def patch_random_choice(x, element):
    """Dummy function for ``np.random.choice`` to make output deterministic. This dummy function
    just returns the element of ``x`` specified by ``element``."""
    if isinstance(x, int):  # np.random.choice can accept an int or 1D array-like input
        return element

    return x[element]