Returns the value of an Edge.
@access		public
@param		ADT_Graph_Node	$source		Source Node of this Edge
@param		ADT_Graph_Node	$target		Target Node of this Edge
@return		int
356035
public function getEdgeValue( $source, $target )
	{
		$value = 0;
		if( $this->isEdge( $source, $target ) )
		{
			$edge	= $this->getEdge( $source, $target );
			$value	= $edge->getEdgeValue();
		}
		return $value;
	}
168989
public function cloneProperties($target, $source)
    {
        $this->validaObjects($target, $source);

        $reflection = new \ReflectionClass($target);
        foreach ($reflection->getProperties() as $property) {

            $this->propertyAccessor->setValue(
                $target,
                $property->getName(),
                $this->propertyAccessor->getValue($source, $property->getName())
            );
        }
    }
420551
static protected function _resolve_target(\DOMNode $node, $target, $value)
    {
        if ($target[0] === "!") {
            // Function call
            $func = "_" . mb_substr($target, 1);

            return self::$func($node, $value);
        }

        return $value ? sprintf($target, $value) : "";
    }
73908
public static function copyRecursive($source, $target)
    {
        // handle symlinks
        if (is_link($source)) {
            return symlink(readlink($source), $target);
        }

        // copy a single file
        if (is_file($source)) {
            return copy($source, $target);
        }

        // make target directory
        if (!is_dir($target)) {
            mkdir($target, 0755);
        }

        $handle = opendir($source);
        // loop through the directory
        while (($file = readdir($handle)) !== false) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            $from = $source . DIRECTORY_SEPARATOR . $file;
            $to = $target . DIRECTORY_SEPARATOR . $file;

            if (is_file($from)) {
                copy($from, $to);
            } else {
                // recursive copy
                static::copyRecursive($from, $to);
            }
        }
        closedir($handle);

        return true;
    }
942696
public static function unlinkTargetFilesNotPresentInSource($source, $target)
    {
        $diff = self::directoryDiff($source, $target);
        $diff = self::sortFilesDescByPathLength($diff);

        foreach ($diff as $file) {
            $remove = $target . $file;

            if (is_dir($remove)) {
                @rmdir($remove);
            } else {
                self::deleteFileIfExists($remove);
            }
        }
    }
1175401
public function copy($target, $source)
    {
        if (!$this->exists($target)) {
            throw new \RuntimeException("$target does not exist.", E_ERROR);
        }

        if (!$this->exists($source)) {
            $this->makeDirectory(dirname($source), true);
        }

        return file_put_contents($source, $this->get($target));
    }
590247
private function copyTarget(TranslationValueInterface $source, WritableTranslationValueInterface $target): void
    {
        if (self::DO_NOT_COPY === $this->copyTarget) {
            return;
        }

        if ((($oldValue = $target->getTarget()) === ($newValue = $source->getTarget()))
            || ($target->isTargetEmpty() && $source->isTargetEmpty())
        ) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Target is same, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );
            return;
        }

        if ((self::COPY_IF_EMPTY === $this->copyTarget) && !$target->isTargetEmpty()) {
            $this->logger->log(
                $this->logLevel,
                '{key}: Target is not empty, no need to update.',
                ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
            );

            return;
        }

        $this->logger->log(
            LogLevel::NOTICE,
            '{key}: Updating target value.',
            ['key' => $target->getKey(), 'old' => $oldValue, 'new' => $newValue]
        );

        if ($this->dryRun) {
            return;
        }

        if (null === $value = $source->getTarget()) {
            $target->clearTarget();
            return;
        }
        $target->setTarget($value);
    }
504521
def get_edge_weight(source, destination)
      if contains_edge?(source, destination)
        @edges[source][destination]
      else
        Float::INFINITY
      end
    end
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;
    }
510535
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if (!$target instanceof SupportedTarget) {
            return false;
        }

        if (is_null(self::getPrimitiveType($source))) {
            return false;
        }

        return true;
    }
780670
private function addAllRecursive($source, $target, array $path = [])
    {
        foreach ($source as $key => $value)
        {
            if (!isset($target[$key]))
            {
                $target[$key] = $value;
            }
            else
            {
                $tgt = $target[$key];

                if (is_array($source) || $source instanceof Dictionary)
                {
                    if ($tgt instanceof Dictionary)
                        $this->addAllRecursive($value, $tgt);
                    else
                        $target[$key] = $value;
                }
                else
                    $target[$key] = $value;
            }
        }
    }
653277
public function addEdge( $source, $target, $value = 1 )
	{
		return $this->edgeSet->addEdge( $source, $target, $value );
	}
785250
public static function get(string $target)
    {
        if (!self::has($target)) {
            return null;
        }

        if (!isset(self::$unserialized[$target])) {
            self::$unserialized[$target] = unserialize(self::$annotations[$target]);
        }

        return self::$unserialized[$target];
    }
1211993
public function getStartCrop($origin, $target, $focus)
    {
        $focusPx = round(($origin * $focus) / 100);
        $start = $focusPx - ($target / 2);

        if ($start <= 0) {
            return 0;
        }

        if (($start + $target) >= $origin) {
            return $origin - $target;
        }

        return $start;
    }
925963
public static function dataGet( $target, $key, $default = NULL )
    {
        if ( is_null( $key ) ) return $target;

        foreach ( explode( '.', $key ) as $segment )
        {
            if ( is_array( $target ) )
            {
                if ( !array_key_exists( $segment, $target ) )
                {
                    return static::value( $default );
                }

                $target = $target[ $segment ];
            }
            elseif ( is_object( $target ) )
            {
                if ( !isset( $target->{$segment} ) )
                {
                    return static::value( $default );
                }

                $target = $target->{$segment};
            }
            else
            {
                return static::value( $default );
            }
        }

        return $target;
    }
1269636
public function resolvePath (string $source, string $target) : string
    {
        $sourceDirs = $this->toDirectoryFragments(\dirname($source));
        $targetFileName = \basename($target);

        // if relative path is absolute, just return the absolute path
        if ("/" === \substr($target, 0, 1))
        {
            return $target;
        }

        // strip leading "./"
        if ("./" === \substr($target, 0, 2))
        {
            $target = \substr($target, 2);
        }

        $targetDirs = $this->toDirectoryFragments(\dirname($target));

        // if the relative dirs are empty (it is just a file name), use the same directory
        if (empty($targetDirs))
        {
            return $this->buildFilePath($sourceDirs, $targetFileName);
        }

        // strip leading "../../" from the beginning of the relative dir and simultaneously from the end of the source dir
        while (!empty($targetDirs) && ".." === $targetDirs[0])
        {
            \array_pop($sourceDirs);
            \array_shift($targetDirs);
        }

        return $this->buildFilePath(
            \array_merge($sourceDirs, $targetDirs),
            $targetFileName
        );
    }
279039
public function copy($target) {
        if (!parent::copy($target))
            return false;
        return copy($this->fileSource, $target);
    }