parameters: (self, quantity_unit=None)
docstring: Returns the measure object associated to quantity_unit.
        If no quantity_unit is specified, the quantity_unit of the resource is used.
        None is returned if the number of found measures differs from 1.
docstring_summary: Returns the measure object associated to quantity_unit.
        If no quantity_unit is specified, the quantity_unit of the resource is used.
        None is returned if the number of found measures differs from 1.
docstring_tokens: Returns the measure object associated to quantity_unit . If no quantity_unit is specified the quantity_unit of the resource is used . None is returned if the number of found measures differs from 1 .
function: def getDefaultMeasure(self, quantity_unit=None):
        """
        Returns the measure object associated to quantity_unit.
        If no quantity_unit is specified, the quantity_unit of the resource is used.
        None is returned if the number of found measures differs from 1.
        """
        if quantity_unit is None:
          quantity_unit = self.getQuantityUnit()
        if quantity_unit:
          top = lambda relative_url: relative_url.split('/', 1)[0]
  
          quantity = top(quantity_unit)
          generic = []
          default = []
          for measure in self.getMeasureList():
            metric_type = measure.getMetricType()
            if metric_type and quantity == top(metric_type) and \
               measure.getDefaultMetricType():
              default.append(measure)
            if quantity == metric_type:
              generic.append(measure)
          result = default or generic
          if len(result) == 1:
            return result[0]
function_tokens: def getDefaultMeasure ( self , quantity_unit = None ) : if quantity_unit is None : quantity_unit = self . getQuantityUnit ( ) if quantity_unit : top = lambda relative_url : relative_url . split ( '/' , 1 ) [ 0 ] quantity = top ( quantity_unit ) generic = [ ] default = [ ] for measure in self . getMeasureList ( ) : metric_type = measure . getMetricType ( ) if metric_type and quantity == top ( metric_type ) and measure . getDefaultMetricType ( ) : default . append ( measure ) if quantity == metric_type : generic . append ( measure ) result = default or generic if len ( result ) == 1 : return result [ 0 ]