code: def deprecated(text="", eos="", max_num_warnings=None):
      """
      Args:
          text, eos, max_num_warnings: same as :func:`log_deprecated`.
  
      Returns:
          a decorator which deprecates the function.
  
      Example:
          .. code-block:: python
  
              @deprecated("Explanation of what to do instead.", "2017-11-4")
              def foo(...):
                  pass
      """
  
      def get_location():
          import inspect
  
          frame = inspect.currentframe()
          if frame:
              callstack = inspect.getouterframes(frame)[-1]
              return "%s:%i" % (callstack[1], callstack[2])
          else:
              stack = inspect.stack(0)
              entry = stack[2]
              return "%s:%i" % (entry[1], entry[2])
  
      def deprecated_inner(func):
          @functools.wraps(func)
          def new_func(*args, **kwargs):
              name = "{} [{}]".format(func.__name__, get_location())
              log_deprecated(
                  name, text, eos, max_num_warnings=max_num_warnings
              )
              return func(*args, **kwargs)
  
          return new_func
  
      return deprecated_inner
  
file_path: tensorpack/tensorpack/utils/develop.py
imports: import functools
  import importlib
  import os
  import types
  from collections import defaultdict
  from datetime import datetime
  import six
  from .None import logger
label_desc: Use image node_id 5 for calling a global function with example usage: deprecated(text, eos, max_num_warnings) and returns: deprecated_inner, new_func, unknown, unknown, func