returns and puts formatted recordings
 returned by query
496300
def play
      abort %(None from #{@user}. Fuck off.).magenta if @recordings.empty?
      stdout = preface
      @recordings.each do |r|
        stdout += "\n#{r[:time]} : ".cyan + "@#{r[:user]}".yellow
        stdout += "\n#{r[:message]}\n\n"
      end
      puts stdout
      stdout
    end
630802
def iterRecords(self):
        """"""
        if self.numRecords is None:
            self.__dbfHeader()
        f = self.__getFileObj(self.dbf)
        f.seek(self.__dbfHdrLength)
        for i in xrange(self.numRecords):
            r = self.__record()
            if r:
                yield r
848603
def _get_recording(self, index):
        """"""
        assert index >= 0
        recs = np.nonzero((index - self.offsets[:-1]) >= 0)[0]
        if len(recs) == 0:  # pragma: no cover
            # If the index is greater than the total size,
            # return the last recording.
            return len(self.arrs) - 1
        # Return the last recording such that the index is greater than
        # its offset.
        return recs[-1]
146417
def format(self, record):
        
        out = dict(
            Timestamp=int(record.created * 1e9),
            Type=record.name,
            Logger=self.logger_name,
            Hostname=self.hostname,
            EnvVersion=self.LOGGING_FORMAT_VERSION,
            Severity=self.SYSLOG_LEVEL_MAP.get(record.levelno,
                                               self.DEFAULT_SYSLOG_LEVEL),
            Pid=record.process,
        )

        # Include any custom attributes set on the record.
        # These would usually be collected metrics data.
        fields = dict()
        for key, value in record.__dict__.items():
            if key not in self.EXCLUDED_LOGRECORD_ATTRS:
                fields[key] = value

        # Only include the 'message' key if it has useful content
        # and is not already a JSON blob.
        message = record.getMessage()
        if message:
            if not message.startswith("{") and not message.endswith("}"):
                fields["msg"] = message

        # If there is an error, format it for nice output.
        if record.exc_info is not None:
            fields["error"] = repr(record.exc_info[1])
            fields["traceback"] = safer_format_traceback(*record.exc_info)

        out['Fields'] = fields

        return json.dumps(out)
1288534
function recordResult (results) {
    // if only ids were selected the return result object to fetch records
    if (this.query.select.isSelectOnlyIds) {
        // build result object
        var result = new ImmutableCoreModelResult({
            query: this.query,
            results: results,
            applyView: true,
        })
        // return result or all records if specified
        return this.query.args.all ? result.all() : result
    }
    // otherwise return ImmutableCoreModelInstance record(s)
    else {
        // if query is for a single record then return record or undefined
        if (this.query.args.limit === 1) {
            // if there are not results return undefined
            if (!results.length) {
                return undefined
            }
            // apply model view to record
            return Promise.resolve(this.applyModelViewRecord(results[0]))
            // resolve with instance
            .then(result => this.newRecordInstance(result))
        }
        // if query is for all records then return all
        else {
            // apply model views to each record
            return Promise.map(results, result => {
                // apply model view to record
                return this.applyModelViewRecord(result)
                // resolve with instance
                .then(result => this.newRecordInstance(result))
            })
        }
    }
}
666263
def __record(self):
        """"""
        f = self.__getFileObj(self.dbf)
        recFmt = self.__recordFmt()
        recordContents = unpack(recFmt[0], f.read(recFmt[1]))
        if recordContents[0] != b(' '):
            # deleted record
            return None
        record = []
        for (name, typ, size, deci), value in zip(self.fields,
                                                                                                recordContents):
            if name == 'DeletionFlag':
                continue
            elif not value.strip():
                record.append(value)
                continue
            elif typ == "N":
                value = value.replace(b('\0'), b('')).strip()
                if value == b(''):
                    value = 0
                elif deci:
                    try:
                        value = float(value)
                    except ValueError:
                        value = 0
                else:
                    value = int(value)
            elif typ == b('D'):
                try:
                    y, m, d = int(value[:4]), int(value[4:6]), int(value[6:8])
                    value = [y, m, d]
                except:
                    value = value.strip()
            elif typ == b('L'):
                value = (value in b('YyTt') and b('T')) or \
                                        (value in b('NnFf') and b('F')) or b('?')
            else:
                value = u(value)
                value = value.strip()
            record.append(value)
        return record
408366
function(raw_records_array) {

		var i = 0,
			count = raw_records_array.length,
			records = [];

		for (; i < count; i++) {

			records.push(this._createRecordInstance(raw_records_array[i]));

		}

		this._fire('records_loaded', {records: records});

		return records;

	}
996217
def get_records(cls, ids, with_deleted=False):
        
        with db.session.no_autoflush:
            query = RecordMetadata.query.filter(RecordMetadata.id.in_(ids))
            if not with_deleted:
                query = query.filter(RecordMetadata.json != None)  # noqa

            return [cls(obj.json, model=obj) for obj in query.all()]
62274
def _parse_results(self, results, cached_records):
        
        parser = xml.sax.make_parser()
        handler = RecordsHandler(cached_records)
        parser.setContentHandler(handler)
        parser.parse(results)
        return handler.records
824284
def batch_query_event_records(
            self,
            batch_size: int,
            filters: List[Tuple[str, Any]] = None,
            logical_and: bool = True,
    ) -> Iterator[List[EventRecord]]:
        
        limit = batch_size
        offset = 0
        result_length = 1

        while result_length != 0:
            result = self._get_event_records(
                limit=limit,
                offset=offset,
                filters=filters,
                logical_and=logical_and,
            )
            result_length = len(result)
            offset += result_length
            yield result
913679
def list_build_set_records(id=None, name=None, page_size=200, page_index=0, sort="", q=""):
    
    content = list_build_set_records_raw(id, name, page_size, page_index, sort, q)
    if content:
        return utils.format_json_list(content)
1272465
def iterateFilteredRecords( dbid, fieldNames, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
      fields = []
      regexp = {}
      fieldNames.each{|field|
         if field.is_a?(Hash)
            fields << field.keys[0]
            regexp[field.keys[0]] = field.values[0]
         elsif field.is_a?(String)
            fields << field
         end
      }
      regexp = nil if regexp.length == 0
      iterateRecords(dbid,fields,query,qid,qname,clist,slist,fmt,options){|record|
         if regexp
            match = true
            fields.each{|field|
               if regexp[field] 
                  unless record[field] and record[field].match(regexp[field])
                     match = false 
                     break
                  end
               end
            }
            yield record if match
         else
            yield record
         end
      }
   end
935874
def append(self, request, response):
        """"""
        request = self._before_record_request(request)
        if not request:
            return
        # Deepcopy is here because mutation of `response` will corrupt the
        # real response.
        response = copy.deepcopy(response)
        response = self._before_record_response(response)
        if response is None:
            return
        self.data.append((request, response))
        self.dirty = True
62180
def refreshRecords( self ):
        
        table_type = self.tableType()
        if ( not table_type ):
            self._records = RecordSet()
            return False
        
        search = nativestring(self.uiSearchTXT.text())
        
        query = self.query().copy()
        terms, search_query = Q.fromSearch(search)
        
        if ( search_query ):
            query &= search_query
        
        self._records = table_type.select(where = query).search(terms)
        return True
1030733
def record(self):
        """"""
        if self.recordmetadata:
            return Record(self.recordmetadata.json, model=self.recordmetadata)
        else:
            return None
1038835
def records(options={})
      options["sortField"], options["sortDirection"] = options.delete(:sort) if options[:sort]
      results = self.class.get(worksheet_url, query: options).parsed_response
      check_and_raise_error(results)
      RecordSet.new(results)
    end
1347571
def format(self, record):
        
        formatted = super(IndentingFormatter, self).format(record)
        prefix = ''
        if self.add_timestamp:
            prefix = self.formatTime(record, "%Y-%m-%dT%H:%M:%S ")
        prefix += " " * get_indentation()
        formatted = "".join([
            prefix + line
            for line in formatted.splitlines(True)
        ])
        return formatted