Get the initial data that got passed into the superform for this
        composite field. It should return ``None`` if no initial values where
        given.
546480
def get_initial(self, form, name):
        

        if hasattr(form, 'initial'):
            return form.initial.get(name, None)
        return None
687759
def _get_fields(self):
        
        if self.data is not None:
            return self.begin, self.end, self.data
        else:
            return self.begin, self.end
498932
def get_if_present(self, name, default=None):
        
        if not self.processed_data:
            raise exceptions.FormNotProcessed('The form data has not been processed yet')

        if name in self.field_dict:
            return self[name]

        return default
1093492
def _get_data(self, fields=None, compare=True):
        
        fields = fields or []
        if self._key is None or self._key == '' or self._key == 0:
            d = {}
            for k, v in self.properties.items():
                #test fields
                if fields and k not in fields:
                    continue
#                if not isinstance(v, ManyToMany):
                if v.property_type == 'compound':
                    continue
                if v.sequence:
                    continue
                if not isinstance(v, ManyToMany):
                    x = v.get_value_for_datastore(self)
                    if isinstance(x, Model):
                        x = x._key
                    elif x is None or (k==self._primary_field and not x):
                        if isinstance(v, DateTimeProperty) and v.auto_now_add:
                            x = v.now()
                        elif (v.auto_add or (not v.auto and not v.auto_add)):
                            x = v.default_value()
                else:
                    x = v.get_value_for_datastore(self, cached=True)
                if x is not None and not x is Lazy:
                    d[k] = x
        else:
            d = {}
            d[self._primary_field] = self._key
            for k, v in self.properties.items():
                if fields and k not in fields:
                    continue
                if v.property_type == 'compound':
                    continue
                t = self._old_values.get(k, None)
                if not isinstance(v, ManyToMany):
                    x = v.get_value_for_datastore(self)
                    if isinstance(x, Model):
                        x = x._key
                else:
                    x = v.get_value_for_datastore(self, cached=True)
                if not x is Lazy:
                    if (compare and t != self.field_str(x)) or not compare:
                        d[k] = x
        
        return d
202158
def get_form_instance(self, request, data=None, instance=None):
        
        defaults = {}
        if self.form:
            defaults['form'] = self.form
        if self.fields:
            defaults['fields'] = self.fields
        return modelform_factory(self.model, **defaults)(data=data, instance=instance)
1083824
def get_changeform_initial_data(self, request):
        ''''''
        initial = super(PageAdmin, self).get_changeform_initial_data(request)
        if ('translation_of' in request.GET):
            original = self.model._tree_manager.get(
                pk=request.GET.get('translation_of'))
            initial['layout'] = original.layout
            initial['theme'] = original.theme
            initial['color_scheme'] = original.color_scheme

            # optionaly translate title and make slug
            old_lang = translation.get_language()
            translation.activate(request.GET.get('language'))
            title = _(original.title)
            if title != original.title:
                initial['title'] = title
                initial['slug'] = slugify(title)
            translation.activate(old_lang)

        return initial
915995
def get_first(self):
		""""""
		try: # Nested try..except because of Python 2.4
			self.lock.acquire()
			try:
				return self.get(self.data_idx[0])
			except (IndexError, ValueError):
				return "NONE"
		finally:
			self.lock.release()
1054826
def get_context_data(self, **kwargs):
        
        for key in self.get_form_class_keys():
            kwargs['{}_form'.format(key)] = self.get_form(key)
        return super(FormMixin, self).get_context_data(**kwargs)
500035
def first(self):
        
        if self.mode == 'local':
            return self.values[0]

        if self.mode == 'spark':
            return self.values.first().toarray()
770880
public String getInitField(FieldData recFieldData, boolean bConstantsNotVariables, boolean bThinConstants)
    {
        boolean bConstantValue = false;
        boolean bValidThinConstant = true;
        String strInitField = recFieldData.getField(FieldData.INITIAL_VALUE).getString();
        if (strInitField != null) if (strInitField.length() > 0)
        {
            if (strInitField.charAt(0) == '\"')
                bConstantValue = true;  // This is a constant value (a string)
            if (Character.isDigit(strInitField.charAt(0)))
                bConstantValue = true;  // This is a constant value (a number)
            if ((strInitField.equalsIgnoreCase("true")) || (strInitField.equalsIgnoreCase("false")))
                bConstantValue = true;  // This is a constant value (a number)
            if (strInitField.startsWith("new "))
                bConstantValue = true;  // This is a constant value (an object)
            if (strInitField.indexOf('.') != -1)
                if (strInitField.lastIndexOf('(') <= 1) // Not found or a class cast.
                    if (!Utility.isNumeric(strInitField))
                {
                    bConstantValue = true;  // This is a constant value (a member constant - not a function call)
                    bValidThinConstant = false;
                }
        }
        if (bConstantsNotVariables != bConstantValue)
            strInitField = DBConstants.BLANK;          // Not asking for this type of value
        if (bThinConstants)
            if (!bValidThinConstant)
                strInitField = DBConstants.BLANK;          // Not asking for this type of value
        return strInitField;
    }
1304397
def init_interface(field):
    ''''''
    interface_shape = np.array(field.shape); interface_shape[-1] += 1
    interfaces = np.tile(False,len(interface_shape)); interfaces[-1] = True
    interface_zero = Field(np.zeros(interface_shape), domain=field.domain, interfaces=interfaces)
    return interface_zero
978478
def get_context_data(self, **kwargs):
        
        context = super(FilterFormMixin, self).get_context_data(**kwargs)
        context[self.context_filterform_name] = self.get_filter()
        return context
1167389
def get_composite_field_value(self, name):
        
        field = self.composite_fields[name]
        if hasattr(field, 'get_form'):
            return self.forms[name]
        if hasattr(field, 'get_formset'):
            return self.formsets[name]
520638
def get_previous_and_current_values(self, instance):
        
        translated_field_names = self._get_translated_field_names(instance.master)
        if instance.pk:
            try:
                previous_obj = instance._meta.model.objects.get(pk=instance.pk)
                previous_values = self.get_obj_values(previous_obj, translated_field_names)
            except ObjectDoesNotExist:
                previous_values = {}
        else:
            previous_values = {}
        current_values = self.get_obj_values(instance, translated_field_names)
        return previous_values, current_values
573707
def get_default_value(self):
        
        default = self.default_value
        if isinstance(default, collections.Callable):
            default = default()
        return default
588396
def get_form_kwargs(self):
        
        kwargs = super(SmartFormMixin, self).get_form_kwargs()
        kwargs['initial'] = self.derive_initial()
        return kwargs
1351486
def first(self, default=None, as_dict=False, as_ordereddict=False):
        """"""

        # Try to get a record, or return/raise default.
        try:
            record = self[0]
        except IndexError:
            if isexception(default):
                raise default
            return default

        # Cast and return.
        if as_dict:
            return record.as_dict()
        elif as_ordereddict:
            return record.as_dict(ordered=True)
        else:
            return record