parameters: (obj)
return_statement: return text
docstring: Try to read from a url, file or string.
  
      Parameters
      ----------
      obj : str, unicode, or file-like
  
      Returns
      -------
      raw_text : str
docstring_summary: Try to read from a url, file or string.
docstring_tokens: Try to read from a url file or string .
function: def _read(obj):
      """
      Try to read from a url, file or string.
  
      Parameters
      ----------
      obj : str, unicode, or file-like
  
      Returns
      -------
      raw_text : str
      """
      if is_url(obj):
          with urlopen(obj) as url:
              text = url.read()
      elif hasattr(obj, "read"):
          text = obj.read()
      elif isinstance(obj, (str, bytes)):
          text = obj
          try:
              if os.path.isfile(text):
                  with open(text, "rb") as f:
                      return f.read()
          except (TypeError, ValueError):
              pass
      else:
          raise TypeError(f"Cannot read object of type '{type(obj).__name__}'")
      return text
function_tokens: def _read ( obj ) : if is_url ( obj ) : with urlopen ( obj ) as url : text = url . read ( ) elif hasattr ( obj , "read" ) : text = obj . read ( ) elif isinstance ( obj , ( str , bytes ) ) : text = obj try : if os . path . isfile ( text ) : with open ( text , "rb" ) as f : return f . read ( ) except ( TypeError , ValueError ) : pass else : raise TypeError ( f"Cannot read object of type '{type(obj).__name__}'" ) return text