code: def asmatrix(data, dtype=None):
      if isinstance(data, np.matrix) and (
          dtype is None or data.dtype == dtype
      ):
          return data
      return np.asarray(data, dtype=dtype).view(np.matrix)
  
imports: import sys
  import operator
  import warnings
  import numpy
  from scipy._lib._util import prod
label_desc: Use image node_id 21 for calling a global function with example usage: asmatrix(data, dtype) and returns: np, data