docs: def _serialize_function(obj):
      """
      Still needing this much try-except stuff. We should find a way to get rid of this.
      :param obj:
      :return:
      """
      try:
          obj = inspect.getsource(obj)
      except (TypeError, IOError):
          try:
              obj = marshal.dumps(obj)
          except ValueError:
              if hasattr(obj, '__dict__'):
                  obj = _serialize_dict(obj.__dict__)
      return obj