code: def rands_array(
      nchars, size, dtype: NpDtype = "O", replace: bool = True
  ) -> np.ndarray:
      """
      Generate an array of byte strings.
      """
      retval = (
          np.random.choice(
              RANDS_CHARS, size=nchars * np.prod(size), replace=replace
          )
          .view((np.str_, nchars))
          .reshape(size)
      )
      return retval.astype(dtype)
  
imports: import string
  import numpy
  from pandas._typing import NpDtype
label_desc: Use image node_id 1 for calling a global function with example usage: rands_array(nchars, size, dtype, replace) and returns: retval