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
209986685325d2ffde609cf885cf84e483ab84e6
a041735626f39d92acb23365d3335b6794fb72bb
queue_processors/autoreduction_processor/post_process_admin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -498,7 +498,7 @@ class PostProcessAdmin: if self.message.overwrite: return append_path(path, ["run-version-0"]) - run_versions = [int(i.split("-")[-1]) for i in glob.glob("run-version-[0-9]*")] + run_versions = [int(i.split("-")[-1]) for i in glob.glob(f"{path}run-version-[0-9]*")] try: return append_path(path, [f"run-version-{max(run_versions) + 1}"]) except ValueError:
run_versions = [ int ( i . split ( "-" ) [ - 1 ] ) for i in glob . glob ( "run-version-[0-9]*" ) ]
run_versions = [ int ( i . split ( "-" ) [ - 1 ] ) for i in glob . glob ( f"{path}run-version-[0-9]*" ) ]
CHANGE_STRING_LITERAL
[["Update", ["string:\"run-version-[0-9]*\"", 2, 66, 2, 86], "f\"{path}run-version-[0-9]*\""]]
ISISScientificComputing/autoreduce@209986685325d2ffde609cf885cf84e483ab84e6
null
null
autoreduce
84eb20f7cc57ab256e358062c53bbd7b81ce2dfa
dbda5e4775ae1e181d81722ab0eda5d140978372
queue_processors/autoreduction_processor/reduction_service.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -189,7 +189,7 @@ def reduce(reduction_dir, temp_dir, datafile, script, run_number, log_stream): except Exception as ex: LOGGER.error("exception caught in reduction script") LOGGER.error(traceback.format_exc()) - with open(temp_dir.script_log(), "a") as target: + with open(temp_dir.script_log, "a") as target: target.writelines(str(ex) + "\n") target.write(traceback.format_exc()) raise ReductionScriptError("Exception in reduction script", ex) from ex
with open ( temp_dir . script_log ( ) , "a" ) as target : target . writelines ( str ( ex ) + "\n" ) target . write ( traceback . format_exc ( ) )
with open ( temp_dir . script_log , "a" ) as target : target . writelines ( str ( ex ) + "\n" ) target . write ( traceback . format_exc ( ) )
SINGLE_STMT
[["Move", ["argument_list", 3, 22, 3, 50], ["attribute", 3, 23, 3, 42], 1], ["Delete", ["(:(", 3, 42, 3, 43]], ["Delete", ["):)", 3, 43, 3, 44]], ["Delete", ["argument_list", 3, 42, 3, 44]], ["Delete", ["call", 3, 23, 3, 44]]]
ISISScientificComputing/autoreduce@84eb20f7cc57ab256e358062c53bbd7b81ce2dfa
null
null
autoreduce
efda067038d78400a82754d20e1e277fc67d2b81
90d7db60c602fc303e07e5fa949823551080daac
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -270,7 +270,7 @@ def run_confirmation(request, run_number, run_version=0): script = ScriptFile(script=script_binary, file_name='reduce.py') script.save() - default_variables = InstrumentVariablesUtils().get_variables_for_run(instrument.name, run_number) + default_variables = reduction_run.run_variables new_variables = [] for default_var in default_variables: form_name = 'var-'
default_variables = InstrumentVariablesUtils ( ) . get_variables_for_run ( instrument . name , run_number )
default_variables = reduction_run . run_variables
SINGLE_STMT
[["Move", ["assignment", 3, 9, 3, 106], ["attribute", 3, 29, 3, 77], 2], ["Update", ["identifier:InstrumentVariablesUtils", 3, 29, 3, 53], "reduction_run"], ["Move", ["attribute", 3, 29, 3, 77], ["identifier:InstrumentVariablesUtils", 3, 29, 3, 53], 0], ["Update", ["identifier:get_variables_for_run", 3, 56, 3, 77], "run_variables"], ["Delete", ["(:(", 3, 53, 3, 54]], ["Delete", ["):)", 3, 54, 3, 55]], ["Delete", ["argument_list", 3, 53, 3, 55]], ["Delete", ["call", 3, 29, 3, 55]], ["Delete", ["(:(", 3, 77, 3, 78]], ["Delete", ["identifier:instrument", 3, 78, 3, 88]], ["Delete", [".:.", 3, 88, 3, 89]], ["Delete", ["identifier:name", 3, 89, 3, 93]], ["Delete", ["attribute", 3, 78, 3, 93]], ["Delete", [",:,", 3, 93, 3, 94]], ["Delete", ["identifier:run_number", 3, 95, 3, 105]], ["Delete", ["):)", 3, 105, 3, 106]], ["Delete", ["argument_list", 3, 77, 3, 106]], ["Delete", ["call", 3, 29, 3, 106]]]
ISISScientificComputing/autoreduce@efda067038d78400a82754d20e1e277fc67d2b81
null
null
autoreduce
c2870840eac6a1537478647916b5bf934e7b0deb
a80d399038979b768e289aabf20bacb21a842bbf
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -82,7 +82,7 @@ def run_list(request): experiments = icat.get_valid_experiments_for_instruments(int(request.user.username), instrument_names) owned_instruments = icat.get_owned_instruments(int(request.user.username)) for instrument_name in instrument_names: - instrument = Instrument.objects.filter(name=instrument) + instrument = Instrument.objects.filter(name=instrument_name) if not instrument: continue instrument_queued_runs = 0
instrument = Instrument . objects . filter ( name = instrument )
instrument = Instrument . objects . filter ( name = instrument_name )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:instrument", 3, 53, 3, 63], "instrument_name"]]
ISISScientificComputing/autoreduce@c2870840eac6a1537478647916b5bf934e7b0deb
null
null
autoreduce
004d112c5dec2e4ff34b06b774cfd38f8c03a5f5
c7d05fd28e3aa3afb1ea3c99126b2bbfb24d445d
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -117,7 +117,7 @@ class InstrumentVariablesUtils(object): variables = InstrumentVariable.objects.filter(instrument=reduction_run.instrument, experiment_reference=reduction_run.experiment.reference_number) # No experiment-specific variables, lets look for run number if not variables: - variables_run_start = InstrumentVariable.objects.filter(instrument=reduction_run.instrument,start_run__lte=reduction_run.run_number, reference_number=None ).order_by('-start_run').first().start_run + variables_run_start = InstrumentVariable.objects.filter(instrument=reduction_run.instrument,start_run__lte=reduction_run.run_number, experiment_reference__isnull=True ).order_by('-start_run').first().start_run variables = InstrumentVariable.objects.filter(instrument=reduction_run.instrument,start_run=variables_run_start) # Still not found any variables, we better create some if not variables:
variables_run_start = InstrumentVariable . objects . filter ( instrument = reduction_run . instrument , start_run__lte = reduction_run . run_number , reference_number = None ) . order_by ( '-start_run' ) . first ( ) . start_run
variables_run_start = InstrumentVariable . objects . filter ( instrument = reduction_run . instrument , start_run__lte = reduction_run . run_number , experiment_reference__isnull = True ) . order_by ( '-start_run' ) . first ( ) . start_run
SINGLE_STMT
[["Update", ["identifier:reference_number", 3, 146, 3, 162], "experiment_reference__isnull"], ["Insert", ["keyword_argument", 3, 146, 3, 167], ["true:True", "T"], 2], ["Delete", ["none:None", 3, 163, 3, 167]]]
ISISScientificComputing/autoreduce@004d112c5dec2e4ff34b06b774cfd38f8c03a5f5
null
null
autoreduce
f697d6916360d991afd8ed610dc722b6976e465d
004d112c5dec2e4ff34b06b774cfd38f8c03a5f5
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -213,7 +213,7 @@ class ReductionVariablesUtils(object): if not reduction_run: reduction_run = variables.reduction_run.id else: - if reduction_run is not variables.reduction_run.id: + if reduction_run != variables.reduction_run.id: raise Exception("All run variables must be for the same reduction run") # Currently only supports a single script file
if reduction_run is not variables . reduction_run . id : raise Exception ( "All run variables must be for the same reduction run" )
if reduction_run != variables . reduction_run . id : raise Exception ( "All run variables must be for the same reduction run" )
SINGLE_STMT
[["Insert", ["comparison_operator", 3, 20, 3, 67], ["!=:!=", "T"], 1], ["Delete", ["is:is", 3, 34, 3, 36]], ["Delete", ["not:not", 3, 37, 3, 40]]]
ISISScientificComputing/autoreduce@f697d6916360d991afd8ed610dc722b6976e465d
null
null
autoreduce
782edb4a959413ba34737f8cba176ab73fbaa120
5fad8f8b26da809315760f8560d3114f208d5496
autoreduce_webapp/reduction_variables/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -119,7 +119,7 @@ class InstrumentVariablesUtilsTestCase(TestCase): def test_get_current_script_text_successful(self): script_file = os.path.join(REDUCTION_SCRIPT_BASE, 'valid', 'reduce.py') - f = open(reduction_file, 'rb') + f = open(script_file, 'rb') script_binary = f.read() script = InstrumentVariablesUtils().get_current_script_text('valid')
f = open ( reduction_file , 'rb' )
f = open ( script_file , 'rb' )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:reduction_file", 3, 18, 3, 32], "script_file"]]
ISISScientificComputing/autoreduce@782edb4a959413ba34737f8cba176ab73fbaa120
null
null
autoreduce
fb146ee60996ebda040ec2470ad58fc1579a42a0
1a220e90ffd39df5dead8b2b7e0904f6e383b803
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -193,7 +193,7 @@ class InstrumentVariablesUtils(object): - instrument = InstrumentUtils().get_instrument(name=instrument_name) + instrument = InstrumentUtils().get_instrument(instrument_name) completed_status = StatusUtils().get_completed() # Get latest run number and latest experiment reference
instrument = InstrumentUtils ( ) . get_instrument ( name = instrument_name )
instrument = InstrumentUtils ( ) . get_instrument ( instrument_name )
SINGLE_STMT
[["Move", ["argument_list", 0, 54, 0, 76], ["identifier:instrument_name", 0, 60, 0, 75], 1], ["Delete", ["identifier:name", 0, 55, 0, 59]], ["Delete", ["=:=", 0, 59, 0, 60]], ["Delete", ["keyword_argument", 0, 55, 0, 75]]]
ISISScientificComputing/autoreduce@fb146ee60996ebda040ec2470ad58fc1579a42a0
null
null
autoreduce
d154a2949651210137f0488e921fd6e0666c34a5
7ad89abf71a36f4a477068ffdc89164b17d9b359
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -143,7 +143,7 @@ class InstrumentVariablesUtils(object): variables = InstrumentVariable.objects.filter(instrument=reduction_run.instrument,start_run=variables_run_start) except AttributeError: # Still not found any variables, we better create some - variables = self.set_default_instrument_variables(reduction_run.instrument) + variables = self.set_default_instrument_variables(reduction_run.instrument.name) return variables def get_current_script_text(self, instrument_name):
AttributeError : variables = self . set_default_instrument_variables ( reduction_run . instrument )
AttributeError : variables = self . set_default_instrument_variables ( reduction_run . instrument . name )
ADD_ATTRIBUTE_ACCESS
[["Move", ["attribute", 3, 67, 3, 91], ["attribute", 3, 67, 3, 91], 0], ["Insert", ["attribute", 3, 67, 3, 91], [".:.", "T"], 1], ["Insert", ["attribute", 3, 67, 3, 91], ["identifier:name", "T"], 2]]
ISISScientificComputing/autoreduce@d154a2949651210137f0488e921fd6e0666c34a5
null
null
autoreduce
53cd2b760664fc43b2756394abbac7d1efb17bc6
d154a2949651210137f0488e921fd6e0666c34a5
autoreduce_webapp/reduction_variables/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -148,7 +148,7 @@ class InstrumentVariablesUtilsTestCase(TestCase): self.assertEqual(len(variables), len(saved_variables), "Expecting all returned variables to have been saved") def test_set_default_instrument_variables_no_start_run(self): - variables = InstrumentVariablesUtils().set_default_instrument_variables("valid") + variables = InstrumentVariablesUtils().set_default_instrument_variables("valid", None) self.assertNotEqual(variables, None, 'Expecting some variables returned') self.assertNotEqual(variables, [], 'Expecting some variables returned')
variables = InstrumentVariablesUtils ( ) . set_default_instrument_variables ( "valid" )
variables = InstrumentVariablesUtils ( ) . set_default_instrument_variables ( "valid" , None )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 80, 3, 89], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 80, 3, 89], ["none:None", "T"], 3]]
ISISScientificComputing/autoreduce@53cd2b760664fc43b2756394abbac7d1efb17bc6
null
null
autoreduce
8b57a4546a4b1b4f53600e46c84bbd8afc06f753
57c87b6a8f9bda1b10a765fd53734fed65b9db9d
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -52,7 +52,7 @@ class VariableUtils(object): if '.' in str(value): return float(value) else: - return re.sub("[^0-9]+", "", value) + return int(re.sub("[^0-9]+", "", str(value))) if var_type == "list_text": var_list = str(value).split(',') list_text = []
return re . sub ( "[^0-9]+" , "" , value )
return int ( re . sub ( "[^0-9]+" , "" , str ( value ) ) )
SINGLE_STMT
[["Insert", ["call", 3, 24, 3, 52], ["identifier:int", "T"], 0], ["Insert", ["call", 3, 24, 3, 52], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["call", "N1"], 1], ["Insert", "N0", ["):)", "T"], 2], ["Move", "N1", ["attribute", 3, 24, 3, 30], 0], ["Move", "N1", ["argument_list", 3, 30, 3, 52], 1], ["Insert", ["argument_list", 3, 30, 3, 52], ["call", "N2"], 5], ["Insert", ["argument_list", 3, 30, 3, 52], ["):)", "T"], 6], ["Insert", "N2", ["identifier:str", "T"], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Insert", "N3", ["(:(", "T"], 0], ["Move", "N3", ["identifier:value", 3, 46, 3, 51], 1], ["Move", "N3", ["):)", 3, 51, 3, 52], 2]]
ISISScientificComputing/autoreduce@8b57a4546a4b1b4f53600e46c84bbd8afc06f753
null
null
autoreduce
04e43e9af6b7e94433037b4864f0cfdb59d33050
a42d44cdc2eabd16006570b80721719b6a1ecaa1
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -49,7 +49,7 @@ class VariableUtils(object): if var_type == "text": return str(value) if var_type == "number": - if not value: + if not value or not re.match('[0-9]+', str(value)): return None if '.' in str(value): return float(value)
if not value : return None
if not value or not re . match ( '[0-9]+' , str ( value ) ) : return None
LESS_SPECIFIC_IF
[["Insert", ["not_operator", 3, 16, 3, 25], ["boolean_operator", "N0"], 1], ["Move", "N0", ["identifier:value", 3, 20, 3, 25], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["not_operator", "N1"], 2], ["Insert", "N1", ["not:not", "T"], 0], ["Insert", "N1", ["call", "N2"], 1], ["Insert", "N2", ["attribute", "N3"], 0], ["Insert", "N2", ["argument_list", "N4"], 1], ["Insert", "N3", ["identifier:re", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:match", "T"], 2], ["Insert", "N4", ["(:(", "T"], 0], ["Insert", "N4", ["string:'[0-9]+'", "T"], 1], ["Insert", "N4", [",:,", "T"], 2], ["Insert", "N4", ["call", "N5"], 3], ["Insert", "N4", ["):)", "T"], 4], ["Insert", "N5", ["identifier:str", "T"], 0], ["Insert", "N5", ["argument_list", "N6"], 1], ["Insert", "N6", ["(:(", "T"], 0], ["Insert", "N6", ["identifier:value", "T"], 1], ["Insert", "N6", ["):)", "T"], 2]]
ISISScientificComputing/autoreduce@04e43e9af6b7e94433037b4864f0cfdb59d33050
null
null
autoreduce
44d5f4bba87ab8076af6a953597c387caa7c1c1f
dc68d30085b368d37f220c1c9b4dfc2fee0418f8
autoreduce_webapp/reduction_variables/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -596,7 +596,7 @@ class ReductionVariablesUtilsTestCase(TestCase): self.assertTrue('advanced_vars' in arguments, "Expecting arguments to have a 'advanced_vars' key.") self.assertEqual(arguments['standard_vars']['test'], 'testvalue1', "Expecting to find testvalue1 in standard_vars.") self.assertTrue("reduction_script_temp" in script_path, "Expecting script_path to point to 'reduction_script_temp'.") - self.assertTrue(re.match('\w{8}-\w{4}-\w{4}-\w{13}\.py$', script_path), "Expecting script_path to contain a uuid filename.") + self.assertTrue(re.match('\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$', script_path), "Expecting script_path to contain a uuid filename but was %s." % script_path) def test_get_script_path_and_arguments_empty(self): with self.assertRaises(Exception) as e:
self . assertTrue ( re . match ( '\w{8}-\w{4}-\w{4}-\w{13}\.py$' , script_path ) , "Expecting script_path to contain a uuid filename." )
self . assertTrue ( re . match ( '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$' , script_path ) , "Expecting script_path to contain a uuid filename but was %s." % script_path )
SINGLE_STMT
[["Insert", ["argument_list", 3, 24, 3, 133], ["binary_operator", "N0"], 3], ["Update", ["string:\"Expecting script_path to contain a uuid filename.\"", 3, 81, 3, 132], "\"Expecting script_path to contain a uuid filename but was %s.\""], ["Move", "N0", ["string:\"Expecting script_path to contain a uuid filename.\"", 3, 81, 3, 132], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Insert", "N0", ["identifier:script_path", "T"], 2], ["Update", ["string:'\\w{8}-\\w{4}-\\w{4}-\\w{13}\\.py$'", 3, 34, 3, 65], "'\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}\\.py$'"]]
ISISScientificComputing/autoreduce@44d5f4bba87ab8076af6a953597c387caa7c1c1f
null
null
autoreduce
112b6320b77916d06887cc00c7ba7ce2022ab4f9
44d5f4bba87ab8076af6a953597c387caa7c1c1f
autoreduce_webapp/reduction_variables/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -596,7 +596,7 @@ class ReductionVariablesUtilsTestCase(TestCase): self.assertTrue('advanced_vars' in arguments, "Expecting arguments to have a 'advanced_vars' key.") self.assertEqual(arguments['standard_vars']['test'], 'testvalue1', "Expecting to find testvalue1 in standard_vars.") self.assertTrue("reduction_script_temp" in script_path, "Expecting script_path to point to 'reduction_script_temp'.") - self.assertTrue(re.match('\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$', script_path), "Expecting script_path to contain a uuid filename but was %s." % script_path) + self.assertTrue(re.search('(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$', script_path), "Expecting script_path to contain a uuid filename but was %s." % script_path) def test_get_script_path_and_arguments_empty(self): with self.assertRaises(Exception) as e:
self . assertTrue ( re . match ( '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$' , script_path ) , "Expecting script_path to contain a uuid filename but was %s." % script_path )
self . assertTrue ( re . search ( '(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$' , script_path ) , "Expecting script_path to contain a uuid filename but was %s." % script_path )
SINGLE_STMT
[["Update", ["identifier:match", 3, 28, 3, 33], "search"], ["Update", ["string:'\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}\\.py$'", 3, 34, 3, 71], "'(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}\\.py$'"]]
ISISScientificComputing/autoreduce@112b6320b77916d06887cc00c7ba7ce2022ab4f9
null
null
autoreduce
c113fa2067c927d31c4928249b6b0b5baa409bfb
112b6320b77916d06887cc00c7ba7ce2022ab4f9
autoreduce_webapp/reduction_variables/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -596,7 +596,7 @@ class ReductionVariablesUtilsTestCase(TestCase): self.assertTrue('advanced_vars' in arguments, "Expecting arguments to have a 'advanced_vars' key.") self.assertEqual(arguments['standard_vars']['test'], 'testvalue1', "Expecting to find testvalue1 in standard_vars.") self.assertTrue("reduction_script_temp" in script_path, "Expecting script_path to point to 'reduction_script_temp'.") - self.assertTrue(re.search('(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$', script_path), "Expecting script_path to contain a uuid filename but was %s." % script_path) + self.assertTrue(re.search('(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$)', script_path), "Expecting script_path to contain a uuid filename but was %s." % script_path) def test_get_script_path_and_arguments_empty(self): with self.assertRaises(Exception) as e:
self . assertTrue ( re . search ( '(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$' , script_path ) , "Expecting script_path to contain a uuid filename but was %s." % script_path )
self . assertTrue ( re . search ( '(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\.py$)' , script_path ) , "Expecting script_path to contain a uuid filename but was %s." % script_path )
CHANGE_STRING_LITERAL
[["Update", ["string:'(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}\\.py$'", 3, 35, 3, 73], "'(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}\\.py$)'"]]
ISISScientificComputing/autoreduce@c113fa2067c927d31c4928249b6b0b5baa409bfb
null
null
autoreduce
42b6f68c9ae882ce53c0a55c59658400cb2bfb15
19896659326c8e235b74a6eba0438fe2197d2257
autoreduce_webapp/autoreduce_webapp/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -311,7 +311,7 @@ class QueueProcessorTestCase(TestCase): parent.assertNotEqual(data_dict['reduction_script'], '', "Expecting a reduction script.") parent.assertEqual(data_dict['reduction_arguments'], {}, "Expecting arguments to be an empty dictionary.") - listener = Listener(mock_client) + listener = Listener(mock_client()) listener.on_message(headers, json.dumps(message)) self.assertTrue(send_called[0], "Expecting send to be called")
listener = Listener ( mock_client )
listener = Listener ( mock_client ( ) )
SINGLE_STMT
[["Insert", ["argument_list", 3, 28, 3, 41], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 28, 3, 41], ["):)", "T"], 2], ["Move", "N0", ["identifier:mock_client", 3, 29, 3, 40], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["):)", 3, 40, 3, 41], 1]]
ISISScientificComputing/autoreduce@42b6f68c9ae882ce53c0a55c59658400cb2bfb15
null
null
autoreduce
8420daa96ec291e5d8173668e43b67fcb92ba203
ba614e177939b166c79b4536d1589e3c174b7feb
autoreduce_webapp/autoreduce_webapp/tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -273,7 +273,7 @@ class QueueProcessorTestCase(TestCase): def test_data_ready_no_vaiables_in_script(self): rb_number = self.get_rb_number() - instrument_name = "test_data_ready_multiple_runs-TestInstrument" + instrument_name = "test_data_ready_no_vaiables_in_script-TestInstrument" directory = os.path.join(REDUCTION_SCRIPT_BASE, instrument_name) test_reduce = os.path.join(os.path.dirname(__file__), '../', 'test_files','empty_reduce.py')
instrument_name = "test_data_ready_multiple_runs-TestInstrument"
instrument_name = "test_data_ready_no_vaiables_in_script-TestInstrument"
CHANGE_STRING_LITERAL
[["Update", ["string:\"test_data_ready_multiple_runs-TestInstrument\"", 3, 27, 3, 73], "\"test_data_ready_no_vaiables_in_script-TestInstrument\""]]
ISISScientificComputing/autoreduce@8420daa96ec291e5d8173668e43b67fcb92ba203
null
null
autoreduce
93eac6fed691988988326dccb60ff73a729c1182
e56c8ab7025e9106167594100b5d29eda74f41a4
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -377,7 +377,7 @@ class ScriptUtils(object): def get_reduce_scripts(self, scripts): script_binary = None script_vars_binary = None - for script in run_variables[0].scripts.all(): + for script in scripts: if script.file_name == "reduce.py": script_binary = script.script elif script.file_name == "reduce_vars.py":
for script in run_variables [ 0 ] . scripts . all ( ) : if script . file_name == "reduce.py" : script_binary = script . script elif script . file_name == "reduce_vars.py" :
for script in scripts : if script . file_name == "reduce.py" : script_binary = script . script elif script . file_name == "reduce_vars.py" :
SINGLE_STMT
[["Move", ["for_statement", 3, 9, 6, 55], ["identifier:scripts", 3, 40, 3, 47], 3], ["Delete", ["identifier:run_variables", 3, 23, 3, 36]], ["Delete", ["[:[", 3, 36, 3, 37]], ["Delete", ["integer:0", 3, 37, 3, 38]], ["Delete", ["]:]", 3, 38, 3, 39]], ["Delete", ["subscript", 3, 23, 3, 39]], ["Delete", [".:.", 3, 39, 3, 40]], ["Delete", ["attribute", 3, 23, 3, 47]], ["Delete", [".:.", 3, 47, 3, 48]], ["Delete", ["identifier:all", 3, 48, 3, 51]], ["Delete", ["attribute", 3, 23, 3, 51]], ["Delete", ["(:(", 3, 51, 3, 52]], ["Delete", ["):)", 3, 52, 3, 53]], ["Delete", ["argument_list", 3, 51, 3, 53]], ["Delete", ["call", 3, 23, 3, 53]]]
ISISScientificComputing/autoreduce@93eac6fed691988988326dccb60ff73a729c1182
null
null
autoreduce
4667aacd4ff4c3d762b8b2f1a8204207e4560fa8
351f316a48c1d5fee510d490a499efb356b89e79
autoreduce_webapp/autoreduce_webapp/queue_processor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -80,7 +80,7 @@ class Listener(object): logging.warning("No instrument variables found on %s for run %s" % (instrument.name, self._data_dict['run_number'])) else: for variables in variables: - reduction_run_variables = RunVariable(name=variables.name, value=variables.value, type=variables.type) + reduction_run_variables = RunVariable(name=variables.name, value=variables.value, type=variables.type, is_advanced=variable.is_advanced) reduction_run_variables.reduction_run = reduction_run reduction_run.run_variables.add(reduction_run_variables) reduction_run_variables.save()
else : for variables in variables : reduction_run_variables = RunVariable ( name = variables . name , value = variables . value , type = variables . type )
else : for variables in variables : reduction_run_variables = RunVariable ( name = variables . name , value = variables . value , type = variables . type , is_advanced = variable . is_advanced )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 58, 3, 123], [",:,", "T"], 6], ["Insert", ["argument_list", 3, 58, 3, 123], ["keyword_argument", "N0"], 7], ["Insert", "N0", ["identifier:is_advanced", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["attribute", "N1"], 2], ["Insert", "N1", ["identifier:variable", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:is_advanced", "T"], 2]]
ISISScientificComputing/autoreduce@4667aacd4ff4c3d762b8b2f1a8204207e4560fa8
null
null
autoreduce
9457bbf6c25180de11dec9b9fe5991628c48a88a
eb0021cdb4985dee46821046e4ec9c1e92c6985c
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -73,7 +73,7 @@ def run_list(request): instruments = [] with ICATCommunication(AUTH='uows',SESSION={'sessionid':request.session.get('sessionid')}) as icat: if request.user.is_superuser: - instrument_names = instrument.objects.values_list('name', flat=true) + instrument_names = Instrument.objects.values_list('name', flat=true) else: instrument_names = icat.get_valid_instruments(int(request.user.username)) owned_instruments = request.session.get('owned_instruments', default=[])
instrument_names = instrument . objects . values_list ( 'name' , flat = true )
instrument_names = Instrument . objects . values_list ( 'name' , flat = true )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:instrument", 3, 32, 3, 42], "Instrument"]]
ISISScientificComputing/autoreduce@9457bbf6c25180de11dec9b9fe5991628c48a88a
null
null
autoreduce
69815b692c7990e7d302c041d316afe3cd760e27
9457bbf6c25180de11dec9b9fe5991628c48a88a
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -73,7 +73,7 @@ def run_list(request): instruments = [] with ICATCommunication(AUTH='uows',SESSION={'sessionid':request.session.get('sessionid')}) as icat: if request.user.is_superuser: - instrument_names = Instrument.objects.values_list('name', flat=true) + instrument_names = Instrument.objects.values_list('name', flat=True) else: instrument_names = icat.get_valid_instruments(int(request.user.username)) owned_instruments = request.session.get('owned_instruments', default=[])
instrument_names = Instrument . objects . values_list ( 'name' , flat = true )
instrument_names = Instrument . objects . values_list ( 'name' , flat = True )
SINGLE_TOKEN
[["Insert", ["keyword_argument", 3, 71, 3, 80], ["true:True", "T"], 2], ["Delete", ["identifier:true", 3, 76, 3, 80]]]
ISISScientificComputing/autoreduce@69815b692c7990e7d302c041d316afe3cd760e27
null
null
autoreduce
5ef74024cba07aad2f516bd3e6cbd3ef64786d09
205fa349c2a1aad9bfcb03f374309ae9035937e2
rpmbuild/autoreduce-mq/usr/bin/PostProcessAdmin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -149,7 +149,7 @@ class PostProcessAdmin: return # specify directory where autoreduction output goes - run_output_dir = TEMP_ROOT_DIRECTORY + instrument_dir[:instrument_dir.find('/'+ self.data['run_number'])+1] + run_output_dir = TEMP_ROOT_DIRECTORY + instrument_dir[:instrument_dir.find('/'+ str(self.data['run_number']))+1] reduce_result_dir = TEMP_ROOT_DIRECTORY + instrument_dir + "/results/" reduce_result_dir_tail_length = len("/results") if not os.path.isdir(reduce_result_dir):
run_output_dir = TEMP_ROOT_DIRECTORY + instrument_dir [ : instrument_dir . find ( '/' + self . data [ 'run_number' ] ) + 1 ]
run_output_dir = TEMP_ROOT_DIRECTORY + instrument_dir [ : instrument_dir . find ( '/' + str ( self . data [ 'run_number' ] ) ) + 1 ]
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["binary_operator", 3, 88, 3, 116], ["call", "N0"], 2], ["Insert", "N0", ["identifier:str", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["subscript", 3, 93, 3, 116], 1], ["Insert", "N1", ["):)", "T"], 2]]
ISISScientificComputing/autoreduce@5ef74024cba07aad2f516bd3e6cbd3ef64786d09
null
null
autoreduce
89769e28fa80959015bf4fc5323424a94509e555
904087f6085de084930f560c1e0d5c80651ad4f9
rpmbuild/autoreduce-mq/usr/bin/queueProcessor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -29,7 +29,7 @@ class Listener(object): self.procList.append(proc) if len(self.procList) > 4: - logger.info("There are " + str(len(self.procList)) + " processors running at the moment, wait for a second") + logger.info("There are " + str(len(self.procList)) + " processes running at the moment, wait for a second") while len(self.procList) > 4: time.sleep(1.0)
logger . info ( "There are " + str ( len ( self . procList ) ) + " processors running at the moment, wait for a second" )
logger . info ( "There are " + str ( len ( self . procList ) ) + " processes running at the moment, wait for a second" )
CHANGE_BINARY_OPERAND
[["Update", ["string:\" processors running at the moment, wait for a second\"", 3, 64, 3, 118], "\" processes running at the moment, wait for a second\""]]
ISISScientificComputing/autoreduce@89769e28fa80959015bf4fc5323424a94509e555
null
null
autoreduce
283d401db6886b615f86925208b705f5828be55a
f42898310ffc5acfa2c35b0398d0bd57d0b96c69
rpmbuild/autoreduce-mq/usr/bin/queueProcessor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -24,7 +24,7 @@ class Listener(object): processNum = 4 #processes allowed to run at one time destination = headers['destination'] - logger.info("Received frame destination: " + destination) + logger.debug("Received frame destination: " + destination) logger.debug("Received frame body (data)" + data) logger.debug("Calling: %s %s %s %s" % ("python", "/usr/bin/PostProcessAdmin.py", destination, data))
logger . info ( "Received frame destination: " + destination )
logger . debug ( "Received frame destination: " + destination )
WRONG_FUNCTION_NAME
[["Update", ["identifier:info", 3, 16, 3, 20], "debug"]]
ISISScientificComputing/autoreduce@283d401db6886b615f86925208b705f5828be55a
null
null
autoreduce
9b01196a1ba27dca8f46d8a2201b4ea07cfb070c
7a617d7dd272a2b9453e9c61f47196ff24e29f12
ISISendOfRunMonitor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -7,7 +7,7 @@ INST_FOLDER = "\\\\isis\inst$\NDX%s\Instrument" DATA_LOC = "\data\cycle_%s\\" SUMMARY_LOC = "\logs\journal\SUMMARY.txt" LAST_RUN_LOC = "\logs\lastrun.txt" -LOG_FILE = "C:\\monitor_log.txt" +LOG_FILE = "xx\\monitor_log.txt" INSTRUMENTS = [{'name': 'LET', 'use_nexus': True}, {'name': 'MERLIN', 'use_nexus': False}, {'name': 'MARI', 'use_nexus': False},
LOG_FILE = "C:\\monitor_log.txt"
LOG_FILE = "xx\\monitor_log.txt"
CHANGE_STRING_LITERAL
[["Update", ["string:\"C:\\\\monitor_log.txt\"", 3, 12, 3, 33], "\"xx\\\\monitor_log.txt\""]]
ISISScientificComputing/autoreduce@9b01196a1ba27dca8f46d8a2201b4ea07cfb070c
null
null
autoreduce
d3453c7708a78699bae1d3b85ab82d885e5a7eb6
3e758cdb922258479d4c066934e62e3764443c6d
rpmbuild/autoreduce-mq/usr/bin/PostProcessAdmin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -173,7 +173,7 @@ class PostProcessAdmin: if not os.path.isdir(reduce_result_dir): os.makedirs(reduce_result_dir) - log_dir = reduce_result_dir + "reduction_log/" + log_dir = reduce_result_dir + "/reduction_log/" if not os.path.exists(log_dir): os.makedirs(log_dir)
log_dir = reduce_result_dir + "reduction_log/"
log_dir = reduce_result_dir + "/reduction_log/"
CHANGE_BINARY_OPERAND
[["Update", ["string:\"reduction_log/\"", 3, 43, 3, 59], "\"/reduction_log/\""]]
ISISScientificComputing/autoreduce@d3453c7708a78699bae1d3b85ab82d885e5a7eb6
null
null
autoreduce
ff0443e32b4ef38ea6ef8021a063d09450efb603
81b24e1f75c1243f63c1dde7e6dae526f67cc0c9
WebApp/autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -61,7 +61,7 @@ def index(request): else: if 'sessionid' in request.session.keys(): authenticated = request.user.is_authenticated \ - and UOWSClient().check_session(request.session['sessionId']) + and UOWSClient().check_session(request.session['sessionid']) if authenticated: if request.GET.get('next'):
else : if 'sessionid' in request . session . keys ( ) : authenticated = request . user . is_authenticated and UOWSClient ( ) . check_session ( request . session [ 'sessionId' ] )
else : if 'sessionid' in request . session . keys ( ) : authenticated = request . user . is_authenticated and UOWSClient ( ) . check_session ( request . session [ 'sessionid' ] )
CHANGE_STRING_LITERAL
[["Update", ["string:'sessionId'", 3, 76, 3, 87], "'sessionid'"]]
ISISScientificComputing/autoreduce@ff0443e32b4ef38ea6ef8021a063d09450efb603
null
null
autoreduce
78227553aa1fc580520dceff77a54e00468055da
5aad464131acefa2c5f750138b72ba9e47f48076
scripts/manual_operations/tests/test_manual_remove.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -150,7 +150,7 @@ class TestManualRemove(unittest.TestCase): self.gem_object_2] self.assertEqual(2, len(self.manual_remove.to_delete['123'])) mock_input.return_value = '1,2' - mock_validate_csv.return_value = (True, [1, 2]) + mock_validate_csv.return_value = (True, ['1', '2']) self.manual_remove.multiple_versions_found('123') # We said to delete version 2 so it should be the only entry for that run number self.assertEqual(2, len(self.manual_remove.to_delete['123']))
mock_validate_csv . return_value = ( True , [ 1 , 2 ] )
mock_validate_csv . return_value = ( True , [ '1' , '2' ] )
SINGLE_STMT
[["Insert", ["list", 3, 49, 3, 55], ["string:'1'", "T"], 1], ["Insert", ["list", 3, 49, 3, 55], ["string:'2'", "T"], 4], ["Delete", ["integer:1", 3, 50, 3, 51]], ["Delete", ["integer:2", 3, 53, 3, 54]]]
ISISScientificComputing/autoreduce@78227553aa1fc580520dceff77a54e00468055da
null
null
autoreduce
015bfc5163d4a208e00f99c1589be1cad98af12b
556cdb19e88f374ad977b2740ed1088daa160e6f
queue_processors/autoreduction_processor/reduction_service.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -190,7 +190,7 @@ def reduce(reduction_dir, temp_dir, datafile, script, run_number): try: log_stream_handler = logging.StreamHandler(log_stream) LOGGER.addHandler(log_stream_handler) - with channels_redirected(temp_dir.script_log, temp_dir.manig_log, log_stream): + with channels_redirected(temp_dir.script_log, temp_dir.mantid_log, log_stream): additional_output_dirs = script.run(datafile, temp_dir) LOGGER.removeHandler(log_stream_handler) except Exception as ex:
with channels_redirected ( temp_dir . script_log , temp_dir . manig_log , log_stream ) : additional_output_dirs = script . run ( datafile , temp_dir )
with channels_redirected ( temp_dir . script_log , temp_dir . mantid_log , log_stream ) : additional_output_dirs = script . run ( datafile , temp_dir )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:manig_log", 3, 64, 3, 73], "mantid_log"]]
ISISScientificComputing/autoreduce@015bfc5163d4a208e00f99c1589be1cad98af12b
null
null
autoreduce
d0c8964b93d1b088c6b0b297db5f5654061e78e9
f019c700d3ca17fb8a9c068a5257b5f936c32b5b
webtests/configuration.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -15,7 +15,7 @@ from shutil import copyfile from utils.project.structure import get_project_root -CONFIG_PATH = Path(get_project_root(), "webtests/confibg.json") +CONFIG_PATH = Path(get_project_root(), "webtests/config.json") TEMP_CONFIG_PATH = Path(get_project_root(), "webtests/temp_config.json")
CONFIG_PATH = Path ( get_project_root ( ) , "webtests/confibg.json" )
CONFIG_PATH = Path ( get_project_root ( ) , "webtests/config.json" )
CHANGE_STRING_LITERAL
[["Update", ["string:\"webtests/confibg.json\"", 3, 40, 3, 63], "\"webtests/config.json\""]]
ISISScientificComputing/autoreduce@d0c8964b93d1b088c6b0b297db5f5654061e78e9
null
null
autoreduce
7161a1e9082ea058555c65ecc1462d35048f1f9f
03fe5fe5a6d56e8aa01745908a61320a50bd6d83
webtests/tests/base_tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -67,7 +67,7 @@ class BaseTestCase(unittest.TestCase): if hasattr(self, '_outcome'): result = self.defaultTestResult() self._feedErrorsToResult(result, self._outcome.errors) - return len(result.failures) > 0 + return len(result.failures) > 0 or len(result.errors) > 0 return False
return len ( result . failures ) > 0
return len ( result . failures ) > 0 or len ( result . errors ) > 0
SINGLE_STMT
[["Insert", ["return_statement", 3, 13, 3, 44], ["boolean_operator", "N0"], 1], ["Move", "N0", ["comparison_operator", 3, 20, 3, 44], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 2], ["Insert", "N1", ["call", "N2"], 0], ["Insert", "N1", [">:>", "T"], 1], ["Insert", "N1", ["integer:0", "T"], 2], ["Insert", "N2", ["identifier:len", "T"], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["attribute", "N4"], 1], ["Insert", "N3", ["):)", "T"], 2], ["Insert", "N4", ["identifier:result", "T"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:errors", "T"], 2]]
ISISScientificComputing/autoreduce@7161a1e9082ea058555c65ecc1462d35048f1f9f
null
null
autoreduce
1691f0b1e4e2f62799bad0a3adf3c7c9c81d8ea8
d4d9a9258c64c54cd7d045c464e82a98e9b47b08
systemtests/test_end_to_end.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -205,7 +205,7 @@ if os.name != 'nt': - remove.remove(instrument, run_number) + remove.remove(instrument, run_number, delete_all_versions=False) @staticmethod def _delete_reduction_directory():
remove . remove ( instrument , run_number )
remove . remove ( instrument , run_number , delete_all_versions = False )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 0, 26, 0, 50], [",:,", "T"], 4], ["Insert", ["argument_list", 0, 26, 0, 50], ["keyword_argument", "N0"], 5], ["Insert", "N0", ["identifier:delete_all_versions", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["false:False", "T"], 2]]
ISISScientificComputing/autoreduce@1691f0b1e4e2f62799bad0a3adf3c7c9c81d8ea8
null
null
autoreduce
fb6acc92bb63c43aae7be78dd0264cfa6eb1ec8d
8850270e604d706d9e17c0faf1eca1e5adfcae8c
plotting/plot_handler.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -115,7 +115,7 @@ class PlotHandler: client = SFTPClient() for plot_file in _existing_plot_files: # Generate paths to data on server and destination on local machine - _server_path = self.server_dir + plot_file + _server_path = f"{self.server_dir}/{plot_file}" _local_path = os.path.join(self.static_graph_dir, plot_file) try:
_server_path = self . server_dir + plot_file
_server_path = f"{self.server_dir}/{plot_file}"
SINGLE_STMT
[["Insert", ["assignment", 3, 17, 3, 59], ["string:f\"{self.server_dir}/{plot_file}\"", "T"], 2], ["Delete", ["identifier:self", 3, 32, 3, 36]], ["Delete", [".:.", 3, 36, 3, 37]], ["Delete", ["identifier:server_dir", 3, 37, 3, 47]], ["Delete", ["attribute", 3, 32, 3, 47]], ["Delete", ["+:+", 3, 48, 3, 49]], ["Delete", ["identifier:plot_file", 3, 50, 3, 59]], ["Delete", ["binary_operator", 3, 32, 3, 59]]]
ISISScientificComputing/autoreduce@fb6acc92bb63c43aae7be78dd0264cfa6eb1ec8d
null
null
autoreduce
d52cd38b83a28a6c2fd45703e1241d886a9307dd
26b0efdcdc221a9af5f8ce48b6f0de38cefaa7fc
queue_processors/queue_processor/handle_message.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -106,7 +106,7 @@ class HandleMessage: raise InvalidStateException("Script text for current instrument is null") # activate instrument if script was found - instrument = self.activate_db_inst(message.instrument) + instrument = self.activate_db_inst(instrument) self.safe_save(reduction_run) # Create a new data location entry which has a foreign key linking it to the current
instrument = self . activate_db_inst ( message . instrument )
instrument = self . activate_db_inst ( instrument )
SINGLE_STMT
[["Move", ["argument_list", 3, 43, 3, 63], ["identifier:instrument", 3, 52, 3, 62], 1], ["Delete", ["identifier:message", 3, 44, 3, 51]], ["Delete", [".:.", 3, 51, 3, 52]], ["Delete", ["attribute", 3, 44, 3, 62]]]
ISISScientificComputing/autoreduce@d52cd38b83a28a6c2fd45703e1241d886a9307dd
null
null
autoreduce
766469c2eb2f61e3df4231699678a1bfcb7e8c1c
b006020195682395ae7c80f79bf288e45dfd9203
queue_processors/queue_processor/reduction_runner/reduction_runner.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -147,7 +147,7 @@ class ReductionRunner: def main(): """ Main method. """ - data, temp_output_file = sys.argv[1:3] # pylint: disable=unbalanced-tuple-unpacking + data, temp_output_file = sys.argv[1], sys.argv[2] try: message = Message() message.populate(data)
data , temp_output_file = sys . argv [ 1 : 3 ]
data , temp_output_file = sys . argv [ 1 ] , sys . argv [ 2 ]
SINGLE_STMT
[["Insert", ["assignment", 3, 5, 3, 43], ["expression_list", "N0"], 2], ["Insert", "N0", ["subscript", "N1"], 0], ["Insert", "N0", [",:,", "T"], 1], ["Insert", "N0", ["subscript", "N2"], 2], ["Move", "N1", ["attribute", 3, 30, 3, 38], 0], ["Move", "N1", ["[:[", 3, 38, 3, 39], 1], ["Move", "N1", ["integer:1", 3, 39, 3, 40], 2], ["Insert", "N1", ["]:]", "T"], 3], ["Insert", "N2", ["attribute", "N3"], 0], ["Insert", "N2", ["[:[", "T"], 1], ["Insert", "N2", ["integer:2", "T"], 2], ["Move", "N2", ["]:]", 3, 42, 3, 43], 3], ["Insert", "N3", ["identifier:sys", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:argv", "T"], 2], ["Delete", [":::", 3, 40, 3, 41]], ["Delete", ["integer:3", 3, 41, 3, 42]], ["Delete", ["slice", 3, 39, 3, 42]], ["Delete", ["subscript", 3, 30, 3, 43]]]
ISISScientificComputing/autoreduce@766469c2eb2f61e3df4231699678a1bfcb7e8c1c
null
null
aetherbot
6ce8476e06c75539acf5bd219d0079b3414527b7
a8342bd37b5faee65753e915949c3162463627b4
plugins/github.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -24,7 +24,7 @@ def issues(text): user = j["user"]["login"] title = j["title"] summary = textutils.truncate(j["body"]) - if j["state"] is "open": + if j["state"] == "open": state = "\x033\x02OPEN\x02\x0f" else: state = "\x034\x02CLOSED\x02\x0f by {}".format(j["closed_by"]["login"])
if j [ "state" ] is "open" : state = "\x033\x02OPEN\x02\x0f" else : state = "\x034\x02CLOSED\x02\x0f by {}" . format ( j [ "closed_by" ] [ "login" ] )
if j [ "state" ] == "open" : state = "\x033\x02OPEN\x02\x0f" else : state = "\x034\x02CLOSED\x02\x0f by {}" . format ( j [ "closed_by" ] [ "login" ] )
CHANGE_BINARY_OPERATOR
[["Insert", ["comparison_operator", 3, 12, 3, 32], ["==:==", "T"], 1], ["Delete", ["is:is", 3, 23, 3, 25]]]
ihatevim/aetherbot@6ce8476e06c75539acf5bd219d0079b3414527b7
Fix github.py state check Made a boo-boo when checking if an issue is open in github.py. This quick commit fixes that.
[ { "sha": "b67cbb4a38ac345c1d49deac5cb14f044cb9011b", "filename": "plugins/github.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/ihatevim/aetherbot/blob/6ce8476e06c75539acf5bd219d0079b3414527b7/plugins%2Fgithub.py", "raw_url": "https://github.com/ihatevim/aetherbot/raw/6ce8476e06c75539acf5bd219d0079b3414527b7/plugins%2Fgithub.py", "contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fgithub.py?ref=6ce8476e06c75539acf5bd219d0079b3414527b7", "patch": "@@ -24,7 +24,7 @@ def issues(text):\n user = j[\"user\"][\"login\"]\n title = j[\"title\"]\n summary = textutils.truncate(j[\"body\"])\n- if j[\"state\"] is \"open\":\n+ if j[\"state\"] == \"open\":\n state = \"\\x033\\x02OPEN\\x02\\x0f\"\n else:\n state = \"\\x034\\x02CLOSED\\x02\\x0f by {}\".format(j[\"closed_by\"][\"login\"])" } ]
aetherbot
3129fb8cd45fe44685492f19d0ef7ba85ab1b409
5a0ee95ca17a574b8f92ef9d648ffe6429b6bdda
cloudbot/core/pluginmanager.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -369,7 +369,7 @@ class PluginManager: try: if sieve.threaded: - result = yield from self.bot.loop.run_in_executor(sieve.function, self.bot, event, hook) + result = yield from self.bot.loop.run_in_executor(None, sieve.function, self.bot, event, hook) else: result = yield from sieve.function(self.bot, event, hook) except Exception:
result = yield from self . bot . loop . run_in_executor ( sieve . function , self . bot , event , hook )
result = yield from self . bot . loop . run_in_executor ( None , sieve . function , self . bot , event , hook )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 2, 66, 2, 105], ["none:None", "T"], 1], ["Insert", ["argument_list", 2, 66, 2, 105], [",:,", "T"], 2]]
ihatevim/aetherbot@3129fb8cd45fe44685492f19d0ef7ba85ab1b409
null
null
95729cui
554b1d40127173cb1297442f9368d24e97885403
babce6027d290b946d81a2a3bbefbbd71a7968e4
main.py
https://github.com/wwyiyi/95729cui
true
false
true
@@ -97,7 +97,7 @@ class ShoppingBot: userInput = raw_input() os.system('clear') - if len(userinput) < 0: + if userInput == None or len(userInput) <= 0: continue # normal flow # If the user wants to exit
if len ( userinput ) < 0 : continue
if userInput == None or len ( userInput ) <= 0 : continue
SINGLE_STMT
[["Insert", ["if_statement", 3, 13, 4, 25], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 0], ["Insert", "N0", ["or:or", "T"], 1], ["Move", "N0", ["comparison_operator", 3, 16, 3, 34], 2], ["Insert", "N1", ["identifier:userInput", "T"], 0], ["Insert", "N1", ["==:==", "T"], 1], ["Insert", "N1", ["none:None", "T"], 2], ["Insert", ["comparison_operator", 3, 16, 3, 34], ["<=:<=", "T"], 1], ["Update", ["identifier:userinput", 3, 20, 3, 29], "userInput"], ["Delete", ["<:<", 3, 31, 3, 32]]]
wwyiyi/95729cui@554b1d40127173cb1297442f9368d24e97885403
fixed zero length input
[ { "sha": "c27c12164bb9becd6bd454a33c6a3eaf288cfd22", "filename": "main.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wwyiyi/95729cui/blob/554b1d40127173cb1297442f9368d24e97885403/main.py", "raw_url": "https://github.com/wwyiyi/95729cui/raw/554b1d40127173cb1297442f9368d24e97885403/main.py", "contents_url": "https://api.github.com/repos/wwyiyi/95729cui/contents/main.py?ref=554b1d40127173cb1297442f9368d24e97885403", "patch": "@@ -97,7 +97,7 @@ def run(self):\n \n userInput = raw_input()\n os.system('clear')\n- if len(userinput) < 0:\n+ if userInput == None or len(userInput) <= 0:\n continue\n # normal flow\n # If the user wants to exit" } ]
95729cui
5e6f1496b7b69f2d3fa22845a6fbd2ededb4395d
554b1d40127173cb1297442f9368d24e97885403
main.py
https://github.com/wwyiyi/95729cui
true
false
true
@@ -60,7 +60,7 @@ class ShoppingBot: print('Bye') def askForQuantity(self, item): - print(colored('We only sell by pounds. How many ' + item.unit + " of " + item.itemName + " do you want?",' blue')) + print(colored('We only sell by pounds. How many ' + item.unit + " of " + item.itemName + " do you want?",'blue')) userInput = raw_input() request = self.ai.text_request() request.lang = 'en' # optional, default value equal 'en'
print ( colored ( 'We only sell by pounds. How many ' + item . unit + " of " + item . itemName + " do you want?" , ' blue' ) )
print ( colored ( 'We only sell by pounds. How many ' + item . unit + " of " + item . itemName + " do you want?" , 'blue' ) )
CHANGE_STRING_LITERAL
[["Update", ["string:' blue'", 3, 114, 3, 121], "'blue'"]]
wwyiyi/95729cui@5e6f1496b7b69f2d3fa22845a6fbd2ededb4395d
fixed another bug
[ { "sha": "ee7a00e118bc6900037762ecc01b5c1708f3f1cb", "filename": "main.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wwyiyi/95729cui/blob/5e6f1496b7b69f2d3fa22845a6fbd2ededb4395d/main.py", "raw_url": "https://github.com/wwyiyi/95729cui/raw/5e6f1496b7b69f2d3fa22845a6fbd2ededb4395d/main.py", "contents_url": "https://api.github.com/repos/wwyiyi/95729cui/contents/main.py?ref=5e6f1496b7b69f2d3fa22845a6fbd2ededb4395d", "patch": "@@ -60,7 +60,7 @@ def displayBye(self):\n print('Bye')\n \n def askForQuantity(self, item):\n- print(colored('We only sell by pounds. How many ' + item.unit + \" of \" + item.itemName + \" do you want?\",' blue'))\n+ print(colored('We only sell by pounds. How many ' + item.unit + \" of \" + item.itemName + \" do you want?\",'blue'))\n userInput = raw_input()\n request = self.ai.text_request()\n request.lang = 'en' # optional, default value equal 'en'" } ]
95729cui
8d87b6e5cdf959083919a2607f8d919688497395
707d556dc7ff2e9836c4d00055663bcdfb0c4793
shoppingCart.py
https://github.com/wwyiyi/95729cui
true
false
true
@@ -23,7 +23,7 @@ class Cart(): print (item + "not in shopping cart! ") return else: - self.items[item.itemName].setQuantity(items[item.itemName].getQuantity() - amount) + self.items[item.itemName].setQuantity(self.items[item.itemName].getQuantity() - amount) return
else : self . items [ item . itemName ] . setQuantity ( items [ item . itemName ] . getQuantity ( ) - amount )
else : self . items [ item . itemName ] . setQuantity ( self . items [ item . itemName ] . getQuantity ( ) - amount )
SINGLE_STMT
[["Insert", ["subscript", 3, 51, 3, 71], ["attribute", "N0"], 0], ["Insert", "N0", ["identifier:self", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Move", "N0", ["identifier:items", 3, 51, 3, 56], 2]]
wwyiyi/95729cui@8d87b6e5cdf959083919a2607f8d919688497395
Fix shoppingCart.py
[ { "sha": "297130c1918b32259f6d4fdfa8cf9e9cd0596c47", "filename": "shoppingCart.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/wwyiyi/95729cui/blob/8d87b6e5cdf959083919a2607f8d919688497395/shoppingCart.py", "raw_url": "https://github.com/wwyiyi/95729cui/raw/8d87b6e5cdf959083919a2607f8d919688497395/shoppingCart.py", "contents_url": "https://api.github.com/repos/wwyiyi/95729cui/contents/shoppingCart.py?ref=8d87b6e5cdf959083919a2607f8d919688497395", "patch": "@@ -23,7 +23,7 @@ def editCart(self,item,amount):\n print (item + \"not in shopping cart! \")\n return \n else:\n- self.items[item.itemName].setQuantity(items[item.itemName].getQuantity() - amount)\n+ self.items[item.itemName].setQuantity(self.items[item.itemName].getQuantity() - amount)\n return\n \n '''" } ]
kivy_media_player
2e57f7a775402266bd380a511f68fbfdb028cecf
2b3f3197eb721c1ea5b261b587261b9bdb33e18d
videocontroller.py
https://github.com/TalhaTZA/kivy_media_player
true
false
true
@@ -24,7 +24,7 @@ class VideoController(FloatLayout): def on_touch_down(self,touch): if self.collide_point(*touch.pos): - if hasattr(self,'animationVB'): + if hasattr(self,'aimationVB'): self.aimationVB.cancel(self.control_bar) self.play_pause.state='normal' return super().on_touch_down(touch) \ No newline at end of file
if hasattr ( self , 'animationVB' ) : self . aimationVB . cancel ( self . control_bar )
if hasattr ( self , 'aimationVB' ) : self . aimationVB . cancel ( self . control_bar )
CHANGE_STRING_LITERAL
[["Update", ["string:'animationVB'", 3, 29, 3, 42], "'aimationVB'"]]
TalhaTZA/kivy_media_player@2e57f7a775402266bd380a511f68fbfdb028cecf
fixed a typo which was causing a bug
[ { "sha": "2b547b12188554be35fcf31ab46939412cceb7ca", "filename": "videocontroller.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/TalhaTZA/kivy_media_player/blob/2e57f7a775402266bd380a511f68fbfdb028cecf/videocontroller.py", "raw_url": "https://github.com/TalhaTZA/kivy_media_player/raw/2e57f7a775402266bd380a511f68fbfdb028cecf/videocontroller.py", "contents_url": "https://api.github.com/repos/TalhaTZA/kivy_media_player/contents/videocontroller.py?ref=2e57f7a775402266bd380a511f68fbfdb028cecf", "patch": "@@ -24,7 +24,7 @@ def on_playing(self,insatnce,value):\n \n def on_touch_down(self,touch):\n if self.collide_point(*touch.pos):\n- if hasattr(self,'animationVB'):\n+ if hasattr(self,'aimationVB'):\n self.aimationVB.cancel(self.control_bar)\n self.play_pause.state='normal'\n return super().on_touch_down(touch)\n\\ No newline at end of file" } ]
builder
6ef88f03edc4d793a1d0718434a9a7c8f2a8344f
efcf018dcf688c7fed43193f884aaf7b2704d9e0
tools/graph.py
https://github.com/gastonfeng/builder
true
false
true
@@ -54,7 +54,7 @@ def process_order(self): if roots: roots.append(self.start) - if clean_tree: + if clean_tree and self.start in self.tree_list and len(self.tree_list[self.start]): one_level_el = self.tree_list[self.start][0][1] base = self.result[one_level_el]['y']# * 2 / (index + 2) else:
if clean_tree : one_level_el = self . tree_list [ self . start ] [ 0 ] [ 1 ] base = self . result [ one_level_el ] [ 'y' ] else :
if clean_tree and self . start in self . tree_list and len ( self . tree_list [ self . start ] ) : one_level_el = self . tree_list [ self . start ] [ 0 ] [ 1 ] base = self . result [ one_level_el ] [ 'y' ] else :
SINGLE_STMT
[["Insert", ["if_statement", 3, 13, 6, 18], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["boolean_operator", "N1"], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Insert", "N0", ["call", "N2"], 2], ["Move", "N1", ["identifier:clean_tree", 3, 16, 3, 26], 0], ["Insert", "N1", ["and:and", "T"], 1], ["Insert", "N1", ["comparison_operator", "N3"], 2], ["Insert", "N2", ["identifier:len", "T"], 0], ["Insert", "N2", ["argument_list", "N4"], 1], ["Insert", "N3", ["attribute", "N5"], 0], ["Insert", "N3", ["in:in", "T"], 1], ["Insert", "N3", ["attribute", "N6"], 2], ["Insert", "N4", ["(:(", "T"], 0], ["Insert", "N4", ["subscript", "N7"], 1], ["Insert", "N4", ["):)", "T"], 2], ["Insert", "N5", ["identifier:self", "T"], 0], ["Insert", "N5", [".:.", "T"], 1], ["Insert", "N5", ["identifier:start", "T"], 2], ["Insert", "N6", ["identifier:self", "T"], 0], ["Insert", "N6", [".:.", "T"], 1], ["Insert", "N6", ["identifier:tree_list", "T"], 2], ["Insert", "N7", ["attribute", "N8"], 0], ["Insert", "N7", ["[:[", "T"], 1], ["Insert", "N7", ["attribute", "N9"], 2], ["Insert", "N7", ["]:]", "T"], 3], ["Insert", "N8", ["identifier:self", "T"], 0], ["Insert", "N8", [".:.", "T"], 1], ["Insert", "N8", ["identifier:tree_list", "T"], 2], ["Insert", "N9", ["identifier:self", "T"], 0], ["Insert", "N9", [".:.", "T"], 1], ["Insert", "N9", ["identifier:start", "T"], 2]]
gastonfeng/builder@6ef88f03edc4d793a1d0718434a9a7c8f2a8344f
graph issues
[ { "sha": "08a183e2c51c13b7a24907af20b1ce857e42ca7c", "filename": "tools/graph.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gastonfeng/builder/blob/6ef88f03edc4d793a1d0718434a9a7c8f2a8344f/tools%2Fgraph.py", "raw_url": "https://github.com/gastonfeng/builder/raw/6ef88f03edc4d793a1d0718434a9a7c8f2a8344f/tools%2Fgraph.py", "contents_url": "https://api.github.com/repos/gastonfeng/builder/contents/tools%2Fgraph.py?ref=6ef88f03edc4d793a1d0718434a9a7c8f2a8344f", "patch": "@@ -54,7 +54,7 @@ def process_order(self):\n \n if roots:\n roots.append(self.start)\n- if clean_tree:\n+ if clean_tree and self.start in self.tree_list and len(self.tree_list[self.start]):\n one_level_el = self.tree_list[self.start][0][1]\n base = self.result[one_level_el]['y']# * 2 / (index + 2)\n else:" } ]
aetherbot
8e545b3a3155d42b196d66b32eb29b7604c1721d
ea39a6fbb96906769cd10d820231724edc9d9dbf
plugins/namegen.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -36,7 +36,7 @@ class NameGenerator(object): for name_part in name_parts: part = random.choice(self.parts[name_part]) - name = name.replace("\{{}\}".format(name_part), part) + name = name.replace("{" + name_part + "}", part) return name
name = name . replace ( "\{{}\}" . format ( name_part ) , part )
name = name . replace ( "{" + name_part + "}" , part )
SINGLE_STMT
[["Insert", ["argument_list", 3, 32, 3, 66], ["binary_operator", "N0"], 1], ["Move", ["argument_list", 3, 32, 3, 66], ["):)", 3, 58, 3, 59], 5], ["Insert", "N0", ["binary_operator", "N1"], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Insert", "N0", ["string:\"}\"", "T"], 2], ["Update", ["string:\"\\{{}\\}\"", 3, 33, 3, 41], "\"{\""], ["Move", "N1", ["string:\"\\{{}\\}\"", 3, 33, 3, 41], 0], ["Insert", "N1", ["+:+", "T"], 1], ["Move", "N1", ["identifier:name_part", 3, 49, 3, 58], 2], ["Delete", [".:.", 3, 41, 3, 42]], ["Delete", ["identifier:format", 3, 42, 3, 48]], ["Delete", ["attribute", 3, 33, 3, 48]], ["Delete", ["(:(", 3, 48, 3, 49]], ["Delete", ["argument_list", 3, 48, 3, 59]], ["Delete", ["call", 3, 33, 3, 59]], ["Delete", ["):)", 3, 65, 3, 66]]]
ihatevim/aetherbot@8e545b3a3155d42b196d66b32eb29b7604c1721d
null
null
aetherbot
cb7f9b736f54ed78f28b2c26cad2db8a457bf05c
ecab6076ea1e85c743078f218b6ed6126233129b
plugins/namegen.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -9,7 +9,7 @@ GEN_DIR = "./plugins/data/name_files/" def get_generator(_json): data = json.loads(_json) return textgen.TextGenerator(data["name"], data["templates"], - data["default_templates"], data["parts"]) + data["parts"], data["default_templates"]) @hook.command(autohelp=False)
return textgen . TextGenerator ( data [ "name" ] , data [ "templates" ] , data [ "default_templates" ] , data [ "parts" ] )
return textgen . TextGenerator ( data [ "name" ] , data [ "templates" ] , data [ "parts" ] , data [ "default_templates" ] )
SAME_FUNCTION_SWAP_ARGS
[["Move", ["subscript", 3, 9, 3, 34], ["argument_list", 2, 33, 3, 50], 6], ["Move", ["subscript", 3, 36, 3, 49], ["argument_list", 2, 33, 3, 50], 5]]
ihatevim/aetherbot@cb7f9b736f54ed78f28b2c26cad2db8a457bf05c
null
null
aetherbot
1bba6262bcfe7b6fe6d2ac87d091e9334dd5a023
d9f613f6f4b8710d055d096c495b8d089a7ac490
plugins/valuesounds.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -10,7 +10,7 @@ def get_sound_info(game, search): except HTTPError as e: return "Error: " + json.loads(e.read())["error"] items = [] - for item in data: + for item in data["items"]: if "music" in game: textsplit = item["text"].split('"') text = ""
for item in data : if "music" in game : textsplit = item [ "text" ] . split ( '"' ) text = ""
for item in data [ "items" ] : if "music" in game : textsplit = item [ "text" ] . split ( '"' ) text = ""
SINGLE_STMT
[["Insert", ["for_statement", 3, 5, 6, 22], ["subscript", "N0"], 3], ["Move", "N0", ["identifier:data", 3, 17, 3, 21], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:\"items\"", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3]]
ihatevim/aetherbot@1bba6262bcfe7b6fe6d2ac87d091e9334dd5a023
null
null
aetherbot
764a74a3eae4550cee34b5f75ff66d04288f1b82
5867cb05c7b533e401cdda8564630ba8f710fc4e
plugins/youtube.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -42,7 +42,7 @@ def get_video_description(video_id): out += ' - \x02%s\x02 views' % format(data['viewCount'], ",d") try: - uploader = http.get_json(base_url + "users/{}?alt=json".format(data["uploader"]))["entry"]["author"]["name"]["$t"] + uploader = http.get_json(base_url + "users/{}?alt=json".format(data["uploader"]))["entry"]["author"][0]["name"]["$t"] except: uploader = data["uploader"]
uploader = http . get_json ( base_url + "users/{}?alt=json" . format ( data [ "uploader" ] ) ) [ "entry" ] [ "author" ] [ "name" ] [ "$t" ]
uploader = http . get_json ( base_url + "users/{}?alt=json" . format ( data [ "uploader" ] ) ) [ "entry" ] [ "author" ] [ 0 ] [ "name" ] [ "$t" ]
SINGLE_STMT
[["Move", ["subscript", 3, 20, 3, 109], ["subscript", 3, 20, 3, 109], 0], ["Insert", ["subscript", 3, 20, 3, 109], ["[:[", "T"], 1], ["Insert", ["subscript", 3, 20, 3, 109], ["integer:0", "T"], 2], ["Insert", ["subscript", 3, 20, 3, 109], ["]:]", "T"], 3]]
ihatevim/aetherbot@764a74a3eae4550cee34b5f75ff66d04288f1b82
Fixed uploader name display for Youtube's new display names
[ { "sha": "4f2675e99520ba341377812dfd299ec6d54f4ed9", "filename": "plugins/youtube.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/ihatevim/aetherbot/blob/764a74a3eae4550cee34b5f75ff66d04288f1b82/plugins%2Fyoutube.py", "raw_url": "https://github.com/ihatevim/aetherbot/raw/764a74a3eae4550cee34b5f75ff66d04288f1b82/plugins%2Fyoutube.py", "contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fyoutube.py?ref=764a74a3eae4550cee34b5f75ff66d04288f1b82", "patch": "@@ -42,7 +42,7 @@ def get_video_description(video_id):\n out += ' - \\x02%s\\x02 views' % format(data['viewCount'], \",d\")\n \n try:\n- uploader = http.get_json(base_url + \"users/{}?alt=json\".format(data[\"uploader\"]))[\"entry\"][\"author\"][\"name\"][\"$t\"]\n+ uploader = http.get_json(base_url + \"users/{}?alt=json\".format(data[\"uploader\"]))[\"entry\"][\"author\"][0][\"name\"][\"$t\"]\n except:\n uploader = data[\"uploader\"]\n " } ]
aetherbot
7474904e974d5b7e8ddfede7ae48135e7a420427
a5d5845faf37621fdffaecbfc130b7d2b5c19b1f
plugins/lmgtfy.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -6,7 +6,7 @@ from util import hook, web, http def lmgtfy(inp): """lmgtfy [phrase] - Posts a google link for the specified phrase""" - link = "http://lmgtfy.com/?q={}".format(http.quote_plus(inp)) + link = u"http://lmgtfy.com/?q={}".format(http.quote_plus(inp)) try: return web.isgd(link)
link = "http://lmgtfy.com/?q={}" . format ( http . quote_plus ( inp ) )
link = u"http://lmgtfy.com/?q={}" . format ( http . quote_plus ( inp ) )
CHANGE_STRING_LITERAL
[["Update", ["string:\"http://lmgtfy.com/?q={}\"", 3, 12, 3, 37], "u\"http://lmgtfy.com/?q={}\""]]
ihatevim/aetherbot@7474904e974d5b7e8ddfede7ae48135e7a420427
null
null
aetherbot
a2c5964438cae968a805270f5fb6ee4e5834e9fd
b6c3a233eb1bc6a45dbdaf5dc42434d197a0b408
core/main.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -32,7 +32,7 @@ class Input(dict): """sends an ctcp to the current channel/user or a specific channel/user""" conn.ctcp(target, ctcp_type, message) - def notice(message, target=chan): + def notice(message, target=user): """sends a notice to the current channel/user or a specific channel/user""" conn.cmd('NOTICE', [target, message])
def notice ( message , target = chan ) : """sends a notice to the current channel/user or a specific channel/user""" conn . cmd ( 'NOTICE' , [ target , message ] )
def notice ( message , target = user ) : """sends a notice to the current channel/user or a specific channel/user""" conn . cmd ( 'NOTICE' , [ target , message ] )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:chan", 3, 36, 3, 40], "user"]]
ihatevim/aetherbot@a2c5964438cae968a805270f5fb6ee4e5834e9fd
Hell hath no fury like an IRC user scorned. (fixed notices)
[ { "sha": "c1746c3fb285b886b030d0167322fd21945e7b44", "filename": "core/main.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/ihatevim/aetherbot/blob/a2c5964438cae968a805270f5fb6ee4e5834e9fd/core%2Fmain.py", "raw_url": "https://github.com/ihatevim/aetherbot/raw/a2c5964438cae968a805270f5fb6ee4e5834e9fd/core%2Fmain.py", "contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=a2c5964438cae968a805270f5fb6ee4e5834e9fd", "patch": "@@ -32,7 +32,7 @@ def ctcp(message, ctcp_type, target=chan):\n \"\"\"sends an ctcp to the current channel/user or a specific channel/user\"\"\"\n conn.ctcp(target, ctcp_type, message)\n \n- def notice(message, target=chan):\n+ def notice(message, target=user):\n \"\"\"sends a notice to the current channel/user or a specific channel/user\"\"\"\n conn.cmd('NOTICE', [target, message])\n " } ]
aetherbot
c9c3fbf67127681a1993b005ffcfed5a6e5d33f8
a2c5964438cae968a805270f5fb6ee4e5834e9fd
core/main.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -32,7 +32,7 @@ class Input(dict): """sends an ctcp to the current channel/user or a specific channel/user""" conn.ctcp(target, ctcp_type, message) - def notice(message, target=user): + def notice(message, target=nick): """sends a notice to the current channel/user or a specific channel/user""" conn.cmd('NOTICE', [target, message])
def notice ( message , target = user ) : """sends a notice to the current channel/user or a specific channel/user""" conn . cmd ( 'NOTICE' , [ target , message ] )
def notice ( message , target = nick ) : """sends a notice to the current channel/user or a specific channel/user""" conn . cmd ( 'NOTICE' , [ target , message ] )
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:user", 3, 36, 3, 40], "nick"]]
ihatevim/aetherbot@c9c3fbf67127681a1993b005ffcfed5a6e5d33f8
properly fixed notices
[ { "sha": "0ff53e4963ae02aeb62d5e8bd3a4e910b9657808", "filename": "core/main.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/ihatevim/aetherbot/blob/c9c3fbf67127681a1993b005ffcfed5a6e5d33f8/core%2Fmain.py", "raw_url": "https://github.com/ihatevim/aetherbot/raw/c9c3fbf67127681a1993b005ffcfed5a6e5d33f8/core%2Fmain.py", "contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=c9c3fbf67127681a1993b005ffcfed5a6e5d33f8", "patch": "@@ -32,7 +32,7 @@ def ctcp(message, ctcp_type, target=chan):\n \"\"\"sends an ctcp to the current channel/user or a specific channel/user\"\"\"\n conn.ctcp(target, ctcp_type, message)\n \n- def notice(message, target=user):\n+ def notice(message, target=nick):\n \"\"\"sends a notice to the current channel/user or a specific channel/user\"\"\"\n conn.cmd('NOTICE', [target, message])\n " } ]
aetherbot
df6e6d93c4377201f28bf00aca500ac0daba324b
d44a6ddb2301eaa0a124410c1591fc99ebf106a6
plugins/geoip.py
https://github.com/ihatevim/aetherbot
true
false
false
@@ -1,5 +1,5 @@ from util import hook, http -from lib import pygeoip +import pygeoip import os.path import json import gzip
from lib import pygeoip
import pygeoip
SINGLE_STMT
[["Insert", ["module", 0, 1, 5, 0], ["import_statement", "N0"], 1], ["Move", "N0", ["import:import", 1, 10, 1, 16], 0], ["Move", "N0", ["dotted_name", 1, 17, 1, 24], 1], ["Delete", ["from:from", 1, 1, 1, 5]], ["Delete", ["identifier:lib", 1, 6, 1, 9]], ["Delete", ["dotted_name", 1, 6, 1, 9]], ["Delete", ["import_from_statement", 1, 1, 1, 24]]]
ihatevim/aetherbot@df6e6d93c4377201f28bf00aca500ac0daba324b
null
null
aetherbot
05782766e9e61dacbe0874735bff4b734552a265
853b4b7db80bdf403fce9a73e96847fafa365220
core/main.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -22,7 +22,7 @@ class Input(dict): if target == nick: conn.msg(target, message) else: - conn.msg(target, "({}) {}".format(nick, message)) + conn.msg(target, u"({}) {}".format(nick, message)) def action(message, target=chan): """sends an action to the current channel/user or a specific channel/user"""
conn . msg ( target , "({}) {}" . format ( nick , message ) )
conn . msg ( target , u"({}) {}" . format ( nick , message ) )
CHANGE_STRING_LITERAL
[["Update", ["string:\"({}) {}\"", 3, 34, 3, 43], "u\"({}) {}\""]]
ihatevim/aetherbot@05782766e9e61dacbe0874735bff4b734552a265
null
null
aetherbot
df6ee28462e6b0ff06a111086d6ef2e16dfaf0b6
cd4b65de3dde53511bcf7099a767aadd265e40eb
plugins/reddit.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -53,7 +53,7 @@ def reddit(inp): # get the requested/random post - if id_num: + if id_num != None: try: item = data[id_num]["data"] except IndexError:
if id_num : try : item = data [ id_num ] [ "data" ] except IndexError :
if id_num != None : try : item = data [ id_num ] [ "data" ] except IndexError :
SINGLE_STMT
[["Insert", ["if_statement", 3, 5, 6, 27], ["comparison_operator", "N0"], 1], ["Move", "N0", ["identifier:id_num", 3, 8, 3, 14], 0], ["Insert", "N0", ["!=:!=", "T"], 1], ["Insert", "N0", ["none:None", "T"], 2]]
ihatevim/aetherbot@df6ee28462e6b0ff06a111086d6ef2e16dfaf0b6
null
null
aetherbot
b2c9f46d78a8a579388773b1e6fbd09e6b602842
186f272062e8fb2756b1a455467a2e97ad17ef51
plugins/github.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -6,7 +6,7 @@ shortcuts = {"cloudbot": "ClouDev/CloudBot"} def truncate(msg): - nmsg = msg.split(" ") + nmsg = msg.split() out = None x = 0 for i in nmsg:
nmsg = msg . split ( " " )
nmsg = msg . split ( )
SAME_FUNCTION_LESS_ARGS
[["Delete", ["string:\" \"", 3, 22, 3, 25]]]
ihatevim/aetherbot@b2c9f46d78a8a579388773b1e6fbd09e6b602842
null
null
aetherbot
df1023da55f88d9dffa05ca6456b4f896a0930c0
954ff2ad00728049b97d79a707d19dcda27b8d3d
plugins/minecraft_wiki.py
https://github.com/ihatevim/aetherbot
true
false
true
@@ -24,6 +24,6 @@ def mcwiki(inp): summary = " ".join(p.text_content().splitlines()) summary = re.sub("\[\d+\]", "", summary) summary = text.truncate_str(summary, 200) - return "{} :: {}".format(summary, url) + return u"{} :: {}".format(summary, url) return "Unknown Error."
return "{} :: {}" . format ( summary , url )
return u"{} :: {}" . format ( summary , url )
CHANGE_STRING_LITERAL
[["Update", ["string:\"{} :: {}\"", 3, 20, 3, 30], "u\"{} :: {}\""]]
ihatevim/aetherbot@df1023da55f88d9dffa05ca6456b4f896a0930c0
null
null
aetherbot
694cbbe81ffe1552232bb81c462622c3093de397
e8876c2c48740dbcc6262515923e5bbb8c264065
plugins/xkcd.py
https://github.com/ihatevim/aetherbot
true
false
false
@@ -4,7 +4,7 @@ from util import hook, http xkcd_re = (r'(.*:)//(www.xkcd.com|xkcd.com)(.*)', re.I) -months = {'1': 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', +months = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', 9: 'September', 10: 'October', 11: 'November', 12: 'December'}
months = { '1' : 'January' , 2 : 'February' , 3 : 'March' , 4 : 'April' , 5 : 'May' , 6 : 'June' , 7 : 'July' , 8 : 'August' , 9 : 'September' , 10 : 'October' , 11 : 'November' , 12 : 'December' }
months = { 1 : 'January' , 2 : 'February' , 3 : 'March' , 4 : 'April' , 5 : 'May' , 6 : 'June' , 7 : 'July' , 8 : 'August' , 9 : 'September' , 10 : 'October' , 11 : 'November' , 12 : 'December' }
CHANGE_CONSTANT_TYPE
[["Insert", ["pair", 3, 11, 3, 25], ["integer:1", "T"], 0], ["Delete", ["string:'1'", 3, 11, 3, 14]]]
ihatevim/aetherbot@694cbbe81ffe1552232bb81c462622c3093de397
Fix xkcd comics made in January throwing an error Previously, any commit written in January would throw an error because the array key for January was falsely '1' instead of the integer 1. This would lead to the moth name not being found and the error occuring. This PR fixes that problem by changing the key of January to the integer 1. **How to reproduce:** Ask your CloudBot to `xkcd Regular Expressions`, an error will be shown in console.
[ { "sha": "d7fad5931bf289b07c8a7eeeed976a092297b8fe", "filename": "plugins/xkcd.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/ihatevim/aetherbot/blob/694cbbe81ffe1552232bb81c462622c3093de397/plugins%2Fxkcd.py", "raw_url": "https://github.com/ihatevim/aetherbot/raw/694cbbe81ffe1552232bb81c462622c3093de397/plugins%2Fxkcd.py", "contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fxkcd.py?ref=694cbbe81ffe1552232bb81c462622c3093de397", "patch": "@@ -4,7 +4,7 @@\n \n \n xkcd_re = (r'(.*:)//(www.xkcd.com|xkcd.com)(.*)', re.I)\n-months = {'1': 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August',\n+months = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August',\n 9: 'September', 10: 'October', 11: 'November', 12: 'December'}\n \n " } ]
autoreduce
4e51cd23d233a3c9bf8eb4a6aecf1ea8f1b48e1b
f5759e8bbdffcc77c00ffff4271eb23f17e66314
WebApp/autoreduce_webapp/reduction_viewer/models.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -27,7 +27,7 @@ class Instrument(models.Model): """ :return: str representation of instrument """ - return f"{name}" + return f"{self.name}" class Experiment(models.Model):
return f"{name}"
return f"{self.name}"
CHANGE_STRING_LITERAL
[["Update", ["string:f\"{name}\"", 3, 16, 3, 25], "f\"{self.name}\""]]
ISISScientificComputing/autoreduce@4e51cd23d233a3c9bf8eb4a6aecf1ea8f1b48e1b
null
null
autoreduce
4290c25d70f13b92c35a7cc2c520d1ed6e6204bc
6ab27069f9db62c2e2e92500c5dfd6eca8cd3519
WebApp/autoreduce_webapp/selenium_tests/configuration.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -15,7 +15,7 @@ from shutil import copyfile from utils.project.structure import get_project_root -CONFIG_PATH = Path(get_project_root(), "Webapp/autoreduce_webapp/selenium_tests/config.json") +CONFIG_PATH = Path(get_project_root(), "WebApp/autoreduce_webapp/selenium_tests/config.json") TEMP_CONFIG_PATH = Path(get_project_root(), "Webapp/autoreduce_webapp/selenium_tests/temp_config.json")
CONFIG_PATH = Path ( get_project_root ( ) , "Webapp/autoreduce_webapp/selenium_tests/config.json" )
CONFIG_PATH = Path ( get_project_root ( ) , "WebApp/autoreduce_webapp/selenium_tests/config.json" )
CHANGE_STRING_LITERAL
[["Update", ["string:\"Webapp/autoreduce_webapp/selenium_tests/config.json\"", 3, 40, 3, 93], "\"WebApp/autoreduce_webapp/selenium_tests/config.json\""]]
ISISScientificComputing/autoreduce@4290c25d70f13b92c35a7cc2c520d1ed6e6204bc
null
null
autoreduce
3863ffe9e258f4dc032f8cd8fafb05f2452e7ccf
7a8ed63621d47272aabbee9545997971eccaa7bb
WebApp/autoreduce_webapp/selenium_tests/tests/base_tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -28,7 +28,7 @@ class BaseTestCase(StaticLiveServerTestCase): Base test class that provides setup and teardown of driver aswell as screenshotting capability on failed tests """ - fixtures = ["super_user_fixture"] + fixtures = ["super_user_fixture", "status_fixture"] def setUp(self) -> None: """
fixtures = [ "super_user_fixture" ]
fixtures = [ "super_user_fixture" , "status_fixture" ]
ADD_ELEMENTS_TO_ITERABLE
[["Insert", ["list", 3, 16, 3, 38], [",:,", "T"], 2], ["Insert", ["list", 3, 16, 3, 38], ["string:\"status_fixture\"", "T"], 3]]
ISISScientificComputing/autoreduce@3863ffe9e258f4dc032f8cd8fafb05f2452e7ccf
null
null
autoreduce
4ac4434e1185849860f54340d2529d13699cf807
3d15da9e7816fe3857768010444fd23527abe1d0
WebApp/autoreduce_webapp/selenium_tests/tests/base_tests.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -44,7 +44,7 @@ class BaseTestCase(StaticLiveServerTestCase): if self._is_test_failure(): self._screenshot_driver() self.driver.quit() - setattr("http://localhost:0000") + set_url("http://localhost:0000") def _screenshot_driver(self): now = datetime.datetime.now() screenshot_name = f"{self._testMethodName}-{now.strftime('%Y-%m-%d_%H-%M-%S')}.png"
setattr ( "http://localhost:0000" )
set_url ( "http://localhost:0000" )
WRONG_FUNCTION_NAME
[["Update", ["identifier:setattr", 3, 9, 3, 16], "set_url"]]
ISISScientificComputing/autoreduce@4ac4434e1185849860f54340d2529d13699cf807
null
null
autoreduce
d8513335423c39e797b2768f355dacb3bc5f2431
9dc1c526a04866b182060e6360e0736a3c9d0021
autoreduce_qp/manage.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autoreduce_qp.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autoreduce_django.settings') try: from django.core.management import execute_from_command_line except ImportError as exc:
os . environ . setdefault ( 'DJANGO_SETTINGS_MODULE' , 'autoreduce_qp.settings' )
os . environ . setdefault ( 'DJANGO_SETTINGS_MODULE' , 'autoreduce_django.settings' )
CHANGE_STRING_LITERAL
[["Update", ["string:'autoreduce_qp.settings'", 3, 53, 3, 77], "'autoreduce_django.settings'"]]
ISISScientificComputing/autoreduce@d8513335423c39e797b2768f355dacb3bc5f2431
null
null
autoreduce
af0d2dfb5b531d363c9a5256a763c0783796344b
2a2c5a555aaefbf2448d381a33c62dfc1c3768c2
setup.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -13,7 +13,7 @@ setup(name="autoreduce_qp", author="ISIS Autoreduction Team", url="https://github.com/ISISScientificComputing/autoreduce/", install_requires=[ - "autoreduce_utils==0.1.3", "autoreduce_db==0.1.4", "autoreduce_scripts==22.0.0.dev1", "Django==3.2.2", + "autoreduce_utils==0.1.3", "autoreduce_db==0.1.4", "autoreduce_scripts==22.0.0.dev9", "Django==3.2.2", "fire==0.4.0", "plotly==4.14.3", "stomp.py==6.1.0" ], packages=find_packages(),
install_requires = [ "autoreduce_utils==0.1.3" , "autoreduce_db==0.1.4" , "autoreduce_scripts==22.0.0.dev1" , "Django==3.2.2" , "fire==0.4.0" , "plotly==4.14.3" , "stomp.py==6.1.0" ] ,
install_requires = [ "autoreduce_utils==0.1.3" , "autoreduce_db==0.1.4" , "autoreduce_scripts==22.0.0.dev9" , "Django==3.2.2" , "fire==0.4.0" , "plotly==4.14.3" , "stomp.py==6.1.0" ] ,
CHANGE_STRING_LITERAL
[["Update", ["string:\"autoreduce_scripts==22.0.0.dev1\"", 3, 62, 3, 95], "\"autoreduce_scripts==22.0.0.dev9\""]]
ISISScientificComputing/autoreduce@af0d2dfb5b531d363c9a5256a763c0783796344b
null
null
autoreduce
fb7eb1e75b8c6c0094fe53b68c0c7100e538bd7d
3572928fa5599ca66e3e04a484524b9f660c0e1c
autoreduce_qp/systemtests/utils/data_archive.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -61,7 +61,7 @@ class DataArchive: location = Path(CYCLE_DIRECTORY % (instrument, f"{year}_{cycle_num}")) - location.mkdir(parents=True) + location.mkdir(parents=True, exist_ok=True) datafile = Path(location, datafile_name) datafile.touch() return str(datafile)
location . mkdir ( parents = True )
location . mkdir ( parents = True , exist_ok = True )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 1, 23, 1, 37], [",:,", "T"], 2], ["Insert", ["argument_list", 1, 23, 1, 37], ["keyword_argument", "N0"], 3], ["Insert", "N0", ["identifier:exist_ok", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["true:True", "T"], 2]]
ISISScientificComputing/autoreduce@fb7eb1e75b8c6c0094fe53b68c0c7100e538bd7d
null
null
autoreduce
6c562cf96b332747deb7302447462064f01322ce
f19c1120a23bf51a3d80915dbc100c8e74ab30fd
setup.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -14,7 +14,7 @@ setup(name="autoreduce_qp", url="https://github.com/ISISScientificComputing/autoreduce/", install_requires=[ "autoreduce_utils==22.0.0.dev3", "autoreduce_db==22.0.0.dev5", "Django==3.2.4", "fire==0.4.0", - "plotly==4.14.3", "stomp.py==6.1.0" + "plotly==5.1.0", "stomp.py==6.1.0" ], packages=find_packages(), entry_points={"console_scripts": ["autoreduce-qp-start = autoreduce_qp.queue_processor.queue_listener:main"]},
install_requires = [ "autoreduce_utils==22.0.0.dev3" , "autoreduce_db==22.0.0.dev5" , "Django==3.2.4" , "fire==0.4.0" , "plotly==4.14.3" , "stomp.py==6.1.0" ] ,
install_requires = [ "autoreduce_utils==22.0.0.dev3" , "autoreduce_db==22.0.0.dev5" , "Django==3.2.4" , "fire==0.4.0" , "plotly==5.1.0" , "stomp.py==6.1.0" ] ,
CHANGE_STRING_LITERAL
[["Update", ["string:\"plotly==4.14.3\"", 3, 11, 3, 27], "\"plotly==5.1.0\""]]
ISISScientificComputing/autoreduce@6c562cf96b332747deb7302447462064f01322ce
null
null
xbmc-addons-chinese
321d0cf15a1677acf066999796952de5a53574ed
2996ef63b0c0dcbe14a70aad46f816cf198e1255
plugin.video.sohuvideo/default.py
https://github.com/Benyjuice/xbmc-addons-chinese
true
false
true
@@ -205,7 +205,7 @@ def progList(name,id,page,cat,area,year,p5,p6,p11,order): dialog = xbmcgui.Dialog() ok = dialog.ok(__addonname__, '没有符合此条件的视频!') else: - matchpages = re.compile('<a href="[^"]*">(\d+)</a>', re.DOTALL).findall(match[0]) + matchpages = re.compile('<a title="\d+" href="[^"]*">(\d+)</a>', re.DOTALL).findall(match[0]) totalpages = int(matchpages[-1]) if totalpages < currpage: totalpages = currpage
else : matchpages = re . compile ( '<a href="[^"]*">(\d+)</a>' , re . DOTALL ) . findall ( match [ 0 ] )
else : matchpages = re . compile ( '<a title="\d+" href="[^"]*">(\d+)</a>' , re . DOTALL ) . findall ( match [ 0 ] )
CHANGE_STRING_LITERAL
[["Update", ["string:'<a href=\"[^\"]*\">(\\d+)</a>'", 3, 33, 3, 60], "'<a title=\"\\d+\" href=\"[^\"]*\">(\\d+)</a>'"]]
Benyjuice/xbmc-addons-chinese@321d0cf15a1677acf066999796952de5a53574ed
fix match pages error due to source html changes
[ { "sha": "8c7939a10f0f612ad2ccad1aba1c68422420b79c", "filename": "plugin.video.sohuvideo/default.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/Benyjuice/xbmc-addons-chinese/blob/321d0cf15a1677acf066999796952de5a53574ed/plugin.video.sohuvideo%2Fdefault.py", "raw_url": "https://github.com/Benyjuice/xbmc-addons-chinese/raw/321d0cf15a1677acf066999796952de5a53574ed/plugin.video.sohuvideo%2Fdefault.py", "contents_url": "https://api.github.com/repos/Benyjuice/xbmc-addons-chinese/contents/plugin.video.sohuvideo%2Fdefault.py?ref=321d0cf15a1677acf066999796952de5a53574ed", "patch": "@@ -205,7 +205,7 @@ def progList(name,id,page,cat,area,year,p5,p6,p11,order):\n dialog = xbmcgui.Dialog()\n ok = dialog.ok(__addonname__, '没有符合此条件的视频!')\n else:\n- matchpages = re.compile('<a href=\"[^\"]*\">(\\d+)</a>', re.DOTALL).findall(match[0])\n+ matchpages = re.compile('<a title=\"\\d+\" href=\"[^\"]*\">(\\d+)</a>', re.DOTALL).findall(match[0])\n totalpages = int(matchpages[-1])\n if totalpages < currpage:\n totalpages = currpage" } ]
mli-gluon-tutorials-zh
e27ea4a44c328a9ca42300b599d1296fdb6985b3
86cef0907c522ef69b53c42b76255795470d1f5d
sphinx_plugin.py
https://github.com/liuheng0111/mli-gluon-tutorials-zh
true
false
true
@@ -150,7 +150,7 @@ def _release_notebook(dst_dir): """convert .md into notebooks and make a zip file""" reader = notedown.MarkdownReader(match='strict') files = glob.glob('*/*.md') - package_files = ['environment.yml', 'mnist.py', 'utils.py', 'README.md', 'LICENSE'] + package_files = ['environment.yml', 'utils.py', 'README.md', 'LICENSE'] for fname in files: # parse if each markdown file is actually a jupyter notebook with open(fname, 'r') as fp:
package_files = [ 'environment.yml' , 'mnist.py' , 'utils.py' , 'README.md' , 'LICENSE' ]
package_files = [ 'environment.yml' , 'utils.py' , 'README.md' , 'LICENSE' ]
SINGLE_STMT
[["Move", [",:,", 3, 51, 3, 52], ["list", 3, 21, 3, 88], 5], ["Move", [",:,", 3, 63, 3, 64], ["list", 3, 21, 3, 88], 8], ["Delete", ["string:'mnist.py'", 3, 41, 3, 51]], ["Delete", [",:,", 3, 76, 3, 77]]]
liuheng0111/mli-gluon-tutorials-zh@e27ea4a44c328a9ca42300b599d1296fdb6985b3
fix
[ { "sha": "784684f6a99e4e5a16371270ecca5eb59c5a9d56", "filename": "sphinx_plugin.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/liuheng0111/mli-gluon-tutorials-zh/blob/e27ea4a44c328a9ca42300b599d1296fdb6985b3/sphinx_plugin.py", "raw_url": "https://github.com/liuheng0111/mli-gluon-tutorials-zh/raw/e27ea4a44c328a9ca42300b599d1296fdb6985b3/sphinx_plugin.py", "contents_url": "https://api.github.com/repos/liuheng0111/mli-gluon-tutorials-zh/contents/sphinx_plugin.py?ref=e27ea4a44c328a9ca42300b599d1296fdb6985b3", "patch": "@@ -150,7 +150,7 @@ def _release_notebook(dst_dir):\n \"\"\"convert .md into notebooks and make a zip file\"\"\"\n reader = notedown.MarkdownReader(match='strict')\n files = glob.glob('*/*.md')\n- package_files = ['environment.yml', 'mnist.py', 'utils.py', 'README.md', 'LICENSE']\n+ package_files = ['environment.yml', 'utils.py', 'README.md', 'LICENSE']\n for fname in files:\n # parse if each markdown file is actually a jupyter notebook\n with open(fname, 'r') as fp:" } ]
mli-gluon-tutorials-zh
ffd3955749d9e0522734e195e4f4a6857462b818
75867026492e959547201c595cba1136426bcd21
sphinx_plugin.py
https://github.com/liuheng0111/mli-gluon-tutorials-zh
true
false
true
@@ -196,7 +196,7 @@ def release_notebook(app, exception): def generate_htaccess(app, exception): print('=== Generate .htaccess file') with open(app.builder.outdir + '/.htaccess', 'w') as f: - f.write('ErrorDocument 404 http://zh.gluon.ai/404.html\n') + f.write('ErrorDocument 404 https://zh.gluon.ai/404.html\n') for old, new in renamed_files + converted_files: f.write('Redirect /%s /%s\n'%( _replace_ext(old, 'html'), _replace_ext(new, 'html')
f . write ( 'ErrorDocument 404 http://zh.gluon.ai/404.html\n' )
f . write ( 'ErrorDocument 404 https://zh.gluon.ai/404.html\n' )
CHANGE_STRING_LITERAL
[["Update", ["string:'ErrorDocument 404 http://zh.gluon.ai/404.html\\n'", 3, 17, 3, 66], "'ErrorDocument 404 https://zh.gluon.ai/404.html\\n'"]]
liuheng0111/mli-gluon-tutorials-zh@ffd3955749d9e0522734e195e4f4a6857462b818
fix https 404 warning
[ { "sha": "e5c50fe0b235030ef144df1c9607c11ada528a40", "filename": "sphinx_plugin.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/liuheng0111/mli-gluon-tutorials-zh/blob/ffd3955749d9e0522734e195e4f4a6857462b818/sphinx_plugin.py", "raw_url": "https://github.com/liuheng0111/mli-gluon-tutorials-zh/raw/ffd3955749d9e0522734e195e4f4a6857462b818/sphinx_plugin.py", "contents_url": "https://api.github.com/repos/liuheng0111/mli-gluon-tutorials-zh/contents/sphinx_plugin.py?ref=ffd3955749d9e0522734e195e4f4a6857462b818", "patch": "@@ -196,7 +196,7 @@ def release_notebook(app, exception):\n def generate_htaccess(app, exception):\n print('=== Generate .htaccess file')\n with open(app.builder.outdir + '/.htaccess', 'w') as f:\n- f.write('ErrorDocument 404 http://zh.gluon.ai/404.html\\n')\n+ f.write('ErrorDocument 404 https://zh.gluon.ai/404.html\\n')\n for old, new in renamed_files + converted_files:\n f.write('Redirect /%s /%s\\n'%(\n _replace_ext(old, 'html'), _replace_ext(new, 'html')" } ]
autoreduce
05e348c1198f1913fee6dd1e32d820684056c2f4
60812c3c81618c836ceeb9f1582cb6944d2a972b
queue_processors/queue_processor/tests/test_instrument_variable_utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -358,7 +358,7 @@ class TestInstrumentVariableUtils(unittest.TestCase): var = new_variables_again[0].variable assert var.name == "standard_var1" - assert var.value == "123" + assert var.value == 123 assert var.type == "number" assert var.help_text == "CHANGED HELP FOR VARIABLE"
assert var . value == "123"
assert var . value == 123
CHANGE_CONSTANT_TYPE
[["Insert", ["comparison_operator", 3, 16, 3, 34], ["integer:123", "T"], 2], ["Delete", ["string:\"123\"", 3, 29, 3, 34]]]
ISISScientificComputing/autoreduce@05e348c1198f1913fee6dd1e32d820684056c2f4
null
null
autoreduce
dd1a074cfd60a70f35c19bc7e08f7f7886508141
238398c2eea0fe1531e1893e61c4a857d0ff0693
queue_processors/queue_processor/tests/test_handle_message.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -75,7 +75,7 @@ class TestHandleMessage(TestCase): "instrument": self.instrument_name # Autoreduction Mock Instrument }) with patch("logging.getLogger") as patched_logger: - self.handler = HandleMessage(self.mocked_client) + self.handler = HandleMessage() self.handler.connect() self.mocked_logger = patched_logger.return_value
self . handler = HandleMessage ( self . mocked_client )
self . handler = HandleMessage ( )
SAME_FUNCTION_LESS_ARGS
[["Delete", ["identifier:self", 3, 42, 3, 46]], ["Delete", [".:.", 3, 46, 3, 47]], ["Delete", ["identifier:mocked_client", 3, 47, 3, 60]], ["Delete", ["attribute", 3, 42, 3, 60]]]
ISISScientificComputing/autoreduce@dd1a074cfd60a70f35c19bc7e08f7f7886508141
null
null
autoreduce
7bb5bdb37ad312d5322e7dca2e96570bf80bf22b
a42b9c06f6eada53c1c698e93ffd4dd7360b52fe
WebApp/autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -352,7 +352,7 @@ def run_confirmation(request, instrument): # Check old run exists if most_recent_previous_run is None: - context_dictionary['error'] = "Run number " + str(run_number) + " doesn't exist." + context_dictionary['error'] = "Run number " + str(run_number) + " hasn't been ran by autoreduction yet." # Check it is not currently queued queued_runs = matching_previous_runs_queryset.filter(status=queued_status).first()
context_dictionary [ 'error' ] = "Run number " + str ( run_number ) + " doesn't exist."
context_dictionary [ 'error' ] = "Run number " + str ( run_number ) + " hasn't been ran by autoreduction yet."
CHANGE_BINARY_OPERAND
[["Update", ["string:\" doesn't exist.\"", 3, 77, 3, 94], "\" hasn't been ran by autoreduction yet.\""]]
ISISScientificComputing/autoreduce@7bb5bdb37ad312d5322e7dca2e96570bf80bf22b
null
null
autoreduce
d8b0f7f3c33a9dcdc0f9e0ba6ab61198f820a3f2
56fb22540ffeeaaaebeb47a01fbde4101ed5508e
QueueProcessors/QueueProcessor/queue_processor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -141,7 +141,7 @@ class Listener(object): # Search for the experiment, if it doesn't exist then add it experiment = session.query(Experiment).filter_by(reference_number=rb_number).first() - if experiment is None and rb_number: + if experiment is None: new_exp = Experiment(reference_number=rb_number) session.add(new_exp) session.commit()
if experiment is None and rb_number : new_exp = Experiment ( reference_number = rb_number ) session . add ( new_exp ) session . commit ( )
if experiment is None : new_exp = Experiment ( reference_number = rb_number ) session . add ( new_exp ) session . commit ( )
SINGLE_STMT
[["Move", ["if_statement", 3, 9, 6, 29], ["comparison_operator", 3, 12, 3, 30], 1], ["Delete", ["and:and", 3, 31, 3, 34]], ["Delete", ["identifier:rb_number", 3, 35, 3, 44]], ["Delete", ["boolean_operator", 3, 12, 3, 44]]]
ISISScientificComputing/autoreduce@d8b0f7f3c33a9dcdc0f9e0ba6ab61198f820a3f2
null
null
autoreduce
97e7a4f41c1b4d186feedbd55b0ed03602f0c248
f8b652258e996a7ad22abd0046a578a8a9387b53
scripts/mysql_dump/reset_database_post_cycle.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -139,7 +139,7 @@ def main(): choice = raw_input('\'Backup\' or \'Wipe\': ') while choice.lower() != 'backup' and choice.lower() != 'wipe': choice = raw_input('Invalid option - \'Backup\' or \'Wipe\':') - choice.lower() + choice = choice.lower() cycle = raw_input('Current cycle name: ') user = raw_input('Database user name: ') password = getpass.getpass('Database password (leave blank if none): ')
choice . lower ( )
choice = choice . lower ( )
SINGLE_STMT
[["Insert", ["expression_statement", 3, 5, 3, 19], ["assignment", "N0"], 0], ["Insert", "N0", ["identifier:choice", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Move", "N0", ["call", 3, 5, 3, 19], 2]]
ISISScientificComputing/autoreduce@97e7a4f41c1b4d186feedbd55b0ed03602f0c248
null
null
autoreduce
ba8bd72e397246e5d33d95d7ae9ca43f219c82b0
cbf0f2343cc1ffb3e81529f71ff1b990e2a6241c
QueueProcessors/QueueProcessor/queueproc_utils/messaging_utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -37,7 +37,7 @@ class MessagingUtils(object): def _make_pending_msg(reduction_run): """ Creates a dict message from the given run, ready to be sent to ReductionPending. """ # Deferred import to avoid circular dependencies - from ..utils.reduction_run_utils import ReductionRunUtils + from ..queueproc_utils.reduction_run_utils import ReductionRunUtils script, arguments = ReductionRunUtils().get_script_and_arguments(reduction_run)
from . . utils . reduction_run_utils import ReductionRunUtils
from . . queueproc_utils . reduction_run_utils import ReductionRunUtils
CHANGE_IDENTIFIER_USED
[["Update", ["identifier:utils", 3, 16, 3, 21], "queueproc_utils"]]
ISISScientificComputing/autoreduce@ba8bd72e397246e5d33d95d7ae9ca43f219c82b0
null
null
autoreduce
3fe99eccae85b948ef86a3650c2ae56e6f55133c
65b9e1aef1679f2706222d7acfaccff6d270373f
QueueProcessors/AutoreductionProcessor/test_settings.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -34,7 +34,7 @@ MISC = { "script_timeout": 3600, # The max time to wait for a user script to finish running (seconds) "mantid_path": "/opt/Mantid/bin", "scripts_directory": append_path(get_project_root(), ['data-archive', 'NDX%s', 'user', 'scripts', 'autoreduction']), - "post_process_directory": append_path(os.path.dirname(os.path.realpath(__file__)), "post_process_admin.py"), + "post_process_directory": append_path(os.path.dirname(os.path.realpath(__file__)), ["post_process_admin.py"]), "ceph_directory": append_path(get_project_root(), ['reduced-data', '%s', 'RB%s', 'autoreduced', '%s']), "temp_root_directory": "/autoreducetmp", "excitation_instruments": ["LET", "MARI", "MAPS", "MERLIN", "WISH", "GEM"]
"post_process_directory" : append_path ( os . path . dirname ( os . path . realpath ( __file__ ) ) , "post_process_admin.py" ) ,
"post_process_directory" : append_path ( os . path . dirname ( os . path . realpath ( __file__ ) ) , [ "post_process_admin.py" ] ) ,
SINGLE_STMT
[["Insert", ["argument_list", 3, 42, 3, 112], ["list", "N0"], 3], ["Insert", "N0", ["[:[", "T"], 0], ["Move", "N0", ["string:\"post_process_admin.py\"", 3, 88, 3, 111], 1], ["Insert", "N0", ["]:]", "T"], 2]]
ISISScientificComputing/autoreduce@3fe99eccae85b948ef86a3650c2ae56e6f55133c
null
null
autoreduce
d4d0bd30dd519f43a6c3fdc9cd76ad26b6e935a7
8eedf41f1cd8cfebdc1d924269392fdb62482d0c
WebApp/autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -431,7 +431,7 @@ def instrument_summary(request, instrument=None): experiments_and_runs[experiment] = associated_runs context_dictionary['experiments'] = experiments_and_runs else: - max_items_per_page = request.GET.get('pagination', 50) + max_items_per_page = request.GET.get('pagination', 10) custom_paginator = CustomPaginator(page_type=sort_by, query_set=runs, items_per_page=max_items_per_page,
else : max_items_per_page = request . GET . get ( 'pagination' , 50 )
else : max_items_per_page = request . GET . get ( 'pagination' , 10 )
CHANGE_NUMERIC_LITERAL
[["Update", ["integer:50", 3, 64, 3, 66], "10"]]
ISISScientificComputing/autoreduce@d4d0bd30dd519f43a6c3fdc9cd76ad26b6e935a7
null
null
awx
b51a867b5f234731f5e436938eda31f8d08ae640
05613c1bea4825c2c80660647cdff2cc2c44752b
awx/main/management/commands/inventory_import.py
https://github.com/gconsidine/awx
true
false
false
@@ -27,7 +27,7 @@ from django.contrib.auth.models import User # AWX from awx.main.models import * from awx.main.signals import ignore_inventory_computed_fields, disable_activity_stream -from awx.main.licenses import LicenseReader +from awx.main.task_engine import TaskSerializer as LicenseReader logger = logging.getLogger('awx.main.commands.inventory_import')
from awx . main . licenses import LicenseReader
from awx . main . task_engine import TaskSerializer as LicenseReader
SINGLE_STMT
[["Insert", ["import_from_statement", 3, 1, 3, 44], ["aliased_import", "N0"], 3], ["Update", ["identifier:licenses", 3, 15, 3, 23], "task_engine"], ["Move", "N0", ["dotted_name", 3, 31, 3, 44], 0], ["Insert", "N0", ["as:as", "T"], 1], ["Move", "N0", ["identifier:LicenseReader", 3, 31, 3, 44], 2], ["Insert", ["dotted_name", 3, 31, 3, 44], ["identifier:TaskSerializer", "T"], 0]]
gconsidine/awx@b51a867b5f234731f5e436938eda31f8d08ae640
More fixes for the license obfuscation
[ { "sha": "ba989ea65f9f96862ab7eff952022893a26fb4f4", "filename": "awx/main/management/commands/inventory_import.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/b51a867b5f234731f5e436938eda31f8d08ae640/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "raw_url": "https://github.com/gconsidine/awx/raw/b51a867b5f234731f5e436938eda31f8d08ae640/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py?ref=b51a867b5f234731f5e436938eda31f8d08ae640", "patch": "@@ -27,7 +27,7 @@\n # AWX\n from awx.main.models import *\n from awx.main.signals import ignore_inventory_computed_fields, disable_activity_stream\n-from awx.main.licenses import LicenseReader\n+from awx.main.task_engine import TaskSerializer as LicenseReader\n \n logger = logging.getLogger('awx.main.commands.inventory_import')\n " } ]
awx
3086ec4930717252fcb5369e78dbab1b835eb825
b14aa0b55dd0768e0abb07e0f2e2338578dd3f8a
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -227,7 +227,7 @@ class Inventory(CommonModel): root_group_pks = set(self.root_groups.values_list('pk', flat=True)) group_depths = {} # pk: max_depth def update_group_depths(group_pk, current_depth=0): - max_depth = group_depths.get(group_pk, 0) + max_depth = group_depths.get(group_pk, -1) if current_depth > max_depth: group_depths[group_pk] = current_depth for child_pk in group_children_map.get(group_pk, set()):
max_depth = group_depths . get ( group_pk , 0 )
max_depth = group_depths . get ( group_pk , - 1 )
SINGLE_STMT
[["Insert", ["argument_list", 3, 41, 3, 54], ["unary_operator", "N0"], 3], ["Insert", "N0", ["-:-", "T"], 0], ["Insert", "N0", ["integer:1", "T"], 1], ["Delete", ["integer:0", 3, 52, 3, 53]]]
gconsidine/awx@3086ec4930717252fcb5369e78dbab1b835eb825
AC-1235 Fix for RunJobTest failures.
[ { "sha": "47d064e469af57cb6e5b4b880571a8aceea20ddf", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/3086ec4930717252fcb5369e78dbab1b835eb825/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/3086ec4930717252fcb5369e78dbab1b835eb825/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=3086ec4930717252fcb5369e78dbab1b835eb825", "patch": "@@ -227,7 +227,7 @@ def update_group_computed_fields(self):\n root_group_pks = set(self.root_groups.values_list('pk', flat=True))\n group_depths = {} # pk: max_depth\n def update_group_depths(group_pk, current_depth=0):\n- max_depth = group_depths.get(group_pk, 0)\n+ max_depth = group_depths.get(group_pk, -1)\n if current_depth > max_depth:\n group_depths[group_pk] = current_depth\n for child_pk in group_children_map.get(group_pk, set()):" } ]
awx
fe29db1a466b28564a32e505f052d8bf8ab01d26
71d256583d28d9995dfa5ab5af46a91de86aa9da
awx/main/models/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -200,7 +200,7 @@ class Inventory(CommonModel): # Find all hosts that need the has_inventory_sources flag cleared. hosts_to_clear = hosts_qs.filter(has_inventory_sources=True).exclude(pk__in=hosts_with_cloud_inventory) for host_pk in hosts_to_clear.values_list('pk', flat=True): - host_updates = hosts_to_updates.setdefault(host_pk, {}) + host_updates = hosts_to_update.setdefault(host_pk, {}) host_updates['has_inventory_sources'] = False # Now apply updates to hosts where needed (in batches). all_update_pks = hosts_to_update.keys()
host_updates = hosts_to_updates . setdefault ( host_pk , { } )
host_updates = hosts_to_update . setdefault ( host_pk , { } )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:hosts_to_updates", 3, 28, 3, 44], "hosts_to_update"]]
gconsidine/awx@fe29db1a466b28564a32e505f052d8bf8ab01d26
Fix small plurality issue when recalculating host fields
[ { "sha": "45cef121a89806c7f63461ef834d91195bd42894", "filename": "awx/main/models/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/fe29db1a466b28564a32e505f052d8bf8ab01d26/awx%2Fmain%2Fmodels%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/fe29db1a466b28564a32e505f052d8bf8ab01d26/awx%2Fmain%2Fmodels%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Finventory.py?ref=fe29db1a466b28564a32e505f052d8bf8ab01d26", "patch": "@@ -200,7 +200,7 @@ def update_host_computed_fields(self):\n # Find all hosts that need the has_inventory_sources flag cleared.\n hosts_to_clear = hosts_qs.filter(has_inventory_sources=True).exclude(pk__in=hosts_with_cloud_inventory)\n for host_pk in hosts_to_clear.values_list('pk', flat=True):\n- host_updates = hosts_to_updates.setdefault(host_pk, {})\n+ host_updates = hosts_to_update.setdefault(host_pk, {})\n host_updates['has_inventory_sources'] = False\n # Now apply updates to hosts where needed (in batches).\n all_update_pks = hosts_to_update.keys()" } ]
awx
718e9916f031d3435c4b23b79a3dcb4aeab15da3
6773fd19d77f0ebc8859fdb651a0ea33defdf605
awx/main/tests/inventory.py
https://github.com/gconsidine/awx
true
false
true
@@ -573,7 +573,7 @@ class InventoryTest(BaseTest): # access url1 = reverse('api:group_hosts_list', args=(groups[0].pk,)) alt_group_hosts = reverse('api:group_hosts_list', args=(groups[1].pk,)) - other_alt_group_hosts = reverse('api:group_hosts_list', args(groups[2].pk,)) + other_alt_group_hosts = reverse('api:group_hosts_list', args=(groups[2].pk,)) data = self.get(url1, expect=200, auth=self.get_normal_credentials()) self.assertEquals(data['count'], 2)
other_alt_group_hosts = reverse ( 'api:group_hosts_list' , args ( groups [ 2 ] . pk , ) )
other_alt_group_hosts = reverse ( 'api:group_hosts_list' , args = ( groups [ 2 ] . pk , ) )
SINGLE_STMT
[["Insert", ["argument_list", 3, 40, 3, 85], ["keyword_argument", "N0"], 3], ["Move", "N0", ["identifier:args", 3, 65, 3, 69], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["tuple", "N1"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["attribute", 3, 70, 3, 82], 1], ["Move", "N1", [",:,", 3, 82, 3, 83], 2], ["Move", "N1", ["):)", 3, 83, 3, 84], 3], ["Delete", ["(:(", 3, 40, 3, 41]]]
gconsidine/awx@718e9916f031d3435c4b23b79a3dcb4aeab15da3
Fix a bug in the mainline inventory test
[ { "sha": "0d2eb0a41b7dc4e730818cd41a91e1d85b38fe63", "filename": "awx/main/tests/inventory.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/gconsidine/awx/blob/718e9916f031d3435c4b23b79a3dcb4aeab15da3/awx%2Fmain%2Ftests%2Finventory.py", "raw_url": "https://github.com/gconsidine/awx/raw/718e9916f031d3435c4b23b79a3dcb4aeab15da3/awx%2Fmain%2Ftests%2Finventory.py", "contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Finventory.py?ref=718e9916f031d3435c4b23b79a3dcb4aeab15da3", "patch": "@@ -573,7 +573,7 @@ def test_main_line(self):\n # access \n url1 = reverse('api:group_hosts_list', args=(groups[0].pk,))\n alt_group_hosts = reverse('api:group_hosts_list', args=(groups[1].pk,))\n- other_alt_group_hosts = reverse('api:group_hosts_list', args(groups[2].pk,))\n+ other_alt_group_hosts = reverse('api:group_hosts_list', args=(groups[2].pk,))\n \n data = self.get(url1, expect=200, auth=self.get_normal_credentials())\n self.assertEquals(data['count'], 2)" } ]
autoreduce
53d89e5f1188b96ae1ab8122090a7d2e48c57343
8ea5e7691498bf899692ab0394f7f2f487bbdfc2
queue_processors/autoreduction_processor/post_process_admin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -508,7 +508,7 @@ def main(): post_proc.reduce() except ValueError as exp: - message.error = str(exp) # Note: I believe this should be .message + message.message = str(exp) # Note: I believe this should be .message logger.info("Message data error: %s", message.serialize(limit_reduction_script=True)) raise
except ValueError as exp : message . error = str ( exp )
except ValueError as exp : message . message = str ( exp )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:error", 3, 21, 3, 26], "message"]]
ISISScientificComputing/autoreduce@53d89e5f1188b96ae1ab8122090a7d2e48c57343
null
null
autoreduce
0ab75421bc01ef369594d988a64962dbfd322cd3
da67e68679622169b4e5fad99cd906a628153012
queue_processors/autoreduction_processor/post_process_admin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -508,7 +508,7 @@ def main(): post_proc.reduce() except ValueError as exp: - message.error = str(exp) # Note: I believe this should be .message + message.message = str(exp) # Note: I believe this should be .message logger.info("Message data error: %s", message.serialize(limit_reduction_script=True)) raise
except ValueError as exp : message . error = str ( exp )
except ValueError as exp : message . message = str ( exp )
CHANGE_ATTRIBUTE_USED
[["Update", ["identifier:error", 3, 21, 3, 26], "message"]]
ISISScientificComputing/autoreduce@0ab75421bc01ef369594d988a64962dbfd322cd3
null
null
autoreduce
fea540013d95c19d4bfd941a371735cd2a13277c
dda44b589944a9fcc4c4a7211e1c6b4bd99b028c
queue_processors/queue_processor/queueproc_utils/instrument_variable_utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -119,7 +119,7 @@ class InstrumentVariablesUtils: model = db.start_database().variable_model applicable_variables = model.InstrumentVariable.objects \ .filter(instrument_id=instrument.id) \ - .order('-start_run') + .order_by('-start_run') variable_run_number = applicable_variables[0].start_run # Now use the InstrumentJoin class (which is a join of the InstrumentVariable and Variable
applicable_variables = model . InstrumentVariable . objects . filter ( instrument_id = instrument . id ) . order ( '-start_run' )
applicable_variables = model . InstrumentVariable . objects . filter ( instrument_id = instrument . id ) . order_by ( '-start_run' )
WRONG_FUNCTION_NAME
[["Update", ["identifier:order", 3, 14, 3, 19], "order_by"]]
ISISScientificComputing/autoreduce@fea540013d95c19d4bfd941a371735cd2a13277c
null
null
coinbase-gdax-python
dd6e6f94411dae2dd466f33894bcc2125c3907ec
a0fc2b9998cb1b9f7e4e5c33161a8a9e12b1a4de
GDAX/AuthenticatedClient.py
https://github.com/inkblot/coinbase-gdax-python
true
false
true
@@ -6,7 +6,7 @@ import hmac, hashlib, time, requests, base64 from requests.auth import AuthBase -from PublicClient import PublicClient +from GDAX.PublicClient import PublicClient class AuthenticatedClient(PublicClient):
from PublicClient import PublicClient
from GDAX . PublicClient import PublicClient
SINGLE_STMT
[["Insert", ["dotted_name", 3, 6, 3, 18], ["identifier:GDAX", "T"], 0], ["Insert", ["dotted_name", 3, 6, 3, 18], [".:.", "T"], 1]]
inkblot/coinbase-gdax-python@dd6e6f94411dae2dd466f33894bcc2125c3907ec
fixed relative import for Python 3 compatibility
[ { "sha": "b79a457e5f1509af454462383ede9325782aee31", "filename": "GDAX/AuthenticatedClient.py", "status": "modified", "additions": 2, "deletions": 2, "changes": 4, "blob_url": "https://github.com/inkblot/coinbase-gdax-python/blob/dd6e6f94411dae2dd466f33894bcc2125c3907ec/GDAX%2FAuthenticatedClient.py", "raw_url": "https://github.com/inkblot/coinbase-gdax-python/raw/dd6e6f94411dae2dd466f33894bcc2125c3907ec/GDAX%2FAuthenticatedClient.py", "contents_url": "https://api.github.com/repos/inkblot/coinbase-gdax-python/contents/GDAX%2FAuthenticatedClient.py?ref=dd6e6f94411dae2dd466f33894bcc2125c3907ec", "patch": "@@ -6,7 +6,7 @@\n \n import hmac, hashlib, time, requests, base64\n from requests.auth import AuthBase\n-from PublicClient import PublicClient\n+from GDAX.PublicClient import PublicClient\n \n class AuthenticatedClient(PublicClient):\n def __init__(self, key, b64secret, passphrase, api_url=\"https://api.gdax.com\", product_id=\"BTC-USD\"):\n@@ -151,4 +151,4 @@ def __call__(self, request):\n 'CB-ACCESS-KEY': self.api_key,\n 'CB-ACCESS-PASSPHRASE': self.passphrase,\n })\n- return request\n\\ No newline at end of file\n+ return request" } ]
apsconnect-cli
6585e3c32bba972d0fd633346f552499ab79a630
35c1d2894c2d001daf76fe0005c97a02a928c20f
setup.py
https://github.com/themaxbelov/apsconnect-cli
true
false
false
@@ -14,7 +14,7 @@ setup( version='1.7.15', keywords='aps apsconnect connector automation', extras_require={ - ':python_version<="2.7"': ['backports.tempfile==1.0']} + ':python_version<="2.7"': ['backports.tempfile==1.0']}, packages=['apsconnectcli'], description='A command line tool for APS connector installation on Odin Automation in ' 'the relaxed way.',
extras_require = { ':python_version<="2.7"' : [ 'backports.tempfile==1.0' ] }
extras_require = { ':python_version<="2.7"' : [ 'backports.tempfile==1.0' ] } ,
SINGLE_STMT
[["Insert", ["assignment", 2, 5, 3, 63], ["expression_list", "N0"], 2], ["Move", "N0", ["dictionary", 2, 20, 3, 63], 0], ["Insert", "N0", [",:,", "T"], 1]]
themaxbelov/apsconnect-cli@6585e3c32bba972d0fd633346f552499ab79a630
typo fix
[ { "sha": "d29257c82263f73b14d0651117cb8200eab77ca1", "filename": "setup.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/themaxbelov/apsconnect-cli/blob/6585e3c32bba972d0fd633346f552499ab79a630/setup.py", "raw_url": "https://github.com/themaxbelov/apsconnect-cli/raw/6585e3c32bba972d0fd633346f552499ab79a630/setup.py", "contents_url": "https://api.github.com/repos/themaxbelov/apsconnect-cli/contents/setup.py?ref=6585e3c32bba972d0fd633346f552499ab79a630", "patch": "@@ -14,7 +14,7 @@\n version='1.7.15',\n keywords='aps apsconnect connector automation',\n extras_require={\n- ':python_version<=\"2.7\"': ['backports.tempfile==1.0']}\n+ ':python_version<=\"2.7\"': ['backports.tempfile==1.0']},\n packages=['apsconnectcli'],\n description='A command line tool for APS connector installation on Odin Automation in '\n 'the relaxed way.'," } ]
apsconnect-cli
862235a5a0b0912e715481b5ab53d0b5907d67b1
9807266880eda653c6054ce7394e5e0cdfa1f72d
apsconnectcli/apsconnect.py
https://github.com/themaxbelov/apsconnect-cli
true
false
true
@@ -607,7 +607,7 @@ def _get_aps_url(aps_host, aps_port, use_tls_aps): def _get_hub_version(hub): r = hub.statistics.getStatisticsReport(reports=[{'name': 'report-for-cep', 'value': ''}]) _osaapi_raise_for_status(r) - tree = xml_et.fromstring(r['result'][0]['value']) + tree = xml_et.fromstring(r['result'][0]['value'].encode('utf-8')) return tree.find('ClientVersion').text
tree = xml_et . fromstring ( r [ 'result' ] [ 0 ] [ 'value' ] )
tree = xml_et . fromstring ( r [ 'result' ] [ 0 ] [ 'value' ] . encode ( 'utf-8' ) )
ADD_METHOD_CALL
[["Insert", ["argument_list", 3, 29, 3, 54], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 29, 3, 54], ["):)", "T"], 2], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["subscript", 3, 30, 3, 53], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:encode", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["string:'utf-8'", "T"], 1], ["Move", "N2", ["):)", 3, 53, 3, 54], 2]]
themaxbelov/apsconnect-cli@862235a5a0b0912e715481b5ab53d0b5907d67b1
Fix unicode for init-hub command on python 2.7
[ { "sha": "9b79f538bcdf3181daf764c883ac8a9029e70136", "filename": "apsconnectcli/apsconnect.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/themaxbelov/apsconnect-cli/blob/862235a5a0b0912e715481b5ab53d0b5907d67b1/apsconnectcli%2Fapsconnect.py", "raw_url": "https://github.com/themaxbelov/apsconnect-cli/raw/862235a5a0b0912e715481b5ab53d0b5907d67b1/apsconnectcli%2Fapsconnect.py", "contents_url": "https://api.github.com/repos/themaxbelov/apsconnect-cli/contents/apsconnectcli%2Fapsconnect.py?ref=862235a5a0b0912e715481b5ab53d0b5907d67b1", "patch": "@@ -607,7 +607,7 @@ def _get_aps_url(aps_host, aps_port, use_tls_aps):\n def _get_hub_version(hub):\n r = hub.statistics.getStatisticsReport(reports=[{'name': 'report-for-cep', 'value': ''}])\n _osaapi_raise_for_status(r)\n- tree = xml_et.fromstring(r['result'][0]['value'])\n+ tree = xml_et.fromstring(r['result'][0]['value'].encode('utf-8'))\n return tree.find('ClientVersion').text\n \n " } ]
apsconnect-cli
ac9032c254b8386815b3d05a9af09ac636ae955f
399d580fb17053caa438335e3c9fa68231ee857f
setup.py
https://github.com/themaxbelov/apsconnect-cli
true
false
false
@@ -11,7 +11,7 @@ install_reqs = parse_requirements(os.path.join(os.path.dirname(os.path.abspath(_ here = abspath(dirname(__file__)) -with open(join(here, 'VERSION'), encoding='utf-8') as f: +with open(join(here, 'VERSION')) as f: VERSION = f.read() setup(
with open ( join ( here , 'VERSION' ) , encoding = 'utf-8' ) as f : VERSION = f . read ( )
with open ( join ( here , 'VERSION' ) ) as f : VERSION = f . read ( )
SAME_FUNCTION_LESS_ARGS
[["Delete", [",:,", 3, 32, 3, 33]], ["Delete", ["identifier:encoding", 3, 34, 3, 42]], ["Delete", ["=:=", 3, 42, 3, 43]], ["Delete", ["string:'utf-8'", 3, 43, 3, 50]], ["Delete", ["keyword_argument", 3, 34, 3, 50]]]
themaxbelov/apsconnect-cli@ac9032c254b8386815b3d05a9af09ac636ae955f
Fix open parameters
[ { "sha": "fc745d28972b0cad96b9f15781f86738b4d96e21", "filename": "setup.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/themaxbelov/apsconnect-cli/blob/ac9032c254b8386815b3d05a9af09ac636ae955f/setup.py", "raw_url": "https://github.com/themaxbelov/apsconnect-cli/raw/ac9032c254b8386815b3d05a9af09ac636ae955f/setup.py", "contents_url": "https://api.github.com/repos/themaxbelov/apsconnect-cli/contents/setup.py?ref=ac9032c254b8386815b3d05a9af09ac636ae955f", "patch": "@@ -11,7 +11,7 @@\n \n here = abspath(dirname(__file__))\n \n-with open(join(here, 'VERSION'), encoding='utf-8') as f:\n+with open(join(here, 'VERSION')) as f:\n VERSION = f.read()\n \n setup(" } ]
apsconnect-cli
7f81185a70e9f7ac5c0e0be27ec6d79cfefe8cdb
d0c48b1b2f549ba377bd4b4643bba59569e363bf
apsconnectcli/apsconnect.py
https://github.com/themaxbelov/apsconnect-cli
true
false
true
@@ -297,7 +297,7 @@ class APSConnectUtil: print("[Success]") def install_frontend(self, source, oauth_key, oauth_secret, backend_url, settings_file=None, - network='public', hub_id=None): + network='proxy', hub_id=None): """ Install connector-frontend in Odin Automation Hub, --source can be http(s):// or filepath"""
def install_frontend ( self , source , oauth_key , oauth_secret , backend_url , settings_file = None , network = 'public' , hub_id = None ) : """ Install connector-frontend in Odin Automation Hub, --source can be http(s):// or filepath"""
def install_frontend ( self , source , oauth_key , oauth_secret , backend_url , settings_file = None , network = 'proxy' , hub_id = None ) : """ Install connector-frontend in Odin Automation Hub, --source can be http(s):// or filepath"""
CHANGE_STRING_LITERAL
[["Update", ["string:'public'", 3, 34, 3, 42], "'proxy'"]]
themaxbelov/apsconnect-cli@7f81185a70e9f7ac5c0e0be27ec6d79cfefe8cdb
Use proxy network by default
[ { "sha": "c09a193443db6b90aeb3d6f2ccafe174780eb05b", "filename": "apsconnectcli/apsconnect.py", "status": "modified", "additions": 1, "deletions": 1, "changes": 2, "blob_url": "https://github.com/themaxbelov/apsconnect-cli/blob/7f81185a70e9f7ac5c0e0be27ec6d79cfefe8cdb/apsconnectcli%2Fapsconnect.py", "raw_url": "https://github.com/themaxbelov/apsconnect-cli/raw/7f81185a70e9f7ac5c0e0be27ec6d79cfefe8cdb/apsconnectcli%2Fapsconnect.py", "contents_url": "https://api.github.com/repos/themaxbelov/apsconnect-cli/contents/apsconnectcli%2Fapsconnect.py?ref=7f81185a70e9f7ac5c0e0be27ec6d79cfefe8cdb", "patch": "@@ -297,7 +297,7 @@ def install_backend(self, name, image, config_file, hostname, healthcheck_path=N\n print(\"[Success]\")\n \n def install_frontend(self, source, oauth_key, oauth_secret, backend_url, settings_file=None,\n- network='public', hub_id=None):\n+ network='proxy', hub_id=None):\n \"\"\" Install connector-frontend in Odin Automation Hub, --source can be http(s):// or\n filepath\"\"\"\n " } ]
eclean-kernel
93fffd7dc95bb93916629d1c56df8c24adb01a4a
70af8b97fd7c90a6b881f2ba311abd79dd2ddc1a
ecleankernel/kernel.py
https://github.com/mgorny/eclean-kernel
true
false
true
@@ -86,7 +86,7 @@ class Kernel(object): def check_writable(self): for path in (self.vmlinuz, self.systemmap, self.config, self.modules, self.build): - if not os.access(path, os.W_OK): + if path is not None and not os.access(path, os.W_OK): raise OSError('%s not writable, refusing to proceed' % path) def __repr__(self):
if not os . access ( path , os . W_OK ) : raise OSError ( '%s not writable, refusing to proceed' % path )
if path is not None and not os . access ( path , os . W_OK ) : raise OSError ( '%s not writable, refusing to proceed' % path )
MORE_SPECIFIC_IF
[["Insert", ["if_statement", 3, 4, 4, 65], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Move", "N0", ["not_operator", 3, 7, 3, 35], 2], ["Insert", "N1", ["identifier:path", "T"], 0], ["Insert", "N1", ["is:is", "T"], 1], ["Insert", "N1", ["not:not", "T"], 2], ["Insert", "N1", ["none:None", "T"], 3]]
mgorny/eclean-kernel@93fffd7dc95bb93916629d1c56df8c24adb01a4a
null
null
eclean-kernel
5c4c49a1996b87518846b49e8fd971892f749b69
8fe312cf86248fd5e700fb4877021e8bd003d2fd
ecleankernel/kernel.py
https://github.com/mgorny/eclean-kernel
true
false
true
@@ -10,7 +10,7 @@ from glob import glob class PathRef(str): def __init__(self, path): - str.__init__(self, path) + str.__init__(self) self._refs = 0 def ref(self):
str . __init__ ( self , path )
str . __init__ ( self )
SAME_FUNCTION_LESS_ARGS
[["Delete", [",:,", 3, 20, 3, 21]], ["Delete", ["identifier:path", 3, 22, 3, 26]]]
mgorny/eclean-kernel@5c4c49a1996b87518846b49e8fd971892f749b69
null
null
eclean-kernel
72a58fe23c5629413a6d96dadbdccdeab801ced3
e737832fd6bebbae02385b83f7dc86536bad688a
ecleankernel/kernel.py
https://github.com/mgorny/eclean-kernel
true
false
true
@@ -144,7 +144,7 @@ class Kernel(object): buf = f.read(0x10) if buf[2:6] != b'HdrS': raise NotImplementedError('Invalid magic for kernel file %s (!= HdrS)' - % path) + % vmlinuz) offset = struct.unpack_from('H', buf, 0x0e)[0] f.seek(offset - 0x10, 1) buf = f.read(0x100) # XXX
raise NotImplementedError ( 'Invalid magic for kernel file %s (!= HdrS)' % path )
raise NotImplementedError ( 'Invalid magic for kernel file %s (!= HdrS)' % vmlinuz )
CHANGE_BINARY_OPERAND
[["Update", ["identifier:path", 3, 8, 3, 12], "vmlinuz"]]
mgorny/eclean-kernel@72a58fe23c5629413a6d96dadbdccdeab801ced3
null
null
autoreduce
4b5c75e60642d1db6f542e3a251ebd3e11b7ef7d
75d2367377c4171dc4cdfb63f49644b490708a74
autoreduce_webapp/reduction_viewer/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -251,7 +251,7 @@ def experiment_summary(request, reference_number): context_dictionary = {} #Check the users permissions - if not request.user.is_superuser and reference_number not in request.session['experiments'] and experiment_details.instrument not in request.session['owned_instruments']: + if not request.user.is_superuser and reference_number not in request.session['experiments'] and experiment_details['instrument'] not in request.session['owned_instruments']: raise PermissionDenied() return context_dictionary
if not request . user . is_superuser and reference_number not in request . session [ 'experiments' ] and experiment_details . instrument not in request . session [ 'owned_instruments' ] : raise PermissionDenied ( )
if not request . user . is_superuser and reference_number not in request . session [ 'experiments' ] and experiment_details [ 'instrument' ] not in request . session [ 'owned_instruments' ] : raise PermissionDenied ( )
SINGLE_STMT
[["Insert", ["comparison_operator", 3, 101, 3, 174], ["subscript", "N0"], 0], ["Move", "N0", ["identifier:experiment_details", 3, 101, 3, 119], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:'instrument'", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Delete", [".:.", 3, 119, 3, 120]], ["Delete", ["identifier:instrument", 3, 120, 3, 130]], ["Delete", ["attribute", 3, 101, 3, 130]]]
ISISScientificComputing/autoreduce@4b5c75e60642d1db6f542e3a251ebd3e11b7ef7d
null
null
autoreduce
330eb3368dff6b38249dfbbdc8a283d3d0798cff
74ba7b6acdb46ff29d9f32a688569f1c9b21ca00
autoreduce_webapp/autoreduce_webapp/queue_processor.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -76,7 +76,7 @@ class Listener(object): if last_run is not None: highest_version = last_run.run_version else: - highest_version = 0 + highest_version = -1 experiment, experiment_created = Experiment.objects.get_or_create(reference_number=self._data_dict['rb_number'])
highest_version = 0
highest_version = - 1
SINGLE_STMT
[["Insert", ["assignment", 3, 13, 3, 32], ["unary_operator", "N0"], 2], ["Insert", "N0", ["-:-", "T"], 0], ["Insert", "N0", ["integer:1", "T"], 1], ["Delete", ["integer:0", 3, 31, 3, 32]]]
ISISScientificComputing/autoreduce@330eb3368dff6b38249dfbbdc8a283d3d0798cff
null
null
autoreduce
c663b8cc4f2ba1b17b8dfa52de13859ebd1ec659
94e1774d99291ac4c01fb4a74892350b48120b58
rpmbuild/autoreduce-mq/usr/bin/PostProcessAdmin.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -255,7 +255,7 @@ class PostProcessAdmin: self.delete_temp_directory(reduce_result_dir) self.client.send(self.conf['reduction_complete'] , json.dumps(self.data)) - logging.info("\nCalling: "+self.conf['reduction_complete'] + "\n" + json.dumps(self.data) + "\n") + logger.info("\nCalling: "+self.conf['reduction_complete'] + "\n" + json.dumps(self.data) + "\n") except Exception, e: self.data["message"] = "REDUCTION Error: %s " % e
logging . info ( "\nCalling: " + self . conf [ 'reduction_complete' ] + "\n" + json . dumps ( self . data ) + "\n" )
logger . info ( "\nCalling: " + self . conf [ 'reduction_complete' ] + "\n" + json . dumps ( self . data ) + "\n" )
SAME_FUNCTION_WRONG_CALLER
[["Update", ["identifier:logging", 3, 13, 3, 20], "logger"]]
ISISScientificComputing/autoreduce@c663b8cc4f2ba1b17b8dfa52de13859ebd1ec659
null
null
autoreduce
7deddb0b7ac6640e282e9feb5e4e1aeb450e77e4
2199c09d08a756b4862fb8102062f714c6e54629
autoreduce_webapp/reduction_viewer/models.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -42,7 +42,7 @@ class ReductionRun(models.Model): graph = SeparatedValuesField(null=True, blank=True) hidden_in_failviewer = models.BooleanField(default=False) retry_when = models.DateTimeField(null=True, blank=True) - retry_run = models.ForeignKey('self', on_delete=models.CASCADE, null=True) + retry_run = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True) cancel = models.BooleanField(default=False) def __unicode__(self):
retry_run = models . ForeignKey ( 'self' , on_delete = models . CASCADE , null = True )
retry_run = models . ForeignKey ( 'self' , on_delete = models . SET_NULL , null = True , blank = True )
SINGLE_STMT
[["Insert", ["argument_list", 3, 34, 3, 79], [",:,", "T"], 6], ["Insert", ["argument_list", 3, 34, 3, 79], ["keyword_argument", "N0"], 7], ["Insert", "N0", ["identifier:blank", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["true:True", "T"], 2], ["Update", ["identifier:CASCADE", 3, 60, 3, 67], "SET_NULL"]]
ISISScientificComputing/autoreduce@7deddb0b7ac6640e282e9feb5e4e1aeb450e77e4
null
null
autoreduce
2c7787d5430021467084df7a6ffaf77ca46ff8dd
4333ee3906ad5fcfdae435a7459c76d09790163f
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -399,7 +399,7 @@ def run_confirmation(request, instrument): for item in range_string: if '-' in item: split_range = item.split('-') - run_numbers.extend(range(int(split_range[0]), int(split_range[1]))) + run_numbers.extend(range(int(split_range[0]), int(split_range[1])+1)) # because this is a range, the end bound is exclusive! else: run_numbers.append(int(item))
run_numbers . extend ( range ( int ( split_range [ 0 ] ) , int ( split_range [ 1 ] ) ) )
run_numbers . extend ( range ( int ( split_range [ 0 ] ) , int ( split_range [ 1 ] ) + 1 ) )
SINGLE_STMT
[["Insert", ["argument_list", 3, 45, 3, 87], ["binary_operator", "N0"], 3], ["Move", "N0", ["call", 3, 67, 3, 86], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Insert", "N0", ["integer:1", "T"], 2]]
ISISScientificComputing/autoreduce@2c7787d5430021467084df7a6ffaf77ca46ff8dd
null
null
autoreduce
1270eb6ff88a69907e1dbcd11351eed3a64dc34b
3b66721a9e590512f95582a45fec3d3686aabe91
autoreduce_webapp/reduction_variables/models.py
https://github.com/ISISScientificComputing/autoreduce
true
false
false
@@ -6,7 +6,7 @@ class Variable(models.Model): value = models.CharField(max_length=300, blank=False) type = models.CharField(max_length=50, blank=False) is_advanced = models.BooleanField(default=False) - help_text = models.CharField(max_length=300, blank=True, null=True, default='') + help_text = models.TextField(blank=True, null=True, default='') def __unicode__(self): return u'%s - %s=%s' % (self.instrument.name, self.name, self.value)
help_text = models . CharField ( max_length = 300 , blank = True , null = True , default = '' )
help_text = models . TextField ( blank = True , null = True , default = '' )
SINGLE_STMT
[["Update", ["identifier:CharField", 3, 24, 3, 33], "TextField"], ["Delete", ["identifier:max_length", 3, 34, 3, 44]], ["Delete", ["=:=", 3, 44, 3, 45]], ["Delete", ["integer:300", 3, 45, 3, 48]], ["Delete", ["keyword_argument", 3, 34, 3, 48]], ["Delete", [",:,", 3, 48, 3, 49]]]
ISISScientificComputing/autoreduce@1270eb6ff88a69907e1dbcd11351eed3a64dc34b
null
null
autoreduce
1170c440daa88a471843ace2a2898a2523ddd9b8
a6f2ad4c31838fe0985b9c4574607c7d341f18a2
autoreduce_webapp/reduction_variables/views.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -172,7 +172,7 @@ def instrument_variables(request, instrument, start=0, end=0, experiment_referen variables = InstrumentVariablesUtils().show_variables_for_run(instrument_name, start) if not editing or not variables: - variables = InstrumentVariablesUtils().get_default_variables(instrument.name) + variables = InstrumentVariablesUtils().show_variables_for_run(instrument.name) editing = False standard_vars = {}
variables = InstrumentVariablesUtils ( ) . get_default_variables ( instrument . name )
variables = InstrumentVariablesUtils ( ) . show_variables_for_run ( instrument . name )
WRONG_FUNCTION_NAME
[["Update", ["identifier:get_default_variables", 3, 52, 3, 73], "show_variables_for_run"]]
ISISScientificComputing/autoreduce@1170c440daa88a471843ace2a2898a2523ddd9b8
null
null
autoreduce
8e94f029f5be36f32770a9a47324f2e5def19508
07227f1c4813a9386da445586eb3a825e515cb21
autoreduce_webapp/autoreduce_webapp/icat_cache.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -26,7 +26,7 @@ class ICATCache(object): def __exit__(self, type, value, traceback): if self.icat is not None: - self.icat.__exit__() + self.icat.__exit__(type, value, traceback) def open_icat(self): """ Try to open an ICAT session, if we don't have one already. """
self . icat . __exit__ ( )
self . icat . __exit__ ( type , value , traceback )
SAME_FUNCTION_MORE_ARGS
[["Insert", ["argument_list", 3, 31, 3, 33], ["identifier:type", "T"], 1], ["Insert", ["argument_list", 3, 31, 3, 33], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 31, 3, 33], ["identifier:value", "T"], 3], ["Insert", ["argument_list", 3, 31, 3, 33], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 31, 3, 33], ["identifier:traceback", "T"], 5]]
ISISScientificComputing/autoreduce@8e94f029f5be36f32770a9a47324f2e5def19508
null
null
autoreduce
eb6a1c559c8b34ea5c58f012bd891fdb3a85a589
8e94f029f5be36f32770a9a47324f2e5def19508
autoreduce_webapp/autoreduce_webapp/icat_cache.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -114,7 +114,7 @@ def make_member_func(obj_type, cache_attr, list_type): # Get the attribute we want, parsing it as a list if we should. attr = getattr(new_obj, cache_attr) if list_type is not None: - attr = map(list_type, attr.split(",")) + attr = map(list_type, filter(bool, attr.split(","))) return attr return member_func
attr = map ( list_type , attr . split ( "," ) )
attr = map ( list_type , filter ( bool , attr . split ( "," ) ) )
ADD_FUNCTION_AROUND_EXPRESSION
[["Insert", ["call", 3, 35, 3, 50], ["identifier:filter", "T"], 0], ["Insert", ["call", 3, 35, 3, 50], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Insert", "N0", ["identifier:bool", "T"], 1], ["Insert", "N0", [",:,", "T"], 2], ["Move", "N0", ["call", 3, 35, 3, 50], 3], ["Insert", "N0", ["):)", "T"], 4]]
ISISScientificComputing/autoreduce@eb6a1c559c8b34ea5c58f012bd891fdb3a85a589
null
null
autoreduce
d6d2771a31181d4934a2e9d72f157a812ef5c3f3
245e0857ea4f2847a8cae07d9d1a6a76302031a4
autoreduce_webapp/reduction_variables/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -171,7 +171,7 @@ class InstrumentVariablesUtils(object): self._update_variables(variables) # Create run variables from these instrument variables, and return them. - return VariableUtils().save_run_variables(self, variables, reduction_run) + return VariableUtils().save_run_variables(variables, reduction_run) def get_current_and_upcoming_variables(self, instrument_name):
return VariableUtils ( ) . save_run_variables ( self , variables , reduction_run )
return VariableUtils ( ) . save_run_variables ( variables , reduction_run )
SAME_FUNCTION_LESS_ARGS
[["Move", [",:,", 3, 55, 3, 56], ["argument_list", 3, 50, 3, 82], 3], ["Delete", ["identifier:self", 3, 51, 3, 55]], ["Delete", [",:,", 3, 66, 3, 67]]]
ISISScientificComputing/autoreduce@d6d2771a31181d4934a2e9d72f157a812ef5c3f3
null
null
autoreduce
0e3c9502aced165d2c0dcc89f4ff1da85d4448e6
d6d2771a31181d4934a2e9d72f157a812ef5c3f3
autoreduce_webapp/reduction_viewer/utils.py
https://github.com/ISISScientificComputing/autoreduce
true
false
true
@@ -123,7 +123,7 @@ class ReductionRunUtils(object): new_job.data_location.add(new_data_location) if not variables: # provide variables if they aren't already - InstrumentVariablesUtils.create_variables_for_run(new_job) + InstrumentVariablesUtils().create_variables_for_run(new_job) return new_job
InstrumentVariablesUtils . create_variables_for_run ( new_job )
InstrumentVariablesUtils ( ) . create_variables_for_run ( new_job )
SINGLE_STMT
[["Insert", ["attribute", 3, 17, 3, 66], ["call", "N0"], 0], ["Move", "N0", ["identifier:InstrumentVariablesUtils", 3, 17, 3, 41], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]]
ISISScientificComputing/autoreduce@0e3c9502aced165d2c0dcc89f4ff1da85d4448e6
null
null