'Extracts the labels from a string that looks like:
{label_name_1="value 1", label_name_2="value 2"}'

def _extract_labels_from_string(self, labels):

    lbls = {}
    labels = labels.lstrip('{').rstrip('}')
    _lbls = self.lbl_pattern.findall(labels)
    for _lbl in _lbls:
        lbls[_lbl[0]] = _lbl[1]
    return lbls
