Return a CategoryDataPoint object newly created with value *value*,
        an optional *number_format*, and appended to this sequence.
556830
def add_data_point(self, value, number_format=None):
        
        data_point = CategoryDataPoint(self, value, number_format)
        self.append(data_point)
        return data_point
1004291
def store_series(category_count, value_count)  # :nodoc:
    record         = 0x1003     # Record identifier.
    length         = 0x000C     # Number of bytes to follow.
    category_type  = 0x0001     # Type: category.
    value_type     = 0x0001     # Type: value.
    # category_count            # Num of categories.
    # value_count               # Num of values.
    bubble_type    = 0x0001     # Type: bubble.
    bubble_count   = 0x0000     # Num of bubble values.

    store_simple(record, length, category_type, value_type,
                 category_count, value_count, bubble_type, bubble_count)
  end
853645
def _get_codes_for_values(values, categories):
    
    from pandas.core.algorithms import _get_data_algo, _hashtables
    dtype_equal = is_dtype_equal(values.dtype, categories.dtype)

    if dtype_equal:
        # To prevent erroneous dtype coercion in _get_data_algo, retrieve
        # the underlying numpy array. gh-22702
        values = getattr(values, '_ndarray_values', values)
        categories = getattr(categories, '_ndarray_values', categories)
    elif (is_extension_array_dtype(categories.dtype) and
          is_object_dtype(values)):
        # Support inferring the correct extension dtype from an array of
        # scalar objects. e.g.
        # Categorical(array[Period, Period], categories=PeriodIndex(...))
        try:
            values = (
                categories.dtype.construct_array_type()._from_sequence(values)
            )
        except Exception:
            # but that may fail for any reason, so fall back to object
            values = ensure_object(values)
            categories = ensure_object(categories)
    else:
        values = ensure_object(values)
        categories = ensure_object(categories)

    (hash_klass, vec_klass), vals = _get_data_algo(values, _hashtables)
    (_, _), cats = _get_data_algo(categories, _hashtables)
    t = hash_klass(len(cats))
    t.map_locations(cats)
    return coerce_indexer_dtype(t.lookup(vals), cats)
766943
def from_value(self, value):
        
        if value is None:
            sql_type = NVarCharType(size=1)
        else:
            sql_type = self._from_class_value(value, type(value))
        return sql_type
56459
public static MetricValue fromNumberValue(Number number) {
        if (number == null) {
            return EMPTY;
        } else if (number instanceof Float || number instanceof Double) {
            return fromDblValue(number.doubleValue());
        } else if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
            return fromIntValue(number.longValue());
        } else {
            throw new IllegalArgumentException("Unrecognized number type: " + number.getClass());
        }
    }
18015
function serializeValueType(t, valueType, acc) {
  if (t.isBooleanLiteral(valueType)) {
    acc.properties.unshift(
      t.objectProperty(t.identifier('type'), t.identifier('Boolean'))
    );
  } else if (t.isNumericLiteral(valueType)) {
    acc.properties.unshift(
      t.objectProperty(t.identifier('type'), t.identifier('Number'))
    );
  } else if (t.isStringLiteral(valueType) || t.isTemplateLiteral(valueType)) {
    acc.properties.unshift(
      t.objectProperty(t.identifier('type'), t.identifier('String'))
    );
  } else if (t.isRegExpLiteral(valueType)) {
    acc.properties.unshift(
      t.objectProperty(t.identifier('type'), t.identifier('RegExp'))
    );
  } else {
    throw new Error('unknown value type');
  }

  return acc;
}
726420
def numRef_xml(self, wksht_ref, number_format, values):
        
        pt_xml = self.pt_xml(values)
        return (
            '            <c:numRef>\n'
            '              <c:f>{wksht_ref}</c:f>\n'
            '              <c:numCache>\n'
            '                <c:formatCode>{number_format}</c:formatCode>\n'
            '{pt_xml}'
            '              </c:numCache>\n'
            '            </c:numRef>\n'
        ).format(**{
            'wksht_ref':     wksht_ref,
            'number_format': number_format,
            'pt_xml':        pt_xml,
        })
159996
def get_prep_value(self, value):
        
        if value:
            if not isinstance(value, PhoneNumber):
                value = to_python(value)
            if value.is_valid():
                format_string = getattr(settings, "PHONENUMBER_DB_FORMAT", "E164")
                fmt = PhoneNumber.format_map[format_string]
                value = value.format_as(fmt)
            else:
                value = self.get_default()
        return super(PhoneNumberField, self).get_prep_value(value)
142995
def add_format(self, key, value=None):
        
        if key in self.FORMAT:
            return
        self.FORMAT.append(key)
        if value is not None:
            for call in self:
                call.data.setdefault(key, value)
977677
def add_data_point(self, x, y):
        """"""

        if not is_numeric(x):
            raise TypeError("x value must be numeric, not '%s'" % str(x))
        if not is_numeric(y):
            raise TypeError("y value must be numeric, not '%s'" % str(y))
        current_last_x = self._data[-1][0]
        self._data.append((x, y))
        if x < current_last_x:
            self._data = sorted(self._data, key=lambda k: k[0])
848797
function resolveCategory(categoryParam: number | string, defaultCategory: number): number {
  if (typeof categoryParam === 'number') {
    return categoryParam;
  }

  if (typeof categoryParam === 'string') {
    if (categoryParam in primaryCategoryNumbers) {
      return primaryCategoryNumbers[categoryParam];
    }
  }

  return defaultCategory;
}
512693
def add_data_point(self, x, y, size, number_format=None):
        
        data_point = BubbleDataPoint(self, x, y, size, number_format)
        self.append(data_point)
        return data_point
1369410
def data(self, value):
        
        self.loader.save_image(self.category, self.image, value)
112530
def apnumber(value):
    """"""
    try:
        value = int(value)
    except (TypeError, ValueError):
        return value
    if not 0 < value < 10:
        return str(value)
    return (_('one'), _('two'), _('three'), _('four'), _('five'), _('six'),
            _('seven'), _('eight'), _('nine'))[value - 1]
122623
def categories(self, value):
        

        if value is not None:
            assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("categories", value)
            for key in value:
                assert type(key) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format(
                    "categories", key)
        self.__categories = value
644774
def _serialize(self, value, attr, obj):
        """"""
        value = super(PhoneNumberField, self)._serialize(value, attr, obj)

        if value:
            value = self._format_phone_number(value, attr)

        return value
267007
def to_representation(self, value):
        """"""
        content_type = ContentType.objects.get_for_id(value)
        return "_".join(content_type.natural_key())