Check if an object is a function or method.

    Args:
        obj: The Python object in question.

    Returns:
        True if the object is an function or method.
353309
def is_function_or_method(obj):
    
    return inspect.isfunction(obj) or inspect.ismethod(obj) or is_cython(obj)
363987
function(obj) {
		return Object.keys(obj).every(function(key) {
			var is = false;
			switch (key) {
				case "getter":
				case "setter":
					is = gui.Type.isFunction(obj[key]);
					break;
			}
			return is;
		});
	}
592384
function (obj) {

            var length = !!obj && "length" in obj && obj.length,
                type   = $this.type(obj);

            if (type === "function" || $this.isWindow(obj)) {
                return false;
            }

            return type === "array" ||
                length === 0 ||
                typeof length === "number" &&
                length > 0 &&
                (length - 1) in obj;
        }
301785
def hasvar(obj, var):
  
  if hasattr(obj, var):
    return not callable(getattr(obj, var))
  return False
1142557
def isexception(obj):
    
    if isinstance(obj, Exception):
        return True
    if isclass(obj) and issubclass(obj, Exception):
        return True
    return False
724772
function isFunctionBasic(inputArg) {
            var isFn = toClass(inputArg) === classFunction,
                type;

            if (!isFn && inputArg !== null) {
                type = typeof inputArg;
                if ((type === 'function' || type === 'object') &&
                        ('constructor' in inputArg) &&
                        ('call' in inputArg) &&
                        ('apply' in inputArg) &&
                        ('length' in inputArg) &&
                        typeof inputArg.length === 'number') {

                    isFn = true;
                }
            }

            return isFn;
        }
1202855
def is_subclass(obj, cls):
    
    try:
        for i in obj.__bases__:
            if i is cls or isinstance(i, cls):
                return True
        for i in obj.__bases__:
            if isinstance(i, cls):
                return True
    except AttributeError:
        return isinstance(obj.__class__, cls)
    return False
87123
public static boolean hasMethod(Object obj, String name) {
		if (obj == null)
			throw new NullPointerException("Object cannot be null");
		if (name == null)
			throw new NullPointerException("Method name cannot be null");

		Class<?> objClass = obj.getClass();

		for (Method method : objClass.getMethods()) {
			if (matchMethod(method, name))
				return true;
		}

		return false;
	}
1212772
public static boolean isFunction( Object obj ) {
      if( obj instanceof String ){
         String str = (String) obj;
         return str.startsWith( FUNCTION_PREFIX ) && RegexpUtils.getMatcher( FUNCTION_PATTERN, true ).matches( str );
      }
      if( obj instanceof JSONFunction ){
         return true;
      }
      return false;
   }
237084
def hasmethod(obj, meth):
  
  if hasattr(obj, meth):
    return callable(getattr(obj,meth))
  return False
798486
function isGetSet(obj) {
        var keys, length;
        if (obj && typeof obj === 'object') {
            keys = Object.getOwnPropertyNames(obj)
                .sort();
            length = keys.length;

            if ((length === 1 && (keys[0] === 'get' && typeof obj.get ===
                    'function' ||
                    keys[0] === 'set' && typeof obj.set === 'function'
                )) ||
                (length === 2 && (keys[0] === 'get' && typeof obj.get ===
                    'function' &&
                    keys[1] === 'set' && typeof obj.set === 'function'
                ))) {
                return true;
            }
        }
        return false;
    }
441287
function isModel(object) {
    if (!object || typeof object !== 'object') {
        return false;
    }
    else if ('isModel' in object) {
        diag.debug.assert(function () { return object.isModel === Model.prototype.isPrototypeOf(object); });
        return object.isModel;
    }
    else {
        return Model.prototype.isPrototypeOf(object);
    }
}
950075
def is_file(obj):
    
    return all(
        [callable(getattr(obj, method_name, None)) for method_name in ('__enter__', '__exit__')]
        +
        [any([callable(getattr(obj, method_name, None)) for method_name in ('next', '__iter__')])]
    )
57036
public boolean isInstanceOf(Object obj, Class<?> clz) {
        if (obj == null || clz == null) {
            if (log.isLoggable(Level.FINEST)) {
                log.finest("isInstanceOf error: obj=" + obj + " clz=" + clz);
            }
            return false;
        }
        return clz.isInstance(obj);
    }
208370
def is_float(obj):
    
    is_f = isinstance(obj, float)
    if not is_f:
        try:
            float(obj)
            is_f = True
        except (ValueError, TypeError):
            is_f = False
    return is_f and not is_bool(obj)
534672
function(obj) {
		var prop;

		if (!obj || typeOf(obj) !== 'object') {
			return true;
		}

		for (prop in obj) {
			return false;
		}

		return true;
	}
244065
function(obj) {
            var length = obj.length;
            return typeof arr !== "function" &&
            (length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj);
        }