parameters: (func_name, f=None, override=False)
return_statement: return register
docstring: Register global function
  
      Parameters
      ----------
      func_name : str or function
          The function name
  
      f : function, optional
          The function to be registered.
  
      override: boolean optional
          Whether override existing entry.
  
      Returns
      -------
      fregister : function
          Register function if f is not specified.
  
      Examples
      --------
      The following code registers my_packed_func as global function.
      Note that we simply get it back from global function table to invoke
      it from python side. However, we can also invoke the same function
      from C++ backend, or in the compiled DECORD code.
  
      .. code-block:: python
  
        targs = (10, 10.0, "hello")
        @decord.register_func
        def my_packed_func(*args):
            assert(tuple(args) == targs)
            return 10
        # Get it out from global function table
        f = decord.get_global_func("my_packed_func")
        assert isinstance(f, decord.nd.Function)
        y = f(*targs)
        assert y == 10
docstring_summary: Register global function
docstring_tokens: Register global function
function: def register_func(func_name, f=None, override=False):
      """Register global function
  
      Parameters
      ----------
      func_name : str or function
          The function name
  
      f : function, optional
          The function to be registered.
  
      override: boolean optional
          Whether override existing entry.
  
      Returns
      -------
      fregister : function
          Register function if f is not specified.
  
      Examples
      --------
      The following code registers my_packed_func as global function.
      Note that we simply get it back from global function table to invoke
      it from python side. However, we can also invoke the same function
      from C++ backend, or in the compiled DECORD code.
  
      .. code-block:: python
  
        targs = (10, 10.0, "hello")
        @decord.register_func
        def my_packed_func(*args):
            assert(tuple(args) == targs)
            return 10
        # Get it out from global function table
        f = decord.get_global_func("my_packed_func")
        assert isinstance(f, decord.nd.Function)
        y = f(*targs)
        assert y == 10
      """
      if callable(func_name):
          f = func_name
          func_name = f.__name__
  
      if not isinstance(func_name, str):
          raise ValueError("expect string function name")
  
      ioverride = ctypes.c_int(override)
      def register(myf):
          """internal register function"""
          if not isinstance(myf, Function):
              myf = convert_to_decord_func(myf)
          check_call(_LIB.DECORDFuncRegisterGlobal(
              c_str(func_name), myf.handle, ioverride))
          return myf
      if f:
          return register(f)
      return register
function_tokens: def register_func ( func_name , f = None , override = False ) : if callable ( func_name ) : f = func_name func_name = f . __name__ if not isinstance ( func_name , str ) : raise ValueError ( "expect string function name" ) ioverride = ctypes . c_int ( override ) def register ( myf ) : """internal register function""" if not isinstance ( myf , Function ) : myf = convert_to_decord_func ( myf ) check_call ( _LIB . DECORDFuncRegisterGlobal ( c_str ( func_name ) , myf . handle , ioverride ) ) return myf if f : return register ( f ) return register