Logical implementation of the store() command
974345
public function store(Memento\Key $key, $value, $expires = null, $ttl = null)
    {
        $keyPath = $this->getKeyPath($key);
        $data = serialize($value);

        $cacheFile = $keyPath . DIRECTORY_SEPARATOR . self::FILENAME_CACHE;
        $expiresFile = $this->getExpiresPath($key) . DIRECTORY_SEPARATOR . self::FILENAME_EXPIRES;
        $ttlFile = $this->getTtlPath($key) . DIRECTORY_SEPARATOR . self::FILENAME_TTL;

        // if no expires specified use default of 5 minutes
        if (!is_numeric($expires)) {
            $expires = self::DEFAULT_EXPIRES;
        }
        $expiresBytes = file_put_contents($expiresFile, time() + $expires, LOCK_EX);

        // ttl is when the cache is actually okay for deletion
        if (!is_numeric($ttl)) {
            $ttl = $expires;
        }

        $ttlBytes = file_put_contents($ttlFile, time() + $ttl, LOCK_EX);

        $cacheBytes = file_put_contents($cacheFile, $data, LOCK_EX);

        if ($expiresBytes > 0 && $ttlBytes > 0 && $cacheBytes > 0) {
            return true;
        }

        return false;
    }
1143648
function createStore(storeObj) {
    switch(storeObj.type) {
      case 'redis':
        return RedisStore(thorin, storeObj, opt);
      case 'sql':
        return SqlStore(thorin, storeObj, opt);
      case 'file':
        return FileStore(thorin, storeObj.path, opt);
      case 'memory':
        return MemStore(thorin, opt);
      default:
        throw thorin.error('PLUGIN_SESSION', `Invalid session store ${storeObj.type} for the session plugin.`);
    }
  }
1338981
protected function store()
	{
		$options = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
		file_put_contents($this->filename, json_encode($this->settings, $options));
	}
1151154
function __() {
    var us = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    var store = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    store = typeof us === "boolean" ? us : store;
    us = typeof us === "boolean" ? [] : us;

    var seq = []; //seq is vanilla JS array + features
    seq.id = getID();
    seq.store = store;
    seq.us = us;
    seq.ds = [];
    seq.updatedTo = {};
    seq.us.map(function (u) {
      //  seq is a member of u.ds
      u.ds[u.ds.length] = seq;
      u.updatedTo[seq.id] = 0; // non-interference dependency
    });
    seq.IndexOnTimestamp = {};
    seq.TimestampOnIndex = {};
    seq.propagating = 0;
    seq.done = 0;
    seq.eqs = [];
    seq.addEq = function (eq) {
      return seq.eqs[seq.eqs.length] = eq;
    };
    seq.evalEqs = function (val) {
      var val0 = val;
      seq.eqs.map(function (eq) {
        return val = eq(val);
      });
      return seq.us.length === 0 ? val0 : val;
    };
    //api-----------------
    Object.keys(__.api).map(function (api) {
      seq[api] = __.api[api](__, seq, store);
    });
    //-----------------
    Object.defineProperties(seq, //detect t update on each seqs
    {
      t: {
        //foo.t
        get: function get() {
          return seq.valOnT;
        },
        set: function set(tval) {
          var sanityCheck = seq.propagating === 0 && seq.us.length !== 0 ? function () {
            throw new Error("Do not set a value of the sequence that depends on other sequences!");
          }() : function () {
            seq.propagating = 0;
            var core = seq.done === 0 ? function () {
              seq.valOnT = seq.evalEqs(tval); //self eqs eval
              seq.T = Date.now();
              var core1 = store ? function () {
                seq.IndexOnTimestamp[seq.T] = seq.length;
                seq.TimestampOnIndex[seq.length] = seq.T;
                seq[seq.length] = seq.valOnT; //after funcs
              }() : true;
              Object.keys(seq.updatedTo).map(function (key) {
                seq.updatedTo[key] = 1;
              });
              //clear updated us in non-interference way
              seq.us.map(function (u) {
                return u.updatedTo[seq.id] = 0;
              });
              seq.ds.map(function (d) {
                var usAllUpdated = d.us.map(function (u) {
                  return u.updatedTo[d.id];
                }).reduce(function (a, b) {
                  return a * b;
                });
                var core2 = usAllUpdated === 1 ? function () {
                  d.propagating = 1;
                  d.t = d.us.map(function (u) {
                    return u.t;
                  });
                }() : true;
              });
            }() : true;
          }();
        }
      }
    });
    return seq;
  }
1357163
function(topology, storeOptions) {
  var self = this;
  var storedOps = [];
  storeOptions = storeOptions || { force: false, bufferMaxEntries: -1 };

  // Internal state
  this.s = {
    storedOps: storedOps,
    storeOptions: storeOptions,
    topology: topology
  };

  Object.defineProperty(this, 'length', {
    enumerable: true,
    get: function() {
      return self.s.storedOps.length;
    }
  });
}
30239
function Eventstore(options, store) {
  this.options = options || {};
  this.store = store;

  this.eventMappings = {};

  EventEmitter.call(this);
}
844722
function buildSTORECommand(sequence, action = '', flags = [], options = {}) {
  let command = {
    command: options.byUid ? 'UID STORE' : 'STORE',
    attributes: [{
      type: 'sequence',
      value: sequence
    }]
  };

  command.attributes.push({
    type: 'atom',
    value: action.toUpperCase() + (options.silent ? '.SILENT' : '')
  });

  command.attributes.push(flags.map(flag => {
    return {
      type: 'atom',
      value: flag
    };
  }));

  return command;
}
901519
function store()
    {
        if ( !$this->IsModified )
        {
            return;
        }

        // EZP-23908: Restore timestamps before saving, to reduce chance of race condition issues
        $modifiedTimestamps = $this->Timestamps;
        $this->restore();

        // Apply timestamps that have been added or modified in this process
        foreach ( $modifiedTimestamps as $name => $value )
        {
            if ( $value > self::getTimestamp( $name, 0 ) )
            {
                $this->setTimestamp( $name, $value );
            }
        }

        if ( $this->IsModified )
        {
            $this->CacheFile->storeContents( "<?php\n\$Timestamps = " . var_export( $this->Timestamps, true ) . ";\n?>", 'expirycache', false, true );
            $this->IsModified = false;
        }
    }
347464
function store( $store_childs = false )
    {
        $db = eZDB::instance();
        $db->begin();
        if ( is_array( $store_childs ) or $store_childs )
        {
            if ( is_array( $store_childs ) )
            {
                $events = $store_childs;
            }
            else
            {
                $events = $this->fetchEvents();
            }
            foreach ( $events as $event )
            {
                $event->store();
            }
        }
        parent::store();
        $db->commit();
    }
928384
def store(self, key, data):
        """"""
        if not os.path.exists(self._hash_dir):
            os.makedirs(self._hash_dir)

        if isinstance(data, pd.DataFrame):
            columns = data.columns.tolist()
            np.save(os.path.join(self._hash_dir, key), data.values)
            json.dump(columns, open(os.path.join(self._hash_dir, '%s.json' % key), 'w'))
        else:
            np.save(os.path.join(self._hash_dir, key), data)
1281074
def store(self, key, value):
        """"""
        # Prepend tweepy to our key,
        # this makes it easier to identify tweepy keys in our redis server
        key = self.pre_identifier + key
        # Get a pipe (to execute several redis commands in one step)
        pipe = self.client.pipeline()
        # Set our values in a redis hash (similar to python dict)
        pipe.set(key, pickle.dumps((time.time(), value)))
        # Set the expiration
        pipe.expire(key, self.timeout)
        # Add the key to a set containing all the keys
        pipe.sadd(self.keys_container, key)
        # Execute the instructions in the redis server
        pipe.execute()
718278
def do_execute(self):
        
        if self.storagehandler is None:
            return "No storage handler available!"
        expr = str(self.resolve_option("expression")).replace(
            "{X}", str(self.storagehandler.storage[str(self.resolve_option("storage_name"))]))
        expr = self.storagehandler.expand(expr)
        self.storagehandler.storage[self.resolve_option("storage_name")] = eval(expr)
        self._output.append(self.input)
        return None
1243895
function MongoStore(options) {
        options = options || {};

        for (var property in defaultOptions) {
            if (defaultOptions.hasOwnProperty(property)) {
                if (!options.hasOwnProperty(property) || (typeof defaultOptions[property] !== typeof options[property]))
                    options[property] = defaultOptions[property];
            }
        }

        Store.call(this, options.store);

        var dbProperties = ["name", "prefix", "servers", "credentials", "URLParam", "extraParam"];
        var dbPropertiesLen = dbProperties.length;
        var dbOptions = {};
        for (var i = 0; i < dbPropertiesLen; i++)
            dbOptions[dbProperties[i]] = options[dbProperties[i]];

        this.mongo = new Mongo(dbOptions);
        this.mongo.ensureIndex(options.collection, {expires: 1}, {expireAfterSeconds: 0}, function (err, result) {
            if (err)
                throw new Error('Error setting TTL index on collection : ' + options.collection + ' <' + err + '>');
        });

        this._options = {
            "collection": options.collection,
            "stringify": options.stringify,
            "expireAfter": options.expireAfter
        };
    }
138160
def put(self, key, value):
    ''''''
    for store in self._stores:
      store.put(key, value)
613317
def store!
      Kernel.p "$$$$$$$$$$$$$$$$$$ @ssh CHECK $$$$$$$$$$$$$$$$$$"
      cmd = "echo \"#{self.to_json.gsub("\"","\\\\\"")}\" > #{@filepath}.json"
      puts cmd
      result = @ssh.exec!(cmd)
      puts result
    end
761807
function sunionstore(destination /* key-1, key-N, req*/) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length-1] === 'object'
      ? args[args.length - 1] : null;
  var list = this.sunion.apply(this, args);
  if(list.length) {
    this.setKey(
      destination, new Set(list), undefined, undefined, undefined, req);
  }
  return list.length;
}
456365
function filterStore(operation, store, args) {
  const filter = obj => {
    switch (operation) {
      case 'omit':
        return _.isFunction(args[0])
          ? _.omitBy(obj, args[0])
          : _.omit(obj, args);
      case 'pick':
        return _.isFunction(args[0])
          ? _.pickBy(obj, args[0])
          : _.pick(obj, args);
      default:
        break;
    }
  };
  switch (store) {
    case 'context':
    case 'functions':
    case 'directives':
    case 'plugins':
    case 'types':
      _.set(this, `_${store}`, filter(_.get(this, `_${store}`)));
      break;
    default:
      assert(false, `invalid store for ${operation} operation`);
      break;
  }
  return this;
}