Format default values.
766134
def _format_default(client, value):
    """"""
    if isinstance(value, File):
        return os.path.relpath(
            str((client.workflow_path / value.path).resolve())
        )
    return value
596497
def hide_defaults(self):
        """"""
        for k in list(self.fields.keys()):
            if k in self.default_fields:
                if self.default_fields[k] == self.fields[k]:
                    del(self.fields[k])
        self.payload.hide_defaults()
361140
def p_default_clause(self, p):
        """"""
        p[0] = self.asttypes.Default(elements=p[3])
        p[0].setpos(p)
577152
private function formatPriceValues()
    {
        $this->price = (float)number_format(
            $this->price,
            2,
            '.',
            ''
        );

        $this->specialPrice = (float)number_format(
            $this->specialPrice,
            2,
            '.',
            ''
        );
    }
1320234
def format_values(self):
        
        source_key_to_display_value_map = {
            _COMMAND_LINE_SOURCE_KEY: "Command Line Args: ",
            _ENV_VAR_SOURCE_KEY: "Environment Variables:\n",
            _CONFIG_FILE_SOURCE_KEY: "Config File (%s):\n",
            _DEFAULTS_SOURCE_KEY: "Defaults:\n"
        }

        r = StringIO()
        for source, settings in self._source_to_settings.items():
            source = source.split("|")
            source = source_key_to_display_value_map[source[0]] % tuple(source[1:])
            r.write(source)
            for key, (action, value) in settings.items():
                if key:
                    r.write("  %-19s%s\n" % (key+":", value))
                else:
                    if isinstance(value, str):
                        r.write("  %s\n" % value)
                    elif isinstance(value, list):
                        r.write("  %s\n" % ' '.join(value))

        return r.getvalue()
872289
def get_default_values(data):
    """"""
    request = data.get('request')
    result = {}
    result['__datetime__'] = datetime.now()
    result['__ip_address__'] = request and get_ip(request) or '0.0.0.0'
    return result
838922
def _set_defaults(self):
        
        self.contents.setdefault('log', [])
        self.contents.setdefault('rollback', None)
        self.contents.setdefault('rollforward', None)
767813
def setDictDefaults (d, defaults):
  
  for key, val in defaults.items():
    d.setdefault(key, val)

  return d
566576
private void setDefaultValues() {

        //Setup icon
        m_icon.setContentMode(ContentMode.HTML);
        m_icon.setValue(FontOpenCms.WARNING.getHtml());

        //Set Mode option.
        m_mode.setValue("keysAndVariations");
    }
389988
def format(self, attrs, args=None):
        """"""
        if args is None:
            return attrs

        out = {}
        for key, val in attrs.items():
            mba = {'indexer': 'annual'}
            # Add formatting {} around values to be able to replace them with _attrs_mapping using format.
            for k, v in args.items():
                if isinstance(v, six.string_types) and v in self._attrs_mapping.get(key, {}).keys():
                    mba[k] = '{{{}}}'.format(v)
                elif isinstance(v, dict):
                    if v:
                        dk, dv = v.copy().popitem()
                        if dk == 'month':
                            dv = 'm{}'.format(dv)
                        mba[k] = '{{{}}}'.format(dv)
                else:
                    mba[k] = int(v) if (isinstance(v, float) and v % 1 == 0) else v

            out[key] = val.format(**mba).format(**self._attrs_mapping.get(key, {}))

        return out
845714
def defaults(current: dict, *args: AnyMapping) -> dict:
    
    """
    for data in args:
        for key, value in data.items():
            current.setdefault(key, value)
    return current
1153340
def _load_defaults(self):
        """"""
        for k, v in self._defaults.items():
            self[k] = v['default']
682836
def _fill_default_values(cls, cls_context, dict_):
        

        dict_with_default_values = dict(dict_)
        params = re.findall(cls._PATTERN_PARAM_NAME_TYPED_ANY,
                            cls_context.__doc__)

        for param in params:
            if param not in dict_with_default_values:
                dict_with_default_values[param] = None

        return dict_with_default_values
1049366
def set_default_names(data):
    """"""
    if all(name is not None for name in data.index.names):
        return data

    data = data.copy()
    if data.index.nlevels > 1:
        names = [name if name is not None else 'level_{}'.format(i)
                 for i, name in enumerate(data.index.names)]
        data.index.names = names
    else:
        data.index.name = data.index.name or 'index'
    return data
729811
private void initDefaultValues() {

    this.defaultValues.put(BigDecimal.class, new BigDecimal(0.0d));
    this.defaultValues.put(BigInteger.class, new BigInteger("0"));
    this.defaultValues.put(Boolean.class, false);
    this.defaultValues.put(Byte.class, (byte) 0);
    this.defaultValues.put(Calendar.class, CalendarValueSupplier.INSTANCE);
    this.defaultValues.put(Character.class, '\0');
    this.defaultValues.put(Double.class, 0.0d);
    this.defaultValues.put(Enum.class, null);
    this.defaultValues.put(Float.class, 0.0f);
    this.defaultValues.put(Integer.class, 0);
    this.defaultValues.put(Identifiable.class, null);
    this.defaultValues.put(Long.class, 0L);
    this.defaultValues.put(Short.class, (short) 0);
    this.defaultValues.put(String.class, null);
  }
1078504
def print_param_defaults(self_):
        """"""
        cls = self_.cls
        for key,val in cls.__dict__.items():
            if isinstance(val,Parameter):
                print(cls.__name__+'.'+key+ '='+ repr(val.default))
767566
def set_default(self, name, value):
        
        if self.vars is None:
            self.vars = {}
        if name not in self.vars:
            self.vars[name] = value