def labels(self, *labelvalues, **labelkwargs):
if not self._labelnames:<EOL><INDENT>raise ValueError('<STR_LIT>' % self)<EOL><DEDENT>if self._labelvalues:<EOL><INDENT>raise ValueError('<STR_LIT>' % (<EOL>self,<EOL>dict(zip(self._labelnames, self._labelvalues))<EOL>))<EOL><DEDENT>if labelvalues and labelkwargs:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if labelkwargs:<EOL><INDENT>if sorted(labelkwargs) != sorted(self._labelnames):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>labelvalues = tuple(unicode(labelkwargs[l]) for l in self._labelnames)<EOL><DEDENT>else:<EOL><INDENT>if len(labelvalues) != len(self._labelnames):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>labelvalues = tuple(unicode(l) for l in labelvalues)<EOL><DEDENT>with self._lock:<EOL><INDENT>if labelvalues not in self._metrics:<EOL><INDENT>self._metrics[labelvalues] = self.__class__(<EOL>self._name,<EOL>documentation=self._documentation,<EOL>labelnames=self._labelnames,<EOL>unit=self._unit,<EOL>labelvalues=labelvalues,<EOL>**self._kwargs<EOL>)<EOL><DEDENT>return self._metrics[labelvalues]<EOL><DEDENT>
Return the child for the given labelset.

        All metrics can have labels, allowing grouping of related time series.
        Taking a counter as an example:

            from prometheus_client import Counter

            c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
            c.labels('get', '/').inc()
            c.labels('post', '/submit').inc()

        Labels can also be provided as keyword arguments:

            from prometheus_client import Counter

            c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
            c.labels(method='get', endpoint='/').inc()
            c.labels(method='post', endpoint='/submit').inc()

        See the best practices on [naming](http://prometheus.io/docs/practices/naming/)
        and [labels](http://prometheus.io/docs/practices/instrumentation/#use-labels).