code: def publish(idx=None):
      
      if idx is None:
          idx = ''
      else:
          idx = '-r ' + idx
      run('python setup.py register {}'.format(idx))
      run('twine upload {} dist/*.whl dist/*.egg dist/*.tar.gz'.format(idx))
docs: Publish packaged distributions to pypi index