Returns an Edge by its source and target Nodes.
@access		public
@param		ADT_Graph_Node	$source		Source Node of the Edge
@param		ADT_Graph_Node	$target		Target Node of the Edge
@return		ADT_Graph_Edge
342012
public function getEdge( $source, $target )
	{
		if( $source->getNodeName() < $target->getNodeName() )
			return $this->edgeSet->getEdge( $source, $target );
		else
			return $this->edgeSet->getEdge( $target, $source );
	}
1164147
public function isPath( $source, $target, $hadNodes = array() )
	{
		if( $this->isEdge( $source, $target ) )
			return true;
		$nodes = $this->getTargetNodes( $source );
		$hadNodes[] = $source->getNodeName();
		foreach( $nodes as $node )
			if( !in_array( $node->getNodeName(), $hadNodes ) )
				if( $this->isPath( $node, $target, $hadNodes ) )
					return true;
		return false;
	}
1165310
public static function mergeConfigurations($target, $source)
    {
        foreach (['attributes', 'entities', 'relationships', 'autocode', 'languages', 'frameworks', 'orms'] as $configurationPart) {
            if (isset($source[$configurationPart])) {
                $target[$configurationPart] = self::mergeArrays($target[$configurationPart], $source[$configurationPart]);
            }
        }

        return $target;
    }
1363027
protected function getPathsRecursion(Vertex $start, DirectedEdge $edge)
    {
        // We don't want to visit the same vertex twice within a single path. (avoid loops)
        if (in_array($start->get_data(), $this->current_path)) {
            $this->paths[] = array_reverse($this->current_path);

            return;
        }

        $this->current_path[] = $start->get_data();

        if ($start->incoming_edges->count() == 0) {
            $this->paths[] = array_reverse($this->current_path);

            return;
        }

        /**
         * @var DirectedEdge
         */
        foreach ($start->incoming_edges as $edge) {
            $this->getPathsRecursion($edge->get_source(), $edge);

            //remove the item that was added by the child
            array_pop($this->current_path);
        }
    }
630473
def nx_all_nodes_between(graph, source, target, data=False):
    
    import utool as ut
    if source is None:
        # assume there is a single source
        sources = list(ut.nx_source_nodes(graph))
        assert len(sources) == 1, (
            'specify source if there is not only one')
        source = sources[0]
    if target is None:
        # assume there is a single source
        sinks = list(ut.nx_sink_nodes(graph))
        assert len(sinks) == 1, (
            'specify sink if there is not only one')
        target = sinks[0]
    all_simple_paths = list(nx.all_simple_paths(graph, source, target))
    nodes = sorted(set.union(*map(set, all_simple_paths)))
    return nodes
289385
protected static function createLink( $source, $target )
	{
		if( file_exists( $target ) === false && @symlink( $source, $target ) === false )
		{
			$source = realpath( __DIR__ . '/' . $source );

			if( symlink( $source, $target ) === false ) {
				throw new \RuntimeException( sprintf( 'Failed to create symlink for "%1$s" to "%2$s"', $source, $target ) );
			}
		}
	}
1165094
def getNextNode(nodes,usednodes,parent):
    ''''''
    for e in edges:
        if e.source==parent:
            if e.target in usednodes:
                x = e.target
                break
        elif e.target==parent:
            if e.source in usednoes:
                x = e.source
                break  
    return x
1337156
private function link(string $source, string $target): bool
    {
        if (!@link($source, $target)) {
            $message = 'Could not create link.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return true;
    }
244839
protected function arrayMerge(array $target, array $source)
    {
        foreach ($source as $key => $value) {
            if ($value instanceof MergingInterface) {
                $value = $value->toArray();
            }
            if (isset($target[$key]) || array_key_exists($key, $target)) {
                if (is_int($key)) {
                    $target[] = $value;
                } elseif (is_array($value) && is_array($target[$key])) {
                    $target[$key] = $this->arrayMerge($target[$key], $value);
                } else {
                    $target[$key] = $value;
                }
            } else {
                $target[$key] = $value;
            }
        }

        return $target;
    }
1072034
public function copy($source, $target) {
        // using mark.
        if ('@' == $source[0]) $source = $this->as($source);
        if ('@' == $target[0]) $target = $this->as($target);

        // copy file.
        if (is_file($source)) return copy($source, $target);

        // copy directory.
        $handle = opendir($source);
        while (false !== ($name = readdir($handle))) {
            if ('.' == $name or '..' == $name) continue;
            $subsource = $source.self::DS.$name;
            $subtarget = $target.self::DS.$name;
            if (!$this->copy($subsource, $subtarget)) return false;
        }
        closedir($handle);
        return true;
    }
1057556
public function convertToMp3($source, $target)
    {
        $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);
       
        $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y')
            ->addCommand('-i', $source)
            ->addCommand('-vn')
            ->addCommand('-ar', '44100')
            ->addCommand('-ac', '2')
            ->addCommand('-ab', '192')
            ->addCommand('-f', 'mp3')
            ->setOutputPath($target)
            ->execute();
        
        return $target;
    }
69591
function (target, source) {
            if (this.children) {
                if(target.parentNode){
                    target.parentNode.removeChild(target);
                }
                for (var i = 0, ci; ci = this.children[i]; i++) {
                    if (ci === source) {
                        this.children.splice(i + 1, 0, target);
                        target.parentNode = this;
                        return target;
                    }

                }
            }
        }
81382
public static function directoryDiff($source, $target)
    {
        $sourceFiles = self::globr($source, '*');
        $targetFiles = self::globr($target, '*');

        $sourceFiles = array_map(function ($file) use ($source) {
            return str_replace($source, '', $file);
        }, $sourceFiles);

        $targetFiles = array_map(function ($file) use ($target) {
            return str_replace($target, '', $file);
        }, $targetFiles);

        $diff = array_diff($targetFiles, $sourceFiles);

        return array_values($diff);
    }
555840
public function map($source, &$target)
    {
        $source = static::makeSource($source);
        $writer = static::makeWriter($target);

        foreach ($this->fields as $field) {
            try {
                $writer::set($target, $field->getName(), $field->getDefinition()->getValue($source));
            } catch (SourceFieldMissingException $e) {
                if ($this->ignoreAllMissing) {
                    continue;
                }
                throw $e;
            } catch (IgnoreFieldException $e) {
                continue;
            }
        }
    }
718071
def edge_by_target(self):
        """"""
        if self._edge_by_target is None:
            self._edge_by_target = reverse_edge_by_source_dict(self._edge_by_source_id,
                                                               self._nexson_tree['^ot:rootNodeId'])
        return self._edge_by_target
127623
protected function mapJoinTable(array $target = [], array $source = [])
    {
        $joinTable['name'] = $target['name'];

        if ($this->hasJoinColumns($target)) {
            $joinTable['joinColumns'] = $this->mapJoinColumns(
                $target['joinColumns'],
                $source['joinColumns']
            );
        }

        if ($this->hasInverseJoinColumns($target)) {
            $joinTable['inverseJoinColumns'] = $this->mapJoinColumns(
                $target['inverseJoinColumns'],
                $source['inverseJoinColumns']
            );
        }

        return $joinTable;
    }
512244
public static function toTarget(Certificate $target,
        CertificateBundle $trust_anchors, CertificateBundle $intermediate = null): self
    {
        $builder = new CertificationPathBuilder($trust_anchors);
        return $builder->shortestPathToTarget($target, $intermediate);
    }