Check if the given function is a native function
771790
function isNativeFunction(f) {
  if ((typeof f) !== 'function') {
    return false;
  }
  var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
  return exp.exec(Function.prototype.toString.call(f)) != null;
}
380679
function checkInterface(obj, funcs) {
    for (var i = 0; i < funcs.length; ++i) {
        if (typeof obj[funcs[i]] !== 'function')
            return false;
    }
    return true;
}
1248373
def _dict_native_ok(d):
    
    if len(d) >= 256:
        return False

    # All keys must be strings
    for k in d:
        if not isinstance(k, six.string_types):
            return False

    return True
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;
        }
1087189
def function_is_noop(function_node: ast.FunctionDef) -> bool:
    
    return all(node_is_noop(n) for n in function_node.body)
11483
private function isFunctionExistenceChecked(Node\Stmt\Function_ $declaredFunction)
    {
        /** @var Node\Stmt\If_ $ifStatement */
        foreach ($this->ifStatementStack as $ifStatement) {
            $condition = $ifStatement->cond;

            $isConditionNegatedFunctionExistsCall = $condition
                && ($condition instanceof Node\Expr\BooleanNot)
                && $this->functionAnalyzer->isFunctionCallByStaticName($condition->expr, static::FUNCTION_EXISTS_FUNCTION_NAME);
            if (!$isConditionNegatedFunctionExistsCall) {
                continue;
            }

            /** @var Node\Expr\FuncCall $conditionFunction */
            $conditionFunction = $condition->expr;
            $checkedFunctionName = isset($conditionFunction->args[0]) ? $conditionFunction->args[0] : null;
            $isCheckedFunctionNameScalarString = $checkedFunctionName
                && ($checkedFunctionName instanceof Node\Arg)
                && ($checkedFunctionName->value instanceof Node\Scalar\String_);
            if (!$isCheckedFunctionNameScalarString) {
                continue;
            }

            $checkedFunctionName = $this->normalizeFunctionName($checkedFunctionName->value->value);
            if ($checkedFunctionName && $checkedFunctionName[0] === '\\') {
                $checkedFunctionName = substr($checkedFunctionName, 1);
            }

            $declaredFunctionName = $this->extractNormalizedFunctionName($declaredFunction);
            if ($checkedFunctionName === $declaredFunctionName) {
                return true;
            }
        }

        return false;
    }
773654
def real_check(*args, func=None):
    """"""
    func = func or inspect.stack()[2][3]
    for var in args:
        if not isinstance(var, numbers.Real):
            name = type(var).__name__
            raise ComplexError(
                f'Function {func} expected real number, {name} got instead.')
503642
def _is_deprecated(func):
    """"""
    if sys.version_info < (3, 5):
        raise NotImplementedError("This is only available for python3.5 "
                                  "or above")
    closures = getattr(func, '__closure__', [])
    if closures is None:
        closures = []
    is_deprecated = ('deprecated' in ''.join([c.cell_contents
                                              for c in closures
                                              if isinstance(c.cell_contents, str)]))
    return is_deprecated
1355336
public static function isScalar($object, $native = false)
    {
        return $native
            ? is_scalar($object)
            : is_scalar($object) || $object instanceof \SplType;
    }
18377
function isDflowFun (f) {
  var isFunction = typeof f === 'function'
  var hasFuncsObject = typeof f.funcs === 'object'
  var hasGraphObject = typeof f.graph === 'object'
  var hasValidGraph = true

  if (!isFunction || !hasFuncsObject || !hasGraphObject) return false

  if (isFunction && hasGraphObject && hasFuncsObject) {
    try {
      validate(f.graph, f.funcs)
    } catch (ignore) {
      hasValidGraph = false
    }
  }

  return hasValidGraph
}
18411
function isRelayEnvironment(environment: mixed): boolean {
  return (
    typeof environment === 'object' &&
    environment !== null &&
    // TODO: add applyMutation/sendMutation once ready in both cores
    typeof environment.check === 'function' &&
    typeof environment.lookup === 'function' &&
    typeof environment.retain === 'function' &&
    typeof environment.sendQuery === 'function' &&
    typeof environment.execute === 'function' &&
    typeof environment.subscribe === 'function'
  );
}
1069961
def isfunc(x):
    
    return any([
        inspect.isfunction(x) and not asyncio.iscoroutinefunction(x),
        inspect.ismethod(x) and not asyncio.iscoroutinefunction(x)
    ])
850610
function isThenable(o) {
		var _then, o_type = typeof o;

		if (o != null &&
			(
				o_type == "object" || o_type == "function"
			)
		) {
			_then = o.then;
		}
		return typeof _then == "function" ? _then : false;
	}
581425
public static function isFunctionBlacklistedInPhpIni($function)
    {
        if (!isset(self::$blackListPhpIni)) {
            self::$blackListPhpIni = static::prepareList(ini_get('disable_functions'));
        }

        return static::isFunctionsMentionedInList($function, self::$blackListPhpIni);
    }
889866
function isNative (val) {
  if (isPrimitive(val)) {
    return true
  }
  return natives.some(function (Class) {
    return val === Class || directInstanceOf(val, Class)
  })
}
266937
function (methodName, callback) {
    Mobile(methodName).registerToNative(callback);
    Mobile('didRegisterToNative').callNative(methodName, function () {
      logger.debug('Method %s registered to native', methodName);
    });
  }
353309
def is_function_or_method(obj):
    
    return inspect.isfunction(obj) or inspect.ismethod(obj) or is_cython(obj)