code: def get_pypi_url(requirement, version=None, base_url=PYPI_BASE_URL):
      
      if version:
          return '{base}/{req}/{version}/json'.format(base=base_url,
                                                      req=requirement,
                                                      version=version)
      else:
          return '{base}/{req}/json'.format(base=base_url, req=requirement)
docs: Get the PyPI url for a given requirement and optional version number and
      PyPI base URL. The default base url is 'https://pypi.python.org/pypi'