def get_method(resource, method):
if hasattr(resource, method) and callable(getattr(resource, method)):<EOL><INDENT>return getattr(resource, method)<EOL><DEDENT>else:<EOL><INDENT>raise MethodNotImplementedException()<EOL><DEDENT>
Test and return a method by name on resource.

    :param resource: resource object
    :type resource: object
    :param method: method name
    :type method: str
    :return: bounded method
    :raises MethodNotImplementedException: when method not found