code: def py_type_to_constructor(
      dtype: type[Any],
  ) -> Callable[..., PySeries]:
      """Get the right PySeries constructor for the given Python dtype."""
      try:
          return _PY_TYPE_TO_CONSTRUCTOR[dtype]
      except KeyError:
          return PySeries.new_object
  
file_path: polars/py-polars/polars/datatypes/constructor.py
imports: from __future__ import annotations
  import functools
  from decimal import Decimal
  from typing import TYPE_CHECKING, Any, Callable, Sequence
  from polars import datatypes
  from polars.dependencies import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: py_type_to_constructor(dtype) and returns: _PY_TYPE_TO_CONSTRUCTOR, PySeries