determineIfLocal tries to determine if the connection to MPD is local
@return bool
170899
public function determineIfLocal() {

		// Default it to false
		$this->local = false;

		// Compare the MPD host a few different ways to try and determine if it's local to the Apache server
		if( 	( stream_is_local( $this->socket )) ||
			( $this->host == (isset($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_ADDR"] : getHostByName( getHostName() ))) ||
			( $this->host == 'localhost' ) || 
			( $this->host == '127.0.0.1' )) {

			$this->local = true;
		}
	}
1024459
function hasFileInLocal(url, mockFileDir) {
    var filePath = findInLocal(url, mockFileDir);
    var status;
    try{
        status = fs.statSync(filePath);
    }catch(e){
        return false;
    }
    return status.isFile();
}
683690
public function isLocal()
    {
        if($this->hasValidResource()) {
            return stream_is_local($this->resource);
        }
        if ($url = $this->url()) {
            return stream_is_local("$url");
        }
        return false;
    }
102549
public boolean isNoLocal()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "isNoLocal");
            SibTr.exit(this, tc, "isNoLocal", Boolean.valueOf(noLocal));
        }

        return noLocal;
    }
1189883
public function isWorking()
    {
        // test with an example IP to make sure the provider is working
        // NOTE: At the moment only country, region & city info is tested.
        try {
            $supportedInfo = $this->getSupportedLocationInfo();

            list($testIp, $expectedResult) = self::getTestIpAndResult();

            // get location using test IP
            $location = $this->getLocation(array('ip' => $testIp));

            // check that result is the same as expected
            $isResultCorrect = true;
            foreach ($expectedResult as $key => $value) {
                // if this provider is not configured to support this information type, skip it
                if (empty($supportedInfo[$key])) {
                    continue;
                }

                if (empty($location[$key])
                    || $location[$key] != $value
                ) {
                    $isResultCorrect = false;
                }
            }

            if (!$isResultCorrect) {
                $unknown = Piwik::translate('General_Unknown');

                $location = "'"
                    . (empty($location[self::CITY_NAME_KEY]) ? $unknown : $location[self::CITY_NAME_KEY])
                    . ", "
                    . (empty($location[self::REGION_CODE_KEY]) ? $unknown : $location[self::REGION_CODE_KEY])
                    . ", "
                    . (empty($location[self::COUNTRY_CODE_KEY]) ? $unknown : $location[self::COUNTRY_CODE_KEY])
                    . "'";

                $expectedLocation = "'" . $expectedResult[self::CITY_NAME_KEY] . ", "
                    . $expectedResult[self::REGION_CODE_KEY] . ", "
                    . $expectedResult[self::COUNTRY_CODE_KEY] . "'";

                $bind = array($testIp, $location, $expectedLocation);
                return Piwik::translate('UserCountry_TestIPLocatorFailed', $bind);
            }

            return true;
        } catch (Exception $ex) {
            return $ex->getMessage();
        }
    }
738482
public final boolean isNoLocal() {
    boolean result = false;
    // if the value is unset then it has come from an environment with back level schema
    if (jmo.getChoiceField(ControlAccess.BODY_CREATEDURABLE_NOLOCAL) != ControlAccess.IS_BODY_CREATEDURABLE_NOLOCAL_UNSET) {
      result = jmo.getBooleanField(ControlAccess.BODY_CREATEDURABLE_NOLOCAL_VALUE);
    }
    return result;
  }
942918
def is_local(self):
        """"""
        from ambry.orm.exc import NotFoundError
        try:
            if self.local_datafile.exists:
                return True
        except NotFoundError:
            pass

        return False
1320912
function DetectLocalIPAddress(callback) {
            if (!DetectRTC.isWebRTCSupported) {
                return;
            }

            if (DetectRTC.isORTCSupported) {
                return;
            }

            getIPs(function(ip) {
                //local IPs
                if (ip.match(/^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/)) {
                    callback('Local: ' + ip);
                }

                //assume the rest are public IPs
                else {
                    callback('Public: ' + ip);
                }
            });
        }
458046
public function say_local_path()
  {
    if ( ($pp = $this->get_prepath()) && (strpos($this->path, $pp) === 0) ){
      return substr($this->path, \strlen($pp));
    }
    return $this->path;
  }
163350
protected function _getLocalMTime()
    {
        if (!is_readable($this->localFile) || !is_file($this->localFile)) {
            throw new Exception("Local file is not readable");
        }

        return filemtime($this->localFile);
    }
62813
def is_local_replica(pid):
    """"""
    return d1_gmn.app.models.LocalReplica.objects.filter(pid__did=pid).exists()
1015767
public function hasManifest()
    {
        $server = $this->releasesManager->getCurrentReleasePath($this->manifest);
        $server = $this->bash->fileExists($server);

        $local = $this->getManifestPath();
        $local = $this->files->has($local);

        return $local || $server;
    }
164517
protected static function _searchLocaleDirectory()
    {
        if (static::$_pearDirectory !== '@data_dir@') {
            $directory = static::$_pearDirectory . '/' . static::$_domain . '/locale';
            if (file_exists($directory)) {
                return $directory;
            }
        }

        $directories = static::_getSearchDirectories();
        foreach ($directories as $directory) {
            if (file_exists($directory)) {
                return $directory;
            }
        }

        return false;
    }
1227138
function localeIsLoaded(locale) {
  return !!(Cldr._raw && Cldr._raw.main && Cldr._raw.main[getLocaleKey(locale)]);
}
733704
public function locally()
    {
        list(
            $this->item,
            $this->itemIterator,
            $this->itemIteratorTotal,
            $this->popIndex,
            $this->upIndex,
            $this->currentIndex
        ) = $this->itemStack[$this->localIndex];

        // Remember any  un-completed (resetLocalScope hasn't been called) lookup chain. Even if there isn't an
        // un-completed chain we need to store an empty item, as resetLocalScope doesn't know the difference later
        $this->localStack[] = array_splice($this->itemStack, $this->localIndex + 1);

        return $this;
    }
1220276
public function isLocalPrimaryKey()
    {
        $localCols = $this->getLocalColumns();

        $localPKColumnObjs = $this->getTable()->getPrimaryKey();

        $localPKCols = array();
        foreach ($localPKColumnObjs as $lPKCol) {
            $localPKCols[] = $lPKCol->getName();
        }

        return ((count($localPKCols) === count($localCols)) && !array_diff($localPKCols, $localCols));
    }
1315103
public function getLocaleList()
    {
        if (null === $this->localeList) {
            $this->setLocaleList(LocaleUtils::getNamedList(Locale::getDefault()));
        }

        return $this->localeList;
    }