code: def parse_labels(result):
      '''fix up the labels, meaning parse to json if needed, and return
         original updated object
  
         Parameters
         ==========
         result: the json object to parse from inspect
      '''
  
      if "data" in result:
          labels = result['data']['attributes'].get('labels') or {}
  
      elif 'attributes' in result:
          labels = result['attributes'].get('labels') or {}
  
      # If labels included, try parsing to json
  
      try:
          labels = jsonp.loads(labels)
      except:
          pass
  
      if "data" in result:
          result['data']['attributes']['labels'] = labels
      else:
          result['attributes']['labels'] = labels
  
      return resulf parse_labels(result):
      '''fix up the labels, meaning parse to json if needed, and return
         original updated object
  
         Parameters
         ==========
         result: the json object to parse from inspect
      '''
  
      if "data" in result:
          labels = result['data']['attributes'].get('labels') or {}
  
      elif 'attributes' in result:
          labels = result['attributes'].get('labels') or {}
  
      # If labels included, try parsing to json
  
      try:
          labels = jsonp.loads(labels)
      except:
          pass
  
      if "data" in result:
          result['data']['attributes']['labels'] = labels
      else:
          result['attributes']['labels'] = labels
  
      return result
docs: fix up the labels, meaning parse to json if needed, and return
         original updated object
  
         Parameters
         ==========
         result: the json object to parse from inspect