(metric_name)
return (
        metric_name,
        dict(dim_pair.split("=") for dim_pair in dims.split(",") if dim_pair),
    )
Parse out existing dimensions from the metric name
Parse out existing dimensions from the metric name
Parse out existing dimensions from the metric name
def _parse_dimensions(metric_name):
    """ Parse out existing dimensions from the metric name """
    try:
        metric_name, dims = metric_name.split("|", 1)
    except ValueError:
        dims = ""

    return (
        metric_name,
        dict(dim_pair.split("=") for dim_pair in dims.split(",") if dim_pair),
    )
def _parse_dimensions ( metric_name ) : try : metric_name , dims = metric_name . split ( "|" , 1 ) except ValueError : dims = "" return ( metric_name , dict ( dim_pair . split ( "=" ) for dim_pair in dims . split ( "," ) if dim_pair ) , )