checks whether the graph has any directed edges

This method is intentionally not named "isDirected()" (aka digraph),
because that might be misleading in regards to empty and/or mixed graphs.

@return boolean
552696
public function hasDirected()
    {
        foreach ($this->set->getEdges() as $edge) {
            if ($edge instanceof EdgeDirected) {
                return true;
            }
        }

        return false;
    }
448623
public boolean hasInEdges() {
		final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_IN);
		return docs != null && !docs.isEmpty();
	}
430612
public function isTethered(): bool
    {
        $parent = $this->getParent();
        if ($parent === null) {
            return false;
        }
        if (array_key_exists($this->getName(), $parent->getNodeType()->getAutoCreatedChildNodes())) {
            return true;
        }

        return false;
    }
1079214
public static function checkBrowserEdge()
    {
        if (stripos(self::$userAgentString, 'Edge') !== false) {
            $version = explode('Edge/', self::$userAgentString);
            if (isset($version[1])) {
                self::$browser->setVersion((float)$version[1]);
            }
            self::$browser->setName(Browser::EDGE);

            return true;
        }

        return false;
    }
564239
def has_causal_in_edges(graph: BELGraph, node: BaseEntity) -> bool:
    """"""
    return any(
        data[RELATION] in CAUSAL_RELATIONS
        for _, _, data in graph.in_edges(node, data=True)
    )
490745
public function isNewItemAdded()
    {
        if ($this->_blNewITemAdded == null) {
            $this->_blNewITemAdded = (bool) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("blAddedNewItem");
            \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blAddedNewItem");
        }

        return $this->_blNewITemAdded;
    }
913539
public function hasDirtyModels()
    {
        foreach ($this->models as $model) {
            if (true === $model->isDirty()) {
                return true;
            }
        }
        return false;
    }
915670
public boolean hasOutEdges() {
		final Set<ODocument> docs = document.field(OGraphDatabase.VERTEX_FIELD_OUT);
		return docs != null && !docs.isEmpty();
	}
569554
public function isCircular()
    {
        return count($this->points) > 3 &&  $this->points[0] == $this->points[ count($this->points) -1 ];
    }
1153717
function Graph(directed) {
  this.directed = (directed === undefined ? true : !!directed);
  this.adjList = Object.create(null);
  this.vertices = new HashSet();
}
91733
private function isAcyclic()
    {
        $returnValue = (bool) false;

        
        
        // To detect if the dependency graph is acyclic or not,
    	// we first perform a usual Topological Sorting algorithm.
    	// If at the end of the algorith, we still have edges,
    	// the graph is cyclic !
    	
    	
    	$l = array(); // Empty list where elements are sorted.
    	$q = array(); // Set of nodes with no incoming edges.
    	
    	$components = $this->getComponents();
    	$dependencies = $this->getDependencies(); // used as a copy !
    	
    	// Set q with nodes with no incoming edges.
    	foreach ($components as $c){
    		$incomingEdges = false;
    		
    		foreach ($dependencies as $d){
    			if ($c === $d['isDependencyOf']){
    				// $c has incoming edges thus we reject it.
    				$incomingEdges = true;
    				break;
    			}
    		}
    		
    		if ($incomingEdges == false){
    			array_push($q, $c);
    		}
    	}
    	
    	while (count($q) > 0){
    		$n = array_pop($q);
    		array_push($l, $n);
    		
    		foreach ($components as $m){
    			// edge from n to m ?
    			foreach ($dependencies as $k => $dep){
    				if ($dep['component'] === $n && $dep['isDependencyOf'] === $m){
    					unset($dependencies[$k]);
    					
    					// other incoming edges for m ?
    					foreach ($dependencies as $dep){
    						if ($dep['isDependencyOf'] === $m){
    							break 2;
    						}
    					}
    					
    					// no incoming edges from m !
    					array_push($q, $m);
    				}
    			}
    		}
    	}
    	
    	$returnValue = count($dependencies) == 0;
        

        return (bool) $returnValue;
    }
932192
def is_causal_central(graph: BELGraph, node: BaseEntity) -> bool:
    
    return has_causal_in_edges(graph, node) and has_causal_out_edges(graph, node)
830452
public boolean hasDSLSentences() {

        if (this.lhs != null) {
            for (IPattern pattern : this.lhs) {
                if (pattern instanceof DSLSentence) {
                    return true;
                }
            }
        }

        if (this.rhs != null) {
            for (IAction action : this.rhs) {
                if (action instanceof DSLSentence) {
                    return true;
                }
            }
        }

        return false;
    }
541242
public function isRedirect()
    {
        $codes = [
            static::STATUS_MOVED_PERMANENTLY,
            static::STATUS_FOUND,
            static::STATUS_SEE_OTHER,
            static::STATUS_TEMPORARY_REDIRECT,
        ];

        return (
            in_array($this->code, $codes) &&
            $this->getHeaderLine('Location')
        );
    }
1317997
protected function checkBrowserEdge()
    {
        if (stripos($this->_agent, 'Edge/') !== false) {
            $aresult = explode('/', stristr($this->_agent, 'Edge'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                $this->setVersion($aversion[0]);
                $this->setBrowser(self::BROWSER_EDGE);
                if (stripos($this->_agent, 'Windows Phone') !== false || stripos($this->_agent, 'Android') !== false) {
                    $this->setMobile(true);
                }
                return true;
            }
        }
        return false;
    }
306196
final public function inMiddle () : bool
    {
        return ($this->lastPage() - ($this->adjacent * 2) > $this->currentPage && $this->currentPage > ($this->adjacent * 2)) ? TRUE : FALSE;
    }
440477
def reverse(self):
        
        assert self.DIRECTED, "Undirected graph types such as %s cannot be reversed" % self.__class__.__name__
        
        N = self.__class__()
    
        #- Add the nodes
        N.add_nodes( n for n in self.nodes() )
    
        #- Add the reversed edges
        for (u, v) in self.edges():
            wt = self.edge_weight((u, v))
            label = self.edge_label((u, v))
            attributes = self.edge_attributes((u, v))
            N.add_edge((v, u), wt, label, attributes)
        return N