Check if the given edge has an evidence.
509008
def has_edge_evidence(self, u: BaseEntity, v: BaseEntity, key: str) -> bool:
        """"""
        return self._has_edge_attr(u, v, key, EVIDENCE)
385789
def assertit(self):
        """"""
        if self.asserted:
            raise RuntimeError("Fact already asserted")

        lib.EnvAssignFactSlotDefaults(self._env, self._fact)

        if lib.EnvAssert(self._env, self._fact) == ffi.NULL:
            raise CLIPSError(self._env)
107729
def _validate_non_edges_do_not_have_edge_like_properties(class_name, properties):
    """"""
    has_source = EDGE_SOURCE_PROPERTY_NAME in properties
    has_destination = EDGE_DESTINATION_PROPERTY_NAME in properties

    if has_source or has_destination:
        raise IllegalSchemaStateError(u'Found a non-edge class that defines edge-like "in" or '
                                      u'"out" properties: {} {}'.format(class_name, properties))

    for property_name, property_descriptor in six.iteritems(properties):
        if property_descriptor.type_id == PROPERTY_TYPE_LINK_ID:
            raise IllegalSchemaStateError(u'Non-edge class "{}" has a property of type Link, this '
                                          u'is not allowed: {}'.format(class_name, property_name))
756358
static <T> GraphTraversal<T, Edge> isEdge(GraphTraversal<T, ? extends Element> traversal) {
        // This cast is safe because we filter only to edges
        //noinspection unchecked
        return (GraphTraversal<T, Edge>) traversal.filter(e -> e.get() instanceof Edge);
    }
781037
def handle_set_evidence(self, _, __, tokens: ParseResults) -> ParseResults:
        """"""
        self.evidence = tokens['value']
        return tokens
296574
def get_edges_with_citation(self, citation: Citation) -> List[Edge]:
        """"""
        return self.session.query(Edge).join(Evidence).filter(Evidence.citation == citation)
346228
def find(self, i):
        '''
        
        '''
        current = i
        edge_list = []
        while len(self.get_neighbors(current)) != 0:
            successor = self.get_neighbors(current)[0]
            edge_list.append((current, successor))
            current = successor
        if self.optimize:
            for e in edge_list:
                if e[1] != current:
                    self.del_edge((e[0], e[1]))
                    self.add_edge(e[0], current)
        return current
591589
def has_edge(self, edge):
        
        u, v = edge
        return (u, v) in self.edge_properties
463838
def _get_edge_sign(im, edge):
    """"""
    edge_data = im[edge[0]][edge[1]]
    # Handle possible multiple edges between nodes
    signs = list(set([v['sign'] for v in edge_data.values()
                                  if v.get('sign')]))
    if len(signs) > 1:
        logger.warning("Edge %s has conflicting polarities; choosing "
                       "positive polarity by default" % str(edge))
        sign = 1
    else:
        sign = signs[0]
    if sign is None:
        raise Exception('No sign attribute for edge.')
    elif abs(sign) == 1:
        return sign
    else:
        raise Exception('Unexpected edge sign: %s' % edge.attr['sign'])
194412
public function hasUndirected()
    {
        foreach ($this->set->getEdges() as $edge) {
            if ($edge instanceof EdgeUndirected) {
                return true;
            }
        }

        return false;
    }
1016246
def _validate_edges_do_not_have_extra_links(class_name, properties):
    """"""
    for property_name, property_descriptor in six.iteritems(properties):
        if property_name in {EDGE_SOURCE_PROPERTY_NAME, EDGE_DESTINATION_PROPERTY_NAME}:
            continue

        if property_descriptor.type_id == PROPERTY_TYPE_LINK_ID:
            raise IllegalSchemaStateError(u'Edge class "{}" has a property of type Link that is '
                                          u'not an edge endpoint, this is not allowed: '
                                          u'{}'.format(class_name, property_name))
281112
public boolean contains(float x, float y) {
    	checkPoints();
    	if (points.length == 0) {
    		return false;
    	}
    	
        boolean result = false;
        float xnew,ynew;
        float xold,yold;
        float x1,y1;
        float x2,y2;
        int npoints = points.length;

        xold=points[npoints - 2];
        yold=points[npoints - 1];
        for (int i=0;i < npoints;i+=2) {
             xnew = points[i];
             ynew = points[i + 1];
             if (xnew > xold) {
                  x1 = xold;
                  x2 = xnew;
                  y1 = yold;
                  y2 = ynew;
             }
             else {
                  x1 = xnew;
                  x2 = xold;
                  y1 = ynew;
                  y2 = yold;
             }
             if ((xnew < x) == (x <= xold)          /* edge "open" at one end */
              && ((double)y - (double)y1) * (x2 - x1)
               < ((double)y2 - (double)y1) * (x - x1)) {
                  result = !result;
             }
             xold = xnew;
             yold = ynew;
        }
        
        return result;
    }
1320308
def p_edgesigs(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
1037098
def get_causal_edge(stmt, activates):
    """"""
    any_contact = any(
        evidence.epistemics.get('direct', False)
        for evidence in stmt.evidence
    )
    if any_contact:
        return pc.DIRECTLY_INCREASES if activates else pc.DIRECTLY_DECREASES

    return pc.INCREASES if activates else pc.DECREASES
382563
def check_fault_data(cls, edges, mesh_spacing):
        
        if not len(edges) >= 2:
            raise ValueError("at least two edges are required")
        if not all(len(edge) >= 2 for edge in edges):
            raise ValueError("at least two points must be defined "
                             "in each edge")
        if not mesh_spacing > 0.0:
            raise ValueError("mesh spacing must be positive")

        cls.check_surface_validity(edges)
        cls.check_aki_richards_convention(edges)
663532
def has_edge(self, p_from, p_to):
        
        return p_from in self._edges and p_to in self._edges[p_from]
1331467
def select_neighbors_by_edge_attribute(docgraph, source,
                                       attribute=None, value=None, data=False):
    """"""
    assert isinstance(docgraph, MultiGraph)
    for neighbor_id in docgraph.neighbors_iter(source):
        edges = docgraph[source][neighbor_id].values()

        if attribute is None:
            has_attrib = True # don't filter neighbors
        else:
            has_attrib = any(attribute in edge for edge in edges)

        if has_attrib:
            if value is None:
                has_value = True
            elif isinstance(value, basestring):
                has_value = any(edge.get(attribute) == value
                                for edge in edges)
            else:  # ``value`` is a list/set/dict of values
                has_value = any(edge.get(attribute) == v
                                for edge in edges
                                for v in value)

            if has_value:
                if data:
                    yield (neighbor_id, docgraph.node[neighbor_id])
                else:
                    yield neighbor_id