'Create a new ProviderIndex.
Optional arguments:
specs
List (or sequence) of specs.  If provided, will call
`update` on this ProviderIndex with each spec in the list.
restrict
"restricts" values to the verbatim input specs; do not
pre-apply package\'s constraints.
TODO: rename this.  It is intended to keep things as broad
as possible without overly restricting results, so it is
not the best name.'

def __init__(self, specs=None, restrict=False):

    if (specs is None):
        specs = []
    self.restrict = restrict
    self.providers = {}
    for spec in specs:
        if (not isinstance(spec, spack.spec.Spec)):
            spec = spack.spec.Spec(spec)
        if spec.virtual:
            continue
        self.update(spec)
