10 func.save(func.get_name())
15 func.save(func.get_name())
32 SIGNED_ARRAY = [
"int64[]",
54 UNSIGNED_ARRAY = [
"int64[]",
63 CALLABLE = [
"function",
"builtin_function_or_method",
"builtin_function",
"type"]
68 @
accept(
'duration', [], [[
'Time',
'time'],
'duration'],
'duration', [])
69 @
accept([[
'Time',
'time'],
'duration'],
'duration', [])
70 @
accept(
'duration', [], [[
'Time',
'time'],
'duration'])
71 @
accept([SIGNED, SIGNED_ARRAY], [SIGNED, SIGNED_ARRAY], [])
77 sum_all = sum_all + num
84 @
accept([SIGNED, SIGNED_ARRAY], [SIGNED, SIGNED_ARRAY], [])
90 mult_all = mult_all * num
97 @
accept([
'Time',
'time'], [
'Time',
'time'], [])
98 @
accept([SIGNED, SIGNED_ARRAY], [SIGNED, SIGNED_ARRAY])
105 @
accept([UNSIGNED, UNSIGNED_ARRAY])
113 @
accept([CALLABLE],
"*", [])
115 def CALL(func, *args, **kwargs):
117 def CALL(func, *args, **kwargs):
118 print "calling {0} with {1} and {2}".format(func, args, kwargs)
120 if len(args)>0
and type(args[0]).__name__
in [
"function",
"builtin_function_or_method",
"builtin_function",
"type"]:
121 args =
CALL(args[0], *args[1:], **kwargs)
122 if type(args)
is not tuple:
124 return func(*args, **kwargs)
126 return CALL(func, *args, **kwargs)
130 @
accept([SIGNED, SIGNED_ARRAY], [])
139 sum_all = sum_all + num
143 return sum_all/len(nums)
147 @
accept([SIGNED, SIGNED_ARRAY])
153 @
accept([SIGNED, SIGNED_ARRAY])
def CALL(func, args, kwargs)