Form the correct create_option to append to results.
542022
def get_create_option(self, context, q):
        """"""
        create_option = []
        display_create_option = False
        if self.create_field and q:
            page_obj = context.get('page_obj', None)
            if page_obj is None or page_obj.number == 1:
                display_create_option = True

        if display_create_option and self.has_add_permission(self.request):
            '''
            Generate querysets of Locations, StaffMembers, and Users that 
            match the query string.
            '''
            for s in Location.objects.filter(
                Q(
                    Q(name__istartswith=q) & Q(transactionparty__isnull=True)
                )
            ):
                create_option += [{
                    'id': 'Location_%s' % s.id,
                    'text': _('Generate from location "%(location)s"') % {'location': s.name},
                    'create_id': True,
                }]

            for s in StaffMember.objects.filter(
                Q(
                    (Q(firstName__istartswith=q) | Q(lastName__istartswith=q)) &
                    Q(transactionparty__isnull=True)
                )
            ):
                create_option += [{
                    'id': 'StaffMember_%s' % s.id,
                    'text': _('Generate from staff member "%(staff_member)s"') % {'staff_member': s.fullName},
                    'create_id': True,
                }]

            for s in User.objects.filter(
                Q(
                    (Q(first_name__istartswith=q) | Q(last_name__istartswith=q)) &
                    Q(staffmember__isnull=True) & Q(transactionparty__isnull=True)
                )
            ):
                create_option += [{
                    'id': 'User_%s' % s.id,
                    'text': _('Generate from user "%(user)s"') % {'user': s.get_full_name()},
                    'create_id': True,
                }]

            # Finally, allow creation from a name only.
            create_option += [{
                'id': q,
                'text': _('Create "%(new_value)s"') % {'new_value': q},
                'create_id': True,
            }]
        return create_option
476332
def append(self, item):
        
        validated_value = self.get_validated_object(item)
        if validated_value is not None:
            self.__modified_data__.append(validated_value)
924155
def add_result(self, content_id, content, **kwargs):
        """""""
        result_object = self.ResultClass(content_id, self.name, self.version,
                                         formats.JSON, content, **kwargs)
        self.results.append(result_object)
        return
852465
def create(cls, result_id=None, summary=None, file_modified_at=None):
        """"""
        asset = cls(result_id, summary, file_modified_at)

        db.session.add(asset)
        db.session.commit()

        return asset
1200749
def generate_create_view(self):
        """"""

        name = model_class_form(self.model + 'CreateView')
        create_args = dict(
            form_class=self.get_actual_form('create'),
            model=self.get_model_class,
            template_name=self.get_template('create'),
            permissions=self.view_permission('create'),
            permission_required=self.check_permission_required,
            login_required=self.check_login_required,
            inlineformset=self.inlineformset,
            success_url=reverse_lazy('{}-{}-list'.format(self.app, self.custom_postfix_url)),
            custom_form=self.createupdate_forms or self.custom_modelform,
            custom_postfix_url=self.custom_postfix_url
        )

        parent_classes = [self.get_createupdate_mixin(), CreateView]
        if self.custom_create_view_mixin:
            parent_classes.insert(0, self.custom_create_view_mixin)

        create_class = type(
            name,
            tuple(parent_classes),
            create_args
        )

        self.classes[name] = create_class
        return create_class
833958
def _append(self, evt):
        """"""
        evts = self._evts
        if len(evts) == self._max_buf:
            evts.pop(0)
        evts.append(evt)
985108
def append(self, name, value):
        
        if self.vars is None:
            self.vars = {}
        if name in self.vars:
            self.vars[name].append(value)
        else:
            self.vars[name] = [value]
1037628
def add(self, opt, val=None):
        """"""

        ov = opt.split('=', 1)
        o = ov[0]
        v = len(ov) > 1 and ov[1] or None

        if (v):
            if val != None:
                raise AttributeError("ambiguous option value")
            val = v

        if val == False:
            return

        if val in (None, True):
            self.optlist.add(o)
        else:
            self.optdict[o] = val
910576
def create_or_update(options) #:nodoc:
                                  #      puts 'create_or_update'
      ret = true
      run_callbacks :save do
        result = new_record? ? create(options) : update(options)
#        puts 'save_callbacks result=' + result.inspect
        ret = result
      end
      ret
    end
229441
def create_append(filename: str, layers: Union[np.ndarray, Dict[str, np.ndarray], loompy.LayerManager], row_attrs: Dict[str, np.ndarray], col_attrs: Dict[str, np.ndarray], *, file_attrs: Dict[str, str] = None, fill_values: Dict[str, np.ndarray] = None) -> None:
	
	deprecated("'create_append' is deprecated. See https://github.com/linnarsson-lab/loompy/issues/42")
	if os.path.exists(filename):
		with connect(filename) as ds:
			ds.add_columns(layers, col_attrs, fill_values=fill_values)
	else:
		create(filename, layers, row_attrs, col_attrs, file_attrs=file_attrs)
730894
private static void appendResult(int result, Appendable dest,
            int cpLength, int options, Edits edits) throws IOException {
        // Decode the result.
        if (result < 0) {
            // (not) original code point
            if (edits != null) {
                edits.addUnchanged(cpLength);
                if ((options & OMIT_UNCHANGED_TEXT) != 0) {
                    return;
                }
            }
            appendCodePoint(dest, ~result);
        } else if (result <= UCaseProps.MAX_STRING_LENGTH) {
            // The mapping has already been appended to result.
            if (edits != null) {
                edits.addReplace(cpLength, result);
            }
        } else {
            // Append the single-code point mapping.
            int length = appendCodePoint(dest, result);
            if (edits != null) {
                edits.addReplace(cpLength, length);
            }
        }
    }
98193
def set(self, results):
        
        self.results = list()
        for row in results:
            self.append(row)
588551
def create_result(self, imports, module_name, import_from, meta, val, dividers):
        """"""
        options = {"imports": imports, "module_name": module_name, "import_from": import_from}
        return ImportLine.FieldSpec(formatter=MergedOptionStringFormatter).normalise(meta, options)
237488
def _post_create(atdepth, entry, result):
    
    if not atdepth and entry is not None:
        if result is not None:
            #We need to get these results a UUID that will be saved so that any
            #instance methods applied to this object has a parent to refer to.
            retid = _tracker_str(result)
            entry["r"] = retid
            ekey = retid
        else: # pragma: no cover
            ekey = _tracker_str(cls)

        msg.info("{}: {}".format(ekey, entry), 1)
        record(ekey, entry)
696682
public ValidationPlanResult append(Collection<ValidationResult> results) {
		if (results == null) {
			return this;
		}
		for (ValidationResult message : results) {
			addResult(message);
		}
		return this;
	}
549942
def Append(self, **kw):
        
        kw = copy_non_reserved_keywords(kw)
        for key, val in kw.items():
            # It would be easier on the eyes to write this using
            # "continue" statements whenever we finish processing an item,
            # but Python 1.5.2 apparently doesn't let you use "continue"
            # within try:-except: blocks, so we have to nest our code.
            try:
                if key == 'CPPDEFINES' and SCons.Util.is_String(self._dict[key]):
                    self._dict[key] = [self._dict[key]]
                orig = self._dict[key]
            except KeyError:
                # No existing variable in the environment, so just set
                # it to the new value.
                if key == 'CPPDEFINES' and SCons.Util.is_String(val):
                    self._dict[key] = [val]
                else:
                    self._dict[key] = val
            else:
                try:
                    # Check if the original looks like a dictionary.
                    # If it is, we can't just try adding the value because
                    # dictionaries don't have __add__() methods, and
                    # things like UserList will incorrectly coerce the
                    # original dict to a list (which we don't want).
                    update_dict = orig.update
                except AttributeError:
                    try:
                        # Most straightforward:  just try to add them
                        # together.  This will work in most cases, when the
                        # original and new values are of compatible types.
                        self._dict[key] = orig + val
                    except (KeyError, TypeError):
                        try:
                            # Check if the original is a list.
                            add_to_orig = orig.append
                        except AttributeError:
                            # The original isn't a list, but the new
                            # value is (by process of elimination),
                            # so insert the original in the new value
                            # (if there's one to insert) and replace
                            # the variable with it.
                            if orig:
                                val.insert(0, orig)
                            self._dict[key] = val
                        else:
                            # The original is a list, so append the new
                            # value to it (if there's a value to append).
                            if val:
                                add_to_orig(val)
                else:
                    # The original looks like a dictionary, so update it
                    # based on what we think the value looks like.
                    if SCons.Util.is_List(val):
                        if key == 'CPPDEFINES':
                            tmp = []
                            for (k, v) in orig.items():
                                if v is not None:
                                    tmp.append((k, v))
                                else:
                                    tmp.append((k,))
                            orig = tmp
                            orig += val
                            self._dict[key] = orig
                        else:
                            for v in val:
                                orig[v] = None
                    else:
                        try:
                            update_dict(val)
                        except (AttributeError, TypeError, ValueError):
                            if SCons.Util.is_Dict(val):
                                for k, v in val.items():
                                    orig[k] = v
                            else:
                                orig[val] = None
        self.scanner_map_delete(kw)
1342788
def append(self, from_group_id, to_group_id, session):
        ''''''
        request = TOPRequest('taobao.crm.group.append')
        request['from_group_id'] = from_group_id
        request['to_group_id'] = to_group_id
        self.create(self.execute(request, session), fields=['is_success',])
        return self.is_success