<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_vcs_directory(context, directory):
 """Get the pathname of the directory containing the version control metadata files."""

        nested = os.path.join(directory, '.git')
        return nested if context.is_directory(nested) else directory