

def process_pypi_option(option, option_str, option_value, parser, builder):
    if option_str.startswith('--no'):
        setattr(parser.values, option.dest, [])
        builder.clear_indices()
    else:
        indices = getattr(parser.values, option.dest, [])
        pypi = PyPIFetcher()
        if (pypi not in indices):
            indices.append(pypi)
        setattr(parser.values, option.dest, indices)
        builder.add_index(PyPIFetcher.PYPI_BASE)

dataset/ETHPy150Open pantsbuild/pex/pex/bin/pex.py process_pypi_option/original