def random_brightness(x, brightness_range):
    "Performs a random brightness shift.\n\n    # Arguments\n        x: Input tensor. Must be 3D.\n        brightness_range: Tuple of floats; brightness range.\n        channel_axis: Index of axis for channels in the input tensor.\n\n    # Returns\n        Numpy image tensor.\n\n    # Raises\n        ValueError if `brightness_range` isn't a tuple.\n\n    "
    if (len(brightness_range) != 2):
        raise ValueError(('`brightness_range should be tuple or list of two floats. Received: %s' % brightness_range))
    x = array_to_img(x)
    x = imgenhancer_Brightness = ImageEnhance.Brightness(x)
    u = np.random.uniform(brightness_range[0], brightness_range[1])
    x = imgenhancer_Brightness.enhance(u)
    x = img_to_array(x)
    return x
Performs a random brightness shift.

# Arguments
    x: Input tensor. Must be 3D.
    brightness_range: Tuple of floats; brightness range.
    channel_axis: Index of axis for channels in the input tensor.

# Returns
    Numpy image tensor.

# Raises
    ValueError if `brightness_range` isn't a tuple.
def random_brightness(x, brightness_range):
    "Performs a random brightness shift.\n\n    # Arguments\n        x: Input tensor. Must be 3D.\n        brightness_range: Tuple of floats; brightness range.\n        channel_axis: Index of axis for channels in the input tensor.\n\n    # Returns\n        Numpy image tensor.\n\n    # Raises\n        ValueError if `brightness_range` isn't a tuple.\n\n    "
    if (len(brightness_range) != 2):
        raise ValueError(('`brightness_range should be tuple or list of two floats. Received: %s' % brightness_range))
    x = array_to_img(x)
    x = imgenhancer_Brightness = ImageEnhance.Brightness(x)
    u = np.random.uniform(brightness_range[0], brightness_range[1])
    x = imgenhancer_Brightness.enhance(u)
    x = img_to_array(x)
    return x