Format a the proper type.
193080
def to_type(f, type_map=CONSTRUCT_CODE):
  
  name = f.type_id
  if name.startswith('GPSTime'):
    name = 'Gps' + name[3:]
  if type_map.get(name, None):
    return type_map.get(name, None)
  elif name == 'array':
    fill = f.options['fill'].value
    f_ = copy.copy(f)
    f_.type_id = fill
    return "[%s]" % to_type(f_)
  return name
1238115
function format (obj) {
  if (!obj || typeof obj !== 'object') {
    throw new TypeError('argument obj is required')
  }

  var subtype = obj.subtype
  var suffix = obj.suffix
  var type = obj.type

  if (!type || !TYPE_NAME_REGEXP.test(type)) {
    throw new TypeError('invalid type')
  }

  if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) {
    throw new TypeError('invalid subtype')
  }

  // format as type/subtype
  var string = type + '/' + subtype

  // append +suffix
  if (suffix) {
    if (!TYPE_NAME_REGEXP.test(suffix)) {
      throw new TypeError('invalid suffix')
    }

    string += '+' + suffix
  }

  return string
}
712913
def format_value(self, val):
        """"""
        if isinstance(val, six.text_type):
            return self.format_string(val)
        else:
            return six.text_type(val)
37450
async def format(self, fstype, *, uuid=None):
        """"""
        self._data = await self._handler.format(
            system_id=self.node.system_id, id=self.id,
            fstype=fstype, uuid=uuid)
4398
function format(errors, type) {
  return errors
    .filter(isDefaultError)
    .reduce((accum, error) => (
      accum.concat(displayError(type, error))
    ), []);
}
923538
def generic_document_type_formatter(view, context, model, name):
    """"""
    _document_model = model.get('document').document_type
    url = _document_model.get_admin_list_url()
    return Markup('<a href="%s">%s</a>' % (url, _document_model.__name__))
233639
static String typeToString(short type) {
        for (Field field : LinuxInput.class.getDeclaredFields()) {
            try {
                if (field.getName().startsWith("EV_")
                        && field.getType() == Short.TYPE
                        && field.getShort(null) == type) {
                    return field.getName();
                }
            } catch (IllegalAccessException e) {
            }
        }
        return new Formatter().format("0x%04x", type & 0xffff).out().toString();
    }
760875
def format(self):
        """"""
        value = self._schema.get("format", None)
        if value is None:
            return
        if not isinstance(value, basestring):
            raise SchemaError(
                "format value {0!r} is not a string".format(value))
        if value in [
            'date-time',
            'regex',
        ]:
            return value
        raise NotImplementedError(
            "format value {0!r} is not supported".format(value))
805988
def _get_type(self, obj):
        """"""
        typever = obj['Type']
        typesplit = typever.split('.')
        return typesplit[0] + '.' + typesplit[1]
56173
function formatValue(value) {
		
		var out;
		var type = util.sType(value);
		
		// if there is a type, check all sub items for types
		if (_.has(value, 'attributes.type') && _.has(value, '$value') && _.keys(value).length === 2) {
			out = util.moRef(value);
		}
		else if (type) {
			if (util.isArray(value)) {
				out = [];
				
				var subtype = type;
				
				if (subtype.match(/^ArrayOf/)) {
					subtype = subtype.replace(/^ArrayOf/, '');

					if (!Array.isArray(_.get(value, subtype)) && value[subtype]) {
						value[subtype] = [value[subtype]];
					}
				}
				
				_.forEach(value[_.keys(value)[1]], function(obj) {
					out.push(formatValue(obj));
				});
			}
			else if (util.isBoolean(value)) {
				
				// check for valid true values, otherwise false
				if (_.includes(['1', 'true'], _.lowerCase(value.$value))) {
					out = true;
				}
				else {
					out = false;
				}
			}
			else if (util.isInt(value)) {
				out = Number(value.$value);
			}
			else if (_.has(value, '$value')) {
				out = value.$value;
			}
			else {
				out = formatValue(_.omit(value, 'attributes'));
			}
			
		}
		else if (Array.isArray(value)) {
			out = [];
			_.forEach(value, function(val) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out.push(formatValue(val));
				}
				else {
					out.push(cast(val));
				}
			});
		}
		else if (util.hasKeys(value)) {
			out = {};
			_.forEach(value, function(val, key) {
				if (util.sType(val) || util.isArray(val) || util.hasKeys(val)) {
					out[key] = formatValue(val);
				}
				else {
					out[key] = cast(val);
				}
			});
		}
		else {
			out = cast(value);
		}
		return out;
	}
1090457
private String formatAccrueType(AccrueType type)
   {
      return (type == null ? null : LocaleData.getStringArray(m_locale, LocaleData.ACCRUE_TYPES)[type.getValue() - 1]);
   }
324992
def format(self, **kwargs):
        """"""
        attrs = self._attrs.copy()
        attrs.update(kwargs)
        lat, lon = self.lat_lon
        return type(self)(lat, lon, **attrs)
1167847
def make_type_consistent(s1, s2):
    """"""
    if isinstance(s1, str) and isinstance(s2, str):
        return s1, s2

    elif isinstance(s1, unicode) and isinstance(s2, unicode):
        return s1, s2

    else:
        return unicode(s1), unicode(s2)
617266
function hasTextMimetype(types) {
      if (!types) return true;
      for (var i = 0; i < types.length; i++) {
        if (types[i] === 'Text' || types[i] === 'text/plain') return true;
      }
      return false;
    }
359333
def normalize(expr):
    """"""
    args = [normalize(arg) for arg in expr.args]

    return type(expr)(expr.func, *args, start=expr.start, end=expr.end)
604281
private void configureInputFormat(CsvInputFormat<?> format, Class<?>... types) {
		format.setDelimiter(this.lineDelimiter);
		format.setFieldDelimiter(this.fieldDelimiter);
		format.setSkipFirstLineAsHeader(skipFirstLineAsHeader);
		if (this.includedMask == null) {
			format.setFieldTypes(types);
		} else {
			format.setFields(this.includedMask, types);
		}
	}
767987
def _value_format(self, value):
        """"""
        return super(Funnel, self)._value_format(value and abs(value))