code: def _to_string(inp: str) -> str:
          
          if '://' in inp:
              req = requests.get(inp)
              if not req.ok:
                  raise ValueError(f"Unable to read {inp}")
              return req.text
          else:
              with open(inp) as infile:
                  return infile.read()
docs: Convert a URL or file name to a string