# Buggy code
def _build_components(**kwargs):
    def _make(field_name, value):
        if field_name not in IndexRecord.__fields__:
            raise CondaValueError("Cannot match on field %s" % (field_name,))
        elif isinstance(value, string_types):
            value = text_type(value)

        if hasattr(value, "match"):
            matcher = value
        elif field_name in _implementors:
            matcher = _implementors[field_name](value)
        elif text_type(value):
            matcher = StrMatch(value)
        else:
            raise NotImplementedError()

        return field_name, matcher

    return frozendict(_make(key, value) for key, value in iteritems(kwargs))


# Traceback (NotImplementedError)
Traceback (most recent call last):
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/exceptions.py\", line 683, in __call__
return func(*args, **kwargs)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main.py\", line 78, in _main
exit_code = do_call(args, p)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py\", line 75, in do_call
exit_code = getattr(module, func_name)(args, parser)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 150, in execute
show_channel_urls=context.show_channel_urls)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 90, in print_packages
show_channel_urls=show_channel_urls)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/cli/main_list.py\", line 52, in list_packages
info = is_linked(prefix, dist)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/core/linked_data.py\", line 166, in is_linked
elif MatchSpec(dist).match(prefix_record):
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 67, in __call__
return super(MatchSpecType, cls).__call__(**parsed)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 178, in __init__
self._match_components = self._build_components(**kwargs)
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 359, in _build_components
return frozendict(_make(key, value) for key, value in iteritems(kwargs))
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 359, in <genexpr>
return frozendict(_make(key, value) for key, value in iteritems(kwargs))
File \"/home/rob/miniconda3/lib/python3.6/site-packages/conda/models/match_spec.py\", line 355, in _make
raise NotImplementedError()
NotImplementedError

# Fixed code
def _build_components(**kwargs):
    def _make(field_name, value):
        if field_name not in IndexRecord.__fields__:
            raise CondaValueError("Cannot match on field %s" % (field_name,))
        elif isinstance(value, string_types):
            value = text_type(value)

        if hasattr(value, "match"):
            matcher = value
        elif field_name in _implementors:
            matcher = _implementors[field_name](value)
        else:
            matcher = StrMatch(text_type(value))

        return field_name, matcher

    return frozendict(_make(key, value) for key, value in iteritems(kwargs))