import types


def is_method_of_class(mthd, cls):
    """
    Returns True if function 'mthd' is a method of class 'cls'

    :type mthd: function
    :type cls: class
    :return: True if 'mthd' is a method of class 'cls', and False otherwise.
    :rtype: bool
    """
    try:
        class_method = getattr(cls, mthd.__name__)
    except AttributeError:
        return False
    if isinstance(mthd, types.MethodType):
        return class_method == mthd.__func__
    return class_method == mthd