code: def get_root_path(obj):
      
      try:
          filename = os.path.abspath(obj.__globals__['__file__'])
      except (KeyError, AttributeError):
          if getattr(obj, '__wrapped__', None):
              # decorator package has been used in view
              return get_root_path(obj.__wrapped__)
          filename = inspect.getfile(obj)
      return os.path.dirname(filename)
docs: Get file path for object and returns its dirname