def _call_with_optional_argument(func, arg):
arg_count = func.__code__.co_argcount<EOL>if inspect.ismethod(func):<EOL><INDENT>arg_count -= <NUM_LIT:1><EOL><DEDENT>if arg_count:<EOL><INDENT>func(arg)<EOL><DEDENT>else:<EOL><INDENT>func()<EOL><DEDENT>
Call the given function with the given argument if func accepts one argument, otherwise
    calls func without arguments