def _fill_with_zeros(partials, rows, zero=None):
assert len(rows) > <NUM_LIT:0><EOL>if not _is_non_string_iterable(partials):<EOL><INDENT>partials = [(partial,) for partial in partials]<EOL><DEDENT>mapping = {}<EOL>for row in rows:<EOL><INDENT>mapping[tuple(row[:-<NUM_LIT:1>])] = row[-<NUM_LIT:1>]<EOL><DEDENT>if zero is None:<EOL><INDENT>array = np.array(tuple(mapping.values()))<EOL>if len(array.shape) == <NUM_LIT:1>:<EOL><INDENT>zero = array.dtype.type()<EOL><DEDENT><DEDENT>return np.array([mapping.get(partial, zero) for partial in partials])<EOL>
Find and return values from rows for all partials. In cases where no
    row matches a partial, zero is assumed as value. For a row, the first
    (n-1) fields are assumed to be the partial, and the last field,
    the value, where n is the total number of fields in each row. It is
    assumed that there is a unique row for each partial.
    partials -- single field values or tuples of field values
    rows -- table rows
    zero -- value used when no rows match a particular partial