def getfunction(inputs):
    signature = [ufunc]
    for x in inputs:
        if isinstance(x, ak.layout.Content):
            record = x.parameter('__record__')
            array = x.parameter('__array__')
            if (record is not None):
                signature.append(record)
            elif (array is not None):
                signature.append(array)
            elif isinstance(x, ak.layout.NumpyArray):
                signature.append(ak.nplike.of(x).asarray(x).dtype.type)
            else:
                signature.append(None)
        else:
            signature.append(type(x))
    custom = ak._util.overload(behavior, signature)
    if (custom is not None):
        return (lambda : adjust(custom, inputs, kwargs))
    if (ufunc is numpy.matmul):
        custom_matmul = getfunction_matmul(inputs)
        if (custom_matmul is not None):
            return custom_matmul
    inputs = [deregulate(x) for x in inputs]
    if all(((isinstance(x, ak.layout.NumpyArray) or (not isinstance(x, (ak.layout.Content, ak.partition.PartitionedArray)))) for x in inputs)):
        nplike = ak.nplike.of(*inputs)
        result = getattr(ufunc, method)(*[nplike.asarray(x) for x in inputs], **kwargs)
        return (lambda : (ak.operations.convert.from_numpy(result, highlevel=False),))
    for x in inputs:
        if isinstance(x, ak.layout.Content):
            chained_behavior = ak._util.Behavior(ak.behavior, behavior)
            apply_ufunc = chained_behavior[(numpy.ufunc, x.parameter('__array__'))]
            if (apply_ufunc is not None):
                out = adjust_apply_ufunc(apply_ufunc, ufunc, method, inputs, kwargs)
                if (out is not None):
                    return out
            apply_ufunc = chained_behavior[(numpy.ufunc, x.parameter('__record__'))]
            if (apply_ufunc is not None):
                out = adjust_apply_ufunc(apply_ufunc, ufunc, method, inputs, kwargs)
                if (out is not None):
                    return out
    if all((((x.parameter('__array__') is not None) or (x.parameter('__record__') is not None)) for x in inputs if isinstance(x, ak.layout.Content))):
        custom_types = []
        for x in inputs:
            if isinstance(x, ak.layout.Content):
                if (x.parameter('__array__') is not None):
                    custom_types.append(x.parameter('__array__'))
                elif (x.parameter('__record__') is not None):
                    custom_types.append(x.parameter('__record__'))
                else:
                    custom_types.append(type(x).__name__)
            else:
                custom_types.append(type(x).__name__)
        raise ValueError(('no overloads for custom types: {0}({1})'.format(ufunc.__name__, ', '.join(custom_types)) + ak._util.exception_suffix(__file__)))
    return None
def getfunction(inputs):
    signature = [ufunc]
    for x in inputs:
        if isinstance(x, ak.layout.Content):
            record = x.parameter('__record__')
            array = x.parameter('__array__')
            if (record is not None):
                signature.append(record)
            elif (array is not None):
                signature.append(array)
            elif isinstance(x, ak.layout.NumpyArray):
                signature.append(ak.nplike.of(x).asarray(x).dtype.type)
            else:
                signature.append(None)
        else:
            signature.append(type(x))
    custom = ak._util.overload(behavior, signature)
    if (custom is not None):
        return (lambda : adjust(custom, inputs, kwargs))
    if (ufunc is numpy.matmul):
        custom_matmul = getfunction_matmul(inputs)
        if (custom_matmul is not None):
            return custom_matmul
    inputs = [deregulate(x) for x in inputs]
    if all(((isinstance(x, ak.layout.NumpyArray) or (not isinstance(x, (ak.layout.Content, ak.partition.PartitionedArray)))) for x in inputs)):
        nplike = ak.nplike.of(*inputs)
        result = getattr(ufunc, method)(*[nplike.asarray(x) for x in inputs], **kwargs)
        return (lambda : (ak.operations.convert.from_numpy(result, highlevel=False),))
    for x in inputs:
        if isinstance(x, ak.layout.Content):
            chained_behavior = ak._util.Behavior(ak.behavior, behavior)
            apply_ufunc = chained_behavior[(numpy.ufunc, x.parameter('__array__'))]
            if (apply_ufunc is not None):
                out = adjust_apply_ufunc(apply_ufunc, ufunc, method, inputs, kwargs)
                if (out is not None):
                    return out
            apply_ufunc = chained_behavior[(numpy.ufunc, x.parameter('__record__'))]
            if (apply_ufunc is not None):
                out = adjust_apply_ufunc(apply_ufunc, ufunc, method, inputs, kwargs)
                if (out is not None):
                    return out
    if all((((x.parameter('__array__') is not None) or (x.parameter('__record__') is not None)) for x in inputs if isinstance(x, ak.layout.Content))):
        custom_types = []
        for x in inputs:
            if isinstance(x, ak.layout.Content):
                if (x.parameter('__array__') is not None):
                    custom_types.append(x.parameter('__array__'))
                elif (x.parameter('__record__') is not None):
                    custom_types.append(x.parameter('__record__'))
                else:
                    custom_types.append(type(x).__name__)
            else:
                custom_types.append(type(x).__name__)
        raise ValueError(('no overloads for custom types: {0}({1})'.format(ufunc.__name__, ', '.join(custom_types)) + ak._util.exception_suffix(__file__)))
    return None