@inject(config=Config)<EOL>def get_resource_task(resource_path, config=Injected):<EOL>
class_name = underscore_to_camelcase(resource_path) + '<STR_LIT>'<EOL>resource_packages = config['<STR_LIT>'] if '<STR_LIT>' in config else (config['<STR_LIT>'],)<EOL>resource = None<EOL>for resource_package in resource_packages:<EOL><INDENT>module_name = "<STR_LIT>".format(resource_package, resource_path)<EOL>try:<EOL><INDENT>module = importlib.import_module(module_name)<EOL>try:<EOL><INDENT>cls = getattr(module, class_name)<EOL>resource = instantiate(cls)<EOL>break<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise NameError("<STR_LIT>".format(resource_path))<EOL><DEDENT><DEDENT>except ImportError:<EOL><INDENT>try:<EOL><INDENT>exposer = importlib.import_module(resource_package + '<STR_LIT>')<EOL>resource = exposer.get_resource(class_name)<EOL>break<EOL><DEDENT>except Exception as e:<EOL><INDENT>logging.error("<STR_LIT>".format(resource_path, e))<EOL>pass<EOL><DEDENT><DEDENT><DEDENT>if resource is None:<EOL><INDENT>raise NameError("<STR_LIT>".format(resource_path))<EOL><DEDENT>try:<EOL><INDENT>if request.method == '<STR_LIT:POST>':<EOL><INDENT>return get_method(resource, '<STR_LIT>')<EOL><DEDENT>elif request.method == '<STR_LIT:GET>':<EOL><INDENT>return get_method(resource, '<STR_LIT>')<EOL><DEDENT>elif request.method == '<STR_LIT>' or request.method == '<STR_LIT>':<EOL><INDENT>return get_method(resource, '<STR_LIT>')<EOL><DEDENT>elif request.method == '<STR_LIT>':<EOL><INDENT>return get_method(resource, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>logging.error("<STR_LIT>", request.method, resource_path)<EOL><DEDENT><DEDENT>except MethodNotImplementedException:<EOL><INDENT>logging.error(<EOL>"<STR_LIT>",<EOL>request.method,<EOL>resource_path<EOL>)<EOL>return None<EOL><DEDENT>
Search and return a bounded method for given path.

    :param resource_path: resource path
    :type resource_path: str
    :param config: current configuration, injected
    :type config: Config
    :return: bounded method or None when not found
    :raises NameError: when can't find given resource by path