mradermacher/EditCoder-6.7b-v1-GGUF
7B • Updated • 45
commit stringlengths 40 40 | old_file stringlengths 4 118 | new_file stringlengths 4 118 | old_contents stringlengths 10 2.94k | new_contents stringlengths 21 3.18k | subject stringlengths 16 444 | message stringlengths 17 2.63k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 5 43k | ndiff stringlengths 51 3.32k | instruction stringlengths 16 444 | content stringlengths 133 4.32k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
e905334869af72025592de586b81650cb3468b8a | sentry/queue/client.py | sentry/queue/client.py | from kombu import BrokerConnection
from kombu.common import maybe_declare
from kombu.pools import producers
from sentry.conf import settings
from sentry.queue.queues import task_queues, task_exchange
class Broker(object):
def __init__(self, config):
self.connection = BrokerConnection(**config)
def d... | from kombu import BrokerConnection
from kombu.common import maybe_declare
from kombu.pools import producers
from sentry.conf import settings
from sentry.queue.queues import task_queues, task_exchange
class Broker(object):
def __init__(self, config):
self.connection = BrokerConnection(**config)
wi... | Declare queues when broker is instantiated | Declare queues when broker is instantiated
| Python | bsd-3-clause | imankulov/sentry,BuildingLink/sentry,zenefits/sentry,korealerts1/sentry,kevinastone/sentry,fotinakis/sentry,fuziontech/sentry,ngonzalvez/sentry,mvaled/sentry,Kronuz/django-sentry,ngonzalvez/sentry,looker/sentry,felixbuenemann/sentry,ngonzalvez/sentry,nicholasserra/sentry,camilonova/sentry,jokey2k/sentry,llonchj/sentry,... | from kombu import BrokerConnection
from kombu.common import maybe_declare
from kombu.pools import producers
from sentry.conf import settings
from sentry.queue.queues import task_queues, task_exchange
class Broker(object):
def __init__(self, config):
self.connection = BrokerConnectio... | Declare queues when broker is instantiated | ## Code Before:
from kombu import BrokerConnection
from kombu.common import maybe_declare
from kombu.pools import producers
from sentry.conf import settings
from sentry.queue.queues import task_queues, task_exchange
class Broker(object):
def __init__(self, config):
self.connection = BrokerConnection(**co... |
950ac9130bafe1fced578bf61d746b047830bfa0 | automata/base/exceptions.py | automata/base/exceptions.py | """Exception classes shared by all automata."""
class AutomatonException(Exception):
"""The base class for all automaton-related errors."""
pass
class InvalidStateError(AutomatonException):
"""A state is not a valid state for this automaton."""
pass
class InvalidSymbolError(AutomatonException):
... | """Exception classes shared by all automata."""
class AutomatonException(Exception):
"""The base class for all automaton-related errors."""
pass
class InvalidStateError(AutomatonException):
"""A state is not a valid state for this automaton."""
pass
class InvalidSymbolError(AutomatonException):
... | Remove "validation" from RejectionException docstring | Remove "validation" from RejectionException docstring
| Python | mit | caleb531/automata | """Exception classes shared by all automata."""
class AutomatonException(Exception):
"""The base class for all automaton-related errors."""
pass
class InvalidStateError(AutomatonException):
"""A state is not a valid state for this automaton."""
pass
class InvalidS... | Remove "validation" from RejectionException docstring | ## Code Before:
"""Exception classes shared by all automata."""
class AutomatonException(Exception):
"""The base class for all automaton-related errors."""
pass
class InvalidStateError(AutomatonException):
"""A state is not a valid state for this automaton."""
pass
class InvalidSymbolError(Autom... |
c3f8860c717a139d396b0d902db989ab7b8369ba | stock_inventory_hierarchical/__openerp__.py | stock_inventory_hierarchical/__openerp__.py |
{
"name": "Hierarchical Inventory adjustments",
"summary": "Group several Inventory adjustments in a master inventory",
"version": "8.0.2.0.0",
"depends": ["stock"],
"author": u"Numérigraphe,Odoo Community Association (OCA)",
"category": "Warehouse Management",
"data": ["views/stock_invento... |
{
"name": "Hierarchical Inventory adjustments",
"summary": "Group several Inventory adjustments in a master inventory",
"version": "8.0.2.0.0",
"depends": ["stock"],
"author": u"Numérigraphe,Odoo Community Association (OCA)",
"category": "Warehouse Management",
"data": ["views/stock_invento... | Fix image path in manifest | Fix image path in manifest
| Python | agpl-3.0 | kmee/stock-logistics-warehouse,factorlibre/stock-logistics-warehouse,open-synergy/stock-logistics-warehouse,acsone/stock-logistics-warehouse,avoinsystems/stock-logistics-warehouse |
{
"name": "Hierarchical Inventory adjustments",
"summary": "Group several Inventory adjustments in a master inventory",
"version": "8.0.2.0.0",
"depends": ["stock"],
"author": u"Numérigraphe,Odoo Community Association (OCA)",
"category": "Warehouse Management",
"data": ["v... | Fix image path in manifest | ## Code Before:
{
"name": "Hierarchical Inventory adjustments",
"summary": "Group several Inventory adjustments in a master inventory",
"version": "8.0.2.0.0",
"depends": ["stock"],
"author": u"Numérigraphe,Odoo Community Association (OCA)",
"category": "Warehouse Management",
"data": ["vie... |
70a642c0597fb2f929fc83d821c8b1f095ed1328 | proxy/plugins/plugins.py | proxy/plugins/plugins.py | packetFunctions = {}
commands = {}
onStart = []
onConnection = []
onConnectionLoss = []
class packetHook(object):
def __init__(self, pktType, pktSubtype):
self.pktType = pktType
self.pktSubtype = pktSubtype
def __call__(self, f):
global packetFunctions
packetFunctions[(self.pktType, self.pktSubtype)] = f
c... | packetFunctions = {}
commands = {}
onStart = []
onConnection = []
onConnectionLoss = []
class packetHook(object):
def __init__(self, pktType, pktSubtype):
self.pktType = pktType
self.pktSubtype = pktSubtype
def __call__(self, f):
global packetFunctions
if (self.pktType, self.pktSubtype) not in packetFunctio... | Allow mutiple hooks for packets | Allow mutiple hooks for packets
| Python | agpl-3.0 | alama/PSO2Proxy,alama/PSO2Proxy,flyergo/PSO2Proxy,alama/PSO2Proxy,cyberkitsune/PSO2Proxy,cyberkitsune/PSO2Proxy,flyergo/PSO2Proxy,cyberkitsune/PSO2Proxy | packetFunctions = {}
commands = {}
onStart = []
onConnection = []
onConnectionLoss = []
class packetHook(object):
def __init__(self, pktType, pktSubtype):
self.pktType = pktType
self.pktSubtype = pktSubtype
def __call__(self, f):
global packetFunctions
+ if (self.pktType, self.pktS... | Allow mutiple hooks for packets | ## Code Before:
packetFunctions = {}
commands = {}
onStart = []
onConnection = []
onConnectionLoss = []
class packetHook(object):
def __init__(self, pktType, pktSubtype):
self.pktType = pktType
self.pktSubtype = pktSubtype
def __call__(self, f):
global packetFunctions
packetFunctions[(self.pktType, self.pkt... |
af91b7c2612fab598ba50c0c0256f7e552098d92 | reportlab/docs/genAll.py | reportlab/docs/genAll.py | """Runs the three manual-building scripts"""
if __name__=='__main__':
import os, sys
d = os.path.dirname(sys.argv[0])
#need a quiet mode for the test suite
if '-s' in sys.argv: # 'silent
quiet = '-s'
else:
quiet = ''
if not d: d = '.'
if not os.path.isabs(d):
... | import os
def _genAll(d=None,quiet=''):
if not d: d = '.'
if not os.path.isabs(d):
d = os.path.normpath(os.path.join(os.getcwd(),d))
for p in ('reference/genreference.py',
'userguide/genuserguide.py',
'graphguide/gengraphguide.py',
'../tools/docco/graphdocpy.py'):
os.chdir(d)
os.chdir(os.path.di... | Allow for use in daily.py | Allow for use in daily.py
| Python | bsd-3-clause | makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile,makinacorpus/reportlab-ecomobile | + import os
+ def _genAll(d=None,quiet=''):
+ if not d: d = '.'
+ if not os.path.isabs(d):
+ d = os.path.normpath(os.path.join(os.getcwd(),d))
+ for p in ('reference/genreference.py',
+ 'userguide/genuserguide.py',
+ 'graphguide/gengraphguide.py',
+ '../tools/docco/graphdocpy.py'):
+ os.chdir(d)
+... | Allow for use in daily.py | ## Code Before:
"""Runs the three manual-building scripts"""
if __name__=='__main__':
import os, sys
d = os.path.dirname(sys.argv[0])
#need a quiet mode for the test suite
if '-s' in sys.argv: # 'silent
quiet = '-s'
else:
quiet = ''
if not d: d = '.'
if not os.p... |
e34969db596ff3dfa4bf78efb3f3ccfe771d9ef9 | setup.py | setup.py | try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
PACKAGE = 'django_exceptional_middleware'
VERSION = '0.2'
data_files = [
(
'exceptional_middleware/templates/http_responses', [ 'exceptional_middleware/templates/http_responses/default.html' ],
),
]
se... | try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
PACKAGE = 'django_exceptional_middleware'
VERSION = '0.4'
package_data = {
'exceptional_middleware': [ 'templates/http_responses/*.html' ],
}
setup(
name=PACKAGE, version=VERSION,
description="Django m... | Fix templates install. Bump to version 0.4 in the process (which is really my laziness). | Fix templates install. Bump to version 0.4 in the process (which is really my laziness).
| Python | mit | jaylett/django_exceptional_middleware | try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
PACKAGE = 'django_exceptional_middleware'
- VERSION = '0.2'
+ VERSION = '0.4'
+ package_data = {
+ 'exceptional_middleware': [ 'templates/http_responses/*.html' ],
+ }
- data_files = [
- (
- ... | Fix templates install. Bump to version 0.4 in the process (which is really my laziness). | ## Code Before:
try:
from setuptools.core import setup
except ImportError:
from distutils.core import setup
PACKAGE = 'django_exceptional_middleware'
VERSION = '0.2'
data_files = [
(
'exceptional_middleware/templates/http_responses', [ 'exceptional_middleware/templates/http_responses/default.html'... |
c6265c2112ee9985af8b6b80fe0bee1811dc6abd | setup.py | setup.py | from distutils.core import setup
setup(
name='oceanoptics',
version='0.2.6',
author='Andreas Poehlmann, Jose A. Jimenez-Berni, Ben Gamari, Simon Dickreuter',
author_email='mail@andreaspoehlmann.de',
packages=['oceanoptics', 'oceanoptics.spectrometers'],
description='A Python driver for Ocean Op... | from distutils.core import setup
setup(
name='oceanoptics',
version='0.2.7',
author='Andreas Poehlmann, Jose A. Jimenez-Berni, Ben Gamari, Simon Dickreuter, Ian Ross Williams',
author_email='mail@andreaspoehlmann.de',
packages=['oceanoptics', 'oceanoptics.spectrometers'],
description='A Python ... | Add author and increase version number | Add author and increase version number
| Python | mit | ap--/python-oceanoptics | from distutils.core import setup
setup(
name='oceanoptics',
- version='0.2.6',
+ version='0.2.7',
- author='Andreas Poehlmann, Jose A. Jimenez-Berni, Ben Gamari, Simon Dickreuter',
+ author='Andreas Poehlmann, Jose A. Jimenez-Berni, Ben Gamari, Simon Dickreuter, Ian Ross Williams',
au... | Add author and increase version number | ## Code Before:
from distutils.core import setup
setup(
name='oceanoptics',
version='0.2.6',
author='Andreas Poehlmann, Jose A. Jimenez-Berni, Ben Gamari, Simon Dickreuter',
author_email='mail@andreaspoehlmann.de',
packages=['oceanoptics', 'oceanoptics.spectrometers'],
description='A Python dri... |
5bb9b2c9d5df410c85f4736c17224aeb2f05dd33 | s2v3.py | s2v3.py | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | Update print result to use "," instead of "+" for context text | Update print result to use "," instead of "+" for context text
| Python | mit | alexmilesyounger/ds_basics | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip... | Update print result to use "," instead of "+" for context text | ## Code Before:
from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed t... |
3ba5b6491bf61e2d2919f05bbf5cef088a754aeb | molecule/default/tests/test_installation.py | molecule/default/tests/test_installation.py |
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):
"""
Test if package... |
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):
"""
Test if package... | Add nologin in expected user shell test | Add nologin in expected user shell test
| Python | mit | infOpen/ansible-role-vsftpd |
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):... | Add nologin in expected user shell test | ## Code Before:
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('vsftpd'),
('db5.3-util'),
])
def test_installed_packages(host, name):
"""
... |
b4c9b76d132668695b77d37d7db3071e629fcba7 | makerscience_admin/models.py | makerscience_admin/models.py | from django.db import models
from solo.models import SingletonModel
class MakerScienceStaticContent (SingletonModel):
about = models.TextField(null=True, blank=True)
about_team = models.TextField(null=True, blank=True)
about_contact = models.TextField(null=True, blank=True)
about_faq = models.TextField... | from django.db import models
from django.db.models.signals import post_delete
from solo.models import SingletonModel
from accounts.models import ObjectProfileLink
from makerscience_forum.models import MakerSciencePost
class MakerScienceStaticContent (SingletonModel):
about = models.TextField(null=True, blank=Tr... | Allow to clear useless instances | Allow to clear useless instances
| Python | agpl-3.0 | atiberghien/makerscience-server,atiberghien/makerscience-server | from django.db import models
+ from django.db.models.signals import post_delete
+
from solo.models import SingletonModel
+
+ from accounts.models import ObjectProfileLink
+
+ from makerscience_forum.models import MakerSciencePost
class MakerScienceStaticContent (SingletonModel):
about = models.TextFie... | Allow to clear useless instances | ## Code Before:
from django.db import models
from solo.models import SingletonModel
class MakerScienceStaticContent (SingletonModel):
about = models.TextField(null=True, blank=True)
about_team = models.TextField(null=True, blank=True)
about_contact = models.TextField(null=True, blank=True)
about_faq = ... |
c713273fe145418113d750579f8b135dc513c3b8 | config.py | config.py | import os
if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_URI = 'sqlite:///meetup.db'
else:
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = False # supress deprecation warning
| import os
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = False # supress deprecation warning
| Delete default case for SQLALCHEMY_DATABASE_URI | Delete default case for SQLALCHEMY_DATABASE_URI
if user doesn't set it, he coud have some problems with SQLite
| Python | mit | Stark-Mountain/meetup-facebook-bot,Stark-Mountain/meetup-facebook-bot | import os
- if os.environ.get('DATABASE_URL') is None:
- SQLALCHEMY_DATABASE_URI = 'sqlite:///meetup.db'
- else:
- SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
+ SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
-
SQLALCHEMY_TRACK_MODIFICATIONS = False # supress deprecation warning
| Delete default case for SQLALCHEMY_DATABASE_URI | ## Code Before:
import os
if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_URI = 'sqlite:///meetup.db'
else:
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_TRACK_MODIFICATIONS = False # supress deprecation warning
## Instruction:
Delete default case for SQLALCHEMY_DATABASE_UR... |
c61d5e84863dd67b5b76ec8031e624642f4c957c | main.py | main.py | from .ide.command import plugin_unloaded
from .ide.error import *
from .ide.rebuild import *
from .ide.server import *
from .ide.settings import plugin_loaded
from .ide.text_command import *
from .ide.type_hints import *
from .ide.utility import *
| from .ide.auto_complete import *
from .ide.command import plugin_unloaded
from .ide.error import *
from .ide.rebuild import *
from .ide.server import *
from .ide.settings import plugin_loaded
from .ide.text_command import *
from .ide.type_hints import *
| Fix issue with wrong import | Fix issue with wrong import
| Python | mit | b123400/purescript-ide-sublime | + from .ide.auto_complete import *
from .ide.command import plugin_unloaded
from .ide.error import *
from .ide.rebuild import *
from .ide.server import *
from .ide.settings import plugin_loaded
from .ide.text_command import *
from .ide.type_hints import *
- from .ide.utility import *
| Fix issue with wrong import | ## Code Before:
from .ide.command import plugin_unloaded
from .ide.error import *
from .ide.rebuild import *
from .ide.server import *
from .ide.settings import plugin_loaded
from .ide.text_command import *
from .ide.type_hints import *
from .ide.utility import *
## Instruction:
Fix issue with wrong import
## Code Aft... |
4e75e742475236cf7358b4481a29a54eb607dd4d | spacy/tests/regression/test_issue850.py | spacy/tests/regression/test_issue850.py | '''
Test Matcher matches with '*' operator and Boolean flag
'''
from __future__ import unicode_literals
import pytest
from ...matcher import Matcher
from ...vocab import Vocab
from ...attrs import LOWER
from ...tokens import Doc
@pytest.mark.xfail
def test_issue850():
matcher = Matcher(Vocab())
IS_ANY_TOKEN ... | '''
Test Matcher matches with '*' operator and Boolean flag
'''
from __future__ import unicode_literals
from __future__ import print_function
import pytest
from ...matcher import Matcher
from ...vocab import Vocab
from ...attrs import LOWER
from ...tokens import Doc
def test_basic_case():
matcher = Matcher(Vocab... | Update regression test for variable-length pattern problem in the matcher. | Update regression test for variable-length pattern problem in the matcher.
| Python | mit | aikramer2/spaCy,oroszgy/spaCy.hu,raphael0202/spaCy,spacy-io/spaCy,explosion/spaCy,oroszgy/spaCy.hu,oroszgy/spaCy.hu,explosion/spaCy,recognai/spaCy,raphael0202/spaCy,recognai/spaCy,honnibal/spaCy,raphael0202/spaCy,recognai/spaCy,honnibal/spaCy,aikramer2/spaCy,raphael0202/spaCy,explosion/spaCy,honnibal/spaCy,Gregory-Howa... | '''
Test Matcher matches with '*' operator and Boolean flag
'''
from __future__ import unicode_literals
+ from __future__ import print_function
import pytest
from ...matcher import Matcher
from ...vocab import Vocab
from ...attrs import LOWER
from ...tokens import Doc
+ def test_basic_case():... | Update regression test for variable-length pattern problem in the matcher. | ## Code Before:
'''
Test Matcher matches with '*' operator and Boolean flag
'''
from __future__ import unicode_literals
import pytest
from ...matcher import Matcher
from ...vocab import Vocab
from ...attrs import LOWER
from ...tokens import Doc
@pytest.mark.xfail
def test_issue850():
matcher = Matcher(Vocab())
... |
fa8783f3307582dafcf636f5c94a7e4cff05724b | bin/tree_print_fasta_names.py | bin/tree_print_fasta_names.py |
import os
import shutil
import datetime
import sys
import argparse
from ete3 import Tree
import logging
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
self.tree=read_newick(tree_newick_fn,format=format)
def process_node(self,n... |
import os
import shutil
import datetime
import sys
from ete3 import Tree
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
self.tree=Tree(tree_newick_fn,format=format)
def process_node(self,node):
if node.is_leaf():
if hasatt... | Fix error in loading trees | Fix error in loading trees
Former-commit-id: 6fda03a47c5fa2d65c143ebdd81e158ba5e1ccda | Python | mit | karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle |
import os
import shutil
import datetime
import sys
- import argparse
from ete3 import Tree
-
- import logging
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
- self.tree=read_newick(tree_newick_fn,form... | Fix error in loading trees | ## Code Before:
import os
import shutil
import datetime
import sys
import argparse
from ete3 import Tree
import logging
DEFAULT_FORMAT = 1
class TreeIndex:
def __init__(self,tree_newick_fn,format=DEFAULT_FORMAT):
self.tree_newick_fn=tree_newick_fn
self.tree=read_newick(tree_newick_fn,format=format)
def pro... |
a20c6d072d70c535ed1f116fc04016c834ea9c14 | doc/en/_getdoctarget.py | doc/en/_getdoctarget.py |
import py
def get_version_string():
fn = py.path.local(__file__).join("..", "..", "..",
"_pytest", "__init__.py")
for line in fn.readlines():
if "version" in line:
return eval(line.split("=")[-1])
def get_minor_version_string():
return ".".join(ge... |
import py
def get_version_string():
fn = py.path.local(__file__).join("..", "..", "..",
"_pytest", "__init__.py")
for line in fn.readlines():
if "version" in line and not line.strip().startswith('#'):
return eval(line.split("=")[-1])
def get_minor_ver... | Fix getdoctarget to ignore comment lines | Fix getdoctarget to ignore comment lines
| Python | mit | etataurov/pytest,gabrielcnr/pytest,mbirtwell/pytest,vodik/pytest,The-Compiler/pytest,omarkohl/pytest,Bjwebb/pytest,davidszotten/pytest,gabrielcnr/pytest,mdboom/pytest,ionelmc/pytest,malinoff/pytest,hpk42/pytest,tareqalayan/pytest,userzimmermann/pytest,rouge8/pytest,tgoodlet/pytest,abusalimov/pytest,bukzor/pytest,icemac... |
import py
def get_version_string():
fn = py.path.local(__file__).join("..", "..", "..",
"_pytest", "__init__.py")
for line in fn.readlines():
- if "version" in line:
+ if "version" in line and not line.strip().startswith('#'):
r... | Fix getdoctarget to ignore comment lines | ## Code Before:
import py
def get_version_string():
fn = py.path.local(__file__).join("..", "..", "..",
"_pytest", "__init__.py")
for line in fn.readlines():
if "version" in line:
return eval(line.split("=")[-1])
def get_minor_version_string():
re... |
efd6fad89131c4d3070c68013ace77f11647bd68 | opal/core/search/__init__.py | opal/core/search/__init__.py | from opal.core.search import urls
from opal.core import plugins
from opal.core import celery # NOQA
class SearchPlugin(plugins.OpalPlugin):
"""
The plugin entrypoint for OPAL's core search functionality
"""
urls = urls.urlpatterns
javascripts = {
'opal.services': [
'js/searc... | from opal.core import celery # NOQA
from opal.core.search import plugin
| Move Opal.core.search plugin into a plugins.py ahead of full plugin 2.0 refactor | Move Opal.core.search plugin into a plugins.py ahead of full plugin 2.0 refactor
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | + from opal.core import celery # NOQA
- from opal.core.search import urls
+ from opal.core.search import plugin
- from opal.core import plugins
-
- from opal.core import celery # NOQA
-
-
- class SearchPlugin(plugins.OpalPlugin):
- """
- The plugin entrypoint for OPAL's core search functionality
- "... | Move Opal.core.search plugin into a plugins.py ahead of full plugin 2.0 refactor | ## Code Before:
from opal.core.search import urls
from opal.core import plugins
from opal.core import celery # NOQA
class SearchPlugin(plugins.OpalPlugin):
"""
The plugin entrypoint for OPAL's core search functionality
"""
urls = urls.urlpatterns
javascripts = {
'opal.services': [
... |
56a8b900570200e63ee460dd7e2962cba2450b16 | preparation/tools/build_assets.py | preparation/tools/build_assets.py | from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
r = copy(expla... | from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
r = copy(expla... | Fix bug with 'all' argument | Fix bug with 'all' argument
| Python | mit | hatbot-team/hatbot_resources | from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
... | Fix bug with 'all' argument | ## Code Before:
from copy import copy
import argparse
from preparation.resources.Resource import names_registered, resource_by_name
from hb_res.storage import get_storage, ExplanationStorage
def generate_asset(resource, out_storage: ExplanationStorage):
out_storage.clear()
for explanation in resource:
... |
6167215e4ed49e8a4300f327d5b4ed4540d1a420 | numba/tests/npyufunc/test_parallel_env_variable.py | numba/tests/npyufunc/test_parallel_env_variable.py | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_numba_parallel_test... | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_numba_parallel_test... | Fix the parallel env variable test to reset the env correctly | Fix the parallel env variable test to reset the env correctly
| Python | bsd-2-clause | seibert/numba,seibert/numba,stonebig/numba,cpcloud/numba,sklam/numba,gmarkall/numba,stuartarchibald/numba,numba/numba,stonebig/numba,seibert/numba,stuartarchibald/numba,sklam/numba,gmarkall/numba,sklam/numba,sklam/numba,stonebig/numba,IntelLabs/numba,IntelLabs/numba,stuartarchibald/numba,cpcloud/numba,numba/numba,stuar... | from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
... | Fix the parallel env variable test to reset the env correctly | ## Code Before:
from numba.np.ufunc.parallel import get_thread_count
from os import environ as env
from numba.core import config
import unittest
class TestParallelEnvVariable(unittest.TestCase):
"""
Tests environment variables related to the underlying "parallel"
functions for npyufuncs.
"""
_num... |
504205d02ef2f5b66da225390fdb34b8b736ce57 | ideascube/migrations/0009_add_a_system_user.py | ideascube/migrations/0009_add_a_system_user.py | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.db import migrations
def add_user(*args):
User = get_user_model()
User(serial='__system__', full_name='System', password='!!').save()
class Migration(migrations.Migration):
dependencies = [
('ide... | from __future__ import unicode_literals
from django.db import migrations
def add_user(apps, *args):
User = apps.get_model('ideascube', 'User')
User(serial='__system__', full_name='System', password='!!').save()
class Migration(migrations.Migration):
dependencies = [
('ideascube', '0008_user_sd... | Load user from migration registry when creating system user | Load user from migration registry when creating system user
Always load models from the registry in migration files.
I hate the idea of touching a migration already released, but
this one prevents us from adding new properties to User.
If we load the User directly (not from registry) when creating
the user model, we'l... | Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | from __future__ import unicode_literals
- from django.contrib.auth import get_user_model
from django.db import migrations
- def add_user(*args):
+ def add_user(apps, *args):
- User = get_user_model()
+ User = apps.get_model('ideascube', 'User')
User(serial='__system__', full_name='System', pa... | Load user from migration registry when creating system user | ## Code Before:
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.db import migrations
def add_user(*args):
User = get_user_model()
User(serial='__system__', full_name='System', password='!!').save()
class Migration(migrations.Migration):
dependencies =... |
d8d2e4b763fbd7cedc42046f6f45395bf15caa79 | samples/plugins/scenario/scenario_plugin.py | samples/plugins/scenario/scenario_plugin.py |
from rally.task.scenarios import base
class ScenarioPlugin(base.Scenario):
"""Sample plugin which lists flavors."""
@base.atomic_action_timer("list_flavors")
def _list_flavors(self):
"""Sample of usage clients - list flavors
You can use self.context, self.admin_clients and self.clients ... |
from rally.plugins.openstack import scenario
from rally.task import atomic
class ScenarioPlugin(scenario.OpenStackScenario):
"""Sample plugin which lists flavors."""
@atomic.action_timer("list_flavors")
def _list_flavors(self):
"""Sample of usage clients - list flavors
You can use self.... | Fix the scenario plugin sample | Fix the scenario plugin sample
We forgot to fix scenario plugin sample when we were doing
rally.task.scenario refactoring
Change-Id: Iadbb960cf168bd3b9cd6c1881a5f7a8dffd7036f
| Python | apache-2.0 | group-policy/rally,eayunstack/rally,openstack/rally,amit0701/rally,paboldin/rally,eonpatapon/rally,cernops/rally,afaheem88/rally,yeming233/rally,vganapath/rally,gluke77/rally,aforalee/RRally,yeming233/rally,openstack/rally,gluke77/rally,gluke77/rally,eayunstack/rally,openstack/rally,aforalee/RRally,cernops/rally,group-... |
- from rally.task.scenarios import base
+ from rally.plugins.openstack import scenario
+ from rally.task import atomic
- class ScenarioPlugin(base.Scenario):
+ class ScenarioPlugin(scenario.OpenStackScenario):
"""Sample plugin which lists flavors."""
- @base.atomic_action_timer("list_flavors")
+ ... | Fix the scenario plugin sample | ## Code Before:
from rally.task.scenarios import base
class ScenarioPlugin(base.Scenario):
"""Sample plugin which lists flavors."""
@base.atomic_action_timer("list_flavors")
def _list_flavors(self):
"""Sample of usage clients - list flavors
You can use self.context, self.admin_clients a... |
68a621005c5a520b7a97c4cad462d43fb7f3aaed | paws/views.py | paws/views.py |
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
request = Request(event, context)
resp = self.prepare(request)
if resp:
return resp
kwargs = event.get('path... |
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
kwargs = event.get('pathParameters') or {}
self.dispatch(request, **kwargs)
def dispatch(self, request, **kwargs):
func = g... | Break out dispatch, and drop prepare. Easier testing | Break out dispatch, and drop prepare. Easier testing
| Python | bsd-3-clause | funkybob/paws |
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
- request = Request(event, context)
- resp = self.prepare(request)
- if resp:
- return resp
... | Break out dispatch, and drop prepare. Easier testing | ## Code Before:
from .request import Request
from .response import Response, response
import logging
log = logging.getLogger()
class View:
def __call__(self, event, context):
request = Request(event, context)
resp = self.prepare(request)
if resp:
return resp
kwargs =... |
d4d448adff71b609d5efb269d1a9a2ea4aba3590 | radio/templatetags/radio_js_config.py | radio/templatetags/radio_js_config.py | import random
import json
from django import template
from django.conf import settings
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS_SETTINGS', None)
js_json = {}
if js_settings:
fo... | import random
import json
from django import template
from django.conf import settings
from radio.models import SiteOption
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS_SETTINGS', None)
js_jso... | Allow SiteOption to load into the JS | Allow SiteOption to load into the JS
| Python | mit | ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player,ScanOC/trunk-player | import random
import json
from django import template
from django.conf import settings
+
+ from radio.models import SiteOption
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS... | Allow SiteOption to load into the JS | ## Code Before:
import random
import json
from django import template
from django.conf import settings
register = template.Library()
# Build json value to pass as js config
@register.simple_tag()
def trunkplayer_js_config(user):
js_settings = getattr(settings, 'JS_SETTINGS', None)
js_json = {}
if js_sett... |
0a13a9a8a779102dbcb2beead7d8aa9143f4c79b | tests/pytests/unit/client/ssh/test_shell.py | tests/pytests/unit/client/ssh/test_shell.py | import os
import subprocess
import pytest
import salt.client.ssh.shell as shell
@pytest.fixture
def keys(tmp_path):
pub_key = tmp_path / "ssh" / "testkey.pub"
priv_key = tmp_path / "ssh" / "testkey"
yield {"pub_key": str(pub_key), "priv_key": str(priv_key)}
@pytest.mark.skip_on_windows(reason="Windows ... | import subprocess
import types
import pytest
import salt.client.ssh.shell as shell
@pytest.fixture
def keys(tmp_path):
pub_key = tmp_path / "ssh" / "testkey.pub"
priv_key = tmp_path / "ssh" / "testkey"
return types.SimpleNamespace(pub_key=pub_key, priv_key=priv_key)
@pytest.mark.skip_on_windows(reason=... | Use commit suggestion to use types | Use commit suggestion to use types
Co-authored-by: Pedro Algarvio <4410d99cefe57ec2c2cdbd3f1d5cf862bb4fb6f8@algarvio.me>
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | - import os
import subprocess
+ import types
import pytest
import salt.client.ssh.shell as shell
@pytest.fixture
def keys(tmp_path):
pub_key = tmp_path / "ssh" / "testkey.pub"
priv_key = tmp_path / "ssh" / "testkey"
- yield {"pub_key": str(pub_key), "priv_key": str(priv_key)}
+ re... | Use commit suggestion to use types | ## Code Before:
import os
import subprocess
import pytest
import salt.client.ssh.shell as shell
@pytest.fixture
def keys(tmp_path):
pub_key = tmp_path / "ssh" / "testkey.pub"
priv_key = tmp_path / "ssh" / "testkey"
yield {"pub_key": str(pub_key), "priv_key": str(priv_key)}
@pytest.mark.skip_on_windows(... |
09d780474d00f3a8f4c2295154d74dae2023c1d3 | samples/storage_sample/storage/__init__.py | samples/storage_sample/storage/__init__.py | """Common imports for generated storage client library."""
# pylint:disable=wildcard-import
import pkgutil
from apitools.base.py import *
from storage_v1 import *
from storage_v1_client import *
from storage_v1_messages import *
__path__ = pkgutil.extend_path(__path__, __name__)
| """Common imports for generated storage client library."""
# pylint:disable=wildcard-import
import pkgutil
from apitools.base.py import *
from storage_v1_client import *
from storage_v1_messages import *
__path__ = pkgutil.extend_path(__path__, __name__)
| Drop the CLI from the sample storage client imports. | Drop the CLI from the sample storage client imports.
| Python | apache-2.0 | cherba/apitools,craigcitro/apitools,b-daniels/apitools,betamos/apitools,kevinli7/apitools,houglum/apitools,pcostell/apitools,thobrla/apitools,google/apitools | """Common imports for generated storage client library."""
# pylint:disable=wildcard-import
import pkgutil
from apitools.base.py import *
- from storage_v1 import *
from storage_v1_client import *
from storage_v1_messages import *
__path__ = pkgutil.extend_path(__path__, __name__)
| Drop the CLI from the sample storage client imports. | ## Code Before:
"""Common imports for generated storage client library."""
# pylint:disable=wildcard-import
import pkgutil
from apitools.base.py import *
from storage_v1 import *
from storage_v1_client import *
from storage_v1_messages import *
__path__ = pkgutil.extend_path(__path__, __name__)
## Instruction:
Drop... |
08d838e87bd92dacbbbfe31b19c628b9d3b271a8 | src/plone.example/plone/example/todo.py | src/plone.example/plone/example/todo.py | from plone.dexterity.interfaces import IDexterityContent
from plone.dexterity.interfaces import IFormFieldProvider
from plone.server.api.service import Service
from plone.supermodel import model
from zope import schema
from zope.component import adapter
from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapt... | from plone.dexterity.interfaces import IDexterityContent
from plone.dexterity.interfaces import IFormFieldProvider
from plone.server.api.service import Service
from plone.supermodel import model
from zope import schema
from zope.component import adapter
from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapt... | Set default values for fields | Set default values for fields
| Python | bsd-2-clause | plone/plone.server,plone/plone.server | from plone.dexterity.interfaces import IDexterityContent
from plone.dexterity.interfaces import IFormFieldProvider
from plone.server.api.service import Service
from plone.supermodel import model
from zope import schema
from zope.component import adapter
from zope.dublincore.annotatableadapter import ZDCAn... | Set default values for fields | ## Code Before:
from plone.dexterity.interfaces import IDexterityContent
from plone.dexterity.interfaces import IFormFieldProvider
from plone.server.api.service import Service
from plone.supermodel import model
from zope import schema
from zope.component import adapter
from zope.dublincore.annotatableadapter import ZDC... |
29a964a64230e26fca550e81a1ecba3dd782dfb1 | python/vtd.py | python/vtd.py | import libvtd.trusted_system
def UpdateTrustedSystem(file_name):
"""Make sure the TrustedSystem object is up to date."""
global my_system
my_system = libvtd.trusted_system.TrustedSystem()
my_system.AddFile(file_name)
| import libvtd.trusted_system
def UpdateTrustedSystem(file_name):
"""Make sure the TrustedSystem object is up to date."""
global my_system
if 'my_system' not in globals():
my_system = libvtd.trusted_system.TrustedSystem()
my_system.AddFile(file_name)
my_system.Refresh()
| Refresh system instead of clobbering it | Refresh system instead of clobbering it
Otherwise, if we set the Contexts, they'll be gone before we can request the
NextActions!
| Python | apache-2.0 | chiphogg/vim-vtd | import libvtd.trusted_system
def UpdateTrustedSystem(file_name):
"""Make sure the TrustedSystem object is up to date."""
global my_system
+ if 'my_system' not in globals():
- my_system = libvtd.trusted_system.TrustedSystem()
+ my_system = libvtd.trusted_system.TrustedSystem()
- ... | Refresh system instead of clobbering it | ## Code Before:
import libvtd.trusted_system
def UpdateTrustedSystem(file_name):
"""Make sure the TrustedSystem object is up to date."""
global my_system
my_system = libvtd.trusted_system.TrustedSystem()
my_system.AddFile(file_name)
## Instruction:
Refresh system instead of clobbering it
## Code Afte... |
b532ffff18e95b6014921d88b6df075e8ac2c4ec | problib/example1/__init__.py | problib/example1/__init__.py | from sympy import symbols, cos, sin, latex
from mathdeck import rand, answer
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# choose three random integers... | from sympy import symbols, cos, sin, latex
from mathdeck import rand, answer
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# choose three random integers... | Update mathdeck problib for new Answer refactoring | Update mathdeck problib for new Answer refactoring
| Python | apache-2.0 | patrickspencer/mathdeck,patrickspencer/mathdeck | from sympy import symbols, cos, sin, latex
from mathdeck import rand, answer
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# ... | Update mathdeck problib for new Answer refactoring | ## Code Before:
from sympy import symbols, cos, sin, latex
from mathdeck import rand, answer
metadata = {
'author': 'Bob Hope',
'institution': 'University of Missouri',
'subject': 'algebra',
'minor subject': 'polynomial equations',
'tags': ['simplify','roots','intervals']
}
r = rand.Random()
# choose three... |
3a9568b4d4de969b1e2031e8d2d3cdd7bd56824f | zerver/migrations/0237_rename_zulip_realm_to_zulipinternal.py | zerver/migrations/0237_rename_zulip_realm_to_zulipinternal.py | from django.conf import settings
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def rename_zulip_realm_to_zulipinternal(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
if not settings.P... | from django.conf import settings
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def rename_zulip_realm_to_zulipinternal(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
if not settings.P... | Fix zulipinternal migration corner case. | migrations: Fix zulipinternal migration corner case.
It's theoretically possible to have configured a Zulip server where
the system bots live in the same realm as normal users (and may have
in fact been the default in early Zulip releases? Unclear.). We
should handle these without the migration intended to clean up ... | Python | apache-2.0 | brainwane/zulip,andersk/zulip,hackerkid/zulip,synicalsyntax/zulip,andersk/zulip,hackerkid/zulip,punchagan/zulip,shubhamdhama/zulip,showell/zulip,zulip/zulip,synicalsyntax/zulip,kou/zulip,rht/zulip,showell/zulip,brainwane/zulip,punchagan/zulip,shubhamdhama/zulip,hackerkid/zulip,andersk/zulip,kou/zulip,brainwane/zulip,br... | from django.conf import settings
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def rename_zulip_realm_to_zulipinternal(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
i... | Fix zulipinternal migration corner case. | ## Code Before:
from django.conf import settings
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
def rename_zulip_realm_to_zulipinternal(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
i... |
97e3b202bbe6726a4056facb8b4690b0710029a9 | handroll/tests/test_site.py | handroll/tests/test_site.py |
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
valid_site = tempfile.mkdtemp()
open(os.path.join(valid_site, 'template.html'), 'w').close()... |
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
valid_site = os.path.realpath(tempfile.mkdtemp())
open(os.path.join(valid_site, 'template.ht... | Use a real path when testing sites. | Use a real path when testing sites.
Mac OS X returns link paths when calling `mkdtemp`. Calling realpath
allows the site path comparison to be consistent across platforms.
| Python | bsd-2-clause | handroll/handroll |
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
- valid_site = tempfile.mkdtemp()
+ valid_site = os.path.realpath(te... | Use a real path when testing sites. | ## Code Before:
import os
import tempfile
from handroll.site import Site
from handroll.tests import TestCase
class TestSite(TestCase):
def test_finds_valid_site_root_from_templates(self):
original = os.getcwd()
valid_site = tempfile.mkdtemp()
open(os.path.join(valid_site, 'template.html... |
7e44a8bd38105144111624710819a1ee54891222 | campos_checkin/__openerp__.py | campos_checkin/__openerp__.py |
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
'website': 'www.steingabelgaard.dk',
'depends': [
'campos_jobber_final',
'campos_transportation',
... |
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
'website': 'www.steingabelgaard.dk',
'depends': [
'campos_jobber_final',
'campos_transportation',
... | Fix order for menu ref | Fix order for menu ref | Python | agpl-3.0 | sl2017/campos |
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
'website': 'www.steingabelgaard.dk',
'depends': [
'campos_jobber_final',
'campos_... | Fix order for menu ref | ## Code Before:
{
'name': 'Campos Checkin',
'description': """
CampOS Check In functionality""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard ApS',
'website': 'www.steingabelgaard.dk',
'depends': [
'campos_jobber_final',
'campos_transpor... |
3cd99c23099a625da711e3ac458a46a7b364d83c | hystrix/pool.py | hystrix/pool.py | from __future__ import absolute_import
from concurrent.futures import ThreadPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'PoolMetaclass')
def __new__(cls, name, bases, attrs):
if name in cls... | from __future__ import absolute_import
from concurrent.futures import ProcessPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'PoolMetaclass')
def __new__(cls, name, bases, attrs):
if name in cl... | Change Pool to use ProcessPoolExecutor | Change Pool to use ProcessPoolExecutor
| Python | apache-2.0 | wiliamsouza/hystrix-py,wiliamsouza/hystrix-py | from __future__ import absolute_import
- from concurrent.futures import ThreadPoolExecutor
+ from concurrent.futures import ProcessPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'Poo... | Change Pool to use ProcessPoolExecutor | ## Code Before:
from __future__ import absolute_import
from concurrent.futures import ThreadPoolExecutor
import logging
import six
log = logging.getLogger(__name__)
class PoolMetaclass(type):
__instances__ = dict()
__blacklist__ = ('Pool', 'PoolMetaclass')
def __new__(cls, name, bases, attrs):
... |
c52edc120f38acb079fa364cdb684fc2052d4727 | corehq/messaging/smsbackends/trumpia/urls.py | corehq/messaging/smsbackends/trumpia/urls.py | from django.conf.urls import url
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
url(r'^sms/(?P<api_key>[\w-]+)/?$', TrumpiaIncomingView.as_view(),
name=TrumpiaIncomingView.urlname),
]
| from django.conf.urls import url
from corehq.apps.hqwebapp.decorators import waf_allow
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
url(r'^sms/(?P<api_key>[\w-]+)/?$', waf_allow('XSS_QUERYSTRING')(TrumpiaIncomingView.as_view()),
name=TrumpiaIncomingView.urlna... | Annotate trumpia url to say it allows XML in the querystring | Annotate trumpia url to say it allows XML in the querystring
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | from django.conf.urls import url
+
+ from corehq.apps.hqwebapp.decorators import waf_allow
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
- url(r'^sms/(?P<api_key>[\w-]+)/?$', TrumpiaIncomingView.as_view(),
+ url(r'^sms/(?P<api_key>[\w-]+)/?$', waf_allow(... | Annotate trumpia url to say it allows XML in the querystring | ## Code Before:
from django.conf.urls import url
from corehq.messaging.smsbackends.trumpia.views import TrumpiaIncomingView
urlpatterns = [
url(r'^sms/(?P<api_key>[\w-]+)/?$', TrumpiaIncomingView.as_view(),
name=TrumpiaIncomingView.urlname),
]
## Instruction:
Annotate trumpia url to say it allows XML in ... |
d159f8201b9d9aeafd24f07a9e39855fc537182d | cocoscore/tools/data_tools.py | cocoscore/tools/data_tools.py | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data frame will be sorted ... | import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True, match_distance=False):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data... | Add match_distance flag to load_data_frame() | Add match_distance flag to load_data_frame()
| Python | mit | JungeAlexander/cocoscore | import pandas as pd
- def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True):
+ def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True, match_distance=False):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path:... | Add match_distance flag to load_data_frame() | ## Code Before:
import pandas as pd
def load_data_frame(data_frame_path, sort_reindex=False, class_labels=True):
"""
Load a sentence data set as pandas DataFrame from a given path.
:param data_frame_path: the path to load the pandas DataFrame from
:param sort_reindex: if True, the returned data frame... |
920e2fbb7e99c17dbe8d5b71e9c9b26a718ca444 | ideascube/search/apps.py | ideascube/search/apps.py | from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
if isinstance(sender, SearchConfig):
create_index_table(force=True)
def reindex(sender, **kwargs):
if isinstanc... | from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
if (kwargs['using'] == 'transient' and isinstance(sender, SearchConfig)):
create_index_table(force=True)
def reinde... | Make (pre|post)_migrate scripts for the index table only if working on 'transient'. | Make (pre|post)_migrate scripts for the index table only if working on 'transient'.
Django run (pre|post)_migrate script once per database.
As we have two databases, the create_index is launch twice with different
kwargs['using'] ('default' and 'transient'). We should try to create
the index table only when we are wor... | Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
- if isinstance(sender, SearchConfig):
+ if (kwargs['using'] == 'transient' and isinstance(sender, SearchCo... | Make (pre|post)_migrate scripts for the index table only if working on 'transient'. | ## Code Before:
from django.apps import AppConfig
from django.db.models.signals import pre_migrate, post_migrate
from .utils import create_index_table, reindex_content
def create_index(sender, **kwargs):
if isinstance(sender, SearchConfig):
create_index_table(force=True)
def reindex(sender, **kwargs):
... |
360efe51bc45f189c235bed6b2b7bfdd4fd1bfbd | flask-restful/api.py | flask-restful/api.py | from flask import Flask, request
from flask_restful import Resource, Api, reqparse
from indra import reach
from indra.statements import *
import json
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('txt')
parser.add_argument('json')
class InputText(Resource):
def post(se... | import json
from bottle import route, run, request, post, default_app
from indra import trips, reach, bel, biopax
from indra.statements import *
@route('/trips/process_text', method='POST')
def trips_process_text():
body = json.load(request.body)
text = body.get('text')
tp = trips.process_text(text)
i... | Reimplement using bottle and add 3 endpoints | Reimplement using bottle and add 3 endpoints
| Python | bsd-2-clause | sorgerlab/indra,sorgerlab/indra,sorgerlab/belpy,pvtodorov/indra,bgyori/indra,johnbachman/indra,johnbachman/indra,pvtodorov/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/indra | - from flask import Flask, request
- from flask_restful import Resource, Api, reqparse
- from indra import reach
+ import json
+ from bottle import route, run, request, post, default_app
+ from indra import trips, reach, bel, biopax
from indra.statements import *
- import json
- app = Flask(__name__)
- api = Api(a... | Reimplement using bottle and add 3 endpoints | ## Code Before:
from flask import Flask, request
from flask_restful import Resource, Api, reqparse
from indra import reach
from indra.statements import *
import json
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('txt')
parser.add_argument('json')
class InputText(Resource):... |
e78910c8b9ecf48f96a693dae3c15afa32a12da1 | casexml/apps/phone/views.py | casexml/apps/phone/views.py | from django_digest.decorators import *
from casexml.apps.phone import xml
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.restore import generate_restore_response
from casexml.apps.phone.models import User
from casexml.apps.case import const
@httpdigest
def restore(request):
user = User... | from django.http import HttpResponse
from django_digest.decorators import *
from casexml.apps.phone import xml
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.restore import generate_restore_response
from casexml.apps.phone.models import User
from casexml.apps.case import const
@httpdigest
... | Revert "moving httpresponse to view" | Revert "moving httpresponse to view"
This reverts commit a6f501bb9de6382e35372996851916adac067fa0.
| Python | bsd-3-clause | SEL-Columbia/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,di... | + from django.http import HttpResponse
from django_digest.decorators import *
from casexml.apps.phone import xml
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.restore import generate_restore_response
from casexml.apps.phone.models import User
from casexml.apps.case import const
... | Revert "moving httpresponse to view" | ## Code Before:
from django_digest.decorators import *
from casexml.apps.phone import xml
from casexml.apps.case.models import CommCareCase
from casexml.apps.phone.restore import generate_restore_response
from casexml.apps.phone.models import User
from casexml.apps.case import const
@httpdigest
def restore(request):... |
63f6e4d50116d5ca2bfc82c1c608e08040055b5e | subdue/core/__init__.py | subdue/core/__init__.py | __all__ = [
'color',
'BANNER',
'DEFAULT_DRIVER_CODE'
'die',
'verbose',
'use_colors',
'set_color_policy',
]
import sys as _sys
from . import color as _color
BANNER = """\
_ _
___ _ _| |__ __| |_ _ ___
/ __| | | | '_ \ / _` | | | |/ _ \\
\__ \ |_| | |_) | (_| | |_|... | __all__ = [
'BANNER',
'DEFAULT_DRIVER_CODE'
'die',
'verbose',
'set_color_policy',
]
import sys as _sys
from . import color as _color
BANNER = """\
_ _
___ _ _| |__ __| |_ _ ___
/ __| | | | '_ \ / _` | | | |/ _ \\
\__ \ |_| | |_) | (_| | |_| | __/
|___/\__,_|_.__/ \__,_|... | Remove old exports from subdue.core | Remove old exports from subdue.core
| Python | mit | jdevera/subdue | __all__ = [
- 'color',
'BANNER',
'DEFAULT_DRIVER_CODE'
'die',
'verbose',
- 'use_colors',
'set_color_policy',
]
import sys as _sys
from . import color as _color
BANNER = """\
_ _
___ _ _| |__ __| |_ _ ___
/ __| | | | '_ \ / _` | | | |... | Remove old exports from subdue.core | ## Code Before:
__all__ = [
'color',
'BANNER',
'DEFAULT_DRIVER_CODE'
'die',
'verbose',
'use_colors',
'set_color_policy',
]
import sys as _sys
from . import color as _color
BANNER = """\
_ _
___ _ _| |__ __| |_ _ ___
/ __| | | | '_ \ / _` | | | |/ _ \\
\__ \ |_| |... |
EditPackFT is a dataset built for training LLMs on the task of instructional code editing. The mail columns are:
old_contents the code before the editinstruction the instruction to transform the before code into the after codenew_contents the code after the editcontent a pre-formatted training window that can be used to train an LLM with prompts in the format of: <before><instruction><after>This dataset has been filtered from CommitPackFT. For more detail, see our paper, and our GitHub repository.
If you use our work, please cite our paper as such:
@inproceedings{cassano2023edit,
title={{Can It Edit? Evaluating the Ability of Large Language Models to Follow Code Editing Instructions}},
author={Federico Cassano and Luisa Li and Akul Sethi and Noah Shinn and Abby Brennan-Jones and Anton Lozhkov and Carolyn Jane Anderson and Arjun Guha},
booktitle={The First International Workshop on Large Language Model for Code},
year={2024},
url={https://arxiv.org/abs/2312.12450}
}