<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def which(cwd=None):
 # pragma: no cover """Try to find which version control system contains the cwd directory. Returns the VersionControl superclass e.g. Git, if none were found this will raise a NotImplementedError. """

        if cwd is None:
            cwd = os.getcwd()
        for (k, using_vc) in globals().items():
            if k.startswith('using_') and using_vc(cwd=cwd):
                return VersionControl.from_string(k[6:])

        # Not supported (yet)
        raise NotImplementedError("Unknown version control system, "
                                  "or you're not in the project directory.")