<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load(self, path, name=None):
 """Load and compile the given Thrift file. :param str path: Path to the ``.thrift`` file. :param str name: Name of the generated module. Defaults to the base name of the file. :returns: The compiled module. """

        if name is None:
            name = os.path.splitext(os.path.basename(path))[0]
            # TODO do we care if the file extension is .thrift?

        with open(path, 'r') as f:
            document = f.read()

        return self.compiler.compile(name, document, path).link().surface