piotrdabkowski / pyjsparser Goto Github PK
View Code? Open in Web Editor NEWFast JavaScript parser for Python.
License: MIT License
Fast JavaScript parser for Python.
License: MIT License
I am trying to parse a number of JavaScript codes into AST, the code is from a dataset and it might have syntax error.
Is there away i can use tolerant mode in pyjsparser?
Thank you.
I've forked it and replaced
And fixed some imports, but it's not tested to fit a python2, so I didn't make a pull request.
Hi,
Would you mind adding the license under which you're releasing this code?
PS: MIT would be awesome 👍
Thanks
The parser seems to ignore/lose comments, I expect the reason is the same as #11 (wasn't necessary) but just in case, any plans to add them?
According to https://pypi.org/project/pyjsparser/ latest version is 2.7.1 however there is no version git tag in repo.
Is it possible to add such tag on exact tag?
Hey, we've been using pyjsparser
in our project coala-quickstart to parse JS files and extract information.
It would be great if we can have continuous integration for common platforms (ubuntu, windows, and osx) in the official repository of "pyjsparser".
Also, I tested the library for coverage and came to know it's around 30%. Maybe we can write more tests to improve the coverage of tests 😅
Let me know what do you think of these ideas. If ideas seem worth executing, I'll also be able to help in the above tasks 😄
See at:
pyjsparser/pyjsparser/parser.py
Line 177 in ff57386
In my case this is a problem because I can't directly serialize the tree with json.
I want to use pyjsparser to write an identifier renamer. For this I generate an AST from the JScode, modify the AST and then convert it back to JavaScript. I know how to generate the AST with pyjsparser. Can I then somehow generate JavaScript from the AST?
pyjsparser line 1163 has a call to method parseParams() which does not supply an argument for formal firstRestricted.
In a statically-analysable language, this would not even have been compilable ...
Is there any way I can parse JavaScript Comments, like below ?
//alert(0);
/*
prompt("do you?");
Some comments
*/
i use pyjsparser in my program
import pyjsparser
or
from pyjsparser import PyJsParser
when program run , it takes as long time to import .
about 2 seconds for import 。
env:
os: win10 1609
cpu: AMD athlon II x3 450
mem: 6G
py : python 3.7 win32
How can we reverse the parsed code (the obtained dictionary) to get the initial one?
code location information can not found, line? col_offset?
For example,
var a = 2;
AST element is:
{
"type": "ExpressionStatement",
"expression": {
"operator": "=",
"right": {
"raw": null,
"type": "Literal",
"value": 2.0
},
"type": "AssignmentExpression",
"left": {
"type": "Identifier",
"name": "a"
}
}
}
Do you have a solution for this issue?
my computer import pyjsparser is very slowly.
test code :
print("begin")
ticks = []
import time
tick_s = time.perf_counter()
import pyjsparser.pyjsparserdata
ticks.append(time.perf_counter() - tick_s)
print("import time =",ticks)
result is:
begin
import time = [1.543109415]
i found slowly code is :
for c in map(unichr, range(sys.maxunicode + 1)):
U_CATEGORIES[unicodedata.category(c)].append(c)
it is found that
1 var U_CATEGORIES is very large
2 var U_CATEGORIES is only used to assign values to other variables.
i change the code for pyjsparserdata.py in line224
import pickle
import os
fn = os.path.dirname(os.path.abspath(__file__))
fn = os.path.join(fn,"u_dict.bin")
try:
with open(fn, "rb") as f:
UNICODE_LETTER,UNICODE_COMBINING_MARK,UNICODE_DIGIT,UNICODE_CONNECTOR_PUNCTUATION,IDENTIFIER_START,IDENTIFIER_PART = pickle.load(f)
except FileNotFoundError as e:
for c in map(unichr, range(sys.maxunicode + 1)):
U_CATEGORIES[unicodedata.category(c)].append(c)
UNICODE_LETTER = set(U_CATEGORIES['Lu']+U_CATEGORIES['Ll']+
U_CATEGORIES['Lt']+U_CATEGORIES['Lm']+
U_CATEGORIES['Lo']+U_CATEGORIES['Nl'])
UNICODE_COMBINING_MARK = set(U_CATEGORIES['Mn']+U_CATEGORIES['Mc'])
UNICODE_DIGIT = set(U_CATEGORIES['Nd'])
UNICODE_CONNECTOR_PUNCTUATION = set(U_CATEGORIES['Pc'])
IDENTIFIER_START = UNICODE_LETTER.union(set(('$','_', '\\'))) # and some fucking unicode escape sequence
IDENTIFIER_PART = IDENTIFIER_START.union(UNICODE_COMBINING_MARK).union(UNICODE_DIGIT)\
.union(UNICODE_CONNECTOR_PUNCTUATION).union(set((ZWJ, ZWNJ)))
saveVar=[UNICODE_LETTER,UNICODE_COMBINING_MARK,UNICODE_DIGIT,UNICODE_CONNECTOR_PUNCTUATION,IDENTIFIER_START,IDENTIFIER_PART]
with open(fn,"wb") as f:
pickle.dump(saveVar, f)
test result:
first run:
begin
import time = [1.836442004]
second run:
begin
import time = [0.240046614]
i hope this code is useful for your module .
my English is poor , forgive me !
Unable to parse: https://onfido.com/js/supported-docs.js
Traceback (most recent call last):
File "scrape_onfido.py", line 12, in <module>
print(parse(data))
File "/venv/lib/python3.7/site-packages/pyjsparser/parser.py", line 3018, in parse
return p.parse(javascript_code)
File "/venv/lib/python3.7/site-packages/pyjsparser/parser.py", line 3010, in parse
raise self.createError(self.lineNumber, self.lastIndex, unicode(e))
pyjsparser.pyjsparserdata.JsSyntaxError: Line 1: ArrowFunction is not supported by ECMA 5.1.
I see a number of releases in the pypi release history but no corresponding release tags in this repository. Would it be possible to add release tags?
Hi there,
Is this module able to parse this file and output it into a HTML sytle tagged document?
JSON:
https://thisiscriminal.com/wp-json/criminal/v1/episodes?posts=10000&page=1
Required output style:
https://pastebin.com/x7Eep284
I'm having issues parsing a JSON Wordpress site into HTML so beautifulsoup can read it. Any advice would be appreciated.
Could python 2.6 be supported?
Same issue as PiotrDabkowski/Js2Py#172
Repro:
function f() {
(a, b) => true;
}
Gives the following error:
<long stack trace removed>
File "/home/petter/.local/share/virtualenvs/ledev-ZDcxcYku/lib/python3.6/site-packages/pyjsparser/parser.py", line 1925, in parseAssignmentExpression
if (expr.type == PlaceHolders.ArrowParameterPlaceHolder or self.match('=>')):
AttributeError: 'dict' object has no attribute 'type'
I realize this syntax is not supported, but this AttributeError seems like a bug.
pyjsparser.py line 262 has "elif (i == 'true' or d == 'false'):". The LHS of the first comparison should be d, not i, which isn't defined in the current scope.
Even with that fixed, the output AST encodes the truth values as Literals. To output identifiers, I simply commented-out ll 262--263.
Currently there's only a wheel for python2 (see https://pypi.org/project/pyjsparser/#files) - Could you provide a python3 wheel e.g. to use this package in pyodide?
Pyodide is a python distribution for the browser and Node.js based on WebAssembly. Especially useful for playgrounds/education (e. g. JupyterLite) and interactive documentation (e. g. markdown-exec) - pure python wheels are directly supported
The pyjsparser package available on pypi doesn't include the license file. The MIT license requires users to include it on their side though.
It seems regexes get parsed to a Syntax.Literal type, but the node.value ends up being some kind of list(). Is this correct?
At the moment it seems it gets coerced into a list of the literal and its flags?
Hello,
I found when use USC-4,the memory would be very high(>120MB),because my python use USC-4, sys.maxunicode is 1114111,it means that the dictionary have 1114111 element,is there any method to
solve that ? Thank you very much!
It is unclear under which license this project is released.
Please add some license information. Your project is very difficult to use / integrate with for many good reasons without it.
Some inspiration: esprima itself is licensed under BSD (see https://github.com/jquery/esprima/blob/master/LICENSE.BSD).
Thanks,
Kevin
My python 3.6.3 code (test.py) :
import pathlib
import pyjsparser as pjp
p = pjp.PyJsParser()
f = p.parse(pathlib.Path('company-proxy.pac').read_text())
print(repr(f))
Results in:
Traceback (most recent call last):
File "C:\path\to\test.py", line 13, in <module>
f = p.parse(pathlib.Path('company-proxy.pac').read_text())
File "C:\Python36\lib\site-packages\pyjsparser\parser.py", line 2864, in parse
return node_to_dict(program)
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 466, in node_to_dict
return [node_to_dict(e) for e in node]
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 466, in <listcomp>
return [node_to_dict(e) for e in node]
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 466, in node_to_dict
return [node_to_dict(e) for e in node]
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 466, in <listcomp>
return [node_to_dict(e) for e in node]
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
... (many more)
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in <genexpr>
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
File "C:\Python36\lib\site-packages\pyjsparser\std_nodes.py", line 471, in node_to_dict
return dict((k, node_to_dict(v)) for k, v in node.__dict__.items())
RecursionError: maximum recursion depth exceeded while calling a Python object
Content of 'company-proxy.pac', as far as I can reveal it:
/*
** some comment
*/
function FindProxyForURL(url, host) {
if (shExpMatch(host, "localhost")) { return "DIRECT"; }
if (shExpMatch(host, "localhost.*")) { return "DIRECT"; }
if (shExpMatch(host, "127.0.0.*")) { return "DIRECT"; }
if (isPlainHostName(host)) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_001")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_002")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_003")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_004")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_005")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_006")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_007")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_008")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_009")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_010")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_011")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_012")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_013")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_014")) { return "PROXY proxy_ip_port_3"; }
if (shExpMatch(host, "host_pattern_015")) { return "PROXY proxy_ip_port_3"; }
if (shExpMatch(host, "host_pattern_016")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_017")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_018")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_019")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_020")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_021")) { return "PROXY proxy_ip_port_5"; }
if (shExpMatch(host, "host_pattern_022")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_023")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_024")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_025")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_026")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_027")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_028")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_029")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_030")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_031")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_032")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_033")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_034")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_035")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_036")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_037")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_038")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_039")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_040")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_041")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_042")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_043")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_044")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_045")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_046")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_047")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_048")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_049")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_050")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_051")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_052")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_053")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_054")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_055")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_056")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_057")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_058")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_059")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_060")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_061")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_062")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_063")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_064")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_065")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_066")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_067")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_068")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_069")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_070")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_071")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_072")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_073")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_074")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_075")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_076")) { return "PROXY proxy_ip_port_2"; }
if (shExpMatch(host, "host_pattern_077")) { return "PROXY proxy_ip_port_4"; }
if (shExpMatch(host, "host_pattern_078")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_079")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_080")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_081")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_082")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_083")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_084")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_085")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_086")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_087")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_088")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_089")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_090")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_091")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_092")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_093")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_094")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_095")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_096")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_097")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_098")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_099")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_100")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_101")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_102")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_103")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_104")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_105")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_106")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_107")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_108")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_109")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_110")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_111")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_112")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_113")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_114")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_115")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_116")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_117")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_118")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_119")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_120")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_121")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_122")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_123")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_124")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_125")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_126")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_127")) { return "PROXY proxy_ip_port_1"; }
if (shExpMatch(host, "host_pattern_128")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_129")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_130")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_131")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_132")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_133")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_134")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_135")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_136")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_137")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_138")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_139")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_140")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_141")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_142")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_143")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_144")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_145")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_146")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_147")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_148")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_149")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_150")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_151")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_152")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_153")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_154")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_155")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_156")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_157")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_158")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_159")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_160")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_161")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_162")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_163")) { return "PROXY proxy_ip_port_7; PROXY proxy_ip_port_6"; }
if (shExpMatch(host, "host_pattern_164")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_165")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_166")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_167")) { return "PROXY proxy_ip_port_8"; }
if (shExpMatch(host, "host_pattern_168")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_169") ||
shExpMatch(host, "host_pattern_170") ||
shExpMatch(host, "host_pattern_171") ||
shExpMatch(host, "host_pattern_172") ||
shExpMatch(host, "host_pattern_173") ||
shExpMatch(host, "host_pattern_174") ||
shExpMatch(host, "host_pattern_175") ||
shExpMatch(host, "host_pattern_176") ||
shExpMatch(host, "host_pattern_177") ||
shExpMatch(host, "host_pattern_178") ||
shExpMatch(host, "host_pattern_179") ||
shExpMatch(host, "host_pattern_180") ||
shExpMatch(host, "host_pattern_181") ||
shExpMatch(host, "host_pattern_182") ||
shExpMatch(host, "host_pattern_183") ||
shExpMatch(host, "host_pattern_184") ||
shExpMatch(host, "host_pattern_185") ||
shExpMatch(host, "host_pattern_186") ||
shExpMatch(host, "host_pattern_187") ||
shExpMatch(host, "host_pattern_188") ||
shExpMatch(host, "host_pattern_189") ||
shExpMatch(host, "host_pattern_190") ||
shExpMatch(host, "host_pattern_191") ||
shExpMatch(host, "host_pattern_192") ||
shExpMatch(host, "host_pattern_193") ||
shExpMatch(host, "host_pattern_194") ||
shExpMatch(host, "host_pattern_195") ||
shExpMatch(host, "host_pattern_196") ||
shExpMatch(host, "host_pattern_197") ||
shExpMatch(host, "host_pattern_198") ||
shExpMatch(host, "host_pattern_199") ||
shExpMatch(host, "host_pattern_200") ||
shExpMatch(host, "host_pattern_201") ||
shExpMatch(host, "host_pattern_202") ||
shExpMatch(host, "host_pattern_203") ||
shExpMatch(host, "host_pattern_204") ||
shExpMatch(host, "host_pattern_205") ||
shExpMatch(host, "host_pattern_206") ||
shExpMatch(host, "host_pattern_207") ||
shExpMatch(host, "host_pattern_208") ||
shExpMatch(host, "host_pattern_209") ||
shExpMatch(host, "host_pattern_210") ||
shExpMatch(host, "host_pattern_211") ||
shExpMatch(host, "host_pattern_212") ||
shExpMatch(host, "host_pattern_213") ||
shExpMatch(host, "host_pattern_214") ||
shExpMatch(host, "host_pattern_215") ||
shExpMatch(host, "host_pattern_216") ||
shExpMatch(host, "host_pattern_217") ||
shExpMatch(host, "host_pattern_218") ||
shExpMatch(host, "host_pattern_219") ||
shExpMatch(host, "host_pattern_220") ||
shExpMatch(host, "host_pattern_221") ||
shExpMatch(host, "host_pattern_222") ||
shExpMatch(host, "host_pattern_223") ||
shExpMatch(host, "host_pattern_224") ||
shExpMatch(host, "host_pattern_225") ||
shExpMatch(host, "host_pattern_226") ||
shExpMatch(host, "host_pattern_227") ||
shExpMatch(host, "host_pattern_228") ||
shExpMatch(host, "host_pattern_229") ||
shExpMatch(host, "host_pattern_230") ||
shExpMatch(host, "host_pattern_231") ||
shExpMatch(host, "host_pattern_232") ||
shExpMatch(host, "host_pattern_233") ||
shExpMatch(host, "host_pattern_234") ||
shExpMatch(host, "host_pattern_235") ||
shExpMatch(host, "host_pattern_236") ||
shExpMatch(host, "host_pattern_237") ||
shExpMatch(host, "host_pattern_238") ||
shExpMatch(host, "host_pattern_239") ||
shExpMatch(host, "host_pattern_240") ||
shExpMatch(host, "host_pattern_241") ||
shExpMatch(host, "host_pattern_242") ||
shExpMatch(host, "host_pattern_243") ||
shExpMatch(host, "host_pattern_244") ||
shExpMatch(host, "host_pattern_245") ||
shExpMatch(host, "host_pattern_246") ||
shExpMatch(host, "host_pattern_247") ||
shExpMatch(host, "host_pattern_248") ||
shExpMatch(host, "host_pattern_249") ||
shExpMatch(host, "host_pattern_250") ||
shExpMatch(host, "host_pattern_251") ||
shExpMatch(host, "host_pattern_252") ||
shExpMatch(host, "host_pattern_253") ||
shExpMatch(host, "host_pattern_254") ||
shExpMatch(host, "host_pattern_255") ||
shExpMatch(host, "host_pattern_256") ||
shExpMatch(host, "host_pattern_257") ||
shExpMatch(host, "host_pattern_258") ||
shExpMatch(host, "host_pattern_259") ||
shExpMatch(host, "host_pattern_260") ||
shExpMatch(host, "host_pattern_261") ||
shExpMatch(host, "host_pattern_262") ||
shExpMatch(host, "host_pattern_263") ||
shExpMatch(host, "host_pattern_264") ||
shExpMatch(host, "host_pattern_265") ||
shExpMatch(host, "host_pattern_266") ||
shExpMatch(host, "host_pattern_267") ||
shExpMatch(host, "host_pattern_268") ||
shExpMatch(host, "host_pattern_269") ||
shExpMatch(host, "host_pattern_270") ||
shExpMatch(host, "host_pattern_271") ||
shExpMatch(host, "host_pattern_272") ||
shExpMatch(host, "host_pattern_273") ||
shExpMatch(host, "host_pattern_274") ||
shExpMatch(host, "host_pattern_275") ||
shExpMatch(host, "host_pattern_276") ||
shExpMatch(host, "host_pattern_277") ||
shExpMatch(host, "host_pattern_278") ||
shExpMatch(host, "host_pattern_279") ||
shExpMatch(host, "host_pattern_280") ||
shExpMatch(host, "host_pattern_281") ||
shExpMatch(host, "host_pattern_282") ||
shExpMatch(host, "host_pattern_283") ||
shExpMatch(host, "host_pattern_284") ||
shExpMatch(host, "host_pattern_285") ||
shExpMatch(host, "host_pattern_286") ||
shExpMatch(host, "host_pattern_287") ||
shExpMatch(host, "host_pattern_288") ||
shExpMatch(host, "host_pattern_289") ||
shExpMatch(host, "host_pattern_290") ||
shExpMatch(host, "host_pattern_291") ||
shExpMatch(host, "host_pattern_292") ||
shExpMatch(host, "host_pattern_293") ||
shExpMatch(host, "host_pattern_294") ||
shExpMatch(host, "host_pattern_295") ||
shExpMatch(host, "host_pattern_296") ||
shExpMatch(host, "host_pattern_297") ||
shExpMatch(host, "host_pattern_298") ||
shExpMatch(host, "host_pattern_299") ||
shExpMatch(host, "host_pattern_300") ||
shExpMatch(host, "host_pattern_301") ||
shExpMatch(host, "host_pattern_302") ||
shExpMatch(host, "host_pattern_303") ||
shExpMatch(host, "host_pattern_304") ||
shExpMatch(host, "host_pattern_305") ||
shExpMatch(host, "host_pattern_306") ||
shExpMatch(host, "host_pattern_307") ||
shExpMatch(host, "host_pattern_308") ||
shExpMatch(host, "host_pattern_309") ||
shExpMatch(host, "host_pattern_310") ||
shExpMatch(host, "host_pattern_311") ||
shExpMatch(host, "host_pattern_312") ||
shExpMatch(host, "host_pattern_313") ||
shExpMatch(host, "host_pattern_314") ||
shExpMatch(host, "host_pattern_315") ||
shExpMatch(host, "host_pattern_316") ||
shExpMatch(host, "host_pattern_317") ||
shExpMatch(host, "host_pattern_318") ||
shExpMatch(host, "host_pattern_319") ||
shExpMatch(host, "host_pattern_320") ||
shExpMatch(host, "host_pattern_321") ||
shExpMatch(host, "host_pattern_322") ||
shExpMatch(host, "host_pattern_323") ||
shExpMatch(host, "host_pattern_324") ||
shExpMatch(host, "host_pattern_325") ||
shExpMatch(host, "host_pattern_326") ||
shExpMatch(host, "host_pattern_327") ||
shExpMatch(host, "host_pattern_328") ||
shExpMatch(host, "host_pattern_329") ||
shExpMatch(host, "host_pattern_330") ||
shExpMatch(host, "host_pattern_331") ||
shExpMatch(host, "host_pattern_332") ||
shExpMatch(host, "host_pattern_333") ||
shExpMatch(host, "host_pattern_334") ||
shExpMatch(host, "host_pattern_335") ||
shExpMatch(host, "host_pattern_336") ||
shExpMatch(host, "host_pattern_337") ||
shExpMatch(host, "host_pattern_338") ||
shExpMatch(host, "host_pattern_339") ||
shExpMatch(host, "host_pattern_340") ||
shExpMatch(host, "host_pattern_341") ||
shExpMatch(host, "host_pattern_342") ||
shExpMatch(host, "host_pattern_343") ||
shExpMatch(host, "host_pattern_344") ||
shExpMatch(host, "host_pattern_345") ||
shExpMatch(host, "host_pattern_346") ||
shExpMatch(host, "host_pattern_347") ||
shExpMatch(host, "host_pattern_348") ||
shExpMatch(host, "host_pattern_349") ||
shExpMatch(host, "host_pattern_350") ||
shExpMatch(host, "host_pattern_351") ||
shExpMatch(host, "host_pattern_352") ||
shExpMatch(host, "host_pattern_353") ||
shExpMatch(host, "host_pattern_354") ||
shExpMatch(host, "host_pattern_355") ||
shExpMatch(host, "host_pattern_356") ||
shExpMatch(host, "host_pattern_357") ||
shExpMatch(host, "host_pattern_358") ||
shExpMatch(host, "host_pattern_359") ||
shExpMatch(host, "host_pattern_360") ||
shExpMatch(host, "host_pattern_361") ||
shExpMatch(host, "host_pattern_362") ||
shExpMatch(host, "host_pattern_363") ||
shExpMatch(host, "host_pattern_364") ||
shExpMatch(host, "host_pattern_365") ||
shExpMatch(host, "host_pattern_366") ||
shExpMatch(host, "host_pattern_367") ||
shExpMatch(host, "host_pattern_368") ||
shExpMatch(host, "host_pattern_369") ||
shExpMatch(host, "host_pattern_370") ||
shExpMatch(host, "host_pattern_371") ||
shExpMatch(host, "host_pattern_372") ||
shExpMatch(host, "host_pattern_373") ||
shExpMatch(host, "host_pattern_374") ||
shExpMatch(host, "host_pattern_375") ||
shExpMatch(host, "host_pattern_376") ||
shExpMatch(host, "host_pattern_377") ||
shExpMatch(host, "host_pattern_378") ||
shExpMatch(host, "host_pattern_379") ||
shExpMatch(host, "host_pattern_380") ||
shExpMatch(host, "host_pattern_381") ||
shExpMatch(host, "host_pattern_382") ||
shExpMatch(host, "host_pattern_383") ||
shExpMatch(host, "host_pattern_384") ||
shExpMatch(host, "host_pattern_385") ||
shExpMatch(host, "host_pattern_386") ||
shExpMatch(host, "host_pattern_387") ||
shExpMatch(host, "host_pattern_388") ||
shExpMatch(host, "host_pattern_389") ||
shExpMatch(host, "host_pattern_390") ||
shExpMatch(host, "host_pattern_391") ||
shExpMatch(host, "host_pattern_392") ||
shExpMatch(host, "host_pattern_393") ||
shExpMatch(host, "host_pattern_394") ||
shExpMatch(host, "host_pattern_395") ||
shExpMatch(host, "host_pattern_396") ||
shExpMatch(host, "host_pattern_397") ||
shExpMatch(host, "host_pattern_398") ||
shExpMatch(host, "host_pattern_399") ||
shExpMatch(host, "host_pattern_400") ||
shExpMatch(host, "host_pattern_401") ||
shExpMatch(host, "host_pattern_402") ||
shExpMatch(host, "host_pattern_403") ||
shExpMatch(host, "host_pattern_404") ||
shExpMatch(host, "host_pattern_405") ||
shExpMatch(host, "host_pattern_406") ||
shExpMatch(host, "host_pattern_407") ||
shExpMatch(host, "host_pattern_408") ||
shExpMatch(host, "host_pattern_409") ||
shExpMatch(host, "host_pattern_410") ||
shExpMatch(host, "host_pattern_411") ||
shExpMatch(host, "host_pattern_412") ||
shExpMatch(host, "host_pattern_413") ||
shExpMatch(host, "host_pattern_414") ||
shExpMatch(host, "host_pattern_415") ||
shExpMatch(host, "host_pattern_416") ||
shExpMatch(host, "host_pattern_417") ||
shExpMatch(host, "host_pattern_418") ||
shExpMatch(host, "host_pattern_419") ||
shExpMatch(host, "host_pattern_420") ||
shExpMatch(host, "host_pattern_421") ||
shExpMatch(host, "host_pattern_422") ||
shExpMatch(host, "host_pattern_423") ||
shExpMatch(host, "host_pattern_424") ||
shExpMatch(host, "host_pattern_425") ||
shExpMatch(host, "host_pattern_426") ||
shExpMatch(host, "host_pattern_427") ||
shExpMatch(host, "host_pattern_428") ||
shExpMatch(host, "host_pattern_429") ||
shExpMatch(host, "host_pattern_430") ||
shExpMatch(host, "host_pattern_431") ||
shExpMatch(host, "host_pattern_432") ||
shExpMatch(host, "host_pattern_433") ||
shExpMatch(host, "host_pattern_434") ||
shExpMatch(host, "host_pattern_435") ||
shExpMatch(host, "host_pattern_436") ||
shExpMatch(host, "host_pattern_437") ||
shExpMatch(host, "host_pattern_438") ||
shExpMatch(host, "host_pattern_439") ||
shExpMatch(host, "host_pattern_440") ||
shExpMatch(host, "host_pattern_441") ||
shExpMatch(host, "host_pattern_442") ||
shExpMatch(host, "host_pattern_443") ||
shExpMatch(host, "host_pattern_444") ||
shExpMatch(host, "host_pattern_445") ||
shExpMatch(host, "host_pattern_446") ||
shExpMatch(host, "host_pattern_447") ||
shExpMatch(host, "host_pattern_448") ||
shExpMatch(host, "host_pattern_449") ||
shExpMatch(host, "host_pattern_450") ||
shExpMatch(host, "host_pattern_451") ||
shExpMatch(host, "host_pattern_452") ||
shExpMatch(host, "host_pattern_453") ||
shExpMatch(host, "host_pattern_454") ||
shExpMatch(host, "host_pattern_455") ||
shExpMatch(host, "host_pattern_456") ||
shExpMatch(host, "host_pattern_457") ||
shExpMatch(host, "host_pattern_458") ||
shExpMatch(host, "host_pattern_459") ||
shExpMatch(host, "host_pattern_460") ||
shExpMatch(host, "host_pattern_461") ||
shExpMatch(host, "host_pattern_462") ||
shExpMatch(host, "host_pattern_463") ||
shExpMatch(host, "host_pattern_464") ||
shExpMatch(host, "host_pattern_465") ||
shExpMatch(host, "host_pattern_466") ||
shExpMatch(host, "host_pattern_467") ||
shExpMatch(host, "host_pattern_468") ||
shExpMatch(host, "host_pattern_469") ||
shExpMatch(host, "host_pattern_470") ||
shExpMatch(host, "host_pattern_471") ||
shExpMatch(host, "host_pattern_472") ||
shExpMatch(host, "host_pattern_473") ||
shExpMatch(host, "host_pattern_474") ||
shExpMatch(host, "host_pattern_475") ||
shExpMatch(host, "host_pattern_476") ||
shExpMatch(host, "host_pattern_477") ||
shExpMatch(host, "host_pattern_478") ||
shExpMatch(host, "host_pattern_479") ||
shExpMatch(host, "host_pattern_480") ||
shExpMatch(host, "host_pattern_481") ||
shExpMatch(host, "host_pattern_482") ||
shExpMatch(host, "host_pattern_483") ||
shExpMatch(host, "host_pattern_484") ||
shExpMatch(host, "host_pattern_485") ||
shExpMatch(host, "host_pattern_486") ||
shExpMatch(host, "host_pattern_487") ||
shExpMatch(host, "host_pattern_488") ||
shExpMatch(host, "host_pattern_489") ||
shExpMatch(host, "host_pattern_490") ||
shExpMatch(host, "host_pattern_491") ||
shExpMatch(host, "host_pattern_492") ||
shExpMatch(host, "host_pattern_493") ||
shExpMatch(host, "host_pattern_494") ||
shExpMatch(host, "host_pattern_495") ||
shExpMatch(host, "host_pattern_496") ||
shExpMatch(host, "host_pattern_497") ||
shExpMatch(host, "host_pattern_498") ||
shExpMatch(host, "host_pattern_499") ||
shExpMatch(host, "host_pattern_500") ||
shExpMatch(host, "host_pattern_501") ||
shExpMatch(host, "host_pattern_502") ||
shExpMatch(host, "host_pattern_503") ||
shExpMatch(host, "host_pattern_504") ||
shExpMatch(host, "host_pattern_505") ||
shExpMatch(host, "host_pattern_506") ||
shExpMatch(host, "host_pattern_507") ||
shExpMatch(host, "host_pattern_508") ||
shExpMatch(host, "host_pattern_509") ||
shExpMatch(host, "host_pattern_510") ||
shExpMatch(host, "host_pattern_511") ||
shExpMatch(host, "host_pattern_512") ||
shExpMatch(host, "host_pattern_513") ||
shExpMatch(host, "host_pattern_514") ||
shExpMatch(host, "host_pattern_515") ||
shExpMatch(host, "host_pattern_516") ||
shExpMatch(host, "host_pattern_517") ||
shExpMatch(host, "host_pattern_518") ||
shExpMatch(host, "host_pattern_519") ||
shExpMatch(host, "host_pattern_520") ||
shExpMatch(host, "host_pattern_521") ||
shExpMatch(host, "host_pattern_522") ||
shExpMatch(host, "host_pattern_523") ||
shExpMatch(host, "host_pattern_524") ||
shExpMatch(host, "host_pattern_525") ||
shExpMatch(host, "host_pattern_526") ||
shExpMatch(host, "host_pattern_527") ||
shExpMatch(host, "host_pattern_528") ||
shExpMatch(host, "host_pattern_529") ||
shExpMatch(host, "host_pattern_530") ||
shExpMatch(host, "host_pattern_531") ||
shExpMatch(host, "host_pattern_532") ||
shExpMatch(host, "host_pattern_533") ||
shExpMatch(host, "host_pattern_534") ||
shExpMatch(host, "host_pattern_535") ||
shExpMatch(host, "host_pattern_536") ||
shExpMatch(host, "host_pattern_537") ||
shExpMatch(host, "host_pattern_538") ||
shExpMatch(host, "host_pattern_539") ||
shExpMatch(host, "host_pattern_540") ||
shExpMatch(host, "host_pattern_541") ||
shExpMatch(host, "host_pattern_542") ||
shExpMatch(host, "host_pattern_543") ||
shExpMatch(host, "host_pattern_544") ||
shExpMatch(host, "host_pattern_545") ||
shExpMatch(host, "host_pattern_546") ||
shExpMatch(host, "host_pattern_547") ||
shExpMatch(host, "host_pattern_548") ||
shExpMatch(host, "host_pattern_549") ||
shExpMatch(host, "host_pattern_550") ||
shExpMatch(host, "host_pattern_551") ||
shExpMatch(host, "host_pattern_552") ||
shExpMatch(host, "host_pattern_553") ||
shExpMatch(host, "host_pattern_554") ||
shExpMatch(host, "host_pattern_555") ||
shExpMatch(host, "host_pattern_556") ||
shExpMatch(host, "host_pattern_557") ||
shExpMatch(host, "host_pattern_558") ||
shExpMatch(host, "host_pattern_559") ||
shExpMatch(host, "host_pattern_560") ||
shExpMatch(host, "host_pattern_561") ||
shExpMatch(host, "host_pattern_562") ||
shExpMatch(host, "host_pattern_563") ||
shExpMatch(host, "host_pattern_564") ||
shExpMatch(host, "host_pattern_565") ||
shExpMatch(host, "host_pattern_566") ||
shExpMatch(host, "host_pattern_567") ||
shExpMatch(host, "host_pattern_568") ||
shExpMatch(host, "host_pattern_569") ||
shExpMatch(host, "host_pattern_570") ||
shExpMatch(host, "host_pattern_571") ||
shExpMatch(host, "host_pattern_572") ||
shExpMatch(host, "host_pattern_573") ||
shExpMatch(host, "host_pattern_574") ||
shExpMatch(host, "host_pattern_575") ||
shExpMatch(host, "host_pattern_576") ||
shExpMatch(host, "host_pattern_577") ||
shExpMatch(host, "host_pattern_578") ||
shExpMatch(host, "host_pattern_579") ||
shExpMatch(host, "host_pattern_580") ||
shExpMatch(host, "host_pattern_581") ||
shExpMatch(host, "host_pattern_582") ||
shExpMatch(host, "host_pattern_583") ||
shExpMatch(host, "host_pattern_584") ||
shExpMatch(host, "host_pattern_585") ||
shExpMatch(host, "host_pattern_586") ||
shExpMatch(host, "host_pattern_587") ||
shExpMatch(host, "host_pattern_588") ||
shExpMatch(host, "host_pattern_589") ||
shExpMatch(host, "host_pattern_590") ||
shExpMatch(host, "host_pattern_591") ||
shExpMatch(host, "host_pattern_592") ||
shExpMatch(host, "host_pattern_593") ||
shExpMatch(host, "host_pattern_594") ||
shExpMatch(host, "host_pattern_595") ||
shExpMatch(host, "host_pattern_596") ||
shExpMatch(host, "host_pattern_597") ||
shExpMatch(host, "host_pattern_598") ||
shExpMatch(host, "host_pattern_599") ||
shExpMatch(host, "host_pattern_600") ||
shExpMatch(host, "host_pattern_601") ||
shExpMatch(host, "host_pattern_602") ||
shExpMatch(host, "host_pattern_603") ||
shExpMatch(host, "host_pattern_604") ||
shExpMatch(host, "host_pattern_605") ||
shExpMatch(host, "host_pattern_606") ||
shExpMatch(host, "host_pattern_607") ||
shExpMatch(host, "host_pattern_608") ||
shExpMatch(host, "host_pattern_609") ||
shExpMatch(host, "host_pattern_610") ||
shExpMatch(host, "host_pattern_611") ||
shExpMatch(host, "host_pattern_612") ||
shExpMatch(host, "host_pattern_613") ||
shExpMatch(host, "host_pattern_614") ||
shExpMatch(host, "host_pattern_615") ||
shExpMatch(host, "host_pattern_616") ||
shExpMatch(host, "host_pattern_617") ||
shExpMatch(host, "host_pattern_618") ||
shExpMatch(host, "host_pattern_619") ||
shExpMatch(host, "host_pattern_620") ||
shExpMatch(host, "host_pattern_621") ||
shExpMatch(host, "host_pattern_622") ||
shExpMatch(host, "host_pattern_623") ||
shExpMatch(host, "host_pattern_624") ||
shExpMatch(host, "host_pattern_625") ||
shExpMatch(host, "host_pattern_626") ||
shExpMatch(host, "host_pattern_627") ||
shExpMatch(host, "host_pattern_628") ||
shExpMatch(host, "host_pattern_629") ||
shExpMatch(host, "host_pattern_630") ||
shExpMatch(host, "host_pattern_631") ||
shExpMatch(host, "host_pattern_632") ||
shExpMatch(host, "host_pattern_633")
)
return "PROXY proxy_ip_port_8";
if (shExpMatch(host, "host_pattern_634")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_635")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_636")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_637")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_638")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_639")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_640")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_641")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_642")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_643")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_644")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_645")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_646")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_647")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_648")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_649")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_650")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_651")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_652")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_653")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_654")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_655")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_656")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_657")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_658")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_659")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_660")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_661")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_662")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_663")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_664")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_665")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_666")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_667")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_668")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_669")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_670")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_671")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_672")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_673")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_674")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_675")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_676")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_677")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_678")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_679")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_680")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_681")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_682")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_683")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_684")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_685")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_686")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_687")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_688")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_689")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_690")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_691")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_692")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_693")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_694")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_695")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_696")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_697")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_698")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_699")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_700")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_701")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_702")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_703")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_704")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_705")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_706")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_707")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_708")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_709")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_710")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_711")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_712")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_713")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_714")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_715")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_716")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_717")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_718")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_719")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_720")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_721")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_722")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_723")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_724")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_725")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_726")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_727")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_728")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_729")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_730")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_731")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_732")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_733")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_734")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_735")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_736")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_737")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_738")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_739")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_740")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_741")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_742")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_743")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_744")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_745")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_746")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_747")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_748")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_749")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_750")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_751")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_752")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_753")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_754")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_755")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_756")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_757")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_758")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_759")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_760")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_761")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_762")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_763")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_764")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_765")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_766")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_767")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_768")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_769")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_770")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_771")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_772")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_773")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_774")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_775")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_776")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_777")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_778")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_779")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_780")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_781")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_782")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_783")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_784")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_785")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_786")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_787")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_788")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_789")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_790")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_791")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_792")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_793")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_794")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_795")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_796")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_797")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_798")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_799")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_800")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_801")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_802")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_803")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_804")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_805")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_806")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_807")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_808")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_809")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_810")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_811")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_812")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_813")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_814")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_815")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_816")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_817")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_818")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_819")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_820")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_821")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_822")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_823")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_824")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_825")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_826")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_827")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_828")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_829")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_830")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_831")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_832")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_833")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_834")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_835")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_836")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_837")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_838")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_839")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_840")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_841")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_842")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_843")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_844")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_845")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_846")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_847")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_848")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_849")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_850")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_851")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_852")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_853")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_854")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_855")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_856")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_857")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_858")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_859")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_860")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_861")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_862")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_863")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_864")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_865")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_866")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_867")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_868")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_869")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_870")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_871")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_872")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_873")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_874")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_875")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_876")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_877")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_878")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_879")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_880")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_881")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_882")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_883")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_884")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_885")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_886")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_887")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_888")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_889")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_890")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_891")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_892")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_893")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_894")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_895")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_896")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_897")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_898")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_899")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_900")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_901")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_902")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_903")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_904")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_905")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_906")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_907")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_908")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_909")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_910")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_911")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_912")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_913")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_914")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_915")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_916")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_917")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_918")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_919")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_920")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_921")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_922")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_923")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_924")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_925")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_926")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_927")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_928")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_929")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_930")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_931")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_932")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_933")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_934")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_935")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_936")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_937")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_938")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_939")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_940")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_941")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_942")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_943")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_944")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_945")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_946")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_947")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_948")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_949")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_950")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_951")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_952")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_953")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_954")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_955")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_956")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_957")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_958")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_959")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_960")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_961")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_962")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_963")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_964")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_965")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_966")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_967")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_968")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_969")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_970")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_971")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_972")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_973")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_974")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_975")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_976")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_977")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_978")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_979")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_980")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_981")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_982")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_983")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_984")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_985")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_986")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_987")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_988")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_989")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_990")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_991")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_992")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_993")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_994")) { return "DIRECT"; }
if (shExpMatch(host, "host_pattern_995")) { return "DIRECT"; }
if (!isResolvable(host)) { return "PROXY proxy_ip_port_8"; }
resolved_host = dnsResolve(host);
if (isInNet(resolved_host, "network_ip_00", "net_mask_00")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_01", "net_mask_01")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_02", "net_mask_02")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_03", "net_mask_03")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_04", "net_mask_04")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_05", "net_mask_05")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_06", "net_mask_06")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_07", "net_mask_07")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_08", "net_mask_08")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_09", "net_mask_09")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_10", "net_mask_10")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_11", "net_mask_11")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_12", "net_mask_12")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_13", "net_mask_13")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_14", "net_mask_14")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_15", "net_mask_15")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_16", "net_mask_16")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_17", "net_mask_17")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_18", "net_mask_18")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_19", "net_mask_19")) { return "PROXY proxy_ip_port_8"; }
if (isInNet(resolved_host, "network_ip_20", "net_mask_20")) { return "PROXY proxy_ip_port_8"; }
if (isInNet(resolved_host, "network_ip_21", "net_mask_21")) { return "PROXY proxy_ip_port_8"; }
if (isInNet(resolved_host, "network_ip_22", "net_mask_22")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_23", "net_mask_23")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_24", "net_mask_24")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_25", "net_mask_25")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_26", "net_mask_26")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_27", "net_mask_27")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_28", "net_mask_28")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_29", "net_mask_29")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_30", "net_mask_30")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_31", "net_mask_31")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_32", "net_mask_32")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_33", "net_mask_33")) { return "DIRECT"; }
if (isInNet(resolved_host, "network_ip_34", "net_mask_34")) { return "DIRECT"; }
return "PROXY proxy_ip_port_8";
}
how can i get line number of the node in ast tree?
Would you have any time soon to add support for parsing classes:
https://github.com/PiotrDabkowski/pyjsparser/blob/master/pyjsparser/parser.py#L2798
Unfortunately I hit this issue as soon as i gave it a try :(
Thanks!
Like if we don't want a particular line to be parsed.
I am trying to run JS2PY and am returning this error:
/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/es6/__init__.py:10: UserWarning:
Importing babel.py for the first time - this can take some time.
Please note that currently Javascript 6 in Js2Py is unstable and slow. Use only for tiny scripts!
warnings.warn(
/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/base.py:2854: FutureWarning: Possible nested set at position 5
self.pat = re.compile(
Initialised babel!
Traceback (most recent call last):
File "/home/bobby/uni_balances/main.py", line 104, in <module>
result = js2py.eval_js6(js) # executing JavaScript and converting the result to python string
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/evaljs.py", line 120, in eval_js6
return eval_js(js6_to_js5(js))
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/evaljs.py", line 115, in eval_js
return e.eval(js)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/evaljs.py", line 204, in eval
self.execute(code, use_compilation_plan=use_compilation_plan)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/evaljs.py", line 199, in execute
exec (compiled, self._context)
File "<EvalJS snippet>", line 4, in <module>
File "<EvalJS snippet>", line 3, in PyJs_LONG_0_
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/base.py", line 949, in __call__
return self.call(self.GlobalObject, args)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/base.py", line 1464, in call
return Js(self.code(*args))
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/host/jseval.py", line 17, in Eval
py_code = translate_js(code.to_string().value, '')
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/translators/translator.py", line 70, in translate_js
parsed = parse_fn(js)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/js2py/translators/translator.py", line 62, in pyjsparser_parse_fn
return parser.parse(code)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 3008, in parse
program = self.parseProgram()
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 2974, in parseProgram
body = self.parseScriptBody()
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 2963, in parseScriptBody
statement = self.parseStatementListItem()
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 2110, in parseStatementListItem
return self.parseStatement()
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 2718, in parseStatement
self.consumeSemicolon()
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 1120, in consumeSemicolon
self.throwUnexpectedToken(self.lookahead)
File "/home/bobby/uni_balances/uni_venv/lib/python3.10/site-packages/pyjsparser/parser.py", line 1046, in throwUnexpectedToken
raise self.unexpectedTokenError(token, message)
js2py.internals.simplex.JsException: SyntaxError: Line 34: Unexpected token function
import { JSBI } from "@uniswap/sdk";
import { ethers } from 'ethers';
import * as fs from 'fs';
function myFunction(id){
// ERC20 json abi file
let ERC20Abi = fs.readFileSync('Erc20.json');
const ERC20 = JSON.parse(ERC20Abi);
// V3 pool abi json file
let pool = fs.readFileSync('V3PairAbi.json');
const IUniswapV3PoolABI = JSON.parse(pool);
// V3 factory abi json
let facto = fs.readFileSync('V3factory.json');
const IUniswapV3FactoryABI = JSON.parse(facto);
let NFT = fs.readFileSync('UniV3NFT.json');
const IUniswapV3NFTmanagerABI = JSON.parse(NFT);
const provider = new ethers.providers.JsonRpcProvider(ALCHEMY_API_ID)
// V3 standard addresses (different for celo)
const factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
const NFTmanager = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88";
async function getData(tokenID){
let FactoryContract = new ethers.Contract(factory, IUniswapV3FactoryABI, provider);
let NFTContract = new ethers.Contract(NFTmanager, IUniswapV3NFTmanagerABI, provider);
let position = await NFTContract.positions(tokenID);
let token0contract = new ethers.Contract(position.token0, ERC20, provider);
let token1contract = new ethers.Contract(position.token1, ERC20, provider);
let token0Decimal = await token0contract.decimals();
let token1Decimal = await token1contract.decimals();
let token0sym = await token0contract.symbol();
let token1sym = await token1contract.symbol();
let V3pool = await FactoryContract.getPool(position.token0, position.token1, position.fee);
let poolContract = new ethers.Contract(V3pool, IUniswapV3PoolABI, provider);
let slot0 = await poolContract.slot0();
let pairName = token0sym +"/"+ token1sym;
let dict = {"SqrtX96" : slot0.sqrtPriceX96.toString(), "Pair": pairName, "T0d": token0Decimal, "T1d": token1Decimal, "tickLow": position.tickLower, "tickHigh": position.tickUpper, "liquidity": position.liquidity.toString()}
return dict
}
const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96));
const MIN_TICK = -887272;
const MAX_TICK = 887272;
function getTickAtSqrtRatio(sqrtPriceX96){
let tick = Math.floor(Math.log((sqrtPriceX96/Q96)**2)/Math.log(1.0001));
return tick;
}
async function getTokenAmounts(liquidity,sqrtPriceX96,tickLow,tickHigh,token0Decimal,token1Decimal){
let sqrtRatioA = Math.sqrt(1.0001**tickLow).toFixed(18);
let sqrtRatioB = Math.sqrt(1.0001**tickHigh).toFixed(18);
let currentTick = getTickAtSqrtRatio(sqrtPriceX96);
let sqrtPrice = sqrtPriceX96 / Q96;
let amount0wei = 0;
let amount1wei = 0;
if(currentTick <= tickLow){
amount0wei = Math.floor(liquidity*((sqrtRatioB-sqrtRatioA)/(sqrtRatioA*sqrtRatioB)));
}
if(currentTick > tickHigh){
amount1wei = Math.floor(liquidity*(sqrtRatioB-sqrtRatioA));
}
if(currentTick >= tickLow && currentTick < tickHigh){
amount0wei = Math.floor(liquidity*((sqrtRatioB-sqrtPrice)/(sqrtPrice*sqrtRatioB)));
amount1wei = Math.floor(liquidity*(sqrtPrice-sqrtRatioA));
}
let amount0Human = (amount0wei/(10**token0Decimal)).toFixed(token0Decimal);
let amount1Human = (amount1wei/(10**token1Decimal)).toFixed(token1Decimal);
console.log("Amount Token0 wei: "+amount0wei);
console.log("Amount Token1 wei: "+amount1wei);
console.log("Amount Token0 : "+amount0Human);
console.log("Amount Token1 : "+amount1Human);
return [amount0wei, amount1wei]
}
async function start(positionID){
let data = await getData(positionID);
let tokens = await getTokenAmounts(data.liquidity, data.SqrtX96, data.tickLow, data.tickHigh, data.T0d, data.T1d);
}
start(POOL_ID)
// Also it can be used without the position data if you pull the data it will work for any range
getTokenAmounts(12558033400096537032, 20259533801624375790673555415)
}
let x =
import js2py
js = """
import { JSBI } from "@uniswap/sdk";
import { ethers } from 'ethers';
import * as fs from 'fs';
// ERC20 json abi file
let ERC20Abi = fs.readFileSync('Erc20.json');
const ERC20 = JSON.parse(ERC20Abi);
// V3 pool abi json file
let pool = fs.readFileSync('V3PairAbi.json');
const IUniswapV3PoolABI = JSON.parse(pool);
// V3 factory abi json
let facto = fs.readFileSync('V3factory.json');
const IUniswapV3FactoryABI = JSON.parse(facto);
let NFT = fs.readFileSync('UniV3NFT.json');
const IUniswapV3NFTmanagerABI = JSON.parse(NFT);
const provider = new ethers.providers.JsonRpcProvider("https://eth-mainnet.g.alchemy.com/v2/fRrLGBzCur7V6wCQjGRPdtmTUQzjCk2F")
// V3 standard addresses (different for celo)
const factory = "0x1F98431c8aD98523631AE4a59f267346ea31F984";
const NFTmanager = "0xC36442b4a4522E871399CD717aBDD847Ab11FE88";
async function getData(tokenID){
let FactoryContract = new ethers.Contract(factory, IUniswapV3FactoryABI, provider);
let NFTContract = new ethers.Contract(NFTmanager, IUniswapV3NFTmanagerABI, provider);
let position = await NFTContract.positions(tokenID);
let token0contract = new ethers.Contract(position.token0, ERC20, provider);
let token1contract = new ethers.Contract(position.token1, ERC20, provider);
let token0Decimal = await token0contract.decimals();
let token1Decimal = await token1contract.decimals();
let token0sym = await token0contract.symbol();
let token1sym = await token1contract.symbol();
let V3pool = await FactoryContract.getPool(position.token0, position.token1, position.fee);
let poolContract = new ethers.Contract(V3pool, IUniswapV3PoolABI, provider);
let slot0 = await poolContract.slot0();
let pairName = token0sym +"/"+ token1sym;
let dict = {"SqrtX96" : slot0.sqrtPriceX96.toString(), "Pair": pairName, "T0d": token0Decimal, "T1d": token1Decimal, "tickLow": position.tickLower, "tickHigh": position.tickUpper, "liquidity": position.liquidity.toString()}
return dict
}
const Q96 = JSBI.exponentiate(JSBI.BigInt(2), JSBI.BigInt(96));
const MIN_TICK = -887272;
const MAX_TICK = 887272;
function getTickAtSqrtRatio(sqrtPriceX96){
let tick = Math.floor(Math.log((sqrtPriceX96/Q96)**2)/Math.log(1.0001));
return tick;
}
async function getTokenAmounts(liquidity,sqrtPriceX96,tickLow,tickHigh,token0Decimal,token1Decimal){
let sqrtRatioA = Math.sqrt(1.0001**tickLow).toFixed(18);
let sqrtRatioB = Math.sqrt(1.0001**tickHigh).toFixed(18);
let currentTick = getTickAtSqrtRatio(sqrtPriceX96);
let sqrtPrice = sqrtPriceX96 / Q96;
let amount0wei = 0;
let amount1wei = 0;
if(currentTick <= tickLow){
amount0wei = Math.floor(liquidity*((sqrtRatioB-sqrtRatioA)/(sqrtRatioA*sqrtRatioB)));
}
if(currentTick > tickHigh){
amount1wei = Math.floor(liquidity*(sqrtRatioB-sqrtRatioA));
}
if(currentTick >= tickLow && currentTick < tickHigh){
amount0wei = Math.floor(liquidity*((sqrtRatioB-sqrtPrice)/(sqrtPrice*sqrtRatioB)));
amount1wei = Math.floor(liquidity*(sqrtPrice-sqrtRatioA));
}
let amount0Human = (amount0wei/(10**token0Decimal)).toFixed(token0Decimal);
let amount1Human = (amount1wei/(10**token1Decimal)).toFixed(token1Decimal);
console.log("Amount Token0 wei: "+amount0wei);
console.log("Amount Token1 wei: "+amount1wei);
console.log("Amount Token0 : "+amount0Human);
console.log("Amount Token1 : "+amount1Human);
return [amount0wei, amount1wei]
}
async function start(positionID){
let data = await getData(positionID);
let tokens = await getTokenAmounts(data.liquidity, data.SqrtX96, data.tickLow, data.tickHigh, data.T0d, data.T1d);
}
start(273381)
// Also it can be used without the position data if you pull the data it will work for any range
getTokenAmounts(12558033400096537032, 20259533801624375790673555415)
""".replace("document.write", "return ")
result = js2py.eval_js6(js) # executing JavaScript and converting the result to python string
Any idea what this unexpected token error is?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.