code: def _validate_layouts(layouts):
      """Checks whether layouts is an instance of expected class.
      Raises ValueError if something is wrong
  
      :param layouts: dict where each key is a str (input/output names) and each value is a list (blob dims)
          None means default layout
      :type layouts: dict(str: list[str]) or None
      """
      if layouts is None:
          return  # Everything is OK, default behavior
      if not isinstance(layouts, dict):
          raise ValueError("layouts must be dict")
      for name, layout in layouts.items():
          if not isinstance(name, str):
              raise ValueError("name must be a str")
          if not isinstance(layout, list):
              raise ValueError("each layout muust be a list")
          rem_dims = {
              "batch_length",
              "batch_width",
              "list_size",
              "height",
              "width",
              "depth",
              "channels",
          }
          for dim in layout:
              if not dim in rem_dims:
                  raise ValueError(
                      "illegal or double dim in layout:" + str(dim)
                  )
              rem_dims.remove(dim)
  
imports: import neoml.PythonWrapper
  import neoml.Dnn
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_layouts(layouts) without return types