Find all quays from stop places.
199044
async def expand_all_quays(self) -> None:
        """"""
        if not self.stops:
            return

        headers = {'ET-Client-Name': self._client_name}
        request = {
            'query': GRAPHQL_STOP_TO_QUAY_TEMPLATE,
            'variables': {
                'stops': self.stops,
                'omitNonBoarding': self.omit_non_boarding
            }
        }

        with async_timeout.timeout(10):
            resp = await self.web_session.post(RESOURCE,
                                               json=request,
                                               headers=headers)

        if resp.status != 200:
            _LOGGER.error(
                "Error connecting to Entur, response http status code: %s",
                resp.status)
            return None
        result = await resp.json()

        if 'errors' in result:
            return

        for stop_place in result['data']['stopPlaces']:
            if len(stop_place['quays']) > 1:
                for quay in stop_place['quays']:
                    if quay['estimatedCalls']:
                        self.quays.append(quay['id'])
493820
def stops(self):
    """"""
    stops = set()
    for stop_time in self.stop_times():
      stops |= stop_time.stops()
    return stops
688002
function findDeps(entrypoints) {
  let deps = new Set();

  for (const entrypoint of entrypoints) {
    deps = new Set([...deps, ...walk(entrypoint)]);
  }

  return deps;
}
186488
def get_departures(self, stop_id, route, destination, api_key):
        """"""
        self.stop_id = stop_id
        self.route = route
        self.destination = destination
        self.api_key = api_key

        # Build the URL including the STOP_ID and the API key
        url = \
            'https://api.transport.nsw.gov.au/v1/tp/departure_mon?' \
            'outputFormat=rapidJSON&coordOutputFormat=EPSG%3A4326&' \
            'mode=direct&type_dm=stop&name_dm=' \
            + self.stop_id \
            + '&departureMonitorMacro=true&TfNSWDM=true&version=10.2.1.42'
        auth = 'apikey ' + self.api_key
        header = {'Accept': 'application/json', 'Authorization': auth}

        # Send query or return error
        try:
            response = requests.get(url, headers=header, timeout=10)
        except:
            logger.warning("Network or Timeout error")
            return self.info

        # If there is no valid request
        if response.status_code != 200:
            logger.warning("Error with the request sent; check api key")
            return self.info

        # Parse the result as a JSON object
        result = response.json()

        # If there is no stop events for the query
        try:
            result['stopEvents']
        except KeyError:
            logger.warning("No stop events for this query")
            return self.info

        # Set variables
        maxresults = 1
        monitor = []
        if self.destination != '':
            for i in range(len(result['stopEvents'])):
                destination = result['stopEvents'][i]['transportation']['destination']['name']
                if destination == self.destination:
                    event = self.parseEvent(result, i)
                    if event != None:
                        monitor.append(event)
                    if len(monitor) >= maxresults:
                        # We found enough results, lets stop
                        break
        elif self.route != '':
            # Find the next stop events for a specific route
            for i in range(len(result['stopEvents'])):
                number = result['stopEvents'][i]['transportation']['number']
                if number == self.route:
                    event = self.parseEvent(result, i)
                    if event != None:
                        monitor.append(event)
                    if len(monitor) >= maxresults:
                        # We found enough results, lets stop
                        break
        else:
            # No route defined, find any route leaving next
            for i in range(0, maxresults):
                event = self.parseEvent(result, i)
                if event != None:
                    monitor.append(event)
        if monitor:
            self.info = {
                ATTR_STOP_ID: self.stop_id,
                ATTR_ROUTE: monitor[0][0],
                ATTR_DUE_IN: monitor[0][1],
                ATTR_DELAY: monitor[0][2],
                ATTR_REALTIME: monitor[0][5],
                ATTR_DESTINATION: monitor[0][6],
                ATTR_MODE: monitor[0][7]
                }
        return self.info
673526
def GetCountStopTimes(self):
    """"""
    cursor = self._schedule._connection.cursor()
    cursor.execute(
        'SELECT count(*) FROM stop_times WHERE trip_id=?', (self.trip_id,))
    return cursor.fetchone()[0]
1341340
def select_coords(self):
        
        start, stop = self.start, self.stop
        nrows = self.table.nrows
        if start is None:
            start = 0
        elif start < 0:
            start += nrows
        if self.stop is None:
            stop = nrows
        elif stop < 0:
            stop += nrows

        if self.condition is not None:
            return self.table.table.get_where_list(self.condition.format(),
                                                   start=start, stop=stop,
                                                   sort=True)
        elif self.coordinates is not None:
            return self.coordinates

        return np.arange(start, stop)
543574
def GetTimeStops(self):
    """"""
    return [(st.arrival_secs, st.departure_secs, st.stop) for st in
            self.GetStopTimes()]
367104
def get_current_waypoints(boatd=None):
    '''
    
    '''

    if boatd is None:
        boatd = Boatd()

    content = boatd.get('/waypoints')
    return [Point(*coords) for coords in content.get('waypoints')]
229312
def find_endpoints(self):
        """"""
        plugins = self._load_upgrades(remove_applied=False)

        dummy_graph_incoming, graph_outgoing = self._create_graph(plugins, {})

        endpoints = {}
        for node, outgoing in six.iteritems(graph_outgoing):
            if not outgoing:
                repository = plugins[node].repository
                if repository not in endpoints:
                    endpoints[repository] = []
                endpoints[repository].append(node)

        return endpoints
718559
def get_all(self, qry, tpl):
        '''  '''
        self.cur.execute(qry, tpl)
        result = self.cur.fetchall()
        return result
1292784
def find_all(self, cls):
        """"""
        final_results = []
        table = self.get_class_table(cls)
        for db_result in table.scan():
            obj = cls.from_data(db_result['value'])
            final_results.append(obj)

        return final_results
882433
def StopToTuple(stop):
  """"""
  return (stop.stop_id, stop.stop_name, float(stop.stop_lat),
          float(stop.stop_lon), stop.location_type)
172338
def departure(stop, destination):
    """"""
    from pyruter.api import Departures

    async def get_departures():
        """"""
        async with aiohttp.ClientSession() as session:
            data = Departures(LOOP, stop, destination, session)
            await data.get_departures()
            print(json.dumps(data.departures, indent=4, sort_keys=True))
    LOOP.run_until_complete(get_departures())
451347
def list_all():
    '''
    
    '''
    if 'ports.list_all' not in __context__:
        __context__['ports.list_all'] = []
        for path, dirs, files in salt.utils.path.os_walk('/usr/ports'):
            stripped = path[len('/usr/ports'):]
            if stripped.count('/') != 2 or stripped.endswith('/CVS'):
                continue
            __context__['ports.list_all'].append(stripped[1:])
    return __context__['ports.list_all']
772948
def find_all(self, table, limit=10):
        '''
        
        '''
        sql = "select * from {} limit 0,{}".format(table, limit)
        res = self.query(sql)
        return res
286047
def _get_locations(self, calc):
        """"""
        return (self._location_in(calc.profile),
                self._location_out(calc.profile))
1238733
def find(self, chrom, start, end):
        """"""

        tree = self._trees.get( chrom, None )
        if tree:
            return tree.find( start, end )
        #return always a list
        return []