project
stringlengths 1
98
| commit_sha
stringlengths 40
40
| parent_sha
stringlengths 40
40
| file_path
stringlengths 4
209
| project_url
stringlengths 23
132
| likely_bug
bool 1
class | comodified
bool 1
class | in_function
bool 2
classes | diff
stringlengths 27
9.71k
| before
stringlengths 1
8.91k
| after
stringlengths 1
6k
| sstub_pattern
stringclasses 23
values | edit_script
stringlengths 33
158k
| key
stringlengths 45
154
| commit_message
stringlengths 3
65.5k
⌀ | files
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
folium | 254b14c1e9da4c508a8c1ad1e412c1131879a499 | 1810e33b9a6271cacbf00ce9d1d9caf17aaf4dab | setup.py | https://github.com/matsuken92/folium | true | false | false | @@ -42,7 +42,7 @@ setup(
author='Rob Story',
author_email='[email protected]',
license='MIT License',
- url='https://github.com/wrobstory/folium',
+ url='https://github.com/python-visualization/folium',
keywords='data visualization',
classifiers=['Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
| url = 'https://github.com/wrobstory/folium' , | url = 'https://github.com/python-visualization/folium' , | CHANGE_STRING_LITERAL | [["Update", ["string:'https://github.com/wrobstory/folium'", 3, 9, 3, 46], "'https://github.com/python-visualization/folium'"]] | matsuken92/folium@254b14c1e9da4c508a8c1ad1e412c1131879a499 | Fixed github URL. | [
{
"sha": "d1f6358c30952b6e7f2b1ceb8c3d607c21fe0079",
"filename": "setup.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/254b14c1e9da4c508a8c1ad1e412c1131879a499/setup.py",
"raw_url": "https://github.com/matsuken92/folium/raw/254b14c1e9da4c508a8c1ad1e412c1131879a499/setup.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/setup.py?ref=254b14c1e9da4c508a8c1ad1e412c1131879a499",
"patch": "@@ -42,7 +42,7 @@ def walk_subpkg(name):\n author='Rob Story',\n author_email='[email protected]',\n license='MIT License',\n- url='https://github.com/wrobstory/folium',\n+ url='https://github.com/python-visualization/folium',\n keywords='data visualization',\n classifiers=['Development Status :: 4 - Beta',\n 'Programming Language :: Python :: 2.7',"
}
] |
folium | 9f5e4a94cb4129677c6873532f1242416c871cc2 | c697485ea85d65bea7f5430b120ae630e821a7fa | tests/folium_tests.py | https://github.com/matsuken92/folium | true | false | true | @@ -416,7 +416,7 @@ class testFolium(object):
map.create_map()
def test_line(self):
- '''Test multi_polyline'''
+ '''Test line'''
line_temp = self.env.get_template('polyline.js')
| '''Test multi_polyline''' | '''Test line''' | CHANGE_STRING_LITERAL | [["Update", ["string:'''Test multi_polyline'''", 3, 9, 3, 34], "'''Test line'''"]] | matsuken92/folium@9f5e4a94cb4129677c6873532f1242416c871cc2 | Fixed test name. | [
{
"sha": "e64b9c1c2981794d6c2d5ba8e1bf56e6c7e6511b",
"filename": "tests/folium_tests.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/9f5e4a94cb4129677c6873532f1242416c871cc2/tests%2Ffolium_tests.py",
"raw_url": "https://github.com/matsuken92/folium/raw/9f5e4a94cb4129677c6873532f1242416c871cc2/tests%2Ffolium_tests.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/tests%2Ffolium_tests.py?ref=9f5e4a94cb4129677c6873532f1242416c871cc2",
"patch": "@@ -416,7 +416,7 @@ def test_create_map(self):\n map.create_map()\n \n def test_line(self):\n- '''Test multi_polyline'''\n+ '''Test line'''\n \n line_temp = self.env.get_template('polyline.js')\n "
}
] |
folium | 85401724a52c9f8176c9dc720be090ed7ab31a8b | ab5f47678d29a60435a61a1fbb52d4aa58605e21 | folium/folium.py | https://github.com/matsuken92/folium | true | false | false | @@ -800,7 +800,7 @@ class Map(object):
else:
width += 75
height += 50
- max_width = self.map_size['width']
+ max_width = max([self.map_size['width'], width])
vega_id = '#' + div_id
popup_temp = self.env.get_template('vega_marker.js')
return popup_temp.render({'mark': mark, 'div_id': div_id,
| max_width = self . map_size [ 'width' ] | max_width = max ( [ self . map_size [ 'width' ] , width ] ) | SINGLE_STMT | [["Insert", ["assignment", 3, 17, 3, 51], ["call", "N0"], 2], ["Insert", "N0", ["identifier:max", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["list", "N2"], 1], ["Insert", "N1", ["):)", "T"], 2], ["Insert", "N2", ["[:[", "T"], 0], ["Move", "N2", ["subscript", 3, 29, 3, 51], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["identifier:width", "T"], 3], ["Insert", "N2", ["]:]", "T"], 4]] | matsuken92/folium@85401724a52c9f8176c9dc720be090ed7ab31a8b | Fix vincent max popup width. | [
{
"sha": "40882627ef913fe2190d719f6380d185379bf4a2",
"filename": "folium/folium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/85401724a52c9f8176c9dc720be090ed7ab31a8b/folium%2Ffolium.py",
"raw_url": "https://github.com/matsuken92/folium/raw/85401724a52c9f8176c9dc720be090ed7ab31a8b/folium%2Ffolium.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/folium%2Ffolium.py?ref=85401724a52c9f8176c9dc720be090ed7ab31a8b",
"patch": "@@ -800,7 +800,7 @@ def _popup_render(self, popup=None, mk_name=None, count=None,\n else:\n width += 75\n height += 50\n- max_width = self.map_size['width']\n+ max_width = max([self.map_size['width'], width])\n vega_id = '#' + div_id\n popup_temp = self.env.get_template('vega_marker.js')\n return popup_temp.render({'mark': mark, 'div_id': div_id,"
}
] |
folium | 9e1e50d40edccac666b82e2914b1e74fd570d06a | 87eae3a0fe017d641707bb0481182945970c6d7e | folium/utilities.py | https://github.com/matsuken92/folium | true | false | true | @@ -159,7 +159,7 @@ def color_brewer(color_code, n=6):
'RdGy': ['#b2182b', '#ef8a62', '#fddbc7', '#e0e0e0', '#999999', '#4d4d4d'],
'RdYlBu': ['#d73027', '#fc8d59', '#fee090', '#e0f3f8', '#91bfdb', '#4575b4'],
'RdYlGn': ['#d73027', '#fc8d59', '#fee08b', '#d9ef8b', '#91cf60', '#1a9850'],
- 'Spectral': ['#d53e4f' '#fc8d59' '#fee08b' '#e6f598' '#99d594' '#3288bd'],
+ 'Spectral': ['#d53e4f', '#fc8d59', '#fee08b', '#e6f598', '#99d594', '#3288bd'],
'Accent': ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f'],
'Dark2': ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02'],
'Paired': ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c'],
| 'Spectral' : [ '#d53e4f' '#fc8d59' '#fee08b' '#e6f598' '#99d594' '#3288bd' ] , | 'Spectral' : [ '#d53e4f' , '#fc8d59' , '#fee08b' , '#e6f598' , '#99d594' , '#3288bd' ] , | SINGLE_STMT | [["Move", ["subscript", 3, 16, 3, 89], ["string:'#d53e4f'", 3, 29, 3, 38], 3], ["Insert", ["subscript", 3, 16, 3, 89], [",:,", "T"], 4], ["Move", ["subscript", 3, 16, 3, 89], ["string:'#fc8d59'", 3, 39, 3, 48], 5], ["Insert", ["subscript", 3, 16, 3, 89], [",:,", "T"], 6], ["Move", ["subscript", 3, 16, 3, 89], ["string:'#fee08b'", 3, 49, 3, 58], 7], ["Insert", ["subscript", 3, 16, 3, 89], [",:,", "T"], 8], ["Move", ["subscript", 3, 16, 3, 89], ["string:'#e6f598'", 3, 59, 3, 68], 9], ["Insert", ["subscript", 3, 16, 3, 89], [",:,", "T"], 10], ["Move", ["subscript", 3, 16, 3, 89], ["string:'#99d594'", 3, 69, 3, 78], 11], ["Insert", ["subscript", 3, 16, 3, 89], [",:,", "T"], 12], ["Move", ["subscript", 3, 16, 3, 89], ["string:'#3288bd'", 3, 79, 3, 88], 13], ["Delete", ["concatenated_string", 3, 29, 3, 88]]] | matsuken92/folium@9e1e50d40edccac666b82e2914b1e74fd570d06a | fix_spectral_bug | [
{
"sha": "a79d62d63d42f688febb58b407876e6d3bea9f86",
"filename": "folium/utilities.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/9e1e50d40edccac666b82e2914b1e74fd570d06a/folium%2Futilities.py",
"raw_url": "https://github.com/matsuken92/folium/raw/9e1e50d40edccac666b82e2914b1e74fd570d06a/folium%2Futilities.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/folium%2Futilities.py?ref=9e1e50d40edccac666b82e2914b1e74fd570d06a",
"patch": "@@ -159,7 +159,7 @@ def color_brewer(color_code, n=6):\n 'RdGy': ['#b2182b', '#ef8a62', '#fddbc7', '#e0e0e0', '#999999', '#4d4d4d'],\n 'RdYlBu': ['#d73027', '#fc8d59', '#fee090', '#e0f3f8', '#91bfdb', '#4575b4'],\n 'RdYlGn': ['#d73027', '#fc8d59', '#fee08b', '#d9ef8b', '#91cf60', '#1a9850'],\n- 'Spectral': ['#d53e4f' '#fc8d59' '#fee08b' '#e6f598' '#99d594' '#3288bd'],\n+ 'Spectral': ['#d53e4f', '#fc8d59', '#fee08b', '#e6f598', '#99d594', '#3288bd'],\n 'Accent': ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f'],\n 'Dark2': ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02'],\n 'Paired': ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c'],"
}
] |
folium | 2431c51863b45dbfe676b81440a06ae5b30aceb7 | c9548ba02e7ee84f27e6b97dfcaa56739230d528 | tests/test_folium.py | https://github.com/matsuken92/folium | true | false | true | @@ -543,7 +543,7 @@ class TestFolium(object):
map.polygon_marker(location=[45.5, -122.5])
# Test write.
- map.create_map()
+ map._parent.render()
def test_line(self):
"""Test line."""
| map . create_map ( ) | map . _parent . render ( ) | SINGLE_STMT | [["Insert", ["attribute", 3, 9, 3, 23], ["attribute", "N0"], 0], ["Insert", ["attribute", 3, 9, 3, 23], [".:.", "T"], 1], ["Insert", ["attribute", 3, 9, 3, 23], ["identifier:render", "T"], 2], ["Move", "N0", ["identifier:map", 3, 9, 3, 12], 0], ["Move", "N0", [".:.", 3, 12, 3, 13], 1], ["Update", ["identifier:create_map", 3, 13, 3, 23], "_parent"], ["Move", "N0", ["identifier:create_map", 3, 13, 3, 23], 2]] | matsuken92/folium@2431c51863b45dbfe676b81440a06ae5b30aceb7 | Fix test_create_map | [
{
"sha": "49a88d86a0886d9653c0eb1af1310f39a2affb28",
"filename": "tests/test_folium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/2431c51863b45dbfe676b81440a06ae5b30aceb7/tests%2Ftest_folium.py",
"raw_url": "https://github.com/matsuken92/folium/raw/2431c51863b45dbfe676b81440a06ae5b30aceb7/tests%2Ftest_folium.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/tests%2Ftest_folium.py?ref=2431c51863b45dbfe676b81440a06ae5b30aceb7",
"patch": "@@ -543,7 +543,7 @@ def test_create_map(self):\n map.polygon_marker(location=[45.5, -122.5])\n \n # Test write.\n- map.create_map()\n+ map._parent.render()\n \n def test_line(self):\n \"\"\"Test line.\"\"\""
}
] |
folium | ab7c3dd939640f8b355d89299be55d78675ddf79 | 9fe75937be7a540d15ad46560951edaaa209ef22 | folium/element.py | https://github.com/matsuken92/folium | true | false | true | @@ -358,7 +358,7 @@ class Html(Element):
self._template = Template(u"""
<div id="{{this.get_name()}}"
style="width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};">
- {{this.data}}</div>
+ {{this.data|e}}</div>
""")
| self . _template = Template ( u"""
<div id="{{this.get_name()}}"
style="width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};">
{{this.data}}</div>
""" ) | self . _template = Template ( u"""
<div id="{{this.get_name()}}"
style="width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};">
{{this.data|e}}</div>
""" ) | CHANGE_STRING_LITERAL | [["Update", ["string:u\"\"\"\n <div id=\"{{this.get_name()}}\"\n style=\"width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};\">\n {{this.data}}</div>\n \"\"\"", 0, 35, 4, 20], "u\"\"\"\n <div id=\"{{this.get_name()}}\"\n style=\"width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};\">\n {{this.data|e}}</div>\n \"\"\""]] | matsuken92/folium@ab7c3dd939640f8b355d89299be55d78675ddf79 | Fix issue #252 | [
{
"sha": "7c7d31f0aee660d3fe46f7715a89ca0066a0f8b6",
"filename": "folium/element.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/ab7c3dd939640f8b355d89299be55d78675ddf79/folium%2Felement.py",
"raw_url": "https://github.com/matsuken92/folium/raw/ab7c3dd939640f8b355d89299be55d78675ddf79/folium%2Felement.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/folium%2Felement.py?ref=ab7c3dd939640f8b355d89299be55d78675ddf79",
"patch": "@@ -358,7 +358,7 @@ def __init__(self, data, width=\"100%\", height=\"100%\"):\n self._template = Template(u\"\"\"\n <div id=\"{{this.get_name()}}\"\n style=\"width: {{this.width[0]}}{{this.width[1]}}; height: {{this.height[0]}}{{this.height[1]}};\">\n- {{this.data}}</div>\n+ {{this.data|e}}</div>\n \"\"\")\n \n "
}
] |
shadowsocksr | 661fbbfb8b6c1888f760a57bbeee81ae616a9b2a | a3344d9f1c5b88184778986ef324481fcaa41204 | asyncmgr.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -69,7 +69,7 @@ class ServerMgr(object):
elif args[3] == '1':
server_pool.ServerPool.get_instance().new_server(args[1], args[2])
- def handle_event(self, sock, event):
+ def handle_event(self, sock, fd, event):
if sock != self._sock:
return
if event & eventloop.POLL_ERR:
| def handle_event ( self , sock , event ) : if sock != self . _sock : return if event & eventloop . POLL_ERR : | def handle_event ( self , sock , fd , event ) : if sock != self . _sock : return if event & eventloop . POLL_ERR : | SINGLE_STMT | [["Insert", ["parameters", 3, 21, 3, 40], ["identifier:fd", "T"], 5], ["Insert", ["parameters", 3, 21, 3, 40], [",:,", "T"], 6]] | myheartsgoon/shadowsocksr@661fbbfb8b6c1888f760a57bbeee81ae616a9b2a | fix handle_event | [
{
"sha": "9bf4d093607b24af3d8b4813b47508f17215ce11",
"filename": "asyncmgr.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/661fbbfb8b6c1888f760a57bbeee81ae616a9b2a/asyncmgr.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/661fbbfb8b6c1888f760a57bbeee81ae616a9b2a/asyncmgr.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/asyncmgr.py?ref=661fbbfb8b6c1888f760a57bbeee81ae616a9b2a",
"patch": "@@ -69,7 +69,7 @@ def _handle_data(self, sock):\n elif args[3] == '1':\n server_pool.ServerPool.get_instance().new_server(args[1], args[2])\n \n- def handle_event(self, sock, event):\n+ def handle_event(self, sock, fd, event):\n if sock != self._sock:\n return\n if event & eventloop.POLL_ERR:"
}
] |
shadowsocksr | e060fd5b4d9e7f0ab4921b3dc9212de83816cff4 | 93c94fbe3c781f477e65cd34552ec8a0e43ec541 | shadowsocks/obfsplugin/http_simple.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -238,7 +238,7 @@ class random_head(object):
if self.has_sent_header:
return buf
self.has_sent_header = True
- return os.urandom(common.ord(os.urandom(1)[0]) % 96)
+ return os.urandom(common.ord(os.urandom(1)[0]) % 96 + 1)
def server_decode(self, buf):
if self.has_recv_header:
| return os . urandom ( common . ord ( os . urandom ( 1 ) [ 0 ] ) % 96 ) | return os . urandom ( common . ord ( os . urandom ( 1 ) [ 0 ] ) % 96 + 1 ) | SINGLE_STMT | [["Move", ["binary_operator", 3, 27, 3, 60], ["binary_operator", 3, 27, 3, 60], 0], ["Insert", ["binary_operator", 3, 27, 3, 60], ["+:+", "T"], 1], ["Insert", ["binary_operator", 3, 27, 3, 60], ["integer:1", "T"], 2]] | myheartsgoon/shadowsocksr@e060fd5b4d9e7f0ab4921b3dc9212de83816cff4 | tiny bug | [
{
"sha": "0e3c211d51c7a190e87faba6da5db63914fb9fbe",
"filename": "shadowsocks/obfsplugin/http_simple.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/e060fd5b4d9e7f0ab4921b3dc9212de83816cff4/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/e060fd5b4d9e7f0ab4921b3dc9212de83816cff4/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fhttp_simple.py?ref=e060fd5b4d9e7f0ab4921b3dc9212de83816cff4",
"patch": "@@ -238,7 +238,7 @@ def server_encode(self, buf):\n if self.has_sent_header:\n return buf\n self.has_sent_header = True\n- return os.urandom(common.ord(os.urandom(1)[0]) % 96)\n+ return os.urandom(common.ord(os.urandom(1)[0]) % 96 + 1)\n \n def server_decode(self, buf):\n if self.has_recv_header:"
}
] |
shadowsocksr | 8ee4cd513a92dac893266490ae9477b2810b839b | 5137377580d85102be503673016582dfdcc4118b | shadowsocks/obfsplugin/verify_simple.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -422,7 +422,7 @@ class auth_simple(verify_base):
def client_pre_encrypt(self, buf):
ret = b''
if not self.has_sent_header:
- datalen = max(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4)
+ datalen = min(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4)
ret += self.pack_data(self.auth_data() + buf[:datalen])
buf = buf[datalen:]
self.has_sent_header = True
| datalen = max ( len ( buf ) , common . ord ( os . urandom ( 1 ) [ 0 ] ) % 32 + 4 ) | datalen = min ( len ( buf ) , common . ord ( os . urandom ( 1 ) [ 0 ] ) % 32 + 4 ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:max", 3, 23, 3, 26], "min"]] | myheartsgoon/shadowsocksr@8ee4cd513a92dac893266490ae9477b2810b839b | a stupid bug | [
{
"sha": "6b90a5a6561e29693867f7018228fbdf33214be4",
"filename": "shadowsocks/obfsplugin/verify_simple.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/8ee4cd513a92dac893266490ae9477b2810b839b/shadowsocks%2Fobfsplugin%2Fverify_simple.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/8ee4cd513a92dac893266490ae9477b2810b839b/shadowsocks%2Fobfsplugin%2Fverify_simple.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fverify_simple.py?ref=8ee4cd513a92dac893266490ae9477b2810b839b",
"patch": "@@ -422,7 +422,7 @@ def auth_data(self):\n def client_pre_encrypt(self, buf):\n ret = b''\n if not self.has_sent_header:\n- datalen = max(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4)\n+ datalen = min(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4)\n ret += self.pack_data(self.auth_data() + buf[:datalen])\n buf = buf[datalen:]\n self.has_sent_header = True"
}
] |
shadowsocksr | 3930cfc72653cde212f9b95efd2fcd62bb4749c2 | 84275b681565b13c002720c56d9be4abb6e065da | shadowsocks/obfsplugin/verify.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -295,7 +295,7 @@ class verify_sha1(verify_base):
ret = b''
if not self.has_sent_header:
datalen = self.get_head_size(buf, 30)
- ret += self.pack_auth_data(buf[datalen:])
+ ret += self.pack_auth_data(buf[:datalen])
buf = buf[datalen:]
self.has_sent_header = True
while len(buf) > self.unit_len:
| ret += self . pack_auth_data ( buf [ datalen : ] ) | ret += self . pack_auth_data ( buf [ : datalen ] ) | SINGLE_STMT | [["Move", ["identifier:datalen", 3, 44, 3, 51], ["slice", 3, 44, 3, 52], 2]] | myheartsgoon/shadowsocksr@3930cfc72653cde212f9b95efd2fcd62bb4749c2 | fix a bug | [
{
"sha": "1c939ae1e7bd7b9896916e34d67489cd116f4f79",
"filename": "shadowsocks/obfsplugin/verify.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/3930cfc72653cde212f9b95efd2fcd62bb4749c2/shadowsocks%2Fobfsplugin%2Fverify.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/3930cfc72653cde212f9b95efd2fcd62bb4749c2/shadowsocks%2Fobfsplugin%2Fverify.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fverify.py?ref=3930cfc72653cde212f9b95efd2fcd62bb4749c2",
"patch": "@@ -295,7 +295,7 @@ def client_pre_encrypt(self, buf):\n ret = b''\n if not self.has_sent_header:\n datalen = self.get_head_size(buf, 30)\n- ret += self.pack_auth_data(buf[datalen:])\n+ ret += self.pack_auth_data(buf[:datalen])\n buf = buf[datalen:]\n self.has_sent_header = True\n while len(buf) > self.unit_len:"
}
] |
shadowsocksr | 443c4f35c21efd9fa532c05aafc3c9137decdf5f | 13579f1ca437f81175b638ebc2a49beec0ff33d6 | shadowsocks/asyncdns.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -81,7 +81,7 @@ def detect_ipv6_supprot():
if 'has_ipv6' in dir(socket):
try:
s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
- s.connect(('ipv6.google.com', 0))
+ s.connect(('::1', 0))
print('IPv6 support')
return True
except:
| s . connect ( ( 'ipv6.google.com' , 0 ) ) | s . connect ( ( '::1' , 0 ) ) | CHANGE_STRING_LITERAL | [["Update", ["string:'ipv6.google.com'", 3, 24, 3, 41], "'::1'"]] | myheartsgoon/shadowsocksr@443c4f35c21efd9fa532c05aafc3c9137decdf5f | fix IPv6 detect | [
{
"sha": "cd8550accd6588fc3b8acee57540fc01589b8c0b",
"filename": "shadowsocks/asyncdns.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/443c4f35c21efd9fa532c05aafc3c9137decdf5f/shadowsocks%2Fasyncdns.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/443c4f35c21efd9fa532c05aafc3c9137decdf5f/shadowsocks%2Fasyncdns.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fasyncdns.py?ref=443c4f35c21efd9fa532c05aafc3c9137decdf5f",
"patch": "@@ -81,7 +81,7 @@ def detect_ipv6_supprot():\n if 'has_ipv6' in dir(socket):\n try:\n s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)\n- s.connect(('ipv6.google.com', 0))\n+ s.connect(('::1', 0))\n print('IPv6 support')\n return True\n except:"
}
] |
shadowsocksr | b151bf815fdb9df5e2d13bef825e816ffb9c2872 | ddcf7f796f50aa766f22411112c4b5338547f822 | shadowsocks/crypto/sodium.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -56,7 +56,7 @@ def load_libsodium():
libsodium.crypto_stream_chacha20_ietf_xor_ic.restype = c_int
libsodium.crypto_stream_chacha20_ietf_xor_ic.argtypes = (c_void_p, c_char_p,
c_ulonglong,
- c_char_p, c_ulonglong,
+ c_char_p, c_ulong,
c_char_p)
except:
pass
| libsodium . crypto_stream_chacha20_ietf_xor_ic . argtypes = ( c_void_p , c_char_p , c_ulonglong , c_char_p , c_ulonglong , c_char_p ) | libsodium . crypto_stream_chacha20_ietf_xor_ic . argtypes = ( c_void_p , c_char_p , c_ulonglong , c_char_p , c_ulong , c_char_p ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:c_ulonglong", 3, 67, 3, 78], "c_ulong"]] | myheartsgoon/shadowsocksr@b151bf815fdb9df5e2d13bef825e816ffb9c2872 | fix "chacha20-ietf" | [
{
"sha": "c4b5c1c93ceb834ee0a60421461b3a7fc239e645",
"filename": "shadowsocks/crypto/sodium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/b151bf815fdb9df5e2d13bef825e816ffb9c2872/shadowsocks%2Fcrypto%2Fsodium.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/b151bf815fdb9df5e2d13bef825e816ffb9c2872/shadowsocks%2Fcrypto%2Fsodium.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Fsodium.py?ref=b151bf815fdb9df5e2d13bef825e816ffb9c2872",
"patch": "@@ -56,7 +56,7 @@ def load_libsodium():\n libsodium.crypto_stream_chacha20_ietf_xor_ic.restype = c_int\n libsodium.crypto_stream_chacha20_ietf_xor_ic.argtypes = (c_void_p, c_char_p,\n c_ulonglong,\n- c_char_p, c_ulonglong,\n+ c_char_p, c_ulong,\n c_char_p)\n except:\n pass"
}
] |
shadowsocksr | e56c5e4b90f0f72998a299072424af5ac22b009a | 519c84719fb9017de504db677b9c9cb9bb586654 | shadowsocks/server.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -74,7 +74,7 @@ def main():
if type(password_obfs) == list:
password = password_obfs[0]
obfs = password_obfs[1]
- if len(password_obfs) >= 2:
+ if len(password_obfs) > 2:
protocol = password_obfs[2]
elif type(password_obfs) == dict:
password = password_obfs.get('password', 'm')
| if len ( password_obfs ) >= 2 : protocol = password_obfs [ 2 ] | if len ( password_obfs ) > 2 : protocol = password_obfs [ 2 ] | CHANGE_BINARY_OPERATOR | [["Insert", ["comparison_operator", 3, 16, 3, 39], [">:>", "T"], 1], ["Delete", [">=:>=", 3, 35, 3, 37]]] | myheartsgoon/shadowsocksr@e56c5e4b90f0f72998a299072424af5ac22b009a | fix index | [
{
"sha": "6ec63c0dd2ffb599b0803dab2fcc654e574fb268",
"filename": "shadowsocks/server.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/e56c5e4b90f0f72998a299072424af5ac22b009a/shadowsocks%2Fserver.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/e56c5e4b90f0f72998a299072424af5ac22b009a/shadowsocks%2Fserver.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fserver.py?ref=e56c5e4b90f0f72998a299072424af5ac22b009a",
"patch": "@@ -74,7 +74,7 @@ def main():\n if type(password_obfs) == list:\n password = password_obfs[0]\n obfs = password_obfs[1]\n- if len(password_obfs) >= 2:\n+ if len(password_obfs) > 2:\n protocol = password_obfs[2]\n elif type(password_obfs) == dict:\n password = password_obfs.get('password', 'm')"
}
] |
shadowsocksr | 81b059759147545a06a8167a6b7b240ef9246b3c | e76939981a379c20351048a115311db9e056a6e8 | shadowsocks/obfsplugin/http_simple.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -79,7 +79,7 @@ class http_simple(plain.plain):
def encode_head(self, buf):
ret = b''
for ch in buf:
- ret += '%' + binascii.hexlify(chr(ch))
+ ret += b'%' + binascii.hexlify(chr(ch))
return ret
def client_encode(self, buf):
| ret += '%' + binascii . hexlify ( chr ( ch ) ) | ret += b'%' + binascii . hexlify ( chr ( ch ) ) | CHANGE_BINARY_OPERAND | [["Update", ["string:'%'", 3, 20, 3, 23], "b'%'"]] | myheartsgoon/shadowsocksr@81b059759147545a06a8167a6b7b240ef9246b3c | fix "bytes" in "encode_head" | [
{
"sha": "e1e359bbbb1a8b42810809cefbba1bfc09a4b0ce",
"filename": "shadowsocks/obfsplugin/http_simple.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/81b059759147545a06a8167a6b7b240ef9246b3c/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/81b059759147545a06a8167a6b7b240ef9246b3c/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fhttp_simple.py?ref=81b059759147545a06a8167a6b7b240ef9246b3c",
"patch": "@@ -79,7 +79,7 @@ def __init__(self, method):\n def encode_head(self, buf):\n ret = b''\n for ch in buf:\n- ret += '%' + binascii.hexlify(chr(ch))\n+ ret += b'%' + binascii.hexlify(chr(ch))\n return ret\n \n def client_encode(self, buf):"
}
] |
shadowsocksr | a49b21ee2c1c9bfe9f0f5b58e418d366463d8807 | 81b059759147545a06a8167a6b7b240ef9246b3c | shadowsocks/obfsplugin/http_simple.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -79,7 +79,7 @@ class http_simple(plain.plain):
def encode_head(self, buf):
ret = b''
for ch in buf:
- ret += b'%' + binascii.hexlify(chr(ch))
+ ret += b'%' + to_bytes(binascii.hexlify(chr(ch)))
return ret
def client_encode(self, buf):
| ret += b'%' + binascii . hexlify ( chr ( ch ) ) | ret += b'%' + to_bytes ( binascii . hexlify ( chr ( ch ) ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 27, 3, 52], ["identifier:to_bytes", "T"], 0], ["Insert", ["call", 3, 27, 3, 52], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 3, 27, 3, 52], 1], ["Insert", "N0", ["):)", "T"], 2]] | myheartsgoon/shadowsocksr@a49b21ee2c1c9bfe9f0f5b58e418d366463d8807 | fix "bytes" in "encode_head" 2 | [
{
"sha": "f0d563f34a24bec2609ad421fe0a12acd41932ec",
"filename": "shadowsocks/obfsplugin/http_simple.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/a49b21ee2c1c9bfe9f0f5b58e418d366463d8807/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/a49b21ee2c1c9bfe9f0f5b58e418d366463d8807/shadowsocks%2Fobfsplugin%2Fhttp_simple.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fhttp_simple.py?ref=a49b21ee2c1c9bfe9f0f5b58e418d366463d8807",
"patch": "@@ -79,7 +79,7 @@ def __init__(self, method):\n def encode_head(self, buf):\n ret = b''\n for ch in buf:\n- ret += b'%' + binascii.hexlify(chr(ch))\n+ ret += b'%' + to_bytes(binascii.hexlify(chr(ch)))\n return ret\n \n def client_encode(self, buf):"
}
] |
shadowsocksr | cb866dc8fe524d15264c2359f743fcb1e8d4d2f2 | be922ba7c2e5ebe6f073033ea5cf05fda6a3427c | shadowsocks/shell.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -236,7 +236,7 @@ def get_config(is_local):
config['obfs_param'] = to_str(config.get('obfs_param', ''))
config['port_password'] = config.get('port_password', None)
config['timeout'] = int(config.get('timeout', 300))
- config['udp_timeout'] = int(config.get('udp_timeout', config['timeout']))
+ config['udp_timeout'] = int(config.get('udp_timeout', 120))
config['udp_cache'] = int(config.get('udp_cache', 64))
config['fast_open'] = config.get('fast_open', False)
config['workers'] = config.get('workers', 1)
| config [ 'udp_timeout' ] = int ( config . get ( 'udp_timeout' , config [ 'timeout' ] ) ) | config [ 'udp_timeout' ] = int ( config . get ( 'udp_timeout' , 120 ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 43, 3, 77], ["integer:120", "T"], 3], ["Delete", ["identifier:config", 3, 59, 3, 65]], ["Delete", ["[:[", 3, 65, 3, 66]], ["Delete", ["string:'timeout'", 3, 66, 3, 75]], ["Delete", ["]:]", 3, 75, 3, 76]], ["Delete", ["subscript", 3, 59, 3, 76]]] | myheartsgoon/shadowsocksr@cb866dc8fe524d15264c2359f743fcb1e8d4d2f2 | set udp_timeout default value | [
{
"sha": "babac982d0d350042c7cde38339c88da24a6953b",
"filename": "shadowsocks/shell.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/cb866dc8fe524d15264c2359f743fcb1e8d4d2f2/shadowsocks%2Fshell.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/cb866dc8fe524d15264c2359f743fcb1e8d4d2f2/shadowsocks%2Fshell.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fshell.py?ref=cb866dc8fe524d15264c2359f743fcb1e8d4d2f2",
"patch": "@@ -236,7 +236,7 @@ def get_config(is_local):\n config['obfs_param'] = to_str(config.get('obfs_param', ''))\n config['port_password'] = config.get('port_password', None)\n config['timeout'] = int(config.get('timeout', 300))\n- config['udp_timeout'] = int(config.get('udp_timeout', config['timeout']))\n+ config['udp_timeout'] = int(config.get('udp_timeout', 120))\n config['udp_cache'] = int(config.get('udp_cache', 64))\n config['fast_open'] = config.get('fast_open', False)\n config['workers'] = config.get('workers', 1)"
}
] |
shadowsocksr | 2e65becc44e877ef4924102749cceb402e3cd38b | c5ca6bd80aa2fc7278f7486e06bc050df54d9893 | shadowsocks/udprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -1080,7 +1080,7 @@ class UDPRelay(object):
client = socket.socket(af, socktype, proto)
client.setblocking(False)
is_dns = False
- if len(data) > 12 and data[11:19] == b"\x00\x01\x00\x00\x00\x00\x00\x00":
+ if len(data) > 20 and data[11:19] == b"\x00\x01\x00\x00\x00\x00\x00\x00":
is_dns = True
else:
pass
| if len ( data ) > 12 and data [ 11 : 19 ] == b"\x00\x01\x00\x00\x00\x00\x00\x00" : is_dns = True else : pass | if len ( data ) > 20 and data [ 11 : 19 ] == b"\x00\x01\x00\x00\x00\x00\x00\x00" : is_dns = True else : pass | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:12", 3, 28, 3, 30], "20"]] | myheartsgoon/shadowsocksr@2e65becc44e877ef4924102749cceb402e3cd38b | fix data size | [
{
"sha": "347c89b02ddd1766776b0ac676e27e8f08d039cd",
"filename": "shadowsocks/udprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/2e65becc44e877ef4924102749cceb402e3cd38b/shadowsocks%2Fudprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/2e65becc44e877ef4924102749cceb402e3cd38b/shadowsocks%2Fudprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fudprelay.py?ref=2e65becc44e877ef4924102749cceb402e3cd38b",
"patch": "@@ -1080,7 +1080,7 @@ def _handle_server(self):\n client = socket.socket(af, socktype, proto)\n client.setblocking(False)\n is_dns = False\n- if len(data) > 12 and data[11:19] == b\"\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\":\n+ if len(data) > 20 and data[11:19] == b\"\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\":\n is_dns = True\n else:\n pass"
}
] |
shadowsocksr | b344bc236b5a28ada617e462b3a4f8dcc8fb595f | 9b14c019bb311b9b9ab86ff2178a511025c405e2 | shadowsocks/asyncdns.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -289,7 +289,7 @@ class DNSResolver(object):
for line in content:
line = line.strip()
if line:
- parts = line.split(' ', 1)
+ parts = line.split(b' ', 1)
if len(parts) >= 2:
server = parts[0]
port = int(parts[1])
| parts = line . split ( ' ' , 1 ) | parts = line . split ( b' ' , 1 ) | CHANGE_STRING_LITERAL | [["Update", ["string:' '", 3, 44, 3, 47], "b' '"]] | myheartsgoon/shadowsocksr@b344bc236b5a28ada617e462b3a4f8dcc8fb595f | fix bytes | [
{
"sha": "3f92e6285285b41326c22760c440d2c21e64f861",
"filename": "shadowsocks/asyncdns.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/b344bc236b5a28ada617e462b3a4f8dcc8fb595f/shadowsocks%2Fasyncdns.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/b344bc236b5a28ada617e462b3a4f8dcc8fb595f/shadowsocks%2Fasyncdns.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fasyncdns.py?ref=b344bc236b5a28ada617e462b3a4f8dcc8fb595f",
"patch": "@@ -289,7 +289,7 @@ def _parse_resolv(self):\n for line in content:\n line = line.strip()\n if line:\n- parts = line.split(' ', 1)\n+ parts = line.split(b' ', 1)\n if len(parts) >= 2:\n server = parts[0]\n port = int(parts[1])"
}
] |
shadowsocksr | 050270a7258a3478797eb92bc647590f52b190a7 | f5434bdbd02290050140f3b396bea6bb773f2850 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -668,7 +668,7 @@ class TCPRelayHandler(object):
try:
data, sendback = self._protocol.server_post_decrypt(data)
if sendback:
- backdata = self._protocol.server_pre_encrypt('')
+ backdata = self._protocol.server_pre_encrypt(b'')
backdata = self._encryptor.encrypt(backdata)
backdata = self._obfs.server_encode(backdata)
try:
| backdata = self . _protocol . server_pre_encrypt ( '' ) | backdata = self . _protocol . server_pre_encrypt ( b'' ) | CHANGE_STRING_LITERAL | [["Update", ["string:''", 3, 74, 3, 76], "b''"]] | myheartsgoon/shadowsocksr@050270a7258a3478797eb92bc647590f52b190a7 | fix send back str type | [
{
"sha": "e1898fc77cb293565e9df1701f3b1aa4e4a1c572",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/050270a7258a3478797eb92bc647590f52b190a7/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/050270a7258a3478797eb92bc647590f52b190a7/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=050270a7258a3478797eb92bc647590f52b190a7",
"patch": "@@ -668,7 +668,7 @@ def _on_local_read(self):\n try:\n data, sendback = self._protocol.server_post_decrypt(data)\n if sendback:\n- backdata = self._protocol.server_pre_encrypt('')\n+ backdata = self._protocol.server_pre_encrypt(b'')\n backdata = self._encryptor.encrypt(backdata)\n backdata = self._obfs.server_encode(backdata)\n try:"
}
] |
shadowsocksr | 2c4600cf0e60d9a26766d20c0e7ef6a850081272 | b922d70a87167174d438ab01e2ac15c48b5ea9dd | db_transfer.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -413,7 +413,7 @@ class Dbv3Transfer(DbTransfer):
cur = conn.cursor()
- cur.execute("SELECT `traffic_rate` FROM ss_node where `id`='" + str(get_config().NODE_ID) + "'")
+ cur.execute("SELECT `traffic_rate` FROM ss_node where `id`='" + str(self.cfg["node_id"]) + "'")
nodeinfo = cur.fetchone()
if nodeinfo == None :
| cur . execute ( "SELECT `traffic_rate` FROM ss_node where `id`='" + str ( get_config ( ) . NODE_ID ) + "'" ) | cur . execute ( "SELECT `traffic_rate` FROM ss_node where `id`='" + str ( self . cfg [ "node_id" ] ) + "'" ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 70, 3, 92], ["subscript", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:\"node_id\"", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Update", ["identifier:get_config", 3, 71, 3, 81], "self"], ["Move", "N1", ["identifier:get_config", 3, 71, 3, 81], 0], ["Move", "N1", [".:.", 3, 83, 3, 84], 1], ["Insert", "N1", ["identifier:cfg", "T"], 2], ["Delete", ["(:(", 3, 81, 3, 82]], ["Delete", ["):)", 3, 82, 3, 83]], ["Delete", ["argument_list", 3, 81, 3, 83]], ["Delete", ["call", 3, 71, 3, 83]], ["Delete", ["identifier:NODE_ID", 3, 84, 3, 91]], ["Delete", ["attribute", 3, 71, 3, 91]]] | myheartsgoon/shadowsocksr@2c4600cf0e60d9a26766d20c0e7ef6a850081272 | fix get node_id | [
{
"sha": "dbb04278434a7c383d5d1ff4f6010e8d387801d3",
"filename": "db_transfer.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/2c4600cf0e60d9a26766d20c0e7ef6a850081272/db_transfer.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/2c4600cf0e60d9a26766d20c0e7ef6a850081272/db_transfer.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/db_transfer.py?ref=2c4600cf0e60d9a26766d20c0e7ef6a850081272",
"patch": "@@ -413,7 +413,7 @@ def pull_db_users(self, conn):\n \n \t\tcur = conn.cursor()\n \n-\t\tcur.execute(\"SELECT `traffic_rate` FROM ss_node where `id`='\" + str(get_config().NODE_ID) + \"'\")\n+\t\tcur.execute(\"SELECT `traffic_rate` FROM ss_node where `id`='\" + str(self.cfg[\"node_id\"]) + \"'\")\n \t\tnodeinfo = cur.fetchone()\n \n \t\tif nodeinfo == None :"
}
] |
shadowsocksr | a440a726f6d3a25fe2eeac94786580f462a314a7 | 3525d3d86aab16b7b5d096d5959df88c13554608 | db_transfer.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -426,7 +426,7 @@ class Dbv3Transfer(DbTransfer):
node_info_dict = {}
for column in range(len(nodeinfo)):
- node_info_dict[node_info_keys[column]] = r[column]
+ node_info_dict[node_info_keys[column]] = nodeinfo[column]
self.cfg['transfer_mul'] = float(node_info_dict['traffic_rate'])
cur = conn.cursor()
| node_info_dict [ node_info_keys [ column ] ] = r [ column ] | node_info_dict [ node_info_keys [ column ] ] = nodeinfo [ column ] | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:r", 3, 45, 3, 46], "nodeinfo"]] | myheartsgoon/shadowsocksr@a440a726f6d3a25fe2eeac94786580f462a314a7 | fix get node_id | [
{
"sha": "b5abd55d7baaac2d62b6aba3a9324ecac0650321",
"filename": "db_transfer.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/a440a726f6d3a25fe2eeac94786580f462a314a7/db_transfer.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/a440a726f6d3a25fe2eeac94786580f462a314a7/db_transfer.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/db_transfer.py?ref=a440a726f6d3a25fe2eeac94786580f462a314a7",
"patch": "@@ -426,7 +426,7 @@ def pull_db_users(self, conn):\n \n \t\tnode_info_dict = {}\n \t\tfor column in range(len(nodeinfo)):\n-\t\t\tnode_info_dict[node_info_keys[column]] = r[column]\n+\t\t\tnode_info_dict[node_info_keys[column]] = nodeinfo[column]\n \t\tself.cfg['transfer_mul'] = float(node_info_dict['traffic_rate'])\n \n \t\tcur = conn.cursor()"
}
] |
shadowsocksr | d47905f01d1dc93dd4497439c9503ba2e3d30d3e | f3808a306fbafb1e2a451f1ac0b44e53666969a8 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -579,7 +579,7 @@ class TCPRelayHandler(object):
remote_sock.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 1000 * val_idle, 1000 * val_intvl))
elif platform.system() in ["Darwin"]: #OSX
TCP_KEEPALIVE = 0x10
- sock.setsockopt(socket.SOL_TCP, TCP_KEEPALIVE, val_intvl * 2)
+ remote_sock.setsockopt(socket.SOL_TCP, TCP_KEEPALIVE, val_intvl * 2)
if not self._is_local:
bind_addr = ''
| sock . setsockopt ( socket . SOL_TCP , TCP_KEEPALIVE , val_intvl * 2 ) | remote_sock . setsockopt ( socket . SOL_TCP , TCP_KEEPALIVE , val_intvl * 2 ) | SAME_FUNCTION_WRONG_CALLER | [["Update", ["identifier:sock", 3, 17, 3, 21], "remote_sock"]] | myheartsgoon/shadowsocksr@d47905f01d1dc93dd4497439c9503ba2e3d30d3e | fix name | [
{
"sha": "a4e5c7b9ce886d77ea2039da7e8a3981314d51c1",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/d47905f01d1dc93dd4497439c9503ba2e3d30d3e/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/d47905f01d1dc93dd4497439c9503ba2e3d30d3e/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=d47905f01d1dc93dd4497439c9503ba2e3d30d3e",
"patch": "@@ -579,7 +579,7 @@ def _create_remote_socket(self, ip, port):\n remote_sock.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 1000 * val_idle, 1000 * val_intvl))\n elif platform.system() in [\"Darwin\"]: #OSX\n TCP_KEEPALIVE = 0x10\n- sock.setsockopt(socket.SOL_TCP, TCP_KEEPALIVE, val_intvl * 2)\n+ remote_sock.setsockopt(socket.SOL_TCP, TCP_KEEPALIVE, val_intvl * 2)\n \n if not self._is_local:\n bind_addr = ''"
}
] |
shadowsocksr | b3fcee662a2318e0868839b4eaa7e7ebbe004c35 | e1aa68029dd2e3eace5ac40d3b2853eafe22d4f1 | shadowsocks/obfsplugin/auth.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -188,7 +188,7 @@ class auth_sha1(verify_base):
def __init__(self, method):
super(auth_sha1, self).__init__(method)
self.recv_buf = b''
- self.unit_len = 8100
+ self.unit_len = 8000
self.decrypt_packet_num = 0
self.raw_trans = False
self.has_sent_header = False
| self . unit_len = 8100 | self . unit_len = 8000 | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:8100", 3, 25, 3, 29], "8000"]] | myheartsgoon/shadowsocksr@b3fcee662a2318e0868839b4eaa7e7ebbe004c35 | fix unit_len in auth_sha1 | [
{
"sha": "ff87cb0ac491640340b696e44a4104faf0e3a1fb",
"filename": "shadowsocks/obfsplugin/auth.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/b3fcee662a2318e0868839b4eaa7e7ebbe004c35/shadowsocks%2Fobfsplugin%2Fauth.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/b3fcee662a2318e0868839b4eaa7e7ebbe004c35/shadowsocks%2Fobfsplugin%2Fauth.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fauth.py?ref=b3fcee662a2318e0868839b4eaa7e7ebbe004c35",
"patch": "@@ -188,7 +188,7 @@ class auth_sha1(verify_base):\n def __init__(self, method):\n super(auth_sha1, self).__init__(method)\n self.recv_buf = b''\n- self.unit_len = 8100\n+ self.unit_len = 8000\n self.decrypt_packet_num = 0\n self.raw_trans = False\n self.has_sent_header = False"
}
] |
shadowsocksr | 2637c8d1c72425508cec6f6998dd851027f77785 | 88017d964373bd045231049ff2eb5aa66543827f | shadowsocks/crypto/sodium.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -17,7 +17,7 @@
from __future__ import absolute_import, division, print_function, \
with_statement
-from ctypes import c_char_p, c_int, c_ulonglong, byref, \
+from ctypes import c_char_p, c_int, c_ulong, c_ulonglong, byref, \
create_string_buffer, c_void_p
from shadowsocks.crypto import util
| from ctypes import c_char_p , c_int , c_ulonglong , byref , create_string_buffer , c_void_p | from ctypes import c_char_p , c_int , c_ulong , c_ulonglong , byref , create_string_buffer , c_void_p | SINGLE_STMT | [["Insert", ["import_from_statement", 3, 1, 4, 35], ["dotted_name", "N0"], 7], ["Insert", ["import_from_statement", 3, 1, 4, 35], [",:,", "T"], 8], ["Insert", "N0", ["identifier:c_ulong", "T"], 0]] | myheartsgoon/shadowsocksr@2637c8d1c72425508cec6f6998dd851027f77785 | fix chacha20-ietf | [
{
"sha": "51d476bedcac729b7d4493352f023707aea12c65",
"filename": "shadowsocks/crypto/sodium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/2637c8d1c72425508cec6f6998dd851027f77785/shadowsocks%2Fcrypto%2Fsodium.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/2637c8d1c72425508cec6f6998dd851027f77785/shadowsocks%2Fcrypto%2Fsodium.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Fsodium.py?ref=2637c8d1c72425508cec6f6998dd851027f77785",
"patch": "@@ -17,7 +17,7 @@\n from __future__ import absolute_import, division, print_function, \\\n with_statement\n \n-from ctypes import c_char_p, c_int, c_ulonglong, byref, \\\n+from ctypes import c_char_p, c_int, c_ulong, c_ulonglong, byref, \\\n create_string_buffer, c_void_p\n \n from shadowsocks.crypto import util"
}
] |
shadowsocksr | a02e995a8a36a432b9ce2720672ae28d9047f3a6 | 2637c8d1c72425508cec6f6998dd851027f77785 | shadowsocks/eventloop.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -99,7 +99,7 @@ class KqueueLoop(object):
self.register(fd, mode)
def close(self):
- self.kqueue.close()
+ self._kqueue.close()
class SelectLoop(object):
| self . kqueue . close ( ) | self . _kqueue . close ( ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:kqueue", 3, 14, 3, 20], "_kqueue"]] | myheartsgoon/shadowsocksr@a02e995a8a36a432b9ce2720672ae28d9047f3a6 | fix bug at KqueueLoop close (#117) | [
{
"sha": "2ccd7e6c3e8ee3e5fc422d790d8fcde6886cfdce",
"filename": "shadowsocks/eventloop.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/a02e995a8a36a432b9ce2720672ae28d9047f3a6/shadowsocks%2Feventloop.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/a02e995a8a36a432b9ce2720672ae28d9047f3a6/shadowsocks%2Feventloop.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Feventloop.py?ref=a02e995a8a36a432b9ce2720672ae28d9047f3a6",
"patch": "@@ -99,7 +99,7 @@ def modify(self, fd, mode):\n self.register(fd, mode)\n \n def close(self):\n- self.kqueue.close()\n+ self._kqueue.close()\n \n \n class SelectLoop(object):"
}
] |
shadowsocksr | e7db6d4248d628f211c91f458caa5a308c9184ac | a407bcc5684d3c5475d1b39c226bed8c326eb3a0 | mujson_mgr.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -92,7 +92,7 @@ class MuMgr(object):
def add(self, user):
up = {'enable': True, 'u': 0, 'd': 0, 'method': "aes-128-cfb",
- 'protocol': "auth_sha1_v3_compatible",
+ 'protocol': "auth_sha1_v4_compatible",
'obfs': "tls1.2_ticket_auth_compatible",
'transfer_enable': 1125899906842624}
up['passwd'] = self.rand_pass()
| up = { 'enable' : True , 'u' : 0 , 'd' : 0 , 'method' : "aes-128-cfb" , 'protocol' : "auth_sha1_v3_compatible" , 'obfs' : "tls1.2_ticket_auth_compatible" , 'transfer_enable' : 1125899906842624 } | up = { 'enable' : True , 'u' : 0 , 'd' : 0 , 'method' : "aes-128-cfb" , 'protocol' : "auth_sha1_v4_compatible" , 'obfs' : "tls1.2_ticket_auth_compatible" , 'transfer_enable' : 1125899906842624 } | CHANGE_STRING_LITERAL | [["Update", ["string:\"auth_sha1_v3_compatible\"", 3, 15, 3, 40], "\"auth_sha1_v4_compatible\""]] | myheartsgoon/shadowsocksr@e7db6d4248d628f211c91f458caa5a308c9184ac | fix typo | [
{
"sha": "d7a810a4c61adc46db31c8b6ccfadeda18be09d5",
"filename": "mujson_mgr.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/e7db6d4248d628f211c91f458caa5a308c9184ac/mujson_mgr.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/e7db6d4248d628f211c91f458caa5a308c9184ac/mujson_mgr.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/mujson_mgr.py?ref=e7db6d4248d628f211c91f458caa5a308c9184ac",
"patch": "@@ -92,7 +92,7 @@ def rand_pass(self):\n \n \tdef add(self, user):\n \t\tup = {'enable': True, 'u': 0, 'd': 0, 'method': \"aes-128-cfb\",\n-\t\t'protocol': \"auth_sha1_v3_compatible\",\n+\t\t'protocol': \"auth_sha1_v4_compatible\",\n \t\t'obfs': \"tls1.2_ticket_auth_compatible\",\n \t\t'transfer_enable': 1125899906842624}\n \t\tup['passwd'] = self.rand_pass()"
}
] |
shadowsocksr | 2eaca2faeaa2fb29d079c06507813d0d8c03d514 | cfb894400321afe362946a0056d65317fc2c2283 | shadowsocks/obfsplugin/obfs_tls.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -149,7 +149,7 @@ class tls_ticket_auth(plain.plain):
return buf
if self.handshake_status == 8:
ret = b''
- while len(buf) > 4096:
+ while len(buf) > 4196:
size = struct.unpack('>H', os.urandom(2))[0] % 4096 + 100
ret += b"\x17" + self.tls_version + struct.pack('>H', size) + buf[:size]
buf = buf[size:]
| while len ( buf ) > 4096 : size = struct . unpack ( '>H' , os . urandom ( 2 ) ) [ 0 ] % 4096 + 100 ret += b"\x17" + self . tls_version + struct . pack ( '>H' , size ) + buf [ : size ] buf = buf [ size : ] | while len ( buf ) > 4196 : size = struct . unpack ( '>H' , os . urandom ( 2 ) ) [ 0 ] % 4096 + 100 ret += b"\x17" + self . tls_version + struct . pack ( '>H' , size ) + buf [ : size ] buf = buf [ size : ] | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:4096", 3, 30, 3, 34], "4196"]] | myheartsgoon/shadowsocksr@2eaca2faeaa2fb29d079c06507813d0d8c03d514 | fix typo | [
{
"sha": "691e6fa94f7de2bb7f86b0732c12b16ba1587729",
"filename": "shadowsocks/obfsplugin/obfs_tls.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/2eaca2faeaa2fb29d079c06507813d0d8c03d514/shadowsocks%2Fobfsplugin%2Fobfs_tls.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/2eaca2faeaa2fb29d079c06507813d0d8c03d514/shadowsocks%2Fobfsplugin%2Fobfs_tls.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fobfs_tls.py?ref=2eaca2faeaa2fb29d079c06507813d0d8c03d514",
"patch": "@@ -149,7 +149,7 @@ def server_encode(self, buf):\n return buf\n if self.handshake_status == 8:\n ret = b''\n- while len(buf) > 4096:\n+ while len(buf) > 4196:\n size = struct.unpack('>H', os.urandom(2))[0] % 4096 + 100\n ret += b\"\\x17\" + self.tls_version + struct.pack('>H', size) + buf[:size]\n buf = buf[size:]"
}
] |
shadowsocksr | e5824be14579c8d8d32b6814fbbf03eddf6abef0 | 13ffdac2b76697f819ca2b5e21cb78079601fc66 | shadowsocks/crypto/table.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -73,7 +73,7 @@ class NoneCipher(object):
return data
ciphers = {
- 'none': (0, 0, NoneCipher),
+ 'none': (16, 0, NoneCipher),
'table': (0, 0, TableCipher)
}
| ciphers = { 'none' : ( 0 , 0 , NoneCipher ) , 'table' : ( 0 , 0 , TableCipher ) } | ciphers = { 'none' : ( 16 , 0 , NoneCipher ) , 'table' : ( 0 , 0 , TableCipher ) } | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:0", 3, 14, 3, 15], "16"]] | myheartsgoon/shadowsocksr@e5824be14579c8d8d32b6814fbbf03eddf6abef0 | fix none encrypt key size | [
{
"sha": "fd6aa94c975160ef180e6fae5479a73c17f84254",
"filename": "shadowsocks/crypto/table.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/e5824be14579c8d8d32b6814fbbf03eddf6abef0/shadowsocks%2Fcrypto%2Ftable.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/e5824be14579c8d8d32b6814fbbf03eddf6abef0/shadowsocks%2Fcrypto%2Ftable.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Ftable.py?ref=e5824be14579c8d8d32b6814fbbf03eddf6abef0",
"patch": "@@ -73,7 +73,7 @@ def update(self, data):\n return data\n \n ciphers = {\n- 'none': (0, 0, NoneCipher),\n+ 'none': (16, 0, NoneCipher),\n 'table': (0, 0, TableCipher)\n }\n "
}
] |
shadowsocksr | 9c794624e0e6f577d7198de4fbe7de69a349448e | ccacef155611a1cd87299b86a76311a2551e88ff | shadowsocks/obfsplugin/auth.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -1224,7 +1224,7 @@ class auth_aes128_sha1(auth_base):
uid = os.urandom(4)
if b':' in to_bytes(self.server_info.protocol_param):
try:
- items = to_bytes(self.server_info.protocol_param).split(':')
+ items = to_bytes(self.server_info.protocol_param).split(b':')
self.user_key = self.hashfunc(items[1]).digest()
uid = struct.pack('<I', int(items[0]))
except:
| items = to_bytes ( self . server_info . protocol_param ) . split ( ':' ) | items = to_bytes ( self . server_info . protocol_param ) . split ( b':' ) | CHANGE_STRING_LITERAL | [["Update", ["string:':'", 3, 73, 3, 76], "b':'"]] | myheartsgoon/shadowsocksr@9c794624e0e6f577d7198de4fbe7de69a349448e | fix auth_aes128_* client side | [
{
"sha": "b1adc37263cdb4d6cb1df5041feb51ce361be3fd",
"filename": "shadowsocks/obfsplugin/auth.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/9c794624e0e6f577d7198de4fbe7de69a349448e/shadowsocks%2Fobfsplugin%2Fauth.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/9c794624e0e6f577d7198de4fbe7de69a349448e/shadowsocks%2Fobfsplugin%2Fauth.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fauth.py?ref=9c794624e0e6f577d7198de4fbe7de69a349448e",
"patch": "@@ -1224,7 +1224,7 @@ def pack_auth_data(self, auth_data, buf):\n uid = os.urandom(4)\n if b':' in to_bytes(self.server_info.protocol_param):\n try:\n- items = to_bytes(self.server_info.protocol_param).split(':')\n+ items = to_bytes(self.server_info.protocol_param).split(b':')\n self.user_key = self.hashfunc(items[1]).digest()\n uid = struct.pack('<I', int(items[0]))\n except:"
}
] |
shadowsocksr | 68693d5ec7475cf265684a68521562501584c995 | 7cfbe49806e2e0724e42af6ac3898883d68ffa09 | db_transfer.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -278,7 +278,7 @@ class DbTransfer(TransferBase):
import json
config_path = get_config().MYSQL_CONFIG
cfg = None
- with open(config_path, 'r+') as f:
+ with open(config_path, 'rb+') as f:
cfg = json.loads(f.read().decode('utf8'))
if cfg:
| with open ( config_path , 'r+' ) as f : cfg = json . loads ( f . read ( ) . decode ( 'utf8' ) ) | with open ( config_path , 'rb+' ) as f : cfg = json . loads ( f . read ( ) . decode ( 'utf8' ) ) | CHANGE_STRING_LITERAL | [["Update", ["string:'r+'", 3, 26, 3, 30], "'rb+'"]] | myheartsgoon/shadowsocksr@68693d5ec7475cf265684a68521562501584c995 | fix bug under py3 | [
{
"sha": "fa10a4bc8cf44597ec00a5ddb4e79d114949efeb",
"filename": "db_transfer.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/68693d5ec7475cf265684a68521562501584c995/db_transfer.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/68693d5ec7475cf265684a68521562501584c995/db_transfer.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/db_transfer.py?ref=68693d5ec7475cf265684a68521562501584c995",
"patch": "@@ -278,7 +278,7 @@ def load_cfg(self):\n \t\timport json\n \t\tconfig_path = get_config().MYSQL_CONFIG\n \t\tcfg = None\n-\t\twith open(config_path, 'r+') as f:\n+\t\twith open(config_path, 'rb+') as f:\n \t\t\tcfg = json.loads(f.read().decode('utf8'))\n \n \t\tif cfg:"
}
] |
shadowsocksr | 5d479087a88647e9bcc0e2ea900b4903f5dedc83 | 26b4d8bc1822968d55da8ee68c344b31f9594d35 | shadowsocks/obfsplugin/obfs_tls.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -107,7 +107,7 @@ class tls_ticket_auth(plain.plain):
ext += b"\x00\x17\x00\x00"
if host not in self.server_info.data.ticket_buf:
self.server_info.data.ticket_buf[host] = os.urandom((struct.unpack('>H', os.urandom(2))[0] % 17 + 8) * 16)
- ext += b"\x00\x23" + struct.pack('>H', len(self.ticket_size_buf[host])) + self.ticket_size_buf[host]
+ ext += b"\x00\x23" + struct.pack('>H', len(self.server_info.data.ticket_buf[host])) + self.server_info.data.ticket_buf[host]
ext += binascii.unhexlify(b"000d001600140601060305010503040104030301030302010203")
ext += binascii.unhexlify(b"000500050100000000")
ext += binascii.unhexlify(b"00120000")
| ext += b"\x00\x23" + struct . pack ( '>H' , len ( self . ticket_size_buf [ host ] ) ) + self . ticket_size_buf [ host ] | ext += b"\x00\x23" + struct . pack ( '>H' , len ( self . server_info . data . ticket_buf [ host ] ) ) + self . server_info . data . ticket_buf [ host ] | SINGLE_STMT | [["Insert", ["subscript", 3, 87, 3, 113], ["attribute", "N0"], 0], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:ticket_buf", "T"], 2], ["Move", "N1", ["attribute", 3, 87, 3, 107], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:data", "T"], 2], ["Update", ["identifier:ticket_size_buf", 3, 92, 3, 107], "server_info"], ["Insert", ["subscript", 3, 56, 3, 82], ["attribute", "N2"], 0], ["Insert", "N2", ["attribute", "N3"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:ticket_buf", "T"], 2], ["Move", "N3", ["attribute", 3, 56, 3, 76], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:data", "T"], 2], ["Update", ["identifier:ticket_size_buf", 3, 61, 3, 76], "server_info"]] | myheartsgoon/shadowsocksr@5d479087a88647e9bcc0e2ea900b4903f5dedc83 | fix tls1.2_ticket_auth when it as a client | [
{
"sha": "18839106cbd737c96050829a1efcc2150f553477",
"filename": "shadowsocks/obfsplugin/obfs_tls.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/5d479087a88647e9bcc0e2ea900b4903f5dedc83/shadowsocks%2Fobfsplugin%2Fobfs_tls.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/5d479087a88647e9bcc0e2ea900b4903f5dedc83/shadowsocks%2Fobfsplugin%2Fobfs_tls.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fobfs_tls.py?ref=5d479087a88647e9bcc0e2ea900b4903f5dedc83",
"patch": "@@ -107,7 +107,7 @@ def client_encode(self, buf):\n ext += b\"\\x00\\x17\\x00\\x00\"\n if host not in self.server_info.data.ticket_buf:\n self.server_info.data.ticket_buf[host] = os.urandom((struct.unpack('>H', os.urandom(2))[0] % 17 + 8) * 16)\n- ext += b\"\\x00\\x23\" + struct.pack('>H', len(self.ticket_size_buf[host])) + self.ticket_size_buf[host]\n+ ext += b\"\\x00\\x23\" + struct.pack('>H', len(self.server_info.data.ticket_buf[host])) + self.server_info.data.ticket_buf[host]\n ext += binascii.unhexlify(b\"000d001600140601060305010503040104030301030302010203\")\n ext += binascii.unhexlify(b\"000500050100000000\")\n ext += binascii.unhexlify(b\"00120000\")"
}
] |
shadowsocksr | bf8bb8afe27dcde8b124c3b849d77474229d5d71 | 5d479087a88647e9bcc0e2ea900b4903f5dedc83 | shadowsocks/obfsplugin/auth.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -1434,7 +1434,7 @@ class auth_aes128_sha1(auth_base):
self.user_id = os.urandom(4)
self.user_key = self.server_info.key
buf += self.user_id
- return buf + hmac.new(user_key, buf, self.hashfunc).digest()[:4]
+ return buf + hmac.new(self.user_key, buf, self.hashfunc).digest()[:4]
def client_udp_post_decrypt(self, buf):
user_key = self.server_info.key
| return buf + hmac . new ( user_key , buf , self . hashfunc ) . digest ( ) [ : 4 ] | return buf + hmac . new ( self . user_key , buf , self . hashfunc ) . digest ( ) [ : 4 ] | SINGLE_STMT | [["Insert", ["argument_list", 3, 30, 3, 60], ["attribute", "N0"], 1], ["Insert", "N0", ["identifier:self", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:user_key", 3, 31, 3, 39], 2]] | myheartsgoon/shadowsocksr@bf8bb8afe27dcde8b124c3b849d77474229d5d71 | fix undefined variable bug (#171) | [
{
"sha": "b787b33a0dd25efd60c16437902752ffbf5c061e",
"filename": "shadowsocks/obfsplugin/auth.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/bf8bb8afe27dcde8b124c3b849d77474229d5d71/shadowsocks%2Fobfsplugin%2Fauth.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/bf8bb8afe27dcde8b124c3b849d77474229d5d71/shadowsocks%2Fobfsplugin%2Fauth.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fobfsplugin%2Fauth.py?ref=bf8bb8afe27dcde8b124c3b849d77474229d5d71",
"patch": "@@ -1434,7 +1434,7 @@ def client_udp_pre_encrypt(self, buf):\n self.user_id = os.urandom(4)\n self.user_key = self.server_info.key\n buf += self.user_id\n- return buf + hmac.new(user_key, buf, self.hashfunc).digest()[:4]\n+ return buf + hmac.new(self.user_key, buf, self.hashfunc).digest()[:4]\n \n def client_udp_post_decrypt(self, buf):\n user_key = self.server_info.key"
}
] |
shadowsocksr | bae7d7a0c2c1bf5b0a91898abf5a8db3342dd288 | e1b199fc44008f226eb786f9aaa3b210aa3ed8b1 | mujson_mgr.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -76,7 +76,7 @@ class MuMgr(object):
for row in self.data.json:
if int(row['port']) == muid:
param = str(muid) + ':' + row['passwd']
- protocol_param = '/?protoparam=' + base64.urlsafe_b64encode(common.to_bytes(param)).replace("=", "")
+ protocol_param = '/?protoparam=' + common.to_str(base64.urlsafe_b64encode(common.to_bytes(param))).replace("=", "")
break
link = ("%s:%s:%s:%s:%s:%s" % (self.server_addr, user['port'], protocol, user['method'], obfs, common.to_str(base64.urlsafe_b64encode(common.to_bytes(user['passwd']))).replace("=", ""))) + protocol_param
return "ssr://" + (encode and common.to_str(base64.urlsafe_b64encode(common.to_bytes(link))).replace("=", "") or link)
| protocol_param = '/?protoparam=' + base64 . urlsafe_b64encode ( common . to_bytes ( param ) ) . replace ( "=" , "" ) | protocol_param = '/?protoparam=' + common . to_str ( base64 . urlsafe_b64encode ( common . to_bytes ( param ) ) ) . replace ( "=" , "" ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 42, 3, 90], ["attribute", "N0"], 0], ["Insert", ["call", 3, 42, 3, 90], ["argument_list", "N1"], 1], ["Insert", "N0", ["identifier:common", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:to_str", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["call", 3, 42, 3, 90], 1], ["Insert", "N1", ["):)", "T"], 2]] | myheartsgoon/shadowsocksr@bae7d7a0c2c1bf5b0a91898abf5a8db3342dd288 | fix str type under py3 | [
{
"sha": "d7f4421482a68a61f74470b359e66f8fc29a3b9f",
"filename": "mujson_mgr.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/bae7d7a0c2c1bf5b0a91898abf5a8db3342dd288/mujson_mgr.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/bae7d7a0c2c1bf5b0a91898abf5a8db3342dd288/mujson_mgr.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/mujson_mgr.py?ref=bae7d7a0c2c1bf5b0a91898abf5a8db3342dd288",
"patch": "@@ -76,7 +76,7 @@ def ssrlink(self, user, encode, muid):\n \t\t\t\tfor row in self.data.json:\n \t\t\t\t\tif int(row['port']) == muid:\n \t\t\t\t\t\tparam = str(muid) + ':' + row['passwd']\n-\t\t\t\t\t\tprotocol_param = '/?protoparam=' + base64.urlsafe_b64encode(common.to_bytes(param)).replace(\"=\", \"\")\n+\t\t\t\t\t\tprotocol_param = '/?protoparam=' + common.to_str(base64.urlsafe_b64encode(common.to_bytes(param))).replace(\"=\", \"\")\n \t\t\t\t\t\tbreak\n \t\tlink = (\"%s:%s:%s:%s:%s:%s\" % (self.server_addr, user['port'], protocol, user['method'], obfs, common.to_str(base64.urlsafe_b64encode(common.to_bytes(user['passwd']))).replace(\"=\", \"\"))) + protocol_param\n \t\treturn \"ssr://\" + (encode and common.to_str(base64.urlsafe_b64encode(common.to_bytes(link))).replace(\"=\", \"\") or link)"
}
] |
shadowsocksr | 21ab52c62bd87b3b9e87fb2d26123b0489504779 | 20ba04c4ce2de34d67165c6ffaf18ce7d3122ec9 | test.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -111,7 +111,7 @@ try:
if local_ready and server_ready and p3 is None:
time.sleep(1)
p3 = Popen(['curl', 'http://www.example.com/', '-v', '-L',
- '--socks5-hostname', '127.0.0.1:1080'], shell=False,
+ '--socks5-hostname', '127.0.0.1:1081'], shell=False,
bufsize=0, close_fds=True)
break
| p3 = Popen ( [ 'curl' , 'http://www.example.com/' , '-v' , '-L' , '--socks5-hostname' , '127.0.0.1:1080' ] , shell = False , bufsize = 0 , close_fds = True ) | p3 = Popen ( [ 'curl' , 'http://www.example.com/' , '-v' , '-L' , '--socks5-hostname' , '127.0.0.1:1081' ] , shell = False , bufsize = 0 , close_fds = True ) | CHANGE_STRING_LITERAL | [["Update", ["string:'127.0.0.1:1080'", 3, 46, 3, 62], "'127.0.0.1:1081'"]] | myheartsgoon/shadowsocksr@21ab52c62bd87b3b9e87fb2d26123b0489504779 | fix tests | [
{
"sha": "4da0a79274e64de1ee44c327a9b96fc2281e6ac2",
"filename": "test.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/21ab52c62bd87b3b9e87fb2d26123b0489504779/test.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/21ab52c62bd87b3b9e87fb2d26123b0489504779/test.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/test.py?ref=21ab52c62bd87b3b9e87fb2d26123b0489504779",
"patch": "@@ -111,7 +111,7 @@ def get_table(key):\n if local_ready and server_ready and p3 is None:\n time.sleep(1)\n p3 = Popen(['curl', 'http://www.example.com/', '-v', '-L',\n- '--socks5-hostname', '127.0.0.1:1080'], shell=False,\n+ '--socks5-hostname', '127.0.0.1:1081'], shell=False,\n bufsize=0, close_fds=True)\n break\n "
}
] |
shadowsocksr | 77f74a06688de5ce0d19412de68f99bcf94193db | 21ab52c62bd87b3b9e87fb2d26123b0489504779 | shadowsocks/utils.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -30,7 +30,7 @@ import logging
def check_python():
info = sys.version_info
- if not (info.major == 2 and info.minor >= 6):
+ if not (info[0] == 2 and info[1] >= 6):
print 'Python 2.6 or 2.7 required'
sys.exit(1)
| if not ( info . major == 2 and info . minor >= 6 ) : print 'Python 2.6 or 2.7 required' sys . exit ( 1 ) | if not ( info [ 0 ] == 2 and info [ 1 ] >= 6 ) : print 'Python 2.6 or 2.7 required' sys . exit ( 1 ) | SINGLE_STMT | [["Insert", ["comparison_operator", 3, 13, 3, 28], ["subscript", "N0"], 0], ["Insert", ["comparison_operator", 3, 33, 3, 48], ["subscript", "N1"], 0], ["Move", "N0", ["identifier:info", 3, 13, 3, 17], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["integer:0", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Move", "N1", ["identifier:info", 3, 33, 3, 37], 0], ["Insert", "N1", ["[:[", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2], ["Insert", "N1", ["]:]", "T"], 3], ["Delete", [".:.", 3, 17, 3, 18]], ["Delete", ["identifier:major", 3, 18, 3, 23]], ["Delete", ["attribute", 3, 13, 3, 23]], ["Delete", [".:.", 3, 37, 3, 38]], ["Delete", ["identifier:minor", 3, 38, 3, 43]], ["Delete", ["attribute", 3, 33, 3, 43]]] | myheartsgoon/shadowsocksr@77f74a06688de5ce0d19412de68f99bcf94193db | fix python version check | [
{
"sha": "c087ee358f79c0df7b832d1ece851e8c7334b6b5",
"filename": "shadowsocks/utils.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/77f74a06688de5ce0d19412de68f99bcf94193db/shadowsocks%2Futils.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/77f74a06688de5ce0d19412de68f99bcf94193db/shadowsocks%2Futils.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Futils.py?ref=77f74a06688de5ce0d19412de68f99bcf94193db",
"patch": "@@ -30,7 +30,7 @@\n \n def check_python():\n info = sys.version_info\n- if not (info.major == 2 and info.minor >= 6):\n+ if not (info[0] == 2 and info[1] >= 6):\n print 'Python 2.6 or 2.7 required'\n sys.exit(1)\n "
}
] |
shadowsocksr | f9fef0e2295ca3783217fe0c15ada8b0b2ee9bef | 1dd722acc7aab30e9ea7c48d6a502e6826dfd472 | shadowsocks/asyncdns.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -233,7 +233,7 @@ def is_ip(address):
try:
socket.inet_pton(family, address)
return True
- except (TypeError, OSError, IOError):
+ except (TypeError, ValueError, OSError, IOError):
pass
return False
| try : socket . inet_pton ( family , address ) return True except ( TypeError , OSError , IOError ) : pass | try : socket . inet_pton ( family , address ) return True except ( TypeError , ValueError , OSError , IOError ) : pass | ADD_ELEMENTS_TO_ITERABLE | [["Move", ["identifier:OSError", 3, 28, 3, 35], ["tuple", 3, 16, 3, 45], 4], ["Insert", ["tuple", 3, 16, 3, 45], ["identifier:ValueError", "T"], 3], ["Insert", ["tuple", 3, 16, 3, 45], [",:,", "T"], 5]] | myheartsgoon/shadowsocksr@f9fef0e2295ca3783217fe0c15ada8b0b2ee9bef | add TypeError | [
{
"sha": "f188faa801ecbae04f71975154c332ff49c7ab29",
"filename": "shadowsocks/asyncdns.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/f9fef0e2295ca3783217fe0c15ada8b0b2ee9bef/shadowsocks%2Fasyncdns.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/f9fef0e2295ca3783217fe0c15ada8b0b2ee9bef/shadowsocks%2Fasyncdns.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fasyncdns.py?ref=f9fef0e2295ca3783217fe0c15ada8b0b2ee9bef",
"patch": "@@ -233,7 +233,7 @@ def is_ip(address):\n try:\n socket.inet_pton(family, address)\n return True\n- except (TypeError, OSError, IOError):\n+ except (TypeError, ValueError, OSError, IOError):\n pass\n return False\n "
}
] |
shadowsocksr | c1cf02cbea8ade829eb30eaa83e5b282bd31b32a | 68b9a063c5f73c4fd5efa5867ba767d4fdf4b0cf | tests/test.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -8,7 +8,7 @@ import select
import time
from subprocess import Popen, PIPE
-sys.path.insert(0, '../')
+sys.path.insert(0, './')
if 'salsa20' in sys.argv[-1]:
from shadowsocks import encrypt_salsa20
| sys . path . insert ( 0 , '../' ) | sys . path . insert ( 0 , './' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'../'", 3, 20, 3, 25], "'./'"]] | myheartsgoon/shadowsocksr@c1cf02cbea8ade829eb30eaa83e5b282bd31b32a | fix tests | [
{
"sha": "33530cd50aef95e421d25ddc675e1ac781f9f36c",
"filename": "tests/test.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/c1cf02cbea8ade829eb30eaa83e5b282bd31b32a/tests%2Ftest.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/c1cf02cbea8ade829eb30eaa83e5b282bd31b32a/tests%2Ftest.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/tests%2Ftest.py?ref=c1cf02cbea8ade829eb30eaa83e5b282bd31b32a",
"patch": "@@ -8,7 +8,7 @@\n import time\n from subprocess import Popen, PIPE\n \n-sys.path.insert(0, '../')\n+sys.path.insert(0, './')\n \n if 'salsa20' in sys.argv[-1]:\n from shadowsocks import encrypt_salsa20"
}
] |
shadowsocksr | c9b489b5e316bfb226582c990b262469c5645fb8 | 1e1b1adba98c66da48acaa663fe59a03a44db686 | shadowsocks/encrypt.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -224,7 +224,7 @@ def encrypt_all(password, method, op, data):
if method == 'salsa20-ctr':
cipher = encrypt_salsa20.Salsa20Cipher(method, key, iv, op)
elif method == 'rc4-sha256':
- return encrypt_rc4_sha256.create_cipher(method, key, iv, op)
+ cipher = encrypt_rc4_sha256.create_cipher(method, key, iv, op)
else:
cipher = M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv,
op, key_as_bytes=0, d='md5',
| return encrypt_rc4_sha256 . create_cipher ( method , key , iv , op ) | cipher = encrypt_rc4_sha256 . create_cipher ( method , key , iv , op ) | SINGLE_STMT | [["Insert", ["block", 3, 13, 3, 73], ["expression_statement", "N0"], 0], ["Insert", "N0", ["assignment", "N1"], 0], ["Insert", "N1", ["identifier:cipher", "T"], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Move", "N1", ["call", 3, 20, 3, 73], 2], ["Delete", ["return:return", 3, 13, 3, 19]], ["Delete", ["return_statement", 3, 13, 3, 73]]] | myheartsgoon/shadowsocksr@c9b489b5e316bfb226582c990b262469c5645fb8 | fix UDP | [
{
"sha": "3537d0053b8433c75f49814310775fa41040026f",
"filename": "shadowsocks/encrypt.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/c9b489b5e316bfb226582c990b262469c5645fb8/shadowsocks%2Fencrypt.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/c9b489b5e316bfb226582c990b262469c5645fb8/shadowsocks%2Fencrypt.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fencrypt.py?ref=c9b489b5e316bfb226582c990b262469c5645fb8",
"patch": "@@ -224,7 +224,7 @@ def encrypt_all(password, method, op, data):\n if method == 'salsa20-ctr':\n cipher = encrypt_salsa20.Salsa20Cipher(method, key, iv, op)\n elif method == 'rc4-sha256':\n- return encrypt_rc4_sha256.create_cipher(method, key, iv, op)\n+ cipher = encrypt_rc4_sha256.create_cipher(method, key, iv, op)\n else:\n cipher = M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv,\n op, key_as_bytes=0, d='md5',"
}
] |
shadowsocksr | f6951c963303e3ecfbb4194dafe94ad9400e2284 | d6a5c567aebff58600d452469c9dcc8a681ab6fc | shadowsocks/crypto/m2.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -36,7 +36,7 @@ def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None, i=1,
padding=1):
import M2Crypto.EVP
- return M2Crypto.EVP.Cipher('rc4', key, iv, op, key_as_bytes=0,
+ return M2Crypto.EVP.Cipher(alg.replace('-', '_'), key, iv, op, key_as_bytes=0,
d='md5', salt=None, i=1, padding=1)
| return M2Crypto . EVP . Cipher ( 'rc4' , key , iv , op , key_as_bytes = 0 , d = 'md5' , salt = None , i = 1 , padding = 1 ) | return M2Crypto . EVP . Cipher ( alg . replace ( '-' , '_' ) , key , iv , op , key_as_bytes = 0 , d = 'md5' , salt = None , i = 1 , padding = 1 ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 31, 4, 67], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 31, 4, 67], [",:,", "T"], 2], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Insert", "N1", ["identifier:alg", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:replace", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["string:'-'", "T"], 1], ["Move", "N2", [",:,", 3, 37, 3, 38], 2], ["Insert", "N2", ["string:'_'", "T"], 3], ["Insert", "N2", ["):)", "T"], 4], ["Delete", ["string:'rc4'", 3, 32, 3, 37]]] | myheartsgoon/shadowsocksr@f6951c963303e3ecfbb4194dafe94ad9400e2284 | fix m2 | [
{
"sha": "d69a468f2dfb1ac558778630694fef0a7f9de289",
"filename": "shadowsocks/crypto/m2.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/f6951c963303e3ecfbb4194dafe94ad9400e2284/shadowsocks%2Fcrypto%2Fm2.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/f6951c963303e3ecfbb4194dafe94ad9400e2284/shadowsocks%2Fcrypto%2Fm2.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Fm2.py?ref=f6951c963303e3ecfbb4194dafe94ad9400e2284",
"patch": "@@ -36,7 +36,7 @@ def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None, i=1,\n padding=1):\n \n import M2Crypto.EVP\n- return M2Crypto.EVP.Cipher('rc4', key, iv, op, key_as_bytes=0,\n+ return M2Crypto.EVP.Cipher(alg.replace('-', '_'), key, iv, op, key_as_bytes=0,\n d='md5', salt=None, i=1, padding=1)\n \n "
}
] |
shadowsocksr | c668ddbc1b37338c73ece403dcf56fb02ed2aa88 | f677c8152d6d399651f9f499ac7a8d487073309c | shadowsocks/utils.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -186,7 +186,7 @@ def get_config(is_local):
if 'local_port' in config:
config['local_port'] = int(config['local_port'])
- if 'server_port' in config:
+ if 'server_port' in config and type(config['server_port']) != list:
config['server_port'] = int(config['server_port'])
logging.getLogger('').handlers = []
| if 'server_port' in config : config [ 'server_port' ] = int ( config [ 'server_port' ] ) | if 'server_port' in config and type ( config [ 'server_port' ] ) != list : config [ 'server_port' ] = int ( config [ 'server_port' ] ) | MORE_SPECIFIC_IF | [["Insert", ["if_statement", 3, 5, 4, 59], ["boolean_operator", "N0"], 1], ["Move", "N0", ["comparison_operator", 3, 8, 3, 31], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["call", "N2"], 0], ["Insert", "N1", ["!=:!=", "T"], 1], ["Insert", "N1", ["identifier:list", "T"], 2], ["Insert", "N2", ["identifier:type", "T"], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["subscript", "N4"], 1], ["Insert", "N3", ["):)", "T"], 2], ["Insert", "N4", ["identifier:config", "T"], 0], ["Insert", "N4", ["[:[", "T"], 1], ["Insert", "N4", ["string:'server_port'", "T"], 2], ["Insert", "N4", ["]:]", "T"], 3]] | myheartsgoon/shadowsocksr@c668ddbc1b37338c73ece403dcf56fb02ed2aa88 | fix multiple ports | [
{
"sha": "fee4afca64154a48c15c7e86054889da7bb71b31",
"filename": "shadowsocks/utils.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/c668ddbc1b37338c73ece403dcf56fb02ed2aa88/shadowsocks%2Futils.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/c668ddbc1b37338c73ece403dcf56fb02ed2aa88/shadowsocks%2Futils.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Futils.py?ref=c668ddbc1b37338c73ece403dcf56fb02ed2aa88",
"patch": "@@ -186,7 +186,7 @@ def get_config(is_local):\n if 'local_port' in config:\n config['local_port'] = int(config['local_port'])\n \n- if 'server_port' in config:\n+ if 'server_port' in config and type(config['server_port']) != list:\n config['server_port'] = int(config['server_port'])\n \n logging.getLogger('').handlers = []"
}
] |
shadowsocksr | be045f1687a36fcb16fcf682164df5edd970bfda | 497524b3136498b41800024d0e1c65afe0bda0bd | shadowsocks/crypto/rc4_md5.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -47,7 +47,7 @@ def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None,
d='md5', salt=None, i=1, padding=1)
except:
m2_not_found = True
- import ctypes_openssl
+ from shadowsocks.crypto import ctypes_openssl
return ctypes_openssl.CtypesCrypto('rc4', rc4_key, '', op)
| import ctypes_openssl | from shadowsocks . crypto import ctypes_openssl | SINGLE_STMT | [["Insert", ["module", 0, 40, 7, 0], ["import_from_statement", "N0"], 3], ["Insert", "N0", ["from:from", "T"], 0], ["Insert", "N0", ["dotted_name", "N1"], 1], ["Move", "N0", ["import:import", 3, 5, 3, 11], 2], ["Move", "N0", ["dotted_name", 3, 12, 3, 26], 3], ["Insert", "N1", ["identifier:shadowsocks", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:crypto", "T"], 2], ["Delete", ["import_statement", 3, 5, 3, 26]]] | myheartsgoon/shadowsocksr@be045f1687a36fcb16fcf682164df5edd970bfda | fix import | [
{
"sha": "daa6ba54a1800743177475838dd9bde9a3366151",
"filename": "shadowsocks/crypto/rc4_md5.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/be045f1687a36fcb16fcf682164df5edd970bfda/shadowsocks%2Fcrypto%2Frc4_md5.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/be045f1687a36fcb16fcf682164df5edd970bfda/shadowsocks%2Fcrypto%2Frc4_md5.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Frc4_md5.py?ref=be045f1687a36fcb16fcf682164df5edd970bfda",
"patch": "@@ -47,7 +47,7 @@ def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None,\n d='md5', salt=None, i=1, padding=1)\n except:\n m2_not_found = True\n- import ctypes_openssl\n+ from shadowsocks.crypto import ctypes_openssl\n return ctypes_openssl.CtypesCrypto('rc4', rc4_key, '', op)\n \n "
}
] |
shadowsocksr | 833c98e1149d883d0ebb5657e924c71ef58cbd63 | 4e083440353833763ab1153d501788b4e40e6402 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -261,7 +261,7 @@ class TCPRelayHandler(object):
if header_result is None:
raise Exception('can not parse header')
addrtype, remote_addr, remote_port, header_length = header_result
- logging.info('connecting %s:%d' % (remote_addr, remote_port))
+ logging.info('connecting %s:%d' % (remote_addr.decode('utf-8'), remote_port))
self._remote_address = (remote_addr, remote_port)
# pause reading
self._update_stream(STREAM_UP, WAIT_STATUS_WRITING)
| logging . info ( 'connecting %s:%d' % ( remote_addr , remote_port ) ) | logging . info ( 'connecting %s:%d' % ( remote_addr . decode ( 'utf-8' ) , remote_port ) ) | ADD_METHOD_CALL | [["Insert", ["tuple", 3, 47, 3, 73], ["call", "N0"], 1], ["Insert", ["tuple", 3, 47, 3, 73], ["):)", "T"], 5], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:remote_addr", 3, 48, 3, 59], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:decode", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["string:'utf-8'", "T"], 1], ["Move", "N2", ["):)", 3, 72, 3, 73], 2]] | myheartsgoon/shadowsocksr@833c98e1149d883d0ebb5657e924c71ef58cbd63 | tcprelay.py: decode remote_addr to fix extra b'' in logging on python 3 | [
{
"sha": "f772c93b79fc2618a88bbdc9d9718526363c9877",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/833c98e1149d883d0ebb5657e924c71ef58cbd63/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/833c98e1149d883d0ebb5657e924c71ef58cbd63/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=833c98e1149d883d0ebb5657e924c71ef58cbd63",
"patch": "@@ -261,7 +261,7 @@ def _handle_stage_hello(self, data):\n if header_result is None:\n raise Exception('can not parse header')\n addrtype, remote_addr, remote_port, header_length = header_result\n- logging.info('connecting %s:%d' % (remote_addr, remote_port))\n+ logging.info('connecting %s:%d' % (remote_addr.decode('utf-8'), remote_port))\n self._remote_address = (remote_addr, remote_port)\n # pause reading\n self._update_stream(STREAM_UP, WAIT_STATUS_WRITING)"
}
] |
shadowsocksr | fb27cf52a9a7b72ef8d3e3693623de43a477ebaf | 22b87f6f16ed2f28d96403ff884e6c0d8b1debf3 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -207,7 +207,7 @@ class TCPRelayHandler(object):
self._create_remote_socket(self._chosen_server[0],
self._chosen_server[1])
self._loop.add(remote_sock, eventloop.POLL_ERR)
- data = ''.join(self._data_to_write_to_local)
+ data = b''.join(self._data_to_write_to_local)
l = len(data)
s = remote_sock.sendto(data, MSG_FASTOPEN, self._chosen_server)
if s < l:
| data = '' . join ( self . _data_to_write_to_local ) | data = b'' . join ( self . _data_to_write_to_local ) | CHANGE_STRING_LITERAL | [["Update", ["string:''", 3, 24, 3, 26], "b''"]] | myheartsgoon/shadowsocksr@fb27cf52a9a7b72ef8d3e3693623de43a477ebaf | Fix str/byte related TypeError in Python 3.4
Traceback (most recent call last):
File "/usr/bin/sslocal", line 9, in <module>
load_entry_point('shadowsocks==2.4', 'console_scripts', 'sslocal')()
File "/usr/lib/python3.4/site-packages/shadowsocks/local.py", line 68, in main
loop.run()
File "/usr/lib/python3.4/site-packages/shadowsocks/eventloop.py", line 230, in run
handler(events)
File "/usr/lib/python3.4/site-packages/shadowsocks/tcprelay.py", line 630, in _handle_events
handler.handle_event(sock, event)
File "/usr/lib/python3.4/site-packages/shadowsocks/tcprelay.py", line 458, in handle_event
self._on_local_read()
File "/usr/lib/python3.4/site-packages/shadowsocks/tcprelay.py", line 377, in _on_local_read
self._handle_stage_reply(data)
File "/usr/lib/python3.4/site-packages/shadowsocks/tcprelay.py", line 212, in _handle_stage_reply
s = remote_sock.sendto(data, MSG_FASTOPEN, self._chosen_server)
TypeError: 'str' does not support the buffer interface | [
{
"sha": "6ccadbe9a729a1901ebbe87b80426a134e6679f8",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/fb27cf52a9a7b72ef8d3e3693623de43a477ebaf/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/fb27cf52a9a7b72ef8d3e3693623de43a477ebaf/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=fb27cf52a9a7b72ef8d3e3693623de43a477ebaf",
"patch": "@@ -207,7 +207,7 @@ def _handle_stage_reply(self, data):\n self._create_remote_socket(self._chosen_server[0],\n self._chosen_server[1])\n self._loop.add(remote_sock, eventloop.POLL_ERR)\n- data = ''.join(self._data_to_write_to_local)\n+ data = b''.join(self._data_to_write_to_local)\n l = len(data)\n s = remote_sock.sendto(data, MSG_FASTOPEN, self._chosen_server)\n if s < l:"
}
] |
shadowsocksr | 5209860db106b8956a67fb029b2e37ad85c663c6 | f9ba6f7390bc7819e31983762fa43e9c86a8c720 | shadowsocks/crypto/table.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -170,7 +170,7 @@ def test_encryption():
from shadowsocks.crypto import util
cipher = TableCipher(b'table', b'test', b'', 1)
- decipher = TableCipher(b'rc4-md5', b'test', b'', 0)
+ decipher = TableCipher(b'table', b'test', b'', 0)
util.run_cipher(cipher, decipher)
| decipher = TableCipher ( b'rc4-md5' , b'test' , b'' , 0 ) | decipher = TableCipher ( b'table' , b'test' , b'' , 0 ) | CHANGE_STRING_LITERAL | [["Update", ["string:b'rc4-md5'", 3, 28, 3, 38], "b'table'"]] | myheartsgoon/shadowsocksr@5209860db106b8956a67fb029b2e37ad85c663c6 | fix cipher name in test | [
{
"sha": "08c1205d75038cb97cf2ae54186f9f262b995c97",
"filename": "shadowsocks/crypto/table.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/5209860db106b8956a67fb029b2e37ad85c663c6/shadowsocks%2Fcrypto%2Ftable.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/5209860db106b8956a67fb029b2e37ad85c663c6/shadowsocks%2Fcrypto%2Ftable.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Ftable.py?ref=5209860db106b8956a67fb029b2e37ad85c663c6",
"patch": "@@ -170,7 +170,7 @@ def test_encryption():\n from shadowsocks.crypto import util\n \n cipher = TableCipher(b'table', b'test', b'', 1)\n- decipher = TableCipher(b'rc4-md5', b'test', b'', 0)\n+ decipher = TableCipher(b'table', b'test', b'', 0)\n \n util.run_cipher(cipher, decipher)\n "
}
] |
shadowsocksr | f43906006a08712316a07392405fa70929e8e32d | ea535c74b21144c769dd41e6ccba36498801db85 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -407,7 +407,7 @@ class TCPRelayHandler(object):
def _on_local_write(self):
if self._data_to_write_to_local:
- data = ''.join(self._data_to_write_to_local)
+ data = b''.join(self._data_to_write_to_local)
self._data_to_write_to_local = []
self._write_to_sock(data, self._local_sock)
else:
| data = '' . join ( self . _data_to_write_to_local ) | data = b'' . join ( self . _data_to_write_to_local ) | CHANGE_STRING_LITERAL | [["Update", ["string:''", 3, 20, 3, 22], "b''"]] | myheartsgoon/shadowsocksr@f43906006a08712316a07392405fa70929e8e32d | fix str/byte issue in python 3 | [
{
"sha": "e25c63f39c91ad3b6ea4be12a69b4fd5264c89a1",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/f43906006a08712316a07392405fa70929e8e32d/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/f43906006a08712316a07392405fa70929e8e32d/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=f43906006a08712316a07392405fa70929e8e32d",
"patch": "@@ -407,7 +407,7 @@ def _on_remote_read(self):\n \n def _on_local_write(self):\n if self._data_to_write_to_local:\n- data = ''.join(self._data_to_write_to_local)\n+ data = b''.join(self._data_to_write_to_local)\n self._data_to_write_to_local = []\n self._write_to_sock(data, self._local_sock)\n else:"
}
] |
shadowsocksr | d91f7d85d4adcc91cf61a2211bd59588c7421f09 | 5a5158b33f24d012496060a6b6b9a061bc982ee4 | shadowsocks/crypto/ctypes_libsodium.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -42,7 +42,7 @@ def load_libsodium():
global loaded, libsodium, buf
from ctypes.util import find_library
- for p in ('sodium',):
+ for p in ('sodium', 'libsodium'):
libsodium_path = find_library(p)
if libsodium_path:
break
| for p in ( 'sodium' , ) : libsodium_path = find_library ( p ) if libsodium_path : break | for p in ( 'sodium' , 'libsodium' ) : libsodium_path = find_library ( p ) if libsodium_path : break | ADD_ELEMENTS_TO_ITERABLE | [["Insert", ["tuple", 3, 14, 3, 25], ["string:'libsodium'", "T"], 3]] | myheartsgoon/shadowsocksr@d91f7d85d4adcc91cf61a2211bd59588c7421f09 | Update ctypes_libsodium.py | [
{
"sha": "69b9de929b70890843ca025499353ef87bd54274",
"filename": "shadowsocks/crypto/ctypes_libsodium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/d91f7d85d4adcc91cf61a2211bd59588c7421f09/shadowsocks%2Fcrypto%2Fctypes_libsodium.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/d91f7d85d4adcc91cf61a2211bd59588c7421f09/shadowsocks%2Fcrypto%2Fctypes_libsodium.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcrypto%2Fctypes_libsodium.py?ref=d91f7d85d4adcc91cf61a2211bd59588c7421f09",
"patch": "@@ -42,7 +42,7 @@ def load_libsodium():\n global loaded, libsodium, buf\n \n from ctypes.util import find_library\n- for p in ('sodium',):\n+ for p in ('sodium', 'libsodium'):\n libsodium_path = find_library(p)\n if libsodium_path:\n break"
}
] |
shadowsocksr | 5a5c8b9c7e6a3bdeec3be69554df654c05ffeca5 | 70559a1030fe88211a119057587580153792fd78 | tests/coverage_server.py | https://github.com/myheartsgoon/shadowsocksr | true | false | false | @@ -18,7 +18,7 @@ if __name__ == '__main__':
raise tornado.web.HTTPError(404)
application = tornado.web.Application([
- (r"/([a-zA-Z0-9\\-_]+)", MainHandler),
+ (r"/([a-zA-Z0-9\-_]+)", MainHandler),
])
if __name__ == "__main__":
| application = tornado . web . Application ( [ ( r"/([a-zA-Z0-9\\-_]+)" , MainHandler ) , ] ) | application = tornado . web . Application ( [ ( r"/([a-zA-Z0-9\-_]+)" , MainHandler ) , ] ) | CHANGE_STRING_LITERAL | [["Update", ["string:r\"/([a-zA-Z0-9\\\\-_]+)\"", 3, 10, 3, 32], "r\"/([a-zA-Z0-9\\-_]+)\""]] | myheartsgoon/shadowsocksr@5a5c8b9c7e6a3bdeec3be69554df654c05ffeca5 | fix coverage server | [
{
"sha": "ca3830b13638932ef5cbb243665b292a65964eff",
"filename": "tests/coverage_server.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/5a5c8b9c7e6a3bdeec3be69554df654c05ffeca5/tests%2Fcoverage_server.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/5a5c8b9c7e6a3bdeec3be69554df654c05ffeca5/tests%2Fcoverage_server.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/tests%2Fcoverage_server.py?ref=5a5c8b9c7e6a3bdeec3be69554df654c05ffeca5",
"patch": "@@ -18,7 +18,7 @@ def get(self, project):\n raise tornado.web.HTTPError(404)\n \n application = tornado.web.Application([\n- (r\"/([a-zA-Z0-9\\\\-_]+)\", MainHandler),\n+ (r\"/([a-zA-Z0-9\\-_]+)\", MainHandler),\n ])\n \n if __name__ == \"__main__\":"
}
] |
shadowsocksr | 8b2deb01d8967cd9afb70600cd0488c5fa34afee | b6efc0efd900d4a27d3805a0b5fd38aa1105474a | shadowsocks/utils.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -172,7 +172,7 @@ def get_config(is_local):
sys.exit(2)
config['password'] = config.get('password', '')
- config['method'] = config.get('method', 'aes-256-cfb')
+ config['method'] = config.get('method', b'aes-256-cfb')
config['port_password'] = config.get('port_password', None)
config['timeout'] = int(config.get('timeout', 300))
config['fast_open'] = config.get('fast_open', False)
| config [ 'method' ] = config . get ( 'method' , 'aes-256-cfb' ) | config [ 'method' ] = config . get ( 'method' , b'aes-256-cfb' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'aes-256-cfb'", 3, 45, 3, 58], "b'aes-256-cfb'"]] | myheartsgoon/shadowsocksr@8b2deb01d8967cd9afb70600cd0488c5fa34afee | Set default method as bytes.
Default method as string may cause false error report. | [
{
"sha": "0247d0ff94b0bed548c21ecff072a28e293f7330",
"filename": "shadowsocks/utils.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/8b2deb01d8967cd9afb70600cd0488c5fa34afee/shadowsocks%2Futils.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/8b2deb01d8967cd9afb70600cd0488c5fa34afee/shadowsocks%2Futils.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Futils.py?ref=8b2deb01d8967cd9afb70600cd0488c5fa34afee",
"patch": "@@ -172,7 +172,7 @@ def get_config(is_local):\n sys.exit(2)\n \n config['password'] = config.get('password', '')\n- config['method'] = config.get('method', 'aes-256-cfb')\n+ config['method'] = config.get('method', b'aes-256-cfb')\n config['port_password'] = config.get('port_password', None)\n config['timeout'] = int(config.get('timeout', 300))\n config['fast_open'] = config.get('fast_open', False)"
}
] |
shadowsocksr | a0aa9173a8001b5c20e270d7b5dcec28172cfa3f | 79b9b53dbea59627d43ec7ee4eb2dd54777460be | shadowsocks/common.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -192,7 +192,7 @@ class IPNetwork(object):
self._network_list_v6 = []
if type(addrs) == str:
addrs = addrs.split(',')
- map(self.add_network, addrs)
+ list(map(self.add_network, addrs))
def add_network(self, addr):
if addr is "":
| map ( self . add_network , addrs ) | list ( map ( self . add_network , addrs ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 9, 3, 37], ["identifier:list", "T"], 0], ["Insert", ["call", 3, 9, 3, 37], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 3, 9, 3, 37], 1], ["Insert", "N0", ["):)", "T"], 2]] | myheartsgoon/shadowsocksr@a0aa9173a8001b5c20e270d7b5dcec28172cfa3f | Fix for Python3 map changed behavior
In Python3, map returns an iterator instead of list in Python2,
which cause map "lazier" than before, wrap with list() force it running. | [
{
"sha": "0c4e2785701e157ab506463e3e09ee61bb99091e",
"filename": "shadowsocks/common.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/a0aa9173a8001b5c20e270d7b5dcec28172cfa3f/shadowsocks%2Fcommon.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/a0aa9173a8001b5c20e270d7b5dcec28172cfa3f/shadowsocks%2Fcommon.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Fcommon.py?ref=a0aa9173a8001b5c20e270d7b5dcec28172cfa3f",
"patch": "@@ -192,7 +192,7 @@ def __init__(self, addrs):\n self._network_list_v6 = []\n if type(addrs) == str:\n addrs = addrs.split(',')\n- map(self.add_network, addrs)\n+ list(map(self.add_network, addrs))\n \n def add_network(self, addr):\n if addr is \"\":"
}
] |
shadowsocksr | 07dc98f60d7d09f3cfff7a21a67b268f96ce49ad | 99db626225508c205f6b8e5982224cd9e28443e7 | shadowsocks/tcprelay.py | https://github.com/myheartsgoon/shadowsocksr | true | false | true | @@ -209,7 +209,7 @@ class TCPRelayHandler(object):
if addrs:
af, socktype, proto, canonname, server_addr = addrs[0]
data = data[header_length:]
- sock.sendto(data, server_addr)
+ sock.sendto(data, (server_addr[0], dest_port))
except Exception as e:
trace = traceback.format_exc()
| sock . sendto ( data , server_addr ) | sock . sendto ( data , ( server_addr [ 0 ] , dest_port ) ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 32, 3, 51], ["tuple", "N0"], 3], ["Insert", ["argument_list", 3, 32, 3, 51], ["):)", "T"], 4], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["subscript", "N1"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Insert", "N0", ["identifier:dest_port", "T"], 3], ["Move", "N0", ["):)", 3, 50, 3, 51], 4], ["Move", "N1", ["identifier:server_addr", 3, 39, 3, 50], 0], ["Insert", "N1", ["[:[", "T"], 1], ["Insert", "N1", ["integer:0", "T"], 2], ["Insert", "N1", ["]:]", "T"], 3]] | myheartsgoon/shadowsocksr@07dc98f60d7d09f3cfff7a21a67b268f96ce49ad | udp fix sendto argv | [
{
"sha": "070e234a032a47618703a578427f321e2fe22adb",
"filename": "shadowsocks/tcprelay.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/myheartsgoon/shadowsocksr/blob/07dc98f60d7d09f3cfff7a21a67b268f96ce49ad/shadowsocks%2Ftcprelay.py",
"raw_url": "https://github.com/myheartsgoon/shadowsocksr/raw/07dc98f60d7d09f3cfff7a21a67b268f96ce49ad/shadowsocks%2Ftcprelay.py",
"contents_url": "https://api.github.com/repos/myheartsgoon/shadowsocksr/contents/shadowsocks%2Ftcprelay.py?ref=07dc98f60d7d09f3cfff7a21a67b268f96ce49ad",
"patch": "@@ -209,7 +209,7 @@ def _write_to_sock(self, data, sock):\n if addrs:\n af, socktype, proto, canonname, server_addr = addrs[0]\n data = data[header_length:]\n- sock.sendto(data, server_addr)\n+ sock.sendto(data, (server_addr[0], dest_port))\n \n except Exception as e:\n trace = traceback.format_exc()"
}
] |
bookmark-server | 4c7db13d97ecf1eb6aa606ced345d444bb765dae | 41539361757edb0c41887f38a4838fa447347633 | BookmarkServer.py | https://github.com/SDey96/bookmark-server | true | false | false | @@ -110,5 +110,5 @@ class Shortener(http.server.BaseHTTPRequestHandler):
if __name__ == '__main__':
port = int(os.environ.get('PORT', 8000)) # Use PORT if it's there.
server_address = ('', port)
- httpd = HTTPServer(server_address, Shortener)
+ httpd = http.server.HTTPServer(server_address, Shortener)
httpd.serve_forever()
| httpd = HTTPServer ( server_address , Shortener ) | httpd = http . server . HTTPServer ( server_address , Shortener ) | SINGLE_STMT | [["Insert", ["call", 3, 13, 3, 50], ["attribute", "N0"], 0], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:HTTPServer", 3, 13, 3, 23], 2], ["Insert", "N1", ["identifier:http", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:server", "T"], 2]] | SDey96/bookmark-server@4c7db13d97ecf1eb6aa606ced345d444bb765dae | null | null |
vHackOSBot-Python | bda9612510b49d4d82f4b1f4c7e37db849713a5c | c4a557907f13276328a8c4c8a71ef27cd3143e2f | network.py | https://github.com/vHackUser/vHackOSBot-Python | true | false | true | @@ -55,7 +55,7 @@ class Network():
self.targetHack = self.ut.requestString("exploit.php", lang="fr", target=str(targetNetwork["ip"]), accesstoken=self.Configuration["accessToken"])
if self.targetHack["result"] == "0":
self.targetHack = self.ut.requestString("remote.php", lang="fr", target=str(targetNetwork["ip"]), accesstoken=self.Configuration["accessToken"])
- self.getBanking(self, targetNetwork)
+ self.getBanking(targetNetwork)
elif self.targetHack["result"] == "2":
self.ut.viewsPrint("showMsgErrorSdk=0", "[{}] - don't possible to hack sdk exploit = 0 wait.".format(os.path.basename(os.path.basename(__file__))))
time.sleep(0.8)
| self . getBanking ( self , targetNetwork ) | self . getBanking ( targetNetwork ) | SAME_FUNCTION_LESS_ARGS | [["Delete", ["identifier:self", 3, 37, 3, 41]], ["Delete", [",:,", 3, 41, 3, 42]]] | vHackUser/vHackOSBot-Python@bda9612510b49d4d82f4b1f4c7e37db849713a5c | fix minor error in self.getBanking | [
{
"sha": "64b868101b1360d1ba232a8b6298b341df7672fb",
"filename": "network.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/vHackUser/vHackOSBot-Python/blob/bda9612510b49d4d82f4b1f4c7e37db849713a5c/network.py",
"raw_url": "https://github.com/vHackUser/vHackOSBot-Python/raw/bda9612510b49d4d82f4b1f4c7e37db849713a5c/network.py",
"contents_url": "https://api.github.com/repos/vHackUser/vHackOSBot-Python/contents/network.py?ref=bda9612510b49d4d82f4b1f4c7e37db849713a5c",
"patch": "@@ -55,7 +55,7 @@ def attackTarget(self):\n self.targetHack = self.ut.requestString(\"exploit.php\", lang=\"fr\", target=str(targetNetwork[\"ip\"]), accesstoken=self.Configuration[\"accessToken\"])\n if self.targetHack[\"result\"] == \"0\":\n self.targetHack = self.ut.requestString(\"remote.php\", lang=\"fr\", target=str(targetNetwork[\"ip\"]), accesstoken=self.Configuration[\"accessToken\"])\n- self.getBanking(self, targetNetwork)\n+ self.getBanking(targetNetwork)\n elif self.targetHack[\"result\"] == \"2\":\n self.ut.viewsPrint(\"showMsgErrorSdk=0\", \"[{}] - don't possible to hack sdk exploit = 0 wait.\".format(os.path.basename(os.path.basename(__file__))))\n time.sleep(0.8)"
}
] |
electrumx | 751bb2d970c0ada6180dcf329a86385c1fd55e00 | 5624809933bdf5467e7e755e01ad6cfdc1d9541a | server/protocol.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -43,7 +43,7 @@ class BlockServer(BlockProcessor):
self.irc = IRC(env)
async def caught_up(self, mempool_hashes):
- await super().caught_up([]) #mempool_hashes)
+ await super().caught_up(mempool_hashes)
if not self.servers:
await self.start_servers()
if self.env.irc:
| await super ( ) . caught_up ( [ ] ) | await super ( ) . caught_up ( mempool_hashes ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 32, 3, 36], ["identifier:mempool_hashes", "T"], 1], ["Delete", ["[:[", 3, 33, 3, 34]], ["Delete", ["]:]", 3, 34, 3, 35]], ["Delete", ["list", 3, 33, 3, 35]]] | Fair-Exchange/electrumx@751bb2d970c0ada6180dcf329a86385c1fd55e00 | Remove debug code | [
{
"sha": "d5f29998a2378de5f3c8c60e3f4dff67c6ebe4ca",
"filename": "server/protocol.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/751bb2d970c0ada6180dcf329a86385c1fd55e00/server%2Fprotocol.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/751bb2d970c0ada6180dcf329a86385c1fd55e00/server%2Fprotocol.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fprotocol.py?ref=751bb2d970c0ada6180dcf329a86385c1fd55e00",
"patch": "@@ -43,7 +43,7 @@ def __init__(self, env):\n self.irc = IRC(env)\n \n async def caught_up(self, mempool_hashes):\n- await super().caught_up([]) #mempool_hashes)\n+ await super().caught_up(mempool_hashes)\n if not self.servers:\n await self.start_servers()\n if self.env.irc:"
}
] |
visbrain | bd3fb27d1b45de51367ebaedbc286aca446eb597 | 1dca8c9635fa92b339e336ada7e49f1d5efa1a5c | examples/5_RealDataExample.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -9,5 +9,5 @@ data = np.load('RealDataExample.npz')
s_data = data['beta']
s_xyz = data['xyz']
-vb = vbrain(s_xyz=s_xyz, s_data=s_data)
+vb = vbrain(s_xyz=s_xyz, s_data=s_data, cmap_vmin=-1, cmap_vmax=1, cmap='jet')
vb.show()
\ No newline at end of file
| vb = vbrain ( s_xyz = s_xyz , s_data = s_data ) | vb = vbrain ( s_xyz = s_xyz , s_data = s_data , cmap_vmin = - 1 , cmap_vmax = 1 , cmap = 'jet' ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 12, 3, 40], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 12, 3, 40], ["keyword_argument", "N0"], 5], ["Insert", ["argument_list", 3, 12, 3, 40], [",:,", "T"], 6], ["Insert", ["argument_list", 3, 12, 3, 40], ["keyword_argument", "N1"], 7], ["Insert", ["argument_list", 3, 12, 3, 40], [",:,", "T"], 8], ["Insert", ["argument_list", 3, 12, 3, 40], ["keyword_argument", "N2"], 9], ["Insert", "N0", ["identifier:cmap_vmin", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["unary_operator", "N3"], 2], ["Insert", "N1", ["identifier:cmap_vmax", "T"], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2], ["Insert", "N2", ["identifier:cmap", "T"], 0], ["Insert", "N2", ["=:=", "T"], 1], ["Insert", "N2", ["string:'jet'", "T"], 2], ["Insert", "N3", ["-:-", "T"], 0], ["Insert", "N3", ["integer:1", "T"], 1]] | kdeleeuw11/visbrain@bd3fb27d1b45de51367ebaedbc286aca446eb597 | Fix colorbar for the example | [
{
"sha": "474e6d90e84dd77ca851cef48c3501bc3fea9535",
"filename": "examples/5_RealDataExample.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/bd3fb27d1b45de51367ebaedbc286aca446eb597/examples%2F5_RealDataExample.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/bd3fb27d1b45de51367ebaedbc286aca446eb597/examples%2F5_RealDataExample.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/examples%2F5_RealDataExample.py?ref=bd3fb27d1b45de51367ebaedbc286aca446eb597",
"patch": "@@ -9,5 +9,5 @@\n s_data = data['beta']\n s_xyz = data['xyz']\n \n-vb = vbrain(s_xyz=s_xyz, s_data=s_data)\n+vb = vbrain(s_xyz=s_xyz, s_data=s_data, cmap_vmin=-1, cmap_vmax=1, cmap='jet')\n vb.show()\n\\ No newline at end of file"
}
] |
visbrain | f3520ac9cb0184bfd8118b9c555eef5ae9514854 | 75b39a91724aeca7512799916ad3539898c832fa | vbrain/elements/AtlasBase.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -16,7 +16,7 @@ class AtlasBase(object):
"""
"""
- def __init__(self, a_color=(1.0,1.0,1.0), a_opacity=0.1, a_projection='internal', a_template='B1',
+ def __init__(self, a_color=(1.0,1.0,1.0), a_opacity=1., a_projection='internal', a_template='B1',
a_vertices=None, a_faces=None, a_shading='smooth', a_transform=[], l_position=(100., 100., 100.),
l_intensity=(1., 1., 1.), l_color=(1., 1., 1., 1.), l_coefAmbient=0.05, l_coefSpecular=0.5, **kwargs):
# Get inputs :
| def __init__ ( self , a_color = ( 1.0 , 1.0 , 1.0 ) , a_opacity = 0.1 , a_projection = 'internal' , a_template = 'B1' , a_vertices = None , a_faces = None , a_shading = 'smooth' , a_transform = [ ] , l_position = ( 100. , 100. , 100. ) , l_intensity = ( 1. , 1. , 1. ) , l_color = ( 1. , 1. , 1. , 1. ) , l_coefAmbient = 0.05 , l_coefSpecular = 0.5 , ** kwargs ) : | def __init__ ( self , a_color = ( 1.0 , 1.0 , 1.0 ) , a_opacity = 1. , a_projection = 'internal' , a_template = 'B1' , a_vertices = None , a_faces = None , a_shading = 'smooth' , a_transform = [ ] , l_position = ( 100. , 100. , 100. ) , l_intensity = ( 1. , 1. , 1. ) , l_color = ( 1. , 1. , 1. , 1. ) , l_coefAmbient = 0.05 , l_coefSpecular = 0.5 , ** kwargs ) : | CHANGE_NUMERIC_LITERAL | [["Update", ["float:0.1", 3, 57, 3, 60], "1."]] | kdeleeuw11/visbrain@f3520ac9cb0184bfd8118b9c555eef5ae9514854 | Default opacity is 1 | [
{
"sha": "bd07d7370262e7c21b6139c0b302e2250784b01f",
"filename": "vbrain/elements/AtlasBase.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/f3520ac9cb0184bfd8118b9c555eef5ae9514854/vbrain%2Felements%2FAtlasBase.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/f3520ac9cb0184bfd8118b9c555eef5ae9514854/vbrain%2Felements%2FAtlasBase.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/vbrain%2Felements%2FAtlasBase.py?ref=f3520ac9cb0184bfd8118b9c555eef5ae9514854",
"patch": "@@ -16,7 +16,7 @@ class AtlasBase(object):\n \"\"\"\n \"\"\"\n \n- def __init__(self, a_color=(1.0,1.0,1.0), a_opacity=0.1, a_projection='internal', a_template='B1',\n+ def __init__(self, a_color=(1.0,1.0,1.0), a_opacity=1., a_projection='internal', a_template='B1',\n a_vertices=None, a_faces=None, a_shading='smooth', a_transform=[], l_position=(100., 100., 100.),\n l_intensity=(1., 1., 1.), l_color=(1., 1., 1., 1.), l_coefAmbient=0.05, l_coefSpecular=0.5, **kwargs):\n # Get inputs :"
}
] |
visbrain | 9f5a0c65f6ae768c8593467ecf3655db8168dc09 | a3ebd0bdceb5e87ae4a0ec9b75bf5e85644857bc | vbrain/interface/uiElements/uiSettings.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -79,7 +79,7 @@ class uiSettings(object):
img = self.view.canvas.render()
io.imsave(filename, img, format='tiff')
- if self.cbexport:
+ if self.cb['export']:
cbimg = self.view.cbcanvas.render()
if filename.find('.')+1:
filename = filename.replace('.', '_colorbar.')
| if self . cbexport : cbimg = self . view . cbcanvas . render ( ) if filename . find ( '.' ) + 1 : filename = filename . replace ( '.' , '_colorbar.' ) | if self . cb [ 'export' ] : cbimg = self . view . cbcanvas . render ( ) if filename . find ( '.' ) + 1 : filename = filename . replace ( '.' , '_colorbar.' ) | SINGLE_STMT | [["Insert", ["if_statement", 3, 9, 6, 63], ["subscript", "N0"], 1], ["Move", "N0", ["attribute", 3, 12, 3, 25], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:'export'", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Update", ["identifier:cbexport", 3, 17, 3, 25], "cb"]] | kdeleeuw11/visbrain@9f5a0c65f6ae768c8593467ecf3655db8168dc09 | Fix exportation | [
{
"sha": "96614f8ca7cf835519cb529c5874853ff05cf7fc",
"filename": "vbrain/interface/uiElements/uiSettings.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/9f5a0c65f6ae768c8593467ecf3655db8168dc09/vbrain%2Finterface%2FuiElements%2FuiSettings.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/9f5a0c65f6ae768c8593467ecf3655db8168dc09/vbrain%2Finterface%2FuiElements%2FuiSettings.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/vbrain%2Finterface%2FuiElements%2FuiSettings.py?ref=9f5a0c65f6ae768c8593467ecf3655db8168dc09",
"patch": "@@ -79,7 +79,7 @@ def screenshot(self):\n img = self.view.canvas.render()\n \n io.imsave(filename, img, format='tiff')\n- if self.cbexport:\n+ if self.cb['export']:\n cbimg = self.view.cbcanvas.render()\n if filename.find('.')+1:\n filename = filename.replace('.', '_colorbar.')"
}
] |
visbrain | cd936c29048deceb9aa995bfc4f2eaddce4b536f | 12d30fe30840d9cc2f46a1cc4edcb111f7783fc5 | setup.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -39,7 +39,7 @@ setup(
long_description=open("README.md").read(),
author=AUTHOR,
author_email=AUTHOR_EMAIL,
- install_requires=["numpy", "vispy", "PyQt4", "matplotlib"],
+ install_requires=["numpy", "vispy", "pyqt", "matplotlib"],
maintainer=AUTHOR,
maintainer_email=AUTHOR_EMAIL,
license='LICENSE.txt',
| install_requires = [ "numpy" , "vispy" , "PyQt4" , "matplotlib" ] , | install_requires = [ "numpy" , "vispy" , "pyqt" , "matplotlib" ] , | CHANGE_STRING_LITERAL | [["Update", ["string:\"PyQt4\"", 3, 41, 3, 48], "\"pyqt\""]] | kdeleeuw11/visbrain@cd936c29048deceb9aa995bfc4f2eaddce4b536f | Fix pyqt | [
{
"sha": "b562aab0ce16057eadb1644a66b110823cd48f51",
"filename": "setup.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/cd936c29048deceb9aa995bfc4f2eaddce4b536f/setup.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/cd936c29048deceb9aa995bfc4f2eaddce4b536f/setup.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/setup.py?ref=cd936c29048deceb9aa995bfc4f2eaddce4b536f",
"patch": "@@ -39,7 +39,7 @@ def find_packages(path, base=\"\" ):\n long_description=open(\"README.md\").read(),\n author=AUTHOR,\n author_email=AUTHOR_EMAIL,\n- install_requires=[\"numpy\", \"vispy\", \"PyQt4\", \"matplotlib\"],\n+ install_requires=[\"numpy\", \"vispy\", \"pyqt\", \"matplotlib\"],\n maintainer=AUTHOR,\n maintainer_email=AUTHOR_EMAIL, \n license='LICENSE.txt',"
}
] |
visbrain | 9be230588ff85062a804d1dc8b75dabb46458505 | 042ce2f50df080bbe92b8fb964c2c686abdc5a79 | setup.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -39,7 +39,7 @@ setup(
long_description=open("README.md").read(),
author=AUTHOR,
author_email=AUTHOR_EMAIL,
- install_requires=["numpy", "vispy", "pyqt", "matplotlib"],
+ install_requires=["numpy", "vispy", "matplotlib"],
maintainer=AUTHOR,
maintainer_email=AUTHOR_EMAIL,
license='LICENSE.txt',
| install_requires = [ "numpy" , "vispy" , "pyqt" , "matplotlib" ] , | install_requires = [ "numpy" , "vispy" , "matplotlib" ] , | SINGLE_STMT | [["Delete", ["string:\"pyqt\"", 3, 41, 3, 47]], ["Delete", [",:,", 3, 47, 3, 48]]] | kdeleeuw11/visbrain@9be230588ff85062a804d1dc8b75dabb46458505 | Fix pyqt | [
{
"sha": "b55e9ce6b7eb412066b6130b7f529bef26793a87",
"filename": "setup.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/9be230588ff85062a804d1dc8b75dabb46458505/setup.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/9be230588ff85062a804d1dc8b75dabb46458505/setup.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/setup.py?ref=9be230588ff85062a804d1dc8b75dabb46458505",
"patch": "@@ -39,7 +39,7 @@ def find_packages(path, base=\"\" ):\n long_description=open(\"README.md\").read(),\n author=AUTHOR,\n author_email=AUTHOR_EMAIL,\n- install_requires=[\"numpy\", \"vispy\", \"pyqt\", \"matplotlib\"],\n+ install_requires=[\"numpy\", \"vispy\", \"matplotlib\"],\n maintainer=AUTHOR,\n maintainer_email=AUTHOR_EMAIL, \n license='LICENSE.txt',"
}
] |
visbrain | 4bce00a79d2d3fe3f31ae21078601d3752669d8c | 829a8aa0fa89ac8aa39e172bfb44bbd6918a201a | docs/conf.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -116,7 +116,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'alabaster'
+html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
| html_theme = 'alabaster' | html_theme = 'default' | CHANGE_STRING_LITERAL | [["Update", ["string:'alabaster'", 3, 14, 3, 25], "'default'"]] | kdeleeuw11/visbrain@4bce00a79d2d3fe3f31ae21078601d3752669d8c | Update conf.py
Set default theme | [
{
"sha": "fc9e44d57daebac42e2a8cfbf80f3a9c1f7e31d3",
"filename": "docs/conf.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4bce00a79d2d3fe3f31ae21078601d3752669d8c/docs%2Fconf.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4bce00a79d2d3fe3f31ae21078601d3752669d8c/docs%2Fconf.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/docs%2Fconf.py?ref=4bce00a79d2d3fe3f31ae21078601d3752669d8c",
"patch": "@@ -116,7 +116,7 @@\n \n # The theme to use for HTML and HTML Help pages. See the documentation for\n # a list of builtin themes.\n-html_theme = 'alabaster'\n+html_theme = 'default'\n \n # Theme options are theme-specific and customize the look and feel of a theme\n # further. For a list of options available for each theme, see the"
}
] |
visbrain | a5f3457667317a18a49c60352134d67db4e74131 | bc2a290898e91db9ca02e28be912574478788cf6 | docs/conf.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -116,7 +116,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'classic'
+html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
| html_theme = 'classic' | html_theme = 'default' | CHANGE_STRING_LITERAL | [["Update", ["string:'classic'", 3, 14, 3, 23], "'default'"]] | kdeleeuw11/visbrain@a5f3457667317a18a49c60352134d67db4e74131 | Update conf.py
Back to default | [
{
"sha": "fc9e44d57daebac42e2a8cfbf80f3a9c1f7e31d3",
"filename": "docs/conf.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/a5f3457667317a18a49c60352134d67db4e74131/docs%2Fconf.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/a5f3457667317a18a49c60352134d67db4e74131/docs%2Fconf.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/docs%2Fconf.py?ref=a5f3457667317a18a49c60352134d67db4e74131",
"patch": "@@ -116,7 +116,7 @@\n \n # The theme to use for HTML and HTML Help pages. See the documentation for\n # a list of builtin themes.\n-html_theme = 'classic'\n+html_theme = 'default'\n \n # Theme options are theme-specific and customize the look and feel of a theme\n # further. For a list of options available for each theme, see the"
}
] |
visbrain | 2b9b7c2f1eb5b6eaee28ceb42f80ea5b15ee8148 | 64cea58740c8504200fd0fa2d665a2d1b94e6975 | visbrain/sleep/sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -21,7 +21,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):
- def __init__(self, file=None, hypno_file=None, data=None, channels=None,
+ def __init__(self, file='', hypno_file=None, data=None, channels=None,
sf=None, hypno=None, downsample=200, axis=False, line='gl'):
"""Init."""
# ====================== APP CREATION ======================
| def __init__ ( self , file = None , hypno_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 200 , axis = False , line = 'gl' ) : """Init.""" | def __init__ ( self , file = '' , hypno_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 200 , axis = False , line = 'gl' ) : """Init.""" | SINGLE_TOKEN | [["Insert", ["default_parameter", 1, 24, 1, 33], ["string:''", "T"], 2], ["Delete", ["none:None", 1, 29, 1, 33]]] | kdeleeuw11/visbrain@2b9b7c2f1eb5b6eaee28ceb42f80ea5b15ee8148 | fixed bug sleep stats filename | [
{
"sha": "0809b502a0bebff4000eb7ada75e6a191f1d5f06",
"filename": "visbrain/sleep/sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/2b9b7c2f1eb5b6eaee28ceb42f80ea5b15ee8148/visbrain%2Fsleep%2Fsleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/2b9b7c2f1eb5b6eaee28ceb42f80ea5b15ee8148/visbrain%2Fsleep%2Fsleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fsleep.py?ref=2b9b7c2f1eb5b6eaee28ceb42f80ea5b15ee8148",
"patch": "@@ -21,7 +21,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):\n Multiple lines description...\n \"\"\"\n \n- def __init__(self, file=None, hypno_file=None, data=None, channels=None,\n+ def __init__(self, file='', hypno_file=None, data=None, channels=None,\n sf=None, hypno=None, downsample=200, axis=False, line='gl'):\n \"\"\"Init.\"\"\"\n # ====================== APP CREATION ======================"
}
] |
visbrain | eaad974e2cc43688f5828356ede978b6b99ea6ec | d79af9680238ca1b906688d11ea1d6517e40b75c | visbrain/sleep/interface/uiElements/uiInfo.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -24,7 +24,7 @@ class uiInfo(object):
"""Complete the table sleep info."""
# Get sleep info :
win = self._infoTime.value()
- stats = sleepstats(self._file, self._hyp.mesh.pos[:, 1], self._sf, win)
+ stats = sleepstats(self._file, -self._hyp.mesh.pos[:, 1], self._sf, win)
self._keysInfo = ['Window'] + [''] * len(stats)
self._valInfo = [str(win)] + [''] * len(stats)
# Check line number:
| stats = sleepstats ( self . _file , self . _hyp . mesh . pos [ : , 1 ] , self . _sf , win ) | stats = sleepstats ( self . _file , - self . _hyp . mesh . pos [ : , 1 ] , self . _sf , win ) | CHANGE_UNARY_OPERATOR | [["Insert", ["argument_list", 3, 27, 3, 80], ["unary_operator", "N0"], 3], ["Insert", "N0", ["-:-", "T"], 0], ["Move", "N0", ["subscript", 3, 40, 3, 64], 1]] | kdeleeuw11/visbrain@eaad974e2cc43688f5828356ede978b6b99ea6ec | Fix uiInfo | [
{
"sha": "28aa7485b3be4bfcb4eb31035cfdcf8a2bc82466",
"filename": "visbrain/sleep/interface/uiElements/uiInfo.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/eaad974e2cc43688f5828356ede978b6b99ea6ec/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/eaad974e2cc43688f5828356ede978b6b99ea6ec/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py?ref=eaad974e2cc43688f5828356ede978b6b99ea6ec",
"patch": "@@ -24,7 +24,7 @@ def _fcn_infoUpdate(self):\n \"\"\"Complete the table sleep info.\"\"\"\n # Get sleep info :\n win = self._infoTime.value()\n- stats = sleepstats(self._file, self._hyp.mesh.pos[:, 1], self._sf, win)\n+ stats = sleepstats(self._file, -self._hyp.mesh.pos[:, 1], self._sf, win)\n self._keysInfo = ['Window'] + [''] * len(stats)\n self._valInfo = [str(win)] + [''] * len(stats)\n # Check line number:"
}
] |
visbrain | c7d7b0641b63165d060e1b707ad3d40b5c1ea3be | eaad974e2cc43688f5828356ede978b6b99ea6ec | visbrain/sleep/visuals/visuals.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -234,7 +234,7 @@ class Spectrogram(object):
# Update object :
self.mesh.update()
# Get camera rectangle :
- self.rect = (t.min(), freq.min(), t.max()-t.min(),
+ self.rect = (time.min(), freq.min(), time.max()-time.min(),
freq.max()-freq.min())
self.freq = freq
| self . rect = ( t . min ( ) , freq . min ( ) , t . max ( ) - t . min ( ) , freq . max ( ) - freq . min ( ) ) | self . rect = ( time . min ( ) , freq . min ( ) , time . max ( ) - time . min ( ) , freq . max ( ) - freq . min ( ) ) | SINGLE_STMT | [["Update", ["identifier:t", 3, 22, 3, 23], "time"], ["Move", ["call", 3, 43, 3, 50], ["argument_list", 3, 56, 3, 58], 1], ["Insert", ["call", 3, 51, 3, 58], ["argument_list", "N0"], 1], ["Update", ["identifier:t", 3, 43, 3, 44], "time"], ["Update", ["identifier:t", 3, 51, 3, 52], "time"], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["):)", "T"], 1], ["Delete", ["(:(", 3, 48, 3, 49]], ["Delete", ["):)", 3, 49, 3, 50]], ["Delete", ["argument_list", 3, 48, 3, 50]]] | kdeleeuw11/visbrain@c7d7b0641b63165d060e1b707ad3d40b5c1ea3be | Fix spectrogram time axis | [
{
"sha": "deadd0120f5b345e4b617328b3d1155f60d7453e",
"filename": "visbrain/sleep/visuals/visuals.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/c7d7b0641b63165d060e1b707ad3d40b5c1ea3be/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/c7d7b0641b63165d060e1b707ad3d40b5c1ea3be/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py?ref=c7d7b0641b63165d060e1b707ad3d40b5c1ea3be",
"patch": "@@ -234,7 +234,7 @@ def set_data(self, sf, data, time, cmap='rainbow', nfft=30., overlap=0.5,\n # Update object :\n self.mesh.update()\n # Get camera rectangle :\n- self.rect = (t.min(), freq.min(), t.max()-t.min(),\n+ self.rect = (time.min(), freq.min(), time.max()-time.min(),\n freq.max()-freq.min())\n self.freq = freq\n "
}
] |
visbrain | 31b8fbaebdaf3baf349b777c1f975e0160d8dbe0 | 82d053e0830ff19344cbe09c2bb8788235d51e59 | visbrain/sleep/interface/uiElements/uiTools.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -105,6 +105,6 @@ class uiTools(object):
# Run detection :
self._fcn_applyDetection()
# Update progress bar :
- self._ToolDetectProgress.setValue(100. * k / len(self))
+ self._ToolDetectProgress.setValue(100. * (k + 1) / len(self))
# Finally, hide progress bar :
self._ToolDetectProgress.hide()
| self . _ToolDetectProgress . setValue ( 100. * k / len ( self ) ) | self . _ToolDetectProgress . setValue ( 100. * ( k + 1 ) / len ( self ) ) | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 47, 3, 55], ["parenthesized_expression", "N0"], 2], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["binary_operator", "N1"], 1], ["Insert", "N0", ["):)", "T"], 2], ["Move", "N1", ["identifier:k", 3, 54, 3, 55], 0], ["Insert", "N1", ["+:+", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2]] | kdeleeuw11/visbrain@31b8fbaebdaf3baf349b777c1f975e0160d8dbe0 | Fix progress bar counting | [
{
"sha": "5578b9db699af2cfe65e6b1f0f2c0b363b66f8ae",
"filename": "visbrain/sleep/interface/uiElements/uiTools.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/31b8fbaebdaf3baf349b777c1f975e0160d8dbe0/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/31b8fbaebdaf3baf349b777c1f975e0160d8dbe0/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py?ref=31b8fbaebdaf3baf349b777c1f975e0160d8dbe0",
"patch": "@@ -105,6 +105,6 @@ def _fcn_applyDetectionAll(self):\n # Run detection :\n self._fcn_applyDetection()\n # Update progress bar :\n- self._ToolDetectProgress.setValue(100. * k / len(self))\n+ self._ToolDetectProgress.setValue(100. * (k + 1) / len(self))\n # Finally, hide progress bar :\n self._ToolDetectProgress.hide()"
}
] |
visbrain | 735084eefb3bb54207926b090fec4476b1fc2c28 | bda90086daff51b2fc0158ddfdd4a350533da021 | visbrain/sleep/interface/uiElements/uiInfo.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -46,7 +46,7 @@ class uiInfo(object):
"""Export stat info."""
# Get file name :
path = QtGui.QFileDialog.getSaveFileName(
- self, "Save File", "",
+ self, "Save File", "statsinfo.csv",
filter="CSV Files (*.csv);;Text Files (*.txt)")
# Find extension :
selected_ext = self._infoExportAs.currentText()
| path = QtGui . QFileDialog . getSaveFileName ( self , "Save File" , "" , filter = "CSV Files (*.csv);;Text Files (*.txt)" ) | path = QtGui . QFileDialog . getSaveFileName ( self , "Save File" , "statsinfo.csv" , filter = "CSV Files (*.csv);;Text Files (*.txt)" ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"", 3, 32, 3, 34], "\"statsinfo.csv\""]] | kdeleeuw11/visbrain@735084eefb3bb54207926b090fec4476b1fc2c28 | Configure default save hypno name | [
{
"sha": "374822ae8c98496cab919e328452deff147ca8d1",
"filename": "visbrain/sleep/interface/uiElements/uiInfo.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/735084eefb3bb54207926b090fec4476b1fc2c28/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/735084eefb3bb54207926b090fec4476b1fc2c28/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py?ref=735084eefb3bb54207926b090fec4476b1fc2c28",
"patch": "@@ -46,7 +46,7 @@ def _fcn_exportFile(self):\n \"\"\"Export stat info.\"\"\"\n # Get file name :\n path = QtGui.QFileDialog.getSaveFileName(\n- self, \"Save File\", \"\",\n+ self, \"Save File\", \"statsinfo.csv\",\n filter=\"CSV Files (*.csv);;Text Files (*.txt)\")\n # Find extension :\n selected_ext = self._infoExportAs.currentText()"
}
] |
electrumx | e4c206e123b40decc93506217c22d9d007d43e80 | 8bc9abf9c1dcbb758b27c709a6a4cd30049c99b1 | lib/jsonrpc.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -607,7 +607,7 @@ class JSONSessionBase(util.LoggedClass):
if self.version.HAS_BATCHES:
parts = [self.notification_bytes(*pair) for pair in mp_iterable]
- self.send_binary(batch_bytes(parts))
+ self.send_binary(self.version.batch_bytes(parts))
else:
for pair in mp_iterable:
self.send_notification(*pair)
| self . send_binary ( batch_bytes ( parts ) ) | self . send_binary ( self . version . batch_bytes ( parts ) ) | SINGLE_STMT | [["Insert", ["call", 2, 30, 2, 48], ["attribute", "N0"], 0], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:batch_bytes", 2, 30, 2, 41], 2], ["Insert", "N1", ["identifier:self", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:version", "T"], 2]] | Fair-Exchange/electrumx@e4c206e123b40decc93506217c22d9d007d43e80 | Namespace fix | [
{
"sha": "977a0cc2ff7103807b615d1a644c8dd5842a3f95",
"filename": "lib/jsonrpc.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/e4c206e123b40decc93506217c22d9d007d43e80/lib%2Fjsonrpc.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/e4c206e123b40decc93506217c22d9d007d43e80/lib%2Fjsonrpc.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/lib%2Fjsonrpc.py?ref=e4c206e123b40decc93506217c22d9d007d43e80",
"patch": "@@ -607,7 +607,7 @@ def send_notifications(self, mp_iterable):\n A 1-tuple is also valid in which case there are no params.'''\n if self.version.HAS_BATCHES:\n parts = [self.notification_bytes(*pair) for pair in mp_iterable]\n- self.send_binary(batch_bytes(parts))\n+ self.send_binary(self.version.batch_bytes(parts))\n else:\n for pair in mp_iterable:\n self.send_notification(*pair)"
}
] |
electrumx | 4dcd7f25a500a00d1a1e4ae59aba8fba83dd4dd5 | 09b2df11797b7e1cdd6aee66461ec946cf2f359a | lib/coins.py | https://github.com/Fair-Exchange/electrumx | true | false | false | @@ -34,7 +34,7 @@ class Coin(object):
REORG_LIMIT = 200
# Not sure if these are coin-specific
- RPC_URL_REGEX = re.compile('.+@(\[[0-9:]+\]|[^:]+)(:[0-9]+)?')
+ RPC_URL_REGEX = re.compile('.+@(\[[0-9a-fA-F:]+\]|[^:]+)(:[0-9]+)?')
VALUE_PER_COIN = 100000000
CHUNK_SIZE = 2016
IRC_SERVER = "irc.freenode.net"
| RPC_URL_REGEX = re . compile ( '.+@(\[[0-9:]+\]|[^:]+)(:[0-9]+)?' ) | RPC_URL_REGEX = re . compile ( '.+@(\[[0-9a-fA-F:]+\]|[^:]+)(:[0-9]+)?' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'.+@(\\[[0-9:]+\\]|[^:]+)(:[0-9]+)?'", 3, 32, 3, 66], "'.+@(\\[[0-9a-fA-F:]+\\]|[^:]+)(:[0-9]+)?'"]] | Fair-Exchange/electrumx@4dcd7f25a500a00d1a1e4ae59aba8fba83dd4dd5 | Further fix regex for hex chars | [
{
"sha": "2d88b0ef14b1a998b70d159709c4b6ca49953266",
"filename": "lib/coins.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/4dcd7f25a500a00d1a1e4ae59aba8fba83dd4dd5/lib%2Fcoins.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/4dcd7f25a500a00d1a1e4ae59aba8fba83dd4dd5/lib%2Fcoins.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/lib%2Fcoins.py?ref=4dcd7f25a500a00d1a1e4ae59aba8fba83dd4dd5",
"patch": "@@ -34,7 +34,7 @@ class Coin(object):\n \n REORG_LIMIT = 200\n # Not sure if these are coin-specific\n- RPC_URL_REGEX = re.compile('.+@(\\[[0-9:]+\\]|[^:]+)(:[0-9]+)?')\n+ RPC_URL_REGEX = re.compile('.+@(\\[[0-9a-fA-F:]+\\]|[^:]+)(:[0-9]+)?')\n VALUE_PER_COIN = 100000000\n CHUNK_SIZE = 2016\n IRC_SERVER = \"irc.freenode.net\""
}
] |
electrumx | 012233672ab9c76d2916af3fba659e9a18f8e1c1 | 6f32f99a067b1bf677ada1b68eed92d59ada7846 | server/peers.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -440,7 +440,7 @@ class PeerManager(util.LoggedClass):
def retry_peer(peer):
# Try some Tor at startup to determine the proxy so we can
# serve the right banner file
- if self.last_tor_retry_time == 0 and self.is_coin_onion_peer(peer):
+ if self.tor_proxy.port is None and self.is_coin_onion_peer(peer):
return True
# Retry a peer whose ports might have updated
if peer.other_port_pairs:
| if self . last_tor_retry_time == 0 and self . is_coin_onion_peer ( peer ) : return True | if self . tor_proxy . port is None and self . is_coin_onion_peer ( peer ) : return True | CHANGE_BINARY_OPERAND | [["Insert", ["comparison_operator", 3, 16, 3, 45], ["attribute", "N0"], 0], ["Insert", ["comparison_operator", 3, 16, 3, 45], ["is:is", "T"], 1], ["Insert", ["comparison_operator", 3, 16, 3, 45], ["none:None", "T"], 2], ["Move", "N0", ["attribute", 3, 16, 3, 40], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:port", "T"], 2], ["Update", ["identifier:last_tor_retry_time", 3, 21, 3, 40], "tor_proxy"], ["Delete", ["==:==", 3, 41, 3, 43]], ["Delete", ["integer:0", 3, 44, 3, 45]]] | Fair-Exchange/electrumx@012233672ab9c76d2916af3fba659e9a18f8e1c1 | fix tor coin peers always scheduled for check (#139)
fixes #138 | [
{
"sha": "376d886ba82fcc0535ffa903cb4cb998e5674ad3",
"filename": "server/peers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/012233672ab9c76d2916af3fba659e9a18f8e1c1/server%2Fpeers.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/012233672ab9c76d2916af3fba659e9a18f8e1c1/server%2Fpeers.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fpeers.py?ref=012233672ab9c76d2916af3fba659e9a18f8e1c1",
"patch": "@@ -440,7 +440,7 @@ async def retry_peers(self):\n def retry_peer(peer):\n # Try some Tor at startup to determine the proxy so we can\n # serve the right banner file\n- if self.last_tor_retry_time == 0 and self.is_coin_onion_peer(peer):\n+ if self.tor_proxy.port is None and self.is_coin_onion_peer(peer):\n return True\n # Retry a peer whose ports might have updated\n if peer.other_port_pairs:"
}
] |
electrumx | 4c8b5a643991080d19a94a64887337721ad6d8fe | 5bcbdea16a7681a4470a1c0cae3856e0d4e45b8b | server/peers.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -439,7 +439,7 @@ class PeerManager(util.LoggedClass):
def retry_peer(peer):
# Try some Tor at startup to determine the proxy so we can
# serve the right banner file
- if self.last_tor_retry_time == 0 and self.is_coin_onion_peer(peer):
+ if self.tor_proxy.port is None and self.is_coin_onion_peer(peer):
return True
# Retry a peer whose ports might have updated
if peer.other_port_pairs:
| if self . last_tor_retry_time == 0 and self . is_coin_onion_peer ( peer ) : return True | if self . tor_proxy . port is None and self . is_coin_onion_peer ( peer ) : return True | CHANGE_BINARY_OPERAND | [["Insert", ["comparison_operator", 3, 16, 3, 45], ["attribute", "N0"], 0], ["Insert", ["comparison_operator", 3, 16, 3, 45], ["is:is", "T"], 1], ["Insert", ["comparison_operator", 3, 16, 3, 45], ["none:None", "T"], 2], ["Move", "N0", ["attribute", 3, 16, 3, 40], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:port", "T"], 2], ["Update", ["identifier:last_tor_retry_time", 3, 21, 3, 40], "tor_proxy"], ["Delete", ["==:==", 3, 41, 3, 43]], ["Delete", ["integer:0", 3, 44, 3, 45]]] | Fair-Exchange/electrumx@4c8b5a643991080d19a94a64887337721ad6d8fe | fix tor coin peers always scheduled for check (#139)
fixes #138 | [
{
"sha": "730b0858d3ae3a38ad15e6d1dc0d0a373a2232f6",
"filename": "server/peers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/4c8b5a643991080d19a94a64887337721ad6d8fe/server%2Fpeers.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/4c8b5a643991080d19a94a64887337721ad6d8fe/server%2Fpeers.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fpeers.py?ref=4c8b5a643991080d19a94a64887337721ad6d8fe",
"patch": "@@ -439,7 +439,7 @@ async def retry_peers(self):\n def retry_peer(peer):\n # Try some Tor at startup to determine the proxy so we can\n # serve the right banner file\n- if self.last_tor_retry_time == 0 and self.is_coin_onion_peer(peer):\n+ if self.tor_proxy.port is None and self.is_coin_onion_peer(peer):\n return True\n # Retry a peer whose ports might have updated\n if peer.other_port_pairs:"
}
] |
electrumx | b3005fbb3ecb7add25bbc76dc68daf8c60a40c87 | a2c5ecf0a0a5f87f264bdd2f92a7d8238fb7d42f | server/session.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -275,7 +275,7 @@ class ElectrumX(SessionBase):
msg = ('chunk indices not advancing (wrong network?): {}'
.format(self.chunk_indices))
# INVALID_REQUEST triggers a disconnect
- raise RPCError(mrg, JSONRPC.INVALID_REQUEST)
+ raise RPCError(msg, JSONRPC.INVALID_REQUEST)
return self.controller.get_chunk(index)
def is_tor(self):
| raise RPCError ( mrg , JSONRPC . INVALID_REQUEST ) | raise RPCError ( msg , JSONRPC . INVALID_REQUEST ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:mrg", 3, 28, 3, 31], "msg"]] | Fair-Exchange/electrumx@b3005fbb3ecb7add25bbc76dc68daf8c60a40c87 | Fix typo | [
{
"sha": "de753a9785e1451a9fa90eb3491ac4b4a0730e9a",
"filename": "server/session.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/b3005fbb3ecb7add25bbc76dc68daf8c60a40c87/server%2Fsession.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/b3005fbb3ecb7add25bbc76dc68daf8c60a40c87/server%2Fsession.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fsession.py?ref=b3005fbb3ecb7add25bbc76dc68daf8c60a40c87",
"patch": "@@ -275,7 +275,7 @@ def block_get_chunk(self, index):\n msg = ('chunk indices not advancing (wrong network?): {}'\n .format(self.chunk_indices))\n # INVALID_REQUEST triggers a disconnect\n- raise RPCError(mrg, JSONRPC.INVALID_REQUEST)\n+ raise RPCError(msg, JSONRPC.INVALID_REQUEST)\n return self.controller.get_chunk(index)\n \n def is_tor(self):"
}
] |
electrumx | 472c7384792b57a476ab897535600722c9528991 | b3005fbb3ecb7add25bbc76dc68daf8c60a40c87 | server/irc.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -35,7 +35,7 @@ class IRC(LoggedClass):
self.prefix = env.coin.IRC_PREFIX
self.nick = '{}{}'.format(self.prefix,
env.irc_nick if env.irc_nick else
- double_sha256(env.identity.host.encode())
+ double_sha256(env.host.encode())
[:5].hex())
self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix))
| self . nick = '{}{}' . format ( self . prefix , env . irc_nick if env . irc_nick else double_sha256 ( env . identity . host . encode ( ) ) [ : 5 ] . hex ( ) ) | self . nick = '{}{}' . format ( self . prefix , env . irc_nick if env . irc_nick else double_sha256 ( env . host . encode ( ) ) [ : 5 ] . hex ( ) ) | SINGLE_STMT | [["Delete", ["identifier:identity", 3, 53, 3, 61]], ["Delete", [".:.", 3, 61, 3, 62]]] | Fair-Exchange/electrumx@472c7384792b57a476ab897535600722c9528991 | fix crash in IRC initialization (#141) | [
{
"sha": "6507c3b678a3735f9c09ca76941de22282009f10",
"filename": "server/irc.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/472c7384792b57a476ab897535600722c9528991/server%2Firc.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/472c7384792b57a476ab897535600722c9528991/server%2Firc.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Firc.py?ref=472c7384792b57a476ab897535600722c9528991",
"patch": "@@ -35,7 +35,7 @@ def __init__(self, env, peer_mgr):\n self.prefix = env.coin.IRC_PREFIX\n self.nick = '{}{}'.format(self.prefix,\n env.irc_nick if env.irc_nick else\n- double_sha256(env.identity.host.encode())\n+ double_sha256(env.host.encode())\n [:5].hex())\n self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix))\n "
}
] |
electrumx | d198b95798f51e048d3452b0244009b6abe72532 | 9238fe397d921dd8107575754fe1c421cbd24df6 | server/peers.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -273,7 +273,7 @@ class PeerManager(util.LoggedClass):
return [peer_data(peer) for peer in sorted(self.peers, key=peer_key)]
- def add_peers(self, peers, limit=3, check_ports=False, source=None):
+ def add_peers(self, peers, limit=2, check_ports=False, source=None):
'''Add a limited number of peers that are not already present.'''
retry = False
new_peers = []
| def add_peers ( self , peers , limit = 3 , check_ports = False , source = None ) : '''Add a limited number of peers that are not already present.''' retry = False new_peers = [ ] | def add_peers ( self , peers , limit = 2 , check_ports = False , source = None ) : '''Add a limited number of peers that are not already present.''' retry = False new_peers = [ ] | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:3", 3, 38, 3, 39], "2"]] | Fair-Exchange/electrumx@d198b95798f51e048d3452b0244009b6abe72532 | Reduce new peers per source limit to 2 by default | [
{
"sha": "70d070b97c05f529fef4ac1fd4b24c5dcb231a64",
"filename": "server/peers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/d198b95798f51e048d3452b0244009b6abe72532/server%2Fpeers.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/d198b95798f51e048d3452b0244009b6abe72532/server%2Fpeers.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fpeers.py?ref=d198b95798f51e048d3452b0244009b6abe72532",
"patch": "@@ -273,7 +273,7 @@ def peer_key(peer):\n \n return [peer_data(peer) for peer in sorted(self.peers, key=peer_key)]\n \n- def add_peers(self, peers, limit=3, check_ports=False, source=None):\n+ def add_peers(self, peers, limit=2, check_ports=False, source=None):\n '''Add a limited number of peers that are not already present.'''\n retry = False\n new_peers = []"
}
] |
electrumx | 79bce5335e952d58d03911df94907af377de89c0 | fa1a5bd3e4e4771f0e239ed58be93a16f69c44cf | server/peers.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -177,7 +177,7 @@ class PeerSession(JSONSession):
def close_if_done(self):
if not self.has_pending_requests():
if self.bad:
- peer.mark_bad()
+ self.peer.mark_bad()
self.peer_mgr.set_connection_status(self.peer, not self.bad)
if self.peer.is_tor:
how = 'via {} over Tor'.format(self.kind)
| peer . mark_bad ( ) | self . peer . mark_bad ( ) | SINGLE_STMT | [["Insert", ["attribute", 3, 17, 3, 30], ["attribute", "N0"], 0], ["Insert", ["attribute", 3, 17, 3, 30], [".:.", "T"], 1], ["Insert", "N0", ["identifier:self", "T"], 0], ["Move", "N0", [".:.", 3, 21, 3, 22], 1], ["Move", "N0", ["identifier:peer", 3, 17, 3, 21], 2]] | Fair-Exchange/electrumx@79bce5335e952d58d03911df94907af377de89c0 | Fix missing self | [
{
"sha": "2bfe54683cf58676d34db90a367de845b38765aa",
"filename": "server/peers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/79bce5335e952d58d03911df94907af377de89c0/server%2Fpeers.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/79bce5335e952d58d03911df94907af377de89c0/server%2Fpeers.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fpeers.py?ref=79bce5335e952d58d03911df94907af377de89c0",
"patch": "@@ -177,7 +177,7 @@ def on_version(self, result, error):\n def close_if_done(self):\n if not self.has_pending_requests():\n if self.bad:\n- peer.mark_bad()\n+ self.peer.mark_bad()\n self.peer_mgr.set_connection_status(self.peer, not self.bad)\n if self.peer.is_tor:\n how = 'via {} over Tor'.format(self.kind)"
}
] |
electrumx | 321315ace07f569263711de207b19a0926492962 | d1894356d0c806eaa8a81b223067c496e7a0c966 | server/env.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -143,7 +143,7 @@ class Env(LoggedClass):
host = self.default('REPORT_HOST_TOR', None)
if host is None:
return None
- if not tor_host.endswith('.onion'):
+ if not host.endswith('.onion'):
raise self.Error('tor host "{}" must end with ".onion"'
.format(host))
| if not tor_host . endswith ( '.onion' ) : raise self . Error ( 'tor host "{}" must end with ".onion"' . format ( host ) ) | if not host . endswith ( '.onion' ) : raise self . Error ( 'tor host "{}" must end with ".onion"' . format ( host ) ) | SAME_FUNCTION_WRONG_CALLER | [["Update", ["identifier:tor_host", 3, 16, 3, 24], "host"]] | Fair-Exchange/electrumx@321315ace07f569263711de207b19a0926492962 | Fix typo | [
{
"sha": "437ceba4ac41d578a4592d2270dda363a5477a85",
"filename": "server/env.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/321315ace07f569263711de207b19a0926492962/server%2Fenv.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/321315ace07f569263711de207b19a0926492962/server%2Fenv.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fenv.py?ref=321315ace07f569263711de207b19a0926492962",
"patch": "@@ -143,7 +143,7 @@ def tor_identity(self, clearnet):\n host = self.default('REPORT_HOST_TOR', None)\n if host is None:\n return None\n- if not tor_host.endswith('.onion'):\n+ if not host.endswith('.onion'):\n raise self.Error('tor host \"{}\" must end with \".onion\"'\n .format(host))\n "
}
] |
electrumx | 08dbbf217a0f656dd7b0a7369087aa6896078e0d | d3348fe6841ad64b86dc7c8ba54006fe0cc91e56 | server/session.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -34,7 +34,7 @@ class SessionBase(JSONSession):
self.env = controller.env
self.daemon = self.bp.daemon
self.client = 'unknown'
- self.client_version = (1)
+ self.client_version = (1, )
self.protocol_version = '1.0'
self.anon_logs = self.env.anon_logs
self.last_delay = 0
| self . client_version = ( 1 ) | self . client_version = ( 1 , ) | SINGLE_STMT | [["Insert", ["assignment", 3, 9, 3, 34], ["tuple", "N0"], 2], ["Move", "N0", ["(:(", 3, 31, 3, 32], 0], ["Move", "N0", ["integer:1", 3, 32, 3, 33], 1], ["Insert", "N0", [",:,", "T"], 2], ["Move", "N0", ["):)", 3, 33, 3, 34], 3], ["Delete", ["parenthesized_expression", 3, 31, 3, 34]]] | Fair-Exchange/electrumx@08dbbf217a0f656dd7b0a7369087aa6896078e0d | client_version must be a tuple
Fixes #180 | [
{
"sha": "b5ab2399d662100bc51a2c30cc55c9fc205d19af",
"filename": "server/session.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/08dbbf217a0f656dd7b0a7369087aa6896078e0d/server%2Fsession.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/08dbbf217a0f656dd7b0a7369087aa6896078e0d/server%2Fsession.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fsession.py?ref=08dbbf217a0f656dd7b0a7369087aa6896078e0d",
"patch": "@@ -34,7 +34,7 @@ def __init__(self, controller, kind):\n self.env = controller.env\n self.daemon = self.bp.daemon\n self.client = 'unknown'\n- self.client_version = (1)\n+ self.client_version = (1, )\n self.protocol_version = '1.0'\n self.anon_logs = self.env.anon_logs\n self.last_delay = 0"
}
] |
electrumx | 9a9f78030d9b9308dac7a7032da442b51a61b657 | efd859ab0288f210981ed712831d457a458f17cd | electrumx_server.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -33,7 +33,7 @@ def main_loop():
raise RuntimeError('Python >= 3.5.3 is required to run ElectrumX')
if os.geteuid() == 0:
- raise RuntimeError('DO NOT RUN AS ROOT! Create an unpriveleged user '
+ raise RuntimeError('DO NOT RUN AS ROOT! Create an unprivileged user '
'account and use that')
loop = asyncio.get_event_loop()
| raise RuntimeError ( 'DO NOT RUN AS ROOT! Create an unpriveleged user ' 'account and use that' ) | raise RuntimeError ( 'DO NOT RUN AS ROOT! Create an unprivileged user ' 'account and use that' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'DO NOT RUN AS ROOT! Create an unpriveleged user '", 3, 28, 3, 78], "'DO NOT RUN AS ROOT! Create an unprivileged user '"]] | Fair-Exchange/electrumx@9a9f78030d9b9308dac7a7032da442b51a61b657 | fix a typo
Fixes a typo. | [
{
"sha": "946d445fe6544aebc900bb124f1833321838e726",
"filename": "electrumx_server.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/9a9f78030d9b9308dac7a7032da442b51a61b657/electrumx_server.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/9a9f78030d9b9308dac7a7032da442b51a61b657/electrumx_server.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/electrumx_server.py?ref=9a9f78030d9b9308dac7a7032da442b51a61b657",
"patch": "@@ -33,7 +33,7 @@ def main_loop():\n raise RuntimeError('Python >= 3.5.3 is required to run ElectrumX')\n \n if os.geteuid() == 0:\n- raise RuntimeError('DO NOT RUN AS ROOT! Create an unpriveleged user '\n+ raise RuntimeError('DO NOT RUN AS ROOT! Create an unprivileged user '\n 'account and use that')\n \n loop = asyncio.get_event_loop()"
}
] |
electrumx | 59d8421c8775d3a9415af6e5b4ef8276baffe1d5 | b4ac4b6a0538e81a69315db881d039f77a04d5e0 | server/db.py | https://github.com/Fair-Exchange/electrumx | true | false | true | @@ -315,7 +315,7 @@ class DB(util.LoggedClass):
genesis_hash = genesis_hash.decode()
if genesis_hash != self.coin.GENESIS_HASH:
raise self.DBError('DB genesis hash {} does not match coin {}'
- .format(state['genesis_hash'],
+ .format(genesis_hash,
self.coin.GENESIS_HASH))
self.db_height = state['height']
self.db_tx_count = state['tx_count']
| raise self . DBError ( 'DB genesis hash {} does not match coin {}' . format ( state [ 'genesis_hash' ] , self . coin . GENESIS_HASH ) ) | raise self . DBError ( 'DB genesis hash {} does not match coin {}' . format ( genesis_hash , self . coin . GENESIS_HASH ) ) | SINGLE_STMT | [["Update", ["identifier:state", 3, 44, 3, 49], "genesis_hash"], ["Move", ["argument_list", 3, 43, 4, 67], ["identifier:state", 3, 44, 3, 49], 1], ["Delete", ["[:[", 3, 49, 3, 50]], ["Delete", ["string:'genesis_hash'", 3, 50, 3, 64]], ["Delete", ["]:]", 3, 64, 3, 65]], ["Delete", ["subscript", 3, 44, 3, 65]]] | Fair-Exchange/electrumx@59d8421c8775d3a9415af6e5b4ef8276baffe1d5 | Fix KeyError on incorrect genesis hash (#224)
Fix KeyError that occurs when creating an exception for an incorrect genesis hash. | [
{
"sha": "6e1b8291d54f1d8df6d6f52c1dc25fb31543ecbd",
"filename": "server/db.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/59d8421c8775d3a9415af6e5b4ef8276baffe1d5/server%2Fdb.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/59d8421c8775d3a9415af6e5b4ef8276baffe1d5/server%2Fdb.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fdb.py?ref=59d8421c8775d3a9415af6e5b4ef8276baffe1d5",
"patch": "@@ -315,7 +315,7 @@ def read_utxo_state(self):\n genesis_hash = genesis_hash.decode()\n if genesis_hash != self.coin.GENESIS_HASH:\n raise self.DBError('DB genesis hash {} does not match coin {}'\n- .format(state['genesis_hash'],\n+ .format(genesis_hash,\n self.coin.GENESIS_HASH))\n self.db_height = state['height']\n self.db_tx_count = state['tx_count']"
}
] |
electrumx | efe86c67f287b33701dcdb2198f2fef587ea0be1 | 137236712fc82067f74b274643b7bc832dd5a050 | setup.py | https://github.com/Fair-Exchange/electrumx | true | false | false | @@ -11,7 +11,7 @@ setuptools.setup(
# via environment variables, in which case I've tested with 15.0.4
# "x11_hash" package (1.4) is required to sync DASH network.
install_requires=['plyvel', 'pylru', 'irc', 'aiohttp >= 1'],
- packages=setuptools.find_packages(),
+ packages=setuptools.find_packages(exclude=['tests']),
description='ElectrumX Server',
author='Neil Booth',
author_email='[email protected]',
| packages = setuptools . find_packages ( ) , | packages = setuptools . find_packages ( exclude = [ 'tests' ] ) , | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 38, 3, 40], ["keyword_argument", "N0"], 1], ["Insert", "N0", ["identifier:exclude", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["list", "N1"], 2], ["Insert", "N1", ["[:[", "T"], 0], ["Insert", "N1", ["string:'tests'", "T"], 1], ["Insert", "N1", ["]:]", "T"], 2]] | Fair-Exchange/electrumx@efe86c67f287b33701dcdb2198f2fef587ea0be1 | Exclude tests directory from installation
Fixes #223 | [
{
"sha": "9d591a5afae2cbd4aa9673c35a23515cbc9b0c0a",
"filename": "setup.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/efe86c67f287b33701dcdb2198f2fef587ea0be1/setup.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/efe86c67f287b33701dcdb2198f2fef587ea0be1/setup.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/setup.py?ref=efe86c67f287b33701dcdb2198f2fef587ea0be1",
"patch": "@@ -11,7 +11,7 @@\n # via environment variables, in which case I've tested with 15.0.4\n # \"x11_hash\" package (1.4) is required to sync DASH network.\n install_requires=['plyvel', 'pylru', 'irc', 'aiohttp >= 1'],\n- packages=setuptools.find_packages(),\n+ packages=setuptools.find_packages(exclude=['tests']),\n description='ElectrumX Server',\n author='Neil Booth',\n author_email='[email protected]',"
}
] |
electrumx | 09783aeacc3bae679fa599aae14d9bba23260d63 | 2a955a922a42c989924873546d47403a94c8dd91 | server/version.py | https://github.com/Fair-Exchange/electrumx | true | false | false | @@ -1,5 +1,5 @@
# Server name and protocol versions
VERSION = 'ElectrumX 1.0.17'
-PROTOCOL_MIN = '0.10'
+PROTOCOL_MIN = '0.9'
PROTOCOL_MAX = '1.1'
| PROTOCOL_MIN = '0.10' | PROTOCOL_MIN = '0.9' | CHANGE_STRING_LITERAL | [["Update", ["string:'0.10'", 3, 16, 3, 22], "'0.9'"]] | Fair-Exchange/electrumx@09783aeacc3bae679fa599aae14d9bba23260d63 | Accept protocols down to 0.9 for Electrum 1.x clients
Fixes #248 | [
{
"sha": "143a3b228bfc815447e4280386d2715d3447d8e3",
"filename": "server/version.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/Fair-Exchange/electrumx/blob/09783aeacc3bae679fa599aae14d9bba23260d63/server%2Fversion.py",
"raw_url": "https://github.com/Fair-Exchange/electrumx/raw/09783aeacc3bae679fa599aae14d9bba23260d63/server%2Fversion.py",
"contents_url": "https://api.github.com/repos/Fair-Exchange/electrumx/contents/server%2Fversion.py?ref=09783aeacc3bae679fa599aae14d9bba23260d63",
"patch": "@@ -1,5 +1,5 @@\n # Server name and protocol versions\n \n VERSION = 'ElectrumX 1.0.17'\n-PROTOCOL_MIN = '0.10'\n+PROTOCOL_MIN = '0.9'\n PROTOCOL_MAX = '1.1'"
}
] |
visbrain | 3c92656d21014dcfdb6e24925a3ca3bc612392c9 | 4d2d18c3721179fdacfd4da5c8ba51a750e16cb0 | visbrain/io/mneio.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -1,6 +1,6 @@
"""Utility functions for MNE."""
-__all__ = ('mne_switch')
+__all__ = ['mne_switch']
def mne_switch(file, ext, *args, **kwargs):
| __all__ = ( 'mne_switch' ) | __all__ = [ 'mne_switch' ] | SINGLE_STMT | [["Insert", ["assignment", 2, 1, 2, 25], ["list", "N0"], 2], ["Insert", "N0", ["[:[", "T"], 0], ["Move", "N0", ["string:'mne_switch'", 2, 12, 2, 24], 1], ["Insert", "N0", ["]:]", "T"], 2], ["Delete", ["(:(", 2, 11, 2, 12]], ["Delete", ["):)", 2, 24, 2, 25]], ["Delete", ["parenthesized_expression", 2, 11, 2, 25]]] | kdeleeuw11/visbrain@3c92656d21014dcfdb6e24925a3ca3bc612392c9 | Fix mneio __all__ import | [
{
"sha": "cfa56e49d1cd4adb3cd6b9ec1eb18e97e868183b",
"filename": "visbrain/io/mneio.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/3c92656d21014dcfdb6e24925a3ca3bc612392c9/visbrain%2Fio%2Fmneio.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/3c92656d21014dcfdb6e24925a3ca3bc612392c9/visbrain%2Fio%2Fmneio.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fio%2Fmneio.py?ref=3c92656d21014dcfdb6e24925a3ca3bc612392c9",
"patch": "@@ -1,6 +1,6 @@\n \"\"\"Utility functions for MNE.\"\"\"\n \n-__all__ = ('mne_switch')\n+__all__ = ['mne_switch']\n \n \n def mne_switch(file, ext, *args, **kwargs):"
}
] |
visbrain | 4ce5b31ad543e9522f9a378eec2cde147fc8e22a | e51a6fd8d98b349472846406fc385322d9fe3826 | visbrain/io/read_sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -591,7 +591,7 @@ def read_elan(path, downsample):
# Last 2 channels do not contain data
nb_chan_data = nb_chan - 2
- chan_list = slice(nb_chan)
+ chan_list = slice(nb_chan_data)
chan = ent[10:10 + nb_chan_data]
# Gain
| chan_list = slice ( nb_chan ) | chan_list = slice ( nb_chan_data ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:nb_chan", 3, 23, 3, 30], "nb_chan_data"]] | kdeleeuw11/visbrain@4ce5b31ad543e9522f9a378eec2cde147fc8e22a | Fix wrong number of channels for ELAN | [
{
"sha": "624372f5e107de3f449e300f66ba659b792f2fe7",
"filename": "visbrain/io/read_sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4ce5b31ad543e9522f9a378eec2cde147fc8e22a/visbrain%2Fio%2Fread_sleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4ce5b31ad543e9522f9a378eec2cde147fc8e22a/visbrain%2Fio%2Fread_sleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fio%2Fread_sleep.py?ref=4ce5b31ad543e9522f9a378eec2cde147fc8e22a",
"patch": "@@ -591,7 +591,7 @@ def read_elan(path, downsample):\n \n # Last 2 channels do not contain data\n nb_chan_data = nb_chan - 2\n- chan_list = slice(nb_chan)\n+ chan_list = slice(nb_chan_data)\n chan = ent[10:10 + nb_chan_data]\n \n # Gain"
}
] |
visbrain | 2b2139ee9656962a764b1553c724a8317658f507 | a9422f74b9a6c6d31e1f237f9c7221d12e1569e3 | test/test_sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -23,7 +23,7 @@ onset = np.array([100, 2000, 5000])
app = QtWidgets.QApplication([])
sp = Sleep(data=data, channels=channels,
sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,
- annotation_file=onset)
+ annotation=onset)
class TestSleep(object):
| sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotation_file = onset ) | sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotation = onset ) | CHANGE_KEYWORD_ARGUMENT_USED | [["Update", ["identifier:annotation_file", 3, 12, 3, 27], "annotation"]] | kdeleeuw11/visbrain@2b2139ee9656962a764b1553c724a8317658f507 | Fix sleep annotations testing | [
{
"sha": "f6e9dea21f5e0e2399b7c623cc1c6ebd0c3170a5",
"filename": "test/test_sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/2b2139ee9656962a764b1553c724a8317658f507/test%2Ftest_sleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/2b2139ee9656962a764b1553c724a8317658f507/test%2Ftest_sleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_sleep.py?ref=2b2139ee9656962a764b1553c724a8317658f507",
"patch": "@@ -23,7 +23,7 @@\n app = QtWidgets.QApplication([])\n sp = Sleep(data=data, channels=channels,\n sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,\n- annotation_file=onset)\n+ annotation=onset)\n \n \n class TestSleep(object):"
}
] |
visbrain | 1d2034c588eea08329252a04c5eea6e71cc6c5f1 | 672d150ed7b4c10a56fb90c46da3fb6191576cd7 | test/test_sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -23,7 +23,7 @@ onset = np.array([100, 2000, 5000])
app = QtWidgets.QApplication([])
sp = Sleep(data=data, channels=channels,
sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,
- annotation_file=onset)
+ annotation=onset)
class TestSleep(object):
| sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotation_file = onset ) | sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotation = onset ) | CHANGE_KEYWORD_ARGUMENT_USED | [["Update", ["identifier:annotation_file", 3, 12, 3, 27], "annotation"]] | kdeleeuw11/visbrain@1d2034c588eea08329252a04c5eea6e71cc6c5f1 | Fix sleep annotations testing | [
{
"sha": "f6e9dea21f5e0e2399b7c623cc1c6ebd0c3170a5",
"filename": "test/test_sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/1d2034c588eea08329252a04c5eea6e71cc6c5f1/test%2Ftest_sleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/1d2034c588eea08329252a04c5eea6e71cc6c5f1/test%2Ftest_sleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_sleep.py?ref=1d2034c588eea08329252a04c5eea6e71cc6c5f1",
"patch": "@@ -23,7 +23,7 @@\n app = QtWidgets.QApplication([])\n sp = Sleep(data=data, channels=channels,\n sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,\n- annotation_file=onset)\n+ annotation=onset)\n \n \n class TestSleep(object):"
}
] |
visbrain | aea3ff96184ec60d8f349ac357a452a85b5d4e3e | 6a043b37e1d1fd9f67c6ea24add7fad0e4d76386 | test/test_sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -23,7 +23,7 @@ onset = np.array([100, 2000, 5000])
app = QtWidgets.QApplication([])
sp = Sleep(data=data, channels=channels,
sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,
- annotation=onset)
+ annotations=onset)
class TestSleep(object):
| sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotation = onset ) | sp = Sleep ( data = data , channels = channels , sf = sf , downsample = 100. , hypno = hypno , axis = False , hedit = True , annotations = onset ) | CHANGE_KEYWORD_ARGUMENT_USED | [["Update", ["identifier:annotation", 3, 12, 3, 22], "annotations"]] | kdeleeuw11/visbrain@aea3ff96184ec60d8f349ac357a452a85b5d4e3e | Fix test_sleep | [
{
"sha": "4f04661048e9adea8becbb071dacd3a0e3b90713",
"filename": "test/test_sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/aea3ff96184ec60d8f349ac357a452a85b5d4e3e/test%2Ftest_sleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/aea3ff96184ec60d8f349ac357a452a85b5d4e3e/test%2Ftest_sleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_sleep.py?ref=aea3ff96184ec60d8f349ac357a452a85b5d4e3e",
"patch": "@@ -23,7 +23,7 @@\n app = QtWidgets.QApplication([])\n sp = Sleep(data=data, channels=channels,\n sf=sf, downsample=100., hypno=hypno, axis=False, hedit=True,\n- annotation=onset)\n+ annotations=onset)\n \n \n class TestSleep(object):"
}
] |
visbrain | a1e6ba782374aed8e3cf144d2212fe9f7065cb45 | 80144c74c8780d7ab38e12c191a048ac5db2fd4a | visbrain/io/read_sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -73,7 +73,7 @@ class ReadSleepData(object):
raise ValueError("When passing raw data, the sampling "
"frequency parameter, sf, must either be an "
"integer or a float.")
- file = None
+ file = annot = None
offset = datetime.time(0, 0, 0)
dsf, downsample = get_dsf(downsample, sf)
n = data.shape[1]
| file = None | file = annot = None | SINGLE_STMT | [["Insert", ["assignment", 3, 13, 3, 24], ["assignment", "N0"], 2], ["Insert", "N0", ["identifier:annot", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Move", "N0", ["none:None", 3, 20, 3, 24], 2]] | kdeleeuw11/visbrain@a1e6ba782374aed8e3cf144d2212fe9f7065cb45 | Fix annotations for Sleep raw data | [
{
"sha": "e349bb5c071bc9bee138a370168b5d79cb68b9be",
"filename": "visbrain/io/read_sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/a1e6ba782374aed8e3cf144d2212fe9f7065cb45/visbrain%2Fio%2Fread_sleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/a1e6ba782374aed8e3cf144d2212fe9f7065cb45/visbrain%2Fio%2Fread_sleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fio%2Fread_sleep.py?ref=a1e6ba782374aed8e3cf144d2212fe9f7065cb45",
"patch": "@@ -73,7 +73,7 @@ def __init__(self, data, channels, sf, hypno, href, preload, use_mne,\n raise ValueError(\"When passing raw data, the sampling \"\n \"frequency parameter, sf, must either be an \"\n \"integer or a float.\")\n- file = None\n+ file = annot = None\n offset = datetime.time(0, 0, 0)\n dsf, downsample = get_dsf(downsample, sf)\n n = data.shape[1]"
}
] |
visbrain | c269ff1ce14286a35a95fa60089d4f6b89bfdb53 | 91906b6bbc3383af54a172847ba51281dc677322 | visbrain/visuals/PicVisual.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -145,7 +145,7 @@ class PicVisual(visuals.Visual):
# Build the default grid of index :
nr, nc = self.nrows, self.ncols
g = np.arange(nr * nc).reshape(nc, nr)
- g = np.fliplr(np.flipud(g.T))
+ g = np.fliplr(g.T) # np.fliplr(np.flipud(g.T))
# Build indices for one map :
index = np.zeros((2 * (nr - 1) * (nc - 1), 3))
q = 0
| g = np . fliplr ( np . flipud ( g . T ) ) | g = np . fliplr ( g . T ) | SINGLE_STMT | [["Delete", ["(:(", 3, 22, 3, 23]], ["Delete", ["):)", 3, 37, 3, 38]]] | kdeleeuw11/visbrain@c269ff1ce14286a35a95fa60089d4f6b89bfdb53 | Fix wrong picture orientation | [
{
"sha": "b3f66a7cac15e568a30d41b9d2f7d1e81120c9bf",
"filename": "visbrain/visuals/PicVisual.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/c269ff1ce14286a35a95fa60089d4f6b89bfdb53/visbrain%2Fvisuals%2FPicVisual.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/c269ff1ce14286a35a95fa60089d4f6b89bfdb53/visbrain%2Fvisuals%2FPicVisual.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fvisuals%2FPicVisual.py?ref=c269ff1ce14286a35a95fa60089d4f6b89bfdb53",
"patch": "@@ -145,7 +145,7 @@ def _get_index(self):\n # Build the default grid of index :\n nr, nc = self.nrows, self.ncols\n g = np.arange(nr * nc).reshape(nc, nr)\n- g = np.fliplr(np.flipud(g.T))\n+ g = np.fliplr(g.T) # np.fliplr(np.flipud(g.T))\n # Build indices for one map :\n index = np.zeros((2 * (nr - 1) * (nc - 1), 3))\n q = 0"
}
] |
visbrain | 4c46940e6f1f2827e51367c92cba1c37529efcda | 935493f95cf98b3e7afce829e8fe28c22d479121 | test/test_utils.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -739,7 +739,7 @@ class TestHypnoprocessing(object):
def test_sleepstats(self):
"""Test function sleepstats."""
hypno = np.random.randint(-1, 3, (2000,))
- sleepstats(None, hypno, len(hypno), time_window=1.)
+ sleepstats(hypno, 100.)
###############################################################################
###############################################################################
| sleepstats ( None , hypno , len ( hypno ) , time_window = 1. ) | sleepstats ( hypno , 100. ) | SINGLE_STMT | [["Move", [",:,", 3, 24, 3, 25], ["argument_list", 3, 19, 3, 60], 3], ["Insert", ["argument_list", 3, 19, 3, 60], ["float:100.", "T"], 3], ["Move", ["argument_list", 3, 19, 3, 60], ["):)", 3, 42, 3, 43], 4], ["Delete", ["none:None", 3, 20, 3, 24]], ["Delete", [",:,", 3, 31, 3, 32]], ["Delete", ["identifier:len", 3, 33, 3, 36]], ["Delete", ["(:(", 3, 36, 3, 37]], ["Delete", ["identifier:hypno", 3, 37, 3, 42]], ["Delete", ["argument_list", 3, 36, 3, 43]], ["Delete", ["call", 3, 33, 3, 43]], ["Delete", [",:,", 3, 43, 3, 44]], ["Delete", ["identifier:time_window", 3, 45, 3, 56]], ["Delete", ["=:=", 3, 56, 3, 57]], ["Delete", ["float:1.", 3, 57, 3, 59]], ["Delete", ["keyword_argument", 3, 45, 3, 59]], ["Delete", ["):)", 3, 59, 3, 60]]] | kdeleeuw11/visbrain@4c46940e6f1f2827e51367c92cba1c37529efcda | Fix test_sleepstats | [
{
"sha": "bfe3e89dfdfcdf1f4ce9b544e0db64d2b830fab6",
"filename": "test/test_utils.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4c46940e6f1f2827e51367c92cba1c37529efcda/test%2Ftest_utils.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4c46940e6f1f2827e51367c92cba1c37529efcda/test%2Ftest_utils.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_utils.py?ref=4c46940e6f1f2827e51367c92cba1c37529efcda",
"patch": "@@ -739,7 +739,7 @@ def test_transient(self):\n def test_sleepstats(self):\n \"\"\"Test function sleepstats.\"\"\"\n hypno = np.random.randint(-1, 3, (2000,))\n- sleepstats(None, hypno, len(hypno), time_window=1.)\n+ sleepstats(hypno, 100.)\n \n ###############################################################################\n ###############################################################################"
}
] |
visbrain | 679b8ae98fd8988d3cae4274cbf6fdc53679870f | 4385cd874d6190530f4f658344e5b7ed3c82064e | visbrain/visuals/PicVisual.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -145,7 +145,7 @@ class PicVisual(visuals.Visual):
# Build the default grid of index :
nr, nc = self.nrows, self.ncols
g = np.arange(nr * nc).reshape(nc, nr)
- g = np.fliplr(np.flipud(g.T))
+ g = np.fliplr(g.T) # np.fliplr(np.flipud(g.T))
# Build indices for one map :
index = np.zeros((2 * (nr - 1) * (nc - 1), 3))
q = 0
| g = np . fliplr ( np . flipud ( g . T ) ) | g = np . fliplr ( g . T ) | SINGLE_STMT | [["Delete", ["(:(", 3, 22, 3, 23]], ["Delete", ["):)", 3, 37, 3, 38]]] | kdeleeuw11/visbrain@679b8ae98fd8988d3cae4274cbf6fdc53679870f | Fix wrong picture orientation | [
{
"sha": "b3f66a7cac15e568a30d41b9d2f7d1e81120c9bf",
"filename": "visbrain/visuals/PicVisual.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/679b8ae98fd8988d3cae4274cbf6fdc53679870f/visbrain%2Fvisuals%2FPicVisual.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/679b8ae98fd8988d3cae4274cbf6fdc53679870f/visbrain%2Fvisuals%2FPicVisual.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fvisuals%2FPicVisual.py?ref=679b8ae98fd8988d3cae4274cbf6fdc53679870f",
"patch": "@@ -145,7 +145,7 @@ def _get_index(self):\n # Build the default grid of index :\n nr, nc = self.nrows, self.ncols\n g = np.arange(nr * nc).reshape(nc, nr)\n- g = np.fliplr(np.flipud(g.T))\n+ g = np.fliplr(g.T) # np.fliplr(np.flipud(g.T))\n # Build indices for one map :\n index = np.zeros((2 * (nr - 1) * (nc - 1), 3))\n q = 0"
}
] |
visbrain | 932a91cfc7166f5a29dbafb51909fd06f522e5bb | d4c268a12045e531cbb600cd72077f5f90bb76e3 | visbrain/utils/sigproc.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -248,7 +248,7 @@ def averaging(ts, n_window, axis=-1, overlap=0., window='flat'):
# Get axis :
npts = ts.shape[axis]
- axis = npts - 1 if axis == -1 else axis
+ axis = ts.ndim - 1 if axis == -1 else axis
# Get overlap step in samples :
n_overlap = int(np.round(n_window * (1. - overlap)))
| axis = npts - 1 if axis == - 1 else axis | axis = ts . ndim - 1 if axis == - 1 else axis | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 12, 3, 20], ["attribute", "N0"], 0], ["Update", ["identifier:npts", 3, 12, 3, 16], "ts"], ["Move", "N0", ["identifier:npts", 3, 12, 3, 16], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:ndim", "T"], 2]] | kdeleeuw11/visbrain@932a91cfc7166f5a29dbafb51909fd06f522e5bb | Fix axis=-1 for averaging | [
{
"sha": "79b448de888bf7062584b5b4945242cdcb4fe2e7",
"filename": "visbrain/utils/sigproc.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/932a91cfc7166f5a29dbafb51909fd06f522e5bb/visbrain%2Futils%2Fsigproc.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/932a91cfc7166f5a29dbafb51909fd06f522e5bb/visbrain%2Futils%2Fsigproc.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fsigproc.py?ref=932a91cfc7166f5a29dbafb51909fd06f522e5bb",
"patch": "@@ -248,7 +248,7 @@ def averaging(ts, n_window, axis=-1, overlap=0., window='flat'):\n \n # Get axis :\n npts = ts.shape[axis]\n- axis = npts - 1 if axis == -1 else axis\n+ axis = ts.ndim - 1 if axis == -1 else axis\n \n # Get overlap step in samples :\n n_overlap = int(np.round(n_window * (1. - overlap)))"
}
] |
visbrain | ee72e935b4064c61750bf646be717e054216a95f | 36e7f96c9ac1b071d0d31d19b2863b81db596541 | visbrain/signal/ui_elements/ui_init.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -433,7 +433,7 @@ class UiInit(QtWidgets.QMainWindow, Ui_MainWindow, app.Canvas):
self.setupUi(self)
# Canvas creation :
- cargs = {'size': (300, 300)}
+ cargs = {'size': (800, 600)}
self._grid_canvas = VisbrainCanvas(axis=False, name='Grid',
cargs=cargs, **kwargs)
self._signal_canvas = VisbrainCanvas(axis=True, name='Signal',
| cargs = { 'size' : ( 300 , 300 ) } | cargs = { 'size' : ( 800 , 600 ) } | SINGLE_STMT | [["Update", ["integer:300", 3, 27, 3, 30], "800"], ["Update", ["integer:300", 3, 32, 3, 35], "600"]] | kdeleeuw11/visbrain@ee72e935b4064c61750bf646be717e054216a95f | Change default canvas size | [
{
"sha": "99e0651a9cd6c192bdca435d659effca45fa14e5",
"filename": "visbrain/signal/ui_elements/ui_init.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/ee72e935b4064c61750bf646be717e054216a95f/visbrain%2Fsignal%2Fui_elements%2Fui_init.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/ee72e935b4064c61750bf646be717e054216a95f/visbrain%2Fsignal%2Fui_elements%2Fui_init.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsignal%2Fui_elements%2Fui_init.py?ref=ee72e935b4064c61750bf646be717e054216a95f",
"patch": "@@ -433,7 +433,7 @@ def __init__(self, **kwargs):\n self.setupUi(self)\n \n # Canvas creation :\n- cargs = {'size': (300, 300)}\n+ cargs = {'size': (800, 600)}\n self._grid_canvas = VisbrainCanvas(axis=False, name='Grid',\n cargs=cargs, **kwargs)\n self._signal_canvas = VisbrainCanvas(axis=True, name='Signal',"
}
] |
visbrain | 11f7556119042da12e76304347783615b0766d46 | 34dc0e8934c03be245f841c7d91600e700a36e88 | visbrain/sleep/visuals/visuals.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -469,7 +469,7 @@ class Spectrogram(PrepareData):
self.freq = self.tf.freqs
else:
# =================== CONVERSION ===================
- overlap = int(round(overlap * nperseg))
+ overlap = int(round(overlap * sf))
# =================== COMPUTE ===================
# Compute the spectrogram :
| else : overlap = int ( round ( overlap * nperseg ) ) | else : overlap = int ( round ( overlap * sf ) ) | CHANGE_BINARY_OPERAND | [["Update", ["identifier:nperseg", 3, 43, 3, 50], "sf"]] | kdeleeuw11/visbrain@11f7556119042da12e76304347783615b0766d46 | fixed bug overlap scipy spectrogram | [
{
"sha": "101dcbbc1e47eaecde02f3e5ca75a6e7571b0698",
"filename": "visbrain/sleep/visuals/visuals.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/11f7556119042da12e76304347783615b0766d46/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/11f7556119042da12e76304347783615b0766d46/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py?ref=11f7556119042da12e76304347783615b0766d46",
"patch": "@@ -469,7 +469,7 @@ def set_data(self, sf, data, time, cmap='rainbow', nfft=30., overlap=0.,\n self.freq = self.tf.freqs\n else:\n # =================== CONVERSION ===================\n- overlap = int(round(overlap * nperseg))\n+ overlap = int(round(overlap * sf))\n \n # =================== COMPUTE ===================\n # Compute the spectrogram :"
}
] |
visbrain | 21c18ec7e734a722f3d19217d9c57967e74f18e1 | a6f1fcaa695daa58059ff59b12539c38e58e4440 | test/test_brain.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -317,7 +317,7 @@ class TestBrain(object):
try:
vb.screenshot(name, print_size=k, unit=i, dpi=50)
except:
- warn("Screenshot failed for print size" + k + " and unit"
+ warn("Screenshot failed for print size" + str(k) + " and unit"
" " + i + " transparent canvas")
# Test factor :
name = self._path_to_tmp('main_factor.png')
| warn ( "Screenshot failed for print size" + k + " and unit" " " + i + " transparent canvas" ) | warn ( "Screenshot failed for print size" + str ( k ) + " and unit" " " + i + " transparent canvas" ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["binary_operator", 3, 22, 3, 60], ["call", "N0"], 2], ["Insert", "N0", ["identifier:str", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:k", 3, 59, 3, 60], 1], ["Insert", "N1", ["):)", "T"], 2]] | kdeleeuw11/visbrain@21c18ec7e734a722f3d19217d9c57967e74f18e1 | fix warning | [
{
"sha": "b3f1afbcd8ba046d602ec25185366fd7624bc801",
"filename": "test/test_brain.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/21c18ec7e734a722f3d19217d9c57967e74f18e1/test%2Ftest_brain.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/21c18ec7e734a722f3d19217d9c57967e74f18e1/test%2Ftest_brain.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_brain.py?ref=21c18ec7e734a722f3d19217d9c57967e74f18e1",
"patch": "@@ -317,7 +317,7 @@ def test_screenshot(self):\n try:\n vb.screenshot(name, print_size=k, unit=i, dpi=50)\n except:\n- warn(\"Screenshot failed for print size\" + k + \" and unit\"\n+ warn(\"Screenshot failed for print size\" + str(k) + \" and unit\"\n \" \" + i + \" transparent canvas\")\n # Test factor :\n name = self._path_to_tmp('main_factor.png')"
}
] |
visbrain | bbe22ec5e2599594b3dbb7f45c6ac5ee4ce9b044 | 857d833b5e6f225bbb464db2de065f10a15f5257 | visbrain/utils/filtering.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -206,7 +206,7 @@ def morlet_power(x, freqs, sf, norm=True):
def welch_power(x, freqs, sf, window_s=10, norm=True):
- """Compute bandwise-normalized power of data using morlet wavelet.
+ """Compute bandwise-normalized power of data using welch power.
Parameters
----------
| bandwise - normalized power of data using morlet wavelet . Parameters | bandwise - normalized power of data using welch power . Parameters | SINGLE_STMT | [["Update", ["identifier:morlet", 3, 56, 3, 62], "welch"], ["Update", ["identifier:wavelet", 3, 63, 3, 70], "power"]] | kdeleeuw11/visbrain@bbe22ec5e2599594b3dbb7f45c6ac5ee4ce9b044 | Fix welch power doc | [
{
"sha": "ef7307a1082e061d6f092dd2e199a1faf5dcd819",
"filename": "visbrain/utils/filtering.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/bbe22ec5e2599594b3dbb7f45c6ac5ee4ce9b044/visbrain%2Futils%2Ffiltering.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/bbe22ec5e2599594b3dbb7f45c6ac5ee4ce9b044/visbrain%2Futils%2Ffiltering.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Ffiltering.py?ref=bbe22ec5e2599594b3dbb7f45c6ac5ee4ce9b044",
"patch": "@@ -206,7 +206,7 @@ def morlet_power(x, freqs, sf, norm=True):\n \n \n def welch_power(x, freqs, sf, window_s=10, norm=True):\n- \"\"\"Compute bandwise-normalized power of data using morlet wavelet.\n+ \"\"\"Compute bandwise-normalized power of data using welch power.\n \n Parameters\n ----------"
}
] |
visbrain | da3e3ea0bd85a3032cfeb34021da97025b291cab | a0edef4dd1d0408e5783ff07705eb18e0cf89046 | visbrain/utils/filtering.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -231,7 +231,7 @@ def welch_power(x, freqs, sf, window_s=10, norm=True):
sf = int(sf)
freq_spacing = .1
- n_epoch = int(len(x) / (window_s * sf))
+ n_epoch = max(1, int(len(x) / (window_s * sf)))
xpow = np.zeros((len(freqs) - 1, n_epoch), dtype=np.float)
| n_epoch = int ( len ( x ) / ( window_s * sf ) ) | n_epoch = max ( 1 , int ( len ( x ) / ( window_s * sf ) ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 2, 15, 2, 44], ["identifier:max", "T"], 0], ["Insert", ["call", 2, 15, 2, 44], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["integer:1", "T"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Move", "N0", ["call", 2, 15, 2, 44], 3], ["Insert", "N0", ["):)", "T"], 4]] | kdeleeuw11/visbrain@da3e3ea0bd85a3032cfeb34021da97025b291cab | Fix n_epoch if `n_epoch = 0` | [
{
"sha": "56417f3c81e833b4eb11c49d08c1e9fcb0cf5cc6",
"filename": "visbrain/utils/filtering.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/da3e3ea0bd85a3032cfeb34021da97025b291cab/visbrain%2Futils%2Ffiltering.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/da3e3ea0bd85a3032cfeb34021da97025b291cab/visbrain%2Futils%2Ffiltering.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Ffiltering.py?ref=da3e3ea0bd85a3032cfeb34021da97025b291cab",
"patch": "@@ -231,7 +231,7 @@ def welch_power(x, freqs, sf, window_s=10, norm=True):\n \"\"\"\n sf = int(sf)\n freq_spacing = .1\n- n_epoch = int(len(x) / (window_s * sf))\n+ n_epoch = max(1, int(len(x) / (window_s * sf)))\n \n xpow = np.zeros((len(freqs) - 1, n_epoch), dtype=np.float)\n "
}
] |
visbrain | ec1225f9a9a36a45bcfc4c6408608f118f8caf68 | 89d7de95287a455721ec34cf79eca5a0b5d5336d | visbrain/visuals/PicVisual.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -54,7 +54,7 @@ class PicVisual(visuals.Visual):
visuals.Visual.__init__(self, VERT_SHADER, FRAG_SHADER)
# Select pictures :
- if (select is not None) and (len(select) == pos.shape[0]):
+ if isinstance(select, (list, np.ndarray)):
data = data[select, ...]
pos = pos[select, ...]
| if ( select is not None ) and ( len ( select ) == pos . shape [ 0 ] ) : data = data [ select , ... ] pos = pos [ select , ... ] | if isinstance ( select , ( list , np . ndarray ) ) : data = data [ select , ... ] pos = pos [ select , ... ] | SINGLE_STMT | [["Insert", ["if_statement", 3, 9, 5, 35], ["call", "N0"], 1], ["Insert", "N0", ["identifier:isinstance", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Move", "N1", ["(:(", 3, 12, 3, 13], 0], ["Move", "N1", ["identifier:select", 3, 13, 3, 19], 1], ["Insert", "N1", [",:,", "T"], 2], ["Insert", "N1", ["tuple", "N2"], 3], ["Move", "N1", ["):)", 3, 65, 3, 66], 4], ["Move", "N2", ["(:(", 3, 41, 3, 42], 0], ["Update", ["identifier:select", 3, 42, 3, 48], "list"], ["Move", "N2", ["identifier:select", 3, 42, 3, 48], 1], ["Insert", "N2", [",:,", "T"], 2], ["Move", "N2", ["attribute", 3, 53, 3, 62], 3], ["Insert", "N2", ["):)", "T"], 4], ["Update", ["identifier:pos", 3, 53, 3, 56], "np"], ["Update", ["identifier:shape", 3, 57, 3, 62], "ndarray"], ["Delete", ["is:is", 3, 20, 3, 22]], ["Delete", ["not:not", 3, 23, 3, 26]], ["Delete", ["none:None", 3, 27, 3, 31]], ["Delete", ["comparison_operator", 3, 13, 3, 31]], ["Delete", ["):)", 3, 31, 3, 32]], ["Delete", ["parenthesized_expression", 3, 12, 3, 32]], ["Delete", ["and:and", 3, 33, 3, 36]], ["Delete", ["(:(", 3, 37, 3, 38]], ["Delete", ["identifier:len", 3, 38, 3, 41]], ["Delete", ["):)", 3, 48, 3, 49]], ["Delete", ["argument_list", 3, 41, 3, 49]], ["Delete", ["call", 3, 38, 3, 49]], ["Delete", ["==:==", 3, 50, 3, 52]], ["Delete", ["[:[", 3, 62, 3, 63]], ["Delete", ["integer:0", 3, 63, 3, 64]], ["Delete", ["]:]", 3, 64, 3, 65]], ["Delete", ["subscript", 3, 53, 3, 65]], ["Delete", ["comparison_operator", 3, 38, 3, 65]], ["Delete", ["parenthesized_expression", 3, 37, 3, 66]], ["Delete", ["boolean_operator", 3, 12, 3, 66]]] | kdeleeuw11/visbrain@ec1225f9a9a36a45bcfc4c6408608f118f8caf68 | Fix select type for PicVisual | [
{
"sha": "c4485f455431250c242d3a75b8ab9efce45adb93",
"filename": "visbrain/visuals/PicVisual.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/ec1225f9a9a36a45bcfc4c6408608f118f8caf68/visbrain%2Fvisuals%2FPicVisual.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/ec1225f9a9a36a45bcfc4c6408608f118f8caf68/visbrain%2Fvisuals%2FPicVisual.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fvisuals%2FPicVisual.py?ref=ec1225f9a9a36a45bcfc4c6408608f118f8caf68",
"patch": "@@ -54,7 +54,7 @@ def __init__(self, data, pos, width=1., height=1., dxyz=(0., 0., 0.,),\n visuals.Visual.__init__(self, VERT_SHADER, FRAG_SHADER)\n \n # Select pictures :\n- if (select is not None) and (len(select) == pos.shape[0]):\n+ if isinstance(select, (list, np.ndarray)):\n data = data[select, ...]\n pos = pos[select, ...]\n "
}
] |
visbrain | 27930d5ddec98014afc213a60bcf10c3f71bcf1f | bd3e24c5018ac32a9215d00dbbacb6c82906bafa | visbrain/utils/physio.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -345,7 +345,7 @@ def load_predefined_roi(name):
name = name.lower()
assert name in ['brodmann', 'aal', 'talairach']
# Load archive :
- file = os.path.join(*(get_data_path(), 'roi', name + '.npz'))
+ file = get_data_path(folder='roi', file=name + '.npz')
arch = np.load(file)
# Extract informations :
vol, hdr = arch['vol'], arch['hdr']
| file = os . path . join ( * ( get_data_path ( ) , 'roi' , name + '.npz' ) ) | file = get_data_path ( folder = 'roi' , file = name + '.npz' ) | SINGLE_STMT | [["Update", ["identifier:os", 3, 12, 3, 14], "get_data_path"], ["Move", ["call", 3, 12, 3, 66], ["identifier:os", 3, 12, 3, 14], 0], ["Insert", ["argument_list", 3, 24, 3, 66], ["keyword_argument", "N0"], 1], ["Move", ["argument_list", 3, 24, 3, 66], [",:,", 3, 42, 3, 43], 2], ["Insert", ["argument_list", 3, 24, 3, 66], ["keyword_argument", "N1"], 3], ["Move", ["argument_list", 3, 24, 3, 66], ["):)", 3, 64, 3, 65], 4], ["Update", ["identifier:get_data_path", 3, 27, 3, 40], "folder"], ["Move", "N0", ["identifier:get_data_path", 3, 27, 3, 40], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["string:'roi'", "T"], 2], ["Insert", "N1", ["identifier:file", "T"], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Move", "N1", ["binary_operator", 3, 51, 3, 64], 2], ["Delete", [".:.", 3, 14, 3, 15]], ["Delete", ["identifier:path", 3, 15, 3, 19]], ["Delete", ["attribute", 3, 12, 3, 19]], ["Delete", [".:.", 3, 19, 3, 20]], ["Delete", ["identifier:join", 3, 20, 3, 24]], ["Delete", ["attribute", 3, 12, 3, 24]], ["Delete", ["*:*", 3, 25, 3, 26]], ["Delete", ["(:(", 3, 26, 3, 27]], ["Delete", ["(:(", 3, 40, 3, 41]], ["Delete", ["):)", 3, 41, 3, 42]], ["Delete", ["argument_list", 3, 40, 3, 42]], ["Delete", ["call", 3, 27, 3, 42]], ["Delete", ["string:'roi'", 3, 44, 3, 49]], ["Delete", [",:,", 3, 49, 3, 50]], ["Delete", ["tuple", 3, 26, 3, 65]], ["Delete", ["list_splat", 3, 25, 3, 65]], ["Delete", ["):)", 3, 65, 3, 66]]] | kdeleeuw11/visbrain@27930d5ddec98014afc213a60bcf10c3f71bcf1f | Fix get_data_path in physio | [
{
"sha": "5846da881fccd31219420260dc5f89bddf7b6903",
"filename": "visbrain/utils/physio.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/27930d5ddec98014afc213a60bcf10c3f71bcf1f/visbrain%2Futils%2Fphysio.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/27930d5ddec98014afc213a60bcf10c3f71bcf1f/visbrain%2Futils%2Fphysio.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fphysio.py?ref=27930d5ddec98014afc213a60bcf10c3f71bcf1f",
"patch": "@@ -345,7 +345,7 @@ def load_predefined_roi(name):\n name = name.lower()\n assert name in ['brodmann', 'aal', 'talairach']\n # Load archive :\n- file = os.path.join(*(get_data_path(), 'roi', name + '.npz'))\n+ file = get_data_path(folder='roi', file=name + '.npz')\n arch = np.load(file)\n # Extract informations :\n vol, hdr = arch['vol'], arch['hdr']"
}
] |
visbrain | 116f89f671904ab26e3a096f68646f661da8ee3b | 471c5c6bc063b5f8ab164d696ea59d90ceba11fe | visbrain/objects/visbrain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -41,7 +41,7 @@ class VisbrainObject(object):
"""Return the object name."""
return self._name
- def preview(self, bgcolor='white', axis=True, show=True):
+ def preview(self, bgcolor='white', axis=False, show=True):
| def preview ( self , bgcolor = 'white' , axis = True , show = True ) : | def preview ( self , bgcolor = 'white' , axis = False , show = True ) : | CHANGE_BOOLEAN_LITERAL | [["Insert", ["default_parameter", 3, 40, 3, 49], ["false:False", "T"], 2], ["Delete", ["true:True", 3, 45, 3, 49]]] | kdeleeuw11/visbrain@116f89f671904ab26e3a096f68646f661da8ee3b | By default hide axis on preview | [
{
"sha": "9b8c46da096aad4ecc019abcff0a1b850754c1fc",
"filename": "visbrain/objects/visbrain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/116f89f671904ab26e3a096f68646f661da8ee3b/visbrain%2Fobjects%2Fvisbrain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/116f89f671904ab26e3a096f68646f661da8ee3b/visbrain%2Fobjects%2Fvisbrain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fvisbrain_obj.py?ref=116f89f671904ab26e3a096f68646f661da8ee3b",
"patch": "@@ -41,7 +41,7 @@ def __str__(self):\n \"\"\"Return the object name.\"\"\"\n return self._name\n \n- def preview(self, bgcolor='white', axis=True, show=True):\n+ def preview(self, bgcolor='white', axis=False, show=True):\n \"\"\"Previsualize the result.\n \n Parameters"
}
] |
visbrain | 7d7d89c8f9f0ae56afe38ff0e9548c62f5b51501 | c3d4c43cd9b10fda244f265eff1f1b3a52b00583 | visbrain/io/download.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -124,7 +124,7 @@ def download_file(name, filename=None, to_path=None, unzip=False,
return path_to_file
-def path_to_visbrain_data(folder=None, file=None):
+def path_to_visbrain_data(file=None, folder=None):
| def path_to_visbrain_data ( folder = None , file = None ) : | def path_to_visbrain_data ( file = None , folder = None ) : | SINGLE_STMT | [["Move", ["default_parameter", 3, 27, 3, 38], ["parameters", 3, 26, 3, 50], 2], ["Move", ["default_parameter", 3, 40, 3, 49], ["parameters", 3, 26, 3, 50], 1]] | kdeleeuw11/visbrain@7d7d89c8f9f0ae56afe38ff0e9548c62f5b51501 | Fix folder // file in path_to_visbrain_data | [
{
"sha": "dc44e22060472b81e932f68f404248f809eeb39f",
"filename": "visbrain/io/download.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/7d7d89c8f9f0ae56afe38ff0e9548c62f5b51501/visbrain%2Fio%2Fdownload.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/7d7d89c8f9f0ae56afe38ff0e9548c62f5b51501/visbrain%2Fio%2Fdownload.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fio%2Fdownload.py?ref=7d7d89c8f9f0ae56afe38ff0e9548c62f5b51501",
"patch": "@@ -124,7 +124,7 @@ def download_file(name, filename=None, to_path=None, unzip=False,\n return path_to_file\n \n \n-def path_to_visbrain_data(folder=None, file=None):\n+def path_to_visbrain_data(file=None, folder=None):\n \"\"\"Get the path to the visbrain_data folder.\n \n Parameters"
}
] |
visbrain | 7325c0e70835750d24f730fec7e76bf0f55d9baf | 9dabc40f7a73215c2afa6d834826fc738daf39a0 | test/test_utils.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -613,7 +613,7 @@ class TestOthers(object):
import vispy.visuals.transforms as vist
# Force creation of vertices, faces and normals :
self._creation()
- tup = (self.vertices, self.faces, self.normals)
+ tup = (self.vertices, self.faces)
# Compare (vertices + faces) Vs. MeshData :
mesh1 = convert_meshdata(*tup)
mesh2 = convert_meshdata(meshdata=MeshData(*tup))
| tup = ( self . vertices , self . faces , self . normals ) | tup = ( self . vertices , self . faces ) | SINGLE_STMT | [["Delete", [",:,", 3, 41, 3, 42]], ["Delete", ["identifier:self", 3, 43, 3, 47]], ["Delete", [".:.", 3, 47, 3, 48]], ["Delete", ["identifier:normals", 3, 48, 3, 55]], ["Delete", ["attribute", 3, 43, 3, 55]]] | kdeleeuw11/visbrain@7325c0e70835750d24f730fec7e76bf0f55d9baf | Fix convert_meshdata test | [
{
"sha": "6080fddebef2475b6a842e3ff2be4cf791b520a2",
"filename": "test/test_utils.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/7325c0e70835750d24f730fec7e76bf0f55d9baf/test%2Ftest_utils.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/7325c0e70835750d24f730fec7e76bf0f55d9baf/test%2Ftest_utils.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/test%2Ftest_utils.py?ref=7325c0e70835750d24f730fec7e76bf0f55d9baf",
"patch": "@@ -613,7 +613,7 @@ def test_convert_meshdata(self):\n import vispy.visuals.transforms as vist\n # Force creation of vertices, faces and normals :\n self._creation()\n- tup = (self.vertices, self.faces, self.normals)\n+ tup = (self.vertices, self.faces)\n # Compare (vertices + faces) Vs. MeshData :\n mesh1 = convert_meshdata(*tup)\n mesh2 = convert_meshdata(meshdata=MeshData(*tup))"
}
] |
visbrain | 55c910534164557b55a1e0fe296b2da7221b6f2a | 7325c0e70835750d24f730fec7e76bf0f55d9baf | visbrain/utils/others.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -133,7 +133,7 @@ def convert_meshdata(vertices=None, faces=None, normals=None, meshdata=None,
if meshdata is not None:
vertices = meshdata.get_vertices()
faces = meshdata.get_faces()
- normals = meshdata.get_vertex_normals(indexed='faces')
+ normals = meshdata.get_vertex_normals()
logger.debug('Indexed faces normals converted // extracted')
else:
# Check if faces index start at zero (Matlab like):
| normals = meshdata . get_vertex_normals ( indexed = 'faces' ) | normals = meshdata . get_vertex_normals ( ) | SAME_FUNCTION_LESS_ARGS | [["Delete", ["identifier:indexed", 3, 47, 3, 54]], ["Delete", ["=:=", 3, 54, 3, 55]], ["Delete", ["string:'faces'", 3, 55, 3, 62]], ["Delete", ["keyword_argument", 3, 47, 3, 62]]] | kdeleeuw11/visbrain@55c910534164557b55a1e0fe296b2da7221b6f2a | Fix MeshData in convert_meshdata | [
{
"sha": "58cb7955461e0ca664a8f48bd4438da040491bed",
"filename": "visbrain/utils/others.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/55c910534164557b55a1e0fe296b2da7221b6f2a/visbrain%2Futils%2Fothers.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/55c910534164557b55a1e0fe296b2da7221b6f2a/visbrain%2Futils%2Fothers.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fothers.py?ref=55c910534164557b55a1e0fe296b2da7221b6f2a",
"patch": "@@ -133,7 +133,7 @@ def convert_meshdata(vertices=None, faces=None, normals=None, meshdata=None,\n if meshdata is not None:\n vertices = meshdata.get_vertices()\n faces = meshdata.get_faces()\n- normals = meshdata.get_vertex_normals(indexed='faces')\n+ normals = meshdata.get_vertex_normals()\n logger.debug('Indexed faces normals converted // extracted')\n else:\n # Check if faces index start at zero (Matlab like):"
}
] |