code: def get_partition(url, headers, source_id, container, partition):
      
      accepted_formats = list(serializer.format_registry.keys())
      accepted_compression = list(serializer.compression_registry.keys())
      payload = dict(action='read',
                     source_id=source_id,
                     accepted_formats=accepted_formats,
                     accepted_compression=accepted_compression)
  
      if partition is not None:
          payload['partition'] = partition
  
      try:
          resp = requests.post(urljoin(url, '/v1/source'),
                               data=msgpack.packb(payload, use_bin_type=True),
                               **headers)
          if resp.status_code != 200:
              raise Exception('Error reading data')
  
          msg = msgpack.unpackb(resp.content, **unpack_kwargs)
          format = msg['format']
          compression = msg['compression']
          compressor = serializer.compression_registry[compression]
          encoder = serializer.format_registry[format]
          chunk = encoder.decode(compressor.decompress(msg['data']),
                                 container)
          return chunk
      finally:
          if resp is not None:
              resp.close()
docs: Serializable function for fetching a data source partition
  
      Parameters
      ----------
      url: str
          Server address
      headers: dict
          HTTP header parameters
      source_id: str
          ID of the source in the server's cache (unique per user)
      container: str
          Type of data, like "dataframe" one of ``intake.container.container_map``
      partition: serializable
          Part of data to fetch, e.g., an integer for a dataframe.