def get_resource(self, base_resource_path, resource_path, method=None):
basic_path = base_resource_path + resource_path<EOL>dynamic_path = base_resource_path + "<STR_LIT:{>" + resource_path + "<STR_LIT:}>"<EOL>for resource in self.raml.resources:<EOL><INDENT>method_matched = method is None or resource.method == method<EOL>if method_matched and (resource.path == basic_path<EOL>or resource.path == basic_path + '<STR_LIT:/>'):<EOL><INDENT>return resource<EOL><DEDENT>if resource.path == dynamic_path and method_matched:<EOL><INDENT>return NodeParameter(resource=resource, parameter=resource_path)<EOL><DEDENT><DEDENT>return None<EOL>
Gets a resource by it's path and optional by it's method

This method does not care about the supported resource methods
unless it is specified.

:param str resource_path: The path of the resource
:param str method: The method of the path.

:returns: the resource if it exists or None
:rtype: ResourceNode