How to use merge method in lisa

Best Python code snippet using lisa_python

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

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 lisa 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