Returns an array of locations that are considered out of scope for the given
location.
183147
function findOutOfScopeLocations(
  sourceId: string,
  position: AstPosition
): AstLocation[] {
  const { functions, comments } = findSymbols(sourceId);
  const commentLocations = comments.map(c => c.location);
  let locations = functions
    .map(getLocation)
    .concat(commentLocations)
    .sort(sortByStart);
  // Must remove inner locations then filter, otherwise,
  // we will mis-judge in-scope inner locations as out of scope.
  locations = removeInnerLocations(locations, position).filter(
    loc => !containsPosition(loc, position)
  );
  return removeOverlaps(locations);
}
1095242
public static location[] get(nitro_service service) throws Exception{
		location obj = new location();
		location[] response = (location[])obj.get_resources(service);
		return response;
	}
225886
def collectLocations(self):
        
        pts = []
        for l, (value, deltaName) in self.items():
            pts.append(Location(l))
        return pts
1012940
protected function getArray(Location $location): array
    {
        $properties = array_filter($location->toArray(), function ($value) {
            return !empty($value);
        });

        unset(
            $properties['latitude'],
            $properties['longitude'],
            $properties['bounds']
        );

        if (0 === count($properties)) {
            $properties = null;
        }

        $lat = 0;
        $lon = 0;
        if (null !== $coordinates = $location->getCoordinates()) {
            $lat = $coordinates->getLatitude();
            $lon = $coordinates->getLongitude();
        }

        $array = [
            'type' => 'Feature',
            'geometry' => [
                'type' => 'Point',
                'coordinates' => [$lon, $lat],
            ],
            'properties' => $properties,
        ];

        if (null !== $bounds = $location->getBounds()) {
            $array['bounds'] = $bounds->toArray();
        }

        return $array;
    }
363706
private String getLocation()
    {
        Collection<InetAddress> localAddresses = FBUtilities.getAllLocalAddresses();

        for (InetAddress address : localAddresses)
        {
            for (String location : split.getLocations())
            {
                InetAddress locationAddress = null;
                try
                {
                    locationAddress = InetAddress.getByName(location);
                }
                catch (UnknownHostException e)
                {
                    throw new AssertionError(e);
                }
                if (address.equals(locationAddress))
                {
                    return location;
                }
            }
        }
        return split.getLocations()[0];
    }
1168409
def get_by_location(cls, location, include_deactivated=False):
        """"""
        if include_deactivated:
            view = views.service_location
        else:
            view = views.active_service_location

        result = yield view.first(key=location, include_docs=True)
        parent = cls.parent_resource(**result['doc'])

        raise Return(cls(parent=parent, **result['value']))
617710
def unpack_scope(cls, scope):
        """"""
        query = {}
        projection = {}
        options = {}

        if isinstance(scope, tuple):
            if len(scope) > 3:
                raise ValueError("Invalid scope")
            if len(scope) >= 1:
                query = scope[0]
            if len(scope) >= 2:
                projection = scope[1]
            if len(scope) == 3:
                options = scope[2]
        elif isinstance(scope, dict):
            query = scope
        else:
            raise ValueError("Invalid scope")

        return query, projection, options
626704
def GetRandomLocationsNearStops(schedule):
  """"""
  locations = []
  for s in schedule.GetStopList():
    locations.append(AddNoiseToLatLng(s.stop_lat, s.stop_lon))
  return locations
918418
protected function prioritizeMainLocation(array $locations): array
    {
        foreach ($locations as $key => $location) {
            if ($location->main) {
                unset($locations[$key]);
                array_unshift($locations, $location);
                break;
            }
        }

        return $locations;
    }
225737
private static Location scanLocations(List<Location> locations, LocationPredicate predicate) {
		Location location = null;
		for (Location l : locations) {
			if (location == null) {
				location = l;
			}
			else {
				if (predicate.accept(location, l)) {
					location = l;
				}
			}
		}
		return location;
	}
771392
private static function findLocation(): ?array
    {
        foreach (\debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $item) {
            if (isset($item['class']) && $item['class'] === __CLASS__) {
                $location = $item;
                continue;
            }

            if (isset($item['function'])) {
                try {
                    $reflection = isset($item['class'])
                        ? new \ReflectionMethod($item['class'], $item['function'])
                        : new \ReflectionFunction($item['function']);
                    if ($reflection->isInternal() || \preg_match('#\s@tracySkipLocation\s#',
                            (string) $reflection->getDocComment())) {
                        $location = $item;
                        continue;
                    }
                } catch (\ReflectionException $e) {
                }
            }
            break;
        }

        if (isset($location['file'], $location['line']) && \is_file($location['file'])) {
            $lines = \file($location['file']);
            $line = $lines[$location['line'] - 1];

            return [
                $location['file'],
                $location['line'],
                \trim(\preg_match('#\w*dump(er::\w+)?\(.*\)#i', $line, $m) ? $m[0] : $line),
            ];
        }

        return null;
    }
908232
public java.util.List<Location> getLocations() {
        if (locations == null) {
            locations = new com.amazonaws.internal.SdkInternalList<Location>();
        }
        return locations;
    }
356746
public function getLocations() {
    $locations = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $branches = $this->client->getBranches(['limit' => 100]);
    foreach ($branches as $branch) {
      $locations[$branch->id] = $branch->name;
    }

    $this->cache->set($cid, $locations);
    return $locations;
  }
197555
def getlocals(back=2):
    """"""
    import inspect
    fr = inspect.currentframe()
    try:
        while fr and back != 0:
            fr1 = fr
            fr = fr.f_back
            back -= 1
    except:
        pass
    return fr1.f_locals
1239012
function getPositionWhereCanIGoFromArray(isBlack, positions) {
    const { x, y } = getPositionFromArray(R.head(positions));
    return {
        x, y, isBlack,
        whereCanIGo: R.tail(positions).map(getPositionFromArray)
    };
}
286047
def _get_locations(self, calc):
        """"""
        return (self._location_in(calc.profile),
                self._location_out(calc.profile))
849480
def get_locations(self, locations, as_list=False):
        

        indexes = [self._index[x] for x in locations]
        return self.get(indexes, as_list)