'Turn a metric into a well-formed metric name
prefix.b.c
:param metric The metric name to normalize
:param prefix A prefix to to add to the normalized name, default None
:param fix_case A boolean, indicating whether to make sure that
the metric name returned is in underscore_case'

def normalize(self, metric, prefix=None, fix_case=False):

    if isinstance(metric, unicode):
        metric_name = unicodedata.normalize('NFKD', metric).encode('ascii', 'ignore')
    else:
        metric_name = metric
    if fix_case:
        name = self.convert_to_underscore_separated(metric_name)
        if (prefix is not None):
            prefix = self.convert_to_underscore_separated(prefix)
    else:
        name = re.sub('[,\\+\\*\\-/()\\[\\]{}\\s]', '_', metric_name)
    name = re.sub('__+', '_', name)
    name = re.sub('^_', '', name)
    name = re.sub('_$', '', name)
    name = re.sub('\\._', '.', name)
    name = re.sub('_\\.', '.', name)
    if (prefix is not None):
        return ((prefix + '.') + name)
    else:
        return name
