<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def git_clone(target_dir, repo_location, branch_or_tag=None, verbose=True):
 """Clone repo at repo_location to target_dir and checkout branch_or_tag. If branch_or_tag is not specified, the HEAD of the primary branch of the cloned repo is checked out. """

    target_dir = pipes.quote(target_dir)
    command = ['git', 'clone']
    if verbose:
        command.append('--verbose')
    if os.path.isdir(repo_location):
        command.append('--no-hardlinks')
    command.extend([pipes.quote(repo_location), target_dir])
    if branch_or_tag:
        command.extend(['--branch', branch_or_tag])
    return execute_git_command(command)