code: def series_cons(
      engine: Engine,
      arr: List,
      dtype="int32",
      npartitions=None,
      chunksize=None,
  ):
      if engine == Engine.PANDAS:
          return pd.Series(arr, dtype=dtype)
  
      if engine == Engine.DASK:
          import dask.dataframe
  
          return dask.dataframe.from_pandas(
              pd.Series(arr, dtype=dtype),
              npartitions=npartitions,
              chunksize=chunksize,
          ).astype(dtype)
  
      if engine == Engine.CUDF:
          import cudf
  
          return cudf.Series(arr, dtype=dtype)
  
      if engine == Engine.DASK_CUDF:
          import cudf, dask_cudf
  
          gs = cudf.Series(arr, dtype=dtype)
          out = dask_cudf.from_cudf(
              gs, npartitions=npartitions, chunksize=chunksize
          )
          out2 = out.astype(dtype)
          logger.debug(
              "series_cons :: %s => %s => %s",
              gs.dtype,
              out.dtype,
              out2.dtype,
          )
          return out2
      raise NotImplementedError("Unknown engine")
  
imports: from typing import TYPE_CHECKING, Any, Dict, List, Optional
  from .Engine import Engine, DataframeLike, DataframeLocalLike
  import numpy, pandas, pyarrow, sys
  from .util import setup_logger
label_desc: Use image node_id 10 for calling a global function with example usage: series_cons(engine, arr, dtype, npartitions, chunksize) and returns: pd, dask, cudf, out2