def _generate_create_callable(name, display_name, arguments, regex, doc, supported, post_arguments, is_action):
def f(self, *args, **kwargs):<EOL><INDENT>for key, value in list(args[-<NUM_LIT:1>].items()):<EOL><INDENT>if type(value) == file:<EOL><INDENT>return self._put_or_post_multipart('<STR_LIT:POST>', self._generate_url(regex, args[:-<NUM_LIT:1>]), args[-<NUM_LIT:1>])<EOL><DEDENT><DEDENT>return self._put_or_post_json('<STR_LIT:POST>', self._generate_url(regex, args[:-<NUM_LIT:1>]), args[-<NUM_LIT:1>])<EOL><DEDENT>if is_action:<EOL><INDENT>f.__name__ = str(name)<EOL><DEDENT>else:<EOL><INDENT>f.__name__ = str('<STR_LIT>' % name)<EOL><DEDENT>f.__doc__ = doc<EOL>f._resource_uri = regex<EOL>f._get_args = arguments<EOL>f._put_or_post_args = post_arguments<EOL>f.resource_name = display_name<EOL>f.is_api_call = True<EOL>f.is_supported_api = supported<EOL>return f<EOL>
Returns a callable which conjures the URL for the resource and POSTs data