code: def find_pip(pip_version=None, python_version=None):
      
      pip_exe = "pip"
  
      try:
          context = create_context(pip_version, python_version)
      except BuildError as e:
          # fall back on system pip. Not ideal but at least it's something
          from rez.backport.shutilwhich import which
  
          pip_exe = which("pip")
  
          if pip_exe:
              print_warning(
                  "pip rez package could not be found; system 'pip' command (%s) "
                  "will be used instead." % pip_exe)
              context = None
          else:
              raise e
  
      return pip_exe, context
docs: Find a pip exe using the given python version.
  
      Returns:
          2-tuple:
              str: pip executable;
              `ResolvedContext`: Context containing pip, or None if we fell back
                  to system pip.