def _check_array_function_arguments(**kwargs):
    'Checks for invalid arguments when an array is passed.\n\n    Helper for functions that work on either AnnData objects or array-likes.\n    '
    invalid_args = [k for (k, v) in kwargs.items() if (v is not None)]
    if (len(invalid_args) > 0):
        raise TypeError(f'Arguments {invalid_args} are only valid if an AnnData object is passed.')
Checks for invalid arguments when an array is passed.

Helper for functions that work on either AnnData objects or array-likes.
def _check_array_function_arguments(**kwargs):
    'Checks for invalid arguments when an array is passed.\n\n    Helper for functions that work on either AnnData objects or array-likes.\n    '
    invalid_args = [k for (k, v) in kwargs.items() if (v is not None)]
    if (len(invalid_args) > 0):
        raise TypeError(f'Arguments {invalid_args} are only valid if an AnnData object is passed.')