<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pip_command(self, command, *args):
 """ Runs a pip command """

        try:
            from pip._internal import main as pip_main
        except ImportError:
            from pip import main as pip_main

        args = [command] + list(args)
        if self.verbosity == 0:
            args.insert(0, '--quiet')
        elif self.verbosity == 2:
            args.insert(0, '--verbose')
        return pip_main(args)