Module Import alias Import alias ImportFrom alias alias alias alias alias alias Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If NameLoad body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num Return NameLoad decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num UnaryOpNot Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num UnaryOpNot Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad NameLoad orelse Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad For NameStore Call NameLoad NameLoad body If Call NameLoad NameLoad body Assign TupleStore NameStore NameStore NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return Call NameLoad NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If CompareIn NameLoad NameLoad body Delete SubscriptDel NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad NameLoad NameLoad Lambda arguments args NameParam defaults NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assert CompareGt Call NameLoad NameLoad Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Slice Num If NameLoad body Return Call NameLoad NameLoad NameLoad Call NameLoad IfExp CompareIn NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore IfExp CompareIn NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str TryExcept body Return Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad body If NameLoad body Raise Return NameLoad decorator_list
N/A N/A copy N/A operator toolz.compatibility map zip iteritems iterkeys itervalues reduce N/A __all__ N/A merge merge_with valmap keymap itemmap valfilter keyfilter itemfilter assoc dissoc assoc_in update_in get_in _get_factory N/A N/A f kwargs N/A N/A N/A factory N/A N/A kwargs pop factory dict N/A kwargs N/A N/A N/A TypeError N/A N/A {0}() got an unexpected keyword argument '{1}' format N/A f __name__ N/A N/A N/A kwargs popitem N/A 0 N/A factory N/A merge N/A N/A N/A dicts kwargs N/A N/A  Merge a collection of dictionaries

    >>> merge({1: 'one'}, {2: 'two'})
    {1: 'one', 2: 'two'}

    Later dictionaries have precedence

    >>> merge({1: 2, 3: 4}, {3: 3, 4: 4})
    {1: 2, 3: 3, 4: 4}

    See Also:
        merge_with
     N/A N/A N/A N/A len dicts 1 N/A N/A isinstance N/A dicts N/A 0 dict N/A N/A dicts N/A dicts N/A 0 N/A factory N/A _get_factory merge kwargs N/A rv N/A factory N/A d dicts N/A N/A N/A N/A rv update d N/A rv N/A merge_with N/A N/A func N/A dicts kwargs N/A N/A  Merge dictionaries and apply function to combined values

    A key may occur in more than one dict, and all values mapped from the key
    will be passed to the function as a list, such as func([val1, val2, ...]).

    >>> merge_with(sum, {1: 1, 2: 2}, {1: 10, 2: 20})
    {1: 11, 2: 22}

    >>> merge_with(first, {1: 1, 2: 2}, {2: 20, 3: 30})  # doctest: +SKIP
    {1: 1, 2: 2, 3: 30}

    See Also:
        merge
     N/A N/A N/A N/A len dicts 1 N/A N/A isinstance N/A dicts N/A 0 dict N/A N/A dicts N/A dicts N/A 0 N/A factory N/A _get_factory merge_with kwargs N/A result N/A factory N/A d dicts N/A N/A N/A k v N/A iteritems d N/A N/A N/A k result N/A N/A N/A result N/A k N/A v N/A N/A N/A N/A N/A result N/A k append v N/A N/A valmap func result factory N/A valmap N/A N/A func d factory N/A dict N/A N/A  Apply function to values of dictionary

    >>> bills = {"Alice": [20, 15, 30], "Bob": [10, 35]}
    >>> valmap(sum, bills)  # doctest: +SKIP
    {'Alice': 65, 'Bob': 45}

    See Also:
        keymap
        itemmap
     N/A rv N/A factory N/A N/A N/A rv update N/A zip N/A iterkeys d N/A map func N/A itervalues d N/A rv N/A keymap N/A N/A func d factory N/A dict N/A N/A  Apply function to keys of dictionary

    >>> bills = {"Alice": [20, 15, 30], "Bob": [10, 35]}
    >>> keymap(str.lower, bills)  # doctest: +SKIP
    {'alice': [20, 15, 30], 'bob': [10, 35]}

    See Also:
        valmap
        itemmap
     N/A rv N/A factory N/A N/A N/A rv update N/A zip N/A map func N/A iterkeys d N/A itervalues d N/A rv N/A itemmap N/A N/A func d factory N/A dict N/A N/A  Apply function to items of dictionary

    >>> accountids = {"Alice": 10, "Bob": 20}
    >>> itemmap(reversed, accountids)  # doctest: +SKIP
    {10: "Alice", 20: "Bob"}

    See Also:
        keymap
        valmap
     N/A rv N/A factory N/A N/A N/A rv update N/A map func N/A iteritems d N/A rv N/A valfilter N/A N/A predicate d factory N/A dict N/A N/A  Filter items in dictionary by value

    >>> iseven = lambda x: x % 2 == 0
    >>> d = {1: 2, 2: 3, 3: 4, 4: 5}
    >>> valfilter(iseven, d)
    {1: 2, 3: 4}

    See Also:
        keyfilter
        itemfilter
        valmap
     N/A rv N/A factory N/A N/A k v N/A iteritems d N/A N/A N/A predicate v N/A N/A N/A rv N/A k v N/A rv N/A keyfilter N/A N/A predicate d factory N/A dict N/A N/A  Filter items in dictionary by key

    >>> iseven = lambda x: x % 2 == 0
    >>> d = {1: 2, 2: 3, 3: 4, 4: 5}
    >>> keyfilter(iseven, d)
    {2: 3, 4: 5}

    See Also:
        valfilter
        itemfilter
        keymap
     N/A rv N/A factory N/A N/A k v N/A iteritems d N/A N/A N/A predicate k N/A N/A N/A rv N/A k v N/A rv N/A itemfilter N/A N/A predicate d factory N/A dict N/A N/A  Filter items in dictionary by item

    >>> def isvalid(item):
    ...     k, v = item
    ...     return k % 2 == 0 and v < 4

    >>> d = {1: 2, 2: 3, 3: 4, 4: 5}
    >>> itemfilter(isvalid, d)
    {2: 3}

    See Also:
        keyfilter
        valfilter
        itemmap
     N/A rv N/A factory N/A item N/A iteritems d N/A N/A N/A predicate item N/A N/A N/A k v item N/A N/A rv N/A k v N/A rv N/A assoc N/A N/A d key value factory N/A dict N/A N/A 
    Return a new dict with new key value pair

    New dict has d[key] set to value. Does not modify the initial dictionary.

    >>> assoc({'x': 1}, 'x', 2)
    {'x': 2}
    >>> assoc({'x': 1}, 'y', 3)   # doctest: +SKIP
    {'x': 1, 'y': 3}
     N/A d2 N/A factory N/A N/A d2 N/A key value N/A N/A merge d d2 factory factory N/A dissoc N/A N/A d N/A keys N/A N/A 
    Return a new dict with the given key(s) removed.

    New dict has d[key] deleted for each supplied key.
    Does not modify the initial dictionary.

    >>> dissoc({'x': 1, 'y': 2}, 'y')
    {'x': 1}
    >>> dissoc({'x': 1, 'y': 2}, 'y', 'x')
    {}
    >>> dissoc({'x': 1}, 'y') # Ignores missing keys
    {'x': 1}
     N/A d2 N/A N/A copy copy d N/A key keys N/A N/A N/A key d2 N/A N/A N/A d2 N/A key N/A d2 N/A assoc_in N/A N/A d keys value factory N/A dict N/A N/A 
    Return a new dict with new, potentially nested, key value pair

    >>> purchase = {'name': 'Alice',
    ...             'order': {'items': ['Apple', 'Orange'],
    ...                       'costs': [0.50, 1.25]},
    ...             'credit card': '5555-1234-1234-1234'}
    >>> assoc_in(purchase, ['order', 'costs'], [0.25, 1.00]) # doctest: +SKIP
    {'credit card': '5555-1234-1234-1234',
     'name': 'Alice',
     'purchase': {'costs': [0.25, 1.00], 'items': ['Apple', 'Orange']}}
     N/A N/A update_in d keys N/A N/A N/A x N/A value value factory N/A update_in N/A N/A d keys func default factory N/A None dict N/A N/A  Update value in a (potentially) nested dictionary

    inputs:
    d - dictionary on which to operate
    keys - list or tuple giving the location of the value to be changed in d
    func - function to operate on that value

    If keys == [k0,..,kX] and d[k0]..[kX] == v, update_in returns a copy of the
    original dictionary with v replaced by func(v), but does not mutate the
    original dictionary.

    If k0 is not a key in d, update_in creates nested dictionaries to the depth
    specified by the keys, with the innermost value set to func(default).

    >>> inc = lambda x: x + 1
    >>> update_in({'a': 0}, ['a'], inc)
    {'a': 1}

    >>> transaction = {'name': 'Alice',
    ...                'purchase': {'items': ['Apple', 'Orange'],
    ...                             'costs': [0.50, 1.25]},
    ...                'credit card': '5555-1234-1234-1234'}
    >>> update_in(transaction, ['purchase', 'costs'], sum) # doctest: +SKIP
    {'credit card': '5555-1234-1234-1234',
     'name': 'Alice',
     'purchase': {'costs': 1.75, 'items': ['Apple', 'Orange']}}

    >>> # updating a value when k0 is not in d
    >>> update_in({}, [1, 2, 3], str, default="bar")
    {1: {2: {3: 'bar'}}}
    >>> update_in({1: 'foo'}, [2, 3, 4], inc, 0)
    {1: 'foo', 2: {3: {4: 1}}}
     N/A N/A N/A len keys 0 N/A N/A k ks N/A N/A keys N/A 0 N/A keys N/A 1 N/A ks N/A N/A N/A assoc d k N/A update_in N/A N/A k d N/A d N/A k N/A factory ks func default factory factory N/A N/A innermost N/A N/A k d N/A func N/A d N/A k N/A func default N/A N/A assoc d k innermost factory N/A get_in N/A N/A keys coll default no_default N/A None False N/A N/A 
    Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys.

    If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless
    ``no_default`` is specified, then it raises KeyError or IndexError.

    ``get_in`` is a generalization of ``operator.getitem`` for nested data
    structures such as dictionaries and lists.

    >>> transaction = {'name': 'Alice',
    ...                'purchase': {'items': ['Apple', 'Orange'],
    ...                             'costs': [0.50, 1.25]},
    ...                'credit card': '5555-1234-1234-1234'}
    >>> get_in(['purchase', 'items', 0], transaction)
    'Apple'
    >>> get_in(['name'], transaction)
    'Alice'
    >>> get_in(['purchase', 'total'], transaction)
    >>> get_in(['purchase', 'items', 'apple'], transaction)
    >>> get_in(['purchase', 'items', 10], transaction)
    >>> get_in(['purchase', 'total'], transaction, 0)
    0
    >>> get_in(['y'], {}, no_default=True)
    Traceback (most recent call last):
        ...
    KeyError: 'y'

    See Also:
        itertoolz.get
        operator.getitem
     N/A N/A N/A N/A reduce N/A operator getitem keys coll N/A N/A N/A N/A KeyError IndexError TypeError N/A N/A no_default N/A N/A N/A default N/A