def dzip(items1, items2, cls=dict):
try:<EOL><INDENT>len(items1)<EOL><DEDENT>except TypeError:<EOL><INDENT>items1 = list(items1)<EOL><DEDENT>try:<EOL><INDENT>len(items2)<EOL><DEDENT>except TypeError:<EOL><INDENT>items2 = list(items2)<EOL><DEDENT>if len(items1) == <NUM_LIT:0> and len(items2) == <NUM_LIT:1>:<EOL><INDENT>items2 = []<EOL><DEDENT>if len(items2) == <NUM_LIT:1> and len(items1) > <NUM_LIT:1>:<EOL><INDENT>items2 = items2 * len(items1)<EOL><DEDENT>if len(items1) != len(items2):<EOL><INDENT>raise ValueError('<STR_LIT>' % (<EOL>len(items1), len(items2)))<EOL><DEDENT>return cls(zip(items1, items2))<EOL>
Zips elementwise pairs between items1 and items2 into a dictionary. Values
from items2 can be broadcast onto items1.

Args:
    items1 (Iterable): full sequence
    items2 (Iterable): can either be a sequence of one item or a sequence
        of equal length to `items1`
    cls (Type[dict]): dictionary type to use. Defaults to dict, but could
        be ordered dict instead.

Returns:
    dict: similar to dict(zip(items1, items2))

Example:
    >>> assert dzip([1, 2, 3], [4]) == {1: 4, 2: 4, 3: 4}
    >>> assert dzip([1, 2, 3], [4, 4, 4]) == {1: 4, 2: 4, 3: 4}
    >>> assert dzip([], [4]) == {}