Checks whether a given list of msg parts has any plural or select parts.

@param msgParts The msg parts to check.
@return Whether there are any plural or select parts.
332726
public static boolean hasPlrselPart(List<SoyMsgPart> msgParts) {
    for (SoyMsgPart origMsgPart : msgParts) {
      if (origMsgPart instanceof SoyMsgPluralPart || origMsgPart instanceof SoyMsgSelectPart) {
        return true;
      }
    }
    return false;
  }
49273
public boolean sendToMatching(Msg msg)
    {
        //  Is this end of a multipart message?
        boolean msgMore = msg.hasMore();

        //  Push the message to matching pipes.
        distribute(msg);

        //  If mutlipart message is fully sent, activate all the eligible pipes.
        if (!msgMore) {
            active = eligible;
        }

        more = msgMore;

        return true;
    }
680387
public boolean hasComponent(SdkComponent component) throws ManagedSdkVerificationException {
    if (!Files.isRegularFile(getGcloudPath())) {
      return false;
    }

    List<String> listComponentCommand =
        Arrays.asList(
            getGcloudPath().toString(),
            "components",
            "list",
            "--only-local-state",
            "--format=json",
            "--filter=id:" + component);

    try {
      String result = CommandCaller.newCaller().call(listComponentCommand, null, null);
      List<CloudSdkComponent> components = CloudSdkComponent.fromJsonList(result);
      if (components.size() > 1) {
        // not a unique component id
        throw new ManagedSdkVerificationException("Invalid component " + component);
      }
      return !components.isEmpty();
    } catch (CommandExecutionException | InterruptedException | CommandExitException ex) {
      throw new ManagedSdkVerificationException(ex);
    }
  }
682684
public static boolean checkCSSStatements(Collection<Pair<String,String>> statements) {
    for (Pair<String, String> pair : statements) {
      if (!checkCSSStatement(pair.getFirst(), pair.getSecond())) {
        return false;
      }
    }
    return true;
  }
100428
private boolean collectAndCheckLastSpans(int nextSpans1StartPosition,
      int nextSpans1EndPosition) throws IOException {
    // check next
    if (nextSpans1StartPosition == nextSpans2StartPosition
        && nextSpans1EndPosition == nextSpans2EndPosition) {
      return false;
    }
    // check last
    if (nextSpans1StartPosition == lastSpans2StartPosition
        && (nextSpans1EndPosition == lastSpans2EndPosition
            || lastSpans2EndPositions.contains(nextSpans1EndPosition))) {
      return false;
    }
    // collect
    if (nextSpans1StartPosition == nextSpans2StartPosition) {
      // reset
      if (nextSpans2StartPosition != lastSpans2StartPosition) {
        lastSpans2StartPosition = nextSpans2StartPosition;
        lastSpans2EndPosition = -1;
        lastSpans2EndPositions.clear();
      }
      while (nextSpans1StartPosition == nextSpans2StartPosition) {
        if (lastSpans2EndPosition > -1) {
          lastSpans2EndPositions.add(lastSpans2EndPosition);
        }
        lastSpans2EndPosition = nextSpans2EndPosition;
        nextSpans2StartPosition = spans2.spans.nextStartPosition();
        nextSpans2EndPosition = spans2.spans.endPosition();
        if (nextSpans1StartPosition == nextSpans2StartPosition
            && nextSpans1EndPosition == nextSpans2EndPosition) {
          return false;
        }
      }
    }

    return true;
  }
554359
private static boolean isDataMessage(final ByteBuf msg) {
    return DcpMutationMessage.is(msg) || DcpDeletionMessage.is(msg) || DcpExpirationMessage.is(msg);
  }
944323
private int findOtherSubMessage(int partIndex) {
        int count=msgPattern.countParts();
        MessagePattern.Part part=msgPattern.getPart(partIndex);
        if(part.getType().hasNumericValue()) {
            ++partIndex;
        }
        // Iterate over (ARG_SELECTOR [ARG_INT|ARG_DOUBLE] message) tuples
        // until ARG_LIMIT or end of plural-only pattern.
        do {
            part=msgPattern.getPart(partIndex++);
            MessagePattern.Part.Type type=part.getType();
            if(type==MessagePattern.Part.Type.ARG_LIMIT) {
                break;
            }
            assert type==MessagePattern.Part.Type.ARG_SELECTOR;
            // part is an ARG_SELECTOR followed by an optional explicit value, and then a message
            if(msgPattern.partSubstringMatches(part, "other")) {
                return partIndex;
            }
            if(msgPattern.getPartType(partIndex).hasNumericValue()) {
                ++partIndex;  // skip the numeric-value part of "=1" etc.
            }
            partIndex=msgPattern.getLimitPartIndex(partIndex);
        } while(++partIndex<count);
        return 0;
    }
674201
private static ImmutableList<SoyMsgPart> buildMsgPartsForChildren(
      MsgBlockNode parent, MsgNode msgNode) {

    ImmutableList.Builder<SoyMsgPart> msgParts = ImmutableList.builder();
    doBuildMsgPartsForChildren(parent, msgNode, msgParts);
    return msgParts.build();
  }
1278646
public boolean hasValidKey(HttpMessage msg) {
		try {
			HttpRequestHeader requestHeader = msg.getRequestHeader();
			return this.hasValidKey(requestHeader, getParams(requestHeader));
		} catch (ApiException e) {
			logger.error(e.getMessage(), e);
			return false;
		}
	}
577483
public boolean hasAnyPartialPosTag(String... posTags) {
    for (String posTag : posTags) {
      if (hasPartialPosTag(posTag)) {
        return true;
      }
    }
    return false;
  }
294559
public static Validation<String> isEmail(String msg) {
        return notEmpty().and(SimpleValidation.from(PatternKit::isEmail, msg));
    }
1119449
private boolean anyStringContainsNewLine(final String[] data) {
		boolean returnVal = false;
		for (int i = 0; i < data.length; i++) {
			if (Util.containsNewlines(data[i])) {
				returnVal = true;
			}
		}
		return returnVal;
	}
713874
boolean containsMessages(final Level level) {
        if (level == null) {
            throw new NullPointerException("Level can't be null");
        }

        return !this.messages.get(level).isEmpty();
    }
202070
def Plural(format_str):
  
  if format_str.startswith('plural?'):
    i = len('plural?')

    try:
      splitchar = format_str[i]  # Usually a space, but could be something else
      _, plural_val, singular_val = format_str.split(splitchar)
    except IndexError:
      raise Error('plural? must have exactly 2 arguments')

    def Formatter(value):
      plural = False
      if isinstance(value, int) and value > 1:
        plural = True
      if isinstance(value, list) and len(value) > 1:
        plural = True

      if plural:
        return plural_val
      else:
        return singular_val

    return Formatter

  else:
    return None
47215
public boolean write(Msg msg)
    {
        if (!checkWrite()) {
            return false;
        }

        boolean more = msg.hasMore();
        boolean identity = msg.isIdentity();
        outpipe.write(msg, more);

        if (!more && !identity) {
            msgsWritten++;
        }

        return true;
    }
505570
private boolean checkForVariables(List<Map<String, String>> values) {
    if (values == null || values.isEmpty()) {
      return false;
    } else {
      for (Map<String, String> list : values) {
        if (list.containsKey("type") && list.get("type")
            .equals(MtasParserMapping.PARSER_TYPE_VARIABLE)) {
          return true;
        }
      }
    }
    return false;
  }
1190324
public static boolean isMultiPartForm(@CheckForNull String contentType) {
        if (contentType == null) {
            return false;
        }

        String[] parts = contentType.split(";");
        return ArrayUtils.contains(parts, "multipart/form-data");
    }