code: def flatten(array):
      """
      Uses list comprehension to flatten array
  
      :param (array): An iterable to flatten
      :raises (PlotlyError): If iterable is not nested.
      :rtype (list): The flattened list.
      """
      try:
          return [item for sublist in array for item in sublist]
      except TypeError:
          raise exceptions.PlotlyError(
              "Your data array could not be "
              "flattened! Make sure your data is "
              "entered as lists or ndarrays!"
          )
  
file_path: plotly.py/packages/python/plotly/plotly/figure_factory/utils.py
imports: from collections.abc import Sequence
  from plotly import exceptions
  from plotly.colors import DEFAULT_PLOTLY_COLORS, PLOTLY_SCALES, color_parser, colorscale_to_colors, colorscale_to_scale, convert_to_RGB_255, find_intermediate_color, hex_to_rgb, label_rgb, n_colors, unconvert_from_RGB_255, unlabel_rgb, validate_colors, validate_colors_dict, validate_colorscale, validate_scale_values
label_desc: Use image node_id 6 for calling a global function with example usage: flatten(array) and returns: unknown