import itertools


def gen_permutations(names, items, hack=False):
    """Takes a list of string names and a list of string items. Returns
    len(name) sized permutations of items.
    """
    if (not hack):
        p = itertools.permutations(items, len(names))
    else:
        p = itertools.permutations(names, len(items))
    return p