parameters: (args, temp_args)
return_statement: return values, type_codes, num_args
docstring: Pack arguments into c args decord call accept
docstring_summary: Pack arguments into c args decord call accept
docstring_tokens: Pack arguments into c args decord call accept
function: def _make_decord_args(args, temp_args):
      """Pack arguments into c args decord call accept"""
      num_args = len(args)
      values = (DECORDValue * num_args)()
      type_codes = (ctypes.c_int * num_args)()
      for i, arg in enumerate(args):
          if arg is None:
              values[i].v_handle = None
              type_codes[i] = TypeCode.NULL
          elif isinstance(arg, NDArrayBase):
              values[i].v_handle = ctypes.cast(arg.handle, ctypes.c_void_p)
              type_codes[i] = (TypeCode.NDARRAY_CONTAINER
                               if not arg.is_view else TypeCode.ARRAY_HANDLE)
          elif isinstance(arg, _nd._DECORD_COMPATS):
              values[i].v_handle = ctypes.c_void_p(arg._decord_handle)
              type_codes[i] = arg.__class__._decord_tcode
          elif isinstance(arg, Integral):
              values[i].v_int64 = arg
              type_codes[i] = TypeCode.INT
          elif isinstance(arg, Number):
              values[i].v_float64 = arg
              type_codes[i] = TypeCode.FLOAT
          elif isinstance(arg, DECORDType):
              values[i].v_str = c_str(str(arg))
              type_codes[i] = TypeCode.STR
          elif isinstance(arg, DECORDContext):
              values[i].v_ctx = arg
              type_codes[i] = TypeCode.DECORD_CONTEXT
          elif isinstance(arg, bytearray):
              arr = DECORDByteArray()
              arr.data = ctypes.cast(
                  (ctypes.c_byte * len(arg)).from_buffer(arg),
                  ctypes.POINTER(ctypes.c_byte))
              arr.size = len(arg)
              values[i].v_handle = ctypes.c_void_p(ctypes.addressof(arr))
              temp_args.append(arr)
              type_codes[i] = TypeCode.BYTES
          elif isinstance(arg, string_types):
              values[i].v_str = c_str(arg)
              type_codes[i] = TypeCode.STR
          # NOTE(minjie): module is not used in DECORD
          #elif isinstance(arg, _CLASS_MODULE):
          #    values[i].v_handle = arg.handle
          #    type_codes[i] = TypeCode.MODULE_HANDLE
          elif isinstance(arg, FunctionBase):
              values[i].v_handle = arg.handle
              type_codes[i] = TypeCode.FUNC_HANDLE
          elif isinstance(arg, ctypes.c_void_p):
              values[i].v_handle = arg
              type_codes[i] = TypeCode.HANDLE
          elif callable(arg):
              arg = convert_to_decord_func(arg)
              values[i].v_handle = arg.handle
              type_codes[i] = TypeCode.FUNC_HANDLE
              temp_args.append(arg)
          else:
              raise TypeError("Don't know how to handle type %s" % type(arg))
      return values, type_codes, num_args
function_tokens: def _make_decord_args ( args , temp_args ) : num_args = len ( args ) values = ( DECORDValue * num_args ) ( ) type_codes = ( ctypes . c_int * num_args ) ( ) for i , arg in enumerate ( args ) : if arg is None : values [ i ] . v_handle = None type_codes [ i ] = TypeCode . NULL elif isinstance ( arg , NDArrayBase ) : values [ i ] . v_handle = ctypes . cast ( arg . handle , ctypes . c_void_p ) type_codes [ i ] = ( TypeCode . NDARRAY_CONTAINER if not arg . is_view else TypeCode . ARRAY_HANDLE ) elif isinstance ( arg , _nd . _DECORD_COMPATS ) : values [ i ] . v_handle = ctypes . c_void_p ( arg . _decord_handle ) type_codes [ i ] = arg . __class__ . _decord_tcode elif isinstance ( arg , Integral ) : values [ i ] . v_int64 = arg type_codes [ i ] = TypeCode . INT elif isinstance ( arg , Number ) : values [ i ] . v_float64 = arg type_codes [ i ] = TypeCode . FLOAT elif isinstance ( arg , DECORDType ) : values [ i ] . v_str = c_str ( str ( arg ) ) type_codes [ i ] = TypeCode . STR elif isinstance ( arg , DECORDContext ) : values [ i ] . v_ctx = arg type_codes [ i ] = TypeCode . DECORD_CONTEXT elif isinstance ( arg , bytearray ) : arr = DECORDByteArray ( ) arr . data = ctypes . cast ( ( ctypes . c_byte * len ( arg ) ) . from_buffer ( arg ) , ctypes . POINTER ( ctypes . c_byte ) ) arr . size = len ( arg ) values [ i ] . v_handle = ctypes . c_void_p ( ctypes . addressof ( arr ) ) temp_args . append ( arr ) type_codes [ i ] = TypeCode . BYTES elif isinstance ( arg , string_types ) : values [ i ] . v_str = c_str ( arg ) type_codes [ i ] = TypeCode . STR # NOTE(minjie): module is not used in DECORD #elif isinstance(arg, _CLASS_MODULE): #    values[i].v_handle = arg.handle #    type_codes[i] = TypeCode.MODULE_HANDLE elif isinstance ( arg , FunctionBase ) : values [ i ] . v_handle = arg . handle type_codes [ i ] = TypeCode . FUNC_HANDLE elif isinstance ( arg , ctypes . c_void_p ) : values [ i ] . v_handle = arg type_codes [ i ] = TypeCode . HANDLE elif callable ( arg ) : arg = convert_to_decord_func ( arg ) values [ i ] . v_handle = arg . handle type_codes [ i ] = TypeCode . FUNC_HANDLE temp_args . append ( arg ) else : raise TypeError ( "Don't know how to handle type %s" % type ( arg ) ) return values , type_codes , num_args