code: def skill(*args: Union[str, Callable]) -> Callable:
      """Decorator to create a skill out of functions
      Can be used without arguments. The function must have a docstring.
  
      Args:
          *args: The arguments to the skill
  
      Examples:
          .. code-block:: python
  
              @skill
              def compute_flight_prices(offers: pd.Dataframe) -> List[float]:
                  \"\"\"Computes the flight prices\"\"\"
                  return
  
              @skill("custom_name")
              def compute_flight_prices(offers: pd.Dataframe) -> List[float]:
                  \"\"\"Computes the flight prices\"\"\"
                  return
      """
  
      def _make_skill_with_name(skill_name: str) -> Callable:
          def _make_skill(skill_fn: Callable) -> Skill:
              return Skill(
                  name=skill_name,  # func.__name__ if None
                  # when this decorator is used, the function MUST have a docstring
                  description=skill_fn.__doc__,
                  func=skill_fn,
              )
  
          return _make_skill
  
      if len(args) == 1 and isinstance(args[0], str):
          # Example: @skill("skillName")
          return _make_skill_with_name(args[0])
      elif len(args) == 1 and callable(args[0]):
          # Example: @skill
          return _make_skill_with_name(args[0].__name__)(args[0])
      elif len(args) == 0:
          # Covers the case in which a function is decorated with "@skill()"
          # with the intended behavior of "@skill"
          def _func_wrapper(fn: Callable) -> Skill:
              return _make_skill_with_name(fn.__name__)(fn)
  
          return _func_wrapper
      else:
          raise ValueError(
              f"Too many arguments for skill decorator. Received: {len(args)}"
          )
  
file_path: pandas-ai/pandasai/skills/__init__.py
imports: from pydantic import BaseModel, PrivateAttr
  from typing import Callable, Any, Optional, Union
  import inspect
label_desc: Use image node_id 1 for calling a global function with example usage: skill() and returns: _make_skill, _make_skill_with_name, Skill, _make_skill_with_name, _func_wrapper, _make_skill_with_name