def _wildcard_dih(atoms, idxs):
    """
    Given atoms and idxs which define a
    pattern return a tuple consisting of
    a entry from atoms if the pattern is
    an int and else the value in idxs.
    """
    atom_key = []
    for idx in idxs:
        if type(idx) is int:
            atom_key.append(atoms[idx])
        else:
            atom_key.append(idx)

    return tuple(atom_key)