<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup(cls, leaderPath):
 """ Returns a resource object representing a resource created from a file or directory at the given path on the leader. This method should be invoked on the worker. The given path does not need to refer to an existing file or directory on the worker, it only identifies the resource within an instance of toil. This method returns None if no resource for the given path exists. :rtype: Resource """

        pathHash = cls._pathHash(leaderPath)
        try:
            path_key = cls.resourceEnvNamePrefix + pathHash
            s = os.environ[path_key]
        except KeyError:
            log.warn("'%s' may exist, but is not yet referenced by the worker (KeyError from os.environ[]).", str(path_key))
            return None
        else:
            self = cls.unpickle(s)
            assert self.pathHash == pathHash
            return self