Convert all '*_speed' fields using 'process_field_speed'
        All other units will use the default method.
181114
def run_field_processor(self, field_data):
        
        if field_data.name.endswith("_speed"):
            self.process_field_speed(field_data)
        else:
            super(StandardUnitsDataProcessor, self).run_field_processor(field_data)
600003
def convert(cls, value, from_unit, to_unit):
        
        value_ms = value * cls.UNITS_IN_MILLISECONDS[from_unit]
        return value_ms / cls.UNITS_IN_MILLISECONDS[to_unit]
1212902
def convert_to_process_params_dict(opt):
    
    opt = copy.deepcopy(opt)
    for arg, val in vars(opt).items():
        if isinstance(val, DictWithDefaultReturn):
            new_val = []
            for key in val.keys():
                if isinstance(val[key], list):
                    for item in val[key]:
                        if item is not None:
                            new_val.append(':'.join([key, str(item)]))
                else:
                    if val[key] is not None:
                        new_val.append(':'.join([key, str(val[key])]))
            setattr(opt, arg, new_val)
    return vars(opt)
451199
def process_fastq_plain(fastq, **kwargs):
    """"""
    logging.info("Nanoget: Starting to collect statistics from plain fastq file.")
    inputfastq = handle_compressed_input(fastq)
    return ut.reduce_memory_usage(pd.DataFrame(
        data=[res for res in extract_from_fastq(inputfastq) if res],
        columns=["quals", "lengths"]
    ).dropna())
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
28668
def process_fields(self, fields):
		""""""
		
		result = []
		strip = ''.join(self.PREFIX_MAP)
		
		for field in fields:
			direction = self.PREFIX_MAP['']
			
			if field[0] in self.PREFIX_MAP:
				direction = self.PREFIX_MAP[field[0]]
				field = field.lstrip(strip)
			
			result.append((field, direction))
		
		return result
812130
def _process_include_fields(self, include_fields, exclude_fields,
                                extra_fields):
        
        def _convert_fields(_in):
            if not _in:
                return _in

            for newname, oldname in self._get_api_aliases():
                if oldname in _in:
                    _in.remove(oldname)
                    if newname not in _in:
                        _in.append(newname)
            return _in

        ret = {}
        if self._check_version(4, 0):
            if include_fields:
                include_fields = _convert_fields(include_fields)
                if "id" not in include_fields:
                    include_fields.append("id")
                ret["include_fields"] = include_fields
            if exclude_fields:
                exclude_fields = _convert_fields(exclude_fields)
                ret["exclude_fields"] = exclude_fields
        if self._supports_getbug_extra_fields:
            if extra_fields:
                ret["extra_fields"] = _convert_fields(extra_fields)
        return ret
1167925
@Pure
	public static double fromMetersPerSecond(double value, SpeedUnit outputUnit) {
		switch (outputUnit) {
		case KILOMETERS_PER_HOUR:
			return value / 3.6;
		case MILLIMETERS_PER_SECOND:
			return value * 1000.;
		case METERS_PER_SECOND:
		default:
		}
		return value;
	}
645818
def speed(self):
        
        self._speed, value = self.get_attr_int(self._speed, 'speed')
        return value
132025
def _serialize(cls, key, value, fields):
        
        converter = cls._get_converter_for_field(key, None, fields)
        return converter.serialize(value)
463195
def speed_p(self):
        
        self._speed_p, value = self.get_attr_int(self._speed_p, 'speed_pid/Kp')
        return value
534879
def humanize_speed(c_per_sec):
    
    scales = [60, 60, 24]
    units = ['c/s', 'c/min', 'c/h', 'c/d']
    speed = c_per_sec
    i = 0
    if speed > 0:
        while (speed < 1) and (i < len(scales)):
            speed *= scales[i]
            i += 1
        
    return "{:.1f}{}".format(speed, units[i])
622026
def process_config(self):
        
        if 'byte_unit' in self.config:
            if isinstance(self.config['byte_unit'], basestring):
                self.config['byte_unit'] = self.config['byte_unit'].split()

        if 'enabled' in self.config:
            self.config['enabled'] = str_to_bool(self.config['enabled'])

        if 'measure_collector_time' in self.config:
            self.config['measure_collector_time'] = str_to_bool(
                self.config['measure_collector_time'])

        # Raise an error if both whitelist and blacklist are specified
        if ((self.config.get('metrics_whitelist', None) and
             self.config.get('metrics_blacklist', None))):
            raise DiamondException(
                'Both metrics_whitelist and metrics_blacklist specified ' +
                'in file %s' % self.configfile)

        if self.config.get('metrics_whitelist', None):
            self.config['metrics_whitelist'] = re.compile(
                self.config['metrics_whitelist'])
        elif self.config.get('metrics_blacklist', None):
            self.config['metrics_blacklist'] = re.compile(
                self.config['metrics_blacklist'])
1295445
def convert(self, value, units, newunits):
        
        return value * self._units[units] / self._units[newunits]
1157182
async def serialize(self, native=False):
        '''
        
        '''
        data = {}
        # iterate through all fields
        for field_name, field in self._fields.items():
            # serialize field data
            raw_data = self._data.get(field_name)
            # add field's data to model data based on projection settings
            if field._projection != None:  # noqa E711
                field_data = await field.serialize(raw_data, native)
                if field_data:
                    data[field_name] = field_data
                elif field._projection == True: # noqa E711
                    data[field_name] = None

        # iterate through all export methods
        for name, func in self._serialize_methods.items():
            data[name] = await func(self)
        return data
294943
private void processFields() {
    List<Field> fields = getAllFields();
    for (Field field : fields) {
      if (field.isAnnotationPresent(Identifier.class)) {
        processIdentifierField(field);
      } else if (field.isAnnotationPresent(Key.class)) {
        processKeyField(field);
      } else if (field.isAnnotationPresent(ParentKey.class)) {
        processParentKeyField(field);
      } else if (field.isAnnotationPresent(Embedded.class)) {
        processEmbeddedField(field);
      } else {
        processField(field);
      }
    }
  }
282899
def _all_fields(self):
        
        if (
            not settings.ENABLE_FIELDS_CACHE or
            not self.ENABLE_FIELDS_CACHE or
            self.__class__ not in FIELDS_CACHE
        ):
            all_fields = super(
                WithDynamicSerializerMixin,
                self
            ).get_fields()

            if (
                settings.ENABLE_FIELDS_CACHE and
                self.ENABLE_FIELDS_CACHE
            ):
                FIELDS_CACHE[self.__class__] = all_fields
        else:
            all_fields = copy.copy(FIELDS_CACHE[self.__class__])
            for k, field in six.iteritems(all_fields):
                if hasattr(field, 'reset'):
                    field.reset()

        for k, field in six.iteritems(all_fields):
            field.field_name = k
            field.parent = self

        return all_fields