Ghetto Record implementation.
766112
function ResponsiveImage() {
  if (!(this instanceof ResponsiveImage)) {
    return new ResponsiveImage();
  }

  this.element = null;
  this.loadedSizes = {};
  this.knownSizes = [];
  this.currentBreakpoint = null;
  this.src = null;
  this.isFlexible = false;
  this.hasRetina = false;
  this.preserveAspectRatio = false;
  this.knownDimensions = null;
  this.hasLoaded = false;
  this.hasRunOnce = false;
  this.hasLoadedFallback = false;
}
267406
public int handlePutRawRecordData(Rec record)
    {
        int iErrorCode = Constant.NORMAL_RETURN;
        int iRecordCount = this.getRecordCount(record);
        
        Rec recTargetRecord = this.setDataIndex(RESET_INDEX, record);   // Reset index if multiple
        
        for (int index = 1; index <= iRecordCount; index++)
        {
            Rec recNext = this.setDataIndex(index, recTargetRecord);
            if (recNext == null)
                break;
            
            iErrorCode = super.handlePutRawRecordData(recNext);

            if (iErrorCode != Constant.NORMAL_RETURN)
                break;
        }
        this.setDataIndex(END_OF_NODES, recTargetRecord);
        return iErrorCode;
    }
1222878
private void writePhysicalRecord(ByteBuffer data, Record record) {
    writeBuffer.putInt(generateCrc(data.array(), data.position(), record.getBytes(),
        record.getType()));
    writeBuffer.putShort((short) record.getBytes());
    writeBuffer.put(record.getType().value());
    int oldLimit = data.limit();
    data.limit(data.position() + record.getBytes());
    writeBuffer.put(data);
    data.limit(oldLimit);
  }
971396
def __dbfRecords(self):
        """"""
        f = self.__getFileObj(self.dbf)
        for record in self.records:
            if not self.fields[0][0].startswith("Deletion"):
                f.write(b(' ')) # deletion flag
            for (fieldName, fieldType, size, dec), value in zip(self.fields, record):
                fieldType = fieldType.upper()
                size = int(size)
                if fieldType.upper() == "N":
                    value = str(value).rjust(size)
                elif fieldType == 'L':
                    value = str(value)[0].upper()
                else:
                    value = str(value)[:size].ljust(size)
                assert len(value) == size
                value = b(value)
                f.write(value)
745239
def applyDeviationToRecords( dbid, numericField, deviationField, 
                                                query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil) 
      fieldNames = Array[numericField]
      avg = average( dbid, fieldNames, query, qid, qname, clist, slist, fmt, options )
      fieldNames << "3" # Record ID#
      iterateRecords( dbid, fieldNames, query, qid, qname, clist, slist, fmt, options ){|record|
         result = deviation( [avg[numericField],record[numericField]] )
         clearFieldValuePairList
         addFieldValuePair( deviationField, nil, nil, result.to_s )
         editRecord( dbid, record["3"], fvlist )
      }
   end
990605
def squeeze(records, gap_threshold=1.0):
    
    with _record_buffer(records) as r:
        gap_proportions = gap_proportion(r())

        keep_columns = [g < gap_threshold for g in gap_proportions]

        for record in r():
            sequence = str(record.seq)
            # Trim
            squeezed = itertools.compress(sequence, keep_columns)
            yield SeqRecord(Seq(''.join(squeezed)), id=record.id,
                            description=record.description)
1188636
def _create_record(name, field_defs, step_name, inputs, unlist, file_vs, std_vs, parallel):
    
    if field_defs:
        fields = []
        inherit = []
        inherit_all = False
        inherit_exclude = []
        for fdef in field_defs:
            if not fdef.get("type"):
                if fdef["id"] == "inherit":
                    inherit_all = True
                    inherit_exclude = fdef.get("exclude", [])
                else:
                    inherit.append(fdef["id"])
            else:
                cur = {"name": _get_string_vid(fdef["id"]),
                       "type": fdef["type"]}
                fields.append(_add_secondary_to_rec_field(fdef, cur))
        if inherit_all:
            fields.extend(_infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel, exclude=inherit_exclude))
        elif inherit:
            fields.extend(_infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel, inherit))
    else:
        fields = _infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel)
    out = {"id": "%s/%s" % (step_name, name),
           "type": {"name": name,
                    "type": "record",
                    "fields": fields}}
    if parallel in ["batch-single", "multi-batch"]:
        out = _nest_variable(out)
    return out
307447
private function _saveRecords()
    {
        $offset = 50;
        if (is_array($this->records) && (count($this->records) > 0)) {
            foreach ($this->records as $index => $record) {
                //Save the record to the .shp file
                $record->saveToFile($this->SHPFile, $this->DBFFile, $index + 1);

                //Save the record to the .shx file
                fwrite($this->SHXFile, pack('N', $offset));
                fwrite($this->SHXFile, pack('N', $record->getContentLength()));
                $offset += (4 + $record->getContentLength());
            }
        }
    }
388230
def applyPercentToRecords( dbid, numericField, percentField, 
                                             query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil) 
      fieldNames = Array[numericField]
      total = sum( dbid, fieldNames, query, qid, qname, clist, slist, fmt, options )
      fieldNames << "3" # Record ID#
      iterateRecords( dbid, fieldNames, query, qid, qname, clist, slist, fmt, options ){|record|
         result = percent( [total[numericField],record[numericField]] )
         clearFieldValuePairList
         addFieldValuePair( percentField, nil, nil, result.to_s )
         editRecord( dbid, record["3"], fvlist )
      }
   end
141829
function recordCursor(records, id) {
  var record;
  id = coerceId(id);
  for (var i = 0, len = records.length; i < len; i++) {
    record = records[i];
    if (coerceId(record.id) === id) {
      return {record: record, index: i};
    }
  }
}
1086117
def _clean_record(self, record):
        """"""
        for k, v in dict(record).items():
            if isinstance(v, dict):
                v = self._clean_record(v)
            if v is None:
                record.pop(k)
        return record
320297
function applyRecords(path, records) {
  let numApply = 0;
  let maxSpecificity = 0;

  for (let i = 0; i < records.length; i = i + 1) {
    const record = records[i];
    if (record.path.test(path)) {
      numApply = numApply + 1;
      if (record.specificity > maxSpecificity) {
        maxSpecificity = record.specificity;
      }
    }
  }

  return {
    numApply,
    maxSpecificity
  }
}
1104299
private String encodeRecord (String record)throws  IOException {
    // Convert original json object to a new json object with format {"Body": "originalJson"}
    // Add new json object to an array and send the whole array to eventhub using REST api
    // Refer to https://docs.microsoft.com/en-us/rest/api/eventhub/send-batch-events
    ArrayList<EventhubRequest> arrayList = new ArrayList<>();
    arrayList.add(new EventhubRequest(record));

    return mapper.writeValueAsString (arrayList);
  }
515382
def _serialize_record(self, record):
        """"""
        f = self._empty_to_dot
        row = [record.CHROM, record.POS]
        row.append(f(";".join(record.ID)))
        row.append(f(record.REF))
        if not record.ALT:
            row.append(".")
        else:
            row.append(",".join([f(a.serialize()) for a in record.ALT]))
        row.append(f(record.QUAL))
        row.append(f(";".join(record.FILTER)))
        row.append(f(self._serialize_info(record)))
        if record.FORMAT:
            row.append(":".join(record.FORMAT))
        row += [
            self._serialize_call(record.FORMAT, record.call_for_sample[s])
            for s in self.header.samples.names
        ]
        print(*row, sep="\t", file=self.stream)
1165498
def createRecordItems(self, records, parent=None):
        
        if parent is None:
            parent=self
            
        blocked = self.signalsBlocked()
        self.blockSignals(True)
        self.setUpdatesEnabled(False)
        for record in records:
            self.recordItemClass(record)(parent, record)
        
        if not blocked:
            self.blockSignals(False)
            self.setUpdatesEnabled(True)
1128983
def preprocess_record(self, pid, record, links_factory=None, **kwargs):
        """"""
        links_factory = links_factory or (lambda x, record=None, **k: dict())
        metadata = copy.deepcopy(record.replace_refs()) if self.replace_refs \
            else record.dumps()
        return dict(
            pid=pid,
            metadata=metadata,
            links=links_factory(pid, record=record, **kwargs),
            revision=record.revision_id,
            created=(pytz.utc.localize(record.created).isoformat()
                     if record.created else None),
            updated=(pytz.utc.localize(record.updated).isoformat()
                     if record.updated else None),
        )
1238935
def to_record_per_alt(self):
        ''''''
        record_list = []
        for alt in self.ALT:
            record_list.append(copy.copy(self))
            record_list[-1].ALT = [alt]
        return record_list