code: def _check_shape_and_ravel(x, field):
      if not isinstance(x, np.ndarray):
          raise ValueError(
              "field {name} must be numpy array type.".format(
                  name=field.name
              )
          )
      if None in field.shape:
          raise ValueError(
              f"All dimensions of a shape: {field.shape} in: {field.name} field must be constant. "
              f"If a dimension is variable, we won't be able to coalesce rows when preparing a batch."
          )
  
      if x.shape != tuple(field.shape):
          raise ValueError(
              "field {name} must be the shape {shape}".format(
                  name=field.name, shape=field.shape
              )
          )
      if not x.flags.c_contiguous:
          raise ValueError(
              "field {name} error: only support row major multi-dimensional array.".format(
                  name=field.name
              )
          )
      return x.ravel()
  
imports: from __future__ import division
  import hashlib
  import operator
  import numpy
  import pandas
  import pyarrow
  from pyarrow import parquet
  from pyarrow.parquet import ParquetFile
  from petastorm.cache import NullCache
  from petastorm.workers_pool import EmptyResultError
  from petastorm.workers_pool.worker_base import WorkerBase
label_desc: Use image node_id 4 for calling the ArrowReaderWorker obj's underlying member method code with example usage: obj._check_shape_and_ravel(x, field) and returns: x