save cast, since members are managed by this instance
542677
@SuppressWarnings("unchecked")
    @Override
    public <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType) {
        if (Geldbetrag.class.equals(amountType)) {
            return (MonetaryAmountFactory<T>) new GeldbetragFactory();
        }
        MonetaryAmountFactoryProviderSpi<T> f = MonetaryAmountFactoryProviderSpi.class.cast(factories.get(amountType));
        if (Objects.nonNull(f)) {
            return f.createMonetaryAmountFactory();
        }
        throw new MonetaryException("no MonetaryAmountFactory found for " + amountType);
    }
954504
def cast(self, value, **opts):
        
        if isinstance(value, self.result_type):
            return value
        if self._is_null(value):
            return None
        try:
            opts_ = self.opts.copy()
            opts_.update(opts)
            return self._cast(value, **opts_)
        except Exception as e:
            if not isinstance(e, ConverterError):
                e = ConverterError(None, exc=e)
            e.converter = self.__class__
            raise e
479683
def cast_to(type, parser = nil)
            assert_cast_type(type)

            cast = type.new(self.copy, parser)
            cast.file_offset = @file_offset

            transfer_attributes(cast)
        end
1352403
def save(coll, to_save):
	
	filter = Projection(['_id'], to_save)
	upsert_replace = functools.partial(coll.replace_one, filter, upsert=True)
	op = upsert_replace if filter else coll.insert_one
	return op(to_save)
1029069
function (member, memberValue, visibility) {
        var newType = typeof memberValue,
            baseMemberValue,
            baseType,
            prototype = this._Constructor.prototype;
        _gpfAssert(!prototype.hasOwnProperty(member), "Existing own member can't be overridden");
        baseMemberValue = this._Super.prototype[member];
        baseType = typeof baseMemberValue;
        if ("undefined" !== baseType) {
            if (null !== baseMemberValue && newType !== baseType) {
                gpf.Error.classMemberOverloadWithTypeChange();
            }
            if ("function" === newType && _gpfUsesSuper(memberValue)) {
                memberValue = _gpfGenSuperMember(baseMemberValue, memberValue);
            }
        }
        _gpfIgnore(visibility); // TODO Handle constructor visibility
        prototype[member] = memberValue;
    }
608101
def save
      if @parse_object_id
        method = :put
        merge!(@op_fields) # use ops instead of our own view of the columns
      else
        method = :post
      end

      body = safe_hash.to_json
      data = @client.request(uri, method, body)

      if data
        # array ops can return mutated view of array which needs to be parsed
        object = Parse.parse_json(class_name, data)
        object = Parse.copy_client(@client, object)
        parse object
      end

      if @class_name == Parse::Protocol::CLASS_USER
        delete('password')
        delete(:username)
        delete(:password)
      end

      self
    end
700046
public void savePersistentObject(PersistentObject object) {
        final String type = object.getClass().getSimpleName();
        LOG.trace("Trying to create a new " + type);
        dao.saveOrUpdate(object);
        LOG.info("Created the " + type + " with id " + object.getId());
    }
1288908
def member(Imported, **Config):
  
  """
  __ec_member__ = Imported.__ec_member__
  __ec_member__.Config.update(**Config)

  state.ActiveModuleMemberQ.insert(0, __ec_member__)
846940
def save(self, *args, **kwargs):
        
        if not self.target:
            self.target = str(self.content_object)
        if not self.actor_name:
            self.actor_name = str(self.actor)
        super(Activity, self).save()
147721
function put_member_object(MemberName, Member) {
	// Get the Member Object filename.
	var filename = get_member_path(MemberName);
	npm_fs_extra.ensureDirSync(filename);
	// Write the Member Object.
	filename = npm_path.join(filename, 'member.json');
	npm_fs_extra.outputFileSync(filename, JSON.stringify(Member, null, 4));
	return;
}
595526
function(){
    var sourceMap = this.sourceMap_;
    var memberMap = this.members_;
    var curMember;
    var newMember;
    var curMemberId;
    var newMemberId;
    var sourceObject;
    var sourceObjectInfo;
    var inserted = [];
    var deleted = [];
    var delta;

    for (var sourceObjectId in sourceMap)
    {
      sourceObjectInfo = sourceMap[sourceObjectId];
      sourceObject = sourceObjectInfo.sourceObject;

      curMember = sourceObjectInfo.member;
      newMember = this.map ? this.map(sourceObject) : sourceObject;

      if (newMember instanceof DataObject == false || this.filter(newMember))
        newMember = null;

      if (!isEqual(curMember, newMember))
      {
        sourceObjectInfo.member = newMember;

        // if here is ref for member already
        if (curMember)
        {
          curMemberId = curMember.basisObjectId;

          // call callback on member ref add
          if (this.removeMemberRef)
            this.removeMemberRef(curMember, sourceObject);

          // decrease ref count
          memberMap[curMemberId]--;
        }

        // if new member exists, update map
        if (newMember)
        {
          newMemberId = newMember.basisObjectId;

          // call callback on member ref add
          if (this.addMemberRef)
            this.addMemberRef(newMember, sourceObject);

          if (newMemberId in memberMap)
          {
            // member is already in map -> increase ref count
            memberMap[newMemberId]++;
          }
          else
          {
            // add to map
            memberMap[newMemberId] = 1;

            // add to delta
            inserted.push(newMember);
          }
        }
      }
    }

    // get deleted delta
    for (curMemberId in this.items_)
      if (memberMap[curMemberId] == 0)
      {
        delete memberMap[curMemberId];
        deleted.push(this.items_[curMemberId]);
      }

    // if any changes, fire event
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
933375
def save(self):
        
        if 'save' not in self._supports:
            raise AssertionError('Can not save this object type')

        values = {}
        for key in [key for key in self.keys() if key not in self._save_ignore]:
            if not getattr(self, key) and getattr(self, key) != False:
                continue

            if isinstance(getattr(self, key, None), list):
                value = list()
                for item in getattr(self, key):
                    if isinstance(item, dict):
                        value.append(item)
                    elif hasattr(item, '_save_as'):
                        value.append(item._save_as())
                    elif hasattr(item, '_ref') and getattr(item, '_ref'):
                        value.append(getattr(item, '_ref'))
                    else:
                        LOGGER.warning('Cant assign %r', item)
                values[key] = value
            elif getattr(self, key, None):
                values[key] = getattr(self, key)
        if not self._ref:
            response = self._session.post(self._path, values)
        else:
            values['_ref'] = self._ref
            response = self._session.put(self._path, values)
        LOGGER.debug('Response: %r, %r', response.status_code, response.content)
        if 200 <= response.status_code <= 201:
            self.fetch()
            return True
        else:
            try:
                error = response.json()
                raise exceptions.ProtocolError(error['text'])
            except ValueError:
                raise exceptions.ProtocolError(response.content)
814927
def save(self, *args, **kwargs):
        """"""
        self.save_prep(instance_or_instances=self)
        return super(AbstractTokenModel, self).save(*args, **kwargs)
79814
def frommembers(cls, members):
        """"""
        return cls.frombitsets(map(cls.BitSet.frommembers, members))
200690
def save(self, idempotency_key=None):
        """"""
        updated_params = self.serialize(None)
        headers = populate_headers(idempotency_key)

        if not updated_params:
            util.logger.debug("Trying to save already saved object %r", self)
            return defer.succeed(self)

        d = self.request('post', self.instance_url(), updated_params, headers)
        return d.addCallback(self.refresh_from).addCallback(lambda _: self)
172673
private Collection<ImmutableMember> handleSync(ImmutableMember member) {
    updateState(member);
    return new ArrayList<>(members.values().stream().map(SwimMember::copy).collect(Collectors.toList()));
  }
1205292
def save(self, *args, **kwargs):
        
        if not self.instance.id:
            self.instance.created_by = self.user
        self.instance.last_modified_by = self.user
        return super(ChangeableContentForm, self).save(*args, **kwargs)