Emulate sunionstore.
559716
def sunionstore(self, dest, keys, *args):
        """"""
        result = self.sunion(keys, *args)
        self.redis[self._encode(dest)] = result
        return len(result)
145323
function () {
			var sDefaultBootstrapURL = new URI(sap.ui.require.toUrl(""), window.location.origin + window.location.pathname) + "/sap/ui/support/",
				sDefaultSelectedLocation = "standard",
				sDefaultOpenInNewWindow = false;

			this._saveLocalStorageDefault(this._LOCAL_STORAGE_KEYS.STANDARD_URL, sDefaultBootstrapURL);
			this._saveLocalStorageDefault(this._LOCAL_STORAGE_KEYS.LOCATION, sDefaultSelectedLocation);
			this._saveLocalStorageDefault(this._LOCAL_STORAGE_KEYS.OPEN_IN_NEW_WINDOW, sDefaultOpenInNewWindow);

			var oViewModel = new JSONModel({
				"ProductName": "SAPUI5",
				"StandardBootstrapURL": this._storage.get(this._LOCAL_STORAGE_KEYS.STANDARD_URL),
				"CustomBootstrapURL": this._storage.get(this._LOCAL_STORAGE_KEYS.CUSTOM_URL),
				"OpenSupportAssistantInNewWindow": this._storage.get(this._LOCAL_STORAGE_KEYS.OPEN_IN_NEW_WINDOW),
				"SelectedLocation": this._storage.get(this._LOCAL_STORAGE_KEYS.LOCATION),
				"OpenUI5ProductVersion": null,
				"OpenUI5ProductTimestamp": null,
				"DebugModuleSelectionCount": 0
			});

			// load version info into view model
			var oVersionInfo = {};
			try {
				oVersionInfo = Global.getVersionInfo();
				oViewModel.setProperty("/ProductName", oVersionInfo.name);
				oViewModel.setProperty("/ProductVersion", oVersionInfo.version);
			} catch (oException) {
				oVersionInfo.version = "";
				Log.error("failed to load global version info");
			}

			try {
				oViewModel.setProperty("/ProductTimestamp", this._generateLocalizedBuildDate(oVersionInfo.buildTimestamp));
			} catch (oException) {
				Log.error("failed to parse build timestamp from global version info");
			}

			if (!/openui5/i.test(oVersionInfo.name)) {
				oViewModel.setProperty("/OpenUI5ProductVersion", Global.version);
				// convert build timestamp
				try {
					oViewModel.setProperty("/OpenUI5ProductTimestamp", this._generateLocalizedBuildDate(Global.buildinfo.buildtime));
				} catch (oException) {
					Log.error("failed to parse OpenUI5 build timestamp from global version info");
				}
			}

			var sAppVersion;
			try {
				sAppVersion = this._getText("TechInfo.SupportAssistantConfigPopup.AppVersionOption", oVersionInfo.version);
			} catch (oException) {
				sAppVersion = "Application";
			}

			var aSupportedUrls = [
				{
					"DisplayName": sAppVersion,
					"Value": sDefaultBootstrapURL
				},
				{
					"DisplayName": "OpenUI5 CDN",
					"Value": "https://openui5.hana.ondemand.com/resources/sap/ui/support/"
				},
				{
					"DisplayName": "OpenUI5 (Nightly)",
					"Value": "https://openui5nightly.hana.ondemand.com/resources/sap/ui/support/"
				},
				{
					"DisplayName": "OpenUI5 (Beta)",
					"Value": "https://openui5beta.hana.ondemand.com/resources/sap/ui/support/"
				},
				{
					"DisplayName": "SAPUI5 CDN",
					"Value": "https://sapui5.hana.ondemand.com/resources/sap/ui/support/"
				}
			];
			var sDebugModulesTitle = this._getText("TechInfo.DebugModulesConfigPopup.SelectionCounter", oViewModel.DebugModuleSelectionCount);
			oViewModel.setProperty("/DebugModulesTitle", sDebugModulesTitle);
			oViewModel.setProperty("/SupportAssistantPopoverURLs", aSupportedUrls);
			oViewModel.setProperty("/ApplicationURL", document.location.href);
			oViewModel.setProperty("/UserAgent", navigator.userAgent);
			oViewModel.setProperty("/DebugMode", sap.ui.getCore().getConfiguration().getDebug());

			// If ui version is smaller than 1.48 this sets the default location from where the SA will be loaded
			// to OpenUI5 (Nightly) because the SA is not available in 1.44 or lower version
			if (!this._isVersionBiggerThanMinSupported()) {
				oViewModel.setProperty("/StandardBootstrapURL",aSupportedUrls[2].Value);
				this._storage.put(this._LOCAL_STORAGE_KEYS.STANDARD_URL,aSupportedUrls[2].Value);
			}
			oViewModel.setSizeLimit(100000);
			return oViewModel;
		}
993425
function QuestionsStore(options) {
  debug('initializing from <%s>', __filename);
  Cache.call(this, options);
  this.createStores(this, this.options);
  this.listen(this);
}
413244
function launch(wmsCatalogItem, bbox) {
  // // At the moment just grab the screen extent
  // // Calculate view extent in degrees
  // const bbox = wmsCatalogItem.terria.currentViewer.getCurrentExtent();

  bbox.west = CesiumMath.toDegrees(bbox.west);
  bbox.south = CesiumMath.toDegrees(bbox.south);
  bbox.east = CesiumMath.toDegrees(bbox.east);
  bbox.north = CesiumMath.toDegrees(bbox.north);

  const query = {
    service: "WCS",
    request: "GetCoverage",
    version: "1.0.0",
    format: "GeoTIFF",
    crs: "EPSG:4326",
    width: 1024,
    height: Math.round((1024 * bbox.height) / bbox.width),
    coverage: wmsCatalogItem.linkedWcsCoverage,
    bbox: `${bbox.west},${bbox.south},${bbox.east},${bbox.north}`
  };

  if (defined(wmsCatalogItem.discreteTime)) {
    query.time = wmsCatalogItem.discreteTime.toISOString();
  }

  const style = getStyle(wmsCatalogItem);
  if (defined(style)) {
    query.styles = style;
  }

  var uri = new URI(wmsCatalogItem.linkedWcsUrl).query(query);

  var url = proxyCatalogItemUrl(wmsCatalogItem, uri.toString(), "1d");

  var now = new Date();
  var timestamp = sprintf(
    "%04d-%02d-%02dT%02d:%02d:%02d",
    now.getFullYear(),
    now.getMonth() + 1,
    now.getDate(),
    now.getHours(),
    now.getMinutes(),
    now.getSeconds()
  );

  const asyncResult = new ResultPendingCatalogItem(wmsCatalogItem.terria);
  asyncResult.name = wmsCatalogItem.name + " " + timestamp;
  asyncResult.description =
    "This is the result of exporting data from " +
    wmsCatalogItem.name +
    " service at " +
    timestamp +
    " with the input parameters below.";

  const parametersForInfo = [
    { name: "Bounding box", value: query.bbox },
    { name: "Format", value: query.format }
  ];
  const inputsSection =
    '<table class="cesium-infoBox-defaultTable">' +
    parametersForInfo.reduce(function(previousValue, parameter) {
      return (
        previousValue +
        "<tr>" +
        '<td style="vertical-align: middle">' +
        parameter.name +
        "</td>" +
        "<td>" +
        parameter.value +
        "</td>" +
        "</tr>"
      );
    }, "") +
    "</table>";

  asyncResult.info.push({
    name: "Inputs",
    content: inputsSection
  });

  const promise = loadBlob(url)
    .then(blob => {
      if (blob.type.indexOf("xml") !== -1) {
        // Geoserver errors -_-
        wmsCatalogItem.terria.error.raiseEvent(
          new TerriaError({
            sender: wmsCatalogItem,
            title: "Data export failed",
            message: "The Web Coverage Service failed"
          })
        );
        // Could fetch error details from XML to show to user
        asyncResult.isEnabled = false;
        return;
      }

      FileSaver.saveAs(blob, `${wmsCatalogItem.name} clip.tiff`);

      asyncResult.isEnabled = false;
    })
    .otherwise(error => {
      wmsCatalogItem.terria.error.raiseEvent(
        new TerriaError({
          sender: wmsCatalogItem,
          title: "Data export failed",
          message: `The Web Coverage Service failed: ${error}`
        })
      );
      asyncResult.isEnabled = false;
    });

  asyncResult.loadPromise = promise;
  asyncResult.isEnabled = true;
}
773169
public IStorer createStorer(SessionManagerConfig smc, IStore store) {
        IStorer storer = null;
        if (smc.getEnableTimeBasedWrite()) {
            storer = new TBWSessionStorer(store, 10); // 10 seconds is fixed - not configurable
        } else if (smc.getEnableManualWrite()) {
            storer = new ManualSessionStorer();
        } else {
            storer = new EOSSessionStorer();
        }
        return storer;
    }
467674
async def storage(dev: Device):
    """"""
    storages = await dev.get_storage_list()
    for storage in storages:
        click.echo(storage)
51667
def _store_binary(self, local_path, remote):
        """"""
        # Destination directory
        dst_dir = os.path.dirname(remote)

        # Destination file name
        dst_file = os.path.basename(remote)

        # File upload command
        dst_cmd = 'STOR {0}'.format(dst_file)

        with open(local_path, 'rb') as local_file:
            # Change directory if needed
            if dst_dir != dst_file:
                self.chdir(dst_dir, make=True)

            # Upload file & return response
            return self.session.storbinary(dst_cmd, local_file)
209518
def makeService(cls, options):
        
        from axiom.store import Store
        jm = options['journal-mode']
        if jm is not None:
            jm = jm.decode('ascii')
        store = Store(options['dbdir'], debug=options['debug'], journalMode=jm)
        service = IService(store)
        _CheckSystemVersion(store).setServiceParent(service)
        return service
396767
def run(self):
    """"""

    module = self.distribution.ext_modules[0]
    base_dir = os.path.dirname(__file__)

    if base_dir:
      os.chdir(base_dir)

    exclusions = []

    for define in self.define or []:
      module.define_macros.append(define)

    for library in self.libraries or []:
      module.libraries.append(library)

    building_for_windows = self.plat_name in ('win32','win-amd64')
    building_for_osx = 'macosx' in self.plat_name
    building_for_linux = 'linux' in self.plat_name
    building_for_freebsd = 'freebsd' in self.plat_name
    building_for_openbsd = 'openbsd' in self.plat_name # need testing

    if building_for_linux:
      module.define_macros.append(('USE_LINUX_PROC', '1'))
    elif building_for_windows:
      module.define_macros.append(('USE_WINDOWS_PROC', '1'))
      module.define_macros.append(('_CRT_SECURE_NO_WARNINGS', '1'))
      module.libraries.append('kernel32')
      module.libraries.append('advapi32')
      module.libraries.append('user32')
      module.libraries.append('crypt32')
      module.libraries.append('ws2_32')
    elif building_for_osx:
      module.define_macros.append(('USE_MACH_PROC', '1'))
      module.include_dirs.append('/usr/local/opt/openssl/include')
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    elif building_for_freebsd:
      module.define_macros.append(('USE_FREEBSD_PROC', '1'))
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    elif building_for_openbsd:
      module.define_macros.append(('USE_OPENBSD_PROC', '1'))
      module.include_dirs.append('/opt/local/include')
      module.library_dirs.append('/opt/local/lib')
      module.include_dirs.append('/usr/local/include')
      module.library_dirs.append('/usr/local/lib')
    else:
      module.define_macros.append(('USE_NO_PROC', '1'))

    if has_function('memmem'):
      module.define_macros.append(('HAVE_MEMMEM', '1'))
    if has_function('strlcpy'):
      module.define_macros.append(('HAVE_STRLCPY', '1'))
    if has_function('strlcat'):
      module.define_macros.append(('HAVE_STRLCAT', '1'))

    if self.enable_profiling:
      module.define_macros.append(('PROFILING_ENABLED', '1'))

    if self.dynamic_linking:
      module.libraries.append('yara')
    else:
      if not self.define or not ('HASH_MODULE', '1') in self.define:
        if (has_function('MD5_Init', libraries=['crypto']) and
            has_function('SHA256_Init', libraries=['crypto'])):
          module.define_macros.append(('HASH_MODULE', '1'))
          module.define_macros.append(('HAVE_LIBCRYPTO', '1'))
          module.libraries.append('crypto')
        else:
          exclusions.append('yara/libyara/modules/hash.c')

      if self.enable_magic:
        module.define_macros.append(('MAGIC_MODULE', '1'))
        module.libraries.append('magic')
      else:
        exclusions.append('yara/libyara/modules/magic.c')

      if self.enable_cuckoo:
        module.define_macros.append(('CUCKOO_MODULE', '1'))
        module.libraries.append('jansson')
      else:
        exclusions.append('yara/libyara/modules/cuckoo.c')

      if self.enable_dotnet:
        module.define_macros.append(('DOTNET_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/dotnet.c')

      if self.enable_dex:
        module.define_macros.append(('DEX_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/dex.c')

      if self.enable_macho:
        module.define_macros.append(('MACHO_MODULE', '1'))
      else:
        exclusions.append('yara/libyara/modules/macho.c')

      exclusions = [os.path.normpath(x) for x in exclusions]

      for directory, _, files in os.walk('yara/libyara/'):
        for x in files:
          x = os.path.normpath(os.path.join(directory, x))
          if x.endswith('.c') and x not in exclusions:
            module.sources.append(x)

    build_ext.run(self)
1098889
def _open_ds_from_store(fname, store_mod=None, store_cls=None, **kwargs):
    """"""
    if isinstance(fname, xr.Dataset):
        return fname
    if not isstring(fname):
        try:  # test iterable
            fname[0]
        except TypeError:
            pass
        else:
            if store_mod is not None and store_cls is not None:
                if isstring(store_mod):
                    store_mod = repeat(store_mod)
                if isstring(store_cls):
                    store_cls = repeat(store_cls)
                fname = [_open_store(sm, sc, f)
                         for sm, sc, f in zip(store_mod, store_cls, fname)]
                kwargs['engine'] = None
                kwargs['lock'] = False
                return open_mfdataset(fname, **kwargs)
    if store_mod is not None and store_cls is not None:
        fname = _open_store(store_mod, store_cls, fname)
    return open_dataset(fname, **kwargs)
285528
def run(self):
        """"""
        self.compile()

        s = "%s&format=%s" % (self.compiled_str, self.format)
        s = "%s%s&env=%s" % (self.endpoint, s, urllib.parse.quote(self.store))

        self.conn.request("GET", s)
        r = self.conn.getresponse()
        r = r.read().decode('UTF-8')
        if self.format is "json":
            return json.loads(r)
        else:
            return r
856931
def Build(self):
    """"""
    self.SetupVars()
    self.Clean()

    if not os.path.exists(args.grr_src):
      self.GitCheckoutGRR()
    proto_sdist = self.MakeProtoSdist()
    core_sdist = self.MakeCoreSdist()
    client_sdist = self.MakeClientSdist()
    client_builder_sdist = self.MakeClientBuilderSdist()

    self.InstallGRR(proto_sdist)
    self.InstallGRR(core_sdist)
    self.InstallGRR(client_sdist)
    self.InstallGRR(client_builder_sdist)
    self.BuildTemplates()
    if args.test_repack_install:
      self._RepackTemplates()
      self._InstallInstallers()
1167544
def appendDatastore(self, store):
    ''''''
    if not isinstance(store, Datastore):
      raise TypeError("stores must be of type %s" % Datastore)

    self._stores.append(store)
1200746
def Main():
  """"""
  tool = pinfo_tool.PinfoTool()

  if not tool.ParseArguments():
    return False

  result = True
  try:
    if tool.compare_storage_information:
      result = tool.CompareStores()
    else:
      tool.PrintStorageInformation()

  except errors.BadConfigOption as exception:
    logging.warning(exception)
    return False

  return result
163639
function(storeName, transaction, cb) {
    try {
      return transaction.objectStore(storeName);
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
  }
973644
def update(self, other):
        """"""
        if isinstance(other, self.__class__):
            return self.client.sunionstore(self.name, [self.name, other.name])
        else:
            return map(self.add, other)
1363483
def unionstore(self, dest, *others):
        
        keys = [self.key]
        keys.extend([other.key for other in others])
        self.database.sunionstore(dest, keys)
        return self.database.Set(dest)