<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _to_string(inp: str) -> str: """ Convert a URL or file name to a string """

        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()