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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awx | 81c4a82db8dc12a0a7b4dd54229b6b98a9cb29de | eeaa325b101be3b89e5d995e116f2e33afaadca0 | awx/settings/production.py | https://github.com/gconsidine/awx | true | false | false | @@ -55,7 +55,7 @@ LOGGING['handlers']['socketio_service']['filename'] = '/var/log/tower/socketio_s
LOGGING['handlers']['task_system']['filename'] = '/var/log/tower/task_system.log'
LOGGING['handlers']['fact_receiver']['filename'] = '/var/log/tower/fact_receiver.log'
LOGGING['handlers']['system_tracking_migrations']['filename'] = '/var/log/tower/tower_system_tracking_migrations.log'
-LOGGING['handlers']['rbac_migrations']['filename'] = '/var/log/tower/tower_rbac_migrations.log',
+LOGGING['handlers']['rbac_migrations']['filename'] = '/var/log/tower/tower_rbac_migrations.log'
# Load settings from any .py files in the global conf.d directory specified in
# the environment, defaulting to /etc/tower/conf.d/.
| LOGGING [ 'handlers' ] [ 'rbac_migrations' ] [ 'filename' ] = '/var/log/tower/tower_rbac_migrations.log' , | LOGGING [ 'handlers' ] [ 'rbac_migrations' ] [ 'filename' ] = '/var/log/tower/tower_rbac_migrations.log' | SINGLE_STMT | [["Move", ["assignment", 3, 1, 3, 97], ["string:'/var/log/tower/tower_rbac_migrations.log'", 3, 54, 3, 96], 2], ["Delete", [",:,", 3, 96, 3, 97]], ["Delete", ["expression_list", 3, 54, 3, 97]]] | gconsidine/awx@81c4a82db8dc12a0a7b4dd54229b6b98a9cb29de | fix issue with rbac_migrations logger | [
{
"sha": "6efe6c397ddda439a880292c7a660d109f2cbd24",
"filename": "awx/settings/production.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/81c4a82db8dc12a0a7b4dd54229b6b98a9cb29de/awx%2Fsettings%2Fproduction.py",
"raw_url": "https://github.com/gconsidine/awx/raw/81c4a82db8dc12a0a7b4dd54229b6b98a9cb29de/awx%2Fsettings%2Fproduction.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsettings%2Fproduction.py?ref=81c4a82db8dc12a0a7b4dd54229b6b98a9cb29de",
"patch": "@@ -55,7 +55,7 @@\n LOGGING['handlers']['task_system']['filename'] = '/var/log/tower/task_system.log'\n LOGGING['handlers']['fact_receiver']['filename'] = '/var/log/tower/fact_receiver.log'\n LOGGING['handlers']['system_tracking_migrations']['filename'] = '/var/log/tower/tower_system_tracking_migrations.log'\n-LOGGING['handlers']['rbac_migrations']['filename'] = '/var/log/tower/tower_rbac_migrations.log',\n+LOGGING['handlers']['rbac_migrations']['filename'] = '/var/log/tower/tower_rbac_migrations.log'\n \n # Load settings from any .py files in the global conf.d directory specified in\n # the environment, defaulting to /etc/tower/conf.d/."
}
] |
awx | 574462b4f22fc562b8da8042872457874f9de05a | d3a541483ca5698feaa0555d09d2baaa1e5e8650 | awx/sso/backends.py | https://github.com/gconsidine/awx | true | false | true | @@ -239,7 +239,7 @@ def on_populate_user(sender, **kwargs):
team, created = Team.objects.get_or_create(name=team_name, organization=org)
users_opts = team_opts.get('users', None)
remove = bool(team_opts.get('remove', True))
- _update_m2m_from_groups(user, ldap_user, team.member_role.users, users_opts,
+ _update_m2m_from_groups(user, ldap_user, team.member_role.members, users_opts,
remove)
# Update user profile to store LDAP DN.
| _update_m2m_from_groups ( user , ldap_user , team . member_role . users , users_opts , remove ) | _update_m2m_from_groups ( user , ldap_user , team . member_role . members , users_opts , remove ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:users", 3, 67, 3, 72], "members"]] | gconsidine/awx@574462b4f22fc562b8da8042872457874f9de05a | Fix for populating teams for LDAP user. | [
{
"sha": "4f479b954f08f04618b5a7c0754a8e9948aadbc7",
"filename": "awx/sso/backends.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/574462b4f22fc562b8da8042872457874f9de05a/awx%2Fsso%2Fbackends.py",
"raw_url": "https://github.com/gconsidine/awx/raw/574462b4f22fc562b8da8042872457874f9de05a/awx%2Fsso%2Fbackends.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fsso%2Fbackends.py?ref=574462b4f22fc562b8da8042872457874f9de05a",
"patch": "@@ -239,7 +239,7 @@ def on_populate_user(sender, **kwargs):\n team, created = Team.objects.get_or_create(name=team_name, organization=org)\n users_opts = team_opts.get('users', None)\n remove = bool(team_opts.get('remove', True))\n- _update_m2m_from_groups(user, ldap_user, team.member_role.users, users_opts,\n+ _update_m2m_from_groups(user, ldap_user, team.member_role.members, users_opts,\n remove)\n \n # Update user profile to store LDAP DN."
}
] |
awx | a431ac785407fad120b4adcbde96060992dc96a0 | 06bb8871d787260d4153aa495ccd795fd80c997b | awx/main/tests/functional/api/test_user.py | https://github.com/gconsidine/awx | true | false | true | @@ -75,4 +75,4 @@ def test_add_user_admin_role_member(post, user):
url = reverse('api:user_roles_list', args=(admin.pk,))
response = post(url, {'id':normal.admin_role.pk}, admin)
assert response.status_code == 403
- assert 'not change membership' in response.rendered_content
+ assert 'not change the membership' in response.rendered_content
| assert 'not change membership' in response . rendered_content | assert 'not change the membership' in response . rendered_content | CHANGE_STRING_LITERAL | [["Update", ["string:'not change membership'", 3, 12, 3, 35], "'not change the membership'"]] | gconsidine/awx@a431ac785407fad120b4adcbde96060992dc96a0 | fix test | [
{
"sha": "027acc07034a912a6873301bd510efc789f1a5e5",
"filename": "awx/main/tests/functional/api/test_user.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/a431ac785407fad120b4adcbde96060992dc96a0/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_user.py",
"raw_url": "https://github.com/gconsidine/awx/raw/a431ac785407fad120b4adcbde96060992dc96a0/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_user.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_user.py?ref=a431ac785407fad120b4adcbde96060992dc96a0",
"patch": "@@ -75,4 +75,4 @@ def test_add_user_admin_role_member(post, user):\n url = reverse('api:user_roles_list', args=(admin.pk,))\n response = post(url, {'id':normal.admin_role.pk}, admin)\n assert response.status_code == 403\n- assert 'not change membership' in response.rendered_content\n+ assert 'not change the membership' in response.rendered_content"
}
] |
awx | 905ff7dad774d9afd689ccff571c7fc41552f355 | e59a724efa7bc495cc8f8f63513aa4f2206211b6 | awx/api/views.py | https://github.com/gconsidine/awx | true | false | true | @@ -627,7 +627,7 @@ class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
ask_field_name = ask_mapping[self.relationship]
- if not getattr(parent, ask_field_name):
+ if not getattr(parent.unified_job_template, ask_field_name):
return {"msg": _("Related template is not configured to accept credentials on launch.")}
elif sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]:
return {"msg": _("This launch configuration already provides a {credential_type} credential.").format(
| if not getattr ( parent , ask_field_name ) : return { "msg" : _ ( "Related template is not configured to accept credentials on launch." ) } | if not getattr ( parent . unified_job_template , ask_field_name ) : return { "msg" : _ ( "Related template is not configured to accept credentials on launch." ) } | ADD_ATTRIBUTE_ACCESS | [["Insert", ["argument_list", 3, 23, 3, 47], ["attribute", "N0"], 1], ["Move", "N0", ["identifier:parent", 3, 24, 3, 30], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:unified_job_template", "T"], 2]] | gconsidine/awx@905ff7dad774d9afd689ccff571c7fc41552f355 | fix bugs where ask_ var was checked on node | [
{
"sha": "75f523cdf65de1ee3b0d4d8c983a235833883e2a",
"filename": "awx/api/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/905ff7dad774d9afd689ccff571c7fc41552f355/awx%2Fapi%2Fviews.py",
"raw_url": "https://github.com/gconsidine/awx/raw/905ff7dad774d9afd689ccff571c7fc41552f355/awx%2Fapi%2Fviews.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=905ff7dad774d9afd689ccff571c7fc41552f355",
"patch": "@@ -627,7 +627,7 @@ def is_valid_relation(self, parent, sub, created=False):\n \n ask_field_name = ask_mapping[self.relationship]\n \n- if not getattr(parent, ask_field_name):\n+ if not getattr(parent.unified_job_template, ask_field_name):\n return {\"msg\": _(\"Related template is not configured to accept credentials on launch.\")}\n elif sub.unique_hash() in [cred.unique_hash() for cred in parent.credentials.all()]:\n return {\"msg\": _(\"This launch configuration already provides a {credential_type} credential.\").format("
}
] |
awx | b8758044e0a89d6543cc1fe46e4b11be48e51a10 | 4c40791d06010f9cbe3313dbcd607a7b010f4144 | awx/main/tasks.py | https://github.com/gconsidine/awx | true | false | true | @@ -707,7 +707,7 @@ class BaseTask(LogErrorsTask):
'hostvars': True,
}).run(buff)
json_data = buff.getvalue().strip()
- f.write("#! /usr/bin/env python\nprint '''%s'''\n" % json_data)
+ f.write('#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nprint %r\n' % json_data)
os.chmod(path, stat.S_IRUSR | stat.S_IXUSR)
return path
else:
| f . write ( "#! /usr/bin/env python\nprint '''%s'''\n" % json_data ) | f . write ( '#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nprint %r\n' % json_data ) | CHANGE_BINARY_OPERAND | [["Update", ["string:\"#! /usr/bin/env python\\nprint '''%s'''\\n\"", 3, 25, 3, 67], "'#! /usr/bin/env python\\n# -*- coding: utf-8 -*-\\nprint %r\\n'"]] | gconsidine/awx@b8758044e0a89d6543cc1fe46e4b11be48e51a10 | fix a bug in inventory generation for isolated nodes
see: https://github.com/ansible/ansible-tower/issues/7849
related: https://github.com/ansible/awx/pull/551 | [
{
"sha": "e2528d197d1b076ee09caa5b05f76578a231299a",
"filename": "awx/main/tasks.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/b8758044e0a89d6543cc1fe46e4b11be48e51a10/awx%2Fmain%2Ftasks.py",
"raw_url": "https://github.com/gconsidine/awx/raw/b8758044e0a89d6543cc1fe46e4b11be48e51a10/awx%2Fmain%2Ftasks.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=b8758044e0a89d6543cc1fe46e4b11be48e51a10",
"patch": "@@ -707,7 +707,7 @@ def build_inventory(self, instance, **kwargs):\n 'hostvars': True,\n }).run(buff)\n json_data = buff.getvalue().strip()\n- f.write(\"#! /usr/bin/env python\\nprint '''%s'''\\n\" % json_data)\n+ f.write('#! /usr/bin/env python\\n# -*- coding: utf-8 -*-\\nprint %r\\n' % json_data)\n os.chmod(path, stat.S_IRUSR | stat.S_IXUSR)\n return path\n else:"
}
] |
awx | 4a28065dbb4df058c5af8a6e192d27da28264529 | 1a98cedc0f3e3e6fb28371f7e271c162a612ea75 | awx/main/models/jobs.py | https://github.com/gconsidine/awx | true | false | true | @@ -675,7 +675,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
data.update(dict(inventory=self.inventory.name if self.inventory else None,
project=self.project.name if self.project else None,
playbook=self.playbook,
- credential=self.credential.name if self.credential else None,
+ credential=getattr(self.get_deprecated_credential('ssh'), 'name', None),
limit=self.limit,
extra_vars=self.display_extra_vars(),
hosts=all_hosts))
| data . update ( dict ( inventory = self . inventory . name if self . inventory else None , project = self . project . name if self . project else None , playbook = self . playbook , credential = self . credential . name if self . credential else None , limit = self . limit , extra_vars = self . display_extra_vars ( ) , hosts = all_hosts ) ) | data . update ( dict ( inventory = self . inventory . name if self . inventory else None , project = self . project . name if self . project else None , playbook = self . playbook , credential = getattr ( self . get_deprecated_credential ( 'ssh' ) , 'name' , None ) , limit = self . limit , extra_vars = self . display_extra_vars ( ) , hosts = all_hosts ) ) | SINGLE_STMT | [["Insert", ["keyword_argument", 3, 26, 3, 86], ["call", "N0"], 2], ["Insert", "N0", ["identifier:getattr", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["call", "N2"], 1], ["Insert", "N1", [",:,", "T"], 2], ["Insert", "N1", ["string:'name'", "T"], 3], ["Insert", "N1", [",:,", "T"], 4], ["Move", "N1", ["none:None", 3, 82, 3, 86], 5], ["Insert", "N1", ["):)", "T"], 6], ["Move", "N2", ["attribute", 3, 37, 3, 52], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Move", ["attribute", 3, 37, 3, 52], [".:.", 3, 52, 3, 53], 1], ["Update", ["identifier:credential", 3, 42, 3, 52], "get_deprecated_credential"], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["string:'ssh'", "T"], 1], ["Insert", "N3", ["):)", "T"], 2], ["Delete", [".:.", 3, 41, 3, 42]], ["Delete", ["identifier:name", 3, 53, 3, 57]], ["Delete", ["attribute", 3, 37, 3, 57]], ["Delete", ["if:if", 3, 58, 3, 60]], ["Delete", ["identifier:self", 3, 61, 3, 65]], ["Delete", [".:.", 3, 65, 3, 66]], ["Delete", ["identifier:credential", 3, 66, 3, 76]], ["Delete", ["attribute", 3, 61, 3, 76]], ["Delete", ["else:else", 3, 77, 3, 81]], ["Delete", ["conditional_expression", 3, 37, 3, 86]]] | gconsidine/awx@4a28065dbb4df058c5af8a6e192d27da28264529 | Fix notification_data attempting to access name property of an int | [
{
"sha": "b0f13b971005f6f6a4d6db9b7f3a7eb45b1ba2ee",
"filename": "awx/main/models/jobs.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/4a28065dbb4df058c5af8a6e192d27da28264529/awx%2Fmain%2Fmodels%2Fjobs.py",
"raw_url": "https://github.com/gconsidine/awx/raw/4a28065dbb4df058c5af8a6e192d27da28264529/awx%2Fmain%2Fmodels%2Fjobs.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fjobs.py?ref=4a28065dbb4df058c5af8a6e192d27da28264529",
"patch": "@@ -675,7 +675,7 @@ def notification_data(self, block=5):\n data.update(dict(inventory=self.inventory.name if self.inventory else None,\n project=self.project.name if self.project else None,\n playbook=self.playbook,\n- credential=self.credential.name if self.credential else None,\n+ credential=getattr(self.get_deprecated_credential('ssh'), 'name', None),\n limit=self.limit,\n extra_vars=self.display_extra_vars(),\n hosts=all_hosts))"
}
] |
awx | 9f8b9b8d7f367e940193493feb7c2bece473968d | 6d69087db8a02d9a690c8767a186249a7d9f729e | awx/main/tests/unit/test_tasks.py | https://github.com/gconsidine/awx | true | false | true | @@ -1757,7 +1757,7 @@ class TestInventoryUpdateCredentials(TestJobExecution):
self.instance.credential, 'password'
)
- self.instance.source_vars_dict['prefer_ipv4'] = True
+ self.instance.source_vars['prefer_ipv4'] = True
def run_pexpect_side_effect(*args, **kwargs):
args, cwd, env, stdout = args
| self . instance . source_vars_dict [ 'prefer_ipv4' ] = True | self . instance . source_vars [ 'prefer_ipv4' ] = True | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:source_vars_dict", 3, 23, 3, 39], "source_vars"]] | gconsidine/awx@9f8b9b8d7f367e940193493feb7c2bece473968d | Fix unit test | [
{
"sha": "ba8c7dde75095b0479b9e90a534fa3f2d44323ff",
"filename": "awx/main/tests/unit/test_tasks.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/9f8b9b8d7f367e940193493feb7c2bece473968d/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py",
"raw_url": "https://github.com/gconsidine/awx/raw/9f8b9b8d7f367e940193493feb7c2bece473968d/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py?ref=9f8b9b8d7f367e940193493feb7c2bece473968d",
"patch": "@@ -1757,7 +1757,7 @@ def test_cloudforms_source(self):\n self.instance.credential, 'password'\n )\n \n- self.instance.source_vars_dict['prefer_ipv4'] = True\n+ self.instance.source_vars['prefer_ipv4'] = True\n \n def run_pexpect_side_effect(*args, **kwargs):\n args, cwd, env, stdout = args"
}
] |
awx | 552b69592c97da0428bd80275459c31eb368d80c | c1b6595a0b1f0c3873aaf9e8b82cc62592a70266 | awx/main/models/mixins.py | https://github.com/gconsidine/awx | true | false | true | @@ -199,7 +199,7 @@ class SurveyJobTemplateMixin(models.Model):
errors.append("'%s' value missing" % survey_element['variable'])
elif survey_element['type'] in ["textarea", "text", "password"]:
if survey_element['variable'] in data:
- if type(data[survey_element['variable']]) not in (str, unicode):
+ if not isinstance(data[survey_element['variable']], six.string_types):
errors.append("Value %s for '%s' expected to be a string." % (data[survey_element['variable']],
survey_element['variable']))
return errors
| if type ( data [ survey_element [ 'variable' ] ] ) not in ( str , unicode ) : errors . append ( "Value %s for '%s' expected to be a string." % ( data [ survey_element [ 'variable' ] ] , survey_element [ 'variable' ] ) ) return errors | if not isinstance ( data [ survey_element [ 'variable' ] ] , six . string_types ) : errors . append ( "Value %s for '%s' expected to be a string." % ( data [ survey_element [ 'variable' ] ] , survey_element [ 'variable' ] ) ) return errors | SINGLE_STMT | [["Insert", ["if_statement", 3, 17, 6, 34], ["not_operator", "N0"], 1], ["Insert", "N0", ["not:not", "T"], 0], ["Move", "N0", ["call", 3, 20, 3, 58], 1], ["Update", ["identifier:type", 3, 20, 3, 24], "isinstance"], ["Insert", ["argument_list", 3, 24, 3, 58], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 24, 3, 58], ["attribute", "N1"], 3], ["Insert", "N1", ["identifier:six", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:string_types", "T"], 2], ["Delete", ["not:not", 3, 59, 3, 62]], ["Delete", ["in:in", 3, 63, 3, 65]], ["Delete", ["(:(", 3, 66, 3, 67]], ["Delete", ["identifier:str", 3, 67, 3, 70]], ["Delete", [",:,", 3, 70, 3, 71]], ["Delete", ["identifier:unicode", 3, 72, 3, 79]], ["Delete", ["):)", 3, 79, 3, 80]], ["Delete", ["tuple", 3, 66, 3, 80]], ["Delete", ["comparison_operator", 3, 20, 3, 80]]] | gconsidine/awx@552b69592c97da0428bd80275459c31eb368d80c | six.string_types in mixins.py | [
{
"sha": "0db9ebb5fb183387d7e7ba1336a2eb1b20fdf9ac",
"filename": "awx/main/models/mixins.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/552b69592c97da0428bd80275459c31eb368d80c/awx%2Fmain%2Fmodels%2Fmixins.py",
"raw_url": "https://github.com/gconsidine/awx/raw/552b69592c97da0428bd80275459c31eb368d80c/awx%2Fmain%2Fmodels%2Fmixins.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fmixins.py?ref=552b69592c97da0428bd80275459c31eb368d80c",
"patch": "@@ -199,7 +199,7 @@ def _survey_element_validation(self, survey_element, data, validate_required=Tru\n errors.append(\"'%s' value missing\" % survey_element['variable'])\n elif survey_element['type'] in [\"textarea\", \"text\", \"password\"]:\n if survey_element['variable'] in data:\n- if type(data[survey_element['variable']]) not in (str, unicode):\n+ if not isinstance(data[survey_element['variable']], six.string_types):\n errors.append(\"Value %s for '%s' expected to be a string.\" % (data[survey_element['variable']],\n survey_element['variable']))\n return errors"
}
] |
awx | 4270e3a17be0f8f3663afb1197dd5691106f04ea | 098f4eb198c518aa8c20eedbfe2b6a2a5373c210 | awx/main/tests/unit/test_validators.py | https://github.com/gconsidine/awx | true | false | true | @@ -26,7 +26,7 @@ def test_invalid_keys():
"-----BEGIN FOO-----foobar---END FOO----",
"----- BEGIN FOO ----- foobar ----- FAIL FOO ----",
"----- FAIL FOO ----- foobar ----- END FOO ----",
- "----BEGIN FOO----foobar----END BAR----"
+ "----BEGIN FOO----foobar----END BAR----",
]
for invalid_key in invalid_keys:
with pytest.raises(ValidationError):
| "----BEGIN FOO----foobar----END BAR----" | "----BEGIN FOO----foobar----END BAR----" , | SINGLE_STMT | [["Insert", ["expression_statement", 3, 9, 3, 49], [",:,", "T"], 1]] | gconsidine/awx@4270e3a17be0f8f3663afb1197dd5691106f04ea | [bugfix] updated pem validation unit tests | [
{
"sha": "a44f78b53cd678d20e7586cfbbaf4e44aa242f37",
"filename": "awx/main/tests/unit/test_validators.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/4270e3a17be0f8f3663afb1197dd5691106f04ea/awx%2Fmain%2Ftests%2Funit%2Ftest_validators.py",
"raw_url": "https://github.com/gconsidine/awx/raw/4270e3a17be0f8f3663afb1197dd5691106f04ea/awx%2Fmain%2Ftests%2Funit%2Ftest_validators.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Funit%2Ftest_validators.py?ref=4270e3a17be0f8f3663afb1197dd5691106f04ea",
"patch": "@@ -26,7 +26,7 @@ def test_invalid_keys():\n \"-----BEGIN FOO-----foobar---END FOO----\",\n \"----- BEGIN FOO ----- foobar ----- FAIL FOO ----\",\n \"----- FAIL FOO ----- foobar ----- END FOO ----\",\n- \"----BEGIN FOO----foobar----END BAR----\"\n+ \"----BEGIN FOO----foobar----END BAR----\",\n ]\n for invalid_key in invalid_keys:\n with pytest.raises(ValidationError):"
}
] |
awx | c900027f82226fa3c3e8706971bf44a13da2b84f | c3968ca2b684a5c7132c71ba08e07ef52f337b4d | awx/api/serializers.py | https://github.com/gconsidine/awx | true | false | true | @@ -998,7 +998,7 @@ class OAuth2ApplicationSerializer(BaseSerializer):
def to_representation(self, obj):
ret = super(OAuth2ApplicationSerializer, self).to_representation(obj)
if obj.client_type == 'public':
- ret.pop('client_secret')
+ ret.pop('client_secret', None)
return ret
| ret . pop ( 'client_secret' ) | ret . pop ( 'client_secret' , None ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 20, 3, 37], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 20, 3, 37], ["none:None", "T"], 3]] | gconsidine/awx@c900027f82226fa3c3e8706971bf44a13da2b84f | fix server error with absent client_secret | [
{
"sha": "054d0573dd9b7ab43f6632087235134935d67a60",
"filename": "awx/api/serializers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/c900027f82226fa3c3e8706971bf44a13da2b84f/awx%2Fapi%2Fserializers.py",
"raw_url": "https://github.com/gconsidine/awx/raw/c900027f82226fa3c3e8706971bf44a13da2b84f/awx%2Fapi%2Fserializers.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=c900027f82226fa3c3e8706971bf44a13da2b84f",
"patch": "@@ -998,7 +998,7 @@ class Meta:\n def to_representation(self, obj):\n ret = super(OAuth2ApplicationSerializer, self).to_representation(obj)\n if obj.client_type == 'public':\n- ret.pop('client_secret')\n+ ret.pop('client_secret', None)\n return ret\n \n "
}
] |
aetherbot | b6760efce9a74a06fe09d07affefc1ba26f05a22 | 766679c6ad29dbeecbb748c97696f4c3590c7631 | core/main.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -5,7 +5,7 @@ import re
:type bot: core.bot.CloudBot
- :type conn: core.irc.BotConnection
+ :type conn: core.connection.BotConnection
:type raw: str
:type prefix: str
:type command: str
| conn : core . irc . BotConnection | conn : core . connection . BotConnection | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:irc", 1, 22, 1, 25], "connection"]] | ihatevim/aetherbot@b6760efce9a74a06fe09d07affefc1ba26f05a22 | Fix doc string in Input | [
{
"sha": "4ae5dbd292eb849056ac6bd15fa5e053508c052a",
"filename": "core/main.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/b6760efce9a74a06fe09d07affefc1ba26f05a22/core%2Fmain.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/b6760efce9a74a06fe09d07affefc1ba26f05a22/core%2Fmain.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=b6760efce9a74a06fe09d07affefc1ba26f05a22",
"patch": "@@ -5,7 +5,7 @@\n class Input:\n \"\"\"\n :type bot: core.bot.CloudBot\n- :type conn: core.irc.BotConnection\n+ :type conn: core.connection.BotConnection\n :type raw: str\n :type prefix: str\n :type command: str"
}
] |
aetherbot | ea4d180d53bbb9c83052d6a2c9a39ff387452d22 | 4906d5c167dfa39e1789d25a7391c09a62753fe7 | modules/time_plugin.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -1,7 +1,7 @@
import time
from cloudbot import hook, http
-from cloudbot.formatting import capitalize_first
+from cloudbot.util.formatting import capitalize_first
api_url = 'http://api.wolframalpha.com/v2/query?format=plaintext'
| from cloudbot . formatting import capitalize_first | from cloudbot . util . formatting import capitalize_first | SINGLE_STMT | [["Insert", ["dotted_name", 3, 6, 3, 25], ["identifier:util", "T"], 2], ["Insert", ["dotted_name", 3, 6, 3, 25], [".:.", "T"], 3]] | ihatevim/aetherbot@ea4d180d53bbb9c83052d6a2c9a39ff387452d22 | null | null |
awx | c35c2d933190a8ee4ec6204ba5782ae33310facb | bf3c68d8b4124abc4c5f7c03bf8cd1313cbb04c9 | awx/main/models/workflow.py | https://github.com/gconsidine/awx | true | false | true | @@ -175,7 +175,7 @@ class WorkflowJobInheritNodesMixin(object):
def _get_workflow_job_node_by_id(self, id):
return WorkflowJobNode.objects.get(id=id)
- def _get_all_by_type(node, node_type):
+ def _get_all_by_type(self, node, node_type):
return getattr(node, node_type).all()
def inherit_job_template_workflow_nodes(self):
| def _get_all_by_type ( node , node_type ) : return getattr ( node , node_type ) . all ( ) | def _get_all_by_type ( self , node , node_type ) : return getattr ( node , node_type ) . all ( ) | SINGLE_STMT | [["Move", ["identifier:node", 3, 26, 3, 30], ["parameters", 3, 25, 3, 42], 2], ["Insert", ["parameters", 3, 25, 3, 42], ["identifier:self", "T"], 1], ["Insert", ["parameters", 3, 25, 3, 42], [",:,", "T"], 3]] | gconsidine/awx@c35c2d933190a8ee4ec6204ba5782ae33310facb | fix class method | [
{
"sha": "3c95fb17e8fd57f46619357a15f46b03af04577a",
"filename": "awx/main/models/workflow.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/c35c2d933190a8ee4ec6204ba5782ae33310facb/awx%2Fmain%2Fmodels%2Fworkflow.py",
"raw_url": "https://github.com/gconsidine/awx/raw/c35c2d933190a8ee4ec6204ba5782ae33310facb/awx%2Fmain%2Fmodels%2Fworkflow.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fworkflow.py?ref=c35c2d933190a8ee4ec6204ba5782ae33310facb",
"patch": "@@ -175,7 +175,7 @@ def _get_workflow_job_template_nodes(self):\n def _get_workflow_job_node_by_id(self, id):\n return WorkflowJobNode.objects.get(id=id)\n \n- def _get_all_by_type(node, node_type):\n+ def _get_all_by_type(self, node, node_type):\n return getattr(node, node_type).all()\n \n def inherit_job_template_workflow_nodes(self):"
}
] |
awx | e1ace0ba0a5f27f748cdde42c8c0526d5d44b007 | f23a87e5a0444525e0d709fb99e0344731a168bb | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -1527,7 +1527,7 @@ class WorkflowJobAccess(BaseAccess):
return self.user in obj.workflow_job_template.admin_role
# TODO: add support for relaunching workflow jobs
- def can_start(self, obj):
+ def can_start(self, obj, validate_license=True):
return False
def can_cancel(self, obj):
| def can_start ( self , obj ) : return False | def can_start ( self , obj , validate_license = True ) : return False | SINGLE_STMT | [["Insert", ["parameters", 3, 18, 3, 29], [",:,", "T"], 4], ["Insert", ["parameters", 3, 18, 3, 29], ["default_parameter", "N0"], 5], ["Insert", "N0", ["identifier:validate_license", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["true:True", "T"], 2]] | gconsidine/awx@e1ace0ba0a5f27f748cdde42c8c0526d5d44b007 | extend license fix to workflow jobs | [
{
"sha": "b0a15b275142823566b631446cad0a72577f9633",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/e1ace0ba0a5f27f748cdde42c8c0526d5d44b007/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/e1ace0ba0a5f27f748cdde42c8c0526d5d44b007/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=e1ace0ba0a5f27f748cdde42c8c0526d5d44b007",
"patch": "@@ -1527,7 +1527,7 @@ def can_delete(self, obj):\n return self.user in obj.workflow_job_template.admin_role\n \n # TODO: add support for relaunching workflow jobs\n- def can_start(self, obj):\n+ def can_start(self, obj, validate_license=True):\n return False\n \n def can_cancel(self, obj):"
}
] |
awx | ca32c5fd2122dc25b178386e10f14d8efee47d7f | 4562faa85800831561a5e067fc84db21fdfcb88a | awx/main/tasks.py | https://github.com/gconsidine/awx | true | false | true | @@ -1116,7 +1116,7 @@ class RunProjectUpdate(BaseTask):
args.append('-v')
scm_url, extra_vars = self._build_scm_url_extra_vars(project_update,
**kwargs)
- if project_update.project.scm_revision and project_update.job_type == 'check':
+ if project_update.project.scm_revision and project_update.job_type == 'run':
scm_branch = project_update.project.scm_revision
else:
scm_branch = project_update.scm_branch or {'hg': 'tip'}.get(project_update.scm_type, 'HEAD')
| if project_update . project . scm_revision and project_update . job_type == 'check' : scm_branch = project_update . project . scm_revision else : scm_branch = project_update . scm_branch or { 'hg' : 'tip' } . get ( project_update . scm_type , 'HEAD' ) | if project_update . project . scm_revision and project_update . job_type == 'run' : scm_branch = project_update . project . scm_revision else : scm_branch = project_update . scm_branch or { 'hg' : 'tip' } . get ( project_update . scm_type , 'HEAD' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'check'", 3, 79, 3, 86], "'run'"]] | gconsidine/awx@ca32c5fd2122dc25b178386e10f14d8efee47d7f | scm_revision should be used for job_type `run` | [
{
"sha": "456ad6293c381c2ad7dcb0562c2a82108a179526",
"filename": "awx/main/tasks.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/ca32c5fd2122dc25b178386e10f14d8efee47d7f/awx%2Fmain%2Ftasks.py",
"raw_url": "https://github.com/gconsidine/awx/raw/ca32c5fd2122dc25b178386e10f14d8efee47d7f/awx%2Fmain%2Ftasks.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftasks.py?ref=ca32c5fd2122dc25b178386e10f14d8efee47d7f",
"patch": "@@ -1116,7 +1116,7 @@ def build_args(self, project_update, **kwargs):\n args.append('-v')\n scm_url, extra_vars = self._build_scm_url_extra_vars(project_update,\n **kwargs)\n- if project_update.project.scm_revision and project_update.job_type == 'check':\n+ if project_update.project.scm_revision and project_update.job_type == 'run':\n scm_branch = project_update.project.scm_revision\n else:\n scm_branch = project_update.scm_branch or {'hg': 'tip'}.get(project_update.scm_type, 'HEAD')"
}
] |
awx | 23af9d6b729bdbf762cd0be22d40eab610fc218a | f74a3c75deaa4c076b174e2bac3dd76a39d7cd3f | awx/main/models/jobs.py | https://github.com/gconsidine/awx | true | false | true | @@ -1210,7 +1210,7 @@ class JobEvent(CreatedModifiedModel):
if isinstance(invocation, dict) and verbosity == 0 and 'module_args' in invocation:
event_data['res']['invocation']['module_args'] = ''
self.event_data = event_data
- update_fields.add('event_data')
+ updated_fields.add('event_data')
if self.event == 'playbook_on_stats':
try:
failures_dict = event_data.get('failures', {})
| update_fields . add ( 'event_data' ) | updated_fields . add ( 'event_data' ) | SAME_FUNCTION_WRONG_CALLER | [["Update", ["identifier:update_fields", 3, 17, 3, 30], "updated_fields"]] | gconsidine/awx@23af9d6b729bdbf762cd0be22d40eab610fc218a | fix bug blocking jobs from running | [
{
"sha": "3377968ebab0a3c04dcc584d60195dabec0470ab",
"filename": "awx/main/models/jobs.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/23af9d6b729bdbf762cd0be22d40eab610fc218a/awx%2Fmain%2Fmodels%2Fjobs.py",
"raw_url": "https://github.com/gconsidine/awx/raw/23af9d6b729bdbf762cd0be22d40eab610fc218a/awx%2Fmain%2Fmodels%2Fjobs.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fjobs.py?ref=23af9d6b729bdbf762cd0be22d40eab610fc218a",
"patch": "@@ -1210,7 +1210,7 @@ def _update_from_event_data(self):\n if isinstance(invocation, dict) and verbosity == 0 and 'module_args' in invocation:\n event_data['res']['invocation']['module_args'] = ''\n self.event_data = event_data\n- update_fields.add('event_data')\n+ updated_fields.add('event_data')\n if self.event == 'playbook_on_stats':\n try:\n failures_dict = event_data.get('failures', {})"
}
] |
awx | cd14b62b23f14b3120a843de0731da23d033bc00 | a80c8077d20a3598b94c2ac2a4a9c65022daf114 | awx/main/models/workflow.py | https://github.com/gconsidine/awx | true | false | true | @@ -290,7 +290,7 @@ class WorkflowJobTemplate(UnifiedJobTemplate, WorkflowJobOptions, ResourceMixin)
@classmethod
def _get_unified_job_field_names(cls):
- return ['name', 'description', 'job_type', 'extra_vars', 'labels', 'schedule']
+ return ['name', 'description', 'extra_vars', 'labels', 'schedule', 'launch_type']
def get_absolute_url(self):
return reverse('api:workflow_job_template_detail', args=(self.pk,))
| return [ 'name' , 'description' , 'job_type' , 'extra_vars' , 'labels' , 'schedule' ] | return [ 'name' , 'description' , 'extra_vars' , 'labels' , 'schedule' , 'launch_type' ] | SINGLE_STMT | [["Move", [",:,", 3, 50, 3, 51], ["list", 3, 16, 3, 87], 7], ["Move", [",:,", 3, 64, 3, 65], ["list", 3, 16, 3, 87], 10], ["Move", [",:,", 3, 74, 3, 75], ["list", 3, 16, 3, 87], 11], ["Insert", ["list", 3, 16, 3, 87], ["string:'launch_type'", "T"], 11], ["Delete", ["string:'job_type'", 3, 40, 3, 50]]] | gconsidine/awx@cd14b62b23f14b3120a843de0731da23d033bc00 | typo fix. | [
{
"sha": "158efabeb48fe30cc905b4ef5381687315873b6e",
"filename": "awx/main/models/workflow.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/cd14b62b23f14b3120a843de0731da23d033bc00/awx%2Fmain%2Fmodels%2Fworkflow.py",
"raw_url": "https://github.com/gconsidine/awx/raw/cd14b62b23f14b3120a843de0731da23d033bc00/awx%2Fmain%2Fmodels%2Fworkflow.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmodels%2Fworkflow.py?ref=cd14b62b23f14b3120a843de0731da23d033bc00",
"patch": "@@ -290,7 +290,7 @@ def _get_unified_job_class(cls):\n \n @classmethod\n def _get_unified_job_field_names(cls):\n- return ['name', 'description', 'job_type', 'extra_vars', 'labels', 'schedule']\n+ return ['name', 'description', 'extra_vars', 'labels', 'schedule', 'launch_type']\n \n def get_absolute_url(self):\n return reverse('api:workflow_job_template_detail', args=(self.pk,))"
}
] |
awx | 1aa6ab72d6a5acf84662a01fe712ae3e73b9a113 | 6bcd0f52595736e31a69dfd11f949faa897597c2 | awx/main/scheduler/partial.py | https://github.com/gconsidine/awx | true | false | false | @@ -61,7 +61,7 @@ class JobDict(PartialModelDict):
'id', 'status', 'job_template_id', 'inventory_id', 'project_id',
'launch_type', 'limit', 'allow_simultaneous', 'created',
'job_type', 'celery_task_id', 'project__scm_update_on_launch',
- 'forks', 'inventory__inventory_sources',
+ 'forks',
)
model = Job
| 'forks' , 'inventory__inventory_sources' , | 'forks' , | SINGLE_STMT | [["Delete", ["string:'inventory__inventory_sources'", 3, 18, 3, 48]], ["Delete", [",:,", 3, 48, 3, 49]]] | gconsidine/awx@1aa6ab72d6a5acf84662a01fe712ae3e73b9a113 | fixes multiple proj updates running for single job
related to #3906 | [
{
"sha": "c6b8a2e575442612a512125d421563a8338018e4",
"filename": "awx/main/scheduler/partial.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/1aa6ab72d6a5acf84662a01fe712ae3e73b9a113/awx%2Fmain%2Fscheduler%2Fpartial.py",
"raw_url": "https://github.com/gconsidine/awx/raw/1aa6ab72d6a5acf84662a01fe712ae3e73b9a113/awx%2Fmain%2Fscheduler%2Fpartial.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fscheduler%2Fpartial.py?ref=1aa6ab72d6a5acf84662a01fe712ae3e73b9a113",
"patch": "@@ -61,7 +61,7 @@ class JobDict(PartialModelDict):\n 'id', 'status', 'job_template_id', 'inventory_id', 'project_id', \n 'launch_type', 'limit', 'allow_simultaneous', 'created', \n 'job_type', 'celery_task_id', 'project__scm_update_on_launch',\n- 'forks', 'inventory__inventory_sources',\n+ 'forks',\n )\n model = Job\n "
}
] |
awx | 9f40e7ef70bf95729939dae5daff0a9fb1659c51 | fb7be12110d7cf247bda5887bcdf32243f059a57 | awx/main/tests/unit/test_tasks.py | https://github.com/gconsidine/awx | true | false | true | @@ -34,7 +34,7 @@ def test_send_notifications_list(mocker):
mock_job = mocker.MagicMock(spec=UnifiedJob)
patches.append(mocker.patch('awx.main.models.UnifiedJob.objects.get', return_value=mock_job))
- mock_notification = mocker.MagicMock(spec=Notification, subject="test")
+ mock_notification = mocker.MagicMock(spec=Notification, subject="test", body={ 'hello': 'world' })
patches.append(mocker.patch('awx.main.models.Notification.objects.get', return_value=mock_notification))
with apply_patches(patches):
| mock_notification = mocker . MagicMock ( spec = Notification , subject = "test" ) | mock_notification = mocker . MagicMock ( spec = Notification , subject = "test" , body = { 'hello' : 'world' } ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 41, 3, 76], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 41, 3, 76], ["keyword_argument", "N0"], 5], ["Insert", "N0", ["identifier:body", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["dictionary", "N1"], 2], ["Insert", "N1", ["{:{", "T"], 0], ["Insert", "N1", ["pair", "N2"], 1], ["Insert", "N1", ["}:}", "T"], 2], ["Insert", "N2", ["string:'hello'", "T"], 0], ["Insert", "N2", [":::", "T"], 1], ["Insert", "N2", ["string:'world'", "T"], 2]] | gconsidine/awx@9f40e7ef70bf95729939dae5daff0a9fb1659c51 | fix notification unit test mock | [
{
"sha": "ff2faf63a44bec1ec1e0dcedaf7f11225955bcaf",
"filename": "awx/main/tests/unit/test_tasks.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/9f40e7ef70bf95729939dae5daff0a9fb1659c51/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py",
"raw_url": "https://github.com/gconsidine/awx/raw/9f40e7ef70bf95729939dae5daff0a9fb1659c51/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Funit%2Ftest_tasks.py?ref=9f40e7ef70bf95729939dae5daff0a9fb1659c51",
"patch": "@@ -34,7 +34,7 @@ def test_send_notifications_list(mocker):\n mock_job = mocker.MagicMock(spec=UnifiedJob)\n patches.append(mocker.patch('awx.main.models.UnifiedJob.objects.get', return_value=mock_job))\n \n- mock_notification = mocker.MagicMock(spec=Notification, subject=\"test\")\n+ mock_notification = mocker.MagicMock(spec=Notification, subject=\"test\", body={ 'hello': 'world' })\n patches.append(mocker.patch('awx.main.models.Notification.objects.get', return_value=mock_notification))\n \n with apply_patches(patches):"
}
] |
awx | c32185312b72238d9e58f5fde5abad58ac792299 | c80a7504579077163ddf3aa0980e5b524432633c | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -1554,7 +1554,7 @@ class WorkflowJobTemplateAccess(BaseAccess):
is_delete_allowed = self.user.is_superuser or self.user in obj.admin_role
if not is_delete_allowed:
return False
- active_jobs = [dict(type="job", id=o.id)
+ active_jobs = [dict(type="workflow_job", id=o.id)
for o in obj.jobs.filter(status__in=ACTIVE_STATES)]
if len(active_jobs) > 0:
raise StateConflict({"conflict": _("Resource is being used by running jobs"),
| active_jobs = [ dict ( type = "job" , id = o . id ) for o in obj . jobs . filter ( status__in = ACTIVE_STATES ) ] | active_jobs = [ dict ( type = "workflow_job" , id = o . id ) for o in obj . jobs . filter ( status__in = ACTIVE_STATES ) ] | CHANGE_STRING_LITERAL | [["Update", ["string:\"job\"", 3, 34, 3, 39], "\"workflow_job\""]] | gconsidine/awx@c32185312b72238d9e58f5fde5abad58ac792299 | Rename type in wfjt delete conflict message. | [
{
"sha": "20d5ae508f0649b8c866146f3e22c5b4c277e6b7",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/c32185312b72238d9e58f5fde5abad58ac792299/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/c32185312b72238d9e58f5fde5abad58ac792299/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=c32185312b72238d9e58f5fde5abad58ac792299",
"patch": "@@ -1554,7 +1554,7 @@ def can_delete(self, obj):\n is_delete_allowed = self.user.is_superuser or self.user in obj.admin_role\n if not is_delete_allowed:\n return False\n- active_jobs = [dict(type=\"job\", id=o.id)\n+ active_jobs = [dict(type=\"workflow_job\", id=o.id)\n for o in obj.jobs.filter(status__in=ACTIVE_STATES)]\n if len(active_jobs) > 0:\n raise StateConflict({\"conflict\": _(\"Resource is being used by running jobs\"),"
}
] |
aetherbot | bfa42ea22056e7a7ffa4c944c95f161e688d90e3 | 950aa9e5a93b0cda59c7212025f9c254a749154a | plugins/sieve.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -32,7 +32,7 @@ def sieve_suite(bot, input, func, kind, args):
if args.get('adminonly', False):
admins = bot.config.get('admins', [])
- if input.nick not in admins and input.mask not in admins:
+ if input.nick.lower() not in admins and input.mask.lower() not in admins:
input.notice("Sorry, you are not allowed to use this command.")
return None
| if input . nick not in admins and input . mask not in admins : input . notice ( "Sorry, you are not allowed to use this command." ) return None | if input . nick . lower ( ) not in admins and input . mask . lower ( ) not in admins : input . notice ( "Sorry, you are not allowed to use this command." ) return None | SINGLE_STMT | [["Insert", ["comparison_operator", 3, 12, 3, 36], ["call", "N0"], 0], ["Insert", ["comparison_operator", 3, 41, 3, 65], ["call", "N1"], 0], ["Insert", "N0", ["attribute", "N2"], 0], ["Insert", "N0", ["argument_list", "N3"], 1], ["Insert", "N1", ["attribute", "N4"], 0], ["Insert", "N1", ["argument_list", "N5"], 1], ["Move", "N2", ["attribute", 3, 12, 3, 22], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:lower", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["):)", "T"], 1], ["Move", "N4", ["attribute", 3, 41, 3, 51], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:lower", "T"], 2], ["Insert", "N5", ["(:(", "T"], 0], ["Insert", "N5", ["):)", "T"], 1]] | ihatevim/aetherbot@bfa42ea22056e7a7ffa4c944c95f161e688d90e3 | null | null |
aetherbot | f9ddfaaad5435f1c1d24aa112393448920b03856 | 378b5442189719d94845f01c92e95e7595880c93 | plugins/feelings.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -52,5 +52,5 @@ def flirt(inp, nick=None, me=None, conn=None):
else:
target = inp
- out = 'insults %s... "%s"' % (target, random.choice(flirts))
+ out = 'flirts with %s... "%s"' % (target, random.choice(flirts))
me(out)
| out = 'insults %s... "%s"' % ( target , random . choice ( flirts ) ) | out = 'flirts with %s... "%s"' % ( target , random . choice ( flirts ) ) | CHANGE_BINARY_OPERAND | [["Update", ["string:'insults %s... \"%s\"'", 3, 11, 3, 31], "'flirts with %s... \"%s\"'"]] | ihatevim/aetherbot@f9ddfaaad5435f1c1d24aa112393448920b03856 | null | null |
aetherbot | 39744d714a11fb7ed9835cafd192406a74772092 | 1670e1d8ac313808f05df3a2bf6d4e67d5ae78ac | plugins/misc.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -52,7 +52,7 @@ def onjoin(paraml, conn=None, bot=None):
time.sleep(1)
# Stay-alive code
- stayalive = conn.conf.get('stayalive')
+ stayalive = conn.conf.get('stayalive', False)
if stayalive:
delay = conn.conf.get('stayalive_delay', 20)
while True:
| stayalive = conn . conf . get ( 'stayalive' ) | stayalive = conn . conf . get ( 'stayalive' , False ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 30, 3, 43], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 30, 3, 43], ["false:False", "T"], 3]] | ihatevim/aetherbot@39744d714a11fb7ed9835cafd192406a74772092 | null | null |
aetherbot | 5f43d70f9739c64c5c7925843ce00ba9d2e36495 | 50ddc623868ca35c6f0a36732d77bf84448be3d3 | plugins/fortune.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -11,7 +11,7 @@ with open("plugins/data/fortunes.txt") as f:
fortunes.append(line.strip())
-@hook.command
+@hook.command(autohelp=False)
def fortune(inp):
".fortune -- Fortune cookies on demand."
return random.choice(fortunes)
| @ hook . command def fortune ( inp ) : ".fortune -- Fortune cookies on demand." return random . choice ( fortunes ) | @ hook . command ( autohelp = False ) def fortune ( inp ) : ".fortune -- Fortune cookies on demand." return random . choice ( fortunes ) | SINGLE_STMT | [["Insert", ["decorator", 3, 1, 3, 14], ["call", "N0"], 1], ["Move", "N0", ["attribute", 3, 2, 3, 14], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["keyword_argument", "N2"], 1], ["Insert", "N1", ["):)", "T"], 2], ["Insert", "N2", ["identifier:autohelp", "T"], 0], ["Insert", "N2", ["=:=", "T"], 1], ["Insert", "N2", ["false:False", "T"], 2]] | ihatevim/aetherbot@5f43d70f9739c64c5c7925843ce00ba9d2e36495 | Fixed bug in plugins/fortune.py | [
{
"sha": "cb1d965461dbaaf1ce4890a71311dde822ee76e4",
"filename": "plugins/fortune.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/5f43d70f9739c64c5c7925843ce00ba9d2e36495/plugins%2Ffortune.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/5f43d70f9739c64c5c7925843ce00ba9d2e36495/plugins%2Ffortune.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Ffortune.py?ref=5f43d70f9739c64c5c7925843ce00ba9d2e36495",
"patch": "@@ -11,7 +11,7 @@\n fortunes.append(line.strip())\n \n \n-@hook.command\n+@hook.command(autohelp=False)\n def fortune(inp):\n \".fortune -- Fortune cookies on demand.\"\n return random.choice(fortunes)"
}
] |
aetherbot | 005bc0457e86652289e552876ceb967bb824215d | a9927eca90113ebb13350cd1bde4260f2054d0ea | plugins/google.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -23,7 +23,7 @@ def googleimage(inp):
if not parsed['responseData']['results']:
return 'no images found'
return random.choice(parsed['responseData']['results'][:10])\
- + ['unescapedUrl']
+ ['unescapedUrl']
@hook.command('search')
| return random . choice ( parsed [ 'responseData' ] [ 'results' ] [ : 10 ] ) + [ 'unescapedUrl' ] | return random . choice ( parsed [ 'responseData' ] [ 'results' ] [ : 10 ] ) [ 'unescapedUrl' ] | SINGLE_STMT | [["Insert", ["return_statement", 2, 5, 3, 43], ["subscript", "N0"], 1], ["Move", "N0", ["call", 2, 12, 2, 65], 0], ["Move", "N0", ["[:[", 3, 27, 3, 28], 1], ["Move", "N0", ["string:'unescapedUrl'", 3, 28, 3, 42], 2], ["Move", "N0", ["]:]", 3, 42, 3, 43], 3], ["Delete", ["+:+", 3, 25, 3, 26]], ["Delete", ["list", 3, 27, 3, 43]], ["Delete", ["binary_operator", 2, 12, 3, 43]]] | ihatevim/aetherbot@005bc0457e86652289e552876ceb967bb824215d | Dear @NeerSighted, please test your 'fixes' before committing. Love, Luke | [
{
"sha": "591474c30c61597cebf757ba74fc2e2496cea75c",
"filename": "plugins/google.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/005bc0457e86652289e552876ceb967bb824215d/plugins%2Fgoogle.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/005bc0457e86652289e552876ceb967bb824215d/plugins%2Fgoogle.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fgoogle.py?ref=005bc0457e86652289e552876ceb967bb824215d",
"patch": "@@ -23,7 +23,7 @@ def googleimage(inp):\n if not parsed['responseData']['results']:\n return 'no images found'\n return random.choice(parsed['responseData']['results'][:10])\\\n- + ['unescapedUrl']\n+ ['unescapedUrl']\n \n \n @hook.command('search')"
}
] |
aetherbot | ac86a78e2c582bc319bd3318fbcb9139fd88e735 | 39664a6217e89628142d5aa4ade7e209dbe25b45 | core/main.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -140,7 +140,7 @@ def match_command(command):
def main(conn, out):
inp = Input(conn, *out)
- commandprefix = conn.conf.get('command_prefix', '.')
+ command_prefix = conn.conf.get('command_prefix', '.')
# EVENTS
for func, args in bot.events[inp.command] + bot.events['*']:
| commandprefix = conn . conf . get ( 'command_prefix' , '.' ) | command_prefix = conn . conf . get ( 'command_prefix' , '.' ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:commandprefix", 3, 5, 3, 18], "command_prefix"]] | ihatevim/aetherbot@ac86a78e2c582bc319bd3318fbcb9139fd88e735 | Critical Bug Fix | [
{
"sha": "62e6960a1244e65e18eb87c91c95c16aae7716f4",
"filename": "core/main.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/ac86a78e2c582bc319bd3318fbcb9139fd88e735/core%2Fmain.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/ac86a78e2c582bc319bd3318fbcb9139fd88e735/core%2Fmain.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=ac86a78e2c582bc319bd3318fbcb9139fd88e735",
"patch": "@@ -140,7 +140,7 @@ def match_command(command):\n \n def main(conn, out):\n inp = Input(conn, *out)\n- commandprefix = conn.conf.get('command_prefix', '.')\n+ command_prefix = conn.conf.get('command_prefix', '.')\n \n # EVENTS\n for func, args in bot.events[inp.command] + bot.events['*']:"
}
] |
aetherbot | 28301e62e1b2f8ba0d960cff59f70c4d0e0dddbc | b22f20d8ac91bce78417c1909c137ac92fdc984b | plugins/mctools.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -56,7 +56,7 @@ def mclogin(inp, say=None):
return "I logged in with %s" % username
else:
return "I couldn't log in using %s, either the password is wrong or " \
- "Minecraft login servers are down!"
+ "Minecraft login servers are down!" % username
@hook.command
| "I couldn't log in using %s, either the password is wrong or " "Minecraft login servers are down!" | "I couldn't log in using %s, either the password is wrong or " "Minecraft login servers are down!" % username | SINGLE_STMT | [["Insert", ["expression_statement", 2, 16, 3, 51], ["binary_operator", "N0"], 0], ["Move", "N0", ["concatenated_string", 2, 16, 3, 51], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Insert", "N0", ["identifier:username", "T"], 2]] | ihatevim/aetherbot@28301e62e1b2f8ba0d960cff59f70c4d0e0dddbc | null | null |
aetherbot | a8b8eb3a6c5e738e25d5e4e45e4a784d146aa27c | 1078f12770913f979312ab793cbd6f3e95fbd1de | core/main.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -116,7 +116,7 @@ def dispatch(input, kind, func, args, autohelp=False):
if autohelp and args.get('autohelp', True) and not input.inp \
and func.__doc__ is not None:
- input.notice(func.__doc__)
+ input.notice(input.conn.conf["command_prefix"] + func.__doc__)
return
if func._thread:
| input . notice ( func . __doc__ ) | input . notice ( input . conn . conf [ "command_prefix" ] + func . __doc__ ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 21, 3, 35], ["binary_operator", "N0"], 1], ["Insert", "N0", ["subscript", "N1"], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Move", "N0", ["attribute", 3, 22, 3, 34], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["[:[", "T"], 1], ["Insert", "N1", ["string:\"command_prefix\"", "T"], 2], ["Insert", "N1", ["]:]", "T"], 3], ["Insert", "N2", ["attribute", "N3"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:conf", "T"], 2], ["Insert", "N3", ["identifier:input", "T"], 0], ["Insert", "N3", [".:.", "T"], 1], ["Insert", "N3", ["identifier:conn", "T"], 2]] | ihatevim/aetherbot@a8b8eb3a6c5e738e25d5e4e45e4a784d146aa27c | Autohelp now shows the command prefix again | [
{
"sha": "f17ff362fe066608f443a88b2d4ea93bf3cdf884",
"filename": "core/main.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/a8b8eb3a6c5e738e25d5e4e45e4a784d146aa27c/core%2Fmain.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/a8b8eb3a6c5e738e25d5e4e45e4a784d146aa27c/core%2Fmain.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=a8b8eb3a6c5e738e25d5e4e45e4a784d146aa27c",
"patch": "@@ -116,7 +116,7 @@ def dispatch(input, kind, func, args, autohelp=False):\n \n if autohelp and args.get('autohelp', True) and not input.inp \\\n and func.__doc__ is not None:\n- input.notice(func.__doc__)\n+ input.notice(input.conn.conf[\"command_prefix\"] + func.__doc__)\n return\n \n if func._thread:"
}
] |
aetherbot | 7f381012d56f172f868c6a3bf9ed914fecd53112 | aafdf424498abd453359f983e1e8f1bf8fd7da3a | plugins/factoids.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -22,7 +22,7 @@ def python(data, args, input):
data = data[4:].strip()
req = http.get("http://eval.appspot.com/eval", statement=statement).splitlines()
if len(req) == 0:
- return "Unknown Error."
+ return "Failed to recieve response from remote Python API.."
req[0] = re_lineends.split(req[0])[0]
if not req[0] == 'Traceback (most recent call last):':
result = req[0].decode('utf8', 'ignore')
| return "Unknown Error." | return "Failed to recieve response from remote Python API.." | CHANGE_STRING_LITERAL | [["Update", ["string:\"Unknown Error.\"", 3, 16, 3, 32], "\"Failed to recieve response from remote Python API..\""]] | ihatevim/aetherbot@7f381012d56f172f868c6a3bf9ed914fecd53112 | added a proper error message | [
{
"sha": "79dd07f30ed36cdc244839f4bbd177d955be3437",
"filename": "plugins/factoids.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/7f381012d56f172f868c6a3bf9ed914fecd53112/plugins%2Ffactoids.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/7f381012d56f172f868c6a3bf9ed914fecd53112/plugins%2Ffactoids.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Ffactoids.py?ref=7f381012d56f172f868c6a3bf9ed914fecd53112",
"patch": "@@ -22,7 +22,7 @@ def python(data, args, input):\n data = data[4:].strip()\n req = http.get(\"http://eval.appspot.com/eval\", statement=statement).splitlines()\n if len(req) == 0:\n- return \"Unknown Error.\"\n+ return \"Failed to recieve response from remote Python API..\"\n req[0] = re_lineends.split(req[0])[0]\n if not req[0] == 'Traceback (most recent call last):':\n result = req[0].decode('utf8', 'ignore')"
}
] |
aetherbot | b43b52e3f3a756c03d07416a3bfe3a2b523a19c8 | aafdf424498abd453359f983e1e8f1bf8fd7da3a | plugins/geoip.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -23,7 +23,7 @@ def timezone(ip):
@hook.command
@hook.command("location")
def geoip(inp, say=None, bot=None):
- ".geoip <ip> - Performs a location check on <ip>."
+ "geoip <ip> - Performs a location check on <ip>."
api_key = bot.config.get("api_keys", {}).get("geoip", None)
if api_key is None:
return "error: no api key set"
| ".geoip <ip> - Performs a location check on <ip>." | "geoip <ip> - Performs a location check on <ip>." | CHANGE_STRING_LITERAL | [["Update", ["string:\".geoip <ip> - Performs a location check on <ip>.\"", 3, 5, 3, 55], "\"geoip <ip> - Performs a location check on <ip>.\""]] | ihatevim/aetherbot@b43b52e3f3a756c03d07416a3bfe3a2b523a19c8 | fix | [
{
"sha": "fde09d79fef3ea743d337e10af8f44f03fb47979",
"filename": "plugins/geoip.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/b43b52e3f3a756c03d07416a3bfe3a2b523a19c8/plugins%2Fgeoip.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/b43b52e3f3a756c03d07416a3bfe3a2b523a19c8/plugins%2Fgeoip.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fgeoip.py?ref=b43b52e3f3a756c03d07416a3bfe3a2b523a19c8",
"patch": "@@ -23,7 +23,7 @@ def timezone(ip):\n @hook.command\n @hook.command(\"location\")\n def geoip(inp, say=None, bot=None):\n- \".geoip <ip> - Performs a location check on <ip>.\"\n+ \"geoip <ip> - Performs a location check on <ip>.\"\n api_key = bot.config.get(\"api_keys\", {}).get(\"geoip\", None)\n if api_key is None:\n return \"error: no api key set\""
}
] |
aetherbot | 13259585460d063ceee421a1023147255d501356 | b41e659dbd5a6efc03297124f19060403f09301b | plugins/time.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -2,7 +2,7 @@
from util import hook
from util import http
-from util.formatting import capitalize_first
+from util.text import capitalize_first
api_url = 'http://api.wolframalpha.com/v2/query?format=plaintext'
| from util . formatting import capitalize_first | from util . text import capitalize_first | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:formatting", 3, 11, 3, 21], "text"]] | ihatevim/aetherbot@13259585460d063ceee421a1023147255d501356 | null | null |
aetherbot | d0c0ab76f3ef28a3c1ad83686bf1bdc6e0f58765 | 30f1c18d941a8f53e81fbf5eace809cecc2790e3 | plugins/factoids.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -136,7 +136,7 @@ def factoid(inp, say=None, db=None, bot=None, me=None, conn=None, input=None):
# if the factoid starts with <py>, its a dynamic one
if data.startswith("<py>"):
data = data[4:].strip()
- variables = "input='%s'; nick='%s'; chan='%s'; bot_nick='%s';" % (arguments,
+ variables = 'input="""%s"""; nick="%s"; chan="%s"; bot_nick="%s";' % (arguments,
input.nick, input.chan, input.conn.nick)
result = eval_py(variables + data)
| variables = "input='%s'; nick='%s'; chan='%s'; bot_nick='%s';" % ( arguments , input . nick , input . chan , input . conn . nick ) | variables = 'input="""%s"""; nick="%s"; chan="%s"; bot_nick="%s";' % ( arguments , input . nick , input . chan , input . conn . nick ) | CHANGE_BINARY_OPERAND | [["Update", ["string:\"input='%s'; nick='%s'; chan='%s'; bot_nick='%s';\"", 3, 25, 3, 75], "'input=\"\"\"%s\"\"\"; nick=\"%s\"; chan=\"%s\"; bot_nick=\"%s\";'"]] | ihatevim/aetherbot@d0c0ab76f3ef28a3c1ad83686bf1bdc6e0f58765 | null | null |
aetherbot | d1f45cd06e362786552edf5437ec27759554ac50 | 2995e3b758cfe0e1371d6aba487e9fca370772e3 | plugins/weather.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -121,7 +121,7 @@ def weather(inp, nick="", reply=None, db=None, notice=None):
reply("\x02{place}\x02 - \x02Current Conditions:\x02 {conditions}, {temp_f}F/{temp_c}C, Humidity: {humidity}%, " \
"Wind: {wind_kph}KPH/{wind_mph}MPH {wind_text}, \x02Todays Forecast:\x02 {forecast}, " \
- "High: {high_f}F/{low_c}C, Low: {low_f}F/{low_c}C.".format(**weather))
+ "High: {high_f}F/{high_c}C, Low: {low_f}F/{low_c}C.".format(**weather))
if location and not dontsave:
db.execute("insert or replace into weather(nick, loc) values (?,?)",
| reply ( "\x02{place}\x02 - \x02Current Conditions:\x02 {conditions}, {temp_f}F/{temp_c}C, Humidity: {humidity}%, " "Wind: {wind_kph}KPH/{wind_mph}MPH {wind_text}, \x02Todays Forecast:\x02 {forecast}, " "High: {high_f}F/{low_c}C, Low: {low_f}F/{low_c}C." . format ( ** weather ) ) | reply ( "\x02{place}\x02 - \x02Current Conditions:\x02 {conditions}, {temp_f}F/{temp_c}C, Humidity: {humidity}%, " "Wind: {wind_kph}KPH/{wind_mph}MPH {wind_text}, \x02Todays Forecast:\x02 {forecast}, " "High: {high_f}F/{high_c}C, Low: {low_f}F/{low_c}C." . format ( ** weather ) ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"High: {high_f}F/{low_c}C, Low: {low_f}F/{low_c}C.\"", 3, 13, 3, 64], "\"High: {high_f}F/{high_c}C, Low: {low_f}F/{low_c}C.\""]] | ihatevim/aetherbot@d1f45cd06e362786552edf5437ec27759554ac50 | null | null |
aetherbot | f1017fba2fdd24c3c744a633826f6ad0358e67ed | dfd103b4387fe1e425fe3b85940cde72a1c5e67d | plugins/youtube.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -134,4 +134,4 @@ def ytplaylist_url(match):
author = soup.find('img', {'class': 'channel-header-profile-image'})['title']
num_videos = soup.find('ul', {'class': 'header-stats'}).findAll('li')[0].text.split(' ')[0]
views = soup.find('ul', {'class': 'header-stats'}).findAll('li')[1].text.split(' ')[0]
- return "\x02{}\x02 - \x02{}\x02 views - \x02{}\x02 videos - \x0{}\x02".format(title, views, num_videos, author)
+ return "\x02{}\x02 - \x02{}\x02 views - \x02{}\x02 videos - \x02{}\x02".format(title, views, num_videos, author)
| return "\x02{}\x02 - \x02{}\x02 views - \x02{}\x02 videos - \x0{}\x02" . format ( title , views , num_videos , author ) | return "\x02{}\x02 - \x02{}\x02 views - \x02{}\x02 videos - \x02{}\x02" . format ( title , views , num_videos , author ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"\\x02{}\\x02 - \\x02{}\\x02 views - \\x02{}\\x02 videos - \\x0{}\\x02\"", 3, 12, 3, 75], "\"\\x02{}\\x02 - \\x02{}\\x02 views - \\x02{}\\x02 videos - \\x02{}\\x02\""]] | ihatevim/aetherbot@f1017fba2fdd24c3c744a633826f6ad0358e67ed | null | null |
aetherbot | 765ac0acb7e7d23b686d839b42d845b2de40bdad | 49895a9634c4c8d3c7b846cccdd7c8cac0c29a43 | modules/log.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -97,7 +97,7 @@ def get_log_stream(data_dir, server, chan):
return log_stream
-@hook.event("*")
+@hook.event("*", singlethread=True)
def log(paraml, input=None, bot=None):
| @ hook . event ( "*" ) def log ( paraml , input = None , bot = None ) : | @ hook . event ( "*" , singlethread = True ) def log ( paraml , input = None , bot = None ) : | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 12, 3, 17], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 12, 3, 17], ["keyword_argument", "N0"], 3], ["Insert", "N0", ["identifier:singlethread", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["true:True", "T"], 2]] | ihatevim/aetherbot@765ac0acb7e7d23b686d839b42d845b2de40bdad | null | null |
aetherbot | d76fb473ee43e4283abefaf3c9d541e2258fdae4 | 765ac0acb7e7d23b686d839b42d845b2de40bdad | modules/rdio.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -2,7 +2,7 @@ import urllib
import json
import re
-import oauth2 as oauth
+oauth = None # import oauth2 as oauth
from util import hook
| import oauth2 as oauth | oauth = None | SINGLE_STMT | [["Insert", ["module", 0, 1, 7, 0], ["expression_statement", "N0"], 2], ["Insert", "N0", ["assignment", "N1"], 0], ["Update", ["identifier:oauth2", 3, 8, 3, 14], "oauth"], ["Move", "N1", ["identifier:oauth2", 3, 8, 3, 14], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Insert", "N1", ["none:None", "T"], 2], ["Delete", ["import:import", 3, 1, 3, 7]], ["Delete", ["dotted_name", 3, 8, 3, 14]], ["Delete", ["as:as", 3, 15, 3, 17]], ["Delete", ["identifier:oauth", 3, 18, 3, 23]], ["Delete", ["aliased_import", 3, 8, 3, 23]], ["Delete", ["import_statement", 3, 1, 3, 23]]] | ihatevim/aetherbot@d76fb473ee43e4283abefaf3c9d541e2258fdae4 | null | null |
aetherbot | f55025265e5f337b53c707b10bce41db30a07848 | 252b8357ff3a289582a73948cabf1101badcbeda | plugins/rdio.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -2,7 +2,7 @@ import urllib
import json
import re
-import oauth2 as oauth
+oauth = None # import oauth2 as oauth
from util import hook
| import oauth2 as oauth | oauth = None | SINGLE_STMT | [["Insert", ["module", 0, 1, 7, 0], ["expression_statement", "N0"], 2], ["Insert", "N0", ["assignment", "N1"], 0], ["Update", ["identifier:oauth2", 3, 8, 3, 14], "oauth"], ["Move", "N1", ["identifier:oauth2", 3, 8, 3, 14], 0], ["Insert", "N1", ["=:=", "T"], 1], ["Insert", "N1", ["none:None", "T"], 2], ["Delete", ["import:import", 3, 1, 3, 7]], ["Delete", ["dotted_name", 3, 8, 3, 14]], ["Delete", ["as:as", 3, 15, 3, 17]], ["Delete", ["identifier:oauth", 3, 18, 3, 23]], ["Delete", ["aliased_import", 3, 8, 3, 23]], ["Delete", ["import_statement", 3, 1, 3, 23]]] | ihatevim/aetherbot@f55025265e5f337b53c707b10bce41db30a07848 | null | null |
aetherbot | 4b0fa36abf3ad5479ae28c85fc2e52c083104a57 | 2a787708dac4604e38d41d6b737a69d2fb08d524 | core/main.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -165,7 +165,7 @@ def run(bot, plugin, input):
parameters.append(value)
else:
bot.logger.error("Plugin {}:{} asked for invalid argument '{}', cancelling execution!"
- .format(plugin.fileplugin.title, plugin.function_name, required_arg))
+ .format(plugin.module.title, plugin.function_name, required_arg))
return
try:
| else : bot . logger . error ( "Plugin {}:{} asked for invalid argument '{}', cancelling execution!" . format ( plugin . fileplugin . title , plugin . function_name , required_arg ) ) | else : bot . logger . error ( "Plugin {}:{} asked for invalid argument '{}', cancelling execution!" . format ( plugin . module . title , plugin . function_name , required_arg ) ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:fileplugin", 3, 45, 3, 55], "module"]] | ihatevim/aetherbot@4b0fa36abf3ad5479ae28c85fc2e52c083104a57 | This fix is module instead of file_plugin | [
{
"sha": "5a0cb8c59f96d3b80836c3258ed3d1c9c2aea97f",
"filename": "core/main.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/4b0fa36abf3ad5479ae28c85fc2e52c083104a57/core%2Fmain.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/4b0fa36abf3ad5479ae28c85fc2e52c083104a57/core%2Fmain.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fmain.py?ref=4b0fa36abf3ad5479ae28c85fc2e52c083104a57",
"patch": "@@ -165,7 +165,7 @@ def run(bot, plugin, input):\n parameters.append(value)\n else:\n bot.logger.error(\"Plugin {}:{} asked for invalid argument '{}', cancelling execution!\"\n- .format(plugin.fileplugin.title, plugin.function_name, required_arg))\n+ .format(plugin.module.title, plugin.function_name, required_arg))\n return\n \n try:"
}
] |
aetherbot | 8f8a72e7f8498d69eba43f1aa8ddeddc80b751b8 | f944406502bd2f8f1a7fff10d98968864e761e1e | modules/google.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -22,7 +22,7 @@ def googleimage(text):
return random.choice(parsed['responseData']['results'][:10])['unescapedUrl']
-@hook.command("google", "g", "search")
+@hook.command(["google", "g", "search"])
def google(text):
"""google <query> -- Returns first google search result for <query>."""
| @ hook . command ( "google" , "g" , "search" ) def google ( text ) : """google <query> -- Returns first google search result for <query>.""" | @ hook . command ( [ "google" , "g" , "search" ] ) def google ( text ) : """google <query> -- Returns first google search result for <query>.""" | SINGLE_STMT | [["Insert", ["argument_list", 3, 14, 3, 39], ["list", "N0"], 1], ["Insert", "N0", ["[:[", "T"], 0], ["Move", "N0", ["string:\"google\"", 3, 15, 3, 23], 1], ["Move", "N0", [",:,", 3, 23, 3, 24], 2], ["Move", "N0", ["string:\"g\"", 3, 25, 3, 28], 3], ["Move", "N0", [",:,", 3, 28, 3, 29], 4], ["Move", "N0", ["string:\"search\"", 3, 30, 3, 38], 5], ["Insert", "N0", ["]:]", "T"], 6]] | ihatevim/aetherbot@8f8a72e7f8498d69eba43f1aa8ddeddc80b751b8 | Oops, fix google | [
{
"sha": "51e28bf8fd60c7d0d55bb0072c94c4202236c3d0",
"filename": "modules/google.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/8f8a72e7f8498d69eba43f1aa8ddeddc80b751b8/modules%2Fgoogle.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/8f8a72e7f8498d69eba43f1aa8ddeddc80b751b8/modules%2Fgoogle.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/modules%2Fgoogle.py?ref=8f8a72e7f8498d69eba43f1aa8ddeddc80b751b8",
"patch": "@@ -22,7 +22,7 @@ def googleimage(text):\n return random.choice(parsed['responseData']['results'][:10])['unescapedUrl']\n \n \n-@hook.command(\"google\", \"g\", \"search\")\n+@hook.command([\"google\", \"g\", \"search\"])\n def google(text):\n \"\"\"google <query> -- Returns first google search result for <query>.\"\"\"\n "
}
] |
aetherbot | 8350ec511405f0139dd1f8721ed6ff27b31ee7ba | 7e6fd318b74863b2c725b20914638ea91ae37e23 | core/bot.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -102,7 +102,7 @@ class CloudBot(threading.Thread):
self.logger.debug("Config system initalised.")
# setup db
- db_path = config.get('database', 'sqlite:///cloudbot.db')
+ db_path = self.config.get('database', 'sqlite:///cloudbot.db')
self.db_engine = create_engine(db_path)
self.logger.debug("Database system initalised.")
| db_path = config . get ( 'database' , 'sqlite:///cloudbot.db' ) | db_path = self . config . get ( 'database' , 'sqlite:///cloudbot.db' ) | SINGLE_STMT | [["Insert", ["attribute", 3, 19, 3, 29], ["attribute", "N0"], 0], ["Insert", ["attribute", 3, 19, 3, 29], [".:.", "T"], 1], ["Insert", "N0", ["identifier:self", "T"], 0], ["Move", "N0", [".:.", 3, 25, 3, 26], 1], ["Move", "N0", ["identifier:config", 3, 19, 3, 25], 2]] | ihatevim/aetherbot@8350ec511405f0139dd1f8721ed6ff27b31ee7ba | null | null |
aetherbot | 653f9ee11b208582b2cc23bc3ee238544ffaf8f2 | ac4c2e70ba381606a5c6a743c29db2828c792f36 | modules/minecraft_user.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -41,7 +41,7 @@ def get_profile(name):
headers = {"Content-Type": "application/json"}
r = http.get_json(
'https://api.mojang.com/profiles/page/1',
- post_data=json.dumps(request),
+ post_data=json.dumps(request).encode('utf-8'),
headers=headers
)
except (http.URLError, http.HTTPError) as e:
| r = http . get_json ( 'https://api.mojang.com/profiles/page/1' , post_data = json . dumps ( request ) , headers = headers ) | r = http . get_json ( 'https://api.mojang.com/profiles/page/1' , post_data = json . dumps ( request ) . encode ( 'utf-8' ) , headers = headers ) | ADD_METHOD_CALL | [["Insert", ["call", 3, 23, 3, 42], ["attribute", "N0"], 0], ["Insert", ["call", 3, 23, 3, 42], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 23, 3, 42], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:encode", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["string:'utf-8'", "T"], 1], ["Insert", "N1", ["):)", "T"], 2]] | ihatevim/aetherbot@653f9ee11b208582b2cc23bc3ee238544ffaf8f2 | Fix mcuser for python 3 | [
{
"sha": "b4421775d7281ae96d74d353ec3bb5414cae3029",
"filename": "modules/minecraft_user.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/653f9ee11b208582b2cc23bc3ee238544ffaf8f2/modules%2Fminecraft_user.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/653f9ee11b208582b2cc23bc3ee238544ffaf8f2/modules%2Fminecraft_user.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/modules%2Fminecraft_user.py?ref=653f9ee11b208582b2cc23bc3ee238544ffaf8f2",
"patch": "@@ -41,7 +41,7 @@ def get_profile(name):\n headers = {\"Content-Type\": \"application/json\"}\n r = http.get_json(\n 'https://api.mojang.com/profiles/page/1',\n- post_data=json.dumps(request),\n+ post_data=json.dumps(request).encode('utf-8'),\n headers=headers\n )\n except (http.URLError, http.HTTPError) as e:"
}
] |
aetherbot | 88c842fd812a35373cc54449d304e80ba7d50048 | 653f9ee11b208582b2cc23bc3ee238544ffaf8f2 | modules/newegg.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -83,7 +83,7 @@ def newegg(inp):
# submit the search request
r = http.get_json(
'http://www.ows.newegg.com/Search.egg/Advanced',
- post_data=json.dumps(request)
+ post_data=json.dumps(request).encode('utf-8')
)
# get the first result
| r = http . get_json ( 'http://www.ows.newegg.com/Search.egg/Advanced' , post_data = json . dumps ( request ) ) | r = http . get_json ( 'http://www.ows.newegg.com/Search.egg/Advanced' , post_data = json . dumps ( request ) . encode ( 'utf-8' ) ) | ADD_METHOD_CALL | [["Insert", ["call", 3, 19, 3, 38], ["attribute", "N0"], 0], ["Insert", ["call", 3, 19, 3, 38], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 19, 3, 38], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:encode", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["string:'utf-8'", "T"], 1], ["Insert", "N1", ["):)", "T"], 2]] | ihatevim/aetherbot@88c842fd812a35373cc54449d304e80ba7d50048 | null | null |
aetherbot | ee6e3449d68819f76ee3f590c15d86a2a955e21f | 2b05cff514447dc81dba19729be13898f6e4c316 | modules/title.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -6,7 +6,7 @@ from util import hook, http, urlnorm
@hook.command
def title(inp):
"""title <url> -- gets the title of a web page"""
- url = urlnorm.normalize(inp.encode('utf-8'), assume_scheme="http")
+ url = urlnorm.normalize(inp, assume_scheme="http")
try:
page = http.open(url)
| url = urlnorm . normalize ( inp . encode ( 'utf-8' ) , assume_scheme = "http" ) | url = urlnorm . normalize ( inp , assume_scheme = "http" ) | SINGLE_STMT | [["Move", ["argument_list", 3, 28, 3, 71], ["identifier:inp", 3, 29, 3, 32], 1], ["Delete", [".:.", 3, 32, 3, 33]], ["Delete", ["identifier:encode", 3, 33, 3, 39]], ["Delete", ["attribute", 3, 29, 3, 39]], ["Delete", ["(:(", 3, 39, 3, 40]], ["Delete", ["string:'utf-8'", 3, 40, 3, 47]], ["Delete", ["):)", 3, 47, 3, 48]], ["Delete", ["argument_list", 3, 39, 3, 48]], ["Delete", ["call", 3, 29, 3, 48]]] | ihatevim/aetherbot@ee6e3449d68819f76ee3f590c15d86a2a955e21f | null | null |
aetherbot | 1a6c43b7b7bce8fa4b3a53c259a1a83d2b34dac8 | 12b35aaa5c288ffe386b39f06103b1175a62d0e1 | util/hook.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -92,8 +92,9 @@ class _RegexHook(_Hook):
if isinstance(regex_param, str):
# if the paramater is a string, compile and add
self.regexes.append(re.compile(regex_param, regex_flags))
- elif isinstance(regex_param, re.__Regex):
+ elif hasattr(regex_param, "search"):
# if the paramater is an re.__Regex, just add it
+ # we only use regex.search anyways, so this is a good determiner
self.regexes.append(regex_param)
else:
assert isinstance(regex_param, list)
| if isinstance ( regex_param , str ) : self . regexes . append ( re . compile ( regex_param , regex_flags ) ) elif isinstance ( regex_param , re . __Regex ) : self . regexes . append ( regex_param ) else : assert isinstance ( regex_param , list ) | if isinstance ( regex_param , str ) : self . regexes . append ( re . compile ( regex_param , regex_flags ) ) elif hasattr ( regex_param , "search" ) : self . regexes . append ( regex_param ) else : assert isinstance ( regex_param , list ) | SINGLE_STMT | [["Update", ["identifier:isinstance", 3, 14, 3, 24], "hasattr"], ["Insert", ["argument_list", 3, 24, 3, 49], ["string:\"search\"", "T"], 3], ["Delete", ["identifier:re", 3, 38, 3, 40]], ["Delete", [".:.", 3, 40, 3, 41]], ["Delete", ["identifier:__Regex", 3, 41, 3, 48]], ["Delete", ["attribute", 3, 38, 3, 48]]] | ihatevim/aetherbot@1a6c43b7b7bce8fa4b3a53c259a1a83d2b34dac8 | Fix compiled regex @hook.regex | [
{
"sha": "397e7884c0321c69301d9fe3c7850b23b432abb7",
"filename": "util/hook.py",
"status": "modified",
"additions": 2,
"deletions": 1,
"changes": 3,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/1a6c43b7b7bce8fa4b3a53c259a1a83d2b34dac8/util%2Fhook.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/1a6c43b7b7bce8fa4b3a53c259a1a83d2b34dac8/util%2Fhook.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/util%2Fhook.py?ref=1a6c43b7b7bce8fa4b3a53c259a1a83d2b34dac8",
"patch": "@@ -92,8 +92,9 @@ def __init__(self, function, regex_param, regex_flags, kwargs):\n if isinstance(regex_param, str):\n # if the paramater is a string, compile and add\n self.regexes.append(re.compile(regex_param, regex_flags))\n- elif isinstance(regex_param, re.__Regex):\n+ elif hasattr(regex_param, \"search\"):\n # if the paramater is an re.__Regex, just add it\n+ # we only use regex.search anyways, so this is a good determiner\n self.regexes.append(regex_param)\n else:\n assert isinstance(regex_param, list)"
}
] |
aetherbot | f098c2b86d8ef6fa89bff8eaab43cdf20b2c0dcb | 2ce5a86964acb42bd3781dfdf04ed23ce61c4438 | core/pluginmanager.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -153,7 +153,7 @@ class PluginManager:
# stop all currently running instances of the modules from this file
for running_plugin, handler in list(self.bot.threads.items()):
- if running_plugin.module.file_name == file_name:
+ if running_plugin == title:
handler.stop()
del self.bot.threads[running_plugin]
| if running_plugin . module . file_name == file_name : handler . stop ( ) del self . bot . threads [ running_plugin ] | if running_plugin == title : handler . stop ( ) del self . bot . threads [ running_plugin ] | SINGLE_STMT | [["Move", ["comparison_operator", 3, 16, 3, 60], ["identifier:running_plugin", 3, 16, 3, 30], 0], ["Update", ["identifier:file_name", 3, 51, 3, 60], "title"], ["Delete", [".:.", 3, 30, 3, 31]], ["Delete", ["identifier:module", 3, 31, 3, 37]], ["Delete", ["attribute", 3, 16, 3, 37]], ["Delete", [".:.", 3, 37, 3, 38]], ["Delete", ["identifier:file_name", 3, 38, 3, 47]], ["Delete", ["attribute", 3, 16, 3, 47]]] | ihatevim/aetherbot@f098c2b86d8ef6fa89bff8eaab43cdf20b2c0dcb | null | null |
aetherbot | 88f16df44bca5ca49277fb263a48ad18ce552f3a | e5e1b1e96ba9429429d041f4b8b4b1aa61f25542 | modules/utility.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -23,7 +23,7 @@ colors = collections.OrderedDict([
# helper functions
-strip_re = re.compile("(\x03|\x02|\x1f)(?:,?\d{1,2}(?:,\d{1,2})?)?", re.UNICODE)
+strip_re = re.compile("(\x03|\x02|\x1f|\x0f)(?:,?\d{1,2}(?:,\d{1,2})?)?")
def strip(string):
| strip_re = re . compile ( "(\x03|\x02|\x1f)(?:,?\d{1,2}(?:,\d{1,2})?)?" , re . UNICODE ) | strip_re = re . compile ( "(\x03|\x02|\x1f|\x0f)(?:,?\d{1,2}(?:,\d{1,2})?)?" ) | SINGLE_STMT | [["Update", ["string:\"(\\x03|\\x02|\\x1f)(?:,?\\d{1,2}(?:,\\d{1,2})?)?\"", 3, 23, 3, 68], "\"(\\x03|\\x02|\\x1f|\\x0f)(?:,?\\d{1,2}(?:,\\d{1,2})?)?\""], ["Delete", [",:,", 3, 68, 3, 69]], ["Delete", ["identifier:re", 3, 70, 3, 72]], ["Delete", [".:.", 3, 72, 3, 73]], ["Delete", ["identifier:UNICODE", 3, 73, 3, 80]], ["Delete", ["attribute", 3, 70, 3, 80]]] | ihatevim/aetherbot@88f16df44bca5ca49277fb263a48ad18ce552f3a | null | null |
aetherbot | e3175ee265ab2788900d77c9866c335dbe1acafa | 3e0d3a2a8c31c0dd53161db67b087689e00f87bf | modules/utility.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -40,7 +40,7 @@ def capitalize(text):
"""capitalize <string> -- Capitalizes <string>.
:type text: str
"""
- return ". ".join([sentance.capitalize() for sentance in text.split(". ")])
+ return ". ".join([sentence.capitalize() for sentence in text.split(". ")])
@hook.command
| return ". " . join ( [ sentance . capitalize ( ) for sentance in text . split ( ". " ) ] ) | return ". " . join ( [ sentence . capitalize ( ) for sentence in text . split ( ". " ) ] ) | SINGLE_STMT | [["Update", ["identifier:sentance", 3, 49, 3, 57], "sentence"], ["Update", ["identifier:sentance", 3, 23, 3, 31], "sentence"]] | ihatevim/aetherbot@e3175ee265ab2788900d77c9866c335dbe1acafa | null | null |
play-with-travis | 373ebae07fe5cd20893d7bb4c0d672b436414416 | 449ff8e25f809e62a7dd188b40a1373f364355bb | test.py | https://github.com/andywow/play-with-travis | true | false | true | @@ -3,7 +3,7 @@ import unittest
class NumbersTest(unittest.TestCase):
def test_equal(self):
- self.assertEqual(1 + 1, 1)
+ self.assertEqual(1, 1)
if __name__ == '__main__':
unittest.main()
| self . assertEqual ( 1 + 1 , 1 ) | self . assertEqual ( 1 , 1 ) | SINGLE_STMT | [["Move", ["argument_list", 3, 25, 3, 35], ["integer:1", 3, 26, 3, 27], 1], ["Move", ["argument_list", 3, 25, 3, 35], ["integer:1", 3, 30, 3, 31], 4], ["Delete", ["+:+", 3, 28, 3, 29]], ["Delete", ["binary_operator", 3, 26, 3, 31]], ["Delete", ["integer:1", 3, 33, 3, 34]]] | andywow/play-with-travis@373ebae07fe5cd20893d7bb4c0d672b436414416 | test_equal function fix for unit test | [
{
"sha": "41e7655a0d729c392219af1f680527bc8b9c6c69",
"filename": "test.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/andywow/play-with-travis/blob/373ebae07fe5cd20893d7bb4c0d672b436414416/test.py",
"raw_url": "https://github.com/andywow/play-with-travis/raw/373ebae07fe5cd20893d7bb4c0d672b436414416/test.py",
"contents_url": "https://api.github.com/repos/andywow/play-with-travis/contents/test.py?ref=373ebae07fe5cd20893d7bb4c0d672b436414416",
"patch": "@@ -3,7 +3,7 @@\n class NumbersTest(unittest.TestCase):\n \n def test_equal(self):\n- self.assertEqual(1 + 1, 1)\n+ self.assertEqual(1, 1)\n \n if __name__ == '__main__':\n unittest.main()"
}
] |
image-detection | 763eb3673b40cdf8aab1dd121663804721ac479b | d1e73be373fd9cea7987c26d98be3aec429d7e72 | application.py | https://github.com/ddavignon/image-detection | true | false | true | @@ -124,7 +124,7 @@ def check_image_for_minors(image):
baby = imgpil.copy()
blurredbaby = baby.crop((xx1, yy1, xx2, yy2))
- blurredbaby = blurredbaby.filter(ImageFilter.GaussianBlur(3))
+ blurredbaby = blurredbaby.filter(ImageFilter.GaussianBlur(10))
baby.paste(blurredbaby, (xx1, yy1))
baby.save(image)
| blurredbaby = blurredbaby . filter ( ImageFilter . GaussianBlur ( 3 ) ) | blurredbaby = blurredbaby . filter ( ImageFilter . GaussianBlur ( 10 ) ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:3", 3, 75, 3, 76], "10"]] | ddavignon/image-detection@763eb3673b40cdf8aab1dd121663804721ac479b | fix blur threshold | [
{
"sha": "b53c6b1c983bd769ca2f1f20ebb2cc3999236262",
"filename": "application.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ddavignon/image-detection/blob/763eb3673b40cdf8aab1dd121663804721ac479b/application.py",
"raw_url": "https://github.com/ddavignon/image-detection/raw/763eb3673b40cdf8aab1dd121663804721ac479b/application.py",
"contents_url": "https://api.github.com/repos/ddavignon/image-detection/contents/application.py?ref=763eb3673b40cdf8aab1dd121663804721ac479b",
"patch": "@@ -124,7 +124,7 @@ def check_image_for_minors(image):\n baby = imgpil.copy()\n blurredbaby = baby.crop((xx1, yy1, xx2, yy2))\n \n- blurredbaby = blurredbaby.filter(ImageFilter.GaussianBlur(3))\n+ blurredbaby = blurredbaby.filter(ImageFilter.GaussianBlur(10))\n baby.paste(blurredbaby, (xx1, yy1))\n baby.save(image)\n "
}
] |
AoC-2017 | f322493b7ac2617107745d7e788b5e71454c0973 | 773945d371f6c447de5d3ec502f8a52f943164dc | day8.py | https://github.com/sereneliu/AoC-2017 | true | false | true | @@ -57,7 +57,7 @@ def setup(some_list):
def run_instructions(some_list):
setup(some_list)
max_value_ever = 0
- for instruction in instructions_list:
+ for instruction in some_list:
if eval(instruction[instruction.index(' if') + 4:]) == True:
exec(instruction[0:instruction.index(' if') + 1])
if max(reg_values.values()) > max_value_ever:
| for instruction in instructions_list : if eval ( instruction [ instruction . index ( ' if' ) + 4 : ] ) == True : exec ( instruction [ 0 : instruction . index ( ' if' ) + 1 ] ) if max ( reg_values . values ( ) ) > max_value_ever : | for instruction in some_list : if eval ( instruction [ instruction . index ( ' if' ) + 4 : ] ) == True : exec ( instruction [ 0 : instruction . index ( ' if' ) + 1 ] ) if max ( reg_values . values ( ) ) > max_value_ever : | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:instructions_list", 3, 24, 3, 41], "some_list"]] | sereneliu/AoC-2017@f322493b7ac2617107745d7e788b5e71454c0973 | Day 8: I Heard You Like Registers | small fix | [
{
"sha": "4f59c11ac0b50c0ebd0af687c7a190352ecf2302",
"filename": "day8.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/sereneliu/AoC-2017/blob/f322493b7ac2617107745d7e788b5e71454c0973/day8.py",
"raw_url": "https://github.com/sereneliu/AoC-2017/raw/f322493b7ac2617107745d7e788b5e71454c0973/day8.py",
"contents_url": "https://api.github.com/repos/sereneliu/AoC-2017/contents/day8.py?ref=f322493b7ac2617107745d7e788b5e71454c0973",
"patch": "@@ -57,7 +57,7 @@ def setup(some_list):\n def run_instructions(some_list):\n setup(some_list)\n max_value_ever = 0\n- for instruction in instructions_list:\n+ for instruction in some_list:\n if eval(instruction[instruction.index(' if') + 4:]) == True:\n exec(instruction[0:instruction.index(' if') + 1])\n if max(reg_values.values()) > max_value_ever:"
}
] |
aetherbot | 9e8700195b5fba4f624f56464b289f52684400ee | 6161164c5f342e5337b3acfcfacbe45e8302d178 | plugins/suggest.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -15,7 +15,7 @@ def suggest(inp, inp_unstripped=''):
num, inp = m.groups()
num = int(num)
if num > 10:
- return 'I can only get first ten suggestions.'
+ return 'I can only get the first ten suggestions.'
else:
num = 0
| return 'I can only get first ten suggestions.' | return 'I can only get the first ten suggestions.' | CHANGE_STRING_LITERAL | [["Update", ["string:'I can only get first ten suggestions.'", 3, 20, 3, 59], "'I can only get the first ten suggestions.'"]] | ihatevim/aetherbot@9e8700195b5fba4f624f56464b289f52684400ee | null | null |
aetherbot | 3abd8acef73983fcc082efab9c9b052e0d48eecd | b7eee30feb48a2aceccf8c12db17a04d4276a53e | core/config.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -17,7 +17,7 @@ if not os.path.exists('config'):
"server": "irc.esper.net",
"nick": "cloudbot_test",
"user": "cloudbot",
- "realname": "CloudBot 3/DEV",
+ "realname": "CloudBot/DEV - https://github.com/lukeroge/CloudBot",
"nickserv_password": "",
"channels": ["#mau5bot"]
}
| "realname" : "CloudBot 3/DEV" , | "realname" : "CloudBot/DEV - https://github.com/lukeroge/CloudBot" , | CHANGE_STRING_LITERAL | [["Update", ["string:\"CloudBot 3/DEV\"", 3, 27, 3, 43], "\"CloudBot/DEV - https://github.com/lukeroge/CloudBot\""]] | ihatevim/aetherbot@3abd8acef73983fcc082efab9c9b052e0d48eecd | Updated default config file | [
{
"sha": "a518925a20ad57f7dc07785d90bea8f3859c1f7f",
"filename": "core/config.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/3abd8acef73983fcc082efab9c9b052e0d48eecd/core%2Fconfig.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/3abd8acef73983fcc082efab9c9b052e0d48eecd/core%2Fconfig.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/core%2Fconfig.py?ref=3abd8acef73983fcc082efab9c9b052e0d48eecd",
"patch": "@@ -17,7 +17,7 @@ def save(conf):\n \"server\": \"irc.esper.net\",\n \"nick\": \"cloudbot_test\",\n \"user\": \"cloudbot\",\n- \"realname\": \"CloudBot 3/DEV\",\n+ \"realname\": \"CloudBot/DEV - https://github.com/lukeroge/CloudBot\",\n \"nickserv_password\": \"\",\n \"channels\": [\"#mau5bot\"]\n }"
}
] |
aetherbot | f712ee26338afe83f88d657e3dcf92a993807504 | 19e4b16b00439f2b854debf34f6ecc68182bf853 | core/config.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -17,7 +17,7 @@ if not os.path.exists('config'):
"server": "irc.esper.net",
"nick": "cloudbot_test",
"user": "cloudbot",
- "realname": "CloudBot/DEV - https://github.com/lukeroge/CloudBot",
+ "realname": "CloudBot/DEV - http://j.mp/uS5Cvx",
"nickserv_password": "",
"channels": ["#mau5bot"]
}
| "realname" : "CloudBot/DEV - https://github.com/lukeroge/CloudBot" , | "realname" : "CloudBot/DEV - http://j.mp/uS5Cvx" , | CHANGE_STRING_LITERAL | [["Update", ["string:\"CloudBot/DEV - https://github.com/lukeroge/CloudBot\"", 3, 27, 3, 80], "\"CloudBot/DEV - http://j.mp/uS5Cvx\""]] | ihatevim/aetherbot@f712ee26338afe83f88d657e3dcf92a993807504 | null | null |
aetherbot | 3aba5a41fc9d2544a381bf003d8e0b610f103934 | ebafa1db0937a3eaf655ee77fd911e560575c969 | core/config.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -32,7 +32,7 @@ if not os.path.exists('config'):
"tvdb": "INSERT API KEY FROM thetvdb.com HERE",
"bitly_user": "INSERT USERNAME FROM bitly.com HERE",
"bitly_api": "INSERT API KEY FROM bitly.com HERE",
- "woflramalpha": "INSERT API KEY FROM wolframalpha.com HERE",
+ "wolframalpha": "INSERT API KEY FROM wolframalpha.com HERE",
"mc_user": "INSERT MINECRAFT USERNAME HERE (used to check login servers in mctools.py)",
"mc_pass": "INSERT MINECRAFT PASSWORD HERE (used to check login servers in mctools.py)"
},
| "woflramalpha" : "INSERT API KEY FROM wolframalpha.com HERE" , | "wolframalpha" : "INSERT API KEY FROM wolframalpha.com HERE" , | CHANGE_STRING_LITERAL | [["Update", ["string:\"woflramalpha\"", 3, 13, 3, 27], "\"wolframalpha\""]] | ihatevim/aetherbot@3aba5a41fc9d2544a381bf003d8e0b610f103934 | null | null |
aetherbot | 21b753c892dd85868f4e194277050a19a0090a04 | a63e35d04318578da5758f8df747d4dc31ea90de | plugins/coin.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -40,5 +40,5 @@ def coin(inp):
return "You flip a coin and get "+sidename+"."
else:
flips = flip_simple(count)
- return "You flip %s coins and get %s heads and %s tails." % (str(count), str(flips[0]), str(flips[0]))
+ return "You flip %s coins and get %s heads and %s tails." % (str(count), str(flips[0]), str(flips[1]))
| return "You flip %s coins and get %s heads and %s tails." % ( str ( count ) , str ( flips [ 0 ] ) , str ( flips [ 0 ] ) ) | return "You flip %s coins and get %s heads and %s tails." % ( str ( count ) , str ( flips [ 0 ] ) , str ( flips [ 1 ] ) ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:0", 3, 107, 3, 108], "1"]] | ihatevim/aetherbot@21b753c892dd85868f4e194277050a19a0090a04 | null | null |
aetherbot | 62437817f47852b6ede41b8b37ac961ab5a715f1 | 7fed7057a6a43a12457d715070cdd5d65eb9fee7 | plugins/fact.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -13,7 +13,7 @@ def fact(inp, say=False, nick=False):
except:
pass
- return "%s [ %s ]" % (fact, link)
+ return u"%s [ %s ]" % (fact, link)
| return "%s [ %s ]" % ( fact , link ) | return u"%s [ %s ]" % ( fact , link ) | CHANGE_BINARY_OPERAND | [["Update", ["string:\"%s [ %s ]\"", 3, 12, 3, 23], "u\"%s [ %s ]\""]] | ihatevim/aetherbot@62437817f47852b6ede41b8b37ac961ab5a715f1 | Fixed plugins/fact.py | [
{
"sha": "350ea3a4ade2eabf901f0d81bdc1763c2dc5f04e",
"filename": "plugins/fact.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/62437817f47852b6ede41b8b37ac961ab5a715f1/plugins%2Ffact.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/62437817f47852b6ede41b8b37ac961ab5a715f1/plugins%2Ffact.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Ffact.py?ref=62437817f47852b6ede41b8b37ac961ab5a715f1",
"patch": "@@ -13,7 +13,7 @@ def fact(inp, say=False, nick=False):\n except:\n pass\n \n- return \"%s [ %s ]\" % (fact, link) \n+ return u\"%s [ %s ]\" % (fact, link) \n \n \n "
}
] |
aetherbot | ea2468b742928b1504caee0489d59bffbbb05344 | 336b81abc0626f47245ce10b308df8d3b6df34e4 | plugins/lastfm.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -49,7 +49,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None):
track = tracks
status = 'last track'
else:
- return "error parsing track listing"
+ return "error: could not parse track listing"
title = track["name"]
album = track["album"]["#text"]
| else : return "error parsing track listing" | else : return "error: could not parse track listing" | CHANGE_STRING_LITERAL | [["Update", ["string:\"error parsing track listing\"", 3, 16, 3, 45], "\"error: could not parse track listing\""]] | ihatevim/aetherbot@ea2468b742928b1504caee0489d59bffbbb05344 | changed error strings a bit | [
{
"sha": "f2a4eff99bf27c5ab940427dfeb58c90172e1038",
"filename": "plugins/lastfm.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/ea2468b742928b1504caee0489d59bffbbb05344/plugins%2Flastfm.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/ea2468b742928b1504caee0489d59bffbbb05344/plugins%2Flastfm.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Flastfm.py?ref=ea2468b742928b1504caee0489d59bffbbb05344",
"patch": "@@ -49,7 +49,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None):\n track = tracks\n status = 'last track'\n else:\n- return \"error parsing track listing\"\n+ return \"error: could not parse track listing\"\n \n title = track[\"name\"]\n album = track[\"album\"][\"#text\"]"
}
] |
awx | d6429eb1e817161d24df97f486ec4190b27f0fdf | a845d5c0bb94396159a9139df44dcb63d1ec85c5 | awx/api/views.py | https://github.com/gconsidine/awx | true | false | true | @@ -1637,7 +1637,7 @@ class InventoryScriptView(RetrieveAPIView):
group_children.append(from_group_name)
# Now use in-memory maps to build up group info.
- for group in obj.groups:
+ for group in obj.groups.all():
group_info = OrderedDict()
group_info['hosts'] = group_hosts_map.get(group.id, [])
group_info['children'] = group_children_map.get(group.id, [])
| for group in obj . groups : group_info = OrderedDict ( ) group_info [ 'hosts' ] = group_hosts_map . get ( group . id , [ ] ) group_info [ 'children' ] = group_children_map . get ( group . id , [ ] ) | for group in obj . groups . all ( ) : group_info = OrderedDict ( ) group_info [ 'hosts' ] = group_hosts_map . get ( group . id , [ ] ) group_info [ 'children' ] = group_children_map . get ( group . id , [ ] ) | ADD_METHOD_CALL | [["Insert", ["for_statement", 3, 13, 6, 78], ["call", "N0"], 3], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 26, 3, 36], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:all", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1]] | gconsidine/awx@d6429eb1e817161d24df97f486ec4190b27f0fdf | Active flag removal fix for .filter->all | [
{
"sha": "96c3bf396eeb4210ca7146b8e16371aa23d4bf9a",
"filename": "awx/api/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/d6429eb1e817161d24df97f486ec4190b27f0fdf/awx%2Fapi%2Fviews.py",
"raw_url": "https://github.com/gconsidine/awx/raw/d6429eb1e817161d24df97f486ec4190b27f0fdf/awx%2Fapi%2Fviews.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=d6429eb1e817161d24df97f486ec4190b27f0fdf",
"patch": "@@ -1637,7 +1637,7 @@ def retrieve(self, request, *args, **kwargs):\n group_children.append(from_group_name)\n \n # Now use in-memory maps to build up group info.\n- for group in obj.groups:\n+ for group in obj.groups.all():\n group_info = OrderedDict()\n group_info['hosts'] = group_hosts_map.get(group.id, [])\n group_info['children'] = group_children_map.get(group.id, [])"
}
] |
awx | e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271 | f55d5d90f269e2e4bb134df6ef6d93c3ab2fad39 | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -322,7 +322,7 @@ class InventoryAccess(BaseAccess):
model = Inventory
def get_queryset(self, allowed=None, ad_hoc=None):
- qs = self.model.accessible_objects(self.user)
+ qs = self.model.accessible_objects(self.user, {'read': True})
qs = qs.select_related('created_by', 'modified_by', 'organization')
return qs
| qs = self . model . accessible_objects ( self . user ) | qs = self . model . accessible_objects ( self . user , { 'read' : True } ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 43, 3, 54], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 43, 3, 54], ["dictionary", "N0"], 3], ["Insert", "N0", ["{:{", "T"], 0], ["Insert", "N0", ["pair", "N1"], 1], ["Insert", "N0", ["}:}", "T"], 2], ["Insert", "N1", ["string:'read'", "T"], 0], ["Insert", "N1", [":::", "T"], 1], ["Insert", "N1", ["true:True", "T"], 2]] | gconsidine/awx@e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271 | Fixed missing accessible_objects permission parameter | [
{
"sha": "2446c94553aada1e4fc8bac1b071360e0b995355",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271",
"patch": "@@ -322,7 +322,7 @@ class InventoryAccess(BaseAccess):\n model = Inventory\n \n def get_queryset(self, allowed=None, ad_hoc=None):\n- qs = self.model.accessible_objects(self.user)\n+ qs = self.model.accessible_objects(self.user, {'read': True})\n qs = qs.select_related('created_by', 'modified_by', 'organization')\n return qs\n "
}
] |
awx | ea9642f5df1662b1f492b9a3b6a8d36649705637 | e0e3954a8aaffa9fd0493e20f33c49b2b1dfe271 | awx/api/views.py | https://github.com/gconsidine/awx | true | false | true | @@ -1555,7 +1555,7 @@ class InventoryRootGroupsList(SubListCreateAttachDetachAPIView):
def get_queryset(self):
parent = self.get_parent_object()
self.check_parent_access(parent)
- qs = self.request.user.get_queryset(self.model)
+ qs = self.request.user.get_queryset(self.model).distinct() # need distinct for '&' operator
return qs & parent.root_groups
class BaseVariableData(RetrieveUpdateAPIView):
| qs = self . request . user . get_queryset ( self . model ) | qs = self . request . user . get_queryset ( self . model ) . distinct ( ) | ADD_METHOD_CALL | [["Insert", ["call", 3, 14, 3, 56], ["attribute", "N0"], 0], ["Insert", ["call", 3, 14, 3, 56], ["argument_list", "N1"], 1], ["Move", "N0", ["call", 3, 14, 3, 56], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:distinct", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["):)", "T"], 1]] | gconsidine/awx@ea9642f5df1662b1f492b9a3b6a8d36649705637 | Fixed missing .distinct() necessary for '&' | [
{
"sha": "1a1ce35346c8f89bb4e179075cac24f2a5db9a23",
"filename": "awx/api/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/ea9642f5df1662b1f492b9a3b6a8d36649705637/awx%2Fapi%2Fviews.py",
"raw_url": "https://github.com/gconsidine/awx/raw/ea9642f5df1662b1f492b9a3b6a8d36649705637/awx%2Fapi%2Fviews.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=ea9642f5df1662b1f492b9a3b6a8d36649705637",
"patch": "@@ -1555,7 +1555,7 @@ class InventoryRootGroupsList(SubListCreateAttachDetachAPIView):\n def get_queryset(self):\n parent = self.get_parent_object()\n self.check_parent_access(parent)\n- qs = self.request.user.get_queryset(self.model)\n+ qs = self.request.user.get_queryset(self.model).distinct() # need distinct for '&' operator\n return qs & parent.root_groups\n \n class BaseVariableData(RetrieveUpdateAPIView):"
}
] |
awx | 0e8b7ab4f41fddea9466db300fc14068f2f46b00 | 3f29f1e3b54b541c4199ff1a3fc04e252ec99ea0 | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -322,7 +322,7 @@ class InventoryAccess(BaseAccess):
model = Inventory
def get_queryset(self, allowed=None, ad_hoc=None):
- qs = self.model.accessible_objects(self.user)
+ qs = self.model.accessible_objects(self.user, {'read':True})
qs = qs.select_related('created_by', 'modified_by', 'organization')
return qs
| qs = self . model . accessible_objects ( self . user ) | qs = self . model . accessible_objects ( self . user , { 'read' : True } ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 43, 3, 54], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 43, 3, 54], ["dictionary", "N0"], 3], ["Insert", "N0", ["{:{", "T"], 0], ["Insert", "N0", ["pair", "N1"], 1], ["Insert", "N0", ["}:}", "T"], 2], ["Insert", "N1", ["string:'read'", "T"], 0], ["Insert", "N1", [":::", "T"], 1], ["Insert", "N1", ["true:True", "T"], 2]] | gconsidine/awx@0e8b7ab4f41fddea9466db300fc14068f2f46b00 | Fixing Inventory access | [
{
"sha": "1fd12f59919f4465aa38a0ebd15ed7afd7e6449c",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/0e8b7ab4f41fddea9466db300fc14068f2f46b00/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/0e8b7ab4f41fddea9466db300fc14068f2f46b00/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=0e8b7ab4f41fddea9466db300fc14068f2f46b00",
"patch": "@@ -322,7 +322,7 @@ class InventoryAccess(BaseAccess):\n model = Inventory\n \n def get_queryset(self, allowed=None, ad_hoc=None):\n- qs = self.model.accessible_objects(self.user)\n+ qs = self.model.accessible_objects(self.user, {'read':True})\n qs = qs.select_related('created_by', 'modified_by', 'organization')\n return qs\n "
}
] |
awx | 46cb51ba2f1884deaf074851f5daaa17a2c45567 | c308c07579f730bee29c1f5ef5c5a19ced5eaef2 | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -645,7 +645,7 @@ class ProjectAccess(BaseAccess):
def can_add(self, data):
if self.user.is_superuser:
return True
- qs = Organization.accessible_objects(self.uesr, ALL_PERMISSIONS)
+ qs = Organization.accessible_objects(self.user, ALL_PERMISSIONS)
return bool(qs.count() > 0)
def can_change(self, obj, data):
| qs = Organization . accessible_objects ( self . uesr , ALL_PERMISSIONS ) | qs = Organization . accessible_objects ( self . user , ALL_PERMISSIONS ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:uesr", 3, 51, 3, 55], "user"]] | gconsidine/awx@46cb51ba2f1884deaf074851f5daaa17a2c45567 | typo fix | [
{
"sha": "3ab8696d11ee9091910c9ecbdf234c4d96284b44",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/46cb51ba2f1884deaf074851f5daaa17a2c45567/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/46cb51ba2f1884deaf074851f5daaa17a2c45567/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=46cb51ba2f1884deaf074851f5daaa17a2c45567",
"patch": "@@ -645,7 +645,7 @@ def get_queryset(self):\n def can_add(self, data):\n if self.user.is_superuser:\n return True\n- qs = Organization.accessible_objects(self.uesr, ALL_PERMISSIONS)\n+ qs = Organization.accessible_objects(self.user, ALL_PERMISSIONS)\n return bool(qs.count() > 0)\n \n def can_change(self, obj, data):"
}
] |
awx | c42f8f98a44a75211b0fc5497664c396229c4408 | 5db7383a3808f40ae94c06990308369dda672c33 | awx/api/views.py | https://github.com/gconsidine/awx | true | false | true | @@ -1006,7 +1006,7 @@ class UserTeamsList(ListAPIView):
def get_queryset(self):
u = User.objects.get(pk=self.kwargs['pk'])
- if not u.can_access(User, 'read', self.request.user):
+ if not self.request.user.can_access(User, 'read', u):
raise PermissionDenied()
return Team.accessible_objects(self.request.user, {'read': True}).filter(member_role__members=u)
| if not u . can_access ( User , 'read' , self . request . user ) : raise PermissionDenied ( ) | if not self . request . user . can_access ( User , 'read' , u ) : raise PermissionDenied ( ) | SINGLE_STMT | [["Move", ["attribute", 3, 16, 3, 28], ["attribute", 3, 43, 3, 60], 0], ["Insert", ["attribute", 3, 16, 3, 28], [".:.", "T"], 1], ["Insert", ["argument_list", 3, 28, 3, 61], ["identifier:u", "T"], 5], ["Delete", ["identifier:u", 3, 16, 3, 17]], ["Delete", [".:.", 3, 17, 3, 18]]] | gconsidine/awx@c42f8f98a44a75211b0fc5497664c396229c4408 | Fixed user/:id/teams access control | [
{
"sha": "08a73fce8933307592058c0f0a87c76127baaa58",
"filename": "awx/api/views.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/c42f8f98a44a75211b0fc5497664c396229c4408/awx%2Fapi%2Fviews.py",
"raw_url": "https://github.com/gconsidine/awx/raw/c42f8f98a44a75211b0fc5497664c396229c4408/awx%2Fapi%2Fviews.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fviews.py?ref=c42f8f98a44a75211b0fc5497664c396229c4408",
"patch": "@@ -1006,7 +1006,7 @@ class UserTeamsList(ListAPIView):\n \n def get_queryset(self):\n u = User.objects.get(pk=self.kwargs['pk'])\n- if not u.can_access(User, 'read', self.request.user):\n+ if not self.request.user.can_access(User, 'read', u):\n raise PermissionDenied()\n return Team.accessible_objects(self.request.user, {'read': True}).filter(member_role__members=u)\n "
}
] |
awx | dde2e66a2f107991961ad2bb6d39b4b1caf153b7 | 16475dd9735ea3f8e85e4677ca28a20415ec4ac1 | awx/main/management/commands/inventory_import.py | https://github.com/gconsidine/awx | true | false | true | @@ -821,7 +821,7 @@ class Command(NoArgsCommand):
db_groups = self.inventory_source.group.all_children
else:
db_groups = self.inventory.groups
- for db_group in db_groups:
+ for db_group in db_groups.all():
# Delete child group relationships not present in imported data.
db_children = db_group.children
db_children_name_pk_map = dict(db_children.values_list('name', 'pk'))
| for db_group in db_groups : db_children = db_group . children db_children_name_pk_map = dict ( db_children . values_list ( 'name' , 'pk' ) ) | for db_group in db_groups . all ( ) : db_children = db_group . children db_children_name_pk_map = dict ( db_children . values_list ( 'name' , 'pk' ) ) | ADD_METHOD_CALL | [["Insert", ["for_statement", 3, 9, 6, 82], ["call", "N0"], 3], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:db_groups", 3, 25, 3, 34], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:all", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1]] | gconsidine/awx@dde2e66a2f107991961ad2bb6d39b4b1caf153b7 | Fix missing .all() from active flag filter nuke | [
{
"sha": "91b3a0a5449d2fceb9c81e21c89bfa24a78a00bc",
"filename": "awx/main/management/commands/inventory_import.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/dde2e66a2f107991961ad2bb6d39b4b1caf153b7/awx%2Fmain%2Fmanagement%2Fcommands%2Finventory_import.py",
"raw_url": "https://github.com/gconsidine/awx/raw/dde2e66a2f107991961ad2bb6d39b4b1caf153b7/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=dde2e66a2f107991961ad2bb6d39b4b1caf153b7",
"patch": "@@ -821,7 +821,7 @@ def _delete_group_children_and_hosts(self):\n db_groups = self.inventory_source.group.all_children\n else:\n db_groups = self.inventory.groups\n- for db_group in db_groups:\n+ for db_group in db_groups.all():\n # Delete child group relationships not present in imported data.\n db_children = db_group.children\n db_children_name_pk_map = dict(db_children.values_list('name', 'pk'))"
}
] |
awx | b9924613fac0fdfc9afa07217086733ceff67505 | dde2e66a2f107991961ad2bb6d39b4b1caf153b7 | awx/main/tests/old/commands/commands_monolithic.py | https://github.com/gconsidine/awx | true | false | true | @@ -986,7 +986,7 @@ class InventoryImportTest(BaseCommandMixin, BaseLiveServerTest):
self.assertEqual(new_inv.groups.count(), ngroups)
self.assertEqual(new_inv.total_hosts, nhosts)
self.assertEqual(new_inv.total_groups, ngroups)
- self.assertElapsedLessThan(120)
+ self.assertElapsedLessThan(1200) # FIXME: This should be < 120, will drop back down next sprint during our performance tuning work - anoek 2016-03-22
@unittest.skipIf(getattr(settings, 'LOCAL_DEVELOPMENT', False),
'Skip this test in local development environments, '
| self . assertElapsedLessThan ( 120 ) | self . assertElapsedLessThan ( 1200 ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:120", 3, 36, 3, 39], "1200"]] | gconsidine/awx@b9924613fac0fdfc9afa07217086733ceff67505 | Timing adjustment to let our large data test pass for now
This hack is to avoid having failure noise as we're working through
preparing to merge into devel.
There is an issue #992 to track and fix this specific problem properly,
so this change is just to squelch the test for now. | [
{
"sha": "359de2dd256c2a29eee34fced63e187e78389358",
"filename": "awx/main/tests/old/commands/commands_monolithic.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/b9924613fac0fdfc9afa07217086733ceff67505/awx%2Fmain%2Ftests%2Fold%2Fcommands%2Fcommands_monolithic.py",
"raw_url": "https://github.com/gconsidine/awx/raw/b9924613fac0fdfc9afa07217086733ceff67505/awx%2Fmain%2Ftests%2Fold%2Fcommands%2Fcommands_monolithic.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Fold%2Fcommands%2Fcommands_monolithic.py?ref=b9924613fac0fdfc9afa07217086733ceff67505",
"patch": "@@ -986,7 +986,7 @@ def _check_largeinv_import(self, new_inv, nhosts):\n self.assertEqual(new_inv.groups.count(), ngroups)\n self.assertEqual(new_inv.total_hosts, nhosts)\n self.assertEqual(new_inv.total_groups, ngroups)\n- self.assertElapsedLessThan(120)\n+ self.assertElapsedLessThan(1200) # FIXME: This should be < 120, will drop back down next sprint during our performance tuning work - anoek 2016-03-22\n \n @unittest.skipIf(getattr(settings, 'LOCAL_DEVELOPMENT', False),\n 'Skip this test in local development environments, '"
}
] |
awx | 2a446d206e6e11c6d91c63f23adfac0f25542364 | 922da6ed7a3bc2c783df243b2d28e6f2d34efc4c | awx/main/access.py | https://github.com/gconsidine/awx | true | false | true | @@ -1340,7 +1340,7 @@ class RoleAccess(BaseAccess):
def get_queryset(self):
if self.user.is_superuser:
return self.model.objects.all()
- return self.model.accessible_objects(self.user, {'read':True})
+ return Role.objects.filter(ancestors__in=self.user.roles.all())
def can_change(self, obj, data):
return self.user.is_superuser
| return self . model . accessible_objects ( self . user , { 'read' : True } ) | return Role . objects . filter ( ancestors__in = self . user . roles . all ( ) ) | SINGLE_STMT | [["Update", ["identifier:accessible_objects", 3, 27, 3, 45], "filter"], ["Insert", ["argument_list", 3, 45, 3, 71], ["keyword_argument", "N0"], 1], ["Update", ["identifier:self", 3, 16, 3, 20], "Role"], ["Update", ["identifier:model", 3, 21, 3, 26], "objects"], ["Insert", "N0", ["identifier:ancestors__in", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["call", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["argument_list", "N3"], 1], ["Insert", "N2", ["attribute", "N4"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:all", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["):)", "T"], 1], ["Move", "N4", ["attribute", 3, 46, 3, 55], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:roles", "T"], 2], ["Delete", [",:,", 3, 55, 3, 56]], ["Delete", ["{:{", 3, 57, 3, 58]], ["Delete", ["string:'read'", 3, 58, 3, 64]], ["Delete", [":::", 3, 64, 3, 65]], ["Delete", ["true:True", 3, 65, 3, 69]], ["Delete", ["pair", 3, 58, 3, 69]], ["Delete", ["}:}", 3, 69, 3, 70]], ["Delete", ["dictionary", 3, 57, 3, 70]]] | gconsidine/awx@2a446d206e6e11c6d91c63f23adfac0f25542364 | Fix for RoleAccess queryset | [
{
"sha": "a0d34d2607ebfa6dfaee67ae3465cbac39b59aec",
"filename": "awx/main/access.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/2a446d206e6e11c6d91c63f23adfac0f25542364/awx%2Fmain%2Faccess.py",
"raw_url": "https://github.com/gconsidine/awx/raw/2a446d206e6e11c6d91c63f23adfac0f25542364/awx%2Fmain%2Faccess.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Faccess.py?ref=2a446d206e6e11c6d91c63f23adfac0f25542364",
"patch": "@@ -1340,7 +1340,7 @@ class RoleAccess(BaseAccess):\n def get_queryset(self):\n if self.user.is_superuser:\n return self.model.objects.all()\n- return self.model.accessible_objects(self.user, {'read':True})\n+ return Role.objects.filter(ancestors__in=self.user.roles.all())\n \n def can_change(self, obj, data):\n return self.user.is_superuser"
}
] |
awx | c1c444fd3ca613bf31373e776845169f6ca7eb2a | 1b9c5ef55b95842c1e816834e488e665b75babe8 | awx/api/pagination.py | https://github.com/gconsidine/awx | true | false | false | @@ -3,7 +3,7 @@
# Django REST Framework
from rest_framework import pagination
-from rest_framework.utils.urls import remove_query_param, replace_query_param
+from rest_framework.utils.urls import replace_query_param
class Pagination(pagination.PageNumberPagination):
| from rest_framework . utils . urls import remove_query_param , replace_query_param | from rest_framework . utils . urls import replace_query_param | SINGLE_STMT | [["Delete", ["identifier:remove_query_param", 3, 39, 3, 57]], ["Delete", ["dotted_name", 3, 39, 3, 57]], ["Delete", [",:,", 3, 57, 3, 58]]] | gconsidine/awx@c1c444fd3ca613bf31373e776845169f6ca7eb2a | Flake8 fix. | [
{
"sha": "ee17aee0e19fab77330dcc21884feaa589a130c7",
"filename": "awx/api/pagination.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/c1c444fd3ca613bf31373e776845169f6ca7eb2a/awx%2Fapi%2Fpagination.py",
"raw_url": "https://github.com/gconsidine/awx/raw/c1c444fd3ca613bf31373e776845169f6ca7eb2a/awx%2Fapi%2Fpagination.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fpagination.py?ref=c1c444fd3ca613bf31373e776845169f6ca7eb2a",
"patch": "@@ -3,7 +3,7 @@\n \n # Django REST Framework\n from rest_framework import pagination\n-from rest_framework.utils.urls import remove_query_param, replace_query_param\n+from rest_framework.utils.urls import replace_query_param\n \n \n class Pagination(pagination.PageNumberPagination):"
}
] |
awx | 1d2d043c299c8fb457e29a4cfe9b4724bc2a8a33 | ed17be242d9d2f6d30f62ffe2533bd4f3ed3ae4b | awx/main/migrations/_rbac.py | https://github.com/gconsidine/awx | true | false | true | @@ -15,7 +15,7 @@ def log_migration(wrapped):
- handler = logging.FileHandler("tower_rbac_migrations.log", mode="a", encoding="UTF-8")
+ handler = logging.FileHandler("/tmp/tower_rbac_migrations.log", mode="a", encoding="UTF-8")
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setLevel(logging.DEBUG)
handler.setFormatter(formatter)
| handler = logging . FileHandler ( "tower_rbac_migrations.log" , mode = "a" , encoding = "UTF-8" ) | handler = logging . FileHandler ( "/tmp/tower_rbac_migrations.log" , mode = "a" , encoding = "UTF-8" ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"tower_rbac_migrations.log\"", 0, 35, 0, 62], "\"/tmp/tower_rbac_migrations.log\""]] | gconsidine/awx@1d2d043c299c8fb457e29a4cfe9b4724bc2a8a33 | fixes:#1371 - migration log write permissions | [
{
"sha": "0fa5ce5ceb2f8b00a2fe45831ee3a92ef53e293e",
"filename": "awx/main/migrations/_rbac.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/1d2d043c299c8fb457e29a4cfe9b4724bc2a8a33/awx%2Fmain%2Fmigrations%2F_rbac.py",
"raw_url": "https://github.com/gconsidine/awx/raw/1d2d043c299c8fb457e29a4cfe9b4724bc2a8a33/awx%2Fmain%2Fmigrations%2F_rbac.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmigrations%2F_rbac.py?ref=1d2d043c299c8fb457e29a4cfe9b4724bc2a8a33",
"patch": "@@ -15,7 +15,7 @@ def log_migration(wrapped):\n as it runs, Django resets this, so we use a decorator\n to re-add the handler for each method.\n '''\n- handler = logging.FileHandler(\"tower_rbac_migrations.log\", mode=\"a\", encoding=\"UTF-8\")\n+ handler = logging.FileHandler(\"/tmp/tower_rbac_migrations.log\", mode=\"a\", encoding=\"UTF-8\")\n formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n handler.setLevel(logging.DEBUG)\n handler.setFormatter(formatter)"
}
] |
awx | 4882bef180d73215c1bd96865a7923b9b5467242 | ff5935ccfdd0b6f5e813506672352884733857bd | awx/api/serializers.py | https://github.com/gconsidine/awx | true | false | true | @@ -1631,7 +1631,7 @@ class JobTemplateSerializer(UnifiedJobTemplateSerializer, JobOptionsSerializer):
return res
def _recent_jobs(self, obj):
- return [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]]
+ return [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.all().order_by('-created')[:10]]
def get_summary_fields(self, obj):
d = super(JobTemplateSerializer, self).get_summary_fields(obj)
| return [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . filter ( active = True ) . order_by ( '-created' ) [ : 10 ] ] | return [ { 'id' : x . id , 'status' : x . status , 'finished' : x . finished } for x in obj . jobs . all ( ) . order_by ( '-created' ) [ : 10 ] ] | SINGLE_STMT | [["Update", ["identifier:filter", 3, 92, 3, 98], "all"], ["Delete", ["identifier:active", 3, 99, 3, 105]], ["Delete", ["=:=", 3, 105, 3, 106]], ["Delete", ["true:True", 3, 106, 3, 110]], ["Delete", ["keyword_argument", 3, 99, 3, 110]]] | gconsidine/awx@4882bef180d73215c1bd96865a7923b9b5467242 | fix job templates endpoint rbacism update | [
{
"sha": "b170199bdb74c328190fbedebf8b10109f0d7147",
"filename": "awx/api/serializers.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/4882bef180d73215c1bd96865a7923b9b5467242/awx%2Fapi%2Fserializers.py",
"raw_url": "https://github.com/gconsidine/awx/raw/4882bef180d73215c1bd96865a7923b9b5467242/awx%2Fapi%2Fserializers.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fapi%2Fserializers.py?ref=4882bef180d73215c1bd96865a7923b9b5467242",
"patch": "@@ -1631,7 +1631,7 @@ def get_related(self, obj):\n return res\n \n def _recent_jobs(self, obj):\n- return [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.filter(active=True).order_by('-created')[:10]]\n+ return [{'id': x.id, 'status': x.status, 'finished': x.finished} for x in obj.jobs.all().order_by('-created')[:10]]\n \n def get_summary_fields(self, obj):\n d = super(JobTemplateSerializer, self).get_summary_fields(obj)"
}
] |
awx | 86e29221d5c3ec97fb33617a6836b0e9083efc59 | 59b6ed3b9c263880eac5294eab09b4a4a0e121b2 | awx/main/migrations/_rbac.py | https://github.com/gconsidine/awx | true | false | true | @@ -135,7 +135,7 @@ def _discover_credentials(instances, cred, orgfunc):
orgs[orgfunc(inst)].append(inst)
if len(orgs) == 1:
- _update_credential_parents(instances[0].inventory.organization, cred)
+ _update_credential_parents(orgfunc(instances[0]), cred)
else:
for pos, org in enumerate(orgs):
if pos == 0:
| _update_credential_parents ( instances [ 0 ] . inventory . organization , cred ) | _update_credential_parents ( orgfunc ( instances [ 0 ] ) , cred ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 35, 3, 78], ["call", "N0"], 1], ["Insert", "N0", ["identifier:orgfunc", "T"], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["subscript", 3, 36, 3, 48], 1], ["Insert", "N1", ["):)", "T"], 2], ["Delete", [".:.", 3, 48, 3, 49]], ["Delete", ["identifier:inventory", 3, 49, 3, 58]], ["Delete", ["attribute", 3, 36, 3, 58]], ["Delete", [".:.", 3, 58, 3, 59]], ["Delete", ["identifier:organization", 3, 59, 3, 71]], ["Delete", ["attribute", 3, 36, 3, 71]]] | gconsidine/awx@86e29221d5c3ec97fb33617a6836b0e9083efc59 | Fixed missing `orgfunc` usage to resolve organization during credential migration | [
{
"sha": "3b411094f40c6aa7152d220f99a4d229cb7212f4",
"filename": "awx/main/migrations/_rbac.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/86e29221d5c3ec97fb33617a6836b0e9083efc59/awx%2Fmain%2Fmigrations%2F_rbac.py",
"raw_url": "https://github.com/gconsidine/awx/raw/86e29221d5c3ec97fb33617a6836b0e9083efc59/awx%2Fmain%2Fmigrations%2F_rbac.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmigrations%2F_rbac.py?ref=86e29221d5c3ec97fb33617a6836b0e9083efc59",
"patch": "@@ -135,7 +135,7 @@ def _discover_credentials(instances, cred, orgfunc):\n orgs[orgfunc(inst)].append(inst)\n \n if len(orgs) == 1:\n- _update_credential_parents(instances[0].inventory.organization, cred)\n+ _update_credential_parents(orgfunc(instances[0]), cred)\n else:\n for pos, org in enumerate(orgs):\n if pos == 0:"
}
] |
awx | 8c917de24da3083d207d5514a64b673d4c738821 | 7cd4fb7b7ae5a894193f0f224e68f348aceb1a1f | awx/main/tests/functional/api/test_activity_streams.py | https://github.com/gconsidine/awx | true | false | true | @@ -20,7 +20,7 @@ def test_get_activity_stream_list(monkeypatch, organization, get, user):
@pytest.mark.django_db
def test_basic_fields(monkeypatch, organization, get, user):
u = user('admin', True)
- activity_stream = ActivityStream.objects.latest('pk')
+ activity_stream = ActivityStream.objects.filter(organization=organization).latest('pk')
activity_stream.actor = u
activity_stream.save()
| activity_stream = ActivityStream . objects . latest ( 'pk' ) | activity_stream = ActivityStream . objects . filter ( organization = organization ) . latest ( 'pk' ) | ADD_METHOD_CALL | [["Insert", ["attribute", 3, 23, 3, 52], ["call", "N0"], 0], ["Insert", ["attribute", 3, 23, 3, 52], [".:.", "T"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["attribute", 3, 23, 3, 45], 0], ["Move", "N1", [".:.", 3, 45, 3, 46], 1], ["Insert", "N1", ["identifier:filter", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["keyword_argument", "N3"], 1], ["Insert", "N2", ["):)", "T"], 2], ["Insert", "N3", ["identifier:organization", "T"], 0], ["Insert", "N3", ["=:=", "T"], 1], ["Insert", "N3", ["identifier:organization", "T"], 2]] | gconsidine/awx@8c917de24da3083d207d5514a64b673d4c738821 | Fix faulty activitystream test
Test assumed that the only entry in activitystream would be related to
the creation of the organization, which in this case was not true, the
most recent being something related to the user object being created or
modified. | [
{
"sha": "8bc33419e64e08d8794a12295833c367afbc6aca",
"filename": "awx/main/tests/functional/api/test_activity_streams.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/8c917de24da3083d207d5514a64b673d4c738821/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py",
"raw_url": "https://github.com/gconsidine/awx/raw/8c917de24da3083d207d5514a64b673d4c738821/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Ftests%2Ffunctional%2Fapi%2Ftest_activity_streams.py?ref=8c917de24da3083d207d5514a64b673d4c738821",
"patch": "@@ -20,7 +20,7 @@ def test_get_activity_stream_list(monkeypatch, organization, get, user):\n @pytest.mark.django_db\n def test_basic_fields(monkeypatch, organization, get, user):\n u = user('admin', True)\n- activity_stream = ActivityStream.objects.latest('pk')\n+ activity_stream = ActivityStream.objects.filter(organization=organization).latest('pk')\n activity_stream.actor = u\n activity_stream.save()\n "
}
] |
awx | 1d27ddc7d27024313fc953c171048e5e897a5495 | 2ccd46de1143118bf9d438006bf3e0719a726189 | awx/main/migrations/0008_v300_rbac_changes.py | https://github.com/gconsidine/awx | true | false | false | @@ -64,7 +64,7 @@ class Migration(migrations.Migration):
('members', models.ManyToManyField(related_name='roles', to=settings.AUTH_USER_MODEL)),
('modified_by', models.ForeignKey(related_name="{u'class': 'role', u'app_label': 'main'}(class)s_modified+", on_delete=django.db.models.deletion.SET_NULL, default=None, editable=False, to=settings.AUTH_USER_MODEL, null=True)),
('parents', models.ManyToManyField(related_name='children', to='main.Role')),
- ('implicit_parents', models.ManyToManyField(related_name='implicit_children', to='main.Role')),
+ ('implicit_parents', models.TextField(null=False, default=b'[]')),
('tags', taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags')),
],
options={
| ( 'implicit_parents' , models . ManyToManyField ( related_name = 'implicit_children' , to = 'main.Role' ) ) , | ( 'implicit_parents' , models . TextField ( null = False , default = b'[]' ) ) , | SINGLE_STMT | [["Update", ["identifier:ManyToManyField", 3, 45, 3, 60], "TextField"], ["Update", ["identifier:related_name", 3, 61, 3, 73], "null"], ["Insert", ["keyword_argument", 3, 61, 3, 93], ["=:=", "T"], 1], ["Insert", ["keyword_argument", 3, 61, 3, 93], ["false:False", "T"], 2], ["Update", ["identifier:to", 3, 95, 3, 97], "default"], ["Move", ["keyword_argument", 3, 95, 3, 109], ["=:=", 3, 73, 3, 74], 1], ["Update", ["string:'main.Role'", 3, 98, 3, 109], "b'[]'"], ["Delete", ["string:'implicit_children'", 3, 74, 3, 93]], ["Delete", ["=:=", 3, 97, 3, 98]]] | gconsidine/awx@1d27ddc7d27024313fc953c171048e5e897a5495 | Fix bad migration from #1496 | [
{
"sha": "ba9299ca19c4c91ac7ba7b97cbc130c98a561392",
"filename": "awx/main/migrations/0008_v300_rbac_changes.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/gconsidine/awx/blob/1d27ddc7d27024313fc953c171048e5e897a5495/awx%2Fmain%2Fmigrations%2F0008_v300_rbac_changes.py",
"raw_url": "https://github.com/gconsidine/awx/raw/1d27ddc7d27024313fc953c171048e5e897a5495/awx%2Fmain%2Fmigrations%2F0008_v300_rbac_changes.py",
"contents_url": "https://api.github.com/repos/gconsidine/awx/contents/awx%2Fmain%2Fmigrations%2F0008_v300_rbac_changes.py?ref=1d27ddc7d27024313fc953c171048e5e897a5495",
"patch": "@@ -64,7 +64,7 @@ class Migration(migrations.Migration):\n ('members', models.ManyToManyField(related_name='roles', to=settings.AUTH_USER_MODEL)),\n ('modified_by', models.ForeignKey(related_name=\"{u'class': 'role', u'app_label': 'main'}(class)s_modified+\", on_delete=django.db.models.deletion.SET_NULL, default=None, editable=False, to=settings.AUTH_USER_MODEL, null=True)),\n ('parents', models.ManyToManyField(related_name='children', to='main.Role')),\n- ('implicit_parents', models.ManyToManyField(related_name='implicit_children', to='main.Role')),\n+ ('implicit_parents', models.TextField(null=False, default=b'[]')),\n ('tags', taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags')),\n ],\n options={"
}
] |
aetherbot | afc556281e87e180fcfeef565232237c8868dbf1 | 22b15b5e5f58dda58ded89d98cda10869cf67590 | plugins/rss.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -34,7 +34,7 @@ def rss(inp, say=None):
say(u"{} - {}".format(title, link))
-@hook.command
+@hook.command(autohelp=False)
def rb(inp, say=None):
"rb -- Shows the latest Craftbukkit recommended build"
rss("bukkit", say)
| @ hook . command def rb ( inp , say = None ) : "rb -- Shows the latest Craftbukkit recommended build" rss ( "bukkit" , say ) | @ hook . command ( autohelp = False ) def rb ( inp , say = None ) : "rb -- Shows the latest Craftbukkit recommended build" rss ( "bukkit" , say ) | SINGLE_STMT | [["Insert", ["decorator", 3, 1, 3, 14], ["call", "N0"], 1], ["Move", "N0", ["attribute", 3, 2, 3, 14], 0], ["Insert", "N0", ["argument_list", "N1"], 1], ["Insert", "N1", ["(:(", "T"], 0], ["Insert", "N1", ["keyword_argument", "N2"], 1], ["Insert", "N1", ["):)", "T"], 2], ["Insert", "N2", ["identifier:autohelp", "T"], 0], ["Insert", "N2", ["=:=", "T"], 1], ["Insert", "N2", ["false:False", "T"], 2]] | ihatevim/aetherbot@afc556281e87e180fcfeef565232237c8868dbf1 | null | null |
aetherbot | 2bdb7a7915bb74ec1b54feb4203d286e48f92065 | afc556281e87e180fcfeef565232237c8868dbf1 | plugins/imdb.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -17,7 +17,7 @@ def imdb(inp):
else:
content = http.get_json("http://www.omdbapi.com/", t=strip)
- if content['Error'] == 'Movie not found!':
+ if content.get('Error', None) == 'Movie not found!':
return 'Movie not found!'
elif content['Response'] == 'True':
content['URL'] = 'http://www.imdb.com/title/%(imdbID)s' % content
| if content [ 'Error' ] == 'Movie not found!' : return 'Movie not found!' elif content [ 'Response' ] == 'True' : content [ 'URL' ] = 'http://www.imdb.com/title/%(imdbID)s' % content | if content . get ( 'Error' , None ) == 'Movie not found!' : return 'Movie not found!' elif content [ 'Response' ] == 'True' : content [ 'URL' ] = 'http://www.imdb.com/title/%(imdbID)s' % content | SINGLE_STMT | [["Insert", ["comparison_operator", 3, 8, 3, 46], ["call", "N0"], 0], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:content", 3, 8, 3, 15], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:get", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Move", "N2", ["string:'Error'", 3, 16, 3, 23], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["none:None", "T"], 3], ["Insert", "N2", ["):)", "T"], 4], ["Delete", ["[:[", 3, 15, 3, 16]], ["Delete", ["]:]", 3, 23, 3, 24]], ["Delete", ["subscript", 3, 8, 3, 24]]] | ihatevim/aetherbot@2bdb7a7915bb74ec1b54feb4203d286e48f92065 | Fixed a bug in imdb | [
{
"sha": "5d015fa71e9d874b1a591a2dd7e5ddae050a4245",
"filename": "plugins/imdb.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/2bdb7a7915bb74ec1b54feb4203d286e48f92065/plugins%2Fimdb.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/2bdb7a7915bb74ec1b54feb4203d286e48f92065/plugins%2Fimdb.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fimdb.py?ref=2bdb7a7915bb74ec1b54feb4203d286e48f92065",
"patch": "@@ -17,7 +17,7 @@ def imdb(inp):\n else:\n content = http.get_json(\"http://www.omdbapi.com/\", t=strip)\n \n- if content['Error'] == 'Movie not found!':\n+ if content.get('Error', None) == 'Movie not found!':\n return 'Movie not found!'\n elif content['Response'] == 'True':\n content['URL'] = 'http://www.imdb.com/title/%(imdbID)s' % content"
}
] |
aetherbot | fc2e8e56a43b6f12a5d340c605255ad05b9fabb7 | f46f7528781cfeb718fb79a6d4f3cb399693d822 | plugins/bitcoin.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -3,7 +3,7 @@ from util import http, hook
@hook.command(autohelp=False)
def bitcoin(inp, say=None):
- ".bitcoin -- gets current exchange rate for bitcoins from mtgox"
+ "bitcoin -- gets current exchange rate for bitcoins from mtgox"
data = http.get_json("https://data.mtgox.com/api/2/BTCUSD/money/ticker")
data = data['data']
ticker = {
| ".bitcoin -- gets current exchange rate for bitcoins from mtgox" | "bitcoin -- gets current exchange rate for bitcoins from mtgox" | CHANGE_STRING_LITERAL | [["Update", ["string:\".bitcoin -- gets current exchange rate for bitcoins from mtgox\"", 3, 5, 3, 69], "\"bitcoin -- gets current exchange rate for bitcoins from mtgox\""]] | ihatevim/aetherbot@fc2e8e56a43b6f12a5d340c605255ad05b9fabb7 | null | null |
aetherbot | 6595f7d54a721470ecdc42934a6e3b90566ffca9 | 48cbc834de2a2433dec06ffbb7742f2fb48d3ae1 | plugins/util/web.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -21,7 +21,7 @@ class ShortenError(Exception):
def isgd(url):
- """ shortens a URL with the is.gd PAI """
+ """ shortens a URL with the is.gd API """
url = urlnorm.normalize(url.encode('utf-8'), assume_scheme='http')
params = urllib.urlencode({'format': 'json', 'url': url})
request = http.get_json("http://is.gd/create.php?%s" % params)
| """ shortens a URL with the is.gd PAI """ | """ shortens a URL with the is.gd API """ | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"\" shortens a URL with the is.gd PAI \"\"\"", 3, 5, 3, 46], "\"\"\" shortens a URL with the is.gd API \"\"\""]] | ihatevim/aetherbot@6595f7d54a721470ecdc42934a6e3b90566ffca9 | null | null |
aetherbot | 0100f1d07133f9120ecd8a499395a39c23d01392 | ba21f11f6b5190db47ab50d1839f1030a861661b | bot.py | https://github.com/ihatevim/aetherbot | true | false | false | @@ -58,7 +58,7 @@ try:
for name, conf in bot.config['connections'].iteritems():
# strip all spaces and capitalization from the connection name
name = name.replace(" ", "_")
- name = re.sub('[^A-Za-z0-9_]+', '', name).lower()
+ name = re.sub('[^A-Za-z0-9_]+', '', name)
print 'Connecting to server: %s' % conf['server']
if conf.get('ssl'):
bot.conns[name] = SSLIRC(name, conf['server'], conf['nick'], conf=conf,
| name = re . sub ( '[^A-Za-z0-9_]+' , '' , name ) . lower ( ) | name = re . sub ( '[^A-Za-z0-9_]+' , '' , name ) | SINGLE_STMT | [["Delete", [".:.", 3, 50, 3, 51]], ["Delete", ["identifier:lower", 3, 51, 3, 56]], ["Delete", ["attribute", 3, 16, 3, 56]], ["Delete", ["(:(", 3, 56, 3, 57]], ["Delete", ["):)", 3, 57, 3, 58]], ["Delete", ["argument_list", 3, 56, 3, 58]]] | ihatevim/aetherbot@0100f1d07133f9120ecd8a499395a39c23d01392 | null | null |
aetherbot | 98395457e56d73e87ad9867d40772f1e363d25e2 | 0bdbade75fe6ef9e947646fa97b5ea60167623a8 | core/irc.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -166,7 +166,7 @@ class IRC(object):
else:
prefix, command, params = irc_noprefix_rem(msg).groups()
nick, user, host = irc_netmask_rem(prefix).groups()
- mask = user + "@" + host
+ mask = nick + "!" + user + "@" + host
paramlist = irc_param_ref(params)
lastparam = ""
if paramlist:
| mask = user + "@" + host | mask = nick + "!" + user + "@" + host | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 20, 3, 30], ["binary_operator", "N0"], 0], ["Insert", ["binary_operator", 3, 20, 3, 30], ["+:+", "T"], 1], ["Insert", "N0", ["binary_operator", "N1"], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Move", "N0", ["identifier:user", 3, 20, 3, 24], 2], ["Insert", "N1", ["identifier:nick", "T"], 0], ["Move", "N1", ["+:+", 3, 25, 3, 26], 1], ["Insert", "N1", ["string:\"!\"", "T"], 2]] | ihatevim/aetherbot@98395457e56d73e87ad9867d40772f1e363d25e2 | null | null |
aetherbot | 6bd692f34ac805e8e3e8e8624d2f39d2c2998e9a | ba6c2ae2c8041dcad85386b46a3afe05e73e040f | plugins/seen.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -39,7 +39,7 @@ def seen(inp, nick='', chan='', db=None, input=None):
if inp.lower() == nick.lower():
return "Have you looked in a mirror lately?"
- if not re.match("^[A-Za-z0-9_|.-\]\[]*$", inp.lower()):
+ if not re.match("^[A-Za-z0-9_|.\-\]\[]*$", inp.lower()):
return "I can't look up that name, its impossible to use!"
if not db_ready:
| if not re . match ( "^[A-Za-z0-9_|.-\]\[]*$" , inp . lower ( ) ) : return "I can't look up that name, its impossible to use!" | if not re . match ( "^[A-Za-z0-9_|.\-\]\[]*$" , inp . lower ( ) ) : return "I can't look up that name, its impossible to use!" | CHANGE_STRING_LITERAL | [["Update", ["string:\"^[A-Za-z0-9_|.-\\]\\[]*$\"", 3, 21, 3, 45], "\"^[A-Za-z0-9_|.\\-\\]\\[]*$\""]] | ihatevim/aetherbot@6bd692f34ac805e8e3e8e8624d2f39d2c2998e9a | null | null |
aetherbot | 4d74493610a9d7682b23ed8f7749c9aa8b8bab62 | e74a92e252f55ebd9a2ceb1027dc3d28b839edeb | plugins/core_sieve.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -32,7 +32,7 @@ def sieve_suite(bot, input, func, kind, args):
# shim so plugins using the old "adminonly" permissions format still work
if args.get('adminonly', False):
- args['perms'] = ["adminonly"]
+ args["permissions"] = ["adminonly"]
if args.get('permissions', False):
| args [ 'perms' ] = [ "adminonly" ] | args [ "permissions" ] = [ "adminonly" ] | CHANGE_STRING_LITERAL | [["Update", ["string:'perms'", 3, 14, 3, 21], "\"permissions\""]] | ihatevim/aetherbot@4d74493610a9d7682b23ed8f7749c9aa8b8bab62 | null | null |
aetherbot | 9eeebe1a9d91bb50d7f1ad53f9a544ca9f6090a8 | e0614272076d2622e4a3450b111edc76beb057ed | plugins/op.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -114,7 +114,7 @@ def kick(inp, chan=None, conn=None, notice=None):
target = split[0]
if len(split) > 1:
reason = " ".join(split[1:])
- out = "KICK {} {}: {}".format(channel, target, reason)
+ out = "KICK {} {} :{}".format(channel, target, reason)
else:
out = "KICK {} {}".format(channel, target)
| out = "KICK {} {}: {}" . format ( channel , target , reason ) | out = "KICK {} {} :{}" . format ( channel , target , reason ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"KICK {} {}: {}\"", 3, 19, 3, 35], "\"KICK {} {} :{}\""]] | ihatevim/aetherbot@9eeebe1a9d91bb50d7f1ad53f9a544ca9f6090a8 | Fix kicking with a reason in op.py | [
{
"sha": "bab19792a8d13db32995a07282088a03d9529616",
"filename": "plugins/op.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/9eeebe1a9d91bb50d7f1ad53f9a544ca9f6090a8/plugins%2Fop.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/9eeebe1a9d91bb50d7f1ad53f9a544ca9f6090a8/plugins%2Fop.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Fop.py?ref=9eeebe1a9d91bb50d7f1ad53f9a544ca9f6090a8",
"patch": "@@ -114,7 +114,7 @@ def kick(inp, chan=None, conn=None, notice=None):\n target = split[0]\n if len(split) > 1:\n reason = \" \".join(split[1:])\n- out = \"KICK {} {}: {}\".format(channel, target, reason)\n+ out = \"KICK {} {} :{}\".format(channel, target, reason)\n else:\n out = \"KICK {} {}\".format(channel, target)\n "
}
] |
aetherbot | 9efedde7344564820a0f05394699bba9a22b7f95 | 8e121f5b5f9cd8814c692674fd74fc6eda17193b | plugins/seen.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -18,7 +18,7 @@ def db_init(db):
@hook.singlethread
@hook.event('PRIVMSG', ignorebots=False)
-def seen_sieve(input=None, db=None):
+def seen_sieve(paraml, input=None, db=None):
if not db_ready:
db_init(db)
# keep private messages private
| def seen_sieve ( input = None , db = None ) : if not db_ready : db_init ( db ) | def seen_sieve ( paraml , input = None , db = None ) : if not db_ready : db_init ( db ) | SINGLE_STMT | [["Insert", ["parameters", 3, 15, 3, 36], ["identifier:paraml", "T"], 1], ["Insert", ["parameters", 3, 15, 3, 36], [",:,", "T"], 2]] | ihatevim/aetherbot@9efedde7344564820a0f05394699bba9a22b7f95 | null | null |
aetherbot | d29b3c313f6ef52a6a14c009535064812ffe1462 | 75d4af13932c7bc8b8b6459febe577c3429e1847 | plugins/util/ircformat.py | https://github.com/ihatevim/aetherbot | true | false | true | @@ -24,7 +24,7 @@ def raw(format_string):
stuff['text'] = {'[url]':'http://'}
final = {}
for x in stuff:
- final.update(x)
+ final.update(stuff[x])
for x in final:
format_string = format_string.replace(x,final[x])
return format_string
| final . update ( x ) | final . update ( stuff [ x ] ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 21, 3, 24], ["subscript", "N0"], 1], ["Insert", "N0", ["identifier:stuff", "T"], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Move", "N0", ["identifier:x", 3, 22, 3, 23], 2], ["Insert", "N0", ["]:]", "T"], 3]] | ihatevim/aetherbot@d29b3c313f6ef52a6a14c009535064812ffe1462 | Fixing dict.update() | [
{
"sha": "e08f291d18ce1ae28e8f893ddbb576c2d0d48fca",
"filename": "plugins/util/ircformat.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/ihatevim/aetherbot/blob/d29b3c313f6ef52a6a14c009535064812ffe1462/plugins%2Futil%2Fircformat.py",
"raw_url": "https://github.com/ihatevim/aetherbot/raw/d29b3c313f6ef52a6a14c009535064812ffe1462/plugins%2Futil%2Fircformat.py",
"contents_url": "https://api.github.com/repos/ihatevim/aetherbot/contents/plugins%2Futil%2Fircformat.py?ref=d29b3c313f6ef52a6a14c009535064812ffe1462",
"patch": "@@ -24,7 +24,7 @@ def raw(format_string):\n stuff['text'] = {'[url]':'http://'}\n final = {}\n for x in stuff:\n- final.update(x)\n+ final.update(stuff[x])\n for x in final:\n format_string = format_string.replace(x,final[x])\n return format_string"
}
] |
records | b21aa145d13a1889997739233e2b9619602e01f8 | fcd41c36c93c1fcac43557da46f62435b1c44716 | records.py | https://github.com/fictorial/records | true | false | true | @@ -296,7 +296,7 @@ class Database(object):
# If path doesn't exists
if not os.path.exists(path):
- raise IOError("File '{}'' not found!".format(path))
+ raise IOError("File '{}' not found!".format(path))
# If it's a directory
if os.path.isdir(path):
| raise IOError ( "File '{}'' not found!" . format ( path ) ) | raise IOError ( "File '{}' not found!" . format ( path ) ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"File '{}'' not found!\"", 3, 27, 3, 50], "\"File '{}' not found!\""]] | fictorial/records@b21aa145d13a1889997739233e2b9619602e01f8 | Fix multiple Single quotation mark error | [
{
"sha": "d37d6ef9f32b6dfe23aa8477235214b349f1bf55",
"filename": "records.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/fictorial/records/blob/b21aa145d13a1889997739233e2b9619602e01f8/records.py",
"raw_url": "https://github.com/fictorial/records/raw/b21aa145d13a1889997739233e2b9619602e01f8/records.py",
"contents_url": "https://api.github.com/repos/fictorial/records/contents/records.py?ref=b21aa145d13a1889997739233e2b9619602e01f8",
"patch": "@@ -296,7 +296,7 @@ def query_file(self, path, fetchall=False, **params):\n \n # If path doesn't exists\n if not os.path.exists(path):\n- raise IOError(\"File '{}'' not found!\".format(path))\n+ raise IOError(\"File '{}' not found!\".format(path))\n \n # If it's a directory\n if os.path.isdir(path):"
}
] |
tinydb | 3545e451e6b964f3aaefb6eeaf86a6f291e650a9 | 73a2954b531e1783a3dccad9ba233a40a8ca7bd3 | tests/test_tinydb.py | https://github.com/fictorial/tinydb | true | false | false | @@ -1,6 +1,6 @@
import pytest
-from conftest import get_db
+from . conftest import get_db
from tinydb import TinyDB, where
from tinydb.storages import MemoryStorage
| from conftest import get_db | from . conftest import get_db | SINGLE_STMT | [["Insert", ["import_from_statement", 2, 1, 2, 28], ["relative_import", "N0"], 1], ["Insert", "N0", ["import_prefix", "N1"], 0], ["Move", "N0", ["dotted_name", 2, 6, 2, 14], 1], ["Insert", "N1", [".:.", "T"], 0]] | fictorial/tinydb@3545e451e6b964f3aaefb6eeaf86a6f291e650a9 | Fix tests on Python 3 | [
{
"sha": "bc18d9c30eb71bdf0e8c4d43ded827bb679b1453",
"filename": "tests/test_tinydb.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/fictorial/tinydb/blob/3545e451e6b964f3aaefb6eeaf86a6f291e650a9/tests%2Ftest_tinydb.py",
"raw_url": "https://github.com/fictorial/tinydb/raw/3545e451e6b964f3aaefb6eeaf86a6f291e650a9/tests%2Ftest_tinydb.py",
"contents_url": "https://api.github.com/repos/fictorial/tinydb/contents/tests%2Ftest_tinydb.py?ref=3545e451e6b964f3aaefb6eeaf86a6f291e650a9",
"patch": "@@ -1,6 +1,6 @@\n import pytest\n \n-from conftest import get_db\n+from . conftest import get_db\n \n from tinydb import TinyDB, where\n from tinydb.storages import MemoryStorage"
}
] |
tinydb | 98bfdf339d85cec0d097e2568f52b6bc42a13776 | 5abbdc9853e3beda04166bdc10adb2e465ef17b5 | tinydb/database.py | https://github.com/fictorial/tinydb | true | false | true | @@ -387,7 +387,7 @@ class Table(object):
# Element specified by condition
elements = self.search(cond)
if elements:
- return elements.pop(0)
+ return elements[0]
def count(self, cond):
| return elements . pop ( 0 ) | return elements [ 0 ] | SINGLE_STMT | [["Insert", ["return_statement", 3, 17, 3, 39], ["subscript", "N0"], 1], ["Move", "N0", ["identifier:elements", 3, 24, 3, 32], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Move", "N0", ["integer:0", 3, 37, 3, 38], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Delete", [".:.", 3, 32, 3, 33]], ["Delete", ["identifier:pop", 3, 33, 3, 36]], ["Delete", ["attribute", 3, 24, 3, 36]], ["Delete", ["(:(", 3, 36, 3, 37]], ["Delete", ["):)", 3, 38, 3, 39]], ["Delete", ["argument_list", 3, 36, 3, 39]], ["Delete", ["call", 3, 24, 3, 39]]] | fictorial/tinydb@98bfdf339d85cec0d097e2568f52b6bc42a13776 | bugfix for Table.get | [
{
"sha": "ac2da9905d73830c49536c14d1f628ac4a24fc59",
"filename": "tinydb/database.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/fictorial/tinydb/blob/98bfdf339d85cec0d097e2568f52b6bc42a13776/tinydb%2Fdatabase.py",
"raw_url": "https://github.com/fictorial/tinydb/raw/98bfdf339d85cec0d097e2568f52b6bc42a13776/tinydb%2Fdatabase.py",
"contents_url": "https://api.github.com/repos/fictorial/tinydb/contents/tinydb%2Fdatabase.py?ref=98bfdf339d85cec0d097e2568f52b6bc42a13776",
"patch": "@@ -387,7 +387,7 @@ def get(self, cond=None, eid=None):\n # Element specified by condition\n elements = self.search(cond)\n if elements:\n- return elements.pop(0)\n+ return elements[0]\n \n def count(self, cond):\n \"\"\""
}
] |
tinydb | 4e824356c1bb3e6d44125a529791a6a1f76ca51f | a21145922cc928d926cfb11731b440a8f110e1a2 | tinydb/queries.py | https://github.com/fictorial/tinydb | true | false | true | @@ -48,7 +48,7 @@ class QueryImpl(object):
return hash(self.hashval)
def __repr__(self):
- return 'Query{}'.format(self.hashval)
+ return 'Query{0}'.format(self.hashval)
def __eq__(self, other):
return self.hashval == other.hashval
| return 'Query{}' . format ( self . hashval ) | return 'Query{0}' . format ( self . hashval ) | CHANGE_STRING_LITERAL | [["Update", ["string:'Query{}'", 3, 16, 3, 25], "'Query{0}'"]] | fictorial/tinydb@4e824356c1bb3e6d44125a529791a6a1f76ca51f | Fix for Python 2.6 | [
{
"sha": "ed718012f61b03ae41aea956a5ca345c541572a4",
"filename": "tinydb/queries.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/fictorial/tinydb/blob/4e824356c1bb3e6d44125a529791a6a1f76ca51f/tinydb%2Fqueries.py",
"raw_url": "https://github.com/fictorial/tinydb/raw/4e824356c1bb3e6d44125a529791a6a1f76ca51f/tinydb%2Fqueries.py",
"contents_url": "https://api.github.com/repos/fictorial/tinydb/contents/tinydb%2Fqueries.py?ref=4e824356c1bb3e6d44125a529791a6a1f76ca51f",
"patch": "@@ -48,7 +48,7 @@ def __hash__(self):\n return hash(self.hashval)\n \n def __repr__(self):\n- return 'Query{}'.format(self.hashval)\n+ return 'Query{0}'.format(self.hashval)\n \n def __eq__(self, other):\n return self.hashval == other.hashval"
}
] |
tinydb | cd8b0e6b4a86880b3468d3ff350157904611e9b6 | d46008bc991e946667ac8704982faa6b654c20e0 | tinydb/serialize.py | https://github.com/fictorial/tinydb | true | false | true | @@ -36,4 +36,4 @@ class Serializer(with_metaclass(ABCMeta, object)):
- raise NotImplementedError('To be overridden1!')
+ raise NotImplementedError('To be overridden!')
| raise NotImplementedError ( 'To be overridden1!' ) | raise NotImplementedError ( 'To be overridden!' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'To be overridden1!'", 0, 35, 0, 55], "'To be overridden!'"]] | fictorial/tinydb@cd8b0e6b4a86880b3468d3ff350157904611e9b6 | Fix another typo | [
{
"sha": "aaec07601165408a009e0f78b66213952bbe50ca",
"filename": "tinydb/serialize.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/fictorial/tinydb/blob/cd8b0e6b4a86880b3468d3ff350157904611e9b6/tinydb%2Fserialize.py",
"raw_url": "https://github.com/fictorial/tinydb/raw/cd8b0e6b4a86880b3468d3ff350157904611e9b6/tinydb%2Fserialize.py",
"contents_url": "https://api.github.com/repos/fictorial/tinydb/contents/tinydb%2Fserialize.py?ref=cd8b0e6b4a86880b3468d3ff350157904611e9b6",
"patch": "@@ -36,4 +36,4 @@ def decode(self, s):\n :type s: str\n :return:\n \"\"\"\n- raise NotImplementedError('To be overridden1!')\n+ raise NotImplementedError('To be overridden!')"
}
] |
segmentation-nets | 0c80e9eb62e2557299656da43038e8ea0d1cbefc | 3523c0c7ded0566d3e8361c14594ddab1d6f8790 | lib/SegNet.py | https://github.com/abhay-venkatesh/segmentation-nets | true | false | true | @@ -24,7 +24,7 @@ class SegNet:
# Make saving trained weights and biases possible
self.saver = tf.train.Saver(max_to_keep = 5, keep_checkpoint_every_n_hours = 1)
- self.checkpoint_directory = '../checkpoints/'
+ self.checkpoint_directory = './checkpoints/'
def weight_variable(self, shape):
initial = tf.truncated_normal(shape, stddev=0.1)
| self . checkpoint_directory = '../checkpoints/' | self . checkpoint_directory = './checkpoints/' | CHANGE_STRING_LITERAL | [["Update", ["string:'../checkpoints/'", 3, 33, 3, 50], "'./checkpoints/'"]] | abhay-venkatesh/segmentation-nets@0c80e9eb62e2557299656da43038e8ea0d1cbefc | Fix checkpoint path | [
{
"sha": "f839a24b0cdd3ce835d1dffc431e78e77ed8f8b6",
"filename": "lib/SegNet.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/abhay-venkatesh/segmentation-nets/blob/0c80e9eb62e2557299656da43038e8ea0d1cbefc/lib%2FSegNet.py",
"raw_url": "https://github.com/abhay-venkatesh/segmentation-nets/raw/0c80e9eb62e2557299656da43038e8ea0d1cbefc/lib%2FSegNet.py",
"contents_url": "https://api.github.com/repos/abhay-venkatesh/segmentation-nets/contents/lib%2FSegNet.py?ref=0c80e9eb62e2557299656da43038e8ea0d1cbefc",
"patch": "@@ -24,7 +24,7 @@ def __init__(self):\n \n # Make saving trained weights and biases possible\n self.saver = tf.train.Saver(max_to_keep = 5, keep_checkpoint_every_n_hours = 1)\n- self.checkpoint_directory = '../checkpoints/'\n+ self.checkpoint_directory = './checkpoints/'\n \n def weight_variable(self, shape):\n initial = tf.truncated_normal(shape, stddev=0.1)"
}
] |
segmentation-nets | 174a9652721a7130384abedb4ef421ea9cbe2f7e | e903741a8b245785205658472b70b6a1a8b0aa20 | lib/BatchSegNet.py | https://github.com/abhay-venkatesh/segmentation-nets | true | false | true | @@ -273,7 +273,7 @@ class BatchSegNet:
dataset = DatasetReader()
# Begin Training
- count = 0
+ count += current_step
for i in range(current_step, num_iterations):
# One training step
| count = 0 | count += current_step | SINGLE_STMT | [["Insert", ["expression_statement", 3, 5, 3, 14], ["augmented_assignment", "N0"], 0], ["Move", "N0", ["identifier:count", 3, 5, 3, 10], 0], ["Insert", "N0", ["+=:+=", "T"], 1], ["Insert", "N0", ["identifier:current_step", "T"], 2], ["Delete", ["=:=", 3, 11, 3, 12]], ["Delete", ["integer:0", 3, 13, 3, 14]], ["Delete", ["assignment", 3, 5, 3, 14]]] | abhay-venkatesh/segmentation-nets@174a9652721a7130384abedb4ef421ea9cbe2f7e | Fix epoch stuff | [
{
"sha": "188278152bc805cf55c5e28b4ff6a52ed794a9d0",
"filename": "lib/BatchSegNet.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/abhay-venkatesh/segmentation-nets/blob/174a9652721a7130384abedb4ef421ea9cbe2f7e/lib%2FBatchSegNet.py",
"raw_url": "https://github.com/abhay-venkatesh/segmentation-nets/raw/174a9652721a7130384abedb4ef421ea9cbe2f7e/lib%2FBatchSegNet.py",
"contents_url": "https://api.github.com/repos/abhay-venkatesh/segmentation-nets/contents/lib%2FBatchSegNet.py?ref=174a9652721a7130384abedb4ef421ea9cbe2f7e",
"patch": "@@ -273,7 +273,7 @@ def train(self, num_iterations=10000, learning_rate=1e-6, batch_size=5):\n dataset = DatasetReader()\n \n # Begin Training\n- count = 0\n+ count += current_step\n for i in range(current_step, num_iterations):\n \n # One training step"
}
] |
segmentation-nets | b9894496540737e700f921dc834e5874e0159f0d | 12a94e2d0121ba310c0ee2693b85b84c0d81a4ac | lib/BatchSegNet.py | https://github.com/abhay-venkatesh/segmentation-nets | true | false | true | @@ -275,7 +275,7 @@ class BatchSegNet:
# Count number of items trained on
count = 0
- count += (current_step * 5)
+ count += (current_step * batch_size)
# Begin Training
for i in range(current_step, num_iterations):
| count += ( current_step * 5 ) | count += ( current_step * batch_size ) | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 15, 3, 31], ["identifier:batch_size", "T"], 2], ["Delete", ["integer:5", 3, 30, 3, 31]]] | abhay-venkatesh/segmentation-nets@b9894496540737e700f921dc834e5874e0159f0d | Fix epoch stuff | [
{
"sha": "4e33b155b27026fdfc020eb90808cc9eeb523190",
"filename": "lib/BatchSegNet.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/abhay-venkatesh/segmentation-nets/blob/b9894496540737e700f921dc834e5874e0159f0d/lib%2FBatchSegNet.py",
"raw_url": "https://github.com/abhay-venkatesh/segmentation-nets/raw/b9894496540737e700f921dc834e5874e0159f0d/lib%2FBatchSegNet.py",
"contents_url": "https://api.github.com/repos/abhay-venkatesh/segmentation-nets/contents/lib%2FBatchSegNet.py?ref=b9894496540737e700f921dc834e5874e0159f0d",
"patch": "@@ -275,7 +275,7 @@ def train(self, num_iterations=10000, learning_rate=1e-6, batch_size=5):\n \n # Count number of items trained on\n count = 0\n- count += (current_step * 5)\n+ count += (current_step * batch_size)\n \n # Begin Training\n for i in range(current_step, num_iterations):"
}
] |
segmentation-nets | a46991a0f21916231dbdbd4d181153ceec56de0b | 0fb230bee7c225e6853e666f92d5828ceb575797 | lib/EDSegNet.py | https://github.com/abhay-venkatesh/segmentation-nets | true | false | true | @@ -407,7 +407,7 @@ class EDSegNet:
# Save the model variables
self.saver.save(self.session,
- self.checkpoint_directory + 'DFSegNet',
+ self.checkpoint_directory + 'EDSegNet',
global_step = i)
# Print outputs every 1000 iterations
| self . saver . save ( self . session , self . checkpoint_directory + 'DFSegNet' , global_step = i ) | self . saver . save ( self . session , self . checkpoint_directory + 'EDSegNet' , global_step = i ) | CHANGE_BINARY_OPERAND | [["Update", ["string:'DFSegNet'", 3, 61, 3, 71], "'EDSegNet'"]] | abhay-venkatesh/segmentation-nets@a46991a0f21916231dbdbd4d181153ceec56de0b | Fix checkpoint naming | [
{
"sha": "5952d14d27981356708a6b1b96358bc73a84d2bf",
"filename": "lib/EDSegNet.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/abhay-venkatesh/segmentation-nets/blob/a46991a0f21916231dbdbd4d181153ceec56de0b/lib%2FEDSegNet.py",
"raw_url": "https://github.com/abhay-venkatesh/segmentation-nets/raw/a46991a0f21916231dbdbd4d181153ceec56de0b/lib%2FEDSegNet.py",
"contents_url": "https://api.github.com/repos/abhay-venkatesh/segmentation-nets/contents/lib%2FEDSegNet.py?ref=a46991a0f21916231dbdbd4d181153ceec56de0b",
"patch": "@@ -407,7 +407,7 @@ def train(self, num_iterations=10000, learning_rate=0.1, batch_size=5):\n \n # Save the model variables\n self.saver.save(self.session, \n- self.checkpoint_directory + 'DFSegNet', \n+ self.checkpoint_directory + 'EDSegNet', \n global_step = i)\n \n # Print outputs every 1000 iterations"
}
] |
TensorBox | 04720fcf7c41127bba8e959712cfd254ab108e43 | caa4914201e218538e0cba431f893d4305e2f543 | train.py | https://github.com/peimengsui/TensorBox | true | false | true | @@ -227,7 +227,7 @@ def train(H, test_images):
q = {}
enqueue_op = {}
for phase in ['train', 'test']:
- dtypes = [tf.float32, tf.float32, tf.float32, tf.float32]
+ dtypes = [tf.float32, tf.float32, tf.float32]
grid_size = H['arch']['grid_width'] * H['arch']['grid_height']
shapes = (
[H['arch']['image_height'], H['arch']['image_width'], 3],
| dtypes = [ tf . float32 , tf . float32 , tf . float32 , tf . float32 ] | dtypes = [ tf . float32 , tf . float32 , tf . float32 ] | SINGLE_STMT | [["Delete", [",:,", 3, 53, 3, 54]], ["Delete", ["identifier:tf", 3, 55, 3, 57]], ["Delete", [".:.", 3, 57, 3, 58]], ["Delete", ["identifier:float32", 3, 58, 3, 65]], ["Delete", ["attribute", 3, 55, 3, 65]]] | peimengsui/TensorBox@04720fcf7c41127bba8e959712cfd254ab108e43 | Fixed bug introduced in last commit. | [
{
"sha": "b14b6a5aae82f66ce45715fc091315df4d0fdbfd",
"filename": "train.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/peimengsui/TensorBox/blob/04720fcf7c41127bba8e959712cfd254ab108e43/train.py",
"raw_url": "https://github.com/peimengsui/TensorBox/raw/04720fcf7c41127bba8e959712cfd254ab108e43/train.py",
"contents_url": "https://api.github.com/repos/peimengsui/TensorBox/contents/train.py?ref=04720fcf7c41127bba8e959712cfd254ab108e43",
"patch": "@@ -227,7 +227,7 @@ def train(H, test_images):\n q = {}\n enqueue_op = {}\n for phase in ['train', 'test']:\n- dtypes = [tf.float32, tf.float32, tf.float32, tf.float32]\n+ dtypes = [tf.float32, tf.float32, tf.float32]\n grid_size = H['arch']['grid_width'] * H['arch']['grid_height']\n shapes = (\n [H['arch']['image_height'], H['arch']['image_width'], 3],"
}
] |
TensorBox | 7162368e204de8277f66a1224dc70c419986a64b | b17cadf2521ac66c03a1381336a13c5ea091c473 | train.py | https://github.com/peimengsui/TensorBox | true | false | true | @@ -36,7 +36,7 @@ def build_lstm_inner(H, lstm_input):
lstm = lstm_cell
batch_size = H['batch_size'] * H['grid_height'] * H['grid_width']
- state = tf.zeros([batch_size, H['lstm_size']])
+ state = tf.zeros([batch_size, lstm.state_size])
outputs = []
with tf.variable_scope('RNN', initializer=tf.random_uniform_initializer(-0.1, 0.1)):
| state = tf . zeros ( [ batch_size , H [ 'lstm_size' ] ] ) | state = tf . zeros ( [ batch_size , lstm . state_size ] ) | SINGLE_STMT | [["Insert", ["list", 3, 22, 3, 50], ["attribute", "N0"], 3], ["Update", ["identifier:H", 3, 35, 3, 36], "lstm"], ["Move", "N0", ["identifier:H", 3, 35, 3, 36], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:state_size", "T"], 2], ["Delete", ["[:[", 3, 36, 3, 37]], ["Delete", ["string:'lstm_size'", 3, 37, 3, 48]], ["Delete", ["]:]", 3, 48, 3, 49]], ["Delete", ["subscript", 3, 35, 3, 49]]] | peimengsui/TensorBox@7162368e204de8277f66a1224dc70c419986a64b | Fixed state_size bug. | [
{
"sha": "4fef48caf0902a9609f6d6332cc987ac8fcf002a",
"filename": "train.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/peimengsui/TensorBox/blob/7162368e204de8277f66a1224dc70c419986a64b/train.py",
"raw_url": "https://github.com/peimengsui/TensorBox/raw/7162368e204de8277f66a1224dc70c419986a64b/train.py",
"contents_url": "https://api.github.com/repos/peimengsui/TensorBox/contents/train.py?ref=7162368e204de8277f66a1224dc70c419986a64b",
"patch": "@@ -36,7 +36,7 @@ def build_lstm_inner(H, lstm_input):\n lstm = lstm_cell\n \n batch_size = H['batch_size'] * H['grid_height'] * H['grid_width']\n- state = tf.zeros([batch_size, H['lstm_size']])\n+ state = tf.zeros([batch_size, lstm.state_size])\n \n outputs = []\n with tf.variable_scope('RNN', initializer=tf.random_uniform_initializer(-0.1, 0.1)):"
}
] |
TensorBox | eda0cec0400ebdfecfbf1751b6cf0bdc5a8efefd | 0e3e1aeca4d659fd02f860577a8b91ef333d03a2 | utils/annolist/AnnotationLib.py | https://github.com/peimengsui/TensorBox | true | false | true | @@ -30,7 +30,7 @@ except ImportError:
################################################
-def cmpAnnRectsByScore(r1, r2):
+def cmpAnnoRectsByScore(r1, r2):
return cmp(r1.score, r2.score)
def cmpAnnoRectsByScoreDescending(r1, r2):
| def cmpAnnRectsByScore ( r1 , r2 ) : return cmp ( r1 . score , r2 . score ) | def cmpAnnoRectsByScore ( r1 , r2 ) : return cmp ( r1 . score , r2 . score ) | SINGLE_TOKEN | [["Update", ["identifier:cmpAnnRectsByScore", 3, 5, 3, 23], "cmpAnnoRectsByScore"]] | peimengsui/TensorBox@eda0cec0400ebdfecfbf1751b6cf0bdc5a8efefd | Fix spelling of cmpAnnRectsByScore to cmpAnnoRectsByScore to match what's expected in sortByScore | [
{
"sha": "9b52784767f3320ef1fb46dadb49465ba6c0ccae",
"filename": "utils/annolist/AnnotationLib.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/peimengsui/TensorBox/blob/eda0cec0400ebdfecfbf1751b6cf0bdc5a8efefd/utils%2Fannolist%2FAnnotationLib.py",
"raw_url": "https://github.com/peimengsui/TensorBox/raw/eda0cec0400ebdfecfbf1751b6cf0bdc5a8efefd/utils%2Fannolist%2FAnnotationLib.py",
"contents_url": "https://api.github.com/repos/peimengsui/TensorBox/contents/utils%2Fannolist%2FAnnotationLib.py?ref=eda0cec0400ebdfecfbf1751b6cf0bdc5a8efefd",
"patch": "@@ -30,7 +30,7 @@\n ################################################\r\n \r\n \r\n-def cmpAnnRectsByScore(r1, r2):\r\n+def cmpAnnoRectsByScore(r1, r2):\r\n return cmp(r1.score, r2.score)\r\n \r\n def cmpAnnoRectsByScoreDescending(r1, r2):\r"
}
] |
SmartParking | 184958a51ae0fb0b2f305f824ed67735accd87ed | 558dca7e78d49818577581dabd5e89cef1b894b3 | GraphManager.py | https://github.com/Poom1997/SmartParking | true | false | true | @@ -10,7 +10,7 @@ class GraphManager:
def getPath(self, A, B , status):
#return list of path from start node to destination
- path_list = self.graph.getPath(A , B, status)
+ path_list = self.graph.getPath(A + 1, B + 1, status)
return [x - 1 for x in path_list]
def printNode(self):
| path_list = self . graph . getPath ( A , B , status ) | path_list = self . graph . getPath ( A + 1 , B + 1 , status ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 39, 3, 54], ["binary_operator", "N0"], 1], ["Insert", ["argument_list", 3, 39, 3, 54], ["binary_operator", "N1"], 4], ["Insert", ["argument_list", 3, 39, 3, 54], [",:,", "T"], 5], ["Move", "N0", ["identifier:A", 3, 40, 3, 41], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Insert", "N0", ["integer:1", "T"], 2], ["Move", "N1", ["identifier:B", 3, 44, 3, 45], 0], ["Insert", "N1", ["+:+", "T"], 1], ["Insert", "N1", ["integer:1", "T"], 2], ["Delete", [",:,", 3, 42, 3, 43]]] | Poom1997/SmartParking@184958a51ae0fb0b2f305f824ed67735accd87ed | null | null |
autoreduce | 8b3d3b39e0c9369eab5f494d1fe6b6a19e253ee1 | 6828ecdbab5ab84806429de52659f6ba3f945ea3 | scripts/manual_operations/manual_remove.py | https://github.com/ISISScientificComputing/autoreduce | true | false | true | @@ -213,7 +213,7 @@ def user_input_check(instrument, run_numbers):
return user_input
-def main(instrument, first_run, last_run=None):
+def main(instrument: str, first_run: int, last_run: int = None):
| def main ( instrument , first_run , last_run = None ) : | def main ( instrument : str , first_run : int , last_run : int = None ) : | SINGLE_STMT | [["Insert", ["parameters", 3, 9, 3, 47], ["typed_parameter", "N0"], 1], ["Insert", ["parameters", 3, 9, 3, 47], ["typed_parameter", "N1"], 4], ["Insert", ["parameters", 3, 9, 3, 47], ["typed_default_parameter", "N2"], 6], ["Move", "N0", ["identifier:instrument", 3, 10, 3, 20], 0], ["Insert", "N0", [":::", "T"], 1], ["Insert", "N0", ["type", "N3"], 2], ["Move", "N1", ["identifier:first_run", 3, 22, 3, 31], 0], ["Insert", "N1", [":::", "T"], 1], ["Insert", "N1", ["type", "N4"], 2], ["Move", "N2", ["identifier:last_run", 3, 33, 3, 41], 0], ["Insert", "N2", [":::", "T"], 1], ["Insert", "N2", ["type", "N5"], 2], ["Move", "N2", ["=:=", 3, 41, 3, 42], 3], ["Move", "N2", ["none:None", 3, 42, 3, 46], 4], ["Insert", "N3", ["identifier:str", "T"], 0], ["Insert", "N4", ["identifier:int", "T"], 0], ["Insert", "N5", ["identifier:int", "T"], 0], ["Delete", ["default_parameter", 3, 33, 3, 46]]] | ISISScientificComputing/autoreduce@8b3d3b39e0c9369eab5f494d1fe6b6a19e253ee1 | null | null |
autoreduce | db6fb13de3501a03f2df8f58590d7cbb08a00474 | 47011dd98ba50fc423f71dbd1caf471cefd0df56 | queue_processors/autoreduction_processor/post_process_admin.py | https://github.com/ISISScientificComputing/autoreduce | true | false | true | @@ -210,7 +210,7 @@ class PostProcessAdmin:
return final_result_directory, final_log_directory
def reduce(self):
- """ Start the reduction job. """
+ """Start the reduction job."""
# pylint: disable=too-many-nested-blocks
logger.info("reduce started") # pylint: disable=trailing-whitespace
self.message.software = self._get_mantid_version()
| """ Start the reduction job. """ | """Start the reduction job.""" | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"\" Start the reduction job. \"\"\"", 3, 9, 3, 41], "\"\"\"Start the reduction job.\"\"\""]] | ISISScientificComputing/autoreduce@db6fb13de3501a03f2df8f58590d7cbb08a00474 | null | null |
autoreduce | 94c34ed1e0a4d7a2373f14cbca2301d05a282b39 | d8761e826b1c21b2b5e38e86f45430aa2c174ed2 | queue_processors/autoreduction_processor/tests/test_post_process_admin.py | https://github.com/ISISScientificComputing/autoreduce | true | false | true | @@ -513,7 +513,7 @@ class TestPostProcessAdmin(unittest.TestCase):
@patch(DIR + '.post_process_admin.PostProcessAdmin._remove_directory')
@patch(DIR + '.post_process_admin.PostProcessAdmin._copy_tree')
@patch(DIR + '.autoreduction_logging_setup.logger.info')
- def test_copy_temp_dir(self, mock_logger, mock_copy, mock_remove):
+ def test_copy_temp_dir(self, mock_logger, mock_copy, mock_remove, _):
| def test_copy_temp_dir ( self , mock_logger , mock_copy , mock_remove ) : | def test_copy_temp_dir ( self , mock_logger , mock_copy , mock_remove , _ ) : | SINGLE_STMT | [["Insert", ["parameters", 3, 27, 3, 70], [",:,", "T"], 8], ["Insert", ["parameters", 3, 27, 3, 70], ["identifier:_", "T"], 9]] | ISISScientificComputing/autoreduce@94c34ed1e0a4d7a2373f14cbca2301d05a282b39 | null | null |
autoreduce | a041735626f39d92acb23365d3335b6794fb72bb | 401df2b22b7a9c9adb5cf2be63662ae814deb806 | paths/isis/isis_reduction_path_manager.py | https://github.com/ISISScientificComputing/autoreduce | true | false | true | @@ -35,7 +35,7 @@ class ISISReductionPathManager(ReductionPathManager):
output_directory = MISC['ceph_directory'] % (instrument, proposal, run_number)
# Excitations would like to remove the run number folder at the end
- if instrument in MISC['excitation_instruments']:
+ if instrument in MISC['flat_output_instruments']:
output_directory = output_directory[:output_directory.rfind('/') + 1]
ReductionPathManager.__init__(self,
| if instrument in MISC [ 'excitation_instruments' ] : output_directory = output_directory [ : output_directory . rfind ( '/' ) + 1 ] | if instrument in MISC [ 'flat_output_instruments' ] : output_directory = output_directory [ : output_directory . rfind ( '/' ) + 1 ] | CHANGE_STRING_LITERAL | [["Update", ["string:'excitation_instruments'", 3, 31, 3, 55], "'flat_output_instruments'"]] | ISISScientificComputing/autoreduce@a041735626f39d92acb23365d3335b6794fb72bb | null | null |