code: def check_input_layers(input_layers, layer_count):
      min_count = 0
      max_count = 0
      if isinstance(layer_count, int):
          if layer_count == 0:
              min_count = 1
              max_count = 9223372036854775807
          else:
              min_count = int(layer_count)
              max_count = int(layer_count)
      else:
          min_count = int(layer_count[0])
          max_count = int(layer_count[1])
  
      layers = []
      outputs = []
  
      # helper functions to detect if an object is a link to another layer and add this link
      _is_link = lambda link: isinstance(link, Layer) or (
          len(link) == 2
          and isinstance(link[0], Layer)
          and isinstance(link[1], int)
      )
  
      def _add_link(link):
          internal_layer, index = (
              (link._internal, 0)
              if isinstance(link, Layer)
              else (link[0]._internal, int(link[1]))
          )
          if index < 0:
              raise ValueError(
                  "The indices in the `input_layers` must be non-negative"
              )
          layers.append(internal_layer)
          outputs.append(index)
  
      if _is_link(input_layers):
          _add_link(input_layers)
      else:
          if len(input_layers) == 0:
              raise ValueError(
                  "The `input_layers` must contain at least one layer."
              )
          for input_layer in input_layers:
              if not _is_link(input_layer):
                  raise ValueEror(
                      "Each entry of `input_layers` must be Layer or tuple(Layer, int)"
                  )
              _add_link(input_layer)
  
      if len(layers) < min_count or len(layers) > max_count:
          raise ValueError(
              "The layer has ("
              + str(min_count)
              + ", "
              + str(max_count)
              + ") inputs."
          )
      return layers, outputs
  
file_path: neoml/NeoML/Python/neoml/Utils.py
imports: import numpy
  from scipy.sparse import csr_matrix, issparse
  from neoml.Dnn.Dnn import Layer
label_desc: Use image node_id 1 for calling a global function with example usage: check_input_layers(input_layers, layer_count) and returns: layers,  outputs