code: def addressbatch(self, data, **kwargs):
          '''
          Send either a CSV file or data to the addressbatch API.
          According to the Census, "there is currently an upper limit of 1000 records per batch file."
          If a file, must have no header and fields id,street,city,state,zip
          If data, should be a list of dicts with the above fields (although ID is optional)
          '''
          # Does data quack like a file handle?
          if hasattr(data, 'read'):
              return self._post_batch(f=data, **kwargs)
  
          # Check if it's a string file
          elif isinstance(data, string_types):
              with open(data, 'rb') as f:
                  return self._post_batch(f=f, **kwargs)
  
          else:
              # Otherwise, assume a list of dicts
              return self._post_batch(data=data, **kwargsf addressbatch(self, data, **kwargs):
          '''
          Send either a CSV file or data to the addressbatch API.
          According to the Census, "there is currently an upper limit of 1000 records per batch file."
          If a file, must have no header and fields id,street,city,state,zip
          If data, should be a list of dicts with the above fields (although ID is optional)
          '''
          # Does data quack like a file handle?
          if hasattr(data, 'read'):
              return self._post_batch(f=data, **kwargs)
  
          # Check if it's a string file
          elif isinstance(data, string_types):
              with open(data, 'rb') as f:
                  return self._post_batch(f=f, **kwargs)
  
          else:
              # Otherwise, assume a list of dicts
              return self._post_batch(data=data, **kwargs)
docs: Send either a CSV file or data to the addressbatch API.
          According to the Census, "there is currently an upper limit of 1000 records per batch file."
          If a file, must have no header and fields id,street,city,state,zip
          If data, should be a list of dicts with the above fields (although ID is optional)