:return: Default value for array elements.
346669
def get_default_value(self, state):
        
        if self._default_value_generator:
            return self._default_value_generator(state)
        else:
            return state.project.simos.get_default_value_by_type(self.element_type, state=state)
875859
def max(self, default=None):
        
        return numpy.asscalar(numpy.max(self.values)) if self.values else default
483924
def get_default_value(self, check):
        
        fun_name, fun_args, fun_kwargs, default = self._parse_with_caching(check)
        if default is None:
            raise KeyError('Check "%s" has no default value.' % check)
        value = self._handle_none(default)
        if value is None:
            return value
        return self._check_value(value, fun_name, fun_args, fun_kwargs)
1289644
def stdev(self, default=None):
        
        return numpy.asscalar(numpy.std(self.values)) if self.values else default
630891
def set_initial_values(self):
        
        self.normals = self.data['normals']
        self.vectors = numpy.ones((
            self.data['vectors'].shape[0],
            self.data['vectors'].shape[1],
            self.data['vectors'].shape[2] + 1
        ))
        self.vectors[:, :, :-1] = self.data['vectors']
        self.attr = self.data['attr']
        return
1225645
function default_value() {
  start_pos = input.pointer();
  value = parse_balanced(/\[/, /\]/, /[^\[\]]*/);
  if (look(/\]/)) {
    return value;
  }
  else {
    input.setPointer(start_pos);
    return match(/[^\]]*/);
  }
}
851615
def default_entities(self):
        """"""
        return [str(i) for i in range(self.rows + self.columns)]
727816
def default(self):
        """"""
        prop_def = getattr(self, '_default', utils.undefined)
        for prop in self.props:
            if prop.default is utils.undefined:
                continue
            if prop_def is utils.undefined:
                prop_def = prop.default
                break
        return prop_def
1026053
def get_default(self, ctx):
        """"""
        # Otherwise go with the regular default.
        if callable(self.default):
            rv = self.default()
        else:
            rv = self.default
        return self.type_cast_value(ctx, rv)
128625
def defaults(self):
        
        return {
            key: get_defaults(value)
            for key, value in self.all.items()
        }
686720
def _set_default_value(dict_obj, keys, value):
    
    variable = dict_obj

    if len(keys) == 1:
        if not variable.get(keys[0]):
            variable[keys[0]] = value

    else:
        for idx, field in enumerate(keys):
            if idx < len(keys) - 1:
                variable = variable[field]

        if not variable.get(keys[-1]):
            variable[keys[-1]] = value
1355045
def compute_default(kwargs):
    """"""
    ranked_default = kwargs.get('default')
    typ = kwargs.get('type', str)

    default = ranked_default.value if ranked_default else None
    if default is None:
      return 'None'

    if typ == list:
      default_str = '[{}]'.format(','.join(["'{}'".format(s) for s in default]))
    elif typ == dict:
      if default:
        default_str = '{{ {} }}'.format(
          ','.join(["'{}':'{}'".format(k, v) for k, v in default.items()]))
      else:
        default_str = '{}'
    elif typ == str:
      default_str = "'{}'".format(default).replace('\n', ' ')
    else:
      default_str = str(default)
    return default_str
896145
def is_default(self):
        
        for _, item in self.iter_items(recursive=True):
            if not item.is_default:
                return False
        return True
561353
def get_default(cls, category):
        """"""
        value = cls._DEFAULTS[category]
        if not value or not isinstance(value, list):
            return value
        return value[0]
1234654
function arrayDefaults(arr, values) {
  values.forEach(function(x) {
    if (!~arr.indexOf(x)) arr.push(x)
  })
}
921522
def get_value(self, index=None):
        

        if self.value is None:
            return self.default
        if index is not None:
            if self.value[index] is None:
                return self.default
            else:
                value = self.value[index]
        else:
            value = self.value

        return value
1104506
def default_value(self, default_value):
        
        # For custom value
        if default_value not in self.default_values:
            if len(self.default_labels) == len(self.default_values):
                self.default_values[-1] = default_value
            else:
                self.default_values.append(default_value)

        self._default_value = default_value