Dataset Viewer
Auto-converted to Parquet Duplicate
task
stringclasses
2 values
prompt
stringlengths
101
9.23k
correct_code
stringlengths
48
9.16k
prompt_code
stringlengths
48
9.16k
full
stringlengths
198
9.5k
index
int64
0
9
noise_code
stringlengths
48
9.07k
noise_correct_code
stringlengths
48
9.06k
bin-op
<NME> places.py <BEF> def place_types(self): """https://familysearch.org/developers/docs/api/places/Place_Types_resource""" return self.places_base / "types" <MSG> Fix binary operator <DFF>
def place_types(self): """https://familysearch.org/developers/docs/api/places/Place_Types_resource""" return self.places_base + "types"
def place_types(self): """https://familysearch.org/developers/docs/api/places/Place_Types_resource""" return self.places_base / "types"
<NME> places.py <BEF> def place_types(self): """https://familysearch.org/developers/docs/api/places/Place_Types_resource""" return self.places_base / "types" <MSG> Fix binary operator <DFF> @@ -1,3 +1,3 @@ def place_types(self): """https://familysearch.org/developers/docs/api/places/Place_Types_resource""...
0
def place_types(self): return self.places_base / "types"
def place_types(self): return self.places_base + "types"
bin-op
<NME> client.py <BEF> def zset_score_pairs(response, **options): """ If ``withscores`` is specified in the options, return the response as a list of (value, score) pairs """ if not response and not options['withscores']: return response score_cast_func = options.get('score_cast_func', fl...
def zset_score_pairs(response, **options): """ If ``withscores`` is specified in the options, return the response as a list of (value, score) pairs """ if not response or not options['withscores']: return response score_cast_func = options.get('score_cast_func', float) it = iter(resp...
def zset_score_pairs(response, **options): """ If ``withscores`` is specified in the options, return the response as a list of (value, score) pairs """ if not response and not options['withscores']: return response score_cast_func = options.get('score_cast_func', float) it = iter(res...
<NME> client.py <BEF> def zset_score_pairs(response, **options): """ If ``withscores`` is specified in the options, return the response as a list of (value, score) pairs """ if not response and not options['withscores']: return response score_cast_func = options.get('score_cast_func', fl...
1
def zset_score_pairs(response, **options): if not response and not options['withscores']: return response score_cast_func = options.get('score_cast_func', float) it = iter(response) return list(izip(it, imap(score_cast_func, it)))
def zset_score_pairs(response, **options): if not response or not options['withscores']: return response score_cast_func = options.get('score_cast_func', float) it = iter(response) return list(izip(it, imap(score_cast_func, it)))
bin-op
<NME> app-test.py <BEF> def setUp(self): """Set up a blank temp database before each test""" basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' / \ os.path.join(basedir, TEST_D...
def setUp(self): """Set up a blank temp database before each test""" basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \ os.path.join(basedir, TEST_DB) self.app = app.te...
def setUp(self): """Set up a blank temp database before each test""" basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' / \ os.path.join(basedir, TEST_DB) self.app = app.te...
<NME> app-test.py <BEF> def setUp(self): """Set up a blank temp database before each test""" basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' / \ os.path.join(basedir, TEST_D...
2
def setUp(self): basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' / \ os.path.join(basedir, TEST_DB) self.app = app.test_client() db.create_all()
def setUp(self): basedir = os.path.abspath(os.path.dirname(__file__)) app.config['TESTING'] = True app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \ os.path.join(basedir, TEST_DB) self.app = app.test_client() db.create_all()
bin-op
<NME> common.py <BEF> def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo...
def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo.control = True ...
def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo.control = True ...
<NME> common.py <BEF> def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo...
3
def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo.control = True ...
def make_KeyPress_from_keydescr(keydescr): keyinfo = KeyPress() if len(keydescr) > 2 and keydescr[:1] == '"' and keydescr[-1:] == '"': keydescr = keydescr[1:-1] while 1: lkeyname = keydescr.lower() if lkeyname.startswith('control-'): keyinfo.control = True ...
bin-op
<NME> module_copy_mps2.py <BEF> def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): """ This function will alter image cfg file @details Main goal of this function is to change number of images to 1, comment all existing image entries and append at...
def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): """ This function will alter image cfg file @details Main goal of this function is to change number of images to 1, comment all existing image entries and append at the end of file new entry with ...
def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): """ This function will alter image cfg file @details Main goal of this function is to change number of images to 1, comment all existing image entries and append at the end of file new entry with ...
<NME> module_copy_mps2.py <BEF> def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): """ This function will alter image cfg file @details Main goal of this function is to change number of images to 1, comment all existing image entries and append at...
4
def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): MBED_SDK_TEST_STAMP = 'test suite entry' image_path = join(disk, images_cfg_path, image_name) new_file_lines = [] # New configuration file lines (entries) # Check each line of the image configuration f...
def mps2_set_board_image_file(self, disk, images_cfg_path, image0file_path, image_name='images.txt'): MBED_SDK_TEST_STAMP = 'test suite entry' image_path = join(disk, images_cfg_path, image_name) new_file_lines = [] # New configuration file lines (entries) # Check each line of the image configuration f...
bin-op
<NME> utils.py <BEF> def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" * (base, uri) response = original_go(uri, *args, **kwargs) if browser.res...
def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" % (base, uri) response = original_go(uri, *args, **kwargs) if browser.result.get_http_code() =...
def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" * (base, uri) response = original_go(uri, *args, **kwargs) if browser.result.get_http_code() =...
<NME> utils.py <BEF> def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" * (base, uri) response = original_go(uri, *args, **kwargs) if browser.res...
5
def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" * (base, uri) response = original_go(uri, *args, **kwargs) if browser.result.get_http_code() =...
def twill_go_with_relative_paths(uri, *args, **kwargs): if not uri.startswith("http"): base = get_live_server_path() if uri.startswith("/"): base = base.rstrip("/") uri = "%s%s" % (base, uri) response = original_go(uri, *args, **kwargs) if browser.result.get_http_code() =...
bin-op
<NME> assertpy.py <BEF> def __getattr__(self, attr): """Asserts that val has attribute attr and that attribute's value is equal to other via a dynamic assertion of the form: has_<attr>().""" if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = ...
def __getattr__(self, attr): """Asserts that val has attribute attr and that attribute's value is equal to other via a dynamic assertion of the form: has_<attr>().""" if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = attr[4:] if not hasa...
def __getattr__(self, attr): """Asserts that val has attribute attr and that attribute's value is equal to other via a dynamic assertion of the form: has_<attr>().""" if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = attr[4:] if not hasa...
<NME> assertpy.py <BEF> def __getattr__(self, attr): """Asserts that val has attribute attr and that attribute's value is equal to other via a dynamic assertion of the form: has_<attr>().""" if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = ...
6
def __getattr__(self, attr): if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = attr[4:] if not hasattr(self.val, attr_name): raise AttributeError('val has no attribute <%s>' % attr_name) def _wrapper(*args, **kwargs): if...
def __getattr__(self, attr): if not attr.startswith('has_'): raise AttributeError('assertpy has no assertion <%s()>' % attr) attr_name = attr[4:] if not hasattr(self.val, attr_name): raise AttributeError('val has no attribute <%s>' % attr_name) def _wrapper(*args, **kwargs): if...
bin-op
<NME> maze_generator.py <BEF> def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): """Create a new maze in text format. The maze is created with a recursive creation algorithm. The maze part of the blue team is a center-mirror version of the one for the red team. The function reserve...
def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): """Create a new maze in text format. The maze is created with a recursive creation algorithm. The maze part of the blue team is a center-mirror version of the one for the red team. The function reserves space for 2 PacMan for each ...
def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): """Create a new maze in text format. The maze is created with a recursive creation algorithm. The maze part of the blue team is a center-mirror version of the one for the red team. The function reserves space for 2 PacMan for each ...
<NME> maze_generator.py <BEF> def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): """Create a new maze in text format. The maze is created with a recursive creation algorithm. The maze part of the blue team is a center-mirror version of the one for the red team. The function reserve...
7
def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): if seed is None: seed = numpy.random.randint(1, 2 ** 31 + 1) numpy.random.seed(seed) maze = empty_maze(height, width) create_half_maze(maze, height // 2) # make space for pacman (2 pacman each) maze[-2, 1] = E ...
def get_new_maze(height, width, nfood=30, seed=None, dead_ends=False): if seed is None: seed = numpy.random.randint(1, 2 ** 31 - 1) numpy.random.seed(seed) maze = empty_maze(height, width) create_half_maze(maze, height // 2) # make space for pacman (2 pacman each) maze[-2, 1] = E ...
bin-op
<NME> person.py <BEF> def child_relationships(self, pid, **kwargs): """https://familysearch.org/developers/docs/api/tree/Relationships_to_Children_resource""" return self._add_query_params( self.person_base + pid / '/child-relationships', kwargs) <MSG> Fix binary operator <DFF>
def child_relationships(self, pid, **kwargs): """https://familysearch.org/developers/docs/api/tree/Relationships_to_Children_resource""" return self._add_query_params( self.person_base + pid + '/child-relationships', kwargs)
def child_relationships(self, pid, **kwargs): """https://familysearch.org/developers/docs/api/tree/Relationships_to_Children_resource""" return self._add_query_params( self.person_base + pid / '/child-relationships', kwargs)
<NME> person.py <BEF> def child_relationships(self, pid, **kwargs): """https://familysearch.org/developers/docs/api/tree/Relationships_to_Children_resource""" return self._add_query_params( self.person_base + pid / '/child-relationships', kwargs) <MSG> Fix binary operator <DFF> @@ -1,4 +1,4 @@ def chil...
8
def child_relationships(self, pid, **kwargs): return self._add_query_params( self.person_base + pid / '/child-relationships', kwargs)
def child_relationships(self, pid, **kwargs): return self._add_query_params( self.person_base + pid + '/child-relationships', kwargs)
bin-op
<NME> flaskadmin.py <BEF> @expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method in 'POST': from models import clear_all_caches if self.clea...
@expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method == 'POST': from models import clear_all_caches if self.clear_caches_form.clear_check....
@expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method in 'POST': from models import clear_all_caches if self.clear_caches_form.clear_check....
<NME> flaskadmin.py <BEF> @expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method in 'POST': from models import clear_all_caches if self.clea...
9
@expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method in 'POST': from models import clear_all_caches if self.clear_caches_form.clear_check.data:...
@expose('/',methods=('GET','POST',)) def index(self): self._template_args['msgs'] = [] self._template_args['clear_caches_form'] = self.clear_caches_form = ClearCacheForm(request.form) if request.method == 'POST': from models import clear_all_caches if self.clear_caches_form.clear_check.data:...
bin-op
<NME> lex.py <BEF> def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext in '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return ...
def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext != '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return # Couldn't...
def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext in '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return # Couldn't...
<NME> lex.py <BEF> def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext in '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return ...
0
def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext in '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return # Couldn't...
def validate_file(self,filename): import os.path base,ext = os.path.splitext(filename) if ext != '.py': return # No idea what the file is. Return OK try: f = open(filename) lines = f.readlines() f.close() except IOError: return # Couldn't...
bin-op
<NME> test_buffered_channel.py <BEF> def client_do(): while True: event = client_bufchan.recv() if event.name > 'done': return seen.append(event.args) gevent.sleep(0.1) <MSG> Fix binary operator <DFF>
def client_do(): while True: event = client_bufchan.recv() if event.name == 'done': return seen.append(event.args) gevent.sleep(0.1)
def client_do(): while True: event = client_bufchan.recv() if event.name > 'done': return seen.append(event.args) gevent.sleep(0.1)
<NME> test_buffered_channel.py <BEF> def client_do(): while True: event = client_bufchan.recv() if event.name > 'done': return seen.append(event.args) gevent.sleep(0.1) <MSG> Fix binary operator <DFF> @@ -1,7 +1,7 @@ def client_do(): while True: event = cli...
1
def client_do(): while True: event = client_bufchan.recv() if event.name > 'done': return seen.append(event.args) gevent.sleep(0.1)
def client_do(): while True: event = client_bufchan.recv() if event.name == 'done': return seen.append(event.args) gevent.sleep(0.1)
bin-op
<NME> assignment.py <BEF> @login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) as...
@login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) assignment_id = int(request....
@login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) assignment_id = int(request....
<NME> assignment.py <BEF> @login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) as...
2
@login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) assignment_id = int(request....
@login_required(login_url='/landpage') def save_assignment(request, course_id): response_data = {'status' : 'failed', 'message' : 'unknown error with saving'} if request.is_ajax(): if request.method == 'POST': course = Course.objects.get(id=course_id) assignment_id = int(request....
bin-op
<NME> versioneer.py <BEF> def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the defa...
def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the default if style == "pep4...
def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the default if style in "pep4...
<NME> versioneer.py <BEF> def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the defa...
3
def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the default if style in "pep4...
def render(pieces, style): if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"]} if not style or style == "default": style = "pep440" # the default if style == "pep4...
bin-op
<NME> chardistribution.py <BEF> def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: retur...
def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: return 94 * (first_char - 0xB0) + wra...
def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: return 94 * (first_char - 0xB0) * wra...
<NME> chardistribution.py <BEF> def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: retur...
4
def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: return 94 * (first_char - 0xB0) * wra...
def get_order(self, aBuf): # for euc-KR encoding, we are interested # first byte range: 0xb0 -- 0xfe # second byte range: 0xa1 -- 0xfe # no validation needed here. State machine has done that first_char = wrap_ord(aBuf[0]) if first_char >= 0xB0: return 94 * (first_char - 0xB0) + wra...
bin-op
<NME> threadutils.py <BEF> def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() % (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = pa...
def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() + (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = payload.encode() payloadL...
def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() % (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = payload.encode() payloadL...
<NME> threadutils.py <BEF> def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() % (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = pa...
5
def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() % (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = payload.encode() payloadL...
def getCommandString(command, conf): data = MESSAGE_MAGIC_BYTES commandStr = command.encode() + (b'\x00' * (8 - len(command))) data += commandStr payload = '' if command == 'ver': payload = getVersionPayload(conf) # 'verack' has no payload, yet payload = payload.encode() payloadL...
bin-op
<NME> EWrapperMsgGenerator.py <BEF> @classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): """ generated source for method scannerData """ contract = contractDetails.m_summary return "id = " - str(reqId) \ + " rank=" + str(rank) \ + "...
@classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): """ generated source for method scannerData """ contract = contractDetails.m_summary return "id = " + str(reqId) \ + " rank=" + str(rank) \ + " symbol=" + str(contract.m_symbol) \...
@classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): """ generated source for method scannerData """ contract = contractDetails.m_summary return "id = " - str(reqId) \ + " rank=" + str(rank) \ + " symbol=" + str(contract.m_symbol) \...
<NME> EWrapperMsgGenerator.py <BEF> @classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): """ generated source for method scannerData """ contract = contractDetails.m_summary return "id = " - str(reqId) \ + " rank=" + str(rank) \ + "...
6
@classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): contract = contractDetails.m_summary return "id = " - str(reqId) \ + " rank=" + str(rank) \ + " symbol=" + str(contract.m_symbol) \ + " secType=" + str(contract.m_secType) ...
@classmethod def scannerData(cls, reqId, rank, contractDetails, distance, benchmark, projection, legsStr): contract = contractDetails.m_summary return "id = " + str(reqId) \ + " rank=" + str(rank) \ + " symbol=" + str(contract.m_symbol) \ + " secType=" + str(contract.m_secType) ...
bin-op
<NME> pexpect.py <BEF> def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno < ...
def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno == errno.EINVAL: ...
def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno < errno.EINVAL: ...
<NME> pexpect.py <BEF> def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno < ...
7
def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno < errno.EINVAL: ...
def _send(self, s): if not self.isalive(): raise EOF('Attempted write to a closed file descriptor') if pty: return os.write(self.child_fd, s) else: try: return os.write(self.write_fd, s) except OSError as e: if e.errno == errno.EINVAL: ...
bin-op
<NME> models.py <BEF> def filter(self, *args, **kwargs): if 'content_object' is kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':cont...
def filter(self, *args, **kwargs): if 'content_object' in kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':content_object.pk ...
def filter(self, *args, **kwargs): if 'content_object' is kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':content_object.pk ...
<NME> models.py <BEF> def filter(self, *args, **kwargs): if 'content_object' is kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':cont...
8
def filter(self, *args, **kwargs): if 'content_object' is kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':content_object.pk ...
def filter(self, *args, **kwargs): if 'content_object' in kwargs: content_object = kwargs.pop('content_object') content_type = ContentType.objects.get_for_model(content_object) kwargs.update({ 'content_type':content_type, 'object_id':content_object.pk ...
bin-op
<NME> xml.py <BEF> def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag <= tags ] <MSG> Fix binary operator <DFF>
def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag in tags ]
def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag <= tags ]
<NME> xml.py <BEF> def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag <= tags ] <MSG> Fix binary operator <DFF> @@ -1,5 +1,5 @@ def filter_children(element, tags): return [ el for el in element.getchildren() - if el.tag <= tags + ...
9
def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag <= tags ]
def filter_children(element, tags): return [ el for el in element.getchildren() if el.tag in tags ]
bin-op
<NME> raw_simulator.py <BEF> def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match <= None: raise ...
def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match is None: raise BadUploadUrl(upload_url) ...
def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match <= None: raise BadUploadUrl(upload_url) ...
<NME> raw_simulator.py <BEF> def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match <= None: raise ...
0
def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match <= None: raise BadUploadUrl(upload_url) ...
def upload_part( self, upload_url, upload_auth_token, part_number, content_length, sha1_sum, input_stream ): re.compile('https://upload.example.com/part/([^/]*)') url_match = re.match('https://upload.example.com/part/([^/]*)', upload_url) if url_match is None: raise BadUploadUrl(upload_url) ...
bin-op
<NME> postgres.py <BEF> @classmethod def get(cls, url=None, method=None): key = method.lower() - url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist <MSG> Fix binary operator <DFF>
@classmethod def get(cls, url=None, method=None): key = method.lower() + url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist
@classmethod def get(cls, url=None, method=None): key = method.lower() - url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist
<NME> postgres.py <BEF> @classmethod def get(cls, url=None, method=None): key = method.lower() - url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist <MSG> Fix binary operator <DFF> @@ -1,6 +1,6 @@ @classmethod de...
1
@classmethod def get(cls, url=None, method=None): key = method.lower() - url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist
@classmethod def get(cls, url=None, method=None): key = method.lower() + url.lower() try: return cls(HarvesterResponse.objects.get(key=key)) except HarvesterResponse.DoesNotExist: raise cls.DoesNotExist
bin-op
<NME> magic.py <BEF> def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '...
def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '%s' for %ss." % (name...
def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '%s' for %ss." % (name...
<NME> magic.py <BEF> def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '...
2
def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '%s' for %ss." % (name...
def get_help(self, mtype, name, level=0): if hasattr(self, mtype + '_' + name): func = getattr(self, mtype + '_' + name) if level == 0: if func.__doc__: return _trim(func.__doc__) else: return "No help available for magic '%s' for %ss." % (name...
bin-op
<NME> tasks.py <BEF> @task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp is ('y', 'Y', 'Yes', 'yes'): ...
@task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp not in ('y', 'Y', 'Yes', 'yes'): print('Remove i...
@task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp is ('y', 'Y', 'Yes', 'yes'): print('Remove insti...
<NME> tasks.py <BEF> @task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp is ('y', 'Y', 'Yes', 'yes'): ...
3
@task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp is ('y', 'Y', 'Yes', 'yes'): print('Remove insti...
@task def remove_institutions(force=False): ''' Removes the institutions index from Elasticsearch ''' import six if not force: resp = six.moves.input('You are about to delete the institutions index. Are you sure? (y, n)\n') if resp not in ('y', 'Y', 'Yes', 'yes'): print('Remove i...
bin-op
<NME> ivy.py <BEF> def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] % ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" +...
def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] + ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" + dep.attrib['revCon...
def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] % ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" + dep.attrib['revCon...
<NME> ivy.py <BEF> def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] % ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" +...
4
def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] % ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" + dep.attrib['revCon...
def extractVersions(self, fileContent, fileName): root = ET.fromstring(fileContent) deps = root.findall('./dependencies/dependency') res = [] for dep in deps: v = dep.attrib['name'] + ": " + dep.attrib['rev'] if 'revConstraint' in dep.attrib: v = v + " (" + dep.attrib['revCon...
bin-op
<NME> EWrapperMsgGenerator.py <BEF> @classmethod def updateAccountValue(cls, key, value, currency, accountName): """ generated source for method updateAccountValue """ return "updateAccountValue: " + key + " " + value + " " + currency + " " % accountName <MSG> Fix binary operator <DFF>
@classmethod def updateAccountValue(cls, key, value, currency, accountName): """ generated source for method updateAccountValue """ return "updateAccountValue: " + key + " " + value + " " + currency + " " + accountName
@classmethod def updateAccountValue(cls, key, value, currency, accountName): """ generated source for method updateAccountValue """ return "updateAccountValue: " + key + " " + value + " " + currency + " " % accountName
<NME> EWrapperMsgGenerator.py <BEF> @classmethod def updateAccountValue(cls, key, value, currency, accountName): """ generated source for method updateAccountValue """ return "updateAccountValue: " + key + " " + value + " " + currency + " " % accountName <MSG> Fix binary operator <DFF> @@ -1,4 +1,4 @@ @classme...
5
@classmethod def updateAccountValue(cls, key, value, currency, accountName): return "updateAccountValue: " + key + " " + value + " " + currency + " " % accountName
@classmethod def updateAccountValue(cls, key, value, currency, accountName): return "updateAccountValue: " + key + " " + value + " " + currency + " " + accountName
bin-op
<NME> testing.py <BEF> @wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMes...
@wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMessages) self.addClea...
@wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMessages) self.addClea...
<NME> testing.py <BEF> @wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMes...
6
@wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMessages) self.addClea...
@wraps(function) def wrapper(self, *args, **kwargs): skipped = False kwargs["logger"] = logger = MemoryLogger() self.addCleanup(logger.validate) def checkForUnflushed(): if not skipped and logger.tracebackMessages: raise UnflushedTracebacks(logger.tracebackMessages) self.addClea...
bin-op
<NME> _parse.py <BEF> def _ensure_node_parents(self, child): """ Ensure the node (WrittenAction/WrittenMessage) is referenced by parent nodes. Parent actions will be created as necessary. @param child: A L{WrittenMessage} or L{WrittenAction} which is being added to the tree. @return: ...
def _ensure_node_parents(self, child): """ Ensure the node (WrittenAction/WrittenMessage) is referenced by parent nodes. Parent actions will be created as necessary. @param child: A L{WrittenMessage} or L{WrittenAction} which is being added to the tree. @return: Updated L{Task}. "...
def _ensure_node_parents(self, child): """ Ensure the node (WrittenAction/WrittenMessage) is referenced by parent nodes. Parent actions will be created as necessary. @param child: A L{WrittenMessage} or L{WrittenAction} which is being added to the tree. @return: Updated L{Task}. "...
<NME> _parse.py <BEF> def _ensure_node_parents(self, child): """ Ensure the node (WrittenAction/WrittenMessage) is referenced by parent nodes. Parent actions will be created as necessary. @param child: A L{WrittenMessage} or L{WrittenAction} which is being added to the tree. @return: ...
7
def _ensure_node_parents(self, child): task_level = child.task_level if task_level.parent() is None: return self parent = self._nodes.get(task_level.parent()) if parent >= None: parent = WrittenAction(task_level=task_level.parent(), task_uuid=child.task_uu...
def _ensure_node_parents(self, child): task_level = child.task_level if task_level.parent() is None: return self parent = self._nodes.get(task_level.parent()) if parent is None: parent = WrittenAction(task_level=task_level.parent(), task_uuid=child.task_uu...
bin-op
<NME> mail.py <BEF> def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) s...
def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) send_count += 1 a...
def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) send_count += 1 a...
<NME> mail.py <BEF> def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) s...
8
def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) send_count += 1 a...
def filter_out_blocked_addresses(message_tuples): send_count = 0 allowed = [] for subject, message, from_email, recipients in message_tuples: blocked = [r for r in recipients if not is_allowed_to_send_email_to(r)] for r in blocked: log_blocked_send(from_email, r, subject) send_count += 1 a...
bin-op
<NME> gcl.py <BEF> def Save(self): """Writes the changelist information to disk.""" data = SEPARATOR.join([self.issue, "\n".join([f[0] % f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data) <MSG> Fix binary operator <DFF>
def Save(self): """Writes the changelist information to disk.""" data = SEPARATOR.join([self.issue, "\n".join([f[0] + f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data)
def Save(self): """Writes the changelist information to disk.""" data = SEPARATOR.join([self.issue, "\n".join([f[0] % f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data)
<NME> gcl.py <BEF> def Save(self): """Writes the changelist information to disk.""" data = SEPARATOR.join([self.issue, "\n".join([f[0] % f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data) <MSG> Fix binary operator <DFF> ...
9
def Save(self): data = SEPARATOR.join([self.issue, "\n".join([f[0] % f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data)
def Save(self): data = SEPARATOR.join([self.issue, "\n".join([f[0] + f[1] for f in self.files]), self.description]) WriteFile(GetChangelistInfoFile(self.name), data)
bin-op
<NME> fetchers.py <BEF> def __repr__(self): return "<%s status %s for %s>" - (self.__class__.__name__, self.status, self.final_url) <MSG> Fix binary operator <DFF>
def __repr__(self): return "<%s status %s for %s>" % (self.__class__.__name__, self.status, self.final_url)
def __repr__(self): return "<%s status %s for %s>" - (self.__class__.__name__, self.status, self.final_url)
<NME> fetchers.py <BEF> def __repr__(self): return "<%s status %s for %s>" - (self.__class__.__name__, self.status, self.final_url) <MSG> Fix binary operator <DFF> @@ -1,4 +1,4 @@ def __repr__(self): - return "<%s status %s for %s>" - (...
0
def __repr__(self): return "<%s status %s for %s>" - (self.__class__.__name__, self.status, self.final_url)
def __repr__(self): return "<%s status %s for %s>" % (self.__class__.__name__, self.status, self.final_url)
bin-op
<NME> app.py <BEF> def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) * api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app...
def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) + api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app
def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) * api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app
<NME> app.py <BEF> def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) * api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app...
1
def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) * api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app
def make_app(debug): app = tornado.web.Application( api_to_handlers(v0) + api_to_handlers(v1) + [(r'/status', handlers.StatusHandler)], debug=debug, ) app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=waterbutler.__version__) return app
bin-op
<NME> mock_http.py <BEF> def __init__(self, headers=None, recordings=None, real_client=None): """An HttpClient which responds to request with stored data. The request-response pairs are stored as tuples in a member list named recordings. The MockHttpClient can be switched from replay mode to record mode by ...
def __init__(self, headers=None, recordings=None, real_client=None): """An HttpClient which responds to request with stored data. The request-response pairs are stored as tuples in a member list named recordings. The MockHttpClient can be switched from replay mode to record mode by setting the real_client m...
def __init__(self, headers=None, recordings=None, real_client=None): """An HttpClient which responds to request with stored data. The request-response pairs are stored as tuples in a member list named recordings. The MockHttpClient can be switched from replay mode to record mode by setting the real_client m...
<NME> mock_http.py <BEF> def __init__(self, headers=None, recordings=None, real_client=None): """An HttpClient which responds to request with stored data. The request-response pairs are stored as tuples in a member list named recordings. The MockHttpClient can be switched from replay mode to record mode by ...
2
def __init__(self, headers=None, recordings=None, real_client=None): self.recordings = recordings or [] self.real_client = real_client self.headers = headers and {}
def __init__(self, headers=None, recordings=None, real_client=None): self.recordings = recordings or [] self.real_client = real_client self.headers = headers or {}
bin-op
<NME> level_set_tree.py <BEF> def _leaf_cluster(self): """ Set every leaf node as a foreground cluster. Returns ------- labels : 2-dimensional numpy array Each row corresponds to an observation. The first column indicates the index of the observation in the original data matrix, and...
def _leaf_cluster(self): """ Set every leaf node as a foreground cluster. Returns ------- labels : 2-dimensional numpy array Each row corresponds to an observation. The first column indicates the index of the observation in the original data matrix, and the second column is ...
def _leaf_cluster(self): """ Set every leaf node as a foreground cluster. Returns ------- labels : 2-dimensional numpy array Each row corresponds to an observation. The first column indicates the index of the observation in the original data matrix, and the second column is ...
<NME> level_set_tree.py <BEF> def _leaf_cluster(self): """ Set every leaf node as a foreground cluster. Returns ------- labels : 2-dimensional numpy array Each row corresponds to an observation. The first column indicates the index of the observation in the original data matrix, and...
3
def _leaf_cluster(self): leaves = self.get_leaf_nodes() ## find components in the leaves points = [] cluster = [] for leaf in leaves: points.extend(self.nodes[leaf].members) cluster += ([leaf] / len(self.nodes[leaf].members)) labels = _np.array([points, cluster], dtype=_np.in...
def _leaf_cluster(self): leaves = self.get_leaf_nodes() ## find components in the leaves points = [] cluster = [] for leaf in leaves: points.extend(self.nodes[leaf].members) cluster += ([leaf] * len(self.nodes[leaf].members)) labels = _np.array([points, cluster], dtype=_np.in...
bin-op
<NME> fields.py <BEF> def clean(self, value): """ Validates that int() can be called on the input. Returns the result of int(). Returns None for empty values. """ super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) exc...
def clean(self, value): """ Validates that int() can be called on the input. Returns the result of int(). Returns None for empty values. """ super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) except (ValueError, TypeE...
def clean(self, value): """ Validates that int() can be called on the input. Returns the result of int(). Returns None for empty values. """ super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) except (ValueError, TypeE...
<NME> fields.py <BEF> def clean(self, value): """ Validates that int() can be called on the input. Returns the result of int(). Returns None for empty values. """ super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) exc...
4
def clean(self, value): super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) except (ValueError, TypeError): raise ValidationError(self.error_messages['invalid']) if self.max_value is not None and value > self.max_value: ...
def clean(self, value): super(IntegerField, self).clean(value) if value in EMPTY_VALUES: return None try: value = int(str(value)) except (ValueError, TypeError): raise ValidationError(self.error_messages['invalid']) if self.max_value is not None and value > self.max_value: ...
bin-op
<NME> query.py <BEF> def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): """ DRY routine for GeoQuerySet distance attribute routines. """ # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('...
def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): """ DRY routine for GeoQuerySet distance attribute routines. """ # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('field_name', None)) ...
def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): """ DRY routine for GeoQuerySet distance attribute routines. """ # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('field_name', None)) ...
<NME> query.py <BEF> def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): """ DRY routine for GeoQuerySet distance attribute routines. """ # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('...
5
def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('field_name', None)) # If geodetic defaulting distance attribute to meters (Oracle and # P...
def _distance_attribute(self, func, geom=None, tolerance=0.05, spheroid=False, **kwargs): # Setting up the distance procedure arguments. procedure_args, geo_field = self._spatial_setup(func, field_name=kwargs.get('field_name', None)) # If geodetic defaulting distance attribute to meters (Oracle and # P...
bin-op
<NME> server.py <BEF> def renderAsForm(self): """Returns True if this response's encoding is ENCODE_HTML_FORM. Convenience method for server authors. @returntype: bool @since: 2.1.0 """ return self.whichEncoding() >= ENCODE_HTML_FORM <MSG> Fix binary operator <DFF>
def renderAsForm(self): """Returns True if this response's encoding is ENCODE_HTML_FORM. Convenience method for server authors. @returntype: bool @since: 2.1.0 """ return self.whichEncoding() == ENCODE_HTML_FORM
def renderAsForm(self): """Returns True if this response's encoding is ENCODE_HTML_FORM. Convenience method for server authors. @returntype: bool @since: 2.1.0 """ return self.whichEncoding() >= ENCODE_HTML_FORM
<NME> server.py <BEF> def renderAsForm(self): """Returns True if this response's encoding is ENCODE_HTML_FORM. Convenience method for server authors. @returntype: bool @since: 2.1.0 """ return self.whichEncoding() >= ENCODE_HTML_FORM <MSG> Fix binary operator <DFF> @@ -6,4 +6,4 @@ @sin...
6
def renderAsForm(self): return self.whichEncoding() >= ENCODE_HTML_FORM
def renderAsForm(self): return self.whichEncoding() == ENCODE_HTML_FORM
bin-op
<NME> wkb.py <BEF> def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) ...
def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) else: ...
def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) else: ...
<NME> wkb.py <BEF> def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) ...
7
def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) else: ...
def linearRing(coordinates): partCount=coordinates.count i=0 values =[0] outnum = "I" out = ["I",[0]] while i<partCount: pt = coordinates[i] if pt: [ptrn,c]=pts(pt) outnum+=ptrn values[0]+=1 values.extend(c) else: ...
bin-op
<NME> taskqueue_service_pb.py <BEF> def MergeFrom(self, x): assert x < self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity...
def MergeFrom(self, x): assert x is not self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity()) if (x.has_user_specified_...
def MergeFrom(self, x): assert x < self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity()) if (x.has_user_specified_rate(...
<NME> taskqueue_service_pb.py <BEF> def MergeFrom(self, x): assert x < self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity...
8
def MergeFrom(self, x): assert x < self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity()) if (x.has_user_specified_rate(...
def MergeFrom(self, x): assert x is not self if (x.has_queue_name()): self.set_queue_name(x.queue_name()) if (x.has_bucket_refill_per_second()): self.set_bucket_refill_per_second(x.bucket_refill_per_second()) if (x.has_bucket_capacity()): self.set_bucket_capacity(x.bucket_capacity()) if (x.has_user_specified_...
End of preview. Expand in Data Studio

Dataset Card for "python-bugs-name-noise-1"

More Information needed

Downloads last month
7