code: def numpy_to_contiguous_memoryview(obj):
      """Converts a NumPy array or matrix into a contiguous memoryview object
      that is suitable to be forwarded to the Graph constructor.
  
      This is used internally to allow us to use a NumPy array or matrix
      directly when constructing a Graph.
      """
      # Deferred import to prevent a hard dependency on NumPy
      from numpy import int32, int64, require
      from igraph._igraph import INTEGER_SIZE
  
      if INTEGER_SIZE == 64:
          dtype = int64
      elif INTEGER_SIZE == 32:
          dtype = int32
      else:
          raise TypeError(
              f"size of igraph_integer_t in the C layer ({INTEGER_SIZE} bits) is not supported"
          )
  
      return memoryview(require(obj, dtype=dtype, requirements="AC"))
  
imports: from contextlib import contextmanager
  from collections.abc import MutableMapping
  from itertools import chain
  from warnings import warn
  import os
  import tempfile
label_desc: Use image node_id 4 for calling a global function with example usage: numpy_to_contiguous_memoryview(obj) and returns: memoryview