Shows whether the tree to train is projective or not

@return true if the tree is non-projective
186424
public boolean isNonprojective()
    {
        for (int dep1 : goldDependencies.keySet())
        {
            int head1 = goldDependencies.get(dep1).headIndex;
            for (int dep2 : goldDependencies.keySet())
            {
                int head2 = goldDependencies.get(dep2).headIndex;
                if (head1 < 0 || head2 < 0)
                    continue;
                if (dep1 > head1 && head1 != head2)
                    if ((dep1 > head2 && dep1 < dep2 && head1 < head2) || (dep1 < head2 && dep1 > dep2 && head1 < dep2))
                        return true;
                if (dep1 < head1 && head1 != head2)
                    if ((head1 > head2 && head1 < dep2 && dep1 < head2) || (head1 < head2 && head1 > dep2 && dep1 < dep2))
                        return true;
            }
        }
        return false;
    }
767177
public boolean canTraverseOutsideSubtree()
  {

    if (null != m_parts)
    {
      int n = m_parts.size();

      for (int i = 0; i < n; i++)
      {
        AVTPart part = (AVTPart) m_parts.elementAt(i);

        if (part.canTraverseOutsideSubtree())
          return true;
      }
    }

    return false;
  }
1139231
public static boolean isDepTree(int[] parents, boolean isProjective, boolean isSingleHeaded) {
        // Check that every token has some head. (Note that the parents array encoding ensures we
        // can't have multiple heads per token.)
        int emptyCount = ParentsArray.countChildrenOf(parents, ParentsArray.EMPTY_POSITION);
        if (emptyCount != 0) {
            return false;
        }
        // Check that there is exactly one node with the WALL as its parent
        int wallCount = ParentsArray.countChildrenOf(parents, ParentsArray.WALL_POSITION);
        if (isSingleHeaded && wallCount != 1) {
            return false;
        } else if (wallCount < 1) {
            return false;
        }

        // Check that there are no cyles
        if (!ParentsArray.isConnectedAndAcyclic(parents)) {
            return false;
        }

        // Check for projectivity if necessary
        if (isProjective) {
            if (!ParentsArray.isProjective(parents)) {
                return false;
            }
        }
        // Is a valid dependency tree.
        return true;
    }
858425
public boolean hasDecorations() {
		if (m_decorations != null && m_decorations.length > 0) {
            for (Decoration m_decoration : m_decorations) {
                if (m_decoration != null)
                    return true;
            }
		}
		return false;
	}
1099435
private boolean hasPassiveProgressiveAuxiliary(Tree[] kids, HashSet<String> verbalSet) {
    if (DEBUG) {
      System.err.println("Checking for passive/progressive auxiliary");
    }
    boolean foundPassiveVP = false;
    boolean foundPassiveAux = false;
    for (Tree kid : kids) {
      if (DEBUG) {
        System.err.println("  checking in " + kid);
      }
      if (kid.isPreTerminal()) {
        Label kidLabel = kid.label();
        String tag = null;
        if (kidLabel instanceof HasTag) {
          tag = ((HasTag) kidLabel).tag();
        }
        if (tag == null) {
          tag = kid.value();
        }
        Label wordLabel = kid.firstChild().label();
        String word = null;
        if (wordLabel instanceof HasWord) {
          word = ((HasWord) wordLabel).word();
        }
        if (word == null) {
          word = wordLabel.value();
        }

        if (DEBUG) {
          System.err.println("Checking " + kid.value() + " head is " + word + '/' + tag);
        }
        String lcWord = word.toLowerCase();
        if (verbalTags.contains(tag) && verbalSet.contains(lcWord)) {
          if (DEBUG) {
            System.err.println("hasPassiveProgressiveAuxiliary found passive aux");
          }
          foundPassiveAux = true;
        }
      } else if (kid.isPhrasal()) {
        Label kidLabel = kid.label();
        String cat = null;
        if (kidLabel instanceof HasCategory) {
          cat = ((HasCategory) kidLabel).category();
        }
        if (cat == null) {
          cat = kid.value();
        }
        if ( ! cat.startsWith("VP")) {
          continue;
        }
        if (DEBUG) {
          System.err.println("hasPassiveProgressiveAuxiliary found VP");
        }
        Tree[] kidkids = kid.children();
        boolean foundParticipleInVp = false;
        for (Tree kidkid : kidkids) {
          if (DEBUG) {
            System.err.println("  hasPassiveProgressiveAuxiliary examining " + kidkid);
          }
          if (kidkid.isPreTerminal()) {
            Label kidkidLabel = kidkid.label();
            String tag = null;
            if (kidkidLabel instanceof HasTag) {
              tag = ((HasTag) kidkidLabel).tag();
            }
            if (tag == null) {
              tag = kidkid.value();
            }
            // we allow in VBD because of frequent tagging mistakes
            if ("VBN".equals(tag) || "VBG".equals(tag) || "VBD".equals(tag)) {
              foundPassiveVP = true;
              if (DEBUG) {
                System.err.println("hasPassiveAuxiliary found VBN/VBG/VBD VP");
              }
              break;
            } else if ("CC".equals(tag) && foundParticipleInVp) {
              foundPassiveVP = true;
              if (DEBUG) {
                System.err.println("hasPassiveAuxiliary [coordination] found (VP (VP[VBN/VBG/VBD] CC");
              }
              break;
            }
          } else if (kidkid.isPhrasal()) {
            String catcat = null;
            if (kidLabel instanceof HasCategory) {
              catcat = ((HasCategory) kidLabel).category();
            }
            if (catcat == null) {
              catcat = kid.value();
            }
            if ("VP".equals(catcat)) {
              if (DEBUG) {
                System.err.println("hasPassiveAuxiliary found (VP (VP)), recursing");
              }
              foundParticipleInVp = vpContainsParticiple(kidkid);
            } else if (("CONJP".equals(catcat) || "PRN".equals(catcat)) && foundParticipleInVp) { // occasionally get PRN in CONJ-like structures
              foundPassiveVP = true;
              if (DEBUG) {
                System.err.println("hasPassiveAuxiliary [coordination] found (VP (VP[VBN/VBG/VBD] CONJP");
              }
              break;
            }
          }
        }
      }
      if (foundPassiveAux && foundPassiveVP) {
        break;
      }
    } // end for (Tree kid : kids)
    if (DEBUG) {
      System.err.println("hasPassiveProgressiveAuxiliary returns " + (foundPassiveAux && foundPassiveVP));
    }
    return foundPassiveAux && foundPassiveVP;
  }
14826
public boolean hasPrimitivePeer() {
        if (mObjectClass == Integer.class ||
            mObjectClass == Boolean.class ||
            mObjectClass == Byte.class ||
            mObjectClass == Character.class ||
            mObjectClass == Short.class ||
            mObjectClass == Long.class ||
            mObjectClass == Float.class ||
            mObjectClass == Double.class ||
            mObjectClass == Void.class) {

            return true;
        }

        return false;
    }
676937
public function isPair()
    {
        return (!$this->isNull() && ($this->getBaseType() === BaseType::PAIR) || $this->getBaseType() === BaseType::DIRECTED_PAIR);
    }
57848
private static boolean isPropertyTree(Node expectedGetprop) {
    if (!expectedGetprop.isGetProp()) {
      return false;
    }

    Node leftChild = expectedGetprop.getFirstChild();
    if (!leftChild.isThis() && !isPropertyTree(leftChild)) {
      return false;
    }

    Node retVal = leftChild.getNext();
    return NodeUtil.getStringValue(retVal) != null;
  }
782938
def is_descendant_of(self, node):
        
        return (
            self.tree_id == node.tree_id and
            self.lft > node.lft and
            self.rgt < node.rgt
        )
1238993
private boolean hasSameStructure() {
        Object wrappedCollection = getWrappedValue();
        if (wrappedCollection == null) {
            return bufferedListModel.size() == 0;
        }
        else if (wrappedCollection instanceof Object[]) {
            Object[] wrappedArray = (Object[])wrappedCollection;
            if (wrappedArray.length != bufferedListModel.size()) {
                return false;
            }
            for (int i = 0; i < bufferedListModel.size(); i++) {
                if(super.hasValueChanged(wrappedArray[i], bufferedListModel.get(i))) {
                    return false;
                }
            }
        }
        else {
            if (((Collection)wrappedCollection).size() != bufferedListModel.size()) {
                return false;
            }
            for (Iterator i = ((Collection)wrappedCollection).iterator(), j = bufferedListModel.iterator(); i.hasNext();) {
                if (super.hasValueChanged(i.next(), j.next())) {
                    return false;
                }
            }
        }
        return true;
    }
1225526
final boolean isAnyChildIgnored() {
    if (isAnyChildIgnored == null) {
      isAnyChildIgnored = false;
      for (RecursableDiffEntity entity : childEntities()) {
        if ((entity.isIgnored() && !entity.isContentEmpty()) || entity.isAnyChildIgnored()) {
          isAnyChildIgnored = true;
          break;
        }
      }
    }
    return isAnyChildIgnored;
  }
1342911
def node_is_subclass(cls, *subclass_names):
    """"""
    if not isinstance(cls, (ClassDef, Instance)):
        return False

    # if cls.bases == YES:
    #     return False
    for base_cls in cls.bases:
        try:
            for inf in base_cls.inferred():  # pragma no branch
                if inf.qname() in subclass_names:
                    return True

                if inf != cls and node_is_subclass(  # pragma no branch
                        inf, *subclass_names):
                    # check up the hierarchy in case we are a subclass of
                    # a subclass of a subclass ...
                    return True
        except InferenceError:  # pragma no cover
            continue

    return False
225647
public boolean canTraverseOutsideSubtree()
  {

    if (null != m_left && m_left.canTraverseOutsideSubtree())
      return true;

    if (null != m_right && m_right.canTraverseOutsideSubtree())
      return true;

    return false;
  }
1008824
function () {
                var negate, p = input.charAt(i + 1);

                if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
                var o = $(this.sub) || $(this.entities.dimension) ||
                        $(this.entities.color) || $(this.entities.variable) ||
                        $(this.entities.call);

                if (negate) {
                    o.parensInOp = true;
                    o = new(tree.Negative)(o);
                }

                return o;
            }
791918
protected function isNewVariant()
    {
        $bIsNewVariant = false;
        if (!is_null($this->sRestriction) && !is_null($this->sRestrictionField) && '_id' == substr($this->sRestrictionField, -3)) {
            if ('variant_parent_id' == $this->sRestrictionField) {
                $bIsNewVariant = true;
            }
        }

        return $bIsNewVariant;
    }
1301472
@Override
    public boolean isOrderDeterministic() {
        assert(m_children != null);
        assert(m_children.size() == 1);

        // This implementation is very close to AbstractPlanNode's implementation of this
        // method, except that we assert just one child.
        // Java doesn't allow calls to super-super-class methods via super.super.
        AbstractPlanNode child = m_children.get(0);
        if (! child.isOrderDeterministic()) {
            m_nondeterminismDetail = child.m_nondeterminismDetail;
            return false;
        }

        return true;
    }
954343
public boolean isReverseIterationSupported() {
        return mNaturalClass.isArray() ||
            List.class.isAssignableFrom(mNaturalClass) ||
            Set.class.isAssignableFrom(mNaturalClass) ||
            Map.class.isAssignableFrom(mNaturalClass) ;
    }