record = field *(COMMA field)
484420
private List<String> _readRecord() throws IOException {
		while (true) {
			int c = reader.read();
			if (c < 0) {
				return null;
			} else if (!Character.isWhitespace(c)) {
				if (commentStart != null && commentStart.indexOf(c) >= 0) {
					while (c != '\n') {
						c = reader.read();
						if (c < 0) {
							return null;
						}
					}
				} else {
					reader.unread(c);
					break;
				}
			}
		}

		List<String> values = new ArrayList<>();
		String value = readField();
		values.add(value);
		while (value != null) {
			int c = reader.read();
			if (c == SEPARATOR) {
				value = readField();
				values.add(value);
			} else if (c < 0 || c == '\n') {
				value = null;
			}
		}
		return values;
	}
1147348
def write_record(fo, datum, schema):
    """"""
    for field in schema['fields']:
        name = field['name']
        if name not in datum and 'default' not in field and \
                'null' not in field['type']:
            raise ValueError('no value and no default for %s' % name)
        write_data(fo, datum.get(
            name, field.get('default')), field['type'])
88965
def add_record(self, record):
        """"""
        rec = self.get_record(record._record_type, record.host)
        if rec:
            rec = record
            for i,r in enumerate(self._entries):
                if r._record_type == record._record_type \
                        and r.host == record.host:
                            self._entries[i] = record
        else:
            self._entries.append(record)
        self.sort()
        return True
128095
private void set(String fieldName, Object value) {
    try {
      String subField;
      Iterator<String> levels = Splitter.on(".").split(fieldName).iterator();
      GenericRecord toInsert = record;
      subField = levels.next();
      Object subRecord = toInsert;

      while (levels.hasNext()) {
        if (subRecord instanceof GenericRecord) {
          subRecord = ((GenericRecord)subRecord).get(subField);
        } else if (subRecord instanceof List) {
          subRecord = ((List)subRecord).get(Integer.parseInt(subField));
        } else if (subRecord instanceof Map) {
          subRecord = ((Map)subRecord).get(subField);
        }

        if (subRecord == null) {
          throw new FieldDoesNotExistException("Field " + subField + " not found when trying to set " + fieldName);
        }
        subField = levels.next();
      }

      if (!(subRecord instanceof GenericRecord)) {
        throw new IllegalArgumentException("Field " + fieldName + " does not refer to a record type.");
      }

      toInsert = (GenericRecord)subRecord;
      Object oldValue = toInsert.get(subField);

      toInsert.put(subField, value);

      Schema.Field changedField = toInsert.getSchema().getField(subField);
      GenericData genericData = GenericData.get();

      boolean valid = genericData
          .validate(changedField.schema(), genericData.getField(toInsert, changedField.name(), changedField.pos()));
      if (!valid) {
        toInsert.put(subField, oldValue);
        throw new IncorrectTypeException(
            "Incorrect type - can't insert a " + value.getClass().getCanonicalName() + " into an Avro record of type "
                + changedField.schema().getType().toString());
      }
    } catch (AvroRuntimeException e) {
      throw new FieldDoesNotExistException("Field not found setting name " + fieldName, e);
    }
  }
1174074
def save_records(self, records):
        '''
        
        '''
        for record in records:
            if not isinstance(record, Record):
                record = Record(*record)
            self.save_record(*record)
884672
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
      hash  = {}
      array = []

      if nested_attributes_association?(record_name)
        hash["#{record_name}_attributes"] = fields_options[:signed_attributes_context] = array
      else
        hash[record_name] = fields_options[:signed_attributes_context] = array
      end

      add_signed_fields hash

      content = super
      array.uniq!
      content
    end
256534
function inputRecord (type, record) {
  const clone = {};
  const recordTypes = this.recordTypes;
  const primaryKey = this.keys.primary;
  const isArrayKey = this.keys.isArray;
  const generateId = this.options.generateId;
  const fields = recordTypes[type];

  // ID business.
  const id = record[primaryKey];
  clone[idKey] = id ? id : generateId(type);

  for (const field in record) {
    if (field === primaryKey) continue;
    clone[field] = record[field];
  }

  for (const field of Object.getOwnPropertyNames(fields))
    if (!(field in record))
      clone[field] = fields[field][isArrayKey] ? [] : null;

  return clone;
}
1000108
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
    {
        int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption);
        if (iErrorCode != DBConstants.NORMAL_RETURN)
            return iErrorCode;
        if (iChangeType == DBConstants.UPDATE_TYPE)
        {   // Special case - Even though the record can't be used, GridTable needs a snapshot of the merged record
            Record recMain = this.getNextTable().getRecord();
            Record recAlt = this.getAltRecord();
            this.syncRecords(recAlt, recMain);  // NOTE: Although I put the wrong fields into the main record, modified = false! (so they don't update)
        }
        return iErrorCode;
    }
915170
def count_by(records: Sequence[Dict], field_name: str) -> defaultdict:
    

    counter = defaultdict(int)

    for record in records:
        name = record[field_name]
        counter[name] += 1

    return counter
1012042
private void writeNotes(int recordNumber, String text) throws IOException
   {
      m_buffer.setLength(0);

      m_buffer.append(recordNumber);
      m_buffer.append(m_delimiter);

      if (text != null)
      {
         String note = stripLineBreaks(text, MPXConstants.EOL_PLACEHOLDER_STRING);
         boolean quote = (note.indexOf(m_delimiter) != -1 || note.indexOf('"') != -1);
         int length = note.length();
         char c;

         if (quote == true)
         {
            m_buffer.append('"');
         }

         for (int loop = 0; loop < length; loop++)
         {
            c = note.charAt(loop);

            switch (c)
            {
               case '"':
               {
                  m_buffer.append("\"\"");
                  break;
               }

               default:
               {
                  m_buffer.append(c);
                  break;
               }
            }
         }

         if (quote == true)
         {
            m_buffer.append('"');
         }
      }

      m_buffer.append(MPXConstants.EOL);

      m_writer.write(m_buffer.toString());
   }
1034285
function readRecord() {
    if (index >= text.length) {
      return EOF;
    }
    var record = [];
    for (var field = readField(); field != EOR; field = readField()) {
      record.push(field);
    }
    return record;
  }
1176283
def record_value(record, property)
      case record
        when Hash
          record.fetch(property, record[property.field])
        when Resource
          property.get!(record)
      end
    end
786635
private void preprocess(Object obj, Record rec)
	{
		if (writingObject && isBasicType(obj))
		{
			return;
		}

		if (obj instanceof Class<?>)
		{
			return;
		}

		// count reference
		rec.refCount++;

		// do things only one time for each record
		if (rec.refCount > 1)
		{
			return;
		}

		// do it recursively
		if (null != rec.exp)
		{
			// deal with 'field' property
			Record targetRec = objRecordMap.get(rec.exp.getTarget());
			if (targetRec != null && targetRec.exp != null && "getField".equals(targetRec.exp.getMethodName()))
			{
				objRecordMap.remove(obj);
			}

			Object args[] = rec.exp.getArguments();
			for (int i = 0; i < args.length; i++)
			{
				Record argRec = objRecordMap.get(args[i]);
				if (argRec != null)
				{
					preprocess(args[i], argRec);
				}
			}
		}

		for (Iterator<?> iter = rec.stats.iterator(); iter.hasNext();)
		{
			Statement subStat = (Statement) iter.next();
			if (subStat.getClass() == Expression.class)
			{
				try
				{
					Expression subExp = (Expression) subStat;
					Record subRec = objRecordMap.get(subExp.getValue());
					if (subRec == null || subRec.exp == null || subRec.exp != subExp)
					{
						iter.remove();
						continue;
					}
					preprocess(subExp.getValue(), subRec);
					if (subRec.stats.isEmpty())
					{
						if (isGetArrayStat(subExp.getTarget(), subExp.getMethodName(), subExp.getArguments())
								|| isGetPropertyStat(subExp.getMethodName(), subExp.getArguments()))
						{
							iter.remove();
							continue;
						}
					}
				}
				catch (Exception e)
				{
					getExceptionListener().exceptionThrown(e);
					iter.remove();
				}
				continue;
			}

			Object subStatArgs[] = subStat.getArguments();
			for (int i = 0; i < subStatArgs.length; i++)
			{
				Record argRec = objRecordMap.get(subStatArgs[i]);
				if (argRec != null)
				{
					preprocess(subStatArgs[i], argRec);
				}
			}
		}
	}
2352
def extract_multiple(record, field, tag)
     a = Array.new
     record.fields(field).each do |field|
       a.push field[tag]
     end
     return a
   end
961267
def formatter_fields_for_record(self, record):
        
        datetime_serialized = (
            datetime.now(timezone.utc).astimezone(self.tz).isoformat()
        )

        default_fields = (
            (LOGGED_AT_FIELDNAME, datetime_serialized),
            (LINE_NUMBER_FIELDNAME, record.lineno),
            (FUNCTION_NAME_FIELDNAME, record.funcName),
            (LOG_LEVEL_FIELDNAME, self.level_to_name_mapping[record.levelno]),
            (FILE_PATH_FIELDNAME, record.pathname),
        )

        for field, value in default_fields:
            if field in self.log_fields:
                yield field, value
768910
def __dbfRecord(self, record):
        """"""
        f = self.__getFileObj(self.dbf)
        if self.recNum == 0:
            # first records, so all fields should be set
            # allowing us to write the dbf header
            # cannot change the fields after this point
            self.__dbfHeader()
        # begin
        self.recNum += 1
        if not self.fields[0][0].startswith("Deletion"):
            f.write(b' ') # deletion flag
        for (fieldName, fieldType, size, deci), value in zip(self.fields, record):
            fieldType = fieldType.upper()
            size = int(size)
            if fieldType in ("N","F"):
                # numeric or float: number stored as a string, right justified, and padded with blanks to the width of the field.
                if value in MISSING:
                    value = b"*"*size # QGIS NULL
                elif not deci:
                    # force to int
                    try:
                        # first try to force directly to int.
                        # forcing a large int to float and back to int
                        # will lose information and result in wrong nr.
                        value = int(value) 
                    except ValueError:
                        # forcing directly to int failed, so was probably a float.
                        value = int(float(value))
                    value = format(value, "d")[:size].rjust(size) # caps the size if exceeds the field size
                else:
                    value = float(value)
                    value = format(value, ".%sf"%deci)[:size].rjust(size) # caps the size if exceeds the field size
            elif fieldType == "D":
                # date: 8 bytes - date stored as a string in the format YYYYMMDD.
                if isinstance(value, date):
                    value = '{:04d}{:02d}{:02d}'.format(value.year, value.month, value.day)
                elif isinstance(value, list) and len(value) == 3:
                    value = '{:04d}{:02d}{:02d}'.format(*value)
                elif value in MISSING:
                    value = b'0' * 8 # QGIS NULL for date type
                elif is_string(value) and len(value) == 8:
                    pass # value is already a date string
                else:
                    raise ShapefileException("Date values must be either a datetime.date object, a list, a YYYYMMDD string, or a missing value.")
            elif fieldType == 'L':
                # logical: 1 byte - initialized to 0x20 (space) otherwise T or F.
                if value in MISSING:
                    value = b' ' # missing is set to space
                elif value in [True,1]:
                    value = b'T'
                elif value in [False,0]:
                    value = b'F'
                else:
                    value = b' ' # unknown is set to space
            else:
                # anything else is forced to string, truncated to the length of the field
                value = b(value, self.encoding, self.encodingErrors)[:size].ljust(size)
            if not isinstance(value, bytes):
                # just in case some of the numeric format() and date strftime() results are still in unicode (Python 3 only)
                value = b(value, 'ascii', self.encodingErrors) # should be default ascii encoding
            if len(value) != size:
                raise ShapefileException(
                    "Shapefile Writer unable to pack incorrect sized value"
                    " (size %d) into field '%s' (size %d)." % (len(value), fieldName, size))
            f.write(value)
1259501
def insert_record(self,
                      table: str,
                      fields: Sequence[str],
                      values: Sequence[Any],
                      update_on_duplicate_key: bool = False) -> int:
        """"""
        self.ensure_db_open()
        if len(fields) != len(values):
            raise AssertionError("Field/value mismatch")
        if update_on_duplicate_key:
            sql = get_sql_insert_or_update(table, fields, self.get_delims())
        else:
            sql = get_sql_insert(table, fields, self.get_delims())
        sql = self.localize_sql(sql)
        log.debug("About to insert_record with SQL template: " + sql)
        try:
            cursor = self.db.cursor()
            debug_sql(sql, values)
            cursor.execute(sql, values)
            # ... binds the placeholders (?, %s) to values in the process
            new_pk = get_pk_of_last_insert(cursor)
            log.debug("Record inserted.")
            return new_pk
        except:  # nopep8
            log.exception("insert_record: Failed to insert record.")
            raise