code: def numpy_to_idxs(idxs: np.ndarray[Any, Any], size: int) -> pl.Series:
      # Unsigned or signed Numpy array (ordered from fastest to slowest).
      #   - np.uint32 (polars) or np.uint64 (polars_u64_idx) numpy array
      #     indexes.
      #   - Other unsigned numpy array indexes are converted to pl.UInt32
      #     (polars) or pl.UInt64 (polars_u64_idx).
      #   - Signed numpy array indexes are converted pl.UInt32 (polars) or
      #     pl.UInt64 (polars_u64_idx) after negative indexes are converted
      #     to absolute indexes.
      if idxs.ndim != 1:
          raise ValueError("only 1D numpy array is supported as index")
  
      idx_type = get_index_type()
  
      if len(idxs) == 0:
          return pl.Series("", [], dtype=idx_type)
  
      # Numpy array with signed or unsigned integers.
      if idxs.dtype.kind not in ("i", "u"):
          raise NotImplementedError("unsupported idxs datatype")
  
      if idx_type == UInt32:
          if (
              idxs.dtype in {np.int64, np.uint64}
              and idxs.max() >= 2**32
          ):
              raise ValueError(
                  "index positions should be smaller than 2^32"
              )
          if idxs.dtype == np.int64 and idxs.min() < -(2**32):
              raise ValueError(
                  "index positions should be bigger than -2^32 + 1"
              )
  
      if idxs.dtype.kind == "i" and idxs.min() < 0:
          if idx_type == UInt32:
              if idxs.dtype in (np.int8, np.int16):
                  idxs = idxs.astype(np.int32)
          else:
              if idxs.dtype in (np.int8, np.int16, np.int32):
                  idxs = idxs.astype(np.int64)
  
          # Update negative indexes to absolute indexes.
          idxs = np.where(idxs < 0, size + idxs, idxs)
  
      # numpy conversion is much faster
      idxs = (
          idxs.astype(np.uint32)
          if idx_type == UInt32
          else idxs.astype(np.uint64)
      )
  
      return pl.Series("", idxs, dtype=idx_type)
  
imports: from __future__ import annotations
  import contextlib
  import warnings
  from datetime import date, datetime, time, timedelta
  from decimal import Decimal
  from functools import lru_cache, singledispatch
  from itertools import islice, zip_longest
  from operator import itemgetter
  from sys import version_info
  from typing import TYPE_CHECKING, Any, Callable, Generator, Iterable, Iterator, Mapping, MutableMapping, Sequence, get_type_hints
  import polars._reexport
  from polars import functions
  from polars.datatypes import INTEGER_DTYPES, N_INFER_DEFAULT, TEMPORAL_DTYPES, Boolean, Categorical, Date, Datetime, Duration, Enum, List, Null, Object, String, Struct, Time, UInt32, Unknown, dtype_to_py_type, is_polars_dtype, numpy_char_code_to_dtype, py_type_to_dtype
  from polars.datatypes.constructor import numpy_type_to_constructor, numpy_values_and_dtype, polars_type_to_constructor, py_type_to_constructor
  from polars.dependencies import _NUMPY_AVAILABLE, _check_for_numpy, _check_for_pandas, _check_for_pydantic, dataclasses, pydantic
  from polars.dependencies import numpy
  from polars.dependencies import pandas
  from polars.dependencies import pyarrow
  from polars.exceptions import ComputeError, ShapeError, TimeZoneAwareConstructorWarning
  from polars.utils._wrap import wrap_df, wrap_s
  from polars.utils.meta import get_index_type, threadpool_size
  from polars.utils.various import _is_generator, arrlen, find_stacklevel, parse_version, range_to_series
label_desc: Use image node_id 44 for calling a global function with example usage: numpy_to_idxs(idxs, size) and returns: pl, pl