Checks if a certain function exists on the server, or not.
I needed to add this, because else the router wouldn't work on a NGINX server!
495257
private function checkFunctions()
    {
        if (!function_exists('apache_request_headers')) {
            function apache_request_headers()
            {
                $arh = array();
                $rx_http = '/\AHTTP_/';
                foreach ($_SERVER as $key => $val) {
                    if (preg_match($rx_http, $key)) {
                        $arh_key = preg_replace($rx_http, '', $key);
                        $rx_matches = explode('_', $arh_key);
                        if (count($rx_matches) > 0 and strlen($arh_key) > 2) {
                            foreach ($rx_matches as $ak_key => $ak_val) {
                                $rx_matches[$ak_key] = ucfirst($ak_val);
                            }
                            $arh_key = implode('-', $rx_matches);
                        }
                        $arh[$arh_key] = $val;
                    }
                }
                return ($arh);
            }
        }
    }
993991
function has_filter( $tag, $function_to_check = false ) {
            $this->_logger->entrance( $tag );

            return has_filter( $this->get_action_tag( $tag ), $function_to_check );
        }
789332
function shouldProxy(hostname, port) {
  var NO_PROXY = getEnv('no_proxy').toLowerCase();
  if (!NO_PROXY) {
    return true;  // Always proxy if NO_PROXY is not set.
  }
  if (NO_PROXY === '*') {
    return false;  // Never proxy if wildcard is set.
  }

  return NO_PROXY.split(/[,\s]/).every(function(proxy) {
    if (!proxy) {
      return true;  // Skip zero-length hosts.
    }
    var parsedProxy = proxy.match(/^(.+):(\d+)$/);
    var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
    var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
    if (parsedProxyPort && parsedProxyPort !== port) {
      return true;  // Skip if ports don't match.
    }

    if (!/^[.*]/.test(parsedProxyHostname)) {
      // No wildcards, so stop proxying if there is an exact match.
      return hostname !== parsedProxyHostname;
    }

    if (parsedProxyHostname.charAt(0) === '*') {
      // Remove leading wildcard.
      parsedProxyHostname = parsedProxyHostname.slice(1);
    }
    // Stop proxying if the hostname ends with the no_proxy host.
    return !stringEndsWith.call(hostname, parsedProxyHostname);
  });
}
251630
static function exists( $fileName = "site.ini", $rootDir = "settings" )
    {
        if ( $fileName == "" )
            $fileName = "site.ini";
        if ( $rootDir == "" )
            $rootDir = "settings";
        if ( $rootDir[0] !== "/" )
            $rootDir = __DIR__ . "/../../../" . $rootDir;
        if ( file_exists( $rootDir . '/' . $fileName ) )
            return true;
        else if ( file_exists( $rootDir . '/' . $fileName . '.append.php' ) )
            return true;
        else if ( file_exists( $rootDir . '/' . $fileName . '.append' ) )
            return true;
        return false;
    }
1065046
def has_function(function_name, libraries=None):
  """"""
  compiler = distutils.ccompiler.new_compiler()
  with muted(sys.stdout, sys.stderr):
    result = compiler.has_function(
        function_name, libraries=libraries)
  if os.path.exists('a.out'):
    os.remove('a.out')
  return result
388119
def exists(self, path, mtime=None):
        
        self._connect()

        if self.sftp:
            exists = self._sftp_exists(path, mtime)
        else:
            exists = self._ftp_exists(path, mtime)

        self._close()

        return exists
1096888
function exists(parts) {
	if (verify(parts, false)) {
		// Valid function name
		return true;
	}

	if (!verify(parts, true)) {
		// Not valid prefix
		return false;
	}

	// Valid prefix, check whether it has members
	for (const prefix of allParts) {
		if (parts.indexOf(prefix) === -1 && exists(parts.concat([prefix]))) {
			return true;
		}
	}

	return false;
}
1325410
def check(func):
    
    def iCheck(request, *args, **kwargs):
        if not request.method == "POST":
            return HttpResponseBadRequest("Must be POST request.")
        follow = func(request, *args, **kwargs)
        if request.is_ajax():
            return HttpResponse('ok')
        try:
            if 'next' in request.GET:
                return HttpResponseRedirect(request.GET.get('next'))
            if 'next' in request.POST:
                return HttpResponseRedirect(request.POST.get('next'))
            return HttpResponseRedirect(follow.target.get_absolute_url())
        except (AttributeError, TypeError):
            if 'HTTP_REFERER' in request.META:
                return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/'))
            if follow:
                return HttpResponseServerError('"%s" object of type ``%s`` has no method ``get_absolute_url()``.' % (
                    unicode(follow.target), follow.target.__class__))
            return HttpResponseServerError('No follow object and `next` parameter found.')
    return iCheck
916356
def _is_valid_function(module_name, function):
    '''
    
    '''
    try:
        functions = __salt__['sys.list_functions'](module_name)
    except salt.exceptions.SaltException:
        functions = ["unable to look up functions"]
    return "{0}.{1}".format(module_name, function) in functions
524821
def _handle_function_exists(self, node, scope, ctxt, stream):
        
        res = fields.Int()
        try:
            func = self._handle_node(node.expr, scope, ctxt, stream)
            if isinstance(func, functions.BaseFunction):
                res._pfp__set_value(1)
            else:
                res._pfp__set_value(0)
        except errors.UnresolvedID:
            res._pfp__set_value(0)
        return res
8455
def check_name_available_except!(name, network)
      return if name.nil? || network.name_eql?(name) || !find_network(name)

      raise CommandError, "a network with the name #{name.inspect} " \
                          'already exists'
    end
868417
def server_side(func):
    
    def inner(*args, **kwargs):
        if args and hasattr(args[0], 'is_server') and not voltron.debugger:
            raise ServerSideOnlyException("This method can only be called on a server-side instance")
        return func(*args, **kwargs)
    return inner
559390
function checkIngredients(flapjack, options) {
    options = options || {};

    // If original module is not a function but has client function, use that
    if (flapjack && !_.isFunction(flapjack) && flapjack.client) {
        flapjack = flapjack.client;
    }
    // else if dealing with factory and no client annotation (i.e. it's server only), return null
    else if (flapjack && options.ngType === 'factory' && !options.isClient) {
        var moduleInfo = this.getModuleInfo(flapjack) || {};
        if (!moduleInfo.client) { return null; }
    }

    return flapjack;
}
316536
def check_is_table(func):
    
    @wraps(func)
    def wrapper(**kwargs):
        if not orca.is_table(kwargs['table_name']):
            abort(404)
        return func(**kwargs)
    return wrapper
649933
function isAppServer(inputpaths, serverConfig) {
  // Test if 'p' is in 'dirs'
  function contains(dirs, p) {
    if (!Array.isArray(dirs)) dirs = [dirs];
    return dirs.some(dir => {
      return indir(dir, p);
    });
  }

  return serverConfig != undefined && serverConfig.file != undefined && contains(inputpaths, serverConfig.file);
}
325840
function exists( path, clbk ) {
	fcn( path, done );

	/**
	* FUNCTION: done( error )
	*	Callback invoked performing a filesystem call.
	*
	* @private
	* @param {Error|Null} error - error object
	*/
	function done( error ) {
		if ( clbk.length === 2 ) {
			if ( error ) {
				return clbk( error, false );
			}
			return clbk( null, true );
		}
		if ( error ) {
			return clbk( false );
		}
		return clbk( true );
	}
}
159830
def __fun_check(self, valid, fun, args=None, kwargs=None):
        '''
        
        '''
        if not isinstance(valid, list):
            valid = [valid]
        for cond in valid:
            # Function name match
            if isinstance(cond, six.string_types):
                if self.match_check(cond, fun):
                    return True
            # Function and args match
            elif isinstance(cond, dict):
                if len(cond) != 1:
                    # Invalid argument
                    continue
                fname_cond = next(six.iterkeys(cond))
                if self.match_check(fname_cond, fun):  # check key that is function name match
                    if self.__args_check(cond[fname_cond], args, kwargs):
                        return True
        return False