Determine whether the user has followed bean-like naming convention or not.
424717
public static NamingConvention determineNamingConvention(
      TypeElement type,
      Iterable<ExecutableElement> methods,
      Messager messager,
      Types types) {
    ExecutableElement beanMethod = null;
    ExecutableElement prefixlessMethod = null;
    for (ExecutableElement method : methods) {
      switch (methodNameConvention(method)) {
      case BEAN:
        beanMethod = firstNonNull(beanMethod, method);
        break;
      case PREFIXLESS:
        prefixlessMethod = firstNonNull(prefixlessMethod, method);
        break;
      default:
        break;
      }
    }
    if (prefixlessMethod != null) {
      if (beanMethod != null) {
        messager.printMessage(
            ERROR,
            "Type contains an illegal mix of get-prefixed and unprefixed getter methods, e.g. '"
                + beanMethod.getSimpleName() + "' and '" + prefixlessMethod.getSimpleName() + "'",
                type);
      }
      return new PrefixlessConvention(messager, types);
    } else {
      return new BeanConvention(messager, types);
    }
  }
285808
private static boolean validTemplateTypeName(String name) {
    return !name.isEmpty()
        && CharMatcher.javaLetterOrDigit().or(CharMatcher.is('_')).matchesAllOf(name);
  }
249568
private boolean willWriteBean(Bean bean) {
        for (MetaProperty<?> prop : bean.metaBean().metaPropertyIterable()) {
            if (prop.style().isSerializable() || (prop.style().isDerived() && settings.isIncludeDerived())) {
                return true;
            }
        }
        return false;
    }
751266
private <T extends Annotation> boolean checkReusable(MetricResolver.Of<T> of) {
        String name = of.metadata().getName();
        // If the metric has been registered before (eg. metrics found in RequestScoped beans),
        // we don't need to worry about re-usable
        if (!of.isInitialDiscovery()) {
            return true;
        }

        Metadata existingMetadata = registry.getMetadata().get(name);
        if (existingMetadata != null && (existingMetadata.isReusable() == false || of.metadata().isReusable() == false)) {
            throw new IllegalArgumentException("Cannot reuse metric for " + of.metricName());
        }
        return true;

    }
587230
function (arrayOfSuggestions, beanName) {
                for (var k = 0, l = arrayOfSuggestions.length; k < l; k++) {
                    var currentSuggestion = arrayOfSuggestions[k];
                    if (!typeUtil.isString(currentSuggestion)
                            && !ariaCoreJsonValidator.check(currentSuggestion, beanName)) {
                        return false;
                    }
                }
                return true;
            }
649412
private boolean isAllowedUser(CmsUser user) throws CmsException {

        if (user.getOuFqn().startsWith(m_cms.getRequestContext().getOuFqn())) {
            return true;
        }
        return OpenCms.getRoleManager().getRolesOfUser(m_cms, user.getName(), m_ou, true, true, false).size() > 0;
    }
65749
function is_user_configured($user = null) {
        global $USER;

        if (is_null($user)) {
            $user = $USER;
        }
        return (bool)get_user_preferences('message_processor_jabber_jabberid', null, $user->id);
    }
1332877
protected boolean syncCheckLoginSessionIfNeeds(USER_BEAN userBean) {
        if (!(userBean instanceof SyncCheckable)) {
            return true; // means no check
        }
        final SyncCheckable checkable = (SyncCheckable) userBean;
        final OptionalThing<LocalDateTime> checkDt = checkable.getLastestSyncCheckTime(); // might be null
        final LocalDateTime currentDt = timeManager.currentDateTime();
        if (!needsLoginSessionSyncCheck(userBean, checkDt, currentDt)) {
            return true; // means no check
        }
        if (logger.isDebugEnabled()) {
            final ID userId = userBean.getUserId();
            final String checkDisp = checkDt.map(dt -> new HandyDate(dt).toDisp("yyyy/MM/dd HH:mm:ss")).orElse(null);
            logger.debug("...Sync-checking login session: userId={}, checkDate={}", userId, checkDisp);
        }
        checkable.manageLastestSyncCheckTime(currentDt); // update latest check date
        return findLoginSessionSyncCheckUser(userBean).map(loginUser -> {
            handleLoginSessionSyncCheckSuccess(userBean, loginUser);
            return true;
        }).orElseGet(() -> { // the user might be assigned here
            logger.debug("*The user already cannot login: {}", userBean);
            logout(); // remove user info from session
            return false; // means check NG
        });
    }
39109
private void validateDepNameUniqueness(final List<TriggerDependencyBean> dependencies) {
    final Set<String> seen = new HashSet<>();
    for (final TriggerDependencyBean dep : dependencies) {
      // set.add() returns false when there exists duplicate
      Preconditions.checkArgument(seen.add(dep.getName()), String.format("duplicate dependency"
          + ".name %s found, dependency.name should be unique", dep.getName()));
    }
  }
657907
static boolean isNameReferenced(Node node, String name, Predicate<Node> traverseChildrenPred) {
    return has(node, new MatchNameNode(name), traverseChildrenPred);
  }
461272
private boolean verifyHostName(String hostName, String pattern) {
    // Basic sanity checks
    // Check length == 0 instead of .isEmpty() to support Java 5.
    if ((hostName == null) || (hostName.length() == 0) || (hostName.startsWith("."))
        || (hostName.endsWith(".."))) {
      // Invalid domain name
      return false;
    }
    if ((pattern == null) || (pattern.length() == 0) || (pattern.startsWith("."))
        || (pattern.endsWith(".."))) {
      // Invalid pattern/domain name
      return false;
    }

    // Normalize hostName and pattern by turning them into absolute domain names if they are not
    // yet absolute. This is needed because server certificates do not normally contain absolute
    // names or patterns, but they should be treated as absolute. At the same time, any hostName
    // presented to this method should also be treated as absolute for the purposes of matching
    // to the server certificate.
    //   www.android.com  matches www.android.com
    //   www.android.com  matches www.android.com.
    //   www.android.com. matches www.android.com.
    //   www.android.com. matches www.android.com
    if (!hostName.endsWith(".")) {
      hostName += '.';
    }
    if (!pattern.endsWith(".")) {
      pattern += '.';
    }
    // hostName and pattern are now absolute domain names.

    pattern = pattern.toLowerCase(Locale.US);
    // hostName and pattern are now in lower case -- domain names are case-insensitive.

    if (!pattern.contains("*")) {
      // Not a wildcard pattern -- hostName and pattern must match exactly.
      return hostName.equals(pattern);
    }
    // Wildcard pattern

    // WILDCARD PATTERN RULES:
    // 1. Asterisk (*) is only permitted in the left-most domain name label and must be the
    //    only character in that label (i.e., must match the whole left-most label).
    //    For example, *.example.com is permitted, while *a.example.com, a*.example.com,
    //    a*b.example.com, a.*.example.com are not permitted.
    // 2. Asterisk (*) cannot match across domain name labels.
    //    For example, *.example.com matches test.example.com but does not match
    //    sub.test.example.com.
    // 3. Wildcard patterns for single-label domain names are not permitted.

    if ((!pattern.startsWith("*.")) || (pattern.indexOf('*', 1) != -1)) {
      // Asterisk (*) is only permitted in the left-most domain name label and must be the only
      // character in that label
      return false;
    }

    // Optimization: check whether hostName is too short to match the pattern. hostName must be at
    // least as long as the pattern because asterisk must match the whole left-most label and
    // hostName starts with a non-empty label. Thus, asterisk has to match one or more characters.
    if (hostName.length() < pattern.length()) {
      // hostName too short to match the pattern.
      return false;
    }

    if ("*.".equals(pattern)) {
      // Wildcard pattern for single-label domain name -- not permitted.
      return false;
    }

    // hostName must end with the region of pattern following the asterisk.
    String suffix = pattern.substring(1);
    if (!hostName.endsWith(suffix)) {
      // hostName does not end with the suffix
      return false;
    }

    // Check that asterisk did not match across domain name labels.
    int suffixStartIndexInHostName = hostName.length() - suffix.length();
    if ((suffixStartIndexInHostName > 0)
        && (hostName.lastIndexOf('.', suffixStartIndexInHostName - 1) != -1)) {
      // Asterisk is matching across domain name labels -- not permitted.
      return false;
    }

    // hostName matches pattern
    return true;
  }
1185282
private static boolean isConstructor(String methodName) {
        return Const.CONSTRUCTOR_NAME.equals(methodName) || Const.STATIC_INITIALIZER_NAME.equals(methodName) || "readObject".equals(methodName)
                || "clone".equals(methodName) || "close".equals(methodName) || "writeObject".equals(methodName)
                || "toString".equals(methodName) || "init".equals(methodName) || "initialize".equals(methodName)
                || "dispose".equals(methodName) || "finalize".equals(methodName) || "this".equals(methodName)
                || "_jspInit".equals(methodName) || "_jspDestroy".equals(methodName);

    }
1352030
protected void beanDefinitionCheck() {
        for (int i = 0; i < beanDefinitions.size(); i++) {
            for (int j = i + 1; j < beanDefinitions.size(); j++) {
                BeanDefinition b1 = beanDefinitions.get(i);
                BeanDefinition b2 = beanDefinitions.get(j);

                // Two components' id are equal
                if (VerifyUtils.isNotEmpty(b1.getId())
                        && VerifyUtils.isNotEmpty(b2.getId())
                        && b1.getId().equals(b2.getId())) {
                    error("Duplicated bean ID of " + b1.getClassName() + " and " + b2.getClassName());
                }

                if (b1.getClassName().equals(b2.getClassName())) {
                    // Two components' class name are equal, but one of them does not set id.
                    if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                        error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                    } else {
                        // Their id are different, save them to memo.
                        // When the component is injecting by type, throw an exception.
                        errorMemo.add(b1.getClassName());
                    }
                }

                for (String iname1 : b1.getInterfaceNames()) {
                    for (String iname2 : b2.getInterfaceNames()) {
                        if (iname1.equals(iname2)) {
                            // Two components' interface name are equal, but one of them does not set id.
                            if (VerifyUtils.isEmpty(b1.getId()) || VerifyUtils.isEmpty(b2.getId())) {
                                error("Duplicated class definition. Please set a ID for " + b1.getClassName());
                            } else {
                                // Their id are different, save them to memo.
                                // When the component is injecting by type, throw an exception.
                                errorMemo.add(iname1);
                            }
                        }
                    }
                }

            }
        }
    }
950751
def is_default(name=None, index=None):
    

    if not is_configured():
        raise JutException('No configurations available, please run `jut config add`')

    count = 1
    for configuration in _CONFIG.sections():

        if index != None:
            if _CONFIG.has_option(configuration, 'default') and count == index:
                return True

        if name != None:
            if _CONFIG.has_option(configuration, 'default') and configuration == name:
                return True

        count += 1

    return False
157387
function isUserResult(item) {
  log.trace('isUserResult(%j)', item);

  if (! item) return(false);
  if (item.userPrincipalName) return(true);
  if (item.objectCategory) {
    re.isUserResult.lastIndex = 0; // Reset the regular expression
    return(re.isUserResult.test(item.objectCategory));
  }
  if ((item.objectClass) && (item.objectClass.length > 0)) {
    return(_.any(item.objectClass, function(c) { return(c.toLowerCase() === 'user'); }));
  }
  return(false);
}
880732
def is_valid_field_name(value):
    """"""
    leftovers = re.sub(r"\w", "", value)
    leftovers = re.sub(r"-", "", leftovers)
    if leftovers != "" or value[0].isdigit() or value[0] in ["-", "_"] or " " in value:
        return False
    return True
1253382
def is_builtin_name(name):
  """"""
  if name.startswith('__') and name.endswith('__'):
    return ALL_LOWER_CASE_RE.match(name[2:-2]) is not None
  return False