parameters: (data, encoding)
return_statement: return CustomBytesIO(data, encoding)
docstring: Coerce the data to an object with a ``read`` method.
docstring_summary: Coerce the data to an object with a ``read`` method.
docstring_tokens: Coerce the data to an object with a read method .
function: def readable_data(data, encoding):
      """Coerce the data to an object with a ``read`` method."""
      if hasattr(data, 'read'):
          return data
  
      return CustomBytesIO(data, encoding)
function_tokens: def readable_data ( data , encoding ) : if hasattr ( data , 'read' ) : return data return CustomBytesIO ( data , encoding )