code: def refactored_function(
      message: str, category=FutureWarning
  ) -> Callable:
      """Used as a decorator when refactoring functions.
  
      Implementation is inspired from [`Hacker Noon`][hacker_link].
  
      [hacker_link]: https://hackernoon.com/why-refactoring-how-to-restructure-python-package-51b89aa91987
  
      Examples:
          ```python
          @refactored_function(
              message="simple_sum() has been refactored. Use hard_sum() instead."
          )
          def simple_sum(alpha, beta):
              return alpha + beta
          ```
  
      Args:
          message: Message to use in warning user about refactoring.
          category: Type of Warning. Default is `FutureWarning`.
  
      Returns:
          Your original function wrapped with the kwarg redirection function.
      """  # noqa: E501
  
      def decorator(func):
          @wraps(func)
          def emit_warning(*args, **kwargs):
              warn(message, category, stacklevel=find_stack_level())
              return func(*args, **kwargs)
  
          return emit_warning
  
      return decorator
  
imports: from __future__ import annotations
  import importlib
  import os
  import socket
  import sys
  from functools import singledispatch, wraps
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Union
  from warnings import warn
  import numpy
  import pandas
label_desc: Use image node_id 12 for calling a global function with example usage: refactored_function(message, category) and returns: decorator, emit_warning, func