Select CSS statistics data format
@param {String} format
@returns {{extension: String, method: String}}
@private
489154
function selectFormat(format) {
  let method = "toTable";
  let extension = `.${format}`;

  switch (format) {
    case "json":
      method = "toJSON";
      break;
    case "csv":
      method = "toCSV";
      break;
    case "html":
      method = "toHTML";
      break;
    case "md":
      method = "toMarkdown";
      break;
    default:
      break;
  }

  return {
    extension: extension,
    method: method
  }
}
938102
function getFormat (obj) {
	//undefined format - no format-related props, for sure
	if (!obj) return {}

	//if is string - parse format
	if (typeof obj === 'string' || obj.id) {
		return parse(obj.id || obj)
	}

	//if audio buffer - we know it’s format
	else if (isAudioBuffer(obj)) {
		var arrayFormat = fromTypedArray(obj.getChannelData(0))
		return {
			sampleRate: obj.sampleRate,
			channels: obj.numberOfChannels,
			samplesPerFrame: obj.length,
			float: true,
			signed: true,
			bitDepth: arrayFormat.bitDepth
		}
	}

	//if is array - detect format
	else if (ArrayBuffer.isView(obj)) {
		return fromTypedArray(obj)
	}

	//FIXME: add AudioNode, stream detection

	//else detect from obhect
	return fromObject(obj)
}
99138
function(formats) {
        for(let format of formats) {
            // TODO: rather than hard coding the mime type use library.spec.base_mime_type
            if(format.mime_type.match(/application\/tsrc\+.+/)) {
                return format;
            }
        }
        return null;
    }
197363
function (format) {
	return function (card) {
		card = getCode(card);
		if (!card)
			return undefined;
		card--;
		return format({rank: card >> 2, suit: card & 3});
	};
}
136498
function(format)
        {
            return !isDate(this._d) ? '' : hasMoment ? moment(this._d).format(format || this._o.format) : this._d.toDateString();
        }
342671
function getFormatter(oType) {
		var oFormatOptions, iScale;

		if (!oType.oFormat) {
			oFormatOptions = {
				groupingEnabled : true,
				maxIntegerDigits : Infinity
			};
			iScale = getScale(oType);
			if (iScale !== Infinity) {
				oFormatOptions.minFractionDigits = oFormatOptions.maxFractionDigits = iScale;
			}
			oFormatOptions = jQuery.extend(oFormatOptions, oType.oFormatOptions);
			oFormatOptions.parseAsString = true;
			oType.oFormat = NumberFormat.getFloatInstance(oFormatOptions);
		}
		return oType.oFormat;
	}
1143935
function (format) {
        return function (data) {
            var el = makeElement("img", [ "image-output" ]);
            el.src = "data:image/" + format + ";base64," + joinText(data).replace(/\n/g, "");
            return el;
        };
    }
1165566
function getElementStyleSheet(element) {
  assertHTMLElement(element);
  return genericPropertyGet(
      Methods.SHEET_GETTER, element, 'sheet', function(sheet) {
        return sheet instanceof CSSStyleSheet;
      });
}
1065255
function (data) {
    var schema = this.schema;
    if (typeof data === 'string') { return data; }
    if (this.isSingleProperty) { return stringifyProperty(data, schema); }
    data = stringifyProperties(data, schema);
    return styleParser.stringify(data);
  }
209209
function (format, quality) {
      var canvasEl = this.upperCanvasEl || this.lowerCanvasEl;

      this.renderAll(true);
      var data = (fabric.StaticCanvas.supports('toDataURLWithQuality'))
                   ? canvasEl.toDataURL('image/' + format, quality)
                   : canvasEl.toDataURL('image/' + format);
      this.renderAll();
      return data;
    }
860756
function toTechFormat(dt, format) {
  return dt.isValid
    ? Formatter.create(Locale.create("en-US"), {
        allowZ: true,
        forceSimple: true
      }).formatDateTimeFromString(dt, format)
    : null;
}
821463
function stringify (format) {
	//TODO: extend possible special formats
	var result = []

	//(S|U)(8|16|24|32)_(LE|BE)?
	result.push(format.float ? 'F' : (format.signed ? 'S' : 'U'))
	result.push(format.bitDepth)
	result.push(format.byteOrder)
	result.push(format.channels)
	result.push(format.sampleRate)
	result.push(format.interleaved ? 'I' : 'N')

	return result.join('_')
}
103808
function (format) {
  throw new Error(index$1.red('[indian-ocean] You passed in an object but converting to ' + index$1.bold(format) + ' requires a list of objects.') + index$1.cyan('\nIf you would like to write a one-row csv, put your object in a list like so: `' + index$1.bold('[data]') + '`\n'));
}
247733
public static String selectDateFormat(Locale locale, String format) {
		String selFormat;
		if (format == null) {
			selFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).toPattern();
			// Since DateFormat.SHORT is silly, return a smart format
			if (selFormat.equals("M/d/yy")) {
				return "MM/dd/yyyy";
			}
			if (selFormat.equals("d/M/yy")) {
				return "dd/MM/yyyy";
			}
		} else {
			selFormat = format;
		}

		return selFormat;
	}
1308369
public final String formatFinish(Format format) {
        if (format != null) {
            Long minFinish = interval.getMinFinish();
            if (minFinish != null) {
                return format.format(minFinish);
            } else {
                return null;
            }
        } else {
            Long minFinish = interval.getMinFinish();
            if (minFinish != null) {
                return numberFormat.get().format(minFinish);
            } else {
                return null;
            }
        }
    }
861686
function format (form) {
        return formToMarkup(form)
        // Split lines.
        .split('\n')
        .map(function (line, index) {
          return EMPTY_LINE.test(line)
          // If the line is empty, leave it empty.
          ? line
          : index === 0
              ? line
              // On subsequent lines with indentation, add spaces
              // to existing indentation.
              : ' '.repeat(token.position.column - 1) + line
        })
        .join('\n')
      }
429563
function(format) {
    if (typeof format === "undefined") {
      _deleteOwnProperties(_clipData);
      _clipDataFormatMap = null;
    } else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
      delete _clipData[format];
    }
  }