def readfile(source):
    """Read data from a file, return data as a string. Target may
    be a path name string or a file-like object (with a `read` method)."""
    if isinstance(source, str):
        return open(source, 'rb').read()
    else:
        return source.read()
