docs: def _convert_entity_to_json(source):
      ''' Converts an entity object to json to send.
      The entity format is:
      {
         "Address":"Mountain View",
         "Age":23,
         "AmountDue":200.23,
         "CustomerCode@odata.type":"Edm.Guid",
         "CustomerCode":"c9da6455-213d-42c9-9a79-3e9149a57833",
         "CustomerSince@odata.type":"Edm.DateTime",
         "CustomerSince":"2008-07-10T00:00:00",
         "IsActive":true,
         "NumberOfOrders@odata.type":"Edm.Int64",
         "NumberOfOrders":"255",
         "PartitionKey":"mypartitionkey",
         "RowKey":"myrowkey"
      }
      '''
  
      properties = {}
  
      # set properties type for types we know if value has no type info.
      # if value has type info, then set the type to value.type
      for name, value in source.items():
          mtype = ''
  
          if isinstance(value, EntityProperty):
              conv = _EDM_TO_ENTITY_CONVERSIONS.get(value.type)
              if conv is None:
                  raise TypeError(
                      _ERROR_TYPE_NOT_SUPPORTED.format(value.type))
              mtype, value = conv(value.value)
          else:
              conv = _PYTHON_TO_ENTITY_CONVERSIONS.get(type(value))
              if conv is None and sys.version_info >= (3,) and value is None:
                  conv = _to_entity_none
              if conv is None:
                  raise TypeError(
                      _ERROR_CANNOT_SERIALIZE_VALUE_TO_ENTITY.format(
                          type(value).__name__))
              mtype, value = conv(value)
  
          # form the property node
          properties[name] = value
          if mtype:
              properties[name + '@odata.type'] = mtype
  
      # generate the entity_body
      return dumps(properties)