code: def get_typing_type(plotly_type, array_ok=False):
      """
      Get Python type corresponding to a valType string from the plotly schema
  
      Parameters
      ----------
      plotly_type : str
          a plotly datatype string
      array_ok : bool
          Whether lists/arrays are permitted
      Returns
      -------
      str
          Python type string
      """
      if plotly_type == "data_array":
          pytype = "numpy.ndarray"
      elif plotly_type == "info_array":
          pytype = "list"
      elif plotly_type == "colorlist":
          pytype = "list"
      elif plotly_type in (
          "string",
          "color",
          "colorscale",
          "subplotid",
      ):
          pytype = "str"
      elif plotly_type in ("enumerated", "flaglist", "any"):
          pytype = "Any"
      elif plotly_type in ("number", "angle"):
          pytype = "int|float"
      elif plotly_type == "integer":
          pytype = "int"
      elif plotly_type == "boolean":
          pytype = "bool"
      else:
          raise ValueError("Unknown plotly type: %s" % plotly_type)
  
      if array_ok:
          return f"{pytype}|numpy.ndarray"
      else:
          return pytype
  
file_path: plotly.py/packages/python/plotly/codegen/datatypes.py
imports: import os.path
  import textwrap
  from io import StringIO
  from codegen.utils import PlotlyNode, write_source_py
label_desc: Use image node_id 1 for calling a global function with example usage: get_typing_type(plotly_type, array_ok) and returns: pytype, str, pytype