(f, K)
return dup_strip(h)
Create a ``K[x]`` polynomial from a ``dict``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_from_dict

    >>> dup_from_dict({(0,): ZZ(7), (2,): ZZ(5), (4,): ZZ(1)}, ZZ)
    [1, 0, 5, 0, 7]
    >>> dup_from_dict({}, ZZ)
    []
Create a ``K[x]`` polynomial from a ``dict``.
Create a K [ x ] polynomial from a dict .
def dup_from_dict(f, K):
    """
    Create a ``K[x]`` polynomial from a ``dict``.

    Examples
    ========

    >>> from sympy.polys.domains import ZZ
    >>> from sympy.polys.densebasic import dup_from_dict

    >>> dup_from_dict({(0,): ZZ(7), (2,): ZZ(5), (4,): ZZ(1)}, ZZ)
    [1, 0, 5, 0, 7]
    >>> dup_from_dict({}, ZZ)
    []

    """
    if not f:
        return []

    n, h = max(f.keys()), []

    if type(n) is int:
        for k in xrange(n, -1, -1):
            h.append(f.get(k, K.zero))
    else:
        (n,) = n

        for k in xrange(n, -1, -1):
            h.append(f.get((k,), K.zero))

    return dup_strip(h)
def dup_from_dict ( f , K ) : if not f : return [ ] n , h = max ( f . keys ( ) ) , [ ] if type ( n ) is int : for k in xrange ( n , - 1 , - 1 ) : h . append ( f . get ( k , K . zero ) ) else : ( n , ) = n for k in xrange ( n , - 1 , - 1 ) : h . append ( f . get ( ( k , ) , K . zero ) ) return dup_strip ( h )