def get_sample_value(self, name, labels=None):
if labels is None:<EOL><INDENT>labels = {}<EOL><DEDENT>for metric in self.collect():<EOL><INDENT>for s in metric.samples:<EOL><INDENT>if s.name == name and s.labels == labels:<EOL><INDENT>return s.value<EOL><DEDENT><DEDENT><DEDENT>return None<EOL>
Returns the sample value, or None if not found.

        This is inefficient, and intended only for use in unittests.