

def get_virtualenv_name(options):
    if options.path:
        return os.path.dirname(options.path)
    else:
        ve_name = (options.rest.pop(0) if options.rest else '')
    if (not ve_name):
        raise exceptions.NoVirtualenvName('could not find a virtualenv name in the command line.')
    return ve_name

dataset/ETHPy150Open sashahart/vex/vex/main.py get_virtualenv_name/original