How to use merge method in mountebank

Best JavaScript code snippet using mountebank

CVAO_dict.py

Source:CVAO_dict.py Github

copy

Full Screen

1#!/usr/bin/env python32# -*- coding: utf-8 -*-3"""4Created on Mon Jan 13 12:56:33 20205Dictionary of variables measured at Cape Verde Observtory and relevent 6information for dataset access, processing and plotting. 7@author: mjr5838"""9CVAO_dict = {10 'O3' : {'species' : 'O3', 11 'ceda_url' : 'http://dap.ceda.ac.uk/thredds/dodsC/badc/capeverde/data/cv-tei-o3/2019/ncas-tei-49i-1_cvao_20190101_o3-concentration_v1.nc',12 'ebas_url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20061002000000.20190425081904.uv_abs.ozone.air.12y.1h.GB12L_CVO_Ozone_Thermo49series.GB12L_Thermo.lev2.nc',13 'ebas_var_name' : 'ozone_nmol_per_mol_amean',14 'ceda_var_name' : '', 15 'longname' : 'ozone',16 'abbr' : '$O_3$',17 'unit': 'ppbv',18 'scale' : '1e9',19 'yscale' : 'linear',20 'start_year' : '2006',21 'merge_pref' : '',22 'merge_suff' : '',23 'instrument' : ''24 },25 'CO' : {'species' : 'CO',26 'ebas_url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20160101000000.20190425083930.online_crds.carbon_monoxide.air.3y.1h.GB12L_CVO_Picarro_G2401.GB12L_Picarro.lev2.nc',27 'ceda_url' : '',28 'ebas_var_name' : 'carbon_monoxide_amean',29 'ceda_var_name' : '',30 'longname' : 'carbon_monoxide',31 'abbr' : 'CO',32 'unit': 'ppbv',33 'scale' : '1e9',34 'yscale' : 'linear',35 'start_year' : '2006',36 'merge_pref' : '',37 'merge_suff' : ' (ppbV)',38 'instrument' : ''39 },40 'CH4' : {'species' : 'CH4',41 'ebas_url' : '',42 'ceda_url' : '',43 'ebas_var_name' : '',44 'ceda_var_name' : '',45 'longname' : 'methane',46 'abbr' : '$CH_4$',47 'unit': 'ppbv',48 'scale' : '1e9',49 'yscale' : 'linear',50 'start_year' : '2006',51 'merge_pref' : '',52 'merge_suff' : ' all (ppbV)',53 'instrument' : ''54 },55 'CO2' : {'species' : 'CO2',56 'ebas_url' : '',57 'ceda_url' : '',58 'ebas_var_name' : '',59 'ceda_var_name' : '',60 'longname' : 'carbon dioxide',61 'abbr' : '$CO_2$',62 'unit': 'ppmv',63 'scale' : '1e9',64 'yscale' : 'linear',65 'start_year' : '2006',66 'merge_pref' : '',67 'merge_suff' : ' (ppmV)',68 'instrument' : ''69 },70 'NO' : {'species' : 'NO',71 'ebas_url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20170101000000.20191024143042.chemiluminescence_photolytic..air.2y.1h.GB12L_CVO_AQD_Nox.GB12L_AQD_NOx.lev2.nc',72 'ceda_url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20170101000000.20191024143042.chemiluminescence_photolytic..air.2y.1h.GB12L_CVO_AQD_Nox.GB12L_AQD_NOx.lev2.nc', 73 'ebas_var_name' : 'nitrogen_monoxide_nmol_per_mol',74 'ceda_var_name' : '', 75 'longname' : 'nitrogen_monoxide',76 'abbr' : 'NO',77 'unit': 'pptv',78 'scale' : '1e9',79 'yscale' : 'log',80 'start_year' : '2006',81 'merge_pref' : '',82 'merge_suff' : ' (pptV)',83 'instrument' : ''84 },85 'NO2' : {'species' : 'NO2',86 'ebas_url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20170101000000.20191024143042.chemiluminescence_photolytic..air.2y.1h.GB12L_CVO_AQD_Nox.GB12L_AQD_NOx.lev2.nc',87 'ceda_url' : '',88 'ebas_var_name' : 'nitrogen_dioxide_nmol_per_mol',89 'ceda_var_name' : '',90 'longname' : 'nitrogen_dioxide',91 'abbr' : '$NO_2$',92 'unit': 'pptv',93 'scale' : '1e9',94 'yscale' : 'linear',95 'start_year' : '2006',96 'merge_pref' : '',97 'merge_suff' : ' (pptV)',98 'instrument' : ''99 },100 'propane' : {'species' : 'propane',101 'ebas_url': '',102 'ceda_url' : '',103 'ebas_var_name' : '',104 'ceda_var_name' : '',105 'longname' : 'propane',106 'abbr' : '$C_3H_8$',107 'unit': 'pptv',108 'scale' : '1e12',109 'yscale' : 'linear',110 'start_year' : '2006',111 'merge_pref' : '',112 'merge_suff' : ' (pptV)',113 'instrument' : ''114 },115 'ethane' : {'species' : 'ethane',116 'ebas_url': '',117 'ceda_url' : '',118 'ebas_var_name' : '',119 'ceda_var_name' : '',120 'longname' : 'ethane',121 'abbr' : '$C_2H_6$',122 'unit': 'pptv',123 'scale' : '1e12',124 'yscale' : 'linear',125 'start_year' : '2006',126 'merge_pref' : '',127 'merge_suff' : ' (pptV)' 128 },129 'iso_butane' : {'species' : 'iso_butane',130 'ebas_url': '',131 'ceda_url' : '',132 'ebas_var_name' : '',133 'ceda_var_name' : '',134 'longname' : 'isobutane',135 'abbr' : '$HC(CH_3)_3$',136 'unit': 'pptv',137 'scale' : '1e12',138 'yscale' : 'log',139 'start_year' : '2006',140 'merge_pref' : '',141 'merge_suff' : ' (;pptV)',142 'instrument' : ''143 },144 'n_butane' : {'species' : 'n_butane',145 'ebas_url': '',146 'ceda_url' : '',147 'ebas_var_name' : '',148 'ceda_var_name' : '',149 'longname' : 'nbutane',150 'abbr' : '$C_4H_{10}$',151 'unit': 'pptv',152 'scale' : '1e12',153 'yscale' : 'log',154 'start_year' : '2006',155 'merge_pref' : '',156 'merge_suff' : ' (pptV)',157 'instrument' : ''158 },159 'acetylene' : {'species' : 'acetylene',160 'ebas_url': '',161 'ceda_url' : '',162 'ebas_var_name' : '',163 'ceda_var_name' : '',164 'longname' : 'acetylene',165 'abbr' : '$C_2H_2$',166 'unit': 'pptv',167 'scale' : '1e12',168 'yscale' : 'linear',169 'start_year' : '2006',170 'merge_pref' : '',171 'merge_suff' : ' (pptV)',172 'instrument' : ''173 },174 'iso_pentane' : {'species' : 'iso_pentane',175 'ebas_url': '',176 'ceda_url' : '',177 'ebas_var_name' : '',178 'ceda_var_name' : '',179 'longname' : 'isopentane',180 'abbr' : '$C_5H_{12}$',181 'unit': 'pptv',182 'scale' : '1e12',183 'yscale' : 'log',184 'start_year' : '2006',185 'merge_pref' : '',186 'merge_suff' : ' (pptV)',187 'instrument' : ''188 },189 'n_pentane' : {'species' : 'n_pentane',190 'ebas_url': '',191 'ceda_url' : '',192 'ebas_var_name' : '',193 'ceda_var_name' : '',194 'longname' : 'n_pentane',195 'abbr' : '$C_5H_{12}$',196 'unit': 'pptv',197 'scale' : '1e12',198 'yscale' : 'log',199 'start_year' : '2006',200 'merge_pref' : '',201 'merge_suff' : ' (pptV)',202 'instrument' : ''203 },204 'ethene' : {'species' : 'ethene',205 'ebas_url': '',206 'ceda_url' : '',207 'ebas_var_name' : '',208 'ceda_var_name' : '',209 'longname' : 'ethene',210 'abbr' : '$C_2H_4$',211 'unit': 'pptv',212 'scale' : '1e12',213 'yscale' : 'log',214 'start_year' : '2006',215 'merge_pref' : '',216 'merge_suff' : ' (pptV)',217 'instrument' : ''218 },219 'propene' : {'species' : 'propene',220 'ebas_url': '',221 'ceda_url' : '',222 'ebas_var_name' : '',223 'ceda_var_name' : '',224 'longname' : 'propene',225 'abbr' : '$C_3H_6$',226 'unit': 'pptv',227 'scale' : '1e12',228 'yscale' : 'linear',229 'start_year' : '2006',230 'merge_pref' : '',231 'merge_suff' : ' (pptV)',232 'instrument' : ''233 },234 'benzene' : {'species' : 'benzene',235 'ebas_url': '',236 'ceda_url' : '',237 'ebas_var_name' : '',238 'ceda_var_name' : '',239 'longname' : 'benzene',240 'abbr' : '$C_6H_6$',241 'unit': 'pptv',242 'scale' : '1e12',243 'yscale' : 'linear',244 'start_year' : '2006',245 'merge_pref' : '',246 'merge_suff' : ' (pptV)',247 'instrument' : ''248 },249 'toluene' : {'species' : 'toluene',250 'ebas_url': '',251 'ceda_url' : '',252 'ebas_var_name' : '',253 'ceda_var_name' : '',254 'longname' : 'toluene',255 'abbr' : '$C_6H_5CH_3$',256 'unit': 'pptv',257 'scale' : '1e12',258 'yscale' : 'linear',259 'start_year' : '2006',260 'merge_pref' : '',261 'merge_suff' : ' (pptV)',262 'instrument' : ''263 },264 'Mercury' : {'species' : 'Mercury',265 'ebas_url': '',266 'ceda_url' : '',267 'ebas_var_name' : '',268 'ceda_var_name' : '',269 'longname' : 'Mercury',270 'abbr' : 'T.G. Hg',271 'unit': 'pptv',272 'scale' : '1e12',273 'yscale' : 'linear',274 'start_year' : '2006',275 'merge_pref' : 'Total Gaseous ',276 'merge_suff' : ' (ngm-3)',277 'instrument' : ''278 },279 'CHBr3' : {'species' : 'CHBr3',280 'ebas_url': '',281 'ceda_url' : '',282 'ebas_var_name' : '',283 'ceda_var_name' : '',284 'longname' : 'Bromoform',285 'abbr' : '$CHBr_3$',286 'unit': 'pptv',287 'scale' : '1e12',288 'yscale' : 'log',289 'start_year' : '2006',290 'merge_pref' : '',291 'merge_suff' : ' (pptV)',292 'instrument' : ''293 },294 'CH2Br2' : {'species' : 'CH2Br2',295 'ebas_url': '',296 'ceda_url' : '',297 'ebas_var_name' : '',298 'ceda_var_name' : '',299 'longname' : 'Dibromomethane',300 'abbr' : '$CH_2Br_2$',301 'unit': 'pptv',302 'scale' : '1e12',303 'yscale' : 'linear',304 'start_year' : '2006',305 'merge_pref' : '',306 'merge_suff' : ' (pptV)',307 'instrument' : ''308 },309 'CCl4' : {'species' : 'CCl4',310 'ebas_url': '',311 'ceda_url' : '',312 'ebas_var_name' : '',313 'ceda_var_name' : '',314 'longname' : 'Carbon Tetrachloride',315 'abbr' : '$CCl_4$',316 'unit': 'pptv',317 'scale' : '1e12',318 'yscale' : 'linear',319 'start_year' : '2006',320 'merge_pref' : '',321 'merge_suff' : ' (pptV)',322 'instrument' : ''323 },324 'CH2I2' : {'species' : 'CH2I2',325 'ebas_url': '',326 'ceda_url' : '',327 'ebas_var_name' : '',328 'ceda_var_name' : '',329 'longname' : 'Diiodomethane',330 'abbr' : '$CH_2I_2$',331 'unit': 'pptv',332 'scale' : '1e12',333 'yscale' : 'log',334 'start_year' : '2006',335 'merge_pref' : '',336 'merge_suff' : ' (pptV)',337 'instrument' : ''338 },339 'CH3I' : {'species' : 'CH3I',340 'ebas_url': '',341 'ceda_url' : '',342 'ebas_var_name' : '',343 'ceda_var_name' : '',344 'longname' : 'Methyl Iodide',345 'abbr' : '$CH_3I$',346 'unit': 'pptv',347 'scale' : '1e12',348 'yscale' : 'linear',349 'start_year' : '2006',350 'merge_pref' : '',351 'merge_suff' : ' (pptV)',352 'instrument' : ''353 },354 'CH2ICl' : {'species' : 'CH2ICl',355 'ebas_url': '',356 'ceda_url' : '',357 'ebas_var_name' : '',358 'ceda_var_name' : '',359 'longname' : 'Chloroiodomethane',360 'abbr' : '$CH_2ICl$',361 'unit': 'pptv',362 'scale' : '1e12',363 'yscale' : 'log',364 'start_year' : '2006',365 'merge_pref' : '',366 'merge_suff' : ' (pptV)',367 'instrument' : ''368 },369 'CHCl3' : {'species' : 'CHCl3',370 'ebas_url': '',371 'ceda_url' : '',372 'ebas_var_name' : '',373 'ceda_var_name' : '',374 'longname' : 'Chloroform',375 'abbr' : '$CHCl_3$',376 'unit': 'pptv',377 'scale' : '1e12',378 'yscale' : 'linear',379 'start_year' : '2006',380 'merge_pref' : '',381 'merge_suff' : ' (pptV)',382 'instrument' : ''383 },384 'CH2BrCl' : {'species' : 'CH2BrCl',385 'ebas_url': '',386 'ceda_url' : '',387 'ebas_var_name' : '',388 'ceda_var_name' : '',389 'longname' : 'Bromochloromethane',390 'abbr' : '$CH_2BrCl$',391 'unit': 'pptv',392 'scale' : '1e12',393 'yscale' : 'log',394 'start_year' : '2006',395 'merge_pref' : '',396 'merge_suff' : ' (pptV)',397 'instrument' : ''398 },399 'CH2IBr' : {'species' : 'CH2IBr',400 'ebas_url': '',401 'ceda_url' : '',402 'ebas_var_name' : '',403 'ceda_var_name' : '',404 'longname' : 'Bromoiodomethane',405 'abbr' : '$CH_2IBr$',406 'unit': 'pptv',407 'scale' : '1e12',408 'yscale' : 'linear',409 'start_year' : '2006',410 'merge_pref' : '',411 'merge_suff' : ' (pptV)',412 'instrument' : ''413 },414 'CHBr2Cl' : {'species' : 'CHBr2Cl',415 'ebas_url': '',416 'ceda_url' : '',417 'ebas_var_name' : '',418 'ceda_var_name' : '',419 'longname' : 'Dibromochloromethane',420 'abbr' : '$CHBr_2Cl$',421 'unit': 'pptv',422 'scale' : '1e12',423 'yscale' : 'log',424 'start_year' : '2006',425 'merge_pref' : '',426 'merge_suff' : ' (pptV)',427 'instrument' : ''428 },429 'SO2' : {'species' : 'SO2',430 'ebas_url': '',431 'ceda_url' : '',432 'ebas_var_name' : '',433 'ceda_var_name' : '',434 'longname' : 'Sulphur dioxide',435 'abbr' : '$SO_2$',436 'unit': 'ppbv',437 'scale' : '1e12',438 'yscale' : 'linear',439 'start_year' : '2006',440 'merge_pref' : '',441 'merge_suff' : ' (ppbV)',442 'instrument' : ''443 },444 'DMS' : {'species' : 'DMS',445 'ebas_url': '',446 'ceda_url' : '',447 'ebas_var_name' : '',448 'ceda_var_name' : '',449 'longname' : 'Dimethyl sulphide',450 'abbr' : 'DMS',451 'unit': 'pptv',452 'scale' : '1e12',453 'yscale' : 'log', # query454 'start_year' : '2006',455 'merge_pref' : '',456 'merge_suff' : ' (pptV)',457 'instrument' : ''458 },459 'Isoprene' : {'species' : 'Isoprene',460 'ebas_url': '',461 'ceda_url' : '',462 'ebas_var_name' : '',463 'ceda_var_name' : '',464 'longname' : 'Isoprene',465 'abbr' : 'Isoprene',466 'unit': 'pptv',467 'scale' : '1e12',468 'yscale' : 'linear',469 'start_year' : '2006',470 'merge_pref' : '',471 'merge_suff' : ' (pptV)',472 'instrument' : ''473 },474 'acetaldehyde' : {'species' : 'acetaldehyde',475 'ebas_url': '',476 'ceda_url' : '',477 'ebas_var_name' : '',478 'ceda_var_name' : '',479 'longname' : 'Acetaldehyde',480 'abbr' : '$C_2H_4O$',481 'unit': 'pptv',482 'scale' : '1e12',483 'yscale' : 'log',484 'start_year' : '2006',485 'merge_pref' : '',486 'merge_suff' : '',487 'instrument' : ''488 },489 'meoh' : {'species' : 'meoh',490 'ebas_url': '',491 'ceda_url' : '',492 'ebas_var_name' : '',493 'ceda_var_name' : '',494 'longname' : 'Methanol',495 'abbr' : '$CH_3OH$',496 'unit': 'pptv',497 'scale' : '1e12',498 'yscale' : 'log',499 'start_year' : '2006',500 'merge_pref' : '',501 'merge_suff' : '',502 'instrument' : ''503 },504 'acetone' : {'species' : 'acetone',505 'ebas_url': '',506 'ceda_url' : '',507 'ebas_var_name' : '',508 'ceda_var_name' : '',509 'longname' : 'Acetone',510 'abbr' : '$C_3H_6O$',511 'unit': 'pptv',512 'scale' : '1e12',513 'yscale' : 'log',514 'start_year' : '2006',515 'merge_pref' : '',516 'merge_suff' : '',517 'instrument' : ''518 },519 }520'''521 'NOx' : {'url' : 'http://thredds.nilu.no/thredds/dodsC/ebas/CV0001G.20170101000000.20191024143042.chemiluminescence_photolytic..air.2y.1h.GB12L_CVO_AQD_Nox.GB12L_AQD_NOx.lev2.nc',522 'species' : 'NOx',523 'longname' : 'nitrogen_oxides',524 'abbr' : '$NO_x$',525 'unit': 'ppbv',526 'scale' : '1e9',527 'start_year' : '2006',528 'var_name_a' : 'nitrogen_monoxide_nmol_per_mol',529 'var_name_b' : 'nitrogen_dioxide_nmol_per_mol'530 },531 }...

Full Screen

Full Screen

LazySet.js

Source:LazySet.js Github

copy

Full Screen

...57 _flatten() {58 flatten(this._toMerge, this._toDeepMerge);59 this._toDeepMerge.length = 0;60 }61 _merge() {62 this._flatten();63 merge(this._set, this._toMerge);64 this._toMerge.clear();65 this._needMerge = false;66 }67 _isEmpty() {68 return (69 this._set.size === 0 &&70 this._toMerge.size === 0 &&71 this._toDeepMerge.length === 072 );73 }74 get size() {75 if (this._needMerge) this._merge();76 return this._set.size;77 }78 /**79 * @param {T} item an item80 * @returns {this} itself81 */82 add(item) {83 this._set.add(item);84 return this;85 }86 /**87 * @param {Iterable<T> | LazySet<T>} iterable a immutable iterable or another immutable LazySet which will eventually be merged into the Set88 * @returns {this} itself89 */90 addAll(iterable) {91 if (this._deopt) {92 const _set = this._set;93 for (const item of iterable) {94 _set.add(item);95 }96 } else {97 if (iterable instanceof LazySet) {98 if (iterable._isEmpty()) return this;99 this._toDeepMerge.push(iterable);100 this._needMerge = true;101 if (this._toDeepMerge.length > 100000) {102 this._flatten();103 }104 } else {105 this._toMerge.add(iterable);106 this._needMerge = true;107 }108 if (this._toMerge.size > 100000) this._merge();109 }110 return this;111 }112 clear() {113 this._set.clear();114 this._toMerge.clear();115 this._toDeepMerge.length = 0;116 this._needMerge = false;117 this._deopt = false;118 }119 /**120 * @param {T} value an item121 * @returns {boolean} true, if the value was in the Set before122 */123 delete(value) {124 if (this._needMerge) this._merge();125 return this._set.delete(value);126 }127 entries() {128 this._deopt = true;129 if (this._needMerge) this._merge();130 return this._set.entries();131 }132 /**133 * @param {function(T, T, Set<T>): void} callbackFn function called for each entry134 * @param {any} thisArg this argument for the callbackFn135 * @returns {void}136 */137 forEach(callbackFn, thisArg) {138 this._deopt = true;139 if (this._needMerge) this._merge();140 this._set.forEach(callbackFn, thisArg);141 }142 /**143 * @param {T} item an item144 * @returns {boolean} true, when the item is in the Set145 */146 has(item) {147 if (this._needMerge) this._merge();148 return this._set.has(item);149 }150 keys() {151 this._deopt = true;152 if (this._needMerge) this._merge();153 return this._set.keys();154 }155 values() {156 this._deopt = true;157 if (this._needMerge) this._merge();158 return this._set.values();159 }160 [Symbol.iterator]() {161 this._deopt = true;162 if (this._needMerge) this._merge();163 return this._set[Symbol.iterator]();164 }165 /* istanbul ignore next */166 get [Symbol.toStringTag]() {167 return "LazySet";168 }169 serialize({ write }) {170 if (this._needMerge) this._merge();171 write(this._set.size);172 for (const item of this._set) write(item);173 }174 static deserialize({ read }) {175 const count = read();176 const items = [];177 for (let i = 0; i < count; i++) {178 items.push(read());179 }180 return new LazySet(items);181 }182}183makeSerializable(LazySet, "webpack/lib/util/LazySet");184module.exports = LazySet;

Full Screen

Full Screen

merge.ts

Source:merge.ts Github

copy

Full Screen

1import { merge as mergeStatic } from '../observable/merge';2import { Observable } from '../Observable';3import { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';4/* tslint:disable:max-line-length */5/** @deprecated Deprecated in favor of static merge. */6export function merge<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;7/** @deprecated Deprecated in favor of static merge. */8export function merge<T>(concurrent?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;9/** @deprecated Deprecated in favor of static merge. */10export function merge<T, T2>(v2: ObservableInput<T2>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;11/** @deprecated Deprecated in favor of static merge. */12export function merge<T, T2>(v2: ObservableInput<T2>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;13/** @deprecated Deprecated in favor of static merge. */14export function merge<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;15/** @deprecated Deprecated in favor of static merge. */16export function merge<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;17/** @deprecated Deprecated in favor of static merge. */18export function merge<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;19/** @deprecated Deprecated in favor of static merge. */20export function merge<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;21/** @deprecated Deprecated in favor of static merge. */22export function merge<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;23/** @deprecated Deprecated in favor of static merge. */24export function merge<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;25/** @deprecated Deprecated in favor of static merge. */26export function merge<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;27/** @deprecated Deprecated in favor of static merge. */28export function merge<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;29/** @deprecated Deprecated in favor of static merge. */30export function merge<T>(...observables: Array<ObservableInput<T> | SchedulerLike | number>): MonoTypeOperatorFunction<T>;31/** @deprecated Deprecated in favor of static merge. */32export function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): OperatorFunction<T, R>;33/* tslint:enable:max-line-length */34/**35 * @deprecated Deprecated in favor of static {@link merge}.36 */37export function merge<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike | number>): OperatorFunction<T, R> {38 return (source: Observable<T>) => source.lift.call(mergeStatic(source, ...observables));...

Full Screen

Full Screen

merge.test.ts

Source:merge.test.ts Github

copy

Full Screen

...18 */19// eslint-disable-next-line max-classes-per-file20import { merge } from './merge';21describe('merge', () => {22 test('empty objects', () => expect(merge({}, {})).toEqual({}));23 test('basic', () => {24 expect(merge({}, { a: 1 })).toEqual({ a: 1 });25 expect(merge({ a: 0 }, {})).toEqual({ a: 0 });26 expect(merge({ a: 0 }, { a: 1 })).toEqual({ a: 1 });27 });28 test('undefined', () => {29 expect(merge({ a: undefined }, { a: 1 })).toEqual({ a: 1 });30 expect(merge({ a: 0 }, { a: undefined })).toEqual({ a: 0 });31 expect(merge({ a: undefined }, { a: undefined })).toEqual({});32 expect(merge({ a: void 0 }, { a: void 0 })).toEqual({});33 });34 test('null', () => {35 expect(merge({ a: null }, { a: 1 })).toEqual({ a: 1 });36 expect(merge({ a: 0 }, { a: null })).toEqual({ a: null });37 expect(merge({ a: null }, { a: null })).toEqual({ a: null });38 });39 test('arrays', () => {40 expect(merge({ b: [0] }, { b: [2] })).toEqual({ b: [2] });41 expect(merge({ b: [0, 1] }, { b: [2] })).toEqual({ b: [2] });42 expect(merge({ b: [0] }, { b: [2, 3] })).toEqual({ b: [2, 3] });43 expect(merge({ b: [] }, { b: [2] })).toEqual({ b: [2] });44 expect(merge({ b: [0] }, { b: [] })).toEqual({ b: [] });45 });46 test('nested objects', () => {47 expect(merge({ top: { a: 0, b: 0 } }, { top: { a: 1, c: 1 } })).toEqual({48 top: { a: 1, b: 0, c: 1 },49 });50 expect(merge({ top: { a: 0, b: 0 } }, { top: [0, 1] })).toEqual({ top: [0, 1] });51 });52 test('multiple objects', () => {53 expect(merge({}, { a: 1 }, { a: 2 })).toEqual({ a: 2 });54 expect(merge({ a: 0 }, {}, {})).toEqual({ a: 0 });55 expect(merge({ a: 0 }, { a: 1 }, {})).toEqual({ a: 1 });56 });57 test('does not merge class instances', () => {58 class Folder {59 constructor(public readonly path: string) {}60 getPath() {61 return this.path;62 }63 }64 class File {65 constructor(public readonly content: string) {}66 getContent() {67 return this.content;68 }69 }70 const folder = new Folder('/etc');71 const file = new File('yolo');72 const result = merge({}, { content: folder }, { content: file });73 expect(result).toStrictEqual({74 content: file,75 });76 expect(result.content.getContent()).toBe('yolo');77 });78 test(`doesn't pollute prototypes`, () => {79 merge({}, JSON.parse('{ "__proto__": { "foo": "bar" } }'));80 merge({}, JSON.parse('{ "constructor": { "prototype": { "foo": "bar" } } }'));81 merge(82 {},83 JSON.parse('{ "__proto__": { "foo": "bar" } }'),84 JSON.parse('{ "constructor": { "prototype": { "foo": "bar" } } }')85 );86 expect(({} as any).foo).toBe(undefined);87 });...

Full Screen

Full Screen

03-merging-data.py

Source:03-merging-data.py Github

copy

Full Screen

1# Merge revenue with managers on 'city': merge_by_city2merge_by_city = pd.merge(revenue,managers, on="city")3# Print merge_by_city4print(merge_by_city)5# Merge revenue with managers on 'branch_id': merge_by_id6merge_by_id = pd.merge(revenue,managers, on="branch_id")7# Print merge_by_id8print(merge_by_id)9# Merge revenue & managers on 'city' & 'branch': combined10combined = pd.merge(revenue,managers,left_on="city",right_on="branch")11# Print combined12print(combined)13# Add 'state' column to revenue: revenue['state']14revenue['state'] = ["TX","CO","IL","CA"]15# Add 'state' column to managers: managers['state']16managers['state'] = ["TX","CO","CA","MO"]17# Merge revenue & managers on 'branch_id', 'city', & 'state': combined18combined = pd.merge(revenue,managers,on=["branch_id","city","state"])19# Print combined20print(combined)21# Merge revenue and sales: revenue_and_sales22revenue_and_sales = pd.merge(revenue,sales, how="right",on=["city","state"])23# Print revenue_and_sales24print(revenue_and_sales)25# Merge sales and managers: sales_and_managers26sales_and_managers = pd.merge(sales,managers,how="left",left_on=["city","state"], right_on=["branch","state"])27# Print sales_and_managers28print(sales_and_managers)29# Perform the first merge: merge_default30merge_default = pd.merge(sales_and_managers,revenue_and_sales)31# Print merge_default32print(merge_default)33# Perform the second merge: merge_outer34merge_outer = pd.merge(sales_and_managers,revenue_and_sales, how="outer")35# Print merge_outer36print(merge_outer)37# Perform the third merge: merge_outer_on38merge_outer_on = pd.merge(sales_and_managers,revenue_and_sales,on=["city","state"],how="outer")39# Print merge_outer_on40print(merge_outer_on)41# Perform the first ordered merge: tx_weather42tx_weather = pd.merge_ordered(austin,houston)43# Print tx_weather44print(tx_weather)45# Perform the second ordered merge: tx_weather_suff46tx_weather_suff = pd.merge_ordered(austin,houston,on="date",suffixes=["_aus","_hus"])47# Print tx_weather_suff48print(tx_weather_suff)49# Perform the third ordered merge: tx_weather_ffill50tx_weather_ffill = pd.merge_ordered(austin,houston, on="date",suffixes=["_aus","_hus"],fill_method="ffill")51# Print tx_weather_ffill52print(tx_weather_ffill)...

Full Screen

Full Screen

git_mark_merge_base.py

Source:git_mark_merge_base.py Github

copy

Full Screen

1#!/usr/bin/env python2# Copyright 2014 The Chromium Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5"""6Explicitly set/remove/print the merge-base for the current branch.7This manually set merge base will be a stand-in for `git merge-base` for the8purposes of the chromium depot_tools git extensions. Passing no arguments will9just print the effective merge base for the current branch.10"""11import argparse12import sys13from subprocess2 import CalledProcessError14from git_common import remove_merge_base, manual_merge_base, current_branch15from git_common import get_or_create_merge_base, hash_one, upstream16def main(argv):17 parser = argparse.ArgumentParser(18 description=__doc__.strip().splitlines()[0],19 epilog=' '.join(__doc__.strip().splitlines()[1:]))20 g = parser.add_mutually_exclusive_group()21 g.add_argument(22 'merge_base', nargs='?',23 help='The new hash to use as the merge base for the current branch'24 )25 g.add_argument('--delete', '-d', action='store_true',26 help='Remove the set mark.')27 opts = parser.parse_args(argv)28 cur = current_branch()29 if opts.delete:30 try:31 remove_merge_base(cur)32 except CalledProcessError:33 print 'No merge base currently exists for %s.' % cur34 return 035 if opts.merge_base:36 try:37 opts.merge_base = hash_one(opts.merge_base)38 except CalledProcessError:39 print >> sys.stderr, (40 'fatal: could not resolve %s as a commit' % (opts.merge_base)41 )42 return 143 manual_merge_base(cur, opts.merge_base, upstream(cur))44 ret = 045 actual = get_or_create_merge_base(cur)46 if opts.merge_base and opts.merge_base != actual:47 ret = 148 print "Invalid merge_base %s" % opts.merge_base49 print "merge_base(%s): %s" % (cur, actual)50 return ret51if __name__ == '__main__':52 try:53 sys.exit(main(sys.argv[1:]))54 except KeyboardInterrupt:55 sys.stderr.write('interrupted\n')...

Full Screen

Full Screen

SVGFEMergeNodeElement-dom-in-attr.js

Source:SVGFEMergeNodeElement-dom-in-attr.js Github

copy

Full Screen

1// [Name] SVGFEMergeNodeElement-dom-in-attr.js2// [Expected rendering result] Two circle merged with feMerge filter - and a series of PASS messages3description("Tests dynamic updates of the 'in' attribute of the SVGFEMergeNodeElement object")4createSVGTestCase();5var defsElement = createSVGElement("defs");6rootSVGElement.appendChild(defsElement);7var off = createSVGElement("feOffset");8off.setAttribute("dx", "105");9off.setAttribute("dy", "25");10off.setAttribute("result", "off");11var merge = createSVGElement("feMerge");12var mergeNode1 = createSVGElement("feMergeNode");13mergeNode1.setAttribute("in", "SourceGraphic");14var mergeNode2 = createSVGElement("feMergeNode");15mergeNode2.setAttribute("in", "SourceGraphic");16merge.appendChild(mergeNode1);17merge.appendChild(mergeNode2);18var mergeFilter = createSVGElement("filter");19mergeFilter.setAttribute("id", "myFilter");20mergeFilter.setAttribute("filterUnits", "objectBoundingBox");21mergeFilter.setAttribute("x", "0");22mergeFilter.setAttribute("y", "0");23mergeFilter.setAttribute("width", "3.5");24mergeFilter.setAttribute("height", "4");25mergeFilter.appendChild(off);26mergeFilter.appendChild(merge);27defsElement.appendChild(mergeFilter);28var myCircle = createSVGElement("circle");29myCircle.setAttribute("cx", "100");30myCircle.setAttribute("cy", "50");31myCircle.setAttribute("r", "50");32myCircle.setAttribute("fill", "#408067");33myCircle.setAttribute("filter", "url(#myFilter)");34rootSVGElement.setAttribute("height", "200");35rootSVGElement.appendChild(myCircle);36shouldBeEqualToString("mergeNode1.getAttribute('in')", "SourceGraphic");37function repaintTest() {38 mergeNode1.setAttribute("in", "off");39 shouldBeEqualToString("mergeNode1.getAttribute('in')", "off");40 completeTest();41}...

Full Screen

Full Screen

SVGFEMergeNodeElement-svgdom-in-prop.js

Source:SVGFEMergeNodeElement-svgdom-in-prop.js Github

copy

Full Screen

1// [Name] SVGFEMergeNodeElement-svgdom-in-prop.js2// [Expected rendering result] Two circle merged with feMerge filter - and a series of PASS messages3description("Tests dynamic updates of the 'in' property of the SVGFEMergeNodeElement object")4createSVGTestCase();5var defsElement = createSVGElement("defs");6rootSVGElement.appendChild(defsElement);7var off = createSVGElement("feOffset");8off.setAttribute("dx", "105");9off.setAttribute("dy", "25");10off.setAttribute("result", "off");11var merge = createSVGElement("feMerge");12var mergeNode1 = createSVGElement("feMergeNode");13mergeNode1.setAttribute("in", "SourceGraphic");14var mergeNode2 = createSVGElement("feMergeNode");15mergeNode2.setAttribute("in", "SourceGraphic");16merge.appendChild(mergeNode1);17merge.appendChild(mergeNode2);18var mergeFilter = createSVGElement("filter");19mergeFilter.setAttribute("id", "myFilter");20mergeFilter.setAttribute("filterUnits", "objectBoundingBox");21mergeFilter.setAttribute("x", "0");22mergeFilter.setAttribute("y", "0");23mergeFilter.setAttribute("width", "3.5");24mergeFilter.setAttribute("height", "4");25mergeFilter.appendChild(off);26mergeFilter.appendChild(merge);27defsElement.appendChild(mergeFilter);28var myCircle = createSVGElement("circle");29myCircle.setAttribute("cx", "100");30myCircle.setAttribute("cy", "50");31myCircle.setAttribute("r", "50");32myCircle.setAttribute("fill", "#408067");33myCircle.setAttribute("filter", "url(#myFilter)");34rootSVGElement.setAttribute("height", "200");35rootSVGElement.appendChild(myCircle);36shouldBeEqualToString("mergeNode1.in1.baseVal", "SourceGraphic");37function repaintTest() {38 mergeNode1.in1.baseVal = "off";39 shouldBeEqualToString("mergeNode1.in1.baseVal", "off");40 completeTest();41}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var imposter = {3 {4 {5 is: {6 }7 }8 }9};10mb.create(imposter).then(function () {11 console.log('Imposter created');12});13var mb = require('mountebank');14var imposter = {15 {16 {17 is: {18 }19 }20 }21};22mb.create(imposter).then(function () {23 console.log('Imposter created');24});25var mb = require('mountebank');26var imposter = {27 {28 {29 is: {30 }31 }32 }33};34mb.create(imposter).then(function () {35 console.log('Imposter created');36});37var mb = require('mountebank');38var imposter = {39 {40 {41 is: {42 }43 }44 }45};46mb.create(imposter).then(function () {47 console.log('Imposter created');48});49var mb = require('mountebank');50var imposter = {51 {52 {53 is: {54 }55 }56 }57};58mb.create(imposter).then(function () {59 console.log('Imposter created');60});61var mb = require('mountebank');

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var imposters = {3 {4 {5 "is": {6 "headers": {7 },8 }9 }10 }11};12mb.create(imposters).then(function (result) {13 console.log(result);14});15var mb = require('mountebank');16var imposters = {17 {18 {19 "is": {20 "headers": {21 },22 }23 }24 }25};26mb.create(imposters).then(function (result) {27 console.log(result);28});29var mb = require('mountebank');30var imposters = {31 {32 {33 "is": {34 "headers": {35 },36 }37 }38 }39};40mb.create(imposters).then(function (result) {41 console.log(result);42});43var mb = require('mountebank');44var imposters = {45 {46 {47 "is": {48 "headers": {49 },50 }51 }52 }53};54mb.create(imposters).then(function (result) {55 console.log(result);56});57var mb = require('mountebank');58var imposters = {

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2 {3 {4 {5 equals: {6 }7 }8 {9 is: {10 }11 }12 },13 {14 {15 equals: {16 }17 }18 {19 is: {20 }21 }22 }23 }24];25mb.create({ imposters: imposters }, function (error, mb) {26 if (error) {27 console.error(error);28 } else {29 console.log('mb running at %s', mb.url);30 }31});32var mb = require('mountebank');33 {34 {35 {36 equals: {37 }38 }39 {40 is: {41 }42 }43 },44 {45 {46 equals: {47 }48 }49 {50 is: {51 }52 }53 }54 }55];56mb.create({ imposters: imposters }, function (error, mb) {57 if (error) {58 console.error(error);59 } else {60 console.log('mb running at %s', mb.url);61 }62});

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2mb.start({3}, function (error) {4 if (error) {5 console.error(error);6 } else {7 console.log('mountebank started');8 }9});10var mb = require('mountebank');11mb.start({12}, function (error) {13 if (error) {14 console.error(error);15 } else {16 console.log('mountebank started');17 }18});19var mb = require('mountebank');20mb.start({21}, function (error) {22 if (error) {23 console.error(error);24 } else {25 console.log('mountebank started');26 }27});28var mb = require('mountebank');29mb.start({30}, function (error) {31 if (error) {32 console.error(error);33 } else {34 console.log('mountebank started');35 }36});37var mb = require('mountebank');38mb.start({39}, function (error) {40 if (error) {41 console.error(error);42 } else {43 console.log('mountebank started');44 }45});46var mb = require('mountebank');47mb.start({48}, function (error) {49 if (error) {50 console.error(error);51 } else {52 console.log('mountebank started');53 }54});55var mb = require('mountebank');56mb.start({

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2 {3 {4 {5 "is": {6 }7 }8 }9 }10];11mb.create({port: 2525, pidfile: 'mb.pid', logfile: 'mb.log'}, function () {12 mb.merge(imposters, function () {13 console.log('Imposters created');14 });15});16var mb = require('mountebank');17 {18 {19 {20 "is": {21 }22 }23 }24 }25];26mb.create({port: 2525, pidfile: 'mb.pid', logfile: 'mb.log'}, function () {27 mb.create(imposters, function () {28 console.log('Imposters created');29 });30});31var mb = require('mountebank');32 {33 {34 {35 "is": {36 }37 }38 }39 },40 {41 {42 {43 "is": {

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var Q = require('q');3var imposters = [{4 stubs: [{5 responses: [{6 is: {7 }8 }]9 }]10}, {11 stubs: [{12 responses: [{13 is: {14 }15 }]16 }]17}];18mb.create({19}).then(function (mb) {20 return mb.post('/imposters', imposters);21}).then(function (response) {22 console.log('Imposters created', response.body);23 return mb.del('/imposters');24}).then(function () {25 console.log('Imposters deleted');26 mb.stop();27});28Imposters created [ { port: 4545, protocol: 'http', numberOfRequests: 0 },29{ port: 4546, protocol: 'http', numberOfRequests: 0 } ]30Error: [ { code: 'not found',31location: 'url' },32{ code: 'not found',33location: 'url' } ]

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var imposter = { port: 3000, protocol: 'http', stubs: [{ responses: [{ is: { body: 'Hello world!' } }] }] };3mb.create(imposter).then(function (result) {4 console.log('Imposter created with ID: ' + result.id);5}, function (error) {6 console.error('Error creating imposter: ' + error.message);7});8var mb = require('mountebank');9var imposter = { port: 3000, protocol: 'http', stubs: [{ responses: [{ is: { body: 'Hello world!' } }] }] };10mb.create(imposter).then(function (result) {11 console.log('Imposter created with ID: ' + result.id);12}, function (error) {13 console.error('Error creating imposter: ' + error.message);14});15var mb = require('mountebank');16var imposter = { port: 3000, protocol: 'http', stubs: [{ responses: [{ is: { body: 'Hello world!' } }] }] };17mb.create(imposter).then(function (result) {18 console.log('Imposter created with ID: ' + result.id);19}, function (error) {20 console.error('Error creating imposter: ' + error.message);21});22var mb = require('mountebank');23var imposter = { port: 3000, protocol: 'http', stubs: [{ responses: [{ is: { body: 'Hello world!' } }] }] };24mb.create(imposter).then(function (result) {25 console.log('Imposter created with ID: ' + result.id);26}, function (error) {27 console.error('Error creating imposter: ' + error.message);28});

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank'),2 imposter = { port: 2525, protocol: 'http', stubs: [] };3mb.create(imposter, function (err, instance) {4 if (err) {5 console.log(err);6 } else {7 console.log('imposter created');8 instance.post('/test', { responses: [{ is: { body: 'test' } }] }, function (err) {9 if (err) {10 console.log(err);11 } else {12 console.log('stub created');13 }14 });15 }16});17var mb = require('mountebank'),18 imposter = { port: 2525, protocol: 'http', stubs: [] };19mb.create(imposter, function (err, instance) {20 if (err) {21 console.log(err);22 } else {23 console.log('imposter created');24 instance.post('/test', { responses: [{ is: { body: 'test' } }] }, function (err) {25 if (err) {26 console.log(err);27 } else {28 console.log('stub created');29 }30 });31 }32});33var mb = require('mountebank'),34 imposter = { port: 2525, protocol: 'http', stubs: [] };35mb.create(imposter, function (err, instance) {36 if (err) {37 console.log(err);38 } else {39 console.log('imposter created');40 instance.post('/test', { responses: [{ is: { body: 'test' } }] }, function (err) {41 if (err) {42 console.log(err);43 } else {44 console.log('stub created');45 }46 });47 }48});49var mb = require('mountebank'),50 imposter = { port: 2525, protocol: 'http', stubs: []

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const path = require('path');3const fs = require('fs');4mb.create({5}, function (error, server) {6 if (error) {7 console.log(`Error creating server: ${error}`);8 } else {9 console.log('Server created');10 const imposters = JSON.parse(fs.readFileSync('imposters.json', 'utf8'));11 server.merge(imposters, function (error) {12 if (error) {13 console.log(`Error merging imposters: ${error}`);14 } else {15 console.log('Imposters merged');16 }17 });18 }19});20{21 {22 {23 {24 "is": {25 "headers": {26 },27 "body": {28 }29 }30 }31 }32 }33}34The merge() method takes an object as a parameter. The object should have a key imposters which is an array of imposters. Each imposter in the array should have the following properties:

Full Screen

Using AI Code Generation

copy

Full Screen

1var fs = require('fs');2var json1 = require('./imposters.json');3var json2 = require('./imposters2.json');4var json3 = json1.concat(json2);5fs.writeFile("./imposters3.json", JSON.stringify(json3), function(err) {6 if(err) {7 return console.log(err);8 }9 console.log("The file was saved!");10});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run mountebank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful