def _try_aggregate_string_function(self, arg, *args, **kwargs):
assert isinstance(arg, str)<EOL>f = getattr(self, arg, None)<EOL>if f is not None:<EOL><INDENT>if callable(f):<EOL><INDENT>return f(*args, **kwargs)<EOL><DEDENT>assert len(args) == <NUM_LIT:0><EOL>assert len([kwarg for kwarg in kwargs<EOL>if kwarg not in ['<STR_LIT>', '<STR_LIT>']]) == <NUM_LIT:0><EOL>return f<EOL><DEDENT>f = getattr(np, arg, None)<EOL>if f is not None:<EOL><INDENT>return f(self, *args, **kwargs)<EOL><DEDENT>raise ValueError("<STR_LIT>".format(arg=arg))<EOL>
if arg is a string, then try to operate on it:
- try to find a function (or attribute) on ourselves
- try to find a numpy function
- raise