def search_fields_to_dict(fields):
    '\n    In ``SearchableQuerySet`` and ``SearchableManager``, search fields\n    can either be a sequence, or a dict of fields mapped to weights.\n    This function converts sequences to a dict mapped to even weights,\n    so that we\'re consistently dealing with a dict of fields mapped to\n    weights, eg: ("title", "content") -> {"title": 1, "content": 1}\n    '
    if (not fields):
        return {}
    try:
        int(list(dict(fields).values())[0])
    except (TypeError, ValueError):
        fields = dict(zip(fields, ([1] * len(fields))))
    return fields
In ``SearchableQuerySet`` and ``SearchableManager``, search fields
can either be a sequence, or a dict of fields mapped to weights.
This function converts sequences to a dict mapped to even weights,
so that we're consistently dealing with a dict of fields mapped to
weights, eg: ("title", "content") -> {"title": 1, "content": 1}
def search_fields_to_dict(fields):
    '\n    In ``SearchableQuerySet`` and ``SearchableManager``, search fields\n    can either be a sequence, or a dict of fields mapped to weights.\n    This function converts sequences to a dict mapped to even weights,\n    so that we\'re consistently dealing with a dict of fields mapped to\n    weights, eg: ("title", "content") -> {"title": 1, "content": 1}\n    '
    if (not fields):
        return {}
    try:
        int(list(dict(fields).values())[0])
    except (TypeError, ValueError):
        fields = dict(zip(fields, ([1] * len(fields))))
    return fields