It verifies if the graph is or not regular.

@param g
@return true, if the graph is regular; or false, on the contrary.
420710
public static function isRegular(Graph $g){
	        
	        $allVertices = $g->getVertexSet();

	        $degree = -1;
	        
	        foreach($allVertices as $vertex){
	            if($degree != -1){
	                if($g->degreeOf($vertex) != $degree)
	                    return false;
	            }
	            else $degree = $g->degreeOf($vertex);
	        }
	        
	        return true;
	    }
1130374
public function isValid()
    {
        $vertices = $this->getGraph()->getVertices()->getMap();
        // check source graph contains all vertices
        foreach ($this->getVertices()->getMap() as $vid => $vertex) {
            // make sure vertex ID exists and has not been replaced
            if (!isset($vertices[$vid]) || $vertices[$vid] !== $vertex) {
                return false;
            }
        }
        $edges = $this->getGraph()->getEdges()->getVector();
        // check source graph contains all edges
        foreach ($this->edges as $edge) {
            if (!in_array($edge, $edges, true)) {
                return false;
            }
        }

        return true;
    }
784681
@Override
	public boolean isValid() {
		if (_valid == null) {
			final byte[] check = bit.newArray(_validAlleles.length());
			_valid = _genes.forAll(g -> !getAndSet(check, g.getAlleleIndex()));
		}

		return _valid;
	}
188155
def is_cyclic(graph):
    
    path = set()

    def visit(vertex):
        path.add(vertex)
        for neighbour in graph.get(vertex, ()):
            if neighbour in path or visit(neighbour):
                return True
        path.remove(vertex)
        return False

    return any(visit(v) for v in graph)
497858
@Override
	public boolean isPrevGoupNotEq(String actualGroup) {
		if (LOGGER.isTraceEnabled()) LOGGER.trace(String.format("check group prev: %s, act: %s", this.prevGroup, actualGroup));
		return StringUtils.isEmpty(this.prevGroup) || !actualGroup.equals(this.prevGroup);
	}
13178
@Override
	public boolean validate(Graph<K, VV, EV> graph) throws Exception {
		DataSet<Tuple1<K>> edgeIds = graph.getEdges()
				.flatMap(new MapEdgeIds<>()).distinct();
		DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
				.equalTo(0).with(new GroupInvalidIds<>()).first(1);

		return invalidIds.map(new KToTupleMap<>()).count() == 0;
	}
589576
private boolean isAlone( Geometry geometryN ) {
        Coordinate[] coordinates = geometryN.getCoordinates();
        if (coordinates.length > 1) {
            Coordinate first = coordinates[0];
            Coordinate last = coordinates[coordinates.length - 1];
            for( SimpleFeature line : linesList ) {
                Geometry lineGeom = (Geometry) line.getDefaultGeometry();
                int numGeometries = lineGeom.getNumGeometries();
                for( int i = 0; i < numGeometries; i++ ) {
                    Geometry subGeom = lineGeom.getGeometryN(i);
                    Coordinate[] lineCoordinates = subGeom.getCoordinates();
                    if (lineCoordinates.length < 2) {
                        continue;
                    } else {
                        Coordinate tmpFirst = lineCoordinates[0];
                        Coordinate tmpLast = lineCoordinates[lineCoordinates.length - 1];
                        if (tmpFirst.distance(first) < SAMEPOINTTHRESHOLD || tmpFirst.distance(last) < SAMEPOINTTHRESHOLD
                                || tmpLast.distance(first) < SAMEPOINTTHRESHOLD || tmpLast.distance(last) < SAMEPOINTTHRESHOLD) {
                            return false;
                        }
                    }
                }
            }
        }
        // 1 point line or no connection, mark it as alone for removal
        return true;
    }
1033409
static <K,V> boolean checkInvariants(TreeNode<K,V> t) {
            TreeNode<K,V> tp = t.parent, tl = t.left, tr = t.right,
                tb = t.prev, tn = (TreeNode<K,V>)t.next;
            if (tb != null && tb.next != t)
                return false;
            if (tn != null && tn.prev != t)
                return false;
            if (tp != null && t != tp.left && t != tp.right)
                return false;
            if (tl != null && (tl.parent != t || tl.hash > t.hash))
                return false;
            if (tr != null && (tr.parent != t || tr.hash < t.hash))
                return false;
            if (t.red && tl != null && tl.red && tr != null && tr.red)
                return false;
            if (tl != null && !checkInvariants(tl))
                return false;
            if (tr != null && !checkInvariants(tr))
                return false;
            return true;
        }
220059
public boolean isGeneralInstance()
    {
        boolean ret = true;
        if (this.generalInstance != null) {
            ret = this.generalInstance;
        } else if (getParentType() != null) {
            ret = getParentType().isGeneralInstance();
        }
        return ret;
    }
303430
public static boolean contains(double[][] polygon, double x, double y) {
        if (polygon.length <= 2) {
            return false;
        }

        int hits = 0;

        int n = polygon.length;
        double lastx = polygon[n - 1][0];
        double lasty = polygon[n - 1][1];
        double curx, cury;

        // Walk the edges of the polygon
        for (int i = 0; i < n; lastx = curx, lasty = cury, i++) {
            curx = polygon[i][0];
            cury = polygon[i][1];

            if (cury == lasty) {
                continue;
            }

            double leftx;
            if (curx < lastx) {
                if (x >= lastx) {
                    continue;
                }
                leftx = curx;
            } else {
                if (x >= curx) {
                    continue;
                }
                leftx = lastx;
            }

            double test1, test2;
            if (cury < lasty) {
                if (y < cury || y >= lasty) {
                    continue;
                }
                if (x < leftx) {
                    hits++;
                    continue;
                }
                test1 = x - curx;
                test2 = y - cury;
            } else {
                if (y < lasty || y >= cury) {
                    continue;
                }
                if (x < leftx) {
                    hits++;
                    continue;
                }
                test1 = x - lastx;
                test2 = y - lasty;
            }

            if (test1 < (test2 / (lasty - cury) * (lastx - curx))) {
                hits++;
            }
        }

        return ((hits & 1) != 0);
    }
887056
def is_2d_regular_grid(nc, variable):
    '''
    
    '''
    # x(x), y(y), t(t)
    # X(t, y, x)

    dims = nc.variables[variable].dimensions

    cmatrix = coordinate_dimension_matrix(nc)

    for req in ('x', 'y', 't'):
        if req not in cmatrix:
            return False

    x = get_lon_variable(nc)
    y = get_lat_variable(nc)
    t = get_time_variable(nc)

    if cmatrix['x'] != (x,):
        return False
    if cmatrix['y'] != (y,):
        return False
    if cmatrix['t'] != (t,):
        return False

    # Relaxed dimension ordering
    if len(dims) == 3 and x in dims and y in dims and t in dims:
        return True
    return False
267669
public static boolean isLeaf(GraphQLType type) {
        GraphQLUnmodifiedType unmodifiedType = unwrapAll(type);
        return
                unmodifiedType instanceof GraphQLScalarType
                        || unmodifiedType instanceof GraphQLEnumType;
    }
341757
def is_regular(self):
        

        """
        warn = False
        msg = 'The given matrix'

        # check symmetry
        if np.abs(self.A - self.A.T).sum() > 0:
            warn = True
            msg = '{} is not symmetric,'.format(msg)

        # check parallel edged
        if self.A.max(axis=None) > 1:
            warn = True
            msg = '{} has parallel edges,'.format(msg)

        # check that d is d-regular
        if np.min(self.d) != np.max(self.d):
            warn = True
            msg = '{} is not d-regular,'.format(msg)

        # check that g doesn't contain any self-loop
        if self.A.diagonal().any():
            warn = True
            msg = '{} has self loop.'.format(msg)

        if warn:
            self.logger.warning('{}.'.format(msg[:-1]))
378809
private boolean isMap(Class<?> rawType) {

    // this sucks... is there really no way to work around this in GWT?
    // http://code.google.com/p/google-web-toolkit/issues/detail?id=4663
    if (rawType == Map.class) {
      return true;
    }
    Class<?> superType = rawType;
    while (superType != null) {
      if (superType == AbstractMap.class) {
        return true;
      }
      superType = superType.getSuperclass();
    }
    return false;
  }
182358
public boolean isVertex(GeometryIndex index) {
		if (index.hasChild()) {
			return isVertex(index.getChild());
		}
		return index.getType() == GeometryIndexType.TYPE_VERTEX;
	}
978369
def is_F_hypergraph(self):
        
        for hyperedge_id in self._hyperedge_attributes:
            tail = self.get_hyperedge_tail(hyperedge_id)
            if len(tail) > 1:
                return False
        return True
8606
public static JCGLType typeFromGL(
    final int type)
  {
    switch (type) {
      case GL2ES2.GL_BOOL:
        return JCGLType.TYPE_BOOLEAN;
      case GL2ES2.GL_BOOL_VEC2:
        return JCGLType.TYPE_BOOLEAN_VECTOR_2;
      case GL2ES2.GL_BOOL_VEC3:
        return JCGLType.TYPE_BOOLEAN_VECTOR_3;
      case GL2ES2.GL_BOOL_VEC4:
        return JCGLType.TYPE_BOOLEAN_VECTOR_4;

      case GL.GL_FLOAT:
        return JCGLType.TYPE_FLOAT;
      case GL2ES2.GL_FLOAT_MAT2:
        return JCGLType.TYPE_FLOAT_MATRIX_2;
      case GL2ES2.GL_FLOAT_MAT3:
        return JCGLType.TYPE_FLOAT_MATRIX_3;
      case GL2ES2.GL_FLOAT_MAT4:
        return JCGLType.TYPE_FLOAT_MATRIX_4;

      case GL3.GL_FLOAT_MAT4x3:
        return JCGLType.TYPE_FLOAT_MATRIX_4x3;
      case GL3.GL_FLOAT_MAT4x2:
        return JCGLType.TYPE_FLOAT_MATRIX_4x2;

      case GL3.GL_FLOAT_MAT3x4:
        return JCGLType.TYPE_FLOAT_MATRIX_3x4;
      case GL3.GL_FLOAT_MAT3x2:
        return JCGLType.TYPE_FLOAT_MATRIX_3x2;

      case GL3.GL_FLOAT_MAT2x4:
        return JCGLType.TYPE_FLOAT_MATRIX_2x4;
      case GL3.GL_FLOAT_MAT2x3:
        return JCGLType.TYPE_FLOAT_MATRIX_2x3;

      case GL2ES2.GL_FLOAT_VEC2:
        return JCGLType.TYPE_FLOAT_VECTOR_2;
      case GL2ES2.GL_FLOAT_VEC3:
        return JCGLType.TYPE_FLOAT_VECTOR_3;
      case GL2ES2.GL_FLOAT_VEC4:
        return JCGLType.TYPE_FLOAT_VECTOR_4;

      case GL2ES2.GL_INT:
        return JCGLType.TYPE_INTEGER;
      case GL2ES2.GL_INT_VEC2:
        return JCGLType.TYPE_INTEGER_VECTOR_2;
      case GL2ES2.GL_INT_VEC3:
        return JCGLType.TYPE_INTEGER_VECTOR_3;
      case GL2ES2.GL_INT_VEC4:
        return JCGLType.TYPE_INTEGER_VECTOR_4;

      case GL2ES2.GL_UNSIGNED_INT:
        return JCGLType.TYPE_UNSIGNED_INTEGER;
      case GL3.GL_UNSIGNED_INT_VEC2:
        return JCGLType.TYPE_UNSIGNED_INTEGER_VECTOR_2;
      case GL3.GL_UNSIGNED_INT_VEC3:
        return JCGLType.TYPE_UNSIGNED_INTEGER_VECTOR_3;
      case GL3.GL_UNSIGNED_INT_VEC4:
        return JCGLType.TYPE_UNSIGNED_INTEGER_VECTOR_4;

      case GL2ES2.GL_SAMPLER_2D:
        return JCGLType.TYPE_SAMPLER_2D;
      case GL2ES2.GL_SAMPLER_3D:
        return JCGLType.TYPE_SAMPLER_3D;
      case GL2ES2.GL_SAMPLER_CUBE:
        return JCGLType.TYPE_SAMPLER_CUBE;
      default:
        throw new UnreachableCodeException();
    }
  }