code: def const(math_engine, shape, data):
      """Creates a blob of the specified shape filled with `data` value."""
      if not isinstance(math_engine, MathEngine):
          raise ValueError(
              "The `math_engine` should be neoml.MathEngine."
          )
  
      np_shape = numpy.array(shape, dtype=numpy.int32, copy=False)
  
      if len(np_shape) > 7:
          raise ValueError(
              "The `shape` should have not more than 7 dimensions."
          )
  
      if numpy.isscalar(data):
          return Blob(
              PythonWrapper.blob_const(
                  math_engine._internal, np_shape, float(data)
              )
          )
  
      np_data = numpy.array(
          data, dtype=numpy.float32, copy=False, order="C"
      )
  
      if len(np_data.shape) > 7:
          raise ValueError(
              "The `shape` should have not more than 7 dimensions."
          )
  
      return Blob(
          PythonWrapper.blob_const(
              math_engine._internal, np_shape, np_data
          )
      )
  
imports: import neoml
  import neoml.PythonWrapper
  from neoml.MathEngine import MathEngine
  from neoml.Blob import Blob
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: const(math_engine, shape, data) and returns: Blob, Blob