hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aceb08184d04594514fd46d7efb1c18a4ff97eb4 | 36,259 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/metrics/detection.py | TolyaTalamanov/open_model_zoo | 1697e60712df4ca72635a2080a197b9d3bc24129 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/metrics/detection.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/metrics/detection.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | """
Copyright (c) 2018-2022 Intel Corporation
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 bisect
import enum
import warnings
from typing import List
from collections import defaultdict
import numpy as np
from ..utils import finalize_metric_result
from .overlap import Overlap, IOA
from ..config import BoolField, NumberField, StringField, ConfigError
from ..representation import (
DetectionAnnotation, DetectionPrediction,
ActionDetectionPrediction, ActionDetectionAnnotation,
AttributeDetectionPrediction, AttributeDetectionAnnotation
)
from .metric import Metric, FullDatasetEvaluationMetric, PerImageEvaluationMetric
class APIntegralType(enum.Enum):
voc_11_point = '11point'
voc_max = 'max'
class BaseDetectionMetricMixin(Metric):
@classmethod
def parameters(cls):
parameters = super().parameters()
parameters.update({
'overlap_threshold': NumberField(
value_type=float, min_value=0.0, max_value=1.0, default=0.5,
description="Minimal value for intersection over union that allows "
"to make decision that prediction bounding box is true positive."
),
'ignore_difficult': BoolField(
default=True, description="Allows to ignore difficult annotation boxes in metric calculation. "
"In this case, difficult boxes are filtered annotations "
"from postprocessing stage."
),
'include_boundaries': BoolField(
default=True, description="allows include boundaries in overlap calculation process. "
"If it is True then width and height of box is calculated by max - min + 1."
),
'distinct_conf': BoolField(
default=False, description="Select only values for distinct confidences."
),
'allow_multiple_matches_per_ignored': BoolField(
default=False, description="Allows multiple matches per ignored."),
'overlap_method': StringField(choices=['iou', 'ioa'], default='iou'),
'use_filtered_tp': BoolField(
default=False, description="If is True then ignored object are counted during evaluation."
),
'label_map': StringField(
optional=True, default='label_map', description='label_map field name in dataset_meta'
)
})
return parameters
def configure(self):
self.overlap_threshold = self.get_value_from_config('overlap_threshold')
self.ignore_difficult = self.get_value_from_config('ignore_difficult')
self.include_boundaries = self.get_value_from_config('include_boundaries')
self.distinct_conf = self.get_value_from_config('distinct_conf')
self.allow_multiple_matches_per_ignored = self.get_value_from_config('allow_multiple_matches_per_ignored')
self.overlap_method = Overlap.provide(self.get_value_from_config('overlap_method'), self.include_boundaries)
self.use_filtered_tp = self.get_value_from_config('use_filtered_tp')
label_map = self.config.get('label_map', 'label_map')
if not self.dataset.metadata:
raise ConfigError('detection metrics require label_map providing in dataset_meta'
'Please provide dataset meta file or regenerate annotation')
labels = self.dataset.metadata.get(label_map, {})
if not labels:
raise ConfigError('detection metrics require label_map providing in dataset_meta'
'Please provide dataset meta file or regenerate annotation')
self.labels = list(labels.keys())
valid_labels = list(filter(lambda x: x != self.dataset.metadata.get('background_label'), self.labels))
self.meta['names'] = [labels[name] for name in valid_labels]
self.meta['orig_label_names'] = [labels[name] for name in valid_labels]
def per_class_detection_statistics(self, annotations, predictions, labels, profile_boxes=False):
labels_stat = {}
for label in labels:
tp, fp, conf, n, matched, dt_boxes, iou = bbox_match(
annotations, predictions, int(label),
self.overlap_method, self.overlap_threshold,
self.ignore_difficult, self.allow_multiple_matches_per_ignored, self.include_boundaries,
self.use_filtered_tp
)
gt_boxes = [np.array(ann.boxes)[ann.labels == label] for ann in annotations]
num_images = np.sum([np.size(box_cnt) != 0 for box_cnt in gt_boxes])
if not tp.size:
labels_stat[label] = {
'precision': np.array([]),
'recall': np.array([]),
'thresholds': conf,
'fppi': np.array([]),
'fp': np.sum(fp),
'tp': np.sum(tp),
'num_images': num_images
}
if profile_boxes:
labels_stat[label].update({
'scores': conf,
'dt': dt_boxes,
'gt': gt_boxes[0],
'matched': matched,
'iou': iou
})
continue
# select only values for distinct confidences
if self.distinct_conf:
distinct_value_indices = np.where(np.diff(conf))[0]
threshold_indexes = np.r_[distinct_value_indices, tp.size - 1]
else:
threshold_indexes = np.arange(conf.size)
tp, fp = np.cumsum(tp)[threshold_indexes], np.cumsum(fp)[threshold_indexes]
labels_stat[label] = {
'precision': tp / np.maximum(tp + fp, np.finfo(np.float64).eps),
'recall': tp / np.maximum(n, np.finfo(np.float64).eps),
'thresholds': conf[threshold_indexes],
'fppi': fp / len(annotations),
'fp': np.sum(fp),
'tp': np.sum(tp),
'num_images': num_images
}
if profile_boxes:
labels_stat[label].update({
'scores': conf,
'dt': dt_boxes,
'gt': gt_boxes[0],
'matched': matched,
'iou': iou
})
return labels_stat
def evaluate(self, annotations, predictions):
if self.profiler:
self.profiler.finish()
def reset(self):
label_map = self.config.get('label_map', 'label_map')
dataset_labels = self.dataset.metadata.get(label_map, {})
valid_labels = list(filter(lambda x: x != self.dataset.metadata.get('background_label'), dataset_labels))
self.meta['names'] = [dataset_labels[name] for name in valid_labels]
if self.profiler:
self.profiler.reset()
class DetectionMAP(BaseDetectionMetricMixin, FullDatasetEvaluationMetric, PerImageEvaluationMetric):
"""
Class for evaluating mAP metric of detection models.
"""
__provider__ = 'map'
annotation_types = (DetectionAnnotation, ActionDetectionAnnotation, AttributeDetectionAnnotation)
prediction_types = (DetectionPrediction, ActionDetectionPrediction, AttributeDetectionPrediction)
@classmethod
def parameters(cls):
parameters = super().parameters()
parameters.update({
'integral':
StringField(
choices=[e.value for e in APIntegralType], default=APIntegralType.voc_max.value, optional=True,
description="Integral type for average precision calculation. "
"Pascal VOC 11point and max approaches are available."
)
})
return parameters
def configure(self):
super().configure()
self.integral = APIntegralType(self.get_value_from_config('integral'))
def update(self, annotation, prediction):
return self._calculate_map([annotation], [prediction], self.profiler is not None)[0]
def evaluate(self, annotations, predictions):
super().evaluate(annotations, predictions)
average_precisions, label_stats = self._calculate_map(annotations, predictions)
average_precisions, self.meta['names'] = finalize_metric_result(
average_precisions, self.meta['orig_label_names']
)
if not average_precisions:
warnings.warn("No detections to compute mAP")
average_precisions.append(0)
if self.profiler:
summary = self.prepare_summary(label_stats)
summary['summary_result']['images_count'] = len(annotations)
self.profiler.write_summary(summary)
return average_precisions
@staticmethod
def prepare_summary(label_stats):
ap, recall_v, recall, precision_v, precision, lamrs = [], [], [], [], [], []
per_class_summary = {}
tp_fp_rate = []
total_objects_cnt = 0
approx_pr_recall, approx_fppi_miss_rate = [], []
for label_idx, stat in label_stats.items():
if stat['num_images'] == 0:
lamrs.append(0)
tp_fp_rate.append([0, 0])
ap.append(np.NAN)
continue
ap.append(stat['result'])
recall.append(stat['recall'])
recall_v.append(recall[-1][-1] if np.size(recall[-1]) else np.NAN)
precision.append(stat['precision'])
precision_v.append(precision[-1][-1] if np.size(precision[-1]) else np.NAN)
fppi = 1 - precision[-1]
mr = stat['miss_rate']
if np.size(recall[-1]) and np.size(precision[-1]):
approx_recall = np.linspace(0, 1, 100, endpoint=True)
approx_precision = np.interp(approx_recall, recall[-1], precision[-1])
approx_pr_recall.append([approx_precision, approx_recall])
approx_fppi = np.linspace(0, 1, 100, endpoint=True)
approx_mr = np.interp(approx_fppi, fppi, mr)
approx_fppi_miss_rate.append([approx_fppi, approx_mr])
pr = np.array([precision[-1], recall[-1]]).T
fm = np.array([fppi, mr]).T
fppi_tmp = np.insert(fppi, 0, -1.0)
mr_tmp = np.insert(mr, 0, 1.0)
ref = np.logspace(-2.0, 0.0, num=9)
fp = int(stat['fp'])
tp = int(stat['tp'])
tp_fp_rate.append([tp, fp])
for i, ref_i in enumerate(ref):
j = np.where(fppi_tmp <= ref_i)[-1][-1]
ref[i] = mr_tmp[j]
lamr = np.exp(np.mean(np.log(np.maximum(1e-10, ref))))
lamrs.append(lamr)
total_objects_cnt += len(recall[-1])
per_class_summary[label_idx] = {
'precision': precision[-1][-1] if np.size(precision[-1]) else -1,
'recall': recall[-1][-1] if np.size(recall[-1]) else -1,
'result': ap[-1] if not np.isnan(ap[-1]) else -1,
"scale": 100,
"result_postfix": "%",
'objects_count': len(recall[-1]),
'charts': {
'precision_recall': pr.tolist(),
'fppi_miss_rate': fm.tolist()
},
'images_count': int(stat['num_images'])
}
ap_res = np.nanmean(ap)
recall_res = np.nanmean(recall_v)
precision_res = np.nanmean(precision_v)
return {
'summary_result': {
'result': ap_res,
'precision': precision_res,
'recall': recall_res,
'result_scale': 100,
'result_postfix': '%',
'charts': {
'ap': [0 if np.isnan(ap_) else ap_ for ap_ in ap],
'log_miss_rate': lamrs,
'tp_fp_rate': tp_fp_rate,
'precision_recall': np.mean(approx_pr_recall, 0).T.tolist() if np.size(approx_pr_recall) else [],
'fppi_miss_rate': (
np.mean(approx_fppi_miss_rate, 0).T.tolist() if np.size(approx_fppi_miss_rate) else []
)
},
'objects_count': total_objects_cnt
},
'per_class_result': per_class_summary
}
def _calculate_map(self, annotations, predictions, profile_boxes=False, return_labels_stats=False):
valid_labels = get_valid_labels(self.labels, self.dataset.metadata.get('background_label'))
labels_stat = self.per_class_detection_statistics(annotations, predictions, valid_labels, profile_boxes)
average_precisions = []
for value in labels_stat.values():
label_precision = value['precision']
label_recall = value['recall']
label_miss_rate = 1 - label_recall
value['miss_rate'] = label_miss_rate
if label_recall.size:
ap = average_precision(label_precision, label_recall, self.integral)
average_precisions.append(ap)
else:
average_precisions.append(np.nan)
value['ap'] = average_precisions[-1]
value['result'] = average_precisions[-1]
if profile_boxes:
self._update_label_stat_for_non_matched_classes(labels_stat, predictions)
self.profiler.update(annotations[0].identifier, labels_stat, self.name, np.nanmean(average_precisions))
return average_precisions, labels_stat
def _update_label_stat_for_non_matched_classes(self, labels_stat, predictions):
matched_classes = set(labels_stat)
background = self.dataset.metadata.get('background_label')
prediction_classes = np.unique([pred.labels for pred in predictions])
for pc in prediction_classes:
if pc == background or pc in matched_classes:
continue
prediction_boxes, prediction_images, _ = _prepare_prediction_boxes(
pc, predictions, True
)
conf = prediction_boxes[:, 0]
label_report = {
'precision': np.array([]),
'recall': np.array([]),
'thresholds': conf,
'fppi': np.array([]),
'fp': len(conf),
'tp': 0,
'num_images': len(prediction_images),
'scores': conf,
'dt': prediction_boxes[:, 1:],
'gt': np.array([]),
'matched': defaultdict(list),
'iou': np.array([])
}
labels_stat[int(pc)] = label_report
return labels_stat
class MissRate(BaseDetectionMetricMixin, FullDatasetEvaluationMetric, PerImageEvaluationMetric):
"""
Class for evaluating Miss Rate metric of detection models.
"""
__provider__ = 'miss_rate'
annotation_types = (DetectionAnnotation, ActionDetectionAnnotation)
prediction_types = (DetectionPrediction, ActionDetectionPrediction)
@classmethod
def parameters(cls):
parameters = super().parameters()
parameters.update({
'fppi_level': NumberField(min_value=0, max_value=1, description="False Positive Per Image level.")
})
return parameters
def configure(self):
super().configure()
self.fppi_level = self.get_value_from_config('fppi_level')
def update(self, annotation, prediction):
valid_labels = get_valid_labels(self.labels, self.dataset.metadata.get('background_label'))
labels_stat = self.per_class_detection_statistics(
[annotation], [prediction], valid_labels, self.profiler is not None
)
miss_rates = []
for value in labels_stat.values():
label_miss_rate = 1.0 - value['recall']
label_fppi = value['fppi']
position = bisect.bisect_left(label_fppi, self.fppi_level)
m0 = max(0, position - 1)
m1 = position if position < len(label_miss_rate) else m0
miss_rates.append(0.5 * (label_miss_rate[m0] + label_miss_rate[m1]))
if self.profiler:
value['result'] = miss_rates[-1]
if self.profiler:
self.profiler.update(annotation[0].identifier, labels_stat, self.name, np.nanmean(miss_rates))
return miss_rates
def evaluate(self, annotations, predictions):
super().evaluate(annotations, predictions)
valid_labels = get_valid_labels(self.labels, self.dataset.metadata.get('background_label'))
labels_stat = self.per_class_detection_statistics(annotations, predictions, valid_labels)
miss_rates = []
for value in labels_stat.values():
label_miss_rate = 1.0 - value['recall']
label_fppi = value['fppi']
position = bisect.bisect_left(label_fppi, self.fppi_level)
m0 = max(0, position - 1)
m1 = position if position < len(label_miss_rate) else m0
miss_rates.append(0.5 * (label_miss_rate[m0] + label_miss_rate[m1]))
return miss_rates
class Recall(BaseDetectionMetricMixin, FullDatasetEvaluationMetric, PerImageEvaluationMetric):
"""
Class for evaluating recall metric of detection models.
"""
__provider__ = 'recall'
annotation_types = (DetectionAnnotation, ActionDetectionAnnotation)
prediction_types = (DetectionPrediction, ActionDetectionPrediction)
def update(self, annotation, prediction):
return self._calculate_recall([annotation], [prediction], self.profiler is not None)
def evaluate(self, annotations, predictions):
super().evaluate(annotations, predictions)
recalls = self._calculate_recall(annotations, predictions)
recalls, self.meta['names'] = finalize_metric_result(recalls, self.meta['orig_label_names'])
if not recalls:
warnings.warn("No detections to compute mAP")
recalls.append(0)
return recalls
def _calculate_recall(self, annotations, predictions, profile_boxes=False):
valid_labels = get_valid_labels(self.labels, self.dataset.metadata.get('background_label'))
labels_stat = self.per_class_detection_statistics(annotations, predictions, valid_labels, profile_boxes)
recalls = []
for value in labels_stat.values():
label_recall = value['recall']
if label_recall.size:
max_recall = label_recall[-1]
recalls.append(max_recall)
else:
recalls.append(np.nan)
if profile_boxes:
value['result'] = recalls[-1]
if profile_boxes:
self.profiler.update(annotations[0].identifier, labels_stat, self.name, np.nanmean(recalls))
return recalls
class DetectionAccuracyMetric(BaseDetectionMetricMixin, PerImageEvaluationMetric):
__provider__ = 'detection_accuracy'
annotation_types = (DetectionAnnotation, ActionDetectionAnnotation)
prediction_types = (DetectionPrediction, ActionDetectionPrediction)
@classmethod
def parameters(cls):
parameters = super().parameters()
parameters.update({
'use_normalization': BoolField(
default=False, optional=True, description="Allows to normalize confusion_matrix for metric calculation."
),
'ignore_label': NumberField(
optional=True, value_type=int, min_value=0, description="Ignore label ID."
),
'fast_match': BoolField(
default=False, optional=True, description='Apply fast match algorithm'
)
})
return parameters
def configure(self):
super().configure()
self.use_normalization = self.get_value_from_config('use_normalization')
self.ignore_label = self.get_value_from_config('ignore_label')
fast_match = self.get_value_from_config('fast_match')
self.match_func = match_detections_class_agnostic if not fast_match else fast_match_detections_class_agnostic
self.cm = np.zeros([len(self.labels), len(self.labels)], dtype=np.int32)
def update(self, annotation, prediction):
matches = self.match_func(prediction, annotation, self.overlap_threshold, self.overlap_method)
update_cm = confusion_matrix(matches, prediction, annotation, len(self.labels), self.ignore_label)
self.cm += update_cm
if self.use_normalization:
return np.mean(normalize_confusion_matrix(update_cm).diagonal())
return float(np.sum(update_cm.diagonal())) / float(np.maximum(1, np.sum(update_cm)))
def evaluate(self, annotations, predictions):
if self.use_normalization:
return np.mean(normalize_confusion_matrix(self.cm).diagonal())
return float(np.sum(self.cm.diagonal())) / float(np.maximum(1, np.sum(self.cm)))
def confusion_matrix(matched_ids, prediction, gt, num_classes, ignore_label=None):
out_cm = np.zeros([num_classes, num_classes], dtype=np.int32)
for match_pair in matched_ids:
gt_label = int(gt.labels[match_pair[0]])
if ignore_label and gt_label == ignore_label:
continue
pred_label = int(prediction.labels[match_pair[1]])
out_cm[gt_label, pred_label] += 1
return out_cm
def normalize_confusion_matrix(cm):
row_sums = np.maximum(1, np.sum(cm, axis=1, keepdims=True)).astype(np.float32)
return cm.astype(np.float32) / row_sums
def match_detections_class_agnostic(prediction, gt, min_iou, overlap_method):
gt_bboxes = np.stack((gt.x_mins, gt.y_mins, gt.x_maxs, gt.y_maxs), axis=-1)
predicted_bboxes = np.stack(
(prediction.x_mins, prediction.y_mins, prediction.x_maxs, prediction.y_maxs), axis=-1
)
predicted_scores = prediction.scores
gt_bboxes_num = len(gt_bboxes)
predicted_bboxes_num = len(predicted_bboxes)
sorted_ind = np.argsort(-predicted_scores)
predicted_bboxes = predicted_bboxes[sorted_ind]
predicted_original_ids = np.arange(predicted_bboxes_num)[sorted_ind]
similarity_matrix = calculate_similarity_matrix(predicted_bboxes, gt_bboxes, overlap_method)
matches = []
visited_gt = np.zeros(gt_bboxes_num, dtype=np.bool)
for predicted_id in range(predicted_bboxes_num):
best_overlap = 0.0
best_gt_id = -1
for gt_id in range(gt_bboxes_num):
if visited_gt[gt_id]:
continue
overlap_value = similarity_matrix[predicted_id, gt_id]
if overlap_value > best_overlap:
best_overlap = overlap_value
best_gt_id = gt_id
if best_gt_id >= 0 and best_overlap > min_iou:
visited_gt[best_gt_id] = True
matches.append((best_gt_id, predicted_original_ids[predicted_id]))
if len(matches) >= gt_bboxes_num:
break
return matches
def fast_match_detections_class_agnostic(prediction, gt, min_iou, overlap_method):
matches = []
gt_bboxes = np.stack((gt.x_mins, gt.y_mins, gt.x_maxs, gt.y_maxs), axis=-1)
if prediction.size:
predicted_bboxes = np.stack(
(prediction.x_mins, prediction.y_mins, prediction.x_maxs, prediction.y_maxs), axis=-1
)
similarity_matrix = calculate_similarity_matrix(gt_bboxes, predicted_bboxes, overlap_method)
for _ in gt_bboxes:
best_match_pos = np.unravel_index(similarity_matrix.argmax(), similarity_matrix.shape)
best_match_value = similarity_matrix[best_match_pos]
if best_match_value <= min_iou:
break
gt_id = best_match_pos[0]
predicted_id = best_match_pos[1]
similarity_matrix[gt_id, :] = 0.0
similarity_matrix[:, predicted_id] = 0.0
matches.append((gt_id, predicted_id))
return matches
def calculate_similarity_matrix(set_a, set_b, overlap):
similarity = np.zeros([len(set_a), len(set_b)], dtype=np.float32)
for i, box_a in enumerate(set_a):
for j, box_b in enumerate(set_b):
similarity[i, j] = overlap(box_a, box_b)
return similarity
def average_precision(precision, recall, integral):
if integral == APIntegralType.voc_11_point:
result = 0.
for point in np.arange(0., 1.1, 0.1):
accumulator = 0 if np.sum(recall >= point) == 0 else np.max(precision[recall >= point])
result = result + accumulator / 11.
return result
if integral != APIntegralType.voc_max:
raise NotImplementedError("Integral type not implemented")
# first append sentinel values at the end
recall = np.concatenate(([0.], recall, [1.]))
precision = np.concatenate(([0.], precision, [0.]))
# compute the precision envelope
for i in range(precision.size - 1, 0, -1):
precision[i - 1] = np.maximum(precision[i - 1], precision[i])
# to calculate area under PR curve, look for points
# where X axis (recall) changes value
change_point = np.where(recall[1:] != recall[:-1])[0]
# and sum (\Delta recall) * recall
return np.sum((recall[change_point + 1] - recall[change_point]) * precision[change_point + 1])
def bbox_match(annotation: List[DetectionAnnotation], prediction: List[DetectionPrediction], label, overlap_evaluator,
overlap_thresh=0.5, ignore_difficult=True, allow_multiple_matches_per_ignored=True,
include_boundaries=True, use_filtered_tp=False):
"""
Args:
annotation: ground truth bounding boxes.
prediction: predicted bounding boxes.
label: class for which bounding boxes are matched.
overlap_evaluator: evaluator of overlap.
overlap_thresh: bounding box IoU threshold.
ignore_difficult: ignores difficult bounding boxes (see Pascal VOC).
allow_multiple_matches_per_ignored: allows multiple matches per ignored.
include_boundaries: if is True then width and height of box is calculated by max - min + 1.
use_filtered_tp: if is True then ignored object are counted during evaluation.
Returns:
tp: tp[i] == 1 if detection with i-th highest score is true positive.
fp: fp[i] == 1 if detection with i-th highest score is false positive.
thresholds: array of confidence thresholds.
number_ground_truth = number of true positives.
"""
used_boxes, number_ground_truth, difficult_boxes_annotation = _prepare_annotation_boxes(
annotation, ignore_difficult, label
)
prediction_boxes, prediction_images, difficult_boxes_prediction = _prepare_prediction_boxes(
label, prediction, ignore_difficult
)
tp = np.zeros_like(prediction_images)
fp = np.zeros_like(prediction_images)
max_overlapped_dt = defaultdict(list)
overlaps = np.array([])
full_iou = []
for image in range(prediction_images.shape[0]):
gt_img = annotation[prediction_images[image]]
annotation_difficult = difficult_boxes_annotation[gt_img.identifier]
used = used_boxes[gt_img.identifier]
idx = gt_img.labels == label
if not np.array(idx).any():
fp[image] = 1
continue
prediction_box = prediction_boxes[image][1:]
annotation_boxes = gt_img.x_mins[idx], gt_img.y_mins[idx], gt_img.x_maxs[idx], gt_img.y_maxs[idx]
overlaps = overlap_evaluator(prediction_box, annotation_boxes)
full_iou.append(overlaps)
if ignore_difficult and allow_multiple_matches_per_ignored:
ioa = IOA(include_boundaries)
ignored = np.where(annotation_difficult == 1)[0]
ignored_annotation_boxes = (
annotation_boxes[0][ignored], annotation_boxes[1][ignored],
annotation_boxes[2][ignored], annotation_boxes[3][ignored]
)
overlaps[ignored] = ioa.evaluate(prediction_box, ignored_annotation_boxes)
max_overlap = -np.inf
not_ignored_overlaps = overlaps[np.where(annotation_difficult == 0)[0]]
ignored_overlaps = overlaps[np.where(annotation_difficult == 1)[0]]
if not_ignored_overlaps.size:
max_overlap = np.max(not_ignored_overlaps)
if max_overlap < overlap_thresh and ignored_overlaps.size:
max_overlap = np.max(ignored_overlaps)
max_overlapped = np.where(overlaps == max_overlap)[0]
def set_false_positive(box_index):
is_box_difficult = difficult_boxes_prediction[box_index].any()
return int(not ignore_difficult or not is_box_difficult)
if max_overlap < overlap_thresh:
fp[image] = set_false_positive(image)
continue
if not annotation_difficult[max_overlapped].any():
if not used[max_overlapped].any():
if not ignore_difficult or use_filtered_tp or not difficult_boxes_prediction[image].any():
tp[image] = 1
used[max_overlapped] = True
max_overlapped_dt[image].append(max_overlapped)
else:
fp[image] = set_false_positive(image)
elif not allow_multiple_matches_per_ignored:
if used[max_overlapped].any():
fp[image] = set_false_positive(image)
used[max_overlapped] = True
return (
tp, fp, prediction_boxes[:, 0], number_ground_truth,
max_overlapped_dt, prediction_boxes[:, 1:], full_iou
)
def _prepare_annotation_boxes(annotation, ignore_difficult, label):
used_boxes = {}
difficult_boxes = {}
num_ground_truth = 0
for ground_truth in annotation:
idx_for_label = ground_truth.labels == label
filtered_label = ground_truth.labels[idx_for_label]
used_ = np.zeros_like(filtered_label)
used_boxes[ground_truth.identifier] = used_
num_ground_truth += used_.shape[0]
difficult_box_mask = np.full_like(ground_truth.labels, False)
difficult_box_indices = ground_truth.metadata.get("difficult_boxes", [])
if ignore_difficult:
difficult_box_mask[difficult_box_indices] = True
difficult_box_mask = difficult_box_mask[idx_for_label]
difficult_boxes[ground_truth.identifier] = difficult_box_mask
if ignore_difficult:
if np.size(difficult_box_mask) > 0:
num_ground_truth -= np.sum(difficult_box_mask)
return used_boxes, num_ground_truth, difficult_boxes
def _prepare_prediction_boxes(label, predictions, ignore_difficult):
prediction_images = []
prediction_boxes = []
indexes = []
difficult_boxes = []
all_label_indices = []
index_counter = 0
for i, prediction in enumerate(predictions):
idx = prediction.labels == label
label_indices = [
det + index_counter
for det, lab in enumerate(prediction.labels)
if lab == label
]
all_label_indices.extend(label_indices)
index_counter += len(prediction.labels)
prediction_images.append(np.full(prediction.labels[idx].shape, i))
prediction_boxes.append(np.c_[
prediction.scores[idx],
prediction.x_mins[idx], prediction.y_mins[idx], prediction.x_maxs[idx], prediction.y_maxs[idx]
])
difficult_box_mask = np.full_like(prediction.labels, False)
difficult_box_indices = prediction.metadata.get("difficult_boxes", [])
if ignore_difficult:
difficult_box_mask[difficult_box_indices] = True
difficult_boxes.append(difficult_box_mask)
indexes.append(np.argwhere(idx))
prediction_boxes = np.concatenate(prediction_boxes)
difficult_boxes = np.concatenate(difficult_boxes)
sorted_order = np.argsort(-prediction_boxes[:, 0])
prediction_boxes = prediction_boxes[sorted_order]
prediction_images = np.concatenate(prediction_images)[sorted_order]
difficult_boxes = difficult_boxes[all_label_indices]
difficult_boxes = difficult_boxes[sorted_order]
return prediction_boxes, prediction_images, difficult_boxes
def get_valid_labels(labels, background):
return list(filter(lambda label: label != background, labels))
def calc_iou(gt_box, dt_box):
# Convert detected face rectangle to integer point form
gt_box = list(map(lambda x: int(round(x, 0)), gt_box))
dt_box = list(map(lambda x: int(round(x, 0)), dt_box))
# Calculate overlapping width and height of two boxes
inter_width = min(gt_box[2], dt_box[2]) - max(gt_box[0], dt_box[0])
inter_height = min(gt_box[3], dt_box[3]) - max(gt_box[1], dt_box[1])
if inter_width <= 0 or inter_height <= 0:
return None
intersect_area = inter_width * inter_height
gt_area = (gt_box[2] - gt_box[0]) * (gt_box[3] - gt_box[1])
dt_area = (dt_box[2] - dt_box[0]) * (dt_box[3] - dt_box[1])
return [intersect_area, dt_area, gt_area]
class YoutubeFacesAccuracy(FullDatasetEvaluationMetric):
__provider__ = 'youtube_faces_accuracy'
annotation_types = (DetectionAnnotation, )
prediction_types = (DetectionPrediction, )
@classmethod
def parameters(cls):
parameters = super().parameters()
parameters.update({
'overlap': NumberField(
value_type=float, min_value=0, max_value=1, default=0.40, optional=True,
description='Specifies the IOU threshold to consider as a true positive candidate face.'
),
'relative_size': NumberField(
value_type=float, min_value=0, max_value=1, default=0.25, optional=True,
description='Specifies the size of detected face candidate\'s area in proportion to the size '
'of ground truth\'s face size. This value is set to filter candidates that have high IOU '
'but have a relatively smaller face size than ground truth face size.'
)
})
return parameters
def configure(self):
self.overlap = self.get_value_from_config('overlap')
self.relative_size = self.get_value_from_config('relative_size')
def evaluate(self, annotations, predictions):
true_positive = 0
false_positive = 0
for (annotation, prediction) in zip(annotations, predictions):
for gt_idx in range(annotation.x_mins.size):
gt_face = [
annotation.x_mins[gt_idx],
annotation.y_mins[gt_idx],
annotation.x_maxs[gt_idx],
annotation.y_maxs[gt_idx]
]
found = False
for i in range(prediction.scores.size):
dt_face = [
prediction.x_mins[i],
prediction.y_mins[i],
prediction.x_maxs[i],
prediction.y_maxs[i]
]
iou = calc_iou(gt_face, dt_face)
if iou:
intersect_area, dt_area, gt_area = iou
if intersect_area / dt_area < self.overlap:
continue
if dt_area / gt_area >= self.relative_size:
found = True
break
if found:
true_positive += 1
else:
false_positive += 1
accuracy = true_positive / (true_positive + false_positive)
return accuracy
| 41.629162 | 120 | 0.626741 |
aceb0925f7de963d6b3e7062d5677bb5275f2780 | 288 | py | Python | Mundo01/Python/aula06-004.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula06-004.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | Mundo01/Python/aula06-004.py | molonti/CursoemVideo---Python | 4f6a7af648f7f619d11e95fa3dc7a33b28fcfa11 | [
"MIT"
] | null | null | null | n1 = input("Digite Algo: ");
print("Tipo de dado:", type(n1));
print("É um espaco ?", n1.isspace());
print("É alphanumerico ?", n1.isalnum());
print("Pode ser convertido em numero ?", n1.isnumeric());
print("Esta em maiusculo ?", n1.isupper());
print("Esta em minusculo ?", n1.islower()); | 41.142857 | 57 | 0.652778 |
aceb0b33b8ad1ae333393c218c1ecfe705a2faab | 4,658 | py | Python | lambda/cdl_grant_lob_permissions.py | aws-samples/aws-lake-formation-permissions-automation | 17b349f0a4de61cd5db3bd0a2745033cfaf36be4 | [
"MIT-0"
] | 2 | 2021-06-04T15:11:36.000Z | 2021-11-30T22:55:46.000Z | lambda/cdl_grant_lob_permissions.py | aws-samples/aws-lake-formation-permissions-automation | 17b349f0a4de61cd5db3bd0a2745033cfaf36be4 | [
"MIT-0"
] | null | null | null | lambda/cdl_grant_lob_permissions.py | aws-samples/aws-lake-formation-permissions-automation | 17b349f0a4de61cd5db3bd0a2745033cfaf36be4 | [
"MIT-0"
] | 3 | 2021-06-10T19:01:33.000Z | 2021-09-20T18:29:22.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# 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.
# 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.
import boto3
import json
import sys
import botocore.exceptions
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
session = boto3.Session()
sts = boto3.client('sts')
def lambda_handler(event, context):
logger.debug("cdl_grant_lob_permissions received event: " + json.dumps(event, indent=2))
databaseARN =event['databaseARN']
databaseName = event['databaseName']
typeOfChange = event['typeOfChange']
cdl_account_id = event['cdl_account_id']
rolearn = event['ARN']
lob_arn_region_prefix = event['lob_arn_region_prefix']
lob_athena_user = event['lob_athena_user']
logger.debug("databaseARN:" + databaseARN)
logger.debug("databaseName: "+ databaseName)
logger.debug("typeOfChange:" + typeOfChange)
logger.debug("cdl_account_id:" + cdl_account_id)
logger.debug("rolearn:" + rolearn)
# -----------------------------------------------------------------------
# Assume LOB account role, initiate a session as the LOB role
# and invoke grant_lob_permissions lambda function from that
# account
# -----------------------------------------------------------------------
try:
awsaccount = sts.assume_role(
RoleArn=rolearn,
RoleSessionName='awsaccount_session'
)
#https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts.html#STS.Client.assume_role
except botocore.exceptions.ClientError as error:
if error.response['Error']['Code'] == 'MalformedPolicyDocumentException':
logger.warn('The policy document is malformed.')
elif error.response['Error']['Code'] == 'ExpiredTokenException':
logger.warn('The token has expired.')
else:
raise error
ACCESS_KEY = awsaccount['Credentials']['AccessKeyId']
SECRET_KEY = awsaccount['Credentials']['SecretAccessKey']
SESSION_TOKEN = awsaccount['Credentials']['SessionToken']
start = '::'
end = ':'
lob_account_id = rolearn[rolearn.find(start)+len(start):rolearn.rfind(end)] # getting awsaccount ID from IAM Role ARN
lob_lambda_arn = lob_arn_region_prefix + lob_account_id + ":function:grant_lob_permissions"
logger.debug("lob_lambda_arn " + lob_lambda_arn)
lambda_lob_client = boto3.client('lambda', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, aws_session_token=SESSION_TOKEN)
args = {
"cdl_account_id": cdl_account_id,
"lob_account_id": lob_account_id,
"databaseARN": databaseARN,
"databaseName": databaseName,
"typeOfChange": typeOfChange,
"lob_athena_user": lob_athena_user,
"lob_db_permissions": event['lob_db_permissions'],
"lob_alltables_permissions": event['lob_alltables_permissions']
}
try:
invoke_response = lambda_lob_client.invoke(FunctionName=lob_lambda_arn,
InvocationType='Event', #assync exec
Payload=json.dumps(args))
#https://docs.amazonaws.cn/en_us/lambda/latest/dg/API_Invoke.html
except botocore.exceptions.ClientError as error:
if error.response['Error']['Code'] == 'ServiceException':
logger.warn('The AWS Lambda service encountered an internal error.')
elif error.response['Error']['Code'] == 'ResourceNotFoundException':
logger.warn('The resource specified in the request does not exist.')
else:
raise error # For possible Exceptions refer: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke
| 45.666667 | 164 | 0.679906 |
aceb0b548834db6c82b175cbee6f59c928ad3f6f | 4,565 | py | Python | zenplayer/components/audio/audio_vlc.py | Zen-CODE/zenplayer | c1803992cd5243a106d1a0eda3cee321ce417b07 | [
"MIT"
] | 3 | 2020-01-04T09:59:54.000Z | 2022-01-08T22:27:20.000Z | zenplayer/components/audio/audio_vlc.py | Zen-CODE/zenplayer | c1803992cd5243a106d1a0eda3cee321ce417b07 | [
"MIT"
] | 2 | 2020-05-16T08:08:37.000Z | 2021-04-06T17:24:28.000Z | zenplayer/components/audio/audio_vlc.py | Zen-CODE/zenplayer | c1803992cd5243a106d1a0eda3cee321ce417b07 | [
"MIT"
] | 2 | 2017-06-01T00:49:05.000Z | 2022-01-08T22:27:19.000Z | """
This module houses a VLC audio component that supports the Kivy `Sound`
interface.
"""
from kivy.core.audio import Sound, SoundLoader
from vlc import EventType, Instance
from kivy.clock import mainthread
from kivy.logger import Logger
class SoundVLCPlayer(Sound):
'''A Kivy `Sound` object based on a VLC audio backend. '''
instance = None
player = None
@staticmethod
def extensions():
return ("mp3", "mp4", "flac", "mkv", "wav", "ogg", "m4a", "wma")
def __init__(self, **kwargs):
self._length = 0
if self.instance is None:
Logger.debug("SoundVLCPlayer: Creating an instance")
SoundVLCPlayer.instance = Instance()
super().__init__(**kwargs)
@mainthread
def _track_finished(self, *_args):
""" Event fired when the track is finished. """
if not self.loop:
self.stop()
else:
self.seek(0.)
self.player.play()
def _load_player(self, filename):
""" Unload the VLC Media player if it not already unloaded """
self._unload_player()
Logger.info("VLCPlayer: Loading player")
SoundVLCPlayer.player = player = self.instance.media_player_new()
media = player.set_mrl(filename)
player.event_manager().event_attach(
EventType.MediaPlayerEndReached, self._track_finished)
media.parse() # Determine duration
self._length = media.get_duration() / 1000.0
media.release()
def _unload_player(self):
""" Unload the VLC Media player if it not already unloaded """
if self.player is not None:
Logger.info("VLCPlayer: Unloading player")
self.player.event_manager().event_detach(
EventType.MediaPlayerEndReached)
if self.player.is_playing():
self.player.stop()
self.player.release()
SoundVLCPlayer.player = None
def load(self):
""" Loads the Media player for the suitable `source` filename. """
Logger.info("VLCPlayer: Entering load")
self._load_player(self.source)
self._set_volume(self.volume)
def unload(self):
""" Unload any instances of the player """
self._unload_player()
def play(self):
""" Play the audio file """
if self.state == 'play':
super().play()
return
if self.player is None:
self.load()
self.player.play()
self.state = 'play'
super().play()
def stop(self):
""" Stop any currently playing audio file """
if self.player and self.player.is_playing():
self.player.pause()
super().stop()
def seek(self, position):
""" Set the player to the given position in seconds """
if self.player:
value = position / self._length
self.player.set_position(value)
def get_pos(self):
""" Return the position in seconds the currently playing track """
if self.player is not None and self.state == "play":
return self.player.get_position() * self._length
return 0
def on_volume(self, _instance, volume):
"""
Respond to the setting of the volume. This value is fraction between
0 and 1.
"""
self._set_volume(volume)
def _set_volume(self, value):
"""
The volume of the currently playing sound, where the value is between
0 and 1.
"""
if self.player:
vol = 100 if abs(value) >= 1.0 else 100 * abs(value)
self.player.audio_set_volume(int(vol))
def _get_length(self):
""" Getter method to fetch the track length """
return self._length
if __name__ == "__main__":
from time import sleep
file = "/home/fruitbat/Music/Various/Music With Attitude/04 - " \
"dEUS - Everybody's Weird.mp3"
# Use the `KIVY_AUDIO=vlcplayer` setting in environment variables to use
# our provider
sound = SoundLoader.load(file)
if sound:
print("Loaded sound")
sound.volume = 0.5
sound.play()
sound.seek(10)
i = 0
while True:
print("Sound found at %s" % sound.source)
print("Sound is %.3f seconds" % sound.length)
print("Position is %.3f seconds" % sound.get_pos())
sleep(2)
i += 1
sound.stop()
sleep(2)
sound.play()
sleep(2)
else:
print("Failed to load sound")
| 30.433333 | 77 | 0.585104 |
aceb0b752a2eca8db1a9e10882b966cc672cb054 | 2,663 | py | Python | tests/test_dubins_path_planning.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | 1 | 2021-12-02T01:45:01.000Z | 2021-12-02T01:45:01.000Z | tests/test_dubins_path_planning.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | null | null | null | tests/test_dubins_path_planning.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | 1 | 2022-01-14T11:11:24.000Z | 2022-01-14T11:11:24.000Z | import numpy as np
import conftest
from PathPlanning.DubinsPath import dubins_path_planner
np.random.seed(12345)
def check_edge_condition(px, py, pyaw, start_x, start_y, start_yaw, end_x,
end_y, end_yaw):
assert (abs(px[0] - start_x) <= 0.01)
assert (abs(py[0] - start_y) <= 0.01)
assert (abs(pyaw[0] - start_yaw) <= 0.01)
assert (abs(px[-1] - end_x) <= 0.01)
assert (abs(py[-1] - end_y) <= 0.01)
assert (abs(pyaw[-1] - end_yaw) <= 0.01)
def check_path_length(px, py, lengths):
path_len = sum(
[np.hypot(dx, dy) for (dx, dy) in zip(np.diff(px), np.diff(py))])
assert (abs(path_len - sum(lengths)) <= 0.1)
def test_1():
start_x = 1.0 # [m]
start_y = 1.0 # [m]
start_yaw = np.deg2rad(45.0) # [rad]
end_x = -3.0 # [m]
end_y = -3.0 # [m]
end_yaw = np.deg2rad(-45.0) # [rad]
curvature = 1.0
px, py, pyaw, mode, lengths = dubins_path_planner.plan_dubins_path(
start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature)
check_edge_condition(px, py, pyaw, start_x, start_y, start_yaw, end_x,
end_y, end_yaw)
check_path_length(px, py, lengths)
def test_2():
dubins_path_planner.show_animation = False
dubins_path_planner.main()
def test_3():
N_TEST = 10
for i in range(N_TEST):
start_x = (np.random.rand() - 0.5) * 10.0 # [m]
start_y = (np.random.rand() - 0.5) * 10.0 # [m]
start_yaw = np.deg2rad((np.random.rand() - 0.5) * 180.0) # [rad]
end_x = (np.random.rand() - 0.5) * 10.0 # [m]
end_y = (np.random.rand() - 0.5) * 10.0 # [m]
end_yaw = np.deg2rad((np.random.rand() - 0.5) * 180.0) # [rad]
curvature = 1.0 / (np.random.rand() * 5.0)
px, py, pyaw, mode, lengths = \
dubins_path_planner.plan_dubins_path(
start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature)
check_edge_condition(px, py, pyaw, start_x, start_y, start_yaw, end_x,
end_y, end_yaw)
check_path_length(px, py, lengths)
def test_path_plannings_types():
dubins_path_planner.show_animation = False
start_x = 1.0 # [m]
start_y = 1.0 # [m]
start_yaw = np.deg2rad(45.0) # [rad]
end_x = -3.0 # [m]
end_y = -3.0 # [m]
end_yaw = np.deg2rad(-45.0) # [rad]
curvature = 1.0
_, _, _, mode, _ = dubins_path_planner.plan_dubins_path(
start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature,
selected_types=["RSL"])
assert mode == ["R", "S", "L"]
if __name__ == '__main__':
conftest.run_this_test(__file__)
| 28.634409 | 78 | 0.578671 |
aceb0e4be6fde84e1c529fdde0a65accd0f5e684 | 1,134 | py | Python | conf.py | imperial-genomics-facility/rnaseq-notebook-image | 8ffbb3fd5caca04b9664897f8a4cf7e516ddefb2 | [
"Apache-2.0"
] | 1 | 2021-02-15T16:53:42.000Z | 2021-02-15T16:53:42.000Z | conf.py | imperial-genomics-facility/rnaseq-notebook-image | 8ffbb3fd5caca04b9664897f8a4cf7e516ddefb2 | [
"Apache-2.0"
] | null | null | null | conf.py | imperial-genomics-facility/rnaseq-notebook-image | 8ffbb3fd5caca04b9664897f8a4cf7e516ddefb2 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
project = 'RNA-Seq notebook'
author = 'IGF'
copyright = f'{datetime.now():%Y}, {author}'
version = ''
release = version
extensions = [
'nbsphinx',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
language = None
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
pygments_style = 'sphinx'
# -- Options for HTML output ----------------------------------------------
html_theme = "sphinx_rtd_theme"
html_theme_options = {
'display_version': False,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'vcs_pageview_mode': '',
'style_nav_header_background': 'white',
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False,
'conf_py_path':'/',
}
# -- Strip output ----------------------------------------------
import nbclean, glob
for filename in glob.glob('examples/*.ipynb', recursive=True):
ntbk = nbclean.NotebookCleaner(filename)
ntbk.clear('stderr')
ntbk.save(filename)
| 24.652174 | 79 | 0.627866 |
aceb0ee04ed43c1bfff0a0cef6ee6898290fa686 | 2,779 | py | Python | jnpr/space/test/test_device_syslogs.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 27 | 2015-04-21T09:01:56.000Z | 2021-08-21T22:39:12.000Z | jnpr/space/test/test_device_syslogs.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2015-04-16T05:57:18.000Z | 2017-05-03T18:34:16.000Z | jnpr/space/test/test_device_syslogs.py | davids-uta-edu/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 22 | 2015-03-26T08:41:04.000Z | 2020-09-24T19:50:43.000Z | #
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2015 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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 __future__ import unicode_literals
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
import configparser
import pytest
import time
from jnpr.space import rest
from jnpr.space import async
_task_id = 0
@pytest.fixture
def task_id():
global _task_id
return _task_id
class TestDeviceSyslogs(object):
def setup_class(self):
# Extract Space URL, userid, password from config file
config = configparser.RawConfigParser()
import os
config.read(os.path.dirname(os.path.realpath(__file__)) +
"/test.conf")
url = config.get('space', 'url')
user = config.get('space', 'user')
passwd = config.get('space', 'passwd')
# Create a Space REST end point
self.space = rest.Space(url, user, passwd)
def test_get_syslog_events(self):
tm = async.TaskMonitor(self.space, 'test_SYSLOG_q')
devices_list = self.space.device_management.devices.get(
filter_={'managedStatus': 'In Sync',
'deviceFamily': 'junos'})
assert len(devices_list) > 0, "Not enough devices on Space"
try:
result = self.space.device_management.devices.get_syslog_events.post(
task_monitor=tm,
devices=devices_list[0:1],
text_patterns=['roshan', 'joyce'])
from pprint import pprint
pprint(result)
assert result.id > 0, "Device Get Syslog Events execution Failed"
global _task_id
_task_id = result.id
finally:
tm.delete()
def test_stop_syslog_events(self, task_id):
my_task_id = task_id
print(my_task_id)
assert my_task_id > 0
time.sleep(30)
result = self.space.device_management.devices.stop_syslog_events.post(
id=my_task_id)
from pprint import pprint
pprint(result)
| 31.579545 | 81 | 0.652033 |
aceb0ee92169a1b0118924d34af80997283febc0 | 2,369 | py | Python | app/BlogSite/BlogSite/settings.py | AbhijithGanesh/FastAPI-Blog | ba60f674fa0bf7dc7346768433886039d642830d | [
"BSD-3-Clause"
] | null | null | null | app/BlogSite/BlogSite/settings.py | AbhijithGanesh/FastAPI-Blog | ba60f674fa0bf7dc7346768433886039d642830d | [
"BSD-3-Clause"
] | 1 | 2022-02-10T08:31:52.000Z | 2022-02-10T08:31:52.000Z | app/BlogSite/BlogSite/settings.py | AbhijithGanesh/FastAPI-Blog | ba60f674fa0bf7dc7346768433886039d642830d | [
"BSD-3-Clause"
] | null | null | null | from pathlib import Path
import os
from dotenv import load_dotenv, dotenv_values
if load_dotenv(".env"):
config = dict(dotenv_values(".env"))
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
SECRET_KEY = os.environ.get("SECRET_KEY")
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
"Logic.apps.LogicConfig",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]
ROOT_URLCONF = "BlogSite.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]
ASGI_APPLICATION = "BlogSite.asgi.application"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "database" / "db.sqlite3",
}
}
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]
LANGUAGE_CODE = "en-us"
TIME_ZONE = "Asia/Calcutta"
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = "/static/"
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
MOUNT_DJANGO = True
| 24.936842 | 92 | 0.646686 |
aceb0efd430c980a9c7adb3f43acac71f74e93fc | 155 | py | Python | investment-opportunities/src/investment_opportunities/pipelines/predict_prices/__init__.py | javiicc/Identifying_Potential_Investment_Opportunities_In_The_Irish_Real_Estate_Market_Using_MachineLearning | da3f8fb696ac2dd17251c09aca2b97070133d0fb | [
"MIT"
] | null | null | null | investment-opportunities/src/investment_opportunities/pipelines/predict_prices/__init__.py | javiicc/Identifying_Potential_Investment_Opportunities_In_The_Irish_Real_Estate_Market_Using_MachineLearning | da3f8fb696ac2dd17251c09aca2b97070133d0fb | [
"MIT"
] | null | null | null | investment-opportunities/src/investment_opportunities/pipelines/predict_prices/__init__.py | javiicc/Identifying_Potential_Investment_Opportunities_In_The_Irish_Real_Estate_Market_Using_MachineLearning | da3f8fb696ac2dd17251c09aca2b97070133d0fb | [
"MIT"
] | null | null | null | """
This is a boilerplate pipeline 'predict_prices'
generated using Kedro 0.17.5
"""
from .pipeline import create_pipeline
__all__ = ["create_pipeline"]
| 17.222222 | 47 | 0.76129 |
aceb0f0980f5311d451949155e7ffc72760ec29b | 11,259 | py | Python | datasets.py | Johnson-yue/RS-GAN | 8e8723045d63d8f9a4b510800cd909e7a6e3d195 | [
"MIT"
] | 26 | 2020-11-10T18:43:07.000Z | 2021-11-05T08:19:17.000Z | datasets.py | Johnson-yue/RS-GAN | 8e8723045d63d8f9a4b510800cd909e7a6e3d195 | [
"MIT"
] | 1 | 2020-11-19T03:46:04.000Z | 2020-12-10T23:25:23.000Z | datasets.py | Johnson-yue/RS-GAN | 8e8723045d63d8f9a4b510800cd909e7a6e3d195 | [
"MIT"
] | 3 | 2020-11-12T09:50:57.000Z | 2021-07-16T21:04:46.000Z | import torch
from torch.utils.data import Dataset, DataLoader, TensorDataset, SubsetRandomSampler
from torchvision import transforms, datasets
import numpy as np
import random
import torchvision
def sample_data(p, n=100):
return np.random.multivariate_normal(p, np.array([[0.002, 0], [0, 0.002]]), n)
def toy_DataLoder(n=100, batch_size=100, gaussian_num=5, shuffle=True):
if gaussian_num == 5:
d = np.linspace(0, 360, 6)[:-1]
x = np.sin(d / 180. * np.pi)
y = np.cos(d / 180. * np.pi)
points = np.vstack((y, x)).T
s0 = sample_data(points[0], n).astype(np.float)
s1 = sample_data(points[1], n).astype(np.float)
s2 = sample_data(points[2], n).astype(np.float)
s3 = sample_data(points[3], n).astype(np.float)
s4 = sample_data(points[4], n).astype(np.float)
samples = np.vstack((s0, s1, s2, s3, s4))
elif gaussian_num == 2:
s0 = sample_data([1, 0], n).astype(np.float)
s1 = sample_data([-1, 0], n).astype(np.float)
samples = np.vstack((s0, s1))
elif gaussian_num == 25:
samples = np.empty((0, 2))
for x in range(-2, 3, 1):
for y in range(-2, 3, 1):
samples = np.vstack((samples, sample_data([x, y], n).astype(np.float)))
permutation = range(gaussian_num * n)
np.random.shuffle(permutation)
samples = samples[permutation]
data = TensorDataset(torch.from_numpy(samples))
dataloader = DataLoader(data, batch_size=batch_size, shuffle=shuffle, num_workers=0, drop_last=True)
return dataloader
def _noise_adder(img):
return torch.empty_like(img, dtype=img.dtype).uniform_(0.0, 1/128.0) + img
def mnist_DataLoder(image_size, batch_size=128, shuffle=True, train=True, balancedbatch=False):
root = '/data01/tf6/DATA/mnist/'
transform = transforms.Compose([
transforms.Scale(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
_noise_adder,
])
dataset = datasets.MNIST(root=root, train=train, download=True, transform=transform)
if balancedbatch:
train_loader = torch.utils.data.DataLoader(dataset,
batch_size=batch_size, shuffle=False, drop_last=True,
sampler=BalancedBatchSampler(dataset))
else:
train_loader = torch.utils.data.DataLoader(dataset, num_workers=8,
batch_size=batch_size, shuffle=shuffle, drop_last=True)
return train_loader
def imbalancedmnist_DataLoader(image_size, batch_size, shuffle=True, train=True):
transform = transforms.Compose([
transforms.Scale(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
_noise_adder,
])
imbal_class_prop = np.array([0, 0, 0, 0, 0, 0.2, 0, 1, 0, 0])
train_dataset_imbalanced = ImbalancedMNIST(
imbal_class_prop, root='/data01/tf6/DATA/mnist/', train=train, download=True, transform=transform)
_, train_class_counts = train_dataset_imbalanced.get_labels_and_class_counts()
# Create new DataLoaders, since the datasets have changed
train_loader_imbalanced = torch.utils.data.DataLoader(
dataset=train_dataset_imbalanced, batch_size=batch_size, shuffle = shuffle, num_workers=8, drop_last = True)
return train_loader_imbalanced
def cifar_DataLoder(image_size, batch_size=128, shuffle=True, train=True, balancedbatch=False):
root = '/data01/tf6/DATA/cifar10/'
transform = transforms.Compose([
transforms.Scale(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
_noise_adder,
])
dataset = datasets.CIFAR10(root=root, train=train, download=True, transform=transform)
if balancedbatch:
train_loader = torch.utils.data.DataLoader(dataset,
batch_size=batch_size, shuffle=False, drop_last=True, num_workers=8,
sampler=BalancedBatchSampler(dataset))
else:
train_loader = torch.utils.data.DataLoader(dataset,
batch_size=batch_size, shuffle=shuffle, num_workers=8, drop_last=True)
return train_loader
def stl_DataLoder(image_size, batch_size=128, shuffle=True):
root = '/data01/tf6/DATA/stl10/'
transform = transforms.Compose([
transforms.Scale(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
_noise_adder,
])
train_loader = torch.utils.data.DataLoader(
datasets.STL10(root=root, split='unlabeled', download=True, transform=transform),
batch_size=batch_size, shuffle=shuffle, num_workers=8, drop_last=True)
return train_loader
def lsunDataLoder(image_size, batch_size=128, shuffle=True, category='bedroom_train'):
dataset = datasets.LSUN(root='/data01/tf6/DATA', classes=[category],
transform=transforms.Compose([
transforms.CenterCrop(image_size),
transforms.Resize((image_size, image_size)),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
_noise_adder,
]))
train_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=8, drop_last=True)
return train_loader
def celebaDataLoader(image_size, batch_size=128, shuffle=True):
dataset = datasets.ImageFolder(root='/data01/tf6/DATA',
transform=transforms.Compose([
transforms.Resize((image_size, image_size)),
transforms.CenterCrop(image_size),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
_noise_adder,
]))
train_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=shuffle, num_workers=8, drop_last=True)
return train_loader
def get_labels_and_class_counts(labels_list):
'''
Calculates the counts of all unique classes.
'''
labels = np.array(labels_list)
_, class_counts = np.unique(labels, return_counts=True)
return labels, class_counts
class ImbalancedMNIST(Dataset):
def __init__(self, imbal_class_prop, root, train, download, transform, seed=1):
self.dataset = datasets.MNIST(
root=root, train=train, download=download, transform=transform)
self.train = train
self.imbal_class_prop = imbal_class_prop
self.nb_classes = len(imbal_class_prop)
self.seed = seed
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
self.idxs = self.resample()
def get_labels_and_class_counts(self):
return self.labels, self.imbal_class_counts
def resample(self):
'''
Resample the indices to create an artificially imbalanced dataset.
'''
if self.train:
targets, class_counts = get_labels_and_class_counts(
self.dataset.train_labels)
else:
targets, class_counts = get_labels_and_class_counts(
self.dataset.test_labels)
# Get class indices for resampling
class_indices = [np.where(targets == i)[0] for i in range(self.nb_classes)]
# Reduce class count by proportion
self.imbal_class_counts = [
int(count * prop)
for count, prop in zip(class_counts, self.imbal_class_prop)
]
# Get class indices for reduced class count
idxs = []
for c in range(self.nb_classes):
imbal_class_count = self.imbal_class_counts[c]
idxs.append(class_indices[c][:imbal_class_count])
idxs = np.hstack(idxs)
random.shuffle(idxs)
self.labels = targets[idxs]
return idxs
def __getitem__(self, index):
img, target = self.dataset[self.idxs[index]]
return img, target
def __len__(self):
return len(self.idxs)
class BalancedBatchSampler(torch.utils.data.sampler.Sampler):
def __init__(self, dataset, labels=None):
self.labels = labels
self.dataset = dict()
self.balanced_max = 0
# Save all the indices for all the classes
for idx in range(0, len(dataset)):
label = self._get_label(dataset, idx)
if label not in self.dataset:
self.dataset[label] = list()
self.dataset[label].append(idx)
self.balanced_max = len(self.dataset[label]) \
if len(self.dataset[label]) > self.balanced_max else self.balanced_max
# Oversample the classes with fewer elements than the max
for label in self.dataset:
while len(self.dataset[label]) < self.balanced_max:
self.dataset[label].append(random.choice(self.dataset[label]))
self.keys = list(self.dataset.keys())
self.currentkey = 0
self.indices = [-1] * len(self.keys)
def __iter__(self):
while self.indices[self.currentkey] < self.balanced_max - 1:
self.indices[self.currentkey] += 1
yield self.dataset[self.keys[self.currentkey]][self.indices[self.currentkey]]
self.currentkey = (self.currentkey + 1) % len(self.keys)
self.indices = [-1] * len(self.keys)
def _get_label(self, dataset, idx, labels=None):
if self.labels is not None:
return self.labels[idx].item()
else:
# Trying guessing
dataset_type = type(dataset)
if (dataset_type is torchvision.datasets.MNIST ):
return dataset.train_labels[idx].item()
elif (dataset_type is torchvision.datasets.CIFAR10 ):
return dataset.train_labels[idx]
elif dataset_type is torchvision.datasets.ImageFolder:
return dataset.imgs[idx][1]
else:
raise Exception("You should pass the tensor of labels to the constructor as second argument")
def __len__(self):
return self.balanced_max * len(self.keys)
def getDataLoader(name, image_size, batch_size=64, shuffle=True, train=True, imbalancedataset=False, balancedbatch=False):
if name == 'mnist':
if imbalancedataset:
return imbalancedmnist_DataLoader(image_size, batch_size, shuffle, train)
else:
return mnist_DataLoder(image_size, batch_size, shuffle, train, balancedbatch)
elif name == 'cifar':
return cifar_DataLoder(image_size, batch_size, shuffle, train, balancedbatch)
elif name == 'stl':
return stl_DataLoder(image_size, batch_size, shuffle)
elif name == 'celeba':
return celebaDataLoader(image_size, batch_size, shuffle)
elif name == 'lsun':
return lsunDataLoder(image_size, batch_size, shuffle)
elif name == 'church_outdoor':
return lsunDataLoder(image_size, batch_size, shuffle, category='church_outdoor_train')
elif name == 'tower':
return lsunDataLoder(image_size, batch_size, shuffle, category='tower_train') | 42.647727 | 126 | 0.635847 |
aceb0fae0c0c01de657d251ef955e1bb4d49301c | 4,307 | py | Python | cairis/data/TemplateGoalDAO.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"Apache-2.0"
] | null | null | null | cairis/data/TemplateGoalDAO.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"Apache-2.0"
] | null | null | null | cairis/data/TemplateGoalDAO.py | nathanjenx/cairis | 06d2d592b64af20746b9a2713551db597af46805 | [
"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.
from cairis.core.ARM import *
from cairis.core.TemplateGoal import TemplateGoal
from cairis.core.TemplateGoalParameters import TemplateGoalParameters
from cairis.daemon.CairisHTTPError import ObjectNotFoundHTTPError, MalformedJSONHTTPError, ARMHTTPError, MissingParameterHTTPError, OverwriteNotAllowedHTTPError
import cairis.core.armid
from cairis.data.CairisDAO import CairisDAO
from cairis.tools.ModelDefinitions import TemplateGoalModel
from cairis.tools.SessionValidator import check_required_keys
from cairis.tools.JsonConverter import json_serialize, json_deserialize
__author__ = 'Shamal Faily'
class TemplateGoalDAO(CairisDAO):
def __init__(self, session_id):
CairisDAO.__init__(self, session_id)
def get_template_goals(self,constraint_id = -1):
try:
tgs = self.db_proxy.getTemplateGoals(constraint_id)
except DatabaseProxyException as ex:
self.close()
raise ARMHTTPError(ex)
except ARMException as ex:
self.close()
raise ARMHTTPError(ex)
tgList = []
for key in tgs:
tg = tgs[key]
del tg.theId
tgList.append(tg)
return tgList
def get_template_goal(self, template_goal_name):
try:
found_tg = None
tgId = self.db_proxy.getDimensionId(template_goal_name,'template_goal')
tgs = self.db_proxy.getTemplateGoals(tgId)
if tgs is not None:
found_tg = tgs.get(template_goal_name)
if found_tg is None:
self.close()
raise ObjectNotFoundHTTPError('The provided template goal')
del found_tg.theId
return found_tg
except ObjectNotFound as ex:
self.close()
raise ObjectNotFoundHTTPError('The provided template goal')
except DatabaseProxyException as ex:
self.close()
raise ARMHTTPError(ex)
except ARMException as ex:
self.close()
raise ARMHTTPError(ex)
def add_template_goal(self, tg):
tgParams = TemplateGoalParameters(
goalName=tg.theName,
goalDef=tg.theDefinition,
goalRat=tg.theRationale,
goalConcerns=tg.theConcerns,
goalResp=tg.theResponsibilities)
try:
self.db_proxy.addTemplateGoal(tgParams)
except ARMException as ex:
self.close()
raise ARMHTTPError(ex)
def update_template_goal(self,tg,name):
tgParams = TemplateGoalParameters(
goalName=tg.theName,
goalDef=tg.theDefinition,
goalRat=tg.theRationale,
goalConcerns=tg.theConcerns,
goalResp=tg.theResponsibilities)
try:
tgId = self.db_proxy.getDimensionId(name,'template_goal')
tgParams.setId(tgId)
self.db_proxy.updateTemplateGoal(tgParams)
except ARMException as ex:
self.close()
raise ARMHTTPError(ex)
def delete_template_goal(self, name):
try:
tgId = self.db_proxy.getDimensionId(name,'template_goal')
self.db_proxy.deleteTemplateGoal(tgId)
except ARMException as ex:
self.close()
raise ARMHTTPError(ex)
def from_json(self, request, to_props=False):
json = request.get_json(silent=True)
if json is False or json is None:
self.close()
raise MalformedJSONHTTPError(data=request.get_data())
json_dict = json['object']
check_required_keys(json_dict, TemplateGoalModel.required)
json_dict['__python_obj__'] = TemplateGoal.__module__+'.'+ TemplateGoal.__name__
tg = json_serialize(json_dict)
tg = json_deserialize(tg)
if isinstance(tg, TemplateGoal):
return tg
else:
self.close()
raise MalformedJSONHTTPError()
| 33.648438 | 160 | 0.728117 |
aceb10b689748003ff4e1ba2273ff9a26843865b | 1,942 | py | Python | 03/day-three.py | antooni/advent-of-code-2021 | 03c8c8e135c6618fd389fd94a1f37bab6afa2391 | [
"MIT"
] | null | null | null | 03/day-three.py | antooni/advent-of-code-2021 | 03c8c8e135c6618fd389fd94a1f37bab6afa2391 | [
"MIT"
] | null | null | null | 03/day-three.py | antooni/advent-of-code-2021 | 03c8c8e135c6618fd389fd94a1f37bab6afa2391 | [
"MIT"
] | null | null | null | from pathlib import Path
path = Path(__file__).resolve().parents[0].joinpath('input.txt')
print(path)
def main():
# PART 1
bits_balances = [0,0,0,0,0,0,0,0,0,0,0,0]
gamma_str = '0b'
epsilon_str = '0b'
lines = open(path).readlines()
def trim_last_character(string):
return string[0:len(string)-1]
for line in lines:
for i, character in enumerate(trim_last_character(line)):
if(character == '0'):
bits_balances[i] -= 1
continue
if(character == '1'):
bits_balances[i] += 1
for balance in bits_balances:
if(balance >= 0):
gamma_str += '1'
epsilon_str += '0'
continue
if(balance < 0):
gamma_str += '0'
epsilon_str += '1'
print('\ngamma = ', gamma_str)
print('epsilon = ', epsilon_str)
print('\npower consumption = ',int(gamma_str,2) * int(epsilon_str,2))
# PART 2
def filter_values(bit_num, array, output):
if(len(array) == 1):
return '0b' + array[0]
balance = 0
for line in array:
if(line[bit_num] == '1'):
balance += 1
continue
if(line[bit_num] == '0'):
balance -= 1
bit_value = output[0] if balance >= 0 else output[1]
result = []
for line in array:
if(line[bit_num] == bit_value):
result.append(line)
return filter_values(bit_num+1, result, output)
oxygen_generator = filter_values(0,lines, '10')
co2_scrubber = filter_values(0,lines, '01')
print('\noxygen generator rating = ',trim_last_character(oxygen_generator))
print('co2 scrubber rating = ', trim_last_character(co2_scrubber))
print('\nlife support rating = ', int(oxygen_generator,2) * int(co2_scrubber,2))
if __name__ == "__main__":
main()
| 26.60274 | 84 | 0.546859 |
aceb11c404bfc36918436bfcdd477b449f18eed0 | 1,171 | py | Python | indic_transliteration/sanscript_cli/typer_opts.py | vipranarayan14/indic_transliteration | e7688559cd77cdf2b469886d61ff6236178c28de | [
"MIT"
] | 15 | 2021-07-21T07:29:12.000Z | 2022-03-21T15:14:46.000Z | indic_transliteration/sanscript_cli/typer_opts.py | mukeshbadgujar/indic_transliteration | 1dde824fcf9bda4282545a6118155c31b418eccc | [
"MIT"
] | 9 | 2021-07-18T11:15:48.000Z | 2022-02-17T15:40:12.000Z | indic_transliteration/sanscript_cli/typer_opts.py | mukeshbadgujar/indic_transliteration | 1dde824fcf9bda4282545a6118155c31b418eccc | [
"MIT"
] | 1 | 2021-07-29T12:48:15.000Z | 2021-07-29T12:48:15.000Z | import typer
from indic_transliteration.sanscript import SCHEMES
from indic_transliteration.sanscript_cli import help_text
scheme_names = list(SCHEMES.keys())
scheme_help = "Choose from: {}.".format(", ".join(scheme_names))
def complete_scheme_name(incomplete: str):
for scheme_name in scheme_names:
if scheme_name.startswith(incomplete):
yield scheme_name
def check_scheme(scheme_name: str):
if scheme_name in scheme_names:
return scheme_name
error_msg = f"Invalid scheme name. \n\n{scheme_help}"
raise typer.BadParameter(error_msg)
from_scheme = typer.Option(
...,
"--from",
"-f",
help=help_text.from_scheme,
callback=check_scheme,
autocompletion=complete_scheme_name,
)
to_scheme = typer.Option(
...,
"--to",
"-t",
help=help_text.to_scheme,
callback=check_scheme,
autocompletion=complete_scheme_name,
)
input_file = typer.Option(
None,
"--input-file",
"-i",
help=help_text.input_file,
)
output_file = typer.Option(None, "--output-file", "-o", help=help_text.output_file)
input_string = typer.Argument(
None,
help=help_text.input_string,
)
| 21.290909 | 83 | 0.695986 |
aceb11da592f882559a1b830e02fe60b0107ae44 | 4,385 | py | Python | pulsectl/lookup.py | mhthies/python-pulse-control | 471428cd7d03356f0641fe93a8156b799d57ce02 | [
"MIT"
] | 135 | 2016-04-05T10:55:17.000Z | 2022-03-23T08:52:47.000Z | pulsectl/lookup.py | mhthies/python-pulse-control | 471428cd7d03356f0641fe93a8156b799d57ce02 | [
"MIT"
] | 73 | 2016-04-06T10:57:20.000Z | 2022-03-25T16:32:05.000Z | pulsectl/lookup.py | mhthies/python-pulse-control | 471428cd7d03356f0641fe93a8156b799d57ce02 | [
"MIT"
] | 36 | 2016-04-06T10:44:20.000Z | 2022-03-23T05:05:08.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import itertools as it, operator as op, functools as ft
import re
lookup_types = {
'sink': 'sink_list', 'source': 'source_list',
'sink-input': 'sink_input_list', 'source-output': 'source_output_list' }
lookup_types.update(it.chain.from_iterable(
((v, lookup_types[k]) for v in v) for k,v in
{ 'source': ['src'], 'sink-input': ['si', 'playback', 'play'],
'source-output': ['so', 'record', 'rec', 'mic'] }.items() ))
lookup_key_defaults = dict(
# No default keys for type = no implicit matches for that type
sink_input_list=[ # match sink_input_list objects with these keys by default
'media.name', 'media.icon_name', 'media.role',
'application.name', 'application.process.binary', 'application.icon_name' ] )
def pulse_obj_lookup(pulse, obj_lookup, prop_default=None):
'''Return set of pulse object(s) with proplist values matching lookup-string.
Pattern syntax:
[ { 'sink' | 'source' | 'sink-input' | 'source-output' } [ / ... ] ':' ]
[ proplist-key-name (non-empty) [ / ... ] ':' ] [ ':' (for regexp match) ]
[ proplist-key-value ]
Examples:
- sink:alsa.driver_name:snd_hda_intel
Match sink(s) with alsa.driver_name=snd_hda_intel (exact match!).
- sink/source:device.bus:pci
Match all sinks and sources with device.bus=pci.
- myprop:somevalue
Match any object (of all 4 supported types) that has myprop=somevalue.
- mpv
Match any object with any of the "default lookup props" (!!!) being equal to "mpv".
"default lookup props" are specified per-type in lookup_key_defaults above.
For example, sink input will be looked-up by media.name, application.name, etc.
- sink-input/source-output:mpv
Same as above, but lookup streams only (not sinks/sources).
Note that "sink-input/source-output" matches type spec, and parsed as such, not as key.
- si/so:mpv
Same as above - see aliases for types in lookup_types.
- application.binary/application.icon:mpv
Lookup by multiple keys with "any match" logic, same as with multiple object types.
- key\/with\/slashes\:and\:colons:somevalue
Lookup by key that has slashes and colons in it.
"/" and ":" must only be escaped in the proplist key part, used as-is in values.
Backslash itself can be escaped as well, i.e. as "\\".
- module-stream-restore.id:sink-input-by-media-role:music
Value has ":" in it, but there's no need to escape it in any way.
- device.description::Analog
Value lookup starting with : is interpreted as a regexp,
i.e. any object with device.description *containing* "Analog" in this case.
- si/so:application.name::^mpv\b
Return all sink-inputs/source-outputs ("si/so") where
"application.name" proplist value matches regexp "^mpv\b".
- :^mpv\b
Regexp lookup (stuff starting with "mpv" word) without type or key specification.
For python2, lookup string should be unicode type.
"prop_default" keyword arg can be used to specify
default proplist value for when key is not found there.'''
# \ue000-\uf8ff - private use area, never assigned to symbols
obj_lookup = obj_lookup.replace('\\\\', '\ue000').replace('\\:', '\ue001')
obj_types_re = '({0})(/({0}))*'.format('|'.join(lookup_types))
m = re.search(
( r'^((?P<t>{}):)?'.format(obj_types_re) +
r'((?P<k>.+?):)?' r'(?P<v>.*)$' ), obj_lookup, re.IGNORECASE )
if not m: raise ValueError(obj_lookup)
lookup_type, lookup_keys, lookup_re = op.itemgetter('t', 'k', 'v')(m.groupdict())
if lookup_keys:
lookup_keys = list(
v.replace('\ue000', '\\\\').replace('\ue001', ':').replace('\ue002', '/')
for v in lookup_keys.replace('\\/', '\ue002').split('/') )
lookup_re = lookup_re.replace('\ue000', '\\\\').replace('\ue001', '\\:')
obj_list_res, lookup_re = list(), re.compile( lookup_re[1:]
if lookup_re.startswith(':') else '^{}$'.format(re.escape(lookup_re)) )
for k in set( lookup_types[k] for k in
(lookup_type.split('/') if lookup_type else lookup_types.keys()) ):
if not lookup_keys: lookup_keys = lookup_key_defaults.get(k)
if not lookup_keys: continue
obj_list = getattr(pulse, k)()
if not obj_list: continue
for obj, k in it.product(obj_list, lookup_keys):
v = obj.proplist.get(k, prop_default)
if v is None: continue
if lookup_re.search(v): obj_list_res.append(obj)
return set(obj_list_res)
| 46.648936 | 91 | 0.682554 |
aceb11ffa758447f7cab09cece0f7471027cb7be | 2,186 | py | Python | torchero/utils/text/transforms/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 10 | 2020-07-06T13:35:26.000Z | 2021-08-10T09:46:53.000Z | torchero/utils/text/transforms/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 6 | 2020-07-07T20:52:16.000Z | 2020-07-14T04:05:02.000Z | torchero/utils/text/transforms/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 1 | 2021-06-28T17:56:11.000Z | 2021-06-28T17:56:11.000Z | import torch
from torchero.utils.text.transforms.compose import Compose
from torchero.utils.text.transforms.tokenizers import *
from torchero.utils.text.transforms.truncate import *
from torchero.utils.text.transforms.vocab import Vocab
tokenizers = {
'basic': BasicTokenizer,
'split': WhitespaceTokenizer,
'spacy': SpacyTokenizer,
'spacy:en': EnglishSpacyTokenizer,
'spacy:es': SpanishSpacyTokenizer,
'spacy:fr': FrenchSpacyTokenizer,
'spacy:de': GermanSpacyTokenizer,
'nltk': NLTKWordTokenizer,
'nltk:word': NLTKWordTokenizer,
'nltk:tweet': NLTKTweetTokenizer
}
truncators = {
'left': LeftTruncator,
'right': RightTruncator,
'center': CenterTruncator
}
def basic_text_transform(pre_process=str.lower,
tokenizer='basic',
vocab=None,
vocab_max_size=None,
vocab_min_count=1,
max_len=None,
truncate_mode='left',
bos=None,
eos=None,
pad="<pad>",
unk=None,
post_process=torch.LongTensor):
pipeline = {}
if pre_process is not None:
pipeline['pre_process'] = pre_process
if isinstance(tokenizer, str):
tokenizer = tokenizers[tokenizer]()
pipeline['tokenize'] = tokenizer
if max_len is not None:
if isinstance(truncate_mode, str):
if truncate_mode not in truncators.keys():
raise ValueError("Invalid truncate_mode. Choose from left, right, center")
truncator = truncators[truncate_mode](max_len)
else:
truncator = truncate_mode
pipeline['truncate'] = truncator
if vocab is None:
vocab = Vocab(bos=bos,
eos=eos,
pad=pad,
unk=unk,
max_size=vocab_max_size,
order_by='frequency',
min_count=vocab_min_count)
pipeline['vocab'] = vocab
if post_process is not None:
pipeline['post_process'] = post_process
return Compose.from_dict(pipeline)
| 33.121212 | 90 | 0.587374 |
aceb123d19ff5e90d25bdad9f5dcbb966c1037a4 | 11,783 | py | Python | code/python/NewsAPIforDigitalPortals/v2/fds/sdk/NewsAPIforDigitalPortals/model/inline_response2007.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/NewsAPIforDigitalPortals/v2/fds/sdk/NewsAPIforDigitalPortals/model/inline_response2007.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/NewsAPIforDigitalPortals/v2/fds/sdk/NewsAPIforDigitalPortals/model/inline_response2007.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.NewsAPIforDigitalPortals.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiModel
)
from fds.sdk.NewsAPIforDigitalPortals.exceptions import ApiAttributeError
def lazy_import():
from fds.sdk.NewsAPIforDigitalPortals.model.inline_response2007_data import InlineResponse2007Data
from fds.sdk.NewsAPIforDigitalPortals.model.inline_response200_meta import InlineResponse200Meta
globals()['InlineResponse2007Data'] = InlineResponse2007Data
globals()['InlineResponse200Meta'] = InlineResponse200Meta
class InlineResponse2007(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""
allowed_values = {
}
validations = {
}
@cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False
@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'data': (InlineResponse2007Data,), # noqa: E501
'meta': (InlineResponse200Meta,), # noqa: E501
}
@cached_property
def discriminator():
return None
attribute_map = {
'data': 'data', # noqa: E501
'meta': 'meta', # noqa: E501
}
read_only_vars = {
}
_composed_schemas = {}
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""InlineResponse2007 - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
data (InlineResponse2007Data): [optional] # noqa: E501
meta (InlineResponse200Meta): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
self = super(OpenApiModel, cls).__new__(cls)
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming',
'_path_to_item',
'_configuration',
'_visited_composed_classes',
])
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""InlineResponse2007 - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
data (InlineResponse2007Data): [optional] # noqa: E501
meta (InlineResponse200Meta): [optional] # noqa: E501
"""
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")
| 43.966418 | 124 | 0.580837 |
aceb1292b45e50e1550a116ea06b76777b2d9b4a | 9,232 | py | Python | util/ga/phase2_ga.py | yuhsiangfu/Multiple-Spreaders | 705d6fda7d825b5db650061ba7061e1ed4e03642 | [
"MIT"
] | null | null | null | util/ga/phase2_ga.py | yuhsiangfu/Multiple-Spreaders | 705d6fda7d825b5db650061ba7061e1ed4e03642 | [
"MIT"
] | null | null | null | util/ga/phase2_ga.py | yuhsiangfu/Multiple-Spreaders | 705d6fda7d825b5db650061ba7061e1ed4e03642 | [
"MIT"
] | null | null | null | """
Standard Genetic Algorithm (SGA)
@auth: Yu-Hsiang Fu
@date: 2016/04/28
"""
# ###
# 1.Imoprt packages and modulars
# ###
# import packages
import copy as c
import numpy as np
import random as r
import sys
import time
# import constants
from util.constant.constant_graph import NODE_DEGREE
# ###
# 2.Declare variables
# ###
# porgram variables
GENE_TO_NODE = {}
NODE_TO_GENE = {}
NEIGHBOR_LIST = {}
NUMBER_COMMUNITY = 2
# GA variables
INDV_LENGTH = 0
INDV_FITNESS = 'fitness'
INDV_GENOTYPE = 'genotype'
INDV_PHENOTYPE = 'phenotype'
# ###
# 3.Define functions
# ###
def show_msg(msg, newline=True):
if newline:
print(msg)
else:
print(msg, end='', flush=True)
def initialization(G, indv):
global GENE_TO_NODE, NODE_TO_GENE
global INDV_LENGTH, NEIGHBOR_LIST, NUMBER_COMMUNITY
INDV_LENGTH = c.copy(G.number_of_nodes())
NUMBER_COMMUNITY = c.copy(len(indv[INDV_PHENOTYPE]))
# mapping gene-to-node and node-to-gene
gene_index = 0
for i in G:
GENE_TO_NODE[gene_index] = i
NODE_TO_GENE[i] = gene_index
gene_index += 1
# create neighbor list
for i in G:
NEIGHBOR_LIST[i] = list(G.neighbors(i))
G.node[i][NODE_DEGREE] = len(NEIGHBOR_LIST[i])
return(G)
# ###
# generate function
# ###
def generate_genotype():
genotype = [r.randint(1, NUMBER_COMMUNITY) for i in range(0, INDV_LENGTH)]
return genotype
def generate_phenotype(indv):
# create community list, map node_index to node_id
community_list = {}
for i in range(INDV_LENGTH):
node_id = GENE_TO_NODE[i]
ci = indv[INDV_GENOTYPE][i]
if ci in community_list:
community_list[ci].append(node_id)
else:
community_list[ci] = [node_id]
return list(community_list.values())
def generage_an_individual():
individual = {}
individual[INDV_GENOTYPE] = generate_genotype()
return individual
def generate_two_individuals(indv_pool, rate_crossover=0.5):
# random select parent
parent_x = {}
parent_y = {}
pool_size = len(indv_pool)
if pool_size == 1:
parent_x = c.deepcopy(indv_pool[0][INDV_GENOTYPE])
parent_y = generage_an_individual()
else:
parent_index = r.sample(range(0, pool_size), 2)
parent_x = c.deepcopy(indv_pool[parent_index[0]][INDV_GENOTYPE])
parent_y = c.deepcopy(indv_pool[parent_index[1]][INDV_GENOTYPE])
# uniform corssover
new_indv1 = {}
new_indv2 = {}
new_indv1[INDV_GENOTYPE] = []
new_indv2[INDV_GENOTYPE] = []
# assign gene value
if r.random() <= rate_crossover:
for i in range(0, INDV_LENGTH):
# mask == 0, px[i] -> idv1[i], py[i] -> idv2[i]
if r.randint(0, 1) == 0:
new_indv1[INDV_GENOTYPE].append(parent_x[i])
new_indv2[INDV_GENOTYPE].append(parent_y[i])
# mask == 1, px[i] -> idv2[i], py[i] -> idv1[i]
else:
new_indv1[INDV_GENOTYPE].append(parent_y[i])
new_indv2[INDV_GENOTYPE].append(parent_x[i])
else:
new_indv1[INDV_GENOTYPE] = parent_x
new_indv2[INDV_GENOTYPE] = parent_y
return new_indv1, new_indv2
def initial_population(p1_best, size_population=100, rate_mutation=0.05):
# transform locus-based encode to straightforward encode
com_index = 1
new_indv = {}
new_indv[INDV_GENOTYPE] = [0] * INDV_LENGTH
for com in sorted(p1_best[INDV_PHENOTYPE]):
for g in com:
new_indv[INDV_GENOTYPE][NODE_TO_GENE[g]] = c.copy(com_index)
com_index += 1
# initial population
indv_pool = [c.deepcopy(new_indv)]
for i in range(1, size_population):
tmp_indv = c.deepcopy(new_indv)
for j in range(0, INDV_LENGTH):
if r.random() <= rate_mutation:
tmp_indv[INDV_GENOTYPE][j] = r.randint(1, NUMBER_COMMUNITY)
else:
pass
indv_pool.append(tmp_indv)
return indv_pool
# ###
# modularity function
# ###
def modularity(G, community_list):
# check empty
if len(community_list) != NUMBER_COMMUNITY:
return 0
# ls, ds variables
intra_degree = {i: 0 for i in range(0, len(community_list))} # ds
intra_edges = {i: 0 for i in range(0, len(community_list))} # ls
# calculate ds, time complexity: O(V)
community_index = 0
community_id = {}
for com in community_list:
tmp_index = c.copy(community_index)
for i in com:
intra_degree[tmp_index] += G.node[i][NODE_DEGREE]
community_id[i] = tmp_index
community_index += 1
# calculate ls, time complexity: O(E)
for (ei, ej) in G.edges():
if community_id[ei] == community_id[ej]:
intra_edges[community_id[ei]] += 1
else:
pass
# calculate modularity Q, time complexity: O(C)
modularity = 0
num_edges = G.number_of_edges()
for i in range(0, len(community_list)):
ls = intra_edges[i] / num_edges
ds = pow((intra_degree[i] / (2 * num_edges)), 2)
modularity += (ls - ds)
return modularity
# ###
# genetic operatin function
# ###
def selection(indv_pool, size_population=100, rate_selection=0.1):
# truncate selection
cut_index = int(rate_selection * size_population)
indv_pool = indv_pool[0:cut_index]
return indv_pool
def crossover(indv_pool, size_population=100, rate_crossover=0.8):
pool_size = len(indv_pool)
empty_size = size_population - len(indv_pool)
new_pool = c.deepcopy(indv_pool)
if (empty_size % 2) == 0:
for i in range(pool_size, size_population, 2):
new_indv1, new_indv2 = generate_two_individuals(indv_pool, rate_crossover)
new_pool.append(new_indv1)
new_pool.append(new_indv2)
else:
for i in range(pool_size, size_population - 1, 2):
new_indv1, new_indv2 = generate_two_individuals(indv_pool, rate_crossover)
new_pool.append(new_indv1)
new_pool.append(new_indv2)
new_pool.append(generate_two_individuals(indv_pool, rate_crossover)[r.randint(0, 1)])
return new_pool
def mutation(indv_pool, size_population=100, rate_mutation=0.05):
# bit-by-bit mutation based on distribution of neighbors' community_id
for i in range(0, size_population):
indv = indv_pool[i][INDV_GENOTYPE]
for j in range(0, INDV_LENGTH):
if r.random() <= rate_mutation:
node_id = GENE_TO_NODE[j]
indv[j] = r.choice([indv[NODE_TO_GENE[nb]] for nb in NEIGHBOR_LIST[node_id]])
else:
pass
return indv_pool
# ###
# major function
# ###
def evaluation(G, indv_pool, size_population=100):
for i in range(0, size_population):
indv = indv_pool[i]
indv[INDV_PHENOTYPE] = generate_phenotype(indv)
indv[INDV_FITNESS] = modularity(G, indv[INDV_PHENOTYPE])
indv_pool = sorted(indv_pool, key=lambda x: x[INDV_FITNESS], reverse=True)
return indv_pool
def standard_genetic_algorithm(G, p1_best, num_generation=100, size_population=100, rate_selection=0.1, rate_crossover=0.5, rate_mutation=0.05, show_progress=False):
if show_progress:
show_msg(' ----- Phase 2: maximize modularity')
else:
pass
# initial variables
fitness_avg = []
fitness_best = []
G = initialization(G, p1_best)
# initial individual pool by p1_best
indv_pool = initial_population(p1_best, size_population, rate_mutation)
# genetic operation
indv_best = {}
for j in range(0, num_generation):
# show_progress: generateion number
if show_progress:
if j is 0:
show_msg(' ------ Generation {0}'.format(j+1))
elif ((j + 1) % 10) is 0:
show_msg(' ------ Generation {0}'.format(j+1))
else:
pass
else:
pass
# evuluate individuals
indv_pool = evaluation(G, indv_pool, size_population)
# maintain indv_best
if not indv_best:
indv_best = c.deepcopy(indv_pool[0])
elif indv_pool[0][INDV_FITNESS] > indv_best[INDV_FITNESS]:
indv_best = c.deepcopy(indv_pool[0])
else:
pass
# record fitness_avg and fitness_best
fitness_avg.append(np.mean([indv[INDV_FITNESS] for indv in indv_pool]))
fitness_best.append(indv_best[INDV_FITNESS])
# stop condition
if (j + 1) == num_generation:
break
else:
pass
# genetic operation: selection, crossover and mutation
indv_pool = selection(indv_pool, size_population, rate_selection)
indv_pool = crossover(indv_pool, size_population, rate_crossover)
indv_pool = mutation(indv_pool, size_population, rate_mutation)
return [indv_best, fitness_avg, fitness_best]
| 30.268852 | 166 | 0.613843 |
aceb12aadb3e045604aea503196bf6d35391b848 | 2,433 | py | Python | log_casp_act/run_model_725.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_act/run_model_725.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_act/run_model_725.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null |
import numpy as np
from math import *
import pymultinest
import sys
sys.path.insert(0, '/home/kochenma/pysb')
from pysb.integrate import Solver
import csv
import datetime
import time as tm
from model_725 import model
from pysb.pathfinder import set_path
set_path('bng', '/home/kochenma/BioNetGen')
data_object = []
with open('earm_data.csv') as data_file:
reader = csv.reader(data_file)
line = list(reader)
for each in line:
data_object.append(each)
for i, each in enumerate(data_object):
if i > 0:
for j, item in enumerate(each):
data_object[i][j] = float(data_object[i][j])
data_object = data_object[1:]
time = []
for each in data_object:
time.append(float(each[0]))
model_solver = Solver(model, time, integrator='vode', integrator_options={'atol': 1e-12, 'rtol': 1e-12})
def prior(cube, ndim, nparams):
for k, every in enumerate(model.parameters):
if every.name[-3:] == '1kf':
cube[k] = cube[k]*4 - 4
if every.name[-3:] == '2kf':
cube[k] = cube[k]*4 - 8
if every.name[-3:] == '1kr':
cube[k] = cube[k]*4 - 4
if every.name[-3:] == '1kc':
cube[k] = cube[k]*4 - 1
postfixes = ['1kf', '2kf', '1kr', '1kc']
def loglike(cube, ndim, nparams):
point = []
cube_index = 0
for k, every in enumerate(model.parameters):
if every.name[-3:] in postfixes:
point.append(10**cube[cube_index])
cube_index += 1
else:
point.append(model.parameters[k].value)
model_solver.run(point)
failed = False
for every in model_solver.yobs:
for thing in every:
if thing <= -0.00000001 or np.isnan(thing):
failed = True
if failed:
return ['fail', -10000.0]
else:
parpc = model_solver.yobs[-1][6]/(model_solver.yobs[-1][1] + model_solver.yobs[-1][6])
if (parpc > 0.0) and (parpc < 1.00000001):
print log(parpc), point
return ['sim', log(parpc)]
else:
return ['fail', -10000.0]
n_params = 0
for m, lotsa in enumerate(model.parameters):
if lotsa.name[-3:] == '1kf':
n_params += 1
if lotsa.name[-3:] == '2kf':
n_params += 1
if lotsa.name[-3:] == '1kr':
n_params += 1
if lotsa.name[-3:] == '1kc':
n_params += 1
start_time = tm.clock()
counts = [0, 0]
pymultinest.run(loglike, prior, n_params, evidence_tolerance=0.0001, n_live_points=16000, log_zero=-1e3, sampling_efficiency=0.3, outputfiles_basename='/scratch/kochenma/log_casp_act/725/', resume = False, verbose = False, counts=counts)
print counts
print 'start time', start_time
print 'end time', tm.clock() | 25.610526 | 237 | 0.671599 |
aceb13b9d6e8ea4ea1abffa1169e28e8b2c822eb | 981 | py | Python | fixture/application.py | girgusp/python_training | da97e97a2d0872a0dc4673e35097e007d00265b4 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | girgusp/python_training | da97e97a2d0872a0dc4673e35097e007d00265b4 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | girgusp/python_training | da97e97a2d0872a0dc4673e35097e007d00265b4 | [
"Apache-2.0"
] | null | null | null | from selenium import WebDriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = WebDriver.Firefox
elif browser == "chrome":
self.wd = WebDriver.Chrome
elif browser == "ie":
self.wd = WebDriver.Ie
else:
raise ValueError("Unrecognized browser %s" % browser)
self.session = SessionHelper(self)
self.group = GroupHelper(self)
self.contact = ContactHelper(self)
self.base_url = base_url
def is_valid(self):
try:
self.wd.current_url
return True
except:
return False
def open_home_page(self):
wd = self.wd
wd.get(self.base_url)
def destroy(self):
self.wd.quit()
| 25.815789 | 69 | 0.574924 |
aceb13c0a2d923a332660ebc95c58b7a80fb7cc4 | 12,953 | py | Python | torchdynamo/optimizations/normalize.py | yf225/torchdynamo | a460bde3e6bc14d4872230982ae8755e6ff54400 | [
"BSD-3-Clause"
] | null | null | null | torchdynamo/optimizations/normalize.py | yf225/torchdynamo | a460bde3e6bc14d4872230982ae8755e6ff54400 | [
"BSD-3-Clause"
] | null | null | null | torchdynamo/optimizations/normalize.py | yf225/torchdynamo | a460bde3e6bc14d4872230982ae8755e6ff54400 | [
"BSD-3-Clause"
] | null | null | null | import builtins
import dataclasses
import functools
import itertools
import logging
import math
import operator
import torch
from torch.fx import Transformer
from torch.fx.experimental.normalize import NormalizeOperators
from torch.fx.operator_schemas import get_signature_for_torch_op
from torchdynamo import config
from torchdynamo.allowed_functions import _allowed_function_ids
from torchdynamo.utils import clone_inputs
from torchdynamo.utils import counters
from .analysis import ShapeAliasingAndMutationProp
log = logging.getLogger(__name__)
VIEW_OPS = {
# list taken from https://pytorch.org/docs/stable/tensor_view.html
"getitem",
"as_strided",
"detach",
"diagonal",
"expand",
"expand_as",
"movedim",
"narrow",
"permute",
"select",
"squeeze",
"transpose",
"t",
"T",
"real",
"imag",
"view_as_real",
"view_as_imag",
"unflatten",
"unfold",
"unsqueeze",
"view",
"view_as",
"unbind",
"split",
"split_with_sizes",
"swapaxes",
"swapdims",
"chunk",
"indices",
"values",
}
MAYBE_VIEW_OPS = {"contiguous", "reshape"}
# convert x.foo(...) to torch.foo(x, ...)
NORMALIZE_METHODS = {
# These ones aren't normalized:
# ('view', 342)
# ('reshape', 285)
# ('expand', 87)
# ('permute', 78)
# ('to', 66)
# ('contiguous', 62)
# ('reshape_as', 57)
# ('masked_fill', 30)
# ('float', 22) -- could rewrite
# ('expand_as', 14) -- could rewrite
# ('detach', 4)
# ('repeat', 2)
# TODO(jansel): debug why this causes issues in detectron2_maskrcnn
# "div": torch.div,
"add_": operator.iadd,
"all": torch.all,
"any": torch.any,
"ceil": torch.ceil,
"chunk": torch.chunk,
"clamp": torch.clamp,
"clone": torch.clone,
"exp": torch.exp,
"flatten": torch.flatten,
"flip": torch.flip,
"floor": torch.floor,
"index_select": torch.index_select,
"log2": torch.log2,
"log_softmax": torch.nn.functional.log_softmax,
"max": torch.max,
"mean": torch.mean,
"min": torch.min,
"mul_": operator.imul,
"narrow": torch.narrow,
"ne": torch.ne,
"nonzero": torch.nonzero,
"numel": torch.numel,
"pow": torch.pow,
"round": torch.round,
"rsqrt": torch.rsqrt,
"sigmoid": torch.sigmoid,
"softmax": torch.nn.functional.softmax,
"sort": torch.sort,
"split": torch.split,
"squeeze": torch.squeeze,
"std": torch.std,
"sum": torch.sum,
"topk": torch.topk,
"transpose": torch.transpose,
"tril": torch.tril,
"t": torch.t,
"unbind": torch.unbind,
"unsqueeze": torch.unsqueeze,
}
DONT_EXPAND_MODULES = {
# These have internal control flow
"ConvTranspose1d",
"ConvTranspose2d",
"Conv2d",
"ConvReLU2d",
"ConvBn2d",
"ConvBnReLU2d",
"EmbeddingBag",
"InstanceNorm2d",
"LSTM",
}
F = torch.nn.functional
INPLACE_KEYWORD_OPS = {
F.mish,
F.silu,
F.hardsigmoid,
F.rrelu,
F.leaky_relu,
F.celu,
F.selu,
F.elu,
F.relu6,
F.hardswish,
F.hardtanh,
F.relu,
F.threshold,
}
IOPERATOR_REPLACEMENTS = {
torch.relu_: torch.relu,
torch.sigmoid_: torch.sigmoid,
operator.iadd: torch.add,
operator.iand: torch.bitwise_and,
operator.ifloordiv: functools.partial(torch.div, rounding_mode="floor"),
operator.itruediv: torch.div,
operator.imul: torch.mul,
operator.imatmul: torch.matmul,
operator.ior: torch.bitwise_or,
operator.ipow: torch.pow,
operator.isub: torch.sub,
operator.ixor: torch.bitwise_xor,
}
OPERATOR_REPLACEMENTS = {
operator.lt: torch.lt,
operator.le: torch.le,
operator.eq: torch.eq,
operator.ne: torch.ne,
operator.ge: torch.ge,
operator.gt: torch.gt,
operator.abs: torch.abs,
operator.add: torch.add,
operator.and_: torch.bitwise_and,
operator.floordiv: functools.partial(torch.div, rounding_mode="floor"),
# operator.truediv: torch.div, # TODO(jansel): debug issue in vision_maskrcnn
operator.inv: torch.bitwise_not,
operator.invert: torch.bitwise_not,
operator.mod: torch.remainder,
operator.mul: torch.mul,
operator.matmul: torch.matmul,
operator.neg: torch.neg,
operator.or_: torch.bitwise_or,
operator.pos: torch.positive,
operator.pow: torch.pow,
operator.sub: torch.sub,
operator.xor: torch.bitwise_xor,
torch.nn.functional.sigmoid: torch.sigmoid,
torch.nn.functional.tanh: torch.tanh,
torch.nn.functional.relu: torch.relu,
}
SKIP_INPLACE = {
v
for v in itertools.chain(
math.__dict__.values(), builtins.__dict__.values(), operator.__dict__.values()
)
if callable(v)
}
def always_true(*args, **kwargs):
return True
class InliningTracer(torch.fx.Tracer):
def is_leaf_module(self, m: torch.nn.Module, module_qualified_name: str) -> bool:
return False
def expand_module_call(prefix, graph: torch.fx.Graph, module, args, kwargs):
# this patch is needed to make BatchNorm2D FX trace
module.__dict__["_check_input_dim"] = always_true
try:
assert not kwargs
arg_index = itertools.count()
vars = dict()
for node in InliningTracer().trace(module).nodes:
if node.op == "placeholder":
vars[node] = args[next(arg_index)]
elif node.op == "output":
assert len(node.args) == 1
return vars[node.args[0]]
elif node.op == "get_attr":
vars[node] = graph.get_attr(f"{prefix}{node.target}")
else:
vars[node] = graph.node_copy(node, vars.__getitem__)
assert False
except Exception:
print(f"Error while expanding {module.__class__.__name__}")
raise
finally:
del module.__dict__["_check_input_dim"]
@dataclasses.dataclass
class NodeCounts:
usages: int = 0
def short_name(gm, node: torch.fx.Node):
if node.op == "call_function":
return node.target.__name__
elif node.op == "call_method":
return node.target
elif node.op == "call_module":
return gm.get_submodule(node.target).__class__.__name__
elif node.op == "get_attr":
return node.target
elif node.op == "output":
return "output"
assert False, node.op
def long_name(gm, node: torch.fx.Node):
name = short_name(gm, node)
target = node.target
if node.op == "call_function":
try:
return _allowed_function_ids()[id(node.target)]
except KeyError:
return f"{getattr(target, '__module__', '')}.{name}"
elif node.op == "call_method":
return name
elif node.op == "call_module":
target = gm.get_submodule(target).__class__
return f"{getattr(target, '__module__', '')}.{getattr(target, '__name__', '')}"
elif node.op == "get_attr":
return name
elif node.op == "output":
return "output"
assert False
class Inplacifier:
def __init__(self, gm: torch.fx.GraphModule):
self.gm = gm
def can_be_view(self, node):
name = short_name(self.gm, node)
return name in VIEW_OPS or name in MAYBE_VIEW_OPS
def inplacify(self):
counts = dict()
def record_usage(node):
counts[node].usages += 1
return node
for node in self.gm.graph.nodes:
if node.op in ("call_function", "call_method", "call_module"):
if self.can_be_view(node):
# Aliasing
counts[node] = counts[node.args[0]]
elif "out" in node.kwargs:
counts[node] = counts[node.kwargs["out"]]
else:
counts[node] = NodeCounts(0)
else:
counts[node] = NodeCounts(float("inf"))
for node in reversed(list(self.gm.graph.nodes)):
kwargs = dict(node.kwargs)
if "inplace" in kwargs:
kwargs.pop("inplace")
if node.op == "call_function" and len(node.args) + len(kwargs) == 1:
arg = node.args[0] if node.args else next(kwargs.values())
if isinstance(arg, torch.fx.Node) and counts[arg].usages == 0:
if node.target in SKIP_INPLACE:
continue
elif node.target in INPLACE_KEYWORD_OPS:
kwargs["inplace"] = True
counters["optimizations"]["inplace"] += 1
elif " out: torch.Tensor" in repr(
get_signature_for_torch_op(node.target)
):
kwargs["out"] = arg
counters["optimizations"]["out"] += 1
else:
continue
with self.gm.graph.inserting_before(node):
node.replace_all_uses_with(
self.gm.graph.call_function(node.target, node.args, kwargs)
)
self.gm.graph.erase_node(node)
torch.fx.map_arg((node.args, node.kwargs), record_usage)
class Functionalization(Transformer):
"""
Remove most cases of mutation from a given fx Graph.
"""
def __init__(self, *args, **kwargs):
super(Functionalization, self).__init__(*args, **kwargs)
self.tracer.tensor_attrs = dict() # TODO(jansel): upstream this fix
def run_node(self, n: torch.fx.Node):
patches = []
target = n.target
args, kwargs = self.fetch_args_kwargs_from_env(n)
kwargs = dict(kwargs)
if (
not n.meta["is_input_mutation"]
and not n.meta["partial_mutation"]
and issubclass(n.meta["type"], torch.Tensor)
):
if "inplace" in n.kwargs:
if kwargs["inplace"]:
patches.append(n.args[0])
kwargs.pop("inplace")
elif "out" in n.kwargs:
kwargs.pop("out")
patches.append(n.kwargs["out"])
elif n.target in IOPERATOR_REPLACEMENTS:
target = IOPERATOR_REPLACEMENTS[n.target]
patches.append(n.args[0])
elif n.meta["is_mutation"]:
counters["mutation"][long_name(self.module, n)] += 1
if target in OPERATOR_REPLACEMENTS and not kwargs:
target = OPERATOR_REPLACEMENTS[target]
if target is builtins.getattr:
if args[1] == "dtype":
return n.args[0].meta["dtype"]
elif args[1] == "device":
return n.args[0].meta["device"]
else:
counters["getattr"][args[1]] += 1
if isinstance(target, functools.partial):
assert not target.args
kwargs.update(target.keywords)
target = target.func
if not issubclass(n.meta["type"], torch.Tensor):
counters["nontensor"][long_name(self.module, n)] += 1
result = getattr(self, n.op)(target, args, kwargs)
for patch in patches:
assert isinstance(
patch, torch.fx.Node
), f"{patch} {n.target} {n.args} {n.kwargs}"
if patch in self.env:
self.env[patch] = result
return result
def swap_node(graph, old_node, new_node):
old_node.replace_all_uses_with(new_node)
graph.erase_node(old_node)
def normalize(gm: torch.fx.GraphModule):
# gm.graph.print_tabular()
graph: torch.fx.Graph = gm.graph
for node in list(graph.nodes):
with graph.inserting_before(node):
if node.op == "call_method" and node.target in NORMALIZE_METHODS:
swap_node(
graph,
node,
graph.call_function(
NORMALIZE_METHODS[node.target], node.args, node.kwargs
),
)
elif node.op == "call_module":
submod = gm.get_submodule(node.target)
if submod.__class__.__name__ not in DONT_EXPAND_MODULES:
swap_node(
graph,
node,
expand_module_call(
f"{node.target}.", graph, submod, node.args, node.kwargs
),
)
# gm.graph.print_tabular()
def normalize_ir(gm, example_inputs):
if config.normalize_ir:
example_inputs = clone_inputs(example_inputs)
normalize(gm)
try:
gm = NormalizeOperators(gm).transform()
except AttributeError:
# log.exception("NormalizeOperators() failed")
pass
ShapeAliasingAndMutationProp(gm).run(*example_inputs)
gm = Functionalization(gm).transform()
gm.recompile()
# record_graph_stats(gm)
return gm
| 29.777011 | 87 | 0.579943 |
aceb1463043d517b33d0a4246473f995b2c6ede0 | 5,819 | py | Python | src/ebay_rest/api/sell_marketing/models/bulk_delete_ads_by_inventory_reference_response.py | matecsaj/ebay_rest | dd23236f39e05636eff222f99df1e3699ce47d4a | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/sell_marketing/models/bulk_delete_ads_by_inventory_reference_response.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/sell_marketing/models/bulk_delete_ads_by_inventory_reference_response.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # coding: utf-8
"""
Marketing API
<p>The <i>Marketing API </i> offers two platforms that sellers can use to promote and advertise their products:</p> <ul><li><b>Promoted Listings</b> is an eBay ad service that lets sellers set up <i>ad campaigns </i> for the products they want to promote. eBay displays the ads in search results and in other marketing modules as <b>SPONSORED</b> listings. If an item in a Promoted Listings campaign sells, the seller is assessed a Promoted Listings fee, which is a seller-specified percentage applied to the sales price. For complete details, see <a href=\"/api-docs/sell/static/marketing/promoted-listings.html\">Promoted Listings</a>.</li> <li><b>Promotions Manager</b> gives sellers a way to offer discounts on specific items as a way to attract buyers to their inventory. Sellers can set up discounts (such as \"20% off\" and other types of offers) on specific items or on an entire customer order. To further attract buyers, eBay prominently displays promotion <i>teasers</i> throughout buyer flows. For complete details, see <a href=\"/api-docs/sell/static/marketing/promotions-manager.html\">Promotions Manager</a>.</li></ul> <p><b>Marketing reports</b>, on both the Promoted Listings and Promotions Manager platforms, give sellers information that shows the effectiveness of their marketing strategies. The data gives sellers the ability to review and fine tune their marketing efforts.</p> <p class=\"tablenote\"><b>Important!</b> Sellers must have an active eBay Store subscription, and they must accept the <b>Terms and Conditions</b> before they can make requests to these APIs in the Production environment. There are also site-specific listings requirements and restrictions associated with these marketing tools, as listed in the \"requirements and restrictions\" sections for <a href=\"/api-docs/sell/marketing/static/overview.html#PL-requirements\">Promoted Listings</a> and <a href=\"/api-docs/sell/marketing/static/overview.html#PM-requirements\">Promotions Manager</a>.</p> <p>The table below lists all the Marketing API calls grouped by resource.</p> # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class BulkDeleteAdsByInventoryReferenceResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'responses': 'list[DeleteAdsByInventoryReferenceResponse]'
}
attribute_map = {
'responses': 'responses'
}
def __init__(self, responses=None): # noqa: E501
"""BulkDeleteAdsByInventoryReferenceResponse - a model defined in Swagger""" # noqa: E501
self._responses = None
self.discriminator = None
if responses is not None:
self.responses = responses
@property
def responses(self):
"""Gets the responses of this BulkDeleteAdsByInventoryReferenceResponse. # noqa: E501
An array of the ads that were deleted by the <b>bulkDeleteAdsByInventoryReference</b> request, including information associated with each individual delete request. # noqa: E501
:return: The responses of this BulkDeleteAdsByInventoryReferenceResponse. # noqa: E501
:rtype: list[DeleteAdsByInventoryReferenceResponse]
"""
return self._responses
@responses.setter
def responses(self, responses):
"""Sets the responses of this BulkDeleteAdsByInventoryReferenceResponse.
An array of the ads that were deleted by the <b>bulkDeleteAdsByInventoryReference</b> request, including information associated with each individual delete request. # noqa: E501
:param responses: The responses of this BulkDeleteAdsByInventoryReferenceResponse. # noqa: E501
:type: list[DeleteAdsByInventoryReferenceResponse]
"""
self._responses = responses
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(BulkDeleteAdsByInventoryReferenceResponse, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, BulkDeleteAdsByInventoryReferenceResponse):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| 51.495575 | 2,092 | 0.674171 |
aceb14fe7952e6c80ca14e737dd199f7c8b29981 | 2,910 | py | Python | hive/indexer/mock_vops_provider.py | ravau/hivemind | efd47abf64ede8b3920c3e87f4acabb46a060c6d | [
"MIT"
] | 1 | 2021-08-28T21:16:52.000Z | 2021-08-28T21:16:52.000Z | hive/indexer/mock_vops_provider.py | ravau/hivemind | efd47abf64ede8b3920c3e87f4acabb46a060c6d | [
"MIT"
] | null | null | null | hive/indexer/mock_vops_provider.py | ravau/hivemind | efd47abf64ede8b3920c3e87f4acabb46a060c6d | [
"MIT"
] | null | null | null | """ Data provider for test vops """
from hive.indexer.mock_data_provider import MockDataProvider
class MockVopsProvider(MockDataProvider):
""" Data provider for test vops """
block_data = {
'ops' : {},
'ops_by_block' : {}
}
@classmethod
def add_block_data_from_file(cls, file_name):
from json import load
data = {}
with open(file_name, "r") as src:
data = load(src)
cls.add_block_data(data)
@classmethod
def add_block_data(cls, data):
if 'ops' in data:
for op in data['ops']:
if 'ops' in cls.block_data and op['block'] in cls.block_data['ops']:
cls.block_data['ops'][op['block']].append(op)
else:
cls.block_data['ops'][op['block']] = [op]
if 'ops_by_block' in data:
for ops in data['ops_by_block']:
if 'ops_by_block' in cls.block_data and ops['block'] in cls.block_data['ops_by_block']:
cls.block_data['ops_by_block'][ops['block']].extend(ops['ops'])
else:
cls.block_data['ops_by_block'][ops['block']] = ops
@classmethod
def get_block_data(cls, block_num):
ret = {}
if 'ops' in cls.block_data and block_num in cls.block_data['ops']:
data = cls.block_data['ops'][block_num]
if data:
if 'ops' in ret:
ret['ops'].extend([op['op'] for op in data])
else:
ret['ops'] = [op['op'] for op in data]
if 'ops_by_block' in cls.block_data and block_num in cls.block_data['ops_by_block']:
data = cls.block_data['ops_by_block'][block_num]
if data:
if 'ops_by_block' in ret:
ret['ops_by_block'].extend([ops['op'] for ops in data['ops']])
else:
ret['ops_by_block'] = [ops['op'] for ops in data['ops']]
return ret
@classmethod
def add_mock_vops(cls, ret, from_block, end_block):
# dont do anyting when there is no block data
if not cls.block_data['ops_by_block'] and not cls.block_data['ops']:
return
for block_num in range(from_block, end_block):
mock_vops = cls.get_block_data(block_num)
if mock_vops:
if block_num in ret:
if 'ops_by_block' in mock_vops:
ret[block_num]['ops'].extend(mock_vops['ops_by_block'])
if 'ops' in mock_vops:
ret[block_num]['ops'].extend(mock_vops['ops'])
else:
if 'ops' in mock_vops:
ret[block_num] = {"ops" : mock_vops['ops']}
if 'ops_by_block' in mock_vops:
ret[block_num] = {"ops" : mock_vops['ops_by_block']}
| 39.324324 | 103 | 0.526804 |
aceb1510e7c7240e7a78200052fe4680fd528a40 | 1,585 | py | Python | script/model/many_to_one.py | XiaoYang1127/sqlalchemy-in-python | 7553b4e1ed0cb27f685aa4dc00a000c2f502ef46 | [
"Apache-2.0"
] | 1 | 2020-09-21T06:03:56.000Z | 2020-09-21T06:03:56.000Z | script/model/many_to_one.py | XiaoYang1127/sqlalchemy-in-python | 7553b4e1ed0cb27f685aa4dc00a000c2f502ef46 | [
"Apache-2.0"
] | null | null | null | script/model/many_to_one.py | XiaoYang1127/sqlalchemy-in-python | 7553b4e1ed0cb27f685aa4dc00a000c2f502ef46 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import Column, Integer, String
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship
from model import Base
class CMTOCompany(Base):
__tablename__ = "many_to_one_company"
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(50))
location = Column(String(255))
# 设置外键的时候,使用的是表名和表列
phone_id = Column(Integer, ForeignKey("many_to_one_phone.id"))
# 设置关联属性,使用的时候类名和属性名
# relationship 函数在 ORM 中用于构建表之间的关联关系。
# 与 ForeignKey 不同的是,它定义的关系不属于表定义,而是动态计算的。
rs_phone = relationship("CMTOPhone", backref="rs_company")
def __repr__(self):
return f"<{self.id}.{self.name}> in {self.__tablename__}"
def save(self):
to_save = {
"id": self.id,
"name": self.name,
"location": self.location,
}
return to_save
def load(self, data):
if not data:
return
self.id = data["id"]
self.name = data["name"]
self.location = data["location"]
class CMTOPhone(Base):
__tablename__ = 'many_to_one_phone'
id = Column(Integer, primary_key=True, autoincrement=True)
name = Column(String(50))
price = Column(Integer)
def __repr__(self):
return f"<{self.id}.{self.name}> in {self.__tablename__}"
def save(self):
to_save = {
"id": self.id,
"name": self.name,
}
return to_save
def load(self, data):
if not data:
return
self.id = data["id"]
self.name = data["name"]
| 24.015152 | 66 | 0.605678 |
aceb156d2c84acf4836c7d152fb761db32d59169 | 7,742 | py | Python | src/infra/PerfectForecastZoning.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | 19 | 2021-12-11T17:17:00.000Z | 2022-03-24T07:27:06.000Z | src/infra/PerfectForecastZoning.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | null | null | null | src/infra/PerfectForecastZoning.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | 1 | 2021-12-21T11:20:39.000Z | 2021-12-21T11:20:39.000Z | # -------------------------------------------------------------------------------------------------------------------- #
# standard distribution imports
# -----------------------------
import os
import logging
# additional module imports (> requirements)
# ------------------------------------------
import pandas as pd
import numpy as np
# src imports
# -----------
from src.infra.Zoning import ZoneSystem
# -------------------------------------------------------------------------------------------------------------------- #
# global variables
# ----------------
from src.misc.globals import *
#from src.fleetctrl.FleetControlBase import PlanRequest # TODO # circular dependency!
# set log level to logging.DEBUG or logging.INFO for single simulations
LOG_LEVEL = logging.WARNING
LOG = logging.getLogger(__name__)
class PerfectForecastZoneSystem(ZoneSystem):
# this class can be used like the "basic" ZoneSystem class
# but instead of getting values from a demand forecast dabase, this class has direct access to the demand file
# and therefore makes perfect predictions for the corresponding forecast querries
def __init__(self, zone_network_dir, scenario_parameters, dir_names):
tmp_scenario_parameters = scenario_parameters.copy()
if scenario_parameters[G_FC_FNAME] is not None:
LOG.warning("forecast file for perfact forecast given. will not be loaded!")
del tmp_scenario_parameters[G_FC_FNAME]
super().__init__(zone_network_dir, tmp_scenario_parameters, dir_names)
def _get_trip_forecasts(self, trip_type, t0, t1, aggregation_level):
"""This method returns the number of expected trip arrivals or departures inside a zone in the
time interval [t0, t1]. The return value is created by interpolation of the forecasts in the data frame
if necessary. The default if no values can be found for a zone should be 0.
:param t0: start of forecast time horizon
:type t0: float
:param t1: end of forecast time horizon
:type t1: float
:param aggregation_level: spatial aggregation level, by default zone_id is used
:type aggregation_level: int
:return: {}: zone -> forecast of arrivals
:rtype: dict
"""
if trip_type == "in":
incoming = True
elif trip_type == "out":
incoming = False
else:
raise AssertionError("Invalid forecast column chosen!")
#
if aggregation_level is not None:
raise NotImplementedError("aggregation level for perfect forecast not implemented")
#
return_dict = {}
if not incoming:
for t in range(t0, t1):
future_rqs = self.demand.future_requests.get(t, {})
for rq in future_rqs.values():
o_zone = self.get_zone_from_node(rq.o_node)
if o_zone >= 0:
try:
return_dict[o_zone] += 1
except:
return_dict[o_zone] = 1
else:
for t in range(t0, t1):
future_rqs = self.demand.future_requests.get(t, {})
for rq in future_rqs.values():
d_zone = self.get_zone_from_node(rq.d_node)
if d_zone >= 0:
try:
return_dict[d_zone] += 1
except:
return_dict[d_zone] = 1
return return_dict
def get_trip_arrival_forecasts(self, t0, t1, aggregation_level=None):
"""This method returns the number of expected trip arrivals inside a zone in the time interval [t0, t1].
The return value is created by interpolation of the forecasts in the data frame if necessary.
The default if no values can be found for a zone should be 0.
:param t0: start of forecast time horizon
:type t0: float
:param t1: end of forecast time horizon
:type t1: float
:param aggregation_level: spatial aggregation level, by default zone_id is used
:type aggregation_level: int
:return: {}: zone -> forecast of arrivals
:rtype: dict
"""
if self.in_fc_type is None:
raise AssertionError("get_trip_arrival_forecasts() called even though no forecasts are available!")
return self._get_trip_forecasts("in", t0, t1, aggregation_level)
def get_trip_departure_forecasts(self, t0, t1, aggregation_level=None):
"""This method returns the number of expected trip departures inside a zone in the time interval [t0, t1].
:param t0: start of forecast time horizon
:type t0: float
:param t1: end of forecast time horizon
:type t1: float
:param aggregation_level: spatial aggregation level, by default zone_id is used
:type aggregation_level: int
:return: {}: zone -> forecast of departures
:rtype: dict
"""
if self.out_fc_type is None:
raise AssertionError("get_trip_departure_forecasts() called even though no forecasts are available!")
return self._get_trip_forecasts("out", t0, t1, aggregation_level)
def draw_future_request_sample(self, t0, t1, request_attribute = None, attribute_value = None, scale = None): #request_type=PlanRequest # TODO # cant import PlanRequest because of circular dependency of files!
""" this function returns exact future request attributes [t0, t1]
currently origin is drawn from get_trip_departure_forecasts an destination is drawn form get_trip_arrival_forecast (independently! # TODO #)
:param t0: start of forecast time horizon
:type t0: float
:param t1: end of forecast time horizon
:type t1: float
:param request_attribute: name of the attribute of the request class. if given, only returns requests with this attribute
:type request_attribute: str
:param attribute_value: if and request_attribute given: only returns future requests with this attribute value
:type attribute_value: type(request_attribute)
:param scale: (not for this class) scales forecast distribution by this values
:type scale: float
:return: list of (time, origin_node, destination_node) of future requests
:rtype: list of 3-tuples
"""
future_list = []
if request_attribute is None and attribute_value is None:
for t in range(int(np.math.floor(t0)), int(np.math.ceil(t1))):
future_rqs = self.demand.future_requests.get(t, {})
for rq in future_rqs.values():
future_list.append( (t, rq.o_node, rq.d_node) )
elif request_attribute is not None:
if attribute_value is None:
for t in range(int(np.math.floor(t0)), int(np.math.ceil(t1))):
future_rqs = self.demand.future_requests.get(t, {})
for rq in future_rqs.values():
if rq.__dict__.get(request_attribute) is not None:
future_list.append( (t, rq.o_node, rq.d_node) )
else:
for t in range(int(np.math.floor(t0)), int(np.math.ceil(t1))):
future_rqs = self.demand.future_requests.get(t, {})
for rq in future_rqs.values():
if rq.__dict__.get(request_attribute) is not None and rq.__dict__.get(request_attribute) == attribute_value:
future_list.append( (t, rq.o_node, rq.d_node) )
LOG.info("perfect forecast list: {}".format(future_list))
return future_list | 50.272727 | 213 | 0.607466 |
aceb1619f51ce18477d639e76dc640d650c34052 | 2,372 | py | Python | tests/service/test_gateway_application_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 25 | 2018-03-04T07:49:21.000Z | 2022-03-28T05:20:50.000Z | tests/service/test_gateway_application_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 22 | 2018-03-25T13:19:45.000Z | 2020-11-28T17:21:08.000Z | tests/service/test_gateway_application_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 31 | 2018-03-25T09:45:13.000Z | 2022-03-24T05:32:18.000Z | from unittest import TestCase
from unittest.mock import MagicMock, patch, ANY
from waves_gateway.service import GatewayApplicationService
class TestGatewayApplicationService(TestCase):
def setUp(self):
self._validation_service = MagicMock()
self._logger = MagicMock()
self._coin_transaction_polling_service = MagicMock()
self._waves_transaction_polling_service = MagicMock()
self._num_attempt_list_workers = 3
self._attempt_list_service = MagicMock()
self._attempt_list_selector = MagicMock()
self._polling_delay_config = MagicMock()
self._flask = MagicMock()
self._host = 'test_host'
self._port = 23512
self._application = GatewayApplicationService(
validation_service=self._validation_service,
logger=self._logger,
coin_transaction_polling_service=self._coin_transaction_polling_service,
waves_transaction_polling_service=self._waves_transaction_polling_service,
num_attempt_list_workers=self._num_attempt_list_workers,
attempt_list_service=self._attempt_list_service,
attempt_list_selector=self._attempt_list_selector,
polling_delay_config=self._polling_delay_config,
flask=self._flask,
host=self._host,
port=self._port)
@patch('gevent.pywsgi.WSGIServer', autospec=True)
@patch('gevent.pool.Group', autospec=True)
@patch('gevent.signal', autospec=True)
def test_run(self, signal: MagicMock, group_clazz: MagicMock, wsgi_server_clazz: MagicMock):
group_instance = MagicMock()
group_clazz.return_value = group_instance
wsgi_server_instance = MagicMock()
wsgi_server_clazz.return_value = wsgi_server_instance
with patch.object(self._application, "_create_attempt_list_workers"):
self._application._create_attempt_list_workers.return_value = []
self._application.run()
group_instance.start.assert_any_call(self._waves_transaction_polling_service)
group_instance.start.assert_any_call(self._coin_transaction_polling_service)
group_clazz.assert_called_once_with()
wsgi_server_clazz.assert_called_once_with((self._host, self._port), self._flask, log=ANY)
wsgi_server_instance.serve_forever.assert_called_once_with()
| 44.754717 | 97 | 0.728499 |
aceb161dc187b90aed2191b23afb1da61db88861 | 12,769 | py | Python | backend/apps/snippets/migrations/0001_initial.py | atroudi/biosensors | 715f879b4979cf989fad997ba8792742e5892d3c | [
"MIT"
] | 1 | 2020-03-11T13:16:46.000Z | 2020-03-11T13:16:46.000Z | backend/apps/snippets/migrations/0001_initial.py | atroudi/biosensors | 715f879b4979cf989fad997ba8792742e5892d3c | [
"MIT"
] | 15 | 2020-03-11T13:17:14.000Z | 2022-02-10T04:42:23.000Z | backend/apps/snippets/migrations/0001_initial.py | atroudi/sustainability_FS | c0084a5c6b4a03f91d5a0158b7a25abacb77654c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2018-08-29 16:19
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Snippet',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True)),
('title', models.CharField(blank=True, default='', max_length=100)),
('code', models.TextField()),
('linenos', models.BooleanField(default=False)),
('language', models.CharField(choices=[('abap', 'ABAP'), ('abnf', 'ABNF'), ('ada', 'Ada'), ('adl', 'ADL'), ('agda', 'Agda'), ('aheui', 'Aheui'), ('ahk', 'autohotkey'), ('alloy', 'Alloy'), ('ampl', 'Ampl'), ('antlr', 'ANTLR'), ('antlr-as', 'ANTLR With ActionScript Target'), ('antlr-cpp', 'ANTLR With CPP Target'), ('antlr-csharp', 'ANTLR With C# Target'), ('antlr-java', 'ANTLR With Java Target'), ('antlr-objc', 'ANTLR With ObjectiveC Target'), ('antlr-perl', 'ANTLR With Perl Target'), ('antlr-python', 'ANTLR With Python Target'), ('antlr-ruby', 'ANTLR With Ruby Target'), ('apacheconf', 'ApacheConf'), ('apl', 'APL'), ('applescript', 'AppleScript'), ('arduino', 'Arduino'), ('as', 'ActionScript'), ('as3', 'ActionScript 3'), ('aspectj', 'AspectJ'), ('aspx-cs', 'aspx-cs'), ('aspx-vb', 'aspx-vb'), ('asy', 'Asymptote'), ('at', 'AmbientTalk'), ('autoit', 'AutoIt'), ('awk', 'Awk'), ('basemake', 'Base Makefile'), ('bash', 'Bash'), ('bat', 'Batchfile'), ('bbcode', 'BBCode'), ('bc', 'BC'), ('befunge', 'Befunge'), ('bib', 'BibTeX'), ('blitzbasic', 'BlitzBasic'), ('blitzmax', 'BlitzMax'), ('bnf', 'BNF'), ('boo', 'Boo'), ('boogie', 'Boogie'), ('brainfuck', 'Brainfuck'), ('bro', 'Bro'), ('bst', 'BST'), ('bugs', 'BUGS'), ('c', 'C'), ('c-objdump', 'c-objdump'), ('ca65', 'ca65 assembler'), ('cadl', 'cADL'), ('camkes', 'CAmkES'), ('capdl', 'CapDL'), ('capnp', "Cap'n Proto"), ('cbmbas', 'CBM BASIC V2'), ('ceylon', 'Ceylon'), ('cfc', 'Coldfusion CFC'), ('cfengine3', 'CFEngine3'), ('cfm', 'Coldfusion HTML'), ('cfs', 'cfstatement'), ('chai', 'ChaiScript'), ('chapel', 'Chapel'), ('cheetah', 'Cheetah'), ('cirru', 'Cirru'), ('clay', 'Clay'), ('clean', 'Clean'), ('clojure', 'Clojure'), ('clojurescript', 'ClojureScript'), ('cmake', 'CMake'), ('cobol', 'COBOL'), ('cobolfree', 'COBOLFree'), ('coffee-script', 'CoffeeScript'), ('common-lisp', 'Common Lisp'), ('componentpascal', 'Component Pascal'), ('console', 'Bash Session'), ('control', 'Debian Control file'), ('coq', 'Coq'), ('cpp', 'C++'), ('cpp-objdump', 'cpp-objdump'), ('cpsa', 'CPSA'), ('cr', 'Crystal'), ('crmsh', 'Crmsh'), ('croc', 'Croc'), ('cryptol', 'Cryptol'), ('csharp', 'C#'), ('csound', 'Csound Orchestra'), ('csound-document', 'Csound Document'), ('csound-score', 'Csound Score'), ('css', 'CSS'), ('css+django', 'CSS+Django/Jinja'), ('css+erb', 'CSS+Ruby'), ('css+genshitext', 'CSS+Genshi Text'), ('css+lasso', 'CSS+Lasso'), ('css+mako', 'CSS+Mako'), ('css+mozpreproc', 'CSS+mozpreproc'), ('css+myghty', 'CSS+Myghty'), ('css+php', 'CSS+PHP'), ('css+smarty', 'CSS+Smarty'), ('cucumber', 'Gherkin'), ('cuda', 'CUDA'), ('cypher', 'Cypher'), ('cython', 'Cython'), ('d', 'D'), ('d-objdump', 'd-objdump'), ('dart', 'Dart'), ('delphi', 'Delphi'), ('dg', 'dg'), ('diff', 'Diff'), ('django', 'Django/Jinja'), ('docker', 'Docker'), ('doscon', 'MSDOS Session'), ('dpatch', 'Darcs Patch'), ('dtd', 'DTD'), ('duel', 'Duel'), ('dylan', 'Dylan'), ('dylan-console', 'Dylan session'), ('dylan-lid', 'DylanLID'), ('earl-grey', 'Earl Grey'), ('easytrieve', 'Easytrieve'), ('ebnf', 'EBNF'), ('ec', 'eC'), ('ecl', 'ECL'), ('eiffel', 'Eiffel'), ('elixir', 'Elixir'), ('elm', 'Elm'), ('emacs', 'EmacsLisp'), ('erb', 'ERB'), ('erl', 'Erlang erl session'), ('erlang', 'Erlang'), ('evoque', 'Evoque'), ('extempore', 'xtlang'), ('ezhil', 'Ezhil'), ('factor', 'Factor'), ('fan', 'Fantom'), ('fancy', 'Fancy'), ('felix', 'Felix'), ('fish', 'Fish'), ('flatline', 'Flatline'), ('forth', 'Forth'), ('fortran', 'Fortran'), ('fortranfixed', 'FortranFixed'), ('foxpro', 'FoxPro'), ('fsharp', 'FSharp'), ('gap', 'GAP'), ('gas', 'GAS'), ('genshi', 'Genshi'), ('genshitext', 'Genshi Text'), ('glsl', 'GLSL'), ('gnuplot', 'Gnuplot'), ('go', 'Go'), ('golo', 'Golo'), ('gooddata-cl', 'GoodData-CL'), ('gosu', 'Gosu'), ('groff', 'Groff'), ('groovy', 'Groovy'), ('gst', 'Gosu Template'), ('haml', 'Haml'), ('handlebars', 'Handlebars'), ('haskell', 'Haskell'), ('haxeml', 'Hxml'), ('hexdump', 'Hexdump'), ('hsail', 'HSAIL'), ('html', 'HTML'), ('html+cheetah', 'HTML+Cheetah'), ('html+django', 'HTML+Django/Jinja'), ('html+evoque', 'HTML+Evoque'), ('html+genshi', 'HTML+Genshi'), ('html+handlebars', 'HTML+Handlebars'), ('html+lasso', 'HTML+Lasso'), ('html+mako', 'HTML+Mako'), ('html+myghty', 'HTML+Myghty'), ('html+ng2', 'HTML + Angular2'), ('html+php', 'HTML+PHP'), ('html+smarty', 'HTML+Smarty'), ('html+twig', 'HTML+Twig'), ('html+velocity', 'HTML+Velocity'), ('http', 'HTTP'), ('hx', 'Haxe'), ('hybris', 'Hybris'), ('hylang', 'Hy'), ('i6t', 'Inform 6 template'), ('idl', 'IDL'), ('idris', 'Idris'), ('iex', 'Elixir iex session'), ('igor', 'Igor'), ('inform6', 'Inform 6'), ('inform7', 'Inform 7'), ('ini', 'INI'), ('io', 'Io'), ('ioke', 'Ioke'), ('ipython2', 'IPython'), ('ipython3', 'IPython3'), ('ipythonconsole', 'IPython console session'), ('irc', 'IRC logs'), ('isabelle', 'Isabelle'), ('j', 'J'), ('jags', 'JAGS'), ('jasmin', 'Jasmin'), ('java', 'Java'), ('javascript+mozpreproc', 'Javascript+mozpreproc'), ('jcl', 'JCL'), ('jlcon', 'Julia console'), ('js', 'JavaScript'), ('js+cheetah', 'JavaScript+Cheetah'), ('js+django', 'JavaScript+Django/Jinja'), ('js+erb', 'JavaScript+Ruby'), ('js+genshitext', 'JavaScript+Genshi Text'), ('js+lasso', 'JavaScript+Lasso'), ('js+mako', 'JavaScript+Mako'), ('js+myghty', 'JavaScript+Myghty'), ('js+php', 'JavaScript+PHP'), ('js+smarty', 'JavaScript+Smarty'), ('jsgf', 'JSGF'), ('json', 'JSON'), ('json-object', 'JSONBareObject'), ('jsonld', 'JSON-LD'), ('jsp', 'Java Server Page'), ('julia', 'Julia'), ('juttle', 'Juttle'), ('kal', 'Kal'), ('kconfig', 'Kconfig'), ('koka', 'Koka'), ('kotlin', 'Kotlin'), ('lagda', 'Literate Agda'), ('lasso', 'Lasso'), ('lcry', 'Literate Cryptol'), ('lean', 'Lean'), ('less', 'LessCss'), ('lhs', 'Literate Haskell'), ('lidr', 'Literate Idris'), ('lighty', 'Lighttpd configuration file'), ('limbo', 'Limbo'), ('liquid', 'liquid'), ('live-script', 'LiveScript'), ('llvm', 'LLVM'), ('logos', 'Logos'), ('logtalk', 'Logtalk'), ('lsl', 'LSL'), ('lua', 'Lua'), ('make', 'Makefile'), ('mako', 'Mako'), ('maql', 'MAQL'), ('mask', 'Mask'), ('mason', 'Mason'), ('mathematica', 'Mathematica'), ('matlab', 'Matlab'), ('matlabsession', 'Matlab session'), ('md', 'markdown'), ('minid', 'MiniD'), ('modelica', 'Modelica'), ('modula2', 'Modula-2'), ('monkey', 'Monkey'), ('monte', 'Monte'), ('moocode', 'MOOCode'), ('moon', 'MoonScript'), ('mozhashpreproc', 'mozhashpreproc'), ('mozpercentpreproc', 'mozpercentpreproc'), ('mql', 'MQL'), ('mscgen', 'Mscgen'), ('mupad', 'MuPAD'), ('mxml', 'MXML'), ('myghty', 'Myghty'), ('mysql', 'MySQL'), ('nasm', 'NASM'), ('ncl', 'NCL'), ('nemerle', 'Nemerle'), ('nesc', 'nesC'), ('newlisp', 'NewLisp'), ('newspeak', 'Newspeak'), ('ng2', 'Angular2'), ('nginx', 'Nginx configuration file'), ('nim', 'Nimrod'), ('nit', 'Nit'), ('nixos', 'Nix'), ('nsis', 'NSIS'), ('numpy', 'NumPy'), ('nusmv', 'NuSMV'), ('objdump', 'objdump'), ('objdump-nasm', 'objdump-nasm'), ('objective-c', 'Objective-C'), ('objective-c++', 'Objective-C++'), ('objective-j', 'Objective-J'), ('ocaml', 'OCaml'), ('octave', 'Octave'), ('odin', 'ODIN'), ('ooc', 'Ooc'), ('opa', 'Opa'), ('openedge', 'OpenEdge ABL'), ('pacmanconf', 'PacmanConf'), ('pan', 'Pan'), ('parasail', 'ParaSail'), ('pawn', 'Pawn'), ('perl', 'Perl'), ('perl6', 'Perl6'), ('php', 'PHP'), ('pig', 'Pig'), ('pike', 'Pike'), ('pkgconfig', 'PkgConfig'), ('plpgsql', 'PL/pgSQL'), ('postgresql', 'PostgreSQL SQL dialect'), ('postscript', 'PostScript'), ('pot', 'Gettext Catalog'), ('pov', 'POVRay'), ('powershell', 'PowerShell'), ('praat', 'Praat'), ('prolog', 'Prolog'), ('properties', 'Properties'), ('protobuf', 'Protocol Buffer'), ('ps1con', 'PowerShell Session'), ('psql', 'PostgreSQL console (psql)'), ('pug', 'Pug'), ('puppet', 'Puppet'), ('py3tb', 'Python 3.0 Traceback'), ('pycon', 'Python console session'), ('pypylog', 'PyPy Log'), ('pytb', 'Python Traceback'), ('python', 'Python'), ('python3', 'Python 3'), ('qbasic', 'QBasic'), ('qml', 'QML'), ('qvto', 'QVTO'), ('racket', 'Racket'), ('ragel', 'Ragel'), ('ragel-c', 'Ragel in C Host'), ('ragel-cpp', 'Ragel in CPP Host'), ('ragel-d', 'Ragel in D Host'), ('ragel-em', 'Embedded Ragel'), ('ragel-java', 'Ragel in Java Host'), ('ragel-objc', 'Ragel in Objective C Host'), ('ragel-ruby', 'Ragel in Ruby Host'), ('raw', 'Raw token data'), ('rb', 'Ruby'), ('rbcon', 'Ruby irb session'), ('rconsole', 'RConsole'), ('rd', 'Rd'), ('rebol', 'REBOL'), ('red', 'Red'), ('redcode', 'Redcode'), ('registry', 'reg'), ('resource', 'ResourceBundle'), ('rexx', 'Rexx'), ('rhtml', 'RHTML'), ('rnc', 'Relax-NG Compact'), ('roboconf-graph', 'Roboconf Graph'), ('roboconf-instances', 'Roboconf Instances'), ('robotframework', 'RobotFramework'), ('rql', 'RQL'), ('rsl', 'RSL'), ('rst', 'reStructuredText'), ('rts', 'TrafficScript'), ('rust', 'Rust'), ('sas', 'SAS'), ('sass', 'Sass'), ('sc', 'SuperCollider'), ('scala', 'Scala'), ('scaml', 'Scaml'), ('scheme', 'Scheme'), ('scilab', 'Scilab'), ('scss', 'SCSS'), ('shen', 'Shen'), ('silver', 'Silver'), ('slim', 'Slim'), ('smali', 'Smali'), ('smalltalk', 'Smalltalk'), ('smarty', 'Smarty'), ('sml', 'Standard ML'), ('snobol', 'Snobol'), ('snowball', 'Snowball'), ('sourceslist', 'Debian Sourcelist'), ('sp', 'SourcePawn'), ('sparql', 'SPARQL'), ('spec', 'RPMSpec'), ('splus', 'S'), ('sql', 'SQL'), ('sqlite3', 'sqlite3con'), ('squidconf', 'SquidConf'), ('ssp', 'Scalate Server Page'), ('stan', 'Stan'), ('stata', 'Stata'), ('swift', 'Swift'), ('swig', 'SWIG'), ('systemverilog', 'systemverilog'), ('tads3', 'TADS 3'), ('tap', 'TAP'), ('tasm', 'TASM'), ('tcl', 'Tcl'), ('tcsh', 'Tcsh'), ('tcshcon', 'Tcsh Session'), ('tea', 'Tea'), ('termcap', 'Termcap'), ('terminfo', 'Terminfo'), ('terraform', 'Terraform'), ('tex', 'TeX'), ('text', 'Text only'), ('thrift', 'Thrift'), ('todotxt', 'Todotxt'), ('trac-wiki', 'MoinMoin/Trac Wiki markup'), ('treetop', 'Treetop'), ('ts', 'TypeScript'), ('tsql', 'Transact-SQL'), ('turtle', 'Turtle'), ('twig', 'Twig'), ('typoscript', 'TypoScript'), ('typoscriptcssdata', 'TypoScriptCssData'), ('typoscripthtmldata', 'TypoScriptHtmlData'), ('urbiscript', 'UrbiScript'), ('vala', 'Vala'), ('vb.net', 'VB.net'), ('vcl', 'VCL'), ('vclsnippets', 'VCLSnippets'), ('vctreestatus', 'VCTreeStatus'), ('velocity', 'Velocity'), ('verilog', 'verilog'), ('vgl', 'VGL'), ('vhdl', 'vhdl'), ('vim', 'VimL'), ('wdiff', 'WDiff'), ('whiley', 'Whiley'), ('x10', 'X10'), ('xml', 'XML'), ('xml+cheetah', 'XML+Cheetah'), ('xml+django', 'XML+Django/Jinja'), ('xml+erb', 'XML+Ruby'), ('xml+evoque', 'XML+Evoque'), ('xml+lasso', 'XML+Lasso'), ('xml+mako', 'XML+Mako'), ('xml+myghty', 'XML+Myghty'), ('xml+php', 'XML+PHP'), ('xml+smarty', 'XML+Smarty'), ('xml+velocity', 'XML+Velocity'), ('xquery', 'XQuery'), ('xslt', 'XSLT'), ('xtend', 'Xtend'), ('xul+mozpreproc', 'XUL+mozpreproc'), ('yaml', 'YAML'), ('yaml+jinja', 'YAML+Jinja'), ('zephir', 'Zephir')], default='python', max_length=100)),
('style', models.CharField(choices=[('abap', 'abap'), ('algol', 'algol'), ('algol_nu', 'algol_nu'), ('arduino', 'arduino'), ('autumn', 'autumn'), ('borland', 'borland'), ('bw', 'bw'), ('colorful', 'colorful'), ('default', 'default'), ('emacs', 'emacs'), ('friendly', 'friendly'), ('fruity', 'fruity'), ('igor', 'igor'), ('lovelace', 'lovelace'), ('manni', 'manni'), ('monokai', 'monokai'), ('murphy', 'murphy'), ('native', 'native'), ('paraiso-dark', 'paraiso-dark'), ('paraiso-light', 'paraiso-light'), ('pastie', 'pastie'), ('perldoc', 'perldoc'), ('rainbow_dash', 'rainbow_dash'), ('rrt', 'rrt'), ('tango', 'tango'), ('trac', 'trac'), ('vim', 'vim'), ('vs', 'vs'), ('xcode', 'xcode')], default='friendly', max_length=100)),
('highlighted', models.TextField()),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='snippets', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ('created',),
},
),
]
| 345.108108 | 10,858 | 0.570444 |
aceb163eeb7236101a5008249164cc6b487cf2dc | 8,828 | py | Python | tests/build/scipy/scipy/stats/__init__.py | crougeux/-a-i_v1.6.3_modif | b499a812e79f335d082d3f9b1070e0465ad67bab | [
"BSD-3-Clause"
] | 3 | 2019-08-14T03:11:16.000Z | 2021-04-15T19:45:35.000Z | tests/build/scipy/scipy/stats/__init__.py | crougeux/-a-i_v1.6.3_modif | b499a812e79f335d082d3f9b1070e0465ad67bab | [
"BSD-3-Clause"
] | null | null | null | tests/build/scipy/scipy/stats/__init__.py | crougeux/-a-i_v1.6.3_modif | b499a812e79f335d082d3f9b1070e0465ad67bab | [
"BSD-3-Clause"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | """
==========================================
Statistical functions (:mod:`scipy.stats`)
==========================================
.. module:: scipy.stats
This module contains a large number of probability distributions as
well as a growing library of statistical functions.
Each included distribution is an instance of the class rv_continous:
For each given name the following methods are available:
.. autosummary::
:toctree: generated/
rv_continuous
rv_continuous.pdf
rv_continuous.logpdf
rv_continuous.cdf
rv_continuous.logcdf
rv_continuous.sf
rv_continuous.logsf
rv_continuous.ppf
rv_continuous.isf
rv_continuous.moment
rv_continuous.stats
rv_continuous.entropy
rv_continuous.fit
rv_continuous.expect
Calling the instance as a function returns a frozen pdf whose shape,
location, and scale parameters are fixed.
Similarly, each discrete distribution is an instance of the class
rv_discrete:
.. autosummary::
:toctree: generated/
rv_discrete
rv_discrete.rvs
rv_discrete.pmf
rv_discrete.logpmf
rv_discrete.cdf
rv_discrete.logcdf
rv_discrete.sf
rv_discrete.logsf
rv_discrete.ppf
rv_discrete.isf
rv_discrete.stats
rv_discrete.moment
rv_discrete.entropy
rv_discrete.expect
Continuous distributions
========================
.. autosummary::
:toctree: generated/
alpha -- Alpha
anglit -- Anglit
arcsine -- Arcsine
beta -- Beta
betaprime -- Beta Prime
bradford -- Bradford
burr -- Burr
cauchy -- Cauchy
chi -- Chi
chi2 -- Chi-squared
cosine -- Cosine
dgamma -- Double Gamma
dweibull -- Double Weibull
erlang -- Erlang
expon -- Exponential
exponweib -- Exponentiated Weibull
exponpow -- Exponential Power
f -- F (Snecdor F)
fatiguelife -- Fatigue Life (Birnbaum-Sanders)
fisk -- Fisk
foldcauchy -- Folded Cauchy
foldnorm -- Folded Normal
frechet_r -- Frechet Right Sided, Extreme Value Type II (Extreme LB) or weibull_min
frechet_l -- Frechet Left Sided, Weibull_max
genlogistic -- Generalized Logistic
genpareto -- Generalized Pareto
genexpon -- Generalized Exponential
genextreme -- Generalized Extreme Value
gausshyper -- Gauss Hypergeometric
gamma -- Gamma
gengamma -- Generalized gamma
genhalflogistic -- Generalized Half Logistic
gilbrat -- Gilbrat
gompertz -- Gompertz (Truncated Gumbel)
gumbel_r -- Right Sided Gumbel, Log-Weibull, Fisher-Tippett, Extreme Value Type I
gumbel_l -- Left Sided Gumbel, etc.
halfcauchy -- Half Cauchy
halflogistic -- Half Logistic
halfnorm -- Half Normal
hypsecant -- Hyperbolic Secant
invgamma -- Inverse Gamma
invgauss -- Inverse Gaussian
invweibull -- Inverse Weibull
johnsonsb -- Johnson SB
johnsonsu -- Johnson SU
ksone -- Kolmogorov-Smirnov one-sided (no stats)
kstwobign -- Kolmogorov-Smirnov two-sided test for Large N (no stats)
laplace -- Laplace
logistic -- Logistic
loggamma -- Log-Gamma
loglaplace -- Log-Laplace (Log Double Exponential)
lognorm -- Log-Normal
lomax -- Lomax (Pareto of the second kind)
maxwell -- Maxwell
mielke -- Mielke's Beta-Kappa
nakagami -- Nakagami
ncx2 -- Non-central chi-squared
ncf -- Non-central F
nct -- Non-central Student's T
norm -- Normal (Gaussian)
pareto -- Pareto
pearson3 -- Pearson type III
powerlaw -- Power-function
powerlognorm -- Power log normal
powernorm -- Power normal
rdist -- R-distribution
reciprocal -- Reciprocal
rayleigh -- Rayleigh
rice -- Rice
recipinvgauss -- Reciprocal Inverse Gaussian
semicircular -- Semicircular
t -- Student's T
triang -- Triangular
truncexpon -- Truncated Exponential
truncnorm -- Truncated Normal
tukeylambda -- Tukey-Lambda
uniform -- Uniform
vonmises -- Von-Mises (Circular)
wald -- Wald
weibull_min -- Minimum Weibull (see Frechet)
weibull_max -- Maximum Weibull (see Frechet)
wrapcauchy -- Wrapped Cauchy
Discrete distributions
======================
.. autosummary::
:toctree: generated/
bernoulli -- Bernoulli
binom -- Binomial
boltzmann -- Boltzmann (Truncated Discrete Exponential)
dlaplace -- Discrete Laplacian
geom -- Geometric
hypergeom -- Hypergeometric
logser -- Logarithmic (Log-Series, Series)
nbinom -- Negative Binomial
planck -- Planck (Discrete Exponential)
poisson -- Poisson
randint -- Discrete Uniform
skellam -- Skellam
zipf -- Zipf
Statistical functions
=====================
Several of these functions have a similar version in scipy.stats.mstats
which work for masked arrays.
.. autosummary::
:toctree: generated/
cmedian -- Computed median
describe -- Descriptive statistics
gmean -- Geometric mean
hmean -- Harmonic mean
kurtosis -- Fisher or Pearson kurtosis
kurtosistest --
mode -- Modal value
moment -- Central moment
normaltest --
skew -- Skewness
skewtest --
tmean -- Truncated arithmetic mean
tvar -- Truncated variance
tmin --
tmax --
tstd --
tsem --
nanmean -- Mean, ignoring NaN values
nanstd -- Standard deviation, ignoring NaN values
nanmedian -- Median, ignoring NaN values
variation -- Coefficient of variation
.. autosummary::
:toctree: generated/
cumfreq _
histogram2 _
histogram _
itemfreq _
percentileofscore _
scoreatpercentile _
relfreq _
.. autosummary::
:toctree: generated/
binned_statistic -- Compute a binned statistic for a set of data.
binned_statistic_2d -- Compute a 2-D binned statistic for a set of data.
binned_statistic_dd -- Compute a d-D binned statistic for a set of data.
.. autosummary::
:toctree: generated/
obrientransform
signaltonoise
bayes_mvs
sem
zmap
zscore
.. autosummary::
:toctree: generated/
threshold
trimboth
trim1
.. autosummary::
:toctree: generated/
f_oneway
pearsonr
spearmanr
pointbiserialr
kendalltau
linregress
.. autosummary::
:toctree: generated/
ttest_1samp
ttest_ind
ttest_rel
kstest
chisquare
power_divergence
ks_2samp
mannwhitneyu
tiecorrect
rankdata
ranksums
wilcoxon
kruskal
friedmanchisquare
.. autosummary::
:toctree: generated/
ansari
bartlett
levene
shapiro
anderson
binom_test
fligner
mood
oneway
Contingency table functions
===========================
.. autosummary::
:toctree: generated/
chi2_contingency
contingency.expected_freq
contingency.margins
fisher_exact
General linear model
====================
.. autosummary::
:toctree: generated/
glm
Plot-tests
==========
.. autosummary::
:toctree: generated/
ppcc_max
ppcc_plot
probplot
Masked statistics functions
===========================
.. toctree::
stats.mstats
Univariate and multivariate kernel density estimation (:mod:`scipy.stats.kde`)
==============================================================================
.. autosummary::
:toctree: generated/
gaussian_kde
For many more stat related functions install the software R and the
interface package rpy.
"""
from __future__ import division, print_function, absolute_import
from .stats import *
from .distributions import *
from .rv import *
from .morestats import *
from ._binned_statistic import *
from .kde import gaussian_kde
from . import mstats
from .contingency import chi2_contingency
#remove vonmises_cython from __all__, I don't know why it is included
__all__ = [s for s in dir() if not (s.startswith('_') or s.endswith('cython'))]
from numpy.testing import Tester
test = Tester().test
| 26.118343 | 94 | 0.592093 |
aceb16bc73c90655ecc1b45e26b5615aac66074f | 101 | py | Python | gtts/tokenizer/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | 3 | 2019-04-10T18:14:46.000Z | 2020-10-26T05:08:05.000Z | gtts/tokenizer/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | null | null | null | gtts/tokenizer/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
from .core import RegexBuilder, PreProcessorRegex, PreProcessorSub, Tokenizer
| 33.666667 | 77 | 0.762376 |
aceb185f1768c9d8236711bb43f02031df5ad7fc | 13,024 | py | Python | src/orion/benchmark/__init__.py | mgermain/orion | b0932da99cac5c3db9bbf662588c581cb6ca1849 | [
"BSD-3-Clause"
] | null | null | null | src/orion/benchmark/__init__.py | mgermain/orion | b0932da99cac5c3db9bbf662588c581cb6ca1849 | [
"BSD-3-Clause"
] | null | null | null | src/orion/benchmark/__init__.py | mgermain/orion | b0932da99cac5c3db9bbf662588c581cb6ca1849 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Benchmark definition
======================
"""
import copy
import itertools
from tabulate import tabulate
import orion.core
from orion.client import create_experiment
from orion.executor.base import Executor
class Benchmark:
"""
Benchmark definition
Parameters
----------
name: str
Name of the benchmark
algorithms: list, optional
Algorithms used for benchmark, and for each algorithm, it can be formats as below:
- A `str` of the algorithm name
- A `dict`, with only one key and one value, where key is the algorithm name and value is a dict for the algorithm config.
- A `dict`, with two keys.
algorithm: str or dict
Algorithm name in string or a dict with algorithm configure.
deterministic: bool, optional
True if it is a deterministic algorithm, then for each assessment, only one experiment
will be run for this algorithm.
Examples:
>>> ["random", "tpe"]
>>> ["random", {"tpe": {"seed": 1}}]
>>> [{"algorithm": "random"}, {"algorithm": {"gridsearch": {"n_values": 50}}, "deterministic": True}]
targets: list, optional
Targets for the benchmark, each target will be a dict with two keys.
assess: list
Assessment objects
task: list
Task objects
storage: dict, optional
Configuration of the storage backend.
executor: `orion.executor.base.Executor`, optional
Executor to run the benchmark experiments
"""
def __init__(self, name, algorithms, targets, storage=None, executor=None):
self._id = None
self.name = name
self.algorithms = algorithms
self.targets = targets
self.metadata = {}
self.storage_config = storage
self.executor = executor or Executor(
orion.core.config.worker.executor,
n_workers=orion.core.config.worker.n_workers,
**orion.core.config.worker.executor_configuration,
)
self.studies = []
def setup_studies(self):
"""Setup studies to run for the benchmark.
Benchmark `algorithms`, together with each `task` and `assessment` combination
define a study.
"""
for target in self.targets:
assessments = target["assess"]
tasks = target["task"]
for assess, task in itertools.product(*[assessments, tasks]):
study = Study(self, self.algorithms, assess, task)
study.setup_experiments()
self.studies.append(study)
def process(self, n_workers=1):
"""Run studies experiment"""
for study in self.studies:
study.execute(n_workers)
def status(self, silent=True):
"""Display benchmark status"""
total_exp_num = 0
complete_exp_num = 0
total_trials = 0
benchmark_status = []
for study in self.studies:
for status in study.status():
column = dict()
column["Algorithms"] = status["algorithm"]
column["Assessments"] = status["assessment"]
column["Tasks"] = status["task"]
column["Total Experiments"] = status["experiments"]
total_exp_num += status["experiments"]
column["Completed Experiments"] = status["completed"]
complete_exp_num += status["completed"]
column["Submitted Trials"] = status["trials"]
total_trials += status["trials"]
benchmark_status.append(column)
if not silent:
print(
"Benchmark name: {}, Experiments: {}/{}, Submitted trials: {}".format(
self.name, complete_exp_num, total_exp_num, total_trials
)
)
self._pretty_table(benchmark_status)
return benchmark_status
def analysis(self):
"""Return all the assessment figures"""
figures = []
for study in self.studies:
figure = study.analysis()
figures.append(figure)
return figures
def experiments(self, silent=True):
"""Return all the experiments submitted in benchmark"""
experiment_table = []
for study in self.studies:
for exp in study.experiments():
exp_column = dict()
stats = exp.stats
exp_column["Algorithm"] = list(exp.configuration["algorithms"].keys())[
0
]
exp_column["Experiment Name"] = exp.name
exp_column["Number Trial"] = len(exp.fetch_trials())
exp_column["Best Evaluation"] = stats["best_evaluation"]
experiment_table.append(exp_column)
if not silent:
print("Total Experiments: {}".format(len(experiment_table)))
self._pretty_table(experiment_table)
return experiment_table
def _pretty_table(self, dict_list):
"""
Print a list of same format dict as pretty table with IPython disaply(notebook) or tablute
:param dict_list: a list of dict where each dict has the same keys.
"""
try:
from IPython.display import HTML, display
display(
HTML(
tabulate(
dict_list,
headers="keys",
tablefmt="html",
stralign="center",
numalign="center",
)
)
)
except ImportError:
table = tabulate(
dict_list,
headers="keys",
tablefmt="grid",
stralign="center",
numalign="center",
)
print(table)
# pylint: disable=invalid-name
@property
def id(self):
"""Id of the benchmark in the database if configured.
Value is `None` if the benchmark is not configured.
"""
return self._id
@property
def configuration(self):
"""Return a copy of an `Benchmark` configuration as a dictionary."""
config = dict()
config["name"] = self.name
config["algorithms"] = self.algorithms
targets = []
for target in self.targets:
str_target = {}
assessments = target["assess"]
str_assessments = dict()
for assessment in assessments:
str_assessments.update(assessment.configuration)
str_target["assess"] = str_assessments
tasks = target["task"]
str_tasks = dict()
for task in tasks:
str_tasks.update(task.configuration)
str_target["task"] = str_tasks
targets.append(str_target)
config["targets"] = targets
if self.id is not None:
config["_id"] = self.id
return copy.deepcopy(config)
class Study:
"""
A study is one assessment and task combination in the `Benchmark` targets. It will
build and run experiments for all the algorithms for that task.
Parameters
----------
benchmark: A Benchmark instance
algorithms: list
Algorithms used for benchmark, each algorithm can be a string or dict, with same format as `Benchmark` algorithms.
assessment: list
`Assessment` instance
task: list
`Task` instance
"""
class _StudyAlgorithm:
"""
Represent user input json format algorithm as a Study algorithm object for easy to use.
Parameters
----------
algorithm: one algorithm in the `Study` algorithms list.
"""
def __init__(self, algorithm):
parameters = None
deterministic = False
if isinstance(algorithm, dict):
if len(algorithm) > 1 or algorithm.get("algorithm"):
deterministic = algorithm.get("deterministic", False)
experiment_algorithm = algorithm["algorithm"]
if isinstance(experiment_algorithm, dict):
name, parameters = list(experiment_algorithm.items())[0]
else:
name = experiment_algorithm
else:
name, parameters = list(algorithm.items())[0]
else:
name = algorithm
self.algo_name = name
self.parameters = parameters
self.deterministic = deterministic
@property
def name(self):
return self.algo_name
@property
def experiment_algorithm(self):
if self.parameters:
return {self.algo_name: self.parameters}
else:
return self.algo_name
@property
def is_deterministic(self):
return self.deterministic
def __init__(self, benchmark, algorithms, assessment, task):
self.algorithms = self._build_benchmark_algorithms(algorithms)
self.assessment = assessment
self.task = task
self.benchmark = benchmark
self.assess_name = type(self.assessment).__name__
self.task_name = type(self.task).__name__
self.experiments_info = []
def _build_benchmark_algorithms(self, algorithms):
benchmark_algorithms = list()
for algorithm in algorithms:
benchmark_algorithm = self._StudyAlgorithm(algorithm)
benchmark_algorithms.append(benchmark_algorithm)
return benchmark_algorithms
def setup_experiments(self):
"""Setup experiments to run of the study"""
max_trials = self.task.max_trials
task_num = self.assessment.task_num
space = self.task.get_search_space()
for task_index in range(task_num):
for algo_index, algorithm in enumerate(self.algorithms):
# Run only 1 experiment for deterministic algorithm
if algorithm.is_deterministic and task_index > 0:
continue
experiment_name = (
self.benchmark.name
+ "_"
+ self.assess_name
+ "_"
+ self.task_name
+ "_"
+ str(task_index)
+ "_"
+ str(algo_index)
)
experiment = create_experiment(
experiment_name,
space=space,
algorithms=algorithm.experiment_algorithm,
max_trials=max_trials,
storage=self.benchmark.storage_config,
executor=self.benchmark.executor,
)
self.experiments_info.append((task_index, experiment))
def execute(self, n_workers=1):
"""Execute all the experiments of the study"""
max_trials = self.task.max_trials
for _, experiment in self.experiments_info:
# TODO: it is a blocking call
experiment.workon(self.task, n_workers=n_workers, max_trials=max_trials)
def status(self):
"""Return status of the study"""
algorithm_tasks = {}
for _, experiment in self.experiments_info:
trials = experiment.fetch_trials()
algorithm_name = list(experiment.configuration["algorithms"].keys())[0]
if algorithm_tasks.get(algorithm_name, None) is None:
task_state = {
"algorithm": algorithm_name,
"experiments": 0,
"assessment": self.assess_name,
"task": self.task_name,
"completed": 0,
"trials": 0,
}
else:
task_state = algorithm_tasks[algorithm_name]
task_state["experiments"] += 1
task_state["trials"] += len(trials)
if experiment.is_done:
task_state["completed"] += 1
algorithm_tasks[algorithm_name] = task_state
return list(algorithm_tasks.values())
def analysis(self):
"""Return assessment figure"""
return self.assessment.analysis(self.task_name, self.experiments_info)
def experiments(self):
"""Return all the experiments of the study"""
exps = []
for _, experiment in self.experiments_info:
exps.append(experiment)
return exps
def __repr__(self):
"""Represent the object as a string."""
algorithms_list = [algorithm.name for algorithm in self.algorithms]
return "Study(assessment=%s, task=%s, algorithms=[%s])" % (
self.assess_name,
self.task_name,
",".join(algorithms_list),
)
| 33.139949 | 130 | 0.558277 |
aceb1a4332441140f046204902205fe9c337368d | 4,587 | py | Python | mprocessing.py | samuelmaina/multi-processing | dc0b9bc3e36af59a85ff2c865d75d74d702eb8db | [
"MIT"
] | null | null | null | mprocessing.py | samuelmaina/multi-processing | dc0b9bc3e36af59a85ff2c865d75d74d702eb8db | [
"MIT"
] | null | null | null | mprocessing.py | samuelmaina/multi-processing | dc0b9bc3e36af59a85ff2c865d75d74d702eb8db | [
"MIT"
] | null | null | null | from multiprocessing import Process
import concurrent.futures
import time
def do_something():
print('Sleeping 1 second...')
time.sleep(1)
print('Done sleeping...')
def do_something_with_args(seconds):
print(f'Sleeping {seconds} second(s)...')
time.sleep(seconds)
feedback= 'Done sleeping..'
print(feedback)
def do_something_with_args_no_printing(seconds):
print(f'Sleeping {seconds} second(s)...')
time.sleep(seconds)
return 'Done sleeping...'
if __name__ == '__main__':
#to get more accurate results the perf_counter_ns() function can be used to get the time in nanoseconds.
start= time.perf_counter()
#run the two processes one after another(the non-multiprocessing way)
do_something()
do_something()
finish= time.perf_counter()
time_taken= round(finish-start,2)
assert time_taken>2,"The two processes should take more than 2 seconds."
print(f' Finished in {time_taken} seconds')
start= time.perf_counter()
#run the two processes concurrently (the multiprocessing way) for just two processes.
p1= Process(target=do_something)
p2= Process(target=do_something)
p1.start()
p2.start()
p1.join()
p2.join()
finish= time.perf_counter()
time_taken= round(finish-start,2)
assert time_taken< 2,"The two processes should take less than 2 seconds."
print(f' Finished in {time_taken} seconds')
start= time.perf_counter()
processes= []
#run the two processes concurrently (the multiprocessing way) for many processes.
for _ in range(10):
p= Process(target=do_something)
p.start()
#the join. can not be called here since all the process need to be started
#before any of them is joined. The process will be stored in a list in which all
#of them will be joined
processes.append(p)
for p in processes:
p.join()
finish= time.perf_counter()
time_taken= round(finish-start,2)
#in this case it does not mean that the processor has 10 cores. The os provides ways to
#switch task for the idle cores.
assert time_taken< 2,"The two processes should take less than 2 seconds."
print(f' Finished in {time_taken} seconds')
start= time.perf_counter()
processes= []
seconds=1.5
#run the two processes concurrently (the multiprocessing way) for many processes.
for _ in range(10):
p= Process(target=do_something_with_args, args=[seconds])
p.start()
#the join. can not be called here since all the process need to be started
#before any of them is joined. The process will be stored in a list in which all
#of them will be joined
processes.append(p)
for p in processes:
p.join()
finish= time.perf_counter()
time_taken= round(finish-start,2)
#give 1 second for context switching and other processes.
assert time_taken< seconds+1,f"The two processes should take less than {seconds+1}seconds."
print(f' Finished in {time_taken} seconds')
#the ideal way of handling mutitprocessing
start= time.perf_counter()
with concurrent.futures.ProcessPoolExecutor() as executor:
#return a future object that will be excuted.
secs=[5,4, 3, 2,1 ]
results= [executor.submit(do_something_with_args_no_printing, sec) for sec in secs]
for f in concurrent.futures.as_completed(results):
print(f.result())
finish= time.perf_counter()
time_taken= round(finish-start,2)
print(f' Finished in {time_taken} seconds')
assert time_taken< 5+1,f"The processes should take less than {seconds+1}seconds."
#using the buildin map function that call the passed function
#with each item that is passed in the iterable.
start= time.perf_counter()
with concurrent.futures.ProcessPoolExecutor() as executor:
secs=[5,4, 3, 2,1 ]
#return the result of the function with the order of which the
#the process were started.
results= executor.map(do_something_with_args_no_printing,secs)
# for result in results:
# #For any execeptions that will be thrown in the multiprocessing ,
# #they should be caught in the iterator.
# print(result)
finish= time.perf_counter()
time_taken= round(finish-start,2)
print(f' Finished running the mapped executor in {time_taken} seconds')
assert time_taken< 5+1,f"The processes should take less than {seconds+1}seconds."
| 29.403846 | 108 | 0.674515 |
aceb1ab3cd89cec27dd251a191e865c8ce7e55d7 | 1,797 | py | Python | products/migrations/0005_auto_20180429_1710.py | adetbekov/magnum_online | 2bd084f867f94fc0159cc818369d3268770960c5 | [
"MIT"
] | null | null | null | products/migrations/0005_auto_20180429_1710.py | adetbekov/magnum_online | 2bd084f867f94fc0159cc818369d3268770960c5 | [
"MIT"
] | 15 | 2018-04-29T11:07:21.000Z | 2022-03-11T23:20:51.000Z | products/migrations/0005_auto_20180429_1710.py | adetbekov/magnum_online | 2bd084f867f94fc0159cc818369d3268770960c5 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-04-29 11:10
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('products', '0004_auto_20180429_1556'),
]
operations = [
migrations.CreateModel(
name='Point',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('real_address', models.CharField(max_length=30)),
('latitude', models.FloatField()),
('longitude', models.FloatField()),
('created', models.DateTimeField(default=datetime.datetime.now)),
('open_time', models.TimeField()),
('close_time', models.TimeField()),
],
options={
'verbose_name': 'Пункт выдачи',
'verbose_name_plural': 'Пункты выдачи',
},
),
migrations.AlterField(
model_name='transaction',
name='status',
field=models.CharField(choices=[('C', 'Canceled'), ('I', 'Incomplete'), ('S', 'Completed'), ('R', 'Rejected')], default='I', max_length=3),
),
migrations.AlterField(
model_name='transaction',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='transaction',
name='point',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='products.Point'),
),
]
| 36.673469 | 151 | 0.570952 |
aceb1ae9649e831bd09110dbb562e6aef480ea81 | 493 | py | Python | packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/coloraxis/colorbar/_y.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="y", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"),
max=kwargs.pop("max", 3),
min=kwargs.pop("min", -2),
**kwargs,
)
| 30.8125 | 80 | 0.612576 |
aceb1c03c05de443f6608356c056c6906b7e92bb | 5,573 | py | Python | {{cookiecutter.project_slug}}/docs/conf.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/docs/conf.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/docs/conf.py | Steamboat/cookiecutter-devops | 6f07329c9e54b76e671a0308d343d2d9ebff5343 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# {{ cookiecutter.project_slug }} documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../../..'))
sys.path.insert(0, os.path.abspath('../../app'))
sys.path.insert(0, os.path.abspath('../../common'))
sys.path.insert(0, os.path.abspath('../../publisher'))
sys.path.insert(0, os.path.abspath('../../etl'))
sys.path.insert(0, os.path.abspath('../../toolkit'))
sys.path.insert(0, os.path.abspath('../../eda'))
sys.path.insert(0, os.path.abspath('../../host'))
sys.path.insert(0, os.path.abspath('../../tests'))
sys.setrecursionlimit(1500)
import {{ cookiecutter.project_slug }}
# -- General configuration ---------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.httpdomain',
# 'sphinxcontrib.autohttp.flask',
# 'sphinxcontrib.autohttp.flaskqref',
'rinoh.frontend.sphinx'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = '{{ cookiecutter.project_name }}'
copyright = "{% now 'local', '%Y' %}, {{ cookiecutter.full_name }}"
author = "{{ cookiecutter.full_name }}"
# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
# the built documents.
#
# The short X.Y version.
version = {{ cookiecutter.project_slug }}.__version__
# The full version, including alpha/beta/rc tags.
release = {{ cookiecutter.project_slug }}.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output -------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ---------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = '{{ cookiecutter.project_slug }}doc'
# -- Options for LaTeX output ------------------------------------------
latex_elements = {
'papersize': 'letterpaper',
'pointsize': '10pt',
'preamble': '',
'figure_align': 'htbp'
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, '{{ cookiecutter.project_slug }}.tex',
'{{ cookiecutter.project_name }} Documentation',
'{{ cookiecutter.full_name }}', 'manual'),
]
# -- Options for manual page output ------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, '{{ cookiecutter.project_slug }}',
'{{ cookiecutter.project_name }} Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, '{{ cookiecutter.project_slug }}',
'{{ cookiecutter.project_name }} Documentation',
author,
'{{ cookiecutter.project_slug }}',
'One line description of project.',
'Miscellaneous'),
]
| 33.172619 | 84 | 0.684371 |
aceb1c5f5e72f1b0291ec1c2d85f22c9004a09f2 | 8,493 | py | Python | integration-tests/test/test_genesis_ceremony.py | MicrohexHQ/rchain | a1b047479ac08f2f307f053960c102d81f9ee956 | [
"Apache-2.0"
] | null | null | null | integration-tests/test/test_genesis_ceremony.py | MicrohexHQ/rchain | a1b047479ac08f2f307f053960c102d81f9ee956 | [
"Apache-2.0"
] | null | null | null | integration-tests/test/test_genesis_ceremony.py | MicrohexHQ/rchain | a1b047479ac08f2f307f053960c102d81f9ee956 | [
"Apache-2.0"
] | null | null | null | from random import Random
from docker.client import DockerClient
from rchain.crypto import PrivateKey
from .conftest import (
testing_context,
temporary_wallets_file,
)
from .common import (
CommandLineOptions,
)
from .rnode import (
started_peer,
ready_bootstrap,
extract_validator_stake_from_bonds_validator_str,
)
from .wait import (
wait_for_block_approval,
wait_for_approved_block_received_handler_state,
wait_for_sent_approved_block,
)
CEREMONY_MASTER_KEYPAIR = PrivateKey.from_hex("80366db5fbb8dad7946f27037422715e4176dda41d582224db87b6c3b783d709")
VALIDATOR_A_KEYPAIR = PrivateKey.from_hex("120d42175739387af0264921bb117e4c4c05fbe2ce5410031e8b158c6e414bb5")
VALIDATOR_B_KEYPAIR = PrivateKey.from_hex("1f52d0bce0a92f5c79f2a88aae6d391ddf853e2eb8e688c5aa68002205f92dad")
VALIDATOR_C_KEYPAIR = PrivateKey.from_hex("5322dbb1828bdb44cb3275d35672bb3453347ee249a1f32d3c035e5ec3bfad1a")
READONLY_A_KEYPAIR = PrivateKey.from_hex("632a21e0176c4daed1ca78f08f98885f61d2050e0391e31eae59ff1a35ccca7f")
def test_successful_genesis_ceremony(command_line_options: CommandLineOptions, random_generator: Random, docker_client: DockerClient) -> None:
"""
https://docs.google.com/document/d/1Z5Of7OVVeMGl2Fw054xrwpRmDmKCC-nAoIxtIIHD-Tc/
"""
bootstrap_cli_options = {
'--deploy-timestamp': '1',
'--required-sigs': '2',
'--duration': '5min',
'--interval': '10sec',
}
peers_cli_flags = set(['--genesis-validator'])
peers_cli_options = {
'--deploy-timestamp': '1',
'--required-sigs': '2',
}
peers_keypairs = [
VALIDATOR_A_KEYPAIR,
VALIDATOR_B_KEYPAIR,
]
with testing_context(command_line_options, random_generator, docker_client, bootstrap_key=CEREMONY_MASTER_KEYPAIR, peers_keys=peers_keypairs) as context, \
temporary_wallets_file(context.random_generator) as wallets, \
ready_bootstrap(context=context, cli_options=bootstrap_cli_options, wallets_file=wallets) as ceremony_master, \
started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='validator-a', private_key=VALIDATOR_A_KEYPAIR, wallets_file=wallets, cli_flags=peers_cli_flags, cli_options=peers_cli_options) as validator_a, \
started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='validator-b', private_key=VALIDATOR_B_KEYPAIR, wallets_file=wallets, cli_flags=peers_cli_flags, cli_options=peers_cli_options) as validator_b, \
started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='readonly-a', private_key=READONLY_A_KEYPAIR) as readonly_a:
wait_for_block_approval(context, ceremony_master)
wait_for_approved_block_received_handler_state(context, ceremony_master)
wait_for_sent_approved_block(context, ceremony_master)
wait_for_approved_block_received_handler_state(context, validator_a)
wait_for_approved_block_received_handler_state(context, validator_b)
assert ceremony_master.get_blocks_count(2) == 1
assert validator_a.get_blocks_count(2) == 1
assert validator_b.get_blocks_count(2) == 1
ceremony_master_blocks = ceremony_master.show_blocks_parsed(2)
assert len(ceremony_master_blocks) == 1
ceremony_master_genesis_block = ceremony_master_blocks[0]
assert ceremony_master_genesis_block['mainParentHash'] == ''
validator_a_blocks = validator_a.show_blocks_parsed(2)
assert len(validator_a_blocks) == 1
validator_a_genesis_block = validator_a_blocks[0]
assert validator_a_genesis_block['blockHash'] == ceremony_master_genesis_block['blockHash']
assert validator_a_genesis_block['mainParentHash'] == ''
validator_b_blocks = validator_b.show_blocks_parsed(2)
assert len(validator_b_blocks) == 1
validator_b_genesis_block = validator_b_blocks[0]
assert validator_b_genesis_block['blockHash'] == ceremony_master_genesis_block['blockHash']
assert validator_b_genesis_block['mainParentHash'] == ''
wait_for_approved_block_received_handler_state(context, readonly_a)
def test_validator_catching_up(command_line_options: CommandLineOptions, random_generator: Random, docker_client: DockerClient) -> None:
bootstrap_cli_options = {
'--deploy-timestamp': '1',
'--required-sigs': '2',
'--duration': '5min',
'--interval': '10sec',
}
peers_cli_flags = set(['--genesis-validator'])
peers_cli_options = {
'--deploy-timestamp': '1',
'--required-sigs': '2',
}
peers_keypairs = [
VALIDATOR_A_KEYPAIR,
VALIDATOR_B_KEYPAIR,
VALIDATOR_C_KEYPAIR
]
with testing_context(command_line_options, random_generator, docker_client, bootstrap_key=CEREMONY_MASTER_KEYPAIR, peers_keys=peers_keypairs) as context, \
temporary_wallets_file(context.random_generator) as wallets, \
ready_bootstrap(context=context, cli_options=bootstrap_cli_options, wallets_file=wallets) as ceremony_master, \
started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='validator-a', private_key=VALIDATOR_A_KEYPAIR, wallets_file=wallets, cli_flags=peers_cli_flags, cli_options=peers_cli_options) as validator_a, \
started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='validator-b', private_key=VALIDATOR_B_KEYPAIR, wallets_file=wallets, cli_flags=peers_cli_flags, cli_options=peers_cli_options) as validator_b:
wait_for_block_approval(context, ceremony_master)
wait_for_approved_block_received_handler_state(context, ceremony_master)
wait_for_sent_approved_block(context, ceremony_master)
wait_for_approved_block_received_handler_state(context, validator_a)
wait_for_approved_block_received_handler_state(context, validator_b)
assert ceremony_master.get_blocks_count(2) == 1
assert validator_a.get_blocks_count(2) == 1
assert validator_b.get_blocks_count(2) == 1
ceremony_master_blocks = ceremony_master.show_blocks_parsed(2)
assert len(ceremony_master_blocks) == 1
ceremony_master_genesis_block = ceremony_master_blocks[0]
assert ceremony_master_genesis_block['mainParentHash'] == ''
validator_a_blocks = validator_a.show_blocks_parsed(2)
assert len(validator_a_blocks) == 1
validator_a_genesis_block = validator_a_blocks[0]
assert validator_a_genesis_block['blockHash'] == ceremony_master_genesis_block['blockHash']
assert validator_a_genesis_block['mainParentHash'] == ''
validator_b_blocks = validator_b.show_blocks_parsed(2)
assert len(validator_b_blocks) == 1
validator_b_genesis_block = validator_b_blocks[0]
assert validator_b_genesis_block['blockHash'] == ceremony_master_genesis_block['blockHash']
assert validator_b_genesis_block['mainParentHash'] == ''
with started_peer(context=context, network=ceremony_master.network, bootstrap=ceremony_master, name='validator-c', private_key=VALIDATOR_C_KEYPAIR) as validator_c:
wait_for_approved_block_received_handler_state(context, validator_c)
assert validator_c.get_blocks_count(2) == 1
validator_c_blocks = validator_c.show_blocks_parsed(2)
assert len(validator_c_blocks) == 1
validator_c_genesis_block = validator_c_blocks[0]
assert validator_c_genesis_block['blockHash'] == ceremony_master_genesis_block['blockHash']
assert validator_c_genesis_block['mainParentHash'] == ''
validator_c_genesis_block_info = validator_c.show_block_parsed(validator_c_genesis_block['blockHash'].strip('"'))
validator_c_bonds_validator_stake = extract_validator_stake_from_bonds_validator_str(validator_c_genesis_block_info['bondsValidatorList'])
assert VALIDATOR_A_KEYPAIR.get_public_key().to_hex() in validator_c_bonds_validator_stake
assert VALIDATOR_B_KEYPAIR.get_public_key().to_hex()in validator_c_bonds_validator_stake | 56.62 | 248 | 0.735665 |
aceb20b020be22a2962ee0c24d740b78f575369b | 1,375 | py | Python | venv/lib/python3.7/site-packages/netmiko/netapp/netapp_cdot_ssh.py | pmorvay/nornir | 6eee093d9a65b690688a3da334a250f6447c5543 | [
"Apache-2.0"
] | 2 | 2019-07-23T02:27:19.000Z | 2019-07-23T02:27:25.000Z | netmiko/netapp/netapp_cdot_ssh.py | tyler-8/netmiko | df317927fcf5d742b5096c0db5ccbd0847c19f84 | [
"MIT"
] | null | null | null | netmiko/netapp/netapp_cdot_ssh.py | tyler-8/netmiko | df317927fcf5d742b5096c0db5ccbd0847c19f84 | [
"MIT"
] | 1 | 2019-10-16T19:02:32.000Z | 2019-10-16T19:02:32.000Z | from __future__ import unicode_literals
from netmiko.base_connection import BaseConnection
class NetAppcDotSSH(BaseConnection):
def session_preparation(self):
"""Prepare the session after the connection has been established."""
self.set_base_prompt()
cmd = self.RETURN + "rows 0" + self.RETURN
self.disable_paging(command=cmd)
def send_command_with_y(self, *args, **kwargs):
output = self.send_command_timing(*args, **kwargs)
if "{y|n}" in output:
output += self.send_command_timing(
"y", strip_prompt=False, strip_command=False
)
return output
def check_config_mode(self, check_string="*>"):
return super(NetAppcDotSSH, self).check_config_mode(check_string=check_string)
def config_mode(
self, config_command="set -privilege diagnostic -confirmations off"
):
return super(NetAppcDotSSH, self).config_mode(config_command=config_command)
def exit_config_mode(self, exit_config="set -privilege admin -confirmations off"):
return super(NetAppcDotSSH, self).exit_config_mode(exit_config=exit_config)
def enable(self, *args, **kwargs):
"""No enable mode on NetApp."""
pass
def check_enable_mode(self, *args, **kwargs):
pass
def exit_enable_mode(self, *args, **kwargs):
pass
| 33.536585 | 86 | 0.675636 |
aceb22617a4596caba79e7bc16e84ca91a81fcde | 383 | py | Python | Flask/request/app.py | zharmedia386/Python-Programming-Exercises | 5d27be4e72cc153ef6c677062a4783abfaf4390c | [
"MIT"
] | null | null | null | Flask/request/app.py | zharmedia386/Python-Programming-Exercises | 5d27be4e72cc153ef6c677062a4783abfaf4390c | [
"MIT"
] | null | null | null | Flask/request/app.py | zharmedia386/Python-Programming-Exercises | 5d27be4e72cc153ef6c677062a4783abfaf4390c | [
"MIT"
] | null | null | null | from flask import Flask, request
application = Flask(__name__)
@application.route('/')
def index():
# mengambil header dari objek request
headers = request.headers
response = [ '%s = %s' % (key, value) \
for key, value in sorted(headers.items())
]
response = '<br/>'.join(response)
return response
if __name__ == '__main__':
application.run(debug=True)
| 22.529412 | 47 | 0.660574 |
aceb23170d1bacc2cd7294f0982f3bb6e6014d81 | 1,084 | py | Python | jsonklog/handlers/basehandler.py | szaydel/jsonklog | ac4b8f5b75b4a0be60ecad9e71d624bad08c3fa1 | [
"Apache-2.0"
] | 5 | 2015-06-03T15:15:30.000Z | 2017-08-21T10:26:57.000Z | jsonklog/handlers/basehandler.py | szaydel/jsonklog | ac4b8f5b75b4a0be60ecad9e71d624bad08c3fa1 | [
"Apache-2.0"
] | 3 | 2016-09-20T16:21:19.000Z | 2020-09-28T10:16:30.000Z | jsonklog/handlers/basehandler.py | szaydel/jsonklog | ac4b8f5b75b4a0be60ecad9e71d624bad08c3fa1 | [
"Apache-2.0"
] | 3 | 2015-06-04T08:39:26.000Z | 2016-09-20T16:21:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright [2012] [Patrick Ancillotti]
# Copyright [2012] [Jason Kölker]
#
# 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 logging
from jsonklog.formatters import JSONFormatter
class RequireJSONFormatter(logging.Handler):
""" Mixin class to require a Handler be configured with a JSONFormmater """
def setFormatter(self, fmt):
if not isinstance(fmt, JSONFormatter):
raise TypeError("%s requires a JSONFormatter" %
self.__class__.__name__)
self.formatter = fmt
| 30.971429 | 79 | 0.698339 |
aceb23c02dac886b80d1e55d1cd70c3c20d1f84b | 515 | py | Python | files_for_copy/gen_data_file.py | roikeman/NPTS | 2ab2c73f35c90daf8edfc1c12b33d9fe66becb5d | [
"Unlicense"
] | null | null | null | files_for_copy/gen_data_file.py | roikeman/NPTS | 2ab2c73f35c90daf8edfc1c12b33d9fe66becb5d | [
"Unlicense"
] | null | null | null | files_for_copy/gen_data_file.py | roikeman/NPTS | 2ab2c73f35c90daf8edfc1c12b33d9fe66becb5d | [
"Unlicense"
] | null | null | null | import sys
import random
input,output,n,player=sys.argv[1:]
with open(input,'r') as file:
for line in file:
data=line.split(',')
file.close()
data=[int(d) for d in data]
data=set(data)
print(data)
random.seed()
while (len(data)!=int(n)):
#print(len(data))
data.add(int(random.random()*1000000))
print(data)
data=[str(d) for d in data]
with open (output,'w') as file:
for d in data[:-1]:
file.write(d+',')
file.write(data[-1])
file.close()
| 17.166667 | 43 | 0.580583 |
aceb24006b318d7d88867c374267e90f3717c8de | 699 | py | Python | var/spack/repos/builtin/packages/libsigsegv/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/libsigsegv/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/libsigsegv/package.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 import *
class Libsigsegv(AutotoolsPackage):
"""GNU libsigsegv is a library for handling page faults in user mode."""
homepage = "https://www.gnu.org/software/libsigsegv/"
url = "https://ftpmirror.gnu.org/libsigsegv/libsigsegv-2.11.tar.gz"
patch('patch.new_config_guess', when='@2.10')
version('2.11', 'a812d9481f6097f705599b218eea349f')
version('2.10', '7f96fb1f65b3b8cbc1582fb7be774f0f')
def configure_args(self):
return ['--enable-shared']
| 31.772727 | 76 | 0.716738 |
aceb242122c929577295a0ce56765c6cdc935045 | 826 | py | Python | dataactcore/scripts/reset_alembic_version.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | dataactcore/scripts/reset_alembic_version.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | 3 | 2021-08-22T11:47:45.000Z | 2022-03-29T22:06:49.000Z | dataactcore/scripts/reset_alembic_version.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | import argparse
from sqlalchemy import MetaData, Table
from sqlalchemy.sql import update
from dataactcore.interfaces.db import GlobalDB
from dataactvalidator.health_check import create_app
def reset_alembic(alembic_version):
with create_app().app_context():
db = GlobalDB.db()
engine = db.engine
sess = db.session
metadata = MetaData(bind=engine)
alembic_table = Table('alembic_version', metadata, autoload=True)
u = update(alembic_table)
u = u.values({"version_num": alembic_version})
sess.execute(u)
sess.commit()
parser = argparse.ArgumentParser(description="Reset alembic version table.")
parser.add_argument(
'version', help="Version to set the Alembic migration table to.")
v = vars(parser.parse_args())['version']
reset_alembic(v)
| 27.533333 | 76 | 0.710654 |
aceb24a06a2407b2901aa99f41872bea6311b11f | 12,348 | py | Python | main.py | jcchuks/triplet_loss_in_practice | 07100a81a4229014c3633e76189f6104751ca660 | [
"MIT"
] | 1 | 2021-04-13T06:32:53.000Z | 2021-04-13T06:32:53.000Z | main.py | jcchuks/triplet_loss_in_practice | 07100a81a4229014c3633e76189f6104751ca660 | [
"MIT"
] | null | null | null | main.py | jcchuks/triplet_loss_in_practice | 07100a81a4229014c3633e76189f6104751ca660 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import torch
from torch.utils.data import DataLoader
import torch.optim as optim
from torchvision import datasets, transforms, models
from opensource.siamesetriplet.datasets import BalancedBatchSampler
from opensource.siamesetriplet.losses import OnlineTripletLossV3, OnlineTripletLossV4, OnlineTripletLossV5
from extended_model import HowGoodIsTheModel, LilNet, IdentityNN, InputNet, EmbeddingNet
from sklearn import svm
from six.moves import urllib
import numpy as np
import torchvision
from torchvision.datasets import MNIST
from torchvision import transforms
import matplotlib.pyplot as plt
from opensource.siamesetriplet.metrics import AverageNonzeroTripletsMetric, SimilarityMetrics
from opensource.siamesetriplet.trainer import fit, best_model_path, best_model_file_name
from opensource.siamesetriplet.utils import SemihardNegativeTripletSelector, RandomNegativeTripletSelector, \
AllPositivePairSelector, AllTripletSelector, HardestNegativeTripletSelector, AllPositivePairSelector
from opensource.trainer import validate_recognition_task
import sys
from constants import *
import argparse
parser = argparse.ArgumentParser(description='Triplet loss in practice')
parser.add_argument('-m','--mode', help='set to "1" to use a path corresponding to main data \n '
'or "0" to use a path corresponding to a small subset'
' of data usually for test. see "base_path" in code', default=0)
parser.add_argument('-p','--pretrained', help='set to 0 to use the vanilla Embedding Net model or set to 1 to use the '
'resenet model with InputNet, IdentityNet and LilNet, '
'only vanilla model is supported on the mnist dataset. '
'To support resnet + Lilnet, adjust the input channels on LilNet, '
'and InputNet accordingly on mnist', default=0)
parser.add_argument('-d','--data', help='set to "mnist" to use mnist dataset or "xray" to use the '
'kaggle chest xray data', default='xray')
parser.add_argument('-t','--resume', help='Used to reload a previously saved model to continue training', default=0)
args = parser.parse_args()
if args.mode == 1:
is_live = True
if args.pretrained == 0:
use_vanilla_model = True
if args.resume == 1:
resume_training = True
if args.data == "mnist":
shared_params["dataset_type"] = "mnist"
torch.autograd.set_detect_anomaly(True)
cuda = torch.cuda.is_available()
if is_live:
n_epochs = 30
margin = 1
batch = 25
base_path = main_training_sample_path
log_interval = 20
train_loader, test_loader, validate_loader, model = None, None, None, None
device = torch.device("cuda:0" if cuda else "cpu")
os.makedirs(result_folder, exist_ok=True)
def load_mnist():
global shared_params
mean, std = 0.1307, 0.3081
train_dataset = MNIST('./data', train=True, download=True,
transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((mean,), (std,))
]))
test_dataset = MNIST('./data', train=False, download=True,
transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((mean,), (std,))
]))
shared_params["classes"] = 10
# We'll create mini batches by sampling labels that will be present in the mini batch and number of examples from each class
train_batch_sampler = BalancedBatchSampler(train_dataset.train_labels, n_classes=10, n_samples=25)
test_batch_sampler = BalancedBatchSampler(test_dataset.test_labels, n_classes=10, n_samples=25)
kwargs = {'num_workers': 1, 'pin_memory': True} if cuda else {}
online_train_loader = torch.utils.data.DataLoader(train_dataset, batch_sampler=train_batch_sampler, **kwargs)
online_test_loader = torch.utils.data.DataLoader(test_dataset, batch_sampler=test_batch_sampler, **kwargs)
return online_train_loader, online_test_loader
def loader(folder, dType=1, train="", nbatch=batch):
global shared_params
mean, std = 0.1307, 0.3081
transform = transforms.Compose(transforms=[transforms.Resize(320),
transforms.CenterCrop(440),
transforms.ToTensor(),
transforms.Normalize((mean,), (std,))
])
data_dir = os.path.join(base_path, folder)
data_sets = datasets.ImageFolder(data_dir, transform)
labels = torch.LongTensor([label for _, label in data_sets])
batch_sampler = BalancedBatchSampler(labels, n_classes=2, n_samples=nbatch)
if dType == 1:
print(f"{train} image size: {len(data_sets.samples)}")
# triplets_dataset = TripletXRay(data_sets, dType)
shared_params["classes"] = 2
data_loader = DataLoader(data_sets, batch_sampler=batch_sampler, num_workers=4)
# draw(data_loader, train)
return data_loader
def imshow(inp, title=None):
"""Imshow for Tensor."""
inp = inp.numpy().transpose((1, 2, 0))
mean = np.array([0.485, 0.456, 0.406])
std = np.array([0.229, 0.224, 0.225])
inp = std * inp + mean
inp = np.clip(inp, 0, 1)
plt.imshow(inp)
if title is not None:
plt.title(title)
plt.pause(0.001)
def dummy_plot(xvalue, data, label, xlabel, ylabel,):
assert n_epochs == len(data), f"datasize {len(data)} != epochs {n_epochs}"
plt.plot(xvalue, data, label=label)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.xticks([x for x in range(n_epochs, -1, -5)])
plt.legend()
plt.title("Loss over time")
def load_data():
test_loader = loader(test_folder, train="Test")
train_loader = loader(train_folder, dType=True, train="traing")
validate_loader = loader(validate_folder, train="val", nbatch=7)
return train_loader, test_loader, validate_loader
def extract_embeddings(dataloader, model):
with torch.no_grad():
model.eval()
embeddings = np.zeros((len(dataloader.dataset), 128))
labels = np.zeros(len(dataloader.dataset))
k = 0
for images, target in dataloader:
if cuda:
images = images.cuda()
dimension = model.get_embedding(images).data.cpu().numpy()
embeddings[k:k + len(images)] = dimension
labels[k:k + len(images)] = target.numpy()
k += len(images)
return embeddings, labels
def draw(test_loader, title=""):
images, labels = next(iter(test_loader))
# print ( len(images))
# print ( len(labels))
out = torchvision.utils.make_grid(images)
imshow(out, title=[label_dir[x] for x in labels])
def get_model():
base_model = InputNet()
trunk_model = models.resnet18(pretrained=True)
# print(trunk_model)
#in_channel = 389376
output_model = LilNet()
# summary(trunk_model,(3,299,299))
for param in trunk_model.parameters():
param.requires_grad = True
base_model.nextmodel = trunk_model
trunk_model.conv1 = IdentityNN()
trunk_model.bn1 = IdentityNN()
trunk_model.relu = IdentityNN()
trunk_model.maxpool = IdentityNN()
trunk_model.layer1 = IdentityNN()
trunk_model.layer4 = output_model
trunk_model.avgpool = IdentityNN()
trunk_model.fc = IdentityNN()
if use_vanilla_model == "mnist":
base_model = EmbeddingNet()
base_model.to(device)
return base_model
def loadmodel(model, optimizer, save_path, test_name):
global best_model_file_name
PATH = os.path.join(save_path, test_name + best_model_file_name)
checkpoint = torch.load(PATH)
model.load_state_dict(checkpoint['model_state_dict'])
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
epoch = checkpoint['epoch']
loss = checkpoint['training_loss']
print(f"starting from epoch {epoch} with a loss of {loss}")
def main(tripletLoss, testName):
global train_loader, test_loader, validate_loader, model, use_saved_model
model = get_model()
if shared_params["dataset_type"] == "mnist":
train_loader, validate_loader = load_mnist()
test_loader = validate_loader
print(f"Loading mnist data")
else:
train_loader, test_loader, validate_loader = load_data()
print (f"Using {margin}; epoch {n_epochs}")
loss_function = tripletLoss(margin=margin,
#triplet_selector=AllTripletSelector())
triplet_selector=SemihardNegativeTripletSelector(margin=margin, cpu=not cuda))
lr = 1e-3
w_decay = 1e-4
optimizer = optim.Adam(model.parameters(), lr=lr, weight_decay=w_decay)
if resume_training:
loadmodel(model, optimizer, best_model_path, testName)
scheduler = optim.lr_scheduler.StepLR(optimizer, 8, gamma=0.1, last_epoch=-1)
training_metric = AverageNonzeroTripletsMetric()
training_metric.set_metric_name(training_and_validation_metric)
training_loss, validation_loss, training_metric, validation_metric = fit(testName,train_loader, validate_loader, model, loss_function,
optimizer, scheduler, n_epochs, cuda, log_interval,
metrics=[training_metric],
pegged_metric=training_and_validation_metric,
save_path=best_model_path)
label_over_n_epochs = range(1, n_epochs + 1)
dummy_plot(label_over_n_epochs, training_loss, "Training Loss", xlabel="Epoch", ylabel="Loss")
dummy_plot(label_over_n_epochs, validation_loss, "Validation Loss", xlabel="Epoch", ylabel="Loss")
plt.savefig(os.path.join(result_folder, testName+loss_graph), bbox_inches='tight')
#plt.show()
plt.close()
dummy_plot(label_over_n_epochs, training_metric, "Training Average Nonzero Triplets", xlabel="Epoch", ylabel="Loss")
dummy_plot(label_over_n_epochs, validation_metric, "Validation Average Nonzero Triplets", xlabel="Epoch", ylabel="Loss")
plt.savefig(os.path.join(result_folder, testName+metric_graph), bbox_inches='tight')
plt.close()
def do_recognition(loader, testName, types):
model = get_model()
checkpoint = torch.load(os.path.join(best_model_path, testName+best_model_file_name ))
model.load_state_dict(checkpoint['model_state_dict'])
epoch = checkpoint['epoch']
anchors = checkpoint['anchors']
validationloss = checkpoint['validation_loss']
trainingloss = checkpoint['training_loss']
svm= checkpoint['svm']
message=checkpoint['message']
model.to(device)
print(f"[Resuming {testName} - {types}] Loading model saved at epoch {epoch} with val_loss:{validationloss} and train_loss:{trainingloss}")
print(message)
validation_function = HowGoodIsTheModel(pairSelector=AllPositivePairSelector(balance=True),
anchors = anchors,
margin=margin,
cuda=cuda,
svm=svm)
# Note we call model.eval inside the test_epoch func.
validation_memo = validate_recognition_task(types, loader, model, validation_function,
cuda, testName, metrics=[SimilarityMetrics()])
if "__main__" == __name__:
for tripletLossLayer, testname in [(OnlineTripletLossV4, "_tripletLossXRay")]:
main(tripletLossLayer, testname)
if shared_params["dataset_type"] == "mnist":
train_loader, validate_loader = load_mnist()
test_loader = validate_loader
else:
train_loader, test_loader, validate_loader = load_data()
do_recognition(train_loader, testName=testname, types="_train")
do_recognition(validate_loader, testName=testname, types="_validate")
do_recognition(test_loader, testName=testname, types= "_test")
| 41.716216 | 143 | 0.658325 |
aceb25428e8f270ee9646c0936cb8a37c691224c | 725 | py | Python | test/win/gyptest-sys.py | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | test/win/gyptest-sys.py | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | test/win/gyptest-sys.py | chlorm-forks/gyp | a8921fcaab1a18c8cf7e4ab09ceb940e336918ec | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
# Copyright (c) 2016 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that Windows drivers are built correctly.
"""
import TestGyp
import TestCmd
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs'])
CHDIR = 'win-driver-target-type'
test.run_gyp('win-driver-target-type.gyp', chdir=CHDIR)
maybe_missing = r'[\s\S]+?(WindowsKernelModeDriver|Build succeeded.)[\s\S]+?'
test.build('win-driver-target-type.gyp', 'win_driver_target_type',
chdir=CHDIR, stdout=maybe_missing,
status=[0, 1], match=TestCmd.match_re_dotall)
test.pass_test()
| 25.892857 | 79 | 0.702069 |
aceb260dcfb1ba81d4b6f9a32defa46fed86489c | 1,991 | py | Python | odps/pai/metrics/classification.py | ZZHGit/aliyun-odps-python-sdk | e1c39378863ec7a1947487acab38125ac77f178e | [
"Apache-2.0"
] | null | null | null | odps/pai/metrics/classification.py | ZZHGit/aliyun-odps-python-sdk | e1c39378863ec7a1947487acab38125ac77f178e | [
"Apache-2.0"
] | null | null | null | odps/pai/metrics/classification.py | ZZHGit/aliyun-odps-python-sdk | e1c39378863ec7a1947487acab38125ac77f178e | [
"Apache-2.0"
] | 1 | 2019-09-18T05:35:29.000Z | 2019-09-18T05:35:29.000Z | # encoding: utf-8
# 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.
import logging
from .nodes.classification import ConfusionMatrixNode, ROCCurveNode
from ..sink import Sink
logger = logging.getLogger(__name__)
def confusion_matrix(dataset, col_true, col_pred='prediction_result'):
logger.debug('Operation step confusion_matrix called.')
mat_sink, col_sink = Sink(), Sink()
cm_node = ConfusionMatrixNode(col_true, col_pred, mat_sink, col_sink)
dataset._context()._dag.add_node(cm_node)
dataset._context()._dag.add_link(dataset._bind_node, dataset._bind_output, cm_node, "input")
dataset._context()._run(cm_node)
return mat_sink(), col_sink()
def roc_curve(dataset, pos_label, col_true, col_pred='prediction_result', col_scores='prediction_score'):
logger.debug('Operation step roc_curve called.')
fpr_sink, tpr_sink, thresholds_sink = Sink(), Sink(), Sink()
roc_node = ROCCurveNode(col_true, col_pred, col_scores, pos_label, fpr_sink, tpr_sink, thresholds_sink)
dataset._context()._dag.add_node(roc_node)
dataset._context()._dag.add_link(dataset._bind_node, dataset._bind_output, roc_node, "input")
dataset._context()._run(roc_node)
return fpr_sink(), tpr_sink(), thresholds_sink()
| 37.566038 | 107 | 0.760422 |
aceb26f6fb0199553884226aa80fd15b6cc128c1 | 12,122 | py | Python | onpolicy/runner/shared/mpe_runner.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-07-04T08:08:30.000Z | 2021-07-04T08:08:30.000Z | onpolicy/runner/shared/mpe_runner.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-06-11T15:28:11.000Z | 2021-06-11T15:28:11.000Z | onpolicy/runner/shared/mpe_runner.py | zoeyuchao/onpolicy-release | c2cb64e59c5b1f21cce022db76c378b396fd480e | [
"MIT"
] | 1 | 2021-05-17T02:00:18.000Z | 2021-05-17T02:00:18.000Z |
import time
import wandb
import os
import numpy as np
from itertools import chain
import torch
import imageio
from icecream import ic
from onpolicy.utils.util import update_linear_schedule
from onpolicy.runner.shared.base_runner import Runner
def _t2n(x):
return x.detach().cpu().numpy()
class MPERunner(Runner):
def __init__(self, config):
super(MPERunner, self).__init__(config)
def run(self):
self.warmup()
start = time.time()
episodes = int(self.num_env_steps) // self.episode_length // self.n_rollout_threads
for episode in range(episodes):
if self.use_linear_lr_decay:
self.trainer.policy.lr_decay(episode, episodes)
for step in range(self.episode_length):
# Sample actions
values, actions, action_log_probs, rnn_states, rnn_states_critic, actions_env = self.collect(step)
# Obser reward and next obs
obs, rewards, dones, infos = self.envs.step(actions_env)
data = obs, rewards, dones, infos, values, actions, action_log_probs, rnn_states, rnn_states_critic
# insert data into buffer
self.insert(data)
# compute return and update network
self.compute()
train_infos = self.train()
# post process
total_num_steps = (episode + 1) * self.episode_length * self.n_rollout_threads
# save model
if (episode % self.save_interval == 0 or episode == episodes - 1):
self.save()
# log information
if episode % self.log_interval == 0:
end = time.time()
print("\n Scenario {} Algo {} Exp {} updates {}/{} episodes, total num timesteps {}/{}, FPS {}.\n"
.format(self.all_args.scenario_name,
self.algorithm_name,
self.experiment_name,
episode,
episodes,
total_num_steps,
self.num_env_steps,
int(total_num_steps / (end - start))))
if self.env_name == "MPE":
env_infos = {}
for agent_id in range(self.num_agents):
idv_rews = []
for info in infos:
if 'individual_reward' in info[agent_id].keys():
idv_rews.append(info[agent_id]['individual_reward'])
agent_k = 'agent%i/individual_rewards' % agent_id
env_infos[agent_k] = idv_rews
train_infos["average_episode_rewards"] = np.mean(self.buffer.rewards) * self.episode_length
print("average episode rewards is {}".format(train_infos["average_episode_rewards"]))
self.log_train(train_infos, total_num_steps)
self.log_env(env_infos, total_num_steps)
# eval
if episode % self.eval_interval == 0 and self.use_eval:
self.eval(total_num_steps)
def warmup(self):
# reset env
obs = self.envs.reset()
# replay buffer
if self.use_centralized_V:
share_obs = obs.reshape(self.n_rollout_threads, -1)
share_obs = np.expand_dims(share_obs, 1).repeat(self.num_agents, axis=1)
else:
share_obs = obs
self.buffer.share_obs[0] = share_obs.copy()
self.buffer.obs[0] = obs.copy()
@torch.no_grad()
def collect(self, step):
self.trainer.prep_rollout()
value, action, action_log_prob, rnn_states, rnn_states_critic \
= self.trainer.policy.get_actions(np.concatenate(self.buffer.share_obs[step]),
np.concatenate(self.buffer.obs[step]),
np.concatenate(self.buffer.rnn_states[step]),
np.concatenate(self.buffer.rnn_states_critic[step]),
np.concatenate(self.buffer.masks[step]))
# [self.envs, agents, dim]
values = np.array(np.split(_t2n(value), self.n_rollout_threads))
actions = np.array(np.split(_t2n(action), self.n_rollout_threads))
action_log_probs = np.array(np.split(_t2n(action_log_prob), self.n_rollout_threads))
rnn_states = np.array(np.split(_t2n(rnn_states), self.n_rollout_threads))
rnn_states_critic = np.array(np.split(_t2n(rnn_states_critic), self.n_rollout_threads))
# rearrange action
if self.envs.action_space[0].__class__.__name__ == 'MultiDiscrete':
for i in range(self.envs.action_space[0].shape):
uc_actions_env = np.eye(self.envs.action_space[0].high[i] + 1)[actions[:, :, i]]
if i == 0:
actions_env = uc_actions_env
else:
actions_env = np.concatenate((actions_env, uc_actions_env), axis=2)
elif self.envs.action_space[0].__class__.__name__ == 'Discrete':
actions_env = np.squeeze(np.eye(self.envs.action_space[0].n)[actions], 2)
else:
raise NotImplementedError
return values, actions, action_log_probs, rnn_states, rnn_states_critic, actions_env
def insert(self, data):
obs, rewards, dones, infos, values, actions, action_log_probs, rnn_states, rnn_states_critic = data
rnn_states[dones == True] = np.zeros(((dones == True).sum(), self.recurrent_N, self.hidden_size), dtype=np.float32)
rnn_states_critic[dones == True] = np.zeros(((dones == True).sum(), *self.buffer.rnn_states_critic.shape[3:]), dtype=np.float32)
masks = np.ones((self.n_rollout_threads, self.num_agents, 1), dtype=np.float32)
masks[dones == True] = np.zeros(((dones == True).sum(), 1), dtype=np.float32)
if self.use_centralized_V:
share_obs = obs.reshape(self.n_rollout_threads, -1)
share_obs = np.expand_dims(share_obs, 1).repeat(self.num_agents, axis=1)
else:
share_obs = obs
self.buffer.insert(share_obs, obs, rnn_states, rnn_states_critic, actions, action_log_probs, values, rewards, masks)
@torch.no_grad()
def eval(self, total_num_steps):
eval_episode_rewards = []
eval_obs = self.eval_envs.reset()
eval_rnn_states = np.zeros((self.n_eval_rollout_threads, *self.buffer.rnn_states.shape[2:]), dtype=np.float32)
eval_masks = np.ones((self.n_eval_rollout_threads, self.num_agents, 1), dtype=np.float32)
for eval_step in range(self.episode_length):
self.trainer.prep_rollout()
eval_action, eval_rnn_states = self.trainer.policy.act(np.concatenate(eval_obs),
np.concatenate(eval_rnn_states),
np.concatenate(eval_masks),
deterministic=True)
eval_actions = np.array(np.split(_t2n(eval_action), self.n_eval_rollout_threads))
eval_rnn_states = np.array(np.split(_t2n(eval_rnn_states), self.n_eval_rollout_threads))
if self.eval_envs.action_space[0].__class__.__name__ == 'MultiDiscrete':
for i in range(self.eval_envs.action_space[0].shape):
eval_uc_actions_env = np.eye(self.eval_envs.action_space[0].high[i]+1)[eval_actions[:, :, i]]
if i == 0:
eval_actions_env = eval_uc_actions_env
else:
eval_actions_env = np.concatenate((eval_actions_env, eval_uc_actions_env), axis=2)
elif self.eval_envs.action_space[0].__class__.__name__ == 'Discrete':
eval_actions_env = np.squeeze(np.eye(self.eval_envs.action_space[0].n)[eval_actions], 2)
else:
raise NotImplementedError
# Obser reward and next obs
eval_obs, eval_rewards, eval_dones, eval_infos = self.eval_envs.step(eval_actions_env)
eval_episode_rewards.append(eval_rewards)
eval_rnn_states[eval_dones == True] = np.zeros(((eval_dones == True).sum(), self.recurrent_N, self.hidden_size), dtype=np.float32)
eval_masks = np.ones((self.n_eval_rollout_threads, self.num_agents, 1), dtype=np.float32)
eval_masks[eval_dones == True] = np.zeros(((eval_dones == True).sum(), 1), dtype=np.float32)
eval_episode_rewards = np.array(eval_episode_rewards)
eval_env_infos = {}
eval_env_infos['eval_average_episode_rewards'] = np.sum(np.array(eval_episode_rewards), axis=0)
print("eval average episode rewards of agent: " + str(np.mean(eval_env_infos['eval_average_episode_rewards'])))
self.log_env(eval_env_infos, total_num_steps)
@torch.no_grad()
def render(self):
envs = self.envs
all_frames = []
for episode in range(self.all_args.render_episodes):
obs = envs.reset()
if self.all_args.save_gifs:
image = envs.render('rgb_array')[0][0]
all_frames.append(image)
else:
envs.render('human')
rnn_states = np.zeros((self.n_rollout_threads, self.num_agents, self.recurrent_N, self.hidden_size), dtype=np.float32)
masks = np.ones((self.n_rollout_threads, self.num_agents, 1), dtype=np.float32)
episode_rewards = []
for step in range(self.episode_length):
calc_start = time.time()
self.trainer.prep_rollout()
action, rnn_states = self.trainer.policy.act(np.concatenate(obs),
np.concatenate(rnn_states),
np.concatenate(masks),
deterministic=True)
actions = np.array(np.split(_t2n(action), self.n_rollout_threads))
rnn_states = np.array(np.split(_t2n(rnn_states), self.n_rollout_threads))
if envs.action_space[0].__class__.__name__ == 'MultiDiscrete':
for i in range(envs.action_space[0].shape):
uc_actions_env = np.eye(envs.action_space[0].high[i]+1)[actions[:, :, i]]
if i == 0:
actions_env = uc_actions_env
else:
actions_env = np.concatenate((actions_env, uc_actions_env), axis=2)
elif envs.action_space[0].__class__.__name__ == 'Discrete':
actions_env = np.squeeze(np.eye(envs.action_space[0].n)[actions], 2)
else:
raise NotImplementedError
# Obser reward and next obs
obs, rewards, dones, infos = envs.step(actions_env)
episode_rewards.append(rewards)
rnn_states[dones == True] = np.zeros(((dones == True).sum(), self.recurrent_N, self.hidden_size), dtype=np.float32)
masks = np.ones((self.n_rollout_threads, self.num_agents, 1), dtype=np.float32)
masks[dones == True] = np.zeros(((dones == True).sum(), 1), dtype=np.float32)
if self.all_args.save_gifs:
image = envs.render('rgb_array')[0][0]
all_frames.append(image)
calc_end = time.time()
elapsed = calc_end - calc_start
if elapsed < self.all_args.ifi:
time.sleep(self.all_args.ifi - elapsed)
else:
envs.render('human')
print("average episode rewards is: " + str(np.mean(np.sum(np.array(episode_rewards), axis=0))))
if self.all_args.save_gifs:
imageio.mimsave(str(self.gif_dir) + '/render.gif', all_frames, duration=self.all_args.ifi)
| 48.103175 | 142 | 0.574905 |
aceb27f76f1c2262ec66807950bd55a34dcbb7ec | 540 | py | Python | mytoolbox/text/size.py | Jacobe2169/my_toolbox | 1b89af8cf54dc5c6e0b0bb0cff96e7dd2bd400e2 | [
"MIT"
] | null | null | null | mytoolbox/text/size.py | Jacobe2169/my_toolbox | 1b89af8cf54dc5c6e0b0bb0cff96e7dd2bd400e2 | [
"MIT"
] | null | null | null | mytoolbox/text/size.py | Jacobe2169/my_toolbox | 1b89af8cf54dc5c6e0b0bb0cff96e7dd2bd400e2 | [
"MIT"
] | null | null | null | import os
def blocks(files, size=65536):
while True:
b = files.read(size)
if not b: break
yield b
def wc_l(text_input_fn):
"""
Count the number of line in a file
Parameters
----------
text_input_fn : str
filepath
"""
if not os.path.exists(text_input_fn):
raise FileNotFoundError("{0} does not exists !".format(text_input_fn))
with open(text_input_fn, "r",encoding="utf-8",errors='ignore') as f:
return (sum(bl.count("\n") for bl in blocks(f))) | 23.478261 | 78 | 0.587037 |
aceb29154c2185e704bf568b3d023bfe66de4e73 | 1,203 | py | Python | ems/utils.py | EMSTrack/EMS-Simulator | 50b0dd60bfa7c5c115fc011e830d275b4eb07ab5 | [
"MIT"
] | 1 | 2020-07-15T00:16:48.000Z | 2020-07-15T00:16:48.000Z | ems/utils.py | EMSTrack/Algorithms | 139160619a935001582a60d3f43c0e33082bce99 | [
"BSD-3-Clause"
] | 40 | 2018-12-06T23:13:52.000Z | 2019-07-11T01:24:13.000Z | ems/utils.py | EMSTrack/Algorithms | 139160619a935001582a60d3f43c0e33082bce99 | [
"BSD-3-Clause"
] | 1 | 2020-04-23T11:17:43.000Z | 2020-04-23T11:17:43.000Z | import pandas as pd
def parse_headered_csv (file: str, desired_keys: list):
"""
Takes a headered CSV file and extracts the columns with the desired keys
:param file: CSV filename
:param desired_keys: Names of columns to extract
:return: pandas dataframe
"""
if file is None:
return None
raw = pd.read_csv (file)
keys_read = raw.keys()
for key in desired_keys:
if key not in keys_read:
raise Exception("{} was not found in keys of file {}".format(key, file))
return raw[desired_keys]
def parse_unheadered_csv (file: str, positions: list, header_names: list):
"""
Takes an unheadered CSV file, extracts the columns based on given positions,
and provides them headers for the pandas dataframe
:param file: CSV filename
:param positions: Indices of the columns to extract
:param header_names: Header names for the extracted columns
:return: pandas dataframe
"""
if file is None:
return None
raw = pd.read_csv (file)
headered_df = pd.DataFrame()
for pos, header in zip(positions, header_names):
headered_df[header] = raw.iloc[:, pos]
return headered_df
| 25.0625 | 84 | 0.670823 |
aceb2931820e4ffe49d5f0c4080ebe958a22570c | 9,778 | py | Python | src/controller/agent.py | SSICLOPS/interconnection-agent | 98bd23337de2cc27e0c84d7d1f1c2e060110a4ad | [
"BSD-3-Clause"
] | null | null | null | src/controller/agent.py | SSICLOPS/interconnection-agent | 98bd23337de2cc27e0c84d7d1f1c2e060110a4ad | [
"BSD-3-Clause"
] | null | null | null | src/controller/agent.py | SSICLOPS/interconnection-agent | 98bd23337de2cc27e0c84d7d1f1c2e060110a4ad | [
"BSD-3-Clause"
] | null | null | null | """
BSD 3-Clause License
Copyright (c) 2018, Maël Kimmerlin, Aalto University, Finland
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
"""
import asyncio
import logging
from marshmallow import Schema, fields, post_load, ValidationError, validate
import utils
from tunneling import l2_tunnel, network, expansion, mptcp_proxy
from ipsec import vpn_connection
from helpers_n_wrappers import container3, utils3
class Agent_schema(Schema):
node_uuid = fields.Str(validate=utils.validate_uuid)
vni = fields.Integer(validate=lambda n: 2<= n <= 4095)
standalone = fields.Boolean()
runtime_id = fields.Integer()
mptcp_capable = fields.Boolean()
@post_load
def load_node(self, data):
return Agent(**data)
class Agent(container3.ContainerNode):
def __init__(self, **kwargs):
super().__init__(name="Agent")
self.addresses = []
utils3.set_attributes(self, override = True, **kwargs)
self.loading = asyncio.Event()
self.loading.set()
self.restarting = False
def lookupkeys(self):
keys = []
keys.append((utils.KEY_AGENT, False))
keys.append(((utils.KEY_AGENT, self.node_uuid), True))
keys.append((self.node_uuid, True))
for address in self.addresses:
keys.append(((utils.KEY_AGENT, utils.KEY_AGENT_IP,
address
), True))
return keys
def update(self, **kwargs):
utils3.set_attributes(self, override = True, **kwargs)
async def reload(self, data_store, amqp):
tunnels = []
connections = []
expansions = []
mptcp_proxies = []
#find all tunnels on this node
for address in self.addresses:
tunnels_list = list(data_store.lookup_list((utils.KEY_L2_TUNNEL,
utils.KEY_L2_TUNNEL_IP, address
), False, False
))
for tunnel_obj in tunnels_list:
if tunnel_obj.deleting:
data_store.remove(tunnel_obj)
else:
tunnels.append(tunnel_obj)
logging.debug("Applying tunnels configuration: {}".format(
[tunnel_obj.node_id for tunnel_obj in tunnels]
))
#For each, create them and find associated connections and expansions
for tunnel in tunnels:
connections_list = list(data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_CONNECTION, tunnel.node_id
), False, False
))
for connection_obj in connections_list:
if connection_obj.deleting:
data_store.remove(connection_obj)
else:
connections.append(connection_obj)
expansions_list = list(data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_EXPANSION, tunnel.node_id
), False, False
))
for expansion_obj in expansions_list:
if expansion_obj.deleting:
data_store.remove(expansion_obj)
else:
expansions.append(expansion_obj)
if self.mptcp_capable:
mptcp_proxies = list(data_store.lookup_list(
(utils.KEY_MPTCP_PROXY, utils.KEY_AGENT, self.node_uuid),
False, False
))
for mptcp_proxy_obj in mptcp_proxies:
if mptcp_proxy_obj.deleting:
data_store.remove(mptcp_proxy_obj)
mptcp_proxies = data_store.lookup_list((utils.KEY_MPTCP_PROXY,
utils.KEY_AGENT, self.node_uuid), False, False)
self.restarting = False
for tunnel in tunnels:
await l2_tunnel.send_create_tunnel(data_store, amqp, tunnel,
no_wait = True)
logging.debug("Applying connections configuration: {}".format(
[con.node_id for con in connections]
))
#For each connection, create it
for connection in connections:
await vpn_connection.send_create_connection(data_store, amqp,
connection, no_wait = True
)
#Assume namespaces deleted, host reboot = deletion
for network_obj in data_store.lookup_list(utils.KEY_NETWORK,
False, False):
if self.node_uuid in network_obj.agents_deployed:
network_obj.agents_deployed.discard(self.node_uuid)
#Create all the expansions
for expansion_obj in expansions:
await expansion.send_create_expansion(data_store, amqp,
expansion_obj, no_wait = True
)
for mptcp_proxy_obj in mptcp_proxies:
await mptcp_proxy.send_create_proxy(data_store, amqp,
mptcp_proxy_obj, no_wait = True
)
async def update_tunnels(self, data_store, amqp, old_addresses, new_addresses):
#Remove the expansions using the tunnels and the tunnels
for address in old_addresses - new_addresses:
if not data_store.has((utils.KEY_L2_TUNNEL, utils.KEY_L2_TUNNEL_IP,
address)):
continue
for tunnel in data_store.get(utils.KEY_L2_TUNNEL,
utils.KEY_L2_TUNNEL_IP, address):
for expansion_obj in data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_EXPANSION, tunnel.node_id ), False, False):
await expansion.send_delete_expansion(data_store, amqp,
expansion_obj
)
await l2_tunnel.send_delete_tunnel(data_store, amqp, tunnel)
self.addresses = payload["addresses"]
data_store.updatekeys(self)
#add the new tunnels and create the associated expansions
for address in new_addresses - old_addresses:
if not data_store.has((utils.KEY_L2_TUNNEL, utils.KEY_L2_TUNNEL_IP,
address)):
continue
for tunnel in data_store.get(utils.KEY_L2_TUNNEL,
utils.KEY_L2_TUNNEL_IP, address):
await l2_tunnel.send_create_tunnel(data_store, amqp, tunnel)
for expansion_obj in data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_EXPANSION, tunnel.node_id ), False, False):
await expansion.send_create_expansion(data_store, amqp,
expansion_obj)
async def update_networks(self, data_store, amqp, old_networks, new_networks):
logging.debug("Updating the networks")
#Remove expansions for old networks and old networks
for network_cloud_id in old_networks - new_networks:
if not data_store.has((utils.KEY_NETWORK, utils.KEY_CLOUD_NET_ID,
network_cloud_id )):
continue
network_obj = data_store.get((utils.KEY_NETWORK, utils.KEY_CLOUD_NET_ID,
network_cloud_id
))
for expansion_obj in data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_EXPANSION, network_obj.node_id ), False, False):
await expansion.send_delete_expansion(data_store, amqp,
expansion_obj)
await network.remove_all_propagated_network(data_store, amqp, network_obj)
self.networks = new_networks
data_store.updatekeys(self)
#Create the expansions for the new networks
for network_cloud_id in new_networks - old_networks:
if not data_store.has((utils.KEY_NETWORK, utils.KEY_CLOUD_NET_ID,
network_cloud_id )):
continue
network_obj = data_store.get((utils.KEY_NETWORK, utils.KEY_CLOUD_NET_ID,
network_cloud_id
))
for expansion_obj in data_store.lookup_list((utils.KEY_IN_USE,
utils.KEY_EXPANSION, network_obj.node_id ), False, False):
await expansion.send_create_expansion(data_store, amqp,
expansion_obj) | 42.69869 | 86 | 0.623338 |
aceb29966da15fd0bd37666778d7a02ed260d1e9 | 285 | py | Python | sample_config.py | marcosir/Telegram_VC_Bot | f8c7db6237a06fd58bd966f5583c092a36459f53 | [
"MIT"
] | null | null | null | sample_config.py | marcosir/Telegram_VC_Bot | f8c7db6237a06fd58bd966f5583c092a36459f53 | [
"MIT"
] | null | null | null | sample_config.py | marcosir/Telegram_VC_Bot | f8c7db6237a06fd58bd966f5583c092a36459f53 | [
"MIT"
] | null | null | null | API_ID = 1686243
API_HASH = "e6ff820963be298cfef580c81e5ee281"
SUDO_CHAT_ID = -1001178564235 # Chat where the bot will play the music.
SUDOERS = [1569115700] # Users which have special control over the bot.
# don't make changes below this line
ARQ_API = "http://35.240.133.234:8000"
| 35.625 | 72 | 0.764912 |
aceb2acbef36dd16c95092186961f5a82656691c | 8,716 | py | Python | OpenAttack/attackers/sea/onmt/modules/Conv2Conv.py | zangy17/OpenAttack | 9114a8af12680f14684d2bf1bc6a5c5e34f8932c | [
"MIT"
] | 10 | 2021-12-01T15:35:05.000Z | 2022-03-16T16:10:24.000Z | OpenAttack/attackers/sea/onmt/modules/Conv2Conv.py | leileigan/clean_label_textual_backdoor_attack | 56e3a96f6a4eeaf30b90a275685f37cc7e7b3c7c | [
"Apache-2.0"
] | null | null | null | OpenAttack/attackers/sea/onmt/modules/Conv2Conv.py | leileigan/clean_label_textual_backdoor_attack | 56e3a96f6a4eeaf30b90a275685f37cc7e7b3c7c | [
"Apache-2.0"
] | 1 | 2020-09-01T11:14:42.000Z | 2020-09-01T11:14:42.000Z | """
Implementation of "Convolutional Sequence to Sequence Learning"
"""
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.autograd import Variable
from .. import modules
from ..modules.WeightNorm import WeightNormConv2d
from ..Models import EncoderBase
from ..Models import DecoderState
from ..Utils import aeq
SCALE_WEIGHT = 0.5 ** 0.5
def shape_transform(x):
""" Tranform the size of the tensors to fit for conv input. """
return torch.unsqueeze(torch.transpose(x, 1, 2), 3)
class GatedConv(nn.Module):
def __init__(self, input_size, width=3, dropout=0.2, nopad=False):
super(GatedConv, self).__init__()
self.conv = WeightNormConv2d(input_size, 2 * input_size,
kernel_size=(width, 1), stride=(1, 1),
padding=(width // 2 * (1 - nopad), 0))
init.xavier_uniform(self.conv.weight, gain=(4 * (1 - dropout))**0.5)
self.dropout = nn.Dropout(dropout)
def forward(self, x_var, hidden=None):
x_var = self.dropout(x_var)
x_var = self.conv(x_var)
out, gate = x_var.split(int(x_var.size(1) / 2), 1)
out = out * F.sigmoid(gate)
return out
class StackedCNN(nn.Module):
def __init__(self, num_layers, input_size, cnn_kernel_width=3,
dropout=0.2):
super(StackedCNN, self).__init__()
self.dropout = dropout
self.num_layers = num_layers
self.layers = nn.ModuleList()
for i in range(num_layers):
self.layers.append(
GatedConv(input_size, cnn_kernel_width, dropout))
def forward(self, x, hidden=None):
for conv in self.layers:
x = x + conv(x)
x *= SCALE_WEIGHT
return x
class CNNEncoder(EncoderBase):
"""
Encoder built on CNN.
"""
def __init__(self, num_layers, hidden_size,
cnn_kernel_width, dropout, embeddings):
super(CNNEncoder, self).__init__()
self.embeddings = embeddings
input_size = embeddings.embedding_size
self.linear = nn.Linear(input_size, hidden_size)
self.cnn = StackedCNN(num_layers, hidden_size,
cnn_kernel_width, dropout)
def forward(self, input, lengths=None, hidden=None):
""" See EncoderBase.forward() for description of args and returns."""
self._check_args(input, lengths, hidden)
emb = self.embeddings(input)
s_len, batch, emb_dim = emb.size()
emb = emb.transpose(0, 1).contiguous()
emb_reshape = emb.view(emb.size(0) * emb.size(1), -1)
emb_remap = self.linear(emb_reshape)
emb_remap = emb_remap.view(emb.size(0), emb.size(1), -1)
emb_remap = shape_transform(emb_remap)
out = self.cnn(emb_remap)
return emb_remap.squeeze(3).transpose(0, 1).contiguous(),\
out.squeeze(3).transpose(0, 1).contiguous()
class CNNDecoder(nn.Module):
"""
Decoder built on CNN, which consists of resduial convolutional layers,
with ConvMultiStepAttention.
"""
def __init__(self, num_layers, hidden_size, attn_type,
copy_attn, cnn_kernel_width, dropout, embeddings):
super(CNNDecoder, self).__init__()
# Basic attributes.
self.decoder_type = 'cnn'
self.num_layers = num_layers
self.hidden_size = hidden_size
self.cnn_kernel_width = cnn_kernel_width
self.embeddings = embeddings
self.dropout = dropout
# Build the CNN.
input_size = self.embeddings.embedding_size
self.linear = nn.Linear(input_size, self.hidden_size)
self.conv_layers = nn.ModuleList()
for i in range(self.num_layers):
self.conv_layers.append(
GatedConv(self.hidden_size, self.cnn_kernel_width,
self.dropout, True))
self.attn_layers = nn.ModuleList()
for i in range(self.num_layers):
self.attn_layers.append(
modules.ConvMultiStepAttention(self.hidden_size))
# CNNDecoder has its own attention mechanism.
# Set up a separated copy attention layer, if needed.
self._copy = False
if copy_attn:
self.copy_attn = modules.GlobalAttention(
hidden_size, attn_type=attn_type)
self._copy = True
def forward(self, input, context, state, context_lengths=None):
"""
Forward through the CNNDecoder.
Args:
input (LongTensor): a sequence of input tokens tensors
of size (len x batch x nfeats).
context (FloatTensor): output(tensor sequence) from the encoder
CNN of size (src_len x batch x hidden_size).
state (FloatTensor): hidden state from the encoder CNN for
initializing the decoder.
context_lengths (LongTensor): the source context lengths, this is
not used for CNNDecoder, but for interface compatibility.
Returns:
outputs (FloatTensor): a Tensor sequence of output from the decoder
of shape (len x batch x hidden_size).
state (FloatTensor): final hidden state from the decoder.
attns (dict of (str, FloatTensor)): a dictionary of different
type of attention Tensor from the decoder
of shape (src_len x batch).
"""
# CHECKS
assert isinstance(state, CNNDecoderState)
input_len, input_batch, _ = input.size()
contxt_len, contxt_batch, _ = context.size()
aeq(input_batch, contxt_batch)
# END CHECKS
if state.previous_input is not None:
input = torch.cat([state.previous_input, input], 0)
# Initialize return variables.
outputs = []
attns = {"std": []}
assert not self._copy, "Copy mechanism not yet tested in conv2conv"
if self._copy:
attns["copy"] = []
emb = self.embeddings(input)
assert emb.dim() == 3 # len x batch x embedding_dim
tgt_emb = emb.transpose(0, 1).contiguous()
# The output of CNNEncoder.
src_context_t = context.transpose(0, 1).contiguous()
# The combination of output of CNNEncoder and source embeddings.
src_context_c = state.init_src.transpose(0, 1).contiguous()
# Run the forward pass of the CNNDecoder.
emb_reshape = tgt_emb.contiguous().view(
tgt_emb.size(0) * tgt_emb.size(1), -1)
linear_out = self.linear(emb_reshape)
x = linear_out.view(tgt_emb.size(0), tgt_emb.size(1), -1)
x = shape_transform(x)
pad = Variable(torch.zeros(x.size(0), x.size(1),
self.cnn_kernel_width - 1, 1))
pad = pad.type_as(x)
base_target_emb = x
for conv, attention in zip(self.conv_layers, self.attn_layers):
new_target_input = torch.cat([pad, x], 2)
out = conv(new_target_input)
c, attn = attention(base_target_emb, out,
src_context_t, src_context_c)
x = (x + (c + out) * SCALE_WEIGHT) * SCALE_WEIGHT
output = x.squeeze(3).transpose(1, 2)
# Process the result and update the attentions.
outputs = output.transpose(0, 1).contiguous()
if state.previous_input is not None:
outputs = outputs[state.previous_input.size(0):]
attn = attn[:, state.previous_input.size(0):].squeeze()
attn = torch.stack([attn])
attns["std"] = attn
if self._copy:
attns["copy"] = attn
# Update the state.
state.update_state(input)
return outputs, state, attns
def init_decoder_state(self, src, context, enc_hidden):
return CNNDecoderState(context, enc_hidden)
class CNNDecoderState(DecoderState):
def __init__(self, context, enc_hidden):
self.init_src = (context + enc_hidden) * SCALE_WEIGHT
self.previous_input = None
@property
def _all(self):
"""
Contains attributes that need to be updated in self.beam_update().
"""
return (self.previous_input,)
def update_state(self, input):
""" Called for every decoder forward pass. """
self.previous_input = input
def repeat_beam_size_times(self, beam_size):
""" Repeat beam_size times along batch dimension. """
self.init_src = Variable(
self.init_src.data.repeat(1, beam_size, 1), volatile=True)
| 36.932203 | 79 | 0.604979 |
aceb2adc98817550a6e15264a8e0417e3cbf1f4d | 5,628 | py | Python | momo_ristorante/settings.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | momo_ristorante/settings.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | momo_ristorante/settings.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | """
Django settings for momo_ristorante project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
import json
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
ENVIRONMENT=os.environ.get('ENVIRONMENT', default='development')
#ENVIRONMENT=os.environ.get('ENVIRONMENT')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# JSON-based secrets module
#with open('secrets.json') as file:
#secret = json.loads(file.read())
#def get_secret(setting, secret=secret):
#""" Get the secret variable. """
#return secret[setting]
SECRET_KEY = os.environ.get('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = int(os.environ.get('DEBUG', default=1))
#DEBUG = False
ALLOWED_HOSTS = ['momo-ristorante-v1.herokuapp.com', 'localhost', '127.0.0.1', '127.0.0.1:8000', '*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'whitenoise.runserver_nostatic',
'django.contrib.staticfiles',
'django.contrib.sites',
# local
'administrators.apps.AdministratorsConfig',
'blogs.apps.BlogsConfig',
'bookings.apps.BookingsConfig',
'brands.apps.BrandsConfig',
'contact.apps.ContactConfig',
'recipes.apps.RecipesConfig',
'timelines.apps.TimelinesConfig',
'testimonials.apps.TestimonialsConfig',
'website.apps.WebsiteConfig',
# 3rd party
'crispy_forms',
'crispy_bootstrap5',
#'debug_toolbar',
# django admin docs
'django.contrib.admindocs',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# debug toolbar
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
]
ROOT_URLCONF = 'momo_ristorante.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
# for debug complex templates.
'string_if_invalid': 'INVALID EXPRESSION: %s'
},
},
]
WSGI_APPLICATION = 'momo_ristorante.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'ATOMIC_REQUESTS': True,
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CRISPY_TEMPLATE_PACK = 'bootstrap5'
# CUSTOM SETTINGS
SITE_NAME = 'MOMO Ristorante'
# Django debugger
# INTERNAL_IPS = [
# ...
# '127.0.0.1',
# ...
# ]
# django-allauth config site = 1
SITE_ID = 1
# django-allauth config
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)
if ENVIRONMENT == 'production':
SECURE_BROWSER_XSS_FILTER = True
X_FRAME_OPTIONS = 'DENY'
SECURE_SSL_REDIRECT = True
SECURE_HSTS_SECONDS = 3600
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | 27.453659 | 101 | 0.707889 |
aceb2b0199341b84150b62785fe204f72a830b1c | 4,691 | py | Python | src/jukeboxcore/addons/genesis/genesis_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | 2 | 2015-01-22T17:39:10.000Z | 2015-03-31T09:03:24.000Z | src/jukeboxcore/addons/genesis/genesis_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | 3 | 2016-10-28T16:11:14.000Z | 2020-06-05T17:46:08.000Z | src/jukeboxcore/addons/genesis/genesis_ui.py | JukeboxPipeline/jukebox-core | bac2280ca49940355270e4b69400ce9976ab2e6f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'h:\projects\jukebox-core\src\jukeboxcore\addons\genesis\genesis.ui'
#
# Created: Mon Nov 03 16:39:53 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_genesis_mwin(object):
def setupUi(self, genesis_mwin):
genesis_mwin.setObjectName("genesis_mwin")
genesis_mwin.resize(1009, 765)
self.central_widget = QtGui.QWidget(genesis_mwin)
self.central_widget.setObjectName("central_widget")
self.central_vbox = QtGui.QVBoxLayout(self.central_widget)
self.central_vbox.setObjectName("central_vbox")
self.shot_open_pb = QtGui.QPushButton(self.central_widget)
self.shot_open_pb.setMinimumSize(QtCore.QSize(200, 32))
self.shot_open_pb.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.shot_open_pb.setFont(font)
self.shot_open_pb.setObjectName("shot_open_pb")
self.central_vbox.addWidget(self.shot_open_pb)
self.asset_open_pb = QtGui.QPushButton(self.central_widget)
self.asset_open_pb.setMinimumSize(QtCore.QSize(200, 32))
self.asset_open_pb.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.asset_open_pb.setFont(font)
self.asset_open_pb.setObjectName("asset_open_pb")
self.central_vbox.addWidget(self.asset_open_pb)
self.shot_save_pb = QtGui.QPushButton(self.central_widget)
self.shot_save_pb.setMinimumSize(QtCore.QSize(200, 32))
self.shot_save_pb.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.shot_save_pb.setFont(font)
self.shot_save_pb.setObjectName("shot_save_pb")
self.central_vbox.addWidget(self.shot_save_pb)
self.asset_save_pb = QtGui.QPushButton(self.central_widget)
self.asset_save_pb.setMinimumSize(QtCore.QSize(200, 32))
self.asset_save_pb.setMaximumSize(QtCore.QSize(200, 16777215))
font = QtGui.QFont()
font.setPointSize(10)
font.setWeight(75)
font.setBold(True)
self.asset_save_pb.setFont(font)
self.asset_save_pb.setObjectName("asset_save_pb")
self.central_vbox.addWidget(self.asset_save_pb)
self.asset_descriptor_le = QtGui.QLineEdit(self.central_widget)
self.asset_descriptor_le.setObjectName("asset_descriptor_le")
self.central_vbox.addWidget(self.asset_descriptor_le)
self.asset_descriptor_lb = QtGui.QLabel(self.central_widget)
self.asset_descriptor_lb.setObjectName("asset_descriptor_lb")
self.central_vbox.addWidget(self.asset_descriptor_lb)
self.shot_descriptor_le = QtGui.QLineEdit(self.central_widget)
self.shot_descriptor_le.setObjectName("shot_descriptor_le")
self.central_vbox.addWidget(self.shot_descriptor_le)
self.shot_descriptor_lb = QtGui.QLabel(self.central_widget)
self.shot_descriptor_lb.setObjectName("shot_descriptor_lb")
self.central_vbox.addWidget(self.shot_descriptor_lb)
genesis_mwin.setCentralWidget(self.central_widget)
self.statusbar = QtGui.QStatusBar(genesis_mwin)
self.statusbar.setObjectName("statusbar")
genesis_mwin.setStatusBar(self.statusbar)
self.retranslateUi(genesis_mwin)
QtCore.QMetaObject.connectSlotsByName(genesis_mwin)
def retranslateUi(self, genesis_mwin):
genesis_mwin.setWindowTitle(QtGui.QApplication.translate("genesis_mwin", "Genesis", None, QtGui.QApplication.UnicodeUTF8))
self.shot_open_pb.setText(QtGui.QApplication.translate("genesis_mwin", "Open", None, QtGui.QApplication.UnicodeUTF8))
self.asset_open_pb.setText(QtGui.QApplication.translate("genesis_mwin", "Open", None, QtGui.QApplication.UnicodeUTF8))
self.shot_save_pb.setText(QtGui.QApplication.translate("genesis_mwin", "Save/New", None, QtGui.QApplication.UnicodeUTF8))
self.asset_save_pb.setText(QtGui.QApplication.translate("genesis_mwin", "Save/New", None, QtGui.QApplication.UnicodeUTF8))
self.asset_descriptor_lb.setText(QtGui.QApplication.translate("genesis_mwin", "Descriptor:", None, QtGui.QApplication.UnicodeUTF8))
self.shot_descriptor_lb.setText(QtGui.QApplication.translate("genesis_mwin", "Descriptor:", None, QtGui.QApplication.UnicodeUTF8))
| 52.707865 | 139 | 0.729056 |
aceb2c8fa1490aed868852f2b83c5a57cbbd7192 | 16,482 | py | Python | higl/utils.py | junsu-kim97/HIGL | fd8926f850552d032a6692747d1dd030ffc7ac84 | [
"MIT"
] | 7 | 2021-11-06T11:13:48.000Z | 2022-03-30T23:59:01.000Z | higl/utils.py | junsu-kim97/HIGL | fd8926f850552d032a6692747d1dd030ffc7ac84 | [
"MIT"
] | 1 | 2021-11-04T13:15:23.000Z | 2021-11-04T15:06:01.000Z | higl/utils.py | junsu-kim97/HIGL | fd8926f850552d032a6692747d1dd030ffc7ac84 | [
"MIT"
] | 2 | 2021-12-19T02:01:30.000Z | 2022-01-13T04:08:11.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as Data
import numpy as np
import pandas as pd
import random
from functools import total_ordering
# from higl.higl import var
from itertools import compress
# Code based on:
# https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Simple replay buffer
class ReplayBuffer(object):
def __init__(self, maxsize=1e6, batch_size=100, reward_func=None, reward_scale=None):
self.storage = [[] for _ in range(11)]
self.maxsize = maxsize
self.next_idx = 0
self.batch_size = batch_size
self.reward_func = reward_func
self.reward_scale = reward_scale
# Expects tuples of (x, x', ag, g, u, r, d, x_seq, a_seq, ag_seq)
def add(self, odict):
assert list(odict.keys()) == ['state', 'next_state', 'achieved_goal', 'next_achieved_goal',
'goal', 'action', 'reward',
'done', 'state_seq', 'actions_seq', 'achieved_goal_seq']
data = tuple(odict.values())
self.next_idx = int(self.next_idx)
if self.next_idx >= len(self.storage[0]):
[array.append(datapoint) for array, datapoint in zip(self.storage, data)]
else:
[array.__setitem__(self.next_idx, datapoint) for array, datapoint in zip(self.storage, data)]
self.next_idx = (self.next_idx + 1) % self.maxsize
def sample(self, batch_size):
ind = np.random.randint(0, len(self.storage[0]), size=batch_size)
x, y, ag, ag_next, g, u, r, d, x_seq, a_seq, ag_seq = [], [], [], [], [], [], [], [], [], [], []
for i in ind:
X, Y, AG, AG_NEXT, G, U, R, D, obs_seq, acts, AG_seq = (array[i] for array in self.storage)
x.append(np.array(X, copy=False))
y.append(np.array(Y, copy=False))
ag.append(np.array(AG, copy=False))
ag_next.append(np.array(AG_NEXT, copy=False))
g.append(np.array(G, copy=False))
u.append(np.array(U, copy=False))
r.append(np.array(R, copy=False))
d.append(np.array(D, copy=False))
# For off-policy goal correction
x_seq.append(np.array(obs_seq, copy=False))
a_seq.append(np.array(acts, copy=False))
ag_seq.append(np.array(AG_seq, copy=False))
return np.array(x), np.array(y), np.array(ag), np.array(ag_next), np.array(g), \
np.array(u), np.array(r).reshape(-1, 1), np.array(d).reshape(-1, 1), \
x_seq, a_seq, ag_seq
def save(self, file):
np.savez_compressed(file, idx=np.array([self.next_idx]), x=self.storage[0],
y=self.storage[1], g=self.storage[2], u=self.storage[3],
r=self.storage[4], d=self.storage[5], xseq=self.storage[6],
aseq=self.storage[7], ld=self.storage[8])
def load(self, file):
with np.load(file) as data:
self.next_idx = int(data['idx'][0])
self.storage = [data['x'], data['y'], data['g'], data['u'], data['r'],
data['d'], data['xseq'], data['aseq'], data['ld']]
self.storage = [list(l) for l in self.storage]
def __len__(self):
return len(self.storage[0])
class TrajectoryBuffer:
def __init__(self, capacity):
self._capacity = capacity
self.reset()
def reset(self):
self._num_traj = 0 # number of trajectories
self._size = 0 # number of game frames
self.trajectory = []
def __len__(self):
return self._num_traj
def size(self):
return self._size
def get_traj_num(self):
return self._num_traj
def full(self):
return self._size >= self._capacity
def create_new_trajectory(self):
self.trajectory.append([])
self._num_traj += 1
def append(self, s):
self.trajectory[self._num_traj-1].append(s)
self._size += 1
def get_trajectory(self):
return self.trajectory
def set_capacity(self, new_capacity):
assert self._size <= new_capacity
self._capacity = new_capacity
class NormalNoise(object):
def __init__(self, sigma):
self.sigma = sigma
def perturb_action(self, action, min_action=-np.inf, max_action=np.inf):
action = (action + np.random.normal(0, self.sigma,
size=action.shape[0])).clip(min_action, max_action)
return action
class OUNoise(object):
def __init__(self, action_dim, mu=0, theta=0.15, sigma=0.3):
self.mu = mu
self.theta = theta
self.sigma = sigma
self.action_dim = action_dim
self.X = np.ones(self.action_dim) * self.mu
def reset(self):
self.X = np.ones(self.action_dim) * self.mu
def perturb_action(self, action, min_action=-np.inf, max_action=np.inf):
dx = self.theta * (self.mu - self.X)
dx = dx + self.sigma * np.random.randn(len(self.X))
self.X = self.X + dx
return (self.X + action).clip(min_action, max_action)
def train_adj_net(a_net, states, adj_mat, optimizer, margin_pos, margin_neg,
n_epochs=100, batch_size=64, device='cpu', verbose=False):
if verbose:
print('Generating training data...')
dataset = MetricDataset(states, adj_mat)
if verbose:
print('Totally {} training pairs.'.format(len(dataset)))
dataloader = Data.DataLoader(dataset, batch_size=batch_size, shuffle=True, num_workers=0, drop_last=False)
n_batches = len(dataloader)
loss_func = ContrastiveLoss(margin_pos, margin_neg)
for i in range(n_epochs):
epoch_loss = []
for j, data in enumerate(dataloader):
x, y, label = data
x = x.float().to(device)
y = y.float().to(device)
label = label.long().to(device)
x = a_net(x)
y = a_net(y)
loss = loss_func(x, y, label)
optimizer.zero_grad()
loss.backward()
optimizer.step()
if verbose and (j % 50 == 0 or j == n_batches - 1):
print('Training metric network: epoch {}/{}, batch {}/{}'.format(i+1, n_epochs, j+1, n_batches))
epoch_loss.append(loss.item())
if verbose:
print('Mean loss: {:.4f}'.format(np.mean(epoch_loss)))
class ContrastiveLoss(nn.Module):
def __init__(self, margin_pos, margin_neg):
super().__init__()
assert margin_pos <= margin_neg
self.margin_pos = margin_pos
self.margin_neg = margin_neg
def forward(self, x, y, label):
# mutually reachable states correspond to label = 1
dist = torch.sqrt(torch.pow(x - y, 2).sum(dim=1) + 1e-12)
loss = (label * (dist - self.margin_pos).clamp(min=0)).mean() + ((1 - label) * (self.margin_neg - dist).clamp(min=0)).mean()
return loss
class MetricDataset(Data.Dataset):
def __init__(self, states, adj_mat):
super().__init__()
n_samples = adj_mat.shape[0]
self.x = []
self.y = []
self.label = []
for i in range(n_samples - 1):
for j in range(i + 1, n_samples):
self.x.append(states[i])
self.y.append(states[j])
self.label.append(adj_mat[i, j])
self.x = np.array(self.x)
self.y = np.array(self.y)
self.label = np.array(self.label)
def __len__(self):
return self.x.shape[0]
def __getitem__(self, idx):
return self.x[idx], self.y[idx], self.label[idx]
def get_reward_function(env, env_name, absolute_goal=False, binary_reward=False):
# distance_threshold = env.distance_threshold
if env_name in ["AntMaze-v1", "PointMaze-v1"]:
distance_threshold = 2.5
elif env_name == "AntMazeW-v2":
distance_threshold = 1
if absolute_goal and binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action=None):
reward = -float(np.linalg.norm(subgoal - next_ag, axis=-1) > distance_threshold) * scale
return reward
elif absolute_goal:
def controller_reward(ag, subgoal, next_ag, scale, action=None):
reward = -np.linalg.norm(subgoal - next_ag, axis=-1) * scale
return reward
elif binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action=None):
reward = -float(np.linalg.norm(ag + subgoal - next_ag, axis=-1) > distance_threshold) * scale
return reward
else:
def controller_reward(ag, subgoal, next_ag, scale, action=None):
reward = -np.linalg.norm(ag + subgoal - next_ag, axis=-1) * scale
return reward
return controller_reward
def get_mbrl_fetch_reward_function(env, env_name, binary_reward, absolute_goal):
action_penalty_coeff = 0.0001
distance_threshold = 0.25
if env_name in ["Reacher3D-v0", "Pusher-v0"]:
if absolute_goal and not binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action):
reward = -np.sum(np.square(ag - subgoal))
reward -= action_penalty_coeff * np.square(action).sum()
return reward * scale
elif absolute_goal and binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action):
reward_ctrl = action_penalty_coeff * -np.square(action).sum()
fail = True
if np.sqrt(np.sum(np.square(ag - subgoal))) <= distance_threshold:
fail = False
reward = reward_ctrl - float(fail)
return reward * scale
elif not absolute_goal and not binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action):
reward = -np.sum(np.square(ag + subgoal - next_ag))
reward -= action_penalty_coeff * np.square(action).sum()
return reward * scale
elif not absolute_goal and binary_reward:
def controller_reward(ag, subgoal, next_ag, scale, action):
reward_ctrl = action_penalty_coeff * -np.square(action).sum()
fail = True
if np.sqrt(np.sum(np.square(ag - subgoal))) <= distance_threshold:
fail = False
reward = reward_ctrl - float(fail)
return reward * scale
else:
raise NotImplementedError
return controller_reward
def is_goal_unreachable(a_net, state, goal, goal_dim, margin, device, absolute_goal=False):
state = torch.from_numpy(state[:goal_dim]).float().to(device)
goal = torch.from_numpy(goal).float().to(device)
if not absolute_goal:
goal = state + goal
inputs = torch.stack((state, goal), dim=0)
outputs = a_net(inputs)
s_embedding = outputs[0]
g_embedding = outputs[1]
dist = F.pairwise_distance(s_embedding.unsqueeze(0), g_embedding.unsqueeze(0)).squeeze()
return dist > margin
@total_ordering
class StorageElement:
def __init__(self, state, achieved_goal, score):
self.state = state
self.achieved_goal = achieved_goal
self.score = score
def __eq__(self, other):
return np.isclose(self.score, other.score)
def __lt__(self, other):
return self.score < other.score
def __hash__(self):
return hash(tuple(self.state))
def unravel_elems(elems):
return tuple(map(list, zip(*[(elem.state, elem.score) for elem in elems])))
class PriorityQueue:
def __init__(self, top_k, close_thr=0.1, discard_by_anet=False):
self.elems = []
self.elems_state_tensor = None
self.elems_achieved_goal_tensor = None
self.top_k = top_k
self.close_thr = close_thr
self.discard_by_anet = discard_by_anet
def __len__(self):
return len(self.elems)
def add_list(self, state_list, achieved_goal_list, score_list, a_net=None):
if self.discard_by_anet:
self.discard_out_of_date_by_anet(achieved_goal_list, a_net)
else:
self.discard_out_of_date(achieved_goal_list)
# total_timesteps = len(state_list)
# Fill inf in the future observation | achieved goal
new_elems = [StorageElement(state=state, achieved_goal=achieved_goal, score=score)
for timestep, (state, achieved_goal, score)
in enumerate(zip(state_list, achieved_goal_list, score_list))]
self.elems.extend(new_elems)
self.elems = list(set(self.elems))
self.update_tensors()
def update_tensors(self):
self.elems_state_tensor = torch.FloatTensor([elems.state for elems in self.elems]).to(device)
self.elems_achieved_goal_tensor = torch.FloatTensor([elems.achieved_goal for elems in self.elems]).to(device)
# update novelty of similar states existing in storage to the newly encountered one.
def discard_out_of_date(self, achieved_goal_list):
if len(self.elems) == 0:
return
achieved_goals = torch.FloatTensor(np.array(achieved_goal_list)).to(device)
dist = torch.cdist(self.elems_achieved_goal_tensor, achieved_goals)
close = dist < self.close_thr
keep = close.sum(dim=1) == 0
self.elems = list(compress(self.elems, keep))
self.update_tensors()
def discard_out_of_date_by_anet(self, achieved_goal_list, a_net):
assert a_net is not None
if len(self.elems) == 0:
return
with torch.no_grad():
achieved_goals = torch.FloatTensor(np.array(achieved_goal_list)).to(device)
dist1 = torch.cdist(a_net(achieved_goals), a_net(self.elems_achieved_goal_tensor)).T
dist2 = torch.cdist(a_net(self.elems_achieved_goal_tensor), a_net(achieved_goals))
dist = (dist1 + dist2)/2
close = dist < self.close_thr
keep = close.sum(dim=1) == 0
self.elems = list(compress(self.elems, keep))
self.update_tensors()
def get_elems(self):
return unravel_elems(self.elems[:self.top_k])
def get_states(self):
return self.elems_state_tensor[:self.top_k]
def get_landmarks(self):
return self.elems_achieved_goal_tensor[:self.top_k]
def squeeze_by_kth(self, k):
k = min(k, len(self.elems))
self.elems = sorted(self.elems, reverse=True)[:k]
self.update_tensors()
return self.elems[-1].score
def squeeze_by_thr(self, thr):
self.elems = sorted(self.elems, reverse=True)
k = next((i for i, elem in enumerate(self.elems) if elem.score < thr), len(self.elems))
self.elems = self.elems[:k]
self.update_tensors()
return unravel_elems(self.elems)
def sample_batch(self, batch_size):
sampled_elems = random.choices(population=self.elems, k=batch_size)
return unravel_elems(sampled_elems)
def save_log(self, timesteps, log_file):
elems = self.get_elems()
output_df = pd.DataFrame((timesteps, score, state) for state, score in zip(elems[0], elems[1]))
output_df.to_csv(log_file, mode='a', header=False)
def sample_by_novelty_weight(self):
raise NotImplementedError
class RunningMeanStd(object):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
def __init__(self, epsilon=1e-4, shape=()):
self.mean = np.zeros(shape, 'float64')
self.var = np.ones(shape, 'float64')
self.count = epsilon
def update(self, x):
batch_mean = np.mean(x, axis=0)
batch_var = np.var(x, axis=0)
batch_count = x.shape[0]
self.update_from_moments(batch_mean, batch_var, batch_count)
def update_from_moments(self, batch_mean, batch_var, batch_count):
delta = batch_mean - self.mean
tot_count = self.count + batch_count
new_mean = self.mean + delta * batch_count / tot_count
m_a = self.var * (self.count)
m_b = batch_var * (batch_count)
M2 = m_a + m_b + np.square(delta) * self.count * batch_count / (self.count + batch_count)
new_var = M2 / (self.count + batch_count)
new_count = batch_count + self.count
self.mean = new_mean
self.var = new_var
self.count = new_count
| 36.790179 | 132 | 0.616187 |
aceb2f92ca07640272fc52b46d85a05db48cf38b | 455 | py | Python | run.py | diazjf/countdowner | 850cc800f7d945cb6308adafdbdf0e2e582d54d0 | [
"MIT"
] | null | null | null | run.py | diazjf/countdowner | 850cc800f7d945cb6308adafdbdf0e2e582d54d0 | [
"MIT"
] | null | null | null | run.py | diazjf/countdowner | 850cc800f7d945cb6308adafdbdf0e2e582d54d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import gui, timer
import threading, time
def countdown(view):
while True:
time_remaining = timer.getTimeRemaining()
view.changeLabel(time_remaining)
time.sleep(1)
def main():
g = gui.GUI()
# Update the UI in the background
thread1 = threading.Thread(target=countdown, args = [g])
thread1.setDaemon(True)
thread1.start()
g.mainloop()
if __name__ == '__main__':
main() | 19.782609 | 60 | 0.643956 |
aceb324945982fe229318cbba9af1060472e55d1 | 2,064 | py | Python | innexia/innexiaBot/modules/wallpaper.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | innexia/innexiaBot/modules/wallpaper.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | innexia/innexiaBot/modules/wallpaper.py | MikeOwino/curly-garbanzo | 37027800724cb80c4035eac421421a7ceb1062a6 | [
"MIT"
] | null | null | null | from random import randint
import requests as r
from innexiaBot import SUPPORT_CHAT, WALL_API, dispatcher
from innexiaBot.modules.disable import DisableAbleCommandHandler
from telegram import Update
from telegram.ext import CallbackContext, run_async
# Wallpapers module by @TheRealPhoenix using wall.alphacoders.com
@run_async
def wall(update: Update, context: CallbackContext):
chat_id = update.effective_chat.id
msg = update.effective_message
args = context.args
msg_id = update.effective_message.message_id
bot = context.bot
query = " ".join(args)
if not query:
msg.reply_text("Please enter a query!")
return
else:
caption = query
term = query.replace(" ", "%20")
json_rep = r.get(
f"https://wall.alphacoders.com/api2.0/get.php?auth={WALL_API}&method=search&term={term}"
).json()
if not json_rep.get("success"):
msg.reply_text(f"An error occurred! Report this @{SUPPORT_CHAT}")
else:
wallpapers = json_rep.get("wallpapers")
if not wallpapers:
msg.reply_text("No results found! Refine your search.")
return
else:
index = randint(0, len(wallpapers) - 1) # Choose random index
wallpaper = wallpapers[index]
wallpaper = wallpaper.get("url_image")
wallpaper = wallpaper.replace("\\", "")
bot.send_photo(
chat_id,
photo=wallpaper,
caption="Preview",
reply_to_message_id=msg_id,
timeout=60,
)
bot.send_document(
chat_id,
document=wallpaper,
filename="wallpaper",
caption=caption,
reply_to_message_id=msg_id,
timeout=60,
)
WALLPAPER_HANDLER = DisableAbleCommandHandler("wall", wall)
dispatcher.add_handler(WALLPAPER_HANDLER)
| 34.4 | 100 | 0.579457 |
aceb32819204599da7ca71adc1a5e28bf36d8d57 | 20,032 | py | Python | dali/python/nvidia/dali/plugin/base_iterator.py | lbhm/DALI | d478d768c55069351a78d6bdcebed7632ca21ecb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/plugin/base_iterator.py | lbhm/DALI | d478d768c55069351a78d6bdcebed7632ca21ecb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/plugin/base_iterator.py | lbhm/DALI | d478d768c55069351a78d6bdcebed7632ca21ecb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. 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 nvidia.dali import types
import math
import logging
import numpy as np
import warnings
from enum import Enum, unique
from collections import Iterable
def _iterator_deprecation_warning():
warnings.warn("Please set `reader_name` and don't set last_batch_padded and size manually " +
"whenever possible. This may lead, in some situations, to missing some " +
"samples or returning duplicated ones. Check the Sharding section of the "
"documentation for more details.",
Warning, stacklevel=2)
@unique
class LastBatchPolicy(Enum):
"""
Describes the last batch policy behavior when there are not enough samples in the epoch
to fill a whole batch.
* FILL - The last batch is filled by either repeating the last sample or by wrapping
up the data set. The precise behavior depends on the reader's ``pad_last_batch`` argument
* DROP - The last batch is dropped if it cannot be fully filled with data from the current epoch
* PARTIAL - The last batch is partially filled with the remaining data from the current epoch,
keeping the rest of the samples empty
"""
FILL = 0
DROP = 1
PARTIAL = 2
class _DaliBaseIterator(object):
"""
DALI base iterator class. Shouldn't be used directly.
Parameters
----------
pipelines : list of nvidia.dali.Pipeline
List of pipelines to use
output_map : list of (str, str)
List of pairs (output_name, tag) which maps consecutive
outputs of DALI pipelines to proper field in MXNet's
DataBatch.
tag is one of DALIGenericIterator.DATA_TAG
and DALIGenericIterator.LABEL_TAG mapping given output
for data or label correspondingly.
output_names should be distinct.
size : int, default = -1
Number of samples in the shard for the wrapped pipeline (if there is more than one it is a sum)
Providing -1 means that the iterator will work until StopIteration is raised
from the inside of iter_setup(). The options `last_batch_policy`, `last_batch_padded` and
`auto_reset` don't work in such case. It works with only one pipeline inside
the iterator.
Mutually exclusive with `reader_name` argument
reader_name : str, default = None
Name of the reader which will be queried to the shard size, number of shards, and
all other properties necessary to count properly the number of relevant and padded
samples that iterator needs to deal with. It allows `last_batch_policy` to be
PARTIAL or DROP, if FILL is used it is changed to PARTIAL. Sets `last_batch_padded`
accordingly to the reader's configuration (`pad_last_batch` reader argument)
auto_reset : bool, optional, default = False
Whether the iterator resets itself for the next epoch
or it requires reset() to be called separately.
fill_last_batch : bool, optional, default = None
**Deprecated** Please use ``last_batch_policy`` instead
Whether to fill the last batch with data up to 'self.batch_size'.
The iterator would return the first integer multiple
of self._num_gpus * self.batch_size entries which exceeds 'size'.
Setting this flag to False will cause the iterator to return
exactly 'size' entries.
last_batch_policy : default = FILL
What to do with the last batch when there is no enough samples in the epoch
to fully fill it. See :meth:`nvidia.dali.plugin.base_iterator.LastBatchPolicy`
last_batch_padded : bool, optional, default = False
Whether the last batch provided by DALI is padded with the last sample
or it just wraps up. In the conjunction with ``last_batch_policy`` it tells
if the iterator returning last batch with data only partially filled with
data from the current epoch is dropping padding samples or samples from
the next epoch (it doesn't literally drop but sets ``pad`` field of ndarray
so the following code could use it to drop the data). If set to False next
epoch will end sooner as data from it was consumed but dropped. If set to
True next epoch would be the same length as the first one. For this to happen,
the option `pad_last_batch` in the reader needs to be set to True as well.
It is overwritten when `reader_name` argument is provided
prepare_first_batch : bool, optional, default = True
Whether DALI should buffer the first batch right after the creation of the iterator,
so one batch is already prepared when the iterator is prompted for the data
Example
-------
With the data set ``[1,2,3,4,5,6,7]`` and the batch size 2:
last_batch_policy = PARTIAL, last_batch_padded = True -> last batch = ``[7]``, next iteration will return ``[1, 2]``
last_batch_policy = PARTIAL, last_batch_padded = False -> last batch = ``[7]``, next iteration will return ``[2, 3]``
last_batch_policy = FILL, last_batch_padded = True -> last batch = ``[7, 7]``, next iteration will return ``[1, 2]``
last_batch_policy = FILL, last_batch_padded = False -> last batch = ``[7, 1]``, next iteration will return ``[2, 3]``
last_batch_policy = DROP, last_batch_padded = True -> last batch = ``[5, 6]``, next iteration will return ``[1, 2]``
last_batch_policy = DROP, last_batch_padded = False -> last batch = ``[5, 6]``, next iteration will return ``[2, 3]``
"""
def __init__(self,
pipelines,
size=-1,
reader_name=None,
auto_reset=False,
fill_last_batch=None,
last_batch_padded=False,
last_batch_policy=LastBatchPolicy.FILL,
prepare_first_batch=True):
assert pipelines is not None, "Number of provided pipelines has to be at least 1"
if not isinstance(pipelines, list):
pipelines = [pipelines]
self._num_gpus = len(pipelines)
# frameworks expect from its data iterators to have batch_size field,
# so it is not possible to use _batch_size instead
self.batch_size = pipelines[0].max_batch_size
assert np.all(np.equal([pipe.max_batch_size for pipe in pipelines], self.batch_size)), \
"All pipelines should have the same batch size set"
self._size = int(size)
self._auto_reset = auto_reset
self._prepare_first_batch = prepare_first_batch
if fill_last_batch is not None:
warnings.warn("Please do not use `fill_last_batch` and use `last_batch_policy` instead.",
Warning, stacklevel=2)
if fill_last_batch:
self._last_batch_policy = LastBatchPolicy.FILL
else:
self._last_batch_policy = LastBatchPolicy.PARTIAL
else:
self._last_batch_policy = last_batch_policy
self._last_batch_padded = last_batch_padded
assert self._size != 0, "Size cannot be 0"
assert self._size > 0 or (self._size < 0 and (len(pipelines) == 1 or reader_name)), "Negative size is supported only for a single pipeline"
assert not reader_name or (reader_name and self._size < 0), "When reader_name is provided, size should not be set"
assert not reader_name or (reader_name and last_batch_padded == False), "When reader_name is provided, last_batch_padded should not be set"
if self._size < 0 and not reader_name:
self._last_batch_policy = LastBatchPolicy.FILL
self._last_batch_padded = False
if self.size > 0 and not reader_name:
_iterator_deprecation_warning()
self._pipes = pipelines
self._counter = 0
# Build all pipelines
for p in self._pipes:
with p._check_api_type_scope(types.PipelineAPIType.ITERATOR):
p.build()
self._reader_name = reader_name
self._extract_from_reader_and_validate()
self._ever_scheduled = False
def _calculate_shard_sizes(self, shard_nums):
shards_beg = np.floor(shard_nums * self._size_no_pad / self._shards_num).astype(np.int)
shards_end = np.floor((shard_nums + 1) * self._size_no_pad / self._shards_num).astype(np.int)
return shards_end - shards_beg
def _extract_from_reader_and_validate(self):
if self._reader_name:
readers_meta = [p.reader_meta(self._reader_name) for p in self._pipes]
def err_msg_gen(err_msg):
'Reader Operator should have the same {} in all the pipelines.'.format(err_msg)
def check_equality_and_get(input_meta, name, err_msg):
assert np.all(np.equal([meta[name] for meta in input_meta], input_meta[0][name])), \
err_msg_gen(err_msg)
return input_meta[0][name]
def check_all_or_none_and_get(input_meta, name, err_msg):
assert np.all([meta[name] for meta in readers_meta]) or \
not np.any([meta[name] for meta in readers_meta]), \
err_msg_gen(err_msg)
return input_meta[0][name]
self._size_no_pad = check_equality_and_get(readers_meta, "epoch_size", "size value")
self._shards_num = check_equality_and_get(readers_meta, "number_of_shards", "`num_shards` argument set")
self._last_batch_padded = check_all_or_none_and_get(readers_meta, "pad_last_batch", "`pad_last_batch` argument set")
self._is_stick_to_shard = check_all_or_none_and_get(readers_meta, "stick_to_shard", "`stick_to_shard` argument set")
self._shards_id = np.array([meta["shard_id"] for meta in readers_meta], dtype=np.int)
if self._last_batch_policy == LastBatchPolicy.DROP:
# when DROP policy is used round down the shard size
self._size = self._size_no_pad // self._shards_num
elif self._last_batch_padded:
# if padding is enabled all shards are equal
self._size = readers_meta[0]["epoch_size_padded"] // self._shards_num
else:
# get the size as a multiply of the batch size that is bigger or equal than the biggest shard
self._size = math.ceil(math.ceil(self._size_no_pad / self._shards_num) / self.batch_size) * self.batch_size
# count where we starts inside each GPU shard in given epoch,
# if shards are uneven this will differ epoch2epoch
self._counter_per_gpu = np.zeros(self._shards_num, dtype=np.long)
self._shard_sizes_per_gpu = self._calculate_shard_sizes(np.arange(0, self._shards_num))
# to avoid recalculation of shard sizes when iterator moves across the shards
# memorize the initial shard sizes and then use chaning self._shards_id to index it
self._shard_sizes_per_gpu_initial = self._shard_sizes_per_gpu.copy()
def _remove_padded(self):
"""
Checks if remove any padded sample and how much.
Calculates the number of padded samples in the batch for each pipeline
wrapped up by the iterator. Returns if there is any padded data that
needs to be dropped and if so how many samples in each GPU
"""
if_drop = False
left = -1
if self._last_batch_policy == LastBatchPolicy.PARTIAL:
# calculate each shard size for each id, and check how many samples are left by substracting
# from iterator counter the shard size, then go though all GPUs and check how much data needs to be dropped
left = self.batch_size - (self._counter - self._shard_sizes_per_gpu_initial[self._shards_id])
if_drop = np.less(left, self.batch_size)
return if_drop, left
def _get_outputs(self):
"""
Checks iterator stop condition, gets DALI outputs and perform reset in case of StopIteration
"""
# if pipeline was not scheduled ever do it here
if not self._ever_scheduled:
self._schedule_runs(False)
if self._size > 0 and self._counter >= self._size:
self._end_iteration()
outputs = []
try:
for p in self._pipes:
with p._check_api_type_scope(types.PipelineAPIType.ITERATOR):
outputs.append(p.share_outputs())
except StopIteration as e:
# in case ExternalSource returns StopIteration
if self._size < 0 and self._auto_reset:
self.reset()
raise e
self._check_batch_size(outputs)
return outputs
def _check_batch_size(self, outs):
if not isinstance(outs, Iterable):
outs = [outs]
if self._reader_name or self._size != -1:
for out in outs:
for o in out:
batch_len = len(o)
assert self.batch_size == batch_len, \
"Variable batch size is not supported by the iterator when reader_name is " + \
"provided or iterator size is set explicitly"
def _end_iteration(self):
if self._auto_reset:
self.reset()
raise StopIteration
def _schedule_runs(self, release_outputs=True):
"""
Schedule DALI runs
"""
self._ever_scheduled = True
for p in self._pipes:
with p._check_api_type_scope(types.PipelineAPIType.ITERATOR):
if release_outputs:
p.release_outputs()
p.schedule_run()
def _advance_and_check_drop_last(self):
"""
Checks whether the current batch is not fully filled and whether it should be dropped.
"""
# check if for given initial count in any GPU with the current value of the samples read
# if we read one more batch would we overflow
if self._reader_name:
self._counter += self.batch_size
if self._last_batch_policy == LastBatchPolicy.DROP:
if np.any(self._counter_per_gpu + self._counter > self._shard_sizes_per_gpu):
self._end_iteration()
else:
self._counter += self._num_gpus * self.batch_size
if self._last_batch_policy == LastBatchPolicy.DROP:
if self._counter > self._size:
self._end_iteration()
def reset(self):
"""
Resets the iterator after the full epoch.
DALI iterators do not support resetting before the end of the epoch
and will ignore such request.
"""
if self._counter >= self._size or self._size < 0:
if self._last_batch_policy == LastBatchPolicy.FILL and not self._last_batch_padded:
if self._reader_name:
# accurate way
# get the number of samples read in this epoch by each GPU
# self._counter had initial value of min(self._counter_per_gpu) so substract this to get the actual value
self._counter -= min(self._counter_per_gpu)
self._counter_per_gpu = self._counter_per_gpu + self._counter
# check how much each GPU read ahead from next shard, as shards have different size each epoch
# GPU may read ahead or not
self._counter_per_gpu = self._counter_per_gpu - self._shard_sizes_per_gpu
# to make sure that in the next epoch we read the whole shard we need to set start value to the smallest one
self._counter = min(self._counter_per_gpu)
else:
# legacy way
self._counter = self._counter % self._size
else:
self._counter = 0
# advance to the next shard
if self._reader_name:
if not self._is_stick_to_shard:
# move shards id for wrapped pipeliens
self._shards_id = (self._shards_id + 1) % self._shards_num
# revaluate _size
if self._last_batch_policy == LastBatchPolicy.FILL and not self._last_batch_padded:
# move all shards ids GPU ahead
if not self._is_stick_to_shard:
self._shard_sizes_per_gpu = np.roll(self._shard_sizes_per_gpu, 1)
# check how many samples we need to reach from each shard in next epoch per each GPU
# taking into account already read
read_in_next_epoch = self._shard_sizes_per_gpu - self._counter_per_gpu
# get the maximmum number of samples and round it up to full batch sizes
self._size = math.ceil(max(read_in_next_epoch) / self.batch_size) * self.batch_size
# in case some epoch is skipped because we have read ahead in this epoch so much
# that in the next one we done already
if self._size == 0:
# it means that self._shard_sizes_per_gpu == self._counter_per_gpu, so we can
# jump to the next epoch and zero self._counter_per_gpu
self._counter_per_gpu = np.zeros(self._shards_num, dtype=np.long)
# self._counter = min(self._counter_per_gpu), but just set 0 to make it simpler
self._counter = 0
# roll once again
self._shard_sizes_per_gpu = np.roll(self._shard_sizes_per_gpu, 1)
# as self._counter_per_gpu is 0 we can just use
# read_in_next_epoch = self._shard_sizes_per_gpu
self._size = math.ceil(max(self._shard_sizes_per_gpu) / self.batch_size) * self.batch_size
for p in self._pipes:
p.reset()
if p.empty():
with p._check_api_type_scope(types.PipelineAPIType.ITERATOR):
p.schedule_run()
else:
logging.warning("DALI iterator does not support resetting while epoch is not finished. Ignoring...")
def next(self):
"""
Returns the next batch of data.
"""
return self.__next__()
def __next__(self):
raise NotImplementedError
def __iter__(self):
return self
@property
def size(self):
return self._size
def __len__(self):
if self._reader_name:
if self._last_batch_policy != LastBatchPolicy.DROP:
return math.ceil(self.size / self.batch_size)
else:
return self.size // self.batch_size
else:
if self._last_batch_policy != LastBatchPolicy.DROP:
return math.ceil(self.size / (self._num_gpus * self.batch_size))
else:
return self.size // (self._num_gpus * self.batch_size)
| 50.585859 | 147 | 0.625749 |
aceb33ae6847d455a71f7a7beff2e1623d703068 | 3,232 | py | Python | deprecated/make_config.py | larsbratholm/portfolio | eacbc2b28a201eab8479e353e221d41496be2ec0 | [
"MIT"
] | 1 | 2020-03-17T02:42:55.000Z | 2020-03-17T02:42:55.000Z | deprecated/make_config.py | larsbratholm/portfolio | eacbc2b28a201eab8479e353e221d41496be2ec0 | [
"MIT"
] | null | null | null | deprecated/make_config.py | larsbratholm/portfolio | eacbc2b28a201eab8479e353e221d41496be2ec0 | [
"MIT"
] | 3 | 2018-04-10T10:30:42.000Z | 2020-03-17T02:24:21.000Z |
def write_yaml(f, d, indent = 0):
for key, value in d.items():
f.write(" "*indent + key + ":")
if isinstance(value, dict):
f.write("\n")
write_yaml(f, value, indent + 2)
else:
f.write(" " + str(value))
f.write("\n")
f.write("\n")
def write_config():
d = {}
d["estimator"] = {"pickle": "model.pkl"}
if STRATEGY == "sobol":
d["strategy"] = {"name": STRATEGY}
elif STRATEGY == "hyperopt_tpe":
d["strategy"] = {"name": STRATEGY, "params": {"seeds": SEEDS}}
elif KAPPA == None:
d["strategy"] = {"name": STRATEGY, "params": {"seeds": SEEDS, "acquisition": "{ name : %s, params : {}}" % ACQUISITION,
"n_init": NUM_INIT, "n_iter": NUM_ITER, "sobol_init": SOBOL_INIT, "optimize_best": OPTIMIZE_BEST}}
else:
d["strategy"] = {"name": STRATEGY, "params": {"seeds": SEEDS,
"acquisition": "{ name : %s, params : {'kappa': %s}}" % (ACQUISITION, KAPPA),
"n_init": NUM_INIT, "n_iter": NUM_ITER, "sobol_init": SOBOL_INIT}}
d["search_space"] = {
"l2_reg": {"min": "1e-7", "max": "1e1", "type": "float", "warp": "log"},
"learning_rate": {"min": "1e-3", "max": "1e1", "type": "float", "warp": "log"}
}
if STRATEGY == "hyperopt_tpe":
d["search_space"]["iterations"] = {"min": "50", "max": "10000", "type": "int"}
else:
d["search_space"]["iterations"] = {"min": "50", "max": "10000", "type": "int", "warp": "log"}
d["random_seed"] = "42"
d["cv"] = {"name": "kfold", "params": {"n_splits": "9", "shuffle": "False"}}
d["dataset_loader"] = {"name": "joblib", "params": {"filenames": "data.pkl", "x_name": "x", "y_name": "y"}}
d["trials"] = {"uri": "sqlite:///trials_%d.db" % COUNTER}
with open("config%d.yaml" % COUNTER, "w") as f:
write_yaml(f, d)
if __name__ == "__main__":
SEEDS = None
KAPPA = None
NUM_ITER = None
NUM_INIT = None
SOBOL_INIT = None
ACQUISITION = None
OPTIMIZE_BEST = None
COUNTER = 1
STRATEGY = "sobol"
write_config()
SEEDS = 15
COUNTER += 1
STRATEGY = "hyperopt_tpe"
write_config()
STRATEGY = "gp"
for ACQUISITION in ["osprey", "ei", "ucb", "lars"]:
for KAPPA in [None, "1", "2", "3"]:
if ACQUISITION != "ucb" and KAPPA != None:
continue
if ACQUISITION == "ucb" and KAPPA == None:
continue
for OPTIMIZE_BEST in ["True", "False"]:
if OPTIMIZE_BEST == "True" and ACQUISITION not in ["ei", "lars"]:
continue
for NUM_ITER in ["1", "10", "100"]:
if NUM_ITER == "1" and OPTIMIZE_BEST == "True":
continue
for NUM_INIT in ["1", "10", "100"]:
for SOBOL_INIT in ["True", "False"]:
if SOBOL_INIT == "True" and NUM_ITER == "1":
continue
COUNTER += 1
#if ACQUISITION == "ucb":
# print(KAPPA, COUNTER)
write_config()
| 35.516484 | 128 | 0.478651 |
aceb34c6ed51c2a5b013f38e32201ac8939ed219 | 350,947 | py | Python | env/lib/python3.5/site-packages/phonenumbers/carrierdata/data1.py | mackevin1/aglan | b53309587e9bb982de069af267ac0626089c5137 | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/phonenumbers/carrierdata/data1.py | mackevin1/aglan | b53309587e9bb982de069af267ac0626089c5137 | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/phonenumbers/carrierdata/data1.py | mackevin1/aglan | b53309587e9bb982de069af267ac0626089c5137 | [
"BSD-3-Clause"
] | null | null | null | """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 = {
'7902743':{'en': 'Tele2', 'ru': 'Tele2'},
'559299933':{'en': 'Oi'},
'7902667':{'en': 'Tele2', 'ru': 'Tele2'},
'7901210':{'en': 'Tele2', 'ru': 'Tele2'},
'852935':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'5939630':{'en': 'Movistar'},
'55499910':{'en': 'Vivo'},
'554899153':{'en': 'Vivo'},
'8536882':{'en': 'CTM'},
'8536399':{'en': '3'},
'8536398':{'en': '3'},
'556599929':{'en': 'Vivo'},
'556599928':{'en': 'Vivo'},
'556599927':{'en': 'Vivo'},
'556599926':{'en': 'Vivo'},
'556599925':{'en': 'Vivo'},
'556599924':{'en': 'Vivo'},
'556599923':{'en': 'Vivo'},
'556599922':{'en': 'Vivo'},
'556599921':{'en': 'Vivo'},
'8536392':{'en': 'CTM'},
'555499974':{'en': 'Vivo'},
'555499975':{'en': 'Vivo'},
'555499976':{'en': 'Vivo'},
'555499977':{'en': 'Vivo'},
'6792':{'en': 'Vodafone'},
'555499971':{'en': 'Vivo'},
'555499972':{'en': 'Vivo'},
'555499973':{'en': 'Vivo'},
'555499978':{'en': 'Vivo'},
'555499979':{'en': 'Vivo'},
'6799':{'en': 'Vodafone'},
'556298176':{'en': 'TIM'},
'556298177':{'en': 'TIM'},
'556298174':{'en': 'TIM'},
'556298175':{'en': 'TIM'},
'556298172':{'en': 'TIM'},
'556298173':{'en': 'TIM'},
'556298171':{'en': 'TIM'},
'59069000':{'en': 'SFR/Rife'},
'59069007':{'en': 'Digicel'},
'59069006':{'en': 'Digicel'},
'556298178':{'en': 'TIM'},
'556298179':{'en': 'TIM'},
'557199928':{'en': 'Vivo'},
'7901642':{'en': 'Tele2', 'ru': 'Tele2'},
'7901640':{'en': 'Tele2', 'ru': 'Tele2'},
'7901641':{'en': 'Tele2', 'ru': 'Tele2'},
'6011209':{'en': 'XOX'},
'7901646':{'en': 'Tele2', 'ru': 'Tele2'},
'7901647':{'en': 'Tele2', 'ru': 'Tele2'},
'62351977':{'en': 'Esia'},
'62351976':{'en': 'Esia'},
'62351975':{'en': 'Esia'},
'62351979':{'en': 'Esia'},
'62351978':{'en': 'Esia'},
'84122':{'en': 'MobiFone'},
'6243191':{'en': 'Esia'},
'84120':{'en': 'MobiFone'},
'84121':{'en': 'MobiFone'},
'84126':{'en': 'MobiFone'},
'84127':{'en': 'Vinaphone'},
'84124':{'en': 'Vinaphone'},
'84125':{'en': 'Vinaphone'},
'7901673':{'en': 'Tele2', 'ru': 'Tele2'},
'6243199':{'en': 'Esia'},
'84128':{'en': 'MobiFone'},
'84129':{'en': 'Vinaphone'},
'556899933':{'en': 'Vivo'},
'556899932':{'en': 'Vivo'},
'556899931':{'en': 'Vivo'},
'556899937':{'en': 'Vivo'},
'556899936':{'en': 'Vivo'},
'556899935':{'en': 'Vivo'},
'556899934':{'en': 'Vivo'},
'556899939':{'en': 'Vivo'},
'556899938':{'en': 'Vivo'},
'790299':{'en': 'Tele2', 'ru': 'Tele2'},
'790298':{'en': 'Tele2', 'ru': 'Tele2'},
'790297':{'en': 'Tele2', 'ru': 'Tele2'},
'790296':{'en': 'Tele2', 'ru': 'Tele2'},
'790295':{'en': 'Tele2', 'ru': 'Tele2'},
'790294':{'en': 'Tele2', 'ru': 'Tele2'},
'790292':{'en': 'Tele2', 'ru': 'Tele2'},
'790291':{'en': 'Tele2', 'ru': 'Tele2'},
'62818':{'en': 'XL'},
'62819':{'en': 'XL'},
'8528480':{'en': 'Handy', 'zh': 'Handy', 'zh_Hant': 'Handy'},
'62814':{'en': 'IM3'},
'55829810':{'en': 'Vivo'},
'55829811':{'en': 'Vivo'},
'55829812':{'en': 'Vivo'},
'55829813':{'en': 'Vivo'},
'559998149':{'en': 'TIM'},
'559998148':{'en': 'TIM'},
'62887':{'en': 'Smartfren'},
'554898419':{'en': 'Brasil Telecom GSM'},
'554898418':{'en': 'Brasil Telecom GSM'},
'62883':{'en': 'Smartfren'},
'62882':{'en': 'Smartfren'},
'554898415':{'en': 'Brasil Telecom GSM'},
'554898414':{'en': 'Brasil Telecom GSM'},
'554898417':{'en': 'Brasil Telecom GSM'},
'554898416':{'en': 'Brasil Telecom GSM'},
'554898411':{'en': 'Brasil Telecom GSM'},
'559998144':{'en': 'TIM'},
'554898413':{'en': 'Brasil Telecom GSM'},
'554898412':{'en': 'Brasil Telecom GSM'},
'62967900':{'en': 'Esia'},
'79397':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'555398121':{'en': 'TIM'},
'558699514':{'en': 'Claro BR'},
'555398123':{'en': 'TIM'},
'555398122':{'en': 'TIM'},
'555398125':{'en': 'TIM'},
'555398124':{'en': 'TIM'},
'555398127':{'en': 'TIM'},
'555398126':{'en': 'TIM'},
'555398129':{'en': 'TIM'},
'555398128':{'en': 'TIM'},
'554799909':{'en': 'TIM'},
'554799905':{'en': 'TIM'},
'554799904':{'en': 'TIM'},
'554799907':{'en': 'TIM'},
'554799906':{'en': 'TIM'},
'554799901':{'en': 'TIM'},
'554799903':{'en': 'TIM'},
'554799902':{'en': 'TIM'},
'556398128':{'en': 'TIM'},
'556398129':{'en': 'TIM'},
'556398122':{'en': 'TIM'},
'556398123':{'en': 'TIM'},
'556398121':{'en': 'TIM'},
'556398126':{'en': 'TIM'},
'556398127':{'en': 'TIM'},
'556398124':{'en': 'TIM'},
'556398125':{'en': 'TIM'},
'6227192':{'en': 'Esia'},
'79535':{'en': 'Tele2', 'ru': 'Tele2'},
'79534':{'en': 'Tele2', 'ru': 'Tele2'},
'79537':{'en': 'Tele2', 'ru': 'Tele2'},
'79536':{'en': 'Tele2', 'ru': 'Tele2'},
'79533':{'en': 'Tele2', 'ru': 'Tele2'},
'554799638':{'en': 'TIM'},
'554799637':{'en': 'TIM'},
'554799636':{'en': 'TIM'},
'554799635':{'en': 'TIM'},
'554799634':{'en': 'TIM'},
'554799633':{'en': 'TIM'},
'554799632':{'en': 'TIM'},
'554799631':{'en': 'TIM'},
'8536395':{'en': 'CTM'},
'557498131':{'en': 'Claro BR'},
'557498130':{'en': 'Claro BR'},
'8536394':{'en': 'CTM'},
'8536397':{'en': 'CTM'},
'790262':{'en': 'Tele2', 'ru': 'Tele2'},
'8536396':{'en': 'CTM'},
'7995898':{'en': 'Tele2', 'ru': 'Tele2'},
'790263':{'en': 'Tele2', 'ru': 'Tele2'},
'7995896':{'en': 'Tele2', 'ru': 'Tele2'},
'7995897':{'en': 'Tele2', 'ru': 'Tele2'},
'7995895':{'en': 'Tele2', 'ru': 'Tele2'},
'8536390':{'en': 'China Telecom'},
'790261':{'en': 'Tele2', 'ru': 'Tele2'},
'556598438':{'en': 'Brasil Telecom GSM'},
'556999998':{'en': 'Vivo'},
'556999999':{'en': 'Vivo'},
'556999996':{'en': 'Vivo'},
'556999997':{'en': 'Vivo'},
'556999994':{'en': 'Vivo'},
'556999995':{'en': 'Vivo'},
'556999992':{'en': 'Vivo'},
'556999993':{'en': 'Vivo'},
'556999991':{'en': 'Vivo'},
'6277799':{'en': 'Esia'},
'8525706':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'790264':{'en': 'Tele2', 'ru': 'Tele2'},
'6797':{'en': 'Digicel'},
'790265':{'en': 'Tele2', 'ru': 'Tele2'},
'60158850':{'en': 'IP Mobility'},
'559999955':{'en': 'Oi'},
'559999954':{'en': 'Oi'},
'559999951':{'en': 'Oi'},
'559999953':{'en': 'Oi'},
'559999952':{'en': 'Oi'},
'7902953':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'8525707':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'7902955':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902954':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'658862':{'en': 'M1'},
'559199281':{'en': 'Vivo'},
'559199280':{'en': 'Vivo'},
'559199283':{'en': 'Vivo'},
'559199282':{'en': 'Vivo'},
'559199285':{'en': 'Vivo'},
'559199284':{'en': 'Vivo'},
'559199286':{'en': 'Vivo'},
'8525704':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'556598409':{'en': 'Brasil Telecom GSM'},
'556598408':{'en': 'Brasil Telecom GSM'},
'556598403':{'en': 'Brasil Telecom GSM'},
'556598402':{'en': 'Brasil Telecom GSM'},
'556598401':{'en': 'Brasil Telecom GSM'},
'556598407':{'en': 'Brasil Telecom GSM'},
'556598406':{'en': 'Brasil Telecom GSM'},
'556598405':{'en': 'Brasil Telecom GSM'},
'556598404':{'en': 'Brasil Telecom GSM'},
'554899901':{'en': 'TIM'},
'554899902':{'en': 'TIM'},
'554899903':{'en': 'TIM'},
'554899904':{'en': 'TIM'},
'554899905':{'en': 'TIM'},
'554899906':{'en': 'TIM'},
'554899907':{'en': 'TIM'},
'554899908':{'en': 'TIM'},
'554899909':{'en': 'TIM'},
'852634':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852635':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852632':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8525705':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'852630':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852631':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'7902356':{'en': 'Tele2', 'ru': 'Tele2'},
'7902423':{'en': 'Tele2', 'ru': 'Tele2'},
'7996814':{'en': 'Tele2', 'ru': 'Tele2'},
'8525702':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'7902422':{'en': 'Tele2', 'ru': 'Tele2'},
'7996813':{'en': 'Tele2', 'ru': 'Tele2'},
'852980':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525703':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'852982':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852983':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852984':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852985':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852986':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852987':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'5939791':{'en': 'Movistar'},
'5939790':{'en': 'Movistar'},
'5939793':{'en': 'Movistar'},
'5939792':{'en': 'Movistar'},
'5939795':{'en': 'Claro'},
'554899168':{'en': 'Vivo'},
'5939797':{'en': 'Claro'},
'5939796':{'en': 'Claro'},
'5939799':{'en': 'Claro'},
'5939798':{'en': 'Claro'},
'674557':{'en': 'Digicel'},
'554899169':{'en': 'Vivo'},
'7902421':{'en': 'Tele2', 'ru': 'Tele2'},
'554899166':{'en': 'Vivo'},
'7996812':{'en': 'Tele2', 'ru': 'Tele2'},
'63909':{'en': 'Smart'},
'5581986':{'en': 'Oi'},
'63907':{'en': 'Smart'},
'63906':{'en': 'Globe'},
'63905':{'en': 'Globe'},
'554899164':{'en': 'Vivo'},
'6234198':{'en': 'Esia'},
'6234199':{'en': 'Esia'},
'7902420':{'en': 'Tele2', 'ru': 'Tele2'},
'59069009':{'en': 'Digicel'},
'59069008':{'en': 'Digicel'},
'8525701':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'658866':{'en': 'M1'},
'8536560':{'en': 'China Telecom'},
'8536561':{'en': 'China Telecom'},
'556698118':{'en': 'TIM'},
'55469910':{'en': 'Vivo'},
'556698114':{'en': 'TIM'},
'556698115':{'en': 'TIM'},
'556698116':{'en': 'TIM'},
'556698117':{'en': 'TIM'},
'556698111':{'en': 'TIM'},
'556698112':{'en': 'TIM'},
'556698113':{'en': 'TIM'},
'556299941':{'en': 'Vivo'},
'556299942':{'en': 'Vivo'},
'556299943':{'en': 'Vivo'},
'556299944':{'en': 'Vivo'},
'556299945':{'en': 'Vivo'},
'556299946':{'en': 'Vivo'},
'556299947':{'en': 'Vivo'},
'556299948':{'en': 'Vivo'},
'556299949':{'en': 'Vivo'},
'55959840':{'en': 'Claro BR'},
'558599666':{'en': 'TIM'},
'558599667':{'en': 'TIM'},
'558599664':{'en': 'TIM'},
'558599665':{'en': 'TIM'},
'558599662':{'en': 'TIM'},
'558599663':{'en': 'TIM'},
'558599661':{'en': 'TIM'},
'558599668':{'en': 'TIM'},
'558599669':{'en': 'TIM'},
'59069005':{'en': 'SFR/Rife'},
'6227599':{'en': 'Esia'},
'62260923':{'en': 'Esia'},
'62260922':{'en': 'Esia'},
'62260921':{'en': 'Esia'},
'62260920':{'en': 'Esia'},
'62260924':{'en': 'Esia'},
'559199919':{'en': 'Oi'},
'559199918':{'en': 'Oi'},
'658391':{'en': 'StarHub'},
'658390':{'en': 'StarHub'},
'559199913':{'en': 'Oi'},
'559199912':{'en': 'Oi'},
'559199915':{'en': 'Oi'},
'559199914':{'en': 'Oi'},
'559199917':{'en': 'Oi'},
'559199916':{'en': 'Oi'},
'559999179':{'en': 'Vivo'},
'559999178':{'en': 'Vivo'},
'556498138':{'en': 'TIM'},
'556498139':{'en': 'TIM'},
'556498134':{'en': 'TIM'},
'556498135':{'en': 'TIM'},
'559999171':{'en': 'Vivo'},
'556498137':{'en': 'TIM'},
'559999177':{'en': 'Vivo'},
'556498131':{'en': 'TIM'},
'559999175':{'en': 'Vivo'},
'556498133':{'en': 'TIM'},
'658643':{'en': 'M1'},
'658642':{'en': 'M1'},
'658641':{'en': 'M1'},
'658640':{'en': 'SingTel'},
'658647':{'en': 'SingTel'},
'658646':{'en': 'SingTel'},
'658645':{'en': 'M1'},
'658644':{'en': 'M1'},
'556199809':{'en': 'Vivo'},
'658648':{'en': 'SingTel'},
'557199258':{'en': 'TIM'},
'557199259':{'en': 'TIM'},
'557199254':{'en': 'TIM'},
'557199255':{'en': 'TIM'},
'557199256':{'en': 'TIM'},
'557199257':{'en': 'TIM'},
'557199251':{'en': 'TIM'},
'557199252':{'en': 'TIM'},
'557199253':{'en': 'TIM'},
'554599972':{'en': 'TIM'},
'6011208':{'en': 'XOX'},
'67371':{'en': 'DSTCom'},
'554599971':{'en': 'TIM'},
'7958034':{'en': 'Tele2', 'ru': 'Tele2'},
'554599976':{'en': 'TIM'},
'790214':{'en': 'Tele2', 'ru': 'Tele2'},
'554599977':{'en': 'TIM'},
'7908436':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'6226391':{'en': 'Esia'},
'554699978':{'en': 'TIM'},
'554699976':{'en': 'TIM'},
'554699975':{'en': 'TIM'},
'554699974':{'en': 'TIM'},
'554699973':{'en': 'TIM'},
'554699972':{'en': 'TIM'},
'554699971':{'en': 'TIM'},
'554599978':{'en': 'TIM'},
'6011202':{'en': 'Talk Focus'},
'6011205':{'en': 'XOX'},
'558999985':{'en': 'TIM'},
'558999984':{'en': 'TIM'},
'555399999':{'en': 'Vivo'},
'555399998':{'en': 'Vivo'},
'555399993':{'en': 'Vivo'},
'555399992':{'en': 'Vivo'},
'555399991':{'en': 'Vivo'},
'6011206':{'en': 'XOX'},
'555399997':{'en': 'Vivo'},
'555399996':{'en': 'Vivo'},
'555399995':{'en': 'Vivo'},
'555399994':{'en': 'Vivo'},
'790211':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559299911':{'en': 'Oi'},
'559299912':{'en': 'Oi'},
'559299913':{'en': 'Oi'},
'559599115':{'en': 'Vivo'},
'559599114':{'en': 'Vivo'},
'559599117':{'en': 'Vivo'},
'559599116':{'en': 'Vivo'},
'559599111':{'en': 'Vivo'},
'559599113':{'en': 'Vivo'},
'559599112':{'en': 'Vivo'},
'559599119':{'en': 'Vivo'},
'559599118':{'en': 'Vivo'},
'790486':{'en': 'Tele2', 'ru': 'Tele2'},
'790487':{'en': 'Tele2', 'ru': 'Tele2'},
'556599945':{'en': 'Vivo'},
'556599944':{'en': 'Vivo'},
'556599947':{'en': 'Vivo'},
'556599946':{'en': 'Vivo'},
'556599941':{'en': 'Vivo'},
'556599943':{'en': 'Vivo'},
'556599942':{'en': 'Vivo'},
'556599949':{'en': 'Vivo'},
'556599948':{'en': 'Vivo'},
'658533':{'en': 'SingTel'},
'59069021':{'en': 'Digicel'},
'59069020':{'en': 'Digicel'},
'59069023':{'en': 'Digicel'},
'59069022':{'en': 'Dauphin Telecom'},
'59069025':{'en': 'Digicel'},
'59069024':{'en': 'Digicel'},
'59069027':{'en': 'Orange'},
'59069026':{'en': 'Orange'},
'59069029':{'en': 'Orange'},
'59069028':{'en': 'Orange'},
'555599946':{'en': 'Vivo'},
'555599947':{'en': 'Vivo'},
'555599944':{'en': 'Vivo'},
'555599945':{'en': 'Vivo'},
'555599942':{'en': 'Vivo'},
'555599943':{'en': 'Vivo'},
'555599941':{'en': 'Vivo'},
'7908850':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908851':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'555599948':{'en': 'Vivo'},
'555599949':{'en': 'Vivo'},
'558299995':{'en': 'TIM'},
'555498414':{'en': 'Brasil Telecom GSM'},
'558299997':{'en': 'TIM'},
'558299996':{'en': 'TIM'},
'558299991':{'en': 'TIM'},
'558299993':{'en': 'TIM'},
'558299992':{'en': 'TIM'},
'558299999':{'en': 'TIM'},
'558299998':{'en': 'TIM'},
'555498141':{'en': 'TIM'},
'555498147':{'en': 'TIM'},
'7901634':{'en': 'Tele2', 'ru': 'Tele2'},
'7901633':{'en': 'Tele2', 'ru': 'Tele2'},
'558299351':{'en': 'Claro BR'},
'7901631':{'en': 'Tele2', 'ru': 'Tele2'},
'7901630':{'en': 'Tele2', 'ru': 'Tele2'},
'62331988':{'en': 'Esia'},
'555498145':{'en': 'TIM'},
'62331989':{'en': 'Esia'},
'8536576':{'en': '3'},
'62264928':{'en': 'Esia'},
'62264927':{'en': 'Esia'},
'62264926':{'en': 'Esia'},
'62264925':{'en': 'Esia'},
'62264924':{'en': 'Esia'},
'62264923':{'en': 'Esia'},
'62264922':{'en': 'Esia'},
'62264921':{'en': 'Esia'},
'62264920':{'en': 'Esia'},
'6011246':{'en': 'Celcom'},
'556298158':{'en': 'TIM'},
'556298159':{'en': 'TIM'},
'556298154':{'en': 'TIM'},
'556298155':{'en': 'TIM'},
'556298156':{'en': 'TIM'},
'556298157':{'en': 'TIM'},
'556298151':{'en': 'TIM'},
'556298152':{'en': 'TIM'},
'556298153':{'en': 'TIM'},
'5699785':{'en': 'Entel'},
'5699784':{'en': 'Entel'},
'62298920':{'en': 'Esia'},
'62298921':{'en': 'Esia'},
'62298922':{'en': 'Esia'},
'62298923':{'en': 'Esia'},
'62298924':{'en': 'Esia'},
'5699787':{'en': 'Entel'},
'557999159':{'en': 'TIM'},
'622291':{'en': 'Esia'},
'622293':{'en': 'Esia'},
'557999154':{'en': 'TIM'},
'557999153':{'en': 'TIM'},
'557999152':{'en': 'TIM'},
'557999151':{'en': 'TIM'},
'6227699':{'en': 'Esia'},
'554898433':{'en': 'Brasil Telecom GSM'},
'554898432':{'en': 'Brasil Telecom GSM'},
'554898431':{'en': 'Brasil Telecom GSM'},
'554898437':{'en': 'Brasil Telecom GSM'},
'554898436':{'en': 'Brasil Telecom GSM'},
'554898435':{'en': 'Brasil Telecom GSM'},
'554898434':{'en': 'Brasil Telecom GSM'},
'554898439':{'en': 'Brasil Telecom GSM'},
'554898438':{'en': 'Brasil Telecom GSM'},
'658876':{'en': 'SingTel'},
'7996019':{'en': 'Tele2', 'ru': 'Tele2'},
'7996018':{'en': 'Tele2', 'ru': 'Tele2'},
'7996017':{'en': 'Tele2', 'ru': 'Tele2'},
'7996016':{'en': 'Tele2', 'ru': 'Tele2'},
'7996015':{'en': 'Tele2', 'ru': 'Tele2'},
'658877':{'en': 'M1'},
'7996013':{'en': 'Tele2', 'ru': 'Tele2'},
'7996010':{'en': 'Tele2', 'ru': 'Tele2'},
'6264593':{'en': 'Esia'},
'658478':{'en': 'StarHub'},
'795306':{'en': 'Tele2', 'ru': 'Tele2'},
'795307':{'en': 'Tele2', 'ru': 'Tele2'},
'795304':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795305':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795302':{'en': 'Tele2', 'ru': 'Tele2'},
'795303':{'en': 'Tele2', 'ru': 'Tele2'},
'795300':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795301':{'en': 'Tele2', 'ru': 'Tele2'},
'5699149':{'en': 'Movistar'},
'795308':{'en': 'Tele2', 'ru': 'Tele2'},
'795309':{'en': 'Tele2', 'ru': 'Tele2'},
'554799923':{'en': 'TIM'},
'554799922':{'en': 'TIM'},
'554799921':{'en': 'TIM'},
'554799927':{'en': 'TIM'},
'554799926':{'en': 'TIM'},
'554799925':{'en': 'TIM'},
'554799924':{'en': 'TIM'},
'554799929':{'en': 'TIM'},
'554799928':{'en': 'TIM'},
'5699148':{'en': 'Movistar'},
'799541':{'en': 'Tele2', 'ru': 'Tele2'},
'554799655':{'en': 'TIM'},
'554799654':{'en': 'TIM'},
'554799657':{'en': 'TIM'},
'554799656':{'en': 'TIM'},
'554799651':{'en': 'TIM'},
'79516':{'en': 'Tele2', 'ru': 'Tele2'},
'554799653':{'en': 'TIM'},
'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'},
'67785':{'en': 'BMobile'},
'67784':{'en': 'BMobile'},
'67787':{'en': 'BMobile'},
'67786':{'en': 'BMobile'},
'67789':{'en': 'BMobile'},
'67788':{'en': 'BMobile'},
'55659998':{'en': 'Vivo'},
'8525233':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525230':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525231':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525234':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'8525235':{'en': '21Vianet', 'zh': '21Vianet', 'zh_Hant': '21Vianet'},
'55659996':{'en': 'Vivo'},
'55659997':{'en': 'Vivo'},
'795105':{'en': 'Tele2', 'ru': 'Tele2'},
'558398164':{'en': 'Vivo'},
'558398165':{'en': 'Vivo'},
'559999970':{'en': 'Oi'},
'558398160':{'en': 'Vivo'},
'558398161':{'en': 'Vivo'},
'558398162':{'en': 'Vivo'},
'558398163':{'en': 'Vivo'},
'559999979':{'en': 'Oi'},
'559999978':{'en': 'Oi'},
'7902209':{'en': 'MTS', 'ru': 'MTS'},
'7902208':{'en': 'MTS', 'ru': 'MTS'},
'7902207':{'en': 'MTS', 'ru': 'MTS'},
'7902206':{'en': 'MTS', 'ru': 'MTS'},
'7902205':{'en': 'MTS', 'ru': 'MTS'},
'7902204':{'en': 'MTS', 'ru': 'MTS'},
'7902203':{'en': 'MTS', 'ru': 'MTS'},
'7902200':{'en': 'MTS', 'ru': 'MTS'},
'62233927':{'en': 'Esia'},
'62233926':{'en': 'Esia'},
'62233925':{'en': 'Esia'},
'62233924':{'en': 'Esia'},
'62233923':{'en': 'Esia'},
'62233922':{'en': 'Esia'},
'62233921':{'en': 'Esia'},
'62233920':{'en': 'Esia'},
'790884':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'62233928':{'en': 'Esia'},
'7958036':{'en': 'Tele2', 'ru': 'Tele2'},
'7958035':{'en': 'Tele2', 'ru': 'Tele2'},
'852618':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852619':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'559899968':{'en': 'Oi'},
'852610':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'7958033':{'en': 'Tele2', 'ru': 'Tele2'},
'852612':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852613':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852614':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852615':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852616':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'7958032':{'en': 'Tele2', 'ru': 'Tele2'},
'7958031':{'en': 'Tele2', 'ru': 'Tele2'},
'7958030':{'en': 'Tele2', 'ru': 'Tele2'},
'559899962':{'en': 'Oi'},
'85366046':{'en': 'SmarTone'},
'7908469':{'en': 'Tele2', 'ru': 'Tele2'},
'7908468':{'en': 'Tele2', 'ru': 'Tele2'},
'7908465':{'en': 'Tele2', 'ru': 'Tele2'},
'7908467':{'en': 'Tele2', 'ru': 'Tele2'},
'7908466':{'en': 'Tele2', 'ru': 'Tele2'},
'7901400':{'en': 'Tele2', 'ru': 'Tele2'},
'556498117':{'en': 'TIM'},
'559599961':{'en': 'Oi'},
'559599962':{'en': 'Oi'},
'559599963':{'en': 'Oi'},
'559599964':{'en': 'Oi'},
'559599965':{'en': 'Oi'},
'559599967':{'en': 'Oi'},
'7901410':{'en': 'Tele2', 'ru': 'Tele2'},
'556498114':{'en': 'TIM'},
'658800':{'en': 'M1'},
'8536588':{'en': 'CTM'},
'8536589':{'en': 'CTM'},
'658809':{'en': 'StarHub'},
'8536585':{'en': 'China Telecom'},
'8536586':{'en': 'CTM'},
'8536587':{'en': 'CTM'},
'8536580':{'en': 'China Telecom'},
'8536581':{'en': 'China Telecom'},
'8536582':{'en': 'China Telecom'},
'8536583':{'en': 'China Telecom'},
'556299926':{'en': 'Vivo'},
'556299927':{'en': 'Vivo'},
'556299924':{'en': 'Vivo'},
'556299925':{'en': 'Vivo'},
'556299922':{'en': 'Vivo'},
'556299923':{'en': 'Vivo'},
'556299921':{'en': 'Vivo'},
'556299928':{'en': 'Vivo'},
'556299929':{'en': 'Vivo'},
'8524600':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'62881':{'en': 'Smartfren'},
'8524602':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8524603':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8524604':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8524605':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8524606':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559998141':{'en': 'TIM'},
'559998143':{'en': 'TIM'},
'559998142':{'en': 'TIM'},
'559998145':{'en': 'TIM'},
'559199933':{'en': 'Oi'},
'62888':{'en': 'Smartfren'},
'7900464':{'en': 'Tele2', 'ru': 'Tele2'},
'558599648':{'en': 'TIM'},
'558599649':{'en': 'TIM'},
'7900463':{'en': 'Tele2', 'ru': 'Tele2'},
'7900462':{'en': 'Tele2', 'ru': 'Tele2'},
'558599644':{'en': 'TIM'},
'558599645':{'en': 'TIM'},
'558599646':{'en': 'TIM'},
'559998146':{'en': 'TIM'},
'558599641':{'en': 'TIM'},
'558599642':{'en': 'TIM'},
'558599643':{'en': 'TIM'},
'559999191':{'en': 'Vivo'},
'559999193':{'en': 'Vivo'},
'559999192':{'en': 'Vivo'},
'559999195':{'en': 'Vivo'},
'559999194':{'en': 'Vivo'},
'559999197':{'en': 'Vivo'},
'559999196':{'en': 'Vivo'},
'659114':{'en': 'SingTel'},
'559999198':{'en': 'Vivo'},
'67574':{'en': 'Digicel'},
'6231930':{'en': 'Esia'},
'67572':{'en': 'Digicel'},
'67573':{'en': 'Digicel'},
'67570':{'en': 'Digicel'},
'67571':{'en': 'Digicel'},
'659115':{'en': 'SingTel'},
'557499189':{'en': 'TIM'},
'557499188':{'en': 'TIM'},
'556798162':{'en': 'TIM'},
'556798163':{'en': 'TIM'},
'556798161':{'en': 'TIM'},
'556798167':{'en': 'TIM'},
'556798164':{'en': 'TIM'},
'554699915':{'en': 'TIM'},
'554699914':{'en': 'TIM'},
'554699917':{'en': 'TIM'},
'554699916':{'en': 'TIM'},
'554699911':{'en': 'TIM'},
'554699913':{'en': 'TIM'},
'554699912':{'en': 'TIM'},
'6015461':{'en': 'Telekom'},
'6015460':{'en': 'Telekom'},
'6015463':{'en': 'Telekom'},
'6015462':{'en': 'Telekom'},
'554699919':{'en': 'TIM'},
'554699918':{'en': 'TIM'},
'59978':{'en': 'Digicel'},
'62218394':{'en': 'Esia'},
'6018130':{'en': 'U Mobile'},
'62218392':{'en': 'Esia'},
'62218391':{'en': 'Esia'},
'62218390':{'en': 'Esia'},
'6237099':{'en': 'Esia'},
'555399971':{'en': 'Vivo'},
'555399973':{'en': 'Vivo'},
'555399972':{'en': 'Vivo'},
'555399975':{'en': 'Vivo'},
'555399974':{'en': 'Vivo'},
'555399977':{'en': 'Vivo'},
'555399976':{'en': 'Vivo'},
'555399979':{'en': 'Vivo'},
'555399978':{'en': 'Vivo'},
'85571':{'en': 'Metfone'},
'62263931':{'en': 'Esia'},
'62263930':{'en': 'Esia'},
'62263933':{'en': 'Esia'},
'62263932':{'en': 'Esia'},
'62263935':{'en': 'Esia'},
'62263934':{'en': 'Esia'},
'559299978':{'en': 'Oi'},
'559299976':{'en': 'Oi'},
'559299977':{'en': 'Oi'},
'559299974':{'en': 'Oi'},
'559299975':{'en': 'Oi'},
'559299972':{'en': 'Oi'},
'559299973':{'en': 'Oi'},
'559299971':{'en': 'Oi'},
'659113':{'en': 'SingTel'},
'8536328':{'en': 'CTM'},
'559599139':{'en': 'Vivo'},
'559599138':{'en': 'Vivo'},
'8536329':{'en': 'CTM'},
'559599133':{'en': 'Vivo'},
'559599132':{'en': 'Vivo'},
'559599131':{'en': 'Vivo'},
'559599137':{'en': 'Vivo'},
'559599136':{'en': 'Vivo'},
'559599135':{'en': 'Vivo'},
'559599134':{'en': 'Vivo'},
'559499934':{'en': 'Oi'},
'559499933':{'en': 'Oi'},
'658654':{'en': 'SingTel'},
'658655':{'en': 'SingTel'},
'658656':{'en': 'SingTel'},
'658657':{'en': 'SingTel'},
'658650':{'en': 'SingTel'},
'658651':{'en': 'SingTel'},
'59069047':{'en': 'Orange'},
'59069046':{'en': 'Digicel'},
'59069045':{'en': 'Digicel'},
'59069044':{'en': 'Digicel'},
'555599968':{'en': 'Vivo'},
'555599969':{'en': 'Vivo'},
'59069041':{'en': 'Orange'},
'59069040':{'en': 'Orange'},
'555599964':{'en': 'Vivo'},
'555599965':{'en': 'Vivo'},
'555599966':{'en': 'Vivo'},
'555599967':{'en': 'Vivo'},
'555599961':{'en': 'Vivo'},
'555599962':{'en': 'Vivo'},
'555599963':{'en': 'Vivo'},
'658222':{'en': 'M1'},
'7902516':{'en': 'Tele2', 'ru': 'Tele2'},
'7902515':{'en': 'Tele2', 'ru': 'Tele2'},
'7902514':{'en': 'Tele2', 'ru': 'Tele2'},
'658229':{'en': 'StarHub'},
'57350':{'en': 'Avantel'},
'8536814':{'en': 'CTM'},
'555499648':{'en': 'Vivo'},
'555499649':{'en': 'Vivo'},
'555499642':{'en': 'Vivo'},
'555499643':{'en': 'Vivo'},
'555499641':{'en': 'Vivo'},
'555499646':{'en': 'Vivo'},
'555499647':{'en': 'Vivo'},
'555499644':{'en': 'Vivo'},
'555499645':{'en': 'Vivo'},
'8536811':{'en': 'CTM'},
'559399122':{'en': 'Vivo'},
'559399123':{'en': 'Vivo'},
'559399121':{'en': 'Vivo'},
'559399126':{'en': 'Vivo'},
'559399127':{'en': 'Vivo'},
'559399124':{'en': 'Vivo'},
'559399125':{'en': 'Vivo'},
'559399128':{'en': 'Vivo'},
'559399129':{'en': 'Vivo'},
'62518322':{'en': 'Esia'},
'62518321':{'en': 'Esia'},
'62518320':{'en': 'Esia'},
'556198582':{'en': 'Brasil Telecom GSM'},
'556198581':{'en': 'Brasil Telecom GSM'},
'557999135':{'en': 'TIM'},
'557999134':{'en': 'TIM'},
'557999137':{'en': 'TIM'},
'557999136':{'en': 'TIM'},
'557999131':{'en': 'TIM'},
'557999133':{'en': 'TIM'},
'557999132':{'en': 'TIM'},
'557999139':{'en': 'TIM'},
'557999138':{'en': 'TIM'},
'558699515':{'en': 'Claro BR'},
'558699517':{'en': 'Claro BR'},
'8536247':{'en': '3'},
'8536246':{'en': '3'},
'8536245':{'en': 'SmarTone'},
'558699516':{'en': 'Claro BR'},
'8536243':{'en': 'CTM'},
'8536242':{'en': 'CTM'},
'8536241':{'en': '3'},
'8536240':{'en': '3'},
'558699511':{'en': 'Claro BR'},
'8536249':{'en': '3'},
'558699510':{'en': 'Claro BR'},
'799698':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799699':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'558699513':{'en': 'Claro BR'},
'799690':{'en': 'Tele2', 'ru': 'Tele2'},
'799691':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799692':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'558699512':{'en': 'Claro BR'},
'799694':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799695':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799696':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799697':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7958848':{'en': 'Tele2', 'ru': 'Tele2'},
'7958849':{'en': 'Tele2', 'ru': 'Tele2'},
'7958842':{'en': 'Tele2', 'ru': 'Tele2'},
'7958843':{'en': 'Tele2', 'ru': 'Tele2'},
'7958840':{'en': 'Tele2', 'ru': 'Tele2'},
'7958841':{'en': 'Tele2', 'ru': 'Tele2'},
'7958847':{'en': 'Tele2', 'ru': 'Tele2'},
'7958844':{'en': 'Tele2', 'ru': 'Tele2'},
'622990':{'en': 'Esia'},
'795093':{'en': 'MTS', 'ru': 'MTS'},
'601142':{'en': 'Telekomunikasi Indonesia'},
'601140':{'en': 'Celcom'},
'601141':{'en': 'Celcom'},
'6277199':{'en': 'Esia'},
'8536642':{'en': '3'},
'59781':{'en': 'Digicel'},
'59782':{'en': 'Digicel'},
'59785':{'en': 'Telesur'},
'59786':{'en': 'Telesur'},
'59787':{'en': 'Telesur'},
'59788':{'en': 'Telesur'},
'59789':{'en': 'Telesur'},
'559699172':{'en': 'Vivo'},
'559699173':{'en': 'Vivo'},
'559699171':{'en': 'Vivo'},
'559699176':{'en': 'Vivo'},
'559699177':{'en': 'Vivo'},
'559699174':{'en': 'Vivo'},
'559699175':{'en': 'Vivo'},
'559699178':{'en': 'Vivo'},
'559699179':{'en': 'Vivo'},
'591731':{'en': 'Entel'},
'55619996':{'en': 'Vivo'},
'591733':{'en': 'Entel'},
'591732':{'en': 'Entel'},
'62295996':{'en': 'Esia'},
'62295997':{'en': 'Esia'},
'62295994':{'en': 'Esia'},
'55619997':{'en': 'Vivo'},
'62295993':{'en': 'Esia'},
'62295998':{'en': 'Esia'},
'62295999':{'en': 'Esia'},
'569439':{'en': 'Virgin Mobile'},
'569438':{'en': 'Virgin Mobile'},
'569431':{'en': 'Telestar'},
'569430':{'en': 'Telestar'},
'569433':{'en': 'Telestar'},
'569432':{'en': 'Telestar'},
'569435':{'en': 'Simple'},
'569434':{'en': 'Simple'},
'569437':{'en': u('Telef\u00f3nica Uno Uno Cuatro')},
'569436':{'en': u('Telef\u00f3nica Uno Uno Cuatro')},
'5582991':{'en': 'Claro BR'},
'554999991':{'en': 'TIM'},
'554999992':{'en': 'TIM'},
'554999993':{'en': 'TIM'},
'554999994':{'en': 'TIM'},
'554999995':{'en': 'TIM'},
'554999996':{'en': 'TIM'},
'554999997':{'en': 'TIM'},
'554999998':{'en': 'TIM'},
'55619998':{'en': 'Vivo'},
'55619999':{'en': 'Vivo'},
'62736400':{'en': 'Esia'},
'62736401':{'en': 'Esia'},
'6011188':{'en': 'Tune Talk'},
'6011189':{'en': 'Tune Talk'},
'62736404':{'en': 'Esia'},
'6011182':{'en': 'Telekom'},
'6011183':{'en': 'Telekom'},
'6011180':{'en': 'Telekom'},
'6011181':{'en': 'Telekom'},
'6011186':{'en': 'Tune Talk'},
'6011187':{'en': 'Tune Talk'},
'6011184':{'en': 'Telekom'},
'6011185':{'en': 'Tune Talk'},
'558599921':{'en': 'TIM'},
'558599923':{'en': 'TIM'},
'558599922':{'en': 'TIM'},
'558599925':{'en': 'TIM'},
'558599924':{'en': 'TIM'},
'558599927':{'en': 'TIM'},
'558599926':{'en': 'TIM'},
'558599929':{'en': 'TIM'},
'558599928':{'en': 'TIM'},
'559298211':{'en': 'TIM'},
'7900554':{'en': 'Tele2', 'ru': 'Tele2'},
'7936333':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559899912':{'en': 'Oi'},
'559899913':{'en': 'Oi'},
'559899911':{'en': 'Oi'},
'7900556':{'en': 'Tele2', 'ru': 'Tele2'},
'7936111':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556598115':{'en': 'TIM'},
'556598114':{'en': 'TIM'},
'556598117':{'en': 'TIM'},
'556598116':{'en': 'TIM'},
'556598111':{'en': 'TIM'},
'554899949':{'en': 'TIM'},
'556598113':{'en': 'TIM'},
'556598112':{'en': 'TIM'},
'554899944':{'en': 'TIM'},
'554899945':{'en': 'TIM'},
'554899946':{'en': 'TIM'},
'554899947':{'en': 'TIM'},
'556598119':{'en': 'TIM'},
'556598118':{'en': 'TIM'},
'554899942':{'en': 'TIM'},
'554899943':{'en': 'TIM'},
'62721974':{'en': 'Esia'},
'62721975':{'en': 'Esia'},
'5623230':{'en': 'Entel'},
'5623231':{'en': 'Entel'},
'5623232':{'en': 'Entel'},
'5623233':{'en': 'Entel'},
'5623234':{'en': 'Entel'},
'5623235':{'en': 'Entel'},
'795815':{'en': 'Tele2', 'ru': 'Tele2'},
'7958668':{'en': 'Tele2', 'ru': 'Tele2'},
'7958669':{'en': 'Tele2', 'ru': 'Tele2'},
'7900553':{'en': 'Tele2', 'ru': 'Tele2'},
'7996853':{'en': 'Tele2', 'ru': 'Tele2'},
'7996852':{'en': 'Tele2', 'ru': 'Tele2'},
'7996851':{'en': 'Tele2', 'ru': 'Tele2'},
'7996850':{'en': 'Tele2', 'ru': 'Tele2'},
'7900552':{'en': 'Tele2', 'ru': 'Tele2'},
'559599904':{'en': 'Oi'},
'559599905':{'en': 'Oi'},
'559599902':{'en': 'Oi'},
'559599903':{'en': 'Oi'},
'559599901':{'en': 'Oi'},
'556998429':{'en': 'Brasil Telecom GSM'},
'556998428':{'en': 'Brasil Telecom GSM'},
'658829':{'en': 'StarHub'},
'658828':{'en': 'M1'},
'556299908':{'en': 'Vivo'},
'556299909':{'en': 'Vivo'},
'556998421':{'en': 'Brasil Telecom GSM'},
'556299905':{'en': 'Vivo'},
'556998423':{'en': 'Brasil Telecom GSM'},
'556998422':{'en': 'Brasil Telecom GSM'},
'556998425':{'en': 'Brasil Telecom GSM'},
'556998424':{'en': 'Brasil Telecom GSM'},
'556998427':{'en': 'Brasil Telecom GSM'},
'556998426':{'en': 'Brasil Telecom GSM'},
'79539':{'en': 'Tele2', 'ru': 'Tele2'},
'79538':{'en': 'Tele2', 'ru': 'Tele2'},
'55719968':{'en': 'Vivo'},
'55719966':{'en': 'Vivo'},
'55719967':{'en': 'Vivo'},
'55719964':{'en': 'Vivo'},
'55719965':{'en': 'Vivo'},
'55719962':{'en': 'Vivo'},
'55719963':{'en': 'Vivo'},
'55719960':{'en': 'Vivo'},
'55719961':{'en': 'Vivo'},
'55999841':{'en': 'Claro BR'},
'55999840':{'en': 'Claro BR'},
'799595':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556299678':{'en': 'Vivo'},
'556299679':{'en': 'Vivo'},
'658359':{'en': 'SingTel'},
'658358':{'en': 'SingTel'},
'556299672':{'en': 'Vivo'},
'556299673':{'en': 'Vivo'},
'658357':{'en': 'SingTel'},
'556299671':{'en': 'Vivo'},
'556299676':{'en': 'Vivo'},
'556299677':{'en': 'Vivo'},
'556299674':{'en': 'Vivo'},
'556299675':{'en': 'Vivo'},
'5586994':{'en': 'Claro BR'},
'59176':{'en': 'Tigo'},
'7900487':{'en': 'Tele2', 'ru': 'Tele2'},
'7900486':{'en': 'Tele2', 'ru': 'Tele2'},
'7900485':{'en': 'Tele2', 'ru': 'Tele2'},
'7900484':{'en': 'Tele2', 'ru': 'Tele2'},
'7900483':{'en': 'Tele2', 'ru': 'Tele2'},
'59175':{'en': 'Tigo'},
'7900481':{'en': 'Tele2', 'ru': 'Tele2'},
'7900480':{'en': 'Tele2', 'ru': 'Tele2'},
'658687':{'en': 'M1'},
'658686':{'en': 'M1'},
'658685':{'en': 'M1'},
'59174':{'en': 'Entel'},
'658683':{'en': 'M1'},
'658682':{'en': 'StarHub'},
'658681':{'en': 'StarHub'},
'658680':{'en': 'StarHub'},
'7996206':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996207':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996205':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'658689':{'en': 'StarHub'},
'59172':{'en': 'Entel'},
'6011203':{'en': 'Talk Focus'},
'790047':{'en': 'Tele2', 'ru': 'Tele2'},
'790044':{'en': 'Tele2', 'ru': 'Tele2'},
'790045':{'en': 'Tele2', 'ru': 'Tele2'},
'790042':{'en': 'Tele2', 'ru': 'Tele2'},
'790043':{'en': 'Tele2', 'ru': 'Tele2'},
'790041':{'en': 'Tele2', 'ru': 'Tele2'},
'79010136':{'en': 'Tele2', 'ru': 'Tele2'},
'59170':{'en': 'Nuevatel'},
'790049':{'en': 'Tele2', 'ru': 'Tele2'},
'659882':{'en': 'StarHub'},
'659883':{'en': 'StarHub'},
'659880':{'en': 'StarHub'},
'659881':{'en': 'StarHub'},
'659886':{'en': 'StarHub'},
'659887':{'en': 'StarHub'},
'659884':{'en': 'StarHub'},
'659885':{'en': 'StarHub'},
'659888':{'en': 'SingTel'},
'659889':{'en': 'M1'},
'569880':{'en': 'Claro'},
'569881':{'en': 'Entel'},
'569882':{'en': 'Entel'},
'569883':{'en': 'Entel'},
'569884':{'en': 'Movistar'},
'569885':{'en': 'Movistar'},
'569886':{'en': 'Movistar'},
'569887':{'en': 'Movistar'},
'569888':{'en': 'Entel'},
'569889':{'en': 'Entel'},
'6011573':{'en': 'YTL'},
'6011572':{'en': 'YTL'},
'6011571':{'en': 'YTL'},
'6011570':{'en': 'YTL'},
'6011577':{'en': 'XOX'},
'6011576':{'en': 'XOX'},
'6011575':{'en': 'XOX'},
'6011574':{'en': 'YTL'},
'6011579':{'en': 'XOX'},
'6011578':{'en': 'XOX'},
'556798412':{'en': 'Brasil Telecom GSM'},
'556798413':{'en': 'Brasil Telecom GSM'},
'556798142':{'en': 'TIM'},
'556798143':{'en': 'TIM'},
'556798144':{'en': 'TIM'},
'556798145':{'en': 'TIM'},
'556798414':{'en': 'Brasil Telecom GSM'},
'556798147':{'en': 'TIM'},
'556798148':{'en': 'TIM'},
'556798149':{'en': 'TIM'},
'556798418':{'en': 'Brasil Telecom GSM'},
'556798419':{'en': 'Brasil Telecom GSM'},
'62426400':{'en': 'Esia'},
'62426401':{'en': 'Esia'},
'62426402':{'en': 'Esia'},
'62426403':{'en': 'Esia'},
'62426404':{'en': 'Esia'},
'556499623':{'en': 'Vivo'},
'556499627':{'en': 'Vivo'},
'556499626':{'en': 'Vivo'},
'556499625':{'en': 'Vivo'},
'556499624':{'en': 'Vivo'},
'555399957':{'en': 'Vivo'},
'555399956':{'en': 'Vivo'},
'555399955':{'en': 'Vivo'},
'555399954':{'en': 'Vivo'},
'555399953':{'en': 'Vivo'},
'555399952':{'en': 'Vivo'},
'555399951':{'en': 'Vivo'},
'555399959':{'en': 'Vivo'},
'555399958':{'en': 'Vivo'},
'62284990':{'en': 'Esia'},
'62284991':{'en': 'Esia'},
'62284992':{'en': 'Esia'},
'62284993':{'en': 'Esia'},
'55949921':{'en': 'Vivo'},
'55949920':{'en': 'Vivo'},
'62284996':{'en': 'Esia'},
'55949922':{'en': 'Vivo'},
'558299608':{'en': 'TIM'},
'559299951':{'en': 'Oi'},
'558299601':{'en': 'TIM'},
'558299600':{'en': 'TIM'},
'558299603':{'en': 'TIM'},
'558299602':{'en': 'TIM'},
'558299605':{'en': 'TIM'},
'558299604':{'en': 'TIM'},
'558299607':{'en': 'TIM'},
'558299606':{'en': 'TIM'},
'86147':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'556898112':{'en': 'TIM'},
'556898113':{'en': 'TIM'},
'556898111':{'en': 'TIM'},
'556898117':{'en': 'TIM'},
'556898114':{'en': 'TIM'},
'556898115':{'en': 'TIM'},
'61481':{'en': 'Optus'},
'556898118':{'en': 'TIM'},
'556898119':{'en': 'TIM'},
'61484':{'en': 'Telstra'},
'61485':{'en': 'TravelSIM'},
'61487':{'en': 'Telstra'},
'7777':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7776':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7775':{'en': 'Kcell/Activ', 'ru': 'Kcell/Activ'},
'7771':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7778':{'en': 'Kcell/Activ', 'ru': 'Kcell/Activ'},
'86145':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'85577':{'en': 'Cellcard'},
'6732':{'en': 'DSTCom'},
'5594991':{'en': 'Vivo'},
'62229616':{'en': 'Esia'},
'555599982':{'en': 'Vivo'},
'555599983':{'en': 'Vivo'},
'79525':{'en': 'Tele2', 'ru': 'Tele2'},
'555599981':{'en': 'Vivo'},
'555599986':{'en': 'Vivo'},
'555599987':{'en': 'Vivo'},
'555599984':{'en': 'Vivo'},
'555599985':{'en': 'Vivo'},
'555599988':{'en': 'Vivo'},
'555599989':{'en': 'Vivo'},
'62229614':{'en': 'Esia'},
'599968':{'en': 'Digicel'},
'852602':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'79522':{'en': 'Tele2', 'ru': 'Tele2'},
'62229615':{'en': 'Esia'},
'6264592':{'en': 'Esia'},
'6276197':{'en': 'Esia'},
'599969':{'en': 'Digicel'},
'79523':{'en': 'Tele2', 'ru': 'Tele2'},
'555499661':{'en': 'Vivo'},
'555499662':{'en': 'Vivo'},
'555499663':{'en': 'Vivo'},
'555499664':{'en': 'Vivo'},
'555499665':{'en': 'Vivo'},
'555499666':{'en': 'Vivo'},
'555499667':{'en': 'Vivo'},
'555499668':{'en': 'Vivo'},
'555499669':{'en': 'Vivo'},
'7901671':{'en': 'Tele2', 'ru': 'Tele2'},
'7901670':{'en': 'Tele2', 'ru': 'Tele2'},
'62229612':{'en': 'Esia'},
'7901674':{'en': 'Tele2', 'ru': 'Tele2'},
'556298198':{'en': 'TIM'},
'556298199':{'en': 'TIM'},
'85570':{'en': 'Smart'},
'559399101':{'en': 'Vivo'},
'556298192':{'en': 'TIM'},
'556298193':{'en': 'TIM'},
'559399104':{'en': 'Vivo'},
'559399105':{'en': 'Vivo'},
'559399106':{'en': 'Vivo'},
'556298197':{'en': 'TIM'},
'59069069':{'en': 'Digicel'},
'79521':{'en': 'Tele2', 'ru': 'Tele2'},
'59069066':{'en': 'Dauphin Telecom'},
'790239':{'en': 'Tele2', 'ru': 'Tele2'},
'790238':{'en': 'Tele2', 'ru': 'Tele2'},
'790234':{'en': 'MTS', 'ru': 'MTS'},
'790237':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'557999116':{'en': 'TIM'},
'790233':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790232':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'557199993':{'en': 'Vivo'},
'557199992':{'en': 'Vivo'},
'557199991':{'en': 'Vivo'},
'557199997':{'en': 'Vivo'},
'557199996':{'en': 'Vivo'},
'557199995':{'en': 'Vivo'},
'557199994':{'en': 'Vivo'},
'557199999':{'en': 'Vivo'},
'557199998':{'en': 'Vivo'},
'8536261':{'en': 'SmarTone'},
'8536260':{'en': 'SmarTone'},
'8536263':{'en': 'SmarTone'},
'8536262':{'en': 'SmarTone'},
'8536265':{'en': 'CTM'},
'8536264':{'en': 'CTM'},
'8536267':{'en': 'CTM'},
'8536266':{'en': 'CTM'},
'8536269':{'en': 'SmarTone'},
'8536268':{'en': 'SmarTone'},
'557199199':{'en': 'TIM'},
'557199198':{'en': 'TIM'},
'557199193':{'en': 'TIM'},
'559998122':{'en': 'TIM'},
'557199191':{'en': 'TIM'},
'557199197':{'en': 'TIM'},
'559998126':{'en': 'TIM'},
'559998125':{'en': 'TIM'},
'557199194':{'en': 'TIM'},
'790051':{'en': 'Tele2', 'ru': 'Tele2'},
'678572':{'en': 'Digicel'},
'6227435':{'en': 'Esia'},
'55699998':{'en': 'Vivo'},
'55699996':{'en': 'Vivo'},
'55699997':{'en': 'Vivo'},
'790050':{'en': 'Tele2', 'ru': 'Tele2'},
'6276598':{'en': 'Esia'},
'601161':{'en': 'U Mobile'},
'6225495':{'en': 'Esia'},
'6225494':{'en': 'Esia'},
'6225491':{'en': 'Esia'},
'6225490':{'en': 'Esia'},
'6225493':{'en': 'Esia'},
'6225492':{'en': 'Esia'},
'559699158':{'en': 'Vivo'},
'559699159':{'en': 'Vivo'},
'591715':{'en': 'Entel'},
'591714':{'en': 'Entel'},
'591712':{'en': 'Entel'},
'591711':{'en': 'Entel'},
'591710':{'en': 'Entel'},
'559699151':{'en': 'Vivo'},
'559699152':{'en': 'Vivo'},
'559699153':{'en': 'Vivo'},
'559699154':{'en': 'Vivo'},
'559699155':{'en': 'Vivo'},
'559699156':{'en': 'Vivo'},
'559699157':{'en': 'Vivo'},
'555398141':{'en': 'TIM'},
'6275199':{'en': 'Esia'},
'7958549':{'en': 'Tele2', 'ru': 'Tele2'},
'598922':{'en': 'Antel'},
'79081':{'en': 'Tele2', 'ru': 'Tele2'},
'79082':{'en': 'Tele2', 'ru': 'Tele2'},
'79085':{'en': 'Tele2', 'ru': 'Tele2'},
'79087':{'en': 'Tele2', 'ru': 'Tele2'},
'559999651':{'en': 'Oi'},
'8525149':{'en': 'Truphone', 'zh': 'Truphone', 'zh_Hant': 'Truphone'},
'8536388':{'en': 'China Telecom'},
'8536389':{'en': 'China Telecom'},
'601125':{'en': 'Maxis'},
'558299381':{'en': 'Claro BR'},
'852638':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'6275195':{'en': 'Esia'},
'852639':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'601121':{'en': 'U Mobile'},
'558599907':{'en': 'TIM'},
'558599906':{'en': 'TIM'},
'558599905':{'en': 'TIM'},
'558599904':{'en': 'TIM'},
'558599903':{'en': 'TIM'},
'558599902':{'en': 'TIM'},
'558599901':{'en': 'TIM'},
'852637':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'601123':{'en': 'Maxis'},
'558599909':{'en': 'TIM'},
'558599908':{'en': 'TIM'},
'852633':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'792':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7952726':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7902243':{'en': 'MTS', 'ru': 'MTS'},
'7902242':{'en': 'MTS', 'ru': 'MTS'},
'7902241':{'en': 'MTS', 'ru': 'MTS'},
'559899933':{'en': 'Oi'},
'559899934':{'en': 'Oi'},
'7902246':{'en': 'Tele2', 'ru': 'Tele2'},
'7902245':{'en': 'Tele2', 'ru': 'Tele2'},
'7902244':{'en': 'Tele2', 'ru': 'Tele2'},
'7902249':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902248':{'en': 'Tele2', 'ru': 'Tele2'},
'790848':{'en': 'Tele2', 'ru': 'Tele2'},
'790849':{'en': 'Tele2', 'ru': 'Tele2'},
'790846':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790847':{'en': 'Tele2', 'ru': 'Tele2'},
'790844':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790845':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790842':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790840':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790841':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'5699688':{'en': 'Claro'},
'5699689':{'en': 'Claro'},
'5699684':{'en': 'Claro'},
'5699685':{'en': 'Claro'},
'5699686':{'en': 'Claro'},
'5699687':{'en': 'Claro'},
'5699680':{'en': 'Movistar'},
'5699681':{'en': 'Movistar'},
'5699682':{'en': 'Claro'},
'5699683':{'en': 'Claro'},
'852658':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852659':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'59891':{'en': 'Antel'},
'852654':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852655':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852656':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852657':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852650':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852651':{'en': 'China-Hongkong Telecom', 'zh': u('\u4e2d\u6e2f\u901a'), 'zh_Hant': u('\u4e2d\u6e2f\u901a')},
'852652':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852653':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'62911996':{'en': 'Esia'},
'59898':{'en': 'Antel'},
'554599923':{'en': 'TIM'},
'797724':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'554899621':{'en': 'TIM'},
'554798442':{'en': 'Brasil Telecom GSM'},
'797722':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'554899151':{'en': 'Vivo'},
'797723':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'554899157':{'en': 'Vivo'},
'797721':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'554899156':{'en': 'Vivo'},
'554899155':{'en': 'Vivo'},
'554899154':{'en': 'Vivo'},
'5581994':{'en': 'Claro BR'},
'556598139':{'en': 'TIM'},
'556598138':{'en': 'TIM'},
'65978':{'en': 'SingTel'},
'555498415':{'en': 'Brasil Telecom GSM'},
'556598133':{'en': 'TIM'},
'556598132':{'en': 'TIM'},
'556598131':{'en': 'TIM'},
'65977':{'en': 'SingTel'},
'556598137':{'en': 'TIM'},
'556598136':{'en': 'TIM'},
'556598135':{'en': 'TIM'},
'556598134':{'en': 'TIM'},
'554899158':{'en': 'Vivo'},
'558799615':{'en': 'TIM'},
'558799614':{'en': 'TIM'},
'558799617':{'en': 'TIM'},
'558799616':{'en': 'TIM'},
'558799611':{'en': 'TIM'},
'558799613':{'en': 'TIM'},
'558799612':{'en': 'TIM'},
'558799619':{'en': 'TIM'},
'558799618':{'en': 'TIM'},
'5585991':{'en': 'Claro BR'},
'556998409':{'en': 'Brasil Telecom GSM'},
'556998408':{'en': 'Brasil Telecom GSM'},
'556998407':{'en': 'Brasil Telecom GSM'},
'556998406':{'en': 'Brasil Telecom GSM'},
'556998405':{'en': 'Brasil Telecom GSM'},
'556998404':{'en': 'Brasil Telecom GSM'},
'556998403':{'en': 'Brasil Telecom GSM'},
'556998402':{'en': 'Brasil Telecom GSM'},
'556998401':{'en': 'Brasil Telecom GSM'},
'7909':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7903':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7905':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7906':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'852988':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'554999129':{'en': 'Vivo'},
'554999128':{'en': 'Vivo'},
'554999121':{'en': 'Vivo'},
'554999123':{'en': 'Vivo'},
'554999122':{'en': 'Vivo'},
'554999125':{'en': 'Vivo'},
'554999124':{'en': 'Vivo'},
'554999127':{'en': 'Vivo'},
'554999126':{'en': 'Vivo'},
'658377':{'en': 'StarHub'},
'658376':{'en': 'SingTel'},
'658375':{'en': 'SingTel'},
'658374':{'en': 'SingTel'},
'658373':{'en': 'StarHub'},
'658372':{'en': 'SingTel'},
'658371':{'en': 'SingTel'},
'658370':{'en': 'StarHub'},
'555498412':{'en': 'Brasil Telecom GSM'},
'7995600':{'en': 'Tele2', 'ru': 'Tele2'},
'658379':{'en': 'SingTel'},
'658378':{'en': 'StarHub'},
'7902409':{'en': 'Tele2', 'ru': 'Tele2'},
'7902408':{'en': 'Tele2', 'ru': 'Tele2'},
'559199979':{'en': 'Oi'},
'559199978':{'en': 'Oi'},
'852981':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'6018822':{'en': 'YTL'},
'6018823':{'en': 'YTL'},
'559199971':{'en': 'Oi'},
'6018821':{'en': 'YTL'},
'559199977':{'en': 'Oi'},
'7902404':{'en': 'Tele2', 'ru': 'Tele2'},
'559199975':{'en': 'Oi'},
'7902406':{'en': 'Tele2', 'ru': 'Tele2'},
'790060':{'en': 'Tele2', 'ru': 'Tele2'},
'790062':{'en': 'Tele2', 'ru': 'Tele2'},
'790063':{'en': 'Tele2', 'ru': 'Tele2'},
'790064':{'en': 'Tele2', 'ru': 'Tele2'},
'790065':{'en': 'Tele2', 'ru': 'Tele2'},
'790066':{'en': 'Tele2', 'ru': 'Tele2'},
'790067':{'en': 'Tele2', 'ru': 'Tele2'},
'790068':{'en': 'Tele2', 'ru': 'Tele2'},
'674559':{'en': 'Digicel'},
'799555':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'5939794':{'en': 'Claro'},
'7996811':{'en': 'Tele2', 'ru': 'Tele2'},
'7996810':{'en': 'Tele2', 'ru': 'Tele2'},
'674554':{'en': 'Digicel'},
'556798438':{'en': 'Brasil Telecom GSM'},
'556798439':{'en': 'Brasil Telecom GSM'},
'674556':{'en': 'Digicel'},
'556798431':{'en': 'Brasil Telecom GSM'},
'556798432':{'en': 'Brasil Telecom GSM'},
'556798433':{'en': 'Brasil Telecom GSM'},
'556798434':{'en': 'Brasil Telecom GSM'},
'556798435':{'en': 'Brasil Telecom GSM'},
'556798436':{'en': 'Brasil Telecom GSM'},
'556798437':{'en': 'Brasil Telecom GSM'},
'556798126':{'en': 'TIM'},
'556798127':{'en': 'TIM'},
'556798124':{'en': 'TIM'},
'556798125':{'en': 'TIM'},
'556798122':{'en': 'TIM'},
'556798123':{'en': 'TIM'},
'556798121':{'en': 'TIM'},
'556598414':{'en': 'Brasil Telecom GSM'},
'556798128':{'en': 'TIM'},
'556798129':{'en': 'TIM'},
'6234197':{'en': 'Esia'},
'9054285':{'en': 'KKTC Telsim'},
'9054287':{'en': 'KKTC Telsim'},
'9054286':{'en': 'KKTC Telsim'},
'9054288':{'en': 'KKTC Telsim'},
'555399939':{'en': 'TIM'},
'555399938':{'en': 'Vivo'},
'555399935':{'en': 'Vivo'},
'555399934':{'en': 'Vivo'},
'555399937':{'en': 'Vivo'},
'555399936':{'en': 'Vivo'},
'555399931':{'en': 'Vivo'},
'558399600':{'en': 'TIM'},
'555399933':{'en': 'Vivo'},
'555399932':{'en': 'Vivo'},
'558399601':{'en': 'TIM'},
'9053385':{'en': 'Kuzey Kibris Turkcell'},
'9053384':{'en': 'Kuzey Kibris Turkcell'},
'9053386':{'en': 'Kuzey Kibris Turkcell'},
'556598417':{'en': 'Brasil Telecom GSM'},
'7970881':{'en': 'Tele2', 'ru': 'Tele2'},
'5699147':{'en': 'Movistar'},
'5699146':{'en': 'Movistar'},
'559898148':{'en': 'TIM'},
'559898149':{'en': 'TIM'},
'5699142':{'en': 'Entel'},
'558299629':{'en': 'TIM'},
'558299628':{'en': 'TIM'},
'559898142':{'en': 'TIM'},
'559898143':{'en': 'TIM'},
'558898130':{'en': 'Vivo'},
'559898141':{'en': 'TIM'},
'558299623':{'en': 'TIM'},
'559898147':{'en': 'TIM'},
'559898144':{'en': 'TIM'},
'559898145':{'en': 'TIM'},
'558999929':{'en': 'TIM'},
'558999928':{'en': 'TIM'},
'558999925':{'en': 'TIM'},
'558999924':{'en': 'TIM'},
'558999927':{'en': 'TIM'},
'558999926':{'en': 'TIM'},
'558999921':{'en': 'TIM'},
'558999922':{'en': 'TIM'},
'6265198':{'en': 'Esia'},
'6265199':{'en': 'Esia'},
'61466':{'en': 'Optus'},
'59469409':{'en': 'Digicel'},
'59469408':{'en': 'Digicel'},
'67078':{'en': 'Timor Telecom'},
'558899926':{'en': 'TIM'},
'55499998':{'en': 'TIM'},
'555499606':{'en': 'Vivo'},
'555499607':{'en': 'Vivo'},
'555499604':{'en': 'Vivo'},
'555499605':{'en': 'Vivo'},
'555499602':{'en': 'Vivo'},
'555499603':{'en': 'Vivo'},
'555499601':{'en': 'Vivo'},
'555499608':{'en': 'Vivo'},
'555499609':{'en': 'Vivo'},
'7900336':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'556698119':{'en': 'TIM'},
'559499664':{'en': 'Oi'},
'559399168':{'en': 'Vivo'},
'557599998':{'en': 'Vivo'},
'557599997':{'en': 'Vivo'},
'559399167':{'en': 'Vivo'},
'559399164':{'en': 'Vivo'},
'559399165':{'en': 'Vivo'},
'557599993':{'en': 'Vivo'},
'559399163':{'en': 'Vivo'},
'559399161':{'en': 'Vivo'},
'556699684':{'en': 'Vivo'},
'59069087':{'en': 'UTS'},
'558899621':{'en': 'TIM'},
'59069089':{'en': 'SFR/Rife'},
'59069088':{'en': 'Dauphin Telecom'},
'8536568':{'en': 'China Telecom'},
'559499661':{'en': 'Oi'},
'8536569':{'en': 'China Telecom'},
'558899623':{'en': 'TIM'},
'559499663':{'en': 'Oi'},
'558899925':{'en': 'TIM'},
'555198208':{'en': 'TIM'},
'555198209':{'en': 'TIM'},
'658869':{'en': 'SingTel'},
'555598118':{'en': 'TIM'},
'555598119':{'en': 'TIM'},
'555198202':{'en': 'TIM'},
'555198203':{'en': 'TIM'},
'555598114':{'en': 'TIM'},
'555598115':{'en': 'TIM'},
'555198206':{'en': 'TIM'},
'555198207':{'en': 'TIM'},
'555198204':{'en': 'TIM'},
'555198205':{'en': 'TIM'},
'62451613':{'en': 'Esia'},
'62451612':{'en': 'Esia'},
'62451611':{'en': 'Esia'},
'62451610':{'en': 'Esia'},
'7901123':{'en': 'Tele2', 'ru': 'Tele2'},
'7901122':{'en': 'Tele2', 'ru': 'Tele2'},
'7901121':{'en': 'Tele2', 'ru': 'Tele2'},
'62451614':{'en': 'Esia'},
'8536203':{'en': 'CTM'},
'8536202':{'en': 'CTM'},
'8536201':{'en': 'CTM'},
'8536200':{'en': 'SmarTone'},
'8536207':{'en': 'CTM'},
'8536206':{'en': 'CTM'},
'8536205':{'en': 'CTM'},
'7901128':{'en': 'Tele2', 'ru': 'Tele2'},
'557199171':{'en': 'TIM'},
'557199173':{'en': 'TIM'},
'557199172':{'en': 'TIM'},
'557199175':{'en': 'TIM'},
'557199174':{'en': 'TIM'},
'557199177':{'en': 'TIM'},
'557199176':{'en': 'TIM'},
'557199179':{'en': 'TIM'},
'557199178':{'en': 'TIM'},
'558899923':{'en': 'TIM'},
'556199941':{'en': 'Vivo'},
'556199943':{'en': 'Vivo'},
'556199942':{'en': 'Vivo'},
'556199945':{'en': 'Vivo'},
'556199944':{'en': 'Vivo'},
'556199947':{'en': 'Vivo'},
'556199946':{'en': 'Vivo'},
'556199949':{'en': 'Vivo'},
'556199948':{'en': 'Vivo'},
'556198542':{'en': 'Brasil Telecom GSM'},
'556198543':{'en': 'Brasil Telecom GSM'},
'799300':{'en': 'Tele2', 'ru': 'Tele2'},
'556198541':{'en': 'Brasil Telecom GSM'},
'556198546':{'en': 'Brasil Telecom GSM'},
'556198547':{'en': 'Brasil Telecom GSM'},
'556198544':{'en': 'Brasil Telecom GSM'},
'556198545':{'en': 'Brasil Telecom GSM'},
'55849812':{'en': 'Vivo'},
'556198548':{'en': 'Brasil Telecom GSM'},
'556198549':{'en': 'Brasil Telecom GSM'},
'790219':{'en': 'Tele2', 'ru': 'Tele2'},
'626191':{'en': 'Esia'},
'558899921':{'en': 'TIM'},
'7995779':{'en': 'Tele2', 'ru': 'Tele2'},
'7995778':{'en': 'Tele2', 'ru': 'Tele2'},
'559699138':{'en': 'Vivo'},
'559699139':{'en': 'Vivo'},
'559699136':{'en': 'Vivo'},
'559699137':{'en': 'Vivo'},
'559699134':{'en': 'Vivo'},
'559699135':{'en': 'Vivo'},
'559699132':{'en': 'Vivo'},
'559699133':{'en': 'Vivo'},
'559699131':{'en': 'Vivo'},
'795360':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'658528':{'en': 'StarHub'},
'658522':{'en': 'SingTel'},
'658523':{'en': 'SingTel'},
'658520':{'en': 'StarHub'},
'658521':{'en': 'StarHub'},
'7902672':{'en': 'Tele2', 'ru': 'Tele2'},
'658524':{'en': 'SingTel'},
'7902671':{'en': 'Tele2', 'ru': 'Tele2'},
'555498403':{'en': 'Brasil Telecom GSM'},
'555498402':{'en': 'Brasil Telecom GSM'},
'555498401':{'en': 'Brasil Telecom GSM'},
'558299361':{'en': 'Claro BR'},
'555498407':{'en': 'Brasil Telecom GSM'},
'555498406':{'en': 'Brasil Telecom GSM'},
'555498405':{'en': 'Brasil Telecom GSM'},
'555498404':{'en': 'Brasil Telecom GSM'},
'555498409':{'en': 'Brasil Telecom GSM'},
'555498408':{'en': 'Brasil Telecom GSM'},
'558599969':{'en': 'TIM'},
'558599961':{'en': 'TIM'},
'558599963':{'en': 'TIM'},
'558599962':{'en': 'TIM'},
'62717404':{'en': 'Esia'},
'62717401':{'en': 'Esia'},
'62717400':{'en': 'Esia'},
'62717403':{'en': 'Esia'},
'62717402':{'en': 'Esia'},
'55779991':{'en': 'Vivo'},
'55779990':{'en': 'Vivo'},
'554899182':{'en': 'Vivo'},
'554899183':{'en': 'Vivo'},
'55779995':{'en': 'Vivo'},
'55779994':{'en': 'Vivo'},
'554899186':{'en': 'Vivo'},
'55779998':{'en': 'Vivo'},
'790868':{'en': 'Tele2', 'ru': 'Tele2'},
'790869':{'en': 'Tele2', 'ru': 'Tele2'},
'790861':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790862':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790863':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790864':{'en': 'Tele2', 'ru': 'Tele2'},
'790865':{'en': 'Tele2', 'ru': 'Tele2'},
'790866':{'en': 'Tele2', 'ru': 'Tele2'},
'790867':{'en': 'Tele2', 'ru': 'Tele2'},
'7958190':{'en': 'Tele2', 'ru': 'Tele2'},
'7958191':{'en': 'Tele2', 'ru': 'Tele2'},
'7958192':{'en': 'Tele2', 'ru': 'Tele2'},
'7958193':{'en': 'Tele2', 'ru': 'Tele2'},
'554698822':{'en': 'Claro BR'},
'554698823':{'en': 'Claro BR'},
'554698821':{'en': 'Claro BR'},
'554698826':{'en': 'Claro BR'},
'554698827':{'en': 'Claro BR'},
'554698824':{'en': 'Claro BR'},
'554698825':{'en': 'Claro BR'},
'57315':{'en': 'Movistar'},
'57314':{'en': 'Claro'},
'57317':{'en': 'Movistar'},
'7901461':{'en': 'Tele2', 'ru': 'Tele2'},
'7901464':{'en': 'Tele2', 'ru': 'Tele2'},
'65918':{'en': 'StarHub'},
'55839932':{'en': 'Claro BR'},
'65913':{'en': 'SingTel'},
'55839930':{'en': 'Claro BR'},
'55839931':{'en': 'Claro BR'},
'65916':{'en': 'StarHub'},
'65917':{'en': 'SingTel'},
'65914':{'en': 'StarHub'},
'65915':{'en': 'SingTel'},
'558799639':{'en': 'TIM'},
'558799638':{'en': 'TIM'},
'558799633':{'en': 'TIM'},
'558799632':{'en': 'TIM'},
'558799631':{'en': 'TIM'},
'558799637':{'en': 'TIM'},
'558799636':{'en': 'TIM'},
'558799635':{'en': 'TIM'},
'558799634':{'en': 'TIM'},
'57311':{'en': 'Claro'},
'556998465':{'en': 'Brasil Telecom GSM'},
'556998467':{'en': 'Brasil Telecom GSM'},
'556998466':{'en': 'Brasil Telecom GSM'},
'556998461':{'en': 'Brasil Telecom GSM'},
'556998463':{'en': 'Brasil Telecom GSM'},
'556998462':{'en': 'Brasil Telecom GSM'},
'57310':{'en': 'Claro'},
'8536694':{'en': '3'},
'8536695':{'en': '3'},
'8536696':{'en': 'CTM'},
'8536697':{'en': '3'},
'8536690':{'en': 'Kong Seng'},
'8536691':{'en': 'Kong Seng'},
'8536692':{'en': 'CTM'},
'8536693':{'en': 'CTM'},
'62218964':{'en': 'Esia'},
'62218965':{'en': 'Esia'},
'62218966':{'en': 'Esia'},
'5547991':{'en': 'Vivo'},
'62218960':{'en': 'Esia'},
'62218961':{'en': 'Esia'},
'62218962':{'en': 'Esia'},
'62218963':{'en': 'Esia'},
'57312':{'en': 'Claro'},
'7902463':{'en': 'Tele2', 'ru': 'Tele2'},
'7902462':{'en': 'Tele2', 'ru': 'Tele2'},
'7902461':{'en': 'Tele2', 'ru': 'Tele2'},
'7902467':{'en': 'Tele2', 'ru': 'Tele2'},
'7902466':{'en': 'Tele2', 'ru': 'Tele2'},
'7902465':{'en': 'Tele2', 'ru': 'Tele2'},
'7902464':{'en': 'Tele2', 'ru': 'Tele2'},
'7902468':{'en': 'Tele2', 'ru': 'Tele2'},
'85578':{'en': 'Cellcard'},
'559998152':{'en': 'TIM'},
'559998153':{'en': 'TIM'},
'559998151':{'en': 'TIM'},
'56972':{'en': 'Claro'},
'62899':{'en': '3'},
'658399':{'en': 'SingTel'},
'658653':{'en': 'SingTel'},
'658398':{'en': 'SingTel'},
'601868':{'en': 'YTL'},
'790003':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790004':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'658393':{'en': 'SingTel'},
'557499121':{'en': 'TIM'},
'554599973':{'en': 'TIM'},
'557499123':{'en': 'TIM'},
'557499122':{'en': 'TIM'},
'557499125':{'en': 'TIM'},
'557499124':{'en': 'TIM'},
'554599974':{'en': 'TIM'},
'554599975':{'en': 'TIM'},
'6011201':{'en': 'Talk Focus'},
'6011200':{'en': 'Talk Focus'},
'556798454':{'en': 'Brasil Telecom GSM'},
'554599979':{'en': 'TIM'},
'556798452':{'en': 'Brasil Telecom GSM'},
'556798453':{'en': 'Brasil Telecom GSM'},
'6011207':{'en': 'XOX'},
'556798451':{'en': 'Brasil Telecom GSM'},
'658396':{'en': 'StarHub'},
'7996242':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996243':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996240':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996241':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'555399913':{'en': 'TIM'},
'559498137':{'en': 'TIM'},
'555399911':{'en': 'TIM'},
'5699786':{'en': 'Entel'},
'5699781':{'en': 'Movistar'},
'5699780':{'en': 'Movistar'},
'5699783':{'en': 'Movistar'},
'5699782':{'en': 'Movistar'},
'5699789':{'en': 'Entel'},
'5699788':{'en': 'Entel'},
'8536640':{'en': 'SmarTone'},
'559498133':{'en': 'TIM'},
'556499907':{'en': 'Vivo'},
'8536645':{'en': '3'},
'8536644':{'en': '3'},
'7958037':{'en': 'Tele2', 'ru': 'Tele2'},
'559898161':{'en': 'TIM'},
'559898162':{'en': 'TIM'},
'559898163':{'en': 'TIM'},
'559898164':{'en': 'TIM'},
'559898165':{'en': 'TIM'},
'559898166':{'en': 'TIM'},
'559898167':{'en': 'TIM'},
'559898168':{'en': 'TIM'},
'559898169':{'en': 'TIM'},
'6236299':{'en': 'Esia'},
'7958038':{'en': 'Tele2', 'ru': 'Tele2'},
'569620':{'en': 'Entel'},
'569621':{'en': 'Entel'},
'569622':{'en': 'Entel'},
'569623':{'en': 'Entel'},
'569624':{'en': 'Entel'},
'569625':{'en': 'Claro'},
'569626':{'en': 'Claro'},
'569627':{'en': 'Claro'},
'569628':{'en': 'Movistar'},
'569629':{'en': 'Movistar'},
'559999173':{'en': 'Vivo'},
'6231931':{'en': 'Esia'},
'559999172':{'en': 'Vivo'},
'556498136':{'en': 'TIM'},
'559999176':{'en': 'Vivo'},
'556498132':{'en': 'TIM'},
'559999174':{'en': 'Vivo'},
'79381':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79385':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'852593':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852592':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852591':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852590':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852597':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852596':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852594':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852599':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852598':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'658649':{'en': 'SingTel'},
'556298118':{'en': 'TIM'},
'7904959':{'en': 'Tele2', 'ru': 'Tele2'},
'7904958':{'en': 'Tele2', 'ru': 'Tele2'},
'559399144':{'en': 'Vivo'},
'559399145':{'en': 'Vivo'},
'559399146':{'en': 'Vivo'},
'559399147':{'en': 'Vivo'},
'559399141':{'en': 'Vivo'},
'559399142':{'en': 'Vivo'},
'559399143':{'en': 'Vivo'},
'559399148':{'en': 'Vivo'},
'559399149':{'en': 'Vivo'},
'62536204':{'en': 'Esia'},
'62536200':{'en': 'Esia'},
'62536201':{'en': 'Esia'},
'62536202':{'en': 'Esia'},
'62536203':{'en': 'Esia'},
'555598134':{'en': 'TIM'},
'555598135':{'en': 'TIM'},
'555598136':{'en': 'TIM'},
'555598137':{'en': 'TIM'},
'555598131':{'en': 'TIM'},
'555198226':{'en': 'TIM'},
'555198227':{'en': 'TIM'},
'555598138':{'en': 'TIM'},
'555598139':{'en': 'TIM'},
'555499628':{'en': 'Vivo'},
'555499629':{'en': 'Vivo'},
'555499624':{'en': 'Vivo'},
'555499625':{'en': 'Vivo'},
'555499626':{'en': 'Vivo'},
'555499627':{'en': 'Vivo'},
'555499621':{'en': 'Vivo'},
'555499622':{'en': 'Vivo'},
'555499623':{'en': 'Vivo'},
'557199157':{'en': 'TIM'},
'557199156':{'en': 'TIM'},
'557199155':{'en': 'TIM'},
'557199154':{'en': 'TIM'},
'557199153':{'en': 'TIM'},
'557199152':{'en': 'TIM'},
'557199151':{'en': 'TIM'},
'62823':{'en': 'Telkomsel'},
'62822':{'en': 'Telkomsel'},
'62821':{'en': 'Telkomsel'},
'852937':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'557199159':{'en': 'TIM'},
'557199158':{'en': 'TIM'},
'852936':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'556198568':{'en': 'Brasil Telecom GSM'},
'556198569':{'en': 'Brasil Telecom GSM'},
'598921':{'en': 'Antel'},
'598920':{'en': 'Antel'},
'601128':{'en': 'U Mobile'},
'601129':{'en': 'Celecom'},
'556198561':{'en': 'Brasil Telecom GSM'},
'556198562':{'en': 'Brasil Telecom GSM'},
'556198563':{'en': 'Brasil Telecom GSM'},
'556198564':{'en': 'Brasil Telecom GSM'},
'556198565':{'en': 'Brasil Telecom GSM'},
'556198566':{'en': 'Brasil Telecom GSM'},
'556198567':{'en': 'Brasil Telecom GSM'},
'790273':{'en': 'Tele2', 'ru': 'Tele2'},
'790272':{'en': 'Tele2', 'ru': 'Tele2'},
'790276':{'en': 'Tele2', 'ru': 'Tele2'},
'790279':{'en': 'Tele2', 'ru': 'Tele2'},
'790278':{'en': 'Tele2', 'ru': 'Tele2'},
'556199619':{'en': 'Vivo'},
'556199618':{'en': 'Vivo'},
'59893':{'en': 'Movistar'},
'59894':{'en': 'Movistar'},
'59895':{'en': 'Movistar'},
'59896':{'en': 'Claro'},
'59897':{'en': 'Claro'},
'556199611':{'en': 'Vivo'},
'59899':{'en': 'Antel'},
'556199613':{'en': 'Vivo'},
'556199612':{'en': 'Vivo'},
'556199615':{'en': 'Vivo'},
'556199614':{'en': 'Vivo'},
'556199617':{'en': 'Vivo'},
'556199616':{'en': 'Vivo'},
'559699114':{'en': 'Vivo'},
'559699115':{'en': 'Vivo'},
'559699116':{'en': 'Vivo'},
'559699117':{'en': 'Vivo'},
'559699111':{'en': 'Vivo'},
'559699112':{'en': 'Vivo'},
'559699113':{'en': 'Vivo'},
'559699118':{'en': 'Vivo'},
'559699119':{'en': 'Vivo'},
'5699387':{'en': 'Claro'},
'5699386':{'en': 'Claro'},
'5699389':{'en': 'Movistar'},
'5699388':{'en': 'Claro'},
'556598431':{'en': 'Brasil Telecom GSM'},
'852561':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'554999932':{'en': 'TIM'},
'658505':{'en': 'StarHub'},
'554999931':{'en': 'TIM'},
'658500':{'en': 'M1'},
'658501':{'en': 'StarHub'},
'658503':{'en': 'StarHub'},
'554999939':{'en': 'TIM'},
'658508':{'en': 'StarHub'},
'658509':{'en': 'StarHub'},
'790497':{'en': 'Tele2', 'ru': 'Tele2'},
'790496':{'en': 'Tele2', 'ru': 'Tele2'},
'790491':{'en': 'Tele2', 'ru': 'Tele2'},
'790490':{'en': 'Tele2', 'ru': 'Tele2'},
'790493':{'en': 'Tele2', 'ru': 'Tele2'},
'790492':{'en': 'Tele2', 'ru': 'Tele2'},
'558299340':{'en': 'Claro BR'},
'558299341':{'en': 'Claro BR'},
'558299342':{'en': 'Claro BR'},
'558299343':{'en': 'Claro BR'},
'790499':{'en': 'Tele2', 'ru': 'Tele2'},
'790498':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'557598275':{'en': 'Claro BR'},
'557598274':{'en': 'Claro BR'},
'557598276':{'en': 'Claro BR'},
'557598271':{'en': 'Claro BR'},
'557598270':{'en': 'Claro BR'},
'557598273':{'en': 'Claro BR'},
'557598272':{'en': 'Claro BR'},
'558599943':{'en': 'TIM'},
'558599942':{'en': 'TIM'},
'558599941':{'en': 'TIM'},
'558599947':{'en': 'TIM'},
'558599946':{'en': 'TIM'},
'558599945':{'en': 'TIM'},
'558599944':{'en': 'TIM'},
'558599949':{'en': 'TIM'},
'558599948':{'en': 'TIM'},
'554899611':{'en': 'TIM'},
'55849813':{'en': 'Vivo'},
'55849810':{'en': 'Vivo'},
'55849811':{'en': 'Vivo'},
'58412':{'en': 'Digitel GSM'},
'58416':{'en': 'Movilnet'},
'58414':{'en': 'movistar'},
'67576':{'en': 'bmobile'},
'79046':{'en': 'Tele2', 'ru': 'Tele2'},
'79041':{'en': 'Tele2', 'ru': 'Tele2'},
'79040':{'en': 'Tele2', 'ru': 'Tele2'},
'79043':{'en': 'Tele2', 'ru': 'Tele2'},
'559899974':{'en': 'Oi'},
'559899975':{'en': 'Oi'},
'559899976':{'en': 'Oi'},
'559899970':{'en': 'Oi'},
'559899971':{'en': 'Oi'},
'559899972':{'en': 'Oi'},
'559899973':{'en': 'Oi'},
'790800':{'en': 'Tele2', 'ru': 'Tele2'},
'790801':{'en': 'Tele2', 'ru': 'Tele2'},
'790806':{'en': 'Tele2', 'ru': 'Tele2'},
'790807':{'en': 'Tele2', 'ru': 'Tele2'},
'790804':{'en': 'Tele2', 'ru': 'Tele2'},
'790805':{'en': 'Tele2', 'ru': 'Tele2'},
'790808':{'en': 'Tele2', 'ru': 'Tele2'},
'790809':{'en': 'Tele2', 'ru': 'Tele2'},
'55479998':{'en': 'TIM'},
'67575':{'en': 'bmobile'},
'861703':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'658823':{'en': 'M1'},
'558899968':{'en': 'TIM'},
'558899969':{'en': 'TIM'},
'558899962':{'en': 'TIM'},
'558899963':{'en': 'TIM'},
'558899961':{'en': 'TIM'},
'558899966':{'en': 'TIM'},
'558899967':{'en': 'TIM'},
'558899964':{'en': 'TIM'},
'558899965':{'en': 'TIM'},
'7902829':{'en': 'Tele2', 'ru': 'Tele2'},
'7902828':{'en': 'Tele2', 'ru': 'Tele2'},
'7902820':{'en': 'Tele2', 'ru': 'Tele2'},
'7902827':{'en': 'Tele2', 'ru': 'Tele2'},
'7902826':{'en': 'Tele2', 'ru': 'Tele2'},
'7902825':{'en': 'Tele2', 'ru': 'Tele2'},
'7902824':{'en': 'Tele2', 'ru': 'Tele2'},
'795816':{'en': 'Tele2', 'ru': 'Tele2'},
'795817':{'en': 'Tele2', 'ru': 'Tele2'},
'795814':{'en': 'Tele2', 'ru': 'Tele2'},
'658821':{'en': 'M1'},
'6225132':{'en': 'Esia'},
'6225133':{'en': 'Esia'},
'6225131':{'en': 'Esia'},
'795818':{'en': 'Tele2', 'ru': 'Tele2'},
'65932':{'en': 'M1'},
'65934':{'en': 'M1'},
'65936':{'en': 'M1'},
'65938':{'en': 'StarHub'},
'65939':{'en': 'SingTel'},
'554698808':{'en': 'Claro BR'},
'554698809':{'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'},
'79527':{'en': 'Tele2', 'ru': 'Tele2'},
'79524':{'en': 'Tele2', 'ru': 'Tele2'},
'556998449':{'en': 'Brasil Telecom GSM'},
'556998448':{'en': 'Brasil Telecom GSM'},
'68890':{'en': 'Tuvalu Telecom'},
'556998443':{'en': 'Brasil Telecom GSM'},
'556998442':{'en': 'Brasil Telecom GSM'},
'556998441':{'en': 'Brasil Telecom GSM'},
'556998447':{'en': 'Brasil Telecom GSM'},
'556998446':{'en': 'Brasil Telecom GSM'},
'556998445':{'en': 'Brasil Telecom GSM'},
'556998444':{'en': 'Brasil Telecom GSM'},
'556699638':{'en': 'Vivo'},
'556699639':{'en': 'Vivo'},
'79520':{'en': 'Tele2', 'ru': 'Tele2'},
'556699632':{'en': 'Vivo'},
'556699633':{'en': 'Vivo'},
'556699631':{'en': 'Vivo'},
'556699636':{'en': 'Vivo'},
'556699637':{'en': 'Vivo'},
'556699634':{'en': 'Vivo'},
'556699635':{'en': 'Vivo'},
'554999165':{'en': 'Vivo'},
'5696770':{'en': 'Celupago'},
'554999167':{'en': 'Vivo'},
'554999166':{'en': 'Vivo'},
'554999161':{'en': 'Vivo'},
'554999163':{'en': 'Vivo'},
'554999162':{'en': 'Vivo'},
'5696779':{'en': 'Entel'},
'5696778':{'en': 'Entel'},
'554999169':{'en': 'Vivo'},
'554999168':{'en': 'Vivo'},
'658339':{'en': 'SingTel'},
'658338':{'en': 'SingTel'},
'658333':{'en': 'M1'},
'658332':{'en': 'StarHub'},
'658331':{'en': 'StarHub'},
'658330':{'en': 'StarHub'},
'658337':{'en': 'StarHub'},
'658336':{'en': 'StarHub'},
'658335':{'en': 'StarHub'},
'658334':{'en': 'StarHub'},
'85365470':{'en': 'CTM'},
'85365471':{'en': 'CTM'},
'85365472':{'en': 'CTM'},
'85365473':{'en': 'CTM'},
'85365474':{'en': 'CTM'},
'85365475':{'en': 'SmarTone'},
'85365476':{'en': 'SmarTone'},
'85365477':{'en': 'SmarTone'},
'85365478':{'en': 'SmarTone'},
'85365479':{'en': 'SmarTone'},
'6243899':{'en': 'Esia'},
'56958':{'en': 'Movistar'},
'56959':{'en': 'Claro'},
'56954':{'en': 'Claro'},
'56956':{'en': 'Entel'},
'56957':{'en': 'Entel'},
'56950':{'en': 'Claro'},
'56953':{'en': 'Movistar'},
'556499998':{'en': 'Vivo'},
'556499991':{'en': 'Vivo'},
'556499995':{'en': 'Vivo'},
'556499994':{'en': 'Vivo'},
'556499997':{'en': 'Vivo'},
'556499996':{'en': 'Vivo'},
'790020':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'799519':{'en': 'Tele2', 'ru': 'Tele2'},
'799518':{'en': 'Tele2', 'ru': 'Tele2'},
'5574989':{'en': 'Oi'},
'5574988':{'en': 'Oi'},
'5574987':{'en': 'Oi'},
'5574986':{'en': 'Oi'},
'5574985':{'en': 'Oi'},
'658197':{'en': 'M1'},
'658196':{'en': 'M1'},
'658195':{'en': 'M1'},
'658194':{'en': 'M1'},
'658193':{'en': 'M1'},
'658192':{'en': 'M1'},
'658191':{'en': 'M1'},
'658190':{'en': 'M1'},
'6227391':{'en': 'Esia'},
'658199':{'en': 'M1'},
'658198':{'en': 'StarHub'},
'5577988':{'en': 'Oi'},
'5577989':{'en': 'Oi'},
'5577986':{'en': 'Oi'},
'5577987':{'en': 'Oi'},
'5577985':{'en': 'Oi'},
'62232933':{'en': 'Esia'},
'62232932':{'en': 'Esia'},
'62232931':{'en': 'Esia'},
'62232930':{'en': 'Esia'},
'62232937':{'en': 'Esia'},
'62232936':{'en': 'Esia'},
'62232935':{'en': 'Esia'},
'62232934':{'en': 'Esia'},
'62232938':{'en': 'Esia'},
'554599951':{'en': 'TIM'},
'554599952':{'en': 'TIM'},
'554599953':{'en': 'TIM'},
'554599954':{'en': 'TIM'},
'7958011':{'en': 'Tele2', 'ru': 'Tele2'},
'7958010':{'en': 'Tele2', 'ru': 'Tele2'},
'7958013':{'en': 'Tele2', 'ru': 'Tele2'},
'7958012':{'en': 'Tele2', 'ru': 'Tele2'},
'569648':{'en': 'Movistar'},
'569649':{'en': 'Movistar'},
'569642':{'en': 'WOM'},
'569643':{'en': 'WOM'},
'569640':{'en': 'Movistar'},
'569641':{'en': 'WOM'},
'569646':{'en': 'Movistar'},
'569647':{'en': 'Movistar'},
'569644':{'en': 'WOM'},
'569645':{'en': 'WOM'},
'7995998':{'en': 'Tele2', 'ru': 'Tele2'},
'7995997':{'en': 'Tele2', 'ru': 'Tele2'},
'7995996':{'en': 'Tele2', 'ru': 'Tele2'},
'554899926':{'en': 'TIM'},
'5598989':{'en': 'Oi'},
'7991318':{'en': 'Tele2', 'ru': 'Tele2'},
'554899927':{'en': 'TIM'},
'55759993':{'en': 'Vivo'},
'55759992':{'en': 'Vivo'},
'55759991':{'en': 'Vivo'},
'55759990':{'en': 'Vivo'},
'55759995':{'en': 'Vivo'},
'55759994':{'en': 'Vivo'},
'59469447':{'en': 'SFR'},
'59469446':{'en': 'SFR'},
'7995901':{'en': 'Tele2', 'ru': 'Tele2'},
'7996305':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559799179':{'en': 'Vivo'},
'559799178':{'en': 'Vivo'},
'7996304':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'852579':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'559799171':{'en': 'Vivo'},
'7996303':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559799173':{'en': 'Vivo'},
'559799172':{'en': 'Vivo'},
'559799175':{'en': 'Vivo'},
'559799174':{'en': 'Vivo'},
'559799177':{'en': 'Vivo'},
'559799176':{'en': 'Vivo'},
'554999164':{'en': 'Vivo'},
'5696775':{'en': 'Entel'},
'62216064':{'en': 'Esia'},
'62216063':{'en': 'Esia'},
'62216062':{'en': 'Esia'},
'62216061':{'en': 'Esia'},
'62216060':{'en': 'Esia'},
'5696777':{'en': 'Entel'},
'5696776':{'en': 'Entel'},
'55819932':{'en': 'Claro BR'},
'658788':{'en': 'M1'},
'658789':{'en': 'StarHub'},
'614888':{'en': 'My Number'},
'795107':{'en': 'Tele2', 'ru': 'Tele2'},
'7986666':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'556199909':{'en': 'Vivo'},
'556199908':{'en': 'Vivo'},
'556199905':{'en': 'Vivo'},
'556199904':{'en': 'Vivo'},
'556199907':{'en': 'Vivo'},
'556199906':{'en': 'Vivo'},
'556199901':{'en': 'Vivo'},
'556199903':{'en': 'Vivo'},
'556199902':{'en': 'Vivo'},
'6227493':{'en': 'Esia'},
'6227492':{'en': 'Esia'},
'6227491':{'en': 'Esia'},
'6227497':{'en': 'Esia'},
'6227496':{'en': 'Esia'},
'555598132':{'en': 'TIM'},
'6227494':{'en': 'Esia'},
'558799174':{'en': 'Claro BR'},
'558799175':{'en': 'Claro BR'},
'558799170':{'en': 'Claro BR'},
'558799171':{'en': 'Claro BR'},
'558799172':{'en': 'Claro BR'},
'558799173':{'en': 'Claro BR'},
'556598451':{'en': 'Brasil Telecom GSM'},
'556198508':{'en': 'Brasil Telecom GSM'},
'556198509':{'en': 'Brasil Telecom GSM'},
'556198506':{'en': 'Brasil Telecom GSM'},
'556198507':{'en': 'Brasil Telecom GSM'},
'558998120':{'en': 'Vivo'},
'556198505':{'en': 'Brasil Telecom GSM'},
'556198502':{'en': 'Brasil Telecom GSM'},
'556198503':{'en': 'Brasil Telecom GSM'},
'556198501':{'en': 'Brasil Telecom GSM'},
'790259':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'555598133':{'en': 'TIM'},
'790253':{'en': 'Tele2', 'ru': 'Tele2'},
'790252':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790250':{'en': 'Tele2', 'ru': 'Tele2'},
'790256':{'en': 'Tele2', 'ru': 'Tele2'},
'790254':{'en': 'Tele2', 'ru': 'Tele2'},
'556199639':{'en': 'Vivo'},
'556199638':{'en': 'Vivo'},
'556199637':{'en': 'Vivo'},
'556199636':{'en': 'Vivo'},
'556199635':{'en': 'Vivo'},
'556199634':{'en': 'Vivo'},
'556199633':{'en': 'Vivo'},
'556199632':{'en': 'Vivo'},
'556199631':{'en': 'Vivo'},
'658294':{'en': 'StarHub'},
'658295':{'en': 'StarHub'},
'658296':{'en': 'StarHub'},
'658297':{'en': 'StarHub'},
'658290':{'en': 'StarHub'},
'658291':{'en': 'StarHub'},
'658292':{'en': 'StarHub'},
'658293':{'en': 'StarHub'},
'658298':{'en': 'StarHub'},
'658299':{'en': 'SingTel'},
'556998111':{'en': 'TIM'},
'7902589':{'en': 'Tele2', 'ru': 'Tele2'},
'556998113':{'en': 'TIM'},
'556998112':{'en': 'TIM'},
'556998115':{'en': 'TIM'},
'556998114':{'en': 'TIM'},
'556998117':{'en': 'TIM'},
'556998116':{'en': 'TIM'},
'556998119':{'en': 'TIM'},
'556998118':{'en': 'TIM'},
'7902582':{'en': 'Tele2', 'ru': 'Tele2'},
'7902583':{'en': 'Tele2', 'ru': 'Tele2'},
'7902584':{'en': 'Tele2', 'ru': 'Tele2'},
'7902585':{'en': 'Tele2', 'ru': 'Tele2'},
'7902586':{'en': 'Tele2', 'ru': 'Tele2'},
'7902587':{'en': 'Tele2', 'ru': 'Tele2'},
'558899463':{'en': 'Claro BR'},
'557199139':{'en': 'TIM'},
'557199138':{'en': 'TIM'},
'558899462':{'en': 'Claro BR'},
'557199135':{'en': 'TIM'},
'557199134':{'en': 'TIM'},
'557199137':{'en': 'TIM'},
'557199136':{'en': 'TIM'},
'557199131':{'en': 'TIM'},
'558899461':{'en': 'Claro BR'},
'557199133':{'en': 'TIM'},
'557199132':{'en': 'TIM'},
'554999918':{'en': 'TIM'},
'554999919':{'en': 'TIM'},
'558899460':{'en': 'Claro BR'},
'659195':{'en': 'M1'},
'554999911':{'en': 'TIM'},
'554999912':{'en': 'TIM'},
'554999913':{'en': 'TIM'},
'554999914':{'en': 'TIM'},
'559999631':{'en': 'Oi'},
'554999916':{'en': 'TIM'},
'554999917':{'en': 'TIM'},
'558899464':{'en': 'Claro BR'},
'555498119':{'en': 'TIM'},
'555498118':{'en': 'TIM'},
'555498115':{'en': 'TIM'},
'555498114':{'en': 'TIM'},
'555498117':{'en': 'TIM'},
'555498116':{'en': 'TIM'},
'555498111':{'en': 'TIM'},
'555498113':{'en': 'TIM'},
'555498112':{'en': 'TIM'},
'601133':{'en': 'DiGi'},
'7958552':{'en': 'Tele2', 'ru': 'Tele2'},
'601132':{'en': 'Altel'},
'852629':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'7958553':{'en': 'Tele2', 'ru': 'Tele2'},
'601131':{'en': 'DiGi'},
'559899198':{'en': 'Vivo'},
'559899199':{'en': 'Vivo'},
'559899192':{'en': 'Vivo'},
'559899193':{'en': 'Vivo'},
'559899191':{'en': 'Vivo'},
'559899196':{'en': 'Vivo'},
'559899197':{'en': 'Vivo'},
'559899194':{'en': 'Vivo'},
'559899195':{'en': 'Vivo'},
'601135':{'en': 'Tune Talk'},
'601134':{'en': 'Enabling Asia'},
'556599642':{'en': 'Vivo'},
'556599643':{'en': 'Vivo'},
'68575':{'en': 'Bluesky'},
'556599641':{'en': 'Vivo'},
'559598123':{'en': 'TIM'},
'556599647':{'en': 'Vivo'},
'559598121':{'en': 'TIM'},
'556599645':{'en': 'Vivo'},
'558399332':{'en': 'Claro BR'},
'558399333':{'en': 'Claro BR'},
'558399330':{'en': 'Claro BR'},
'558399331':{'en': 'Claro BR'},
'558399334':{'en': 'Claro BR'},
'852620':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'55919998':{'en': 'Oi'},
'55919996':{'en': 'Oi'},
'559899992':{'en': 'Oi'},
'559899993':{'en': 'Oi'},
'559899991':{'en': 'Oi'},
'559799611':{'en': 'Oi'},
'559899994':{'en': 'Oi'},
'559899995':{'en': 'Oi'},
'67987':{'en': 'Vodafone'},
'67986':{'en': 'Vodafone'},
'659192':{'en': 'M1'},
'557599129':{'en': 'TIM'},
'557599122':{'en': 'TIM'},
'557599123':{'en': 'TIM'},
'557599121':{'en': 'TIM'},
'557599126':{'en': 'TIM'},
'557599127':{'en': 'TIM'},
'557599124':{'en': 'TIM'},
'557599125':{'en': 'TIM'},
'79511':{'en': 'Tele2', 'ru': 'Tele2'},
'599319':{'en': 'WIC'},
'558899941':{'en': 'TIM'},
'558899942':{'en': 'TIM'},
'558899943':{'en': 'TIM'},
'558899944':{'en': 'TIM'},
'558899945':{'en': 'TIM'},
'558899946':{'en': 'TIM'},
'558899947':{'en': 'TIM'},
'554899144':{'en': 'Vivo'},
'554899145':{'en': 'Vivo'},
'554798456':{'en': 'Brasil Telecom GSM'},
'5587989':{'en': 'Oi'},
'5587988':{'en': 'Oi'},
'554899147':{'en': 'Vivo'},
'795839':{'en': 'Tele2', 'ru': 'Tele2'},
'5587985':{'en': 'Oi'},
'5587987':{'en': 'Oi'},
'554899141':{'en': 'Vivo'},
'554899142':{'en': 'Vivo'},
'5966969':{'en': 'Digicel'},
'5966967':{'en': 'Digicel'},
'5966964':{'en': 'Orange'},
'554899143':{'en': 'Vivo'},
'5966962':{'en': 'Orange'},
'5966963':{'en': 'Orange'},
'5966960':{'en': 'SFR/Rife'},
'556699611':{'en': 'Vivo'},
'556699612':{'en': 'Vivo'},
'556699613':{'en': 'Vivo'},
'556699614':{'en': 'Vivo'},
'556699615':{'en': 'Vivo'},
'556699616':{'en': 'Vivo'},
'556699617':{'en': 'Vivo'},
'556699618':{'en': 'Vivo'},
'55979840':{'en': 'Claro BR'},
'658392':{'en': 'StarHub'},
'555499989':{'en': 'Vivo'},
'555499988':{'en': 'Vivo'},
'554899632':{'en': 'TIM'},
'555499981':{'en': 'Vivo'},
'555499983':{'en': 'Vivo'},
'555499982':{'en': 'Vivo'},
'555499985':{'en': 'Vivo'},
'555499984':{'en': 'Vivo'},
'555499987':{'en': 'Vivo'},
'555499986':{'en': 'Vivo'},
'554899633':{'en': 'TIM'},
'554999149':{'en': 'Vivo'},
'554999148':{'en': 'Vivo'},
'554999143':{'en': 'Vivo'},
'554999142':{'en': 'Vivo'},
'554999141':{'en': 'Vivo'},
'554999147':{'en': 'Vivo'},
'554999146':{'en': 'Vivo'},
'554999145':{'en': 'Vivo'},
'554999144':{'en': 'Vivo'},
'556699903':{'en': 'Vivo'},
'658731':{'en': 'SingTel'},
'554899631':{'en': 'TIM'},
'559799979':{'en': 'Oi'},
'559799978':{'en': 'Oi'},
'79517':{'en': 'Tele2', 'ru': 'Tele2'},
'558299994':{'en': 'TIM'},
'7908437':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'5583985':{'en': 'Oi'},
'5583987':{'en': 'Oi'},
'5583986':{'en': 'Oi'},
'554899637':{'en': 'TIM'},
'5583989':{'en': 'Oi'},
'5583988':{'en': 'Oi'},
'67854':{'en': 'Digicel'},
'62838':{'en': 'AXIS'},
'601083':{'en': 'XOX'},
'601082':{'en': 'DiGi'},
'601081':{'en': 'Tune Talk'},
'601080':{'en': 'Tune Talk'},
'601087':{'en': 'XOX'},
'601086':{'en': 'XOX'},
'601085':{'en': 'XOX'},
'554899634':{'en': 'TIM'},
'7996755':{'en': 'Tele2', 'ru': 'Tele2'},
'601089':{'en': 'Maxis'},
'601088':{'en': 'DiGi'},
'7980999':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7996751':{'en': 'Tele2', 'ru': 'Tele2'},
'7996752':{'en': 'Tele2', 'ru': 'Tele2'},
'659002':{'en': 'StarHub'},
'659003':{'en': 'StarHub'},
'659001':{'en': 'StarHub'},
'659006':{'en': 'StarHub'},
'659007':{'en': 'StarHub'},
'659004':{'en': 'StarHub'},
'659005':{'en': 'StarHub'},
'659008':{'en': 'StarHub'},
'659009':{'en': 'StarHub'},
'554899635':{'en': 'TIM'},
'6261921':{'en': 'Esia'},
'6261920':{'en': 'Esia'},
'559998128':{'en': 'TIM'},
'62284910':{'en': 'Esia'},
'556799814':{'en': 'Vivo'},
'62284912':{'en': 'Esia'},
'62284913':{'en': 'Esia'},
'556799811':{'en': 'Vivo'},
'556799810':{'en': 'Vivo'},
'556799813':{'en': 'Vivo'},
'556799812':{'en': 'Vivo'},
'7901413':{'en': 'Tele2', 'ru': 'Tele2'},
'7901412':{'en': 'Tele2', 'ru': 'Tele2'},
'8524601':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'6011249':{'en': 'Celcom'},
'6011248':{'en': 'Celcom'},
'554599938':{'en': 'TIM'},
'554599939':{'en': 'TIM'},
'554599936':{'en': 'TIM'},
'554599937':{'en': 'TIM'},
'554599934':{'en': 'TIM'},
'554599935':{'en': 'TIM'},
'554599932':{'en': 'TIM'},
'554599933':{'en': 'TIM'},
'6011243':{'en': 'Maxis'},
'554599931':{'en': 'TIM'},
'593959':{'en': 'Claro'},
'6233192':{'en': 'Esia'},
'6233191':{'en': 'Esia'},
'7901632':{'en': 'Tele2', 'ru': 'Tele2'},
'62281988':{'en': 'Esia'},
'62281989':{'en': 'Esia'},
'658717':{'en': 'M1'},
'658716':{'en': 'M1'},
'658711':{'en': 'M1'},
'658710':{'en': 'SingTel'},
'658713':{'en': 'SingTel'},
'658712':{'en': 'SingTel'},
'658719':{'en': 'M1'},
'62281985':{'en': 'Esia'},
'62281986':{'en': 'Esia'},
'62281987':{'en': 'Esia'},
'55819824':{'en': 'Vivo'},
'55819825':{'en': 'Vivo'},
'55819822':{'en': 'Vivo'},
'55819823':{'en': 'Vivo'},
'55819820':{'en': 'Vivo'},
'55819821':{'en': 'Vivo'},
'7952744':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7952743':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7952742':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7952741':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7952740':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7902329':{'en': 'Tele2', 'ru': 'Tele2'},
'7902325':{'en': 'Tele2', 'ru': 'Tele2'},
'7902326':{'en': 'Tele2', 'ru': 'Tele2'},
'559898128':{'en': 'TIM'},
'5588985':{'en': 'Oi'},
'5588986':{'en': 'Oi'},
'5588987':{'en': 'Oi'},
'559898124':{'en': 'TIM'},
'559898125':{'en': 'TIM'},
'559898126':{'en': 'TIM'},
'559898127':{'en': 'TIM'},
'559898121':{'en': 'TIM'},
'559898122':{'en': 'TIM'},
'559898123':{'en': 'TIM'},
'852557':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852556':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852553':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852552':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852551':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'61452':{'en': 'Vodafone'},
'852559':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852558':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'559799159':{'en': 'Vivo'},
'559799158':{'en': 'Vivo'},
'559799157':{'en': 'Vivo'},
'559799156':{'en': 'Vivo'},
'559799155':{'en': 'Vivo'},
'559799154':{'en': 'Vivo'},
'559799153':{'en': 'Vivo'},
'559799152':{'en': 'Vivo'},
'559799151':{'en': 'Vivo'},
'559498411':{'en': 'Claro BR'},
'559498412':{'en': 'Claro BR'},
'559498413':{'en': 'Claro BR'},
'559498414':{'en': 'Claro BR'},
'55879910':{'en': 'Claro BR'},
'55879911':{'en': 'Claro BR'},
'55879912':{'en': 'Claro BR'},
'55879913':{'en': 'Claro BR'},
'55879914':{'en': 'Claro BR'},
'55879915':{'en': 'Claro BR'},
'55879916':{'en': 'Claro BR'},
'61458':{'en': 'Telstra'},
'8536333':{'en': 'CTM'},
'601865':{'en': 'YTL'},
'601864':{'en': 'YTL'},
'601867':{'en': 'YTL'},
'601866':{'en': 'U Mobile'},
'601861':{'en': 'YTL'},
'601860':{'en': 'YTL'},
'601863':{'en': 'YTL'},
'601862':{'en': 'YTL'},
'8536598':{'en': 'China Telecom'},
'601869':{'en': 'YTL'},
'558899634':{'en': 'TIM'},
'554798901':{'en': 'Claro BR'},
'79514':{'en': 'Tele2', 'ru': 'Tele2'},
'558599954':{'en': 'TIM'},
'558599955':{'en': 'TIM'},
'5939922':{'en': 'Claro'},
'5939923':{'en': 'Claro'},
'558799998':{'en': 'TIM'},
'558799999':{'en': 'TIM'},
'5939926':{'en': 'Movistar'},
'5939927':{'en': 'Movistar'},
'5939924':{'en': 'Claro'},
'5939925':{'en': 'Movistar'},
'558799992':{'en': 'TIM'},
'558799993':{'en': 'TIM'},
'5939928':{'en': 'Movistar'},
'558799991':{'en': 'TIM'},
'558799996':{'en': 'TIM'},
'558799997':{'en': 'TIM'},
'558799994':{'en': 'TIM'},
'558799995':{'en': 'TIM'},
'7901149':{'en': 'Tele2', 'ru': 'Tele2'},
'559998124':{'en': 'TIM'},
'556199923':{'en': 'Vivo'},
'556199922':{'en': 'Vivo'},
'556199921':{'en': 'Vivo'},
'556199927':{'en': 'Vivo'},
'556199926':{'en': 'Vivo'},
'556199925':{'en': 'Vivo'},
'556199924':{'en': 'Vivo'},
'558599958':{'en': 'TIM'},
'556199929':{'en': 'Vivo'},
'556199928':{'en': 'Vivo'},
'558599959':{'en': 'TIM'},
'8529293':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'66804':{'en': 'DTAC'},
'556198524':{'en': 'Brasil Telecom GSM'},
'556198525':{'en': 'Brasil Telecom GSM'},
'556198526':{'en': 'Brasil Telecom GSM'},
'556198527':{'en': 'Brasil Telecom GSM'},
'556198521':{'en': 'Brasil Telecom GSM'},
'556198522':{'en': 'Brasil Telecom GSM'},
'556198523':{'en': 'Brasil Telecom GSM'},
'8536332':{'en': 'CTM'},
'556198528':{'en': 'Brasil Telecom GSM'},
'556198529':{'en': 'Brasil Telecom GSM'},
'557999193':{'en': 'TIM'},
'557999192':{'en': 'TIM'},
'557999191':{'en': 'TIM'},
'557999199':{'en': 'TIM'},
'557999198':{'en': 'TIM'},
'556199655':{'en': 'Vivo'},
'556199654':{'en': 'Vivo'},
'556199657':{'en': 'Vivo'},
'556199656':{'en': 'Vivo'},
'556199651':{'en': 'Vivo'},
'556199653':{'en': 'Vivo'},
'556199652':{'en': 'Vivo'},
'556398416':{'en': 'Brasil Telecom GSM'},
'556398417':{'en': 'Brasil Telecom GSM'},
'556398414':{'en': 'Brasil Telecom GSM'},
'556398415':{'en': 'Brasil Telecom GSM'},
'556199659':{'en': 'Vivo'},
'556199658':{'en': 'Vivo'},
'556398411':{'en': 'Brasil Telecom GSM'},
'6228291':{'en': 'Esia'},
'595976':{'en': 'Personal'},
'595975':{'en': 'Personal'},
'595974':{'en': 'Personal'},
'595973':{'en': 'Personal'},
'595972':{'en': 'Personal'},
'595971':{'en': 'Personal'},
'557199113':{'en': 'TIM'},
'557199112':{'en': 'TIM'},
'557199111':{'en': 'TIM'},
'557199117':{'en': 'TIM'},
'557199116':{'en': 'TIM'},
'557199115':{'en': 'TIM'},
'557199114':{'en': 'TIM'},
'557199119':{'en': 'TIM'},
'557199118':{'en': 'TIM'},
'556599651':{'en': 'Vivo'},
'554999978':{'en': 'TIM'},
'554999979':{'en': 'TIM'},
'554999976':{'en': 'TIM'},
'554999977':{'en': 'TIM'},
'554999974':{'en': 'TIM'},
'554999975':{'en': 'TIM'},
'554999972':{'en': 'TIM'},
'554999973':{'en': 'TIM'},
'554999971':{'en': 'TIM'},
'556599652':{'en': 'Vivo'},
'556599655':{'en': 'Vivo'},
'556599654':{'en': 'Vivo'},
'555498133':{'en': 'TIM'},
'555498132':{'en': 'TIM'},
'555498131':{'en': 'TIM'},
'6142010':{'en': 'Pivotel Satellite'},
'555498137':{'en': 'TIM'},
'555498136':{'en': 'TIM'},
'555498135':{'en': 'TIM'},
'555498134':{'en': 'TIM'},
'555498139':{'en': 'TIM'},
'555498138':{'en': 'TIM'},
'6226297':{'en': 'Esia'},
'793865':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'853631':{'en': '3'},
'555598117':{'en': 'TIM'},
'556599668':{'en': 'Vivo'},
'556599669':{'en': 'Vivo'},
'7995905':{'en': 'Tele2', 'ru': 'Tele2'},
'556599661':{'en': 'Vivo'},
'556599662':{'en': 'Vivo'},
'556599663':{'en': 'Vivo'},
'556599664':{'en': 'Vivo'},
'556599665':{'en': 'Vivo'},
'556599666':{'en': 'Vivo'},
'556599667':{'en': 'Vivo'},
'79000':{'en': 'Tele2', 'ru': 'Tele2'},
'622292':{'en': 'Esia'},
'622295':{'en': 'Esia'},
'55489881':{'en': 'Claro BR'},
'55489880':{'en': 'Claro BR'},
'55489883':{'en': 'Claro BR'},
'55489882':{'en': 'Claro BR'},
'55489885':{'en': 'Claro BR'},
'55489884':{'en': 'Claro BR'},
'555598112':{'en': 'TIM'},
'62273920':{'en': 'Esia'},
'559198242':{'en': 'TIM'},
'559198243':{'en': 'TIM'},
'559198241':{'en': 'TIM'},
'559198246':{'en': 'TIM'},
'559198244':{'en': 'TIM'},
'559198245':{'en': 'TIM'},
'62283924':{'en': 'Esia'},
'62283920':{'en': 'Esia'},
'62283921':{'en': 'Esia'},
'6271193':{'en': 'Esia'},
'554798432':{'en': 'Brasil Telecom GSM'},
'554798433':{'en': 'Brasil Telecom GSM'},
'558899924':{'en': 'TIM'},
'554798431':{'en': 'Brasil Telecom GSM'},
'554798436':{'en': 'Brasil Telecom GSM'},
'554798437':{'en': 'Brasil Telecom GSM'},
'554798434':{'en': 'Brasil Telecom GSM'},
'554798435':{'en': 'Brasil Telecom GSM'},
'554798438':{'en': 'Brasil Telecom GSM'},
'554798439':{'en': 'Brasil Telecom GSM'},
'558899928':{'en': 'TIM'},
'558899929':{'en': 'TIM'},
'6271192':{'en': 'Esia'},
'559798411':{'en': 'Claro BR'},
'559798410':{'en': 'Claro BR'},
'795850':{'en': 'Tele2', 'ru': 'Tele2'},
'795856':{'en': 'Tele2', 'ru': 'Tele2'},
'559398114':{'en': 'TIM'},
'559398115':{'en': 'TIM'},
'559398116':{'en': 'TIM'},
'559398117':{'en': 'TIM'},
'55839998':{'en': 'TIM'},
'55839999':{'en': 'TIM'},
'559398112':{'en': 'TIM'},
'559398113':{'en': 'TIM'},
'55839995':{'en': 'TIM'},
'55839996':{'en': 'TIM'},
'55839997':{'en': 'TIM'},
'55839990':{'en': 'TIM'},
'55839991':{'en': 'TIM'},
'55839992':{'en': 'TIM'},
'55839993':{'en': 'TIM'},
'6222995':{'en': 'Esia'},
'6222994':{'en': 'Esia'},
'6222997':{'en': 'Esia'},
'6222996':{'en': 'Esia'},
'6222991':{'en': 'Esia'},
'6222990':{'en': 'Esia'},
'6222993':{'en': 'Esia'},
'6222992':{'en': 'Esia'},
'557799121':{'en': 'TIM'},
'557799125':{'en': 'TIM'},
'557799127':{'en': 'TIM'},
'557799128':{'en': 'TIM'},
'557799129':{'en': 'TIM'},
'556699676':{'en': 'Vivo'},
'556699677':{'en': 'Vivo'},
'556699674':{'en': 'Vivo'},
'556699675':{'en': 'Vivo'},
'556699672':{'en': 'Vivo'},
'556699673':{'en': 'Vivo'},
'556699671':{'en': 'Vivo'},
'556699678':{'en': 'Vivo'},
'556699679':{'en': 'Vivo'},
'6228599':{'en': 'Esia'},
'6228591':{'en': 'Esia'},
'861340':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861341':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861342':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861343':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861344':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861345':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861346':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861347':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861348':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'7983999':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'559799957':{'en': 'Oi'},
'559799953':{'en': 'Oi'},
'559799959':{'en': 'Oi'},
'559799958':{'en': 'Oi'},
'5917373':{'en': 'Entel'},
'5917372':{'en': 'Entel'},
'5917371':{'en': 'Entel'},
'5917370':{'en': 'Entel'},
'5917377':{'en': 'Entel'},
'5917375':{'en': 'Entel'},
'5917374':{'en': 'Entel'},
'658718':{'en': 'M1'},
'852662':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'5551991':{'en': 'Claro BR'},
'5551993':{'en': 'Claro BR'},
'5551992':{'en': 'Claro BR'},
'5551997':{'en': 'Vivo'},
'5551996':{'en': 'Vivo'},
'5551999':{'en': 'Vivo'},
'5551998':{'en': 'Vivo'},
'62967903':{'en': 'Esia'},
'62967902':{'en': 'Esia'},
'62967904':{'en': 'Esia'},
'5695554':{'en': 'Netline'},
'5695555':{'en': 'Redvoiss'},
'5695556':{'en': 'Redvoiss'},
'5695550':{'en': 'Netline'},
'5695551':{'en': 'Netline'},
'5695552':{'en': 'Netline'},
'5695553':{'en': 'Netline'},
'85510':{'en': 'Smart'},
'557799814':{'en': 'Vivo'},
'85512':{'en': 'Cellcard'},
'85514':{'en': 'Cellcard'},
'557799815':{'en': 'Vivo'},
'601065':{'en': 'Packcet One'},
'601064':{'en': 'Baraka'},
'601066':{'en': 'DiGi'},
'601061':{'en': 'Baraka'},
'601060':{'en': 'Baraka'},
'601063':{'en': 'Baraka'},
'601062':{'en': 'Baraka'},
'59669610':{'en': 'Digicel'},
'59669611':{'en': 'Digicel'},
'59669616':{'en': 'Digicel'},
'59669617':{'en': 'Digicel'},
'59669618':{'en': 'Digicel'},
'559199906':{'en': 'Oi'},
'557799811':{'en': 'Vivo'},
'557799812':{'en': 'Vivo'},
'559399933':{'en': 'Oi'},
'559199905':{'en': 'Oi'},
'658868':{'en': 'M1'},
'8536302':{'en': 'CTM'},
'7958589':{'en': 'Tele2', 'ru': 'Tele2'},
'7958588':{'en': 'Tele2', 'ru': 'Tele2'},
'8536651':{'en': 'CTM'},
'7958587':{'en': 'Tele2', 'ru': 'Tele2'},
'7958586':{'en': 'Tele2', 'ru': 'Tele2'},
'7958585':{'en': 'Tele2', 'ru': 'Tele2'},
'7958584':{'en': 'Tele2', 'ru': 'Tele2'},
'8536653':{'en': 'CTM'},
'8536654':{'en': 'CTM'},
'8536307':{'en': '3'},
'62276911':{'en': 'Esia'},
'62276910':{'en': 'Esia'},
'62276913':{'en': 'Esia'},
'62276912':{'en': 'Esia'},
'62276915':{'en': 'Esia'},
'62276914':{'en': 'Esia'},
'62276916':{'en': 'Esia'},
'8536657':{'en': '3'},
'658488':{'en': 'M1'},
'554599914':{'en': 'TIM'},
'554599915':{'en': 'TIM'},
'554599916':{'en': 'TIM'},
'554599917':{'en': 'TIM'},
'557499147':{'en': 'TIM'},
'554599911':{'en': 'TIM'},
'554599912':{'en': 'TIM'},
'554599913':{'en': 'TIM'},
'557499149':{'en': 'TIM'},
'557499148':{'en': 'TIM'},
'554599918':{'en': 'TIM'},
'554599919':{'en': 'TIM'},
'569688':{'en': u('N\u00f3made Telecomunicaciones')},
'569686':{'en': 'Movistar'},
'569687':{'en': 'Movistar'},
'569684':{'en': 'Movistar'},
'569685':{'en': 'Movistar'},
'569682':{'en': 'Movistar'},
'569683':{'en': 'Movistar'},
'569680':{'en': 'Movistar'},
'569681':{'en': 'Movistar'},
'6221853':{'en': 'Esia'},
'6221854':{'en': 'Esia'},
'556598421':{'en': 'Brasil Telecom GSM'},
'658738':{'en': 'M1'},
'62274984':{'en': 'Esia'},
'62274985':{'en': 'Esia'},
'62274986':{'en': 'Esia'},
'62274987':{'en': 'Esia'},
'62274980':{'en': 'Esia'},
'62274981':{'en': 'Esia'},
'62274982':{'en': 'Esia'},
'62274983':{'en': 'Esia'},
'62231950':{'en': 'Esia'},
'559699968':{'en': 'Oi'},
'559699961':{'en': 'Oi'},
'559699963':{'en': 'Oi'},
'559699962':{'en': 'Oi'},
'559699965':{'en': 'Oi'},
'559699964':{'en': 'Oi'},
'559699967':{'en': 'Oi'},
'559699966':{'en': 'Oi'},
'6236286':{'en': 'Esia'},
'7950943':{'en': 'MTS', 'ru': 'MTS'},
'7950942':{'en': 'MTS', 'ru': 'MTS'},
'7950941':{'en': 'MTS', 'ru': 'MTS'},
'7950940':{'en': 'MTS', 'ru': 'MTS'},
'7950944':{'en': 'MTS', 'ru': 'MTS'},
'558498147':{'en': 'Vivo'},
'558498146':{'en': 'Vivo'},
'558498145':{'en': 'Vivo'},
'558498144':{'en': 'Vivo'},
'558498143':{'en': 'Vivo'},
'558498142':{'en': 'Vivo'},
'558498141':{'en': 'Vivo'},
'558498140':{'en': 'Vivo'},
'55519951':{'en': 'Vivo'},
'55519950':{'en': 'Vivo'},
'55519953':{'en': 'Vivo'},
'55519952':{'en': 'Vivo'},
'55519955':{'en': 'Vivo'},
'55519954':{'en': 'Vivo'},
'852537':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'7904943':{'en': 'Tele2', 'ru': 'Tele2'},
'852539':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852538':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'7904940':{'en': 'Tele2', 'ru': 'Tele2'},
'5579988':{'en': 'Oi'},
'5579989':{'en': 'Oi'},
'5579985':{'en': 'Oi'},
'5579986':{'en': 'Oi'},
'5579987':{'en': 'Oi'},
'593984':{'en': 'Movistar'},
'593985':{'en': 'Claro'},
'593986':{'en': 'Claro'},
'593987':{'en': 'Movistar'},
'593980':{'en': 'Claro'},
'593981':{'en': 'Claro'},
'593983':{'en': 'Movistar'},
'593988':{'en': 'Claro'},
'593989':{'en': 'Claro'},
'559399654':{'en': 'Oi'},
'559399655':{'en': 'Oi'},
'559399656':{'en': 'Oi'},
'559399657':{'en': 'Oi'},
'559399651':{'en': 'Oi'},
'559399652':{'en': 'Oi'},
'559399653':{'en': 'Oi'},
'559399658':{'en': 'Oi'},
'559399659':{'en': 'Oi'},
'601847':{'en': 'U Mobile'},
'601846':{'en': 'U Mobile'},
'601840':{'en': 'U Mobile'},
'65856':{'en': 'StarHub'},
'65854':{'en': 'M1'},
'62815':{'en': 'IM3'},
'658572':{'en': 'StarHub'},
'558699982':{'en': 'TIM'},
'558699983':{'en': 'TIM'},
'558699981':{'en': 'TIM'},
'558699986':{'en': 'TIM'},
'558699987':{'en': 'TIM'},
'558699984':{'en': 'TIM'},
'558699985':{'en': 'TIM'},
'853666':{'en': 'CTM'},
'558699988':{'en': 'TIM'},
'558699989':{'en': 'TIM'},
'853662':{'en': 'SmarTone'},
'853663':{'en': '3'},
'555499684':{'en': 'Vivo'},
'555499682':{'en': 'Vivo'},
'555499683':{'en': 'Vivo'},
'555499681':{'en': 'Vivo'},
'6688':{'en': 'True Move'},
'6689':{'en': 'DTAC'},
'6682':{'en': 'AIS'},
'6683':{'en': 'True Move'},
'6684':{'en': 'AIS'},
'6685':{'en': 'DTAC'},
'6686':{'en': 'True Move'},
'6687':{'en': 'AIS'},
'55619811':{'en': 'TIM'},
'555399241':{'en': 'Claro BR'},
'55619813':{'en': 'TIM'},
'55619812':{'en': 'TIM'},
'55619815':{'en': 'TIM'},
'55619814':{'en': 'TIM'},
'55619816':{'en': 'TIM'},
'556398434':{'en': 'Brasil Telecom GSM'},
'556398435':{'en': 'Brasil Telecom GSM'},
'556398436':{'en': 'Brasil Telecom GSM'},
'556398437':{'en': 'Brasil Telecom GSM'},
'57302':{'en': 'Tigo'},
'556398431':{'en': 'Brasil Telecom GSM'},
'556398432':{'en': 'Brasil Telecom GSM'},
'556398433':{'en': 'Brasil Telecom GSM'},
'556398438':{'en': 'Brasil Telecom GSM'},
'556398439':{'en': 'Brasil Telecom GSM'},
'852574':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852576':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'65943':{'en': 'M1'},
'55849945':{'en': 'Claro BR'},
'7900216':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900214':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900215':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900212':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900213':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900210':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900211':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'554999955':{'en': 'TIM'},
'554999951':{'en': 'TIM'},
'7958835':{'en': 'Tele2', 'ru': 'Tele2'},
'790165':{'en': 'Tele2', 'ru': 'Tele2'},
'790166':{'en': 'Tele2', 'ru': 'Tele2'},
'790160':{'en': 'Tele2', 'ru': 'Tele2'},
'55849943':{'en': 'Claro BR'},
'554798449':{'en': 'Brasil Telecom GSM'},
'556199679':{'en': 'Vivo'},
'556199678':{'en': 'Vivo'},
'556199673':{'en': 'Vivo'},
'556199672':{'en': 'Vivo'},
'556199671':{'en': 'Vivo'},
'556199677':{'en': 'Vivo'},
'556199676':{'en': 'Vivo'},
'556199675':{'en': 'Vivo'},
'556199674':{'en': 'Vivo'},
'556198108':{'en': 'TIM'},
'556198109':{'en': 'TIM'},
'556198102':{'en': 'TIM'},
'556198103':{'en': 'TIM'},
'556198101':{'en': 'TIM'},
'556198106':{'en': 'TIM'},
'556198107':{'en': 'TIM'},
'556198104':{'en': 'TIM'},
'556198105':{'en': 'TIM'},
'557199181':{'en': 'TIM'},
'556599608':{'en': 'Vivo'},
'556599609':{'en': 'Vivo'},
'556599606':{'en': 'Vivo'},
'556599607':{'en': 'Vivo'},
'556599604':{'en': 'Vivo'},
'556599605':{'en': 'Vivo'},
'556599602':{'en': 'Vivo'},
'556599603':{'en': 'Vivo'},
'556599601':{'en': 'Vivo'},
'62335995':{'en': 'Esia'},
'558399372':{'en': 'Claro BR'},
'601084':{'en': 'XOX'},
'5571981':{'en': 'Claro BR'},
'5571982':{'en': 'Claro BR'},
'5571985':{'en': 'Oi'},
'5571986':{'en': 'Oi'},
'5571987':{'en': 'Oi'},
'5571988':{'en': 'Oi'},
'5571989':{'en': 'Oi'},
'557599165':{'en': 'TIM'},
'557599168':{'en': 'TIM'},
'557599169':{'en': 'TIM'},
'554798418':{'en': 'Brasil Telecom GSM'},
'554798419':{'en': 'Brasil Telecom GSM'},
'558899908':{'en': 'TIM'},
'558899909':{'en': 'TIM'},
'558899904':{'en': 'TIM'},
'554798411':{'en': 'Brasil Telecom GSM'},
'554798412':{'en': 'Brasil Telecom GSM'},
'554798413':{'en': 'Brasil Telecom GSM'},
'554798414':{'en': 'Brasil Telecom GSM'},
'554798415':{'en': 'Brasil Telecom GSM'},
'554798416':{'en': 'Brasil Telecom GSM'},
'554798417':{'en': 'Brasil Telecom GSM'},
'557799119':{'en': 'TIM'},
'557799118':{'en': 'TIM'},
'556299997':{'en': 'Vivo'},
'556299996':{'en': 'Vivo'},
'62272902':{'en': 'Esia'},
'62272903':{'en': 'Esia'},
'62272900':{'en': 'Esia'},
'62272901':{'en': 'Esia'},
'556699658':{'en': 'Vivo'},
'556699659':{'en': 'Vivo'},
'556699654':{'en': 'Vivo'},
'556699655':{'en': 'Vivo'},
'556699656':{'en': 'Vivo'},
'556699657':{'en': 'Vivo'},
'556699651':{'en': 'Vivo'},
'557799148':{'en': 'TIM'},
'556699653':{'en': 'Vivo'},
'556998457':{'en': 'Brasil Telecom GSM'},
'554598418':{'en': 'Brasil Telecom GSM'},
'62218383':{'en': 'Esia'},
'7958136':{'en': 'Tele2', 'ru': 'Tele2'},
'556998452':{'en': 'Brasil Telecom GSM'},
'7958137':{'en': 'Tele2', 'ru': 'Tele2'},
'557799116':{'en': 'TIM'},
'79519':{'en': 'Tele2', 'ru': 'Tele2'},
'59069122':{'en': 'Dauphin Telecom'},
'79518':{'en': 'Tele2', 'ru': 'Tele2'},
'554799658':{'en': 'TIM'},
'554599114':{'en': 'Vivo'},
'6229191':{'en': 'Esia'},
'658394':{'en': 'StarHub'},
'555399988':{'en': 'TIM'},
'556499675':{'en': 'Vivo'},
'556699602':{'en': 'Vivo'},
'554599116':{'en': 'Vivo'},
'62370989':{'en': 'Esia'},
'62370988':{'en': 'Esia'},
'62370987':{'en': 'Esia'},
'62370986':{'en': 'Esia'},
'62370985':{'en': 'Esia'},
'559799933':{'en': 'Oi'},
'66901':{'en': 'AIS'},
'8536619':{'en': 'CTM'},
'8536348':{'en': 'CTM'},
'8529295':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'60154850':{'en': 'MyKris'},
'8536347':{'en': 'CTM'},
'8536344':{'en': '3'},
'8536345':{'en': 'CTM'},
'8536342':{'en': 'China Telecom'},
'8536343':{'en': 'China Telecom'},
'5917353':{'en': 'Entel'},
'8536341':{'en': 'China Telecom'},
'8525232':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'569848':{'en': 'Claro'},
'569849':{'en': 'Claro'},
'569844':{'en': 'Entel'},
'569845':{'en': 'Entel'},
'569846':{'en': 'Entel'},
'569847':{'en': 'Entel'},
'569840':{'en': 'Entel'},
'569841':{'en': 'Entel'},
'569842':{'en': 'Entel'},
'569843':{'en': 'Entel'},
'601046':{'en': 'DiGi'},
'601045':{'en': 'Webe'},
'601044':{'en': 'Webe'},
'601043':{'en': 'Maxis'},
'601042':{'en': 'Maxis'},
'601041':{'en': 'Celcom'},
'601040':{'en': 'Celcom'},
'554599111':{'en': 'Vivo'},
'62855':{'en': 'IM3'},
'799242':{'en': 'Tele2', 'ru': 'Tele2'},
'799241':{'en': 'Tele2', 'ru': 'Tele2'},
'799240':{'en': 'Tele2', 'ru': 'Tele2'},
'6272799':{'en': 'Esia'},
'554599112':{'en': 'Vivo'},
'6277899':{'en': 'Esia'},
'852605':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'55469881':{'en': 'Claro BR'},
'7901847':{'en': 'Tele2', 'ru': 'Tele2'},
'554599113':{'en': 'Vivo'},
'852604':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'7902718':{'en': 'TMT', 'ru': 'TMT'},
'59069078':{'en': 'SFR/Rife'},
'569518':{'en': 'Entel'},
'569519':{'en': 'Entel'},
'569516':{'en': 'Entel'},
'569517':{'en': 'Entel'},
'569514':{'en': 'Entel'},
'569515':{'en': 'Entel'},
'569512':{'en': 'Virgin Mobile'},
'569513':{'en': 'Virgin Mobile'},
'569510':{'en': 'Virgin Mobile'},
'569511':{'en': 'Virgin Mobile'},
'556498422':{'en': 'Brasil Telecom GSM'},
'556498423':{'en': 'Brasil Telecom GSM'},
'556498421':{'en': 'Brasil Telecom GSM'},
'556498426':{'en': 'Brasil Telecom GSM'},
'556498427':{'en': 'Brasil Telecom GSM'},
'556498424':{'en': 'Brasil Telecom GSM'},
'556498425':{'en': 'Brasil Telecom GSM'},
'556498428':{'en': 'Brasil Telecom GSM'},
'556498429':{'en': 'Brasil Telecom GSM'},
'59069079':{'en': 'SFR/Rife'},
'7902755':{'en': 'Tele2', 'ru': 'Tele2'},
'7902757':{'en': 'Tele2', 'ru': 'Tele2'},
'7902756':{'en': 'Tele2', 'ru': 'Tele2'},
'7902759':{'en': 'Tele2', 'ru': 'Tele2'},
'7902758':{'en': 'Tele2', 'ru': 'Tele2'},
'6221833':{'en': 'Esia'},
'6221832':{'en': 'Esia'},
'6221836':{'en': 'Esia'},
'6221834':{'en': 'Esia'},
'559199618':{'en': 'Oi'},
'559199619':{'en': 'Oi'},
'559199616':{'en': 'Oi'},
'559199617':{'en': 'Oi'},
'559199614':{'en': 'Oi'},
'559199615':{'en': 'Oi'},
'559199612':{'en': 'Oi'},
'559199613':{'en': 'Oi'},
'559199611':{'en': 'Oi'},
'67950':{'en': 'Digicel'},
'67951':{'en': 'Digicel'},
'6222880':{'en': 'Esia'},
'67955':{'en': 'Digicel'},
'67956':{'en': 'Digicel'},
'67958':{'en': 'Vodafone'},
'6011177':{'en': 'Maxis'},
'6011176':{'en': 'Maxis'},
'6011175':{'en': 'Maxis'},
'6011174':{'en': 'YTL'},
'6011173':{'en': 'YTL'},
'6011172':{'en': 'YTL'},
'6011171':{'en': 'YTL'},
'6011170':{'en': 'YTL'},
'6011179':{'en': 'Maxis'},
'6011178':{'en': 'Maxis'},
'55899941':{'en': 'Claro BR'},
'55899940':{'en': 'Claro BR'},
'55899943':{'en': 'Claro BR'},
'55899942':{'en': 'Claro BR'},
'79344':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79341':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559999977':{'en': 'Oi'},
'852519':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852518':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852513':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852512':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852511':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'852510':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852517':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852516':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852514':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'659337':{'en': 'StarHub'},
'557798152':{'en': 'Claro BR'},
'557798153':{'en': 'Claro BR'},
'557798150':{'en': 'Claro BR'},
'557798151':{'en': 'Claro BR'},
'593968':{'en': 'Claro'},
'593969':{'en': 'Claro'},
'593967':{'en': 'Claro'},
'593960':{'en': 'CNT'},
'554999173':{'en': 'Vivo'},
'557599979':{'en': 'Vivo'},
'557599978':{'en': 'Vivo'},
'557599975':{'en': 'Vivo'},
'557599977':{'en': 'Vivo'},
'557599976':{'en': 'Vivo'},
'557599970':{'en': 'Vivo'},
'557599973':{'en': 'Vivo'},
'557599972':{'en': 'Vivo'},
'6271195':{'en': 'Esia'},
'6271194':{'en': 'Esia'},
'6271191':{'en': 'Esia'},
'5593988':{'en': 'Oi'},
'5593989':{'en': 'Oi'},
'65831':{'en': 'SingTel'},
'5593985':{'en': 'Oi'},
'5593986':{'en': 'Oi'},
'5593987':{'en': 'Oi'},
'65834':{'en': 'SingTel'},
'62911997':{'en': 'Esia'},
'558499471':{'en': 'Claro BR'},
'62911995':{'en': 'Esia'},
'559999989':{'en': 'Oi'},
'559999986':{'en': 'Oi'},
'559999987':{'en': 'Oi'},
'559999984':{'en': 'Oi'},
'559999985':{'en': 'Oi'},
'658232':{'en': 'StarHub'},
'658233':{'en': 'StarHub'},
'6227495':{'en': 'Esia'},
'658234':{'en': 'StarHub'},
'658235':{'en': 'StarHub'},
'57320':{'en': 'Claro'},
'57321':{'en': 'Claro'},
'557399980':{'en': 'Vivo'},
'57323':{'en': 'Claro'},
'601137':{'en': 'U Mobile'},
'559899125':{'en': 'Vivo'},
'556198178':{'en': 'TIM'},
'6148984':{'en': 'Victorian Rail Track'},
'790417':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790416':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790142':{'en': 'Tele2', 'ru': 'Tele2'},
'795019':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'556199691':{'en': 'Vivo'},
'569988':{'en': 'Entel'},
'556199693':{'en': 'Vivo'},
'556199692':{'en': 'Vivo'},
'556199695':{'en': 'Vivo'},
'556199694':{'en': 'Vivo'},
'556199697':{'en': 'Vivo'},
'556199696':{'en': 'Vivo'},
'556199699':{'en': 'Vivo'},
'556199698':{'en': 'Vivo'},
'569983':{'en': 'Entel'},
'556198174':{'en': 'TIM'},
'569985':{'en': 'Claro'},
'556198504':{'en': 'Brasil Telecom GSM'},
'569987':{'en': 'Entel'},
'569986':{'en': 'Claro'},
'597770':{'en': 'Telesur'},
'556599624':{'en': 'Vivo'},
'556599625':{'en': 'Vivo'},
'556599626':{'en': 'Vivo'},
'556599627':{'en': 'Vivo'},
'556599621':{'en': 'Vivo'},
'556599622':{'en': 'Vivo'},
'556599623':{'en': 'Vivo'},
'597774':{'en': 'Telesur'},
'556599628':{'en': 'Vivo'},
'556599629':{'en': 'Vivo'},
'558399352':{'en': 'Claro BR'},
'599700':{'en': 'Digicel'},
'599701':{'en': 'Digicel'},
'886900':{'en': 'FarEasTone'},
'7991332':{'en': 'Tele2', 'ru': 'Tele2'},
'7991331':{'en': 'Tele2', 'ru': 'Tele2'},
'7991330':{'en': 'Tele2', 'ru': 'Tele2'},
'852617':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'557599148':{'en': 'TIM'},
'557599149':{'en': 'TIM'},
'557599144':{'en': 'TIM'},
'557599145':{'en': 'TIM'},
'557599146':{'en': 'TIM'},
'557599147':{'en': 'TIM'},
'557599141':{'en': 'TIM'},
'557599142':{'en': 'TIM'},
'557599143':{'en': 'TIM'},
'559198206':{'en': 'TIM'},
'559198207':{'en': 'TIM'},
'559198204':{'en': 'TIM'},
'559198205':{'en': 'TIM'},
'559198202':{'en': 'TIM'},
'559198203':{'en': 'TIM'},
'559198201':{'en': 'TIM'},
'559198208':{'en': 'TIM'},
'559198209':{'en': 'TIM'},
'559298450':{'en': 'Claro BR'},
'559298451':{'en': 'Claro BR'},
'559499233':{'en': 'Vivo'},
'559499232':{'en': 'Vivo'},
'569770':{'en': 'Entel'},
'559499230':{'en': 'Vivo'},
'5581989':{'en': 'Oi'},
'5581988':{'en': 'Oi'},
'5581987':{'en': 'Oi'},
'554899167':{'en': 'Vivo'},
'5581985':{'en': 'Oi'},
'554899165':{'en': 'Vivo'},
'554899162':{'en': 'Vivo'},
'554899163':{'en': 'Vivo'},
'5581981':{'en': 'Vivo'},
'554899161':{'en': 'Vivo'},
'559398408':{'en': 'Claro BR'},
'559398409':{'en': 'Claro BR'},
'559398406':{'en': 'Claro BR'},
'559398407':{'en': 'Claro BR'},
'559398404':{'en': 'Claro BR'},
'559398405':{'en': 'Claro BR'},
'559398402':{'en': 'Claro BR'},
'559398403':{'en': 'Claro BR'},
'559398401':{'en': 'Claro BR'},
'6221317':{'en': 'Esia'},
'8525548':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525540':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525541':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'559499944':{'en': 'Oi'},
'8525543':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525544':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525545':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525546':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525547':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'61475':{'en': 'Telstra'},
'61474':{'en': 'Telstra'},
'61477':{'en': 'Telstra'},
'61476':{'en': 'Telstra'},
'61470':{'en': 'Lycamobile'},
'61473':{'en': 'Telstra'},
'61472':{'en': 'Telstra'},
'61478':{'en': 'Optus'},
'558899650':{'en': 'TIM'},
'62401700':{'en': 'Esia'},
'62401701':{'en': 'Esia'},
'62401702':{'en': 'Esia'},
'62401703':{'en': 'Esia'},
'62401704':{'en': 'Esia'},
'556298103':{'en': 'TIM'},
'7902588':{'en': 'Tele2', 'ru': 'Tele2'},
'595951':{'en': 'VOX'},
'556298102':{'en': 'TIM'},
'554598801':{'en': 'Claro BR'},
'556399998':{'en': 'Vivo'},
'556399999':{'en': 'Vivo'},
'556399994':{'en': 'Vivo'},
'556399995':{'en': 'Vivo'},
'556399996':{'en': 'Vivo'},
'556399997':{'en': 'Vivo'},
'556399991':{'en': 'Vivo'},
'556399992':{'en': 'Vivo'},
'556399993':{'en': 'Vivo'},
'55819933':{'en': 'Claro BR'},
'554598805':{'en': 'Claro BR'},
'554598804':{'en': 'Claro BR'},
'556499911':{'en': 'Vivo'},
'554598807':{'en': 'Claro BR'},
'7908025':{'en': 'Tele2', 'ru': 'Tele2'},
'7908024':{'en': 'Tele2', 'ru': 'Tele2'},
'7908026':{'en': 'Tele2', 'ru': 'Tele2'},
'7908021':{'en': 'Tele2', 'ru': 'Tele2'},
'7908020':{'en': 'Tele2', 'ru': 'Tele2'},
'7908023':{'en': 'Tele2', 'ru': 'Tele2'},
'7908022':{'en': 'Tele2', 'ru': 'Tele2'},
'8536320':{'en': '3'},
'8536321':{'en': '3'},
'8536322':{'en': 'China Telecom'},
'8536323':{'en': 'China Telecom'},
'8536324':{'en': 'CTM'},
'8536325':{'en': 'CTM'},
'8536326':{'en': 'CTM'},
'8536327':{'en': 'CTM'},
'556299694':{'en': 'Vivo'},
'556299695':{'en': 'Vivo'},
'556299696':{'en': 'Vivo'},
'556299697':{'en': 'Vivo'},
'556299691':{'en': 'Vivo'},
'556299692':{'en': 'Vivo'},
'556299693':{'en': 'Vivo'},
'799229':{'en': 'Tele2', 'ru': 'Tele2'},
'799228':{'en': 'Tele2', 'ru': 'Tele2'},
'556299698':{'en': 'Vivo'},
'556299699':{'en': 'Vivo'},
'8536300':{'en': 'CTM'},
'559399975':{'en': 'Oi'},
'559399974':{'en': 'Oi'},
'559399977':{'en': 'Oi'},
'559399976':{'en': 'Oi'},
'559399970':{'en': 'Oi'},
'559399973':{'en': 'Oi'},
'559399979':{'en': 'Oi'},
'559399978':{'en': 'Oi'},
'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'},
'556498408':{'en': 'Brasil Telecom GSM'},
'556498409':{'en': 'Brasil Telecom GSM'},
'59179':{'en': 'Nuevatel'},
'86132':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'59177':{'en': 'Tigo'},
'556498401':{'en': 'Brasil Telecom GSM'},
'556498402':{'en': 'Brasil Telecom GSM'},
'556498403':{'en': 'Brasil Telecom GSM'},
'556498404':{'en': 'Brasil Telecom GSM'},
'556498405':{'en': 'Brasil Telecom GSM'},
'556498406':{'en': 'Brasil Telecom GSM'},
'556498407':{'en': 'Brasil Telecom GSM'},
'7958548':{'en': 'Tele2', 'ru': 'Tele2'},
'79004881':{'en': 'Tele2', 'ru': 'Tele2'},
'59669654':{'en': 'Digicel'},
'59669655':{'en': 'Orange'},
'59669656':{'en': 'Orange'},
'59669650':{'en': 'Digicel'},
'59669651':{'en': 'Digicel'},
'59669652':{'en': 'Digicel'},
'59669653':{'en': 'Digicel'},
'7901624':{'en': 'Tele2', 'ru': 'Tele2'},
'7901625':{'en': 'Tele2', 'ru': 'Tele2'},
'79004884':{'en': 'Tele2', 'ru': 'Tele2'},
'658777':{'en': 'M1'},
'659444':{'en': 'SingTel'},
'658778':{'en': 'M1'},
'559199634':{'en': 'Oi'},
'559199635':{'en': 'Oi'},
'559199636':{'en': 'Oi'},
'559199637':{'en': 'Oi'},
'559199631':{'en': 'Oi'},
'559199632':{'en': 'Oi'},
'559199633':{'en': 'Oi'},
'559199638':{'en': 'Oi'},
'559199639':{'en': 'Oi'},
'554799242':{'en': 'Vivo'},
'554799243':{'en': 'Vivo'},
'554799240':{'en': 'Vivo'},
'554799241':{'en': 'Vivo'},
'554799246':{'en': 'Vivo'},
'554799244':{'en': 'Vivo'},
'554799245':{'en': 'Vivo'},
'7958547':{'en': 'Tele2', 'ru': 'Tele2'},
'7958546':{'en': 'Tele2', 'ru': 'Tele2'},
'7958545':{'en': 'Tele2', 'ru': 'Tele2'},
'7958544':{'en': 'Tele2', 'ru': 'Tele2'},
'7958543':{'en': 'Tele2', 'ru': 'Tele2'},
'7958542':{'en': 'Tele2', 'ru': 'Tele2'},
'7958541':{'en': 'Tele2', 'ru': 'Tele2'},
'555398408':{'en': 'Brasil Telecom GSM'},
'555398409':{'en': 'Brasil Telecom GSM'},
'7952729':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7952728':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'555398402':{'en': 'Brasil Telecom GSM'},
'555398403':{'en': 'Brasil Telecom GSM'},
'7952727':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'555398401':{'en': 'Brasil Telecom GSM'},
'555398406':{'en': 'Brasil Telecom GSM'},
'555398407':{'en': 'Brasil Telecom GSM'},
'555398404':{'en': 'Brasil Telecom GSM'},
'555398405':{'en': 'Brasil Telecom GSM'},
'6011151':{'en': 'Tune Talk'},
'6011150':{'en': 'Tune Talk'},
'6011153':{'en': 'Tune Talk'},
'6011152':{'en': 'Tune Talk'},
'6011155':{'en': 'Celcom'},
'6011154':{'en': 'Tune Talk'},
'6011157':{'en': 'Celcom'},
'6011156':{'en': 'Celcom'},
'6011159':{'en': 'Celcom'},
'6011158':{'en': 'Celcom'},
'554599134':{'en': 'Vivo'},
'559898184':{'en': 'TIM'},
'559898185':{'en': 'TIM'},
'559898182':{'en': 'TIM'},
'559898183':{'en': 'TIM'},
'559898181':{'en': 'TIM'},
'79366':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79367':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79360':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556999905':{'en': 'Vivo'},
'556999904':{'en': 'Vivo'},
'556999907':{'en': 'Vivo'},
'556999906':{'en': 'Vivo'},
'556999901':{'en': 'Vivo'},
'556999903':{'en': 'Vivo'},
'556999902':{'en': 'Vivo'},
'556999909':{'en': 'Vivo'},
'556999908':{'en': 'Vivo'},
'556698406':{'en': 'Brasil Telecom GSM'},
'556698407':{'en': 'Brasil Telecom GSM'},
'556698404':{'en': 'Brasil Telecom GSM'},
'556698405':{'en': 'Brasil Telecom GSM'},
'556698402':{'en': 'Brasil Telecom GSM'},
'556698403':{'en': 'Brasil Telecom GSM'},
'9053387':{'en': 'Kuzey Kibris Turkcell'},
'556698401':{'en': 'Brasil Telecom GSM'},
'556698408':{'en': 'Brasil Telecom GSM'},
'556698409':{'en': 'Brasil Telecom GSM'},
'7995900':{'en': 'Tele2', 'ru': 'Tele2'},
'62331994':{'en': 'Esia'},
'62331993':{'en': 'Esia'},
'62331992':{'en': 'Esia'},
'62331991':{'en': 'Esia'},
'62331990':{'en': 'Esia'},
'61440':{'en': 'MessageBird'},
'62735986':{'en': 'Esia'},
'65817':{'en': 'M1'},
'65816':{'en': 'StarHub'},
'65815':{'en': 'StarHub'},
'65814':{'en': 'StarHub'},
'65813':{'en': 'StarHub'},
'65812':{'en': 'SingTel'},
'65811':{'en': 'StarHub'},
'65810':{'en': 'M1'},
'7900343':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'853622':{'en': '3'},
'853623':{'en': 'CTM'},
'853621':{'en': 'China Telecom'},
'853628':{'en': 'CTM'},
'558799243':{'en': 'Claro BR'},
'7900989':{'en': 'Tele2', 'ru': 'Tele2'},
'7904719':{'en': 'TMT', 'ru': 'TMT'},
'7904718':{'en': 'TMT', 'ru': 'TMT'},
'797827':{'en': 'MTS', 'ru': 'MTS'},
'797826':{'en': 'MTS', 'ru': 'MTS'},
'797821':{'en': 'MTS', 'ru': 'MTS'},
'7902407':{'en': 'Tele2', 'ru': 'Tele2'},
'677932':{'en': 'Satsol'},
'677930':{'en': 'Satsol'},
'677931':{'en': 'Satsol'},
'7900986':{'en': 'Tele2', 'ru': 'Tele2'},
'797822':{'en': 'MTS', 'ru': 'MTS'},
'7900987':{'en': 'Tele2', 'ru': 'Tele2'},
'7900984':{'en': 'Tele2', 'ru': 'Tele2'},
'7900985':{'en': 'Tele2', 'ru': 'Tele2'},
'558199749':{'en': 'TIM'},
'558199748':{'en': 'TIM'},
'558199747':{'en': 'TIM'},
'5696894':{'en': 'Netline'},
'5696895':{'en': 'Entel'},
'5696896':{'en': 'Entel'},
'5696897':{'en': 'Entel'},
'5696890':{'en': 'Netline'},
'5696891':{'en': 'Netline'},
'5696892':{'en': 'Netline'},
'5696893':{'en': 'Netline'},
'5696898':{'en': 'Entel'},
'5696899':{'en': 'Entel'},
'7904955':{'en': 'Tele2', 'ru': 'Tele2'},
'7904957':{'en': 'Tele2', 'ru': 'Tele2'},
'7904956':{'en': 'Tele2', 'ru': 'Tele2'},
'658218':{'en': 'SingTel'},
'658219':{'en': 'M1'},
'658214':{'en': 'M1'},
'658215':{'en': 'M1'},
'658216':{'en': 'M1'},
'658217':{'en': 'M1'},
'658210':{'en': 'M1'},
'658211':{'en': 'M1'},
'658212':{'en': 'M1'},
'658213':{'en': 'M1'},
'557799964':{'en': 'Vivo'},
'557799966':{'en': 'Vivo'},
'557799967':{'en': 'Vivo'},
'557799961':{'en': 'Vivo'},
'557799962':{'en': 'Vivo'},
'557799963':{'en': 'Vivo'},
'557799968':{'en': 'Vivo'},
'557799969':{'en': 'Vivo'},
'79966':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'852934':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'79964':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79965':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'852931':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852930':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852933':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852932':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852938':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'68577':{'en': 'Digicel'},
'55629998':{'en': 'Vivo'},
'55629997':{'en': 'Vivo'},
'55629996':{'en': 'Vivo'},
'790438':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'556599646':{'en': 'Vivo'},
'6243599':{'en': 'Esia'},
'559598122':{'en': 'TIM'},
'556599644':{'en': 'Vivo'},
'7996699':{'en': 'Tele2', 'ru': 'Tele2'},
'556599648':{'en': 'Vivo'},
'556599649':{'en': 'Vivo'},
'852547':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'7991315':{'en': 'Tele2', 'ru': 'Tele2'},
'7991317':{'en': 'Tele2', 'ru': 'Tele2'},
'7991316':{'en': 'Tele2', 'ru': 'Tele2'},
'7991319':{'en': 'Tele2', 'ru': 'Tele2'},
'6011274':{'en': 'U Mobile'},
'6011275':{'en': 'Maxis'},
'6011278':{'en': 'Maxis'},
'6011279':{'en': 'Maxis'},
'559198228':{'en': 'TIM'},
'559198229':{'en': 'TIM'},
'559198224':{'en': 'TIM'},
'559198225':{'en': 'TIM'},
'559198226':{'en': 'TIM'},
'559198227':{'en': 'TIM'},
'559198221':{'en': 'TIM'},
'559198222':{'en': 'TIM'},
'559198223':{'en': 'TIM'},
'559899112':{'en': 'Vivo'},
'559899113':{'en': 'Vivo'},
'559899111':{'en': 'Vivo'},
'559899116':{'en': 'Vivo'},
'559899117':{'en': 'Vivo'},
'559899114':{'en': 'Vivo'},
'559899115':{'en': 'Vivo'},
'559899118':{'en': 'Vivo'},
'559899119':{'en': 'Vivo'},
'5699048':{'en': 'WOM'},
'5699049':{'en': 'WOM'},
'5699046':{'en': 'Movistar'},
'5699047':{'en': 'Movistar'},
'5699044':{'en': 'Movistar'},
'5699045':{'en': 'Movistar'},
'5699042':{'en': 'Movistar'},
'5699043':{'en': 'Movistar'},
'5699040':{'en': 'Movistar'},
'5699041':{'en': 'Movistar'},
'60154840':{'en': 'red ONE'},
'60154841':{'en': 'Bizsurf'},
'60154845':{'en': 'Fristor'},
'60154848':{'en': 'Webe'},
'60154849':{'en': 'Webe'},
'554798454':{'en': 'Brasil Telecom GSM'},
'554798455':{'en': 'Brasil Telecom GSM'},
'554899146':{'en': 'Vivo'},
'554798457':{'en': 'Brasil Telecom GSM'},
'554899636':{'en': 'TIM'},
'554798451':{'en': 'Brasil Telecom GSM'},
'554798452':{'en': 'Brasil Telecom GSM'},
'554798453':{'en': 'Brasil Telecom GSM'},
'554899638':{'en': 'TIM'},
'554899639':{'en': 'TIM'},
'554899148':{'en': 'Vivo'},
'554899149':{'en': 'Vivo'},
'8525708':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8525709':{'en': 'CITIC', 'zh': u('\u4e2d\u4fe1\u56fd\u9645\u7535\u8baf'), 'zh_Hant': u('\u4e2d\u4fe1\u570b\u969b\u96fb\u8a0a')},
'6241196':{'en': 'Esia'},
'6241194':{'en': 'Esia'},
'6241195':{'en': 'Esia'},
'6241192':{'en': 'Esia'},
'6241193':{'en': 'Esia'},
'6241191':{'en': 'Esia'},
'67855':{'en': 'Digicel'},
'5567999':{'en': 'Vivo'},
'67856':{'en': 'Digicel'},
'67851':{'en': 'Digicel'},
'67850':{'en': 'Digicel'},
'67853':{'en': 'Digicel'},
'67852':{'en': 'Digicel'},
'67859':{'en': 'Digicel'},
'67858':{'en': 'Digicel'},
'5567996':{'en': 'Vivo'},
'852621':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'556699698':{'en': 'Vivo'},
'556699699':{'en': 'Vivo'},
'61451':{'en': 'Vodafone'},
'61450':{'en': 'Vodafone'},
'61457':{'en': 'Telstra'},
'61456':{'en': 'Telstra'},
'61455':{'en': 'Telstra'},
'556699691':{'en': 'Vivo'},
'556699692':{'en': 'Vivo'},
'556699693':{'en': 'Vivo'},
'556699694':{'en': 'Vivo'},
'556699695':{'en': 'Vivo'},
'556699696':{'en': 'Vivo'},
'556699697':{'en': 'Vivo'},
'558899636':{'en': 'TIM'},
'554798900':{'en': 'Claro BR'},
'558899635':{'en': 'TIM'},
'558899630':{'en': 'TIM'},
'852922':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'7936555':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'62273923':{'en': 'Esia'},
'62273922':{'en': 'Esia'},
'62273921':{'en': 'Esia'},
'5696790':{'en': 'Telestar'},
'5696797':{'en': 'Entel'},
'5696796':{'en': 'Entel'},
'5696795':{'en': 'Entel'},
'62273924':{'en': 'Esia'},
'5696799':{'en': 'Entel'},
'5696798':{'en': 'Entel'},
'559498128':{'en': 'TIM'},
'559498129':{'en': 'TIM'},
'559498121':{'en': 'TIM'},
'559498122':{'en': 'TIM'},
'559498123':{'en': 'TIM'},
'559498124':{'en': 'TIM'},
'559498125':{'en': 'TIM'},
'559498126':{'en': 'TIM'},
'559498127':{'en': 'TIM'},
'556499937':{'en': 'Vivo'},
'8536303':{'en': '3'},
'556499935':{'en': 'Vivo'},
'8536301':{'en': 'CTM'},
'8536306':{'en': '3'},
'56989':{'en': 'Movistar'},
'556499931':{'en': 'Vivo'},
'8536305':{'en': '3'},
'8536658':{'en': 'CTM'},
'8536659':{'en': 'CTM'},
'8536308':{'en': '3'},
'8536309':{'en': 'CTM'},
'556499939':{'en': 'Vivo'},
'556499938':{'en': 'Vivo'},
'555499901':{'en': 'Vivo'},
'555499903':{'en': 'Vivo'},
'555499902':{'en': 'Vivo'},
'555499905':{'en': 'Vivo'},
'555499904':{'en': 'Vivo'},
'555499907':{'en': 'Vivo'},
'555499906':{'en': 'Vivo'},
'555499909':{'en': 'Vivo'},
'555499908':{'en': 'Vivo'},
'599951':{'en': 'Chippie'},
'599953':{'en': 'Chippie'},
'599952':{'en': 'Chippie'},
'599954':{'en': 'Chippie'},
'599957':{'en': 'Chippie'},
'599956':{'en': 'Chippie'},
'556199841':{'en': 'Vivo'},
'556199842':{'en': 'Vivo'},
'556199843':{'en': 'Vivo'},
'556199844':{'en': 'Vivo'},
'56980':{'en': 'Entel'},
'556299816':{'en': 'Vivo'},
'556299817':{'en': 'Vivo'},
'556299814':{'en': 'Vivo'},
'556299815':{'en': 'Vivo'},
'556299812':{'en': 'Vivo'},
'556299813':{'en': 'Vivo'},
'556299811':{'en': 'Vivo'},
'799202':{'en': 'Tele2', 'ru': 'Tele2'},
'799201':{'en': 'Tele2', 'ru': 'Tele2'},
'799200':{'en': 'Tele2', 'ru': 'Tele2'},
'554798401':{'en': 'Brasil Telecom GSM'},
'556299818':{'en': 'Vivo'},
'559399952':{'en': 'Oi'},
'559399951':{'en': 'Oi'},
'559399954':{'en': 'Oi'},
'559899619':{'en': 'Oi'},
'559899618':{'en': 'Oi'},
'559899615':{'en': 'Oi'},
'559899614':{'en': 'Oi'},
'559899617':{'en': 'Oi'},
'559899616':{'en': 'Oi'},
'559899611':{'en': 'Oi'},
'559899613':{'en': 'Oi'},
'559899612':{'en': 'Oi'},
'554699132':{'en': 'Vivo'},
'554699131':{'en': 'Vivo'},
'7900461':{'en': 'Tele2', 'ru': 'Tele2'},
'84199':{'en': 'G-Mobile'},
'7900460':{'en': 'Tele2', 'ru': 'Tele2'},
'7902715':{'en': 'TMT', 'ru': 'TMT'},
'7902717':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7902711':{'en': 'TMT', 'ru': 'TMT'},
'7902710':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7902712':{'en': 'MTS', 'ru': 'MTS'},
'7902719':{'en': 'TMT', 'ru': 'TMT'},
'6232191':{'en': 'Esia'},
'6232192':{'en': 'Esia'},
'558599647':{'en': 'TIM'},
'658799':{'en': 'SingTel'},
'658798':{'en': 'SingTel'},
'658797':{'en': 'M1'},
'658790':{'en': 'StarHub'},
'67578':{'en': 'Telikom'},
'595985':{'en': 'Tigo'},
'67579':{'en': 'Digicel'},
'569552':{'en': 'WOM'},
'569553':{'en': 'WOM'},
'569550':{'en': 'OPS Movil'},
'569551':{'en': 'WOM'},
'569556':{'en': 'Falabella Movil'},
'569557':{'en': 'Telestar'},
'569554':{'en': 'Netline'},
'569558':{'en': 'Falabella Movil'},
'569559':{'en': 'Falabella Movil'},
'555398421':{'en': 'Brasil Telecom GSM'},
'555398422':{'en': 'Brasil Telecom GSM'},
'555398423':{'en': 'Brasil Telecom GSM'},
'555398424':{'en': 'Brasil Telecom GSM'},
'555398425':{'en': 'Brasil Telecom GSM'},
'555398426':{'en': 'Brasil Telecom GSM'},
'555398427':{'en': 'Brasil Telecom GSM'},
'555398428':{'en': 'Brasil Telecom GSM'},
'555398429':{'en': 'Brasil Telecom GSM'},
'6011139':{'en': 'Baraka'},
'6011138':{'en': 'Baraka'},
'6011133':{'en': 'XOX'},
'6011132':{'en': 'XOX'},
'6011131':{'en': 'XOX'},
'6011130':{'en': 'XOX'},
'6011137':{'en': 'Baraka'},
'6011136':{'en': 'Baraka'},
'6011135':{'en': 'Baraka'},
'6011134':{'en': 'XOX'},
'79308':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79302':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79303':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79300':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79301':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79307':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79304':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556999929':{'en': 'Vivo'},
'556999928':{'en': 'Vivo'},
'556999923':{'en': 'Vivo'},
'556999922':{'en': 'Vivo'},
'556999921':{'en': 'Vivo'},
'556999927':{'en': 'Vivo'},
'556999926':{'en': 'Vivo'},
'556999925':{'en': 'Vivo'},
'556999924':{'en': 'Vivo'},
'556698428':{'en': 'Brasil Telecom GSM'},
'556698424':{'en': 'Brasil Telecom GSM'},
'556698425':{'en': 'Brasil Telecom GSM'},
'556698426':{'en': 'Brasil Telecom GSM'},
'556698427':{'en': 'Brasil Telecom GSM'},
'556698421':{'en': 'Brasil Telecom GSM'},
'556698422':{'en': 'Brasil Telecom GSM'},
'556698423':{'en': 'Brasil Telecom GSM'},
'554799996':{'en': 'TIM'},
'554799997':{'en': 'TIM'},
'554799994':{'en': 'TIM'},
'554799995':{'en': 'TIM'},
'554799992':{'en': 'TIM'},
'554799993':{'en': 'TIM'},
'554799991':{'en': 'TIM'},
'79004880':{'en': 'Tele2', 'ru': 'Tele2'},
'659443':{'en': 'SingTel'},
'79004882':{'en': 'Tele2', 'ru': 'Tele2'},
'79004883':{'en': 'Tele2', 'ru': 'Tele2'},
'659446':{'en': 'SingTel'},
'554799998':{'en': 'TIM'},
'659445':{'en': 'SingTel'},
'559699909':{'en': 'Oi'},
'559699908':{'en': 'Oi'},
'559699903':{'en': 'Oi'},
'559699902':{'en': 'Oi'},
'559699901':{'en': 'Oi'},
'559699907':{'en': 'Oi'},
'559699906':{'en': 'Oi'},
'559699905':{'en': 'Oi'},
'559699904':{'en': 'Oi'},
'559699161':{'en': 'Vivo'},
'7996756':{'en': 'Tele2', 'ru': 'Tele2'},
'7904713':{'en': 'TMT', 'ru': 'TMT'},
'7904712':{'en': 'TMT', 'ru': 'TMT'},
'7904711':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904710':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904717':{'en': 'TMT', 'ru': 'TMT'},
'7904716':{'en': 'TMT', 'ru': 'TMT'},
'7904715':{'en': 'TMT', 'ru': 'TMT'},
'7904714':{'en': 'TMT', 'ru': 'TMT'},
'601890':{'en': 'U Mobile'},
'599963':{'en': 'GSM Caribbean'},
'7996757':{'en': 'Tele2', 'ru': 'Tele2'},
'559699168':{'en': 'Vivo'},
'601891':{'en': 'U Mobile'},
'558799912':{'en': 'TIM'},
'558799913':{'en': 'TIM'},
'558799911':{'en': 'TIM'},
'558799916':{'en': 'TIM'},
'558799917':{'en': 'TIM'},
'558799914':{'en': 'TIM'},
'558799915':{'en': 'TIM'},
'558799918':{'en': 'TIM'},
'558799919':{'en': 'TIM'},
'601892':{'en': 'YTL'},
'6661':{'en': 'AIS'},
'6666':{'en': 'DTAC'},
'6664':{'en': 'Penguin SIM'},
'6665':{'en': 'AIS'},
'63995':{'en': 'Globe'},
'63998':{'en': 'Smart'},
'63999':{'en': 'Smart'},
'6234167':{'en': 'Esia'},
'6234166':{'en': 'Esia'},
'6234165':{'en': 'Esia'},
'852916':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852540':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'852541':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852543':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852919':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852918':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852917':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852544':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852915':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852914':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852913':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852912':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852910':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852546':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'856209':{'en': 'Unitel'},
'856207':{'en': 'Beeline'},
'856205':{'en': 'Lao Telecom'},
'5587986':{'en': 'Oi'},
'856202':{'en': 'ETL'},
'790451':{'en': 'Tele2', 'ru': 'Tele2'},
'790450':{'en': 'Tele2', 'ru': 'Tele2'},
'790453':{'en': 'Tele2', 'ru': 'Tele2'},
'790452':{'en': 'Tele2', 'ru': 'Tele2'},
'790454':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'62215936':{'en': 'Esia'},
'790459':{'en': 'Tele2', 'ru': 'Tele2'},
'790458':{'en': 'Tele2', 'ru': 'Tele2'},
'569949':{'en': 'Entel'},
'569945':{'en': 'Movistar'},
'569944':{'en': 'Movistar'},
'569947':{'en': 'Entel'},
'569946':{'en': 'Movistar'},
'569941':{'en': 'Entel'},
'569940':{'en': 'Movistar'},
'569943':{'en': 'Movistar'},
'569942':{'en': 'Movistar'},
'8536517':{'en': 'CTM'},
'8536516':{'en': 'CTM'},
'8536515':{'en': 'CTM'},
'8536519':{'en': 'CTM'},
'8536518':{'en': 'CTM'},
'554799603':{'en': 'TIM'},
'7901871':{'en': 'Tele2', 'ru': 'Tele2'},
'7901870':{'en': 'Tele2', 'ru': 'Tele2'},
'7996014':{'en': 'Tele2', 'ru': 'Tele2'},
'790457':{'en': 'Tele2', 'ru': 'Tele2'},
'6227299':{'en': 'Esia'},
'557199229':{'en': 'TIM'},
'557199228':{'en': 'TIM'},
'557199221':{'en': 'TIM'},
'557199223':{'en': 'TIM'},
'557199222':{'en': 'TIM'},
'557199225':{'en': 'TIM'},
'557199224':{'en': 'TIM'},
'557199227':{'en': 'TIM'},
'557199226':{'en': 'TIM'},
'557599181':{'en': 'TIM'},
'557599182':{'en': 'TIM'},
'557599183':{'en': 'TIM'},
'559899138':{'en': 'Vivo'},
'559899139':{'en': 'Vivo'},
'559899131':{'en': 'Vivo'},
'559899132':{'en': 'Vivo'},
'559899133':{'en': 'Vivo'},
'559899134':{'en': 'Vivo'},
'559899135':{'en': 'Vivo'},
'559899136':{'en': 'Vivo'},
'559899137':{'en': 'Vivo'},
'5699028':{'en': 'WOM'},
'5699029':{'en': 'WOM'},
'5699020':{'en': 'Movistar'},
'5699021':{'en': 'Movistar'},
'5699022':{'en': 'Movistar'},
'5699023':{'en': 'Movistar'},
'5699024':{'en': 'Movistar'},
'5699025':{'en': 'Movistar'},
'5699026':{'en': 'Mobilink'},
'5699027':{'en': 'Mobilink'},
'554899618':{'en': 'TIM'},
'569768':{'en': 'Claro'},
'60154862':{'en': 'TM Net'},
'60154860':{'en': 'TM Net'},
'556498141':{'en': 'TIM'},
'569760':{'en': 'Entel'},
'554899612':{'en': 'TIM'},
'569762':{'en': 'Movistar'},
'569765':{'en': 'Entel'},
'554899615':{'en': 'TIM'},
'554899616':{'en': 'TIM'},
'569766':{'en': 'Entel'},
'658636':{'en': 'SingTel'},
'658637':{'en': 'SingTel'},
'658634':{'en': 'SingTel'},
'658635':{'en': 'SingTel'},
'658633':{'en': 'SingTel'},
'57305':{'en': 'Movil Exito'},
'658631':{'en': 'SingTel'},
'8525768':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'8525769':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'658638':{'en': 'SingTel'},
'658639':{'en': 'SingTel'},
'554598812':{'en': 'Claro BR'},
'554598813':{'en': 'Claro BR'},
'554598811':{'en': 'Claro BR'},
'554598816':{'en': 'Claro BR'},
'554598817':{'en': 'Claro BR'},
'554598814':{'en': 'Claro BR'},
'554598815':{'en': 'Claro BR'},
'556699901':{'en': 'Vivo'},
'554598818':{'en': 'Claro BR'},
'554598819':{'en': 'Claro BR'},
'556699904':{'en': 'Vivo'},
'556699905':{'en': 'Vivo'},
'556699906':{'en': 'Vivo'},
'556699907':{'en': 'Vivo'},
'67873':{'en': 'SMILE'},
'67871':{'en': 'SMILE'},
'67870':{'en': 'SMILE'},
'67876':{'en': 'SMILE'},
'67875':{'en': 'SMILE'},
'67874':{'en': 'SMILE'},
'6221358':{'en': 'Esia'},
'6221359':{'en': 'Esia'},
'8536209':{'en': 'CTM'},
'61439':{'en': 'Telstra'},
'61438':{'en': 'Telstra'},
'61431':{'en': 'Optus'},
'61430':{'en': 'Vodafone'},
'61433':{'en': 'Vodafone'},
'61432':{'en': 'Optus'},
'61435':{'en': 'Optus'},
'61434':{'en': 'Optus'},
'61437':{'en': 'Telstra'},
'61436':{'en': 'Telstra'},
'62218393':{'en': 'Esia'},
'678573':{'en': 'Digicel'},
'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'},
'678576':{'en': 'Digicel'},
'601876':{'en': 'U Mobile'},
'678575':{'en': 'Digicel'},
'678574':{'en': 'Digicel'},
'558999443':{'en': 'Claro BR'},
'558999446':{'en': 'Claro BR'},
'558999444':{'en': 'Claro BR'},
'558999445':{'en': 'Claro BR'},
'556499607':{'en': 'Vivo'},
'55679980':{'en': 'Vivo'},
'556499606':{'en': 'Vivo'},
'7908608':{'en': 'Tele2', 'ru': 'Tele2'},
'556699619':{'en': 'Vivo'},
'7908605':{'en': 'Tele2', 'ru': 'Tele2'},
'7908604':{'en': 'Tele2', 'ru': 'Tele2'},
'7908607':{'en': 'Tele2', 'ru': 'Tele2'},
'7908606':{'en': 'Tele2', 'ru': 'Tele2'},
'7908601':{'en': 'Tele2', 'ru': 'Tele2'},
'7908600':{'en': 'Tele2', 'ru': 'Tele2'},
'7908603':{'en': 'Tele2', 'ru': 'Tele2'},
'7908602':{'en': 'Tele2', 'ru': 'Tele2'},
'556499959':{'en': 'Vivo'},
'556499958':{'en': 'Vivo'},
'559498148':{'en': 'TIM'},
'559498149':{'en': 'TIM'},
'556499955':{'en': 'Vivo'},
'556499954':{'en': 'Vivo'},
'556499957':{'en': 'Vivo'},
'556499956':{'en': 'Vivo'},
'556499951':{'en': 'Vivo'},
'559498143':{'en': 'TIM'},
'556499953':{'en': 'Vivo'},
'556499952':{'en': 'Vivo'},
'8536678':{'en': 'SmarTone'},
'8536679':{'en': 'CTM'},
'8536672':{'en': 'CTM'},
'8536673':{'en': 'SmarTone'},
'8536670':{'en': 'China Telecom'},
'8536671':{'en': 'China Telecom'},
'8536676':{'en': '3'},
'8536677':{'en': 'CTM'},
'8536674':{'en': '3'},
'8536675':{'en': 'CTM'},
'555499927':{'en': 'Vivo'},
'555499926':{'en': 'Vivo'},
'555499925':{'en': 'Vivo'},
'555499924':{'en': 'Vivo'},
'555499923':{'en': 'Vivo'},
'555499922':{'en': 'Vivo'},
'555499921':{'en': 'Vivo'},
'555499929':{'en': 'Vivo'},
'555499928':{'en': 'Vivo'},
'556298129':{'en': 'TIM'},
'556298128':{'en': 'TIM'},
'556199828':{'en': 'Vivo'},
'556199829':{'en': 'Vivo'},
'556298121':{'en': 'TIM'},
'556199827':{'en': 'Vivo'},
'556199824':{'en': 'Vivo'},
'556199825':{'en': 'Vivo'},
'556298125':{'en': 'TIM'},
'556298124':{'en': 'TIM'},
'556298127':{'en': 'TIM'},
'556298126':{'en': 'TIM'},
'85598':{'en': 'Smart'},
'554798423':{'en': 'Brasil Telecom GSM'},
'85590':{'en': 'Beeline'},
'85592':{'en': 'Cellcard'},
'85593':{'en': 'Smart'},
'85595':{'en': 'Cellcard'},
'85596':{'en': 'Smart'},
'556399958':{'en': 'Vivo'},
'556399959':{'en': 'Vivo'},
'622992':{'en': 'Esia'},
'556399951':{'en': 'Vivo'},
'556399952':{'en': 'Vivo'},
'556399953':{'en': 'Vivo'},
'556399954':{'en': 'Vivo'},
'556399955':{'en': 'Vivo'},
'556399956':{'en': 'Vivo'},
'556399957':{'en': 'Vivo'},
'658418':{'en': 'M1'},
'62380404':{'en': 'Esia'},
'658419':{'en': 'M1'},
'62380401':{'en': 'Esia'},
'62380400':{'en': 'Esia'},
'62380403':{'en': 'Esia'},
'62380402':{'en': 'Esia'},
'658416':{'en': 'M1'},
'658417':{'en': 'M1'},
'9053':{'en': 'Turkcell'},
'9054':{'en': 'Vodafone'},
'8525542':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'6233399':{'en': 'Esia'},
'556498441':{'en': 'Brasil Telecom GSM'},
'556899942':{'en': 'Vivo'},
'556899943':{'en': 'Vivo'},
'7952725':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'556899941':{'en': 'Vivo'},
'556899946':{'en': 'Vivo'},
'556899947':{'en': 'Vivo'},
'556899944':{'en': 'Vivo'},
'556899945':{'en': 'Vivo'},
'658405':{'en': 'SingTel'},
'658404':{'en': 'SingTel'},
'556899948':{'en': 'Vivo'},
'556899949':{'en': 'Vivo'},
'658401':{'en': 'SingTel'},
'658400':{'en': 'StarHub'},
'658403':{'en': 'SingTel'},
'658402':{'en': 'SingTel'},
'62341682':{'en': 'Esia'},
'557199941':{'en': 'Vivo'},
'557199942':{'en': 'Vivo'},
'557199943':{'en': 'Vivo'},
'557199944':{'en': 'Vivo'},
'557199945':{'en': 'Vivo'},
'557199946':{'en': 'Vivo'},
'557199947':{'en': 'Vivo'},
'557199948':{'en': 'Vivo'},
'557199949':{'en': 'Vivo'},
'62341683':{'en': 'Esia'},
'7904942':{'en': 'Tele2', 'ru': 'Tele2'},
'60102':{'en': 'DiGi'},
'799621':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799620':{'en': 'Tele2', 'ru': 'Tele2'},
'799623':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799622':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'8536884':{'en': 'CTM'},
'68987':{'en': 'Vini'},
'68989':{'en': 'Vodafone'},
'601126':{'en': 'DiGi'},
'555598419':{'en': 'Brasil Telecom GSM'},
'555598418':{'en': 'Brasil Telecom GSM'},
'555598417':{'en': 'Brasil Telecom GSM'},
'555598416':{'en': 'Brasil Telecom GSM'},
'555598415':{'en': 'Brasil Telecom GSM'},
'555598414':{'en': 'Brasil Telecom GSM'},
'555598413':{'en': 'Brasil Telecom GSM'},
'555598412':{'en': 'Brasil Telecom GSM'},
'555598411':{'en': 'Brasil Telecom GSM'},
'59669663':{'en': 'SFR/Rife'},
'59669662':{'en': 'SFR/Rife'},
'79320':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79321':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79322':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79323':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79324':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79325':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79326':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79328':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'66801':{'en': 'AIS'},
'66800':{'en': 'AIS'},
'66803':{'en': 'True Move'},
'66802':{'en': 'AIS'},
'6018798':{'en': 'YTL'},
'6018799':{'en': 'YTL'},
'66806':{'en': 'AIS'},
'6018794':{'en': 'U Mobile'},
'6018795':{'en': 'YTL'},
'6018796':{'en': 'YTL'},
'6018797':{'en': 'YTL'},
'6018790':{'en': 'U Mobile'},
'6018791':{'en': 'U Mobile'},
'6018792':{'en': 'U Mobile'},
'6018793':{'en': 'U Mobile'},
'601122':{'en': 'Clixster'},
'55459910':{'en': 'Vivo'},
'7904739':{'en': 'MTS', 'ru': 'MTS'},
'7904738':{'en': 'MTS', 'ru': 'MTS'},
'7904735':{'en': 'MTS', 'ru': 'MTS'},
'7904734':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904737':{'en': 'MTS', 'ru': 'MTS'},
'7904736':{'en': 'MTS', 'ru': 'MTS'},
'7904731':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904730':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904733':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904732':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902513':{'en': 'Tele2', 'ru': 'Tele2'},
'614791':{'en': 'Optus'},
'614790':{'en': 'Optus'},
'799633':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902512':{'en': 'Tele2', 'ru': 'Tele2'},
'7902550':{'en': 'Tele2', 'ru': 'Tele2'},
'62335998':{'en': 'Esia'},
'6866':{'en': 'Ocean Link'},
'6867':{'en': 'ATHKL'},
'7902511':{'en': 'Tele2', 'ru': 'Tele2'},
'7902510':{'en': 'Tele2', 'ru': 'Tele2'},
'63976':{'en': 'Globe'},
'63975':{'en': 'Globe'},
'7958574':{'en': 'Tele2', 'ru': 'Tele2'},
'790890':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7958572':{'en': 'Tele2', 'ru': 'Tele2'},
'7958573':{'en': 'Tele2', 'ru': 'Tele2'},
'6221608':{'en': 'Esia'},
'6221609':{'en': 'Esia'},
'852689':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852688':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'6221604':{'en': 'Esia'},
'6221605':{'en': 'Esia'},
'852685':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'6221607':{'en': 'Esia'},
'852682':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'6221602':{'en': 'Esia'},
'6221603':{'en': 'Esia'},
'558799938':{'en': 'TIM'},
'558799939':{'en': 'TIM'},
'790897':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'55499884':{'en': 'Claro BR'},
'558799931':{'en': 'TIM'},
'558799932':{'en': 'TIM'},
'558799933':{'en': 'TIM'},
'558799934':{'en': 'TIM'},
'558799935':{'en': 'TIM'},
'558799936':{'en': 'TIM'},
'558799937':{'en': 'TIM'},
'595991':{'en': 'Claro'},
'852607':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'595993':{'en': 'Claro'},
'595992':{'en': 'Claro'},
'595995':{'en': 'Claro'},
'595994':{'en': 'Claro'},
'852606':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'5698106':{'en': 'WOM'},
'5698107':{'en': 'WOM'},
'852603':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'5698101':{'en': 'Viva'},
'852979':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852978':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852601':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852971':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852970':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852973':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852972':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852975':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852974':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852977':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852976':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8536584':{'en': 'China Telecom'},
'790479':{'en': 'Tele2', 'ru': 'Tele2'},
'790478':{'en': 'Tele2', 'ru': 'Tele2'},
'5698108':{'en': 'WOM'},
'790470':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790477':{'en': 'Tele2', 'ru': 'Tele2'},
'790476':{'en': 'Tele2', 'ru': 'Tele2'},
'790475':{'en': 'Tele2', 'ru': 'Tele2'},
'5698109':{'en': 'WOM'},
'558199374':{'en': 'Claro BR'},
'558199375':{'en': 'Claro BR'},
'569965':{'en': 'Movistar'},
'569964':{'en': 'Movistar'},
'558199370':{'en': 'Claro BR'},
'558199371':{'en': 'Claro BR'},
'558199372':{'en': 'Claro BR'},
'558199373':{'en': 'Claro BR'},
'852608':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'569969':{'en': 'Entel'},
'8536531':{'en': 'CTM'},
'8536530':{'en': 'CTM'},
'8536533':{'en': '3'},
'8536532':{'en': '3'},
'8536535':{'en': '3'},
'8536534':{'en': '3'},
'8536537':{'en': 'CTM'},
'8536536':{'en': 'CTM'},
'8536539':{'en': 'CTM'},
'8536538':{'en': 'CTM'},
'558599639':{'en': 'TIM'},
'558599638':{'en': 'TIM'},
'659123':{'en': 'SingTel'},
'659122':{'en': 'SingTel'},
'659125':{'en': 'SingTel'},
'659124':{'en': 'SingTel'},
'659126':{'en': 'SingTel'},
'558599631':{'en': 'TIM'},
'6226491':{'en': 'Esia'},
'558599633':{'en': 'TIM'},
'558599632':{'en': 'TIM'},
'558599635':{'en': 'TIM'},
'558599634':{'en': 'TIM'},
'558599637':{'en': 'TIM'},
'558599636':{'en': 'TIM'},
'556898408':{'en': 'Brasil Telecom GSM'},
'556898409':{'en': 'Brasil Telecom GSM'},
'556898404':{'en': 'Brasil Telecom GSM'},
'556898405':{'en': 'Brasil Telecom GSM'},
'556898406':{'en': 'Brasil Telecom GSM'},
'556898407':{'en': 'Brasil Telecom GSM'},
'556898401':{'en': 'Brasil Telecom GSM'},
'556898402':{'en': 'Brasil Telecom GSM'},
'556898403':{'en': 'Brasil Telecom GSM'},
'557199209':{'en': 'TIM'},
'557199208':{'en': 'TIM'},
'557199207':{'en': 'TIM'},
'557199206':{'en': 'TIM'},
'557199205':{'en': 'TIM'},
'557199204':{'en': 'TIM'},
'557199203':{'en': 'TIM'},
'557199202':{'en': 'TIM'},
'557199201':{'en': 'TIM'},
'569769':{'en': 'Claro'},
'559899158':{'en': 'Vivo'},
'554899619':{'en': 'TIM'},
'559899156':{'en': 'Vivo'},
'559899157':{'en': 'Vivo'},
'559899154':{'en': 'Vivo'},
'559899155':{'en': 'Vivo'},
'559899152':{'en': 'Vivo'},
'559899153':{'en': 'Vivo'},
'559899151':{'en': 'Vivo'},
'556198182':{'en': 'TIM'},
'556198183':{'en': 'TIM'},
'556198181':{'en': 'TIM'},
'556198186':{'en': 'TIM'},
'556198187':{'en': 'TIM'},
'556198184':{'en': 'TIM'},
'556198185':{'en': 'TIM'},
'556198188':{'en': 'TIM'},
'556198189':{'en': 'TIM'},
'559798121':{'en': 'TIM'},
'569742':{'en': 'Movistar'},
'569741':{'en': 'Movistar'},
'569740':{'en': 'Claro'},
'569747':{'en': 'Movistar'},
'569746':{'en': 'Movistar'},
'569745':{'en': 'Movistar'},
'569744':{'en': 'Movistar'},
'60154805':{'en': 'Offisgate'},
'569749':{'en': 'Movistar'},
'569748':{'en': 'Movistar'},
'60154801':{'en': 'Telekom'},
'60154802':{'en': 'ARL'},
'559499970':{'en': 'Oi'},
'569761':{'en': 'Movistar'},
'559999108':{'en': 'Vivo'},
'559499973':{'en': 'Oi'},
'559499974':{'en': 'Oi'},
'559499975':{'en': 'Oi'},
'559499953':{'en': 'Oi'},
'559999102':{'en': 'Vivo'},
'559499979':{'en': 'Oi'},
'559999101':{'en': 'Vivo'},
'559999106':{'en': 'Vivo'},
'569763':{'en': 'Movistar'},
'559999104':{'en': 'Vivo'},
'559999105':{'en': 'Vivo'},
'658610':{'en': 'SingTel'},
'658611':{'en': 'M1'},
'658612':{'en': 'M1'},
'554899613':{'en': 'TIM'},
'658614':{'en': 'M1'},
'658615':{'en': 'SingTel'},
'658616':{'en': 'SingTel'},
'658617':{'en': 'SingTel'},
'658618':{'en': 'SingTel'},
'554899614':{'en': 'TIM'},
'8525746':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'8525747':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'569764':{'en': 'Entel'},
'556199628':{'en': 'Vivo'},
'569767':{'en': 'Claro'},
'556199629':{'en': 'Vivo'},
'62736402':{'en': 'Esia'},
'554899617':{'en': 'TIM'},
'556699968':{'en': 'Vivo'},
'556699969':{'en': 'Vivo'},
'556699966':{'en': 'Vivo'},
'556699967':{'en': 'Vivo'},
'556699964':{'en': 'Vivo'},
'556699965':{'en': 'Vivo'},
'556699962':{'en': 'Vivo'},
'556699963':{'en': 'Vivo'},
'556699961':{'en': 'Vivo'},
'8536346':{'en': 'CTM'},
'62736403':{'en': 'Esia'},
'8536655':{'en': 'CTM'},
'658630':{'en': 'M1'},
'6011588':{'en': 'XOX'},
'556998456':{'en': 'Brasil Telecom GSM'},
'6011586':{'en': 'XOX'},
'6011587':{'en': 'XOX'},
'6011584':{'en': 'YTL'},
'6011585':{'en': 'XOX'},
'6011582':{'en': 'YTL'},
'6011583':{'en': 'YTL'},
'6011580':{'en': 'YTL'},
'6011581':{'en': 'YTL'},
'8536656':{'en': '3'},
'84898':{'en': 'MobiFone'},
'84899':{'en': 'MobiFone'},
'7902552':{'en': 'Tele2', 'ru': 'Tele2'},
'59069043':{'en': 'Digicel'},
'59069042':{'en': 'Digicel'},
'554599125':{'en': 'Vivo'},
'554599124':{'en': 'Vivo'},
'554599127':{'en': 'Vivo'},
'554599126':{'en': 'Vivo'},
'554599121':{'en': 'Vivo'},
'554599123':{'en': 'Vivo'},
'554599122':{'en': 'Vivo'},
'554599129':{'en': 'Vivo'},
'554599128':{'en': 'Vivo'},
'554598838':{'en': 'Claro BR'},
'554598839':{'en': 'Claro BR'},
'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'},
'59069049':{'en': 'Orange'},
'59069048':{'en': 'Orange'},
'62435989':{'en': 'Esia'},
'62435988':{'en': 'Esia'},
'5591991':{'en': 'Vivo'},
'7901240':{'en': 'Tele2', 'ru': 'Tele2'},
'7901241':{'en': 'Tele2', 'ru': 'Tele2'},
'62435985':{'en': 'Esia'},
'62435987':{'en': 'Esia'},
'62435986':{'en': 'Esia'},
'61417':{'en': 'Telstra'},
'61416':{'en': 'Vodafone'},
'61415':{'en': 'Vodafone'},
'61414':{'en': 'Vodafone'},
'61413':{'en': 'Optus'},
'61412':{'en': 'Optus'},
'61411':{'en': 'Optus'},
'61410':{'en': 'Vodafone'},
'7908373':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908375':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7908374':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'61419':{'en': 'Telstra'},
'61418':{'en': 'Telstra'},
'556699908':{'en': 'Vivo'},
'556699909':{'en': 'Vivo'},
'62852':{'en': 'Telkomsel'},
'555499949':{'en': 'Vivo'},
'555499948':{'en': 'Vivo'},
'62853':{'en': 'Telkomsel'},
'555499945':{'en': 'Vivo'},
'555499944':{'en': 'Vivo'},
'555499947':{'en': 'Vivo'},
'555499946':{'en': 'Vivo'},
'555499941':{'en': 'Vivo'},
'7900557':{'en': 'Tele2', 'ru': 'Tele2'},
'555499943':{'en': 'Vivo'},
'555499942':{'en': 'Vivo'},
'62851':{'en': 'Telkomsel'},
'7900551':{'en': 'Tele2', 'ru': 'Tele2'},
'55859999':{'en': 'TIM'},
'556699902':{'en': 'Vivo'},
'62857':{'en': 'IM3'},
'556199804':{'en': 'Vivo'},
'556199805':{'en': 'Vivo'},
'556199806':{'en': 'Vivo'},
'556199807':{'en': 'Vivo'},
'556199801':{'en': 'Vivo'},
'559399199':{'en': 'Vivo'},
'559399198':{'en': 'Vivo'},
'559399197':{'en': 'Vivo'},
'559399196':{'en': 'Vivo'},
'559399195':{'en': 'Vivo'},
'559399194':{'en': 'Vivo'},
'559399193':{'en': 'Vivo'},
'559399192':{'en': 'Vivo'},
'556298101':{'en': 'TIM'},
'6275298':{'en': 'Esia'},
'8525906':{'en': '21Vianet', 'zh': '21Vianet', 'zh_Hant': '21Vianet'},
'62858':{'en': 'IM3'},
'62859':{'en': 'XL'},
'7900559':{'en': 'Tele2', 'ru': 'Tele2'},
'7900558':{'en': 'Tele2', 'ru': 'Tele2'},
'7900197':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900199':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900198':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'6228391':{'en': 'Esia'},
'6228399':{'en': 'Esia'},
'558599402':{'en': 'Claro BR'},
'558599403':{'en': 'Claro BR'},
'6221413':{'en': 'Esia'},
'558599401':{'en': 'Claro BR'},
'6221415':{'en': 'Esia'},
'6221414':{'en': 'Esia'},
'558599404':{'en': 'Claro BR'},
'6221416':{'en': 'Esia'},
'7900379':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'6221418':{'en': 'Esia'},
'556899968':{'en': 'Vivo'},
'556899969':{'en': 'Vivo'},
'554998418':{'en': 'Brasil Telecom GSM'},
'559299395':{'en': 'Vivo'},
'559299392':{'en': 'Vivo'},
'559299393':{'en': 'Vivo'},
'559299390':{'en': 'Vivo'},
'559299391':{'en': 'Vivo'},
'554998412':{'en': 'Brasil Telecom GSM'},
'554998413':{'en': 'Brasil Telecom GSM'},
'556899962':{'en': 'Vivo'},
'556899963':{'en': 'Vivo'},
'554998416':{'en': 'Brasil Telecom GSM'},
'554998417':{'en': 'Brasil Telecom GSM'},
'554998414':{'en': 'Brasil Telecom GSM'},
'554998415':{'en': 'Brasil Telecom GSM'},
'85586':{'en': 'Smart'},
'557199926':{'en': 'Vivo'},
'557199927':{'en': 'Vivo'},
'557199924':{'en': 'Vivo'},
'557199925':{'en': 'Vivo'},
'557199922':{'en': 'Vivo'},
'557199923':{'en': 'Vivo'},
'5584999':{'en': 'TIM'},
'557199921':{'en': 'Vivo'},
'5584991':{'en': 'Claro BR'},
'557199929':{'en': 'Vivo'},
'799609':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799608':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799607':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799606':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799605':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799604':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799603':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799602':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799600':{'en': 'Tele2', 'ru': 'Tele2'},
'554898442':{'en': 'Brasil Telecom GSM'},
'554898443':{'en': 'Brasil Telecom GSM'},
'554898441':{'en': 'Brasil Telecom GSM'},
'554898446':{'en': 'Brasil Telecom GSM'},
'554898447':{'en': 'Brasil Telecom GSM'},
'554898444':{'en': 'Brasil Telecom GSM'},
'554898445':{'en': 'Brasil Telecom GSM'},
'7958837':{'en': 'Tele2', 'ru': 'Tele2'},
'7958836':{'en': 'Tele2', 'ru': 'Tele2'},
'554898448':{'en': 'Brasil Telecom GSM'},
'554898449':{'en': 'Brasil Telecom GSM'},
'554899123':{'en': 'Vivo'},
'6015632':{'en': 'Majlis Keselamatan Negara'},
'6254291':{'en': 'Esia'},
'67663':{'en': 'U-Call'},
'67666':{'en': 'U-Call'},
'67667':{'en': 'U-Call'},
'67664':{'en': 'U-Call'},
'67665':{'en': 'U-Call'},
'6273599':{'en': 'Esia'},
'67669':{'en': 'U-Call'},
'554799952':{'en': 'TIM'},
'554799953':{'en': 'TIM'},
'554799951':{'en': 'TIM'},
'554799956':{'en': 'TIM'},
'554799957':{'en': 'TIM'},
'554799954':{'en': 'TIM'},
'554799955':{'en': 'TIM'},
'5699961':{'en': 'Movistar'},
'5699960':{'en': 'Movistar'},
'554799958':{'en': 'TIM'},
'554799959':{'en': 'TIM'},
'5699965':{'en': 'Entel'},
'5699964':{'en': 'Movistar'},
'5699967':{'en': 'Entel'},
'5699966':{'en': 'Entel'},
'554899126':{'en': 'Vivo'},
'7901138':{'en': 'Tele2', 'ru': 'Tele2'},
'62342999':{'en': 'Esia'},
'62342998':{'en': 'Esia'},
'7900973':{'en': 'Tele2', 'ru': 'Tele2'},
'7900972':{'en': 'Tele2', 'ru': 'Tele2'},
'62333988':{'en': 'Esia'},
'62333989':{'en': 'Esia'},
'62333986':{'en': 'Esia'},
'62333987':{'en': 'Esia'},
'62333985':{'en': 'Esia'},
'62342995':{'en': 'Esia'},
'62342997':{'en': 'Esia'},
'62342996':{'en': 'Esia'},
'7900371':{'en': 'Tele2', 'ru': 'Tele2'},
'658830':{'en': 'StarHub'},
'658831':{'en': 'StarHub'},
'7900370':{'en': 'Tele2', 'ru': 'Tele2'},
'658833':{'en': 'M1'},
'559999902':{'en': 'Oi'},
'559999903':{'en': 'Oi'},
'559999901':{'en': 'Oi'},
'559999904':{'en': 'Oi'},
'559999905':{'en': 'Oi'},
'554899939':{'en': 'TIM'},
'554899938':{'en': 'TIM'},
'556598452':{'en': 'Brasil Telecom GSM'},
'556598453':{'en': 'Brasil Telecom GSM'},
'556598454':{'en': 'Brasil Telecom GSM'},
'556598455':{'en': 'Brasil Telecom GSM'},
'556598456':{'en': 'Brasil Telecom GSM'},
'556598457':{'en': 'Brasil Telecom GSM'},
'554899931':{'en': 'TIM'},
'554899933':{'en': 'TIM'},
'554899932':{'en': 'TIM'},
'554899935':{'en': 'TIM'},
'554899934':{'en': 'TIM'},
'554899937':{'en': 'TIM'},
'554899936':{'en': 'TIM'},
'62334989':{'en': 'Esia'},
'62334988':{'en': 'Esia'},
'62334987':{'en': 'Esia'},
'62334986':{'en': 'Esia'},
'62334985':{'en': 'Esia'},
'7900375':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900374':{'en': 'Tele2', 'ru': 'Tele2'},
'852953':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852952':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852951':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852950':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852957':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852956':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852955':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852954':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852958':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'7900377':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'63955':{'en': 'Globe'},
'63956':{'en': 'Globe'},
'63950':{'en': 'Smart'},
'62284911':{'en': 'Esia'},
'62213433':{'en': 'Esia'},
'62213432':{'en': 'Esia'},
'62213431':{'en': 'Esia'},
'62213430':{'en': 'Esia'},
'62213434':{'en': 'Esia'},
'569901':{'en': 'Movistar'},
'569900':{'en': 'Claro'},
'569903':{'en': 'Movistar'},
'569905':{'en': 'Claro'},
'569907':{'en': 'Entel'},
'569906':{'en': 'Claro'},
'569909':{'en': 'Entel'},
'569908':{'en': 'Entel'},
'5939836':{'en': 'Claro'},
'556698125':{'en': 'TIM'},
'556698124':{'en': 'TIM'},
'556698127':{'en': 'TIM'},
'556698126':{'en': 'TIM'},
'556698121':{'en': 'TIM'},
'556698123':{'en': 'TIM'},
'556698122':{'en': 'TIM'},
'8536553':{'en': 'CTM'},
'8536552':{'en': 'CTM'},
'8536551':{'en': 'CTM'},
'658855':{'en': 'M1'},
'556698129':{'en': 'TIM'},
'556698128':{'en': 'TIM'},
'8536555':{'en': 'CTM'},
'8536554':{'en': 'CTM'},
'558599619':{'en': 'TIM'},
'558599618':{'en': 'TIM'},
'558599617':{'en': 'TIM'},
'558599616':{'en': 'TIM'},
'558599615':{'en': 'TIM'},
'558599614':{'en': 'TIM'},
'558599613':{'en': 'TIM'},
'558599612':{'en': 'TIM'},
'558599611':{'en': 'TIM'},
'6223492':{'en': 'Esia'},
'6223491':{'en': 'Esia'},
'554899184':{'en': 'Vivo'},
'557199265':{'en': 'TIM'},
'557199264':{'en': 'TIM'},
'557199267':{'en': 'TIM'},
'557199266':{'en': 'TIM'},
'557199261':{'en': 'TIM'},
'557199263':{'en': 'TIM'},
'557199262':{'en': 'TIM'},
'659811':{'en': 'SingTel'},
'659810':{'en': 'SingTel'},
'659813':{'en': 'StarHub'},
'659812':{'en': 'SingTel'},
'557199269':{'en': 'TIM'},
'557199268':{'en': 'TIM'},
'659817':{'en': 'SingTel'},
'659816':{'en': 'SingTel'},
'6011245':{'en': 'Celcom'},
'6011244':{'en': 'Maxis'},
'6011247':{'en': 'Celcom'},
'559899174':{'en': 'Vivo'},
'559899175':{'en': 'Vivo'},
'559899176':{'en': 'Vivo'},
'559899177':{'en': 'Vivo'},
'559899171':{'en': 'Vivo'},
'559899172':{'en': 'Vivo'},
'559899173':{'en': 'Vivo'},
'6011241':{'en': 'Maxis'},
'559899178':{'en': 'Vivo'},
'559899179':{'en': 'Vivo'},
'6011240':{'en': 'Maxis'},
'62335996':{'en': 'Esia'},
'6011242':{'en': 'Maxis'},
'60154821':{'en': 'TT dotCom'},
'559999121':{'en': 'Vivo'},
'559999122':{'en': 'Vivo'},
'559999123':{'en': 'Vivo'},
'559999124':{'en': 'Vivo'},
'559999125':{'en': 'Vivo'},
'559999126':{'en': 'Vivo'},
'559999127':{'en': 'Vivo'},
'559999128':{'en': 'Vivo'},
'559999129':{'en': 'Vivo'},
'658678':{'en': 'SingTel'},
'658679':{'en': 'SingTel'},
'658672':{'en': 'SingTel'},
'658673':{'en': 'SingTel'},
'658670':{'en': 'SingTel'},
'658671':{'en': 'SingTel'},
'658676':{'en': 'SingTel'},
'658677':{'en': 'SingTel'},
'658674':{'en': 'SingTel'},
'658675':{'en': 'SingTel'},
'8536244':{'en': 'SmarTone'},
'86166':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'559698131':{'en': 'TIM'},
'5592991':{'en': 'Vivo'},
'559698133':{'en': 'TIM'},
'559698132':{'en': 'TIM'},
'559698135':{'en': 'TIM'},
'559698134':{'en': 'TIM'},
'799236':{'en': 'Tele2', 'ru': 'Tele2'},
'7958644':{'en': 'Tele2', 'ru': 'Tele2'},
'7958640':{'en': 'Tele2', 'ru': 'Tele2'},
'7958641':{'en': 'Tele2', 'ru': 'Tele2'},
'7958642':{'en': 'Tele2', 'ru': 'Tele2'},
'7958643':{'en': 'Tele2', 'ru': 'Tele2'},
'8536248':{'en': '3'},
'559299394':{'en': 'Vivo'},
'557499976':{'en': 'Vivo'},
'557499977':{'en': 'Vivo'},
'557499975':{'en': 'Vivo'},
'557499972':{'en': 'Vivo'},
'557499973':{'en': 'Vivo'},
'557499970':{'en': 'Vivo'},
'557499971':{'en': 'Vivo'},
'799234':{'en': 'Tele2', 'ru': 'Tele2'},
'557499978':{'en': 'Vivo'},
'557499979':{'en': 'Vivo'},
'658395':{'en': 'StarHub'},
'658715':{'en': 'M1'},
'799693':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'658714':{'en': 'M1'},
'558899625':{'en': 'TIM'},
'7901220':{'en': 'Tele2', 'ru': 'Tele2'},
'6225398':{'en': 'Esia'},
'6225399':{'en': 'Esia'},
'559599148':{'en': 'Vivo'},
'559599149':{'en': 'Vivo'},
'559599142':{'en': 'Vivo'},
'559599143':{'en': 'Vivo'},
'559599141':{'en': 'Vivo'},
'559599146':{'en': 'Vivo'},
'559599147':{'en': 'Vivo'},
'559599144':{'en': 'Vivo'},
'559599145':{'en': 'Vivo'},
'6229399':{'en': 'Esia'},
'6229391':{'en': 'Esia'},
'558899627':{'en': 'TIM'},
'5939628':{'en': 'Movistar'},
'556599918':{'en': 'Vivo'},
'556599919':{'en': 'Vivo'},
'556599912':{'en': 'Vivo'},
'556599913':{'en': 'Vivo'},
'5939623':{'en': 'CNT'},
'556599911':{'en': 'Vivo'},
'556599916':{'en': 'Vivo'},
'556599917':{'en': 'Vivo'},
'556599914':{'en': 'Vivo'},
'556599915':{'en': 'Vivo'},
'555499963':{'en': 'Vivo'},
'555499962':{'en': 'Vivo'},
'555499961':{'en': 'Vivo'},
'555499967':{'en': 'Vivo'},
'555499966':{'en': 'Vivo'},
'555499965':{'en': 'Vivo'},
'555499964':{'en': 'Vivo'},
'555499969':{'en': 'Vivo'},
'555499968':{'en': 'Vivo'},
'558899626':{'en': 'TIM'},
'7958845':{'en': 'Tele2', 'ru': 'Tele2'},
'556298165':{'en': 'TIM'},
'556298164':{'en': 'TIM'},
'556298167':{'en': 'TIM'},
'556298166':{'en': 'TIM'},
'556298161':{'en': 'TIM'},
'556298163':{'en': 'TIM'},
'556298162':{'en': 'TIM'},
'59069010':{'en': 'UTS'},
'556298169':{'en': 'TIM'},
'556298168':{'en': 'TIM'},
'555599939':{'en': 'Vivo'},
'555599938':{'en': 'Vivo'},
'555599937':{'en': 'Vivo'},
'555599936':{'en': 'Vivo'},
'555599935':{'en': 'Vivo'},
'555599934':{'en': 'Vivo'},
'555599933':{'en': 'Vivo'},
'555599932':{'en': 'Vivo'},
'555599931':{'en': 'Vivo'},
'6015882':{'en': 'Asiaspace'},
'88016':{'en': 'Airtel'},
'88017':{'en': 'Grameenphone'},
'6013':{'en': 'Celcom'},
'6012':{'en': 'Maxis'},
'6015881':{'en': 'Webe'},
'6017':{'en': 'Maxis'},
'6016':{'en': 'DiGi'},
'6019':{'en': 'Celcom'},
'88018':{'en': 'Robi'},
'88019':{'en': 'Banglalink'},
'62562994':{'en': 'Esia'},
'62562991':{'en': 'Esia'},
'556399911':{'en': 'Vivo'},
'62562993':{'en': 'Esia'},
'62562992':{'en': 'Esia'},
'559498146':{'en': 'TIM'},
'559498147':{'en': 'TIM'},
'559498144':{'en': 'TIM'},
'559498145':{'en': 'TIM'},
'62361602':{'en': 'Esia'},
'559498142':{'en': 'TIM'},
'62361600':{'en': 'Esia'},
'62361601':{'en': 'Esia'},
'62361606':{'en': 'Esia'},
'62361604':{'en': 'Esia'},
'62361605':{'en': 'Esia'},
'559498141':{'en': 'TIM'},
'790280':{'en': 'Tele2', 'ru': 'Tele2'},
'790283':{'en': 'Tele2', 'ru': 'Tele2'},
'790284':{'en': 'Tele2', 'ru': 'Tele2'},
'790285':{'en': 'Tele2', 'ru': 'Tele2'},
'790286':{'en': 'Tele2', 'ru': 'Tele2'},
'790287':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790288':{'en': 'Tele2', 'ru': 'Tele2'},
'790289':{'en': 'Tele2', 'ru': 'Tele2'},
'557199908':{'en': 'Vivo'},
'557199909':{'en': 'Vivo'},
'557199904':{'en': 'Vivo'},
'557199905':{'en': 'Vivo'},
'557199906':{'en': 'Vivo'},
'557199907':{'en': 'Vivo'},
'557199901':{'en': 'Vivo'},
'557199902':{'en': 'Vivo'},
'557199903':{'en': 'Vivo'},
'558399948':{'en': 'TIM'},
'558399941':{'en': 'TIM'},
'558399940':{'en': 'TIM'},
'558399943':{'en': 'TIM'},
'558399942':{'en': 'TIM'},
'558399945':{'en': 'TIM'},
'558399944':{'en': 'TIM'},
'558399947':{'en': 'TIM'},
'558399946':{'en': 'TIM'},
'6272199':{'en': 'Esia'},
'6272190':{'en': 'Esia'},
'6272193':{'en': 'Esia'},
'8536652':{'en': 'CTM'},
'659716':{'en': 'SingTel'},
'659714':{'en': 'SingTel'},
'659715':{'en': 'SingTel'},
'659712':{'en': 'SingTel'},
'659713':{'en': 'SingTel'},
'659710':{'en': 'SingTel'},
'659711':{'en': 'SingTel'},
'67649':{'en': 'U-Call'},
'67646':{'en': 'U-Call'},
'554799978':{'en': 'TIM'},
'554799979':{'en': 'TIM'},
'62341685':{'en': 'Esia'},
'554799971':{'en': 'TIM'},
'554799972':{'en': 'TIM'},
'558299444':{'en': 'Claro BR'},
'554799974':{'en': 'TIM'},
'554799975':{'en': 'TIM'},
'554799976':{'en': 'TIM'},
'554799977':{'en': 'TIM'},
'62341680':{'en': 'Esia'},
'62341681':{'en': 'Esia'},
'554798421':{'en': 'Brasil Telecom GSM'},
'595984':{'en': 'Tigo'},
'55779814':{'en': 'Claro BR'},
'556398133':{'en': 'TIM'},
'556398132':{'en': 'TIM'},
'55779810':{'en': 'Claro BR'},
'55779811':{'en': 'Claro BR'},
'55779812':{'en': 'Claro BR'},
'55779813':{'en': 'Claro BR'},
'556199826':{'en': 'Vivo'},
'554798422':{'en': 'Brasil Telecom GSM'},
'554798425':{'en': 'Brasil Telecom GSM'},
'556298123':{'en': 'TIM'},
'559898129':{'en': 'TIM'},
'554799608':{'en': 'TIM'},
'556298122':{'en': 'TIM'},
'554798427':{'en': 'Brasil Telecom GSM'},
'796':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'554799602':{'en': 'TIM'},
'556199822':{'en': 'Vivo'},
'601881':{'en': 'YTL'},
'554798426':{'en': 'Brasil Telecom GSM'},
'554799606':{'en': 'TIM'},
'554799607':{'en': 'TIM'},
'554799604':{'en': 'TIM'},
'556199823':{'en': 'Vivo'},
'5588988':{'en': 'Oi'},
'5588989':{'en': 'Oi'},
'556199821':{'en': 'Vivo'},
'591738':{'en': 'Entel'},
'852687':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'591736':{'en': 'Entel'},
'591730':{'en': 'Entel'},
'795320':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'795321':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'852550':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'795322':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'62295995':{'en': 'Esia'},
'556598436':{'en': 'Brasil Telecom GSM'},
'556598437':{'en': 'Brasil Telecom GSM'},
'556598434':{'en': 'Brasil Telecom GSM'},
'556598435':{'en': 'Brasil Telecom GSM'},
'556598432':{'en': 'Brasil Telecom GSM'},
'556598433':{'en': 'Brasil Telecom GSM'},
'554899919':{'en': 'TIM'},
'554899918':{'en': 'TIM'},
'554899917':{'en': 'TIM'},
'554899916':{'en': 'TIM'},
'554899915':{'en': 'TIM'},
'554899914':{'en': 'TIM'},
'554899913':{'en': 'TIM'},
'554899912':{'en': 'TIM'},
'554899911':{'en': 'TIM'},
'556598439':{'en': 'Brasil Telecom GSM'},
'557999603':{'en': 'Vivo'},
'557999602':{'en': 'Vivo'},
'557999601':{'en': 'Vivo'},
'557999600':{'en': 'Vivo'},
'557999607':{'en': 'Vivo'},
'557999606':{'en': 'Vivo'},
'557999605':{'en': 'Vivo'},
'557999604':{'en': 'Vivo'},
'6229891':{'en': 'Esia'},
'62322924':{'en': 'Esia'},
'62322922':{'en': 'Esia'},
'62322923':{'en': 'Esia'},
'62322920':{'en': 'Esia'},
'62322921':{'en': 'Esia'},
'852681':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'63932':{'en': 'Sun'},
'63933':{'en': 'Sun'},
'63930':{'en': 'Smart'},
'7908435':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'63936':{'en': 'Globe'},
'63937':{'en': 'Globe'},
'63935':{'en': 'Globe'},
'63938':{'en': 'Smart'},
'63939':{'en': 'Smart'},
'7908438':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7908439':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'569929':{'en': 'Entel'},
'622993':{'en': 'Esia'},
'559599959':{'en': 'Oi'},
'569922':{'en': 'Movistar'},
'569921':{'en': 'Entel'},
'569920':{'en': 'Claro'},
'569927':{'en': 'Movistar'},
'569926':{'en': 'Movistar'},
'569925':{'en': 'Movistar'},
'569924':{'en': 'Movistar'},
'8536575':{'en': '3'},
'8536574':{'en': '3'},
'8536577':{'en': '3'},
'622991':{'en': 'Esia'},
'8536571':{'en': 'China Telecom'},
'8536570':{'en': 'China Telecom'},
'8536573':{'en': 'China Telecom'},
'8536572':{'en': 'China Telecom'},
'622996':{'en': 'Esia'},
'8536579':{'en': '3'},
'8536578':{'en': '3'},
'556798402':{'en': 'Brasil Telecom GSM'},
'622994':{'en': 'Esia'},
'556299959':{'en': 'Vivo'},
'556299958':{'en': 'Vivo'},
'556299957':{'en': 'Vivo'},
'556299956':{'en': 'Vivo'},
'556299955':{'en': 'Vivo'},
'556299954':{'en': 'Vivo'},
'556299953':{'en': 'Vivo'},
'556299952':{'en': 'Vivo'},
'556299951':{'en': 'Vivo'},
'556798404':{'en': 'Brasil Telecom GSM'},
'558599675':{'en': 'TIM'},
'558599674':{'en': 'TIM'},
'558599677':{'en': 'TIM'},
'558599676':{'en': 'TIM'},
'558599671':{'en': 'TIM'},
'556798159':{'en': 'TIM'},
'558599673':{'en': 'TIM'},
'558599672':{'en': 'TIM'},
'556798406':{'en': 'Brasil Telecom GSM'},
'556798157':{'en': 'TIM'},
'556798156':{'en': 'TIM'},
'7950666':{'en': 'TMT', 'ru': 'TMT'},
'7950667':{'en': 'TMT', 'ru': 'TMT'},
'795106':{'en': 'Tele2', 'ru': 'Tele2'},
'7950665':{'en': 'TMT', 'ru': 'TMT'},
'795100':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'795101':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'795102':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'795103':{'en': 'Tele2', 'ru': 'Tele2'},
'6254190':{'en': 'Esia'},
'795108':{'en': 'Tele2', 'ru': 'Tele2'},
'795109':{'en': 'Tele2', 'ru': 'Tele2'},
'7950668':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'6254191':{'en': 'Esia'},
'6254192':{'en': 'Esia'},
'5599988':{'en': 'Oi'},
'5599989':{'en': 'Oi'},
'5599986':{'en': 'Oi'},
'5599987':{'en': 'Oi'},
'62911999':{'en': 'Esia'},
'5599985':{'en': 'Oi'},
'658388':{'en': 'M1'},
'658389':{'en': 'StarHub'},
'658382':{'en': 'M1'},
'658383':{'en': 'M1'},
'658380':{'en': 'StarHub'},
'658381':{'en': 'SingTel'},
'658386':{'en': 'SingTel'},
'658387':{'en': 'SingTel'},
'658384':{'en': 'StarHub'},
'658385':{'en': 'SingTel'},
'556498129':{'en': 'TIM'},
'556498128':{'en': 'TIM'},
'556498123':{'en': 'TIM'},
'556498122':{'en': 'TIM'},
'556498121':{'en': 'TIM'},
'556498127':{'en': 'TIM'},
'556498126':{'en': 'TIM'},
'556498125':{'en': 'TIM'},
'556498124':{'en': 'TIM'},
'559999146':{'en': 'Vivo'},
'559999147':{'en': 'Vivo'},
'559999144':{'en': 'Vivo'},
'559999145':{'en': 'Vivo'},
'559999142':{'en': 'Vivo'},
'559999143':{'en': 'Vivo'},
'658652':{'en': 'SingTel'},
'559999141':{'en': 'Vivo'},
'658658':{'en': 'StarHub'},
'658659':{'en': 'StarHub'},
'559999148':{'en': 'Vivo'},
'559999149':{'en': 'Vivo'},
'8536650':{'en': 'CTM'},
'62335999':{'en': 'Esia'},
'557199249':{'en': 'TIM'},
'557199248':{'en': 'TIM'},
'557199243':{'en': 'TIM'},
'557199242':{'en': 'TIM'},
'557199241':{'en': 'TIM'},
'557199247':{'en': 'TIM'},
'557199246':{'en': 'TIM'},
'557199245':{'en': 'TIM'},
'557199244':{'en': 'TIM'},
'86188':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86189':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86186':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86187':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86184':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86185':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86182':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86183':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86180':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86181':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'559698117':{'en': 'TIM'},
'559698116':{'en': 'TIM'},
'559698115':{'en': 'TIM'},
'559698114':{'en': 'TIM'},
'559698113':{'en': 'TIM'},
'559698112':{'en': 'TIM'},
'559698111':{'en': 'TIM'},
'62335997':{'en': 'Esia'},
'559698119':{'en': 'TIM'},
'559698118':{'en': 'TIM'},
'569787':{'en': 'Entel'},
'569786':{'en': 'Claro'},
'569785':{'en': 'Claro'},
'569784':{'en': 'Claro'},
'569783':{'en': 'Claro'},
'569782':{'en': 'Claro'},
'569781':{'en': 'Claro'},
'569780':{'en': 'Entel'},
'7958667':{'en': 'Tele2', 'ru': 'Tele2'},
'6223194':{'en': 'Esia'},
'569789':{'en': 'Entel'},
'569788':{'en': 'Entel'},
'558999972':{'en': 'TIM'},
'558999973':{'en': 'TIM'},
'6223192':{'en': 'Esia'},
'6223193':{'en': 'Esia'},
'556499658':{'en': 'Vivo'},
'556499652':{'en': 'Vivo'},
'556499653':{'en': 'Vivo'},
'6223191':{'en': 'Esia'},
'556499654':{'en': 'Vivo'},
'556499655':{'en': 'Vivo'},
'8536852':{'en': '3'},
'799221':{'en': 'Tele2', 'ru': 'Tele2'},
'8493':{'en': 'MobiFone'},
'8492':{'en': 'Vietnamobile'},
'8491':{'en': 'Vinaphone'},
'8490':{'en': 'MobiFone'},
'8497':{'en': 'Viettel'},
'8496':{'en': 'Viettel'},
'8494':{'en': 'Vinaphone'},
'8498':{'en': 'Viettel'},
'8536854':{'en': '3'},
'559299907':{'en': 'Oi'},
'559299906':{'en': 'Oi'},
'559299905':{'en': 'Oi'},
'559299904':{'en': 'Oi'},
'559299903':{'en': 'Oi'},
'559299902':{'en': 'Oi'},
'559299901':{'en': 'Oi'},
'559898461':{'en': 'Claro BR'},
'559898460':{'en': 'Claro BR'},
'559299909':{'en': 'Oi'},
'559299908':{'en': 'Oi'},
'555399962':{'en': 'Vivo'},
'7900372':{'en': 'Tele2', 'ru': 'Tele2'},
'555399963':{'en': 'Vivo'},
'7901201':{'en': 'Tele2', 'ru': 'Tele2'},
'7900900':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559599161':{'en': 'Vivo'},
'559599162':{'en': 'Vivo'},
'559599163':{'en': 'Vivo'},
'559599164':{'en': 'Vivo'},
'559599165':{'en': 'Vivo'},
'559599166':{'en': 'Vivo'},
'559599167':{'en': 'Vivo'},
'559599168':{'en': 'Vivo'},
'555399965':{'en': 'Vivo'},
'55749812':{'en': 'Claro BR'},
'556599931':{'en': 'Vivo'},
'556599932':{'en': 'Vivo'},
'556599933':{'en': 'Vivo'},
'556599934':{'en': 'Vivo'},
'556599935':{'en': 'Vivo'},
'556599936':{'en': 'Vivo'},
'556599937':{'en': 'Vivo'},
'556599938':{'en': 'Vivo'},
'556599939':{'en': 'Vivo'},
'8536380':{'en': '3'},
'8536381':{'en': '3'},
'8536386':{'en': 'China Telecom'},
'8536387':{'en': 'China Telecom'},
'8536384':{'en': '3'},
'8536385':{'en': '3'},
'556499618':{'en': 'Vivo'},
'59069036':{'en': 'Digicel'},
'555599955':{'en': 'Vivo'},
'555599954':{'en': 'Vivo'},
'555599957':{'en': 'Vivo'},
'555599956':{'en': 'Vivo'},
'555599951':{'en': 'Vivo'},
'555599953':{'en': 'Vivo'},
'555599952':{'en': 'Vivo'},
'555599959':{'en': 'Vivo'},
'555599958':{'en': 'Vivo'},
'7900970':{'en': 'Tele2', 'ru': 'Tele2'},
'658409':{'en': 'SingTel'},
'658408':{'en': 'SingTel'},
'559598412':{'en': 'Claro BR'},
'559598411':{'en': 'Claro BR'},
'559598410':{'en': 'Claro BR'},
'658407':{'en': 'SingTel'},
'7900335':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900334':{'en': 'Tele2', 'ru': 'Tele2'},
'7900337':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'658406':{'en': 'SingTel'},
'7900331':{'en': 'Tele2', 'ru': 'Tele2'},
'7900330':{'en': 'Tele2', 'ru': 'Tele2'},
'7900333':{'en': 'Tele2', 'ru': 'Tele2'},
'7900332':{'en': 'Tele2', 'ru': 'Tele2'},
'8536818':{'en': 'SmarTone'},
'558599444':{'en': 'Claro BR'},
'7900339':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900338':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'556298149':{'en': 'TIM'},
'556298148':{'en': 'TIM'},
'556298143':{'en': 'TIM'},
'556298142':{'en': 'TIM'},
'556298141':{'en': 'TIM'},
'556298147':{'en': 'TIM'},
'556298146':{'en': 'TIM'},
'556298145':{'en': 'TIM'},
'556298144':{'en': 'TIM'},
'658469':{'en': 'M1'},
'658468':{'en': 'StarHub'},
'658463':{'en': 'M1'},
'658462':{'en': 'M1'},
'658461':{'en': 'M1'},
'658460':{'en': 'M1'},
'658467':{'en': 'M1'},
'658466':{'en': 'M1'},
'658465':{'en': 'M1'},
'658464':{'en': 'M1'},
'569923':{'en': 'Movistar'},
'5939920':{'en': 'Claro'},
'7902557':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'5939921':{'en': 'Claro'},
'799135':{'en': 'Tele2', 'ru': 'Tele2'},
'799137':{'en': 'Tele2', 'ru': 'Tele2'},
'799136':{'en': 'Tele2', 'ru': 'Tele2'},
'799132':{'en': 'Tele2', 'ru': 'Tele2'},
'799139':{'en': 'Tele2', 'ru': 'Tele2'},
'799138':{'en': 'Tele2', 'ru': 'Tele2'},
'7902556':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'62896':{'en': '3'},
'62897':{'en': '3'},
'62895':{'en': 'Hutchison'},
'554898408':{'en': 'Brasil Telecom GSM'},
'554898409':{'en': 'Brasil Telecom GSM'},
'554898406':{'en': 'Brasil Telecom GSM'},
'554898407':{'en': 'Brasil Telecom GSM'},
'554898404':{'en': 'Brasil Telecom GSM'},
'554898405':{'en': 'Brasil Telecom GSM'},
'554898402':{'en': 'Brasil Telecom GSM'},
'554898403':{'en': 'Brasil Telecom GSM'},
'62898':{'en': '3'},
'554898401':{'en': 'Brasil Telecom GSM'},
'5939929':{'en': 'Movistar'},
'7902555':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'8536819':{'en': 'SmarTone'},
'7902554':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'79382':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79383':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79380':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'59669727':{'en': 'Digicel'},
'79384':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'675775':{'en': 'Telikom'},
'8536816':{'en': 'SmarTone'},
'79388':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79389':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902553':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'559699181':{'en': 'Vivo'},
'62272904':{'en': 'Esia'},
'555398132':{'en': 'TIM'},
'555398133':{'en': 'TIM'},
'555398131':{'en': 'TIM'},
'555398136':{'en': 'TIM'},
'555398137':{'en': 'TIM'},
'555398134':{'en': 'TIM'},
'555398135':{'en': 'TIM'},
'555398138':{'en': 'TIM'},
'555398139':{'en': 'TIM'},
'5699381':{'en': 'Movistar'},
'5699380':{'en': 'Movistar'},
'5699383':{'en': 'Entel'},
'5699382':{'en': 'Entel'},
'5699385':{'en': 'Claro'},
'5699384':{'en': 'Scharfstein'},
'554799918':{'en': 'TIM'},
'554799919':{'en': 'TIM'},
'554799916':{'en': 'TIM'},
'554799917':{'en': 'TIM'},
'554799914':{'en': 'TIM'},
'554799915':{'en': 'TIM'},
'554799912':{'en': 'TIM'},
'554799913':{'en': 'TIM'},
'554799911':{'en': 'TIM'},
'614444':{'en': 'Telstra'},
'55919920':{'en': 'Vivo'},
'55919921':{'en': 'Vivo'},
'55919922':{'en': 'Vivo'},
'55919923':{'en': 'Vivo'},
'55919924':{'en': 'Vivo'},
'55919925':{'en': 'Vivo'},
'55919926':{'en': 'Vivo'},
'55919927':{'en': 'Vivo'},
'559699981':{'en': 'Oi'},
'7902551':{'en': 'Tele2', 'ru': 'Tele2'},
'556398119':{'en': 'TIM'},
'556398118':{'en': 'TIM'},
'556398117':{'en': 'TIM'},
'556398116':{'en': 'TIM'},
'556398115':{'en': 'TIM'},
'556398114':{'en': 'TIM'},
'556398113':{'en': 'TIM'},
'556398112':{'en': 'TIM'},
'556398111':{'en': 'TIM'},
'659868':{'en': 'SingTel'},
'659869':{'en': 'SingTel'},
'79526':{'en': 'Tele2', 'ru': 'Tele2'},
'554799621':{'en': 'TIM'},
'554799622':{'en': 'TIM'},
'554799623':{'en': 'TIM'},
'554799624':{'en': 'TIM'},
'554799625':{'en': 'TIM'},
'554799626':{'en': 'TIM'},
'554799627':{'en': 'TIM'},
'554799628':{'en': 'TIM'},
'554799629':{'en': 'TIM'},
'555198215':{'en': 'TIM'},
'7900939':{'en': 'Tele2', 'ru': 'Tele2'},
'7900938':{'en': 'Tele2', 'ru': 'Tele2'},
'7900933':{'en': 'Tele2', 'ru': 'Tele2'},
'7900932':{'en': 'Tele2', 'ru': 'Tele2'},
'7900931':{'en': 'Tele2', 'ru': 'Tele2'},
'7900930':{'en': 'Tele2', 'ru': 'Tele2'},
'7900937':{'en': 'Tele2', 'ru': 'Tele2'},
'7900935':{'en': 'Tele2', 'ru': 'Tele2'},
'7900934':{'en': 'Tele2', 'ru': 'Tele2'},
'61497':{'en': 'Telstra'},
'60158860':{'en': 'Izzinet'},
'61491':{'en': 'Telstra'},
'61490':{'en': 'Telstra'},
'55899811':{'en': 'Vivo'},
'55899810':{'en': 'Vivo'},
'556598418':{'en': 'Brasil Telecom GSM'},
'556598419':{'en': 'Brasil Telecom GSM'},
'556598142':{'en': 'TIM'},
'556598415':{'en': 'Brasil Telecom GSM'},
'556598416':{'en': 'Brasil Telecom GSM'},
'556598141':{'en': 'TIM'},
'556598411':{'en': 'Brasil Telecom GSM'},
'556598412':{'en': 'Brasil Telecom GSM'},
'556598413':{'en': 'Brasil Telecom GSM'},
'554899975':{'en': 'TIM'},
'554899974':{'en': 'TIM'},
'554899977':{'en': 'TIM'},
'554899976':{'en': 'TIM'},
'554899971':{'en': 'TIM'},
'852628':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'554899973':{'en': 'TIM'},
'554899972':{'en': 'TIM'},
'852625':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852627':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'554899979':{'en': 'TIM'},
'554899978':{'en': 'TIM'},
'852623':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852622':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8536615':{'en': 'SmarTone'},
'852672':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852673':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852670':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852671':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'554899948':{'en': 'TIM'},
'852677':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852674':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'5939788':{'en': 'Movistar'},
'5939789':{'en': 'Movistar'},
'5939786':{'en': 'Movistar'},
'5939787':{'en': 'Movistar'},
'852675':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8536617':{'en': '3'},
'63918':{'en': 'Smart'},
'63919':{'en': 'Smart'},
'63910':{'en': 'Smart'},
'63912':{'en': 'Smart'},
'7901414':{'en': 'Tele2', 'ru': 'Tele2'},
'63914':{'en': 'Globe'},
'63915':{'en': 'Globe'},
'63916':{'en': 'Globe'},
'63917':{'en': 'Globe'},
'852679':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'554899941':{'en': 'TIM'},
'559599977':{'en': 'Oi'},
'559599976':{'en': 'Oi'},
'559599974':{'en': 'Oi'},
'559599972':{'en': 'Oi'},
'559599971':{'en': 'Oi'},
'559599970':{'en': 'Oi'},
'658812':{'en': 'M1'},
'658813':{'en': 'M1'},
'658811':{'en': 'M1'},
'658816':{'en': 'M1'},
'8536599':{'en': 'China Telecom'},
'7953039':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'8536611':{'en': '3'},
'658818':{'en': 'M1'},
'7991667':{'en': 'Tele2', 'ru': 'Tele2'},
'8536590':{'en': 'CTM'},
'556299935':{'en': 'Vivo'},
'556299934':{'en': 'Vivo'},
'556299937':{'en': 'Vivo'},
'556299936':{'en': 'Vivo'},
'556299931':{'en': 'Vivo'},
'556299933':{'en': 'Vivo'},
'556299932':{'en': 'Vivo'},
'556299939':{'en': 'Vivo'},
'556299938':{'en': 'Vivo'},
'60154879':{'en': 'red ONE'},
'60154878':{'en': 'Tg Agas'},
'799550':{'en': 'Tele2', 'ru': 'Tele2'},
'60154875':{'en': 'PP International'},
'60154874':{'en': 'red ONE'},
'559199908':{'en': 'Oi'},
'559199902':{'en': 'Oi'},
'559199903':{'en': 'Oi'},
'559199901':{'en': 'Oi'},
'557799810':{'en': 'Vivo'},
'559199907':{'en': 'Oi'},
'559199904':{'en': 'Oi'},
'557799813':{'en': 'Vivo'},
'558599659':{'en': 'TIM'},
'558599658':{'en': 'TIM'},
'558599653':{'en': 'TIM'},
'558599652':{'en': 'TIM'},
'558599651':{'en': 'TIM'},
'558599657':{'en': 'TIM'},
'558599656':{'en': 'TIM'},
'558599655':{'en': 'TIM'},
'558599654':{'en': 'TIM'},
'559999168':{'en': 'Vivo'},
'559999169':{'en': 'Vivo'},
'559999164':{'en': 'Vivo'},
'559999165':{'en': 'Vivo'},
'559999166':{'en': 'Vivo'},
'559999167':{'en': 'Vivo'},
'559999161':{'en': 'Vivo'},
'559999162':{'en': 'Vivo'},
'559999163':{'en': 'Vivo'},
'559499666':{'en': 'Oi'},
'7993033':{'en': 'Tele2', 'ru': 'Tele2'},
'793069':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'793068':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7993034':{'en': 'Tele2', 'ru': 'Tele2'},
'7993035':{'en': 'Tele2', 'ru': 'Tele2'},
'793067':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556398418':{'en': 'Brasil Telecom GSM'},
'556398419':{'en': 'Brasil Telecom GSM'},
'55849944':{'en': 'Claro BR'},
'556398412':{'en': 'Brasil Telecom GSM'},
'55849940':{'en': 'Claro BR'},
'55849941':{'en': 'Claro BR'},
'55849942':{'en': 'Claro BR'},
'556398413':{'en': 'Brasil Telecom GSM'},
'569814':{'en': 'Claro'},
'62218384':{'en': 'Esia'},
'62218380':{'en': 'Esia'},
'62218381':{'en': 'Esia'},
'62218382':{'en': 'Esia'},
'6018120':{'en': 'U Mobile'},
'559499662':{'en': 'Oi'},
'558999997':{'en': 'TIM'},
'556499671':{'en': 'Vivo'},
'5555996':{'en': 'Vivo'},
'5555991':{'en': 'Claro BR'},
'555399989':{'en': 'TIM'},
'556499676':{'en': 'Vivo'},
'555399985':{'en': 'TIM'},
'555399986':{'en': 'TIM'},
'555399987':{'en': 'TIM'},
'555399981':{'en': 'TIM'},
'555399982':{'en': 'TIM'},
'555399983':{'en': 'TIM'},
'55489998':{'en': 'TIM'},
'55489996':{'en': 'TIM'},
'6236139':{'en': 'Esia'},
'559299969':{'en': 'Oi'},
'559299968':{'en': 'Oi'},
'559299965':{'en': 'Oi'},
'559299964':{'en': 'Oi'},
'559299967':{'en': 'Oi'},
'559299966':{'en': 'Oi'},
'559299961':{'en': 'Oi'},
'559299963':{'en': 'Oi'},
'559299962':{'en': 'Oi'},
'62265986':{'en': 'Esia'},
'62265987':{'en': 'Esia'},
'62265985':{'en': 'Esia'},
'62265988':{'en': 'Esia'},
'62265989':{'en': 'Esia'},
'6425':{'en': 'Telecom'},
'6426':{'en': 'Vodafone'},
'6427':{'en': 'Telecom'},
'6421':{'en': 'Vodafone'},
'6422':{'en': '2degrees'},
'6428':{'en': 'Vodafone'},
'6429':{'en': 'TelstraClear'},
'556599956':{'en': 'Vivo'},
'556599957':{'en': 'Vivo'},
'556599954':{'en': 'Vivo'},
'556599955':{'en': 'Vivo'},
'556599952':{'en': 'Vivo'},
'556599953':{'en': 'Vivo'},
'556599951':{'en': 'Vivo'},
'66805':{'en': 'DTAC'},
'556599958':{'en': 'Vivo'},
'556599959':{'en': 'Vivo'},
'6221511':{'en': 'Esia'},
'555599979':{'en': 'Vivo'},
'555599978':{'en': 'Vivo'},
'6221512':{'en': 'Esia'},
'658684':{'en': 'M1'},
'555599973':{'en': 'Vivo'},
'555599972':{'en': 'Vivo'},
'555599971':{'en': 'Vivo'},
'6221513':{'en': 'Esia'},
'555599977':{'en': 'Vivo'},
'555599976':{'en': 'Vivo'},
'555599975':{'en': 'Vivo'},
'555599974':{'en': 'Vivo'},
'601071':{'en': 'Maxis'},
'555499659':{'en': 'Vivo'},
'555499658':{'en': 'Vivo'},
'7901621':{'en': 'Tele2', 'ru': 'Tele2'},
'7901623':{'en': 'Tele2', 'ru': 'Tele2'},
'555499651':{'en': 'Vivo'},
'555499653':{'en': 'Vivo'},
'555499652':{'en': 'Vivo'},
'555499655':{'en': 'Vivo'},
'555499654':{'en': 'Vivo'},
'555499657':{'en': 'Vivo'},
'555499656':{'en': 'Vivo'},
'7996854':{'en': 'Tele2', 'ru': 'Tele2'},
'559399131':{'en': 'Vivo'},
'559399133':{'en': 'Vivo'},
'559399132':{'en': 'Vivo'},
'559399135':{'en': 'Vivo'},
'559399134':{'en': 'Vivo'},
'559399137':{'en': 'Vivo'},
'559399136':{'en': 'Vivo'},
'559399139':{'en': 'Vivo'},
'559399138':{'en': 'Vivo'},
'557999141':{'en': 'TIM'},
'557999142':{'en': 'TIM'},
'557999143':{'en': 'TIM'},
'557999145':{'en': 'TIM'},
'557999147':{'en': 'TIM'},
'557999148':{'en': 'TIM'},
'557999149':{'en': 'TIM'},
'555598141':{'en': 'TIM'},
'555598143':{'en': 'TIM'},
'555598142':{'en': 'TIM'},
'86151':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'658228':{'en': 'SingTel'},
'86150':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'790474':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'86155':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'799111':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'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'},
'6226298':{'en': 'Esia'},
'6226299':{'en': 'Esia'},
'555398118':{'en': 'TIM'},
'555398119':{'en': 'TIM'},
'559699163':{'en': 'Vivo'},
'559699162':{'en': 'Vivo'},
'559699165':{'en': 'Vivo'},
'559699164':{'en': 'Vivo'},
'559699167':{'en': 'Vivo'},
'559699166':{'en': 'Vivo'},
'559699169':{'en': 'Vivo'},
'555398111':{'en': 'TIM'},
'555398112':{'en': 'TIM'},
'555398113':{'en': 'TIM'},
'555398114':{'en': 'TIM'},
'555398115':{'en': 'TIM'},
'555398116':{'en': 'TIM'},
'555398117':{'en': 'TIM'},
'795315':{'en': 'Tele2', 'ru': 'Tele2'},
'795314':{'en': 'Tele2', 'ru': 'Tele2'},
'795317':{'en': 'Tele2', 'ru': 'Tele2'},
'795316':{'en': 'Tele2', 'ru': 'Tele2'},
'795311':{'en': 'Tele2', 'ru': 'Tele2'},
'795310':{'en': 'Tele2', 'ru': 'Tele2'},
'795313':{'en': 'Tele2', 'ru': 'Tele2'},
'795319':{'en': 'Tele2', 'ru': 'Tele2'},
'795318':{'en': 'Tele2', 'ru': 'Tele2'},
'554799934':{'en': 'TIM'},
'554799935':{'en': 'TIM'},
'554799936':{'en': 'TIM'},
'554799937':{'en': 'TIM'},
'554799931':{'en': 'TIM'},
'554799932':{'en': 'TIM'},
'554799933':{'en': 'TIM'},
'554799938':{'en': 'TIM'},
'554799939':{'en': 'TIM'},
'5575985':{'en': 'Oi'},
'5575986':{'en': 'Oi'},
'5575987':{'en': 'Oi'},
'5575981':{'en': 'Claro BR'},
'5575988':{'en': 'Oi'},
'5575989':{'en': 'Oi'},
'658688':{'en': 'M1'},
'61423':{'en': 'Optus'},
'79508':{'en': 'Tele2', 'ru': 'Tele2'},
'79509':{'en': 'Tele2', 'ru': 'Tele2'},
'79504':{'en': 'Tele2', 'ru': 'Tele2'},
'79505':{'en': 'Tele2', 'ru': 'Tele2'},
'79506':{'en': 'Tele2', 'ru': 'Tele2'},
'79507':{'en': 'Tele2', 'ru': 'Tele2'},
'79500':{'en': 'Tele2', 'ru': 'Tele2'},
'79501':{'en': 'Tele2', 'ru': 'Tele2'},
'79503':{'en': 'Tele2', 'ru': 'Tele2'},
'67796':{'en': 'Smile'},
'67797':{'en': 'Smile'},
'67794':{'en': 'Smile'},
'67795':{'en': 'Smile'},
'67792':{'en': 'Satsol'},
'67791':{'en': 'Satsol'},
'6228799':{'en': 'Esia'},
'67798':{'en': 'Smile'},
'67799':{'en': 'Smile'},
'556299904':{'en': 'Vivo'},
'658822':{'en': 'M1'},
'556299906':{'en': 'Vivo'},
'556299907':{'en': 'Vivo'},
'556299901':{'en': 'Vivo'},
'559899909':{'en': 'Oi'},
'559899908':{'en': 'Oi'},
'556299902':{'en': 'Vivo'},
'559899901':{'en': 'Oi'},
'597773':{'en': 'Telesur'},
'559899903':{'en': 'Oi'},
'559899902':{'en': 'Oi'},
'559899905':{'en': 'Oi'},
'559899904':{'en': 'Oi'},
'559899907':{'en': 'Oi'},
'559899906':{'en': 'Oi'},
'556298187':{'en': 'TIM'},
'556298186':{'en': 'TIM'},
'556298185':{'en': 'TIM'},
'790899':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790898':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'556298184':{'en': 'TIM'},
'597772':{'en': 'Telesur'},
'790891':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'556298183':{'en': 'TIM'},
'790893':{'en': 'Tele2', 'ru': 'Tele2'},
'790892':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790895':{'en': 'Tele2', 'ru': 'Tele2'},
'790894':{'en': 'Tele2', 'ru': 'Tele2'},
'62283986':{'en': 'Esia'},
'556298182':{'en': 'TIM'},
'5698104':{'en': 'Viva'},
'5698105':{'en': 'WOM'},
'554899959':{'en': 'TIM'},
'554899958':{'en': 'TIM'},
'5698100':{'en': 'Viva'},
'556298181':{'en': 'TIM'},
'5698102':{'en': 'Viva'},
'5698103':{'en': 'Viva'},
'554899953':{'en': 'TIM'},
'554899952':{'en': 'TIM'},
'554899951':{'en': 'TIM'},
'554899957':{'en': 'TIM'},
'554899956':{'en': 'TIM'},
'554899955':{'en': 'TIM'},
'554899954':{'en': 'TIM'},
'597771':{'en': 'Telesur'},
'55889812':{'en': 'Vivo'},
'55889810':{'en': 'Vivo'},
'55889811':{'en': 'Vivo'},
'8617401':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'8617400':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'8617403':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'8617402':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'8617405':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'8617404':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'559399119':{'en': 'Vivo'},
'556298188':{'en': 'TIM'},
'557599801':{'en': 'Vivo'},
'557599803':{'en': 'Vivo'},
'557599802':{'en': 'Vivo'},
'557599805':{'en': 'Vivo'},
'557599804':{'en': 'Vivo'},
'557599807':{'en': 'Vivo'},
'557599806':{'en': 'Vivo'},
'557599809':{'en': 'Vivo'},
'557599808':{'en': 'Vivo'},
'65945':{'en': 'StarHub'},
'65947':{'en': 'M1'},
'65946':{'en': 'SingTel'},
'558599957':{'en': 'TIM'},
'65942':{'en': 'StarHub'},
'852611':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'65948':{'en': 'StarHub'},
'659121':{'en': 'SingTel'},
'7953059':{'en': 'Tele2', 'ru': 'Tele2'},
'556299919':{'en': 'Vivo'},
'556299918':{'en': 'Vivo'},
'658838':{'en': 'M1'},
'556299913':{'en': 'Vivo'},
'556299912':{'en': 'Vivo'},
'556299911':{'en': 'Vivo'},
'556299917':{'en': 'Vivo'},
'556299916':{'en': 'Vivo'},
'556299915':{'en': 'Vivo'},
'556299914':{'en': 'Vivo'},
'797810':{'en': 'MTS', 'ru': 'MTS'},
'797811':{'en': 'MTS', 'ru': 'MTS'},
'797812':{'en': 'MTS', 'ru': 'MTS'},
'797813':{'en': 'MTS', 'ru': 'MTS'},
'797814':{'en': 'MTS', 'ru': 'MTS'},
'62752994':{'en': 'Esia'},
'62752995':{'en': 'Esia'},
'62752996':{'en': 'Esia'},
'62752990':{'en': 'Esia'},
'62752991':{'en': 'Esia'},
'62752992':{'en': 'Esia'},
'62752993':{'en': 'Esia'},
'556299669':{'en': 'Vivo'},
'556299668':{'en': 'Vivo'},
'556299661':{'en': 'Vivo'},
'556299663':{'en': 'Vivo'},
'556299662':{'en': 'Vivo'},
'556299665':{'en': 'Vivo'},
'556299664':{'en': 'Vivo'},
'556299667':{'en': 'Vivo'},
'556299666':{'en': 'Vivo'},
'559199921':{'en': 'Oi'},
'559199922':{'en': 'Oi'},
'559199923':{'en': 'Oi'},
'559199924':{'en': 'Oi'},
'559199925':{'en': 'Oi'},
'559199926':{'en': 'Oi'},
'559999182':{'en': 'Vivo'},
'559999183':{'en': 'Vivo'},
'559999181':{'en': 'Vivo'},
'559999186':{'en': 'Vivo'},
'559999187':{'en': 'Vivo'},
'559999184':{'en': 'Vivo'},
'559999185':{'en': 'Vivo'},
'559999188':{'en': 'Vivo'},
'559999189':{'en': 'Vivo'},
'658698':{'en': 'SingTel'},
'658699':{'en': 'M1'},
'7902188':{'en': 'Tele2', 'ru': 'Tele2'},
'658690':{'en': 'StarHub'},
'658691':{'en': 'M1'},
'658692':{'en': 'M1'},
'658693':{'en': 'M1'},
'658694':{'en': 'SingTel'},
'658695':{'en': 'SingTel'},
'658696':{'en': 'SingTel'},
'658697':{'en': 'SingTel'},
'8536255':{'en': 'SmarTone'},
'557199287':{'en': 'TIM'},
'55849960':{'en': 'TIM'},
'793950':{'en': 'TMT', 'ru': 'TMT'},
'7950880':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'68576':{'en': 'Bluesky'},
'7950888':{'en': 'MTS', 'ru': 'MTS'},
'7950889':{'en': 'MTS', 'ru': 'MTS'},
'556798401':{'en': 'Brasil Telecom GSM'},
'557499191':{'en': 'TIM'},
'556798403':{'en': 'Brasil Telecom GSM'},
'557499193':{'en': 'TIM'},
'556798405':{'en': 'Brasil Telecom GSM'},
'557499195':{'en': 'TIM'},
'556798407':{'en': 'Brasil Telecom GSM'},
'556798158':{'en': 'TIM'},
'556798409':{'en': 'Brasil Telecom GSM'},
'556798408':{'en': 'Brasil Telecom GSM'},
'556798155':{'en': 'TIM'},
'556798154':{'en': 'TIM'},
'556798153':{'en': 'TIM'},
'556798152':{'en': 'TIM'},
'556798151':{'en': 'TIM'},
'557499998':{'en': 'Vivo'},
'557499999':{'en': 'Vivo'},
'558999971':{'en': 'TIM'},
'558999976':{'en': 'TIM'},
'558999974':{'en': 'TIM'},
'558999975':{'en': 'TIM'},
'557499991':{'en': 'Vivo'},
'558999978':{'en': 'TIM'},
'558999979':{'en': 'TIM'},
'557499995':{'en': 'Vivo'},
'557499996':{'en': 'Vivo'},
'5597988':{'en': 'Oi'},
'5597989':{'en': 'Oi'},
'555399961':{'en': 'Vivo'},
'555399966':{'en': 'Vivo'},
'555399967':{'en': 'Vivo'},
'555399964':{'en': 'Vivo'},
'556499611':{'en': 'Vivo'},
'555399968':{'en': 'Vivo'},
'555399969':{'en': 'Vivo'},
'5597985':{'en': 'Oi'},
'5597986':{'en': 'Oi'},
'5597987':{'en': 'Oi'},
'79513':{'en': 'Tele2', 'ru': 'Tele2'},
'658720':{'en': 'M1'},
'68572':{'en': 'Digicel'},
'559299944':{'en': 'Oi'},
'7995899':{'en': 'Tele2', 'ru': 'Tele2'},
'79512':{'en': 'Tele2', 'ru': 'Tele2'},
'559599128':{'en': 'Vivo'},
'559599129':{'en': 'Vivo'},
'61499':{'en': 'Telstra'},
'61498':{'en': 'Telstra'},
'559599124':{'en': 'Vivo'},
'559599125':{'en': 'Vivo'},
'559599126':{'en': 'Vivo'},
'559599127':{'en': 'Vivo'},
'559599121':{'en': 'Vivo'},
'559599122':{'en': 'Vivo'},
'559599123':{'en': 'Vivo'},
'7764':{'en': '2Day Telecom', 'ru': '2Day Telecom'},
'7760':{'en': 'Kulan', 'ru': u('\u041a\u0443\u043b\u0430\u043d')},
'7762':{'en': 'Nursat', 'ru': u('\u041d\u0423\u0420\u0421\u0410\u0422')},
'7763':{'en': 'Arna', 'ru': u('\u0410\u0440\u043d\u0430')},
'5594985':{'en': 'Oi'},
'658355':{'en': 'SingTel'},
'5594987':{'en': 'Oi'},
'5594986':{'en': 'Oi'},
'7900405':{'en': 'Tele2', 'ru': 'Tele2'},
'658354':{'en': 'SingTel'},
'6226291':{'en': 'Esia'},
'5594989':{'en': 'Oi'},
'5594988':{'en': 'Oi'},
'658356':{'en': 'SingTel'},
'658351':{'en': 'SingTel'},
'658350':{'en': 'SingTel'},
'790896':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900404':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'658353':{'en': 'SingTel'},
'658352':{'en': 'StarHub'},
'555599991':{'en': 'Vivo'},
'555599993':{'en': 'Vivo'},
'555599992':{'en': 'Vivo'},
'555599995':{'en': 'Vivo'},
'555599994':{'en': 'Vivo'},
'555599997':{'en': 'Vivo'},
'555599996':{'en': 'Vivo'},
'555599999':{'en': 'Vivo'},
'555599998':{'en': 'Vivo'},
'79515':{'en': 'Tele2', 'ru': 'Tele2'},
'555499679':{'en': 'Vivo'},
'555499678':{'en': 'Vivo'},
'555499677':{'en': 'Vivo'},
'555499676':{'en': 'Vivo'},
'555499675':{'en': 'Vivo'},
'555499674':{'en': 'Vivo'},
'555499673':{'en': 'Vivo'},
'555499672':{'en': 'Vivo'},
'555499671':{'en': 'Vivo'},
'559399117':{'en': 'Vivo'},
'559399116':{'en': 'Vivo'},
'559399115':{'en': 'Vivo'},
'559399114':{'en': 'Vivo'},
'559399113':{'en': 'Vivo'},
'559399112':{'en': 'Vivo'},
'559399111':{'en': 'Vivo'},
'59069077':{'en': 'Dauphin Telecom'},
'556298189':{'en': 'TIM'},
'559399118':{'en': 'Vivo'},
'569966':{'en': 'Movistar'},
'790229':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790226':{'en': 'Tele2', 'ru': 'Tele2'},
'790227':{'en': 'Tele2', 'ru': 'Tele2'},
'790225':{'en': 'Tele2', 'ru': 'Tele2'},
'790222':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790221':{'en': 'Tele2', 'ru': 'Tele2'},
'557999124':{'en': 'TIM'},
'557999121':{'en': 'TIM'},
'7900482':{'en': 'Tele2', 'ru': 'Tele2'},
'8536254':{'en': 'SmarTone'},
'7996758':{'en': 'Tele2', 'ru': 'Tele2'},
'8536256':{'en': 'SmarTone'},
'8536257':{'en': 'SmarTone'},
'8536250':{'en': 'CTM'},
'8536251':{'en': 'CTM'},
'8536252':{'en': 'CTM'},
'8536253':{'en': 'CTM'},
'8536258':{'en': 'SmarTone'},
'8536259':{'en': 'SmarTone'},
'852684':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559998116':{'en': 'TIM'},
'559998117':{'en': 'TIM'},
'559998114':{'en': 'TIM'},
'559998115':{'en': 'TIM'},
'559998112':{'en': 'TIM'},
'559998113':{'en': 'TIM'},
'559998111':{'en': 'TIM'},
'852680':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'559998118':{'en': 'TIM'},
'559998119':{'en': 'TIM'},
'7996208':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996209':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556199625':{'en': 'Vivo'},
'601155':{'en': 'red ONE'},
'601154':{'en': 'Celcom'},
'601151':{'en': 'DiGi'},
'601150':{'en': 'Talk Focus'},
'601153':{'en': 'Tune Talk'},
'601152':{'en': 'Altel'},
'62735985':{'en': 'Esia'},
'55499885':{'en': 'Claro BR'},
'59775':{'en': 'Telesur'},
'59774':{'en': 'Digicel'},
'59776':{'en': 'Digicel'},
'59771':{'en': 'Digicel'},
'55499886':{'en': 'Claro BR'},
'59772':{'en': 'Digicel'},
'559699147':{'en': 'Vivo'},
'559699146':{'en': 'Vivo'},
'559699145':{'en': 'Vivo'},
'559699144':{'en': 'Vivo'},
'559699143':{'en': 'Vivo'},
'559699142':{'en': 'Vivo'},
'559699141':{'en': 'Vivo'},
'55499880':{'en': 'Claro BR'},
'559699149':{'en': 'Vivo'},
'559699148':{'en': 'Vivo'},
'557799999':{'en': 'Vivo'},
'55499882':{'en': 'Claro BR'},
'795338':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'557799990':{'en': 'Vivo'},
'557799993':{'en': 'Vivo'},
'557799992':{'en': 'Vivo'},
'7900409':{'en': 'Tele2', 'ru': 'Tele2'},
'790069':{'en': 'Tele2', 'ru': 'Tele2'},
'7996759':{'en': 'Tele2', 'ru': 'Tele2'},
'68870':{'en': 'Tuvalu Telecom'},
'68871':{'en': 'Tuvalu Telecom'},
'556199811':{'en': 'Vivo'},
'62735987':{'en': 'Esia'},
'559999649':{'en': 'Oi'},
'559999641':{'en': 'Oi'},
'559999643':{'en': 'Oi'},
'559999642':{'en': 'Oi'},
'559999645':{'en': 'Oi'},
'559999644':{'en': 'Oi'},
'559999647':{'en': 'Oi'},
'559999646':{'en': 'Oi'},
'554899122':{'en': 'Vivo'},
'658571':{'en': 'StarHub'},
'658570':{'en': 'StarHub'},
'5582988':{'en': 'Oi'},
'558899927':{'en': 'TIM'},
'5582986':{'en': 'Oi'},
'5582987':{'en': 'Oi'},
'5582985':{'en': 'Oi'},
'62481991':{'en': 'Esia'},
'62481990':{'en': 'Esia'},
'62481993':{'en': 'Esia'},
'554899121':{'en': 'Vivo'},
'62481994':{'en': 'Esia'},
'558899922':{'en': 'TIM'},
'554899127':{'en': 'Vivo'},
'556199818':{'en': 'Vivo'},
'554899124':{'en': 'Vivo'},
'6223291':{'en': 'Esia'},
'554899125':{'en': 'Vivo'},
'558599932':{'en': 'TIM'},
'558599933':{'en': 'TIM'},
'558599931':{'en': 'TIM'},
'558599936':{'en': 'TIM'},
'558599937':{'en': 'TIM'},
'558599934':{'en': 'TIM'},
'558599935':{'en': 'TIM'},
'558599938':{'en': 'TIM'},
'558599939':{'en': 'TIM'},
'554899128':{'en': 'Vivo'},
'554899129':{'en': 'Vivo'},
'7902236':{'en': 'Tele2', 'ru': 'Tele2'},
'7902237':{'en': 'Tele2', 'ru': 'Tele2'},
'7902234':{'en': 'Tele2', 'ru': 'Tele2'},
'7902232':{'en': 'Tele2', 'ru': 'Tele2'},
'7902233':{'en': 'Tele2', 'ru': 'Tele2'},
'7902230':{'en': 'Tele2', 'ru': 'Tele2'},
'7902231':{'en': 'Tele2', 'ru': 'Tele2'},
'7902238':{'en': 'Tele2', 'ru': 'Tele2'},
'7902239':{'en': 'Tele2', 'ru': 'Tele2'},
'55549921':{'en': 'Claro BR'},
'55549920':{'en': 'Claro BR'},
'852528':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852661':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852660':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852663':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'852529':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852665':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852664':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852667':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852669':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852668':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'799680':{'en': 'Tele2', 'ru': 'Tele2'},
'7901453':{'en': 'Tele2', 'ru': 'Tele2'},
'7996849':{'en': 'Tele2', 'ru': 'Tele2'},
'7901457':{'en': 'Tele2', 'ru': 'Tele2'},
'7901455':{'en': 'Tele2', 'ru': 'Tele2'},
'7901454':{'en': 'Tele2', 'ru': 'Tele2'},
'65963':{'en': 'SingTel'},
'65961':{'en': 'SingTel'},
'65967':{'en': 'SingTel'},
'65966':{'en': 'SingTel'},
'65965':{'en': 'SingTel'},
'65964':{'en': 'SingTel'},
'65969':{'en': 'M1'},
'65968':{'en': 'M1'},
'559599933':{'en': 'Oi'},
'558499620':{'en': 'TIM'},
'559398111':{'en': 'TIM'},
'556998438':{'en': 'Brasil Telecom GSM'},
'556998439':{'en': 'Brasil Telecom GSM'},
'5585987':{'en': 'Oi'},
'5585986':{'en': 'Oi'},
'5585985':{'en': 'Oi'},
'556798141':{'en': 'TIM'},
'556998432':{'en': 'Brasil Telecom GSM'},
'556998433':{'en': 'Brasil Telecom GSM'},
'5585989':{'en': 'Oi'},
'556998431':{'en': 'Brasil Telecom GSM'},
'556998436':{'en': 'Brasil Telecom GSM'},
'556998437':{'en': 'Brasil Telecom GSM'},
'556998434':{'en': 'Brasil Telecom GSM'},
'556998435':{'en': 'Brasil Telecom GSM'},
'556798411':{'en': 'Brasil Telecom GSM'},
'556798416':{'en': 'Brasil Telecom GSM'},
'556798417':{'en': 'Brasil Telecom GSM'},
'556798146':{'en': 'TIM'},
'559398118':{'en': 'TIM'},
'556798415':{'en': 'Brasil Telecom GSM'},
'559398119':{'en': 'TIM'},
'62736996':{'en': 'Esia'},
'84169':{'en': 'Viettel Mobile'},
'62736997':{'en': 'Esia'},
'658368':{'en': 'M1'},
'658369':{'en': 'StarHub'},
'658360':{'en': 'SingTel'},
'658361':{'en': 'StarHub'},
'658362':{'en': 'StarHub'},
'658363':{'en': 'StarHub'},
'658364':{'en': 'StarHub'},
'658366':{'en': 'M1'},
'658367':{'en': 'StarHub'},
'569967':{'en': 'Entel'},
'559199944':{'en': 'Oi'},
'559199942':{'en': 'Oi'},
'5586987':{'en': 'Oi'},
'559199940':{'en': 'Oi'},
'5586985':{'en': 'Oi'},
'5586988':{'en': 'Oi'},
'5582989':{'en': 'Oi'},
'559199949':{'en': 'Oi'},
'569963':{'en': 'Movistar'},
'62294911':{'en': 'Esia'},
'62294910':{'en': 'Esia'},
'62294913':{'en': 'Esia'},
'569962':{'en': 'Movistar'},
'569961':{'en': 'Entel'},
'799540':{'en': 'Tele2', 'ru': 'Tele2'},
'790054':{'en': 'Tele2', 'ru': 'Tele2'},
'799542':{'en': 'Tele2', 'ru': 'Tele2'},
'6226692':{'en': 'Esia'},
'6226693':{'en': 'Esia'},
'6226690':{'en': 'Esia'},
'6226691':{'en': 'Esia'},
'677792':{'en': 'Solomon Telekom'},
'677793':{'en': 'Solomon Telekom'},
'677790':{'en': 'Solomon Telekom'},
'677791':{'en': 'Solomon Telekom'},
'677794':{'en': 'Solomon Telekom'},
'62481992':{'en': 'Esia'},
'6011560':{'en': 'Celcom'},
'6011561':{'en': 'Celcom'},
'6011562':{'en': 'Celcom'},
'6011563':{'en': 'Celcom'},
'6011564':{'en': 'Celcom'},
'6011565':{'en': 'XOX'},
'6011566':{'en': 'XOX'},
'6011567':{'en': 'XOX'},
'554599983':{'en': 'TIM'},
'554599982':{'en': 'TIM'},
'554599981':{'en': 'TIM'},
'601887':{'en': 'U Mobile'},
'554599984':{'en': 'TIM'},
'556798135':{'en': 'TIM'},
'556798426':{'en': 'Brasil Telecom GSM'},
'556798425':{'en': 'Brasil Telecom GSM'},
'556798136':{'en': 'TIM'},
'556798423':{'en': 'Brasil Telecom GSM'},
'556798422':{'en': 'Brasil Telecom GSM'},
'556798421':{'en': 'Brasil Telecom GSM'},
'556798132':{'en': 'TIM'},
'556798139':{'en': 'TIM'},
'554699921':{'en': 'TIM'},
'554699922':{'en': 'TIM'},
'554699923':{'en': 'TIM'},
'55879811':{'en': 'Vivo'},
'55879810':{'en': 'Vivo'},
'79779':{'en': 'Tele2', 'ru': 'Tele2'},
'79778':{'en': 'Tele2', 'ru': 'Tele2'},
'64204':{'en': 'Skinny'},
'79776':{'en': 'Tele2', 'ru': 'Tele2'},
'79775':{'en': 'Tele2', 'ru': 'Tele2'},
'79774':{'en': 'Tele2', 'ru': 'Tele2'},
'79773':{'en': 'Tele2', 'ru': 'Tele2'},
'79772':{'en': 'Tele2', 'ru': 'Tele2'},
'79771':{'en': 'Tele2', 'ru': 'Tele2'},
'555399948':{'en': 'Vivo'},
'555399949':{'en': 'Vivo'},
'555399941':{'en': 'Vivo'},
'555399942':{'en': 'Vivo'},
'555399943':{'en': 'Vivo'},
'555399944':{'en': 'Vivo'},
'555399945':{'en': 'Vivo'},
'555399946':{'en': 'Vivo'},
'555399947':{'en': 'Vivo'},
'659235':{'en': 'SingTel'},
'659234':{'en': 'SingTel'},
'659237':{'en': 'StarHub'},
'659236':{'en': 'SingTel'},
'659231':{'en': 'SingTel'},
'659230':{'en': 'SingTel'},
'659233':{'en': 'SingTel'},
'659232':{'en': 'SingTel'},
'659239':{'en': 'StarHub'},
'659238':{'en': 'StarHub'},
'7900610':{'en': 'Tele2', 'ru': 'Tele2'},
'559898159':{'en': 'TIM'},
'559898158':{'en': 'TIM'},
'84168':{'en': 'Viettel Mobile'},
'559898151':{'en': 'TIM'},
'559898153':{'en': 'TIM'},
'559898152':{'en': 'TIM'},
'559898155':{'en': 'TIM'},
'559898154':{'en': 'TIM'},
'559898157':{'en': 'TIM'},
'559898156':{'en': 'TIM'},
'556898121':{'en': 'TIM'},
'84162':{'en': 'Viettel Mobile'},
'84163':{'en': 'Viettel Mobile'},
'7747':{'en': 'Tele2', 'ru': 'Tele2'},
'556599992':{'en': 'Vivo'},
'556599993':{'en': 'Vivo'},
'556599991':{'en': 'Vivo'},
'556599996':{'en': 'Vivo'},
'556599997':{'en': 'Vivo'},
'556599994':{'en': 'Vivo'},
'556599995':{'en': 'Vivo'},
'556599998':{'en': 'Vivo'},
'556599999':{'en': 'Vivo'},
'59469418':{'en': 'SFR'},
'59469419':{'en': 'SFR'},
'59469412':{'en': 'Digicel'},
'59469413':{'en': 'Digicel'},
'59469414':{'en': 'Digicel'},
'59469415':{'en': 'Digicel'},
'59469416':{'en': 'Digicel'},
'59469417':{'en': 'SFR'},
'62283987':{'en': 'Esia'},
'85566':{'en': 'Beeline'},
'555499615':{'en': 'Vivo'},
'555499614':{'en': 'Vivo'},
'555499617':{'en': 'Vivo'},
'555499616':{'en': 'Vivo'},
'555499611':{'en': 'Vivo'},
'555499613':{'en': 'Vivo'},
'555499612':{'en': 'Vivo'},
'55859820':{'en': 'Vivo'},
'555499619':{'en': 'Vivo'},
'555499618':{'en': 'Vivo'},
'6015464':{'en': 'Telekom'},
'6235199':{'en': 'Esia'},
'6235198':{'en': 'Esia'},
'62548994':{'en': 'Esia'},
'559399179':{'en': 'Vivo'},
'559399178':{'en': 'Vivo'},
'62548993':{'en': 'Esia'},
'62548992':{'en': 'Esia'},
'559399175':{'en': 'Vivo'},
'559399174':{'en': 'Vivo'},
'559399177':{'en': 'Vivo'},
'559399176':{'en': 'Vivo'},
'559399171':{'en': 'Vivo'},
'559399173':{'en': 'Vivo'},
'559399172':{'en': 'Vivo'},
'62518990':{'en': 'Esia'},
'62518991':{'en': 'Esia'},
'62518992':{'en': 'Esia'},
'62518993':{'en': 'Esia'},
'790208':{'en': 'MTS', 'ru': 'MTS'},
'790209':{'en': 'Tele2', 'ru': 'Tele2'},
'5939621':{'en': 'CNT'},
'790200':{'en': 'Tele2', 'ru': 'Tele2'},
'790201':{'en': 'Tele2', 'ru': 'Tele2'},
'790204':{'en': 'Tele2', 'ru': 'Tele2'},
'790205':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790206':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'790207':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'557199984':{'en': 'Vivo'},
'557199985':{'en': 'Vivo'},
'557199986':{'en': 'Vivo'},
'557199987':{'en': 'Vivo'},
'557199981':{'en': 'Vivo'},
'557199982':{'en': 'Vivo'},
'557199983':{'en': 'Vivo'},
'555198211':{'en': 'TIM'},
'555198213':{'en': 'TIM'},
'555198212':{'en': 'TIM'},
'557199988':{'en': 'Vivo'},
'555198214':{'en': 'TIM'},
'555198217':{'en': 'TIM'},
'555198216':{'en': 'TIM'},
'5939620':{'en': 'CNT'},
'79532':{'en': 'Tele2', 'ru': 'Tele2'},
'62284994':{'en': 'Esia'},
'62284995':{'en': 'Esia'},
'8536278':{'en': '3'},
'8536279':{'en': '3'},
'8536276':{'en': '3'},
'8536277':{'en': '3'},
'8536274':{'en': 'CTM'},
'8536275':{'en': 'CTM'},
'8536272':{'en': 'CTM'},
'8536273':{'en': 'CTM'},
'8536270':{'en': 'SmarTone'},
'8536271':{'en': 'SmarTone'},
'557199188':{'en': 'TIM'},
'559998139':{'en': 'TIM'},
'559998134':{'en': 'TIM'},
'557199185':{'en': 'TIM'},
'559998136':{'en': 'TIM'},
'559998137':{'en': 'TIM'},
'559998131':{'en': 'TIM'},
'559998132':{'en': 'TIM'},
'557199183':{'en': 'TIM'},
'5939622':{'en': 'CNT'},
'7991013':{'en': 'Tele2', 'ru': 'Tele2'},
'7991010':{'en': 'Tele2', 'ru': 'Tele2'},
'7991011':{'en': 'Tele2', 'ru': 'Tele2'},
'7991016':{'en': 'Tele2', 'ru': 'Tele2'},
'7991017':{'en': 'Tele2', 'ru': 'Tele2'},
'7991014':{'en': 'Tele2', 'ru': 'Tele2'},
'7991015':{'en': 'Tele2', 'ru': 'Tele2'},
'556198551':{'en': 'Brasil Telecom GSM'},
'556198553':{'en': 'Brasil Telecom GSM'},
'556198552':{'en': 'Brasil Telecom GSM'},
'556198555':{'en': 'Brasil Telecom GSM'},
'556198554':{'en': 'Brasil Telecom GSM'},
'556198557':{'en': 'Brasil Telecom GSM'},
'556198556':{'en': 'Brasil Telecom GSM'},
'556198559':{'en': 'Brasil Telecom GSM'},
'556198558':{'en': 'Brasil Telecom GSM'},
'6228192':{'en': 'Esia'},
'5939625':{'en': 'Movistar'},
'5581999':{'en': 'TIM'},
'559699129':{'en': 'Vivo'},
'559699128':{'en': 'Vivo'},
'559699125':{'en': 'Vivo'},
'559699124':{'en': 'Vivo'},
'559699127':{'en': 'Vivo'},
'559699126':{'en': 'Vivo'},
'559699121':{'en': 'Vivo'},
'559699123':{'en': 'Vivo'},
'559699122':{'en': 'Vivo'},
'55799812':{'en': 'Claro BR'},
'55799813':{'en': 'Claro BR'},
'55799810':{'en': 'Claro BR'},
'55799811':{'en': 'Claro BR'},
'55799816':{'en': 'Claro BR'},
'55799814':{'en': 'Claro BR'},
'55799815':{'en': 'Claro BR'},
'67983':{'en': 'Vodafone'},
'6226591':{'en': 'Esia'},
'6226590':{'en': 'Esia'},
'6226593':{'en': 'Esia'},
'6226592':{'en': 'Esia'},
'5939627':{'en': 'Movistar'},
'6226599':{'en': 'Esia'},
'5939626':{'en': 'Movistar'},
'7902661':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902660':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902663':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902662':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902665':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902664':{'en': 'Tele2', 'ru': 'Tele2'},
'658559':{'en': 'StarHub'},
'7902666':{'en': 'Tele2', 'ru': 'Tele2'},
'7902669':{'en': 'Tele2', 'ru': 'Tele2'},
'7902668':{'en': 'Tele2', 'ru': 'Tele2'},
'558299371':{'en': 'Claro BR'},
'558599918':{'en': 'TIM'},
'558599919':{'en': 'TIM'},
'558599911':{'en': 'TIM'},
'558599912':{'en': 'TIM'},
'558599913':{'en': 'TIM'},
'558599914':{'en': 'TIM'},
'558599915':{'en': 'TIM'},
'558599916':{'en': 'TIM'},
'558599917':{'en': 'TIM'},
'8525283':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'8525282':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525281':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8525280':{'en': 'Truphone', 'zh': 'Truphone', 'zh_Hant': 'Truphone'},
'8525289':{'en': '263.net', 'zh': '263.net', 'zh_Hant': '263.net'},
'5581996':{'en': 'TIM'},
'623994':{'en': 'Esia'},
'557499194':{'en': 'TIM'},
'61482':{'en': 'Optus'},
'84999':{'en': 'Indochina Telecom'},
'84998':{'en': 'Indochina Telecom'},
'84997':{'en': 'G-Mobile'},
'84996':{'en': 'G-Mobile'},
'84995':{'en': 'G-Mobile'},
'84994':{'en': 'G-Mobile'},
'84993':{'en': 'G-Mobile'},
'84992':{'en': 'VSAT'},
'55779980':{'en': 'Vivo'},
'559899944':{'en': 'Oi'},
'55499887':{'en': 'Claro BR'},
'790853':{'en': 'MTS', 'ru': 'MTS'},
'790852':{'en': 'MTS', 'ru': 'MTS'},
'554899997':{'en': 'TIM'},
'554899996':{'en': 'TIM'},
'554899995':{'en': 'TIM'},
'554899994':{'en': 'TIM'},
'554899993':{'en': 'TIM'},
'554899992':{'en': 'TIM'},
'554899991':{'en': 'TIM'},
'852643':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852642':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852641':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852640':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852647':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852646':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852645':{'en': 'CITIC', 'zh': u('\u4e2d\u4fe1\u56fd\u9645\u7535\u8baf'), 'zh_Hant': u('\u4e2d\u4fe1\u570b\u969b\u96fb\u8a0a')},
'554899998':{'en': 'TIM'},
'7958513':{'en': 'Tele2', 'ru': 'Tele2'},
'55499881':{'en': 'Claro BR'},
'559899159':{'en': 'Vivo'},
'557599841':{'en': 'Vivo'},
'557599840':{'en': 'Vivo'},
'557599843':{'en': 'Vivo'},
'557599842':{'en': 'Vivo'},
'622995':{'en': 'Esia'},
'599796':{'en': 'Chippie'},
'55499883':{'en': 'Claro BR'},
'7901470':{'en': 'Tele2', 'ru': 'Tele2'},
'65909':{'en': 'M1'},
'65908':{'en': 'SingTel'},
'61459':{'en': 'Telstra'},
'556598128':{'en': 'TIM'},
'556598129':{'en': 'TIM'},
'556598124':{'en': 'TIM'},
'556598125':{'en': 'TIM'},
'556598126':{'en': 'TIM'},
'556598127':{'en': 'TIM'},
'65905':{'en': 'SingTel'},
'556598121':{'en': 'TIM'},
'556598122':{'en': 'TIM'},
'556598123':{'en': 'TIM'},
'57303':{'en': 'Uff!'},
'558799606':{'en': 'TIM'},
'558799607':{'en': 'TIM'},
'558799604':{'en': 'TIM'},
'558799605':{'en': 'TIM'},
'558799602':{'en': 'TIM'},
'558799603':{'en': 'TIM'},
'558799601':{'en': 'TIM'},
'558799608':{'en': 'TIM'},
'558799609':{'en': 'TIM'},
'556998411':{'en': 'Brasil Telecom GSM'},
'556998412':{'en': 'Brasil Telecom GSM'},
'556998413':{'en': 'Brasil Telecom GSM'},
'556998414':{'en': 'Brasil Telecom GSM'},
'556998415':{'en': 'Brasil Telecom GSM'},
'556998416':{'en': 'Brasil Telecom GSM'},
'556998417':{'en': 'Brasil Telecom GSM'},
'556998418':{'en': 'Brasil Telecom GSM'},
'556998419':{'en': 'Brasil Telecom GSM'},
'569743':{'en': 'Movistar'},
'5547988':{'en': 'Claro BR'},
'6011105':{'en': 'red ONE'},
'554999138':{'en': 'Vivo'},
'554999139':{'en': 'Vivo'},
'554999132':{'en': 'Vivo'},
'554999133':{'en': 'Vivo'},
'554999131':{'en': 'Vivo'},
'554999136':{'en': 'Vivo'},
'554999137':{'en': 'Vivo'},
'554999134':{'en': 'Vivo'},
'554999135':{'en': 'Vivo'},
'7902416':{'en': 'Tele2', 'ru': 'Tele2'},
'7902417':{'en': 'Tele2', 'ru': 'Tele2'},
'7902414':{'en': 'Tele2', 'ru': 'Tele2'},
'7902415':{'en': 'Tele2', 'ru': 'Tele2'},
'85560':{'en': 'Beeline'},
'7902410':{'en': 'Tele2', 'ru': 'Tele2'},
'85569':{'en': 'Smart'},
'85568':{'en': 'Beeline'},
'599790':{'en': 'Chippie'},
'7902419':{'en': 'Tele2', 'ru': 'Tele2'},
'56966':{'en': 'Entel'},
'56961':{'en': 'Movistar'},
'559499972':{'en': 'Oi'},
'559999109':{'en': 'Vivo'},
'84186':{'en': 'Vietnamobile'},
'556398423':{'en': 'Brasil Telecom GSM'},
'556398422':{'en': 'Brasil Telecom GSM'},
'559499977':{'en': 'Oi'},
'556398421':{'en': 'Brasil Telecom GSM'},
'658264':{'en': 'SingTel'},
'57316':{'en': 'Movistar'},
'559999103':{'en': 'Vivo'},
'556398427':{'en': 'Brasil Telecom GSM'},
'799520':{'en': 'Tele2', 'ru': 'Tele2'},
'556398426':{'en': 'Brasil Telecom GSM'},
'57313':{'en': 'Claro'},
'556398424':{'en': 'Brasil Telecom GSM'},
'559999107':{'en': 'Vivo'},
'554599961':{'en': 'TIM'},
'554599963':{'en': 'TIM'},
'554599962':{'en': 'TIM'},
'554599965':{'en': 'TIM'},
'554599964':{'en': 'TIM'},
'554599967':{'en': 'TIM'},
'554599966':{'en': 'TIM'},
'556798445':{'en': 'Brasil Telecom GSM'},
'556798444':{'en': 'Brasil Telecom GSM'},
'556798111':{'en': 'TIM'},
'556798446':{'en': 'Brasil Telecom GSM'},
'556798117':{'en': 'TIM'},
'556798116':{'en': 'TIM'},
'556798115':{'en': 'TIM'},
'556798114':{'en': 'TIM'},
'59669689':{'en': 'SFR/Rife'},
'59669688':{'en': 'SFR/Rife'},
'7902365':{'en': 'Tele2', 'ru': 'Tele2'},
'59669683':{'en': 'Orange'},
'59669682':{'en': 'Orange'},
'59669681':{'en': 'Orange'},
'59669680':{'en': 'Orange'},
'59669687':{'en': 'SFR/Rife'},
'59669686':{'en': 'Orange'},
'59669685':{'en': 'Orange'},
'59669684':{'en': 'Orange'},
'658261':{'en': 'SingTel'},
'658619':{'en': 'SingTel'},
'66909':{'en': 'True Move'},
'555399928':{'en': 'Vivo'},
'555399929':{'en': 'Vivo'},
'555399927':{'en': 'Vivo'},
'62967901':{'en': 'Esia'},
'6225299':{'en': 'Esia'},
'6225298':{'en': 'Esia'},
'8525745':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'658267':{'en': 'SingTel'},
'658266':{'en': 'SingTel'},
'6236196':{'en': 'Esia'},
'559198480':{'en': 'Claro BR'},
'559198481':{'en': 'Claro BR'},
'559198482':{'en': 'Claro BR'},
'559198483':{'en': 'Claro BR'},
'559198484':{'en': 'Claro BR'},
'559198485':{'en': 'Claro BR'},
'559198486':{'en': 'Claro BR'},
'658260':{'en': 'SingTel'},
'658263':{'en': 'SingTel'},
'658262':{'en': 'SingTel'},
'558299631':{'en': 'TIM'},
'559898179':{'en': 'TIM'},
'559898178':{'en': 'TIM'},
'559898177':{'en': 'TIM'},
'559898176':{'en': 'TIM'},
'559898175':{'en': 'TIM'},
'559898174':{'en': 'TIM'},
'559898173':{'en': 'TIM'},
'559898172':{'en': 'TIM'},
'559898171':{'en': 'TIM'},
'557499198':{'en': 'TIM'},
'79004659':{'en': 'Tele2', 'ru': 'Tele2'},
'79004658':{'en': 'Tele2', 'ru': 'Tele2'},
'79004655':{'en': 'Tele2', 'ru': 'Tele2'},
'79004657':{'en': 'Tele2', 'ru': 'Tele2'},
'79004656':{'en': 'Tele2', 'ru': 'Tele2'},
'56992885':{'en': 'Bermann'},
'56992884':{'en': 'Arch Comunicaciones'},
'56992886':{'en': 'Bermann'},
'56992881':{'en': 'Arch Comunicaciones'},
'56992880':{'en': 'Arch Comunicaciones'},
'56992883':{'en': 'Arch Comunicaciones'},
'56992882':{'en': 'Arch Comunicaciones'},
'674558':{'en': 'Digicel'},
'62878':{'en': 'XL'},
'62879':{'en': 'XL'},
'62717999':{'en': 'Esia'},
'62717998':{'en': 'Esia'},
'62717997':{'en': 'Esia'},
'62717996':{'en': 'Esia'},
'62717995':{'en': 'Esia'},
'59469438':{'en': 'Orange'},
'7901390':{'en': 'Tele2', 'ru': 'Tele2'},
'59469434':{'en': 'Orange'},
'85517':{'en': 'Cellcard'},
'59469432':{'en': 'Orange'},
'59469433':{'en': 'Orange'},
'59469430':{'en': 'Orange'},
'59469431':{'en': 'Orange'},
'85518':{'en': 'Seatel'},
'554799601':{'en': 'TIM'},
'5906906':{'en': 'Orange'},
'557499199':{'en': 'TIM'},
'5906905':{'en': 'Orange'},
'559499665':{'en': 'Oi'},
'7994271':{'en': 'Tele2', 'ru': 'Tele2'},
'5906903':{'en': 'Orange'},
'5699488':{'en': 'Entel'},
'5699489':{'en': 'Entel'},
'5699486':{'en': 'Entel'},
'5699487':{'en': 'Entel'},
'559399153':{'en': 'Vivo'},
'559399152':{'en': 'Vivo'},
'559399151':{'en': 'Vivo'},
'557599983':{'en': 'Vivo'},
'559399157':{'en': 'Vivo'},
'557599985':{'en': 'Vivo'},
'559399155':{'en': 'Vivo'},
'559399154':{'en': 'Vivo'},
'557599988':{'en': 'Vivo'},
'559399159':{'en': 'Vivo'},
'559399158':{'en': 'Vivo'},
'5906908':{'en': 'Digicel'},
'59669619':{'en': 'Digicel'},
'5906909':{'en': 'SFR/Rife'},
'555598123':{'en': 'TIM'},
'555598122':{'en': 'TIM'},
'555598121':{'en': 'TIM'},
'60145':{'en': 'Celcom'},
'555598127':{'en': 'TIM'},
'555598126':{'en': 'TIM'},
'555598125':{'en': 'TIM'},
'555598124':{'en': 'TIM'},
'555598129':{'en': 'TIM'},
'555598128':{'en': 'TIM'},
'60148':{'en': 'Celcom'},
'60149':{'en': 'DiGi'},
'6011589':{'en': 'XOX'},
'7901134':{'en': 'Tele2', 'ru': 'Tele2'},
'555499639':{'en': 'Vivo'},
'555499638':{'en': 'Vivo'},
'7901130':{'en': 'Tele2', 'ru': 'Tele2'},
'7901131':{'en': 'Tele2', 'ru': 'Tele2'},
'7901645':{'en': 'Tele2', 'ru': 'Tele2'},
'555499633':{'en': 'Vivo'},
'555499632':{'en': 'Vivo'},
'555499631':{'en': 'Vivo'},
'555499637':{'en': 'Vivo'},
'555499636':{'en': 'Vivo'},
'555499635':{'en': 'Vivo'},
'555499634':{'en': 'Vivo'},
'557199162':{'en': 'TIM'},
'557199163':{'en': 'TIM'},
'557199161':{'en': 'TIM'},
'557199166':{'en': 'TIM'},
'557199167':{'en': 'TIM'},
'557199164':{'en': 'TIM'},
'557199165':{'en': 'TIM'},
'62816':{'en': 'IM3'},
'62817':{'en': 'XL'},
'557199168':{'en': 'TIM'},
'557199169':{'en': 'TIM'},
'62812':{'en': 'Telkomsel'},
'62813':{'en': 'Telkomsel'},
'62811':{'en': 'Telkomsel'},
'556199952':{'en': 'Vivo'},
'556199953':{'en': 'Vivo'},
'556199951':{'en': 'Vivo'},
'556199956':{'en': 'Vivo'},
'556199957':{'en': 'Vivo'},
'556199954':{'en': 'Vivo'},
'556199955':{'en': 'Vivo'},
'556199958':{'en': 'Vivo'},
'556199959':{'en': 'Vivo'},
'601111':{'en': 'U Mobile'},
'6227198':{'en': 'Esia'},
'601112':{'en': 'Maxis'},
'559998147':{'en': 'TIM'},
'601116':{'en': 'DiGi'},
'601119':{'en': 'Celcom'},
'6227193':{'en': 'Esia'},
'6227191':{'en': 'Esia'},
'6227196':{'en': 'Esia'},
'6227197':{'en': 'Esia'},
'6227194':{'en': 'Esia'},
'6227195':{'en': 'Esia'},
'556198577':{'en': 'Brasil Telecom GSM'},
'556198576':{'en': 'Brasil Telecom GSM'},
'790260':{'en': 'Tele2', 'ru': 'Tele2'},
'556198574':{'en': 'Brasil Telecom GSM'},
'556198573':{'en': 'Brasil Telecom GSM'},
'556198572':{'en': 'Brasil Telecom GSM'},
'556198571':{'en': 'Brasil Telecom GSM'},
'7901672':{'en': 'Tele2', 'ru': 'Tele2'},
'790268':{'en': 'Tele2', 'ru': 'Tele2'},
'790269':{'en': 'Tele2', 'ru': 'Tele2'},
'556198579':{'en': 'Brasil Telecom GSM'},
'6142000':{'en': 'Rail Corporation NSW'},
'6142001':{'en': 'Rail Corporation NSW'},
'6142002':{'en': 'Dialogue Communications'},
'556398441':{'en': 'Brasil Telecom GSM'},
'556398443':{'en': 'Brasil Telecom GSM'},
'556398442':{'en': 'Brasil Telecom GSM'},
'557399915':{'en': 'TIM'},
'557399914':{'en': 'TIM'},
'557399911':{'en': 'TIM'},
'557399913':{'en': 'TIM'},
'557399912':{'en': 'TIM'},
'556299903':{'en': 'Vivo'},
'557399919':{'en': 'TIM'},
'554999921':{'en': 'TIM'},
'554999923':{'en': 'TIM'},
'554999922':{'en': 'TIM'},
'554999925':{'en': 'TIM'},
'554999924':{'en': 'TIM'},
'554999927':{'en': 'TIM'},
'554999926':{'en': 'TIM'},
'554999929':{'en': 'TIM'},
'554999928':{'en': 'TIM'},
'658539':{'en': 'M1'},
'658538':{'en': 'StarHub'},
'790484':{'en': 'Tele2', 'ru': 'Tele2'},
'790485':{'en': 'Tele2', 'ru': 'Tele2'},
'790482':{'en': 'Tele2', 'ru': 'Tele2'},
'790483':{'en': 'Tele2', 'ru': 'Tele2'},
'790480':{'en': 'Tele2', 'ru': 'Tele2'},
'790481':{'en': 'Tele2', 'ru': 'Tele2'},
'55629964':{'en': 'Vivo'},
'55629965':{'en': 'Vivo'},
'55629962':{'en': 'Vivo'},
'55629963':{'en': 'Vivo'},
'55629960':{'en': 'Vivo'},
'55629961':{'en': 'Vivo'},
'555498142':{'en': 'TIM'},
'555498143':{'en': 'TIM'},
'555498416':{'en': 'Brasil Telecom GSM'},
'555498417':{'en': 'Brasil Telecom GSM'},
'555498146':{'en': 'TIM'},
'555498411':{'en': 'Brasil Telecom GSM'},
'555498144':{'en': 'TIM'},
'555498413':{'en': 'Brasil Telecom GSM'},
'555498148':{'en': 'TIM'},
'555498149':{'en': 'TIM'},
'555498418':{'en': 'Brasil Telecom GSM'},
'558599978':{'en': 'TIM'},
'558599979':{'en': 'TIM'},
'558599976':{'en': 'TIM'},
'558599977':{'en': 'TIM'},
'558599974':{'en': 'TIM'},
'558599975':{'en': 'TIM'},
'558599972':{'en': 'TIM'},
'558599973':{'en': 'TIM'},
'558599971':{'en': 'TIM'},
'62229613':{'en': 'Esia'},
'58426':{'en': 'Movilnet'},
'62751978':{'en': 'Esia'},
'62421993':{'en': 'Esia'},
'556298191':{'en': 'TIM'},
'559399102':{'en': 'Vivo'},
'79010135':{'en': 'Tele2', 'ru': 'Tele2'},
'559899969':{'en': 'Oi'},
'559399103':{'en': 'Vivo'},
'559899963':{'en': 'Oi'},
'556298194':{'en': 'TIM'},
'559899961':{'en': 'Oi'},
'559899967':{'en': 'Oi'},
'559899966':{'en': 'Oi'},
'559899965':{'en': 'Oi'},
'559899964':{'en': 'Oi'},
'556298196':{'en': 'TIM'},
'559399107':{'en': 'Vivo'},
'62218553':{'en': 'Esia'},
'62218555':{'en': 'Esia'},
'62218554':{'en': 'Esia'},
'62218557':{'en': 'Esia'},
'62218556':{'en': 'Esia'},
'62218559':{'en': 'Esia'},
'62218558':{'en': 'Esia'},
'55829933':{'en': 'Claro BR'},
'55829932':{'en': 'Claro BR'},
'6229299':{'en': 'Esia'},
'65924':{'en': 'StarHub'},
'65922':{'en': 'M1'},
'7994013':{'en': 'Tele2', 'ru': 'Tele2'},
'7994014':{'en': 'Tele2', 'ru': 'Tele2'},
'62721971':{'en': 'Esia'},
'62721972':{'en': 'Esia'},
'62721973':{'en': 'Esia'},
'558799628':{'en': 'TIM'},
'558799629':{'en': 'TIM'},
'658484':{'en': 'M1'},
'558799624':{'en': 'TIM'},
'558799625':{'en': 'TIM'},
'558799626':{'en': 'TIM'},
'558799627':{'en': 'TIM'},
'558799621':{'en': 'TIM'},
'558799622':{'en': 'TIM'},
'558799623':{'en': 'TIM'},
'658480':{'en': 'M1'},
'556699629':{'en': 'Vivo'},
'556699628':{'en': 'Vivo'},
'556699621':{'en': 'Vivo'},
'556699623':{'en': 'Vivo'},
'556699622':{'en': 'Vivo'},
'556699625':{'en': 'Vivo'},
'556699624':{'en': 'Vivo'},
'556699627':{'en': 'Vivo'},
'556699626':{'en': 'Vivo'},
'6251199':{'en': 'Esia'},
'793869':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'6251192':{'en': 'Esia'},
'6251191':{'en': 'Esia'},
'7931':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79019':{'en': 'Tele2', 'ru': 'Tele2'},
'7937':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'554999111':{'en': 'Vivo'},
'554999112':{'en': 'Vivo'},
'554999113':{'en': 'Vivo'},
'554999114':{'en': 'Vivo'},
'554999115':{'en': 'Vivo'},
'554999116':{'en': 'Vivo'},
'554999117':{'en': 'Vivo'},
'554999118':{'en': 'Vivo'},
'554999119':{'en': 'Vivo'},
'658328':{'en': 'StarHub'},
'658329':{'en': 'M1'},
'658324':{'en': 'M1'},
'658325':{'en': 'M1'},
'658326':{'en': 'M1'},
'658320':{'en': 'M1'},
'658321':{'en': 'StarHub'},
'658322':{'en': 'StarHub'},
'658323':{'en': 'M1'},
'559899129':{'en': 'Vivo'},
'56942':{'en': 'Entel'},
'56941':{'en': 'Movistar'},
'5596989':{'en': 'Oi'},
'5596988':{'en': 'Oi'},
'5596987':{'en': 'Oi'},
'5596986':{'en': 'Oi'},
'5596985':{'en': 'Oi'},
'658188':{'en': 'M1'},
'658189':{'en': 'StarHub'},
'658180':{'en': 'StarHub'},
'658181':{'en': 'SingTel'},
'658182':{'en': 'SingTel'},
'658183':{'en': 'StarHub'},
'658184':{'en': 'StarHub'},
'658185':{'en': 'StarHub'},
'658186':{'en': 'StarHub'},
'658187':{'en': 'StarHub'},
'556798113':{'en': 'TIM'},
'790011':{'en': 'Tele2', 'ru': 'Tele2'},
'790013':{'en': 'Tele2', 'ru': 'Tele2'},
'790012':{'en': 'Tele2', 'ru': 'Tele2'},
'556798112':{'en': 'TIM'},
'554599947':{'en': 'TIM'},
'554599946':{'en': 'TIM'},
'554599945':{'en': 'TIM'},
'554599944':{'en': 'TIM'},
'554599943':{'en': 'TIM'},
'554599942':{'en': 'TIM'},
'554599941':{'en': 'TIM'},
'557499135':{'en': 'TIM'},
'554599949':{'en': 'TIM'},
'554599948':{'en': 'TIM'},
'7958681':{'en': 'Tele2', 'ru': 'Tele2'},
'7958682':{'en': 'Tele2', 'ru': 'Tele2'},
'7958683':{'en': 'Tele2', 'ru': 'Tele2'},
'7958684':{'en': 'Tele2', 'ru': 'Tele2'},
'7958685':{'en': 'Tele2', 'ru': 'Tele2'},
'7958686':{'en': 'Tele2', 'ru': 'Tele2'},
'7958687':{'en': 'Tele2', 'ru': 'Tele2'},
'5585988':{'en': 'Oi'},
'558598210':{'en': 'Vivo'},
'558598211':{'en': 'Vivo'},
'558598212':{'en': 'Vivo'},
'558598213':{'en': 'Vivo'},
'558598214':{'en': 'Vivo'},
'558598215':{'en': 'Vivo'},
'558598216':{'en': 'Vivo'},
'558598217':{'en': 'Vivo'},
'67077':{'en': 'Timor Telecom'},
'8527071':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'559998129':{'en': 'TIM'},
'659279':{'en': 'M1'},
'659278':{'en': 'M1'},
'55489910':{'en': 'Vivo'},
'659271':{'en': 'StarHub'},
'659270':{'en': 'StarHub'},
'659273':{'en': 'M1'},
'659272':{'en': 'StarHub'},
'659275':{'en': 'M1'},
'659274':{'en': 'M1'},
'659277':{'en': 'M1'},
'659276':{'en': 'M1'},
'67381':{'en': 'B-Mobile'},
'7908379':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'67382':{'en': 'B-Mobile'},
'67387':{'en': 'DSTCom'},
'67386':{'en': 'DSTCom'},
'67389':{'en': 'DSTCom'},
'67388':{'en': 'DSTCom'},
'793933':{'en': 'TMT', 'ru': 'TMT'},
'559998123':{'en': 'TIM'},
'557199192':{'en': 'TIM'},
'793939':{'en': 'TMT', 'ru': 'TMT'},
'793938':{'en': 'TMT', 'ru': 'TMT'},
'559998121':{'en': 'TIM'},
'559898115':{'en': 'TIM'},
'559898114':{'en': 'TIM'},
'559898117':{'en': 'TIM'},
'559898116':{'en': 'TIM'},
'559898111':{'en': 'TIM'},
'559898113':{'en': 'TIM'},
'559898112':{'en': 'TIM'},
'559998127':{'en': 'TIM'},
'559898119':{'en': 'TIM'},
'559898118':{'en': 'TIM'},
'557199196':{'en': 'TIM'},
'557199195':{'en': 'TIM'},
'569639':{'en': 'Movistar'},
'569638':{'en': u('VTR M\u00f3vil')},
'569637':{'en': u('VTR M\u00f3vil')},
'569636':{'en': u('VTR M\u00f3vil')},
'569635':{'en': u('VTR M\u00f3vil')},
'569634':{'en': u('VTR M\u00f3vil')},
'569633':{'en': 'Movistar'},
'569632':{'en': 'Movistar'},
'569631':{'en': 'Movistar'},
'569630':{'en': 'Movistar'},
'7707':{'en': 'Tele2', 'ru': 'Tele2'},
'7705':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7702':{'en': 'Kcell/Activ', 'ru': 'Kcell/Activ'},
'7700':{'en': 'Altel', 'ru': u('\u0410\u041b\u0422\u0415\u041b')},
'7701':{'en': 'Kcell/Activ', 'ru': 'Kcell/Activ'},
'7708':{'en': 'Altel', 'ru': u('\u0410\u041b\u0422\u0415\u041b')},
'7908377':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'658736':{'en': 'SingTel'},
'9051616':{'en': 'Turkcell'},
'7908376':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'658735':{'en': 'SingTel'},
'658734':{'en': 'SingTel'},
'658733':{'en': 'M1'},
'658732':{'en': 'SingTel'},
'55929934':{'en': 'Vivo'},
'55929935':{'en': 'Vivo'},
'55929936':{'en': 'Vivo'},
'55929937':{'en': 'Vivo'},
'55929930':{'en': 'Vivo'},
'55929931':{'en': 'Vivo'},
'55929932':{'en': 'Vivo'},
'55929933':{'en': 'Vivo'},
'658730':{'en': 'SingTel'},
'55929938':{'en': 'Vivo'},
'55759981':{'en': 'Vivo'},
'55759982':{'en': 'Vivo'},
'55759983':{'en': 'Vivo'},
'63942':{'en': 'Sun'},
'62343924':{'en': 'Esia'},
'62343923':{'en': 'Esia'},
'62343922':{'en': 'Esia'},
'62343921':{'en': 'Esia'},
'62343920':{'en': 'Esia'},
'63946':{'en': 'Smart'},
'852568':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852569':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852566':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'5586986':{'en': 'Oi'},
'852564':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852562':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852563':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852560':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559199943':{'en': 'Oi'},
'5696919':{'en': 'Entel'},
'5696918':{'en': 'Entel'},
'5696910':{'en': u('Sociedad Comercial y de Ingenier\u00eda Swedcom')},
'559199941':{'en': 'Oi'},
'5696915':{'en': 'Entel'},
'5696917':{'en': 'Entel'},
'5696916':{'en': 'Entel'},
'861700':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'861701':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'861702':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'5586989':{'en': 'Oi'},
'861704':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'861705':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861706':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'861707':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'861708':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'861709':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'7908378':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'62294914':{'en': 'Esia'},
'558699951':{'en': 'TIM'},
'558699950':{'en': 'TIM'},
'5585981':{'en': 'Vivo'},
'7901118':{'en': 'Tele2', 'ru': 'Tele2'},
'7901119':{'en': 'Tele2', 'ru': 'Tele2'},
'7901117':{'en': 'Tele2', 'ru': 'Tele2'},
'62294912':{'en': 'Esia'},
'7901111':{'en': 'Tele2', 'ru': 'Tele2'},
'7902363':{'en': 'Tele2', 'ru': 'Tele2'},
'6275183':{'en': 'Esia'},
'6275188':{'en': 'Esia'},
'601139':{'en': 'U Mobile'},
'601138':{'en': 'Ceres'},
'556198519':{'en': 'Brasil Telecom GSM'},
'556198518':{'en': 'Brasil Telecom GSM'},
'556198515':{'en': 'Brasil Telecom GSM'},
'556198514':{'en': 'Brasil Telecom GSM'},
'556198517':{'en': 'Brasil Telecom GSM'},
'556198516':{'en': 'Brasil Telecom GSM'},
'556198511':{'en': 'Brasil Telecom GSM'},
'601136':{'en': 'DiGi'},
'556198513':{'en': 'Brasil Telecom GSM'},
'556198512':{'en': 'Brasil Telecom GSM'},
'790248':{'en': 'Tele2', 'ru': 'Tele2'},
'790249':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790244':{'en': 'Tele2', 'ru': 'Tele2'},
'790245':{'en': 'Tele2', 'ru': 'Tele2'},
'790247':{'en': 'Tele2', 'ru': 'Tele2'},
'790243':{'en': 'Tele2', 'ru': 'Tele2'},
'556199608':{'en': 'Vivo'},
'556199609':{'en': 'Vivo'},
'556199602':{'en': 'Vivo'},
'556199603':{'en': 'Vivo'},
'556199601':{'en': 'Vivo'},
'556199606':{'en': 'Vivo'},
'556199607':{'en': 'Vivo'},
'556199604':{'en': 'Vivo'},
'556199605':{'en': 'Vivo'},
'852530':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'591717':{'en': 'Entel'},
'591716':{'en': 'Entel'},
'799199':{'en': 'Tele2', 'ru': 'Tele2'},
'557199148':{'en': 'TIM'},
'557199149':{'en': 'TIM'},
'62831':{'en': 'AXIS'},
'62832':{'en': 'AXIS'},
'62833':{'en': 'AXIS'},
'557199141':{'en': 'TIM'},
'557199142':{'en': 'TIM'},
'557199143':{'en': 'TIM'},
'557199144':{'en': 'TIM'},
'557199145':{'en': 'TIM'},
'557199146':{'en': 'TIM'},
'557199147':{'en': 'TIM'},
'790053':{'en': 'Tele2', 'ru': 'Tele2'},
'790052':{'en': 'Tele2', 'ru': 'Tele2'},
'658513':{'en': 'StarHub'},
'658512':{'en': 'StarHub'},
'658511':{'en': 'SingTel'},
'658510':{'en': 'SingTel'},
'658514':{'en': 'StarHub'},
'658519':{'en': 'StarHub'},
'658518':{'en': 'SingTel'},
'554798407':{'en': 'Brasil Telecom GSM'},
'556199802':{'en': 'Vivo'},
'554798406':{'en': 'Brasil Telecom GSM'},
'556199803':{'en': 'Vivo'},
'554798405':{'en': 'Brasil Telecom GSM'},
'7958571':{'en': 'Tele2', 'ru': 'Tele2'},
'554798404':{'en': 'Brasil Telecom GSM'},
'591719':{'en': 'Entel'},
'554798403':{'en': 'Brasil Telecom GSM'},
'591718':{'en': 'Entel'},
'554798402':{'en': 'Brasil Telecom GSM'},
'559899189':{'en': 'Vivo'},
'559899188':{'en': 'Vivo'},
'558599956':{'en': 'TIM'},
'556298104':{'en': 'TIM'},
'558599951':{'en': 'TIM'},
'558599952':{'en': 'TIM'},
'558599953':{'en': 'TIM'},
'559899181':{'en': 'Vivo'},
'556199808':{'en': 'Vivo'},
'559899183':{'en': 'Vivo'},
'559899182':{'en': 'Vivo'},
'559899185':{'en': 'Vivo'},
'559899184':{'en': 'Vivo'},
'559899187':{'en': 'Vivo'},
'559899186':{'en': 'Vivo'},
'8536391':{'en': 'China Telecom'},
'8525700':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'559399191':{'en': 'Vivo'},
'55539916':{'en': 'Claro BR'},
'55539915':{'en': 'Claro BR'},
'55539914':{'en': 'Claro BR'},
'55539913':{'en': 'Claro BR'},
'55539912':{'en': 'Claro BR'},
'55539911':{'en': 'Claro BR'},
'55539910':{'en': 'Claro BR'},
'559598112':{'en': 'TIM'},
'559598113':{'en': 'TIM'},
'556599653':{'en': 'Vivo'},
'559598111':{'en': 'TIM'},
'559598116':{'en': 'TIM'},
'559598117':{'en': 'TIM'},
'559598114':{'en': 'TIM'},
'559598115':{'en': 'TIM'},
'556599659':{'en': 'Vivo'},
'556599658':{'en': 'Vivo'},
'559598118':{'en': 'TIM'},
'559598119':{'en': 'TIM'},
'554798409':{'en': 'Brasil Telecom GSM'},
'554798408':{'en': 'Brasil Telecom GSM'},
'55969840':{'en': 'Claro BR'},
'559899981':{'en': 'Oi'},
'852531':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559899983':{'en': 'Oi'},
'559899982':{'en': 'Oi'},
'559899985':{'en': 'Oi'},
'559899984':{'en': 'Oi'},
'62283922':{'en': 'Esia'},
'62283923':{'en': 'Esia'},
'559899988':{'en': 'Oi'},
'8536393':{'en': 'CTM'},
'852533':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852532':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852534':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852536':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'557599139':{'en': 'TIM'},
'557599138':{'en': 'TIM'},
'557599131':{'en': 'TIM'},
'557599133':{'en': 'TIM'},
'557599132':{'en': 'TIM'},
'557599135':{'en': 'TIM'},
'557599134':{'en': 'TIM'},
'557599137':{'en': 'TIM'},
'557599136':{'en': 'TIM'},
'5699587':{'en': 'Claro'},
'5699586':{'en': 'Claro'},
'5699585':{'en': 'Claro'},
'5699584':{'en': 'Movistar'},
'5699583':{'en': 'Movistar'},
'5699582':{'en': 'Movistar'},
'5699581':{'en': 'Movistar'},
'5699580':{'en': 'Movistar'},
'7902247':{'en': 'Tele2', 'ru': 'Tele2'},
'5699589':{'en': 'Claro'},
'5699588':{'en': 'Claro'},
'558899959':{'en': 'TIM'},
'558899958':{'en': 'TIM'},
'558899957':{'en': 'TIM'},
'558899956':{'en': 'TIM'},
'558899955':{'en': 'TIM'},
'558899954':{'en': 'TIM'},
'558899953':{'en': 'TIM'},
'558899952':{'en': 'TIM'},
'558899951':{'en': 'TIM'},
'79088':{'en': 'Tele2', 'ru': 'Tele2'},
'6225141':{'en': 'Esia'},
'6225140':{'en': 'Esia'},
'559398125':{'en': 'TIM'},
'559398124':{'en': 'TIM'},
'559398121':{'en': 'TIM'},
'559398123':{'en': 'TIM'},
'559398122':{'en': 'TIM'},
'6011568':{'en': 'XOX'},
'6011569':{'en': 'XOX'},
'5939588':{'en': 'Movistar'},
'5939589':{'en': 'Movistar'},
'5939586':{'en': 'Movistar'},
'5939587':{'en': 'Movistar'},
'556299993':{'en': 'Vivo'},
'556299992':{'en': 'Vivo'},
'556299991':{'en': 'Vivo'},
'556998458':{'en': 'Brasil Telecom GSM'},
'556998459':{'en': 'Brasil Telecom GSM'},
'556299995':{'en': 'Vivo'},
'556299994':{'en': 'Vivo'},
'556998454':{'en': 'Brasil Telecom GSM'},
'556998455':{'en': 'Brasil Telecom GSM'},
'556299999':{'en': 'Vivo'},
'556299998':{'en': 'Vivo'},
'557799115':{'en': 'TIM'},
'556998451':{'en': 'Brasil Telecom GSM'},
'557799117':{'en': 'TIM'},
'556998453':{'en': 'Brasil Telecom GSM'},
'556798427':{'en': 'Brasil Telecom GSM'},
'556699609':{'en': 'Vivo'},
'556699608':{'en': 'Vivo'},
'556699607':{'en': 'Vivo'},
'556699606':{'en': 'Vivo'},
'556699605':{'en': 'Vivo'},
'556699604':{'en': 'Vivo'},
'556699603':{'en': 'Vivo'},
'556798137':{'en': 'TIM'},
'556699601':{'en': 'Vivo'},
'556798424':{'en': 'Brasil Telecom GSM'},
'556798131':{'en': 'TIM'},
'62218955':{'en': 'Esia'},
'62218954':{'en': 'Esia'},
'62218957':{'en': 'Esia'},
'62218956':{'en': 'Esia'},
'556798133':{'en': 'TIM'},
'62218959':{'en': 'Esia'},
'62218958':{'en': 'Esia'},
'7995210':{'en': 'Tele2', 'ru': 'Tele2'},
'55639997':{'en': 'Vivo'},
'7995213':{'en': 'Tele2', 'ru': 'Tele2'},
'55639998':{'en': 'Vivo'},
'556798138':{'en': 'TIM'},
'554999176':{'en': 'Vivo'},
'554999177':{'en': 'Vivo'},
'554999174':{'en': 'Vivo'},
'554999175':{'en': 'Vivo'},
'554999172':{'en': 'Vivo'},
'556798429':{'en': 'Brasil Telecom GSM'},
'5696768':{'en': 'Entel'},
'5696769':{'en': 'Entel'},
'5696766':{'en': 'Entel'},
'5696767':{'en': 'Entel'},
'5696764':{'en': 'Cibeles Telecom'},
'5696765':{'en': 'Entel'},
'5696762':{'en': 'Telsur'},
'5696760':{'en': 'Telsur'},
'5696761':{'en': 'Telsur'},
'7904889':{'en': 'Tele2', 'ru': 'Tele2'},
'7904888':{'en': 'Tele2', 'ru': 'Tele2'},
'7904887':{'en': 'Tele2', 'ru': 'Tele2'},
'7904886':{'en': 'Tele2', 'ru': 'Tele2'},
'7904885':{'en': 'Tele2', 'ru': 'Tele2'},
'7904884':{'en': 'Tele2', 'ru': 'Tele2'},
'7904883':{'en': 'Tele2', 'ru': 'Tele2'},
'7904882':{'en': 'Tele2', 'ru': 'Tele2'},
'7904880':{'en': 'Tele2', 'ru': 'Tele2'},
'8536881':{'en': 'CTM'},
'79777':{'en': 'Tele2', 'ru': 'Tele2'},
'790031':{'en': 'Tele2', 'ru': 'Tele2'},
'790030':{'en': 'Tele2', 'ru': 'Tele2'},
'790036':{'en': 'Tele2', 'ru': 'Tele2'},
'790035':{'en': 'Tele2', 'ru': 'Tele2'},
'790039':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'790038':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7902240':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'601094':{'en': 'DiGi'},
'601095':{'en': 'DiGi'},
'601096':{'en': 'DiGi'},
'601097':{'en': 'DiGi'},
'601090':{'en': 'DiGi'},
'601091':{'en': 'DiGi'},
'601092':{'en': 'DiGi'},
'601093':{'en': 'DiGi'},
'601098':{'en': 'DiGi'},
'62199':{'en': 'Esia'},
'5939820':{'en': 'CNT'},
'7996299':{'en': 'Tele2', 'ru': 'Tele2'},
'559998138':{'en': 'TIM'},
'55919843':{'en': 'Claro BR'},
'55919842':{'en': 'Claro BR'},
'55919841':{'en': 'Claro BR'},
'55919840':{'en': 'Claro BR'},
'55919847':{'en': 'Claro BR'},
'55919846':{'en': 'Claro BR'},
'55919845':{'en': 'Claro BR'},
'55919844':{'en': 'Claro BR'},
'6221411':{'en': 'Esia'},
'6221410':{'en': 'Esia'},
'7900373':{'en': 'Tele2', 'ru': 'Tele2'},
'6011270':{'en': 'U Mobile'},
'6011271':{'en': 'U Mobile'},
'6011272':{'en': 'U Mobile'},
'6011273':{'en': 'U Mobile'},
'554599929':{'en': 'TIM'},
'554599928':{'en': 'TIM'},
'6011276':{'en': 'Maxis'},
'6011277':{'en': 'Maxis'},
'554599925':{'en': 'TIM'},
'554599924':{'en': 'TIM'},
'554599927':{'en': 'TIM'},
'554599926':{'en': 'TIM'},
'554599921':{'en': 'TIM'},
'557499115':{'en': 'TIM'},
'557499116':{'en': 'TIM'},
'554599922':{'en': 'TIM'},
'7900408':{'en': 'Tele2', 'ru': 'Tele2'},
'6221417':{'en': 'Esia'},
'7900376':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'569659':{'en': 'Entel'},
'569658':{'en': 'Entel'},
'7900378':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'569651':{'en': 'Entel'},
'569650':{'en': 'Entel'},
'569653':{'en': 'Claro'},
'569652':{'en': 'Claro'},
'569655':{'en': 'Claro'},
'569654':{'en': 'Claro'},
'569657':{'en': 'Claro'},
'569656':{'en': 'Claro'},
'658706':{'en': 'SingTel'},
'658707':{'en': 'SingTel'},
'658704':{'en': 'SingTel'},
'658705':{'en': 'SingTel'},
'658702':{'en': 'SingTel'},
'658703':{'en': 'SingTel'},
'658700':{'en': 'StarHub'},
'658701':{'en': 'SingTel'},
'658708':{'en': 'SingTel'},
'658709':{'en': 'SingTel'},
'559199641':{'en': 'Oi'},
'559199642':{'en': 'Oi'},
'556499699':{'en': 'Vivo'},
'556499695':{'en': 'Vivo'},
'65830':{'en': 'SingTel'},
'7901800':{'en': 'Tele2', 'ru': 'Tele2'},
'7901801':{'en': 'Tele2', 'ru': 'Tele2'},
'55869950':{'en': 'Claro BR'},
'554998419':{'en': 'Brasil Telecom GSM'},
'7901804':{'en': 'Tele2', 'ru': 'Tele2'},
'7901805':{'en': 'Tele2', 'ru': 'Tele2'},
'7901806':{'en': 'Tele2', 'ru': 'Tele2'},
'7901807':{'en': 'Tele2', 'ru': 'Tele2'},
'5588992':{'en': 'Claro BR'},
'559898139':{'en': 'TIM'},
'559898138':{'en': 'TIM'},
'556899961':{'en': 'Vivo'},
'559898133':{'en': 'TIM'},
'559898132':{'en': 'TIM'},
'559898131':{'en': 'TIM'},
'559898137':{'en': 'TIM'},
'559898136':{'en': 'TIM'},
'559898135':{'en': 'TIM'},
'559898134':{'en': 'TIM'},
'554998411':{'en': 'Brasil Telecom GSM'},
'556899964':{'en': 'Vivo'},
'556899965':{'en': 'Vivo'},
'852548':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852549':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559799168':{'en': 'Vivo'},
'559799169':{'en': 'Vivo'},
'556899966':{'en': 'Vivo'},
'559799162':{'en': 'Vivo'},
'559799163':{'en': 'Vivo'},
'852542':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'559799161':{'en': 'Vivo'},
'559799166':{'en': 'Vivo'},
'559799167':{'en': 'Vivo'},
'559799164':{'en': 'Vivo'},
'559799165':{'en': 'Vivo'},
'559498409':{'en': 'Claro BR'},
'559498408':{'en': 'Claro BR'},
'559498407':{'en': 'Claro BR'},
'559498406':{'en': 'Claro BR'},
'559498405':{'en': 'Claro BR'},
'559498404':{'en': 'Claro BR'},
'559498403':{'en': 'Claro BR'},
'559498402':{'en': 'Claro BR'},
'559498401':{'en': 'Claro BR'},
'62358996':{'en': 'Esia'},
'62358997':{'en': 'Esia'},
'62358995':{'en': 'Esia'},
'62358998':{'en': 'Esia'},
'62358999':{'en': 'Esia'},
'7936222':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'556798134':{'en': 'TIM'},
'55649997':{'en': 'Vivo'},
'55649998':{'en': 'Vivo'},
'554598409':{'en': 'Brasil Telecom GSM'},
'601877':{'en': 'TM Homeline'},
'601870':{'en': 'YTL'},
'601871':{'en': 'YTL'},
'601878':{'en': 'U Mobile'},
'62262925':{'en': 'Esia'},
'62262924':{'en': 'Esia'},
'62262927':{'en': 'Esia'},
'62262926':{'en': 'Esia'},
'62262921':{'en': 'Esia'},
'62262920':{'en': 'Esia'},
'62262923':{'en': 'Esia'},
'62262922':{'en': 'Esia'},
'558299621':{'en': 'TIM'},
'558799988':{'en': 'TIM'},
'558699979':{'en': 'TIM'},
'558699978':{'en': 'TIM'},
'558699973':{'en': 'TIM'},
'558699972':{'en': 'TIM'},
'558699971':{'en': 'TIM'},
'558699977':{'en': 'TIM'},
'558699976':{'en': 'TIM'},
'558699975':{'en': 'TIM'},
'558699974':{'en': 'TIM'},
'5917342':{'en': 'Entel'},
'5993181':{'en': 'Eutel'},
'5993184':{'en': 'Eutel'},
'5993185':{'en': 'Eutel'},
'5993186':{'en': 'Eutel'},
'5993187':{'en': 'Eutel'},
'5993188':{'en': 'Eutel'},
'6223391':{'en': 'Esia'},
'5917343':{'en': 'Entel'},
'853668':{'en': 'CTM'},
'556199918':{'en': 'Vivo'},
'556199919':{'en': 'Vivo'},
'556199916':{'en': 'Vivo'},
'556199917':{'en': 'Vivo'},
'556199914':{'en': 'Vivo'},
'556199915':{'en': 'Vivo'},
'556199912':{'en': 'Vivo'},
'556199913':{'en': 'Vivo'},
'556199911':{'en': 'Vivo'},
'556198533':{'en': 'Brasil Telecom GSM'},
'556198532':{'en': 'Brasil Telecom GSM'},
'556198531':{'en': 'Brasil Telecom GSM'},
'556198537':{'en': 'Brasil Telecom GSM'},
'556198536':{'en': 'Brasil Telecom GSM'},
'556198535':{'en': 'Brasil Telecom GSM'},
'556198534':{'en': 'Brasil Telecom GSM'},
'556198539':{'en': 'Brasil Telecom GSM'},
'556198538':{'en': 'Brasil Telecom GSM'},
'65975':{'en': 'SingTel'},
'797820':{'en': 'MTS', 'ru': 'MTS'},
'556199621':{'en': 'Vivo'},
'556199622':{'en': 'Vivo'},
'556199623':{'en': 'Vivo'},
'556398409':{'en': 'Brasil Telecom GSM'},
'556398408':{'en': 'Brasil Telecom GSM'},
'556199626':{'en': 'Vivo'},
'556199627':{'en': 'Vivo'},
'556398405':{'en': 'Brasil Telecom GSM'},
'556398404':{'en': 'Brasil Telecom GSM'},
'556398407':{'en': 'Brasil Telecom GSM'},
'556398406':{'en': 'Brasil Telecom GSM'},
'556398401':{'en': 'Brasil Telecom GSM'},
'556398403':{'en': 'Brasil Telecom GSM'},
'556398402':{'en': 'Brasil Telecom GSM'},
'658283':{'en': 'SingTel'},
'658282':{'en': 'M1'},
'658281':{'en': 'SingTel'},
'658280':{'en': 'SingTel'},
'658287':{'en': 'SingTel'},
'658286':{'en': 'SingTel'},
'658285':{'en': 'SingTel'},
'658284':{'en': 'SingTel'},
'658289':{'en': 'SingTel'},
'658288':{'en': 'M1'},
'595961':{'en': 'VOX'},
'595962':{'en': 'VOX'},
'595969':{'en': 'VOX'},
'558698141':{'en': 'Vivo'},
'558698140':{'en': 'Vivo'},
'558698143':{'en': 'Vivo'},
'558698142':{'en': 'Vivo'},
'62856':{'en': 'IM3'},
'558698144':{'en': 'Vivo'},
'557199128':{'en': 'TIM'},
'557199129':{'en': 'TIM'},
'557199126':{'en': 'TIM'},
'557199127':{'en': 'TIM'},
'557199124':{'en': 'TIM'},
'557199125':{'en': 'TIM'},
'557199122':{'en': 'TIM'},
'557199123':{'en': 'TIM'},
'557199121':{'en': 'TIM'},
'554999969':{'en': 'TIM'},
'554999968':{'en': 'TIM'},
'554999965':{'en': 'TIM'},
'554999964':{'en': 'TIM'},
'554999967':{'en': 'TIM'},
'554999966':{'en': 'TIM'},
'554999963':{'en': 'TIM'},
'9050':{'en': 'Turk Telekom'},
'556899967':{'en': 'Vivo'},
'5939624':{'en': 'CNT'},
'558299313':{'en': 'Claro BR'},
'558299312':{'en': 'Claro BR'},
'558299311':{'en': 'Claro BR'},
'558299310':{'en': 'Claro BR'},
'558299317':{'en': 'Claro BR'},
'558299316':{'en': 'Claro BR'},
'558299315':{'en': 'Claro BR'},
'558299314':{'en': 'Claro BR'},
'558299318':{'en': 'Claro BR'},
'557199690':{'en': 'Vivo'},
'557199691':{'en': 'Vivo'},
'557199692':{'en': 'Vivo'},
'793877':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'793870':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'793878':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'793879':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'62215149':{'en': 'Esia'},
'62215148':{'en': 'Esia'},
'62215145':{'en': 'Esia'},
'62215144':{'en': 'Esia'},
'62215147':{'en': 'Esia'},
'62215146':{'en': 'Esia'},
'62215141':{'en': 'Esia'},
'62215143':{'en': 'Esia'},
'62215142':{'en': 'Esia'},
'556599677':{'en': 'Vivo'},
'556599676':{'en': 'Vivo'},
'556599675':{'en': 'Vivo'},
'556599674':{'en': 'Vivo'},
'556599673':{'en': 'Vivo'},
'556599672':{'en': 'Vivo'},
'556599671':{'en': 'Vivo'},
'658721':{'en': 'M1'},
'790839':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790838':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790833':{'en': 'TMT', 'ru': 'TMT'},
'790832':{'en': 'Tele2', 'ru': 'Tele2'},
'790831':{'en': 'Tele2', 'ru': 'Tele2'},
'790830':{'en': 'Tele2', 'ru': 'Tele2'},
'62751977':{'en': 'Esia'},
'790835':{'en': 'MTS', 'ru': 'MTS'},
'659629':{'en': 'SingTel'},
'85365427':{'en': 'China Telecom'},
'557599119':{'en': 'TIM'},
'557599118':{'en': 'TIM'},
'557599117':{'en': 'TIM'},
'557599116':{'en': 'TIM'},
'557599115':{'en': 'TIM'},
'557599114':{'en': 'TIM'},
'557599113':{'en': 'TIM'},
'557599112':{'en': 'TIM'},
'557599111':{'en': 'TIM'},
'55759823':{'en': 'Claro BR'},
'55759822':{'en': 'Claro BR'},
'55759821':{'en': 'Claro BR'},
'55759820':{'en': 'Claro BR'},
'55759826':{'en': 'Claro BR'},
'55759825':{'en': 'Claro BR'},
'55759824':{'en': 'Claro BR'},
'7958839':{'en': 'Tele2', 'ru': 'Tele2'},
'7958838':{'en': 'Tele2', 'ru': 'Tele2'},
'558899935':{'en': 'TIM'},
'558899934':{'en': 'TIM'},
'558899937':{'en': 'TIM'},
'558899936':{'en': 'TIM'},
'558899931':{'en': 'TIM'},
'554798424':{'en': 'Brasil Telecom GSM'},
'558899933':{'en': 'TIM'},
'558899932':{'en': 'TIM'},
'554798429':{'en': 'Brasil Telecom GSM'},
'554798428':{'en': 'Brasil Telecom GSM'},
'558899939':{'en': 'TIM'},
'558899938':{'en': 'TIM'},
'6236285':{'en': 'Esia'},
'556699999':{'en': 'Vivo'},
'556699998':{'en': 'Vivo'},
'556699997':{'en': 'Vivo'},
'556699996':{'en': 'Vivo'},
'556699995':{'en': 'Vivo'},
'556699994':{'en': 'Vivo'},
'556699993':{'en': 'Vivo'},
'556699992':{'en': 'Vivo'},
'556699991':{'en': 'Vivo'},
'62353999':{'en': 'Esia'},
'62353998':{'en': 'Esia'},
'62353997':{'en': 'Esia'},
'62353996':{'en': 'Esia'},
'62353995':{'en': 'Esia'},
'62751979':{'en': 'Esia'},
'557799136':{'en': 'TIM'},
'557799135':{'en': 'TIM'},
'557799131':{'en': 'TIM'},
'556699665':{'en': 'Vivo'},
'556699664':{'en': 'Vivo'},
'556699667':{'en': 'Vivo'},
'556699666':{'en': 'Vivo'},
'556699661':{'en': 'Vivo'},
'556699663':{'en': 'Vivo'},
'556699662':{'en': 'Vivo'},
'84868':{'en': 'Viettel Mobile'},
'556699669':{'en': 'Vivo'},
'556699668':{'en': 'Vivo'},
'55749811':{'en': 'Claro BR'},
'55749810':{'en': 'Claro BR'},
'7902812':{'en': 'Tele2', 'ru': 'Tele2'},
'7902813':{'en': 'Tele2', 'ru': 'Tele2'},
'7902816':{'en': 'Tele2', 'ru': 'Tele2'},
'7902817':{'en': 'Tele2', 'ru': 'Tele2'},
'7902814':{'en': 'Tele2', 'ru': 'Tele2'},
'7902815':{'en': 'Tele2', 'ru': 'Tele2'},
'7902818':{'en': 'Tele2', 'ru': 'Tele2'},
'7902819':{'en': 'Tele2', 'ru': 'Tele2'},
'555499998':{'en': 'Vivo'},
'555499999':{'en': 'Vivo'},
'555499992':{'en': 'Vivo'},
'555499993':{'en': 'Vivo'},
'555499991':{'en': 'Vivo'},
'555499996':{'en': 'Vivo'},
'555499997':{'en': 'Vivo'},
'555499994':{'en': 'Vivo'},
'555499995':{'en': 'Vivo'},
'554999158':{'en': 'Vivo'},
'554999159':{'en': 'Vivo'},
'554999154':{'en': 'Vivo'},
'554999155':{'en': 'Vivo'},
'554999156':{'en': 'Vivo'},
'554999157':{'en': 'Vivo'},
'554999151':{'en': 'Vivo'},
'554999152':{'en': 'Vivo'},
'554999153':{'en': 'Vivo'},
'8536605':{'en': 'China Telecom'},
'554899642':{'en': 'TIM'},
'554899623':{'en': 'TIM'},
'8536377':{'en': 'China Telecom'},
'8536376':{'en': 'China Telecom'},
'8536375':{'en': 'China Telecom'},
'8536374':{'en': 'China Telecom'},
'8536373':{'en': 'China Telecom'},
'8536372':{'en': 'China Telecom'},
'8536371':{'en': 'China Telecom'},
'8536370':{'en': 'China Telecom'},
'8536379':{'en': '3'},
'8536378':{'en': '3'},
'559499903':{'en': 'Oi'},
'57304':{'en': 'Une'},
'569817':{'en': 'Movistar'},
'569816':{'en': 'Movistar'},
'569815':{'en': 'Entel'},
'5583991':{'en': 'Claro BR'},
'569813':{'en': 'Entel'},
'569812':{'en': 'Movistar'},
'569811':{'en': 'Entel'},
'569819':{'en': 'Entel'},
'569818':{'en': 'Entel'},
'57300':{'en': 'Tigo'},
'554899625':{'en': 'TIM'},
'57301':{'en': 'Tigo'},
'659120':{'en': 'SingTel'},
'559999132':{'en': 'Vivo'},
'601078':{'en': 'Tune Talk'},
'601079':{'en': 'Tune Talk'},
'601076':{'en': 'DiGi'},
'601077':{'en': 'Tune Talk'},
'601070':{'en': 'Maxis'},
'556298195':{'en': 'TIM'},
'554899624':{'en': 'TIM'},
'6254292':{'en': 'Esia'},
'558198261':{'en': 'Vivo'},
'558198260':{'en': 'Vivo'},
'558198263':{'en': 'Vivo'},
'558198262':{'en': 'Vivo'},
'554899627':{'en': 'TIM'},
'6232291':{'en': 'Esia'},
'795213':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795214':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'5699289':{'en': 'Entel'},
'554899626':{'en': 'TIM'},
'5699280':{'en': 'Movistar'},
'5699281':{'en': 'Movistar'},
'5699282':{'en': 'Movistar'},
'5699283':{'en': 'Movistar'},
'5699284':{'en': 'Movistar'},
'5699285':{'en': 'Instabeep'},
'5699286':{'en': 'Movistar'},
'5699287':{'en': 'Movistar'},
'62228812':{'en': 'Esia'},
'62228811':{'en': 'Esia'},
'62228810':{'en': 'Esia'},
'658494':{'en': 'SingTel'},
'658495':{'en': 'SingTel'},
'658492':{'en': 'SingTel'},
'658493':{'en': 'SingTel'},
'658490':{'en': 'SingTel'},
'658491':{'en': 'SingTel'},
'658498':{'en': 'StarHub'},
'658499':{'en': 'SingTel'},
'85365426':{'en': 'China Telecom'},
'569673':{'en': 'Claro'},
'569672':{'en': 'Claro'},
'569671':{'en': 'Claro'},
'569670':{'en': 'Claro'},
'569675':{'en': 'Claro'},
'569674':{'en': 'Claro'},
'7900550':{'en': 'Tele2', 'ru': 'Tele2'},
'85365425':{'en': 'China Telecom'},
'67668':{'en': 'U-Call'},
'62324999':{'en': 'Esia'},
'62324998':{'en': 'Esia'},
'658722':{'en': 'StarHub'},
'658723':{'en': 'M1'},
'658724':{'en': 'StarHub'},
'658725':{'en': 'StarHub'},
'658726':{'en': 'StarHub'},
'658727':{'en': 'StarHub'},
'658728':{'en': 'StarHub'},
'658729':{'en': 'StarHub'},
'62324995':{'en': 'Esia'},
'62324997':{'en': 'Esia'},
'62324996':{'en': 'Esia'},
'85365423':{'en': '3'},
'7902311':{'en': 'Tele2', 'ru': 'Tele2'},
'7902310':{'en': 'Tele2', 'ru': 'Tele2'},
'7902313':{'en': 'Tele2', 'ru': 'Tele2'},
'7902312':{'en': 'Tele2', 'ru': 'Tele2'},
'7902314':{'en': 'Tele2', 'ru': 'Tele2'},
'852522':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852523':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852520':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852521':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852526':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852527':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852524':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'55519944':{'en': 'Claro BR'},
'7900219':{'en': 'Tele2', 'ru': 'Tele2'},
'55519942':{'en': 'Claro BR'},
'55519943':{'en': 'Claro BR'},
'55519940':{'en': 'Claro BR'},
'55519941':{'en': 'Claro BR'},
'5579999':{'en': 'Vivo'},
'5579998':{'en': 'Vivo'},
'5699969':{'en': 'Entel'},
'5699968':{'en': 'Entel'},
'9053383':{'en': 'Kuzey Kibris Turkcell'},
'8525748':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'5699963':{'en': 'Movistar'},
'5699962':{'en': 'Movistar'},
'601857':{'en': 'U Mobile'},
'601858':{'en': 'YTL'},
'601859':{'en': 'YTL'},
'86178':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'65979':{'en': 'M1'},
'558699991':{'en': 'TIM'},
'65974':{'en': 'M1'},
'558699993':{'en': 'TIM'},
'558699992':{'en': 'TIM'},
'558699995':{'en': 'TIM'},
'558699994':{'en': 'TIM'},
'558699997':{'en': 'TIM'},
'558699996':{'en': 'TIM'},
'558699999':{'en': 'TIM'},
'558699998':{'en': 'TIM'},
'65976':{'en': 'M1'},
'7901150':{'en': 'Tele2', 'ru': 'Tele2'},
'7901157':{'en': 'Tele2', 'ru': 'Tele2'},
'65972':{'en': 'SingTel'},
'65973':{'en': 'SingTel'},
'659194':{'en': 'M1'},
'6236199':{'en': 'Esia'},
'556199934':{'en': 'Vivo'},
'556199935':{'en': 'Vivo'},
'556199936':{'en': 'Vivo'},
'556199937':{'en': 'Vivo'},
'556199931':{'en': 'Vivo'},
'556199932':{'en': 'Vivo'},
'556199933':{'en': 'Vivo'},
'556199938':{'en': 'Vivo'},
'556199939':{'en': 'Vivo'},
'795027':{'en': 'Tele2', 'ru': 'Tele2'},
'795026':{'en': 'Tele2', 'ru': 'Tele2'},
'795025':{'en': 'Tele2', 'ru': 'Tele2'},
'795024':{'en': 'Tele2', 'ru': 'Tele2'},
'795023':{'en': 'MTS', 'ru': 'MTS'},
'795022':{'en': 'Tele2', 'ru': 'Tele2'},
'795021':{'en': 'Tele2', 'ru': 'Tele2'},
'795020':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795029':{'en': 'Tele2', 'ru': 'Tele2'},
'795028':{'en': 'Tele2', 'ru': 'Tele2'},
'556199646':{'en': 'Vivo'},
'556199647':{'en': 'Vivo'},
'556199644':{'en': 'Vivo'},
'556199645':{'en': 'Vivo'},
'556199642':{'en': 'Vivo'},
'556199643':{'en': 'Vivo'},
'556398425':{'en': 'Brasil Telecom GSM'},
'556199641':{'en': 'Vivo'},
'556398429':{'en': 'Brasil Telecom GSM'},
'556398428':{'en': 'Brasil Telecom GSM'},
'57319':{'en': 'Virgin Mobile'},
'57318':{'en': 'Movistar'},
'556199648':{'en': 'Vivo'},
'556199649':{'en': 'Vivo'},
'556998128':{'en': 'TIM'},
'658269':{'en': 'SingTel'},
'658268':{'en': 'StarHub'},
'7902559':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'658265':{'en': 'SingTel'},
'556998121':{'en': 'TIM'},
'556998122':{'en': 'TIM'},
'556998123':{'en': 'TIM'},
'556998124':{'en': 'TIM'},
'556998125':{'en': 'TIM'},
'556998126':{'en': 'TIM'},
'556998127':{'en': 'TIM'},
'799220':{'en': 'Tele2', 'ru': 'Tele2'},
'557199104':{'en': 'TIM'},
'557199105':{'en': 'TIM'},
'557199106':{'en': 'TIM'},
'557199107':{'en': 'TIM'},
'557199101':{'en': 'TIM'},
'557199102':{'en': 'TIM'},
'557199103':{'en': 'TIM'},
'557199108':{'en': 'TIM'},
'557199109':{'en': 'TIM'},
'62877':{'en': 'XL'},
'790170':{'en': 'Tele2', 'ru': 'Tele2'},
'555498124':{'en': 'TIM'},
'555498125':{'en': 'TIM'},
'555498126':{'en': 'TIM'},
'555498127':{'en': 'TIM'},
'555498121':{'en': 'TIM'},
'555498122':{'en': 'TIM'},
'555498123':{'en': 'TIM'},
'555498128':{'en': 'TIM'},
'555498129':{'en': 'TIM'},
'6011623':{'en': 'U Mobile'},
'6011622':{'en': 'U Mobile'},
'6011621':{'en': 'U Mobile'},
'6011620':{'en': 'U Mobile'},
'6011624':{'en': 'U Mobile'},
'556599619':{'en': 'Vivo'},
'556599618':{'en': 'Vivo'},
'55829930':{'en': 'Claro BR'},
'556599615':{'en': 'Vivo'},
'556599614':{'en': 'Vivo'},
'556599617':{'en': 'Vivo'},
'556599616':{'en': 'Vivo'},
'556599611':{'en': 'Vivo'},
'556599613':{'en': 'Vivo'},
'556599612':{'en': 'Vivo'},
'558399362':{'en': 'Claro BR'},
'68586':{'en': 'Digicel'},
'68587':{'en': 'Digicel'},
'68584':{'en': 'Digicel'},
'68585':{'en': 'Digicel'},
'68583':{'en': 'Digicel'},
'62736998':{'en': 'Esia'},
'62736999':{'en': 'Esia'},
'659350':{'en': 'SingTel'},
'659351':{'en': 'SingTel'},
'557599175':{'en': 'TIM'},
'557599174':{'en': 'TIM'},
'557599177':{'en': 'TIM'},
'557599176':{'en': 'TIM'},
'557599173':{'en': 'TIM'},
'557599172':{'en': 'TIM'},
'557599179':{'en': 'TIM'},
'557599178':{'en': 'TIM'},
'554599136':{'en': 'Vivo'},
'7958593':{'en': 'Tele2', 'ru': 'Tele2'},
'554599137':{'en': 'Vivo'},
'555399171':{'en': 'Claro BR'},
'555399170':{'en': 'Claro BR'},
'555399173':{'en': 'Claro BR'},
'555399172':{'en': 'Claro BR'},
'555399175':{'en': 'Claro BR'},
'555399174':{'en': 'Claro BR'},
'555399177':{'en': 'Claro BR'},
'555399176':{'en': 'Claro BR'},
'557499961':{'en': 'Vivo'},
'62736995':{'en': 'Esia'},
'558899919':{'en': 'TIM'},
'558899918':{'en': 'TIM'},
'7900971':{'en': 'Tele2', 'ru': 'Tele2'},
'558899913':{'en': 'TIM'},
'558899912':{'en': 'TIM'},
'558899911':{'en': 'TIM'},
'554599131':{'en': 'Vivo'},
'558899917':{'en': 'TIM'},
'558899916':{'en': 'TIM'},
'558899915':{'en': 'TIM'},
'558899914':{'en': 'TIM'},
'554899117':{'en': 'Vivo'},
'554899116':{'en': 'Vivo'},
'554899115':{'en': 'Vivo'},
'554899114':{'en': 'Vivo'},
'554899113':{'en': 'Vivo'},
'554899112':{'en': 'Vivo'},
'554899111':{'en': 'Vivo'},
'554899119':{'en': 'Vivo'},
'554899118':{'en': 'Vivo'},
'659818':{'en': 'SingTel'},
'65983':{'en': 'SingTel'},
'65982':{'en': 'SingTel'},
'65985':{'en': 'StarHub'},
'65984':{'en': 'M1'},
'65987':{'en': 'M1'},
'65989':{'en': 'SingTel'},
'658820':{'en': 'M1'},
'795845':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'623995':{'en': 'Esia'},
'680884':{'en': 'PalauTel'},
'680880':{'en': 'PalauTel'},
'680881':{'en': 'PalauTel'},
'680882':{'en': 'PalauTel'},
'680883':{'en': 'PalauTel'},
'556699649':{'en': 'Vivo'},
'556699648':{'en': 'Vivo'},
'556699643':{'en': 'Vivo'},
'556699642':{'en': 'Vivo'},
'556699641':{'en': 'Vivo'},
'556699647':{'en': 'Vivo'},
'556699646':{'en': 'Vivo'},
'556699645':{'en': 'Vivo'},
'556699644':{'en': 'Vivo'},
'555198218':{'en': 'TIM'},
'554598841':{'en': 'Claro BR'},
'554999915':{'en': 'TIM'},
'6011204':{'en': 'Talk Focus'},
'55719996':{'en': 'Vivo'},
'63908':{'en': 'Smart'},
'55859924':{'en': 'Claro BR'},
'55859923':{'en': 'Claro BR'},
'55859922':{'en': 'Claro BR'},
'55859921':{'en': 'Claro BR'},
'55859920':{'en': 'Claro BR'},
'55889940':{'en': 'Claro BR'},
'55889941':{'en': 'Claro BR'},
'55889942':{'en': 'Claro BR'},
'55889943':{'en': 'Claro BR'},
'55889944':{'en': 'Claro BR'},
'55889945':{'en': 'Claro BR'},
'557199989':{'en': 'Vivo'},
'55669997':{'en': 'Vivo'},
'55669998':{'en': 'Vivo'},
'85365429':{'en': 'China Telecom'},
'85365428':{'en': 'China Telecom'},
'799250':{'en': 'Tele2', 'ru': 'Tele2'},
'799251':{'en': 'Tele2', 'ru': 'Tele2'},
'799252':{'en': 'Tele2', 'ru': 'Tele2'},
'85365424':{'en': '3'},
'6226392':{'en': 'Esia'},
'85365422':{'en': '3'},
'85365421':{'en': '3'},
'84123':{'en': 'Vinaphone'},
'7999':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'8536603':{'en': '3'},
'8536602':{'en': 'SmarTone'},
'8536601':{'en': 'CTM'},
'569871':{'en': 'Claro'},
'569870':{'en': 'Claro'},
'569873':{'en': 'Entel'},
'569872':{'en': 'Entel'},
'569875':{'en': 'Entel'},
'569874':{'en': 'Entel'},
'569877':{'en': 'Claro'},
'569876':{'en': 'Entel'},
'569879':{'en': 'Movistar'},
'569878':{'en': 'Movistar'},
'5551984':{'en': 'Brasil Telecom GSM'},
'5551985':{'en': 'Brasil Telecom GSM'},
'6235490':{'en': 'Esia'},
'6235491':{'en': 'Esia'},
'6235492':{'en': 'Esia'},
'5551981':{'en': 'TIM'},
'601058':{'en': 'Celcom'},
'601059':{'en': 'Celcom'},
'601050':{'en': 'Tune Talk'},
'601051':{'en': 'Tune Talk'},
'601052':{'en': 'Tune Talk'},
'601053':{'en': 'Tune Talk'},
'601054':{'en': 'Tune Talk'},
'601055':{'en': 'Webe'},
'601056':{'en': 'DiGi'},
'601057':{'en': 'Celcom'},
'658826':{'en': 'M1'},
'556599657':{'en': 'Vivo'},
'7901230':{'en': 'Tele2', 'ru': 'Tele2'},
'852676':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'556599656':{'en': 'Vivo'},
'556199624':{'en': 'Vivo'},
'795273':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'62911401':{'en': 'Esia'},
'62911400':{'en': 'Esia'},
'62911403':{'en': 'Esia'},
'62911402':{'en': 'Esia'},
'7958594':{'en': 'Tele2', 'ru': 'Tele2'},
'62911404':{'en': 'Esia'},
'556498431':{'en': 'Brasil Telecom GSM'},
'556498433':{'en': 'Brasil Telecom GSM'},
'556498432':{'en': 'Brasil Telecom GSM'},
'556498435':{'en': 'Brasil Telecom GSM'},
'556498434':{'en': 'Brasil Telecom GSM'},
'556498437':{'en': 'Brasil Telecom GSM'},
'556498436':{'en': 'Brasil Telecom GSM'},
'556498439':{'en': 'Brasil Telecom GSM'},
'556498438':{'en': 'Brasil Telecom GSM'},
'557199189':{'en': 'TIM'},
'61400':{'en': 'Telstra'},
'61401':{'en': 'Optus'},
'557199184':{'en': 'TIM'},
'559998135':{'en': 'TIM'},
'557199186':{'en': 'TIM'},
'557199187':{'en': 'TIM'},
'569699':{'en': 'Telecomunicaciones Dotcom'},
'569695':{'en': 'Blue Two'},
'569694':{'en': 'NetUno'},
'569697':{'en': u('VTR M\u00f3vil')},
'569696':{'en': 'Virgin Mobile'},
'569690':{'en': 'Entel'},
'569693':{'en': 'Quantax'},
'569692':{'en': 'Television Interactiva'},
'61408':{'en': 'Telstra'},
'557199182':{'en': 'TIM'},
'559998133':{'en': 'TIM'},
'559199609':{'en': 'Oi'},
'559199608':{'en': 'Oi'},
'559199605':{'en': 'Oi'},
'559199604':{'en': 'Oi'},
'559199607':{'en': 'Oi'},
'559199606':{'en': 'Oi'},
'559199601':{'en': 'Oi'},
'559199603':{'en': 'Oi'},
'559199602':{'en': 'Oi'},
'659297':{'en': 'SingTel'},
'659296':{'en': 'SingTel'},
'659295':{'en': 'SingTel'},
'6226099':{'en': 'Esia'},
'6226091':{'en': 'Esia'},
'659299':{'en': 'SingTel'},
'659298':{'en': 'SingTel'},
'67945':{'en': 'Vodafone'},
'559699972':{'en': 'Oi'},
'559699973':{'en': 'Oi'},
'559699970':{'en': 'Oi'},
'559699971':{'en': 'Oi'},
'559699976':{'en': 'Oi'},
'559699974':{'en': 'Oi'},
'559699975':{'en': 'Oi'},
'7902400':{'en': 'Tele2', 'ru': 'Tele2'},
'6018820':{'en': 'YTL'},
'7902405':{'en': 'Tele2', 'ru': 'Tele2'},
'7958040':{'en': 'Tele2', 'ru': 'Tele2'},
'7958041':{'en': 'Tele2', 'ru': 'Tele2'},
'6018824':{'en': 'YTL'},
'7991012':{'en': 'Tele2', 'ru': 'Tele2'},
'62243601':{'en': 'Esia'},
'62243600':{'en': 'Esia'},
'62243603':{'en': 'Esia'},
'62243602':{'en': 'Esia'},
'62243605':{'en': 'Esia'},
'62243604':{'en': 'Esia'},
'556999958':{'en': 'Vivo'},
'556999959':{'en': 'Vivo'},
'556999952':{'en': 'Vivo'},
'556999953':{'en': 'Vivo'},
'556999951':{'en': 'Vivo'},
'556999956':{'en': 'Vivo'},
'556999957':{'en': 'Vivo'},
'556999954':{'en': 'Vivo'},
'556999955':{'en': 'Vivo'},
'556499964':{'en': 'Vivo'},
'556599908':{'en': 'Vivo'},
'593993':{'en': 'Claro'},
'593991':{'en': 'Claro'},
'593990':{'en': 'Claro'},
'593997':{'en': 'Claro'},
'593996':{'en': 'CNT'},
'593995':{'en': 'Movistar'},
'593994':{'en': 'Claro'},
'55869993':{'en': 'TIM'},
'55869992':{'en': 'TIM'},
'55869994':{'en': 'TIM'},
'7902995':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902994':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902993':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'601838':{'en': 'U Mobile'},
'601839':{'en': 'U Mobile'},
'601832':{'en': 'U Mobile'},
'556599905':{'en': 'Vivo'},
'601830':{'en': 'YTL'},
'601831':{'en': 'U Mobile'},
'601836':{'en': 'U Mobile'},
'601837':{'en': 'U Mobile'},
'556599904':{'en': 'Vivo'},
'55689997':{'en': 'Vivo'},
'65844':{'en': 'M1'},
'55689998':{'en': 'Vivo'},
'65842':{'en': 'SingTel'},
'65843':{'en': 'SingTel'},
'6228199':{'en': 'Esia'},
'8536290':{'en': 'CTM'},
'8536291':{'en': 'CTM'},
'8536292':{'en': '3'},
'8536293':{'en': '3'},
'8536294':{'en': '3'},
'8536295':{'en': '3'},
'8536296':{'en': 'CTM'},
'8536297':{'en': 'CTM'},
'8536298':{'en': 'CTM'},
'8536299':{'en': 'CTM'},
'55749998':{'en': 'Vivo'},
'6228191':{'en': 'Esia'},
'558499468':{'en': 'Claro BR'},
'558499467':{'en': 'Claro BR'},
'558499466':{'en': 'Claro BR'},
'558499465':{'en': 'Claro BR'},
'558499464':{'en': 'Claro BR'},
'558499463':{'en': 'Claro BR'},
'558499462':{'en': 'Claro BR'},
'558499461':{'en': 'Claro BR'},
'55749995':{'en': 'Vivo'},
'623191':{'en': 'Esia'},
'623192':{'en': 'Esia'},
'55719834':{'en': 'Claro BR'},
'55719835':{'en': 'Claro BR'},
'55719830':{'en': 'Claro BR'},
'55719831':{'en': 'Claro BR'},
'55719832':{'en': 'Claro BR'},
'55719833':{'en': 'Claro BR'},
'557399999':{'en': 'Vivo'},
'557399998':{'en': 'Vivo'},
'557399995':{'en': 'Vivo'},
'557399994':{'en': 'Vivo'},
'557399997':{'en': 'Vivo'},
'557399996':{'en': 'Vivo'},
'557399991':{'en': 'Vivo'},
'557399990':{'en': 'Vivo'},
'557399993':{'en': 'Vivo'},
'557399992':{'en': 'Vivo'},
'7902579':{'en': 'Tele2', 'ru': 'Tele2'},
'6221412':{'en': 'Esia'},
'7902577':{'en': 'Tele2', 'ru': 'Tele2'},
'7902576':{'en': 'Tele2', 'ru': 'Tele2'},
'558899905':{'en': 'TIM'},
'558899906':{'en': 'TIM'},
'558899907':{'en': 'TIM'},
'799559':{'en': 'Tele2', 'ru': 'Tele2'},
'559399181':{'en': 'Vivo'},
'60154888':{'en': 'Asian Broadcasting Network'},
'556298112':{'en': 'TIM'},
'558899901':{'en': 'TIM'},
'790150':{'en': 'Tele2', 'ru': 'Tele2'},
'6226792':{'en': 'Esia'},
'6226791':{'en': 'Esia'},
'556298113':{'en': 'TIM'},
'558899902':{'en': 'TIM'},
'6226794':{'en': 'Esia'},
'556298114':{'en': 'TIM'},
'558899903':{'en': 'TIM'},
'556298115':{'en': 'TIM'},
'6015678':{'en': 'Eletcoms'},
'556298116':{'en': 'TIM'},
'556298117':{'en': 'TIM'},
'558798124':{'en': 'Vivo'},
'558798125':{'en': 'Vivo'},
'569998':{'en': 'Claro'},
'558798120':{'en': 'Vivo'},
'558798121':{'en': 'Vivo'},
'558798122':{'en': 'Vivo'},
'558798123':{'en': 'Vivo'},
'556199664':{'en': 'Vivo'},
'556199665':{'en': 'Vivo'},
'556199666':{'en': 'Vivo'},
'556199667':{'en': 'Vivo'},
'556199661':{'en': 'Vivo'},
'556199662':{'en': 'Vivo'},
'556199663':{'en': 'Vivo'},
'6011609':{'en': 'U Mobile'},
'6011608':{'en': 'U Mobile'},
'6011605':{'en': 'U Mobile'},
'6011607':{'en': 'U Mobile'},
'6011606':{'en': 'U Mobile'},
'556599633':{'en': 'Vivo'},
'556599632':{'en': 'Vivo'},
'556599631':{'en': 'Vivo'},
'659197':{'en': 'M1'},
'556599637':{'en': 'Vivo'},
'556599636':{'en': 'Vivo'},
'556599635':{'en': 'Vivo'},
'556599634':{'en': 'Vivo'},
'558399342':{'en': 'Claro BR'},
'556599639':{'en': 'Vivo'},
'556599638':{'en': 'Vivo'},
'659198':{'en': 'M1'},
'659199':{'en': 'StarHub'},
'659371':{'en': 'SingTel'},
'659372':{'en': 'SingTel'},
'62411972':{'en': 'Esia'},
'62411973':{'en': 'Esia'},
'62411970':{'en': 'Esia'},
'62411971':{'en': 'Esia'},
'62411974':{'en': 'Esia'},
'62751976':{'en': 'Esia'},
'559198215':{'en': 'TIM'},
'559198214':{'en': 'TIM'},
'559198217':{'en': 'TIM'},
'559198216':{'en': 'TIM'},
'559198211':{'en': 'TIM'},
'559198213':{'en': 'TIM'},
'559198212':{'en': 'TIM'},
'67773':{'en': 'Solomon Telekom'},
'559198219':{'en': 'TIM'},
'559198218':{'en': 'TIM'},
'67776':{'en': 'Solomon Telekom'},
'67777':{'en': 'Solomon Telekom'},
'569736':{'en': 'Claro'},
'569737':{'en': 'Entel'},
'569734':{'en': 'Claro'},
'569735':{'en': 'Claro'},
'569732':{'en': 'Claro'},
'569733':{'en': 'Claro'},
'569730':{'en': 'Claro'},
'569731':{'en': 'Claro'},
'569738':{'en': 'Entel'},
'569739':{'en': 'Entel'},
'554899179':{'en': 'Vivo'},
'554899178':{'en': 'Vivo'},
'554899175':{'en': 'Vivo'},
'554899174':{'en': 'Vivo'},
'554899177':{'en': 'Vivo'},
'554899176':{'en': 'Vivo'},
'554899171':{'en': 'Vivo'},
'554899173':{'en': 'Vivo'},
'554899172':{'en': 'Vivo'},
'556298119':{'en': 'TIM'},
'5906901':{'en': 'Digicel'},
'8525730':{'en': 'Tai Tung', 'zh': u('\u53f0\u4e1c'), 'zh_Hant': u('\u81fa\u6771')},
'795863':{'en': 'Tele2', 'ru': 'Tele2'},
'795862':{'en': 'TMT', 'ru': 'TMT'},
'795867':{'en': 'Tele2', 'ru': 'Tele2'},
'558499618':{'en': 'TIM'},
'558499619':{'en': 'TIM'},
'8536591':{'en': 'CTM'},
'559398415':{'en': 'Claro BR'},
'559398414':{'en': 'Claro BR'},
'558499612':{'en': 'TIM'},
'559398416':{'en': 'Claro BR'},
'559398411':{'en': 'Claro BR'},
'558499615':{'en': 'TIM'},
'558499616':{'en': 'TIM'},
'559398412':{'en': 'Claro BR'},
'6275198':{'en': 'Esia'},
'6222960':{'en': 'Esia'},
'559499955':{'en': 'Oi'},
'558899640':{'en': 'TIM'},
'59669699':{'en': 'Orange'},
'59069135':{'en': 'Arcane'},
'59069134':{'en': 'Arcane'},
'59069133':{'en': 'Arcane'},
'59069132':{'en': 'Arcane'},
'59069131':{'en': 'Arcane'},
'59069130':{'en': 'Arcane'},
'55889961':{'en': 'TIM'},
'5926':{'en': 'Digicel Guyana'},
'557998172':{'en': 'Claro BR'},
'557998171':{'en': 'Claro BR'},
'79952112':{'en': 'Tele2', 'ru': 'Tele2'},
'79952113':{'en': 'Tele2', 'ru': 'Tele2'},
'79952110':{'en': 'Tele2', 'ru': 'Tele2'},
'79952111':{'en': 'Tele2', 'ru': 'Tele2'},
'79952116':{'en': 'Tele2', 'ru': 'Tele2'},
'79952117':{'en': 'Tele2', 'ru': 'Tele2'},
'79952114':{'en': 'Tele2', 'ru': 'Tele2'},
'79952115':{'en': 'Tele2', 'ru': 'Tele2'},
'559498111':{'en': 'TIM'},
'559498113':{'en': 'TIM'},
'559498112':{'en': 'TIM'},
'559498115':{'en': 'TIM'},
'559498114':{'en': 'TIM'},
'559498117':{'en': 'TIM'},
'559498116':{'en': 'TIM'},
'559498119':{'en': 'TIM'},
'559498118':{'en': 'TIM'},
'5917348':{'en': 'Entel'},
'5917349':{'en': 'Entel'},
'555499220':{'en': 'Claro BR'},
'555499221':{'en': 'Claro BR'},
'8536331':{'en': 'CTM'},
'8536330':{'en': 'CTM'},
'5917346':{'en': 'Entel'},
'5917347':{'en': 'Entel'},
'5917344':{'en': 'Entel'},
'8536334':{'en': 'CTM'},
'601032':{'en': 'Celcom'},
'601033':{'en': 'Celcom'},
'601030':{'en': 'Celcom'},
'601031':{'en': 'Celcom'},
'601036':{'en': 'DiGi'},
'601037':{'en': 'DiGi'},
'601034':{'en': 'Celcom'},
'601035':{'en': 'Webe'},
'601038':{'en': 'DiGi'},
'601039':{'en': 'DiGi'},
'556299683':{'en': 'Vivo'},
'556299682':{'en': 'Vivo'},
'556299681':{'en': 'Vivo'},
'799231':{'en': 'Tele2', 'ru': 'Tele2'},
'556299687':{'en': 'Vivo'},
'556299686':{'en': 'Vivo'},
'556299685':{'en': 'Vivo'},
'556299684':{'en': 'Vivo'},
'556299689':{'en': 'Vivo'},
'556299688':{'en': 'Vivo'},
'559399901':{'en': 'Oi'},
'559399902':{'en': 'Oi'},
'559399903':{'en': 'Oi'},
'559399904':{'en': 'Oi'},
'559399908':{'en': 'Oi'},
'790090':{'en': 'Tele2', 'ru': 'Tele2'},
'790092':{'en': 'Tele2', 'ru': 'Tele2'},
'790095':{'en': 'Tele2', 'ru': 'Tele2'},
'790094':{'en': 'Tele2', 'ru': 'Tele2'},
'790096':{'en': 'Tele2', 'ru': 'Tele2'},
'790099':{'en': 'Tele2', 'ru': 'Tele2'},
'6275194':{'en': 'Esia'},
'556498417':{'en': 'Brasil Telecom GSM'},
'556498416':{'en': 'Brasil Telecom GSM'},
'556498415':{'en': 'Brasil Telecom GSM'},
'556498414':{'en': 'Brasil Telecom GSM'},
'556498413':{'en': 'Brasil Telecom GSM'},
'556498412':{'en': 'Brasil Telecom GSM'},
'556498411':{'en': 'Brasil Telecom GSM'},
'556498419':{'en': 'Brasil Telecom GSM'},
'556498418':{'en': 'Brasil Telecom GSM'},
'556899995':{'en': 'Vivo'},
'556899994':{'en': 'Vivo'},
'556899997':{'en': 'Vivo'},
'556899996':{'en': 'Vivo'},
'556899991':{'en': 'Vivo'},
'556899993':{'en': 'Vivo'},
'556899992':{'en': 'Vivo'},
'7902746':{'en': 'MTS', 'ru': 'MTS'},
'7902747':{'en': 'MTS', 'ru': 'MTS'},
'7902744':{'en': 'Tele2', 'ru': 'Tele2'},
'7902745':{'en': 'Tele2', 'ru': 'Tele2'},
'556899999':{'en': 'Vivo'},
'556899998':{'en': 'Vivo'},
'8536558':{'en': 'China Telecom'},
'556699652':{'en': 'Vivo'},
'557799149':{'en': 'TIM'},
'658858':{'en': 'M1'},
'559299631':{'en': 'Oi'},
'658765':{'en': 'StarHub'},
'658766':{'en': 'M1'},
'8536880':{'en': 'CTM'},
'8536883':{'en': 'CTM'},
'559199623':{'en': 'Oi'},
'559199622':{'en': 'Oi'},
'559199621':{'en': 'Oi'},
'8536550':{'en': 'CTM'},
'559199627':{'en': 'Oi'},
'559199626':{'en': 'Oi'},
'559199625':{'en': 'Oi'},
'559199624':{'en': 'Oi'},
'8536557':{'en': 'China Telecom'},
'559199629':{'en': 'Oi'},
'559199628':{'en': 'Oi'},
'8536556':{'en': 'China Telecom'},
'601833':{'en': 'YTL'},
'555398419':{'en': 'Brasil Telecom GSM'},
'555398418':{'en': 'Brasil Telecom GSM'},
'555398411':{'en': 'Brasil Telecom GSM'},
'555398413':{'en': 'Brasil Telecom GSM'},
'555398412':{'en': 'Brasil Telecom GSM'},
'555398415':{'en': 'Brasil Telecom GSM'},
'555398414':{'en': 'Brasil Telecom GSM'},
'555398417':{'en': 'Brasil Telecom GSM'},
'555398416':{'en': 'Brasil Telecom GSM'},
'7902358':{'en': 'Tele2', 'ru': 'Tele2'},
'7902355':{'en': 'Tele2', 'ru': 'Tele2'},
'7902354':{'en': 'MTS', 'ru': 'MTS'},
'7902357':{'en': 'Tele2', 'ru': 'Tele2'},
'601835':{'en': 'U Mobile'},
'7902351':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902350':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902353':{'en': 'MTS', 'ru': 'MTS'},
'7902352':{'en': 'MTS', 'ru': 'MTS'},
'59069129':{'en': 'Digicel'},
'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'},
'556698415':{'en': 'Brasil Telecom GSM'},
'556698414':{'en': 'Brasil Telecom GSM'},
'556698417':{'en': 'Brasil Telecom GSM'},
'556698416':{'en': 'Brasil Telecom GSM'},
'556698411':{'en': 'Brasil Telecom GSM'},
'556698413':{'en': 'Brasil Telecom GSM'},
'556698412':{'en': 'Brasil Telecom GSM'},
'556698419':{'en': 'Brasil Telecom GSM'},
'556698418':{'en': 'Brasil Telecom GSM'},
'62331985':{'en': 'Esia'},
'62331986':{'en': 'Esia'},
'62331987':{'en': 'Esia'},
'557599966':{'en': 'Vivo'},
'557599967':{'en': 'Vivo'},
'557599964':{'en': 'Vivo'},
'557599965':{'en': 'Vivo'},
'557599962':{'en': 'Vivo'},
'557599963':{'en': 'Vivo'},
'557599961':{'en': 'Vivo'},
'556798428':{'en': 'Brasil Telecom GSM'},
'65820':{'en': 'StarHub'},
'65827':{'en': 'M1'},
'65824':{'en': 'StarHub'},
'65825':{'en': 'StarHub'},
'5939993':{'en': 'Claro'},
'5939992':{'en': 'Movistar'},
'5939991':{'en': 'Claro'},
'5939990':{'en': 'Movistar'},
'5939997':{'en': 'Movistar'},
'5939996':{'en': 'Claro'},
'5939995':{'en': 'Claro'},
'5939994':{'en': 'Claro'},
'5939999':{'en': 'Movistar'},
'5939998':{'en': 'Movistar'},
'558799253':{'en': 'Claro BR'},
'6234391':{'en': 'Esia'},
'5699145':{'en': 'Movistar'},
'5699144':{'en': 'Movistar'},
'795063':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795065':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'795064':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'5699141':{'en': 'Entel'},
'5699140':{'en': 'Entel'},
'558299627':{'en': 'TIM'},
'558299625':{'en': 'TIM'},
'658221':{'en': 'StarHub'},
'658220':{'en': 'StarHub'},
'658223':{'en': 'SingTel'},
'558299624':{'en': 'TIM'},
'658225':{'en': 'StarHub'},
'658224':{'en': 'StarHub'},
'658227':{'en': 'StarHub'},
'658226':{'en': 'StarHub'},
'57351':{'en': 'Avantel'},
'559898146':{'en': 'TIM'},
'7902519':{'en': 'Tele2', 'ru': 'Tele2'},
'8536815':{'en': 'SmarTone'},
'8536812':{'en': 'CTM'},
'8536813':{'en': 'CTM'},
'8536810':{'en': 'CTM'},
'558299622':{'en': 'TIM'},
'557799973':{'en': 'Vivo'},
'557799972':{'en': 'Vivo'},
'557799971':{'en': 'Vivo'},
'557799970':{'en': 'Vivo'},
'557799977':{'en': 'Vivo'},
'557799976':{'en': 'Vivo'},
'557799975':{'en': 'Vivo'},
'557799974':{'en': 'Vivo'},
'557799978':{'en': 'Vivo'},
'852926':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852927':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852924':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852925':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'6221561':{'en': 'Esia'},
'852923':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852920':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852921':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8536817':{'en': 'SmarTone'},
'852928':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'659819':{'en': 'SingTel'},
'6276299':{'en': 'Esia'},
'6276298':{'en': 'Esia'},
'658593':{'en': 'StarHub'},
'658592':{'en': 'StarHub'},
'554699939':{'en': 'TIM'},
'658594':{'en': 'StarHub'},
'593998':{'en': 'Movistar'},
'556199682':{'en': 'Vivo'},
'556199683':{'en': 'Vivo'},
'556199681':{'en': 'Vivo'},
'556199686':{'en': 'Vivo'},
'556199687':{'en': 'Vivo'},
'556199684':{'en': 'Vivo'},
'556199685':{'en': 'Vivo'},
'556199688':{'en': 'Vivo'},
'556199689':{'en': 'Vivo'},
'7994270':{'en': 'Tele2', 'ru': 'Tele2'},
'659815':{'en': 'SingTel'},
'659814':{'en': 'StarHub'},
'62219':{'en': 'Esia'},
'6691':{'en': 'DTAC'},
'6690':{'en': 'DTAC'},
'790856':{'en': 'MTS', 'ru': 'MTS'},
'799672':{'en': 'Tele2', 'ru': 'Tele2'},
'6272599':{'en': 'Esia'},
'559198239':{'en': 'TIM'},
'559198238':{'en': 'TIM'},
'559198233':{'en': 'TIM'},
'559198232':{'en': 'TIM'},
'559198231':{'en': 'TIM'},
'559198237':{'en': 'TIM'},
'559198236':{'en': 'TIM'},
'559198235':{'en': 'TIM'},
'559198234':{'en': 'TIM'},
'559899101':{'en': 'Vivo'},
'559899103':{'en': 'Vivo'},
'559899102':{'en': 'Vivo'},
'559899105':{'en': 'Vivo'},
'559899104':{'en': 'Vivo'},
'559899107':{'en': 'Vivo'},
'559899106':{'en': 'Vivo'},
'559899108':{'en': 'Vivo'},
'6276196':{'en': 'Esia'},
'569710':{'en': 'Entel'},
'569711':{'en': 'CIT LTDA'},
'569712':{'en': 'Movistar'},
'569713':{'en': 'Movistar'},
'569714':{'en': 'Movistar'},
'569715':{'en': 'Movistar'},
'569716':{'en': 'Movistar'},
'569717':{'en': 'Claro'},
'569718':{'en': 'Claro'},
'569719':{'en': 'Claro'},
'554798443':{'en': 'Brasil Telecom GSM'},
'554899152':{'en': 'Vivo'},
'554798441':{'en': 'Brasil Telecom GSM'},
'554899622':{'en': 'TIM'},
'554798447':{'en': 'Brasil Telecom GSM'},
'554798446':{'en': 'Brasil Telecom GSM'},
'554798445':{'en': 'Brasil Telecom GSM'},
'554798444':{'en': 'Brasil Telecom GSM'},
'554899629':{'en': 'TIM'},
'554899628':{'en': 'TIM'},
'554899159':{'en': 'Vivo'},
'554798448':{'en': 'Brasil Telecom GSM'},
'5581991':{'en': 'Claro BR'},
'5581992':{'en': 'Claro BR'},
'8525719':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'8525718':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'8525711':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525710':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525713':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525712':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525715':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525714':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525717':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'8525716':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'795885':{'en': 'Tele2', 'ru': 'Tele2'},
'6276198':{'en': 'Esia'},
'795887':{'en': 'Tele2', 'ru': 'Tele2'},
'795886':{'en': 'Tele2', 'ru': 'Tele2'},
'852649':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852648':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'55869810':{'en': 'Vivo'},
'55869811':{'en': 'Vivo'},
'55869812':{'en': 'Vivo'},
'55869813':{'en': 'Vivo'},
'559999133':{'en': 'Vivo'},
'62341684':{'en': 'Esia'},
'62426996':{'en': 'Esia'},
'62426997':{'en': 'Esia'},
'62426995':{'en': 'Esia'},
'62426998':{'en': 'Esia'},
'62426999':{'en': 'Esia'},
'557799191':{'en': 'TIM'},
'61467':{'en': 'Telstra'},
'557799193':{'en': 'TIM'},
'557799194':{'en': 'TIM'},
'557799199':{'en': 'TIM'},
'557799198':{'en': 'TIM'},
'61468':{'en': 'Optus'},
'61469':{'en': 'Lycamobile'},
'556699687':{'en': 'Vivo'},
'556699686':{'en': 'Vivo'},
'556699685':{'en': 'Vivo'},
'559499667':{'en': 'Oi'},
'556699683':{'en': 'Vivo'},
'556699682':{'en': 'Vivo'},
'556699681':{'en': 'Vivo'},
'558899622':{'en': 'TIM'},
'852644':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'559499668':{'en': 'Oi'},
'558899628':{'en': 'TIM'},
'556699689':{'en': 'Vivo'},
'556699688':{'en': 'Vivo'},
'6274198':{'en': 'Esia'},
'6274199':{'en': 'Esia'},
'6274197':{'en': 'Esia'},
'8536618':{'en': 'CTM'},
'556399961':{'en': 'Vivo'},
'556399963':{'en': 'Vivo'},
'556399962':{'en': 'Vivo'},
'556399965':{'en': 'Vivo'},
'556399964':{'en': 'Vivo'},
'556399967':{'en': 'Vivo'},
'556399966':{'en': 'Vivo'},
'556399969':{'en': 'Vivo'},
'556399968':{'en': 'Vivo'},
'8536349':{'en': 'CTM'},
'6229490':{'en': 'Esia'},
'559799901':{'en': 'Oi'},
'559799902':{'en': 'Oi'},
'559799903':{'en': 'Oi'},
'8536616':{'en': '3'},
'556499902':{'en': 'Vivo'},
'559498136':{'en': 'TIM'},
'559498135':{'en': 'TIM'},
'559498134':{'en': 'TIM'},
'556499906':{'en': 'Vivo'},
'559498132':{'en': 'TIM'},
'559498131':{'en': 'TIM'},
'556499905':{'en': 'Vivo'},
'8536610':{'en': '3'},
'8536649':{'en': 'China Telecom'},
'8536648':{'en': '3'},
'559498139':{'en': 'TIM'},
'559498138':{'en': 'TIM'},
'7908032':{'en': 'Tele2', 'ru': 'Tele2'},
'7908033':{'en': 'Tele2', 'ru': 'Tele2'},
'7908030':{'en': 'Tele2', 'ru': 'Tele2'},
'7908031':{'en': 'Tele2', 'ru': 'Tele2'},
'8536340':{'en': 'China Telecom'},
'7908034':{'en': 'Tele2', 'ru': 'Tele2'},
'8536613':{'en': 'CTM'},
'62735988':{'en': 'Esia'},
'62735989':{'en': 'Esia'},
'556299805':{'en': 'Vivo'},
'556299804':{'en': 'Vivo'},
'556299807':{'en': 'Vivo'},
'556299806':{'en': 'Vivo'},
'556299801':{'en': 'Vivo'},
'556299803':{'en': 'Vivo'},
'556299802':{'en': 'Vivo'},
'556299809':{'en': 'Vivo'},
'556299808':{'en': 'Vivo'},
'623996':{'en': 'Esia'},
'8536304':{'en': '3'},
'623991':{'en': 'Esia'},
'623990':{'en': 'Esia'},
'623993':{'en': 'Esia'},
'623992':{'en': 'Esia'},
'558298141':{'en': 'Vivo'},
'558298140':{'en': 'Vivo'},
'558298143':{'en': 'Vivo'},
'558298142':{'en': 'Vivo'},
'7902578':{'en': 'Tele2', 'ru': 'Tele2'},
'67980':{'en': 'Vodafone'},
'622491':{'en': 'Esia'},
'557199979':{'en': 'Vivo'},
'557199978':{'en': 'Vivo'},
'5598985':{'en': 'Oi'},
'5598987':{'en': 'Oi'},
'5598986':{'en': 'Oi'},
'557199971':{'en': 'Vivo'},
'5598988':{'en': 'Oi'},
'557199973':{'en': 'Vivo'},
'557199972':{'en': 'Vivo'},
'557199975':{'en': 'Vivo'},
'557199974':{'en': 'Vivo'},
'557199977':{'en': 'Vivo'},
'557199976':{'en': 'Vivo'},
'6221802':{'en': 'Esia'},
'6221803':{'en': 'Esia'},
'7995902':{'en': 'Tele2', 'ru': 'Tele2'},
'7995903':{'en': 'Tele2', 'ru': 'Tele2'},
'7995904':{'en': 'Tele2', 'ru': 'Tele2'},
'6221807':{'en': 'Esia'},
'7996301':{'en': 'Tele2', 'ru': 'Tele2'},
'7996300':{'en': 'Tele2', 'ru': 'Tele2'},
'7996309':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7996308':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'555199560':{'en': 'Vivo'},
'555199561':{'en': 'Vivo'},
'555199562':{'en': 'Vivo'},
'555199563':{'en': 'Vivo'},
'658786':{'en': 'M1'},
'658787':{'en': 'M1'},
'658782':{'en': 'M1'},
'658783':{'en': 'M1'},
'658781':{'en': 'M1'},
'569527':{'en': 'Falabella Movil'},
'569526':{'en': 'Falabella Movil'},
'569525':{'en': 'Virgin Mobile'},
'569524':{'en': 'Virgin Mobile'},
'569523':{'en': 'Entel'},
'569522':{'en': 'Entel'},
'569521':{'en': 'Entel'},
'569520':{'en': 'Entel'},
'7958556':{'en': 'Tele2', 'ru': 'Tele2'},
'7958557':{'en': 'Tele2', 'ru': 'Tele2'},
'7958550':{'en': 'Tele2', 'ru': 'Tele2'},
'7958551':{'en': 'Tele2', 'ru': 'Tele2'},
'569529':{'en': 'Falabella Movil'},
'569528':{'en': 'Falabella Movil'},
'67989':{'en': 'Vodafone'},
'559699933':{'en': 'Oi'},
'555398437':{'en': 'Brasil Telecom GSM'},
'555398436':{'en': 'Brasil Telecom GSM'},
'555398435':{'en': 'Brasil Telecom GSM'},
'555398434':{'en': 'Brasil Telecom GSM'},
'555398433':{'en': 'Brasil Telecom GSM'},
'555398432':{'en': 'Brasil Telecom GSM'},
'555398431':{'en': 'Brasil Telecom GSM'},
'67984':{'en': 'Vodafone'},
'5699975':{'en': 'Claro'},
'6011148':{'en': 'Celcom'},
'6011149':{'en': 'Celcom'},
'6011146':{'en': 'Celcom'},
'6011147':{'en': 'Celcom'},
'6011144':{'en': 'Maxis'},
'6011145':{'en': 'Celcom'},
'6011142':{'en': 'Maxis'},
'6011143':{'en': 'Maxis'},
'6011140':{'en': 'Maxis'},
'6011141':{'en': 'Maxis'},
'601880':{'en': 'YTL'},
'556999916':{'en': 'Vivo'},
'556999917':{'en': 'Vivo'},
'556999914':{'en': 'Vivo'},
'556999915':{'en': 'Vivo'},
'556999912':{'en': 'Vivo'},
'556999913':{'en': 'Vivo'},
'556999911':{'en': 'Vivo'},
'66854':{'en': 'AIS'},
'5699979':{'en': 'Claro'},
'556999918':{'en': 'Vivo'},
'556999919':{'en': 'Vivo'},
'5699998':{'en': 'Entel'},
'5699999':{'en': 'Entel'},
'5699990':{'en': 'Tesacom'},
'5699991':{'en': 'Entel'},
'5699992':{'en': 'Entel'},
'5699993':{'en': 'Entel'},
'5699994':{'en': 'Entel'},
'5699995':{'en': 'Entel'},
'5699996':{'en': 'Entel'},
'5699997':{'en': 'Entel'},
'659499':{'en': 'StarHub'},
'55929998':{'en': 'Oi'},
'558799901':{'en': 'TIM'},
'558799902':{'en': 'TIM'},
'853635':{'en': 'China Telecom'},
'853636':{'en': 'SmarTone'},
'5592992':{'en': 'Vivo'},
'65901':{'en': 'SingTel'},
'65903':{'en': 'SingTel'},
'65902':{'en': 'StarHub'},
'658613':{'en': 'M1'},
'65904':{'en': 'M1'},
'6226790':{'en': 'Esia'},
'65907':{'en': 'M1'},
'65906':{'en': 'StarHub'},
'7978255':{'en': 'MTS', 'ru': 'MTS'},
'7978257':{'en': 'MTS', 'ru': 'MTS'},
'7978256':{'en': 'MTS', 'ru': 'MTS'},
'7978259':{'en': 'MTS', 'ru': 'MTS'},
'7978258':{'en': 'MTS', 'ru': 'MTS'},
'55559991':{'en': 'Vivo'},
'55559990':{'en': 'Vivo'},
'558199750':{'en': 'TIM'},
'55559992':{'en': 'Vivo'},
'60182':{'en': 'U Mobile'},
'5589987':{'en': 'Oi'},
'5589986':{'en': 'Oi'},
'5589985':{'en': 'Oi'},
'7904941':{'en': 'Tele2', 'ru': 'Tele2'},
'7904946':{'en': 'Tele2', 'ru': 'Tele2'},
'7904947':{'en': 'Tele2', 'ru': 'Tele2'},
'7904944':{'en': 'Tele2', 'ru': 'Tele2'},
'7904945':{'en': 'Tele2', 'ru': 'Tele2'},
'5589989':{'en': 'Oi'},
'5589988':{'en': 'Oi'},
'852901':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852902':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852903':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852904':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852906':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852907':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852908':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852909':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'5699604':{'en': 'Movistar'},
'5699605':{'en': 'Movistar'},
'8536614':{'en': 'SmarTone'},
'790118':{'en': 'Tele2', 'ru': 'Tele2'},
'68077':{'en': 'PalauCel'},
'601898':{'en': 'U Mobile'},
'569959':{'en': 'Entel'},
'569956':{'en': 'Movistar'},
'569957':{'en': 'Entel'},
'569954':{'en': 'Movistar'},
'569955':{'en': 'Movistar'},
'569952':{'en': 'Movistar'},
'569953':{'en': 'Movistar'},
'569950':{'en': 'Entel'},
'569951':{'en': 'Entel'},
'601894':{'en': 'U Mobile'},
'556199668':{'en': 'Vivo'},
'601896':{'en': 'U Mobile'},
'556199669':{'en': 'Vivo'},
'601897':{'en': 'U Mobile'},
'8529298':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'8529299':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'8529294':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'5699608':{'en': 'Movistar'},
'8529296':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'8529297':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'8529290':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'5699609':{'en': 'Claro'},
'569992':{'en': 'Claro'},
'558399382':{'en': 'Claro BR'},
'6277898':{'en': 'Esia'},
'569993':{'en': 'Entel'},
'6277896':{'en': 'Esia'},
'6277897':{'en': 'Esia'},
'601893':{'en': 'YTL'},
'569990':{'en': 'Movistar'},
'6277891':{'en': 'Esia'},
'569991':{'en': 'Entel'},
'557599999':{'en': 'Vivo'},
'599770':{'en': 'Kla'},
'559399169':{'en': 'Vivo'},
'599777':{'en': 'Kla'},
'559399166':{'en': 'Vivo'},
'569994':{'en': 'Entel'},
'557599996':{'en': 'Vivo'},
'569995':{'en': 'Movistar'},
'659334':{'en': 'SingTel'},
'659335':{'en': 'StarHub'},
'659336':{'en': 'StarHub'},
'557599994':{'en': 'Vivo'},
'852572':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'559399162':{'en': 'Vivo'},
'659338':{'en': 'StarHub'},
'659339':{'en': 'StarHub'},
'557599992':{'en': 'Vivo'},
'55479921':{'en': 'Vivo'},
'55479920':{'en': 'Vivo'},
'55479923':{'en': 'Vivo'},
'55479922':{'en': 'Vivo'},
'557599990':{'en': 'Vivo'},
'557599194':{'en': 'TIM'},
'557599193':{'en': 'TIM'},
'557599192':{'en': 'TIM'},
'557599191':{'en': 'TIM'},
'557599199':{'en': 'TIM'},
'557599198':{'en': 'TIM'},
'559899127':{'en': 'Vivo'},
'559899126':{'en': 'Vivo'},
'556198179':{'en': 'TIM'},
'559899124':{'en': 'Vivo'},
'559899123':{'en': 'Vivo'},
'559899122':{'en': 'Vivo'},
'559899121':{'en': 'Vivo'},
'556198173':{'en': 'TIM'},
'556198172':{'en': 'TIM'},
'556198171':{'en': 'TIM'},
'601596':{'en': 'DiGi'},
'556198177':{'en': 'TIM'},
'556198176':{'en': 'TIM'},
'556198175':{'en': 'TIM'},
'559899128':{'en': 'Vivo'},
'79787':{'en': 'MTS', 'ru': 'MTS'},
'79780':{'en': 'MTS', 'ru': 'MTS'},
'79788':{'en': 'MTS', 'ru': 'MTS'},
'569778':{'en': 'Claro'},
'569779':{'en': 'Claro'},
'60154854':{'en': 'GITN'},
'569772':{'en': 'Movistar'},
'569773':{'en': 'Movistar'},
'559499231':{'en': 'Vivo'},
'569771':{'en': 'Movistar'},
'569776':{'en': 'Entel'},
'569777':{'en': 'Claro'},
'569774':{'en': 'Entel'},
'569775':{'en': 'Entel'},
'554899607':{'en': 'TIM'},
'554899606':{'en': 'TIM'},
'554899604':{'en': 'TIM'},
'554899603':{'en': 'TIM'},
'554899602':{'en': 'TIM'},
'554899601':{'en': 'TIM'},
'62283985':{'en': 'Esia'},
'62283988':{'en': 'Esia'},
'62283989':{'en': 'Esia'},
'659196':{'en': 'M1'},
'554899609':{'en': 'TIM'},
'554899608':{'en': 'TIM'},
'659190':{'en': 'M1'},
'659191':{'en': 'M1'},
'55819930':{'en': 'Claro BR'},
'55819931':{'en': 'Claro BR'},
'554598803':{'en': 'Claro BR'},
'554598802':{'en': 'Claro BR'},
'55819934':{'en': 'Claro BR'},
'55819935':{'en': 'Claro BR'},
'55819936':{'en': 'Claro BR'},
'554598806':{'en': 'Claro BR'},
'554598809':{'en': 'Claro BR'},
'554598808':{'en': 'Claro BR'},
'659193':{'en': 'M1'},
'556699913':{'en': 'Vivo'},
'556699912':{'en': 'Vivo'},
'556699911':{'en': 'Vivo'},
'86133':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'555199450':{'en': 'Claro BR'},
'86131':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86130':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86137':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86136':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86135':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86139':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86138':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'558899609':{'en': 'TIM'},
'558899608':{'en': 'TIM'},
'61448':{'en': 'Telstra'},
'61449':{'en': 'Vodafone'},
'558899603':{'en': 'TIM'},
'558899602':{'en': 'TIM'},
'558899601':{'en': 'TIM'},
'61447':{'en': 'Telstra'},
'558899607':{'en': 'TIM'},
'558899606':{'en': 'TIM'},
'558899605':{'en': 'TIM'},
'558899604':{'en': 'TIM'},
'8536383':{'en': '3'},
'5696780':{'en': 'Mavi'},
'555598116':{'en': 'TIM'},
'5696785':{'en': 'Entel'},
'5696786':{'en': 'Entel'},
'5696787':{'en': 'Entel'},
'5696788':{'en': 'Entel'},
'5696789':{'en': 'Entel'},
'559299991':{'en': 'Oi'},
'555198201':{'en': 'TIM'},
'559299994':{'en': 'Oi'},
'559299995':{'en': 'Oi'},
'559299996':{'en': 'Oi'},
'559299997':{'en': 'Oi'},
'559299998':{'en': 'Oi'},
'559299999':{'en': 'Oi'},
'555598113':{'en': 'TIM'},
'555598111':{'en': 'TIM'},
'556399947':{'en': 'Vivo'},
'556399946':{'en': 'Vivo'},
'556399945':{'en': 'Vivo'},
'556399944':{'en': 'Vivo'},
'556399943':{'en': 'Vivo'},
'556399942':{'en': 'Vivo'},
'556399941':{'en': 'Vivo'},
'56986':{'en': 'Claro'},
'56985':{'en': 'Movistar'},
'56983':{'en': 'Movistar'},
'56982':{'en': 'Entel'},
'556399949':{'en': 'Vivo'},
'556399948':{'en': 'Vivo'},
'6271399':{'en': 'Esia'},
'559498155':{'en': 'TIM'},
'559498154':{'en': 'TIM'},
'559498157':{'en': 'TIM'},
'559498156':{'en': 'TIM'},
'555499912':{'en': 'Vivo'},
'555499913':{'en': 'Vivo'},
'555499911':{'en': 'Vivo'},
'555499916':{'en': 'Vivo'},
'555499917':{'en': 'Vivo'},
'555499914':{'en': 'Vivo'},
'555499915':{'en': 'Vivo'},
'555499918':{'en': 'Vivo'},
'555499919':{'en': 'Vivo'},
'556199839':{'en': 'Vivo'},
'556199838':{'en': 'Vivo'},
'599965':{'en': 'Digicel'},
'599966':{'en': 'Digicel'},
'599967':{'en': 'Digicel'},
'556199831':{'en': 'Vivo'},
'599961':{'en': 'CSC'},
'556199832':{'en': 'Vivo'},
'85589':{'en': 'Cellcard'},
'7901126':{'en': 'Tele2', 'ru': 'Tele2'},
'6228699':{'en': 'Esia'},
'7900988':{'en': 'Tele2', 'ru': 'Tele2'},
'7901125':{'en': 'Tele2', 'ru': 'Tele2'},
'8536208':{'en': 'CTM'},
'8536559':{'en': 'China Telecom'},
'7901120':{'en': 'Tele2', 'ru': 'Tele2'},
'559899608':{'en': 'Oi'},
'559899609':{'en': 'Oi'},
'559899606':{'en': 'Oi'},
'559899607':{'en': 'Oi'},
'559899604':{'en': 'Oi'},
'559899605':{'en': 'Oi'},
'559899602':{'en': 'Oi'},
'559899603':{'en': 'Oi'},
'559899601':{'en': 'Oi'},
'554699124':{'en': 'Vivo'},
'554699125':{'en': 'Vivo'},
'554699126':{'en': 'Vivo'},
'554699127':{'en': 'Vivo'},
'678577':{'en': 'Digicel'},
'554699121':{'en': 'Vivo'},
'554699122':{'en': 'Vivo'},
'554699123':{'en': 'Vivo'},
'84188':{'en': 'Vietnamobile'},
'8536204':{'en': 'CTM'},
'554699128':{'en': 'Vivo'},
'554699129':{'en': 'Vivo'},
'85567':{'en': 'Beeline'},
'556899951':{'en': 'Vivo'},
'556899953':{'en': 'Vivo'},
'556899952':{'en': 'Vivo'},
'556899955':{'en': 'Vivo'},
'556899954':{'en': 'Vivo'},
'556899957':{'en': 'Vivo'},
'556899956':{'en': 'Vivo'},
'556899959':{'en': 'Vivo'},
'556899958':{'en': 'Vivo'},
'658414':{'en': 'M1'},
'658415':{'en': 'M1'},
'658412':{'en': 'M1'},
'658413':{'en': 'M1'},
'658410':{'en': 'M1'},
'658411':{'en': 'SingTel'},
'7902938':{'en': 'Tele2', 'ru': 'Tele2'},
'59669664':{'en': 'SFR/Rife'},
'59669661':{'en': 'SFR/Rife'},
'59669660':{'en': 'SFR/Rife'},
'557199959':{'en': 'Vivo'},
'557199958':{'en': 'Vivo'},
'557199957':{'en': 'Vivo'},
'557199956':{'en': 'Vivo'},
'557199955':{'en': 'Vivo'},
'557199954':{'en': 'Vivo'},
'557199953':{'en': 'Vivo'},
'557199952':{'en': 'Vivo'},
'557199951':{'en': 'Vivo'},
'67619':{'en': 'U-Call'},
'67618':{'en': 'U-Call'},
'67617':{'en': 'U-Call'},
'67616':{'en': 'U-Call'},
'67615':{'en': 'U-Call'},
'799636':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799637':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799634':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799635':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799632':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7902418':{'en': 'Tele2', 'ru': 'Tele2'},
'799631':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799638':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799639':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'601130':{'en': 'YTL'},
'5994161':{'en': 'Satel'},
'7958575':{'en': 'Tele2', 'ru': 'Tele2'},
'5994167':{'en': 'WIC'},
'5994166':{'en': 'WIC'},
'5994165':{'en': 'WIC'},
'5994164':{'en': 'WIC'},
'5994169':{'en': 'Satel'},
'5994168':{'en': 'WIC'},
'555598422':{'en': 'Brasil Telecom GSM'},
'555598423':{'en': 'Brasil Telecom GSM'},
'555598421':{'en': 'Brasil Telecom GSM'},
'555598426':{'en': 'Brasil Telecom GSM'},
'555598427':{'en': 'Brasil Telecom GSM'},
'555598424':{'en': 'Brasil Telecom GSM'},
'555598425':{'en': 'Brasil Telecom GSM'},
'67778':{'en': 'Solomon Telekom'},
'79333':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79332':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'79331':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'8525908':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'8525909':{'en': 'Lycamobile', 'zh': 'Lycamobile', 'zh_Hant': 'Lycamobile'},
'556999931':{'en': 'Vivo'},
'556999932':{'en': 'Vivo'},
'8525907':{'en': '21Vianet', 'zh': '21Vianet', 'zh_Hant': '21Vianet'},
'5939629':{'en': 'Movistar'},
'593939':{'en': 'Claro'},
'67774':{'en': 'Solomon Telekom'},
'7994250':{'en': 'Tele2', 'ru': 'Tele2'},
'554899928':{'en': 'TIM'},
'67775':{'en': 'Solomon Telekom'},
'554899929':{'en': 'TIM'},
'559699918':{'en': 'Oi'},
'6233499':{'en': 'Esia'},
'559699914':{'en': 'Oi'},
'559699915':{'en': 'Oi'},
'559699916':{'en': 'Oi'},
'559699917':{'en': 'Oi'},
'559699911':{'en': 'Oi'},
'559699912':{'en': 'Oi'},
'559699913':{'en': 'Oi'},
'62229610':{'en': 'Esia'},
'62229611':{'en': 'Esia'},
'8536612':{'en': 'CTM'},
'554899922':{'en': 'TIM'},
'554899923':{'en': 'TIM'},
'7904708':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904709':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'790217':{'en': 'Tele2', 'ru': 'Tele2'},
'554899921':{'en': 'TIM'},
'790216':{'en': 'Tele2', 'ru': 'Tele2'},
'556598429':{'en': 'Brasil Telecom GSM'},
'556598428':{'en': 'Brasil Telecom GSM'},
'62252913':{'en': 'Esia'},
'62252912':{'en': 'Esia'},
'62252911':{'en': 'Esia'},
'62252910':{'en': 'Esia'},
'554899924':{'en': 'TIM'},
'62252914':{'en': 'Esia'},
'790213':{'en': 'Tele2', 'ru': 'Tele2'},
'554899925':{'en': 'TIM'},
'790212':{'en': 'Tele2', 'ru': 'Tele2'},
'558799927':{'en': 'TIM'},
'558799926':{'en': 'TIM'},
'558799925':{'en': 'TIM'},
'558799924':{'en': 'TIM'},
'558799923':{'en': 'TIM'},
'558799922':{'en': 'TIM'},
'558799921':{'en': 'TIM'},
'790210':{'en': 'Tele2', 'ru': 'Tele2'},
'558799929':{'en': 'TIM'},
'558799928':{'en': 'TIM'},
'7902360':{'en': 'Tele2', 'ru': 'Tele2'},
'7902361':{'en': 'Tele2', 'ru': 'Tele2'},
'7902362':{'en': 'Tele2', 'ru': 'Tele2'},
'7902287':{'en': 'Tele2', 'ru': 'Tele2'},
'7902286':{'en': 'Tele2', 'ru': 'Tele2'},
'7902285':{'en': 'Tele2', 'ru': 'Tele2'},
'7902284':{'en': 'Tele2', 'ru': 'Tele2'},
'7902283':{'en': 'Tele2', 'ru': 'Tele2'},
'7902282':{'en': 'Tele2', 'ru': 'Tele2'},
'7902281':{'en': 'Tele2', 'ru': 'Tele2'},
'7902364':{'en': 'Tele2', 'ru': 'Tele2'},
'7902288':{'en': 'Tele2', 'ru': 'Tele2'},
'7996307':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'63965':{'en': 'Globe'},
'63967':{'en': 'Globe'},
'63966':{'en': 'Globe'},
'7996306':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'852690':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852691':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852692':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852693':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852694':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852695':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852697':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852699':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'595982':{'en': 'Tigo'},
'595983':{'en': 'Tigo'},
'595981':{'en': 'Tigo'},
'595986':{'en': 'Tigo'},
'557198362':{'en': 'Claro BR'},
'557198361':{'en': 'Claro BR'},
'557198360':{'en': 'Claro BR'},
'6015924':{'en': 'Celcom'},
'6015920':{'en': 'Celcom'},
'6015921':{'en': 'Celcom'},
'6015922':{'en': 'Celcom'},
'6015923':{'en': 'Celcom'},
'852968':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852969':{'en': 'China-Hongkong Telecom', 'zh': u('\u4e2d\u6e2f\u901a'), 'zh_Hant': u('\u4e2d\u6e2f\u901a')},
'852962':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852963':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852960':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'852961':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852966':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852967':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852964':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852965':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'622519':{'en': 'Esia'},
'799400':{'en': 'Tele2', 'ru': 'Tele2'},
'790462':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'559998422':{'en': 'Claro BR'},
'559998420':{'en': 'Claro BR'},
'559998421':{'en': 'Claro BR'},
'7996302':{'en': 'Tele2', 'ru': 'Tele2'},
'569979':{'en': 'Entel'},
'569970':{'en': 'Movistar'},
'569971':{'en': 'Entel'},
'569972':{'en': 'Movistar'},
'569973':{'en': 'Movistar'},
'569974':{'en': 'Movistar'},
'569975':{'en': 'Movistar'},
'569976':{'en': 'Movistar'},
'569977':{'en': 'Entel'},
'8536504':{'en': '3'},
'8536853':{'en': '3'},
'8536850':{'en': '3'},
'8536851':{'en': '3'},
'8536500':{'en': '3'},
'8536501':{'en': '3'},
'8536502':{'en': '3'},
'8536503':{'en': '3'},
'62548991':{'en': 'Esia'},
'7901860':{'en': 'Tele2', 'ru': 'Tele2'},
'8536338':{'en': '3'},
'556898418':{'en': 'Brasil Telecom GSM'},
'556898413':{'en': 'Brasil Telecom GSM'},
'556898412':{'en': 'Brasil Telecom GSM'},
'556898411':{'en': 'Brasil Telecom GSM'},
'556898417':{'en': 'Brasil Telecom GSM'},
'556898416':{'en': 'Brasil Telecom GSM'},
'556898415':{'en': 'Brasil Telecom GSM'},
'556898414':{'en': 'Brasil Telecom GSM'},
'62548990':{'en': 'Esia'},
'659860':{'en': 'SingTel'},
'557199238':{'en': 'TIM'},
'557199239':{'en': 'TIM'},
'659866':{'en': 'SingTel'},
'557199232':{'en': 'TIM'},
'557199233':{'en': 'TIM'},
'557199231':{'en': 'TIM'},
'557199236':{'en': 'TIM'},
'557199237':{'en': 'TIM'},
'557199234':{'en': 'TIM'},
'557199235':{'en': 'TIM'},
'559899149':{'en': 'Vivo'},
'559899148':{'en': 'Vivo'},
'559899145':{'en': 'Vivo'},
'559899144':{'en': 'Vivo'},
'559899147':{'en': 'Vivo'},
'559899146':{'en': 'Vivo'},
'559899141':{'en': 'Vivo'},
'559899143':{'en': 'Vivo'},
'559899142':{'en': 'Vivo'},
'556198191':{'en': 'TIM'},
'556198193':{'en': 'TIM'},
'556198192':{'en': 'TIM'},
'556198195':{'en': 'TIM'},
'556198194':{'en': 'TIM'},
'556198197':{'en': 'TIM'},
'556198196':{'en': 'TIM'},
'556198199':{'en': 'TIM'},
'556198198':{'en': 'TIM'},
'569754':{'en': 'Entel'},
'569755':{'en': 'Entel'},
'569756':{'en': 'Entel'},
'569757':{'en': 'Entel'},
'569750':{'en': 'WOM'},
'569751':{'en': 'Entel'},
'569752':{'en': 'Entel'},
'569753':{'en': 'Entel'},
'60154871':{'en': 'red ONE'},
'60154870':{'en': 'Optical Communication'},
'60154873':{'en': 'red ONE'},
'60154872':{'en': 'red ONE'},
'569758':{'en': 'Entel'},
'569759':{'en': 'Claro'},
'60154877':{'en': 'red ONE'},
'60154876':{'en': 'red ONE'},
'88015':{'en': 'TeleTalk'},
'559499969':{'en': 'Oi'},
'559999111':{'en': 'Vivo'},
'559999113':{'en': 'Vivo'},
'559999112':{'en': 'Vivo'},
'559999115':{'en': 'Vivo'},
'559999114':{'en': 'Vivo'},
'658625':{'en': 'M1'},
'658624':{'en': 'M1'},
'658627':{'en': 'M1'},
'658626':{'en': 'M1'},
'658621':{'en': 'SingTel'},
'658620':{'en': 'SingTel'},
'658623':{'en': 'M1'},
'658622':{'en': 'SingTel'},
'88011':{'en': 'Citycell'},
'658629':{'en': 'M1'},
'658628':{'en': 'M1'},
'554598827':{'en': 'Claro BR'},
'554598826':{'en': 'Claro BR'},
'554598825':{'en': 'Claro BR'},
'554598824':{'en': 'Claro BR'},
'554598823':{'en': 'Claro BR'},
'554598822':{'en': 'Claro BR'},
'554598821':{'en': 'Claro BR'},
'556798119':{'en': 'TIM'},
'554598829':{'en': 'Claro BR'},
'554598828':{'en': 'Claro BR'},
'558499610':{'en': 'TIM'},
'556798118':{'en': 'TIM'},
'558499611':{'en': 'TIM'},
'556798449':{'en': 'Brasil Telecom GSM'},
'556798448':{'en': 'Brasil Telecom GSM'},
'86159':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86158':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'6011595':{'en': 'XOX'},
'6011597':{'en': 'XOX'},
'6011596':{'en': 'XOX'},
'6011599':{'en': 'XOX'},
'6011598':{'en': 'XOX'},
'86153':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86152':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'554999171':{'en': 'Vivo'},
'86157':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86156':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'554599969':{'en': 'TIM'},
'559398413':{'en': 'Claro BR'},
'554599968':{'en': 'TIM'},
'558499617':{'en': 'TIM'},
'556798447':{'en': 'Brasil Telecom GSM'},
'62562990':{'en': 'Esia'},
'61428':{'en': 'Telstra'},
'61429':{'en': 'Telstra'},
'61422':{'en': 'Optus'},
'556798441':{'en': 'Brasil Telecom GSM'},
'61420':{'en': 'Vodafone'},
'61421':{'en': 'Optus'},
'61426':{'en': 'Vodafone'},
'61427':{'en': 'Telstra'},
'61424':{'en': 'Vodafone'},
'61425':{'en': 'Vodafone'},
'556798443':{'en': 'Brasil Telecom GSM'},
'556798442':{'en': 'Brasil Telecom GSM'},
'8536337':{'en': '3'},
'554599151':{'en': 'Vivo'},
'554599152':{'en': 'Vivo'},
'554599153':{'en': 'Vivo'},
'554599154':{'en': 'Vivo'},
'554599155':{'en': 'Vivo'},
'554599156':{'en': 'Vivo'},
'554599157':{'en': 'Vivo'},
'554599158':{'en': 'Vivo'},
'8536336':{'en': '3'},
'55839811':{'en': 'Vivo'},
'55839810':{'en': 'Vivo'},
'55839813':{'en': 'Vivo'},
'55839812':{'en': 'Vivo'},
'55839815':{'en': 'Vivo'},
'55839814':{'en': 'Vivo'},
'7908348':{'en': 'TMT', 'ru': 'TMT'},
'7908349':{'en': 'TMT', 'ru': 'TMT'},
'7908344':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908345':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908346':{'en': 'TMT', 'ru': 'TMT'},
'7908347':{'en': 'TMT', 'ru': 'TMT'},
'7908340':{'en': 'TMT', 'ru': 'TMT'},
'7908341':{'en': 'TMT', 'ru': 'TMT'},
'7908342':{'en': 'TMT', 'ru': 'TMT'},
'7908343':{'en': 'TMT', 'ru': 'TMT'},
'556499948':{'en': 'Vivo'},
'556499949':{'en': 'Vivo'},
'556499946':{'en': 'Vivo'},
'556499947':{'en': 'Vivo'},
'556499944':{'en': 'Vivo'},
'556499945':{'en': 'Vivo'},
'556499942':{'en': 'Vivo'},
'556499943':{'en': 'Vivo'},
'556499941':{'en': 'Vivo'},
'555499938':{'en': 'Vivo'},
'555499939':{'en': 'Vivo'},
'558899624':{'en': 'TIM'},
'555499931':{'en': 'Vivo'},
'555499932':{'en': 'Vivo'},
'555499933':{'en': 'Vivo'},
'555499934':{'en': 'Vivo'},
'555499935':{'en': 'Vivo'},
'555499936':{'en': 'Vivo'},
'555499937':{'en': 'Vivo'},
'593961':{'en': 'CNT'},
'556199813':{'en': 'Vivo'},
'556199812':{'en': 'Vivo'},
'556298138':{'en': 'TIM'},
'556298139':{'en': 'TIM'},
'556199817':{'en': 'Vivo'},
'556199816':{'en': 'Vivo'},
'556199815':{'en': 'Vivo'},
'556199814':{'en': 'Vivo'},
'556298132':{'en': 'TIM'},
'556298133':{'en': 'TIM'},
'556199819':{'en': 'Vivo'},
'556298131':{'en': 'TIM'},
'556298136':{'en': 'TIM'},
'556298137':{'en': 'TIM'},
'556298134':{'en': 'TIM'},
'556298135':{'en': 'TIM'},
'7901802':{'en': 'Tele2', 'ru': 'Tele2'},
'7902670':{'en': 'Tele2', 'ru': 'Tele2'},
'7902150':{'en': 'Tele2', 'ru': 'Tele2'},
'7996750':{'en': 'Tele2', 'ru': 'Tele2'},
'7901803':{'en': 'Tele2', 'ru': 'Tele2'},
'559899621':{'en': 'Oi'},
'852609':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'7900344':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900345':{'en': 'Tele2', 'ru': 'Tele2'},
'7900346':{'en': 'Tele2', 'ru': 'Tele2'},
'7900347':{'en': 'Tele2', 'ru': 'Tele2'},
'7900340':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900341':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7900342':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'62361603':{'en': 'Esia'},
'84166':{'en': 'Viettel Mobile'},
'84167':{'en': 'Viettel Mobile'},
'84164':{'en': 'Viettel Mobile'},
'84165':{'en': 'Viettel Mobile'},
'7900348':{'en': 'Tele2', 'ru': 'Tele2'},
'7900349':{'en': 'Tele2', 'ru': 'Tele2'},
'554998409':{'en': 'Brasil Telecom GSM'},
'554998408':{'en': 'Brasil Telecom GSM'},
'554998401':{'en': 'Brasil Telecom GSM'},
'554998403':{'en': 'Brasil Telecom GSM'},
'554998402':{'en': 'Brasil Telecom GSM'},
'554998405':{'en': 'Brasil Telecom GSM'},
'554998404':{'en': 'Brasil Telecom GSM'},
'554998407':{'en': 'Brasil Telecom GSM'},
'554998406':{'en': 'Brasil Telecom GSM'},
'559698412':{'en': 'Claro BR'},
'559698413':{'en': 'Claro BR'},
'559698410':{'en': 'Claro BR'},
'559698411':{'en': 'Claro BR'},
'557199935':{'en': 'Vivo'},
'557199934':{'en': 'Vivo'},
'557199937':{'en': 'Vivo'},
'557199936':{'en': 'Vivo'},
'557199931':{'en': 'Vivo'},
'557199933':{'en': 'Vivo'},
'557199932':{'en': 'Vivo'},
'557199939':{'en': 'Vivo'},
'557199938':{'en': 'Vivo'},
'799610':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799611':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799612':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799613':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'799615':{'en': 'Tele2', 'ru': 'Tele2'},
'8536541':{'en': '3'},
'554898451':{'en': 'Brasil Telecom GSM'},
'7958511':{'en': 'Tele2', 'ru': 'Tele2'},
'554898452':{'en': 'Brasil Telecom GSM'},
'7958514':{'en': 'Tele2', 'ru': 'Tele2'},
'7958515':{'en': 'Tele2', 'ru': 'Tele2'},
'7958516':{'en': 'Tele2', 'ru': 'Tele2'},
'555598401':{'en': 'Brasil Telecom GSM'},
'555598402':{'en': 'Brasil Telecom GSM'},
'555598403':{'en': 'Brasil Telecom GSM'},
'555598404':{'en': 'Brasil Telecom GSM'},
'555598405':{'en': 'Brasil Telecom GSM'},
'555598406':{'en': 'Brasil Telecom GSM'},
'555598407':{'en': 'Brasil Telecom GSM'},
'555598408':{'en': 'Brasil Telecom GSM'},
'555598409':{'en': 'Brasil Telecom GSM'},
'6011102':{'en': 'Webe'},
'6011103':{'en': 'Webe'},
'6011100':{'en': 'Webe'},
'6011101':{'en': 'Webe'},
'6011106':{'en': 'red ONE'},
'6011107':{'en': 'red ONE'},
'6011104':{'en': 'Webe'},
'558599601':{'en': 'TIM'},
'6011108':{'en': 'red ONE'},
'6011109':{'en': 'red ONE'},
'599795':{'en': 'Chippie'},
'7958570':{'en': 'Tele2', 'ru': 'Tele2'},
'558599607':{'en': 'TIM'},
'7901822':{'en': 'Tele2', 'ru': 'Tele2'},
'55739988':{'en': 'Oi'},
'55739989':{'en': 'Oi'},
'67675':{'en': 'U-Call'},
'67677':{'en': 'U-Call'},
'67676':{'en': 'U-Call'},
'67678':{'en': 'U-Call'},
'55739981':{'en': 'Claro BR'},
'55739986':{'en': 'Oi'},
'55739987':{'en': 'Oi'},
'55739985':{'en': 'Oi'},
'66812':{'en': 'AIS'},
'66813':{'en': 'DTAC'},
'66810':{'en': 'AIS'},
'66811':{'en': 'AIS'},
'66816':{'en': 'DTAC'},
'66817':{'en': 'AIS'},
'66814':{'en': 'DTAC'},
'66815':{'en': 'DTAC'},
'66818':{'en': 'AIS'},
'66819':{'en': 'AIS'},
'554799941':{'en': 'TIM'},
'5906907':{'en': 'Orange'},
'554799943':{'en': 'TIM'},
'554799942':{'en': 'TIM'},
'554799945':{'en': 'TIM'},
'554799944':{'en': 'TIM'},
'554799947':{'en': 'TIM'},
'554799946':{'en': 'TIM'},
'554799949':{'en': 'TIM'},
'554799948':{'en': 'TIM'},
'5699484':{'en': 'Entel'},
'5699485':{'en': 'Entel'},
'5699482':{'en': 'Movistar'},
'5699483':{'en': 'Entel'},
'5699480':{'en': 'Movistar'},
'5699481':{'en': 'Movistar'},
'8525749':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'5554991':{'en': 'Claro BR'},
'7904728':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904729':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7904726':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'7904727':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'5946949':{'en': 'Digicel'},
'8536382':{'en': '3'},
'55929840':{'en': 'Claro BR'},
'55929841':{'en': 'Claro BR'},
'55929842':{'en': 'Claro BR'},
'55929843':{'en': 'Claro BR'},
'55929844':{'en': 'Claro BR'},
'62380997':{'en': 'Esia'},
'62380996':{'en': 'Esia'},
'62380995':{'en': 'Esia'},
'8527072':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8527073':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'62380999':{'en': 'Esia'},
'62380998':{'en': 'Esia'},
'8527074':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8527075':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'5562984':{'en': 'Brasil Telecom GSM'},
'5562985':{'en': 'Brasil Telecom GSM'},
'63949':{'en': 'Smart'},
'63948':{'en': 'Smart'},
'554899181':{'en': 'Vivo'},
'63943':{'en': 'Sun'},
'5561984':{'en': 'Brasil Telecom GSM'},
'63947':{'en': 'Smart'},
'55779993':{'en': 'Vivo'},
'63945':{'en': 'Globe'},
'55779992':{'en': 'Vivo'},
'556598449':{'en': 'Brasil Telecom GSM'},
'556598448':{'en': 'Brasil Telecom GSM'},
'556598447':{'en': 'Brasil Telecom GSM'},
'556598446':{'en': 'Brasil Telecom GSM'},
'556598445':{'en': 'Brasil Telecom GSM'},
'556598444':{'en': 'Brasil Telecom GSM'},
'556598443':{'en': 'Brasil Telecom GSM'},
'556598442':{'en': 'Brasil Telecom GSM'},
'556598441':{'en': 'Brasil Telecom GSM'},
'554899185':{'en': 'Vivo'},
'852944':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852945':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852946':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852947':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852940':{'en': 'HKT', 'zh': u('\u9999\u6e2f\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u9999\u6e2f\u79fb\u52d5\u901a\u8a0a')},
'852941':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852942':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852943':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'852948':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'852949':{'en': '3', 'zh': '3', 'zh_Hant': '3'},
'5595988':{'en': 'Oi'},
'5595989':{'en': 'Oi'},
'5595986':{'en': 'Oi'},
'5595987':{'en': 'Oi'},
'5595985':{'en': 'Oi'},
'569912':{'en': 'Entel'},
'569913':{'en': 'Entel'},
'569910':{'en': 'Claro'},
'569916':{'en': 'Movistar'},
'569917':{'en': 'Claro'},
'569915':{'en': 'Entel'},
'569918':{'en': 'Movistar'},
'569919':{'en': 'Movistar'},
'5939827':{'en': 'Claro'},
'5939826':{'en': 'Claro'},
'5939825':{'en': 'Claro'},
'5939824':{'en': 'CNT'},
'5939823':{'en': 'CNT'},
'5939822':{'en': 'CNT'},
'5939821':{'en': 'CNT'},
'559599981':{'en': 'Oi'},
'5939829':{'en': 'Claro'},
'5939828':{'en': 'Claro'},
'60154851':{'en': 'Maxis'},
'8536528':{'en': 'CTM'},
'8536529':{'en': 'CTM'},
'8536526':{'en': 'CTM'},
'8536527':{'en': 'CTM'},
'8536524':{'en': 'CTM'},
'8536525':{'en': 'CTM'},
'8536522':{'en': 'China Telecom'},
'8536523':{'en': 'China Telecom'},
'8536520':{'en': 'China Telecom'},
'8536521':{'en': 'China Telecom'},
'7900407':{'en': 'Tele2', 'ru': 'Tele2'},
'7900406':{'en': 'Tele2', 'ru': 'Tele2'},
'558599628':{'en': 'TIM'},
'558599629':{'en': 'TIM'},
'7900403':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900402':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900401':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'7900400':{'en': 'Motiv', 'ru': u('\u041c\u041e\u0422\u0418\u0412')},
'558599622':{'en': 'TIM'},
'558599623':{'en': 'TIM'},
'659116':{'en': 'SingTel'},
'558599621':{'en': 'TIM'},
'558599626':{'en': 'TIM'},
'558599627':{'en': 'TIM'},
'558599624':{'en': 'TIM'},
'558599625':{'en': 'TIM'},
'7991342':{'en': 'Tele2', 'ru': 'Tele2'},
'7991343':{'en': 'Tele2', 'ru': 'Tele2'},
'7991346':{'en': 'Tele2', 'ru': 'Tele2'},
'7991347':{'en': 'Tele2', 'ru': 'Tele2'},
'7991344':{'en': 'Tele2', 'ru': 'Tele2'},
'7991345':{'en': 'Tele2', 'ru': 'Tele2'},
'7991348':{'en': 'Tele2', 'ru': 'Tele2'},
'7991349':{'en': 'Tele2', 'ru': 'Tele2'},
'62549994':{'en': 'Esia'},
'62549992':{'en': 'Esia'},
'62549993':{'en': 'Esia'},
'62549990':{'en': 'Esia'},
'62549991':{'en': 'Esia'},
'62911998':{'en': 'Esia'},
'557199211':{'en': 'TIM'},
'557199212':{'en': 'TIM'},
'557199213':{'en': 'TIM'},
'557199214':{'en': 'TIM'},
'557199215':{'en': 'TIM'},
'557199216':{'en': 'TIM'},
'557199217':{'en': 'TIM'},
'557199218':{'en': 'TIM'},
'557199219':{'en': 'TIM'},
'659800':{'en': 'StarHub'},
'659806':{'en': 'SingTel'},
'659807':{'en': 'SingTel'},
'62253914':{'en': 'Esia'},
'62253910':{'en': 'Esia'},
'62253911':{'en': 'Esia'},
'62253912':{'en': 'Esia'},
'62253913':{'en': 'Esia'},
'559899163':{'en': 'Vivo'},
'559899162':{'en': 'Vivo'},
'559899161':{'en': 'Vivo'},
'559899167':{'en': 'Vivo'},
'559899166':{'en': 'Vivo'},
'559899165':{'en': 'Vivo'},
'559899164':{'en': 'Vivo'},
'559899169':{'en': 'Vivo'},
'559899168':{'en': 'Vivo'},
'55829995':{'en': 'TIM'},
'55829994':{'en': 'TIM'},
'55829997':{'en': 'TIM'},
'55829996':{'en': 'TIM'},
'55829991':{'en': 'TIM'},
'55829990':{'en': 'TIM'},
'55829993':{'en': 'TIM'},
'55829992':{'en': 'TIM'},
'8536643':{'en': '3'},
'55829998':{'en': 'TIM'},
'799223':{'en': 'Tele2', 'ru': 'Tele2'},
'62421992':{'en': 'Esia'},
'554899643':{'en': 'TIM'},
'559499904':{'en': 'Oi'},
'554899641':{'en': 'TIM'},
'559499901':{'en': 'Oi'},
'559999139':{'en': 'Vivo'},
'559999138':{'en': 'Vivo'},
'559999137':{'en': 'Vivo'},
'559999136':{'en': 'Vivo'},
'559999135':{'en': 'Vivo'},
'559999134':{'en': 'Vivo'},
'559499909':{'en': 'Oi'},
'559499908':{'en': 'Oi'},
'559999131':{'en': 'Vivo'},
'799222':{'en': 'Tele2', 'ru': 'Tele2'},
'62421991':{'en': 'Esia'},
'658609':{'en': 'StarHub'},
'658608':{'en': 'StarHub'},
'658607':{'en': 'StarHub'},
'658606':{'en': 'StarHub'},
'658605':{'en': 'StarHub'},
'658604':{'en': 'StarHub'},
'658603':{'en': 'StarHub'},
'658602':{'en': 'StarHub'},
'658601':{'en': 'StarHub'},
'658600':{'en': 'M1'},
'8536641':{'en': 'SmarTone'},
'556699953':{'en': 'Vivo'},
'556699952':{'en': 'Vivo'},
'556699951':{'en': 'Vivo'},
'62421990':{'en': 'Esia'},
'556699957':{'en': 'Vivo'},
'556699956':{'en': 'Vivo'},
'556699955':{'en': 'Vivo'},
'556699954':{'en': 'Vivo'},
'556699959':{'en': 'Vivo'},
'556699958':{'en': 'Vivo'},
'86177':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86176':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86175':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'86173':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86172':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'86171':{'en': 'China Unicom', 'zh': u('\u4e2d\u56fd\u8054\u901a'), 'zh_Hant': u('\u4e2d\u570b\u806f\u901a')},
'799224':{'en': 'Tele2', 'ru': 'Tele2'},
'5592981':{'en': 'TIM'},
'5592987':{'en': 'Oi'},
'5592986':{'en': 'Oi'},
'5592985':{'en': 'Oi'},
'5592989':{'en': 'Oi'},
'5592988':{'en': 'Oi'},
'7958657':{'en': 'Tele2', 'ru': 'Tele2'},
'8536647':{'en': 'CTM'},
'6015481':{'en': 'Jaring'},
'8536646':{'en': '3'},
'5939690':{'en': 'Movistar'},
'557499965':{'en': 'Vivo'},
'557499964':{'en': 'Vivo'},
'557499967':{'en': 'Vivo'},
'554599135':{'en': 'Vivo'},
'554599132':{'en': 'Vivo'},
'554599133':{'en': 'Vivo'},
'557499963':{'en': 'Vivo'},
'557499962':{'en': 'Vivo'},
'557499969':{'en': 'Vivo'},
'557499968':{'en': 'Vivo'},
'554599138':{'en': 'Vivo'},
'554599139':{'en': 'Vivo'},
'62421994':{'en': 'Esia'},
'55819970':{'en': 'TIM'},
'55819971':{'en': 'TIM'},
'55819972':{'en': 'TIM'},
'554598842':{'en': 'Claro BR'},
'7908366':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908367':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908364':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'5591981':{'en': 'TIM'},
'5591986':{'en': 'Oi'},
'5591987':{'en': 'Oi'},
'5591985':{'en': 'Oi'},
'558399444':{'en': 'Claro BR'},
'5591988':{'en': 'Oi'},
'5591989':{'en': 'Oi'},
'8536339':{'en': '3'},
'7908368':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'7908369':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'559599159':{'en': 'Vivo'},
'559599158':{'en': 'Vivo'},
'61402':{'en': 'Optus'},
'61403':{'en': 'Optus'},
'61404':{'en': 'Vodafone'},
'61405':{'en': 'Vodafone'},
'61406':{'en': 'Vodafone'},
'61407':{'en': 'Telstra'},
'559599151':{'en': 'Vivo'},
'61409':{'en': 'Telstra'},
'559599153':{'en': 'Vivo'},
'559599152':{'en': 'Vivo'},
'559599155':{'en': 'Vivo'},
'559599154':{'en': 'Vivo'},
'559599157':{'en': 'Vivo'},
'559599156':{'en': 'Vivo'},
'799302':{'en': 'Tele2', 'ru': 'Tele2'},
'556599909':{'en': 'Vivo'},
'556499965':{'en': 'Vivo'},
'556499966':{'en': 'Vivo'},
'556499967':{'en': 'Vivo'},
'556499961':{'en': 'Vivo'},
'556499962':{'en': 'Vivo'},
'556499963':{'en': 'Vivo'},
'556599901':{'en': 'Vivo'},
'556599903':{'en': 'Vivo'},
'556599902':{'en': 'Vivo'},
'556499968':{'en': 'Vivo'},
'556499969':{'en': 'Vivo'},
'556599907':{'en': 'Vivo'},
'556599906':{'en': 'Vivo'},
'556498116':{'en': 'TIM'},
'555499958':{'en': 'Vivo'},
'555499959':{'en': 'Vivo'},
'555499956':{'en': 'Vivo'},
'555499957':{'en': 'Vivo'},
'555499954':{'en': 'Vivo'},
'555499955':{'en': 'Vivo'},
'555499952':{'en': 'Vivo'},
'555499953':{'en': 'Vivo'},
'7958138':{'en': 'Tele2', 'ru': 'Tele2'},
'555499951':{'en': 'Vivo'},
'556498115':{'en': 'TIM'},
'8536335':{'en': 'CTM'},
'556498112':{'en': 'TIM'},
'556298111':{'en': 'TIM'},
'559399182':{'en': 'Vivo'},
'559399183':{'en': 'Vivo'},
'559399184':{'en': 'Vivo'},
'559399185':{'en': 'Vivo'},
'559399186':{'en': 'Vivo'},
'559399187':{'en': 'Vivo'},
'559399188':{'en': 'Vivo'},
'559399189':{'en': 'Vivo'},
'556498111':{'en': 'TIM'},
'7958139':{'en': 'Tele2', 'ru': 'Tele2'},
'799301':{'en': 'Tele2', 'ru': 'Tele2'},
'7958590':{'en': 'Tele2', 'ru': 'Tele2'},
'57322':{'en': 'Claro'},
'7958592':{'en': 'Tele2', 'ru': 'Tele2'},
'7958134':{'en': 'Tele2', 'ru': 'Tele2'},
'6221409':{'en': 'Esia'},
'7902151':{'en': 'Tele2', 'ru': 'Tele2'},
'658452':{'en': 'SingTel'},
'658453':{'en': 'SingTel'},
'658450':{'en': 'SingTel'},
'658451':{'en': 'SingTel'},
'7958135':{'en': 'Tele2', 'ru': 'Tele2'},
'658457':{'en': 'SingTel'},
'658454':{'en': 'SingTel'},
'658455':{'en': 'SingTel'},
'7902157':{'en': 'Tele2', 'ru': 'Tele2'},
'658458':{'en': 'SingTel'},
'658459':{'en': 'SingTel'},
'556899911':{'en': 'Vivo'},
'7902156':{'en': 'Tele2', 'ru': 'Tele2'},
'7902155':{'en': 'Tele2', 'ru': 'Tele2'},
'557199919':{'en': 'Vivo'},
'557199918':{'en': 'Vivo'},
'557199913':{'en': 'Vivo'},
'557199912':{'en': 'Vivo'},
'557199911':{'en': 'Vivo'},
'557199917':{'en': 'Vivo'},
'557199916':{'en': 'Vivo'},
'557199915':{'en': 'Vivo'},
'557199914':{'en': 'Vivo'},
'5584988':{'en': 'Oi'},
'5584989':{'en': 'Oi'},
'5584985':{'en': 'Oi'},
'5584986':{'en': 'Oi'},
'5584987':{'en': 'Oi'},
'7958133':{'en': 'Tele2', 'ru': 'Tele2'},
'799678':{'en': 'Tele2', 'ru': 'Tele2'},
'799679':{'en': 'Tele2', 'ru': 'Tele2'},
'62889':{'en': 'Smartfren'},
'799673':{'en': 'Tele2', 'ru': 'Tele2'},
'799676':{'en': 'Tele2', 'ru': 'Tele2'},
'799677':{'en': 'Tele2', 'ru': 'Tele2'},
'799674':{'en': 'Tele2', 'ru': 'Tele2'},
'6272187':{'en': 'Esia'},
'7958535':{'en': 'Tele2', 'ru': 'Tele2'},
'790230':{'en': 'Tele2', 'ru': 'Tele2'},
'554899131':{'en': 'Vivo'},
'799233':{'en': 'Tele2', 'ru': 'Tele2'},
'799230':{'en': 'Tele2', 'ru': 'Tele2'},
'61488':{'en': 'Telstra'},
'67659':{'en': 'U-Call'},
'67658':{'en': 'U-Call'},
'67657':{'en': 'U-Call'},
'67656':{'en': 'U-Call'},
'67655':{'en': 'U-Call'},
'67654':{'en': 'U-Call'},
'67653':{'en': 'U-Call'},
'5699976':{'en': 'Claro'},
'5699977':{'en': 'Claro'},
'5699974':{'en': 'Movistar'},
'554799973':{'en': 'TIM'},
'5699972':{'en': 'Movistar'},
'5699973':{'en': 'Movistar'},
'5699970':{'en': 'Movistar'},
'5699971':{'en': 'Movistar'},
'799235':{'en': 'Tele2', 'ru': 'Tele2'},
'554998881':{'en': 'Claro BR'},
'554998880':{'en': 'Claro BR'},
'5699978':{'en': 'Claro'},
'554998882':{'en': 'Claro BR'},
'554799967':{'en': 'TIM'},
'554799966':{'en': 'TIM'},
'554799965':{'en': 'TIM'},
'554799964':{'en': 'TIM'},
'554799963':{'en': 'TIM'},
'554799962':{'en': 'TIM'},
'554799961':{'en': 'TIM'},
'554799969':{'en': 'TIM'},
'554799968':{'en': 'TIM'},
'554899133':{'en': 'Vivo'},
'793393':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'793399':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'554899132':{'en': 'Vivo'},
'554799619':{'en': 'TIM'},
'554799618':{'en': 'TIM'},
'5699606':{'en': 'Movistar'},
'5699607':{'en': 'Entel'},
'5699600':{'en': 'Movistar'},
'5699601':{'en': 'Entel'},
'5699602':{'en': 'Movistar'},
'5699603':{'en': 'Movistar'},
'554799611':{'en': 'TIM'},
'601895':{'en': 'U Mobile'},
'554799613':{'en': 'TIM'},
'554799612':{'en': 'TIM'},
'554799615':{'en': 'TIM'},
'554799614':{'en': 'TIM'},
'554799617':{'en': 'TIM'},
'554799616':{'en': 'TIM'},
'7902403':{'en': 'Tele2', 'ru': 'Tele2'},
'554899135':{'en': 'Vivo'},
'558599989':{'en': 'TIM'},
'558599988':{'en': 'TIM'},
'558599987':{'en': 'TIM'},
'558599986':{'en': 'TIM'},
'558599985':{'en': 'TIM'},
'558599984':{'en': 'TIM'},
'558599983':{'en': 'TIM'},
'558599982':{'en': 'TIM'},
'558599981':{'en': 'TIM'},
'559799184':{'en': 'Vivo'},
'559799185':{'en': 'Vivo'},
'559799186':{'en': 'Vivo'},
'559799187':{'en': 'Vivo'},
'559799181':{'en': 'Vivo'},
'559799182':{'en': 'Vivo'},
'559799183':{'en': 'Vivo'},
'554899134':{'en': 'Vivo'},
'559799188':{'en': 'Vivo'},
'6256192':{'en': 'Esia'},
'554899137':{'en': 'Vivo'},
'558499481':{'en': 'Claro BR'},
'65910':{'en': 'StarHub'},
'559999935':{'en': 'Oi'},
'559999934':{'en': 'Oi'},
'559999933':{'en': 'Oi'},
'7902939':{'en': 'Tele2', 'ru': 'Tele2'},
'556398131':{'en': 'TIM'},
'554899136':{'en': 'Vivo'},
'7902935':{'en': 'Tele2', 'ru': 'Tele2'},
'7902937':{'en': 'Tele2', 'ru': 'Tele2'},
'7902936':{'en': 'Tele2', 'ru': 'Tele2'},
'556598425':{'en': 'Brasil Telecom GSM'},
'556598424':{'en': 'Brasil Telecom GSM'},
'556598427':{'en': 'Brasil Telecom GSM'},
'556598426':{'en': 'Brasil Telecom GSM'},
'558199738':{'en': 'TIM'},
'554899139':{'en': 'Vivo'},
'556598423':{'en': 'Brasil Telecom GSM'},
'556598422':{'en': 'Brasil Telecom GSM'},
'558199734':{'en': 'TIM'},
'558199735':{'en': 'TIM'},
'558199736':{'en': 'TIM'},
'558199737':{'en': 'TIM'},
'558199730':{'en': 'TIM'},
'558199731':{'en': 'TIM'},
'558199732':{'en': 'TIM'},
'558199733':{'en': 'TIM'},
'554898864':{'en': 'Claro BR'},
'554898865':{'en': 'Claro BR'},
'55989844':{'en': 'Claro BR'},
'55989845':{'en': 'Claro BR'},
'55989842':{'en': 'Claro BR'},
'55989843':{'en': 'Claro BR'},
'55989840':{'en': 'Claro BR'},
'55989841':{'en': 'Claro BR'},
'6256191':{'en': 'Esia'},
'7983888':{'en': 'Beeline', 'ru': u('\u0411\u0438\u043b\u0430\u0439\u043d')},
'554899138':{'en': 'Vivo'},
'85366001':{'en': 'CTM'},
'63921':{'en': 'Smart'},
'63920':{'en': 'Smart'},
'63923':{'en': 'Sun'},
'63922':{'en': 'Sun'},
'63927':{'en': 'Globe'},
'63926':{'en': 'Globe'},
'63929':{'en': 'Smart'},
'63928':{'en': 'Smart'},
'6223292':{'en': 'Esia'},
'6235599':{'en': 'Esia'},
'6235598':{'en': 'Esia'},
'554799609':{'en': 'TIM'},
'569939':{'en': 'Claro'},
'569934':{'en': 'Movistar'},
'569935':{'en': 'Entel'},
'569936':{'en': 'Movistar'},
'569937':{'en': 'Movistar'},
'569930':{'en': 'Entel'},
'569931':{'en': 'Entel'},
'569932':{'en': 'Movistar'},
'569933':{'en': 'Movistar'},
'569989':{'en': 'Entel'},
'8536548':{'en': 'SmarTone'},
'8536549':{'en': 'SmarTone'},
'556698132':{'en': 'TIM'},
'658848':{'en': 'M1'},
'556698131':{'en': 'TIM'},
'8536540':{'en': '3'},
'658844':{'en': 'M1'},
'8536543':{'en': 'China Telecom'},
'8536544':{'en': 'China Telecom'},
'8536545':{'en': 'CTM'},
'8536546':{'en': 'CTM'},
'557599980':{'en': 'Vivo'},
'558599602':{'en': 'TIM'},
'558599603':{'en': 'TIM'},
'558599604':{'en': 'TIM'},
'558599605':{'en': 'TIM'},
'558599606':{'en': 'TIM'},
'557599981':{'en': 'Vivo'},
'558599608':{'en': 'TIM'},
'558599609':{'en': 'TIM'},
'7901820':{'en': 'Tele2', 'ru': 'Tele2'},
'7901821':{'en': 'Tele2', 'ru': 'Tele2'},
'557599982':{'en': 'Vivo'},
'569981':{'en': 'Entel'},
'5946944':{'en': 'Orange'},
'5946942':{'en': 'Orange'},
'5946940':{'en': 'SFR'},
'569980':{'en': 'Claro'},
'554799605':{'en': 'TIM'},
'559399156':{'en': 'Vivo'},
'569982':{'en': 'Entel'},
'557599986':{'en': 'Vivo'},
'557599987':{'en': 'Vivo'},
'569984':{'en': 'Claro'},
'8524644':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8524645':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8524647':{'en': 'Sun Mobile', 'zh': u('\u65b0\u79fb\u52a8\u901a\u8baf'), 'zh_Hant': u('\u65b0\u79fb\u52d5\u901a\u8a0a')},
'8524640':{'en': 'China Mobile', 'zh': u('\u4e2d\u56fd\u79fb\u52a8'), 'zh_Hant': u('\u4e2d\u570b\u79fb\u52d5')},
'8524641':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8524642':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8524643':{'en': 'SmarTone', 'zh': u('\u6570\u7801\u901a'), 'zh_Hant': u('\u6578\u78bc\u901a')},
'8524648':{'en': 'Multibyte', 'zh': 'Multibyte', 'zh_Hant': 'Multibyte'},
'8524649':{'en': 'CITIC', 'zh': u('\u4e2d\u4fe1\u56fd\u9645\u7535\u8baf'), 'zh_Hant': u('\u4e2d\u4fe1\u570b\u969b\u96fb\u8a0a')},
'557199276':{'en': 'TIM'},
'557199277':{'en': 'TIM'},
'557199274':{'en': 'TIM'},
'557199275':{'en': 'TIM'},
'557199272':{'en': 'TIM'},
'557199273':{'en': 'TIM'},
'557199271':{'en': 'TIM'},
'557199278':{'en': 'TIM'},
'557199279':{'en': 'TIM'},
'556499641':{'en': 'Vivo'},
'554599115':{'en': 'Vivo'},
'7958558':{'en': 'Tele2', 'ru': 'Tele2'},
'556499643':{'en': 'Vivo'},
'554599117':{'en': 'Vivo'},
'559799612':{'en': 'Oi'},
'556499645':{'en': 'Vivo'},
'556499644':{'en': 'Vivo'},
'556499647':{'en': 'Vivo'},
'7958559':{'en': 'Tele2', 'ru': 'Tele2'},
'556499646':{'en': 'Vivo'},
'569798':{'en': 'Entel'},
'569799':{'en': 'Entel'},
'559799613':{'en': 'Oi'},
'60154830':{'en': 'EB Technologies'},
'8526261':{'en': 'Webbing', 'zh': 'Webbing', 'zh_Hant': 'Webbing'},
'569790':{'en': 'Claro'},
'569791':{'en': 'Claro'},
'569792':{'en': 'Claro'},
'569793':{'en': 'Claro'},
'569794':{'en': 'Claro'},
'569795':{'en': 'Entel'},
'569796':{'en': 'Entel'},
'569797':{'en': 'Entel'},
'559999155':{'en': 'Vivo'},
'559999154':{'en': 'Vivo'},
'559999157':{'en': 'Vivo'},
'559999156':{'en': 'Vivo'},
'559999151':{'en': 'Vivo'},
'556498113':{'en': 'TIM'},
'559999153':{'en': 'Vivo'},
'559999152':{'en': 'Vivo'},
'559999159':{'en': 'Vivo'},
'559999158':{'en': 'Vivo'},
'556498118':{'en': 'TIM'},
'556498119':{'en': 'TIM'},
'658669':{'en': 'SingTel'},
'658668':{'en': 'M1'},
'7902159':{'en': 'Tele2', 'ru': 'Tele2'},
'7902158':{'en': 'Tele2', 'ru': 'Tele2'},
'658661':{'en': 'StarHub'},
'658660':{'en': 'StarHub'},
'658663':{'en': 'SingTel'},
'658662':{'en': 'SingTel'},
'658665':{'en': 'SingTel'},
'658664':{'en': 'SingTel'},
'658667':{'en': 'SingTel'},
'658666':{'en': 'M1'},
'6226191':{'en': 'Esia'},
'6226192':{'en': 'Esia'},
'86199':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'86198':{'en': 'China Telecom', 'zh': u('\u4e2d\u56fd\u7535\u4fe1'), 'zh_Hant': u('\u4e2d\u570b\u96fb\u4fe1')},
'559698122':{'en': 'TIM'},
'559698123':{'en': 'TIM'},
'559698121':{'en': 'TIM'},
'559698126':{'en': 'TIM'},
'559698127':{'en': 'TIM'},
'559698124':{'en': 'TIM'},
'559698125':{'en': 'TIM'},
'559698128':{'en': 'TIM'},
'559698129':{'en': 'TIM'},
'559798118':{'en': 'TIM'},
'559798119':{'en': 'TIM'},
'554898866':{'en': 'Claro BR'},
'554898860':{'en': 'Claro BR'},
'554898861':{'en': 'Claro BR'},
'554898862':{'en': 'Claro BR'},
'554898863':{'en': 'Claro BR'},
'559798111':{'en': 'TIM'},
'559798113':{'en': 'TIM'},
'559798114':{'en': 'TIM'},
'559798115':{'en': 'TIM'},
'559798116':{'en': 'TIM'},
'559798117':{'en': 'TIM'},
'8536698':{'en': 'CTM'},
'8536699':{'en': 'China Telecom'},
'556499648':{'en': 'Vivo'},
'557499949':{'en': 'Vivo'},
'557499948':{'en': 'Vivo'},
'554599118':{'en': 'Vivo'},
'554599119':{'en': 'Vivo'},
'8489':{'en': 'MobiFone'},
'557499943':{'en': 'Vivo'},
'557499942':{'en': 'Vivo'},
'557499941':{'en': 'Vivo'},
'556499642':{'en': 'Vivo'},
'557499947':{'en': 'Vivo'},
'557499946':{'en': 'Vivo'},
'557499945':{'en': 'Vivo'},
'557499944':{'en': 'Vivo'},
'8526260':{'en': 'Easco', 'zh': 'Easco', 'zh_Hant': 'Easco'},
'60146':{'en': 'DiGi'},
'7902748':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'60147':{'en': 'Maxis'},
'7902749':{'en': 'MegaFon', 'ru': u('\u041c\u0435\u0433\u0430\u0424\u043e\u043d')},
'60144':{'en': 'Tune Talk'},
'8488':{'en': 'Vinaphone'},
'60142':{'en': 'Maxis'},
'60143':{'en': 'DiGi'},
}
| 35.014167 | 130 | 0.530892 |
aceb3521c6d3dad2d6e265d9f494f7db160f6ae0 | 14,217 | py | Python | tests/test_metadata.py | Bancherd-DeLong/PheKnowLator | a2fdc8706b62111c12ab0302b0a3e089186cc5e4 | [
"Apache-2.0"
] | 73 | 2019-08-29T17:37:14.000Z | 2022-02-23T02:11:58.000Z | tests/test_metadata.py | Bancherd-DeLong/PheKnowLator | a2fdc8706b62111c12ab0302b0a3e089186cc5e4 | [
"Apache-2.0"
] | 91 | 2019-09-01T17:50:36.000Z | 2021-12-24T01:21:04.000Z | tests/test_metadata.py | Bancherd-DeLong/PheKnowLator | a2fdc8706b62111c12ab0302b0a3e089186cc5e4 | [
"Apache-2.0"
] | 14 | 2020-03-18T16:55:57.000Z | 2022-01-11T03:00:34.000Z | import glob
import logging
import os
import os.path
import pickle
import unittest
from rdflib import Graph
from typing import Dict
from pkt_kg.metadata import *
class TestMetadata(unittest.TestCase):
"""Class to test the metadata class from the metadata script."""
def setUp(self):
# initialize file location
current_directory = os.path.dirname(__file__)
dir_loc = os.path.join(current_directory, 'data')
self.dir_loc = os.path.abspath(dir_loc)
# handle logging
self.logs = os.path.abspath(current_directory + '/builds/logs')
logging.disable(logging.CRITICAL)
if len(glob.glob(self.logs + '/*.log')) > 0: os.remove(glob.glob(self.logs + '/*.log')[0])
# pointer to owltools
dir_loc2 = os.path.join(current_directory, 'utils/owltools')
self.owltools_location = os.path.abspath(dir_loc2)
# create graph data
self.graph = Graph().parse(self.dir_loc + '/ontologies/so_with_imports.owl')
# set-up input arguments
self.metadata = Metadata(kg_version='v2.0.0',
write_location=self.dir_loc,
kg_location=self.dir_loc + '/ontologies/so_with_imports.owl',
node_data=glob.glob(self.dir_loc + '/node_data/*.pkl'),
node_dict=dict())
# load dictionary
self.metadata.metadata_processor()
return None
def test_metadata_processor(self):
"""Tests the metadata_processor method."""
# set-up input arguments
self.metadata = Metadata(kg_version='v2.0.0', write_location=self.dir_loc,
kg_location=self.dir_loc + '/ontologies/so_with_imports.owl',
node_data=glob.glob(self.dir_loc + '/node_data/*dict.pkl'),
node_dict=dict())
self.metadata.metadata_processor() # load dictionary
# make sure that the dictionary has the "schtuff"
self.assertIsInstance(self.metadata.node_dict, Dict)
self.assertTrue('nodes' in self.metadata.node_dict.keys())
self.assertTrue('relations' in self.metadata.node_dict.keys())
# check node dict
node_key = 'http://www.ncbi.nlm.nih.gov/gene/1'
self.assertIsInstance(self.metadata.node_dict['nodes'], Dict)
self.assertTrue(len(self.metadata.node_dict['nodes']) == 21)
self.assertIn('Label', self.metadata.node_dict['nodes'][node_key].keys())
self.assertIn('Synonym', self.metadata.node_dict['nodes'][node_key].keys())
self.assertIn('Description', self.metadata.node_dict['nodes'][node_key].keys())
# check relations dict
relations_key = 'http://purl.obolibrary.org/obo/RO_0002597'
self.assertIsInstance(self.metadata.node_dict['relations'], Dict)
self.assertTrue(len(self.metadata.node_dict['relations']) == 20)
self.assertIn('Label', self.metadata.node_dict['relations'][relations_key].keys())
self.assertIn('Synonym', self.metadata.node_dict['relations'][relations_key].keys())
self.assertIn('Description', self.metadata.node_dict['relations'][relations_key].keys())
return None
def test_creates_node_metadata_nodes(self):
"""Tests the creates_node_metadata method."""
self.metadata.node_data = [self.metadata.node_data[0].replace('.pkl', '_test.pkl')]
self.metadata.extract_metadata(self.graph)
# test when the node has metadata
updated_graph_1 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/1',
'http://www.ncbi.nlm.nih.gov/gene/2'],
e_type=['entity', 'entity'])
self.assertTrue(len(updated_graph_1) == 16)
# check that the correct info is returned if only one is an entity
updated_graph_2 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/1',
'http://www.ncbi.nlm.nih.gov/gene/2'],
e_type=['entity', 'class'])
self.assertTrue(len(updated_graph_2) == 8)
# check that nothing is returned if the entities are classes
updated_graph_3 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/1',
'http://www.ncbi.nlm.nih.gov/gene/2'],
e_type=['class', 'class'])
self.assertTrue(updated_graph_3 is None)
# test when the node does not have metadata
updated_graph_4 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/None',
'http://www.ncbi.nlm.nih.gov/gene/None'],
e_type=['entity', 'entity'])
self.assertTrue(updated_graph_4 is None)
# test when node_data is None
self.metadata.node_data = None
updated_graph_5 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/None',
'http://www.ncbi.nlm.nih.gov/gene/None'],
e_type=['entity', 'entity'])
self.assertTrue(updated_graph_5 is None)
return None
def test_creates_node_metadata_relations(self):
"""Tests the creates_node_metadata method."""
self.metadata.node_data = [self.metadata.node_data[0].replace('.pkl', '_test.pkl')]
self.metadata.extract_metadata(self.graph)
# test when the node has metadata
updated_graph_1 = self.metadata.creates_node_metadata(ent=['http://purl.obolibrary.org/obo/RO_0002310'],
key_type='relations')
self.assertTrue(len(updated_graph_1) == 2)
# check that nothing is returned if the entities are classes
updated_graph_2 = self.metadata.creates_node_metadata(ent=['http://purl.obolibrary.org/obo/RO_0002597'],
e_type=['class'], key_type='relations')
self.assertTrue(len(updated_graph_2) == 2)
# test when the node does not have metadata
updated_graph_3 = self.metadata.creates_node_metadata(['http://www.ncbi.nlm.nih.gov/gene/None'],
key_type='relations')
self.assertTrue(updated_graph_3 is None)
return None
def test_creates_node_metadata_none(self):
"""Tests the creates_node_metadata method when node_dict is None."""
self.metadata.node_data = [self.metadata.node_data[0].replace('.pkl', '_test.pkl')]
self.metadata.extract_metadata(self.graph)
self.metadata.node_dict = None
# relations -- with valid input
updated_graph_1 = self.metadata.creates_node_metadata(ent=['http://purl.obolibrary.org/obo/RO_0002597'],
key_type='relations')
self.assertTrue(updated_graph_1 is None)
# relations -- without valid input
updated_graph_2 = self.metadata.creates_node_metadata(ent=['http://purl.obolibrary.org/obo/None'],
key_type='relations')
self.assertTrue(updated_graph_2 is None)
# nodes -- with valid input
updated_graph_3 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/1',
'http://www.ncbi.nlm.nih.gov/gene/2'],
e_type=['class', 'class'])
self.assertTrue(updated_graph_3 is None)
# nodes -- without valid input
updated_graph_4 = self.metadata.creates_node_metadata(ent=['http://www.ncbi.nlm.nih.gov/gene/None',
'http://www.ncbi.nlm.nih.gov/gene/None'],
e_type=['entity', 'entity'])
self.assertTrue(updated_graph_4 is None)
return None
def test_extract_metadata(self):
"""Tests the extract_metadata data."""
org_file_size = os.path.getsize(self.metadata.node_data[0])
# extract metadata
self.metadata.node_data = [self.metadata.node_data[0].replace('.pkl', '_test.pkl')]
self.metadata.extract_metadata(graph=self.graph)
# check that it worked
# nodes
node_key = 'http://purl.obolibrary.org/obo/SO_0000373'
self.assertTrue(len(self.metadata.node_dict['nodes']) == 2462)
self.assertIn('Label', self.metadata.node_dict['nodes'][node_key])
self.assertIn('Description', self.metadata.node_dict['nodes'][node_key])
self.assertIn('Synonym', self.metadata.node_dict['nodes'][node_key])
# relations
relation_key = 'http://purl.obolibrary.org/obo/so#genome_of'
self.assertTrue(len(self.metadata.node_dict['relations']) == 72)
self.assertIn('Label', self.metadata.node_dict['relations'][relation_key])
self.assertIn('Description', self.metadata.node_dict['relations'][relation_key])
self.assertIn('Synonym', self.metadata.node_dict['relations'][relation_key])
# check that larger dict was saved
self.assertTrue(os.path.getsize(self.metadata.node_data[0]) >= org_file_size)
return None
def test_output_metadata_graph(self):
"""Tests the output_metadata method when input is an RDFLib Graph object."""
original_dict = self.metadata.node_dict.copy()
self.metadata.write_location = '' # update environment var
self.metadata.metadata_processor() # load dictionary
graph = Graph().parse(self.dir_loc + '/ontologies/so_with_imports.owl') # load graph
filename = self.dir_loc + '/ontologies/'
# get node integer map
node_ints = maps_ids_to_integers(graph, filename, 'SO_Triples_Integers.txt',
'SO_Triples_Integer_Identifier_Map.json')
# run function
self.metadata.output_metadata(node_ints, graph)
# make sure that node data wrote out
self.assertTrue(os.path.exists(self.dir_loc + '/ontologies/so_with_imports_NodeLabels.txt'))
# remove file
os.remove(self.dir_loc + '/ontologies/so_with_imports_NodeLabels.txt')
os.remove(filename + 'SO_Triples_Integers.txt')
os.remove(filename + 'SO_Triples_Identifiers.txt')
os.remove(filename + 'SO_Triples_Integer_Identifier_Map.json')
# write original data
pickle.dump(original_dict, open(self.dir_loc + '/node_data/node_metadata_dict.pkl', 'wb'))
return None
def test_tidy_metadata(self):
"""Tests the _tidy_metadata function when input includes keys with newlines."""
original_dict = self.metadata.node_dict.copy() # store original faulty dict
test_node = 'http://purl.obolibrary.org/obo/VO_0000247'
self.metadata._tidy_metadata()
self.assertTrue('\n' not in self.metadata.node_dict['nodes'][test_node]['Label'])
# set original metadata dict back to faulty data
self.metadata.node_dict = original_dict
return None
def test_output_metadata_graph_set(self):
"""Tests the output_metadata method when input is a set of RDFLib Graph object triples."""
original_dict = self.metadata.node_dict.copy()
self.metadata.write_location = '' # update environment var
self.metadata.metadata_processor() # load dictionary
graph = Graph().parse(self.dir_loc + '/ontologies/so_with_imports.owl') # load graph
filename = self.dir_loc + '/ontologies/'
# get node integer map
node_ints = maps_ids_to_integers(graph, filename, 'SO_Triples_Integers.txt',
'SO_Triples_Integer_Identifier_Map.json')
# run function
self.metadata.output_metadata(node_ints, set(graph))
# make sure that node data wrote out
self.assertTrue(os.path.exists(self.dir_loc + '/ontologies/so_with_imports_NodeLabels.txt'))
# remove file
os.remove(self.dir_loc + '/ontologies/so_with_imports_NodeLabels.txt')
os.remove(filename + 'SO_Triples_Integers.txt')
os.remove(filename + 'SO_Triples_Identifiers.txt')
os.remove(filename + 'SO_Triples_Integer_Identifier_Map.json')
# write original data
pickle.dump(original_dict, open(self.dir_loc + '/node_data/node_metadata_dict.pkl', 'wb'))
return None
def test_adds_ontology_annotations(self):
"""Tests the adds_ontology_annotations method."""
# load graph
graph = Graph().parse(self.dir_loc + '/ontologies/so_with_imports.owl')
# run function
updated_graph = self.metadata.adds_ontology_annotations(filename='tests/data/so_tests_file.owl', graph=graph)
# check that the annotations were added
results = updated_graph.query(
"""SELECT DISTINCT ?o ?p ?s
WHERE {
?o rdf:type owl:Ontology .
?o ?p ?s . }
""", initNs={'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'owl': 'http://www.w3.org/2002/07/owl#'})
results_list = [str(x) for y in results for x in y]
self.assertTrue(len(results_list) == 21)
self.assertIn('https://pheknowlator.com/pheknowlator_file.owl', results_list)
return None
def tearDown(self):
if self.metadata.node_data:
test_data_location = glob.glob(self.dir_loc + '/node_data/*_test.pkl')
if len(test_data_location) > 0:
os.remove(test_data_location[0])
return None
| 46.460784 | 117 | 0.60294 |
aceb352a4e85c15b7748a8fafe556347507340f0 | 73 | py | Python | src/app/test/test.py | mdn522/IRBRL | 30f9120bd22f709778f618899968e293897caebe | [
"MIT"
] | 1 | 2020-08-12T19:19:45.000Z | 2020-08-12T19:19:45.000Z | src/app/test/test.py | mdn522/IRBRL | 30f9120bd22f709778f618899968e293897caebe | [
"MIT"
] | null | null | null | src/app/test/test.py | mdn522/IRBRL | 30f9120bd22f709778f618899968e293897caebe | [
"MIT"
] | null | null | null |
a=[2]
k={}
if (21,2) not in k:
k[21,2]=[3]
print("in")
print(k) | 9.125 | 19 | 0.438356 |
aceb356f20dca8d78a91f6425aa46464acc00dd5 | 695 | py | Python | tests/test_mrjob.py | H10K/ukmohso | b15e93c347d1744f443cf2a08a4275bd443ee800 | [
"BSD-3-Clause"
] | null | null | null | tests/test_mrjob.py | H10K/ukmohso | b15e93c347d1744f443cf2a08a4275bd443ee800 | [
"BSD-3-Clause"
] | 1 | 2019-09-21T11:07:29.000Z | 2019-09-21T11:07:29.000Z | tests/test_mrjob.py | H10K/ukmohso | b15e93c347d1744f443cf2a08a4275bd443ee800 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
import unittest
import testinfra
import time
class Test(unittest.TestCase):
def setUp(self):
self.host = testinfra.get_host("docker://hadoop")
attempts = 60
while attempts > 0:
d = self.host.file('/tmp/output')
if d.exists:
break
time.sleep(1)
attempts -= 1
time.sleep(1)
def test_output_directory(self):
d = self.host.file('/tmp/output')
self.assertTrue(d.is_directory)
def test_success(self):
f = self.host.file('/tmp/output/SUCCESS')
self.assertTrue(f.exists)
if __name__ == "__main__":
unittest.main()
| 19.305556 | 57 | 0.579856 |
aceb358619de84d88e8a5356873f443d60e6d279 | 367 | py | Python | setup.py | warcy/montagne | 96c11555778754c73d5b026ee5ad4d932b8e4ccd | [
"Apache-2.0"
] | null | null | null | setup.py | warcy/montagne | 96c11555778754c73d5b026ee5ad4d932b8e4ccd | [
"Apache-2.0"
] | null | null | null | setup.py | warcy/montagne | 96c11555778754c73d5b026ee5ad4d932b8e4ccd | [
"Apache-2.0"
] | null | null | null | # In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
import setuptools
setuptools.setup(
name='openrainbow',
setup_requires=['pbr'],
pbr=True)
| 24.466667 | 68 | 0.724796 |
aceb35994c6577c04c89c76beacbf62491c296cf | 7,867 | py | Python | youtube_dlc/extractor/rutv.py | mrysn/yt-dlc | f9401f2a91987068139c5f757b12fc711d4c0cee | [
"Unlicense"
] | 3,001 | 2020-10-24T05:24:18.000Z | 2022-03-31T06:45:32.000Z | youtube_dlc/extractor/rutv.py | mrysn/yt-dlc | f9401f2a91987068139c5f757b12fc711d4c0cee | [
"Unlicense"
] | 274 | 2020-10-24T04:57:21.000Z | 2022-03-22T01:34:56.000Z | youtube_dlc/extractor/rutv.py | mrysn/yt-dlc | f9401f2a91987068139c5f757b12fc711d4c0cee | [
"Unlicense"
] | 479 | 2020-10-24T07:38:48.000Z | 2022-03-29T15:41:03.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://
(?:test)?player\.(?:rutv\.ru|vgtrk\.com)/
(?P<path>
flash\d+v/container\.swf\?id=|
iframe/(?P<type>swf|video|live)/id/|
index/iframe/cast_id/
)
(?P<id>\d+)
'''
_TESTS = [
{
'url': 'http://player.rutv.ru/flash2v/container.swf?id=774471&sid=kultura&fbv=true&isPlay=true&ssl=false&i=560&acc_video_id=episode_id/972347/video_id/978186/brand_id/31724',
'info_dict': {
'id': '774471',
'ext': 'mp4',
'title': 'Монологи на все времена',
'description': 'md5:18d8b5e6a41fb1faa53819471852d5d5',
'duration': 2906,
},
'params': {
# m3u8 download
'skip_download': True,
},
},
{
'url': 'https://player.vgtrk.com/flash2v/container.swf?id=774016&sid=russiatv&fbv=true&isPlay=true&ssl=false&i=560&acc_video_id=episode_id/972098/video_id/977760/brand_id/57638',
'info_dict': {
'id': '774016',
'ext': 'mp4',
'title': 'Чужой в семье Сталина',
'description': '',
'duration': 2539,
},
'params': {
# m3u8 download
'skip_download': True,
},
},
{
'url': 'http://player.rutv.ru/iframe/swf/id/766888/sid/hitech/?acc_video_id=4000',
'info_dict': {
'id': '766888',
'ext': 'mp4',
'title': 'Вести.net: интернет-гиганты начали перетягивание программных "одеял"',
'description': 'md5:65ddd47f9830c4f42ed6475f8730c995',
'duration': 279,
},
'params': {
# m3u8 download
'skip_download': True,
},
},
{
'url': 'http://player.rutv.ru/iframe/video/id/771852/start_zoom/true/showZoomBtn/false/sid/russiatv/?acc_video_id=episode_id/970443/video_id/975648/brand_id/5169',
'info_dict': {
'id': '771852',
'ext': 'mp4',
'title': 'Прямой эфир. Жертвы загадочной болезни: смерть от старости в 17 лет',
'description': 'md5:b81c8c55247a4bd996b43ce17395b2d8',
'duration': 3096,
},
'params': {
# m3u8 download
'skip_download': True,
},
},
{
'url': 'http://player.rutv.ru/iframe/live/id/51499/showZoomBtn/false/isPlay/true/sid/sochi2014',
'info_dict': {
'id': '51499',
'ext': 'flv',
'title': 'Сочи-2014. Биатлон. Индивидуальная гонка. Мужчины ',
'description': 'md5:9e0ed5c9d2fa1efbfdfed90c9a6d179c',
},
'skip': 'Translation has finished',
},
{
'url': 'http://player.rutv.ru/iframe/live/id/21/showZoomBtn/false/isPlay/true/',
'info_dict': {
'id': '21',
'ext': 'mp4',
'title': 're:^Россия 24. Прямой эфир [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'is_live': True,
},
'params': {
# m3u8 download
'skip_download': True,
},
},
{
'url': 'https://testplayer.vgtrk.com/iframe/live/id/19201/showZoomBtn/false/isPlay/true/',
'only_matching': True,
},
]
@classmethod
def _extract_url(cls, webpage):
mobj = re.search(
r'<iframe[^>]+?src=(["\'])(?P<url>https?://(?:test)?player\.(?:rutv\.ru|vgtrk\.com)/(?:iframe/(?:swf|video|live)/id|index/iframe/cast_id)/.+?)\1', webpage)
if mobj:
return mobj.group('url')
mobj = re.search(
r'<meta[^>]+?property=(["\'])og:video\1[^>]+?content=(["\'])(?P<url>https?://(?:test)?player\.(?:rutv\.ru|vgtrk\.com)/flash\d+v/container\.swf\?id=.+?\2)',
webpage)
if mobj:
return mobj.group('url')
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
video_path = mobj.group('path')
if re.match(r'flash\d+v', video_path):
video_type = 'video'
elif video_path.startswith('iframe'):
video_type = mobj.group('type')
if video_type == 'swf':
video_type = 'video'
elif video_path.startswith('index/iframe/cast_id'):
video_type = 'live'
is_live = video_type == 'live'
json_data = self._download_json(
'http://player.vgtrk.com/iframe/data%s/id/%s' % ('live' if is_live else 'video', video_id),
video_id, 'Downloading JSON')
if json_data['errors']:
raise ExtractorError('%s said: %s' % (self.IE_NAME, json_data['errors']), expected=True)
playlist = json_data['data']['playlist']
medialist = playlist['medialist']
media = medialist[0]
if media['errors']:
raise ExtractorError('%s said: %s' % (self.IE_NAME, media['errors']), expected=True)
view_count = playlist.get('count_views')
priority_transport = playlist['priority_transport']
thumbnail = media['picture']
width = int_or_none(media['width'])
height = int_or_none(media['height'])
description = media['anons']
title = media['title']
duration = int_or_none(media.get('duration'))
formats = []
for transport, links in media['sources'].items():
for quality, url in links.items():
preference = -1 if priority_transport == transport else -2
if transport == 'rtmp':
mobj = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>.+))/(?P<playpath>.+)$', url)
if not mobj:
continue
fmt = {
'url': mobj.group('url'),
'play_path': mobj.group('playpath'),
'app': mobj.group('app'),
'page_url': 'http://player.rutv.ru',
'player_url': 'http://player.rutv.ru/flash3v/osmf.swf?i=22',
'rtmp_live': True,
'ext': 'flv',
'vbr': int(quality),
'preference': preference,
}
elif transport == 'm3u8':
formats.extend(self._extract_m3u8_formats(
url, video_id, 'mp4', preference=preference, m3u8_id='hls'))
continue
else:
fmt = {
'url': url
}
fmt.update({
'width': width,
'height': height,
'format_id': '%s-%s' % (transport, quality),
})
formats.append(fmt)
self._sort_formats(formats)
return {
'id': video_id,
'title': self._live_title(title) if is_live else title,
'description': description,
'thumbnail': thumbnail,
'view_count': view_count,
'duration': duration,
'formats': formats,
'is_live': is_live,
}
| 37.108491 | 190 | 0.470319 |
aceb36e0f207c939a204e53f864194b1ade6464a | 8,315 | py | Python | InkscapeExtension/export_cursor.py | mikekov/PngToCursor | af9fa12d3dfc2a96d31f61bcc84fe52b6f702543 | [
"MIT"
] | 3 | 2019-08-17T17:45:21.000Z | 2022-01-11T15:43:16.000Z | InkscapeExtension/export_cursor.py | mikekov/PngToCursor | af9fa12d3dfc2a96d31f61bcc84fe52b6f702543 | [
"MIT"
] | 1 | 2018-02-19T08:46:06.000Z | 2021-08-07T06:39:59.000Z | InkscapeExtension/export_cursor.py | mikekov/PngToCursor | af9fa12d3dfc2a96d31f61bcc84fe52b6f702543 | [
"MIT"
] | 2 | 2019-08-29T12:50:56.000Z | 2020-01-18T07:45:17.000Z | #!/usr/bin/env python
'''
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
import os
import tempfile
import subprocess
from subprocess import Popen, PIPE
import sys
sys.path.append('/usr/share/inkscape/extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
from simplestyle import *
from simplepath import *
from math import sqrt
color_props_fill=('fill:','stop-color:','flood-color:','lighting-color:')
color_props_stroke=('stroke:',)
color_props = color_props_fill + color_props_stroke
'''
def correlation(xList,yList):
#print yList
n = len(xList)
sumX = 0
sumXX = 0
sumY = 0
sumYY = 0
sumXY = 0
for i in range(0,n):
X = xList[i]
sumX += X
sumXX += X*X
Y = yList[i]
sumY += Y
sumYY += Y*Y
sumXY += X*Y
corrnum = (n * sumXY)-(sumX * sumY)
corrden = sqrt( (n * sumXX) - (sumX * sumX) ) * sqrt( (n * sumYY) - (sumY * sumY) )
corr = corrnum/corrden
return corr
def pathMatch(rPath,cPath):
n = len(rPath)
for i in range(0,n):
rNode = rPath[i]
cNode = cPath[i]
[rCmd,rPoints] = rNode
[cCmd,cPoints] = cNode
if rCmd != cCmd:
#print "not match"
return 0
#print "Command Match"
return 1
def pathPullPoints(rPath,cPath):
n = len(rPath)
rPointList = []
cPointList = []
for i in range(0,n):
rNode = rPath[i]
cNode = cPath[i]
[rCmd,rPoints] = rNode
[cCmd,cPoints] = cNode
rPointList.extend(rPoints)
cPointList.extend(cPoints)
return [rPointList,cPointList]
def getLayer(svg, layerName):
for g in svg.xpath('//svg:g', namespaces=inkex.NSS):
if g.get(inkex.addNS('groupmode', 'inkscape')) == 'layer' \
and g.get(inkex.addNS('label', 'inkscape')) \
== layerName:
return g
# Create a new layer.
newLayer = inkex.etree.SubElement(svg, 'g')
newLayer.set(inkex.addNS('label', 'inkscape'), layerName)
newLayer.set(inkex.addNS('groupmode', 'inkscape'), 'layer')
return newLayer
def compareColors(refNode, compNode):
pass
def getColor(node):
col = {}
if 'style' in node.attrib:
style=node.get('style') # fixme: this will break for presentation attributes!
if style!='':
#inkex.debug('old style:'+style)
styles=style.split(';')
for i in range(len(styles)):
for c in range(len(color_props)):
if styles[i].startswith(color_props[c]):
#print "col num %d" % c
#print styles[i][len(color_props[c]):]
col[c] = styles[i][len(color_props[c]):]
return col
def colorMatch(rNode,cNode):
rCol = getColor(rNode)
#print rCol
cCol = getColor(cNode)
#print cCol
if rCol == cCol:
return 1
return 0
'''
class ExportCursor(inkex.Effect):
"""
Inkscape effect extension.
Exports selected object to PNG and converts it to a cursor file.
"""
def __init__(self):
"""
Constructor.
Defines the "--what" option of a script.
"""
# Call the base class constructor.
inkex.Effect.__init__(self)
self.OptionParser.add_option('-o', '--out_dir', action = 'store',
type = 'string', dest = 'output_directory', default = 'c:',
help = 'Destination folder for cursors.')
def get_cmd_output(self, cmd):
# This solution comes from Andrew Reedick <jr9445 at ATT.COM>
# http://mail.python.org/pipermail/python-win32/2008-January/006606.html
# This method replaces the commands.getstatusoutput() usage, with the
# hope to correct the windows exporting bug:
# https://bugs.launchpad.net/inkscape/+bug/563722
if sys.platform != "win32": cmd = '{ '+ cmd +'; }'
pipe = os.popen(cmd +' 2>&1', 'r')
text = pipe.read()
sts = pipe.close()
if sts is None: sts = 0
if text[-1:] == '\n': text = text[:-1]
return sts, text
def effect(self):
"""
Effect behaviour.
Export selected object to PNG
"""
#foundLayer = self.options.foundLayer
#matchcolor = self.options.matchcolor
# Get access to main SVG document element
#svg = self.document.getroot()
# get the layer where the found paths will be moved to
#layer = getLayer(svg, foundLayer)
# get a list of all path nodes
#pathNodes = self.document.xpath('//svg:path',namespaces=inkex.NSS)
if len(self.selected) == 0:
print >>sys.stderr, "Nothing is selected."
return
if self.options.output_directory == "":
print >>sys.stderr, "Empty destination folder."
return
# setup stderr so that we can print to it for debugging
saveout = sys.stdout
sys.stdout = sys.stderr
elements = { }
for id, node in self.selected.iteritems():
svg_file = self.args[-1]
# has to be one of the canvas objects...
if id[0:-1] != "canvas-":
continue
suffix = id[-1:]
(ref, tmp_png) = tempfile.mkstemp('.png')
os.close(ref)
# export PNG and x/y locations
command = "inkscape --without-gui --query-all --export-id=%s --export-png \"%s\" \"%s\" " % (id, tmp_png, svg_file)
(status, output) = self.get_cmd_output(command)
if status == 0:
if not elements:
for el in output.split('\n'):
el = el.split(',')
if len(el) == 5:
elements[el[0]] = { 'x': float(el[1]), 'y': float(el[2]), 'w': float(el[3]), 'h': float(el[4]) }
# read location of the hot spot correnponding to the "canvas-<n>" element
hot_spot = elements["hot-spot-128-" + suffix]
(x, y) = (hot_spot['x'] + hot_spot['w'] / 2, hot_spot['y'] + hot_spot['h'] / 2)
hot_spot_list = "%s,%s" % (x, y)
# read file name; get text from textspan element
output_file = os.path.join(self.options.output_directory, self.getElementById("filename-" + suffix).getchildren()[0].text)
params = "\"%s\" \"%s\" \"%s\"" % (tmp_png, output_file, hot_spot_list)
cmd2 = "PngToIco.exe " + params
p = subprocess.Popen(cmd2, shell=True)
rc = p.wait()
os.remove(tmp_png)
'''
for cPathNode in pathNodes:
cPathList = parsePath(cPathNode.attrib['d'])
cPathLen = len(cPathList)
#print cPathLen
#print cPathList
if rPathLen == cPathLen:
#print " Found %d in %s" % (rPathLen,cPathNode)
#print matchcolor
colorMatchFlag = colorMatch(rPathNode,cPathNode) == 1 or not matchcolor
pathMatchFlag = pathMatch(rPathList,cPathList)==1
if pathMatchFlag and colorMatchFlag:
[rList,cList] = pathPullPoints(rPathList,cPathList)
corVal = correlation(rList,cList)
#print "The correlation was %g" % corVal
if corVal > 0.80:
layer.append(cPathNode)
'''
#print
#print 'This message will be logged instead of displayed'
sys.stdout = saveout
# Create effect instance and apply it.
effect = ExportCursor()
effect.affect()
| 32.354086 | 138 | 0.569814 |
aceb370ef044b4211c6a81cd80ce7caf4e056257 | 468 | py | Python | python/totalNum.py | SULING4EVER/learngit | d55f942fbd782b309b0490c34a1bb743f6c4ef03 | [
"Apache-2.0"
] | null | null | null | python/totalNum.py | SULING4EVER/learngit | d55f942fbd782b309b0490c34a1bb743f6c4ef03 | [
"Apache-2.0"
] | null | null | null | python/totalNum.py | SULING4EVER/learngit | d55f942fbd782b309b0490c34a1bb743f6c4ef03 | [
"Apache-2.0"
] | null | null | null | house={'ling':{'chair':3,'desk':1,'pot':4},
'jiamin':{'chair':5,'book':18,'cup':20},
'soo':{'car':1,'chair':9,'desk':1}}
def allHouse(houses,item):
numItems=0
for p,i in houses.items():
numItems+=i.get(item,0)
# print(p+str(i.get(item,0)))
return numItems
print('Number of properties:')
print('-chair: '+str(allHouse(house,'chair')))
print('--desk: '+str(allHouse(house,'desk')))
print('---car: '+str(allHouse(house,'car')))
| 29.25 | 47 | 0.581197 |
aceb3ac20127f600048b49e02ce51d91cc4159e0 | 6,261 | py | Python | schrodinet/solver/solver_potential.py | NLESC-JCER/Schrodinet | 12f8a92e83e9de8a0884241e3b8975d15a624e36 | [
"Apache-2.0"
] | null | null | null | schrodinet/solver/solver_potential.py | NLESC-JCER/Schrodinet | 12f8a92e83e9de8a0884241e3b8975d15a624e36 | [
"Apache-2.0"
] | null | null | null | schrodinet/solver/solver_potential.py | NLESC-JCER/Schrodinet | 12f8a92e83e9de8a0884241e3b8975d15a624e36 | [
"Apache-2.0"
] | 1 | 2020-03-19T10:42:07.000Z | 2020-03-19T10:42:07.000Z | import numpy as np
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
from schrodinet.solver.solver_base import SolverBase
from schrodinet.solver.torch_utils import DataSet, Loss, ZeroOneClipper
class SolverPotential(SolverBase):
def __init__(self, wf=None, sampler=None, optimizer=None,
scheduler=None):
SolverBase.__init__(self, wf, sampler, optimizer)
self.scheduler = scheduler
self.task = "wf_opt"
# esampling
self.resampling(ntherm=-1,
resample=100,
resample_from_last=True,
resample_every=1)
# observalbe
self.observable(['local_energy'])
def run(self, nepoch, batchsize=None, save='model.pth', loss='variance',
plot=None, pos = None, with_tqdm=True):
'''Train the model.
Arg:
nepoch : number of epoch
batchsize : size of the minibatch, if None take all points at once
pos : presampled electronic poition
obs_dict (dict, {name: []} ) : quantities to be computed during
the training
'name' must refer to a method of
the Solver instance
ntherm : thermalization of the MC sampling. If negative (-N) takes
the last N entries
resample : number of MC step during the resampling
resample_from_last (bool) : if true use the previous position as
starting for the resampling
resample_every (int) : number of epch between resampling
loss : loss used ('energy','variance' or callable (for supervised)
plot : None or plotter instance from plot_utils.py to
interactively monitor the training
'''
# checkpoint file
self.save_model = save
# sample the wave function
pos = self.sample(pos=pos, ntherm=self.resample.ntherm, with_tqdm=with_tqdm)
# determine the batching mode
if batchsize is None:
batchsize = len(pos)
# change the number of steps
_nstep_save = self.sampler.nstep
self.sampler.nstep = self.resample.resample
# create the data loader
self.dataset = DataSet(pos)
self.dataloader = DataLoader(self.dataset, batch_size=batchsize)
# get the loss
self.loss = Loss(self.wf, method=loss)
# clipper for the fc weights
clipper = ZeroOneClipper()
cumulative_loss = []
min_loss = 1E3
for n in range(nepoch):
print('----------------------------------------')
print('epoch %d' % n)
cumulative_loss = 0
for ibatch, data in enumerate(self.dataloader):
lpos = Variable(data)
lpos.requires_grad = True
loss, eloc = self.evaluate_gradient(lpos, self.loss.method)
cumulative_loss += loss
self.opt.step()
if self.wf.fc.clip:
self.wf.fc.apply(clipper)
if plot is not None:
plot.drawNow()
if cumulative_loss < min_loss:
min_loss = self.save_checkpoint(
n, cumulative_loss, self.save_model)
# get the observalbes
self.get_observable(self.obs_dict, pos, eloc, ibatch=ibatch)
self.print_observable(cumulative_loss)
print('----------------------------------------')
# resample the data
if (n % self.resample.resample_every == 0) or (n == nepoch-1):
if self.resample.resample_from_last:
pos = pos.clone().detach()
else:
pos = None
pos = self.sample(
pos=pos, ntherm=self.resample.ntherm, with_tqdm=False)
self.dataloader.dataset.data = pos
if self.scheduler is not None:
self.scheduler.step()
# restore the sampler number of step
self.sampler.nstep = _nstep_save
def evaluate_gradient(self, lpos, loss):
"""Evaluate the gradient
Arguments:
grad {str} -- method of the gradient (auto, manual)
lpos {torch.tensor} -- positions of the walkers
Returns:
tuple -- (loss, local energy)
"""
if loss in ['variance','energy']:
loss, eloc = self._evaluate_grad_auto(lpos)
elif loss == 'energy-manual':
loss, eloc = self._evaluate_grad_manual(lpos)
else:
raise ValueError('Error in gradient method')
if torch.isnan(loss):
raise ValueError("Nans detected in the loss")
return loss, eloc
def _evaluate_grad_auto(self, lpos):
"""Evaluate the gradient using automatic diff of the required loss.
Arguments:
lpos {torch.tensor} -- positions of the walkers
Returns:
tuple -- (loss, local energy)
"""
# compute the loss
loss, eloc = self.loss(lpos)
# compute local gradients
self.opt.zero_grad()
loss.backward()
return loss, eloc
def _evaluate_grad_manual(self, lpos):
"""Evaluate the gradient using a low variance method
Arguments:
lpos {torch.tensor} -- positions of the walkers
Returns:
tuple -- (loss, local energy)
"""
''' Get the gradient of the total energy
dE/dk = < (dpsi/dk)/psi (E_L - <E_L >) >
'''
# compute local energy and wf values
psi = self.wf(lpos)
eloc = self.wf.local_energy(lpos, wf=psi)
norm = 1./len(psi)
# evaluate the prefactor of the grads
weight = eloc.clone()
weight -= torch.mean(eloc)
weight /= psi
weight *= 2.
weight *= norm
# compute the gradients
self.opt.zero_grad()
psi.backward(weight)
return torch.mean(eloc), eloc | 31.462312 | 84 | 0.543523 |
aceb3b104325137897615dcdcf175a10fc3cce68 | 4,633 | py | Python | setup.py | POFK/CosmAna | 153af155d243e38f64b8bdf79abc496163269219 | [
"MIT"
] | 1 | 2020-07-04T10:28:05.000Z | 2020-07-04T10:28:05.000Z | setup.py | POFK/CosmAna | 153af155d243e38f64b8bdf79abc496163269219 | [
"MIT"
] | 10 | 2019-04-16T07:03:42.000Z | 2021-07-11T06:15:34.000Z | setup.py | POFK/CosmAna | 153af155d243e38f64b8bdf79abc496163269219 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
import os
import glob
import logging
import codecs
from setuptools import setup, Extension
from distutils.util import convert_path
from distutils import sysconfig
from Cython.Build import cythonize
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
os.environ["CC"] = 'mpicc' # set CC compiler
os.environ["LDSHARED"] = 'mpicc -shared' # set linker_so
INCL = [os.path.join(os.environ['CONDA_PREFIX'],'include')]
LIBS = [os.path.join(os.environ['CONDA_PREFIX'],'lib')]
# ================================================================================
def read(fname):
'''
read description from README.rst
'''
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_packages(base_path):
base_path = convert_path(base_path)
found = []
for root, dirs, files in os.walk(base_path, followlinks=True):
dirs[:] = [
d for d in dirs if d[0] != '.' and d not in (
'ez_setup', '__pycache__')]
relpath = os.path.relpath(root, base_path)
parent = relpath.replace(os.sep, '.').lstrip('.')
if relpath != '.' and parent not in found:
# foo.bar package but no foo package, skip
continue
for dir in dirs:
if os.path.isfile(os.path.join(root, dir, '__init__.py')):
package = '.'.join((parent, dir)) if parent else dir
found.append(package)
return found
def find_extc(base_path):
file = {}
for i in glob.iglob(base_path + '*/*.c'):
dir, name = i.split(base_path)[1].split('/')
if dir not in file.keys():
file[dir] = []
if name == 'libfftw.c':
continue
file[dir].append(base_path + dir + '/' + name)
for i in glob.iglob(base_path + '*/*.pyx'):
dir, name = i.split(base_path)[1].split('/')
if dir not in file.keys():
file[dir] = []
file[dir].append(base_path + dir + '/' + name)
for dir in file.keys():
if len(glob.glob(base_path + dir + '/*.i')) > 0:
file[dir].append(base_path + dir + '/' + dir + '.i')
return file
# the base dependencies
with open('requirements.txt', 'r') as fh:
dependencies = [l.strip() for l in fh]
# ================================================================================
NAME = 'CosmAna'
PACKAGES = find_packages('.') # ,['pack1', 'pack2', 'Ext_C']
SCRIPTS = ['CosmAna/exam/smooth.py']
DESCRIPTION = 'A Python package for cosmological data analysis.'
LONG_DESCRIPTION = read('README.md')
KEYWORDS = 'python; cosmology; data analysis'
AUTHOR = 'Tian-Xiang Mao'
AUTHOR_EMAIL = 'maotianxiang@bao.ac.cn'
URL = 'https://github.com/POFK/CosmAna'
VERSION = '0.3'
LICENSE = 'MIT'
DATA_FILES = ''
# ============================ Extension C ===============================
Ext_path = find_extc('CosmAna/Ext_C/')
Ext_Dir = ['libgrid', 'libfftw']
ext_modules = []
cython_ext_modules = []
try:
import mpi4py
except:
logging.error("mpi4py is needed!")
exit()
try:
import numpy
INCL.append(numpy.get_include())
except ImportError:
pass
cython_ext_modules += cythonize(
Extension(NAME + '.Ext_C.libfftw.libfftw',
sources=Ext_path['libfftw'],
include_dirs=INCL,
library_dirs=LIBS,
libraries=['fftw3f_mpi', 'fftw3f', 'fftw3_mpi', 'fftw3']))
ext_modules.append(Extension(NAME + '.Ext_C.libgrid.libgrid',
sources=Ext_path['libgrid'],
include_dirs=INCL,
)
)
ext_modules = ext_modules + cython_ext_modules
# ================================================================================
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language ::Python',
'Programming Language :: Python :: 2',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
],
keywords=KEYWORDS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
url=URL,
license=LICENSE,
ext_modules=ext_modules,
packages=PACKAGES,
scripts=SCRIPTS,
data_files=DATA_FILES,
# install_requires=dependencies,
setup_requires=['cython>0.25', 'setuptools>=18.0'],
test_suite='tests',
)
'''
>>> python setup.py sdist
>>> python setup.py build_ext
>>> python setup.py build
>>> python setup.py develop
>>> python setup.py develop -u
'''
| 28.078788 | 82 | 0.570041 |
aceb3b49c276cd639e2d2e384a0ac0c70e6db967 | 568 | py | Python | plotly/validators/layout/mapbox/layer/_opacity.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/mapbox/layer/_opacity.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/mapbox/layer/_opacity.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class OpacityValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='opacity',
parent_name='layout.mapbox.layer',
**kwargs
):
super(OpacityValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop('edit_type', 'plot'),
max=kwargs.pop('max', 1),
min=kwargs.pop('min', 0),
role=kwargs.pop('role', 'info'),
**kwargs
)
| 27.047619 | 69 | 0.580986 |
aceb3c2b92ece51bb3b21761ab13587999094e77 | 6,882 | py | Python | pygmt/helpers/testing.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | pygmt/helpers/testing.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | pygmt/helpers/testing.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | """
Helper functions for testing.
"""
import inspect
import os
import string
from matplotlib.testing.compare import compare_images
from pygmt.exceptions import GMTImageComparisonFailure
from pygmt.src import which
def check_figures_equal(*, extensions=("png",), tol=0.0, result_dir="result_images"):
"""
Decorator for test cases that generate and compare two figures.
The decorated function must return two arguments, *fig_ref* and *fig_test*,
these two figures will then be saved and compared against each other.
This decorator is practically identical to matplotlib's check_figures_equal
function, but adapted for PyGMT figures. See also the original code at
https://matplotlib.org/3.3.1/api/testing_api.html#
matplotlib.testing.decorators.check_figures_equal
Parameters
----------
extensions : list
The extensions to test. Default is ["png"].
tol : float
The RMS threshold above which the test is considered failed.
result_dir : str
The directory where the figures will be stored.
Examples
--------
>>> import pytest
>>> import shutil
>>> from pygmt import Figure
>>> @check_figures_equal(result_dir="tmp_result_images")
... def test_check_figures_equal():
... fig_ref = Figure()
... fig_ref.basemap(projection="X5c", region=[0, 5, 0, 5], frame=True)
... fig_test = Figure()
... fig_test.basemap(
... projection="X5c", region=[0, 5, 0, 5], frame=["WrStZ", "af"]
... )
... return fig_ref, fig_test
>>> test_check_figures_equal()
>>> assert len(os.listdir("tmp_result_images")) == 0
>>> shutil.rmtree(path="tmp_result_images") # cleanup folder if tests pass
>>> @check_figures_equal(result_dir="tmp_result_images")
... def test_check_figures_unequal():
... fig_ref = Figure()
... fig_ref.basemap(projection="X5c", region=[0, 6, 0, 6], frame=True)
... fig_test = Figure()
... fig_test.basemap(projection="X5c", region=[0, 3, 0, 3], frame=True)
... return fig_ref, fig_test
>>> with pytest.raises(GMTImageComparisonFailure):
... test_check_figures_unequal()
...
>>> for suffix in ["", "-expected", "-failed-diff"]:
... assert os.path.exists(
... os.path.join(
... "tmp_result_images",
... f"test_check_figures_unequal{suffix}.png",
... )
... )
...
>>> shutil.rmtree(path="tmp_result_images") # cleanup folder if tests pass
"""
# pylint: disable=invalid-name
ALLOWED_CHARS = set(string.digits + string.ascii_letters + "_-[]()")
KEYWORD_ONLY = inspect.Parameter.KEYWORD_ONLY
def decorator(func):
import pytest
os.makedirs(result_dir, exist_ok=True)
old_sig = inspect.signature(func)
@pytest.mark.parametrize("ext", extensions)
def wrapper(*args, ext="png", request=None, **kwargs):
if "ext" in old_sig.parameters:
kwargs["ext"] = ext
if "request" in old_sig.parameters:
kwargs["request"] = request
try:
file_name = "".join(c for c in request.node.name if c in ALLOWED_CHARS)
except AttributeError: # 'NoneType' object has no attribute 'node'
file_name = func.__name__
try:
fig_ref, fig_test = func(*args, **kwargs)
ref_image_path = os.path.join(result_dir, f"{file_name}-expected.{ext}")
test_image_path = os.path.join(result_dir, f"{file_name}.{ext}")
fig_ref.savefig(ref_image_path)
fig_test.savefig(test_image_path)
# Code below is adapted for PyGMT, and is originally based on
# matplotlib.testing.decorators._raise_on_image_difference
err = compare_images(
expected=ref_image_path,
actual=test_image_path,
tol=tol,
in_decorator=True,
)
if err is None: # Images are the same
os.remove(ref_image_path)
os.remove(test_image_path)
else: # Images are not the same
for key in ["actual", "expected", "diff"]:
err[key] = os.path.relpath(err[key])
raise GMTImageComparisonFailure(
f"images not close (RMS {err['rms']:.3f}):\n"
f"\t{err['actual']}\n"
f"\t{err['expected']}"
)
finally:
del fig_ref
del fig_test
parameters = [
param
for param in old_sig.parameters.values()
if param.name not in {"fig_test", "fig_ref"}
]
if "ext" not in old_sig.parameters:
parameters += [inspect.Parameter("ext", KEYWORD_ONLY)]
if "request" not in old_sig.parameters:
parameters += [inspect.Parameter("request", KEYWORD_ONLY)]
new_sig = old_sig.replace(parameters=parameters)
wrapper.__signature__ = new_sig
# reach a bit into pytest internals to hoist the marks from
# our wrapped function
new_marks = getattr(func, "pytestmark", []) + wrapper.pytestmark
wrapper.pytestmark = new_marks
return wrapper
return decorator
def download_test_data():
"""
Convenience function to download remote data files used in PyGMT tests and
docs.
"""
# List of datasets to download
datasets = [
# Earth relief grids
"@earth_relief_01d_p",
"@earth_relief_01d_g",
"@earth_relief_30m_p",
"@earth_relief_30m_g",
"@earth_relief_10m_p",
"@earth_relief_05m_p",
"@earth_relief_05m_g",
# List of tiles of 03s srtm data.
# Names like @N35E135.earth_relief_03s_g.nc is for internal use only.
# The naming scheme may change. DO NOT USE IT IN YOUR SCRIPTS.
"@N30W120.earth_relief_15s_p.nc",
"@N35E135.earth_relief_03s_g.nc",
"@N37W120.earth_relief_03s_g.nc",
"@N00W090.earth_relief_03m_p.nc",
# Earth seafloor age grids
"@earth_age_01d_g",
"@S90W180.earth_age_05m_g.nc", # Specific grid for 05m test
# Other cache files
"@EGM96_to_36.txt",
"@MaunaLoa_CO2.txt",
"@Table_5_11.txt",
"@Table_5_11_mean.xyz",
"@fractures_06.txt",
"@hotspots.txt",
"@ridge.txt",
"@mars370d.txt",
"@srtm_tiles.nc", # needed for 03s and 01s relief data
"@test.dat.nc",
"@tut_bathy.nc",
"@tut_quakes.ngdc",
"@tut_ship.xyz",
"@usgs_quakes_22.txt",
]
which(fname=datasets, download="a")
| 36.606383 | 88 | 0.584568 |
aceb3c49d6dfe79c6bd9e42a104298a043f42199 | 43,863 | py | Python | test/functional/p2p-compactblocks.py | RossClelland/uscbuild | db77df86e94ba4362040d5bedf1c71e5b4f01654 | [
"MIT"
] | null | null | null | test/functional/p2p-compactblocks.py | RossClelland/uscbuild | db77df86e94ba4362040d5bedf1c71e5b4f01654 | [
"MIT"
] | null | null | null | test/functional/p2p-compactblocks.py | RossClelland/uscbuild | db77df86e94ba4362040d5bedf1c71e5b4f01654 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Uscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact blocks are post-segwit (wtxids)
"""
from test_framework.mininode import *
from test_framework.test_framework import UscoinTestFramework
from test_framework.util import *
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment
from test_framework.script import CScript, OP_TRUE
# TestNode: A peer we use to send messages to uscoind, and store responses.
class TestNode(NodeConnCB):
def __init__(self):
super().__init__()
self.last_sendcmpct = []
self.block_announced = False
# Store the hashes of blocks we've seen announced.
# This is for synchronizing the p2p message traffic,
# so we can eg wait until a particular block is announced.
self.announced_blockhashes = set()
def on_sendcmpct(self, conn, message):
self.last_sendcmpct.append(message)
def on_cmpctblock(self, conn, message):
self.block_announced = True
self.last_message["cmpctblock"].header_and_shortids.header.calc_sha256()
self.announced_blockhashes.add(self.last_message["cmpctblock"].header_and_shortids.header.sha256)
def on_headers(self, conn, message):
self.block_announced = True
for x in self.last_message["headers"].headers:
x.calc_sha256()
self.announced_blockhashes.add(x.sha256)
def on_inv(self, conn, message):
for x in self.last_message["inv"].inv:
if x.type == 2:
self.block_announced = True
self.announced_blockhashes.add(x.hash)
# Requires caller to hold mininode_lock
def received_block_announcement(self):
return self.block_announced
def clear_block_announcement(self):
with mininode_lock:
self.block_announced = False
self.last_message.pop("inv", None)
self.last_message.pop("headers", None)
self.last_message.pop("cmpctblock", None)
def get_headers(self, locator, hashstop):
msg = msg_getheaders()
msg.locator.vHave = locator
msg.hashstop = hashstop
self.connection.send_message(msg)
def send_header_for_blocks(self, new_blocks):
headers_message = msg_headers()
headers_message.headers = [CBlockHeader(b) for b in new_blocks]
self.send_message(headers_message)
def request_headers_and_sync(self, locator, hashstop=0):
self.clear_block_announcement()
self.get_headers(locator, hashstop)
wait_until(self.received_block_announcement, timeout=30, lock=mininode_lock)
self.clear_block_announcement()
# Block until a block announcement for a particular block hash is
# received.
def wait_for_block_announcement(self, block_hash, timeout=30):
def received_hash():
return (block_hash in self.announced_blockhashes)
wait_until(received_hash, timeout=timeout, lock=mininode_lock)
def send_await_disconnect(self, message, timeout=30):
"""Sends a message to the node and wait for disconnect.
This is used when we want to send a message into the node that we expect
will get us disconnected, eg an invalid block."""
self.send_message(message)
wait_until(lambda: not self.connected, timeout=timeout, lock=mininode_lock)
class CompactBlocksTest(UscoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
# Node0 = pre-segwit, node1 = segwit-aware
self.num_nodes = 2
self.extra_args = [["-vbparams=segwit:0:0"], ["-txindex"]]
self.utxos = []
def build_block_on_tip(self, node, segwit=False):
height = node.getblockcount()
tip = node.getbestblockhash()
mtp = node.getblockheader(tip)['mediantime']
block = create_block(int(tip, 16), create_coinbase(height + 1), mtp + 1)
block.nVersion = 4
if segwit:
add_witness_commitment(block)
block.solve()
return block
# Create 10 more anyone-can-spend utxo's for testing.
def make_utxos(self):
# Doesn't matter which node we use, just use node0.
block = self.build_block_on_tip(self.nodes[0])
self.test_node.send_and_ping(msg_block(block))
assert(int(self.nodes[0].getbestblockhash(), 16) == block.sha256)
self.nodes[0].generate(100)
total_value = block.vtx[0].vout[0].nValue
out_value = total_value // 10
tx = CTransaction()
tx.vin.append(CTxIn(COutPoint(block.vtx[0].sha256, 0), b''))
for i in range(10):
tx.vout.append(CTxOut(out_value, CScript([OP_TRUE])))
tx.rehash()
block2 = self.build_block_on_tip(self.nodes[0])
block2.vtx.append(tx)
block2.hashMerkleRoot = block2.calc_merkle_root()
block2.solve()
self.test_node.send_and_ping(msg_block(block2))
assert_equal(int(self.nodes[0].getbestblockhash(), 16), block2.sha256)
self.utxos.extend([[tx.sha256, i, out_value] for i in range(10)])
return
# Test "sendcmpct" (between peers preferring the same version):
# - No compact block announcements unless sendcmpct is sent.
# - If sendcmpct is sent with version > preferred_version, the message is ignored.
# - If sendcmpct is sent with boolean 0, then block announcements are not
# made with compact blocks.
# - If sendcmpct is then sent with boolean 1, then new block announcements
# are made with compact blocks.
# If old_node is passed in, request compact blocks with version=preferred-1
# and verify that it receives block announcements via compact block.
def test_sendcmpct(self, node, test_node, preferred_version, old_node=None):
# Make sure we get a SENDCMPCT message from our peer
def received_sendcmpct():
return (len(test_node.last_sendcmpct) > 0)
wait_until(received_sendcmpct, timeout=30, lock=mininode_lock)
with mininode_lock:
# Check that the first version received is the preferred one
assert_equal(test_node.last_sendcmpct[0].version, preferred_version)
# And that we receive versions down to 1.
assert_equal(test_node.last_sendcmpct[-1].version, 1)
test_node.last_sendcmpct = []
tip = int(node.getbestblockhash(), 16)
def check_announcement_of_new_block(node, peer, predicate):
peer.clear_block_announcement()
block_hash = int(node.generate(1)[0], 16)
peer.wait_for_block_announcement(block_hash, timeout=30)
assert(peer.block_announced)
with mininode_lock:
assert predicate(peer), (
"block_hash={!r}, cmpctblock={!r}, inv={!r}".format(
block_hash, peer.last_message.get("cmpctblock", None), peer.last_message.get("inv", None)))
# We shouldn't get any block announcements via cmpctblock yet.
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message)
# Try one more time, this time after requesting headers.
test_node.request_headers_and_sync(locator=[tip])
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message and "inv" in p.last_message)
# Test a few ways of using sendcmpct that should NOT
# result in compact block announcements.
# Before each test, sync the headers chain.
test_node.request_headers_and_sync(locator=[tip])
# Now try a SENDCMPCT message with too-high version
sendcmpct = msg_sendcmpct()
sendcmpct.version = preferred_version+1
sendcmpct.announce = True
test_node.send_and_ping(sendcmpct)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message)
# Headers sync before next test.
test_node.request_headers_and_sync(locator=[tip])
# Now try a SENDCMPCT message with valid version, but announce=False
sendcmpct.version = preferred_version
sendcmpct.announce = False
test_node.send_and_ping(sendcmpct)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message)
# Headers sync before next test.
test_node.request_headers_and_sync(locator=[tip])
# Finally, try a SENDCMPCT message with announce=True
sendcmpct.version = preferred_version
sendcmpct.announce = True
test_node.send_and_ping(sendcmpct)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" in p.last_message)
# Try one more time (no headers sync should be needed!)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" in p.last_message)
# Try one more time, after turning on sendheaders
test_node.send_and_ping(msg_sendheaders())
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" in p.last_message)
# Try one more time, after sending a version-1, announce=false message.
sendcmpct.version = preferred_version-1
sendcmpct.announce = False
test_node.send_and_ping(sendcmpct)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" in p.last_message)
# Now turn off announcements
sendcmpct.version = preferred_version
sendcmpct.announce = False
test_node.send_and_ping(sendcmpct)
check_announcement_of_new_block(node, test_node, lambda p: "cmpctblock" not in p.last_message and "headers" in p.last_message)
if old_node is not None:
# Verify that a peer using an older protocol version can receive
# announcements from this node.
sendcmpct.version = preferred_version-1
sendcmpct.announce = True
old_node.send_and_ping(sendcmpct)
# Header sync
old_node.request_headers_and_sync(locator=[tip])
check_announcement_of_new_block(node, old_node, lambda p: "cmpctblock" in p.last_message)
# This test actually causes uscoind to (reasonably!) disconnect us, so do this last.
def test_invalid_cmpctblock_message(self):
self.nodes[0].generate(101)
block = self.build_block_on_tip(self.nodes[0])
cmpct_block = P2PHeaderAndShortIDs()
cmpct_block.header = CBlockHeader(block)
cmpct_block.prefilled_txn_length = 1
# This index will be too high
prefilled_txn = PrefilledTransaction(1, block.vtx[0])
cmpct_block.prefilled_txn = [prefilled_txn]
self.test_node.send_await_disconnect(msg_cmpctblock(cmpct_block))
assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.hashPrevBlock)
# Compare the generated shortids to what we expect based on BIP 152, given
# uscoind's choice of nonce.
def test_compactblock_construction(self, node, test_node, version, use_witness_address):
# Generate a bunch of transactions.
node.generate(101)
num_transactions = 25
address = node.getnewaddress()
if use_witness_address:
# Want at least one segwit spend, so move all funds to
# a witness address.
address = node.addwitnessaddress(address)
value_to_send = node.getbalance()
node.sendtoaddress(address, satoshi_round(value_to_send-Decimal(0.1)))
node.generate(1)
segwit_tx_generated = False
for i in range(num_transactions):
txid = node.sendtoaddress(address, 0.1)
hex_tx = node.gettransaction(txid)["hex"]
tx = FromHex(CTransaction(), hex_tx)
if not tx.wit.is_null():
segwit_tx_generated = True
if use_witness_address:
assert(segwit_tx_generated) # check that our test is not broken
# Wait until we've seen the block announcement for the resulting tip
tip = int(node.getbestblockhash(), 16)
test_node.wait_for_block_announcement(tip)
# Make sure we will receive a fast-announce compact block
self.request_cb_announcements(test_node, node, version)
# Now mine a block, and look at the resulting compact block.
test_node.clear_block_announcement()
block_hash = int(node.generate(1)[0], 16)
# Store the raw block in our internal format.
block = FromHex(CBlock(), node.getblock("%02x" % block_hash, False))
[tx.calc_sha256() for tx in block.vtx]
block.rehash()
# Wait until the block was announced (via compact blocks)
wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)
# Now fetch and check the compact block
header_and_shortids = None
with mininode_lock:
assert("cmpctblock" in test_node.last_message)
# Convert the on-the-wire representation to absolute indexes
header_and_shortids = HeaderAndShortIDs(test_node.last_message["cmpctblock"].header_and_shortids)
self.check_compactblock_construction_from_block(version, header_and_shortids, block_hash, block)
# Now fetch the compact block using a normal non-announce getdata
with mininode_lock:
test_node.clear_block_announcement()
inv = CInv(4, block_hash) # 4 == "CompactBlock"
test_node.send_message(msg_getdata([inv]))
wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)
# Now fetch and check the compact block
header_and_shortids = None
with mininode_lock:
assert("cmpctblock" in test_node.last_message)
# Convert the on-the-wire representation to absolute indexes
header_and_shortids = HeaderAndShortIDs(test_node.last_message["cmpctblock"].header_and_shortids)
self.check_compactblock_construction_from_block(version, header_and_shortids, block_hash, block)
def check_compactblock_construction_from_block(self, version, header_and_shortids, block_hash, block):
# Check that we got the right block!
header_and_shortids.header.calc_sha256()
assert_equal(header_and_shortids.header.sha256, block_hash)
# Make sure the prefilled_txn appears to have included the coinbase
assert(len(header_and_shortids.prefilled_txn) >= 1)
assert_equal(header_and_shortids.prefilled_txn[0].index, 0)
# Check that all prefilled_txn entries match what's in the block.
for entry in header_and_shortids.prefilled_txn:
entry.tx.calc_sha256()
# This checks the non-witness parts of the tx agree
assert_equal(entry.tx.sha256, block.vtx[entry.index].sha256)
# And this checks the witness
wtxid = entry.tx.calc_sha256(True)
if version == 2:
assert_equal(wtxid, block.vtx[entry.index].calc_sha256(True))
else:
# Shouldn't have received a witness
assert(entry.tx.wit.is_null())
# Check that the cmpctblock message announced all the transactions.
assert_equal(len(header_and_shortids.prefilled_txn) + len(header_and_shortids.shortids), len(block.vtx))
# And now check that all the shortids are as expected as well.
# Determine the siphash keys to use.
[k0, k1] = header_and_shortids.get_siphash_keys()
index = 0
while index < len(block.vtx):
if (len(header_and_shortids.prefilled_txn) > 0 and
header_and_shortids.prefilled_txn[0].index == index):
# Already checked prefilled transactions above
header_and_shortids.prefilled_txn.pop(0)
else:
tx_hash = block.vtx[index].sha256
if version == 2:
tx_hash = block.vtx[index].calc_sha256(True)
shortid = calculate_shortid(k0, k1, tx_hash)
assert_equal(shortid, header_and_shortids.shortids[0])
header_and_shortids.shortids.pop(0)
index += 1
# Test that uscoind requests compact blocks when we announce new blocks
# via header or inv, and that responding to getblocktxn causes the block
# to be successfully reconstructed.
# Post-segwit: upgraded nodes would only make this request of cb-version-2,
# NODE_WITNESS peers. Unupgraded nodes would still make this request of
# any cb-version-1-supporting peer.
def test_compactblock_requests(self, node, test_node, version, segwit):
# Try announcing a block with an inv or header, expect a compactblock
# request
for announce in ["inv", "header"]:
block = self.build_block_on_tip(node, segwit=segwit)
with mininode_lock:
test_node.last_message.pop("getdata", None)
if announce == "inv":
test_node.send_message(msg_inv([CInv(2, block.sha256)]))
wait_until(lambda: "getheaders" in test_node.last_message, timeout=30, lock=mininode_lock)
test_node.send_header_for_blocks([block])
else:
test_node.send_header_for_blocks([block])
wait_until(lambda: "getdata" in test_node.last_message, timeout=30, lock=mininode_lock)
assert_equal(len(test_node.last_message["getdata"].inv), 1)
assert_equal(test_node.last_message["getdata"].inv[0].type, 4)
assert_equal(test_node.last_message["getdata"].inv[0].hash, block.sha256)
# Send back a compactblock message that omits the coinbase
comp_block = HeaderAndShortIDs()
comp_block.header = CBlockHeader(block)
comp_block.nonce = 0
[k0, k1] = comp_block.get_siphash_keys()
coinbase_hash = block.vtx[0].sha256
if version == 2:
coinbase_hash = block.vtx[0].calc_sha256(True)
comp_block.shortids = [
calculate_shortid(k0, k1, coinbase_hash) ]
test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))
assert_equal(int(node.getbestblockhash(), 16), block.hashPrevBlock)
# Expect a getblocktxn message.
with mininode_lock:
assert("getblocktxn" in test_node.last_message)
absolute_indexes = test_node.last_message["getblocktxn"].block_txn_request.to_absolute()
assert_equal(absolute_indexes, [0]) # should be a coinbase request
# Send the coinbase, and verify that the tip advances.
if version == 2:
msg = msg_witness_blocktxn()
else:
msg = msg_blocktxn()
msg.block_transactions.blockhash = block.sha256
msg.block_transactions.transactions = [block.vtx[0]]
test_node.send_and_ping(msg)
assert_equal(int(node.getbestblockhash(), 16), block.sha256)
# Create a chain of transactions from given utxo, and add to a new block.
def build_block_with_transactions(self, node, utxo, num_transactions):
block = self.build_block_on_tip(node)
for i in range(num_transactions):
tx = CTransaction()
tx.vin.append(CTxIn(COutPoint(utxo[0], utxo[1]), b''))
tx.vout.append(CTxOut(utxo[2] - 1000, CScript([OP_TRUE])))
tx.rehash()
utxo = [tx.sha256, 0, tx.vout[0].nValue]
block.vtx.append(tx)
block.hashMerkleRoot = block.calc_merkle_root()
block.solve()
return block
# Test that we only receive getblocktxn requests for transactions that the
# node needs, and that responding to them causes the block to be
# reconstructed.
def test_getblocktxn_requests(self, node, test_node, version):
with_witness = (version==2)
def test_getblocktxn_response(compact_block, peer, expected_result):
msg = msg_cmpctblock(compact_block.to_p2p())
peer.send_and_ping(msg)
with mininode_lock:
assert("getblocktxn" in peer.last_message)
absolute_indexes = peer.last_message["getblocktxn"].block_txn_request.to_absolute()
assert_equal(absolute_indexes, expected_result)
def test_tip_after_message(node, peer, msg, tip):
peer.send_and_ping(msg)
assert_equal(int(node.getbestblockhash(), 16), tip)
# First try announcing compactblocks that won't reconstruct, and verify
# that we receive getblocktxn messages back.
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 5)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
comp_block = HeaderAndShortIDs()
comp_block.initialize_from_block(block, use_witness=with_witness)
test_getblocktxn_response(comp_block, test_node, [1, 2, 3, 4, 5])
msg_bt = msg_blocktxn()
if with_witness:
msg_bt = msg_witness_blocktxn() # serialize with witnesses
msg_bt.block_transactions = BlockTransactions(block.sha256, block.vtx[1:])
test_tip_after_message(node, test_node, msg_bt, block.sha256)
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 5)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
# Now try interspersing the prefilled transactions
comp_block.initialize_from_block(block, prefill_list=[0, 1, 5], use_witness=with_witness)
test_getblocktxn_response(comp_block, test_node, [2, 3, 4])
msg_bt.block_transactions = BlockTransactions(block.sha256, block.vtx[2:5])
test_tip_after_message(node, test_node, msg_bt, block.sha256)
# Now try giving one transaction ahead of time.
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 5)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
test_node.send_and_ping(msg_tx(block.vtx[1]))
assert(block.vtx[1].hash in node.getrawmempool())
# Prefill 4 out of the 6 transactions, and verify that only the one
# that was not in the mempool is requested.
comp_block.initialize_from_block(block, prefill_list=[0, 2, 3, 4], use_witness=with_witness)
test_getblocktxn_response(comp_block, test_node, [5])
msg_bt.block_transactions = BlockTransactions(block.sha256, [block.vtx[5]])
test_tip_after_message(node, test_node, msg_bt, block.sha256)
# Now provide all transactions to the node before the block is
# announced and verify reconstruction happens immediately.
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 10)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
for tx in block.vtx[1:]:
test_node.send_message(msg_tx(tx))
test_node.sync_with_ping()
# Make sure all transactions were accepted.
mempool = node.getrawmempool()
for tx in block.vtx[1:]:
assert(tx.hash in mempool)
# Clear out last request.
with mininode_lock:
test_node.last_message.pop("getblocktxn", None)
# Send compact block
comp_block.initialize_from_block(block, prefill_list=[0], use_witness=with_witness)
test_tip_after_message(node, test_node, msg_cmpctblock(comp_block.to_p2p()), block.sha256)
with mininode_lock:
# Shouldn't have gotten a request for any transaction
assert("getblocktxn" not in test_node.last_message)
# Incorrectly responding to a getblocktxn shouldn't cause the block to be
# permanently failed.
def test_incorrect_blocktxn_response(self, node, test_node, version):
if (len(self.utxos) == 0):
self.make_utxos()
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 10)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
# Relay the first 5 transactions from the block in advance
for tx in block.vtx[1:6]:
test_node.send_message(msg_tx(tx))
test_node.sync_with_ping()
# Make sure all transactions were accepted.
mempool = node.getrawmempool()
for tx in block.vtx[1:6]:
assert(tx.hash in mempool)
# Send compact block
comp_block = HeaderAndShortIDs()
comp_block.initialize_from_block(block, prefill_list=[0], use_witness=(version == 2))
test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))
absolute_indexes = []
with mininode_lock:
assert("getblocktxn" in test_node.last_message)
absolute_indexes = test_node.last_message["getblocktxn"].block_txn_request.to_absolute()
assert_equal(absolute_indexes, [6, 7, 8, 9, 10])
# Now give an incorrect response.
# Note that it's possible for uscoind to be smart enough to know we're
# lying, since it could check to see if the shortid matches what we're
# sending, and eg disconnect us for misbehavior. If that behavior
# change were made, we could just modify this test by having a
# different peer provide the block further down, so that we're still
# verifying that the block isn't marked bad permanently. This is good
# enough for now.
msg = msg_blocktxn()
if version==2:
msg = msg_witness_blocktxn()
msg.block_transactions = BlockTransactions(block.sha256, [block.vtx[5]] + block.vtx[7:])
test_node.send_and_ping(msg)
# Tip should not have updated
assert_equal(int(node.getbestblockhash(), 16), block.hashPrevBlock)
# We should receive a getdata request
wait_until(lambda: "getdata" in test_node.last_message, timeout=10, lock=mininode_lock)
assert_equal(len(test_node.last_message["getdata"].inv), 1)
assert(test_node.last_message["getdata"].inv[0].type == 2 or test_node.last_message["getdata"].inv[0].type == 2|MSG_WITNESS_FLAG)
assert_equal(test_node.last_message["getdata"].inv[0].hash, block.sha256)
# Deliver the block
if version==2:
test_node.send_and_ping(msg_witness_block(block))
else:
test_node.send_and_ping(msg_block(block))
assert_equal(int(node.getbestblockhash(), 16), block.sha256)
def test_getblocktxn_handler(self, node, test_node, version):
# uscoind will not send blocktxn responses for blocks whose height is
# more than 10 blocks deep.
MAX_GETBLOCKTXN_DEPTH = 10
chain_height = node.getblockcount()
current_height = chain_height
while (current_height >= chain_height - MAX_GETBLOCKTXN_DEPTH):
block_hash = node.getblockhash(current_height)
block = FromHex(CBlock(), node.getblock(block_hash, False))
msg = msg_getblocktxn()
msg.block_txn_request = BlockTransactionsRequest(int(block_hash, 16), [])
num_to_request = random.randint(1, len(block.vtx))
msg.block_txn_request.from_absolute(sorted(random.sample(range(len(block.vtx)), num_to_request)))
test_node.send_message(msg)
wait_until(lambda: "blocktxn" in test_node.last_message, timeout=10, lock=mininode_lock)
[tx.calc_sha256() for tx in block.vtx]
with mininode_lock:
assert_equal(test_node.last_message["blocktxn"].block_transactions.blockhash, int(block_hash, 16))
all_indices = msg.block_txn_request.to_absolute()
for index in all_indices:
tx = test_node.last_message["blocktxn"].block_transactions.transactions.pop(0)
tx.calc_sha256()
assert_equal(tx.sha256, block.vtx[index].sha256)
if version == 1:
# Witnesses should have been stripped
assert(tx.wit.is_null())
else:
# Check that the witness matches
assert_equal(tx.calc_sha256(True), block.vtx[index].calc_sha256(True))
test_node.last_message.pop("blocktxn", None)
current_height -= 1
# Next request should send a full block response, as we're past the
# allowed depth for a blocktxn response.
block_hash = node.getblockhash(current_height)
msg.block_txn_request = BlockTransactionsRequest(int(block_hash, 16), [0])
with mininode_lock:
test_node.last_message.pop("block", None)
test_node.last_message.pop("blocktxn", None)
test_node.send_and_ping(msg)
with mininode_lock:
test_node.last_message["block"].block.calc_sha256()
assert_equal(test_node.last_message["block"].block.sha256, int(block_hash, 16))
assert "blocktxn" not in test_node.last_message
def test_compactblocks_not_at_tip(self, node, test_node):
# Test that requesting old compactblocks doesn't work.
MAX_CMPCTBLOCK_DEPTH = 5
new_blocks = []
for i in range(MAX_CMPCTBLOCK_DEPTH + 1):
test_node.clear_block_announcement()
new_blocks.append(node.generate(1)[0])
wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)
test_node.clear_block_announcement()
test_node.send_message(msg_getdata([CInv(4, int(new_blocks[0], 16))]))
wait_until(lambda: "cmpctblock" in test_node.last_message, timeout=30, lock=mininode_lock)
test_node.clear_block_announcement()
node.generate(1)
wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)
test_node.clear_block_announcement()
with mininode_lock:
test_node.last_message.pop("block", None)
test_node.send_message(msg_getdata([CInv(4, int(new_blocks[0], 16))]))
wait_until(lambda: "block" in test_node.last_message, timeout=30, lock=mininode_lock)
with mininode_lock:
test_node.last_message["block"].block.calc_sha256()
assert_equal(test_node.last_message["block"].block.sha256, int(new_blocks[0], 16))
# Generate an old compactblock, and verify that it's not accepted.
cur_height = node.getblockcount()
hashPrevBlock = int(node.getblockhash(cur_height-5), 16)
block = self.build_block_on_tip(node)
block.hashPrevBlock = hashPrevBlock
block.solve()
comp_block = HeaderAndShortIDs()
comp_block.initialize_from_block(block)
test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))
tips = node.getchaintips()
found = False
for x in tips:
if x["hash"] == block.hash:
assert_equal(x["status"], "headers-only")
found = True
break
assert(found)
# Requesting this block via getblocktxn should silently fail
# (to avoid fingerprinting attacks).
msg = msg_getblocktxn()
msg.block_txn_request = BlockTransactionsRequest(block.sha256, [0])
with mininode_lock:
test_node.last_message.pop("blocktxn", None)
test_node.send_and_ping(msg)
with mininode_lock:
assert "blocktxn" not in test_node.last_message
def activate_segwit(self, node):
node.generate(144*3)
assert_equal(get_bip9_status(node, "segwit")["status"], 'active')
def test_end_to_end_block_relay(self, node, listeners):
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 10)
[l.clear_block_announcement() for l in listeners]
# ToHex() won't serialize with witness, but this block has no witnesses
# anyway. TODO: repeat this test with witness tx's to a segwit node.
node.submitblock(ToHex(block))
for l in listeners:
wait_until(lambda: l.received_block_announcement(), timeout=30, lock=mininode_lock)
with mininode_lock:
for l in listeners:
assert "cmpctblock" in l.last_message
l.last_message["cmpctblock"].header_and_shortids.header.calc_sha256()
assert_equal(l.last_message["cmpctblock"].header_and_shortids.header.sha256, block.sha256)
# Test that we don't get disconnected if we relay a compact block with valid header,
# but invalid transactions.
def test_invalid_tx_in_compactblock(self, node, test_node, use_segwit):
assert(len(self.utxos))
utxo = self.utxos[0]
block = self.build_block_with_transactions(node, utxo, 5)
del block.vtx[3]
block.hashMerkleRoot = block.calc_merkle_root()
if use_segwit:
# If we're testing with segwit, also drop the coinbase witness,
# but include the witness commitment.
add_witness_commitment(block)
block.vtx[0].wit.vtxinwit = []
block.solve()
# Now send the compact block with all transactions prefilled, and
# verify that we don't get disconnected.
comp_block = HeaderAndShortIDs()
comp_block.initialize_from_block(block, prefill_list=[0, 1, 2, 3, 4], use_witness=use_segwit)
msg = msg_cmpctblock(comp_block.to_p2p())
test_node.send_and_ping(msg)
# Check that the tip didn't advance
assert(int(node.getbestblockhash(), 16) is not block.sha256)
test_node.sync_with_ping()
# Helper for enabling cb announcements
# Send the sendcmpct request and sync headers
def request_cb_announcements(self, peer, node, version):
tip = node.getbestblockhash()
peer.get_headers(locator=[int(tip, 16)], hashstop=0)
msg = msg_sendcmpct()
msg.version = version
msg.announce = True
peer.send_and_ping(msg)
def test_compactblock_reconstruction_multiple_peers(self, node, stalling_peer, delivery_peer):
assert(len(self.utxos))
def announce_cmpct_block(node, peer):
utxo = self.utxos.pop(0)
block = self.build_block_with_transactions(node, utxo, 5)
cmpct_block = HeaderAndShortIDs()
cmpct_block.initialize_from_block(block)
msg = msg_cmpctblock(cmpct_block.to_p2p())
peer.send_and_ping(msg)
with mininode_lock:
assert "getblocktxn" in peer.last_message
return block, cmpct_block
block, cmpct_block = announce_cmpct_block(node, stalling_peer)
for tx in block.vtx[1:]:
delivery_peer.send_message(msg_tx(tx))
delivery_peer.sync_with_ping()
mempool = node.getrawmempool()
for tx in block.vtx[1:]:
assert(tx.hash in mempool)
delivery_peer.send_and_ping(msg_cmpctblock(cmpct_block.to_p2p()))
assert_equal(int(node.getbestblockhash(), 16), block.sha256)
self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])
# Now test that delivering an invalid compact block won't break relay
block, cmpct_block = announce_cmpct_block(node, stalling_peer)
for tx in block.vtx[1:]:
delivery_peer.send_message(msg_tx(tx))
delivery_peer.sync_with_ping()
cmpct_block.prefilled_txn[0].tx.wit.vtxinwit = [ CTxInWitness() ]
cmpct_block.prefilled_txn[0].tx.wit.vtxinwit[0].scriptWitness.stack = [ser_uint256(0)]
cmpct_block.use_witness = True
delivery_peer.send_and_ping(msg_cmpctblock(cmpct_block.to_p2p()))
assert(int(node.getbestblockhash(), 16) != block.sha256)
msg = msg_blocktxn()
msg.block_transactions.blockhash = block.sha256
msg.block_transactions.transactions = block.vtx[1:]
stalling_peer.send_and_ping(msg)
assert_equal(int(node.getbestblockhash(), 16), block.sha256)
def run_test(self):
# Setup the p2p connections and start up the network thread.
self.test_node = TestNode()
self.segwit_node = TestNode()
self.old_node = TestNode() # version 1 peer <--> segwit node
connections = []
connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], self.test_node))
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1],
self.segwit_node, services=NODE_NETWORK|NODE_WITNESS))
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1],
self.old_node, services=NODE_NETWORK))
self.test_node.add_connection(connections[0])
self.segwit_node.add_connection(connections[1])
self.old_node.add_connection(connections[2])
NetworkThread().start() # Start up network handling in another thread
# Test logic begins here
self.test_node.wait_for_verack()
# We will need UTXOs to construct transactions in later tests.
self.make_utxos()
self.log.info("Running tests, pre-segwit activation:")
self.log.info("Testing SENDCMPCT p2p message... ")
self.test_sendcmpct(self.nodes[0], self.test_node, 1)
sync_blocks(self.nodes)
self.test_sendcmpct(self.nodes[1], self.segwit_node, 2, old_node=self.old_node)
sync_blocks(self.nodes)
self.log.info("Testing compactblock construction...")
self.test_compactblock_construction(self.nodes[0], self.test_node, 1, False)
sync_blocks(self.nodes)
self.test_compactblock_construction(self.nodes[1], self.segwit_node, 2, False)
sync_blocks(self.nodes)
self.log.info("Testing compactblock requests... ")
self.test_compactblock_requests(self.nodes[0], self.test_node, 1, False)
sync_blocks(self.nodes)
self.test_compactblock_requests(self.nodes[1], self.segwit_node, 2, False)
sync_blocks(self.nodes)
self.log.info("Testing getblocktxn requests...")
self.test_getblocktxn_requests(self.nodes[0], self.test_node, 1)
sync_blocks(self.nodes)
self.test_getblocktxn_requests(self.nodes[1], self.segwit_node, 2)
sync_blocks(self.nodes)
self.log.info("Testing getblocktxn handler...")
self.test_getblocktxn_handler(self.nodes[0], self.test_node, 1)
sync_blocks(self.nodes)
self.test_getblocktxn_handler(self.nodes[1], self.segwit_node, 2)
self.test_getblocktxn_handler(self.nodes[1], self.old_node, 1)
sync_blocks(self.nodes)
self.log.info("Testing compactblock requests/announcements not at chain tip...")
self.test_compactblocks_not_at_tip(self.nodes[0], self.test_node)
sync_blocks(self.nodes)
self.test_compactblocks_not_at_tip(self.nodes[1], self.segwit_node)
self.test_compactblocks_not_at_tip(self.nodes[1], self.old_node)
sync_blocks(self.nodes)
self.log.info("Testing handling of incorrect blocktxn responses...")
self.test_incorrect_blocktxn_response(self.nodes[0], self.test_node, 1)
sync_blocks(self.nodes)
self.test_incorrect_blocktxn_response(self.nodes[1], self.segwit_node, 2)
sync_blocks(self.nodes)
# End-to-end block relay tests
self.log.info("Testing end-to-end block relay...")
self.request_cb_announcements(self.test_node, self.nodes[0], 1)
self.request_cb_announcements(self.old_node, self.nodes[1], 1)
self.request_cb_announcements(self.segwit_node, self.nodes[1], 2)
self.test_end_to_end_block_relay(self.nodes[0], [self.segwit_node, self.test_node, self.old_node])
self.test_end_to_end_block_relay(self.nodes[1], [self.segwit_node, self.test_node, self.old_node])
self.log.info("Testing handling of invalid compact blocks...")
self.test_invalid_tx_in_compactblock(self.nodes[0], self.test_node, False)
self.test_invalid_tx_in_compactblock(self.nodes[1], self.segwit_node, False)
self.test_invalid_tx_in_compactblock(self.nodes[1], self.old_node, False)
self.log.info("Testing reconstructing compact blocks from all peers...")
self.test_compactblock_reconstruction_multiple_peers(self.nodes[1], self.segwit_node, self.old_node)
sync_blocks(self.nodes)
# Advance to segwit activation
self.log.info("Advancing to segwit activation")
self.activate_segwit(self.nodes[1])
self.log.info("Running tests, post-segwit activation...")
self.log.info("Testing compactblock construction...")
self.test_compactblock_construction(self.nodes[1], self.old_node, 1, True)
self.test_compactblock_construction(self.nodes[1], self.segwit_node, 2, True)
sync_blocks(self.nodes)
self.log.info("Testing compactblock requests (unupgraded node)... ")
self.test_compactblock_requests(self.nodes[0], self.test_node, 1, True)
self.log.info("Testing getblocktxn requests (unupgraded node)...")
self.test_getblocktxn_requests(self.nodes[0], self.test_node, 1)
# Need to manually sync node0 and node1, because post-segwit activation,
# node1 will not download blocks from node0.
self.log.info("Syncing nodes...")
assert(self.nodes[0].getbestblockhash() != self.nodes[1].getbestblockhash())
while (self.nodes[0].getblockcount() > self.nodes[1].getblockcount()):
block_hash = self.nodes[0].getblockhash(self.nodes[1].getblockcount()+1)
self.nodes[1].submitblock(self.nodes[0].getblock(block_hash, False))
assert_equal(self.nodes[0].getbestblockhash(), self.nodes[1].getbestblockhash())
self.log.info("Testing compactblock requests (segwit node)... ")
self.test_compactblock_requests(self.nodes[1], self.segwit_node, 2, True)
self.log.info("Testing getblocktxn requests (segwit node)...")
self.test_getblocktxn_requests(self.nodes[1], self.segwit_node, 2)
sync_blocks(self.nodes)
self.log.info("Testing getblocktxn handler (segwit node should return witnesses)...")
self.test_getblocktxn_handler(self.nodes[1], self.segwit_node, 2)
self.test_getblocktxn_handler(self.nodes[1], self.old_node, 1)
# Test that if we submitblock to node1, we'll get a compact block
# announcement to all peers.
# (Post-segwit activation, blocks won't propagate from node0 to node1
# automatically, so don't bother testing a block announced to node0.)
self.log.info("Testing end-to-end block relay...")
self.request_cb_announcements(self.test_node, self.nodes[0], 1)
self.request_cb_announcements(self.old_node, self.nodes[1], 1)
self.request_cb_announcements(self.segwit_node, self.nodes[1], 2)
self.test_end_to_end_block_relay(self.nodes[1], [self.segwit_node, self.test_node, self.old_node])
self.log.info("Testing handling of invalid compact blocks...")
self.test_invalid_tx_in_compactblock(self.nodes[0], self.test_node, False)
self.test_invalid_tx_in_compactblock(self.nodes[1], self.segwit_node, True)
self.test_invalid_tx_in_compactblock(self.nodes[1], self.old_node, True)
self.log.info("Testing invalid index in cmpctblock message...")
self.test_invalid_cmpctblock_message()
if __name__ == '__main__':
CompactBlocksTest().main()
| 47.164516 | 137 | 0.668992 |
aceb3c6cb6214a1b13cfec764b67d80d575baed9 | 1,264 | py | Python | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_deployment_map.py | StewartW/aws-deployment-framework | 7511241664c946ce3b045db211a4931b1dbaac6d | [
"Apache-2.0"
] | 490 | 2019-03-03T15:24:11.000Z | 2022-03-30T10:22:21.000Z | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_deployment_map.py | StewartW/aws-deployment-framework | 7511241664c946ce3b045db211a4931b1dbaac6d | [
"Apache-2.0"
] | 301 | 2019-03-06T12:13:10.000Z | 2022-03-18T16:12:09.000Z | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_deployment_map.py | StewartW/aws-deployment-framework | 7511241664c946ce3b045db211a4931b1dbaac6d | [
"Apache-2.0"
] | 211 | 2019-03-04T13:56:46.000Z | 2022-03-24T10:35:55.000Z | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# pylint: skip-file
import os
import boto3
from errors import InvalidDeploymentMapError
from pytest import fixture, raises
from mock import Mock
from ..pipeline import Pipeline
from ..deployment_map import DeploymentMap
@fixture
def cls():
return DeploymentMap(
parameter_store=None,
s3=None,
pipeline_name_prefix='adf',
map_path='{0}/stubs/stub_deployment_map.yml'.format(
os.path.dirname(os.path.realpath(__file__))
)
)
def test_update_deployment_parameters(cls):
cls.s3 = Mock()
cls.s3.put_object.return_value = None
pipeline = Pipeline({
"name": "pipeline",
"params": {"key": "value"},
"targets": [],
"default_providers": {
"source": {
"name": "codecommit",
"properties" : {
"account_id": 123456789101
}
}
}
})
pipeline.template_dictionary = {
"targets": [[{"name": "some_pipeline", "path": "/fake/path"}]]
}
cls.update_deployment_parameters(pipeline)
assert cls.account_ou_names['some_pipeline'] == '/fake/path'
| 25.28 | 73 | 0.607595 |
aceb3ca7af0e36f3c1861691d61d64290bea1372 | 126 | py | Python | bridges/admin.py | vitale232/InspectionPlanner | 4d9c9b494e6b3587eb182e9c34ea3d6aee5546e8 | [
"MIT"
] | 1 | 2020-01-30T12:32:38.000Z | 2020-01-30T12:32:38.000Z | bridges/admin.py | vitale232/InspectionPlanner | 4d9c9b494e6b3587eb182e9c34ea3d6aee5546e8 | [
"MIT"
] | 45 | 2019-07-27T02:12:11.000Z | 2022-03-02T04:59:15.000Z | bridges/admin.py | vitale232/InspectionPlanner | 4d9c9b494e6b3587eb182e9c34ea3d6aee5546e8 | [
"MIT"
] | null | null | null | from django.contrib.gis import admin
from .models import NewYorkBridge
admin.site.register(NewYorkBridge, admin.OSMGeoAdmin)
| 25.2 | 53 | 0.84127 |
aceb3ce67e78507a51dc3b576e6ebaaa603405b7 | 2,740 | py | Python | keras_frcnn/data_augment.py | wang101/mrcnn | fa5685256cd80594797d456bbb6f3c009f9c112c | [
"Apache-2.0"
] | null | null | null | keras_frcnn/data_augment.py | wang101/mrcnn | fa5685256cd80594797d456bbb6f3c009f9c112c | [
"Apache-2.0"
] | null | null | null | keras_frcnn/data_augment.py | wang101/mrcnn | fa5685256cd80594797d456bbb6f3c009f9c112c | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
import copy
def augment(img_data, config, augment=True):
assert 'filepath' in img_data
assert 'bboxes' in img_data
assert 'width' in img_data
assert 'height' in img_data
img_data_aug = copy.deepcopy(img_data)
img = cv2.imread(img_data_aug['filepath'])
if augment:
rows, cols = img.shape[:2]
if config.use_horizontal_flips and np.random.randint(0, 2) == 0:
img = cv2.flip(img, 1)
for n,bbox in enumerate(img_data_aug['bboxes']):
x1 = bbox['x1']
x2 = bbox['x2']
bbox['x2'] = cols - x1
bbox['x1'] = cols - x2
masks = img_data_aug['masks'][n]
img_data_aug['masks'][n] = cv2.flip(masks,1)
if config.use_vertical_flips and np.random.randint(0, 2) == 0:
img = cv2.flip(img, 0)
for n,bbox in enumerate(img_data_aug['bboxes']):
y1 = bbox['y1']
y2 = bbox['y2']
bbox['y2'] = rows - y1
bbox['y1'] = rows - y2
masks = img_data_aug['masks'][n]
img_data_aug['masks'][n] = cv2.flip(masks,0)
if config.rot_90:
#angle = np.random.choice([0,90,180,270],1)[0]
angle = 180
if angle == 270:
img = np.transpose(img, (1,0,2))
img = cv2.flip(img, 0)
elif angle == 180:
img = cv2.flip(img, -1)
elif angle == 90:
img = np.transpose(img, (1,0,2))
img = cv2.flip(img, 1)
elif angle == 0:
pass
for n,bbox in enumerate(img_data_aug['bboxes']):
x1 = bbox['x1']
x2 = bbox['x2']
y1 = bbox['y1']
y2 = bbox['y2']
if angle == 270:
bbox['x1'] = y1
bbox['x2'] = y2
bbox['y1'] = cols - x2
bbox['y2'] = cols - x1
elif angle == 180:
bbox['x2'] = cols - x1
bbox['x1'] = cols - x2
bbox['y2'] = rows - y1
bbox['y1'] = rows - y2
masks = img_data_aug['masks'][n]
img_data_aug['masks'][n]= cv2.flip(masks,-1)
elif angle == 90:
bbox['x1'] = rows - y2
bbox['x2'] = rows - y1
bbox['y1'] = x1
bbox['y2'] = x2
elif angle == 0:
pass
img_data_aug['width'] = img.shape[1]
img_data_aug['height'] = img.shape[0]
return img_data_aug, img
| 33.414634 | 72 | 0.433212 |
aceb3cf0562d48e2584b26d93b4721e95164b076 | 6,379 | py | Python | uclasm/counting/isomorphisms.py | jdmoorman/Multi-Channel-Subgraph-Matching | e19e0c4c52065dd17ef69e38bb634f69a1bfc771 | [
"MIT"
] | 15 | 2020-05-12T02:50:06.000Z | 2022-03-23T13:39:23.000Z | uclasm/counting/isomorphisms.py | jdmoorman/Multi-Channel-Subgraph-Matching | e19e0c4c52065dd17ef69e38bb634f69a1bfc771 | [
"MIT"
] | 12 | 2020-04-23T01:01:31.000Z | 2021-04-08T12:34:10.000Z | uclasm/counting/isomorphisms.py | jdmoorman/Multi-Channel-Subgraph-Matching | e19e0c4c52065dd17ef69e38bb634f69a1bfc771 | [
"MIT"
] | 5 | 2019-05-09T23:45:40.000Z | 2019-09-05T23:51:39.000Z | from ..filters import run_filters, cheap_filters, all_filters
from ..utils.misc import invert, values_map_to_same_key, one_hot
from ..utils.graph_ops import get_node_cover
from .alldiffs import count_alldiffs
import numpy as np
from functools import reduce
# TODO: count how many isomorphisms each background node participates in.
# TODO: switch from recursive to iterative implementation for readability
n_iterations = 0
def recursive_isomorphism_counter(tmplt, world, candidates, *,
unspec_cover, verbose, init_changed_cands, count_iterations=False):
global n_iterations
n_iterations += 1
# If the node cover is empty, the unspec nodes are disconnected. Thus, we
# can skip straight to counting solutions to the alldiff constraint problem
if len(unspec_cover) == 0:
# Elimination filter is not needed here and would be a waste of time
tmplt, world, candidates = run_filters(tmplt, world, candidates=candidates, filters=cheap_filters,
verbose=False, init_changed_cands=init_changed_cands)
node_to_cands = {node: world.nodes[candidates[idx]]
for idx, node in enumerate(tmplt.nodes)}
return count_alldiffs(node_to_cands)
tmplt, world, candidates = run_filters(tmplt, world, candidates=candidates, filters=all_filters,
verbose=False, init_changed_cands=init_changed_cands)
# Since the node cover is not empty, we first choose some valid
# assignment of the unspecified nodes one at a time until the remaining
# unspecified nodes are disconnected.
n_isomorphisms = 0
node_idx = unspec_cover[0]
cand_idxs = np.argwhere(candidates[node_idx]).flat
for i, cand_idx in enumerate(cand_idxs):
candidates_copy = candidates.copy()
candidates_copy[node_idx] = one_hot(cand_idx, world.n_nodes)
# recurse to make assignment for the next node in the unspecified cover
n_isomorphisms += recursive_isomorphism_counter(
tmplt, world, candidates_copy, unspec_cover=unspec_cover[1:],
verbose=verbose, init_changed_cands=one_hot(node_idx, tmplt.n_nodes), count_iterations=count_iterations)
# TODO: more useful progress summary
if verbose:
print("depth {}: {} of {}".format(len(unspec_cover), i, len(cand_idxs)), n_isomorphisms)
return n_isomorphisms
def count_isomorphisms(tmplt, world, *, candidates=None, verbose=True, count_iterations=False):
"""
counts the number of ways to assign template nodes to world nodes such that
edges between template nodes also appear between the corresponding world
nodes. Does not factor in the number of ways to assign the edges. Only
counts the number of assignments between nodes.
if the set of unspecified template nodes is too large or too densely
connected, this code may never finish.
"""
global n_iterations
n_iterations = 0
if candidates is None:
tmplt, world, candidates = uclasm.run_filters(
tmplt, world, filters=uclasm.all_filters, verbose=verbose)
unspec_nodes = np.where(candidates.sum(axis=1) > 1)[0]
tmplt_subgraph = tmplt.subgraph(unspec_nodes)
unspec_cover = get_node_cover(tmplt_subgraph)
unspec_cover_nodes = [tmplt_subgraph.nodes[node_idx] for node_idx in unspec_cover]
unspec_cover_idxes = [tmplt.node_idxs[node] for node in unspec_cover_nodes]
# Send zeros to init_changed_cands since we already just ran the filters
count = recursive_isomorphism_counter(
tmplt, world, candidates, verbose=verbose, unspec_cover=unspec_cover_idxes,
init_changed_cands=np.zeros(tmplt.nodes.shape, dtype=np.bool), count_iterations=count_iterations)
if count_iterations:
return count, n_iterations
else:
return count
def recursive_isomorphism_finder(tmplt, world, candidates, *,
unspec_node_idxs, verbose, init_changed_cands,
found_isomorphisms):
if len(unspec_node_idxs) == 0:
# All nodes have been assigned, add the isomorphism to the list
new_isomorphism = {}
for tmplt_idx, tmplt_node in enumerate(tmplt.nodes):
if verbose:
print(str(tmplt_node)+":", world.nodes[candidates[tmplt_idx]])
new_isomorphism[tmplt_node] = world.nodes[candidates[tmplt_idx]][0]
found_isomorphisms.append(new_isomorphism)
return found_isomorphisms
tmplt, world, candidates = run_filters(tmplt, world, candidates=candidates,
filters=all_filters, verbose=False,
init_changed_cands=init_changed_cands)
node_idx = unspec_node_idxs[0]
cand_idxs = np.argwhere(candidates[node_idx]).flat
for i, cand_idx in enumerate(cand_idxs):
candidates_copy = candidates.copy()
candidates_copy[node_idx] = one_hot(cand_idx, world.n_nodes)
# recurse to make assignment for the next node in the unspecified cover
recursive_isomorphism_finder(
tmplt, world, candidates_copy,
unspec_node_idxs=unspec_node_idxs[1:],
verbose=verbose,
init_changed_cands=one_hot(node_idx, tmplt.n_nodes),
found_isomorphisms=found_isomorphisms)
return found_isomorphisms
def find_isomorphisms(tmplt, world, *, candidates=None, verbose=True):
""" Returns a list of isomorphisms as dictionaries mapping template nodes to
world nodes. Note: this is much slower than counting, and should only be
done for small numbers of isomorphisms and fully filtered candidate matrices
"""
if candidates is None:
tmplt, world, candidates = uclasm.run_filters(
tmplt, world, filters=uclasm.all_filters, verbose=verbose)
unspec_node_idxs = np.where(candidates.sum(axis=1) > 1)[0]
found_isomorphisms = []
return recursive_isomorphism_finder(
tmplt, world, candidates, verbose=verbose,
unspec_node_idxs=unspec_node_idxs,
init_changed_cands=np.zeros(tmplt.nodes.shape, dtype=np.bool),
found_isomorphisms=found_isomorphisms)
def print_isomorphisms(tmplt, world, *, candidates=None, verbose=True):
""" Prints the list of isomorphisms """
print(find_isomorphisms(tmplt, world, candidates=candidates,
verbose=verbose))
| 46.224638 | 116 | 0.707948 |
aceb3d6bfc68d95f6b70f931d43e1b9ac9f59368 | 49,749 | py | Python | sdk/python/pulumi_azure_native/web/v20160601/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20160601/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20160601/_inputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'ApiConnectionDefinitionPropertiesArgs',
'ApiConnectionTestLinkArgs',
'ApiOAuthSettingsArgs',
'ApiOAuthSettingsParameterArgs',
'ApiReferenceArgs',
'ApiResourceBackendServiceArgs',
'ApiResourceDefinitionsArgs',
'ConnectionErrorArgs',
'ConnectionGatewayDefinitionPropertiesArgs',
'ConnectionGatewayReferenceArgs',
'ConnectionParameterArgs',
'ConnectionStatusDefinitionArgs',
'ConsentLinkParameterDefinition',
'CustomApiPropertiesDefinitionArgs',
'WsdlDefinitionArgs',
'WsdlServiceArgs',
'WsdlService',
]
@pulumi.input_type
class ApiConnectionDefinitionPropertiesArgs:
def __init__(__self__, *,
api: Optional[pulumi.Input['ApiReferenceArgs']] = None,
changed_time: Optional[pulumi.Input[str]] = None,
created_time: Optional[pulumi.Input[str]] = None,
custom_parameter_values: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
display_name: Optional[pulumi.Input[str]] = None,
non_secret_parameter_values: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
parameter_values: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
statuses: Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionStatusDefinitionArgs']]]] = None,
test_links: Optional[pulumi.Input[Sequence[pulumi.Input['ApiConnectionTestLinkArgs']]]] = None):
"""
:param pulumi.Input[str] changed_time: Timestamp of last connection change
:param pulumi.Input[str] created_time: Timestamp of the connection creation
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] custom_parameter_values: Dictionary of custom parameter values
:param pulumi.Input[str] display_name: Display name
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] non_secret_parameter_values: Dictionary of nonsecret parameter values
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] parameter_values: Dictionary of parameter values
:param pulumi.Input[Sequence[pulumi.Input['ConnectionStatusDefinitionArgs']]] statuses: Status of the connection
:param pulumi.Input[Sequence[pulumi.Input['ApiConnectionTestLinkArgs']]] test_links: Links to test the API connection
"""
if api is not None:
pulumi.set(__self__, "api", api)
if changed_time is not None:
pulumi.set(__self__, "changed_time", changed_time)
if created_time is not None:
pulumi.set(__self__, "created_time", created_time)
if custom_parameter_values is not None:
pulumi.set(__self__, "custom_parameter_values", custom_parameter_values)
if display_name is not None:
pulumi.set(__self__, "display_name", display_name)
if non_secret_parameter_values is not None:
pulumi.set(__self__, "non_secret_parameter_values", non_secret_parameter_values)
if parameter_values is not None:
pulumi.set(__self__, "parameter_values", parameter_values)
if statuses is not None:
pulumi.set(__self__, "statuses", statuses)
if test_links is not None:
pulumi.set(__self__, "test_links", test_links)
@property
@pulumi.getter
def api(self) -> Optional[pulumi.Input['ApiReferenceArgs']]:
return pulumi.get(self, "api")
@api.setter
def api(self, value: Optional[pulumi.Input['ApiReferenceArgs']]):
pulumi.set(self, "api", value)
@property
@pulumi.getter(name="changedTime")
def changed_time(self) -> Optional[pulumi.Input[str]]:
"""
Timestamp of last connection change
"""
return pulumi.get(self, "changed_time")
@changed_time.setter
def changed_time(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "changed_time", value)
@property
@pulumi.getter(name="createdTime")
def created_time(self) -> Optional[pulumi.Input[str]]:
"""
Timestamp of the connection creation
"""
return pulumi.get(self, "created_time")
@created_time.setter
def created_time(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "created_time", value)
@property
@pulumi.getter(name="customParameterValues")
def custom_parameter_values(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Dictionary of custom parameter values
"""
return pulumi.get(self, "custom_parameter_values")
@custom_parameter_values.setter
def custom_parameter_values(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "custom_parameter_values", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[pulumi.Input[str]]:
"""
Display name
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="nonSecretParameterValues")
def non_secret_parameter_values(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Dictionary of nonsecret parameter values
"""
return pulumi.get(self, "non_secret_parameter_values")
@non_secret_parameter_values.setter
def non_secret_parameter_values(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "non_secret_parameter_values", value)
@property
@pulumi.getter(name="parameterValues")
def parameter_values(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Dictionary of parameter values
"""
return pulumi.get(self, "parameter_values")
@parameter_values.setter
def parameter_values(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "parameter_values", value)
@property
@pulumi.getter
def statuses(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionStatusDefinitionArgs']]]]:
"""
Status of the connection
"""
return pulumi.get(self, "statuses")
@statuses.setter
def statuses(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ConnectionStatusDefinitionArgs']]]]):
pulumi.set(self, "statuses", value)
@property
@pulumi.getter(name="testLinks")
def test_links(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ApiConnectionTestLinkArgs']]]]:
"""
Links to test the API connection
"""
return pulumi.get(self, "test_links")
@test_links.setter
def test_links(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ApiConnectionTestLinkArgs']]]]):
pulumi.set(self, "test_links", value)
@pulumi.input_type
class ApiConnectionTestLinkArgs:
def __init__(__self__, *,
method: Optional[pulumi.Input[str]] = None,
request_uri: Optional[pulumi.Input[str]] = None):
"""
API connection properties
:param pulumi.Input[str] method: HTTP Method
:param pulumi.Input[str] request_uri: Test link request URI
"""
if method is not None:
pulumi.set(__self__, "method", method)
if request_uri is not None:
pulumi.set(__self__, "request_uri", request_uri)
@property
@pulumi.getter
def method(self) -> Optional[pulumi.Input[str]]:
"""
HTTP Method
"""
return pulumi.get(self, "method")
@method.setter
def method(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "method", value)
@property
@pulumi.getter(name="requestUri")
def request_uri(self) -> Optional[pulumi.Input[str]]:
"""
Test link request URI
"""
return pulumi.get(self, "request_uri")
@request_uri.setter
def request_uri(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "request_uri", value)
@pulumi.input_type
class ApiOAuthSettingsArgs:
def __init__(__self__, *,
client_id: Optional[pulumi.Input[str]] = None,
client_secret: Optional[pulumi.Input[str]] = None,
custom_parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input['ApiOAuthSettingsParameterArgs']]]] = None,
identity_provider: Optional[pulumi.Input[str]] = None,
properties: Optional[Any] = None,
redirect_url: Optional[pulumi.Input[str]] = None,
scopes: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
OAuth settings for the connection provider
:param pulumi.Input[str] client_id: Resource provider client id
:param pulumi.Input[str] client_secret: Client Secret needed for OAuth
:param pulumi.Input[Mapping[str, pulumi.Input['ApiOAuthSettingsParameterArgs']]] custom_parameters: OAuth parameters key is the name of parameter
:param pulumi.Input[str] identity_provider: Identity provider
:param Any properties: Read only properties for this oauth setting.
:param pulumi.Input[str] redirect_url: Url
:param pulumi.Input[Sequence[pulumi.Input[str]]] scopes: OAuth scopes
"""
if client_id is not None:
pulumi.set(__self__, "client_id", client_id)
if client_secret is not None:
pulumi.set(__self__, "client_secret", client_secret)
if custom_parameters is not None:
pulumi.set(__self__, "custom_parameters", custom_parameters)
if identity_provider is not None:
pulumi.set(__self__, "identity_provider", identity_provider)
if properties is not None:
pulumi.set(__self__, "properties", properties)
if redirect_url is not None:
pulumi.set(__self__, "redirect_url", redirect_url)
if scopes is not None:
pulumi.set(__self__, "scopes", scopes)
@property
@pulumi.getter(name="clientId")
def client_id(self) -> Optional[pulumi.Input[str]]:
"""
Resource provider client id
"""
return pulumi.get(self, "client_id")
@client_id.setter
def client_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_id", value)
@property
@pulumi.getter(name="clientSecret")
def client_secret(self) -> Optional[pulumi.Input[str]]:
"""
Client Secret needed for OAuth
"""
return pulumi.get(self, "client_secret")
@client_secret.setter
def client_secret(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_secret", value)
@property
@pulumi.getter(name="customParameters")
def custom_parameters(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['ApiOAuthSettingsParameterArgs']]]]:
"""
OAuth parameters key is the name of parameter
"""
return pulumi.get(self, "custom_parameters")
@custom_parameters.setter
def custom_parameters(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['ApiOAuthSettingsParameterArgs']]]]):
pulumi.set(self, "custom_parameters", value)
@property
@pulumi.getter(name="identityProvider")
def identity_provider(self) -> Optional[pulumi.Input[str]]:
"""
Identity provider
"""
return pulumi.get(self, "identity_provider")
@identity_provider.setter
def identity_provider(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "identity_provider", value)
@property
@pulumi.getter
def properties(self) -> Optional[Any]:
"""
Read only properties for this oauth setting.
"""
return pulumi.get(self, "properties")
@properties.setter
def properties(self, value: Optional[Any]):
pulumi.set(self, "properties", value)
@property
@pulumi.getter(name="redirectUrl")
def redirect_url(self) -> Optional[pulumi.Input[str]]:
"""
Url
"""
return pulumi.get(self, "redirect_url")
@redirect_url.setter
def redirect_url(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "redirect_url", value)
@property
@pulumi.getter
def scopes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
OAuth scopes
"""
return pulumi.get(self, "scopes")
@scopes.setter
def scopes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "scopes", value)
@pulumi.input_type
class ApiOAuthSettingsParameterArgs:
def __init__(__self__, *,
options: Optional[Any] = None,
ui_definition: Optional[Any] = None,
value: Optional[pulumi.Input[str]] = None):
"""
OAuth settings for the API
:param Any options: Options available to this parameter
:param Any ui_definition: UI definitions per culture as caller can specify the culture
:param pulumi.Input[str] value: Value of the setting
"""
if options is not None:
pulumi.set(__self__, "options", options)
if ui_definition is not None:
pulumi.set(__self__, "ui_definition", ui_definition)
if value is not None:
pulumi.set(__self__, "value", value)
@property
@pulumi.getter
def options(self) -> Optional[Any]:
"""
Options available to this parameter
"""
return pulumi.get(self, "options")
@options.setter
def options(self, value: Optional[Any]):
pulumi.set(self, "options", value)
@property
@pulumi.getter(name="uiDefinition")
def ui_definition(self) -> Optional[Any]:
"""
UI definitions per culture as caller can specify the culture
"""
return pulumi.get(self, "ui_definition")
@ui_definition.setter
def ui_definition(self, value: Optional[Any]):
pulumi.set(self, "ui_definition", value)
@property
@pulumi.getter
def value(self) -> Optional[pulumi.Input[str]]:
"""
Value of the setting
"""
return pulumi.get(self, "value")
@value.setter
def value(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "value", value)
@pulumi.input_type
class ApiReferenceArgs:
def __init__(__self__, *,
brand_color: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
icon_uri: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
swagger: Optional[Any] = None,
type: Optional[pulumi.Input[str]] = None):
"""
:param pulumi.Input[str] brand_color: Brand color
:param pulumi.Input[str] description: The custom API description
:param pulumi.Input[str] display_name: The display name
:param pulumi.Input[str] icon_uri: The icon URI
:param pulumi.Input[str] id: Resource reference id
:param pulumi.Input[str] name: The name of the API
:param Any swagger: The JSON representation of the swagger
:param pulumi.Input[str] type: Resource reference type
"""
if brand_color is not None:
pulumi.set(__self__, "brand_color", brand_color)
if description is not None:
pulumi.set(__self__, "description", description)
if display_name is not None:
pulumi.set(__self__, "display_name", display_name)
if icon_uri is not None:
pulumi.set(__self__, "icon_uri", icon_uri)
if id is not None:
pulumi.set(__self__, "id", id)
if name is not None:
pulumi.set(__self__, "name", name)
if swagger is not None:
pulumi.set(__self__, "swagger", swagger)
if type is not None:
pulumi.set(__self__, "type", type)
@property
@pulumi.getter(name="brandColor")
def brand_color(self) -> Optional[pulumi.Input[str]]:
"""
Brand color
"""
return pulumi.get(self, "brand_color")
@brand_color.setter
def brand_color(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "brand_color", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The custom API description
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[pulumi.Input[str]]:
"""
The display name
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="iconUri")
def icon_uri(self) -> Optional[pulumi.Input[str]]:
"""
The icon URI
"""
return pulumi.get(self, "icon_uri")
@icon_uri.setter
def icon_uri(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "icon_uri", value)
@property
@pulumi.getter
def id(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference id
"""
return pulumi.get(self, "id")
@id.setter
def id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "id", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the API
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def swagger(self) -> Optional[Any]:
"""
The JSON representation of the swagger
"""
return pulumi.get(self, "swagger")
@swagger.setter
def swagger(self, value: Optional[Any]):
pulumi.set(self, "swagger", value)
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference type
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "type", value)
@pulumi.input_type
class ApiResourceBackendServiceArgs:
def __init__(__self__, *,
service_url: Optional[pulumi.Input[str]] = None):
"""
The API backend service
:param pulumi.Input[str] service_url: The service URL
"""
if service_url is not None:
pulumi.set(__self__, "service_url", service_url)
@property
@pulumi.getter(name="serviceUrl")
def service_url(self) -> Optional[pulumi.Input[str]]:
"""
The service URL
"""
return pulumi.get(self, "service_url")
@service_url.setter
def service_url(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "service_url", value)
@pulumi.input_type
class ApiResourceDefinitionsArgs:
def __init__(__self__, *,
modified_swagger_url: Optional[pulumi.Input[str]] = None,
original_swagger_url: Optional[pulumi.Input[str]] = None):
"""
API Definitions
:param pulumi.Input[str] modified_swagger_url: The modified swagger URL
:param pulumi.Input[str] original_swagger_url: The original swagger URL
"""
if modified_swagger_url is not None:
pulumi.set(__self__, "modified_swagger_url", modified_swagger_url)
if original_swagger_url is not None:
pulumi.set(__self__, "original_swagger_url", original_swagger_url)
@property
@pulumi.getter(name="modifiedSwaggerUrl")
def modified_swagger_url(self) -> Optional[pulumi.Input[str]]:
"""
The modified swagger URL
"""
return pulumi.get(self, "modified_swagger_url")
@modified_swagger_url.setter
def modified_swagger_url(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "modified_swagger_url", value)
@property
@pulumi.getter(name="originalSwaggerUrl")
def original_swagger_url(self) -> Optional[pulumi.Input[str]]:
"""
The original swagger URL
"""
return pulumi.get(self, "original_swagger_url")
@original_swagger_url.setter
def original_swagger_url(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "original_swagger_url", value)
@pulumi.input_type
class ConnectionErrorArgs:
def __init__(__self__, *,
code: Optional[pulumi.Input[str]] = None,
etag: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
message: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
"""
Connection error
:param pulumi.Input[str] code: Code of the status
:param pulumi.Input[str] etag: Resource ETag
:param pulumi.Input[str] location: Resource location
:param pulumi.Input[str] message: Description of the status
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Resource tags
"""
if code is not None:
pulumi.set(__self__, "code", code)
if etag is not None:
pulumi.set(__self__, "etag", etag)
if location is not None:
pulumi.set(__self__, "location", location)
if message is not None:
pulumi.set(__self__, "message", message)
if tags is not None:
pulumi.set(__self__, "tags", tags)
@property
@pulumi.getter
def code(self) -> Optional[pulumi.Input[str]]:
"""
Code of the status
"""
return pulumi.get(self, "code")
@code.setter
def code(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "code", value)
@property
@pulumi.getter
def etag(self) -> Optional[pulumi.Input[str]]:
"""
Resource ETag
"""
return pulumi.get(self, "etag")
@etag.setter
def etag(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "etag", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
Resource location
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def message(self) -> Optional[pulumi.Input[str]]:
"""
Description of the status
"""
return pulumi.get(self, "message")
@message.setter
def message(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "message", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Resource tags
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@pulumi.input_type
class ConnectionGatewayDefinitionPropertiesArgs:
def __init__(__self__, *,
backend_uri: Optional[pulumi.Input[str]] = None,
connection_gateway_installation: Optional[pulumi.Input['ConnectionGatewayReferenceArgs']] = None,
contact_information: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
description: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
machine_name: Optional[pulumi.Input[str]] = None,
status: Optional[Any] = None):
"""
:param pulumi.Input[str] backend_uri: The URI of the backend
:param pulumi.Input['ConnectionGatewayReferenceArgs'] connection_gateway_installation: The gateway installation reference
:param pulumi.Input[Sequence[pulumi.Input[str]]] contact_information: The gateway admin
:param pulumi.Input[str] description: The gateway description
:param pulumi.Input[str] display_name: The gateway display name
:param pulumi.Input[str] machine_name: The machine name of the gateway
:param Any status: The gateway status
"""
if backend_uri is not None:
pulumi.set(__self__, "backend_uri", backend_uri)
if connection_gateway_installation is not None:
pulumi.set(__self__, "connection_gateway_installation", connection_gateway_installation)
if contact_information is not None:
pulumi.set(__self__, "contact_information", contact_information)
if description is not None:
pulumi.set(__self__, "description", description)
if display_name is not None:
pulumi.set(__self__, "display_name", display_name)
if machine_name is not None:
pulumi.set(__self__, "machine_name", machine_name)
if status is not None:
pulumi.set(__self__, "status", status)
@property
@pulumi.getter(name="backendUri")
def backend_uri(self) -> Optional[pulumi.Input[str]]:
"""
The URI of the backend
"""
return pulumi.get(self, "backend_uri")
@backend_uri.setter
def backend_uri(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "backend_uri", value)
@property
@pulumi.getter(name="connectionGatewayInstallation")
def connection_gateway_installation(self) -> Optional[pulumi.Input['ConnectionGatewayReferenceArgs']]:
"""
The gateway installation reference
"""
return pulumi.get(self, "connection_gateway_installation")
@connection_gateway_installation.setter
def connection_gateway_installation(self, value: Optional[pulumi.Input['ConnectionGatewayReferenceArgs']]):
pulumi.set(self, "connection_gateway_installation", value)
@property
@pulumi.getter(name="contactInformation")
def contact_information(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The gateway admin
"""
return pulumi.get(self, "contact_information")
@contact_information.setter
def contact_information(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "contact_information", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The gateway description
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[pulumi.Input[str]]:
"""
The gateway display name
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="machineName")
def machine_name(self) -> Optional[pulumi.Input[str]]:
"""
The machine name of the gateway
"""
return pulumi.get(self, "machine_name")
@machine_name.setter
def machine_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "machine_name", value)
@property
@pulumi.getter
def status(self) -> Optional[Any]:
"""
The gateway status
"""
return pulumi.get(self, "status")
@status.setter
def status(self, value: Optional[Any]):
pulumi.set(self, "status", value)
@pulumi.input_type
class ConnectionGatewayReferenceArgs:
def __init__(__self__, *,
id: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None):
"""
The gateway installation reference
:param pulumi.Input[str] id: Resource reference id
:param pulumi.Input[str] location: Resource reference location
:param pulumi.Input[str] name: Resource reference name
:param pulumi.Input[str] type: Resource reference type
"""
if id is not None:
pulumi.set(__self__, "id", id)
if location is not None:
pulumi.set(__self__, "location", location)
if name is not None:
pulumi.set(__self__, "name", name)
if type is not None:
pulumi.set(__self__, "type", type)
@property
@pulumi.getter
def id(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference id
"""
return pulumi.get(self, "id")
@id.setter
def id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "id", value)
@property
@pulumi.getter
def location(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference location
"""
return pulumi.get(self, "location")
@location.setter
def location(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "location", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference name
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input[str]]:
"""
Resource reference type
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "type", value)
@pulumi.input_type
class ConnectionParameterArgs:
def __init__(__self__, *,
o_auth_settings: Optional[pulumi.Input['ApiOAuthSettingsArgs']] = None,
type: Optional[pulumi.Input['ConnectionParameterType']] = None):
"""
Connection provider parameters
:param pulumi.Input['ApiOAuthSettingsArgs'] o_auth_settings: OAuth settings for the connection provider
:param pulumi.Input['ConnectionParameterType'] type: Type of the parameter
"""
if o_auth_settings is not None:
pulumi.set(__self__, "o_auth_settings", o_auth_settings)
if type is not None:
pulumi.set(__self__, "type", type)
@property
@pulumi.getter(name="oAuthSettings")
def o_auth_settings(self) -> Optional[pulumi.Input['ApiOAuthSettingsArgs']]:
"""
OAuth settings for the connection provider
"""
return pulumi.get(self, "o_auth_settings")
@o_auth_settings.setter
def o_auth_settings(self, value: Optional[pulumi.Input['ApiOAuthSettingsArgs']]):
pulumi.set(self, "o_auth_settings", value)
@property
@pulumi.getter
def type(self) -> Optional[pulumi.Input['ConnectionParameterType']]:
"""
Type of the parameter
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: Optional[pulumi.Input['ConnectionParameterType']]):
pulumi.set(self, "type", value)
@pulumi.input_type
class ConnectionStatusDefinitionArgs:
def __init__(__self__, *,
error: Optional[pulumi.Input['ConnectionErrorArgs']] = None,
status: Optional[pulumi.Input[str]] = None,
target: Optional[pulumi.Input[str]] = None):
"""
Connection status
:param pulumi.Input['ConnectionErrorArgs'] error: Connection error
:param pulumi.Input[str] status: The gateway status
:param pulumi.Input[str] target: Target of the error
"""
if error is not None:
pulumi.set(__self__, "error", error)
if status is not None:
pulumi.set(__self__, "status", status)
if target is not None:
pulumi.set(__self__, "target", target)
@property
@pulumi.getter
def error(self) -> Optional[pulumi.Input['ConnectionErrorArgs']]:
"""
Connection error
"""
return pulumi.get(self, "error")
@error.setter
def error(self, value: Optional[pulumi.Input['ConnectionErrorArgs']]):
pulumi.set(self, "error", value)
@property
@pulumi.getter
def status(self) -> Optional[pulumi.Input[str]]:
"""
The gateway status
"""
return pulumi.get(self, "status")
@status.setter
def status(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "status", value)
@property
@pulumi.getter
def target(self) -> Optional[pulumi.Input[str]]:
"""
Target of the error
"""
return pulumi.get(self, "target")
@target.setter
def target(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "target", value)
@pulumi.input_type
class ConsentLinkParameterDefinition:
def __init__(__self__, *,
object_id: Optional[str] = None,
parameter_name: Optional[str] = None,
redirect_url: Optional[str] = None,
tenant_id: Optional[str] = None):
"""
Consent link definition
:param str object_id: AAD OID (user or group) if the principal type is ActiveDirectory. MSA PUID if the principal type is MicrosoftAccount
:param str parameter_name: Name of the parameter in the connection provider's OAuth settings
:param str redirect_url: Name of the parameter in the connection provider's OAuth settings
:param str tenant_id: The tenant id
"""
if object_id is not None:
pulumi.set(__self__, "object_id", object_id)
if parameter_name is not None:
pulumi.set(__self__, "parameter_name", parameter_name)
if redirect_url is not None:
pulumi.set(__self__, "redirect_url", redirect_url)
if tenant_id is not None:
pulumi.set(__self__, "tenant_id", tenant_id)
@property
@pulumi.getter(name="objectId")
def object_id(self) -> Optional[str]:
"""
AAD OID (user or group) if the principal type is ActiveDirectory. MSA PUID if the principal type is MicrosoftAccount
"""
return pulumi.get(self, "object_id")
@object_id.setter
def object_id(self, value: Optional[str]):
pulumi.set(self, "object_id", value)
@property
@pulumi.getter(name="parameterName")
def parameter_name(self) -> Optional[str]:
"""
Name of the parameter in the connection provider's OAuth settings
"""
return pulumi.get(self, "parameter_name")
@parameter_name.setter
def parameter_name(self, value: Optional[str]):
pulumi.set(self, "parameter_name", value)
@property
@pulumi.getter(name="redirectUrl")
def redirect_url(self) -> Optional[str]:
"""
Name of the parameter in the connection provider's OAuth settings
"""
return pulumi.get(self, "redirect_url")
@redirect_url.setter
def redirect_url(self, value: Optional[str]):
pulumi.set(self, "redirect_url", value)
@property
@pulumi.getter(name="tenantId")
def tenant_id(self) -> Optional[str]:
"""
The tenant id
"""
return pulumi.get(self, "tenant_id")
@tenant_id.setter
def tenant_id(self, value: Optional[str]):
pulumi.set(self, "tenant_id", value)
@pulumi.input_type
class CustomApiPropertiesDefinitionArgs:
def __init__(__self__, *,
api_definitions: Optional[pulumi.Input['ApiResourceDefinitionsArgs']] = None,
api_type: Optional[pulumi.Input[Union[str, 'ApiType']]] = None,
backend_service: Optional[pulumi.Input['ApiResourceBackendServiceArgs']] = None,
brand_color: Optional[pulumi.Input[str]] = None,
capabilities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
connection_parameters: Optional[pulumi.Input[Mapping[str, pulumi.Input['ConnectionParameterArgs']]]] = None,
description: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
icon_uri: Optional[pulumi.Input[str]] = None,
runtime_urls: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
swagger: Optional[Any] = None,
wsdl_definition: Optional[pulumi.Input['WsdlDefinitionArgs']] = None):
"""
Custom API properties
:param pulumi.Input['ApiResourceDefinitionsArgs'] api_definitions: API Definitions
:param pulumi.Input[Union[str, 'ApiType']] api_type: The API type
:param pulumi.Input['ApiResourceBackendServiceArgs'] backend_service: The API backend service
:param pulumi.Input[str] brand_color: Brand color
:param pulumi.Input[Sequence[pulumi.Input[str]]] capabilities: The custom API capabilities
:param pulumi.Input[Mapping[str, pulumi.Input['ConnectionParameterArgs']]] connection_parameters: Connection parameters
:param pulumi.Input[str] description: The custom API description
:param pulumi.Input[str] display_name: The display name
:param pulumi.Input[str] icon_uri: The icon URI
:param pulumi.Input[Sequence[pulumi.Input[str]]] runtime_urls: Runtime URLs
:param Any swagger: The JSON representation of the swagger
:param pulumi.Input['WsdlDefinitionArgs'] wsdl_definition: The WSDL definition
"""
if api_definitions is not None:
pulumi.set(__self__, "api_definitions", api_definitions)
if api_type is not None:
pulumi.set(__self__, "api_type", api_type)
if backend_service is not None:
pulumi.set(__self__, "backend_service", backend_service)
if brand_color is not None:
pulumi.set(__self__, "brand_color", brand_color)
if capabilities is not None:
pulumi.set(__self__, "capabilities", capabilities)
if connection_parameters is not None:
pulumi.set(__self__, "connection_parameters", connection_parameters)
if description is not None:
pulumi.set(__self__, "description", description)
if display_name is not None:
pulumi.set(__self__, "display_name", display_name)
if icon_uri is not None:
pulumi.set(__self__, "icon_uri", icon_uri)
if runtime_urls is not None:
pulumi.set(__self__, "runtime_urls", runtime_urls)
if swagger is not None:
pulumi.set(__self__, "swagger", swagger)
if wsdl_definition is not None:
pulumi.set(__self__, "wsdl_definition", wsdl_definition)
@property
@pulumi.getter(name="apiDefinitions")
def api_definitions(self) -> Optional[pulumi.Input['ApiResourceDefinitionsArgs']]:
"""
API Definitions
"""
return pulumi.get(self, "api_definitions")
@api_definitions.setter
def api_definitions(self, value: Optional[pulumi.Input['ApiResourceDefinitionsArgs']]):
pulumi.set(self, "api_definitions", value)
@property
@pulumi.getter(name="apiType")
def api_type(self) -> Optional[pulumi.Input[Union[str, 'ApiType']]]:
"""
The API type
"""
return pulumi.get(self, "api_type")
@api_type.setter
def api_type(self, value: Optional[pulumi.Input[Union[str, 'ApiType']]]):
pulumi.set(self, "api_type", value)
@property
@pulumi.getter(name="backendService")
def backend_service(self) -> Optional[pulumi.Input['ApiResourceBackendServiceArgs']]:
"""
The API backend service
"""
return pulumi.get(self, "backend_service")
@backend_service.setter
def backend_service(self, value: Optional[pulumi.Input['ApiResourceBackendServiceArgs']]):
pulumi.set(self, "backend_service", value)
@property
@pulumi.getter(name="brandColor")
def brand_color(self) -> Optional[pulumi.Input[str]]:
"""
Brand color
"""
return pulumi.get(self, "brand_color")
@brand_color.setter
def brand_color(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "brand_color", value)
@property
@pulumi.getter
def capabilities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
The custom API capabilities
"""
return pulumi.get(self, "capabilities")
@capabilities.setter
def capabilities(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "capabilities", value)
@property
@pulumi.getter(name="connectionParameters")
def connection_parameters(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input['ConnectionParameterArgs']]]]:
"""
Connection parameters
"""
return pulumi.get(self, "connection_parameters")
@connection_parameters.setter
def connection_parameters(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input['ConnectionParameterArgs']]]]):
pulumi.set(self, "connection_parameters", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The custom API description
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> Optional[pulumi.Input[str]]:
"""
The display name
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="iconUri")
def icon_uri(self) -> Optional[pulumi.Input[str]]:
"""
The icon URI
"""
return pulumi.get(self, "icon_uri")
@icon_uri.setter
def icon_uri(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "icon_uri", value)
@property
@pulumi.getter(name="runtimeUrls")
def runtime_urls(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Runtime URLs
"""
return pulumi.get(self, "runtime_urls")
@runtime_urls.setter
def runtime_urls(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "runtime_urls", value)
@property
@pulumi.getter
def swagger(self) -> Optional[Any]:
"""
The JSON representation of the swagger
"""
return pulumi.get(self, "swagger")
@swagger.setter
def swagger(self, value: Optional[Any]):
pulumi.set(self, "swagger", value)
@property
@pulumi.getter(name="wsdlDefinition")
def wsdl_definition(self) -> Optional[pulumi.Input['WsdlDefinitionArgs']]:
"""
The WSDL definition
"""
return pulumi.get(self, "wsdl_definition")
@wsdl_definition.setter
def wsdl_definition(self, value: Optional[pulumi.Input['WsdlDefinitionArgs']]):
pulumi.set(self, "wsdl_definition", value)
@pulumi.input_type
class WsdlDefinitionArgs:
def __init__(__self__, *,
content: Optional[pulumi.Input[str]] = None,
import_method: Optional[pulumi.Input[Union[str, 'WsdlImportMethod']]] = None,
service: Optional[pulumi.Input['WsdlServiceArgs']] = None,
url: Optional[pulumi.Input[str]] = None):
"""
The WSDL definition
:param pulumi.Input[str] content: The WSDL content
:param pulumi.Input[Union[str, 'WsdlImportMethod']] import_method: The WSDL import method
:param pulumi.Input['WsdlServiceArgs'] service: The service with name and endpoint names
:param pulumi.Input[str] url: The WSDL URL
"""
if content is not None:
pulumi.set(__self__, "content", content)
if import_method is not None:
pulumi.set(__self__, "import_method", import_method)
if service is not None:
pulumi.set(__self__, "service", service)
if url is not None:
pulumi.set(__self__, "url", url)
@property
@pulumi.getter
def content(self) -> Optional[pulumi.Input[str]]:
"""
The WSDL content
"""
return pulumi.get(self, "content")
@content.setter
def content(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "content", value)
@property
@pulumi.getter(name="importMethod")
def import_method(self) -> Optional[pulumi.Input[Union[str, 'WsdlImportMethod']]]:
"""
The WSDL import method
"""
return pulumi.get(self, "import_method")
@import_method.setter
def import_method(self, value: Optional[pulumi.Input[Union[str, 'WsdlImportMethod']]]):
pulumi.set(self, "import_method", value)
@property
@pulumi.getter
def service(self) -> Optional[pulumi.Input['WsdlServiceArgs']]:
"""
The service with name and endpoint names
"""
return pulumi.get(self, "service")
@service.setter
def service(self, value: Optional[pulumi.Input['WsdlServiceArgs']]):
pulumi.set(self, "service", value)
@property
@pulumi.getter
def url(self) -> Optional[pulumi.Input[str]]:
"""
The WSDL URL
"""
return pulumi.get(self, "url")
@url.setter
def url(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "url", value)
@pulumi.input_type
class WsdlServiceArgs:
def __init__(__self__, *,
qualified_name: pulumi.Input[str],
endpoint_qualified_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
The service with name and endpoint names
:param pulumi.Input[str] qualified_name: The service's qualified name
:param pulumi.Input[Sequence[pulumi.Input[str]]] endpoint_qualified_names: List of the endpoints' qualified names
"""
pulumi.set(__self__, "qualified_name", qualified_name)
if endpoint_qualified_names is not None:
pulumi.set(__self__, "endpoint_qualified_names", endpoint_qualified_names)
@property
@pulumi.getter(name="qualifiedName")
def qualified_name(self) -> pulumi.Input[str]:
"""
The service's qualified name
"""
return pulumi.get(self, "qualified_name")
@qualified_name.setter
def qualified_name(self, value: pulumi.Input[str]):
pulumi.set(self, "qualified_name", value)
@property
@pulumi.getter(name="endpointQualifiedNames")
def endpoint_qualified_names(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
List of the endpoints' qualified names
"""
return pulumi.get(self, "endpoint_qualified_names")
@endpoint_qualified_names.setter
def endpoint_qualified_names(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "endpoint_qualified_names", value)
@pulumi.input_type
class WsdlService:
def __init__(__self__, *,
qualified_name: str,
endpoint_qualified_names: Optional[Sequence[str]] = None):
"""
The service with name and endpoint names
:param str qualified_name: The service's qualified name
:param Sequence[str] endpoint_qualified_names: List of the endpoints' qualified names
"""
pulumi.set(__self__, "qualified_name", qualified_name)
if endpoint_qualified_names is not None:
pulumi.set(__self__, "endpoint_qualified_names", endpoint_qualified_names)
@property
@pulumi.getter(name="qualifiedName")
def qualified_name(self) -> str:
"""
The service's qualified name
"""
return pulumi.get(self, "qualified_name")
@qualified_name.setter
def qualified_name(self, value: str):
pulumi.set(self, "qualified_name", value)
@property
@pulumi.getter(name="endpointQualifiedNames")
def endpoint_qualified_names(self) -> Optional[Sequence[str]]:
"""
List of the endpoints' qualified names
"""
return pulumi.get(self, "endpoint_qualified_names")
@endpoint_qualified_names.setter
def endpoint_qualified_names(self, value: Optional[Sequence[str]]):
pulumi.set(self, "endpoint_qualified_names", value)
| 35.764917 | 153 | 0.635993 |
aceb3f05d56462d9131a085dd92d2f578dbef049 | 25,909 | py | Python | testcases/bitstamp_test.py | wilsonwang371/pyalgotrade | b6ecd88c06e5ad44ab66cbe03c1a91105343c64d | [
"Apache-2.0"
] | 6 | 2018-12-29T05:32:49.000Z | 2021-11-10T10:56:55.000Z | testcases/bitstamp_test.py | wilsonwang371/pyalgotrade | b6ecd88c06e5ad44ab66cbe03c1a91105343c64d | [
"Apache-2.0"
] | null | null | null | testcases/bitstamp_test.py | wilsonwang371/pyalgotrade | b6ecd88c06e5ad44ab66cbe03c1a91105343c64d | [
"Apache-2.0"
] | 1 | 2019-07-17T15:16:57.000Z | 2019-07-17T15:16:57.000Z | # PyAlgoTrade
#
# Copyright 2011-2018 Gabriel Martin Becedillas Ruiz
#
# 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.
"""
.. moduleauthor:: Gabriel Martin Becedillas Ruiz <gabriel.becedillas@gmail.com>
"""
import unittest
import datetime
import time
import threading
import json
from six.moves import queue
from . import common as tc_common
from . import test_strategy
from pyalgotrade import broker as basebroker
from pyalgotrade.bitstamp import barfeed
from pyalgotrade.bitstamp import broker
from pyalgotrade.bitstamp import wsclient
from pyalgotrade.bitstamp import httpclient
from pyalgotrade.bitstamp import common
from pyalgotrade.bitcoincharts import barfeed as btcbarfeed
from pyalgotrade import strategy
from pyalgotrade import dispatcher
class WebSocketClientThreadMock(threading.Thread):
def __init__(self, events):
threading.Thread.__init__(self)
self.__queue = queue.Queue()
self.__queue.put((wsclient.WebSocketClient.Event.CONNECTED, None))
for event in events:
self.__queue.put(event)
self.__queue.put((wsclient.WebSocketClient.Event.DISCONNECTED, None))
self.__stop = False
def getQueue(self):
return self.__queue
def start(self):
threading.Thread.start(self)
def run(self):
while not self.__queue.empty() and not self.__stop:
time.sleep(0.01)
def stop(self):
self.__stop = True
class TestingLiveTradeFeed(barfeed.LiveTradeFeed):
def __init__(self):
barfeed.LiveTradeFeed.__init__(self)
# Disable reconnections so the test finishes when ON_DISCONNECTED is pushed.
self.enableReconection(False)
self.__events = []
def addTrade(self, dateTime, tid, price, amount):
dataDict = {
"id": tid,
"price": price,
"amount": amount,
"type": 0,
}
eventDict = {}
eventDict["data"] = json.dumps(dataDict)
self.__events.append((wsclient.WebSocketClient.Event.TRADE, wsclient.Trade(dateTime, eventDict)))
def buildWebSocketClientThread(self):
return WebSocketClientThreadMock(self.__events)
class HTTPClientMock(object):
class UserTransactionType:
MARKET_TRADE = 2
def __init__(self):
self.__userTransactions = []
self.__openOrders = []
self.__btcAvailable = 0.0
self.__usdAvailable = 0.0
self.__nextTxId = 1
self.__nextOrderId = 1000
self.__userTransactionsRequested = False
def setUSDAvailable(self, usd):
self.__usdAvailable = usd
def setBTCAvailable(self, btc):
self.__btcAvailable = btc
def addOpenOrder(self, orderId, btcAmount, usdAmount):
jsonDict = {
'id': orderId,
'datetime': str(datetime.datetime.now()),
'type': 0 if btcAmount > 0 else 1,
'price': str(usdAmount),
'amount': str(abs(btcAmount)),
}
self.__openOrders.append(jsonDict)
def addUserTransaction(self, orderId, btcAmount, usdAmount, fillPrice, fee):
jsonDict = {
'btc': str(btcAmount),
'btc_usd': str(fillPrice),
'datetime': str(datetime.datetime.now()),
'fee': str(fee),
'id': self.__nextTxId,
'order_id': orderId,
'type': 2,
'usd': str(usdAmount)
}
self.__userTransactions.insert(0, jsonDict)
self.__nextTxId += 1
def getAccountBalance(self):
jsonDict = {
'btc_available': str(self.__btcAvailable),
# 'btc_balance': '0',
# 'btc_reserved': '0',
# 'fee': '0.5000',
'usd_available': str(self.__usdAvailable),
# 'usd_balance': '0.00',
# 'usd_reserved': '0'
}
return httpclient.AccountBalance(jsonDict)
def getOpenOrders(self):
return [httpclient.Order(jsonDict) for jsonDict in self.__openOrders]
def cancelOrder(self, orderId):
pass
def _buildOrder(self, price, amount):
jsonDict = {
'id': self.__nextOrderId,
'datetime': str(datetime.datetime.now()),
'type': 0 if amount > 0 else 1,
'price': str(price),
'amount': str(abs(amount)),
}
self.__nextOrderId += 1
return httpclient.Order(jsonDict)
def buyLimit(self, limitPrice, quantity):
assert(quantity > 0)
return self._buildOrder(limitPrice, quantity)
def sellLimit(self, limitPrice, quantity):
assert(quantity > 0)
return self._buildOrder(limitPrice, quantity)
def getUserTransactions(self, transactionType=None):
# The first call is to retrieve user transactions that should have been
# processed already.
if not self.__userTransactionsRequested:
self.__userTransactionsRequested = True
return []
else:
return [httpclient.UserTransaction(jsonDict) for jsonDict in self.__userTransactions]
class TestingLiveBroker(broker.LiveBroker):
def __init__(self, clientId, key, secret):
self.__httpClient = HTTPClientMock()
broker.LiveBroker.__init__(self, clientId, key, secret)
def buildHTTPClient(self, clientId, key, secret):
return self.__httpClient
def getHTTPClient(self):
return self.__httpClient
class NonceTest(unittest.TestCase):
def testNonceGenerator(self):
gen = httpclient.NonceGenerator()
prevNonce = 0
for i in range(1000):
nonce = gen.getNext()
self.assertGreater(nonce, prevNonce)
prevNonce = nonce
class TestStrategy(test_strategy.BaseStrategy):
def __init__(self, feed, brk):
super(TestStrategy, self).__init__(feed, brk)
self.bid = None
self.ask = None
# Subscribe to order book update events to get bid/ask prices to trade.
feed.getOrderBookUpdateEvent().subscribe(self.__onOrderBookUpdate)
def __onOrderBookUpdate(self, orderBookUpdate):
bid = orderBookUpdate.getBidPrices()[0]
ask = orderBookUpdate.getAskPrices()[0]
if bid != self.bid or ask != self.ask:
self.bid = bid
self.ask = ask
class InstrumentTraitsTestCase(tc_common.TestCase):
def testInstrumentTraits(self):
traits = common.BTCTraits()
self.assertEqual(traits.roundQuantity(0), 0)
self.assertEqual(traits.roundQuantity(1), 1)
self.assertEqual(traits.roundQuantity(1.1 + 1.1 + 1.1), 3.3)
self.assertEqual(traits.roundQuantity(1.1 + 1.1 + 1.1 - 3.3), 0)
self.assertEqual(traits.roundQuantity(0.00441376), 0.00441376)
self.assertEqual(traits.roundQuantity(0.004413764), 0.00441376)
class BacktestingTestCase(tc_common.TestCase):
def testBitcoinChartsFeed(self):
class TestStrategy(strategy.BaseStrategy):
def __init__(self, feed, brk):
strategy.BaseStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if not self.pos:
self.pos = self.enterLongLimit("BTC", 5.83, 1, True)
barFeed = btcbarfeed.CSVTradeFeed()
barFeed.addBarsFromCSV(tc_common.get_data_file_path("bitstampUSD.csv"))
brk = broker.BacktestingBroker(100, barFeed)
strat = TestStrategy(barFeed, brk)
strat.run()
self.assertEqual(strat.pos.getShares(), 1)
self.assertEqual(strat.pos.entryActive(), False)
self.assertEqual(strat.pos.isOpen(), True)
self.assertEqual(strat.pos.getEntryOrder().getAvgFillPrice(), 5.83)
def testMinTrade(self):
class TestStrategy(strategy.BaseStrategy):
def __init__(self, feed, brk):
strategy.BaseStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if not self.pos:
self.pos = self.enterLongLimit("BTC", 4.99, 1, True)
barFeed = btcbarfeed.CSVTradeFeed()
barFeed.addBarsFromCSV(tc_common.get_data_file_path("bitstampUSD.csv"))
brk = broker.BacktestingBroker(100, barFeed)
strat = TestStrategy(barFeed, brk)
with self. assertRaisesRegex(Exception, "Trade must be >= 5"):
strat.run()
class PaperTradingTestCase(tc_common.TestCase):
def testBuyWithPartialFill(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if self.pos is None:
self.pos = self.enterLongLimit("BTC", 100, 1, True)
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 101, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 0.2)
brk = broker.PaperTradingBroker(1000, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertTrue(strat.pos.isOpen())
self.assertEqual(round(strat.pos.getShares(), 3), 0.3)
self.assertEqual(len(strat.posExecutionInfo), 1)
self.assertEqual(strat.pos.getEntryOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
def testBuyAndSellWithPartialFill1(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if self.pos is None:
self.pos = self.enterLongLimit("BTC", 100, 1, True)
elif bars.getDateTime() == datetime.datetime(2000, 1, 3):
self.pos.exitLimit(101)
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 101, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 0.2)
barFeed.addTrade(datetime.datetime(2000, 1, 4), 1, 100, 0.2)
barFeed.addTrade(datetime.datetime(2000, 1, 5), 1, 101, 0.2)
brk = broker.PaperTradingBroker(1000, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertTrue(strat.pos.isOpen())
self.assertEqual(round(strat.pos.getShares(), 3), 0.1)
self.assertEqual(len(strat.posExecutionInfo), 1)
self.assertEqual(strat.pos.getEntryOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
self.assertEqual(strat.pos.getExitOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
def testBuyAndSellWithPartialFill2(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if self.pos is None:
self.pos = self.enterLongLimit("BTC", 100, 1, True)
elif bars.getDateTime() == datetime.datetime(2000, 1, 3):
self.pos.exitLimit(101)
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 101, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 0.2)
barFeed.addTrade(datetime.datetime(2000, 1, 4), 1, 100, 0.2)
barFeed.addTrade(datetime.datetime(2000, 1, 5), 1, 101, 0.2)
barFeed.addTrade(datetime.datetime(2000, 1, 6), 1, 102, 5)
brk = broker.PaperTradingBroker(1000, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertFalse(strat.pos.isOpen())
self.assertEqual(strat.pos.getShares(), 0)
self.assertEqual(len(strat.posExecutionInfo), 2)
self.assertEqual(strat.pos.getEntryOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
self.assertEqual(strat.pos.getExitOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
def testRoundingBugWithTrades(self):
# Unless proper rounding is in place 0.01 - 0.00441376 - 0.00445547 - 0.00113077 == 6.50521303491e-19
# instead of 0.
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.pos = None
def onBars(self, bars):
if self.pos is None:
self.pos = self.enterLongLimit("BTC", 1000, 0.01, True)
elif self.pos.entryFilled() and not self.pos.getExitOrder():
self.pos.exitLimit(1000, True)
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 1000, 1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 1000, 0.01)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 1000, 0.00441376)
barFeed.addTrade(datetime.datetime(2000, 1, 4), 1, 1000, 0.00445547)
barFeed.addTrade(datetime.datetime(2000, 1, 5), 1, 1000, 0.00113077)
brk = broker.PaperTradingBroker(1000, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(brk.getShares("BTC"), 0)
self.assertEqual(strat.pos.getEntryOrder().getAvgFillPrice(), 1000)
self.assertEqual(strat.pos.getExitOrder().getAvgFillPrice(), 1000)
self.assertEqual(strat.pos.getEntryOrder().getFilled(), 0.01)
self.assertEqual(strat.pos.getExitOrder().getFilled(), 0.01)
self.assertEqual(strat.pos.getEntryOrder().getRemaining(), 0)
self.assertEqual(strat.pos.getExitOrder().getRemaining(), 0)
self.assertEqual(strat.pos.getEntryOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
self.assertEqual(strat.pos.getExitOrder().getSubmitDateTime().date(), wsclient.get_current_datetime().date())
self.assertFalse(strat.pos.isOpen())
self.assertEqual(len(strat.posExecutionInfo), 2)
self.assertEqual(strat.pos.getShares(), 0.0)
def testInvalidOrders(self):
barFeed = TestingLiveTradeFeed()
brk = broker.PaperTradingBroker(1000, barFeed)
with self.assertRaises(Exception):
brk.createLimitOrder(basebroker.Order.Action.BUY, "none", 1, 1)
with self.assertRaises(Exception):
brk.createLimitOrder(basebroker.Order.Action.SELL_SHORT, "none", 1, 1)
with self.assertRaises(Exception):
brk.createMarketOrder(basebroker.Order.Action.BUY, "none", 1)
with self.assertRaises(Exception):
brk.createStopOrder(basebroker.Order.Action.BUY, "none", 1, 1)
with self.assertRaises(Exception):
brk.createStopLimitOrder(basebroker.Order.Action.BUY, "none", 1, 1, 1)
def testBuyWithoutCash(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.errors = 0
def onBars(self, bars):
try:
self.limitOrder("BTC", 10, 1)
except Exception:
self.errors += 1
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 0.1)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 101, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 0.2)
brk = broker.PaperTradingBroker(0, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(strat.errors, 4)
self.assertEqual(brk.getShares("BTC"), 0)
self.assertEqual(brk.getCash(), 0)
def testRanOutOfCash(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.errors = 0
def onBars(self, bars):
try:
self.limitOrder("BTC", 100, 0.1)
except Exception:
self.errors += 1
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 10)
brk = broker.PaperTradingBroker(10.025, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(strat.errors, 2)
self.assertEqual(brk.getShares("BTC"), 0.1)
self.assertEqual(brk.getCash(), 0)
def testSellWithoutBTC(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.errors = 0
def onBars(self, bars):
try:
self.limitOrder("BTC", 100, -0.1)
except Exception:
self.errors += 1
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 10)
brk = broker.PaperTradingBroker(0, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(strat.errors, 2)
self.assertEqual(brk.getShares("BTC"), 0)
self.assertEqual(brk.getCash(), 0)
def testRanOutOfCoins(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.errors = 0
self.bought = False
def onBars(self, bars):
if not self.bought:
self.limitOrder("BTC", 100, 0.1)
self.bought = True
else:
try:
self.limitOrder("BTC", 100, -0.1)
except Exception:
self.errors += 1
barFeed = TestingLiveTradeFeed()
barFeed.addTrade(datetime.datetime(2000, 1, 1), 1, 100, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 2), 1, 100, 10)
barFeed.addTrade(datetime.datetime(2000, 1, 3), 1, 100, 10)
brk = broker.PaperTradingBroker(10.05, barFeed)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(strat.errors, 1)
self.assertEqual(brk.getShares("BTC"), 0)
self.assertEqual(brk.getCash(), 10)
class LiveTradingTestCase(tc_common.TestCase):
def testMapUserTransactionsToOrderEvents(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
def onBars(self, bars):
self.stop()
barFeed = TestingLiveTradeFeed()
# This is to hit onBars and stop strategy execution.
barFeed.addTrade(datetime.datetime.now(), 1, 100, 1)
brk = TestingLiveBroker(None, None, None)
httpClient = brk.getHTTPClient()
httpClient.setUSDAvailable(0)
httpClient.setBTCAvailable(0.1)
httpClient.addOpenOrder(1, -0.1, 578.79)
httpClient.addOpenOrder(2, 0.1, 567.21)
httpClient.addUserTransaction(1, -0.04557395, 26.38, 578.79, 0.14)
httpClient.addUserTransaction(2, 0.04601436, -26.10, 567.21, 0.14)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(len(strat.orderExecutionInfo), 2)
self.assertEqual(strat.orderExecutionInfo[0].getPrice(), 578.79)
self.assertEqual(strat.orderExecutionInfo[0].getQuantity(), 0.04557395)
self.assertEqual(strat.orderExecutionInfo[0].getCommission(), 0.14)
self.assertEqual(strat.orderExecutionInfo[0].getDateTime().date(), datetime.datetime.now().date())
self.assertEqual(strat.orderExecutionInfo[1].getPrice(), 567.21)
self.assertEqual(strat.orderExecutionInfo[1].getQuantity(), 0.04601436)
self.assertEqual(strat.orderExecutionInfo[1].getCommission(), 0.14)
self.assertEqual(strat.orderExecutionInfo[1].getDateTime().date(), datetime.datetime.now().date())
def testCancelOrder(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
def onBars(self, bars):
order = self.getBroker().getActiveOrders()[0]
self.getBroker().cancelOrder(order)
self.stop()
barFeed = TestingLiveTradeFeed()
# This is to hit onBars and stop strategy execution.
barFeed.addTrade(datetime.datetime.now(), 1, 100, 1)
brk = TestingLiveBroker(None, None, None)
httpClient = brk.getHTTPClient()
httpClient.setUSDAvailable(0)
httpClient.setBTCAvailable(0)
httpClient.addOpenOrder(1, 0.1, 578.79)
strat = Strategy(barFeed, brk)
strat.run()
self.assertEqual(brk.getShares("BTC"), 0)
self.assertEqual(brk.getCash(), 0)
self.assertEqual(len(strat.orderExecutionInfo), 1)
self.assertEqual(strat.orderExecutionInfo[0], None)
self.assertEqual(len(strat.ordersUpdated), 1)
self.assertTrue(strat.ordersUpdated[0].isCanceled())
def testBuyAndSell(self):
class Strategy(TestStrategy):
def __init__(self, feed, brk):
TestStrategy.__init__(self, feed, brk)
self.buyOrder = None
self.sellOrder = None
def onOrderUpdated(self, order):
TestStrategy.onOrderUpdated(self, order)
if order == self.buyOrder and order.isPartiallyFilled():
if self.sellOrder is None:
self.sellOrder = self.limitOrder(common.btc_symbol, 10, -0.5)
brk.getHTTPClient().addUserTransaction(self.sellOrder.getId(), -0.5, 5, 10, 0.01)
elif order == self.sellOrder and order.isFilled():
self.stop()
def onBars(self, bars):
if self.buyOrder is None:
self.buyOrder = self.limitOrder(common.btc_symbol, 10, 1)
brk.getHTTPClient().addUserTransaction(self.buyOrder.getId(), 0.5, -5, 10, 0.01)
barFeed = TestingLiveTradeFeed()
# This is to get onBars called once.
barFeed.addTrade(datetime.datetime.now(), 1, 100, 1)
brk = TestingLiveBroker(None, None, None)
httpClient = brk.getHTTPClient()
httpClient.setUSDAvailable(10)
httpClient.setBTCAvailable(0)
strat = Strategy(barFeed, brk)
strat.run()
self.assertTrue(strat.buyOrder.isPartiallyFilled())
self.assertTrue(strat.sellOrder.isFilled())
# 2 events for each order: 1 for accepted, 1 for fill.
self.assertEqual(len(strat.orderExecutionInfo), 4)
self.assertEqual(strat.orderExecutionInfo[0], None)
self.assertEqual(strat.orderExecutionInfo[1].getPrice(), 10)
self.assertEqual(strat.orderExecutionInfo[1].getQuantity(), 0.5)
self.assertEqual(strat.orderExecutionInfo[1].getCommission(), 0.01)
self.assertEqual(strat.orderExecutionInfo[1].getDateTime().date(), datetime.datetime.now().date())
self.assertEqual(strat.orderExecutionInfo[2], None)
self.assertEqual(strat.orderExecutionInfo[3].getPrice(), 10)
self.assertEqual(strat.orderExecutionInfo[3].getQuantity(), 0.5)
self.assertEqual(strat.orderExecutionInfo[3].getCommission(), 0.01)
self.assertEqual(strat.orderExecutionInfo[3].getDateTime().date(), datetime.datetime.now().date())
class WebSocketTestCase(tc_common.TestCase):
def testBarFeed(self):
events = {
"on_bars": False,
"on_order_book_updated": False,
"break": False,
"start": datetime.datetime.now()
}
disp = dispatcher.Dispatcher()
barFeed = barfeed.LiveTradeFeed()
disp.addSubject(barFeed)
def on_bars(dateTime, bars):
bars[common.btc_symbol]
events["on_bars"] = True
if events["on_order_book_updated"] is True:
disp.stop()
def on_order_book_updated(orderBookUpdate):
events["on_order_book_updated"] = True
if events["on_bars"] is True:
disp.stop()
def on_idle():
# Stop after 5 minutes.
if (datetime.datetime.now() - events["start"]).seconds > 60*5:
disp.stop()
# Subscribe to events.
barFeed.getNewValuesEvent().subscribe(on_bars)
barFeed.getOrderBookUpdateEvent().subscribe(on_order_book_updated)
disp.getIdleEvent().subscribe(on_idle)
disp.run()
# Check that we received both events.
self.assertTrue(events["on_bars"])
self.assertTrue(events["on_order_book_updated"])
| 38.383704 | 118 | 0.620788 |
aceb3f3475da710f215059df1303ada3782cf120 | 864 | py | Python | ExampleScript_RadiatorPerformance.py | DrTol/radiator_performance-Python | e9e8244ed1ba23f7fb9b6e87fc4e4b6d6f55cc5b | [
"MIT"
] | null | null | null | ExampleScript_RadiatorPerformance.py | DrTol/radiator_performance-Python | e9e8244ed1ba23f7fb9b6e87fc4e4b6d6f55cc5b | [
"MIT"
] | null | null | null | ExampleScript_RadiatorPerformance.py | DrTol/radiator_performance-Python | e9e8244ed1ba23f7fb9b6e87fc4e4b6d6f55cc5b | [
"MIT"
] | 1 | 2020-09-30T18:51:57.000Z | 2020-09-30T18:51:57.000Z | # Example Script - calculates Radiator Return Temperature
# prepared by Hakan İbrahim Tol, PhD
# INPUTS
q=0.5 # [kW] Actual heat demand rate
Ts=90 # [°C] Actual radiator supply temperature
Ti=20 # [°C] Actual indoor (set) temperature
q_o=1 # [kW] Desing (peak) heat demand rate
Ts_o=90 # [°C] Design radiator supply temperature
Tr_o=70 # [°C] Design radiator return temperature
Ti_o=20 # [°C] Design indoor (set) temperature
n=1.3 # [-] Emprical radiator constant
import ReturnTemperature as Tr
Tr_AMTD=Tr.Tr_AMTD(q,Ts,Ti,q_o,Ts_o,Tr_o,Ti_o,n)
Tr_GMTD=Tr.Tr_GMTD(q,Ts,Ti,q_o,Ts_o,Tr_o,Ti_o,n)
Tr_LMTD=Tr.Tr_LMTD(q,Ts,Ti,q_o,Ts_o,Tr_o,Ti_o,n)
# Print to Screen as Table
table={'Tr via AMTD': Tr_AMTD, 'Tr via GMTD': Tr_GMTD, 'Tr via LMTD': Tr_LMTD}
for name, value in table.items():
print(f'{name:10} ==> {value:10f}')
| 34.56 | 79 | 0.688657 |
aceb3fc5c713cdca22ebb2e19e9018dc74d9ce27 | 230 | py | Python | Scripts/qtimageconvert.py | Psiphonc/EasierLife | ad9143a6362d70489ef4b36651ce58a3cc1d0fa3 | [
"MIT"
] | 203 | 2016-04-02T07:43:47.000Z | 2022-01-05T11:41:03.000Z | Scripts/qtimageconvert.py | Psiphonc/EasierLife | ad9143a6362d70489ef4b36651ce58a3cc1d0fa3 | [
"MIT"
] | 4 | 2016-05-13T11:20:09.000Z | 2018-09-23T01:12:07.000Z | Scripts/qtimageconvert.py | Psiphonc/EasierLife | ad9143a6362d70489ef4b36651ce58a3cc1d0fa3 | [
"MIT"
] | 169 | 2016-04-26T03:20:04.000Z | 2022-03-09T18:36:19.000Z | import os
from PyQt4.QtGui import QImage
for file in os.walk('.').next()[2]:
if not file.endswith('.png'): continue
i = QImage()
i.load(file)
i.save(file)
print('%s is successfully converted' % file)
| 23 | 49 | 0.608696 |
aceb4267e1733156ed5dd28f078674807b5c492d | 9,119 | py | Python | airflow/utils/dates.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/utils/dates.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/utils/dates.py | KarthikKothareddy/AirFlow | faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-14T09:45:54.000Z | 2020-07-14T09:45:54.000Z | # -*- coding: utf-8 -*-
#
# 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 __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from airflow.utils import timezone
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta # for doctest
import six
from croniter import croniter
cron_presets = {
'@hourly': '0 * * * *',
'@daily': '0 0 * * *',
'@weekly': '0 0 * * 0',
'@monthly': '0 0 1 * *',
'@yearly': '0 0 1 1 *',
}
def date_range(
start_date,
end_date=None,
num=None,
delta=None):
"""
Get a set of dates as a list based on a start, end and delta, delta
can be something that can be added to ``datetime.datetime``
or a cron expression as a ``str``
:param start_date: anchor date to start the series from
:type start_date: datetime.datetime
:param end_date: right boundary for the date range
:type end_date: datetime.datetime
:param num: alternatively to end_date, you can specify the number of
number of entries you want in the range. This number can be negative,
output will always be sorted regardless
:type num: int
>>> date_range(datetime(2016, 1, 1), datetime(2016, 1, 3), delta=timedelta(1))
[datetime.datetime(2016, 1, 1, 0, 0), datetime.datetime(2016, 1, 2, 0, 0), datetime.datetime(2016, 1, 3, 0, 0)]
>>> date_range(datetime(2016, 1, 1), datetime(2016, 1, 3), delta='0 0 * * *')
[datetime.datetime(2016, 1, 1, 0, 0), datetime.datetime(2016, 1, 2, 0, 0), datetime.datetime(2016, 1, 3, 0, 0)]
>>> date_range(datetime(2016, 1, 1), datetime(2016, 3, 3), delta="0 0 0 * *")
[datetime.datetime(2016, 1, 1, 0, 0), datetime.datetime(2016, 2, 1, 0, 0), datetime.datetime(2016, 3, 1, 0, 0)]
"""
if not delta:
return []
if end_date and start_date > end_date:
raise Exception("Wait. start_date needs to be before end_date")
if end_date and num:
raise Exception("Wait. Either specify end_date OR num")
if not end_date and not num:
end_date = timezone.utcnow()
delta_iscron = False
if isinstance(delta, six.string_types):
delta_iscron = True
tz = start_date.tzinfo
start_date = timezone.make_naive(start_date, tz)
cron = croniter(delta, start_date)
elif isinstance(delta, timedelta):
delta = abs(delta)
l = []
if end_date:
while start_date <= end_date:
if timezone.is_naive(start_date):
l.append(timezone.make_aware(start_date, tz))
else:
l.append(start_date)
if delta_iscron:
start_date = cron.get_next(datetime)
else:
start_date += delta
else:
for _ in range(abs(num)):
if timezone.is_naive(start_date):
l.append(timezone.make_aware(start_date, tz))
else:
l.append(start_date)
if delta_iscron:
if num > 0:
start_date = cron.get_next(datetime)
else:
start_date = cron.get_prev(datetime)
else:
if num > 0:
start_date += delta
else:
start_date -= delta
return sorted(l)
def round_time(dt, delta, start_date=timezone.make_aware(datetime.min)):
"""
Returns the datetime of the form start_date + i * delta
which is closest to dt for any non-negative integer i.
Note that delta may be a datetime.timedelta or a dateutil.relativedelta
>>> round_time(datetime(2015, 1, 1, 6), timedelta(days=1))
datetime.datetime(2015, 1, 1, 0, 0)
>>> round_time(datetime(2015, 1, 2), relativedelta(months=1))
datetime.datetime(2015, 1, 1, 0, 0)
>>> round_time(datetime(2015, 9, 16, 0, 0), timedelta(1), datetime(2015, 9, 14, 0, 0))
datetime.datetime(2015, 9, 16, 0, 0)
>>> round_time(datetime(2015, 9, 15, 0, 0), timedelta(1), datetime(2015, 9, 14, 0, 0))
datetime.datetime(2015, 9, 15, 0, 0)
>>> round_time(datetime(2015, 9, 14, 0, 0), timedelta(1), datetime(2015, 9, 14, 0, 0))
datetime.datetime(2015, 9, 14, 0, 0)
>>> round_time(datetime(2015, 9, 13, 0, 0), timedelta(1), datetime(2015, 9, 14, 0, 0))
datetime.datetime(2015, 9, 14, 0, 0)
"""
if isinstance(delta, six.string_types):
# It's cron based, so it's easy
tz = start_date.tzinfo
start_date = timezone.make_naive(start_date, tz)
cron = croniter(delta, start_date)
prev = cron.get_prev(datetime)
if prev == start_date:
return timezone.make_aware(start_date, tz)
else:
return timezone.make_aware(prev, tz)
# Ignore the microseconds of dt
dt -= timedelta(microseconds=dt.microsecond)
# We are looking for a datetime in the form start_date + i * delta
# which is as close as possible to dt. Since delta could be a relative
# delta we don't know its exact length in seconds so we cannot rely on
# division to find i. Instead we employ a binary search algorithm, first
# finding an upper and lower limit and then disecting the interval until
# we have found the closest match.
# We first search an upper limit for i for which start_date + upper * delta
# exceeds dt.
upper = 1
while start_date + upper*delta < dt:
# To speed up finding an upper limit we grow this exponentially by a
# factor of 2
upper *= 2
# Since upper is the first value for which start_date + upper * delta
# exceeds dt, upper // 2 is below dt and therefore forms a lower limited
# for the i we are looking for
lower = upper // 2
# We now continue to intersect the interval between
# start_date + lower * delta and start_date + upper * delta
# until we find the closest value
while True:
# Invariant: start + lower * delta < dt <= start + upper * delta
# If start_date + (lower + 1)*delta exceeds dt, then either lower or
# lower+1 has to be the solution we are searching for
if start_date + (lower + 1)*delta >= dt:
# Check if start_date + (lower + 1)*delta or
# start_date + lower*delta is closer to dt and return the solution
if (
(start_date + (lower + 1) * delta) - dt <=
dt - (start_date + lower * delta)):
return start_date + (lower + 1)*delta
else:
return start_date + lower * delta
# We intersect the interval and either replace the lower or upper
# limit with the candidate
candidate = lower + (upper - lower) // 2
if start_date + candidate*delta >= dt:
upper = candidate
else:
lower = candidate
# in the special case when start_date > dt the search for upper will
# immediately stop for upper == 1 which results in lower = upper // 2 = 0
# and this function returns start_date.
def infer_time_unit(time_seconds_arr):
"""
Determine the most appropriate time unit for an array of time durations
specified in seconds.
e.g. 5400 seconds => 'minutes', 36000 seconds => 'hours'
"""
if len(time_seconds_arr) == 0:
return 'hours'
max_time_seconds = max(time_seconds_arr)
if max_time_seconds <= 60*2:
return 'seconds'
elif max_time_seconds <= 60*60*2:
return 'minutes'
elif max_time_seconds <= 24*60*60*2:
return 'hours'
else:
return 'days'
def scale_time_units(time_seconds_arr, unit):
"""
Convert an array of time durations in seconds to the specified time unit.
"""
if unit == 'minutes':
return list(map(lambda x: x*1.0/60, time_seconds_arr))
elif unit == 'hours':
return list(map(lambda x: x*1.0/(60*60), time_seconds_arr))
elif unit == 'days':
return list(map(lambda x: x*1.0/(24*60*60), time_seconds_arr))
return time_seconds_arr
def days_ago(n, hour=0, minute=0, second=0, microsecond=0):
"""
Get a datetime object representing `n` days ago. By default the time is
set to midnight.
"""
today = timezone.utcnow().replace(
hour=hour,
minute=minute,
second=second,
microsecond=microsecond)
return today - timedelta(days=n)
def parse_execution_date(execution_date_str):
"""
Parse execution date string to datetime object.
"""
return timezone.parse(execution_date_str)
| 36.770161 | 115 | 0.625946 |
aceb44647f27845f759bda40dadcb21f06483a80 | 10,185 | py | Python | userbot/modules/afk.py | syamsulmaarif013/RE-USER | 8682a7116dbdc3c13a5d68e4655b3753d6c91121 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/afk.py | syamsulmaarif013/RE-USER | 8682a7116dbdc3c13a5d68e4655b3753d6c91121 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/afk.py | syamsulmaarif013/RE-USER | 8682a7116dbdc3c13a5d68e4655b3753d6c91121 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | """ Userbot module which contains afk-related commands """
from datetime import datetime
import time
from random import choice, randint
from telethon.events import StopPropagation
from telethon.tl.functions.account import UpdateProfileRequest
from userbot import ( # noqa pylint: disable=unused-import isort:skip
AFKREASON,
BOTLOG,
BOTLOG_CHATID,
CMD_HANDLER,
CMD_HELP,
COUNT_MSG,
ISAFK,
PM_AUTO_BAN,
USERS,
PM_AUTO_BAN,
bot,
ALIVE_NAME,
)
from userbot.events import register
# ========================= CONSTANTS ============================
AFKSTR = [
"`۩🄰🄵🄺! \n ۩ʟᴀɢɪ sɪʙᴜᴋ ᴅᴜʟᴜ ʙʀᴏ...!`",
"`۩🄰🄵🄺! \n ۩ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ! ᴀᴘᴀʟᴀɢɪ ɢᴀɴɢɢᴜ!",
"`۩🄰🄵🄺! \n ۩ʟᴀɢɪ ᴏғғ! \nᴊᴀɴɢᴀɴ ᴋᴀɴɢᴇɴ ᴅᴜʟᴜ!!!`",
"`۩🄰🄵🄺! \n ۩ʟᴀɢɪ sɪʙᴜᴋ! \nᴅɪʟᴀʀᴀɴɢ ᴜɴᴛᴜᴋ ʀɪɴᴅᴜ!!`",
]
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global afk_start
global afk_end
USER_AFK = {}
afk_time = None
afk_start = {}
# =================================================================
@register(outgoing=True, pattern="^.afk(?: |$)(.*)", disable_errors=True)
async def set_afk(afk_e):
""" For .afk command, allows you to inform people that you are afk when they message you """
message = afk_e.text # pylint:disable=E0602
string = afk_e.pattern_match.group(1)
global ISAFK
global AFKREASON
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global afk_start
global afk_end
user = await bot.get_me() # pylint:disable=E0602
global reason
USER_AFK = {}
afk_time = None
afk_end = {}
start_1 = datetime.now()
afk_start = start_1.replace(microsecond=0)
if string:
AFKREASON = string
await afk_e.edit(f"**۩ {ALIVE_NAME} sᴇᴅᴀɴɢ ᴀғᴋ!!** \n۩ ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ ᴅᴜʟᴜᴜᴜ...\
\n۩ᴀʟᴀsᴀɴ: `{string}`")
else:
await afk_e.edit(f"**۩ {ALIVE_NAME} sᴇᴅᴀɴɢ ᴀғᴋ!!** \n۩ ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ ᴅᴜʟᴜᴜᴜ!")
if user.last_name:
await afk_e.client(UpdateProfileRequest(first_name=user.first_name, last_name=user.last_name + "【ʙᴜꜱʏ】"))
else:
await afk_e.client(UpdateProfileRequest(first_name=user.first_name, last_name="【ʙᴜꜱʏ】"))
if BOTLOG:
await afk_e.client.send_message(BOTLOG_CHATID, "#AFK\nᴀғᴋ! ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ ᴅᴜʟᴜᴜᴜ...")
ISAFK = True
afk_time = datetime.now() # pylint:disable=E0602
raise StopPropagation
@register(outgoing=True)
async def type_afk_is_not_true(notafk):
""" This sets your status as not afk automatically when you write something while being afk """
global ISAFK
global COUNT_MSG
global USERS
global AFKREASON
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global afk_start
global afk_end
user = await bot.get_me() # pylint:disable=E0602
last = user.last_name
if last and last.endswith(" [ SIBUK ]"):
last1 = last[:-12]
else:
last1 = ""
back_alive = datetime.now()
afk_end = back_alive.replace(microsecond=0)
if ISAFK:
ISAFK = False
msg = await notafk.respond(f"**🄾🄺🄴, {ALIVE_NAME} 🅄🄳🄰 🄱🄰🄻🄴🄺 🄻🄰🄷 🄿🄰🄽🅃🄴🄺!**")
time.sleep(3)
await msg.delete()
await notafk.client(UpdateProfileRequest(first_name=user.first_name, last_name=last1))
if BOTLOG:
await notafk.client.send_message(
BOTLOG_CHATID,
"You've recieved " + str(COUNT_MSG) + " messages from " +
str(len(USERS)) + " chats while you were away",
)
for i in USERS:
name = await notafk.client.get_entity(i)
name0 = str(name.first_name)
await notafk.client.send_message(
BOTLOG_CHATID,
"[" + name0 + "](tg://user?id=" + str(i) + ")" +
" sent you " + "`" + str(USERS[i]) + " messages`",
)
COUNT_MSG = 0
USERS = {}
AFKREASON = None
@register(incoming=True, disable_edited=True)
async def mention_afk(mention):
""" This function takes care of notifying the people who mention you that you are AFK."""
global COUNT_MSG
global USERS
global ISAFK
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global afk_start
global afk_end
user = await bot.get_me() # pylint:disable=E0602
back_alivee = datetime.now()
afk_end = back_alivee.replace(microsecond=0)
afk_since = "**Terakhir Aktif**"
if mention.message.mentioned and not (await mention.get_sender()).bot:
if ISAFK:
now = datetime.now()
datime_since_afk = now - afk_time # pylint:disable=E0602
time = float(datime_since_afk.seconds)
days = time // (24 * 3600)
time = time % (24 * 3600)
hours = time // 3600
time %= 3600
minutes = time // 60
time %= 60
seconds = time
if days == 1:
afk_since = "**Yesterday**"
elif days > 1:
if days > 6:
date = now + \
datetime.timedelta(
days=-days, hours=-hours, minutes=-minutes)
afk_since = date.strftime("%A, %Y %B %m, %H:%I")
else:
wday = now + datetime.timedelta(days=-days)
afk_since = wday.strftime('%A')
elif hours > 1:
afk_since = f"`{int(hours)}h {int(minutes)}m`"
elif minutes > 0:
afk_since = f"`{int(minutes)}m {int(seconds)}s`"
else:
afk_since = f"`{int(seconds)}s`"
if mention.sender_id not in USERS:
if AFKREASON:
await mention.reply(f"⛣ ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ! \n⛣ {ALIVE_NAME} ʟᴀɢɪ ᴀғᴋ {afk_since} ʏᴀɴɢ ʟᴀʟᴜ.\
\n⛣ ᴀʟᴀsᴀɴ: `{AFKREASON}`")
else:
await mention.reply(str(choice(AFKSTR)))
USERS.update({mention.sender_id: 1})
COUNT_MSG = COUNT_MSG + 1
elif mention.sender_id in USERS:
if USERS[mention.sender_id] % randint(2, 4) == 0:
if AFKREASON:
await mention.reply(f"↪ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ! \n⛣ {ALIVE_NAME} ʟᴀɢɪ ᴀғᴋ {afk_since} ʏᴀɴɢ ʟᴀʟᴜ.\
\n⛣ ᴀʟᴀsᴀɴ: `{AFKREASON}`")
else:
await mention.reply(str(choice(AFKSTR)))
USERS[mention.sender_id] = USERS[mention.sender_id] + 1
COUNT_MSG = COUNT_MSG + 1
else:
USERS[mention.sender_id] = USERS[mention.sender_id] + 1
COUNT_MSG = COUNT_MSG + 1
@register(incoming=True, disable_errors=True)
async def afk_on_pm(sender):
""" Function which informs people that you are AFK in PM """
global ISAFK
global USERS
global COUNT_MSG
global COUNT_MSG
global USERS
global ISAFK
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global afk_start
global afk_end
user = await bot.get_me() # pylint:disable=E0602
back_alivee = datetime.now()
afk_end = back_alivee.replace(microsecond=0)
afk_since = "**a while ago**"
if sender.is_private and sender.sender_id != 777000 and not (
await sender.get_sender()).bot:
if PM_AUTO_BAN:
try:
from userbot.modules.sql_helper.pm_permit_sql import is_approved
apprv = is_approved(sender.sender_id)
except AttributeError:
apprv = True
else:
apprv = True
if apprv and ISAFK:
now = datetime.now()
datime_since_afk = now - afk_time # pylint:disable=E0602
time = float(datime_since_afk.seconds)
days = time // (24 * 3600)
time = time % (24 * 3600)
hours = time // 3600
time %= 3600
minutes = time // 60
time %= 60
seconds = time
if days == 1:
afk_since = "**yesterday**"
elif days > 1:
if days > 6:
date = now + \
datetime.timedelta(
days=-days, hours=-hours, minutes=-minutes)
afk_since = date.strftime("%A, %Y %B %m, %H:%I")
else:
wday = now + datetime.timedelta(days=-days)
afk_since = wday.strftime('%A')
elif hours > 1:
afk_since = f"`{int(hours)}h {int(minutes)}m`"
elif minutes > 0:
afk_since = f"`{int(minutes)}m {int(seconds)}s`"
else:
afk_since = f"`{int(seconds)}s`"
if sender.sender_id not in USERS:
if AFKREASON:
await sender.reply(f"⛣ ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ! \n⛣{ALIVE_NAME}ʟᴀɢɪ ᴀғᴋ {afk_since} ʏᴀɴɢ ʟᴀʟᴜ.\
\n⛣ ᴀʟᴀsᴀɴ: `{AFKREASON}`")
else:
await sender.reply(str(choice(AFKSTR)))
USERS.update({sender.sender_id: 1})
COUNT_MSG = COUNT_MSG + 1
elif apprv and sender.sender_id in USERS:
if USERS[sender.sender_id] % randint(2, 4) == 0:
if AFKREASON:
await sender.reply(f"⛣ᴊᴀɴɢᴀɴ ʀɪɴᴅᴜ! \n⛣{ALIVE_NAME}ʟᴀɢɪ ᴀғᴋ... {afk_since} ʏᴀɴɢ ʟᴀʟᴜ.\
\n⛣ ᴀʟᴀsᴀɴ: `{AFKREASON}`")
else:
await sender.reply(str(choice(AFKSTR)))
USERS[sender.sender_id] = USERS[sender.sender_id] + 1
COUNT_MSG = COUNT_MSG + 1
else:
USERS[sender.sender_id] = USERS[sender.sender_id] + 1
COUNT_MSG = COUNT_MSG + 1
CMD_HELP.update({
"afk":
"`.afk` [Optional Reason]\
\nUsage: Sets you as afk.\nReplies to anyone who tags/PM's \
you telling them that you are AFK(reason).\n\nSwitches off AFK when you type back anything, anywhere.\
"
})
| 37.307692 | 113 | 0.54649 |
aceb45889d2d70b6474e312c68484b2dd90f034e | 969 | py | Python | lawu/attributes/local_variable.py | nickelpro/Lawu | e6f7dcab4463b29937856898ac093ce1ac1e573b | [
"MIT"
] | null | null | null | lawu/attributes/local_variable.py | nickelpro/Lawu | e6f7dcab4463b29937856898ac093ce1ac1e573b | [
"MIT"
] | null | null | null | lawu/attributes/local_variable.py | nickelpro/Lawu | e6f7dcab4463b29937856898ac093ce1ac1e573b | [
"MIT"
] | null | null | null | from struct import unpack
from typing import BinaryIO
from dataclasses import dataclass
from lawu.ast import LocalVariableTable
from lawu.constants import ConstantPool, UTF8
from lawu.attribute import Attribute
@dataclass
class LocalVariableEntry:
start_pc: int
length: int
name: UTF8
descriptor: UTF8
index: int
class LocalVariableTableAttribute(Attribute):
ADDED_IN = '1.0.2'
MINIMUM_CLASS_VERSION = (45, 3)
@classmethod
def from_binary(cls, pool: ConstantPool, source: BinaryIO) -> LocalVariableTable:
entries = []
num_entries = unpack('>H', source.read(2))[0]
data = unpack(f'>{num_entries * 5}H', source.read(num_entries * 10))
for i in range(0, num_entries * 5, 5):
pc, length, name, desc, idx = data[i:i+5]
entries.append(LocalVariableEntry(
pc, length, pool[name], pool[desc], idx
))
return LocalVariableTable(entries=entries)
| 28.5 | 85 | 0.667699 |
aceb45ca7bc5be52c5b08c3aff199d577d225b62 | 7,962 | py | Python | xy_1d/i13.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | 2 | 2021-07-29T19:09:30.000Z | 2022-01-17T21:13:40.000Z | xy_1d/i13.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | null | null | null | xy_1d/i13.py | nftqcd/nthmc | 010c70e297c904219e9d8a04cc20b9c75a4b61e5 | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow.keras as tk
import nthmc
# compared to i11.py
# triple stepPerTraj
conf = nthmc.Conf(nbatch=256, nepoch=1, nstepEpoch=2048, nstepMixing=64, stepPerTraj = 30,
initDt=0.4, refreshOpt=False, checkReverse=False, nthr=4)
nthmc.setup(conf)
beta=3.5
action = nthmc.OneD(beta=beta, size=256, transform=nthmc.Ident())
loss = nthmc.LossFun(action, cCosDiff=1.0, cTopoDiff=1.0, dHmin=0.0, topoFourierN=1)
x0 = action.initState(conf.nbatch)
weights=list(map(lambda x:tf.constant(x,dtype=tf.float64),
[0.5*0.268831031592305,
beta]))
x1 = nthmc.runInfer(conf, action, loss, weights, x0, detail=False)
action = nthmc.OneD(beta=beta, size=256, transform=nthmc.TransformChain([
nthmc.OneDNeighbor(mask='even'), nthmc.OneDNeighbor(mask='odd'),
nthmc.OneDNeighbor(mask='even',distance=2), nthmc.OneDNeighbor(mask='odd',distance=2),
nthmc.OneDNeighbor(mask='even',distance=4), nthmc.OneDNeighbor(mask='odd',distance=4),
nthmc.OneDNeighbor(mask='even',distance=8), nthmc.OneDNeighbor(mask='odd',distance=8),
nthmc.OneDNeighbor(mask='even',distance=16), nthmc.OneDNeighbor(mask='odd',distance=16),
nthmc.OneDNeighbor(mask='even',distance=32), nthmc.OneDNeighbor(mask='odd',distance=32),
nthmc.OneDNeighbor(mask='even',order=2), nthmc.OneDNeighbor(mask='odd',order=2),
nthmc.OneDNeighbor(mask='even',order=2,distance=2), nthmc.OneDNeighbor(mask='odd',order=2,distance=2),
nthmc.OneDNeighbor(mask='even',order=2,distance=4), nthmc.OneDNeighbor(mask='odd',order=2,distance=4),
nthmc.OneDNeighbor(mask='even',order=2,distance=8), nthmc.OneDNeighbor(mask='odd',order=2,distance=8),
nthmc.OneDNeighbor(mask='even',order=2,distance=16), nthmc.OneDNeighbor(mask='odd',order=2,distance=16),
nthmc.OneDNeighbor(mask='even',order=2,distance=32), nthmc.OneDNeighbor(mask='odd',order=2,distance=32),
nthmc.OneDNeighbor(mask='even',order=3), nthmc.OneDNeighbor(mask='odd',order=3),
nthmc.OneDNeighbor(mask='even',order=3,distance=2), nthmc.OneDNeighbor(mask='odd',order=3,distance=2),
nthmc.OneDNeighbor(mask='even',order=3,distance=4), nthmc.OneDNeighbor(mask='odd',order=3,distance=4),
nthmc.OneDNeighbor(mask='even',order=3,distance=8), nthmc.OneDNeighbor(mask='odd',order=3,distance=8),
nthmc.OneDNeighbor(mask='even',order=3,distance=16), nthmc.OneDNeighbor(mask='odd',order=3,distance=16),
nthmc.OneDNeighbor(mask='even',order=3,distance=32), nthmc.OneDNeighbor(mask='odd',order=3,distance=32),
nthmc.OneDNeighbor(mask='even',order=4), nthmc.OneDNeighbor(mask='odd',order=4),
nthmc.OneDNeighbor(mask='even',order=4,distance=2), nthmc.OneDNeighbor(mask='odd',order=4,distance=2),
nthmc.OneDNeighbor(mask='even',order=4,distance=4), nthmc.OneDNeighbor(mask='odd',order=4,distance=4),
nthmc.OneDNeighbor(mask='even',order=4,distance=8), nthmc.OneDNeighbor(mask='odd',order=4,distance=8),
nthmc.OneDNeighbor(mask='even',order=4,distance=16), nthmc.OneDNeighbor(mask='odd',order=4,distance=16),
nthmc.OneDNeighbor(mask='even',order=4,distance=32), nthmc.OneDNeighbor(mask='odd',order=4,distance=32),
nthmc.OneDNeighbor(mask='even'), nthmc.OneDNeighbor(mask='odd'),
nthmc.OneDNeighbor(mask='even',distance=2), nthmc.OneDNeighbor(mask='odd',distance=2),
nthmc.OneDNeighbor(mask='even',distance=4), nthmc.OneDNeighbor(mask='odd',distance=4),
nthmc.OneDNeighbor(mask='even',distance=8), nthmc.OneDNeighbor(mask='odd',distance=8),
nthmc.OneDNeighbor(mask='even',distance=16), nthmc.OneDNeighbor(mask='odd',distance=16),
nthmc.OneDNeighbor(mask='even',distance=32), nthmc.OneDNeighbor(mask='odd',distance=32),
nthmc.OneDNeighbor(mask='even',order=2), nthmc.OneDNeighbor(mask='odd',order=2),
nthmc.OneDNeighbor(mask='even',order=2,distance=2), nthmc.OneDNeighbor(mask='odd',order=2,distance=2),
nthmc.OneDNeighbor(mask='even',order=2,distance=4), nthmc.OneDNeighbor(mask='odd',order=2,distance=4),
nthmc.OneDNeighbor(mask='even',order=2,distance=8), nthmc.OneDNeighbor(mask='odd',order=2,distance=8),
nthmc.OneDNeighbor(mask='even',order=2,distance=16), nthmc.OneDNeighbor(mask='odd',order=2,distance=16),
nthmc.OneDNeighbor(mask='even',order=2,distance=32), nthmc.OneDNeighbor(mask='odd',order=2,distance=32),
nthmc.OneDNeighbor(mask='even',order=3), nthmc.OneDNeighbor(mask='odd',order=3),
nthmc.OneDNeighbor(mask='even',order=3,distance=2), nthmc.OneDNeighbor(mask='odd',order=3,distance=2),
nthmc.OneDNeighbor(mask='even',order=3,distance=4), nthmc.OneDNeighbor(mask='odd',order=3,distance=4),
nthmc.OneDNeighbor(mask='even',order=3,distance=8), nthmc.OneDNeighbor(mask='odd',order=3,distance=8),
nthmc.OneDNeighbor(mask='even',order=3,distance=16), nthmc.OneDNeighbor(mask='odd',order=3,distance=16),
nthmc.OneDNeighbor(mask='even',order=3,distance=32), nthmc.OneDNeighbor(mask='odd',order=3,distance=32),
nthmc.OneDNeighbor(mask='even',order=4), nthmc.OneDNeighbor(mask='odd',order=4),
nthmc.OneDNeighbor(mask='even',order=4,distance=2), nthmc.OneDNeighbor(mask='odd',order=4,distance=2),
nthmc.OneDNeighbor(mask='even',order=4,distance=4), nthmc.OneDNeighbor(mask='odd',order=4,distance=4),
nthmc.OneDNeighbor(mask='even',order=4,distance=8), nthmc.OneDNeighbor(mask='odd',order=4,distance=8),
nthmc.OneDNeighbor(mask='even',order=4,distance=16), nthmc.OneDNeighbor(mask='odd',order=4,distance=16),
nthmc.OneDNeighbor(mask='even',order=4,distance=32), nthmc.OneDNeighbor(mask='odd',order=4,distance=32),
]))
loss = nthmc.LossFun(action, cCosDiff=1.0, cTopoDiff=1.0, dHmin=0.0, topoFourierN=1)
weights=list(map(lambda x:tf.constant(x,dtype=tf.float64),
[0.5*0.426161809940765,
-0.320109120400013,
-0.32090020243824952,
-0.031182716984891851,
-0.036169773339796464,
0.055714318919392686,
0.057602389890724234,
0.029411886986087127,
0.02048733243498738,
0.00094839455227904755,
-0.003336858749749962,
0.0042831810194401618,
0.0055589091837478805,
0.1523380013134244,
0.15163036003180105,
0.017450942775123303,
0.01366963403033924,
-0.015362176729137129,
-0.023842410298148348,
-0.0077312457934894819,
-0.0013628219442876222,
0.0011295376199805572,
-0.00091410054524127253,
-0.00059341864473508234,
0.0025111964348351304,
-0.016444424617664447,
-0.015570829270105238,
0.0019647033660882846,
0.0059393613468408137,
0.0064600167032926427,
0.004736273804986227,
0.0022333630983046664,
-0.0011657888127998832,
0.00019669260733786145,
-0.0030779286401902473,
0.002774947111944009,
-9.6433938335267359e-05,
0.0083785133367789,
0.0053008391565818914,
-0.0014080778872983919,
-0.0024396905236594682,
-0.0015531026667714104,
-0.0015796761344081557,
-0.0012537334878866919,
-0.0015042727436904697,
0.0011413533343287735,
0.00097227804515090984,
-0.00046677598847423714,
0.00063556338329312273,
-0.32071868062103076,
-0.32148180159296041,
-0.00986116406882059,
-0.017335584106134748,
0.068029369690636679,
0.066918020242658541,
0.030819349510999603,
0.023206203501044503,
0.0017779135561217525,
-0.0034133032476216588,
0.002189343578032792,
0.00656004530207795,
0.11256550758203428,
0.11055222402865708,
0.049446153758141626,
0.045658985887769253,
-0.017581715497940329,
-0.026933901536123416,
-0.011986081801134148,
-0.0048059039456269485,
0.0017878663762805563,
-0.0025517310832571327,
0.00019610673621250042,
0.003797903258295098,
-0.04866943996936729,
-0.045885640197634261,
-0.030946502446712494,
-0.025988143680184862,
0.0058739799141497131,
0.0044195418882953643,
0.0029309881330323194,
-0.0042307734485617391,
-0.000379102785780568,
-0.00042006608019470941,
-0.000890702512832992,
-0.0015533078274466545,
0.018431797429963044,
0.01296582266989706,
0.0083730807637790484,
0.0071470949531473186,
-0.0006280677552497352,
0.00086911341441850648,
-0.00011310686430592162,
0.0010197384364829679,
-0.00042664791705881658,
-0.00060594003312396886,
8.3595033525653663e-05,
-0.00070533166824918961,
beta]))
nthmc.runInfer(conf, action, loss, weights, x1, detail=False)
| 46.290698 | 106 | 0.768525 |
aceb476057f379508fb6c294ee2873e4cc791d8a | 698 | py | Python | src/server/Role.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/Role.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/Role.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | class Role():
"""The implementation of a exemplary role class.
"""
def __init__(self):
self._id = 0
self._name = ""
def get_id(self):
"""Reads out the id."""
return self._id
def set_id(self, val):
"""Sets the id."""
self._id = val
def get_name(self):
"""Reads out the name."""
return self._name
def set_name(self, txt):
"""Sets the name."""
self._name = txt
@staticmethod
def from_dict(dicti=dict()):
""""Converts a Python dict() into a Role()."""
role = Role()
role.set_id(dicti["id"])
role.set_name(dicti["name"])
return role
| 21.151515 | 54 | 0.510029 |
aceb47ff84bde2ad82fff461e504aa995490563c | 1,627 | py | Python | cmaj/ast/simplify.py | marianwieczorek/cmaj | ddeab560bce4b8a8caf813cd1597cba91b1d8342 | [
"MIT"
] | null | null | null | cmaj/ast/simplify.py | marianwieczorek/cmaj | ddeab560bce4b8a8caf813cd1597cba91b1d8342 | [
"MIT"
] | null | null | null | cmaj/ast/simplify.py | marianwieczorek/cmaj | ddeab560bce4b8a8caf813cd1597cba91b1d8342 | [
"MIT"
] | null | null | null | from cmaj.ast.node import Node
def squash(parent: Node, *keys: str) -> Node:
for key in keys:
parent = _squash(parent, key)
return parent
def _squash(parent: Node, key: str) -> Node:
new_parent = Node(parent.key, token=parent.token)
new_children = [_squash(child, key) for child in parent.children]
if not new_children or parent.key != key:
new_parent.add_children(*new_children)
return new_parent
if (new_child := new_children[0]).key == key and len(new_children) == 1:
return new_child
for new_child in new_children:
if new_child.key != key or not new_child.children:
new_parent.add_child(new_child)
else:
new_parent.add_children(*new_child.children)
return new_parent
def prune(parent: Node, *keys: str) -> Node:
new_node = Node(parent.key, token=parent.token)
gen = (prune(child, *keys) for child in parent.children if child.key not in keys)
new_node.add_children(*(child for child in gen if len(child) > 0))
return new_node
def skip(parent: Node, *keys: str) -> Node:
new_parent = squash(parent, *keys)
for key in keys:
new_parent = _skip(new_parent, key)
return new_parent
def _skip(parent: Node, key: str) -> Node:
new_parent = Node(parent.key, token=parent.token)
new_children = [_skip(child, key) for child in parent.children]
for new_child in new_children:
if new_child.key != key or not new_child.children:
new_parent.add_child(new_child)
else:
new_parent.add_children(*new_child.children)
return new_parent
| 31.901961 | 85 | 0.666872 |
aceb48b8610de0510234e308db66fa6b34844e84 | 2,884 | py | Python | src/p4p/server/cli.py | kasemir/p4p | bf7ad049327689d19222498866cd5230ede87061 | [
"BSD-3-Clause"
] | 12 | 2017-04-15T03:56:28.000Z | 2022-02-15T07:42:54.000Z | src/p4p/server/cli.py | kasemir/p4p | bf7ad049327689d19222498866cd5230ede87061 | [
"BSD-3-Clause"
] | 68 | 2017-07-18T18:50:58.000Z | 2022-02-01T23:01:03.000Z | src/p4p/server/cli.py | kasemir/p4p | bf7ad049327689d19222498866cd5230ede87061 | [
"BSD-3-Clause"
] | 23 | 2017-05-19T13:32:01.000Z | 2022-01-20T04:27:46.000Z |
from __future__ import print_function
import warnings
import os
import sys
import json
import logging
import shutil
from collections import OrderedDict
from . import Server, StaticProvider
from .thread import SharedPV
from .. import nt
from .. import set_debug
_log = logging.getLogger(__name__)
defs = {
'int': nt.NTScalar('l').wrap(0),
'uint': nt.NTScalar('L').wrap(0),
'real': nt.NTScalar('d').wrap(0),
'str': nt.NTScalar('s').wrap(''),
'aint': nt.NTScalar('al').wrap([]),
'auint': nt.NTScalar('aL').wrap([]),
'areal': nt.NTScalar('ad').wrap([]),
'astr': nt.NTScalar('as').wrap([]),
'enum': nt.NTEnum().wrap(0),
}
def getargs():
from argparse import ArgumentParser
P = ArgumentParser()
P.add_argument('-d', '--debug', action='store_const', const=logging.DEBUG, default=logging.INFO)
P.add_argument('-v', '--verbose', action='store_const', const=logging.DEBUG, default=logging.INFO)
P.add_argument('-f', '--file', help='Persistence file')
P.add_argument('pvs', metavar='name=type', nargs='+', help='PV definitions. types: %s'%(', '.join(defs.keys())))
return P.parse_args()
def buildMailbox(*args, **kws):
pv = SharedPV(*args, **kws)
@pv.put
def handler(pv, op):
pv.post(op.value())
op.done()
return pv
def main(args):
db = OrderedDict()
provider = StaticProvider('soft')
for pv in args.pvs:
name, sep, type = pv.partition('=')
if sep == '':
print("Invalid definition, missing '=' :", pv)
sys.exit(1)
pv = buildMailbox(initial=defs[type])
provider.add(name, pv)
db[name] = (type, pv)
_log.info("Add %s", name)
if args.file:
# pre-create to ensure write permission
OF = open(args.file+'.tmp', 'w')
if args.file and os.path.exists(args.file):
with open(args.file, 'r') as F:
persist = json.load(F)
if persist['version']!=1:
warnings.warn('Unknown persist version %s. Attempting to load'%persist['version'])
persist = persist['pvs']
for name, type, iv in persist:
if name not in db:
db[name] = (type, buildMailbox(initial=defs[type]))
_type, pv = db[name]
pv.post(pv.current().type()(iv))
try:
Server.forever(providers=[provider])
finally:
persist = []
for name, (type, pv) in db.items():
persist.append((name, type, pv.current().todict(None, OrderedDict)))
if args.file:
OF.write(json.dumps(OrderedDict([('version',1), ('pvs',persist)]), indent=2))
OF.flush()
OF.close()
shutil.move(args.file+'.tmp', args.file)
if __name__ == '__main__':
args = getargs()
set_debug(args.debug)
logging.basicConfig(level=args.verbose)
main(args)
| 26.953271 | 117 | 0.584951 |
aceb49cecf5543060b3404524db184682c910e6d | 49,858 | py | Python | BackEnd/venv/lib/python3.8/site-packages/setuptools/dist.py | MatheusBrodt/App_LabCarolVS | 9552149ceaa9bee15ef9a45fab2983c6651031c4 | [
"MIT"
] | null | null | null | BackEnd/venv/lib/python3.8/site-packages/setuptools/dist.py | MatheusBrodt/App_LabCarolVS | 9552149ceaa9bee15ef9a45fab2983c6651031c4 | [
"MIT"
] | null | null | null | BackEnd/venv/lib/python3.8/site-packages/setuptools/dist.py | MatheusBrodt/App_LabCarolVS | 9552149ceaa9bee15ef9a45fab2983c6651031c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = ['Distribution']
import io
import sys
import re
import os
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.util import strtobool
from distutils.debug import DEBUG
from distutils.fancy_getopt import translate_longopt
import itertools
from collections import defaultdict
from email import message_from_file
from distutils.errors import (
DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError,
)
from distutils.util import rfc822_escape
from distutils.version import StrictVersion
from setuptools.extern import six
from setuptools.extern import packaging
from setuptools.extern import ordered_set
from setuptools.extern.six.moves import map, filter, filterfalse
from . import SetuptoolsDeprecationWarning
from setuptools.depends import Require
from setuptools import windows_support
from setuptools.monkey import get_unpatched
from setuptools.config import parse_configuration
import pkg_resources
__import__('setuptools.extern.packaging.specifiers')
__import__('setuptools.extern.packaging.version')
def _get_unpatched(cls):
warnings.warn("Do not call this function", DistDeprecationWarning)
return get_unpatched(cls)
def get_metadata_version(self):
mv = getattr(self, 'metadata_version', None)
if mv is None:
if self.long_description_content_type or self.provides_extras:
mv = StrictVersion('2.1')
elif (self.maintainer is not None or
self.maintainer_email is not None or
getattr(self, 'python_requires', None) is not None or
self.project_urls):
mv = StrictVersion('1.2')
elif (self.provides or self.requires or self.obsoletes or
self.classifiers or self.download_url):
mv = StrictVersion('1.1')
else:
mv = StrictVersion('1.0')
self.metadata_version = mv
return mv
def read_pkg_file(self, file):
"""Reads the metadata values from a file object."""
msg = message_from_file(file)
def _read_field(name):
value = msg[name]
if value == 'UNKNOWN':
return None
return value
def _read_list(name):
values = msg.get_all(name, None)
if values == []:
return None
return values
self.metadata_version = StrictVersion(msg['metadata-version'])
self.name = _read_field('name')
self.version = _read_field('version')
self.description = _read_field('summary')
# we are filling author only.
self.author = _read_field('author')
self.maintainer = None
self.author_email = _read_field('author-email')
self.maintainer_email = None
self.url = _read_field('home-page')
self.license = _read_field('license')
if 'download-url' in msg:
self.download_url = _read_field('download-url')
else:
self.download_url = None
self.long_description = _read_field('description')
self.description = _read_field('summary')
if 'keywords' in msg:
self.keywords = _read_field('keywords').split(',')
self.platforms = _read_list('platform')
self.classifiers = _read_list('classifier')
# PEP 314 - these fields only exist in 1.1
if self.metadata_version == StrictVersion('1.1'):
self.requires = _read_list('requires')
self.provides = _read_list('provides')
self.obsoletes = _read_list('obsoletes')
else:
self.requires = None
self.provides = None
self.obsoletes = None
# Based on Python 3.5 version
def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
"""
version = self.get_metadata_version()
if six.PY2:
def write_field(key, value):
file.write("%s: %s\n" % (key, self._encode_field(value)))
else:
def write_field(key, value):
file.write("%s: %s\n" % (key, value))
write_field('Metadata-Version', str(version))
write_field('Name', self.get_name())
write_field('Version', self.get_version())
write_field('Summary', self.get_description())
write_field('Home-page', self.get_url())
if version < StrictVersion('1.2'):
write_field('Author', self.get_contact())
write_field('Author-email', self.get_contact_email())
else:
optional_fields = (
('Author', 'author'),
('Author-email', 'author_email'),
('Maintainer', 'maintainer'),
('Maintainer-email', 'maintainer_email'),
)
for field, attr in optional_fields:
attr_val = getattr(self, attr)
if attr_val is not None:
write_field(field, attr_val)
write_field('License', self.get_license())
if self.download_url:
write_field('Download-URL', self.download_url)
for project_url in self.project_urls.items():
write_field('Project-URL', '%s, %s' % project_url)
long_desc = rfc822_escape(self.get_long_description())
write_field('Description', long_desc)
keywords = ','.join(self.get_keywords())
if keywords:
write_field('Keywords', keywords)
if version >= StrictVersion('1.2'):
for platform in self.get_platforms():
write_field('Platform', platform)
else:
self._write_list(file, 'Platform', self.get_platforms())
self._write_list(file, 'Classifier', self.get_classifiers())
# PEP 314
self._write_list(file, 'Requires', self.get_requires())
self._write_list(file, 'Provides', self.get_provides())
self._write_list(file, 'Obsoletes', self.get_obsoletes())
# Setuptools specific for PEP 345
if hasattr(self, 'python_requires'):
write_field('Requires-Python', self.python_requires)
# PEP 566
if self.long_description_content_type:
write_field(
'Description-Content-Type',
self.long_description_content_type
)
if self.provides_extras:
for extra in sorted(self.provides_extras):
write_field('Provides-Extra', extra)
sequence = tuple, list
def check_importable(dist, attr, value):
try:
ep = pkg_resources.EntryPoint.parse('x=' + value)
assert not ep.extras
except (TypeError, ValueError, AttributeError, AssertionError):
raise DistutilsSetupError(
"%r must be importable 'module:attrs' string (got %r)"
% (attr, value)
)
def assert_string_list(dist, attr, value):
"""Verify that value is a string list"""
try:
# verify that value is a list or tuple to exclude unordered
# or single-use iterables
assert isinstance(value, (list, tuple))
# verify that elements of value are strings
assert ''.join(value) != value
except (TypeError, ValueError, AttributeError, AssertionError):
raise DistutilsSetupError(
"%r must be a list of strings (got %r)" % (attr, value)
)
def check_nsp(dist, attr, value):
"""Verify that namespace packages are valid"""
ns_packages = value
assert_string_list(dist, attr, ns_packages)
for nsp in ns_packages:
if not dist.has_contents_for(nsp):
raise DistutilsSetupError(
"Distribution contains no modules or packages for " +
"namespace package %r" % nsp
)
parent, sep, child = nsp.rpartition('.')
if parent and parent not in ns_packages:
distutils.log.warn(
"WARNING: %r is declared as a package namespace, but %r"
" is not: please correct this in setup.py", nsp, parent
)
def check_extras(dist, attr, value):
"""Verify that extras_require mapping is valid"""
try:
list(itertools.starmap(_check_extra, value.items()))
except (TypeError, ValueError, AttributeError):
raise DistutilsSetupError(
"'extras_require' must be a dictionary whose values are "
"strings or lists of strings containing valid project/version "
"requirement specifiers."
)
def _check_extra(extra, reqs):
name, sep, marker = extra.partition(':')
if marker and pkg_resources.invalid_marker(marker):
raise DistutilsSetupError("Invalid environment marker: " + marker)
list(pkg_resources.parse_requirements(reqs))
def assert_bool(dist, attr, value):
"""Verify that value is True, False, 0, or 1"""
if bool(value) != value:
tmpl = "{attr!r} must be a boolean value (got {value!r})"
raise DistutilsSetupError(tmpl.format(attr=attr, value=value))
def check_requirements(dist, attr, value):
"""Verify that install_requires is a valid requirements list"""
try:
list(pkg_resources.parse_requirements(value))
if isinstance(value, (dict, set)):
raise TypeError("Unordered types are not allowed")
except (TypeError, ValueError) as error:
tmpl = (
"{attr!r} must be a string or list of strings "
"containing valid project/version requirement specifiers; {error}"
)
raise DistutilsSetupError(tmpl.format(attr=attr, error=error))
def check_specifier(dist, attr, value):
"""Verify that value is a valid version specifier"""
try:
packaging.specifiers.SpecifierSet(value)
except packaging.specifiers.InvalidSpecifier as error:
tmpl = (
"{attr!r} must be a string "
"containing valid version specifiers; {error}"
)
raise DistutilsSetupError(tmpl.format(attr=attr, error=error))
def check_entry_points(dist, attr, value):
"""Verify that entry_points map is parseable"""
try:
pkg_resources.EntryPoint.parse_map(value)
except ValueError as e:
raise DistutilsSetupError(e)
def check_test_suite(dist, attr, value):
if not isinstance(value, six.string_types):
raise DistutilsSetupError("test_suite must be a string")
def check_package_data(dist, attr, value):
"""Verify that value is a dictionary of package names to glob lists"""
if not isinstance(value, dict):
raise DistutilsSetupError(
"{!r} must be a dictionary mapping package names to lists of "
"string wildcard patterns".format(attr))
for k, v in value.items():
if not isinstance(k, six.string_types):
raise DistutilsSetupError(
"keys of {!r} dict must be strings (got {!r})"
.format(attr, k)
)
assert_string_list(dist, 'values of {!r} dict'.format(attr), v)
def check_packages(dist, attr, value):
for pkgname in value:
if not re.match(r'\w+(\.\w+)*', pkgname):
distutils.log.warn(
"WARNING: %r not a valid package name; please use only "
".-separated package names in setup.py", pkgname
)
_Distribution = get_unpatched(distutils.core.Distribution)
class Distribution(_Distribution):
"""Distribution with support for features, tests, and package data
This is an enhanced version of 'distutils.dist.Distribution' that
effectively adds the following new optional keyword arguments to 'setup()':
'install_requires' -- a string or sequence of strings specifying project
versions that the distribution requires when installed, in the format
used by 'pkg_resources.require()'. They will be installed
automatically when the package is installed. If you wish to use
packages that are not available in PyPI, or want to give your users an
alternate download location, you can add a 'find_links' option to the
'[easy_install]' section of your project's 'setup.cfg' file, and then
setuptools will scan the listed web pages for links that satisfy the
requirements.
'extras_require' -- a dictionary mapping names of optional "extras" to the
additional requirement(s) that using those extras incurs. For example,
this::
extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])
indicates that the distribution can optionally provide an extra
capability called "reST", but it can only be used if docutils and
reSTedit are installed. If the user installs your package using
EasyInstall and requests one of your extras, the corresponding
additional requirements will be installed if needed.
'features' **deprecated** -- a dictionary mapping option names to
'setuptools.Feature'
objects. Features are a portion of the distribution that can be
included or excluded based on user options, inter-feature dependencies,
and availability on the current system. Excluded features are omitted
from all setup commands, including source and binary distributions, so
you can create multiple distributions from the same source tree.
Feature names should be valid Python identifiers, except that they may
contain the '-' (minus) sign. Features can be included or excluded
via the command line options '--with-X' and '--without-X', where 'X' is
the name of the feature. Whether a feature is included by default, and
whether you are allowed to control this from the command line, is
determined by the Feature object. See the 'Feature' class for more
information.
'test_suite' -- the name of a test suite to run for the 'test' command.
If the user runs 'python setup.py test', the package will be installed,
and the named test suite will be run. The format is the same as
would be used on a 'unittest.py' command line. That is, it is the
dotted name of an object to import and call to generate a test suite.
'package_data' -- a dictionary mapping package names to lists of filenames
or globs to use to find data files contained in the named packages.
If the dictionary has filenames or globs listed under '""' (the empty
string), those names will be searched for in every package, in addition
to any names for the specific package. Data files found using these
names/globs will be installed along with the package, in the same
location as the package. Note that globs are allowed to reference
the contents of non-package subdirectories, as long as you use '/' as
a path separator. (Globs are automatically converted to
platform-specific paths at runtime.)
In addition to these new keywords, this class also has several new methods
for manipulating the distribution's contents. For example, the 'include()'
and 'exclude()' methods can be thought of as in-place add and subtract
commands that add or remove packages, modules, extensions, and so on from
the distribution. They are used by the feature subsystem to configure the
distribution for the included and excluded features.
"""
_DISTUTILS_UNSUPPORTED_METADATA = {
'long_description_content_type': None,
'project_urls': dict,
'provides_extras': ordered_set.OrderedSet,
'license_files': ordered_set.OrderedSet,
}
_patched_dist = None
def patch_missing_pkg_info(self, attrs):
# Fake up a replacement for the data that would normally come from
# PKG-INFO, but which might not yet be built if this is a fresh
# checkout.
#
if not attrs or 'name' not in attrs or 'version' not in attrs:
return
key = pkg_resources.safe_name(str(attrs['name'])).lower()
dist = pkg_resources.working_set.by_key.get(key)
if dist is not None and not dist.has_metadata('PKG-INFO'):
dist._version = pkg_resources.safe_version(str(attrs['version']))
self._patched_dist = dist
def __init__(self, attrs=None):
have_package_data = hasattr(self, "package_data")
if not have_package_data:
self.package_data = {}
attrs = attrs or {}
if 'features' in attrs or 'require_features' in attrs:
Feature.warn_deprecated()
self.require_features = []
self.features = {}
self.dist_files = []
# Filter-out setuptools' specific options.
self.src_root = attrs.pop("src_root", None)
self.patch_missing_pkg_info(attrs)
self.dependency_links = attrs.pop('dependency_links', [])
self.setup_requires = attrs.pop('setup_requires', [])
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
vars(self).setdefault(ep.name, None)
_Distribution.__init__(self, {
k: v for k, v in attrs.items()
if k not in self._DISTUTILS_UNSUPPORTED_METADATA
})
# Fill-in missing metadata fields not supported by distutils.
# Note some fields may have been set by other tools (e.g. pbr)
# above; they are taken preferrentially to setup() arguments
for option, default in self._DISTUTILS_UNSUPPORTED_METADATA.items():
for source in self.metadata.__dict__, attrs:
if option in source:
value = source[option]
break
else:
value = default() if default else None
setattr(self.metadata, option, value)
if isinstance(self.metadata.version, numbers.Number):
# Some people apparently take "version number" too literally :)
self.metadata.version = str(self.metadata.version)
if self.metadata.version is not None:
try:
ver = packaging.version.Version(self.metadata.version)
normalized_version = str(ver)
if self.metadata.version != normalized_version:
warnings.warn(
"Normalizing '%s' to '%s'" % (
self.metadata.version,
normalized_version,
)
)
self.metadata.version = normalized_version
except (packaging.version.InvalidVersion, TypeError):
warnings.warn(
"The version specified (%r) is an invalid version, this "
"may not work as expected with newer versions of "
"setuptools, pip, and PyPI. Please see PEP 440 for more "
"details." % self.metadata.version
)
self._finalize_requires()
def _finalize_requires(self):
"""
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
"""
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
if getattr(self, 'extras_require', None):
for extra in self.extras_require.keys():
# Since this gets called multiple times at points where the
# keys have become 'converted' extras, ensure that we are only
# truly adding extras we haven't seen before here.
extra = extra.split(':')[0]
if extra:
self.metadata.provides_extras.add(extra)
self._convert_extras_requirements()
self._move_install_requirements_markers()
def _convert_extras_requirements(self):
"""
Convert requirements in `extras_require` of the form
`"extra": ["barbazquux; {marker}"]` to
`"extra:{marker}": ["barbazquux"]`.
"""
spec_ext_reqs = getattr(self, 'extras_require', None) or {}
self._tmp_extras_require = defaultdict(list)
for section, v in spec_ext_reqs.items():
# Do not strip empty sections.
self._tmp_extras_require[section]
for r in pkg_resources.parse_requirements(v):
suffix = self._suffix_for(r)
self._tmp_extras_require[section + suffix].append(r)
@staticmethod
def _suffix_for(req):
"""
For a requirement, return the 'extras_require' suffix for
that requirement.
"""
return ':' + str(req.marker) if req.marker else ''
def _move_install_requirements_markers(self):
"""
Move requirements in `install_requires` that are using environment
markers `extras_require`.
"""
# divide the install_requires into two sets, simple ones still
# handled by install_requires and more complex ones handled
# by extras_require.
def is_simple_req(req):
return not req.marker
spec_inst_reqs = getattr(self, 'install_requires', None) or ()
inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs))
simple_reqs = filter(is_simple_req, inst_reqs)
complex_reqs = filterfalse(is_simple_req, inst_reqs)
self.install_requires = list(map(str, simple_reqs))
for r in complex_reqs:
self._tmp_extras_require[':' + str(r.marker)].append(r)
self.extras_require = dict(
(k, [str(r) for r in map(self._clean_req, v)])
for k, v in self._tmp_extras_require.items()
)
def _clean_req(self, req):
"""
Given a Requirement, remove environment markers and return it.
"""
req.marker = None
return req
def _parse_config_files(self, filenames=None):
"""
Adapted from distutils.dist.Distribution.parse_config_files,
this method provides the same functionality in subtly-improved
ways.
"""
from setuptools.extern.six.moves.configparser import ConfigParser
# Ignore install directory options if we have a venv
if six.PY3 and sys.prefix != sys.base_prefix:
ignore_options = [
'install-base', 'install-platbase', 'install-lib',
'install-platlib', 'install-purelib', 'install-headers',
'install-scripts', 'install-data', 'prefix', 'exec-prefix',
'home', 'user', 'root']
else:
ignore_options = []
ignore_options = frozenset(ignore_options)
if filenames is None:
filenames = self.find_config_files()
if DEBUG:
self.announce("Distribution.parse_config_files():")
parser = ConfigParser()
for filename in filenames:
with io.open(filename, encoding='utf-8') as reader:
if DEBUG:
self.announce(" reading {filename}".format(**locals()))
(parser.read_file if six.PY3 else parser.readfp)(reader)
for section in parser.sections():
options = parser.options(section)
opt_dict = self.get_option_dict(section)
for opt in options:
if opt != '__name__' and opt not in ignore_options:
val = self._try_str(get(section, opt))
opt = opt.replace('-', '_')
opt_dict[opt] = (filename, val)
# Make the ConfigParser forget everything (so we retain
# the original filenames that options come from)
parser.__init__()
# If there was a "global" section in the config file, use it
# to set Distribution options.
if 'global' in self.command_options:
for (opt, (src, val)) in self.command_options['global'].items():
alias = self.negative_opt.get(opt)
try:
if alias:
setattr(self, alias, not strtobool(val))
elif opt in ('verbose', 'dry_run'): # ugh!
setattr(self, opt, strtobool(val))
else:
setattr(self, opt, val)
except ValueError as msg:
raise DistutilsOptionError(msg)
@staticmethod
def _try_str(val):
"""
On Python 2, much of distutils relies on string values being of
type 'str' (bytes) and not unicode text. If the value can be safely
encoded to bytes using the default encoding, prefer that.
Why the default encoding? Because that value can be implicitly
decoded back to text if needed.
Ref #1653
"""
if six.PY3:
return val
try:
return val.encode()
except UnicodeEncodeError:
pass
return val
def _set_command_options(self, command_obj, option_dict=None):
"""
Set the options for 'command_obj' from 'option_dict'. Basically
this means copying elements of a dictionary ('option_dict') to
attributes of an instance ('command').
'command_obj' must be a Command instance. If 'option_dict' is not
supplied, uses the standard option dictionary for this command
(from 'self.command_options').
(Adopted from distutils.dist.Distribution._set_command_options)
"""
command_name = command_obj.get_command_name()
if option_dict is None:
option_dict = self.get_option_dict(command_name)
if DEBUG:
self.announce(" setting options for '%s' command:" % command_name)
for (option, (source, value)) in option_dict.items():
if DEBUG:
self.announce(" %s = %s (from %s)" % (option, value,
source))
try:
bool_opts = [translate_longopt(o)
for o in command_obj.boolean_options]
except AttributeError:
bool_opts = []
try:
neg_opt = command_obj.negative_opt
except AttributeError:
neg_opt = {}
try:
is_string = isinstance(value, six.string_types)
if option in neg_opt and is_string:
setattr(command_obj, neg_opt[option], not strtobool(value))
elif option in bool_opts and is_string:
setattr(command_obj, option, strtobool(value))
elif hasattr(command_obj, option):
setattr(command_obj, option, value)
else:
raise DistutilsOptionError(
"error in %s: command '%s' has no such option '%s'"
% (source, command_name, option))
except ValueError as msg:
raise DistutilsOptionError(msg)
def parse_config_files(self, filenames=None, ignore_option_errors=False):
"""Parses configuration files from various levels
and loads configuration.
"""
self._parse_config_files(filenames=filenames)
parse_configuration(self, self.command_options,
ignore_option_errors=ignore_option_errors)
self._finalize_requires()
def parse_command_line(self):
"""Process features after parsing command line options"""
result = _Distribution.parse_command_line(self)
if self.features:
self._finalize_features()
return result
def _feature_attrname(self, name):
"""Convert feature name to corresponding option attribute name"""
return 'with_' + name.replace('-', '_')
def fetch_build_eggs(self, requires):
"""Resolve pre-setup requirements"""
resolved_dists = pkg_resources.working_set.resolve(
pkg_resources.parse_requirements(requires),
installer=self.fetch_build_egg,
replace_conflicting=True,
)
for dist in resolved_dists:
pkg_resources.working_set.add(dist, replace=True)
return resolved_dists
def finalize_options(self):
"""
Allow plugins to apply arbitrary operations to the
distribution. Each hook may optionally define a 'order'
to influence the order of execution. Smaller numbers
go first and the default is 0.
"""
hook_key = 'setuptools.finalize_distribution_options'
def by_order(hook):
return getattr(hook, 'order', 0)
eps = pkg_resources.iter_entry_points(hook_key)
for ep in sorted(eps, key=by_order):
ep.load()(self)
def _finalize_setup_keywords(self):
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
value = getattr(self, ep.name, None)
if value is not None:
ep.require(installer=self.fetch_build_egg)
ep.load()(self, ep.name, value)
def _finalize_2to3_doctests(self):
if getattr(self, 'convert_2to3_doctests', None):
# XXX may convert to set here when we can rely on set being builtin
self.convert_2to3_doctests = [
os.path.abspath(p)
for p in self.convert_2to3_doctests
]
else:
self.convert_2to3_doctests = []
def get_egg_cache_dir(self):
egg_cache_dir = os.path.join(os.curdir, '.eggs')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
windows_support.hide_file(egg_cache_dir)
readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
with open(readme_txt_filename, 'w') as f:
f.write('This directory contains eggs that were downloaded '
'by setuptools to build, test, and run plug-ins.\n\n')
f.write('This directory caches those eggs to prevent '
'repeated downloads.\n\n')
f.write('However, it is safe to delete this directory.\n\n')
return egg_cache_dir
def fetch_build_egg(self, req):
"""Fetch an egg needed for building"""
from setuptools.installer import fetch_build_egg
return fetch_build_egg(self, req)
def _finalize_feature_opts(self):
"""Add --with-X/--without-X options based on optional features"""
if not self.features:
return
go = []
no = self.negative_opt.copy()
for name, feature in self.features.items():
self._set_feature(name, None)
feature.validate(self)
if feature.optional:
descr = feature.description
incdef = ' (default)'
excdef = ''
if not feature.include_by_default():
excdef, incdef = incdef, excdef
new = (
('with-' + name, None, 'include ' + descr + incdef),
('without-' + name, None, 'exclude ' + descr + excdef),
)
go.extend(new)
no['without-' + name] = 'with-' + name
self.global_options = self.feature_options = go + self.global_options
self.negative_opt = self.feature_negopt = no
def _finalize_features(self):
"""Add/remove features and resolve dependencies between them"""
# First, flag all the enabled items (and thus their dependencies)
for name, feature in self.features.items():
enabled = self.feature_is_included(name)
if enabled or (enabled is None and feature.include_by_default()):
feature.include_in(self)
self._set_feature(name, 1)
# Then disable the rest, so that off-by-default features don't
# get flagged as errors when they're required by an enabled feature
for name, feature in self.features.items():
if not self.feature_is_included(name):
feature.exclude_from(self)
self._set_feature(name, 0)
def get_command_class(self, command):
"""Pluggable version of get_command_class()"""
if command in self.cmdclass:
return self.cmdclass[command]
eps = pkg_resources.iter_entry_points('distutils.commands', command)
for ep in eps:
ep.require(installer=self.fetch_build_egg)
self.cmdclass[command] = cmdclass = ep.load()
return cmdclass
else:
return _Distribution.get_command_class(self, command)
def print_commands(self):
for ep in pkg_resources.iter_entry_points('distutils.commands'):
if ep.name not in self.cmdclass:
# don't require extras as the commands won't be invoked
cmdclass = ep.resolve()
self.cmdclass[ep.name] = cmdclass
return _Distribution.print_commands(self)
def get_command_list(self):
for ep in pkg_resources.iter_entry_points('distutils.commands'):
if ep.name not in self.cmdclass:
# don't require extras as the commands won't be invoked
cmdclass = ep.resolve()
self.cmdclass[ep.name] = cmdclass
return _Distribution.get_command_list(self)
def _set_feature(self, name, status):
"""Set feature's inclusion status"""
setattr(self, self._feature_attrname(name), status)
def feature_is_included(self, name):
"""Return 1 if feature is included, 0 if excluded, 'None' if unknown"""
return getattr(self, self._feature_attrname(name))
def include_feature(self, name):
"""Request inclusion of feature named 'name'"""
if self.feature_is_included(name) == 0:
descr = self.features[name].description
raise DistutilsOptionError(
descr + " is required, but was excluded or is not available"
)
self.features[name].include_in(self)
self._set_feature(name, 1)
def include(self, **attrs):
"""Add items to distribution that are named in keyword arguments
For example, 'dist.include(py_modules=["x"])' would add 'x' to
the distribution's 'py_modules' attribute, if it was not already
there.
Currently, this method only supports inclusion for attributes that are
lists or tuples. If you need to add support for adding to other
attributes in this or a subclass, you can add an '_include_X' method,
where 'X' is the name of the attribute. The method will be called with
the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})'
will try to call 'dist._include_foo({"bar":"baz"})', which can then
handle whatever special inclusion logic is needed.
"""
for k, v in attrs.items():
include = getattr(self, '_include_' + k, None)
if include:
include(v)
else:
self._include_misc(k, v)
def exclude_package(self, package):
"""Remove packages, modules, and extensions in named package"""
pfx = package + '.'
if self.packages:
self.packages = [
p for p in self.packages
if p != package and not p.startswith(pfx)
]
if self.py_modules:
self.py_modules = [
p for p in self.py_modules
if p != package and not p.startswith(pfx)
]
if self.ext_modules:
self.ext_modules = [
p for p in self.ext_modules
if p.name != package and not p.name.startswith(pfx)
]
def has_contents_for(self, package):
"""Return true if 'exclude_package(package)' would do something"""
pfx = package + '.'
for p in self.iter_distribution_names():
if p == package or p.startswith(pfx):
return True
def _exclude_misc(self, name, value):
"""Handle 'exclude()' for list/tuple attrs without a special handler"""
if not isinstance(value, sequence):
raise DistutilsSetupError(
"%s: setting must be a list or tuple (%r)" % (name, value)
)
try:
old = getattr(self, name)
except AttributeError:
raise DistutilsSetupError(
"%s: No such distribution setting" % name
)
if old is not None and not isinstance(old, sequence):
raise DistutilsSetupError(
name + ": this setting cannot be changed via include/exclude"
)
elif old:
setattr(self, name, [item for item in old if item not in value])
def _include_misc(self, name, value):
"""Handle 'include()' for list/tuple attrs without a special handler"""
if not isinstance(value, sequence):
raise DistutilsSetupError(
"%s: setting must be a list (%r)" % (name, value)
)
try:
old = getattr(self, name)
except AttributeError:
raise DistutilsSetupError(
"%s: No such distribution setting" % name
)
if old is None:
setattr(self, name, value)
elif not isinstance(old, sequence):
raise DistutilsSetupError(
name + ": this setting cannot be changed via include/exclude"
)
else:
new = [item for item in value if item not in old]
setattr(self, name, old + new)
def exclude(self, **attrs):
"""Remove items from distribution that are named in keyword arguments
For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
the distribution's 'py_modules' attribute. Excluding packages uses
the 'exclude_package()' method, so all of the package's contained
packages, modules, and extensions are also excluded.
Currently, this method only supports exclusion from attributes that are
lists or tuples. If you need to add support for excluding from other
attributes in this or a subclass, you can add an '_exclude_X' method,
where 'X' is the name of the attribute. The method will be called with
the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})'
will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
handle whatever special exclusion logic is needed.
"""
for k, v in attrs.items():
exclude = getattr(self, '_exclude_' + k, None)
if exclude:
exclude(v)
else:
self._exclude_misc(k, v)
def _exclude_packages(self, packages):
if not isinstance(packages, sequence):
raise DistutilsSetupError(
"packages: setting must be a list or tuple (%r)" % (packages,)
)
list(map(self.exclude_package, packages))
def _parse_command_opts(self, parser, args):
# Remove --with-X/--without-X options when processing command args
self.global_options = self.__class__.global_options
self.negative_opt = self.__class__.negative_opt
# First, expand any aliases
command = args[0]
aliases = self.get_option_dict('aliases')
while command in aliases:
src, alias = aliases[command]
del aliases[command] # ensure each alias can expand only once!
import shlex
args[:1] = shlex.split(alias, True)
command = args[0]
nargs = _Distribution._parse_command_opts(self, parser, args)
# Handle commands that want to consume all remaining arguments
cmd_class = self.get_command_class(command)
if getattr(cmd_class, 'command_consumes_arguments', None):
self.get_option_dict(command)['args'] = ("command line", nargs)
if nargs is not None:
return []
return nargs
def get_cmdline_options(self):
"""Return a '{cmd: {opt:val}}' map of all command-line options
Option names are all long, but do not include the leading '--', and
contain dashes rather than underscores. If the option doesn't take
an argument (e.g. '--quiet'), the 'val' is 'None'.
Note that options provided by config files are intentionally excluded.
"""
d = {}
for cmd, opts in self.command_options.items():
for opt, (src, val) in opts.items():
if src != "command line":
continue
opt = opt.replace('_', '-')
if val == 0:
cmdobj = self.get_command_obj(cmd)
neg_opt = self.negative_opt.copy()
neg_opt.update(getattr(cmdobj, 'negative_opt', {}))
for neg, pos in neg_opt.items():
if pos == opt:
opt = neg
val = None
break
else:
raise AssertionError("Shouldn't be able to get here")
elif val == 1:
val = None
d.setdefault(cmd, {})[opt] = val
return d
def iter_distribution_names(self):
"""Yield all packages, modules, and extension names in distribution"""
for pkg in self.packages or ():
yield pkg
for module in self.py_modules or ():
yield module
for ext in self.ext_modules or ():
if isinstance(ext, tuple):
name, buildinfo = ext
else:
name = ext.name
if name.endswith('module'):
name = name[:-6]
yield name
def handle_display_options(self, option_order):
"""If there were any non-global "display-only" options
(--help-commands or the metadata display options) on the command
line, display the requested info and return true; else return
false.
"""
import sys
if six.PY2 or self.help_commands:
return _Distribution.handle_display_options(self, option_order)
# Stdout may be StringIO (e.g. in tests)
if not isinstance(sys.stdout, io.TextIOWrapper):
return _Distribution.handle_display_options(self, option_order)
# Don't wrap stdout if utf-8 is already the encoding. Provides
# workaround for #334.
if sys.stdout.encoding.lower() in ('utf-8', 'utf8'):
return _Distribution.handle_display_options(self, option_order)
# Print metadata in UTF-8 no matter the platform
encoding = sys.stdout.encoding
errors = sys.stdout.errors
newline = sys.platform != 'win32' and '\n' or None
line_buffering = sys.stdout.line_buffering
sys.stdout = io.TextIOWrapper(
sys.stdout.detach(), 'utf-8', errors, newline, line_buffering)
try:
return _Distribution.handle_display_options(self, option_order)
finally:
sys.stdout = io.TextIOWrapper(
sys.stdout.detach(), encoding, errors, newline, line_buffering)
class Feature:
"""
**deprecated** -- The `Feature` facility was never completely implemented
or supported, `has reported issues
<https://github.com/pypa/setuptools/issues/58>`_ and will be removed in
a future version.
A subset of the distribution that can be excluded if unneeded/wanted
Features are created using these keyword arguments:
'description' -- a short, human readable description of the feature, to
be used in error messages, and option help messages.
'standard' -- if true, the feature is included by default if it is
available on the current system. Otherwise, the feature is only
included if requested via a command line '--with-X' option, or if
another included feature requires it. The default setting is 'False'.
'available' -- if true, the feature is available for installation on the
current system. The default setting is 'True'.
'optional' -- if true, the feature's inclusion can be controlled from the
command line, using the '--with-X' or '--without-X' options. If
false, the feature's inclusion status is determined automatically,
based on 'availabile', 'standard', and whether any other feature
requires it. The default setting is 'True'.
'require_features' -- a string or sequence of strings naming features
that should also be included if this feature is included. Defaults to
empty list. May also contain 'Require' objects that should be
added/removed from the distribution.
'remove' -- a string or list of strings naming packages to be removed
from the distribution if this feature is *not* included. If the
feature *is* included, this argument is ignored. This argument exists
to support removing features that "crosscut" a distribution, such as
defining a 'tests' feature that removes all the 'tests' subpackages
provided by other features. The default for this argument is an empty
list. (Note: the named package(s) or modules must exist in the base
distribution when the 'setup()' function is initially called.)
other keywords -- any other keyword arguments are saved, and passed to
the distribution's 'include()' and 'exclude()' methods when the
feature is included or excluded, respectively. So, for example, you
could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be
added or removed from the distribution as appropriate.
A feature must include at least one 'requires', 'remove', or other
keyword argument. Otherwise, it can't affect the distribution in any way.
Note also that you can subclass 'Feature' to create your own specialized
feature types that modify the distribution in other ways when included or
excluded. See the docstrings for the various methods here for more detail.
Aside from the methods, the only feature attributes that distributions look
at are 'description' and 'optional'.
"""
@staticmethod
def warn_deprecated():
msg = (
"Features are deprecated and will be removed in a future "
"version. See https://github.com/pypa/setuptools/issues/65."
)
warnings.warn(msg, DistDeprecationWarning, stacklevel=3)
def __init__(
self, description, standard=False, available=True,
optional=True, require_features=(), remove=(), **extras):
self.warn_deprecated()
self.description = description
self.standard = standard
self.available = available
self.optional = optional
if isinstance(require_features, (str, Require)):
require_features = require_features,
self.require_features = [
r for r in require_features if isinstance(r, str)
]
er = [r for r in require_features if not isinstance(r, str)]
if er:
extras['require_features'] = er
if isinstance(remove, str):
remove = remove,
self.remove = remove
self.extras = extras
if not remove and not require_features and not extras:
raise DistutilsSetupError(
"Feature %s: must define 'require_features', 'remove', or "
"at least one of 'packages', 'py_modules', etc."
)
def include_by_default(self):
"""Should this feature be included by default?"""
return self.available and self.standard
def include_in(self, dist):
"""Ensure feature and its requirements are included in distribution
You may override this in a subclass to perform additional operations on
the distribution. Note that this method may be called more than once
per feature, and so should be idempotent.
"""
if not self.available:
raise DistutilsPlatformError(
self.description + " is required, "
"but is not available on this platform"
)
dist.include(**self.extras)
for f in self.require_features:
dist.include_feature(f)
def exclude_from(self, dist):
"""Ensure feature is excluded from distribution
You may override this in a subclass to perform additional operations on
the distribution. This method will be called at most once per
feature, and only after all included features have been asked to
include themselves.
"""
dist.exclude(**self.extras)
if self.remove:
for item in self.remove:
dist.exclude_package(item)
def validate(self, dist):
"""Verify that feature makes sense in context of distribution
This method is called by the distribution just before it parses its
command line. It checks to ensure that the 'remove' attribute, if any,
contains only valid package/module names that are present in the base
distribution when 'setup()' is called. You may override it in a
subclass to perform any other required validation of the feature
against a target distribution.
"""
for item in self.remove:
if not dist.has_contents_for(item):
raise DistutilsSetupError(
"%s wants to be able to remove %s, but the distribution"
" doesn't contain any packages or modules under %s"
% (self.description, item, item)
)
class DistDeprecationWarning(SetuptoolsDeprecationWarning):
"""Class for warning about deprecations in dist in
setuptools. Not ignored by default, unlike DeprecationWarning."""
| 39.104314 | 79 | 0.618376 |
aceb4a37c97d2a4a42cbd535257e57f6ca2cc293 | 6,981 | py | Python | iaso/api/form_versions.py | BLSQ/iaso-copy | 85fb17f408c15e8c2d730416d1312f58f8db39b7 | [
"MIT"
] | null | null | null | iaso/api/form_versions.py | BLSQ/iaso-copy | 85fb17f408c15e8c2d730416d1312f58f8db39b7 | [
"MIT"
] | null | null | null | iaso/api/form_versions.py | BLSQ/iaso-copy | 85fb17f408c15e8c2d730416d1312f58f8db39b7 | [
"MIT"
] | 1 | 2022-03-23T16:44:12.000Z | 2022-03-23T16:44:12.000Z | import typing
from django.http.response import HttpResponseBadRequest
from rest_framework import serializers, parsers, permissions, exceptions
from iaso.models import Form, FormVersion
from django.db.models.functions import Concat
from django.db.models import Value, Count
from django.db.models import BooleanField
from django.db.models.expressions import Case, When
from iaso.odk import parsing
from .common import ModelViewSet, TimestampField, DynamicFieldsModelSerializer, HasPermission
from .forms import HasFormPermission
# noinspection PyMethodMayBeStatic
class FormVersionSerializer(DynamicFieldsModelSerializer):
class Meta:
model = FormVersion
default_fields = [
"id",
"version_id",
"form_id",
"form_name",
"full_name", # model annotation
"mapped", # model annotation
"xls_file",
"file",
"created_at",
"updated_at",
"start_period",
"end_period",
"mapping_versions",
]
fields = [
"id",
"version_id",
"form_id",
"form_name",
"full_name", # model annotation
"mapped", # model annotation
"xls_file",
"file",
"descriptor",
"created_at",
"updated_at",
"start_period",
"end_period",
"mapping_versions",
]
read_only_fields = [
"id",
"form_name",
"version_id",
"full_name",
"mapped",
"file",
"created_at",
"updated_at",
"descriptor",
]
form_id = serializers.PrimaryKeyRelatedField(source="form", queryset=Form.objects.all())
form_name = serializers.SerializerMethodField()
xls_file = serializers.FileField(required=False, allow_empty_file=False) # field is not required in model
mapped = serializers.BooleanField(read_only=True)
full_name = serializers.CharField(read_only=True)
created_at = TimestampField(read_only=True)
updated_at = TimestampField(read_only=True)
descriptor = serializers.SerializerMethodField()
mapping_versions = serializers.SerializerMethodField()
start_period = serializers.CharField(required=False, default=None)
end_period = serializers.CharField(required=False, default=None)
def get_form_name(self, form_version):
return form_version.form.name
def get_descriptor(self, form_version):
return form_version.get_or_save_form_descriptor()
@staticmethod
def get_mapping_versions(obj: FormVersion):
return [f.as_dict() for f in obj.mapping_versions.all()]
def validate(self, data: typing.MutableMapping):
# TODO: validate start en end period (is a period and start before end)
form = data["form"]
# validate form (access check)
permission_checker = HasFormPermission()
if not permission_checker.has_object_permission(self.context["request"], self.context["view"], form):
raise serializers.ValidationError({"form_id": "Invalid form id"})
if self.context["request"].method == "PUT":
# if update skip the rest of check
return data
# handle xls to xml conversion
try:
previous_form_version = FormVersion.objects.latest_version(form)
survey = parsing.parse_xls_form(
data["xls_file"],
previous_version=previous_form_version.version_id if previous_form_version is not None else None,
)
except parsing.ParsingError as e:
raise serializers.ValidationError({"xls_file": str(e)})
# validate that form_id stays constant across versions
if form.form_id is not None and survey.form_id != form.form_id:
raise serializers.ValidationError({"xls_file": "Form id should stay constant across form versions."})
# validate form_id (from XLS file) uniqueness across account
if Form.objects.exists_with_same_version_id_within_projects(form, survey.form_id):
raise serializers.ValidationError({"xls_file": "The form_id is already used in another form."})
data["survey"] = survey
return data
def create(self, validated_data):
form = validated_data.pop("form")
survey = validated_data.pop("survey")
try:
return FormVersion.objects.create_for_form_and_survey(form=form, survey=survey, **validated_data)
except Exception as e:
# putting the error in an array to prevent front-end crash
raise exceptions.ValidationError({"xls_file": [e]})
def update(self, form_version, validated_data):
form_version.start_period = validated_data.pop("start_period", None)
form_version.end_period = validated_data.pop("end_period", None)
form_version.save()
return form_version
class FormVersionsViewSet(ModelViewSet):
"""Form versions API
This API is restricted to authenticated users having the "menupermissions.iaso_forms" or "menupermissions.iaso_submissions" permissions.
GET /api/formversions/
GET /api/formversions/<id>
POST /api/formversions/
PUT /api/formversions/<id> -- can only update start_period and end_period
"""
serializer_class = FormVersionSerializer
permission_classes = [
permissions.IsAuthenticated,
HasPermission("menupermissions.iaso_forms", "menupermissions.iaso_submissions"),
]
results_key = "form_versions"
queryset = FormVersion.objects.all()
parser_classes = (parsers.MultiPartParser, parsers.JSONParser)
http_method_names = ["get", "put", "post", "head", "options", "trace"]
def get_queryset(self):
orders = self.request.query_params.get("order", "full_name").split(",")
mapped_filter = self.request.query_params.get("mapped", "")
profile = self.request.user.iaso_profile
queryset = FormVersion.objects.filter(form__projects__account=profile.account)
search_name = self.request.query_params.get("search_name", None)
if search_name:
queryset = queryset.filter(form__name__icontains=search_name)
form_id = self.request.query_params.get("form_id", None)
if form_id:
queryset = queryset.filter(form__id=form_id)
queryset = queryset.annotate(full_name=Concat("form__name", Value(" - V"), "version_id"))
queryset = queryset.annotate(mapping_versions_count=Count("mapping_versions"))
queryset = queryset.annotate(
mapped=Case(When(mapping_versions_count__gt=0, then=True), default=False, output_field=BooleanField())
)
if mapped_filter:
queryset = queryset.filter(mapped=(mapped_filter == "true"))
queryset = queryset.order_by(*orders)
return queryset
| 37.735135 | 140 | 0.658358 |
aceb4ce0c02e79a0ebe45325bb249c6471081319 | 5,014 | py | Python | t_core/Mutex/HHoldRuleNAC1.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | t_core/Mutex/HHoldRuleNAC1.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | t_core/Mutex/HHoldRuleNAC1.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z |
from core.himesis import Himesis, HimesisPreConditionPatternNAC
import cPickle as pickle
class HHoldRuleNAC1(HimesisPreConditionPatternNAC):
def __init__(self, LHS):
"""
Creates the himesis graph representing the AToM3 model HHoldRuleNAC1.
"""
# Create the himesis graph
EDGE_LIST = [(1, 0)]
super(HHoldRuleNAC1, self).__init__(name='HHoldRuleNAC1', num_nodes=2, edges=EDGE_LIST, LHS=LHS)
self.is_compiled = True # now this instance has been compiled
# Set the graph attributes
self["mm__"] = pickle.loads("""(lp1
S'MT_pre__Mutex'
p2
aS'MoTifRule'
p3
a.""")
self["MT_constraint__"] = pickle.loads("""S"#===============================================================================@n# This code is executed after the nodes in the NAC have been matched.@n# You can access a matched node labelled n by: PreNode('n').@n# To access attribute x of node n, use: PreNode('n')['x'].@n# The given constraint must evaluate to a boolean expression:@n# returning True forbids the rule from being applied,@n# returning False enables the rule to be applied.@n#===============================================================================@n@nreturn True@n"
p1
.""").replace("@n", "\n")
self["name"] = pickle.loads("""S''
.""")
self["GUID__"] = pickle.loads("""ccopy_reg
_reconstructor
p1
(cuuid
UUID
p2
c__builtin__
object
p3
NtRp4
(dp5
S'int'
p6
L160179377637520873875861494974975545758L
sb.""")
# Set the node attributes
self.vs[0]["MT_subtypeMatching__"] = pickle.loads("""I00
.""")
self.vs[0]["MT_label__"] = pickle.loads("""S'4'
.""")
self.vs[0]["MT_subtypes__"] = pickle.loads("""(lp1
.""")
self.vs[0]["mm__"] = pickle.loads("""S'MT_pre__held_by'
p1
.""")
self.vs[0]["MT_dirty__"] = pickle.loads("""I00
.""")
self.vs[0]["GUID__"] = pickle.loads("""ccopy_reg
_reconstructor
p1
(cuuid
UUID
p2
c__builtin__
object
p3
NtRp4
(dp5
S'int'
p6
L125465582863726898435674588919499575544L
sb.""")
self.vs[1]["MT_subtypeMatching__"] = pickle.loads("""I00
.""")
self.vs[1]["MT_label__"] = pickle.loads("""S'2'
.""")
self.vs[1]["MT_subtypes__"] = pickle.loads("""(lp1
.""")
self.vs[1]["mm__"] = pickle.loads("""S'MT_pre__Resource'
p1
.""")
self.vs[1]["MT_dirty__"] = pickle.loads("""I00
.""")
self.vs[1]["MT_pre__name"] = pickle.loads("""S"@n#===============================================================================@n# This code is executed when evaluating if a node shall be matched by this rule.@n# You can access the value of the current node's attribute value by: attr_value.@n# You can access a matched node 'n' by: PreNode('n').@n# To access attribute x of node n, use: PreNode('n')['x'].@n# The given constraint must evaluate to a boolean expression.@n#===============================================================================@n@nreturn True@n"
p1
.""").replace("@n", "\n")
self.vs[1]["GUID__"] = pickle.loads("""ccopy_reg
_reconstructor
p1
(cuuid
UUID
p2
c__builtin__
object
p3
NtRp4
(dp5
S'int'
p6
L226802655720759481614389774357601028373L
sb.""")
# Load the bridge between this NAC and its LHS
from HHoldRuleNAC1Bridge import HHoldRuleNAC1Bridge
self.bridge = HHoldRuleNAC1Bridge()
def eval_name2(self, attr_value, PreNode, graph):
#===============================================================================
# This code is executed when evaluating if a node shall be matched by this rule.
# You can access the value of the current node's attribute value by: attr_value.
# You can access a matched node 'n' by: PreNode('n').
# To access attribute x of node n, use: PreNode('n')['x'].
# The given constraint must evaluate to a boolean expression.
#===============================================================================
return True
def constraint(self, PreNode, graph):
"""
Executable constraint code.
@param PreNode: Function taking an integer as parameter
and returns the node corresponding to that label.
"""
#===============================================================================
# This code is executed after the nodes in the NAC have been matched.
# You can access a matched node labelled n by: PreNode('n').
# To access attribute x of node n, use: PreNode('n')['x'].
# The given constraint must evaluate to a boolean expression:
# returning True forbids the rule from being applied,
# returning False enables the rule to be applied.
#===============================================================================
return True
| 37.140741 | 601 | 0.538293 |
aceb4dc484b7bf5bd8627a85cfe3a77443ea4108 | 2,345 | py | Python | LIM_scripts/iterativeMapper/examples/run_mapper_MP.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | 3 | 2019-04-21T13:13:02.000Z | 2020-10-15T12:44:23.000Z | LIM_scripts/iterativeMapper/examples/run_mapper_MP.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | null | null | null | LIM_scripts/iterativeMapper/examples/run_mapper_MP.py | Bhare8972/LOFAR-LIM | 89f25be8c02cb8980c2e237da3eaac279d40a06a | [
"MIT"
] | 2 | 2018-11-06T18:34:33.000Z | 2019-04-04T14:16:57.000Z | #!/usr/bin/env python3
"""Use this to actually run the iterative mapper. But first make sure you made a header file with make_header.py"""
import time
from multiprocessing import Process
from LoLIM.utilities import logger
from LoLIM.iterativeMapper.iterative_mapper import read_header, iterative_mapper
## these lines are anachronistic and should be fixed at some point
from LoLIM import utilities
utilities.default_raw_data_loc = "/exp_app2/appexp1/lightning_data"
utilities.default_processed_data_loc = "/home/brian/processed_files"
out_folder = 'iterMapper_50_CS002'
timeID = 'D20180809T141413.250Z'
first_block = 0
final_datapoint = 6000*(2**16) ## this may be exceeded by upto one block size
num_processes = 4
## the mapper is most efficent when it proceses consecutive blocks, and does not jump around
## but we don't want one process to get the majority of the flash, and anouther to get all noise
## therefore, each process images a number of consecutive blocks, then leap-frogs forward.
num_consecutive_blocks = 100
def run_process(process_i):
inHeader = read_header(out_folder, timeID)
log_fname = inHeader.next_log_file()
logger_function = logger()
logger_function.set( log_fname, False )
logger_function.take_stdout()
logger_function.take_stderr()
logger_function("process", process_i)
logger_function("date and time run:", time.strftime("%c") )
mapper = iterative_mapper(inHeader, logger_function)
current_datapoint = 0
current_run = 0
while current_datapoint < final_datapoint:
for blockJ in range(num_consecutive_blocks):
block = first_block + blockJ + process_i*num_consecutive_blocks + current_run*num_consecutive_blocks*num_processes
mapper.process_block( block, logger_function )
current_datapoint = inHeader.initial_datapoint + (block+1)*mapper.usable_block_length
if current_datapoint > final_datapoint:
break
current_run += 1
logger_function("done!" )
processes = []
for run_i in range(num_processes):
p = Process(target=run_process, args=(run_i,) )
p.start()
processes.append(p)
time.sleep(1)
for p in processes:
p.join()
time.sleep(60)
print("all done!") | 32.123288 | 126 | 0.711727 |
aceb5079923923faa40277e4c39ed29bccba63b8 | 5,774 | py | Python | nemo_text_processing/inverse_text_normalization/en/taggers/time.py | admariner/NeMo | e542d7f9063a40afa4119a3b94de4c2c636a37bb | [
"Apache-2.0"
] | null | null | null | nemo_text_processing/inverse_text_normalization/en/taggers/time.py | admariner/NeMo | e542d7f9063a40afa4119a3b94de4c2c636a37bb | [
"Apache-2.0"
] | 1 | 2022-03-06T14:09:02.000Z | 2022-03-06T14:09:02.000Z | nemo_text_processing/inverse_text_normalization/en/taggers/time.py | admariner/NeMo | e542d7f9063a40afa4119a3b94de4c2c636a37bb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright 2015 and onwards Google, Inc.
#
# 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 pynini
from nemo_text_processing.inverse_text_normalization.en.taggers.cardinal import CardinalFst
from nemo_text_processing.inverse_text_normalization.en.utils import get_abs_path, num_to_word
from nemo_text_processing.text_normalization.en.graph_utils import (
GraphFst,
convert_space,
delete_extra_space,
delete_space,
insert_space,
)
from pynini.lib import pynutil
class TimeFst(GraphFst):
"""
Finite state transducer for classifying time
e.g. twelve thirty -> time { hours: "12" minutes: "30" }
e.g. twelve past one -> time { minutes: "12" hours: "1" }
e.g. two o clock a m -> time { hours: "2" suffix: "a.m." }
e.g. quarter to two -> time { hours: "1" minutes: "45" }
e.g. quarter past two -> time { hours: "2" minutes: "15" }
e.g. half past two -> time { hours: "2" minutes: "30" }
"""
def __init__(self):
super().__init__(name="time", kind="classify")
# hours, minutes, seconds, suffix, zone, style, speak_period
suffix_graph = pynini.string_file(get_abs_path("data/time/time_suffix.tsv"))
time_zone_graph = pynini.invert(pynini.string_file(get_abs_path("data/time/time_zone.tsv")))
to_hour_graph = pynini.string_file(get_abs_path("data/time/to_hour.tsv"))
minute_to_graph = pynini.string_file(get_abs_path("data/time/minute_to.tsv"))
# only used for < 1000 thousand -> 0 weight
cardinal = pynutil.add_weight(CardinalFst().graph_no_exception, weight=-0.7)
labels_hour = [num_to_word(x) for x in range(0, 24)]
labels_minute_single = [num_to_word(x) for x in range(1, 10)]
labels_minute_double = [num_to_word(x) for x in range(10, 60)]
graph_hour = pynini.union(*labels_hour) @ cardinal
graph_minute_single = pynini.union(*labels_minute_single) @ cardinal
graph_minute_double = pynini.union(*labels_minute_double) @ cardinal
graph_minute_verbose = pynini.cross("half", "30") | pynini.cross("quarter", "15")
oclock = pynini.cross(pynini.union("o' clock", "o clock", "o'clock", "oclock"), "")
final_graph_hour = pynutil.insert("hours: \"") + graph_hour + pynutil.insert("\"")
graph_minute = (
oclock + pynutil.insert("00")
| pynutil.delete("o") + delete_space + graph_minute_single
| graph_minute_double
)
final_suffix = pynutil.insert("suffix: \"") + convert_space(suffix_graph) + pynutil.insert("\"")
final_suffix = delete_space + insert_space + final_suffix
final_suffix_optional = pynini.closure(final_suffix, 0, 1)
final_time_zone_optional = pynini.closure(
delete_space
+ insert_space
+ pynutil.insert("zone: \"")
+ convert_space(time_zone_graph)
+ pynutil.insert("\""),
0,
1,
)
# five o' clock
# two o eight, two thirty five (am/pm)
# two pm/am
graph_hm = (
final_graph_hour + delete_extra_space + pynutil.insert("minutes: \"") + graph_minute + pynutil.insert("\"")
)
# 10 past four, quarter past four, half past four
graph_m_past_h = (
pynutil.insert("minutes: \"")
+ pynini.union(graph_minute_single, graph_minute_double, graph_minute_verbose)
+ pynutil.insert("\"")
+ delete_space
+ pynutil.delete("past")
+ delete_extra_space
+ final_graph_hour
)
graph_quarter_time = (
pynutil.insert("minutes: \"")
+ pynini.cross("quarter", "45")
+ pynutil.insert("\"")
+ delete_space
+ pynutil.delete(pynini.union("to", "till"))
+ delete_extra_space
+ pynutil.insert("hours: \"")
+ to_hour_graph
+ pynutil.insert("\"")
)
graph_m_to_h_suffix_time = (
pynutil.insert("minutes: \"")
+ ((graph_minute_single | graph_minute_double).optimize() @ minute_to_graph)
+ pynutil.insert("\"")
+ pynini.closure(delete_space + pynutil.delete(pynini.union("min", "mins", "minute", "minutes")), 0, 1)
+ delete_space
+ pynutil.delete(pynini.union("to", "till"))
+ delete_extra_space
+ pynutil.insert("hours: \"")
+ to_hour_graph
+ pynutil.insert("\"")
+ final_suffix
)
graph_h = (
final_graph_hour
+ delete_extra_space
+ pynutil.insert("minutes: \"")
+ (pynutil.insert("00") | graph_minute)
+ pynutil.insert("\"")
+ final_suffix
+ final_time_zone_optional
)
final_graph = (
(graph_hm | graph_m_past_h | graph_quarter_time) + final_suffix_optional + final_time_zone_optional
)
final_graph |= graph_h
final_graph |= graph_m_to_h_suffix_time
final_graph = self.add_tokens(final_graph.optimize())
self.fst = final_graph.optimize()
| 40.097222 | 119 | 0.615171 |
aceb50a8abdc4a255a0c460b20e4a5606737b52e | 3,966 | py | Python | data/config.py | BingzheWu/ssd-pytorch | bc3f1f5473170082e3b01adb1f4e5d4fb7e0077e | [
"MIT"
] | 7 | 2018-01-25T03:05:18.000Z | 2021-03-03T21:49:54.000Z | data/config.py | BingzheWu/ssd-pytorch | bc3f1f5473170082e3b01adb1f4e5d4fb7e0077e | [
"MIT"
] | 1 | 2018-03-10T12:21:47.000Z | 2018-03-10T12:21:47.000Z | data/config.py | BingzheWu/ssd-pytorch | bc3f1f5473170082e3b01adb1f4e5d4fb7e0077e | [
"MIT"
] | null | null | null | # config.py
import os.path
# gets home dir cross platform
home = os.path.expanduser("~")
ddir = os.path.join(home,"data/VOCdevkit/")
# note: if you used our download scripts, this should be right
VOCroot = ddir # path to VOCdevkit root dir
# default batch size
BATCHES = 32
# data reshuffled at every epoch
SHUFFLE = True
# number of subprocesses to use for data loading
WORKERS = 4
#SSD300 CONFIGS
# newer version: use additional conv11_2 layer as last layer before multibox layers
v2 = {
'feature_maps' : [38, 19, 10, 5, 3, 1],
'min_dim' : 300,
'steps' : [8, 16, 32, 64, 100, 300],
'min_sizes' : [30, 60, 111, 162, 213, 264],
'max_sizes' : [60, 111, 162, 213, 264, 315],
# 'aspect_ratios' : [[2, 1/2], [2, 1/2, 3, 1/3], [2, 1/2, 3, 1/3],
# [2, 1/2, 3, 1/3], [2, 1/2], [2, 1/2]],
'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2], [2]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v2',
}
# use average pooling layer as last layer before multibox layers
v1 = {
'feature_maps' : [38, 19, 10, 5, 3, 1],
'min_dim' : 300,
'steps' : [8, 16, 32, 64, 100, 300],
'min_sizes' : [30, 60, 114, 168, 222, 276],
'max_sizes' : [-1, 114, 168, 222, 276, 330],
# 'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]],
'aspect_ratios' : [[1,1,2,1/2],[1,1,2,1/2,3,1/3],[1,1,2,1/2,3,1/3],
[1,1,2,1/2,3,1/3],[1,1,2,1/2,3,1/3],[1,1,2,1/2,3,1/3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v1',
}
# use average pooling layer as last layer before multibox layers
v3 = {
'feature_maps' : [38, 19,10],
'min_dim' : 300,
'steps' : [8, 16, 32],
'min_sizes' : [30, 60, 114],
'max_sizes' : [-1, 114, 168],
# 'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]],
'aspect_ratios' : [[1,1,2,1./2],[1,1,2,1./2,3,1./3],[1,1,2,1./2,3,1./3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v3',
}
v3 = {
'feature_maps' : [38, 19, 10],
'min_dim' : 300,
'steps' : [8, 16, 32],
'min_sizes' : [30, 60, 111],
'max_sizes' : [60, 111, 162],
# 'aspect_ratios' : [[2, 1/2], [2, 1/2, 3, 1/3], [2, 1/2, 3, 1/3],
# [2, 1/2, 3, 1/3], [2, 1/2], [2, 1/2]],
'aspect_ratios' : [[2], [2, 3], [2, 3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v3',
}
v_resnet = {
'feature_maps' : [38, 19, 10, 5, 3, 1],
'min_dim' : 300,
'steps' : [8, 16, 32, 64, 100, 300],
'min_sizes' : [30, 60, 114, 168, 222, 276],
'max_sizes' : [-1, 114, 168, 222, 276, 330],
# 'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]],
'aspect_ratios' : [[1,2,1/2.],[1,2,1/2.,3,1/3.],[1,2,1/2.,3,1/3.],
[1,2,1/2.,3,1/3.],[1,2,1/2.,3,1/3.], [1, 2, 1./2, 3, 1./3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v1',
}
v_sq = {
'feature_maps' : [36, 18, 9, 4, 2, 1],
'min_dim' : 300,
'steps' : [8, 16, 32, 64, 100, 300],
'min_sizes' : [30, 60, 114, 168, 222, 276],
'max_sizes' : [-1, 114, 168, 222, 276, 330],
# 'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]],
'aspect_ratios' : [[1,2,1/2.],[1,2,1/2.,3,1/3.],[1,2,1/2.,3,1/3.],
[1,2,1/2.,3,1/3.],[1,2,1/2.,3,1/3.], [1, 2, 1./2, 3, 1./3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v1',
}
v_mobilenet = {
'feature_maps' : [19, 10, 5, 3, 2, 1],
'min_dim' : 300,
'steps' : [16, 32, 64, 100, 150, 300],
'min_sizes' : [60, 105, 150, 195, 240, 285],
'max_sizes' : [-1, 150, 195, 240, 285, 300],
# 'aspect_ratios' : [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3]],
'aspect_ratios' : [[2,1/2.],[2,1/2.,3,1/3.],[2,1/2.,3,1/3.],
[2,1/2.,3,1/3.],[2,1/2.,3,1/3.], [2, 1./2, 3, 1./3]],
'variance' : [0.1, 0.2],
'clip' : True,
'name' : 'v_mobilenet',
} | 23.329412 | 84 | 0.45764 |
aceb50ba856ce8458286d69bcc69d1416fc67622 | 15,409 | py | Python | sdk/python/pulumi_azure_native/hybriddata/v20190601/data_store.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybriddata/v20190601/data_store.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/hybriddata/v20190601/data_store.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['DataStoreArgs', 'DataStore']
@pulumi.input_type
class DataStoreArgs:
def __init__(__self__, *,
data_manager_name: pulumi.Input[str],
data_store_type_id: pulumi.Input[str],
resource_group_name: pulumi.Input[str],
state: pulumi.Input['State'],
customer_secrets: Optional[pulumi.Input[Sequence[pulumi.Input['CustomerSecretArgs']]]] = None,
data_store_name: Optional[pulumi.Input[str]] = None,
extended_properties: Optional[Any] = None,
repository_id: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a DataStore resource.
:param pulumi.Input[str] data_manager_name: The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only
:param pulumi.Input[str] data_store_type_id: The arm id of the data store type.
:param pulumi.Input[str] resource_group_name: The Resource Group Name
:param pulumi.Input['State'] state: State of the data source.
:param pulumi.Input[Sequence[pulumi.Input['CustomerSecretArgs']]] customer_secrets: List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
:param pulumi.Input[str] data_store_name: The data store/repository name to be created or updated.
:param Any extended_properties: A generic json used differently by each data source type.
:param pulumi.Input[str] repository_id: Arm Id for the manager resource to which the data source is associated. This is optional.
"""
pulumi.set(__self__, "data_manager_name", data_manager_name)
pulumi.set(__self__, "data_store_type_id", data_store_type_id)
pulumi.set(__self__, "resource_group_name", resource_group_name)
pulumi.set(__self__, "state", state)
if customer_secrets is not None:
pulumi.set(__self__, "customer_secrets", customer_secrets)
if data_store_name is not None:
pulumi.set(__self__, "data_store_name", data_store_name)
if extended_properties is not None:
pulumi.set(__self__, "extended_properties", extended_properties)
if repository_id is not None:
pulumi.set(__self__, "repository_id", repository_id)
@property
@pulumi.getter(name="dataManagerName")
def data_manager_name(self) -> pulumi.Input[str]:
"""
The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only
"""
return pulumi.get(self, "data_manager_name")
@data_manager_name.setter
def data_manager_name(self, value: pulumi.Input[str]):
pulumi.set(self, "data_manager_name", value)
@property
@pulumi.getter(name="dataStoreTypeId")
def data_store_type_id(self) -> pulumi.Input[str]:
"""
The arm id of the data store type.
"""
return pulumi.get(self, "data_store_type_id")
@data_store_type_id.setter
def data_store_type_id(self, value: pulumi.Input[str]):
pulumi.set(self, "data_store_type_id", value)
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> pulumi.Input[str]:
"""
The Resource Group Name
"""
return pulumi.get(self, "resource_group_name")
@resource_group_name.setter
def resource_group_name(self, value: pulumi.Input[str]):
pulumi.set(self, "resource_group_name", value)
@property
@pulumi.getter
def state(self) -> pulumi.Input['State']:
"""
State of the data source.
"""
return pulumi.get(self, "state")
@state.setter
def state(self, value: pulumi.Input['State']):
pulumi.set(self, "state", value)
@property
@pulumi.getter(name="customerSecrets")
def customer_secrets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['CustomerSecretArgs']]]]:
"""
List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
"""
return pulumi.get(self, "customer_secrets")
@customer_secrets.setter
def customer_secrets(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['CustomerSecretArgs']]]]):
pulumi.set(self, "customer_secrets", value)
@property
@pulumi.getter(name="dataStoreName")
def data_store_name(self) -> Optional[pulumi.Input[str]]:
"""
The data store/repository name to be created or updated.
"""
return pulumi.get(self, "data_store_name")
@data_store_name.setter
def data_store_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "data_store_name", value)
@property
@pulumi.getter(name="extendedProperties")
def extended_properties(self) -> Optional[Any]:
"""
A generic json used differently by each data source type.
"""
return pulumi.get(self, "extended_properties")
@extended_properties.setter
def extended_properties(self, value: Optional[Any]):
pulumi.set(self, "extended_properties", value)
@property
@pulumi.getter(name="repositoryId")
def repository_id(self) -> Optional[pulumi.Input[str]]:
"""
Arm Id for the manager resource to which the data source is associated. This is optional.
"""
return pulumi.get(self, "repository_id")
@repository_id.setter
def repository_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "repository_id", value)
class DataStore(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
customer_secrets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['CustomerSecretArgs']]]]] = None,
data_manager_name: Optional[pulumi.Input[str]] = None,
data_store_name: Optional[pulumi.Input[str]] = None,
data_store_type_id: Optional[pulumi.Input[str]] = None,
extended_properties: Optional[Any] = None,
repository_id: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input['State']] = None,
__props__=None):
"""
Data store.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['CustomerSecretArgs']]]] customer_secrets: List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
:param pulumi.Input[str] data_manager_name: The name of the DataManager Resource within the specified resource group. DataManager names must be between 3 and 24 characters in length and use any alphanumeric and underscore only
:param pulumi.Input[str] data_store_name: The data store/repository name to be created or updated.
:param pulumi.Input[str] data_store_type_id: The arm id of the data store type.
:param Any extended_properties: A generic json used differently by each data source type.
:param pulumi.Input[str] repository_id: Arm Id for the manager resource to which the data source is associated. This is optional.
:param pulumi.Input[str] resource_group_name: The Resource Group Name
:param pulumi.Input['State'] state: State of the data source.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: DataStoreArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Data store.
:param str resource_name: The name of the resource.
:param DataStoreArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(DataStoreArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
customer_secrets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['CustomerSecretArgs']]]]] = None,
data_manager_name: Optional[pulumi.Input[str]] = None,
data_store_name: Optional[pulumi.Input[str]] = None,
data_store_type_id: Optional[pulumi.Input[str]] = None,
extended_properties: Optional[Any] = None,
repository_id: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input['State']] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = DataStoreArgs.__new__(DataStoreArgs)
__props__.__dict__["customer_secrets"] = customer_secrets
if data_manager_name is None and not opts.urn:
raise TypeError("Missing required property 'data_manager_name'")
__props__.__dict__["data_manager_name"] = data_manager_name
__props__.__dict__["data_store_name"] = data_store_name
if data_store_type_id is None and not opts.urn:
raise TypeError("Missing required property 'data_store_type_id'")
__props__.__dict__["data_store_type_id"] = data_store_type_id
__props__.__dict__["extended_properties"] = extended_properties
__props__.__dict__["repository_id"] = repository_id
if resource_group_name is None and not opts.urn:
raise TypeError("Missing required property 'resource_group_name'")
__props__.__dict__["resource_group_name"] = resource_group_name
if state is None and not opts.urn:
raise TypeError("Missing required property 'state'")
__props__.__dict__["state"] = state
__props__.__dict__["name"] = None
__props__.__dict__["type"] = None
alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-nextgen:hybriddata/v20190601:DataStore"), pulumi.Alias(type_="azure-native:hybriddata:DataStore"), pulumi.Alias(type_="azure-nextgen:hybriddata:DataStore"), pulumi.Alias(type_="azure-native:hybriddata/v20160601:DataStore"), pulumi.Alias(type_="azure-nextgen:hybriddata/v20160601:DataStore")])
opts = pulumi.ResourceOptions.merge(opts, alias_opts)
super(DataStore, __self__).__init__(
'azure-native:hybriddata/v20190601:DataStore',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'DataStore':
"""
Get an existing DataStore resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = DataStoreArgs.__new__(DataStoreArgs)
__props__.__dict__["customer_secrets"] = None
__props__.__dict__["data_store_type_id"] = None
__props__.__dict__["extended_properties"] = None
__props__.__dict__["name"] = None
__props__.__dict__["repository_id"] = None
__props__.__dict__["state"] = None
__props__.__dict__["type"] = None
return DataStore(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="customerSecrets")
def customer_secrets(self) -> pulumi.Output[Optional[Sequence['outputs.CustomerSecretResponse']]]:
"""
List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
"""
return pulumi.get(self, "customer_secrets")
@property
@pulumi.getter(name="dataStoreTypeId")
def data_store_type_id(self) -> pulumi.Output[str]:
"""
The arm id of the data store type.
"""
return pulumi.get(self, "data_store_type_id")
@property
@pulumi.getter(name="extendedProperties")
def extended_properties(self) -> pulumi.Output[Optional[Any]]:
"""
A generic json used differently by each data source type.
"""
return pulumi.get(self, "extended_properties")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
Name of the object.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="repositoryId")
def repository_id(self) -> pulumi.Output[Optional[str]]:
"""
Arm Id for the manager resource to which the data source is associated. This is optional.
"""
return pulumi.get(self, "repository_id")
@property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
"""
State of the data source.
"""
return pulumi.get(self, "state")
@property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
"""
Type of the object.
"""
return pulumi.get(self, "type")
| 47.122324 | 371 | 0.665585 |
aceb51dc74ebb51c823f38acb87eeab65c78f41b | 541 | py | Python | test_suite/suite/test13/test.py | joncatanio/cannoli | 410f6bea362bf9e33eecc0e01fb080dadd14ef23 | [
"MIT"
] | 755 | 2017-12-09T05:34:43.000Z | 2022-03-26T09:15:56.000Z | test_suite/suite/test13/test.py | joncatanio/cannoli | 410f6bea362bf9e33eecc0e01fb080dadd14ef23 | [
"MIT"
] | 8 | 2017-12-12T01:03:18.000Z | 2020-06-29T01:41:03.000Z | test_suite/suite/test13/test.py | joncatanio/cannoli | 410f6bea362bf9e33eecc0e01fb080dadd14ef23 | [
"MIT"
] | 23 | 2018-05-17T17:48:23.000Z | 2022-03-26T09:15:57.000Z | def get_int(x):
return x
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
b = a[:]
c = 4
b.append(-1)
print(a)
print(b)
print(a[1:5])
print(a[1:12])
print(a[0:11])
print(a[1:24])
print(a[-5:10])
print(a[-1])
print(a[1:-2])
print(a[1:0])
print(a[1:])
print(a[:5])
print(a[c:])
print(a[:get_int(9)])
print(a[-111111:-222222222])
print(a[5:1])
print(a[5:1])
print(a[5:1])
print(a[:])
print(a[1:4])
print(a[-1:-4])
print(a[-1:-4])
print(a[-1:])
print(a[-1:-4])
print(a[-1:])
print(a[1:-5])
print(a[:-5])
print(a[10:-5])
print(a[:])
print(a[0:-2])
| 13.195122 | 39 | 0.54159 |
aceb51f323ee9bee63fe28a346beb858e0f33ec7 | 6,655 | py | Python | rbig/information/mutual_info.py | jejjohnson/rbig | 6d25401b32b318894dfcb594edde076356f73324 | [
"MIT"
] | 1 | 2020-05-15T17:27:40.000Z | 2020-05-15T17:27:40.000Z | rbig/information/mutual_info.py | jejjohnson/rbig | 6d25401b32b318894dfcb594edde076356f73324 | [
"MIT"
] | null | null | null | rbig/information/mutual_info.py | jejjohnson/rbig | 6d25401b32b318894dfcb594edde076356f73324 | [
"MIT"
] | null | null | null | import numpy as np
class RBIGMI(object):
""" Rotation-Based Iterative Gaussian-ization (RBIG) applied to two
multidimensional variables (RBIGMI). Applies the RBIG algorithm to
the two multidimensional variables independently, then applies another
RBIG algorithm on the two Gaussian-ized datasets.
Parameters
----------
n_layers : int, optional (default 1000)
The number of steps to run the sequence of marginal gaussianization
and then rotation
rotation_type : {'PCA', 'random'}
The rotation applied to the marginally Gaussian-ized data at each iteration.
- 'pca' : a principal components analysis rotation (PCA)
- 'random' : random rotations
- 'ica' : independent components analysis (ICA)
pdf_resolution : int, optional (default 1000)
The number of points at which to compute the gaussianized marginal pdfs.
The functions that map from original data to gaussianized data at each
iteration have to be stored so that we can invert them later - if working
with high-dimensional data consider reducing this resolution to shorten
computation time.
pdf_extension : int, optional (default 0.1)
The fraction by which to extend the support of the Gaussian-ized marginal
pdf compared to the empirical marginal PDF.
verbose : int, optional
If specified, report the RBIG iteration number every
progress_report_interval iterations.
zero_tolerance : int, optional (default=60)
The number of layers where the total correlation should not change
between RBIG iterations. If there is no zero_tolerance, then the
method will stop iterating regardless of how many the user sets as
the n_layers.
rotation_kwargs : dict, optional (default=None)
Any extra keyword arguments that you want to pass into the rotation
algorithms (i.e. ICA or PCA). See the respective algorithms on
scikit-learn for more details.
random_state : int, optional (default=None)
Control the seed for any randomization that occurs in this algorithm.
entropy_correction : bool, optional (default=True)
Implements the shannon-millow correction to the entropy algorithm
Attributes
----------
rbig_model_X : RBIG() object
The RBIG model fitted
rbig_model_Y :
rbig_model_XY :
References
----------
* Original Paper : Iterative Gaussianization: from ICA to Random Rotations
https://arxiv.org/abs/1602.00229
"""
def __init__(
self,
n_layers=50,
rotation_type="PCA",
pdf_resolution=1000,
pdf_extension=None,
random_state=None,
verbose=None,
tolerance=None,
zero_tolerance=100,
increment=1.5,
):
self.n_layers = n_layers
self.rotation_type = rotation_type
self.pdf_resolution = pdf_resolution
self.pdf_extension = pdf_extension
self.random_state = random_state
self.verbose = verbose
self.tolerance = tolerance
self.zero_tolerance = zero_tolerance
self.increment = 1.5
def fit(self, X, Y):
"""Inputs for the RBIGMI algorithm.
Parameters
----------
X : array, (n1_samples, d1_dimensions)
Y : array, (n2_samples, d2_dimensions)
Note: The number of dimensions and the number of samples
do not have to be the same.
"""
# Loop Until Convergence
fitted = None
try:
while fitted is None:
if self.verbose:
print(f"PDF Extension: {self.pdf_extension}%")
try:
# Initialize RBIG class I
self.rbig_model_X = RBIG(
n_layers=self.n_layers,
rotation_type=self.rotation_type,
pdf_resolution=self.pdf_resolution,
pdf_extension=self.pdf_extension,
verbose=None,
random_state=self.random_state,
zero_tolerance=self.zero_tolerance,
tolerance=self.tolerance,
)
# fit and transform model to the data
X_transformed = self.rbig_model_X.fit_transform(X)
# Initialize RBIG class II
self.rbig_model_Y = RBIG(
n_layers=self.n_layers,
rotation_type=self.rotation_type,
pdf_resolution=self.pdf_resolution,
pdf_extension=self.pdf_extension,
verbose=None,
random_state=self.random_state,
zero_tolerance=self.zero_tolerance,
tolerance=self.tolerance,
)
# fit model to the data
Y_transformed = self.rbig_model_Y.fit_transform(Y)
# Stack Data
if self.verbose:
print(X_transformed.shape, Y_transformed.shape)
XY_transformed = np.hstack([X_transformed, Y_transformed])
# Initialize RBIG class I & II
self.rbig_model_XY = RBIG(
n_layers=self.n_layers,
rotation_type=self.rotation_type,
random_state=self.random_state,
zero_tolerance=self.zero_tolerance,
tolerance=self.tolerance,
pdf_resolution=self.pdf_resolution,
pdf_extension=self.pdf_extension,
verbose=None,
)
# Fit RBIG model to combined dataset
self.rbig_model_XY.fit(XY_transformed)
fitted = True
except:
self.pdf_extension = self.increment * self.pdf_extension
except KeyboardInterrupt:
print("Interrupted!")
return self
def mutual_information(self):
"""Given that the algorithm has been fitted to two datasets, this
returns the mutual information between the two multidimensional
datasets.
Returns
-------
mutual_info : float
The mutual information between the two multidimensional
variables.
"""
return self.rbig_model_XY.residual_info.sum()
| 35.21164 | 84 | 0.579264 |
aceb520d23420b432c885fb26cfd6541ca0e8743 | 25,968 | py | Python | pychess/Utils/lutils/PolyglotHash.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | pychess/Utils/lutils/PolyglotHash.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | 40 | 2019-05-04T04:46:31.000Z | 2022-02-26T10:37:51.000Z | pychess/Utils/lutils/PolyglotHash.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import random
from pychess.Utils.const import WHITE, BLACK, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING
# Polyglot opening books are indexed by 64-bit Zobrist hash keys.
# The standard specifies the following Zobrist seed values.
# The numbers in this file come from PolyGlot by Fabien Letouzey.
# PolyGlot is available under the GNU GPL from http://wbec-ridderkerk.nl
pieceHashes = [
[
[0x0000000000000000] * 64,
[
0x5355F900C2A82DC7,
0x07FB9F855A997142,
0x5093417AA8A7ED5E,
0x7BCBC38DA25A7F3C,
0x19FC8A768CF4B6D4,
0x637A7780DECFC0D9,
0x8249A47AEE0E41F7,
0x79AD695501E7D1E8,
0x14ACBAF4777D5776,
0xF145B6BECCDEA195,
0xDABF2AC8201752FC,
0x24C3C94DF9C8D3F6,
0xBB6E2924F03912EA,
0x0CE26C0B95C980D9,
0xA49CD132BFBF7CC4,
0xE99D662AF4243939,
0x27E6AD7891165C3F,
0x8535F040B9744FF1,
0x54B3F4FA5F40D873,
0x72B12C32127FED2B,
0xEE954D3C7B411F47,
0x9A85AC909A24EAA1,
0x70AC4CD9F04F21F5,
0xF9B89D3E99A075C2,
0x87B3E2B2B5C907B1,
0xA366E5B8C54F48B8,
0xAE4A9346CC3F7CF2,
0x1920C04D47267BBD,
0x87BF02C6B49E2AE9,
0x092237AC237F3859,
0xFF07F64EF8ED14D0,
0x8DE8DCA9F03CC54E,
0x9C1633264DB49C89,
0xB3F22C3D0B0B38ED,
0x390E5FB44D01144B,
0x5BFEA5B4712768E9,
0x1E1032911FA78984,
0x9A74ACB964E78CB3,
0x4F80F7A035DAFB04,
0x6304D09A0B3738C4,
0x2171E64683023A08,
0x5B9B63EB9CEFF80C,
0x506AACF489889342,
0x1881AFC9A3A701D6,
0x6503080440750644,
0xDFD395339CDBF4A7,
0xEF927DBCF00C20F2,
0x7B32F7D1E03680EC,
0xB9FD7620E7316243,
0x05A7E8A57DB91B77,
0xB5889C6E15630A75,
0x4A750A09CE9573F7,
0xCF464CEC899A2F8A,
0xF538639CE705B824,
0x3C79A0FF5580EF7F,
0xEDE6C87F8477609D,
0x799E81F05BC93F31,
0x86536B8CF3428A8C,
0x97D7374C60087B73,
0xA246637CFF328532,
0x043FCAE60CC0EBA0,
0x920E449535DD359E,
0x70EB093B15B290CC,
0x73A1921916591CBD,
],
[
0xC547F57E42A7444E,
0x78E37644E7CAD29E,
0xFE9A44E9362F05FA,
0x08BD35CC38336615,
0x9315E5EB3A129ACE,
0x94061B871E04DF75,
0xDF1D9F9D784BA010,
0x3BBA57B68871B59D,
0xD2B7ADEEDED1F73F,
0xF7A255D83BC373F8,
0xD7F4F2448C0CEB81,
0xD95BE88CD210FFA7,
0x336F52F8FF4728E7,
0xA74049DAC312AC71,
0xA2F61BB6E437FDB5,
0x4F2A5CB07F6A35B3,
0x87D380BDA5BF7859,
0x16B9F7E06C453A21,
0x7BA2484C8A0FD54E,
0xF3A678CAD9A2E38C,
0x39B0BF7DDE437BA2,
0xFCAF55C1BF8A4424,
0x18FCF680573FA594,
0x4C0563B89F495AC3,
0x40E087931A00930D,
0x8CFFA9412EB642C1,
0x68CA39053261169F,
0x7A1EE967D27579E2,
0x9D1D60E5076F5B6F,
0x3810E399B6F65BA2,
0x32095B6D4AB5F9B1,
0x35CAB62109DD038A,
0xA90B24499FCFAFB1,
0x77A225A07CC2C6BD,
0x513E5E634C70E331,
0x4361C0CA3F692F12,
0xD941ACA44B20A45B,
0x528F7C8602C5807B,
0x52AB92BEB9613989,
0x9D1DFA2EFC557F73,
0x722FF175F572C348,
0x1D1260A51107FE97,
0x7A249A57EC0C9BA2,
0x04208FE9E8F7F2D6,
0x5A110C6058B920A0,
0x0CD9A497658A5698,
0x56FD23C8F9715A4C,
0x284C847B9D887AAE,
0x04FEABFBBDB619CB,
0x742E1E651C60BA83,
0x9A9632E65904AD3C,
0x881B82A13B51B9E2,
0x506E6744CD974924,
0xB0183DB56FFC6A79,
0x0ED9B915C66ED37E,
0x5E11E86D5873D484,
0xF678647E3519AC6E,
0x1B85D488D0F20CC5,
0xDAB9FE6525D89021,
0x0D151D86ADB73615,
0xA865A54EDCC0F019,
0x93C42566AEF98FFB,
0x99E7AFEABE000731,
0x48CBFF086DDF285A,
],
[
0x23B70EDB1955C4BF,
0xC330DE426430F69D,
0x4715ED43E8A45C0A,
0xA8D7E4DAB780A08D,
0x0572B974F03CE0BB,
0xB57D2E985E1419C7,
0xE8D9ECBE2CF3D73F,
0x2FE4B17170E59750,
0x11317BA87905E790,
0x7FBF21EC8A1F45EC,
0x1725CABFCB045B00,
0x964E915CD5E2B207,
0x3E2B8BCBF016D66D,
0xBE7444E39328A0AC,
0xF85B2B4FBCDE44B7,
0x49353FEA39BA63B1,
0x1DD01AAFCD53486A,
0x1FCA8A92FD719F85,
0xFC7C95D827357AFA,
0x18A6A990C8B35EBD,
0xCCCB7005C6B9C28D,
0x3BDBB92C43B17F26,
0xAA70B5B4F89695A2,
0xE94C39A54A98307F,
0xB7A0B174CFF6F36E,
0xD4DBA84729AF48AD,
0x2E18BC1AD9704A68,
0x2DE0966DAF2F8B1C,
0xB9C11D5B1E43A07E,
0x64972D68DEE33360,
0x94628D38D0C20584,
0xDBC0D2B6AB90A559,
0xD2733C4335C6A72F,
0x7E75D99D94A70F4D,
0x6CED1983376FA72B,
0x97FCAACBF030BC24,
0x7B77497B32503B12,
0x8547EDDFB81CCB94,
0x79999CDFF70902CB,
0xCFFE1939438E9B24,
0x829626E3892D95D7,
0x92FAE24291F2B3F1,
0x63E22C147B9C3403,
0xC678B6D860284A1C,
0x5873888850659AE7,
0x0981DCD296A8736D,
0x9F65789A6509A440,
0x9FF38FED72E9052F,
0xE479EE5B9930578C,
0xE7F28ECD2D49EECD,
0x56C074A581EA17FE,
0x5544F7D774B14AEF,
0x7B3F0195FC6F290F,
0x12153635B2C0CF57,
0x7F5126DBBA5E0CA7,
0x7A76956C3EAFB413,
0x3D5774A11D31AB39,
0x8A1B083821F40CB4,
0x7B4A38E32537DF62,
0x950113646D1D6E03,
0x4DA8979A0041E8A9,
0x3BC36E078F7515D7,
0x5D0A12F27AD310D1,
0x7F9D1A2E1EBE1327,
],
[
0xA09E8C8C35AB96DE,
0xFA7E393983325753,
0xD6B6D0ECC617C699,
0xDFEA21EA9E7557E3,
0xB67C1FA481680AF8,
0xCA1E3785A9E724E5,
0x1CFC8BED0D681639,
0xD18D8549D140CAEA,
0x4ED0FE7E9DC91335,
0xE4DBF0634473F5D2,
0x1761F93A44D5AEFE,
0x53898E4C3910DA55,
0x734DE8181F6EC39A,
0x2680B122BAA28D97,
0x298AF231C85BAFAB,
0x7983EED3740847D5,
0x66C1A2A1A60CD889,
0x9E17E49642A3E4C1,
0xEDB454E7BADC0805,
0x50B704CAB602C329,
0x4CC317FB9CDDD023,
0x66B4835D9EAFEA22,
0x219B97E26FFC81BD,
0x261E4E4C0A333A9D,
0x1FE2CCA76517DB90,
0xD7504DFA8816EDBB,
0xB9571FA04DC089C8,
0x1DDC0325259B27DE,
0xCF3F4688801EB9AA,
0xF4F5D05C10CAB243,
0x38B6525C21A42B0E,
0x36F60E2BA4FA6800,
0xEB3593803173E0CE,
0x9C4CD6257C5A3603,
0xAF0C317D32ADAA8A,
0x258E5A80C7204C4B,
0x8B889D624D44885D,
0xF4D14597E660F855,
0xD4347F66EC8941C3,
0xE699ED85B0DFB40D,
0x2472F6207C2D0484,
0xC2A1E7B5B459AEB5,
0xAB4F6451CC1D45EC,
0x63767572AE3D6174,
0xA59E0BD101731A28,
0x116D0016CB948F09,
0x2CF9C8CA052F6E9F,
0x0B090A7560A968E3,
0xABEEDDB2DDE06FF1,
0x58EFC10B06A2068D,
0xC6E57A78FBD986E0,
0x2EAB8CA63CE802D7,
0x14A195640116F336,
0x7C0828DD624EC390,
0xD74BBE77E6116AC7,
0x804456AF10F5FB53,
0xEBE9EA2ADF4321C7,
0x03219A39EE587A30,
0x49787FEF17AF9924,
0xA1E9300CD8520548,
0x5B45E522E4B1B4EF,
0xB49C3B3995091A36,
0xD4490AD526F14431,
0x12A8F216AF9418C2,
],
[
0x6FFE73E81B637FB3,
0xDDF957BC36D8B9CA,
0x64D0E29EEA8838B3,
0x08DD9BDFD96B9F63,
0x087E79E5A57D1D13,
0xE328E230E3E2B3FB,
0x1C2559E30F0946BE,
0x720BF5F26F4D2EAA,
0xB0774D261CC609DB,
0x443F64EC5A371195,
0x4112CF68649A260E,
0xD813F2FAB7F5C5CA,
0x660D3257380841EE,
0x59AC2C7873F910A3,
0xE846963877671A17,
0x93B633ABFA3469F8,
0xC0C0F5A60EF4CDCF,
0xCAF21ECD4377B28C,
0x57277707199B8175,
0x506C11B9D90E8B1D,
0xD83CC2687A19255F,
0x4A29C6465A314CD1,
0xED2DF21216235097,
0xB5635C95FF7296E2,
0x22AF003AB672E811,
0x52E762596BF68235,
0x9AEBA33AC6ECC6B0,
0x944F6DE09134DFB6,
0x6C47BEC883A7DE39,
0x6AD047C430A12104,
0xA5B1CFDBA0AB4067,
0x7C45D833AFF07862,
0x5092EF950A16DA0B,
0x9338E69C052B8E7B,
0x455A4B4CFE30E3F5,
0x6B02E63195AD0CF8,
0x6B17B224BAD6BF27,
0xD1E0CCD25BB9C169,
0xDE0C89A556B9AE70,
0x50065E535A213CF6,
0x9C1169FA2777B874,
0x78EDEFD694AF1EED,
0x6DC93D9526A50E68,
0xEE97F453F06791ED,
0x32AB0EDB696703D3,
0x3A6853C7E70757A7,
0x31865CED6120F37D,
0x67FEF95D92607890,
0x1F2B1D1F15F6DC9C,
0xB69E38A8965C6B65,
0xAA9119FF184CCCF4,
0xF43C732873F24C13,
0xFB4A3D794A9A80D2,
0x3550C2321FD6109C,
0x371F77E76BB8417E,
0x6BFA9AAE5EC05779,
0xCD04F3FF001A4778,
0xE3273522064480CA,
0x9F91508BFFCFC14A,
0x049A7F41061A9E60,
0xFCB6BE43A9F2FE9B,
0x08DE8A1C7797DA9B,
0x8F9887E6078735A1,
0xB5B4071DBFC73A66,
],
[
0x55B6344CF97AAFAE,
0xB862225B055B6960,
0xCAC09AFBDDD2CDB4,
0xDAF8E9829FE96B5F,
0xB5FDFC5D3132C498,
0x310CB380DB6F7503,
0xE87FBB46217A360E,
0x2102AE466EBB1148,
0xF8549E1A3AA5E00D,
0x07A69AFDCC42261A,
0xC4C118BFE78FEAAE,
0xF9F4892ED96BD438,
0x1AF3DBE25D8F45DA,
0xF5B4B0B0D2DEEEB4,
0x962ACEEFA82E1C84,
0x046E3ECAAF453CE9,
0xF05D129681949A4C,
0x964781CE734B3C84,
0x9C2ED44081CE5FBD,
0x522E23F3925E319E,
0x177E00F9FC32F791,
0x2BC60A63A6F3B3F2,
0x222BBFAE61725606,
0x486289DDCC3D6780,
0x7DC7785B8EFDFC80,
0x8AF38731C02BA980,
0x1FAB64EA29A2DDF7,
0xE4D9429322CD065A,
0x9DA058C67844F20C,
0x24C0E332B70019B0,
0x233003B5A6CFE6AD,
0xD586BD01C5C217F6,
0x5E5637885F29BC2B,
0x7EBA726D8C94094B,
0x0A56A5F0BFE39272,
0xD79476A84EE20D06,
0x9E4C1269BAA4BF37,
0x17EFEE45B0DEE640,
0x1D95B0A5FCF90BC6,
0x93CBE0B699C2585D,
0x65FA4F227A2B6D79,
0xD5F9E858292504D5,
0xC2B5A03F71471A6F,
0x59300222B4561E00,
0xCE2F8642CA0712DC,
0x7CA9723FBB2E8988,
0x2785338347F2BA08,
0xC61BB3A141E50E8C,
0x150F361DAB9DEC26,
0x9F6A419D382595F4,
0x64A53DC924FE7AC9,
0x142DE49FFF7A7C3D,
0x0C335248857FA9E7,
0x0A9C32D5EAE45305,
0xE6C42178C4BBB92E,
0x71F1CE2490D20B07,
0xF1BCC3D275AFE51A,
0xE728E8C83C334074,
0x96FBF83A12884624,
0x81A1549FD6573DA5,
0x5FA7867CAF35E149,
0x56986E2EF3ED091B,
0x917F1DD5F8886C61,
0xD20D8C88C8FFE65F,
],
],
[
[0x0000000000000000] * 64,
[
0x9D39247E33776D41,
0x2AF7398005AAA5C7,
0x44DB015024623547,
0x9C15F73E62A76AE2,
0x75834465489C0C89,
0x3290AC3A203001BF,
0x0FBBAD1F61042279,
0xE83A908FF2FB60CA,
0x0D7E765D58755C10,
0x1A083822CEAFE02D,
0x9605D5F0E25EC3B0,
0xD021FF5CD13A2ED5,
0x40BDF15D4A672E32,
0x011355146FD56395,
0x5DB4832046F3D9E5,
0x239F8B2D7FF719CC,
0x05D1A1AE85B49AA1,
0x679F848F6E8FC971,
0x7449BBFF801FED0B,
0x7D11CDB1C3B7ADF0,
0x82C7709E781EB7CC,
0xF3218F1C9510786C,
0x331478F3AF51BBE6,
0x4BB38DE5E7219443,
0xAA649C6EBCFD50FC,
0x8DBD98A352AFD40B,
0x87D2074B81D79217,
0x19F3C751D3E92AE1,
0xB4AB30F062B19ABF,
0x7B0500AC42047AC4,
0xC9452CA81A09D85D,
0x24AA6C514DA27500,
0x4C9F34427501B447,
0x14A68FD73C910841,
0xA71B9B83461CBD93,
0x03488B95B0F1850F,
0x637B2B34FF93C040,
0x09D1BC9A3DD90A94,
0x3575668334A1DD3B,
0x735E2B97A4C45A23,
0x18727070F1BD400B,
0x1FCBACD259BF02E7,
0xD310A7C2CE9B6555,
0xBF983FE0FE5D8244,
0x9F74D14F7454A824,
0x51EBDC4AB9BA3035,
0x5C82C505DB9AB0FA,
0xFCF7FE8A3430B241,
0x3253A729B9BA3DDE,
0x8C74C368081B3075,
0xB9BC6C87167C33E7,
0x7EF48F2B83024E20,
0x11D505D4C351BD7F,
0x6568FCA92C76A243,
0x4DE0B0F40F32A7B8,
0x96D693460CC37E5D,
0x42E240CB63689F2F,
0x6D2BDCDAE2919661,
0x42880B0236E4D951,
0x5F0F4A5898171BB6,
0x39F890F579F92F88,
0x93C5B5F47356388B,
0x63DC359D8D231B78,
0xEC16CA8AEA98AD76,
],
[
0x56436C9FE1A1AA8D,
0xEFAC4B70633B8F81,
0xBB215798D45DF7AF,
0x45F20042F24F1768,
0x930F80F4E8EB7462,
0xFF6712FFCFD75EA1,
0xAE623FD67468AA70,
0xDD2C5BC84BC8D8FC,
0x7EED120D54CF2DD9,
0x22FE545401165F1C,
0xC91800E98FB99929,
0x808BD68E6AC10365,
0xDEC468145B7605F6,
0x1BEDE3A3AEF53302,
0x43539603D6C55602,
0xAA969B5C691CCB7A,
0xA87832D392EFEE56,
0x65942C7B3C7E11AE,
0xDED2D633CAD004F6,
0x21F08570F420E565,
0xB415938D7DA94E3C,
0x91B859E59ECB6350,
0x10CFF333E0ED804A,
0x28AED140BE0BB7DD,
0xC5CC1D89724FA456,
0x5648F680F11A2741,
0x2D255069F0B7DAB3,
0x9BC5A38EF729ABD4,
0xEF2F054308F6A2BC,
0xAF2042F5CC5C2858,
0x480412BAB7F5BE2A,
0xAEF3AF4A563DFE43,
0x19AFE59AE451497F,
0x52593803DFF1E840,
0xF4F076E65F2CE6F0,
0x11379625747D5AF3,
0xBCE5D2248682C115,
0x9DA4243DE836994F,
0x066F70B33FE09017,
0x4DC4DE189B671A1C,
0x51039AB7712457C3,
0xC07A3F80C31FB4B4,
0xB46EE9C5E64A6E7C,
0xB3819A42ABE61C87,
0x21A007933A522A20,
0x2DF16F761598AA4F,
0x763C4A1371B368FD,
0xF793C46702E086A0,
0xD7288E012AEB8D31,
0xDE336A2A4BC1C44B,
0x0BF692B38D079F23,
0x2C604A7A177326B3,
0x4850E73E03EB6064,
0xCFC447F1E53C8E1B,
0xB05CA3F564268D99,
0x9AE182C8BC9474E8,
0xA4FC4BD4FC5558CA,
0xE755178D58FC4E76,
0x69B97DB1A4C03DFE,
0xF9B5B7C4ACC67C96,
0xFC6A82D64B8655FB,
0x9C684CB6C4D24417,
0x8EC97D2917456ED0,
0x6703DF9D2924E97E,
],
[
0x7F9B6AF1EBF78BAF,
0x58627E1A149BBA21,
0x2CD16E2ABD791E33,
0xD363EFF5F0977996,
0x0CE2A38C344A6EED,
0x1A804AADB9CFA741,
0x907F30421D78C5DE,
0x501F65EDB3034D07,
0x37624AE5A48FA6E9,
0x957BAF61700CFF4E,
0x3A6C27934E31188A,
0xD49503536ABCA345,
0x088E049589C432E0,
0xF943AEE7FEBF21B8,
0x6C3B8E3E336139D3,
0x364F6FFA464EE52E,
0xD60F6DCEDC314222,
0x56963B0DCA418FC0,
0x16F50EDF91E513AF,
0xEF1955914B609F93,
0x565601C0364E3228,
0xECB53939887E8175,
0xBAC7A9A18531294B,
0xB344C470397BBA52,
0x65D34954DAF3CEBD,
0xB4B81B3FA97511E2,
0xB422061193D6F6A7,
0x071582401C38434D,
0x7A13F18BBEDC4FF5,
0xBC4097B116C524D2,
0x59B97885E2F2EA28,
0x99170A5DC3115544,
0x6F423357E7C6A9F9,
0x325928EE6E6F8794,
0xD0E4366228B03343,
0x565C31F7DE89EA27,
0x30F5611484119414,
0xD873DB391292ED4F,
0x7BD94E1D8E17DEBC,
0xC7D9F16864A76E94,
0x947AE053EE56E63C,
0xC8C93882F9475F5F,
0x3A9BF55BA91F81CA,
0xD9A11FBB3D9808E4,
0x0FD22063EDC29FCA,
0xB3F256D8ACA0B0B9,
0xB03031A8B4516E84,
0x35DD37D5871448AF,
0xE9F6082B05542E4E,
0xEBFAFA33D7254B59,
0x9255ABB50D532280,
0xB9AB4CE57F2D34F3,
0x693501D628297551,
0xC62C58F97DD949BF,
0xCD454F8F19C5126A,
0xBBE83F4ECC2BDECB,
0xDC842B7E2819E230,
0xBA89142E007503B8,
0xA3BC941D0A5061CB,
0xE9F6760E32CD8021,
0x09C7E552BC76492F,
0x852F54934DA55CC9,
0x8107FCCF064FCF56,
0x098954D51FFF6580,
],
[
0xDA3A361B1C5157B1,
0xDCDD7D20903D0C25,
0x36833336D068F707,
0xCE68341F79893389,
0xAB9090168DD05F34,
0x43954B3252DC25E5,
0xB438C2B67F98E5E9,
0x10DCD78E3851A492,
0xDBC27AB5447822BF,
0x9B3CDB65F82CA382,
0xB67B7896167B4C84,
0xBFCED1B0048EAC50,
0xA9119B60369FFEBD,
0x1FFF7AC80904BF45,
0xAC12FB171817EEE7,
0xAF08DA9177DDA93D,
0x1B0CAB936E65C744,
0xB559EB1D04E5E932,
0xC37B45B3F8D6F2BA,
0xC3A9DC228CAAC9E9,
0xF3B8B6675A6507FF,
0x9FC477DE4ED681DA,
0x67378D8ECCEF96CB,
0x6DD856D94D259236,
0xA319CE15B0B4DB31,
0x073973751F12DD5E,
0x8A8E849EB32781A5,
0xE1925C71285279F5,
0x74C04BF1790C0EFE,
0x4DDA48153C94938A,
0x9D266D6A1CC0542C,
0x7440FB816508C4FE,
0x13328503DF48229F,
0xD6BF7BAEE43CAC40,
0x4838D65F6EF6748F,
0x1E152328F3318DEA,
0x8F8419A348F296BF,
0x72C8834A5957B511,
0xD7A023A73260B45C,
0x94EBC8ABCFB56DAE,
0x9FC10D0F989993E0,
0xDE68A2355B93CAE6,
0xA44CFE79AE538BBE,
0x9D1D84FCCE371425,
0x51D2B1AB2DDFB636,
0x2FD7E4B9E72CD38C,
0x65CA5B96B7552210,
0xDD69A0D8AB3B546D,
0x604D51B25FBF70E2,
0x73AA8A564FB7AC9E,
0x1A8C1E992B941148,
0xAAC40A2703D9BEA0,
0x764DBEAE7FA4F3A6,
0x1E99B96E70A9BE8B,
0x2C5E9DEB57EF4743,
0x3A938FEE32D29981,
0x26E6DB8FFDF5ADFE,
0x469356C504EC9F9D,
0xC8763C5B08D1908C,
0x3F6C6AF859D80055,
0x7F7CC39420A3A545,
0x9BFB227EBDF4C5CE,
0x89039D79D6FC5C5C,
0x8FE88B57305E2AB6,
],
[
0x001F837CC7350524,
0x1877B51E57A764D5,
0xA2853B80F17F58EE,
0x993E1DE72D36D310,
0xB3598080CE64A656,
0x252F59CF0D9F04BB,
0xD23C8E176D113600,
0x1BDA0492E7E4586E,
0x21E0BD5026C619BF,
0x3B097ADAF088F94E,
0x8D14DEDB30BE846E,
0xF95CFFA23AF5F6F4,
0x3871700761B3F743,
0xCA672B91E9E4FA16,
0x64C8E531BFF53B55,
0x241260ED4AD1E87D,
0x106C09B972D2E822,
0x7FBA195410E5CA30,
0x7884D9BC6CB569D8,
0x0647DFEDCD894A29,
0x63573FF03E224774,
0x4FC8E9560F91B123,
0x1DB956E450275779,
0xB8D91274B9E9D4FB,
0xA2EBEE47E2FBFCE1,
0xD9F1F30CCD97FB09,
0xEFED53D75FD64E6B,
0x2E6D02C36017F67F,
0xA9AA4D20DB084E9B,
0xB64BE8D8B25396C1,
0x70CB6AF7C2D5BCF0,
0x98F076A4F7A2322E,
0xBF84470805E69B5F,
0x94C3251F06F90CF3,
0x3E003E616A6591E9,
0xB925A6CD0421AFF3,
0x61BDD1307C66E300,
0xBF8D5108E27E0D48,
0x240AB57A8B888B20,
0xFC87614BAF287E07,
0xEF02CDD06FFDB432,
0xA1082C0466DF6C0A,
0x8215E577001332C8,
0xD39BB9C3A48DB6CF,
0x2738259634305C14,
0x61CF4F94C97DF93D,
0x1B6BACA2AE4E125B,
0x758F450C88572E0B,
0x959F587D507A8359,
0xB063E962E045F54D,
0x60E8ED72C0DFF5D1,
0x7B64978555326F9F,
0xFD080D236DA814BA,
0x8C90FD9B083F4558,
0x106F72FE81E2C590,
0x7976033A39F7D952,
0xA4EC0132764CA04B,
0x733EA705FAE4FA77,
0xB4D8F77BC3E56167,
0x9E21F4F903B33FD9,
0x9D765E419FB69F6D,
0xD30C088BA61EA5EF,
0x5D94337FBFAF7F5B,
0x1A4E4822EB4D7A59,
],
[
0x230E343DFBA08D33,
0x43ED7F5A0FAE657D,
0x3A88A0FBBCB05C63,
0x21874B8B4D2DBC4F,
0x1BDEA12E35F6A8C9,
0x53C065C6C8E63528,
0xE34A1D250E7A8D6B,
0xD6B04D3B7651DD7E,
0x5E90277E7CB39E2D,
0x2C046F22062DC67D,
0xB10BB459132D0A26,
0x3FA9DDFB67E2F199,
0x0E09B88E1914F7AF,
0x10E8B35AF3EEAB37,
0x9EEDECA8E272B933,
0xD4C718BC4AE8AE5F,
0x81536D601170FC20,
0x91B534F885818A06,
0xEC8177F83F900978,
0x190E714FADA5156E,
0xB592BF39B0364963,
0x89C350C893AE7DC1,
0xAC042E70F8B383F2,
0xB49B52E587A1EE60,
0xFB152FE3FF26DA89,
0x3E666E6F69AE2C15,
0x3B544EBE544C19F9,
0xE805A1E290CF2456,
0x24B33C9D7ED25117,
0xE74733427B72F0C1,
0x0A804D18B7097475,
0x57E3306D881EDB4F,
0x4AE7D6A36EB5DBCB,
0x2D8D5432157064C8,
0xD1E649DE1E7F268B,
0x8A328A1CEDFE552C,
0x07A3AEC79624C7DA,
0x84547DDC3E203C94,
0x990A98FD5071D263,
0x1A4FF12616EEFC89,
0xF6F7FD1431714200,
0x30C05B1BA332F41C,
0x8D2636B81555A786,
0x46C9FEB55D120902,
0xCCEC0A73B49C9921,
0x4E9D2827355FC492,
0x19EBB029435DCB0F,
0x4659D2B743848A2C,
0x963EF2C96B33BE31,
0x74F85198B05A2E7D,
0x5A0F544DD2B1FB18,
0x03727073C2E134B1,
0xC7F6AA2DE59AEA61,
0x352787BAA0D7C22F,
0x9853EAB63B5E0B35,
0xABBDCDD7ED5C0860,
0xCF05DAF5AC8D77B0,
0x49CAD48CEBF4A71E,
0x7A4C10EC2158C4A6,
0xD9E92AA246BF719E,
0x13AE978D09FE5557,
0x730499AF921549FF,
0x4E4B705B92903BA4,
0xFF577222C14F0A3A,
],
],
]
epHashes = [
0x70CC73D90BC26E24,
0xE21A6B35DF0C3AD7,
0x003A93D8B2806962,
0x1C99DED33CB890A1,
0xCF3145DE0ADD4289,
0xD0E4427A5514FB72,
0x77C621CC9FB3A483,
0x67A34DAC4356550B,
]
W_OOHash = 0x31D71DCE64B2C310
W_OOOHash = 0xF165B587DF898190
B_OOHash = 0xA57E6339DD2CF3A0
B_OOOHash = 0x1EF6E6DBB1961EC9
colorHash = 0xF8D626AAAF278509
holdingHash = [[[0], [0], [0], [0], [0], [0], [0]], [[0], [0], [0], [0], [0], [0], [0]]]
for color in (WHITE, BLACK):
for pt in (PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING):
for i in range(16):
holdingHash[color][pt].append(random.getrandbits(64))
| 31.062201 | 88 | 0.562038 |
aceb5227c38b6cdc60aa7dc8818e455421b59054 | 627 | py | Python | mySpider/__init__.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | mySpider/__init__.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | mySpider/__init__.py | qq453388937/Scarapy_Git | 6faa32684b76841face3d977fb162290cb79d177 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdetaultencoding('utf-8')
"""
for python2 also
coding:utf-8
__title__ = ''
__author__ = 'faith'
__mtime__ = '18-4-1'
Created by faith on 18-4-1.
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
┏┓ ┏┓
┏┛┻━━━┛┻┓
┃ ☃ ┃
┃ ┳┛ ┗┳ ┃
┃ ┻ ┃
┗━┓ ┏━┛
┃ ┗━━━┓
┃ 神兽保佑 ┣┓
┃ 永无BUG! ┏┛
┗┓┓┏━┳┓┏┛
┃┫┫ ┃┫┫
┗┻┛ ┗┻┛
""" | 23.222222 | 59 | 0.350877 |
aceb5228a659db7a8cf0faa08b479715655ddbe6 | 6,959 | py | Python | models/train_classifier.py | eugeniftimoaie/webapp-disaster-response | 7900c62291dbe4b3f949623e766742113680dd08 | [
"MIT"
] | null | null | null | models/train_classifier.py | eugeniftimoaie/webapp-disaster-response | 7900c62291dbe4b3f949623e766742113680dd08 | [
"MIT"
] | null | null | null | models/train_classifier.py | eugeniftimoaie/webapp-disaster-response | 7900c62291dbe4b3f949623e766742113680dd08 | [
"MIT"
] | null | null | null | '''
Machine Learning Pipeline for loading data from Sqlite database, splitting database into train and test sets, building a text processing and machine learning pipeline, training and tuning the model, outputting results on the test set and exporting final model as a pickle file.
'''
# import python libraries
import sys
import pandas as pd
from sqlalchemy import create_engine
import re
import nltk
nltk.download(['punkt','stopwords'])
from nltk.tokenize import word_tokenize
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.corpus import stopwords
from sklearn.pipeline import Pipeline
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.multioutput import MultiOutputClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import classification_report, precision_recall_fscore_support
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
import joblib
def load_data(database_filepath):
"""
Function to load sqlite database
Args:
database_filepath (str): path to database file
Returns:
X (pd.Series, str): containing messages
y (pd.DataFrame): containing features (target variables)
category names (pd.Series, str): list with names of the features (target variables)
"""
engine = create_engine('sqlite:///' + database_filepath)
df = pd.read_sql_table('FigureEight_data', con = engine)
# define feature and target variables X, y
X = df['message']
Y = df.iloc[:, 4:]
# category names
category_names = list(df.columns[4:])
return X, Y, category_names
def tokenize(text):
"""
Function to process text data taking following steps:
1) normalization and punctuation removal: convert to lower case and remove punctuations
2) tokenization: splitting each sentence into sequence of words
3) stop words removal: removal of words which do not add a meaning to the sentence
4) lemmatization: reducting words to their root form
Args:
text (str): string with message
Returns:
clean_tokens: cleaned tokens of the message with word list
"""
# normalize case and remove punctuation
text = re.sub(r"[^a-zA-Z0-9]", " ", text.lower())
# tokenize text and innitiate lemmatizer
tokens = word_tokenize(text)
lemmatizer = WordNetLemmatizer()
# remove stopwords
tokens = [w for w in tokens if w not in stopwords.words('english')]
# iterate through each token
clean_tokens = []
for tok in tokens:
# lemmatize and remove leading/ trailing white space
clean_tok = lemmatizer.lemmatize(tok).strip()
clean_tokens.append(clean_tok)
return clean_tokens
def build_model():
"""
Function to create (initialize) a Model with classification results on the categories of the dataset and to optimize entire Workflow (parameter tuning)
Args:
none
Returns:
cv: cross-validation generator of GridSearchCV over full pipeline showing classification results
"""
# build pipeline
pipeline = Pipeline([
('vect', CountVectorizer(tokenizer = tokenize)),
('tfidf', TfidfTransformer()),
('clf', MultiOutputClassifier(DecisionTreeClassifier()))
])
# parameters for Grid Search
parameters = {
#'clf__estimator__criterion': ['gini', 'entropy']
}
# initializing a Grid Search
cv = GridSearchCV(estimator = pipeline, param_grid = parameters)
return cv
def evaluate_model(model, X_test, Y_test, category_names):
"""
Function to evaluate model by computing f1_score, precision and recall for each target variable (feature) and as overall score (mean of all target variables (features))
Args:
model (function): build_model function with classification results
X_test (pd.Series, str): containing messages of test set
y_test (pd.DataFrame): containing features (target variables) of test set
category_names (pd.Series, str): containing category_names of features (target variables)
Returns:
df (pd.DataFrame): containing data of category, f1_score, precision and recall for each target variable (feature)
print statements with overall f1_score, precision and recall
"""
# predict on test data
Y_pred = model.predict(X_test)
# create empty dataframe for results with columns Category, f1_score, precision and recall
results = pd.DataFrame(columns = ['category', 'f1_score', 'precision', 'recall'])
# iterate through y_test columns with target variables (features) for scores of each feature
i = 0
for category in Y_test.columns:
precision, recall, f1_score, support = precision_recall_fscore_support(Y_test[category], Y_pred[:,i], average = 'weighted')
results.at[i + 1, 'category'] = category
results.at[i + 1, 'f1_score'] = f1_score
results.at[i + 1, 'precision'] = precision
results.at[i + 1, 'recall'] = recall
i += 1
# print dataframe results
print (results)
# print mean scores of all target variables (features)
print('Overall f1_score: ', '{:.4}'.format(results['f1_score'].mean()))
print('Overall precision: ', '{:.4}'.format(results['precision'].mean()))
print('Overall recall: ', '{:.4}'.format(results['recall'].mean()))
#return results
def save_model(model, model_filepath):
"""
Function to save trained model into a pickle file
Args:
model_filename (str): path to the pickle file
Returns:
pickle file with trained model
"""
joblib.dump(model, model_filepath)
def main():
if len(sys.argv) == 3:
database_filepath, model_filepath = sys.argv[1:]
print('Loading data...\n DATABASE: {}'.format(database_filepath))
X, Y, category_names = load_data(database_filepath)
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.2)
print('Shape of training set: X_train {} | Y_train {}'.format(X_train.shape, Y_train.shape))
print('Shape of testing set: X_train {} | Y_train {}'.format(X_test.shape, Y_test.shape))
print('Building model...')
model = build_model()
print('Training model...')
model.fit(X_train, Y_train)
print('Evaluating model...')
print(evaluate_model(model, X_test, Y_test, category_names))
print('Saving model...\n MODEL: {}'.format(model_filepath))
save_model(model, model_filepath)
print('Trained model saved!')
else:
print('Please provide the filepath of the disaster messages database '\
'as the first argument and the filepath of the pickle file to '\
'save the model to as the second argument. \n\nExample: python '\
'train_classifier.py ../data/drp.db classifier.pkl')
if __name__ == '__main__':
main()
| 34.621891 | 277 | 0.685874 |
aceb526fef1b8284e105987b0d0f5983c13688bd | 3,812 | py | Python | data/p4VQE/R4/benchmark/startQiskit_Class647.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_Class647.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_Class647.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=33
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def build_oracle(n: int, f) -> QuantumCircuit:
# implement the oracle O_f^\pm
# NOTE: use U1 gate (P gate) with \lambda = 180 ==> CZ gate
# or multi_control_Z_gate (issue #127)
controls = QuantumRegister(n, "ofc")
oracle = QuantumCircuit(controls, name="Zf")
for i in range(2 ** n):
rep = np.binary_repr(i, n)
if f(rep) == "1":
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
# oracle.h(controls[n])
if n >= 2:
oracle.mcu1(pi, controls[1:], controls[0])
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
# oracle.barrier()
return oracle
def make_circuit(n:int,f) -> QuantumCircuit:
# circuit begin
input_qubit = QuantumRegister(n,"qc")
classical = ClassicalRegister(n, "qm")
prog = QuantumCircuit(input_qubit, classical)
prog.h(input_qubit[0]) # number=3
prog.h(input_qubit[1]) # number=4
prog.h(input_qubit[2]) # number=5
prog.cx(input_qubit[3],input_qubit[2]) # number=28
prog.h(input_qubit[3]) # number=6
prog.h(input_qubit[4]) # number=21
Zf = build_oracle(n, f)
repeat = floor(sqrt(2 ** n) * pi / 4)
for i in range(1):
prog.append(Zf.to_gate(), [input_qubit[i] for i in range(n)])
prog.h(input_qubit[0]) # number=1
prog.h(input_qubit[1]) # number=2
prog.h(input_qubit[2]) # number=7
prog.h(input_qubit[3]) # number=8
prog.cx(input_qubit[4],input_qubit[3]) # number=26
prog.h(input_qubit[2]) # number=29
prog.cx(input_qubit[1],input_qubit[0]) # number=22
prog.cx(input_qubit[3],input_qubit[1]) # number=25
prog.x(input_qubit[0]) # number=23
prog.h(input_qubit[0]) # number=30
prog.cz(input_qubit[1],input_qubit[0]) # number=31
prog.h(input_qubit[0]) # number=32
prog.x(input_qubit[1]) # number=10
prog.x(input_qubit[2]) # number=11
prog.x(input_qubit[3]) # number=12
prog.x(input_qubit[1]) # number=27
if n>=2:
prog.mcu1(pi,input_qubit[1:],input_qubit[0])
prog.x(input_qubit[0]) # number=13
prog.x(input_qubit[1]) # number=14
prog.x(input_qubit[2]) # number=15
prog.x(input_qubit[3]) # number=16
prog.h(input_qubit[0]) # number=17
prog.h(input_qubit[1]) # number=18
prog.h(input_qubit[2]) # number=19
prog.h(input_qubit[3]) # number=20
prog.h(input_qubit[0])
prog.h(input_qubit[1])
prog.h(input_qubit[2])
prog.h(input_qubit[3])
# circuit end
return prog
if __name__ == '__main__':
key = "00000"
f = lambda rep: str(int(rep == key))
prog = make_circuit(5,f)
backend = BasicAer.get_backend('statevector_simulator')
sample_shot =7924
info = execute(prog, backend=backend).result().get_statevector()
qubits = round(log2(len(info)))
info = {
np.binary_repr(i, qubits): round((info[i]*(info[i].conjugate())).real,3)
for i in range(2 ** qubits)
}
backend = FakeVigo()
circuit1 = transpile(prog,backend,optimization_level=2)
writefile = open("../data/startQiskit_Class647.csv","w")
print(info,file=writefile)
print("results end", file=writefile)
print(circuit1.depth(),file=writefile)
print(circuit1,file=writefile)
writefile.close()
| 29.78125 | 80 | 0.601784 |
aceb52ff4136f8bfa60eb118efcae07f5bf96e2a | 2,655 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/network/tests/unit/plugins/modules/network/opx/opx_module.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/network/tests/unit/plugins/modules/network/opx/opx_module.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/network/tests/unit/plugins/modules/network/opx/opx_module.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # (c) 2018 Red Hat Inc.
#
# (c) 2018 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
from ansible_collections.community.network.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures')
fixture_data = {}
def load_fixture(name):
path = os.path.join(fixture_path, name)
if path in fixture_data:
return fixture_data[path]
with open(path) as f:
data = f.read()
try:
data = json.loads(data)
except Exception:
pass
fixture_data[path] = data
return data
class TestOpxModule(ModuleTestCase):
def execute_module(self, failed=False, changed=False,
response=None, msg=None, db=None,
commit_event=None):
self.load_fixtures(response)
if failed:
result = self.failed(msg)
self.assertTrue(result['failed'], result)
else:
result = self.changed(changed, db)
self.assertEqual(result['changed'], changed, result)
return result
def failed(self, msg):
with self.assertRaises(AnsibleFailJson) as exc:
self.module.main()
result = exc.exception.args[0]
self.assertTrue(result['failed'], result)
self.assertEqual(result['msg'], msg, result)
return result
def changed(self, changed=False, db=None):
with self.assertRaises(AnsibleExitJson) as exc:
self.module.main()
result = exc.exception.args[0]
print("res" + str(result) + "dv=" + str(db) + "ch=" + str(changed))
self.assertEqual(result['changed'], changed, result)
if db:
self.assertEqual(result['db'], db, result)
return result
def load_fixtures(self, response=None):
pass
| 28.858696 | 131 | 0.6629 |
aceb533a1cd188ef9d1bbb1ff9a546e387e7dc77 | 8,593 | py | Python | gammapy/makers/background/tests/test_fov.py | luca-giunti/gammapy | f5873caa3e0ec7175df4647fca83cd44d1ab8fcc | [
"BSD-3-Clause"
] | null | null | null | gammapy/makers/background/tests/test_fov.py | luca-giunti/gammapy | f5873caa3e0ec7175df4647fca83cd44d1ab8fcc | [
"BSD-3-Clause"
] | null | null | null | gammapy/makers/background/tests/test_fov.py | luca-giunti/gammapy | f5873caa3e0ec7175df4647fca83cd44d1ab8fcc | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from numpy.testing import assert_allclose
from astropy.coordinates import Angle, SkyCoord
from regions import CircleSkyRegion
from gammapy.data import DataStore
from gammapy.datasets import MapDataset
from gammapy.makers import FoVBackgroundMaker, MapDatasetMaker, SafeMaskMaker
from gammapy.maps import MapAxis, WcsGeom
from gammapy.modeling.models import (
FoVBackgroundModel,
GaussianSpatialModel,
PowerLawSpectralModel,
PowerLawNormSpectralModel,
SkyModel,
)
from gammapy.utils.testing import requires_data, requires_dependency
@pytest.fixture(scope="session")
def observation():
"""Example observation list for testing."""
datastore = DataStore.from_dir("$GAMMAPY_DATA/hess-dl3-dr1/")
obs_id = 23523
return datastore.obs(obs_id)
@pytest.fixture(scope="session")
def geom():
energy_axis = MapAxis.from_edges([1, 10], unit="TeV", name="energy", interp="log")
return WcsGeom.create(
skydir=SkyCoord(83.633, 22.014, unit="deg"),
binsz=0.02,
width=(5, 5),
frame="galactic",
proj="CAR",
axes=[energy_axis],
)
@pytest.fixture(scope="session")
def reference(geom):
return MapDataset.create(geom)
@pytest.fixture(scope="session")
def exclusion_mask(geom):
"""Example mask for testing."""
pos = SkyCoord(83.633, 22.014, unit="deg", frame="icrs")
region = CircleSkyRegion(pos, Angle(0.3, "deg"))
return ~geom.region_mask([region])
@pytest.fixture(scope="session")
def obs_dataset(geom, observation):
safe_mask_maker = SafeMaskMaker(methods=["offset-max"], offset_max="2 deg")
map_dataset_maker = MapDatasetMaker(selection=["counts", "background", "exposure"])
reference = MapDataset.create(geom)
cutout = reference.cutout(
observation.pointing_radec, width="4 deg", name="test-fov"
)
dataset = map_dataset_maker.run(cutout, observation)
dataset = safe_mask_maker.run(dataset, observation)
return dataset
def test_fov_bkg_maker_incorrect_method():
with pytest.raises(ValueError):
FoVBackgroundMaker(method="bad")
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit(obs_dataset, exclusion_mask):
fov_bkg_maker = FoVBackgroundMaker(method="fit", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 0.830789, rtol=1e-4)
assert_allclose(model.tilt.value, 0.0, rtol=1e-4)
@requires_data()
def test_fov_bkg_maker_scale(obs_dataset, exclusion_mask, caplog):
fov_bkg_maker = FoVBackgroundMaker(method="scale", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 0.83, rtol=1e-2)
assert_allclose(model.norm.error, 0.0207, rtol=1e-2)
assert_allclose(model.tilt.value, 0.0, rtol=1e-2)
@requires_data()
def test_fov_bkg_maker_scale_nocounts(obs_dataset, exclusion_mask, caplog):
fov_bkg_maker = FoVBackgroundMaker(method="scale", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
test_dataset.counts *= 0
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 1, rtol=1e-4)
assert_allclose(model.tilt.value, 0.0, rtol=1e-2)
assert caplog.records[-1].levelname == "WARNING"
assert (
"Only 0 counts outside exclusion mask for test-fov"
in caplog.records[-1].message
)
assert "FoVBackgroundMaker failed" in caplog.records[-1].message
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit(obs_dataset, exclusion_mask):
spectral_model = PowerLawNormSpectralModel()
spectral_model.tilt.frozen = False
fov_bkg_maker = FoVBackgroundMaker(
method="fit", exclusion_mask=exclusion_mask, spectral_model=spectral_model
)
test_dataset = obs_dataset.copy(name="test-fov")
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 0.901523, rtol=1e-4)
assert_allclose(model.tilt.value, 0.071069, rtol=1e-4)
assert_allclose(fov_bkg_maker.default_spectral_model.tilt.value, 0.0)
assert_allclose(fov_bkg_maker.default_spectral_model.norm.value, 1.0)
@pytest.mark.xfail
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit_nocounts(obs_dataset, exclusion_mask, caplog):
fov_bkg_maker = FoVBackgroundMaker(method="fit", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
test_dataset.counts *= 0
dataset = fov_bkg_maker.run(test_dataset)
# This should be solved along with issue https://github.com/gammapy/gammapy/issues/3175
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 1, rtol=1e-4)
assert_allclose(model.tilt.value, 0.0, rtol=1e-4)
assert caplog.records[-1].levelname == "WARNING"
assert f"Fit did not converge for {dataset.name}" in caplog.records[-1].message
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit_with_source_model(obs_dataset, exclusion_mask):
fov_bkg_maker = FoVBackgroundMaker(method="fit", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
spatial_model = GaussianSpatialModel(
lon_0="0.2 deg", lat_0="0.1 deg", sigma="0.2 deg", frame="galactic"
)
spectral_model = PowerLawSpectralModel(
index=3, amplitude="1e-11 cm-2 s-1 TeV-1", reference="1 TeV"
)
model = SkyModel(
spatial_model=spatial_model, spectral_model=spectral_model, name="test-source"
)
bkg_model = FoVBackgroundModel(dataset_name="test-fov")
test_dataset.models = [model, bkg_model]
dataset = fov_bkg_maker.run(test_dataset)
# Here we check that source parameters are correctly thawed after fit.
assert not dataset.models.parameters["index"].frozen
assert not dataset.models.parameters["lon_0"].frozen
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert not model.norm.frozen
assert_allclose(model.norm.value, 0.830789, rtol=1e-4)
assert_allclose(model.tilt.value, 0.0, rtol=1e-4)
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit_with_tilt(obs_dataset, exclusion_mask):
fov_bkg_maker = FoVBackgroundMaker(method="fit", exclusion_mask=exclusion_mask,)
test_dataset = obs_dataset.copy(name="test-fov")
model = FoVBackgroundModel(dataset_name="test-fov")
model.spectral_model.tilt.frozen = False
test_dataset.models = [model]
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 0.901523, rtol=1e-4)
assert_allclose(model.tilt.value, 0.071069, rtol=1e-4)
@requires_data()
@requires_dependency("iminuit")
def test_fov_bkg_maker_fit_fail(obs_dataset, exclusion_mask, caplog):
fov_bkg_maker = FoVBackgroundMaker(method="fit", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
# Putting null background model to prevent convergence
test_dataset.background.data *= 0
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 1, rtol=1e-4)
assert caplog.records[-1].levelname == "WARNING"
assert f"Fit did not converge for {dataset.name}" in caplog.records[-1].message
@requires_data()
def test_fov_bkg_maker_scale_fail(obs_dataset, exclusion_mask, caplog):
fov_bkg_maker = FoVBackgroundMaker(method="scale", exclusion_mask=exclusion_mask)
test_dataset = obs_dataset.copy(name="test-fov")
# Putting negative background model to prevent correct scaling
test_dataset.background.data *= -1
dataset = fov_bkg_maker.run(test_dataset)
model = dataset.models[f"{dataset.name}-bkg"].spectral_model
assert_allclose(model.norm.value, 1, rtol=1e-4)
assert caplog.records[-1].levelname == "WARNING"
assert (
f"Only -1940 background counts outside exclusion mask for test-fov"
in caplog.records[-1].message
)
assert "FoVBackgroundMaker failed" in caplog.records[-1].message
| 35.804167 | 91 | 0.738741 |
aceb535f3b280371e44e9aff091498d4a056bc5a | 1,041 | py | Python | 05_CovidProj/web/test_plot/test.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | 2 | 2019-03-17T23:38:48.000Z | 2019-03-23T06:12:34.000Z | 05_CovidProj/web/test_plot/test.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | null | null | null | 05_CovidProj/web/test_plot/test.py | QApolo/CS | 44e3c547544ac06da095641160b8d5956b31e149 | [
"MIT"
] | null | null | null |
import matplotlib.pyplot as plt
s = [0.8, 0.74, 0.5970875, 0.3189681075341796, 0.018355197727011552, -0.0035659216287486344, -0.0016499259299776815, -0.001303913686803759, -0.0011957608257480313, -0.0011564395705535588, -0.0011413519114286837, -0.0011354424028935416, -0.0011331090809594774, -0.0011321848582920653, -0.0011318183156380063]
i = [0.2, 0.14, 0.19891250000000002, 0.3576843924658204, 0.4436866667934962, 0.1993957860731587, 0.07784231873049254, 0.030790915249023092, 0.01220821323855351, 0.004843964040226931, 0.0019224979569658974, 0.0007630896742512168, 0.0003029025477664225, 0.00012023679643915687, 0.00004772817592160383]
r = [0, 0.12, 0.20400000000000001, 0.3233475, 0.5379581354794922, 0.8041701355555899, 0.9238076071994852, 0.9705129984377807, 0.9889875475871945, 0.9963124755303266, 0.9992188539544629, 1.0003723527286423, 1.000830206533193, 1.001011948061853, 1.0010840901397164]
plt.plot(s, label="S")
plt.plot(i, label="I")
plt.plot(r, label ="R")
plt.legend()
plt.xlabel("Time")
plt.ylabel("Portion")
plt.show() | 74.357143 | 307 | 0.79731 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.