Get several entries at once.
486673
def get_many(self, ids):
        """"""
        return [self.instance(id, **fields)
                    for id, fields in zip(ids, self.api.mget(ids))]
686656
def index(request, page):
    """"""
    days = []
    days_found = set()
    query = Entry.query.order_by(Entry.pub_date.desc())
    pagination = Pagination(query, PER_PAGE, page, "index")
    for entry in pagination.entries:
        day = date(*entry.pub_date.timetuple()[:3])
        if day not in days_found:
            days_found.add(day)
            days.append({"date": day, "entries": []})
        days[-1]["entries"].append(entry)
    return render_template("index.html", days=days, pagination=pagination)
495448
def entries(self, start = None, end = None):
        ''''''
        if not start:
            start = self.earliest_record
        if not end:
            end = self.latest_record
        fr = start.strftime('%Y%m%d')
        to = end.strftime('%Y%m%d')
        url = str.format(
            'projects/{}/entries?from={}&to={}',
            self.id,
            fr,
            to,
        )
        response = self.hv.get_request(url)
        return [Entry(self.hv, ej['day_entry']) for ej in response]
1226005
def _load_entries(self):
        """"""

        rel_path = os.path.join('~','cltk_data',
                                'french',
                                'text','french_data_cltk'
                                ,'entries.py')
        path = os.path.expanduser(rel_path)
        #logger.info('Loading entries. This may take a minute.')
        loader = importlib.machinery.SourceFileLoader('entries', path)
        module = loader.load_module()
        entries = module.entries
        return entries
263534
def get_participants(self, namespace, room):
        """"""
        for sid, active in six.iteritems(self.rooms[namespace][room].copy()):
            yield sid
328376
def get_multi(features)
      result = {}
      features.each do |feature|
        result[feature.key] = get(feature)
      end
      result
    end
42743
def get_entries(path):
    """"""
    dirs, files = [], []
    for entry in os.listdir(path):
        # Categorize entry as directory or file.
        if os.path.isdir(os.path.join(path, entry)):
            dirs.append(entry)
        else:
            files.append(entry)
    dirs.sort()
    files.sort()
    return dirs, files
1222328
def get(self, query, *parameters, **kwargs):
        """"""
        rows = self.query(query, *parameters, **kwargs)
        if not rows:
            return None
        elif len(rows) > 1:
            raise ValueError('Multiple rows returned for get() query')
        else:
            return rows[0]
1252409
def items(self):
        """"""
        if self._result_cache:
            return self._result_cache.items

        return self.all().items
1069305
def _get_things(self, method, thing, thing_type, params=None, cacheable=True):
        """"""

        limit = params.get("limit", 1)
        seq = []
        for node in _collect_nodes(
            limit, self, self.ws_prefix + "." + method, cacheable, params
        ):
            title = _extract(node, "name")
            artist = _extract(node, "name", 1)
            playcount = _number(_extract(node, "playcount"))

            seq.append(TopItem(thing_type(artist, title, self.network), playcount))

        return seq
467515
def _get_all(self):
        ''' 
        '''
        rowid = 0
        while True:
            SQL_SELECT_MANY = 'SELECT rowid, * FROM %s WHERE rowid > ? LIMIT ?;' % self._table
            self._cursor.execute(SQL_SELECT_MANY, (rowid, ITEMS_PER_REQUEST))
            items = self._cursor.fetchall()
            if len(items) == 0:
                break
            for item in items:
                rowid = item['_id']
                yield self._make_item(item)
471020
def get(content, keep_order=False):
        """"""
        if keep_order:
            from collections import OrderedDict
            dataentry = OrderedDict()
        else:
            dataentry = {}

        found = False
        for line in content.split('\n'):
            if line.strip().startswith('---- dataentry'):
                found = True
                continue
            elif line == '----':
                break
            elif not found:
                continue

            line_split = line.split(':')
            key = line_split[0].strip()
            value = re.sub('#.*$', '', ':'.join(line_split[1:])).strip()
            dataentry.setdefault(key, value)

        if not found:
            raise DokuWikiError('no dataentry found')
        return dataentry
483315
def on_receive_append_entries(self, data):
        """"""
        if self.storage.term == data['term']:
            self.state.to_follower()
1012692
def _ProcessEntries(self, fd):
    """"""
    p = config_file.KeyValueParser(kv_sep="{", term="}", sep=None)
    data = utils.ReadFileBytesAsUnicode(fd)
    entries = p.ParseEntries(data)
    for entry in entries:
      for section, cfg in iteritems(entry):
        # The parser returns a list of configs. There will only be one.
        if cfg:
          cfg = cfg[0].strip()
        else:
          cfg = ""
        self._ParseSection(section, cfg)
273889
def append(self, data):
        """"""
        for k in self._entries.keys():
            self._entries[k].append(data._entries[k])
1108709
def get_all(self):
        """"""
        logger.debug('Fetching items. Table: {namespace}'.format(
            namespace=self.namespace
        ))

        rows = []

        result = self.table.scan()

        while True:
            next_token = result.get('LastEvaluatedKey', None)
            rows += result['Items']

            if next_token:
                result = self.table.scan(ExclusiveStartKey=next_token)
            else:
                break

        return rows
164335
def get(self, entry):
        """"""
        try:
            list = self.cache[entry.key]
            return list[list.index(entry)]
        except:
            return None