import types


def is_function(obj):
    """Check if obj is function(lambda function or user defined method) or not"""
    return isinstance(obj, (types.FunctionType, types.MethodType,
                            types.LambdaType))