<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_file(cls, f, origin=MISSING, relpath=MISSING, **kwargs):
 """Read Sass source from a file or file-like object. If `origin` or `relpath` are missing, they are derived from the file's ``.name`` attribute as with `from_path`. If it doesn't have one, the origin becomes None and the relpath becomes the file's repr. """

        contents = f.read()
        encoding = determine_encoding(contents)
        if isinstance(contents, six.binary_type):
            contents = contents.decode(encoding)

        if origin is MISSING or relpath is MISSING:
            filename = getattr(f, 'name', None)
            if filename is None:
                origin = None
                relpath = repr(f)
            else:
                origin, relpath = cls._key_from_path(Path(filename), origin)

        return cls(origin, relpath, contents, encoding=encoding, **kwargs)