Check if lambda function exists.

        Returns:
            True if function does exist
            False if function does not exist
504401
def _check_lambda(self):
        
        exists = False
        try:
            self.lambda_client.get_function(FunctionName=self.app_name)
            exists = True
        except boto3.exceptions.botocore.exceptions.ClientError:
            pass
        return exists
1229206
def _check_existence_by_collection(self, container, item_name):
        '''
        '''

        coll = container.get_collection()
        for item in coll:
            if item.name == item_name:
                return True
        return False
202126
def has_arg(fn, arg_name):
    
    if sys.version_info < (3,):
        if isinstance(fn, types.FunctionType) or isinstance(fn, types.MethodType):
            arg_spec = inspect.getargspec(fn)
        else:
            try:
                arg_spec = inspect.getargspec(fn.__call__)
            except AttributeError:
                return False
        return (arg_name in arg_spec.args)
    elif sys.version_info < (3, 6):
        arg_spec = inspect.getfullargspec(fn)
        return (arg_name in arg_spec.args or
                arg_name in arg_spec.kwonlyargs)
    else:
        try:
            signature = inspect.signature(fn)
        except ValueError:
            # handling Cython
            signature = inspect.signature(fn.__call__)
        parameter = signature.parameters.get(arg_name)
        if parameter is None:
            return False
        return (parameter.kind in (inspect.Parameter.POSITIONAL_OR_KEYWORD,
                                   inspect.Parameter.KEYWORD_ONLY))
304132
def _check_lambda_alias(self):
        
        aliases = self.lambda_client.list_aliases(FunctionName=self.app_name)

        matched_alias = False
        for alias in aliases['Aliases']:
            if alias['Name'] == self.env:
                LOG.info('Found alias %s for function %s', self.env, self.app_name)
                matched_alias = True
                break
        else:
            LOG.info('No alias %s found for function %s', self.env, self.app_name)
        return matched_alias
16775
def exists(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists(index=self._name, **kwargs)
1216996
private function exists($className, $functionName)
    {
        return
            function_exists($this->getFullFunctionName($className, $functionName))
            || method_exists($className, $functionName);
    }
1087189
def function_is_noop(function_node: ast.FunctionDef) -> bool:
    
    return all(node_is_noop(n) for n in function_node.body)
1147766
def exists(name, tags=None, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        rds = conn.describe_db_instances(DBInstanceIdentifier=name)
        return {'exists': bool(rds)}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
12718
def exists(self):
    
    try:
      info = self._api.tables_get(self._name_parts)
    except google.datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    self._info = info
    return 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
1162900
def remove_lambda_functions():
    """"""
    logger.debug("[#] Removing the Lambda functions")
    client = boto3.client('lambda', region_name=PRIMARY_REGION)

    responses = list()
    for label in LAMBDA_FUNCTIONS:
        try:
            response = client.delete_function(
                FunctionName=label,
            )
        except client.exceptions.ResourceNotFoundException:
            logger.info("[!] Function %s already removed" % (label))
            continue
        responses.append(response)
        logger.debug("[*] Removed %s function" % (label))
    logger.info("[#] Successfully removed Lambda functions")

    return responses
1052026
def exists(self):
        
        return self.rpc_model.search_count(
            self.domain, context=self.context
        ) > 0
79600
public static boolean hasFunction(Object object, String functionName, Class[] parameters) {
        boolean result = false;

        try {
            Method method = object.getClass().getMethod(functionName, parameters);

            if (method != null) {
                result = true;
            }
        } catch (NoSuchMethodException ex) {
            result = false;
        }

        return result;
    }
1130739
def has_method(obj, method_name):
    '''
    
    '''
    if method_name in dir(obj):
        return True

    log.error('Method \'%s\' not yet supported!', method_name)
    return False
647569
def _check_make_function_instrs(load_code_instr,
                                load_name_instr,
                                make_function_instr,
                                *,
                                expect_lambda=False):
    

    # Validate load_code_instr.
    if not isinstance(load_code_instr, instrs.LOAD_CONST):
        raise TypeError(
            "make_function expected 'load_code_instr` to be a "
            "LOAD_CONST, but got %s" % load_code_instr,
        )
    if not isinstance(load_code_instr.arg, types.CodeType):
        raise TypeError(
            "make_function expected load_code_instr "
            "to load a code object, but got %s" % load_code_instr.arg,
        )

    # Validate load_name_instr
    if not isinstance(load_name_instr, instrs.LOAD_CONST):
        raise TypeError(
            "make_function expected 'load_name_instr` to be a "
            "LOAD_CONST, but got %s" % load_code_instr,
        )

    if not isinstance(load_name_instr.arg, str):
        raise TypeError(
            "make_function expected load_name_instr "
            "to load a string, but got %r instead" % load_name_instr.arg
        )

    # This is an endswith rather than '==' because the arg is the
    # fully-qualified name.
    is_lambda = is_lambda_name(load_name_instr.arg)
    if expect_lambda and not is_lambda:
        raise ValueError(
            "Expected to make a function named <lambda>, but "
            "got %r instead." % load_name_instr.arg
        )
    if not expect_lambda and is_lambda:
        raise ValueError("Unexpectedly received lambda function.")

    # Validate make_function_instr
    if not isinstance(make_function_instr, (instrs.MAKE_FUNCTION,
                                            instrs.MAKE_CLOSURE)):
        raise TypeError(
            "make_function expected a MAKE_FUNCTION or MAKE_CLOSURE"
            "instruction, but got %s instead." % make_function_instr
        )
949122
public static function functionExists($function)
    {
        // eval() is a language construct
        if ($function == 'eval') {
            // does not check suhosin.executor.eval.whitelist (or blacklist)
            if (extension_loaded('suhosin')) {
                return @ini_get("suhosin.executor.disable_eval") != "1";
            }
            return true;
        }

        $exists = function_exists($function);

        if (extension_loaded('suhosin')) {
            $blacklist = @ini_get("suhosin.executor.func.blacklist");
            if (!empty($blacklist)) {
                $blacklistFunctions = array_map('strtolower', array_map('trim', explode(',', $blacklist)));
                return $exists && !in_array($function, $blacklistFunctions);
            }
        }

        return $exists;
    }
872100
public static function exists(string $func): bool
    {
        if (strpos($func, "::") !== false) {
            list($class, $method) = explode("::", $func);
            return method_exists($class, $method);
        }
        return function_exists($func);
    }