<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clone(cls, repo_location, repo_dir=None, branch_or_tag=None, temp=False):
 """Clone repo at repo_location into repo_dir and checkout branch_or_tag. Defaults into current working directory if repo_dir is not supplied. If 'temp' is True, a temporary directory will be created for you and the repository will be cloned into it. The tempdir is scheduled for deletion (when the process exits) through an exit function registered with the atexit module. If 'temp' is True, repo_dir is ignored. If branch_or_tag is not specified, the HEAD of the primary branch of the cloned repo is checked out. """

        if temp:
            reponame = repo_location.rsplit('/', 1)[-1]
            suffix = '%s.temp_simpl_GitRepo' % '_'.join(
                [str(x) for x in (reponame, branch_or_tag) if x])
            repo_dir = create_tempdir(suffix=suffix, delete=True)
        else:
            repo_dir = repo_dir or os.getcwd()
        git_clone(repo_dir, repo_location, branch_or_tag=branch_or_tag)
        # assuming no errors
        return cls(repo_dir)