code: def _setup_metric_group_definitions(self):
          
          # Dictionary of MetricGroupDefinition objects, by metric group name
          metric_group_definitions = dict()
          for mg_info in self.properties['metric-group-infos']:
              mg_name = mg_info['group-name']
              mg_def = MetricGroupDefinition(
                  name=mg_name,
                  resource_class=_resource_class_from_group(mg_name),
                  metric_definitions=dict())
              for i, m_info in enumerate(mg_info['metric-infos']):
                  m_name = m_info['metric-name']
                  m_def = MetricDefinition(
                      index=i,
                      name=m_name,
                      type=_metric_type(m_info['metric-type']),
                      unit=_metric_unit_from_name(m_name))
                  mg_def.metric_definitions[m_name] = m_def
              metric_group_definitions[mg_name] = mg_def
          return metric_group_definitions
docs: Return the dict of MetricGroupDefinition objects for this metrics
          context, by processing its 'metric-group-infos' property.