Skip to content

Instantly share code, notes, and snippets.

@breandan
Last active November 3, 2022 01:04
Show Gist options
  • Save breandan/f7d3c6dc3178d9b0fb1b63540e281858 to your computer and use it in GitHub Desktop.
Save breandan/f7d3c6dc3178d9b0fb1b63540e281858 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
Disabling nonterminal stubs!
Drew 0 samples before timeout
Synthesized repair in: 73ms
Tidyparse (proposed/total): 0/1
Tidyparse (accepted/proposed): 0/0
ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.9.3
ANTLR Runtime version 4.7.2 used for parser compilation does not match the current runtime version 4.9.3
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------|-------------------------|
| ~def T(self, w):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if w in self.T_memoized:~ | |
| ~ return self.T_memoized[w]~ | |
| ~ res = set(filter(lambda(r, w_): self.I(w, r, w_) > 0,~ | |
| ~ itertools.product(self.relations, self.words)))~ | |
| ~ self.T_memoized[w] = res~ | |
| ~ return res~ | |
| ~~ | |
ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.9.3
ANTLR Runtime version 4.7.2 used for parser compilation does not match the current runtime version 4.9.3
Filtered out 115/115 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30208ms
Tidyparse (proposed/total): 0/2
Tidyparse (accepted/proposed): 0/0
Original error: invalid syntax
| original | repair |
|------------------------------------|-------------------------|
| ~def sort_param(x):~ | **NO_REPAIR_PROPOSAL!** |
| ~ y = ord(x)~ | |
| ~ if 96 < y < 123:~ | |
| ~ return y - 96~ | |
| ~ elif 64 < y < 91:~ | |
| ~ return 50 +(y - 64)~ | |
| ~ else:~ | |
| ~ if y % 2 == 1:~ | |
| ~ return 100 +(y - 47)~ | |
| ~ else:~ | |
| ~ return 150 +(y - 47)~ | |
| ~~ | |
Filtered out 62/64 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30294ms
Tidyparse (proposed/total): 1/3
Tidyparse (accepted/proposed): 1/1
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|-------------------------------------------------------------------------|
| def _additional(self): | def _additional(self): |
| return{ | return{ |
| 'ansicolors': '/elsewhere:ansicolors', | 'ansicolors': '/elsewhere:ansicolors', |
| 'apache': '/elsewhere:apache.aurora.client', | 'apache': '/elsewhere:apache.aurora.client', |
| 'fsqio': { | 'fsqio': { |
| 'buildgen': { | 'buildgen': { |
| 'core': '/elsewhere:buildgen-core', | 'core': '/elsewhere:buildgen-core', |
| 'python': '/elsewhere:buildgen-jvm', | 'python': '/elsewhere:buildgen-jvm', |
| }, | }, |
| }, | }, |
| 'twitter': { | 'twitter': { |
| 'common': { | 'common': { |
| 'collections': '/elsewhere:twitter.common.collections', | 'collections': '/elsewhere:twitter.common.collections', |
| 'confluence': '/elsewhere:twitter.common.confluence', | 'confluence': '/elsewhere:twitter.common.confluence', |
| 'log': '/elsewhere:twitter.common.log', | 'log': '/elsewhere:twitter.common.log', |
| }, | }**}**, |
| 'finagle': { | 'finagle': { |
| 'DEFAULT': 'a_bird_name', | 'DEFAULT': 'a_bird_name', |
| } | }**}** |
| | |
Python parser ACCEPTED repair!
Filtered out 77/77 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30326ms
Tidyparse (proposed/total): 1/4
Tidyparse (accepted/proposed): 1/1
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------|-------------------------|
| ~def test_sequential_fuzz_prohibited(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Test to make sure that no unwanted characters are included"""~ | |
| ~ self.fuzzer.initialize()~ | |
| ~ prohibited = ["a", "b"]~ | |
| ~ for number, result in enumerate(~ | |
| ~ self.fuzzer.sequential_fuzz(~ | |
| ~ prohibit = prohibited~ | |
| ~ )~ | |
| ~ ):~ | |
| ~ if number >= 600:~ | |
| ~ break~ | |
| ~ for character in result.value:~ | |
| ~ self.assertTrue(~ | |
| ~ character not in prohibited,~ | |
| ~ msg = "A prohibited character was in the result."~ | |
| ~ )~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 1/5
Tidyparse (accepted/proposed): 1/1
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------|-------------------------|
| ~def _sts_mon(self, value, ** kwargs):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(self._target is None or~ | |
| ~ np.abs(self._target - value) < self._dead_band):~ | |
| ~ self.T.clear_sub(self._sts_mon)~ | |
| ~ self.scan.put('Passive', wait = True)~ | |
| ~ if self._sts is not None:~ | |
| ~ self._sts._finished()~ | |
| ~ self._sts = None~ | |
| ~ self._target = None~ | |
| ~~ | |
Filtered out 97/105 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30682ms
Tidyparse (proposed/total): 2/6
Tidyparse (accepted/proposed): 2/2
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| def __init__(self, cache_dir = None): | def __init__(self, cache_dir = None): |
| """Create an UASparser to parse useragent strings.""" | """Create an UASparser to parse useragent strings.""" |
| self.cache_dir = cache_dir and cache_dir or os.path.abspath(os.path.~dirname(__file__~) | self.cache_dir = cache_dir and cache_dir or os.path.abspath(os.path.**dirname__file__**) |
| if not os.access(self.cache_dir, os.W_OK): | if not os.access(self.cache_dir, os.W_OK): |
| raise UASException("Cache directory %s is not writable.") | raise UASException("Cache directory %s is not writable.") |
| self.cache_file_name = os.path.join(self.cache_dir, self.cache_file_name) | self.cache_file_name = os.path.join(self.cache_dir, self.cache_file_name) |
| | |
Python parser ACCEPTED repair!
Filtered out 26/30 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30743ms
Tidyparse (proposed/total): 3/7
Tidyparse (accepted/proposed): 3/3
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|----------------------------------------------------------------------|
| def style_widgets(self): | def style_widgets(self): |
| self.r_cutoff_txt.setMaximumWidth(80) | self.r_cutoff_txt.setMaximumWidth(80) |
| self.optimize_iterations_txt.setMaximumWidth(80) | self.optimize_iterations_txt.setMaximumWidth(80) |
| self.r_cutoff_txt.setValidator(QtGui.QDoubleValidator()) | self.r_cutoff_txt.setValidator(QtGui.QDoubleValidator()) |
| self.optimize_iterations_txt.setValidator(QtGui.QIntValidator())~)~ | self.optimize_iterations_txt.setValidator(QtGui.QIntValidator()) |
| self.attenuation_factor_sb.setRange(1, 1000) | self.attenuation_factor_sb.setRange(1, 1000) |
| self.attenuation_factor_sb.setSingleStep(1) | self.attenuation_factor_sb.setSingleStep(1) |
| self.attenuation_factor_sb.setValue(1) | self.attenuation_factor_sb.setValue(1) |
| self.attenuation_factor_sb.setAlignment(QtCore.Qt.AlignRight) | self.attenuation_factor_sb.setAlignment(QtCore.Qt.AlignRight) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 43ms
Tidyparse (proposed/total): 3/8
Tidyparse (accepted/proposed): 3/3
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~def sender(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ pub = rospy.Publisher('ocvfacerec/static_image', Image, queue_size = 4)~ | |
| ~ rospy.init_node('ocvf_static_image_sender', anonymous = False)~ | |
| ~ c = 0~ | |
| ~ rate = rospy.Rate(0.5)~ | |
| ~ while not rospy.is_shutdown():~ | |
| ~ pub.publish(self.bridge.cv2_to_imgmsg(self.images[c], "bgr8"))~ | |
| ~ time.sleep(2)~ | |
| ~ print(">> Image " + str(c))~ | |
| ~ c += 1~ | |
| ~ if c > 3:~ | |
| ~ c = 0~ | |
| ~~ | |
Filtered out 78/78 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31688ms
Tidyparse (proposed/total): 3/9
Tidyparse (accepted/proposed): 3/3
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------------|-------------------------|
| ~def get_package_name(self, package_tree):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for child in package_tree.iterchildren("member_select", "identifier"):~ | |
| ~ prefix = self.get_package_name(child)~ | |
| ~ if prefix != None and len(prefix) > 0:~ | |
| ~ return prefix + "." + child.get("name")~ | |
| ~ else:~ | |
| ~ return child.get("name")~ | |
| ~~ | |
Filtered out 64/68 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 35256ms
Tidyparse (proposed/total): 4/10
Tidyparse (accepted/proposed): 4/4
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| def add_arguments(self, parser): | def add_arguments(self, parser): |
| parser.add_argument('-q', '--quiet', action = 'store_true', dest = 'quiet', default = False, | parser.add_argument('-q', '--quiet', action = 'store_true', dest = 'quiet', default = False, |
| help = 'If no error occurs, swallow all output.'), | help = 'If no error occurs, swallow all output.'), |
| parser.add_argument('--database', default = 'default', | parser.add_argument('--database', default = 'default', |
| help = ~(~'Specifies the database to use, if using a db. ' | help = 'Specifies the database to use, if using a db. ' |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 26ms
Tidyparse (proposed/total): 4/11
Tidyparse (accepted/proposed): 4/4
Original error: expected an indented block
| original | repair |
|-------------------------------------------------|-------------------------|
| ~def get_dom_handle(conn, domain, domainname):~ | **NO_REPAIR_PROPOSAL!** |
| ~ dom = None~ | |
| ~ try:~ | |
| ~ if domain > 0:~ | |
| ~ dom = conn.lookupByID(domain)~ | |
| ~ else:~ | |
| ~ dom = conn.lookupByName(domainname)~ | |
| ~ except:~ | |
| ~ return None~ | |
| ~ return dom~ | |
| ~~ | |
Filtered out 127/127 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 37067ms
Tidyparse (proposed/total): 4/12
Tidyparse (accepted/proposed): 4/4
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------------------|-------------------------|
| ~def readS8(self, reg):~ | **NO_REPAIR_PROPOSAL!** |
| ~ "Reads a signed byte from the I2C device"~ | |
| ~ try:~ | |
| ~ result = self.bus.read_byte_data(self.address, reg)~ | |
| ~ if result > 127: result -= 256~ | |
| ~ if self.debug:~ | |
| ~ print("I2C: Device 0x%02X returned 0x%02X from reg 0x%02X" %~ | |
| ~ (self.address, result & 0xFF, reg))~ | |
| ~ return result~ | |
| ~ except IOError, err:~ | |
| ~ return self.errMsg()~ | |
| ~~ | |
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 58883ms
Tidyparse (proposed/total): 4/13
Tidyparse (accepted/proposed): 4/4
Original error: invalid syntax
| original | repair |
|------------------------------------------------------|-------------------------|
| ~def convert_code(line):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if line.startswith('{{{'):~ | |
| ~ print~ | |
| ~ print(".. code-block: : python")~ | |
| ~ print~ | |
| ~ while True:~ | |
| ~ line = sys.stdin.readline()~ | |
| ~ if line.startswith('}}}'): return True~ | |
| ~ else:~ | |
| ~ print " " + line.strip()~ | |
| ~ return False~ | |
| ~~ | |
Filtered out 31/61 invalid samples!
Drew 30 samples before timeout
Synthesized repair in: 31224ms
Tidyparse (proposed/total): 5/14
Tidyparse (accepted/proposed): 5/5
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| def get(self, model_name): | def get(self, model_name): |
| try: | try: |
| models = ModelPredictPython3Handler._registry | models = ModelPredictPython3Handler._registry |
| self.write(models) | self.write(models) |
| self.finish() | self.finish() |
| except Exception as e: | except Exception as e: |
| logging.exception('ModelPredictPython3Handler.get: Exception{0}'.format(str(e)) | logging.exception('ModelPredictPython3Handler.get: Exception{0}'.format(str(e)) |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 41ms
Tidyparse (proposed/total): 5/15
Tidyparse (accepted/proposed): 5/5
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------------------------|-------------------------|
| ~def get_expired_last_calls():~ | **NO_REPAIR_PROPOSAL!** |
| ~ today = datetime.date.today()~ | |
| ~ for d in Document.objects.filter(Q(states__type = "draft-iesg", states__slug = "lc")~ | |
| ~ | Q(states__type = "statchg", states__slug = "in-lc")):~ | |
| ~ e = d.latest_event(LastCallDocEvent, type = "sent_last_call")~ | |
| ~ if e and e.expires.date() <= today:~ | |
| ~ yield d~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 35ms
Tidyparse (proposed/total): 5/16
Tidyparse (accepted/proposed): 5/5
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------------------------------------------|-------------------------|
| ~def binomial_prefactor(s, ia, ib xpa, xpb):~ | **NO_REPAIR_PROPOSAL!** |
| ~ "From Augspurger and Dykstra"~ | |
| ~ sum = 0~ | |
| ~ for t in range(s + 1):~ | |
| ~ if s - ia <= t <= ib:~ | |
| ~ sum = sum + binomial(ia, s - t) * binomial(ib, t) * pow(xpa, ia - s + t) * pow(xpb, ib - t)~ | |
| ~ return sum~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 28ms
Tidyparse (proposed/total): 5/17
Tidyparse (accepted/proposed): 5/5
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------|-------------------------|
| ~def extract_pandas_labels(labels):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Extract data from pandas.DataFrame for labels."""~ | |
| ~ if isinstance(labels,~ | |
| ~ pd.DataFrame):~ | |
| ~ if len(labels.columns) > 1:~ | |
| ~ raise ValueError('Only one column for labels is allowed.')~ | |
| ~ if all(dtype.name in PANDAS_DTYPES for dtype in labels.dtypes):~ | |
| ~ return labels.values~ | |
| ~ else:~ | |
| ~ raise ValueError('Data types for labels must be int, float, or bool.')~ | |
| ~ else:~ | |
| ~ return labels~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 5/18
Tidyparse (accepted/proposed): 5/5
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------------|-------------------------|
| ~def run_test4(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ i = (1 << 47)~ | |
| ~ if(self.debug):~ | |
| ~ print "removing switch " + str(i)~ | |
| ~ self.bs.remove_name_for_location(datapathid.from_host(i), 0,~ | |
| ~ "", Name.SWITCH)~ | |
| ~ self.next_fn = self.run_test5~ | |
| ~ self.wait_count = 1~ | |
| ~~ | |
Filtered out 23/45 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 32061ms
Tidyparse (proposed/total): 6/19
Tidyparse (accepted/proposed): 6/6
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def put_atoms(self, atoms): | def put_atoms(self, atoms): |
| for atom, neg in atoms: | for atom, neg in atoms: |
| if neg: | if neg: |
| self[Categories.N_ATOM].add((- atom, None)) | self[Categories.N_ATOM].add((- atom, None)) |
| else: | else: |
| self[Categories.ATOM].add(~(~atom, None~)~ | self[Categories.ATOM].add(atom, None |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 16/22 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31369ms
Tidyparse (proposed/total): 7/20
Tidyparse (accepted/proposed): 7/7
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------|--------------------------------------------------------|
| def _randomize(self): | def _randomize(self): |
| allItems = [self.cardListWidget.takeItem(0) | allItems = [self.cardListWidget.takeItem(0) |
| for i in ~range(self~.cardListWidget.count()] | for i in **rangeself**.cardListWidget.count()] |
| shuffle(allItems) | shuffle(allItems) |
| for item in allItems: | for item in allItems: |
| self.cardListWidget.addItem(item) | self.cardListWidget.addItem(item) |
| | |
Python parser ACCEPTED repair!
Filtered out 59/78 invalid samples!
Drew 19 samples before timeout
Synthesized repair in: 32427ms
Tidyparse (proposed/total): 8/21
Tidyparse (accepted/proposed): 8/8
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|---------------------------------------------------------|
| class SpaceTimeRealignerOutputSpec(TraitedSpec): | class SpaceTimeRealignerOutputSpec(TraitedSpec): |
| out_file = OutputMultiPath(File(exists = True), | out_file = OutputMultiPath(File(exists = True), |
| desc = "Realigned files") | desc = "Realigned files") |
| par_file = OutputMultiPath(File(exists = True), | par_file = OutputMultiPath(File(exists = True), |
| desc = ~(~"Motion parameter files.Angles are not " | desc = "Motion parameter files.Angles are not " |
| "euler angles") | "euler angles") |
| | |
Python parser ACCEPTED repair!
Filtered out 80/103 invalid samples!
Drew 23 samples before timeout
Synthesized repair in: 74183ms
Tidyparse (proposed/total): 9/22
Tidyparse (accepted/proposed): 9/9
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|------------------------------------------------------------|
| def setUpClass(kls): | def setUpClass(kls): |
| kls.app = SwaggerApp.~_create_~(~get_test_data_folder(~ | kls.app = SwaggerApp.**_create_get_test_data_folder**( |
| version = '2.0', | version = '2.0', |
| which = os.path.join('resolve', 'other') | which = os.path.join('resolve', 'other') |
| ) | ) |
| | |
Python parser ACCEPTED repair!
Filtered out 39/41 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 43455ms
Tidyparse (proposed/total): 10/23
Tidyparse (accepted/proposed): 10/10
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|--------------------------------------------------------------|
| import sys | import sys |
| sys.path.insert(0, "../boardgamebot") | sys.path.insert(0, "../boardgamebot") |
| from tools import http | from tools import http |
| import exceptions | import exceptions |
| try: | try: |
| ~print(http~.searchByName("Pandemic Iberia").toString() | **printhttp**.searchByName("Pandemic Iberia").toString() |
| print(http.searchByNameExact("Pandemic").toString()) | print(http.searchByNameExact("Pandemic").toString()) |
| print(http.searchById(131691).toString()) | print(http.searchById(131691).toString()) |
| except exceptions.BggUnreachable: | except exceptions.BggUnreachable: |
| print("Bgg unreachable") | print("Bgg unreachable") |
| except exceptions.NoResultFound: | except exceptions.NoResultFound: |
| print("No result found") | print("No result found") |
| | |
Python parser ACCEPTED repair!
Filtered out 344/344 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 54827ms
Tidyparse (proposed/total): 10/24
Tidyparse (accepted/proposed): 10/10
Original error: unexpected indent
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~birthYear = 1928~ | **NO_REPAIR_PROPOSAL!** |
| ~currentYear = 2013~ | |
| ~age = currentYear - birthYear~ | |
| ~if age > 65:~ | |
| ~ print('Enjoy retirement!')~ | |
| ~ print('You turn 100 in', 100 + birthYear)~ | |
| ~print('You are', age, 'years old')~ | |
| ~~ | |
Filtered out 77/81 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30915ms
Tidyparse (proposed/total): 11/25
Tidyparse (accepted/proposed): 11/11
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|-----------------------------------------------------------|
| def updateSetsList(self): | def updateSetsList(self): |
| self.list.reset() | self.list.reset() |
| for setNum in ~sorted(self~.parser.feedsList.keys(): | for setNum in **sortedself**.parser.feedsList.keys(): |
| self.list.addItem(setNum) | self.list.addItem(setNum) |
| self.list_label.setLabel(getLS(24)) | self.list_label.setLabel(getLS(24)) |
| | |
Python parser ACCEPTED repair!
Filtered out 45/53 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 35285ms
Tidyparse (proposed/total): 12/26
Tidyparse (accepted/proposed): 12/12
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|------------------------------------------------------------|
| def test_exists_miss_w_bound_client(self): | def test_exists_miss_w_bound_client(self): |
| client = _Client(project = self.PROJECT) | client = _Client(project = self.PROJECT) |
| api = client.subscriber_api = _FauxSubscribererAPI() | api = client.subscriber_api = _FauxSubscribererAPI() |
| topic = _Topic(self.TOPIC_NAME, client = client) | topic = _Topic(self.TOPIC_NAME, client = client) |
| subscription = self._make_one(self.SUB_NAME, topic) | subscription = self._make_one(self.SUB_NAME, topic) |
| self.assertFalse(subscription.exists())~)~ | self.assertFalse(subscription.exists()) |
| self.assertEqual(api._subscription_got, self.SUB_PATH) | self.assertEqual(api._subscription_got, self.SUB_PATH) |
| | |
Python parser ACCEPTED repair!
Filtered out 47/52 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 34056ms
Tidyparse (proposed/total): 13/27
Tidyparse (accepted/proposed): 13/13
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------|----------------------------------------------------------------|
| def _bytecode_filenames(self, py_filenames): | def _bytecode_filenames(self, py_filenames): |
| bytecode_files = [] | bytecode_files = [] |
| for py_file in py_filenames: | for py_file in py_filenames: |
| ext = os.path.splitext(os.path.~normcase(py_file~)[1] | ext = os.path.splitext(os.path.**normcasepy_file**)[1] |
| if ext != PYTHON_SOURCE_EXTENSION: | if ext != PYTHON_SOURCE_EXTENSION: |
| continue | continue |
| if self.compile: | if self.compile: |
| bytecode_files.append(py_file + "c") | bytecode_files.append(py_file + "c") |
| if self.optimize > 0: | if self.optimize > 0: |
| bytecode_files.append(py_file + "o") | bytecode_files.append(py_file + "o") |
| return bytecode_files | return bytecode_files |
| | |
Python parser ACCEPTED repair!
Filtered out 54/75 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 32948ms
Tidyparse (proposed/total): 14/28
Tidyparse (accepted/proposed): 14/14
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def print_ip(ip, offset): | def print_ip(ip, offset): |
| margin = ' ' * offset | margin = ' ' * offset |
| print("%s -> %s, proto=%d, tclass=%x," %( | print("%s -> %s, proto=%d, tclass=%x," %( |
| ip.src_prefix, ip.dst_prefix, ip.proto, ip.traffic_class)) | ip.src_prefix, ip.dst_prefix, ip.proto, ip.traffic_class)) |
| print("%sttl=%d, hlen=%d, plen=%d, " %~(~ | print("%sttl=%d, hlen=%d, plen=%d, " % |
| margin, ip.ttl, ip.hdr_len, ip.pkt_len), | margin, ip.ttl, ip.hdr_len, ip.pkt_len), |
| print("mf=%s, frag_offset=%d, ident=%04x" %( | print("mf=%s, frag_offset=%d, ident=%04x" %( |
| ip.has_mf, ip.frag_offset, ip.ident)) | ip.has_mf, ip.frag_offset, ip.ident)) |
| | |
Python parser ACCEPTED repair!
Filtered out 5/5 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30293ms
Tidyparse (proposed/total): 14/29
Tidyparse (accepted/proposed): 14/14
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------|-------------------------|
| ~def remove_qjump():~ | **NO_REPAIR_PROPOSAL!** |
| ~ boxes = clients +[server]~ | |
| ~ for i in range(0, q2pc_client_count + 1):~ | |
| ~ (host, eth, ip, mac) = boxes[i]~ | |
| ~ msg = "Removing qjump and qdisc host %s (%s.%s) ..." %(host, iphead, ip)~ | |
| ~ cmds = ["sudo tc qdisc del root dev %s qjump " %(eth), "sudo rmmod sch_qjump",~ | |
| ~ cmds_str = "&& ".join(cmds)~ | |
| ~ run_remote_cmd(subs, host, cmds_str)~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 47557ms
Tidyparse (proposed/total): 15/30
Tidyparse (accepted/proposed): 15/15
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 76/90 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 30594ms
Tidyparse (proposed/total): 16/31
Tidyparse (accepted/proposed): 16/16
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|-----------------------------------------------------------------------|
| def to_lineq(d: dict): | def to_lineq(d: dict): |
| return stl.andf(*(stl.LinEq((stl.Var(1, k, stl.t_sym), ), "=", v) | return stl.andf(*(stl.LinEq((stl.Var(1, k, stl.t_sym), ), "=", v) |
| for k, v in d.items()) | for k, v in d.items()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 15/38 invalid samples!
Drew 23 samples before timeout
Synthesized repair in: 32294ms
Tidyparse (proposed/total): 17/32
Tidyparse (accepted/proposed): 17/17
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| def add_send_edit(self): | def add_send_edit(self): |
| self.send_fiat_e = AmountEdit(self.fiat_unit) | self.send_fiat_e = AmountEdit(self.fiat_unit) |
| btc_e = self.win.amount_e | btc_e = self.win.amount_e |
| fee_e = self.win.fee_e | fee_e = self.win.fee_e |
| self.connect_fields(btc_e, self.send_fiat_e, fee_e) | self.connect_fields(btc_e, self.send_fiat_e, fee_e) |
| self.win.send_grid.addWidget(self.send_fiat_e, 4, 3, Qt.AlignHCenter) | self.win.send_grid.addWidget(self.send_fiat_e, 4, 3, Qt.AlignHCenter) |
| btc_e.frozen.connect(lambda: self.send_fiat_e.setFrozen(btc_e.isReadOnly()) | btc_e.frozen.connect(lambda: self.send_fiat_e.setFrozen(btc_e.isReadOnly()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 56/64 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32880ms
Tidyparse (proposed/total): 18/33
Tidyparse (accepted/proposed): 18/18
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------|------------------------------------------|
| def __init__(self): | def __init__(self): |
| try: | try: |
| self.config() | self.config() |
| self._toc = None | self._toc = None |
| self._tracks = None | self._tracks = None |
| sys.~exit(self~.run() | sys.**exitself**.run() |
| except(EOFError, KeyboardInterrupt): | except(EOFError, KeyboardInterrupt): |
| sys.exit(114) | sys.exit(114) |
| except SystemExit as exception: | except SystemExit as exception: |
| sys.exit(exception) | sys.exit(exception) |
| | |
Python parser ACCEPTED repair!
Filtered out 132/164 invalid samples!
Drew 32 samples before timeout
Synthesized repair in: 44333ms
Tidyparse (proposed/total): 19/34
Tidyparse (accepted/proposed): 19/19
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|-----------------------------------------------------------------|
| def _check_attachment_id(self): | def _check_attachment_id(self): |
| if self.storage == 'filestore' and not self.attachment_id: | if self.storage == 'filestore' and not self.attachment_id: |
| raise exceptions.ValidationError( | raise exceptions.ValidationError( |
| _('You must provide an attachment for the image.'))~)~ | _('You must provide an attachment for the image.')) |
| | |
Python parser ACCEPTED repair!
Filtered out 90/94 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 31353ms
Tidyparse (proposed/total): 20/35
Tidyparse (accepted/proposed): 20/20
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| def get_images(self, spec, fileds = None, sorts = None, page_index = 0, page_size = 20, callback = None): | def get_images(self, spec, fileds = None, sorts = None, page_index = 0, page_size = 20, callback = None): |
| skip = page_index * page_size | skip = page_index * page_size |
| result_list = yield tornado.gen.~Task(m_image~.find(spec, fields, sorts, skip, page_size) | result_list = yield tornado.gen.**Taskm_image**.find(spec, fields, sorts, skip, page_size) |
| if not result_list or len(result_list) == 0: | if not result_list or len(result_list) == 0: |
| callback(None) | callback(None) |
| else: | else: |
| callback(result_list) | callback(result_list) |
| | |
Python parser ACCEPTED repair!
Filtered out 27/27 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 42422ms
Tidyparse (proposed/total): 20/36
Tidyparse (accepted/proposed): 20/20
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------------------------------------------|-------------------------|
| ~def destroy(self, * args):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if _debug:~ | |
| ~ print 'FigureManagerGTK.{0!s}'.format(fn_name())~ | |
| ~ self.vbox.destroy()~ | |
| ~ self.window.destroy()~ | |
| ~ self.canvas.destroy()~ | |
| ~ self.toolbar.destroy()~ | |
| ~ self.__dict__.clear()~ | |
| ~ if Gcf.get_num_fig_managers() == 0 and not matplotlib.is_interactive() and gtk.main_level() >= 1:~ | |
| ~ gtk.main_quit()~ | |
| ~~ | |
Filtered out 61/90 invalid samples!
Drew 29 samples before timeout
Synthesized repair in: 72930ms
Tidyparse (proposed/total): 21/37
Tidyparse (accepted/proposed): 21/21
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def get_footnote_backref_id(self, footnote_id): | def get_footnote_backref_id(self, footnote_id): |
| """Get the footnote back-reference ID(HTML escaped).""" | """Get the footnote back-reference ID(HTML escaped).""" |
| return ~escape_html(self~.footnote_id_html_format_backref.~format~(~footnote_id)~ | return **escape_htmlself**.footnote_id_html_format_backref.**formatfootnote_id**( |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 70/109 invalid samples!
Drew 39 samples before timeout
Synthesized repair in: 115474ms
Tidyparse (proposed/total): 22/38
Tidyparse (accepted/proposed): 22/22
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| def angle(val): | def angle(val): |
| '''calculate the pwm for requested angle''' | '''calculate the pwm for requested angle''' |
| return int(round(servo_min +~(~90.0 - val~)~ *~(~servo_max - servo_min) / 180.0~)~ | return int(round(servo_min +90.0 - val *servo_max - servo_min) / 180.0**(** |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 85/85 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30769ms
Tidyparse (proposed/total): 22/39
Tidyparse (accepted/proposed): 22/22
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~from easy_thumbnails.processors import scale_and_crop~ | **NO_REPAIR_PROPOSAL!** |
| ~def scale_and_crop_with_orientation(~ | |
| ~ im, size, crop = False, upscale = False, ** kwargs):~ | |
| ~ ''' This processor change target size for portrait-oriented pictures'''~ | |
| ~ source_x, source_y = im.size~ | |
| ~ if source_x < source_y:~ | |
| ~ vertical_size = (size[1], size[0])~ | |
| ~ return scale_and_crop(im, vertical_size, crop, upscale, ** kwargs)~ | |
| ~ return scale_and_crop(im, size, crop, upscale, ** kwargs)~ | |
| ~~ | |
Filtered out 81/81 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33367ms
Tidyparse (proposed/total): 22/40
Tidyparse (accepted/proposed): 22/22
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------------------------|-------------------------|
| ~def print_clust(clust, labels = None, n = 0):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for i in range(n): print ' ',~ | |
| ~ if clust.id < 0:~ | |
| ~ print('-')~ | |
| ~ else:~ | |
| ~ if labels == None: print clust.id~ | |
| ~ else:~ | |
| ~ print labels[clust.id]~ | |
| ~ if clust.left != None: print_clust(clust.left, labels = labels, n = n + 1)~ | |
| ~ if clust.right != None: print_clust(clust.right, labels = labels, n = n + 1)~ | |
| ~~ | |
Filtered out 72/78 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32734ms
Tidyparse (proposed/total): 23/41
Tidyparse (accepted/proposed): 23/23
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| def update_board(self, X): | def update_board(self, X): |
| N = convolve2d(X, np.ones(~(~3, 3), mode = 'same', boundary = 'wrap') - X | N = convolve2d(X, np.ones(3, 3), mode = 'same', boundary = 'wrap') - X |
| X = (N == 3) |(X &(N == 2)) | X = (N == 3) |(X &(N == 2)) |
| return X | return X |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 23/42
Tidyparse (accepted/proposed): 23/23
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def set_linestyle(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.width < 0:~ | |
| ~ self.style = pyemf.PS_NULL~ | |
| ~ else:~ | |
| ~ styles = {'solid': pyemf.PS_SOLID, 'dashed': pyemf.PS_DASH,~ | |
| ~ 'dashdot': pyemf.PS_DASHDOT, 'dotted': pyemf.PS_DOT}~ | |
| ~ style = self.gc.get_linestyle('solid')~ | |
| ~ if debugHandle:~ | |
| ~ print "EMFPen: style={0: d}".format(style)~ | |
| ~ if style in styles:~ | |
| ~ self.style = styles[style]~ | |
| ~ else:~ | |
| ~ self.style = pyemf.PS_SOLID~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 22ms
Tidyparse (proposed/total): 23/43
Tidyparse (accepted/proposed): 23/23
Original error: expected an indented block
| original | repair |
|---------------------------------------------------|-------------------------|
| ~def check_flying(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ entity = self.connection.entity~ | |
| ~ flags = entity.flags~ | |
| ~ if not(flags & GLIDER_FLAG~ | |
| ~ or is_bit_set(entity.physics_flags, 0)~ | |
| ~ or is_bit_set(entity.physics_flags, 1)~ | |
| ~ or is_bit_set(entity.physics_flags, 2)~ | |
| ~ or entity.hp <= 0):~ | |
| ~ self.air_time += self.time_since_update~ | |
| ~ if self.air_time > self.max_air_time:~ | |
| ~ self.remove_cheater('flying hack')~ | |
| ~ return False~ | |
| ~ else:~ | |
| ~ self.air_time = 0~ | |
| ~~ | |
Filtered out 35/39 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 71856ms
Tidyparse (proposed/total): 24/44
Tidyparse (accepted/proposed): 24/24
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------|-------------------------------------------------------|
| def randomGenerators(far, Nmax): | def randomGenerators(far, Nmax): |
| pradius = (1.0 / math.sqrt(2)) * far | pradius = (1.0 / math.sqrt(2)) * far |
| plist = [] | plist = [] |
| for n in range(Nmax): | for n in range(Nmax): |
| x = - pradius + 2 * pradius * random.random() | x = - pradius + 2 * pradius * random.random() |
| y = - pradius + 2 * pradius * random.random() | y = - pradius + 2 * pradius * random.random() |
| plist.~append(ovd~.Point(x, y) | plist.**appendovd**.Point(x, y) |
| return plist | return plist |
| | |
Python parser ACCEPTED repair!
Filtered out 41/63 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 32187ms
Tidyparse (proposed/total): 25/45
Tidyparse (accepted/proposed): 25/25
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------|-----------------------------------------------|
| def test_users_none_yields_empty(self): | def test_users_none_yields_empty(self): |
| result = Task.from_dict({'users': None}) | result = Task.from_dict({'users': None}) |
| self.assertIsInstance(result, Task) | self.assertIsInstance(result, Task) |
| self.assertEqual([], ~list(result~.users~)~ | self.assertEqual([], **listresult**.users |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 70/70 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30536ms
Tidyparse (proposed/total): 25/46
Tidyparse (accepted/proposed): 25/25
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~def _get_context(self, cursor = None):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """ Gets the context for the specified cursor (or the current cursor"""~ | |
| ~ if cursor is None:~ | |
| ~ cursor = self._get_cursor()~ | |
| ~ cursor.movePosition(QtGui.QTextCursor.StartOfBlock~ | |
| ~ QtGui.QTextCursor.KeepAnchor)~ | |
| ~ text = cursor.selection().toPlainText()~ | |
| ~ return self._completion_lexer.get_context(text)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 25/47
Tidyparse (accepted/proposed): 25/25
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------------------------|-------------------------|
| ~def read(self, size = None):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if size is None:~ | |
| ~ size = self.len - self.pos~ | |
| ~ if size + self.pos > self.len:~ | |
| ~ size = self.len - self.pos~ | |
| ~ txt = self.fh.read(size)~ | |
| ~ self.pos += len(txt)~ | |
| ~ if self.debug:~ | |
| ~ print "WindowReader: read %s from %d(%s)" %(size, self.pos, repr(txt))~ | |
| ~ return txt~ | |
| ~~ | |
Filtered out 33/37 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 39004ms
Tidyparse (proposed/total): 26/48
Tidyparse (accepted/proposed): 26/26
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|------------------------------------------------------------------|
| def print_inverted_index(self): | def print_inverted_index(self): |
| for term_id in self.iindex: | for term_id in self.iindex: |
| print(u'{0} = ('.~format(self~.data.get_term(term_id)), | print(u'{0} = ('.**formatself**.data.get_term(term_id)), |
| for doc_id in self.iindex[term_id]: | for doc_id in self.iindex[term_id]: |
| print(u'{0}'.format(doc_id), ) | print(u'{0}'.format(doc_id), ) |
| print(')') | print(')') |
| | |
Python parser ACCEPTED repair!
Filtered out 193/193 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 53459ms
Tidyparse (proposed/total): 26/49
Tidyparse (accepted/proposed): 26/26
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------|-------------------------|
| ~def file_copy(srcfile, destfile):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(verbose): print "Copy " + srcfile + " -> " + destfile~ | |
| ~ shutil.copyfile(srcfile, destfile)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 26ms
Tidyparse (proposed/total): 26/50
Tidyparse (accepted/proposed): 26/26
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~def movedown(self, W):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.y < 29:~ | |
| ~ if self.checkWall(self.x, self.y + 1, W):~ | |
| ~ self.y = self.y~ | |
| ~ else:~ | |
| ~ self.y = (self.y) + 1~ | |
| ~ return self~ | |
| ~~ | |
Filtered out 39/54 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 31164ms
Tidyparse (proposed/total): 27/51
Tidyparse (accepted/proposed): 27/27
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def main(package, version, news_path): | def main(package, version, news_path): |
| release_name, details = extract_description(package, version, news_path) | release_name, details = extract_description(package, version, news_path) |
| print("""%(release_name)s""".strip().rstrip() %{ | print("""%(release_name)s""".strip().rstrip() %{ |
| 'base_url': BASE_URL, | 'base_url': BASE_URL, |
| 'git_url': GIT_URL, | 'git_url': GIT_URL, |
| 'package': package, | 'package': package, |
| 'version': version, | 'version': version, |
| 'release_name': release_name, | 'release_name': release_name, |
| 'details': details, | 'details': details, |
| } | }**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 85/91 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32244ms
Tidyparse (proposed/total): 28/52
Tidyparse (accepted/proposed): 28/28
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|------------------------------------------------------------|
| def wavLen(fname): | def wavLen(fname): |
| with contextlib.closing(wave.~open(fname~, 'r') as f: | with contextlib.closing(wave.**openfname**, 'r') as f: |
| frames = f.getnframes() | frames = f.getnframes() |
| rate = f.getframerate() | rate = f.getframerate() |
| duration = frames / float(rate) | duration = frames / float(rate) |
| return int(duration * 1000) | return int(duration * 1000) |
| | |
Python parser ACCEPTED repair!
Filtered out 23/38 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 31211ms
Tidyparse (proposed/total): 29/53
Tidyparse (accepted/proposed): 29/29
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------|--------------------------------------------|
| def DriveLettersFromMask(mask): | def DriveLettersFromMask(mask): |
| return[ | return[ |
| chr(65 + driveNum) | chr(65 + driveNum) |
| for driveNum in range(0, 26) | for driveNum in range(0, 26) |
| if(mask ~&(2~ ** driveNum~)~ | if(mask **&2** ** driveNum |
| | ** )** |
| ] | ] |
| ~~ | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 19ms
Tidyparse (proposed/total): 29/54
Tidyparse (accepted/proposed): 29/29
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~def serviceInterruptRain(self, channel):~ | **NO_REPAIR_PROPOSAL!** |
| ~ currentTime = (micros() - SDL_Pi_Weather_80422._lastRainTime);~ | |
| ~ SDL_Pi_Weather_80422._lastRainTime = micros();~ | |
| ~ if(currentTime > 500):~ | |
| ~ SDL_Pi_Weather_80422._currentRainCount = SDL_Pi_Weather_80422._currentRainCount + 1~ | |
| ~ if(currentTime < SDL_Pi_Weather_80422._currentRainMin):~ | |
| ~ SDL_Pi_Weather_80422._currentRainMin = currentTime;~ | |
| ~~ | |
Filtered out 136/136 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 181170ms
Tidyparse (proposed/total): 29/55
Tidyparse (accepted/proposed): 29/29
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|-------------------------|
| ~def marsmap(whichone = "vishires"):~ | **NO_REPAIR_PROPOSAL!** |
| ~ from os import uname~ | |
| ~ mymachine = uname()[1]~ | |
| ~ if "lmd.jussieu.fr" in mymachine: domain = "/u/aslmd/WWW/maps/"~ | |
| ~ elif "aymeric-laptop" in mymachine: domain = "/home/aymeric/Dropbox/Public/"~ | |
| ~ else: domain = "http://www.lmd.jussieu.fr/~aslmd/maps/"~ | |
| ~ whichlink = {~ | |
| ~ if whichone not in whichlink:~ | |
| ~ print("marsmap: choice not defined... you'll get the default one... ")~ | |
| ~ whichone = "vishires"~ | |
| ~ return whichlink[whichone]~ | |
| ~~ | |
Filtered out 23/26 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 30525ms
Tidyparse (proposed/total): 30/56
Tidyparse (accepted/proposed): 30/30
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def _ExtractPragmas(self, input_line, input_lines, output_stream): | def _ExtractPragmas(self, input_line, input_lines, output_stream): |
| """Extracts pragmas from a given input.""" | """Extracts pragmas from a given input.""" |
| for line in input_lines[input_line - 1: ]: | for line in input_lines[input_line - 1: ]: |
| pragma_match = constants.PRAGMA_RE.match(line) | pragma_match = constants.PRAGMA_RE.match(line) |
| if not pragma_match: | if not pragma_match: |
| break | break |
| pragma_type, pragma_value = pragma_match.groups() | pragma_type, pragma_value = pragma_match.groups() |
| self._pragma_handler.HandlePragma( | self._pragma_handler.HandlePragma( |
| input_line, | input_line, |
| output_stream, | output_stream, |
| pragma_type.strip(), | pragma_type.strip(), |
| pragma_value.strip~(~) | pragma_value.strip) |
| input_line += 1 | input_line += 1 |
| return input_line | return input_line |
| | |
Python parser ACCEPTED repair!
Filtered out 99/102 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 30115ms
Tidyparse (proposed/total): 31/57
Tidyparse (accepted/proposed): 31/31
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------|----------------------------------------------------|
| def _match_variables(self, ingoing, outgoing): | def _match_variables(self, ingoing, outgoing): |
| match_list = [] | match_list = [] |
| for in_var in ingoing.inputs: | for in_var in ingoing.inputs: |
| for out_var in outgoing.outputs: | for out_var in outgoing.outputs: |
| if in_var.binding == out_var.binding: | if in_var.binding == out_var.binding: |
| match_list.append(~(~in_var, out_var) | match_list.append(in_var, out_var) |
| return match_list | return match_list |
| | |
Python parser ACCEPTED repair!
Filtered out 68/113 invalid samples!
Drew 45 samples before timeout
Synthesized repair in: 74520ms
Tidyparse (proposed/total): 32/58
Tidyparse (accepted/proposed): 32/32
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------|------------------------------------------|
| def test_connection(self): | def test_connection(self): |
| engine = self._connect() | engine = self._connect() |
| list(engine.connection.list_tables()~))~ | list(engine.connection.list_tables() |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 21/45 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 31128ms
Tidyparse (proposed/total): 33/59
Tidyparse (accepted/proposed): 33/33
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|-----------------------------------------------------------|
| def test_contains(self): | def test_contains(self): |
| item = SaleItem(['10', '1', 'TestItem3']) | item = SaleItem(['10', '1', 'TestItem3']) |
| self.theBasket.addItem((1, item)) | self.theBasket.addItem((1, item)) |
| self.assertTrue(self.theBasket.contains(item.getID()) | self.assertTrue(self.theBasket.contains(item.getID()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 91/95 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 31320ms
Tidyparse (proposed/total): 34/60
Tidyparse (accepted/proposed): 34/34
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|----------------------------------------------------------------------|
| def repo_hooks(): | def repo_hooks(): |
| global hook_list | global hook_list |
| if hook_list is None: | if hook_list is None: |
| d = os.path.abspath(os.path.~dirname(__file__~) | d = os.path.abspath(os.path.**dirname__file__**) |
| d = os.path.join(d, 'hooks') | d = os.path.join(d, 'hooks') |
| hook_list = map(lambda x: os.path.join(d, x), os.listdir(d)) | hook_list = map(lambda x: os.path.join(d, x), os.listdir(d)) |
| return hook_list | return hook_list |
| | |
Python parser ACCEPTED repair!
Filtered out 28/28 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 40730ms
Tidyparse (proposed/total): 34/61
Tidyparse (accepted/proposed): 34/34
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------|-------------------------|
| ~from rauth import OAuth2Service~ | **NO_REPAIR_PROPOSAL!** |
| ~import json~ | |
| ~nation_slug = "fakenation"~ | |
| ~access_token_url = "http://" + nation_slug + ".nationbuilder.com/oauth/token"~ | |
| ~authorize_url = nation_slug + ".nationbuilder.com/oauth/authorize"~ | |
| ~service = OAuth2Service(~ | |
| ~ client_id = "c2803fd687f856ce94a55b7f66121c79b75bf7283c467c855e82d53af07074e9",~ | |
| ~ client_secret = "0d133e9f2b24ab3b897b4a9a216a1a8391a67b96805eb9a3c9305c0f7ac0e411",~ | |
| ~ name = "anyname",~ | |
| ~ authorize_url = authorize_url,~ | |
| ~ access_token_url = access_token_url,~ | |
| ~ base_url = nation_slug + ".nationbuilder.com")~ | |
| ~token = "3b25a115de6b9581f567c1eba47148223203a1825c35c03df5c0b7d046e30455"~ | |
| ~session = service.get_session(token)~ | |
| ~response = session.get("https://" + nation_slug + ".nationbuilder.com/api/v1/people",~ | |
| ~ params = {'format': 'json'},~ | |
| ~ headers = {'content-type': 'application/json'})~ | |
| ~person = {'first_name' =~ | |
| ~response = session.post("https://" + nation_slug + ".nationbuilder.com/api/v1/people",~ | |
| ~ params = {'format': 'json'}, data = json.dumps({'person': {'first_name': 'john', 'last_name': 'doe'}}),~ | |
| ~ headers = {'content-type': 'application/json'})~ | |
| ~~ | |
Filtered out 111/115 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 64177ms
Tidyparse (proposed/total): 35/62
Tidyparse (accepted/proposed): 35/35
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------|-----------------------------------------------|
| def read_cards(): | def read_cards(): |
| n = int(raw_input~(~) | n = int(raw_input) |
| for i in xrange(n): | for i in xrange(n): |
| data = raw_input().strip().split(" ") | data = raw_input().strip().split(" ") |
| card = Card(data) | card = Card(data) |
| deck.append(card) | deck.append(card) |
| return n | return n |
| | |
Python parser ACCEPTED repair!
Filtered out 89/89 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31946ms
Tidyparse (proposed/total): 35/63
Tidyparse (accepted/proposed): 35/35
Original error: unexpected indent
| original | repair |
|---------------------------------------------------------------------------|-------------------------|
| ~def after_run(self, run_context, run_values):~ | **NO_REPAIR_PROPOSAL!** |
| ~ num_attempted_trees = run_values.results["num_attempted_trees"]~ | |
| ~ num_finalized_trees = run_values.results["num_finalized_trees"]~ | |
| ~ assert num_attempted_trees is not None~ | |
| ~ assert num_finalized_trees is not None~ | |
| ~ if(num_finalized_trees >= self._num_trees or~ | |
| ~ num_attempted_trees > 2 * self._num_trees):~ | |
| ~ logging.info("Requesting stop since we have reached %d trees.",~ | |
| ~ num_finalized_trees)~ | |
| ~ run_context.request_stop()~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 31ms
Tidyparse (proposed/total): 35/64
Tidyparse (accepted/proposed): 35/35
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def NumeroSection(Section):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if debugLevel > 1:~ | |
| ~ print u' NumeroSection()'~ | |
| ~ s = 0~ | |
| ~ while s < len(Sections) and Section != Sections[s]:~ | |
| ~ s = s + 1~ | |
| ~ if s >= len(Sections):~ | |
| ~ if debugLevel > 0: print u' "' + Section + u'" non trouvé'~ | |
| ~ if debugLevel > 1:~ | |
| ~ print u' ' + Section + u' = ' + str(s)~ | |
| ~ return s~ | |
| ~~ | |
Filtered out 1/1 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 38213ms
Tidyparse (proposed/total): 35/65
Tidyparse (accepted/proposed): 35/35
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def test_ToSSCC18(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("***==== Test SSCC18 ====***"~ | |
| ~ sscc96 = self._sscc96.encode(self._companyPrefix, self._extensionDigit, self._serialRef, self._filter)~ | |
| ~ print(sscc96.toSSCC18())~ | |
| ~ print("***==== END To SSCC18 ====***"~ | |
| ~ print(""~ | |
| ~~ | |
Filtered out 37/41 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 34745ms
Tidyparse (proposed/total): 36/66
Tidyparse (accepted/proposed): 36/36
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------|-----------------------------------------|
| def stem_word_process(): | def stem_word_process(): |
| def stem_word(word): | def stem_word(word): |
| return STEMMER.stem(word.lower~(~) | return STEMMER.stem(word.lower) |
| return stem_word | return stem_word |
| | |
Python parser ACCEPTED repair!
Filtered out 59/63 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 49365ms
Tidyparse (proposed/total): 37/67
Tidyparse (accepted/proposed): 37/37
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def normalizeKey(self, key): | def normalizeKey(self, key): |
| """Returns String""" | """Returns String""" |
| if key == None: | if key == None: |
| LOG.error("Key can't be null") | LOG.error("Key can't be null") |
| raise IllegalArgumentException("Key can't be null") | raise IllegalArgumentException("Key can't be null") |
| while(key.startsWith("/"): | while(key.startsWith**)**("/"): |
| key = key.substring(1) | key = key.substring(1) |
| return "/" + key | return "/" + key |
| | |
Python parser ACCEPTED repair!
Filtered out 86/94 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32817ms
Tidyparse (proposed/total): 38/68
Tidyparse (accepted/proposed): 38/38
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|--------------------------------------------------------------------------|
| def flaky(bugNumber): | def flaky(bugNumber): |
| def wrap(fn): | def wrap(fn): |
| if not os.environ.get(_FLAKY_ENV_VAR): | if not os.environ.get(_FLAKY_ENV_VAR): |
| fn.skip = ("Flaky test(http: //trac.buildbot.net/ticket/%d)" | fn.skip = ("Flaky test(http: //trac.buildbot.net/ticket/%d)" |
| "- set $%s to run anyway" %(bugNumber, _FLAKY_ENV_VAR))~)~ | "- set $%s to run anyway" %(bugNumber, _FLAKY_ENV_VAR)) |
| return fn | return fn |
| return wrap | return wrap |
| | |
Python parser ACCEPTED repair!
Filtered out 16/31 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 33460ms
Tidyparse (proposed/total): 39/69
Tidyparse (accepted/proposed): 39/39
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------|---------------------------------------------|
| class Wall(pygame.sprite.DirtySprite): | class Wall(pygame.sprite.DirtySprite): |
| def __init__(self, x, y, h, w): | def __init__(self, x, y, h, w): |
| super(Wall, self).__init__() | super(Wall, self).__init__() |
| self.rect = pygame.Rect(x, y, h, w) | self.rect = pygame.Rect(x, y, h, w) |
| self.image = pygame.Surface(~(~h, w~)~ | self.image = pygame.Surface(h, w |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 14/21 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 32383ms
Tidyparse (proposed/total): 40/70
Tidyparse (accepted/proposed): 40/40
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------|---------------------------------|
| def create_dict_state(self): | def create_dict_state(self): |
| self.dStates = { | self.dStates = { |
| 0: [0, "BATTERY_DEAD"], | 0: [0, "BATTERY_DEAD"], |
| 1: [10, "VERY_LOW_CHARGE"], | 1: [10, "VERY_LOW_CHARGE"], |
| 2: [25, "LOW_CHARGE"], | 2: [25, "LOW_CHARGE"], |
| 3: [50, "HALF_CHARGE"], | 3: [50, "HALF_CHARGE"], |
| 4: [75, "HIGH_CHARGE"], | 4: [75, "HIGH_CHARGE"], |
| 5: [95, "FULL_CHARGE"] | 5: [95, "FULL_CHARGE"]**}** |
| | |
Python parser ACCEPTED repair!
Filtered out 13/13 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 40482ms
Tidyparse (proposed/total): 40/71
Tidyparse (accepted/proposed): 40/40
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|-------------------------|
| ~def shorturl_prep_worker(itertweets, shorturlq):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Take each tuple from the iterurls iterator."""~ | |
| ~ for tweet in itertweets:~ | |
| ~ tweet_id = tweet.get('_id')~ | |
| ~ for u in tweet['twitter_entities']['urls']:~ | |
| ~ if 'expanded_url' in u:~ | |
| ~ shorturlq.put((tweet_id, u['expanded_url']))~ | |
| ~ shorturlq.put((~ | |
| ~ for(url_id, shorturl) in iterurls:~ | |
| ~ shorturlq.put((url_id, shorturl))~ | |
| ~ print(u'Done reading URLs from source.')~ | |
| ~~ | |
Filtered out 160/160 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 116206ms
Tidyparse (proposed/total): 40/72
Tidyparse (accepted/proposed): 40/40
Original error: invalid syntax
...
Filtered out 57/63 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30388ms
Tidyparse (proposed/total): 41/73
Tidyparse (accepted/proposed): 41/41
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|-------------------------------------------------------------|
| def ssh(self, comando): | def ssh(self, comando): |
| ssh = paramiko.SSHClient() | ssh = paramiko.SSHClient() |
| ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy~(~) | ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy) |
| ssh.connect(self.nombre, username = 'root') | ssh.connect(self.nombre, username = 'root') |
| stdin, stdout, stderr = ssh.exec_command(comando) | stdin, stdout, stderr = ssh.exec_command(comando) |
| return stdout.read() | return stdout.read() |
| | |
Python parser ACCEPTED repair!
Filtered out 209/209 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 59999ms
Tidyparse (proposed/total): 41/74
Tidyparse (accepted/proposed): 41/41
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~<< << << < HEAD~ | **NO_REPAIR_PROPOSAL!** |
| ~== == == =~ | |
| ~>> >> >> > a41cc069c865a5d0f35d0731f92c547467395b1b~ | |
| ~from __future__ import unicode_literals, division, print_function~ | |
| ~import os~ | |
| ~import tempfile~ | |
| ~import shutil~ | |
| ~from pymatgen.util.testing import PymatgenTest~ | |
| ~from monty.functools import lazy_property~ | |
| ~from pymatgen.core.lattice import Lattice~ | |
| ~from pymatgen.core.structure import Structure~ | |
| ~from pymatgen.io.abinit import *~ | |
| ~from pymatgen.io.abinit.flows import *~ | |
| ~from pymatgen.io.abinit.works import *~ | |
| ~from pymatgen.io.abinit.tasks import *~ | |
| ~from pymatgen.io.abinit.pseudos import Pseudo~ | |
| ~<< << << < HEAD~ | |
| ~_test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..",~ | |
| ~== == == =~ | |
| ~_test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..",~ | |
| ~>> >> >> > a41cc069c865a5d0f35d0731f92c547467395b1b~ | |
| ~ 'test_files', "abinit")~ | |
| ~~ | |
Filtered out 24/24 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33581ms
Tidyparse (proposed/total): 41/75
Tidyparse (accepted/proposed): 41/41
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~def test_ToRawUri(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("***==== Test To Raw Uri Value ====***"~ | |
| ~ epc = self._giai96.encode(self._companyPrefix, None, self._itemRef, self._filter, None)~ | |
| ~ print(epc.toEPCRawUri())~ | |
| ~ print("***==== END Test To EPC Tag Uri Value ====***"~ | |
| ~ print(""~ | |
| ~~ | |
Filtered out 17/21 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 31284ms
Tidyparse (proposed/total): 42/76
Tidyparse (accepted/proposed): 42/42
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def test_render_diffs_batch(self): | def test_render_diffs_batch(self): |
| """test a full render in batch mode including indentation""" | """test a full render in batch mode including indentation""" |
| template_args = {} | template_args = {} |
| self.context.opts['render_as_batch'] = True | self.context.opts['render_as_batch'] = True |
| autogenerate._render_migration_diffs(self.context, template_args) | autogenerate._render_migration_diffs(self.context, template_args) |
| eq_(re.sub(r"u'", "'", template_args['upgrades']), | eq_(re.sub(r"u'", "'", template_args['upgrades']), |
| """### commands auto generated by Alembic - please adjust! ###""" | """### commands auto generated by Alembic - please adjust! ###""" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 33522ms
Tidyparse (proposed/total): 43/77
Tidyparse (accepted/proposed): 43/43
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| class Ui_preferences(object): | class Ui_preferences(object): |
| def setupUi(self, preferences): | def setupUi(self, preferences): |
| preferences.setObjectName("preferences") | preferences.setObjectName("preferences") |
| preferences.setWindowModality(QtCore.Qt.ApplicationModal) | preferences.setWindowModality(QtCore.Qt.ApplicationModal) |
| preferences.resize(340, 497) | preferences.resize(340, 497) |
| preferences.setStyleSheet("QDialog~{~\n" | preferences.setStyleSheet("QDialog\n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 15/26 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 30614ms
Tidyparse (proposed/total): 44/78
Tidyparse (accepted/proposed): 44/44
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def save_model(classifier): | def save_model(classifier): |
| """Saves the previously saved model to a file for later use""" | """Saves the previously saved model to a file for later use""" |
| if not os.path.exists('model/'): | if not os.path.exists('model/'): |
| os.mkdir('model') | os.mkdir('model') |
| filename = 'model/classifier.pkl' | filename = 'model/classifier.pkl' |
| with open(filename, 'wb') as fp: | with open(filename, 'wb') as fp: |
| cPickle.dump(classifier, fp) | cPickle.dump(classifier, fp) |
| print('Model save in Location{0}'.~format(filename~) | print('Model save in Location{0}'.**formatfilename**) |
| | |
Python parser ACCEPTED repair!
Filtered out 31/31 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 45305ms
Tidyparse (proposed/total): 44/79
Tidyparse (accepted/proposed): 44/44
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------|-------------------------|
| ~import numpy as np~ | **NO_REPAIR_PROPOSAL!** |
| ~m = np.array([[1, 2, 3], [3, 4, 5]]])~ | |
| ~print(m)~ | |
| ~"""<[[1 2 3]"""~ | |
| ~~ | |
Filtered out 136/217 invalid samples!
Drew 81 samples before timeout
Synthesized repair in: 50302ms
Tidyparse (proposed/total): 45/80
Tidyparse (accepted/proposed): 45/45
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------|-----------------------------------------------------|
| def run(): | def run(): |
| runner = unittest.TextTestRunner(verbosity = 2) | runner = unittest.TextTestRunner(verbosity = 2) |
| runner.run(suite~()~ | runner.run(suite |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 88/99 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 35755ms
Tidyparse (proposed/total): 46/81
Tidyparse (accepted/proposed): 46/46
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------|------------------------------------------|
| def items(self): | def items(self): |
| L = [] | L = [] |
| for key, value in self.data.items(): | for key, value in self.data.items(): |
| o = key() | o = key() |
| if o is not None: | if o is not None: |
| L.append(~(~o, value) | L.append(o, value) |
| return L | return L |
| | |
Python parser ACCEPTED repair!
Filtered out 100/100 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31387ms
Tidyparse (proposed/total): 46/82
Tidyparse (accepted/proposed): 46/46
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------------------------------|-------------------------|
| ~def __init__(self, local_endpoint, autobind = True, timeout = 0.5, bind_single = False, debug = 0):~ | **NO_REPAIR_PROPOSAL!** |
| ~ super(PacketSocket, self).__init__(socket.AF_INET, socket.SOCK_DGRAM)~ | |
| ~ self.debug = debug~ | |
| ~ self.local_endpoint = local_endpoint~ | |
| ~ self.recvfrom_timeout = timeout~ | |
| ~ self.settimeout(self.recvfrom_timeout)~ | |
| ~ self.bbind_single = bind_single~ | |
| ~ self.autobind = autobind~ | |
| ~ if self.debug > 0:~ | |
| ~ print "Set socket timeout to %s" %(self.recvfrom_timeout)~ | |
| ~ if self.autobind:~ | |
| ~ self.packet_bind()~ | |
| ~~ | |
Filtered out 41/41 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 43751ms
Tidyparse (proposed/total): 46/83
Tidyparse (accepted/proposed): 46/46
Original error: expected an indented block
| original | repair |
|--------------------------------|-------------------------|
| ~def bfs(dp):~ | **NO_REPAIR_PROPOSAL!** |
| ~ global queue~ | |
| ~ queue = deque([(0, 0)])~ | |
| ~ dp[0][0] = a[0][0]~ | |
| ~ while len(queue) > 0:~ | |
| ~ (i, j) = queue.popleft()~ | |
| ~ f(i, j, dp)~ | |
| ~~ | |
Filtered out 78/92 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 30697ms
Tidyparse (proposed/total): 47/84
Tidyparse (accepted/proposed): 47/47
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|-----------------------------------------------------------------------|
| def computeNRMSE(truth, prediction, startFrom = 0): | def computeNRMSE(truth, prediction, startFrom = 0): |
| squareDeviation = computeSquareDeviation(prediction, truth) | squareDeviation = computeSquareDeviation(prediction, truth) |
| squareDeviation[: startFrom] = None | squareDeviation[: startFrom] = None |
| return np.sqrt(np.nanmean(squareDeviation))~)~ / np.~nanstd~(~truth)~ | return np.sqrt(np.nanmean(squareDeviation)) / np.**nanstdtruth**( |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 54/75 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 39153ms
Tidyparse (proposed/total): 48/85
Tidyparse (accepted/proposed): 48/48
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def schrijf(self): | def schrijf(self): |
| first = True | first = True |
| for waarde in self._waarde: | for waarde in self._waarde: |
| if first: | if first: |
| print("- %-27s: %s" %(self.naam(), waarde)) | print("- %-27s: %s" %(self.naam(), waarde)) |
| first = False | first = False |
| else: | else: |
| print("- %-27s %s" ~%(""~, waarde) | print("- %-27s %s" **%""**, waarde) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 24ms
Tidyparse (proposed/total): 48/86
Tidyparse (accepted/proposed): 48/48
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------------|-------------------------|
| ~def _get_min_dep_path(sentence, span1, span2):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Return the shortest dependency path between two Span objects"""~ | |
| ~ min_path = None~ | |
| ~ min_path_length = 200~ | |
| ~ for i in range(span1.begin_word_id, span1.begin_word_id + span1.length):~ | |
| ~ for j in range(~ | |
| ~ span2.begin_word_id, span2.begin_word_id + span2.length):~ | |
| ~ p = dep_path_between_words(sentence, i, j)~ | |
| ~ if len(p) < min_path_length:~ | |
| ~ min_path = p~ | |
| ~ return min_path~ | |
| ~~ | |
Filtered out 76/82 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32873ms
Tidyparse (proposed/total): 49/87
Tidyparse (accepted/proposed): 49/49
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| def clone_index(self, new_indexname, index_conf = None): | def clone_index(self, new_indexname, index_conf = None): |
| '''Clone current index''' | '''Clone current index''' |
| log.debug("Cloning index '{}' into '{}'".~format(self~.index_name, new_indexname) | log.debug("Cloning index '{}' into '{}'".**formatself**.index_name, new_indexname) |
| self.create_index(indexname = new_indexname, index_conf = index_conf) | self.create_index(indexname = new_indexname, index_conf = index_conf) |
| reindex(self.es, self.index_name, new_indexname) | reindex(self.es, self.index_name, new_indexname) |
| | |
Python parser ACCEPTED repair!
Filtered out 70/78 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32376ms
Tidyparse (proposed/total): 50/88
Tidyparse (accepted/proposed): 50/50
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|--------------------------------------------------------------|
| def __init__(self, ** kw): | def __init__(self, ** kw): |
| obj = kw["obj"] | obj = kw["obj"] |
| kw.setdefault("manager", self.parent) | kw.setdefault("manager", self.parent) |
| kw.setdefault("hidden", ~getattr(obj~, "hidden", False) | kw.setdefault("hidden", **getattrobj**, "hidden", False) |
| self.__super.__init__(** kw) | self.__super.__init__(** kw) |
| | |
Python parser ACCEPTED repair!
Filtered out 88/92 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32872ms
Tidyparse (proposed/total): 51/89
Tidyparse (accepted/proposed): 51/51
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|--------------------------------------------------------------|
| def undirected_arcs(bn_structure): | def undirected_arcs(bn_structure): |
| arcs = np.array(bnlearn.~undirected_arcs(bn_structure~) | arcs = np.array(bnlearn.**undirected_arcsbn_structure**) |
| ncols = 2 | ncols = 2 |
| nrows = len(arcs) / 2 | nrows = len(arcs) / 2 |
| arcs = arcs.reshape(nrows, ncols, order = 'F') | arcs = arcs.reshape(nrows, ncols, order = 'F') |
| return arcs | return arcs |
| | |
Python parser ACCEPTED repair!
Filtered out 15/19 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 33720ms
Tidyparse (proposed/total): 52/90
Tidyparse (accepted/proposed): 52/52
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| def backwards(self, orm): | def backwards(self, orm): |
| db.delete_column(u'tango_in_blood_app_profile', 'signature') | db.delete_column(u'tango_in_blood_app_profile', 'signature') |
| db.delete_column(u'tango_in_blood_app_profile', 'signature_html') | db.delete_column(u'tango_in_blood_app_profile', 'signature_html') |
| db.delete_column(u'tango_in_blood_app_profile', 'time_zone') | db.delete_column(u'tango_in_blood_app_profile', 'time_zone') |
| db.delete_column(u'tango_in_blood_app_profile', 'language') | db.delete_column(u'tango_in_blood_app_profile', 'language') |
| db.delete_column(u'tango_in_blood_app_profile', 'show_signatures') | db.delete_column(u'tango_in_blood_app_profile', 'show_signatures') |
| db.delete_column(u'tango_in_blood_app_profile', 'post_count') | db.delete_column(u'tango_in_blood_app_profile', 'post_count') |
| db.delete_column(u'tango_in_blood_app_profile', 'autosubscribe') | db.delete_column(u'tango_in_blood_app_profile', 'autosubscribe') |
| db.alter_column(u'tango_in_blood_app_profile', 'avatar', self.gf('django.db.models.fields.URLField')(default = '', max_length = 200) | db.alter_column(u'tango_in_blood_app_profile', 'avatar', self.gf('django.db.models.fields.URLField')(default = '', max_length = 200)**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 147/235 invalid samples!
Drew 88 samples before timeout
Synthesized repair in: 44407ms
Tidyparse (proposed/total): 53/91
Tidyparse (accepted/proposed): 53/53
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def _Exit(self, exc): | def _Exit(self, exc): |
| """This method exists so we can mock this out during testing to not exit.""" | """This method exists so we can mock this out during testing to not exit.""" |
| sys.exit(getattr(exc, 'exit_code', 1))~)~ | sys.exit(getattr(exc, 'exit_code', 1)) |
| | |
Python parser ACCEPTED repair!
Filtered out 42/44 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30729ms
Tidyparse (proposed/total): 54/92
Tidyparse (accepted/proposed): 54/54
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| """Example of using a Management Policy to delete all files with a particular xattr.""" | """Example of using a Management Policy to delete all files with a particular xattr.""" |
| from arcapix.fs.gpfs import ManagementPolicy, DeleteRule | from arcapix.fs.gpfs import ManagementPolicy, DeleteRule |
| p = ManagementPolicy() | p = ManagementPolicy() |
| r = p.rules.new(DeleteRule) | r = p.rules.new(DeleteRule) |
| r.change(directories_plus = True) | r.change(directories_plus = True) |
| r.criteria.new("xattr('user.projectstate.archivedEXAMPLE') IS NOT NULL")) | r.criteria.new(**(**"xattr('user.projectstate.archivedEXAMPLE') IS NOT NULL")) |
| p.run('mmfs1') | p.run('mmfs1') |
| | |
Python parser ACCEPTED repair!
Filtered out 147/153 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 68897ms
Tidyparse (proposed/total): 55/93
Tidyparse (accepted/proposed): 55/55
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|----------------------------------------------------------------|
| def write_to_file(username): | def write_to_file(username): |
| with open("tech-company-founders-list-new.txt", 'a') as f: | with open("tech-company-founders-list-new.txt", 'a') as f: |
| f.~write~(~username}~ ","~)~ | f.**writeusername**(**{** ","**}** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 47/47 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30936ms
Tidyparse (proposed/total): 55/94
Tidyparse (accepted/proposed): 55/55
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~import os~ | **NO_REPAIR_PROPOSAL!** |
| ~try:~ | |
| ~ from setuptools import setup~ | |
| ~except ImportError:~ | |
| ~ from distutils.core import setup~ | |
| ~ver_file = os.path.join('shablona', 'version.py')~ | |
| ~with open(ver_file) as f:~ | |
| ~ exec(f.read())~ | |
| ~opts = dict(name = NAME,~ | |
| ~ description = "Example of making packages and how to install them"~ | |
| ~ packages = ["makingpackages", "makingpackages/tests"]~ | |
| ~if __name__ == '__main__':~ | |
| ~ setup(** opts)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 59ms
Tidyparse (proposed/total): 55/95
Tidyparse (accepted/proposed): 55/55
Original error: unexpected indent
| original | repair |
|----------------------------------------------|-------------------------|
| ~def normpath(mypath):~ | **NO_REPAIR_PROPOSAL!** |
| ~ TrailingSlash = False~ | |
| ~ if mypath[- 1] == "/":~ | |
| ~ TrailingSlash = True~ | |
| ~ newpath = os.path.normpath(mypath)~ | |
| ~ if len(newpath) > 1:~ | |
| ~ if newpath[: 2] == "//":~ | |
| ~ newpath = newpath[1: ]~ | |
| ~ if TrailingSlash:~ | |
| ~ newpath = newpath + '/'~ | |
| ~ return newpath~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 80ms
Tidyparse (proposed/total): 55/96
Tidyparse (accepted/proposed): 55/55
Original error: invalid syntax
| original | repair |
|-----------------------------------------------|-------------------------|
| ~class Logging:~ | **NO_REPAIR_PROPOSAL!** |
| ~ """A super-simple logging class"""~ | |
| ~ def error(self, msg):~ | |
| ~ print "ERROR: ", msg~ | |
| ~ def warn(self, msg):~ | |
| ~ print "WARNING: ", msg~ | |
| ~ def info(self, msg): print msg~ | |
| ~ def debug(self, msg): self.vlog(1, msg)~ | |
| ~ def vlog(self, level, msg):~ | |
| ~ if FLAGS.v >= level: print msg~ | |
| ~~ | |
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 66575ms
Tidyparse (proposed/total): 55/97
Tidyparse (accepted/proposed): 55/55
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|-------------------------|
| ~def __repr__(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ entries_str = '%s' % list(islice(self.entries, 2))~ | |
| ~ if len(self.entries) > 2:~ | |
| ~ entries_str = entries_str[: - 1] + ', ...]'~ | |
| ~ return "%s(parent_node: %s, parent_entry: %s, entries:%s)" %(~ | |
| ~ self.__class__.__name__,~ | |
| ~ self.parent_node.repr_class() if self.parent_node else self.parent_node,~ | |
| ~ self.parent_entry,~ | |
| ~ entries_str~ | |
| ~~ | |
Filtered out 19/24 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 51236ms
Tidyparse (proposed/total): 56/98
Tidyparse (accepted/proposed): 56/56
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|-----------------------------------------------------------|
| def getQuote(): | def getQuote(): |
| aquote = '{0}--Mos Def'.format( | aquote = '{0}--Mos Def'.format( |
| quotes[random.randint(0, len(quotes) - 1)].strip~(~) | quotes[random.randint(0, len(quotes) - 1)].strip) |
| return aquote | return aquote |
| | |
Python parser ACCEPTED repair!
Filtered out 41/79 invalid samples!
Drew 38 samples before timeout
Synthesized repair in: 32068ms
Tidyparse (proposed/total): 57/99
Tidyparse (accepted/proposed): 57/57
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| def run_playbook(self, o, fields, template_name = None): | def run_playbook(self, o, fields, template_name = None): |
| if not template_name: | if not template_name: |
| template_name = self.template_name | template_name = self.template_name |
| tStart = time.time() | tStart = time.time() |
| run_template_ssh(template_name, fields, path = "container") | run_template_ssh(template_name, fields, path = "container") |
| logger.info("playbook execution time %d" % int(time.time() - tStart, extra = o.tologdict~(~)) | logger.info("playbook execution time %d" % int(time.time() - tStart, extra = o.tologdict)) |
| | |
Python parser ACCEPTED repair!
Filtered out 9/21 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 30854ms
Tidyparse (proposed/total): 58/100
Tidyparse (accepted/proposed): 58/58
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def main(): | def main(): |
| totality_courses = pickle.load(open("c.p", "rb")) | totality_courses = pickle.load(open("c.p", "rb")) |
| for i in range(len(totality_courses)): | for i in range(len(totality_courses)): |
| totality_courses[i].id = "FA2013-" + str(i) | totality_courses[i].id = "FA2013-" + str(i) |
| print(json.dumps(totality_courses[i].to_JSON(), sort_keys = True, | print(json.dumps(totality_courses[i].to_JSON(), sort_keys = True, |
| indent = 4, separators = (',', ': ')) + ',' | indent = 4, separators = (',', ': ')) + ',' |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 26/49 invalid samples!
Drew 23 samples before timeout
Synthesized repair in: 32619ms
Tidyparse (proposed/total): 59/101
Tidyparse (accepted/proposed): 59/59
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| def __repr__(self): | def __repr__(self): |
| L = ['%s=%r' %(key, value) | L = ['%s=%r' %(key, value) |
| for key, value in self.__dict__.iteritems()] | for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' ~%(self~.__class__.__name__, ', '.~join~(~L)~ | return '%s(%s)' **%self**.__class__.__name__, ', '.**joinL**( |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 11/13 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30371ms
Tidyparse (proposed/total): 60/102
Tidyparse (accepted/proposed): 60/60
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|----------------------------------------------------------------|
| def test_execute_policy_positive_change_in_capacity(): | def test_execute_policy_positive_change_in_capacity(): |
| setup_autoscale_group() | setup_autoscale_group() |
| conn = boto.connect_autoscale() | conn = boto.connect_autoscale() |
| policy = ScalingPolicy( | policy = ScalingPolicy( |
| name = 'ScaleUp', | name = 'ScaleUp', |
| adjustment_type = 'ChangeInCapacity', | adjustment_type = 'ChangeInCapacity', |
| as_name = 'tester_group', | as_name = 'tester_group', |
| scaling_adjustment = 3, | scaling_adjustment = 3, |
| ) | ) |
| conn.create_scaling_policy(policy) | conn.create_scaling_policy(policy) |
| conn.execute_policy("ScaleUp") | conn.execute_policy("ScaleUp") |
| instances = list(conn.get_all_autoscaling_instances() | instances = list(conn.get_all_autoscaling_instances()**)** |
| instances.should.have.length_of(5) | instances.should.have.length_of(5) |
| | |
Python parser ACCEPTED repair!
Filtered out 60/69 invalid samples!
Drew 9 samples before timeout
Synthesized repair in: 34780ms
Tidyparse (proposed/total): 61/103
Tidyparse (accepted/proposed): 61/61
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| def acc_get_authorized_emails(name_action, ** arguments): | def acc_get_authorized_emails(name_action, ** arguments): |
| """Given the action and its arguments, try to retireve all the matching""" | """Given the action and its arguments, try to retireve all the matching""" |
| roles = acc_find_possible_roles(name_action, always_add_superadmin = False, ** arguments) | roles = acc_find_possible_roles(name_action, always_add_superadmin = False, ** arguments) |
| authorized_emails = acc_get_roles_emails(roles) | authorized_emails = acc_get_roles_emails(roles) |
| for id_role in roles: | for id_role in roles: |
| firerole = load_role_definition(id_role) | firerole = load_role_definition(id_role) |
| authorized_emails = authorized_emails.union(acc_firerole_extract_emails(firerole))~)~ | authorized_emails = authorized_emails.union(acc_firerole_extract_emails(firerole)) |
| return authorized_emails | return authorized_emails |
| | |
Python parser ACCEPTED repair!
Filtered out 62/68 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31067ms
Tidyparse (proposed/total): 62/104
Tidyparse (accepted/proposed): 62/62
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|----------------------------------------------------------------|
| def show_help(): | def show_help(): |
| """Help on common operations.""" | """Help on common operations.""" |
| from denim.environment import get_environments | from denim.environment import get_environments |
| import denim | import denim |
| print("""Common operations with Denim (%(version)s).""" %{ | print("""Common operations with Denim (%(version)s).""" %{ |
| 'environments': '|'.join(get_environments()), | 'environments': '|'.join(get_environments()), |
| 'version': denim.__version__, | 'version': denim.__version__, |
| } | } |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 59/94 invalid samples!
Drew 35 samples before timeout
Synthesized repair in: 32481ms
Tidyparse (proposed/total): 63/105
Tidyparse (accepted/proposed): 63/63
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| def normal_pdf(x, mu = 0, sigma = 1): | def normal_pdf(x, mu = 0, sigma = 1): |
| sqrt_two_pi = math.sqrt(2 * math.pi) | sqrt_two_pi = math.sqrt(2 * math.pi) |
| return(math.exp(-~(~x - mu) ** 2 / 2 / sigma ** 2) /(sqrt_two_pi * sigma) | return(math.exp(-x - mu) ** 2 / 2 / sigma ** 2) /(sqrt_two_pi * sigma) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 39ms
Tidyparse (proposed/total): 63/106
Tidyparse (accepted/proposed): 63/63
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~def getWaterPercent(range, rmin, rmax):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(range > rmin):~ | |
| ~ range = rmin~ | |
| ~ if(range < rmax):~ | |
| ~ range = rmax~ | |
| ~ rpercent = 1.0 -((range - rmax) /(rmin - rmax))~ | |
| ~ return rpercent * 100~ | |
| ~~ | |
Filtered out 114/123 invalid samples!
Drew 9 samples before timeout
Synthesized repair in: 54977ms
Tidyparse (proposed/total): 64/107
Tidyparse (accepted/proposed): 64/64
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| import requests | import requests |
| parameters = {'key': '94e4f86021169ee84b3fac03a466638f', 'q': 'shredded%20chicken'} | parameters = {'key': '94e4f86021169ee84b3fac03a466638f', 'q': 'shredded%20chicken'} |
| response = requests.get~{~'http://food2fork.com/api/search', params = parameters) | response = requests.get**(**'http://food2fork.com/api/search', params = parameters) |
| print(response.content) | print(response.content) |
| | |
Python parser ACCEPTED repair!
Filtered out 19/43 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 30089ms
Tidyparse (proposed/total): 65/108
Tidyparse (accepted/proposed): 65/65
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def rememberCurrentCredentials(self): | def rememberCurrentCredentials(self): |
| self.initSettings() | self.initSettings() |
| self.settings.setValue('username', QVariant(self._usernameLineEdit_.text())) | self.settings.setValue('username', QVariant(self._usernameLineEdit_.text())) |
| self.settings.setValue('password', QVariant(self._passwordLineEdit_.text()) | self.settings.setValue('password', QVariant(self._passwordLineEdit_.text()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 21/21 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 42128ms
Tidyparse (proposed/total): 65/109
Tidyparse (accepted/proposed): 65/65
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|-------------------------|
| ~def fill(self, process_data):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if process_data and process_data is not None:~ | |
| ~ self.heating_rate.setValue(float(process_data["heating_rate"]))~ | |
| ~ self.time_at_final_temp.setValue(float(process_data["time_final_temp"]))~ | |
| ~ self.final_temperature.setValue(float(process_data["final_temp"])~ | |
| ~ self.date_type = process_data["date_type"]~ | |
| ~ self.comments = process_data["comments"]~ | |
| ~~ | |
Filtered out 45/49 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 68727ms
Tidyparse (proposed/total): 66/110
Tidyparse (accepted/proposed): 66/66
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| def sum_series(k, m = 0, n = 1): | def sum_series(k, m = 0, n = 1): |
| """ This function requires 1 must and 2 optinol parameters""" | """ This function requires 1 must and 2 optinol parameters""" |
| if k < 0: return None | if k < 0: return None |
| if k == 0: return m | if k == 0: return m |
| if k == 1: return n~)~ | if k == 1: return n |
| return sum_series(k - 1, m, n) + sum_series(k - 2, m, n) | return sum_series(k - 1, m, n) + sum_series(k - 2, m, n) |
| | |
Python parser ACCEPTED repair!
Filtered out 37/45 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31610ms
Tidyparse (proposed/total): 67/111
Tidyparse (accepted/proposed): 67/67
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|---------------------------------------------------------------------|
| def update_channel_selector_buttons(self): | def update_channel_selector_buttons(self): |
| buttons = self._on_channel_seletor_button_value.subject | buttons = self._on_channel_seletor_button_value.subject |
| if buttons: | if buttons: |
| for button, coords in buttons.iterbuttons(): | for button, coords in buttons.iterbuttons(): |
| if button: | if button: |
| channel = self._channel - self._user_channel_offset | channel = self._channel - self._user_channel_offset |
| selected = coords[0] +(coords[1] * buttons.width())~)~ | selected = coords[0] +(coords[1] * buttons.width()) |
| if channel == selected: | if channel == selected: |
| button.set_light('Translation.SelectorOn') | button.set_light('Translation.SelectorOn') |
| else: | else: |
| button.set_light('Translation.SelectorOff') | button.set_light('Translation.SelectorOff') |
| | |
Python parser ACCEPTED repair!
Filtered out 56/72 invalid samples!
Drew 16 samples before timeout
Synthesized repair in: 32187ms
Tidyparse (proposed/total): 68/112
Tidyparse (accepted/proposed): 68/68
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def add_python_path(path): | def add_python_path(path): |
| lib_path = os.path.join(os.path.abspath(os.path.dirname(__file__))~)~, path) | lib_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), path) |
| if lib_path != sys.path[0]: | if lib_path != sys.path[0]: |
| sys.path.insert(0, lib_path) | sys.path.insert(0, lib_path) |
| | |
Python parser ACCEPTED repair!
Filtered out 73/105 invalid samples!
Drew 32 samples before timeout
Synthesized repair in: 31317ms
Tidyparse (proposed/total): 69/113
Tidyparse (accepted/proposed): 69/69
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| def import_from_string(name): | def import_from_string(name): |
| """helper to import module from a given string""" | """helper to import module from a given string""" |
| components = name.split('.')[1: ] | components = name.split('.')[1: ] |
| return reduce(lambda mod, y: getattr(mod, y), components, __import__(name))~)~ | return reduce(lambda mod, y: getattr(mod, y), components, __import__(name))**(** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 27/48 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 30584ms
Tidyparse (proposed/total): 70/114
Tidyparse (accepted/proposed): 70/70
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|----------------------------------------------------------------------------|
| def test_unexpected_error_subclass_debug(self): | def test_unexpected_error_subclass_debug(self): |
| self.config_fixture.config(debug = True) | self.config_fixture.config(debug = True) |
| subclass = self.SubClassExc | subclass = self.SubClassExc |
| e = subclass(debug_info = self.exc_str) | e = subclass(debug_info = self.exc_str) |
| expected = subclass.debug_message_format %{'debug_info': self.exc_str} | expected = subclass.debug_message_format %{'debug_info': self.exc_str} |
| self.~assertEqual(expected~, six.~text_type~(~e)~ | self.**assertEqualexpected**, six.**text_typee**( |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 90/90 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33442ms
Tidyparse (proposed/total): 70/115
Tidyparse (accepted/proposed): 70/70
Original error: expected an indented block
| original | repair |
|------------------------------------------|-------------------------|
| ~def _sessionResultEvent(self, iq):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """ """~ | |
| ~ if len(self.waiting_requests) > 0:~ | |
| ~ wr = self.waiting_requests.pop(0)~ | |
| ~ d = wr.deferred~ | |
| ~ else:~ | |
| ~ d = None~ | |
| ~ if iq["type"] == "result":~ | |
| ~ if d:~ | |
| ~ d.callback(self)~ | |
| ~ else:~ | |
| ~ if d:~ | |
| ~ d.errback(self)~ | |
| ~~ | |
Filtered out 4/8 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32434ms
Tidyparse (proposed/total): 71/116
Tidyparse (accepted/proposed): 71/71
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def exploit(self): | def exploit(self): |
| self.cmsjsons = self.retcmsjsons('db/cms.txt') | self.cmsjsons = self.retcmsjsons('db/cms.txt') |
| threadsNum = int(self.options['threads']) | threadsNum = int(self.options['threads']) |
| sites = self.options['sites'] | sites = self.options['sites'] |
| sitesLst = retSites(sites) | sitesLst = retSites(sites) |
| ArgsLst = self.retArgs(sitesLst, self.cmsjsons) | ArgsLst = self.retArgs(sitesLst, self.cmsjsons) |
| threadsDo(self.whatCMS, threadsNum, ArgsLst) | threadsDo(self.whatCMS, threadsNum, ArgsLst) |
| if len(self.result): | if len(self.result): |
| logByLine(self.result, 'output/%s-whatcms.txt' % currentTime("-") | logByLine(self.result, 'output/%s-whatcms.txt' % currentTime("-") |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 19/25 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30159ms
Tidyparse (proposed/total): 72/117
Tidyparse (accepted/proposed): 72/72
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| def test_get_tsastats(self): | def test_get_tsastats(self): |
| tsastats = self.datalogger.get_tsastats(self.project, self.tablename, self.datestring) | tsastats = self.datalogger.get_tsastats(self.project, self.tablename, self.datestring) |
| assert isinstance(tsastats, TimeseriesArrayStats) | assert isinstance(tsastats, TimeseriesArrayStats) |
| assert len(tsastats.keys~(~) > 0 | assert len(tsastats.keys) > 0 |
| tsstat = tsastats[tsastats.keys()[0]] | tsstat = tsastats[tsastats.keys()[0]] |
| assert isinstance(tsstat, TimeseriesStats) | assert isinstance(tsstat, TimeseriesStats) |
| | |
Python parser ACCEPTED repair!
Filtered out 72/76 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30178ms
Tidyparse (proposed/total): 73/118
Tidyparse (accepted/proposed): 73/73
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| def draw_path(self, path, pid = 0): | def draw_path(self, path, pid = 0): |
| points = [] | points = [] |
| for path_element in path: | for path_element in path: |
| x = path_element.position.x | x = path_element.position.x |
| y = path_element.position.y | y = path_element.position.y |
| points.append(~(~x, y) | points.append(x, y) |
| self.debug_interface.add_multiple_points(points, COLOR_ID_MAP[pid], width = 5, link = "path - " + str(pid), | self.debug_interface.add_multiple_points(points, COLOR_ID_MAP[pid], width = 5, link = "path - " + str(pid), |
| timeout = DEFAULT_PATH_TIMEOUT) | timeout = DEFAULT_PATH_TIMEOUT) |
| | |
Python parser ACCEPTED repair!
Filtered out 31/62 invalid samples!
Drew 31 samples before timeout
Synthesized repair in: 30899ms
Tidyparse (proposed/total): 74/119
Tidyparse (accepted/proposed): 74/74
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def _validateVertex(self, v): | def _validateVertex(self, v): |
| """raise an IndexOutOfBoundsException unless 0 <= v < V.""" | """raise an IndexOutOfBoundsException unless 0 <= v < V.""" |
| V = len(self._rank) | V = len(self._rank) |
| if v < 0 or v >= V: | if v < 0 or v >= V: |
| raise Exception("vertex {} is not between 0 and {}".format(v, ~(~V - 1)) | raise Exception("vertex {} is not between 0 and {}".format(v, V - 1)) |
| | |
Python parser ACCEPTED repair!
Filtered out 106/112 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34ms
Tidyparse (proposed/total): 75/120
Tidyparse (accepted/proposed): 74/75
Original error: unexpected indent
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~def _schedule_ha_routers_to_additional_agent(self, plugin, context, agent):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Bind already scheduled routers to the agent."""~ | |
| ~ routers_agents = plugin.get_ha_routers_l3_agents_count(context)~ | |
| ~ scheduled = False~ | |
| ~ admin_ctx = context.elevated()~ | |
| ~ for router_id, tenant_id, agents in routers_agents:~ | |
| ~ max_agents_not_reached = (~ | |
| ~ not self.max_ha_agents or agents < self.max_ha_agents)~ | |
| ~ if max_agents_not_reached:~ | |
| ~ if not self._router_has_binding(admin_ctx, router_id,~ | |
| ~ agent.id):~ | |
| ~ self._create_ha_router_binding(plugin, admin_ctx,~ | |
| ~ router_id, tenant_id,~ | |
| ~ agent)~ | |
| ~ scheduled = True~ | |
| ~ return scheduled~ | |
| ~~ | |
Drew 6 samples before timeout
Synthesized repair in: 51635ms
Tidyparse (proposed/total): 75/121
Tidyparse (accepted/proposed): 75/75
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------|-----------------------------------------|
| def test_1channel_update_from_vector(): | def test_1channel_update_from_vector(): |
| im = MaskedImage.init_blank(~(~10, 10) | im = MaskedImage.init_blank(10, 10) |
| update_im_from_vector(im) | update_im_from_vector(im) |
| | |
Python parser ACCEPTED repair!
Filtered out 89/103 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 117107ms
Tidyparse (proposed/total): 76/122
Tidyparse (accepted/proposed): 76/76
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|--------------------------------------------------------------------|
| def save(self, name): | def save(self, name): |
| f = open(os.path.~join(settings~.SETTINGS_DIR, 'classifiers', | f = open(os.path.**joinsettings**.SETTINGS_DIR, 'classifiers', |
| SAVE_FILE_TPL.format(name), 'w') | SAVE_FILE_TPL.format(name), 'w') |
| simplejson.dump(self.settings, f, indent = 4) | simplejson.dump(self.settings, f, indent = 4) |
| | |
Python parser ACCEPTED repair!
Filtered out 42/64 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 31242ms
Tidyparse (proposed/total): 77/123
Tidyparse (accepted/proposed): 77/77
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| def kelvin_to_fahrenheit(kelvintemp): | def kelvin_to_fahrenheit(kelvintemp): |
| """Converts a numeric temperature from Kelvin degrees to Fahrenheit degrees""" | """Converts a numeric temperature from Kelvin degrees to Fahrenheit degrees""" |
| if kelvintemp < 0: | if kelvintemp < 0: |
| raise ValueError(__name__ + ": negative temperature values not allowed") | raise ValueError(__name__ + ": negative temperature values not allowed") |
| fahrenheittemp = (kelvintemp - KELVIN_OFFSET) * FAHRENHEIT_DEGREE_SCALE + FAHRENHEIT_OFFSET | fahrenheittemp = (kelvintemp - KELVIN_OFFSET) * FAHRENHEIT_DEGREE_SCALE + FAHRENHEIT_OFFSET |
| return float("{0: .2f}".~format(fahrenheittemp~) | return float("{0: .2f}".**formatfahrenheittemp**) |
| | |
Python parser ACCEPTED repair!
Filtered out 93/111 invalid samples!
Drew 18 samples before timeout
Synthesized repair in: 155693ms
Tidyparse (proposed/total): 78/124
Tidyparse (accepted/proposed): 78/78
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def test_tuple2(self): | def test_tuple2(self): |
| env = wb.createJinjaEnv( | env = wb.createJinjaEnv( |
| changecommentlink = (r'#(\d+)', r'http: //buildbot.net/trac/ticket/\1'))~)~ | changecommentlink = (r'#(\d+)', r'http: //buildbot.net/trac/ticket/\1')) |
| self.~_test~(~env)~ | self.**_testenv**( |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 37/37 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30333ms
Tidyparse (proposed/total): 78/125
Tidyparse (accepted/proposed): 78/78
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------------|-------------------------|
| ~def run_outdated(self, options):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for dist, latest_version, typ in sorted(~ | |
| ~ self.find_packages_latest_versions(options),~ | |
| ~ key = lambda p: p[0].project_name.lower()):~ | |
| ~ if latest_version > dist.parsed_version:~ | |
| ~ logger.info(~ | |
| ~ '%s - Latest: %s [%s]',~ | |
| ~ self.output_package(dist), latest_version, typ,~ | |
| ~ )~ | |
| ~~ | |
Filtered out 65/70 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 38957ms
Tidyparse (proposed/total): 79/126
Tidyparse (accepted/proposed): 79/79
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def pubkeys_from_crt_files(flist): | def pubkeys_from_crt_files(flist): |
| pubkeys = [] | pubkeys = [] |
| errors = [] | errors = [] |
| for fname in flist: | for fname in flist: |
| try: | try: |
| pubkeys.~append~(~crtfile_to_pubkey(~fname) | pubkeys.**appendcrtfile_to_pubkey**(fname) |
| except util.ProcessExecutionError: | except util.ProcessExecutionError: |
| errors.append(fname) | errors.append(fname) |
| if errors: | if errors: |
| LOG.warn("failed to convert the crt files to pubkey: %s", errors) | LOG.warn("failed to convert the crt files to pubkey: %s", errors) |
| return pubkeys | return pubkeys |
| | |
Python parser ACCEPTED repair!
Filtered out 54/62 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32660ms
Tidyparse (proposed/total): 80/127
Tidyparse (accepted/proposed): 80/80
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-----------------------------------------------------------------|
| def test_100_del_ut3c5(self): | def test_100_del_ut3c5(self): |
| self.dsdb_expect_delete(self.net["unknown0"].usable[6]) | self.dsdb_expect_delete(self.net["unknown0"].usable[6]) |
| command = "del chassis --chassis ut3c5.aqd-unittest.ms.com" | command = "del chassis --chassis ut3c5.aqd-unittest.ms.com" |
| self.~noouttest(command~.split(" ") | self.**noouttestcommand**.split(" ") |
| self.dsdb_verify() | self.dsdb_verify() |
| | |
Python parser ACCEPTED repair!
Filtered out 70/94 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 32857ms
Tidyparse (proposed/total): 81/128
Tidyparse (accepted/proposed): 81/81
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def send(self, uuid, conn_id, msg): | def send(self, uuid, conn_id, msg): |
| """Raw send to the given connection ID at the given uuid, mostly used""" | """Raw send to the given connection ID at the given uuid, mostly used""" |
| header = "%s %d: %s, " %(uuid, len(str(conn_id))~)~, str(conn_id)) | header = "%s %d: %s, " %(uuid, len(str(conn_id)), str(conn_id)) |
| self.resp.send(header + ' ' + msg) | self.resp.send(header + ' ' + msg) |
| | |
Python parser ACCEPTED repair!
Filtered out 0/2 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 40937ms
Tidyparse (proposed/total): 82/129
Tidyparse (accepted/proposed): 82/82
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------|------------------------------------------------------------------|
| def form_id(self, record): | def form_id(self, record): |
| """ Will bind the form on a existing form with same name """ | """ Will bind the form on a existing form with same name """ |
| form_id = self.env['medical.drug.form'].search([ | form_id = self.env['medical.drug.form'].search([ |
| '|', | '|', |
| ('code', '=', record['dose'].strip(), | ('code', '=', record**)**['dose'].strip(), |
| ('name', '=', record['gcdf_desc'].strip().title()), | ('name', '=', record['gcdf_desc'].strip().title()), |
| ], | ], |
| limit = 1, | limit = 1, |
| ) | ) |
| if form_id: | if form_id: |
| return{'form_id': form_id.id} | return{'form_id': form_id.id} |
| | |
Python parser ACCEPTED repair!
Filtered out 82/106 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 78616ms
Tidyparse (proposed/total): 83/130
Tidyparse (accepted/proposed): 83/83
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------|-------------------------------|
| def print_contents(self): | def print_contents(self): |
| ~print(os~.linesep.join( | **printos**.linesep.join( |
| map( | map( |
| lambda x: x.name, | lambda x: x.name, |
| self.tables | self.tables |
| ) | ) |
| ) | ) |
| | |
Python parser ACCEPTED repair!
Filtered out 16/17 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 46861ms
Tidyparse (proposed/total): 84/131
Tidyparse (accepted/proposed): 84/84
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, DockWidget): | def retranslateUi(self, DockWidget): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| DockWidget.setWindowTitle(_translate("DockWidget", "DockWidget")) | DockWidget.setWindowTitle(_translate("DockWidget", "DockWidget")) |
| self._grpScriptBox.setTitle(_translate("DockWidget", "Authorisation Script")) | self._grpScriptBox.setTitle(_translate("DockWidget", "Authorisation Script")) |
| self.textEdit.setHtml(_translate("DockWidget", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | self.textEdit.setHtml(_translate("DockWidget", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 301/301 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 57372ms
Tidyparse (proposed/total): 84/132
Tidyparse (accepted/proposed): 84/84
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------|-------------------------|
| ~def writeByte(self, registerAddress, data):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(registerAddress > 255):~ | |
| ~ self.address = self.address | 1~ | |
| ~ registerAddress = registerAddress - 256~ | |
| ~ else:~ | |
| ~ self.address = self.address & 0xFE~ | |
| ~ self.bus.write_byte_data(self.address, registerAddress, data)~ | |
| ~~ | |
Filtered out 17/19 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 34980ms
Tidyparse (proposed/total): 85/133
Tidyparse (accepted/proposed): 84/85
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|--------------------------------------------------------------------|
| def make_dummy(cls, address): | def make_dummy(cls, address): |
| return cls.from_state(dict( | return cls.from_state(dict( |
| address = dict(address = address, use_ipv6 = False), | address = dict(address = address, use_ipv6 = False), |
| cert = None, | cert = None, |
| sni = None, | sni = None, |
| source_address = dict(address = ~(~'', 0), use_ipv6 = False), | source_address = dict(address = '', 0), use_ipv6 = False), |
| ssl_established = False, | ssl_established = False, |
| timestamp_start = None, | timestamp_start = None, |
| timestamp_tcp_setup = None, | timestamp_tcp_setup = None, |
| timestamp_ssl_setup = None, | timestamp_ssl_setup = None, |
| timestamp_end = None, | timestamp_end = None, |
| via = None | via = None |
| | **)** |
Python parser REJECTED repair because: positional argument follows keyword argument (<unknown>, line 6)
Drew 0 samples before timeout
Synthesized repair in: 28ms
Tidyparse (proposed/total): 85/134
Tidyparse (accepted/proposed): 84/85
Original error: unexpected indent
| original | repair |
|--------------------------------|-------------------------|
| ~def ipv4_to_int(string):~ | **NO_REPAIR_PROPOSAL!** |
| ~ ip = string.split('.')~ | |
| ~ assert len(ip) == 4~ | |
| ~ i = 0~ | |
| ~ for b in ip:~ | |
| ~ b = int(b)~ | |
| ~ i = (i << 8) | b~ | |
| ~ return i~ | |
| ~~ | |
Filtered out 36/49 invalid samples!
Drew 13 samples before timeout
Synthesized repair in: 32549ms
Tidyparse (proposed/total): 86/135
Tidyparse (accepted/proposed): 85/86
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| def test_padding(self): | def test_padding(self): |
| self._test_format("%20.f", - 42, grouping = 0, out = '-42'.rjust(20)) | self._test_format("%20.f", - 42, grouping = 0, out = '-42'.rjust(20)) |
| self._test_format("%+10.f", - 4200, grouping = 0, out = '-4200'.rjust(10)) | self._test_format("%+10.f", - 4200, grouping = 0, out = '-4200'.rjust(10)) |
| self._test_format("%-10.f", 4200, grouping = 0, out = '4200'.ljust(10) | self._test_format("%-10.f", 4200, grouping = 0, out = '4200'.ljust(10)**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 94/94 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31286ms
Tidyparse (proposed/total): 86/136
Tidyparse (accepted/proposed): 85/86
Original error: invalid syntax
| original | repair |
|--------------------------------------------|-------------------------|
| ~def final_action_state(path):~ | **NO_REPAIR_PROPOSAL!** |
| ~ "return the final state from a path"~ | |
| ~ if len(path) > 1~ | |
| ~ return path[- 2][0], path[- 1]~ | |
| ~ return None, path[- 1]~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 31141ms
Tidyparse (proposed/total): 87/137
Tidyparse (accepted/proposed): 86/87
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| class Ui_ChessRoomWindow(object): | class Ui_ChessRoomWindow(object): |
| def setupUi(self, ChessRoomWindow): | def setupUi(self, ChessRoomWindow): |
| ChessRoomWindow.setObjectName(_fromUtf8("ChessRoomWindow")) | ChessRoomWindow.setObjectName(_fromUtf8("ChessRoomWindow")) |
| ChessRoomWindow.resize(948, 800) | ChessRoomWindow.resize(948, 800) |
| ChessRoomWindow.setStyleSheet(_fromUtf8("background-color: #517191;")) | ChessRoomWindow.setStyleSheet(_fromUtf8("background-color: #517191;")) |
| self.RoomTitle = QtGui.QLabel(ChessRoomWindow) | self.RoomTitle = QtGui.QLabel(ChessRoomWindow) |
| self.RoomTitle.setGeometry(QtCore.QRect(205, 10, 541, 71)) | self.RoomTitle.setGeometry(QtCore.QRect(205, 10, 541, 71)) |
| self.RoomTitle.setStyleSheet(_fromUtf8("background-color: #E2C9A5;\n" | self.RoomTitle.setStyleSheet(_fromUtf8("background-color: #E2C9A5;\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 86/90 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 41182ms
Tidyparse (proposed/total): 88/138
Tidyparse (accepted/proposed): 87/88
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|--------------------------------------------------------------------------|
| def getChapters(self, manga): | def getChapters(self, manga): |
| query = 'SELECT Id, Number, MangaId FROM Chapters WHERE MangaId = ?' | query = 'SELECT Id, Number, MangaId FROM Chapters WHERE MangaId = ?' |
| self.db.~execute(query~, (manga.id, ) | self.db.**executequery**, (manga.id, ) |
| chapters_list = [] | chapters_list = [] |
| results = self.db.fetchall() | results = self.db.fetchall() |
| for data in results: | for data in results: |
| chapter = self.createChapterFromDB(data, manga) | chapter = self.createChapterFromDB(data, manga) |
| chapters_list.append(chapter) | chapters_list.append(chapter) |
| return chapters_list | return chapters_list |
| | |
Python parser ACCEPTED repair!
Filtered out 103/109 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 33641ms
Tidyparse (proposed/total): 89/139
Tidyparse (accepted/proposed): 88/89
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def __unicode__(self): | def __unicode__(self): |
| try: | try: |
| prin = self._comobj_.QueryInterface(IID_nsISupportsString) | prin = self._comobj_.QueryInterface(IID_nsISupportsString) |
| except COMException: | except COMException: |
| return ~unicode~(~str(~self) | return **unicodestr**(self) |
| return prin.data | return prin.data |
| | |
Python parser ACCEPTED repair!
Filtered out 68/74 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31723ms
Tidyparse (proposed/total): 90/140
Tidyparse (accepted/proposed): 89/90
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|----------------------------------------|
| def genomes_from_filename(fname): | def genomes_from_filename(fname): |
| fname = os.path.basename(fname) | fname = os.path.basename(fname) |
| fname = re.sub('\.tsv', '', fname) | fname = re.sub('\.tsv', '', fname) |
| ~print(fname~.split('--') | **printfname**.split('--') |
| return fname.split('--') | return fname.split('--') |
| | |
Python parser ACCEPTED repair!
Filtered out 46/53 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 61976ms
Tidyparse (proposed/total): 91/141
Tidyparse (accepted/proposed): 90/91
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|------------------------------------------------------|
| def _string_subst(self, val): | def _string_subst(self, val): |
| """ Substitute string definitions""" | """ Substitute string definitions""" |
| logger.debug('Substitute string definitions') | logger.debug('Substitute string definitions') |
| if not val: | if not val: |
| return '' | return '' |
| for k in list(self.bib_database.strings.keys())~)~: | for k in list(self.bib_database.strings.keys()): |
| if val.lower() == k: | if val.lower() == k: |
| val = self.bib_database.strings[k] | val = self.bib_database.strings[k] |
| if not isinstance(val, ustr): | if not isinstance(val, ustr): |
| val = ustr(val, self.encoding, 'ignore') | val = ustr(val, self.encoding, 'ignore') |
| return val | return val |
| | |
Python parser ACCEPTED repair!
Filtered out 66/72 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30610ms
Tidyparse (proposed/total): 92/142
Tidyparse (accepted/proposed): 91/92
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-----------------------------------------------------------------|
| def test_repr_big(self): | def test_repr_big(self): |
| biggie = DataFrame(np.zeros((200, 4)), columns = lrange(4), | biggie = DataFrame(np.zeros((200, 4)), columns = lrange(4), |
| index = ~lrange(200~) | index = **lrange200**) |
| repr(biggie) | repr(biggie) |
| | |
Python parser ACCEPTED repair!
Filtered out 85/85 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30799ms
Tidyparse (proposed/total): 92/143
Tidyparse (accepted/proposed): 91/92
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------------------------------------------|-------------------------|
| ~def cross_section(isotope, decay_mode, energy):~ | **NO_REPAIR_PROPOSAL!** |
| ~ Data = np.loadtxt(isotope + "_" + decay_mode + ".txt", delimiter = ",", skiprows = 1)~ | |
| ~ Data = np.array_split(Data, 2)~ | |
| ~ for array in Data:~ | |
| ~ if array[0][0] > energy:~ | |
| ~ return(Data)~ | |
| ~~ | |
Filtered out 83/89 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 38094ms
Tidyparse (proposed/total): 93/144
Tidyparse (accepted/proposed): 92/93
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------|------------------------------------------------|
| def _to_sequence(* vals): | def _to_sequence(* vals): |
| seq = univ.Sequence() | seq = univ.Sequence() |
| for i in ~range~(~len(~vals): | for i in **rangelen**(vals): |
| seq.setComponentByPosition(i, vals[i]) | seq.setComponentByPosition(i, vals[i]) |
| return seq | return seq |
| | |
Python parser ACCEPTED repair!
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 40137ms
Tidyparse (proposed/total): 93/145
Tidyparse (accepted/proposed): 92/93
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|-------------------------|
| ~def vote(request, poll_id):~ | **NO_REPAIR_PROPOSAL!** |
| ~ p = get_object_or_404(Poll, pk = poll_id)~ | |
| ~ try:~ | |
| ~ selected_choice = p.choice_set.get(pk = request.POST['choice'])~ | |
| ~ except(KeyError, Choice.DoesNotExist):~ | |
| ~ return render(request, 'polls/detail.html', {~ | |
| ~ 'poll': p,~ | |
| ~ 'error_message': "You didn't select a choice."),~ | |
| ~ })~ | |
| ~ else:~ | |
| ~ selected_choice.votes += 1~ | |
| ~ selected_choice.save()~ | |
| ~ return HttpResponseRedirect(reverse('polls:results', args = (p.id)))~ | |
| ~~ | |
Filtered out 3/10 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 35682ms
Tidyparse (proposed/total): 94/146
Tidyparse (accepted/proposed): 93/94
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|------------------------------------------------------------------|
| class Player(ndb.Model): | class Player(ndb.Model): |
| user_id = ndb.IntegerProperty(required = True) | user_id = ndb.IntegerProperty(required = True) |
| role = ndb.StringProperty( | role = ndb.StringProperty( |
| choices = ['spy', 'resistance']) | choices = ['spy', 'resistance']) |
| name = ndb.StringProperty() | name = ndb.StringProperty() |
| has_been_leader = ndb.BooleanProperty(default = False) | has_been_leader = ndb.BooleanProperty(default = False) |
| is_going_on_mission = ndb.~BooleanProperty(default~ = False | is_going_on_mission = ndb.**BooleanPropertydefault** = False |
| | |
Python parser ACCEPTED repair!
Filtered out 99/99 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 53990ms
Tidyparse (proposed/total): 94/147
Tidyparse (accepted/proposed): 93/94
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~class conexion():~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self):~ | |
| ~ self.conectar_base_de_datos = MySQLdb.connect(host = "localhost",~ | |
| ~ user =~ | |
| ~ passwd =~ | |
| ~ charset = "utf8",~ | |
| ~ db =~ | |
| ~ self.cursor = self.conectar_base_de_datos.cursor()~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 35ms
Tidyparse (proposed/total): 94/148
Tidyparse (accepted/proposed): 93/94
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------------|-------------------------|
| ~def render_Icon(self, h, comp, * args)~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.title is not None:~ | |
| ~ h << h.i(~ | |
| ~ self.title, class_ = self.icon, title = self.title, alt = self.title)~ | |
| ~ else:~ | |
| ~ h << h.i(class_ = self.icon)~ | |
| ~ return h.root~ | |
| ~~ | |
Filtered out 33/33 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31721ms
Tidyparse (proposed/total): 94/149
Tidyparse (accepted/proposed): 93/94
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------|-------------------------|
| ~def _item_check(self, dim_vals, data):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.type is not None and(type(data) != self.type):~ | |
| ~ raise AssertionError("%s must only contain one type of object, not both %s and %s." %~ | |
| ~ (self.__class__.__name__, type(data).__name__, self.type.__name__)~ | |
| ~ super(UniformNdMapping, self)._item_check(dim_vals, data)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 38ms
Tidyparse (proposed/total): 94/150
Tidyparse (accepted/proposed): 93/94
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------|-------------------------|
| ~def prev_date(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''Moves date back by one timestep (6hr)'''~ | |
| ~ index = np.where(self.dates == self.date)[0][0]~ | |
| ~ if index > 0:~ | |
| ~ date = self.dates[index - 1]~ | |
| ~ return self.set_date(date)~ | |
| ~ else:~ | |
| ~ log.warn('Trying to set date beyond date range')~ | |
| ~ return None~ | |
| ~~ | |
Filtered out 70/78 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30042ms
Tidyparse (proposed/total): 95/151
Tidyparse (accepted/proposed): 94/95
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|---------------------------------------------------------------------|
| def hscaleRbOD_adj_value_changed(self, slider): | def hscaleRbOD_adj_value_changed(self, slider): |
| self.RbParameters['imageObj'].~set_clim(0~, slider.get_value() | self.RbParameters['imageObj'].**set_clim0**, slider.get_value() |
| self.RbParameters['canvasObj'].draw_idle() | self.RbParameters['canvasObj'].draw_idle() |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 18ms
Tidyparse (proposed/total): 95/152
Tidyparse (accepted/proposed): 94/95
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------|-------------------------|
| ~def hit_url(url):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ urllib2.urlopen(url)~ | |
| ~ except URLError, e:~ | |
| ~ if "timed out" in e.reason:~ | |
| ~ print("=> Request to URL [%s] timed out (this is normal)" % url)~ | |
| ~ pass~ | |
| ~ else:~ | |
| ~ raise~ | |
| ~~ | |
Filtered out 10/15 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 35161ms
Tidyparse (proposed/total): 96/153
Tidyparse (accepted/proposed): 95/96
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def cameraview(ex, args, response): | def cameraview(ex, args, response): |
| """ Switch to camera view for the specified camera.""" | """ Switch to camera view for the specified camera.""" |
| if len(args): | if len(args): |
| if ex.display.userzoom: | if ex.display.userzoom: |
| raise CommandError('no camera view with external zoom enabled') | raise CommandError('no camera view with external zoom enabled') |
| ex.display.camera_view(ex.~model~[~args[~0]) | ex.display.camera_view(ex.**modelargs**[0]) |
| ex.modifier.visible = False | ex.modifier.visible = False |
| ex.modifier.parent = None | ex.modifier.parent = None |
| else: | else: |
| try: | try: |
| ex.display.camera_view() | ex.display.camera_view() |
| except RuntimeError: | except RuntimeError: |
| pass | pass |
| | |
Python parser ACCEPTED repair!
Filtered out 4/4 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35723ms
Tidyparse (proposed/total): 96/154
Tidyparse (accepted/proposed): 95/96
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def main():~ | **NO_REPAIR_PROPOSAL!** |
| ~ class MyOptionParser(optparse.OptionParser):~ | |
| ~ def format_epilog(self, formatter):~ | |
| ~ return self.epilog~ | |
| ~ usage = "%prog [options] --input_1 <fastq_file_read_1> --input_2 <fastq_file_read_2> --output_2 <fastq_file_1> --output_2 <fastq_file_2> "~ | |
| ~ description = """It trims (finds and/or removes by trimming) the paired-reads (FASTQ file"""~ | |
| ~ epilog = """Author: Daniel Nicorici"""~ | |
| ~ version = "%prog 0.98 beta"~ | |
| ~ parser = MyOptionParser(usage = usage,~ | |
| ~ epilog = epilog,~ | |
| ~ description = description,~ | |
| ~ version = version~ | |
| ~~ | |
Filtered out 96/100 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 52187ms
Tidyparse (proposed/total): 97/155
Tidyparse (accepted/proposed): 96/97
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|------------------------------------------------------------|
| class Diff(_Merge): | class Diff(_Merge): |
| """Layer that takes difference of a list of inputs.""" | """Layer that takes difference of a list of inputs.""" |
| def _merge_function(self, inputs): | def _merge_function(self, inputs): |
| output = inputs[0] | output = inputs[0] |
| for i in range(1, ~len(inputs~): | for i in range(1, **leninputs**): |
| output -= inputs[i] | output -= inputs[i] |
| return output | return output |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 37ms
Tidyparse (proposed/total): 97/156
Tidyparse (accepted/proposed): 96/97
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------|-------------------------|
| ~def feed_data(self, data):~ | **NO_REPAIR_PROPOSAL!** |
| ~ assert not self._eof, 'feed_data after feed_eof'~ | |
| ~ if not data:~ | |
| ~ return~ | |
| ~ self._buffer.extend(data)~ | |
| ~ self._wakeup_waiter()~ | |
| ~ if(self._transport is not None and~ | |
| ~ not self._paused and~ | |
| ~ len(self._buffer) > 2 * self._limit):~ | |
| ~ try:~ | |
| ~ self._transport.pause_reading()~ | |
| ~ except NotImplementedError:~ | |
| ~ self._transport = None~ | |
| ~ else:~ | |
| ~ self._paused = True~ | |
| ~~ | |
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31493ms
Tidyparse (proposed/total): 97/157
Tidyparse (accepted/proposed): 96/97
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|-------------------------|
| ~def CheckFramework(context, name):~ | **NO_REPAIR_PROPOSAL!** |
| ~ ret = 0~ | |
| ~ if(platform.system().lower() == 'darwin'):~ | |
| ~ context.Message('\nLooking for framework %s... ' % name)~ | |
| ~ lastFRAMEWORKS = context.env['FRAMEWORKS']~ | |
| ~ context.env.Append(FRAMEWORKS = [name])~ | |
| ~ ret = context.TryLink("""int main(int argc, char **argv) {""", '.c')~ | |
| ~ if not ret:~ | |
| ~ context.env.Replace(FRAMEWORKS = lastFRAMEWORKS~ | |
| ~~ | |
Filtered out 46/48 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 32864ms
Tidyparse (proposed/total): 98/158
Tidyparse (accepted/proposed): 97/98
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|----------------------------------------------------------|
| def create_includes(): | def create_includes(): |
| for number in range(0, number_of_files): | for number in range(0, number_of_files): |
| path = include_path.format(str(number) | path = include_path.format(str(number)**)** |
| content = content_of_include.format(str(number)) | content = content_of_include.format(str(number)) |
| create_include_file(path, content) | create_include_file(path, content) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 98/159
Tidyparse (accepted/proposed): 97/98
Original error: unexpected indent
| original | repair |
|----------------------------------------------------------------------------------|-------------------------|
| ~def remote_write(self, data):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Called from remote slave to write L{data} to L{fp} within boundaries"""~ | |
| ~ if self.remaining is not None:~ | |
| ~ if len(data) > self.remaining:~ | |
| ~ data = data[: self.remaining]~ | |
| ~ self.value += data~ | |
| ~ self.remaining = self.remaining - len(data)~ | |
| ~ else:~ | |
| ~ self.value += data~ | |
| ~~ | |
Filtered out 73/102 invalid samples!
Drew 29 samples before timeout
Synthesized repair in: 143897ms
Tidyparse (proposed/total): 99/160
Tidyparse (accepted/proposed): 98/99
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|--------------------------------------------------------------|
| def to_data_type(self, nodeid): | def to_data_type(self, nodeid): |
| if not nodeid: | if not nodeid: |
| return ua.NodeId(ua.ObjectIds.String) | return ua.NodeId(ua.ObjectIds.String) |
| if "=" in nodeid: | if "=" in nodeid: |
| return ua.NodeId.from_string(nodeid) | return ua.NodeId.from_string(nodeid) |
| else: | else: |
| return ua.~NodeId(getattr(ua~.ObjectIds, nodeid~)~ | return ua.**NodeIdgetattrua**.ObjectIds, nodeid**(** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 98/98 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 69874ms
Tidyparse (proposed/total): 99/161
Tidyparse (accepted/proposed): 98/99
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def test_strip_layout(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ test_layout = (~ | |
| ~ """ #######"""~ | |
| ~ self.assertRaises(LayoutEncodingException, Layout.check_layout,~ | |
| ~ Layout.strip_layout(illegal_layout),~ | |
| ~ TestLayoutChecks.layout_chars, 0)~ | |
| ~~ | |
Filtered out 16/20 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 33153ms
Tidyparse (proposed/total): 100/162
Tidyparse (accepted/proposed): 99/100
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def assert_200(response, max_len = 500): | def assert_200(response, max_len = 500): |
| """ Check that a HTTP response returned 200.""" | """ Check that a HTTP response returned 200.""" |
| if response.status_code == 200: | if response.status_code == 200: |
| return | return |
| raise ValueError( | raise ValueError( |
| "Response was{}, not 200: \n{}\n{}".format( | "Response was{}, not 200: \n{}\n{}".format( |
| response.status_code, | response.status_code, |
| json.dumps(dict(response.headers), indent = 2), | json.dumps(dict(response.headers), indent = 2), |
| response.content[: max_len]) | response.content[: max_len])**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 79/79 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32505ms
Tidyparse (proposed/total): 100/163
Tidyparse (accepted/proposed): 99/100
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~userInput = input("Enter your message: ").upper()~ | **NO_REPAIR_PROPOSAL!** |
| ~translated = ""~ | |
| ~i = len(userInput) - 1~ | |
| ~while i >= 0:~ | |
| ~ if message[i] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"~ | |
| ~ translate += message[i]~ | |
| ~ i -= 1~ | |
| ~print(translated)~ | |
| ~~ | |
Filtered out 14/18 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 36652ms
Tidyparse (proposed/total): 101/164
Tidyparse (accepted/proposed): 100/101
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------|--------------------------------|
| def listToDict(names, l): | def listToDict(names, l): |
| d = {} | d = {} |
| for x in enumerate(names): | for x in enumerate(names): |
| d[x[1]] = ~l~[~x[~0] | d[x[1]] = **lx**[0] |
| return d | return d |
| | |
Python parser ACCEPTED repair!
Filtered out 1/1 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 38982ms
Tidyparse (proposed/total): 101/165
Tidyparse (accepted/proposed): 100/101
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def test_ToRawUri(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("***==== Test To Raw Uri Value ====***"~ | |
| ~ sscc96 = self._sscc96.encode(self._companyPrefix, self._extensionDigit, self._serialRef, self._filter)~ | |
| ~ print(sscc96.toEPCRawUri())~ | |
| ~ print("***==== END Test To EPC Tag Uri Value ====***"~ | |
| ~ print(""~ | |
| ~~ | |
Filtered out 22/24 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 59565ms
Tidyparse (proposed/total): 102/166
Tidyparse (accepted/proposed): 101/102
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|--------------------------------------------------------------|
| def test_Location___repr__(): | def test_Location___repr__(): |
| tus = Location(32.2, - 111, 'US/Arizona', 700, 'Tucson') | tus = Location(32.2, - 111, 'US/Arizona', 700, 'Tucson') |
| expected = '\n'.join(~[~ | expected = '\n'.join( |
| 'Location: ', | 'Location: ', |
| ' name: Tucson', | ' name: Tucson', |
| ' latitude: 32.2', | ' latitude: 32.2', |
| ' longitude: -111', | ' longitude: -111', |
| ' altitude: 700', | ' altitude: 700', |
| ' tz: US/Arizona' | ' tz: US/Arizona' |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 0/5 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 30575ms
Tidyparse (proposed/total): 103/167
Tidyparse (accepted/proposed): 102/103
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------|------------------------------------------------------------|
| def getlist(self, section, option, conv = str): | def getlist(self, section, option, conv = str): |
| '''converts the value into a list.''' | '''converts the value into a list.''' |
| value = super(Config, self).get(section, option) | value = super(Config, self).get(section, option) |
| return[conv(i.strip() for i in value.split(', ')] | return[conv(i.strip() for i in value.split(', ')**)**] |
| | |
Python parser ACCEPTED repair!
Filtered out 7/7 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32773ms
Tidyparse (proposed/total): 103/168
Tidyparse (accepted/proposed): 102/103
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|-------------------------|
| ~def testOneDim(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ random.seed(42)~ | |
| ~ x = np.random.rand(1000)~ | |
| ~ y = 2 * x + 3~ | |
| ~ feature_columns = learn.infer_real_valued_columns_from_input(x)~ | |
| ~ regressor = learn.LinearRegressor(feature_columns = feature_columns)~ | |
| ~ regressor.fit(x, y, max_steps = 100)~ | |
| ~ score = mean_squared_error(y, regressor.predict(x)~ | |
| ~ self.assertLess(score, 1.0, "Failed with score ={0}".format(score))~ | |
| ~~ | |
Filtered out 100/104 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 37838ms
Tidyparse (proposed/total): 104/169
Tidyparse (accepted/proposed): 103/104
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|---------------------------------------|
| def get_frame_name(frame, nframes): | def get_frame_name(frame, nframes): |
| ndigits = ~len~(~str(~nframes) + 1 | ndigits = **lenstr**(nframes) + 1 |
| name = str(frame) | name = str(frame) |
| while len(name) < ndigits: | while len(name) < ndigits: |
| name = '0' + name | name = '0' + name |
| return name | return name |
| | |
Python parser ACCEPTED repair!
Filtered out 73/75 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 54259ms
Tidyparse (proposed/total): 105/170
Tidyparse (accepted/proposed): 104/105
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|--------------------------------------------------------------------------|
| def _search_for_existing_subject(self, file_date): | def _search_for_existing_subject(self, file_date): |
| if not self._subject_db: | if not self._subject_db: |
| return None | return None |
| for index, (start_date, end_date, _) in enumerate(self._subject_db): | for index, (start_date, end_date, _) in enumerate(self._subject_db): |
| if(file_date >(start_date - self._skew) and | if(file_date >(start_date - self._skew) and |
| file_date ~<(end_date~ + self._skew): | file_date **<end_date** + self._skew): |
| return index | return index |
| return None | return None |
| | |
Python parser ACCEPTED repair!
Filtered out 49/49 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35304ms
Tidyparse (proposed/total): 105/171
Tidyparse (accepted/proposed): 104/105
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------------------|-------------------------|
| ~def main():~ | **NO_REPAIR_PROPOSAL!** |
| ~ lat_beg = 39.049713081441~ | |
| ~ lat_end = 41.003754766807~ | |
| ~ lng_beg = 116.08693749489~ | |
| ~ lng_end = 117.08762815435~ | |
| ~ num = 0~ | |
| ~ lat = lat_beg~ | |
| ~ while lat < lat_end:~ | |
| ~ lng = lng_beg~ | |
| ~ while lng < lng_end:~ | |
| ~ getPoiType(lat, lng)~ | |
| ~ num += 1~ | |
| ~ lng += GPS_STEP~ | |
| ~ if num % 10 == 0:~ | |
| ~ print('Current GPS: ' + str(lat) + ', ' + str(lng))~ | |
| ~ show(PoiTypes, num)~ | |
| ~ lat += GPS_STEP~ | |
| ~ show(PoiTypes)~ | |
| ~ print('Finish!')~ | |
| ~~ | |
Filtered out 78/82 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30410ms
Tidyparse (proposed/total): 106/172
Tidyparse (accepted/proposed): 105/106
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|----------------------------------------------------------|
| def optimize_database(self): | def optimize_database(self): |
| size_orig = os.path.~getsize(self~.get_dbfilename() | size_orig = os.path.**getsizeself**.get_dbfilename() |
| self._db.execute('VACUUM') | self._db.execute('VACUUM') |
| size_opt = os.path.getsize(self.get_dbfilename()) | size_opt = os.path.getsize(self.get_dbfilename()) |
| return(size_orig, size_opt, size_orig - size_opt) | return(size_orig, size_opt, size_orig - size_opt) |
| | |
Python parser ACCEPTED repair!
Filtered out 10/14 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 36475ms
Tidyparse (proposed/total): 107/173
Tidyparse (accepted/proposed): 106/107
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------|----------------------------------------------------|
| def createDictData(filename): | def createDictData(filename): |
| f = open(filename, "r") | f = open(filename, "r") |
| i = 0 | i = 0 |
| if line.isCiteyLine(line): | if line.isCiteyLine(line): |
| cityInfo = [] | cityInfo = [] |
| city = line[: line.index(",").strip() | city = line[: line.index(",")**]**.strip() |
| return | return |
| | |
Python parser ACCEPTED repair!
Filtered out 38/46 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30744ms
Tidyparse (proposed/total): 108/174
Tidyparse (accepted/proposed): 107/108
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|--------------------------------------------------------------|
| def test_loaders(self): | def test_loaders(self): |
| loaders = loading.get_available_plugin_loaders() | loaders = loading.get_available_plugin_loaders() |
| self.assertThat(len(loaders), matchers.~GreaterThan(0~) | self.assertThat(len(loaders), matchers.**GreaterThan0**) |
| for l in loaders.values(): | for l in loaders.values(): |
| self.assertIsInstance(l, loading.BaseLoader) | self.assertIsInstance(l, loading.BaseLoader) |
| | |
Python parser ACCEPTED repair!
Filtered out 74/81 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 34866ms
Tidyparse (proposed/total): 109/175
Tidyparse (accepted/proposed): 108/109
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|----------------------------------------------------------|
| def test_name_variants_libfoo_so_1(self): | def test_name_variants_libfoo_so_1(self): |
| self.assertEqual(libs.name_variants('libfoo.so.1'), ~[~ | self.assertEqual(libs.name_variants('libfoo.so.1'), |
| 'libfoo.so.1', | 'libfoo.so.1', |
| 'libfoo.dylib.1', | 'libfoo.dylib.1', |
| 'libfoo.1', | 'libfoo.1', |
| 'foo.so.1', | 'foo.so.1', |
| 'foo.dylib.1', | 'foo.dylib.1', |
| 'foo.1', | 'foo.1', |
| 'libfoo.so', | 'libfoo.so', |
| 'libfoo.dylib', | 'libfoo.dylib', |
| 'libfoo', | 'libfoo', |
| 'foo.so', | 'foo.so', |
| 'foo.dylib', | 'foo.dylib', |
| 'foo' | 'foo' |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 4/4 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 40109ms
Tidyparse (proposed/total): 109/176
Tidyparse (accepted/proposed): 108/109
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def __init__(self, solr_server_url = None, solr_server_timeout = 10, ** kwargs):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if solr_server_url is None:~ | |
| ~ solr_server_url = settings.SOLR_SERVER_URL~ | |
| ~ if solr_server_timeout is None:~ | |
| ~ solr_server_timeout = settings.SOLR_SERVER_TIMEOUT_SECONDS~ | |
| ~ self.num_display_rows = kwargs.get('num_display_rows', DEFAULT_NUM_DISPLAY_ROWS)~ | |
| ~ self.page_num = kwargs.get('page_num', DEFAULT_NUM_DISPLAY_ROWS)~ | |
| ~ self.solr_object = pysolr.Solr(solr_server_url, timeout = solr_server_timeout)~ | |
| ~ self.searchFormatter = SolrSearchFormatter(** dict(num_display_rows = self.num_display_rows, page_num = 2~ | |
| ~ self.err_found = False~ | |
| ~ self.err_msg = None~ | |
| ~~ | |
Filtered out 32/32 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35373ms
Tidyparse (proposed/total): 109/177
Tidyparse (accepted/proposed): 108/109
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def update(self, m):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if not m:~ | |
| ~ return~ | |
| ~ if type(m) is not str:~ | |
| ~ raise TypeError, '%s() argument 1 must be string, not %s' %(sys._getframe().f_code.co_name, type(m).__name__)~ | |
| ~ self._buffer += m~ | |
| ~ self._counter += len(m)~ | |
| ~ while len(self._buffer) >= 64:~ | |
| ~ self._sha256_process(self._buffer[: 64])~ | |
| ~ self._buffer = self._buffer[64: ]~ | |
| ~~ | |
Filtered out 21/21 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30822ms
Tidyparse (proposed/total): 109/178
Tidyparse (accepted/proposed): 108/109
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~class ResGroups(models.Model):~ | **NO_REPAIR_PROPOSAL!** |
| ~ _inherit = 'res.groups'~ | |
| ~ login_calendar_id = fields.Many2one('resource.calendar'~ | |
| ~ 'Allow Login Calendar', company_dependent = True,~ | |
| ~ help = 'The user will be only allowed to login in the calendar defined here.'),~ | |
| ~ no_multiple_sessions = fields.Boolean('No Multiple Sessions', company_dependent = True~ | |
| ~ help = 'Select this to prevent user to start a session more than once'),~ | |
| ~ interval_number = fields.Integer('Session Timeout', company_dependent = True, help = 'Timeout since last activity for auto logout')~ | |
| ~ interval_type = fields.Selection([('minutes', 'Minutes')~ | |
| ~~ | |
Filtered out 33/46 invalid samples!
Drew 13 samples before timeout
Synthesized repair in: 32463ms
Tidyparse (proposed/total): 110/179
Tidyparse (accepted/proposed): 109/110
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| def render(self, name, value, attrs = None): | def render(self, name, value, attrs = None): |
| if value: | if value: |
| value = [str(i) for i in value] | value = [str(i) for i in value] |
| else: | else: |
| value = [] | value = [] |
| return mark_safe(loader.render_to_string("large_data_admin/m2m/widget.html", { | return mark_safe(loader.render_to_string("large_data_admin/m2m/widget.html", { |
| "STATIC_URL": settings.STATIC_URL, | "STATIC_URL": settings.STATIC_URL, |
| "name": name, | "name": name, |
| "value": ", ".join(value), | "value": ", ".join(value), |
| "model_str": self.model_str, | "model_str": self.model_str, |
| "field": self.search_field, | "field": self.search_field, |
| }))~)~ | })) |
| | |
Python parser ACCEPTED repair!
Filtered out 105/105 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32649ms
Tidyparse (proposed/total): 110/180
Tidyparse (accepted/proposed): 109/110
Original error: expected an indented block
| original | repair |
|--------------------------------------|-------------------------|
| ~def getNumber(str, length):~ | **NO_REPAIR_PROPOSAL!** |
| ~ sum = 0~ | |
| ~ for i in range(length):~ | |
| ~ sum = (sum << 8) + ord(str[i])~ | |
| ~ return sum, str[length: ]~ | |
| ~~ | |
Filtered out 156/189 invalid samples!
Drew 33 samples before timeout
Synthesized repair in: 79886ms
Tidyparse (proposed/total): 111/181
Tidyparse (accepted/proposed): 110/111
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def print_html(title = "Running Tests", html = None): | def print_html(title = "Running Tests", html = None): |
| """docstring for print_html""" | """docstring for print_html""" |
| html_file = read_file("%s/template.html" % HTML_BUNDLE) | html_file = read_file("%s/template.html" % HTML_BUNDLE) |
| ~print(html_file~ %{ | **printhtml_file** %{ |
| 'PAGE_TITLE': title, | 'PAGE_TITLE': title, |
| 'PAGE_CSS': "%s/styles.css" % HTML_BUNDLE, | 'PAGE_CSS': "%s/styles.css" % HTML_BUNDLE, |
| 'HTML_INPUT': html | 'HTML_INPUT': html |
| } | } |
| | |
Python parser ACCEPTED repair!
Filtered out 9/19 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 30723ms
Tidyparse (proposed/total): 112/182
Tidyparse (accepted/proposed): 111/112
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------|--------------------------------------------------------|
| class TestDataPlugin(unittest.TestCase): | class TestDataPlugin(unittest.TestCase): |
| def test_run(self): | def test_run(self): |
| vodka.data.data_types.instantiate_from_config( | vodka.data.data_types.instantiate_from_config( |
| [{ | [{ |
| "type": "data_test", | "type": "data_test", |
| "handlers": [ | "handlers": [ |
| { | { |
| "type": "store", | "type": "store", |
| "container": "list", | "container": "list", |
| "limit": 10 | "limit": 10 |
| } | } |
| ] | ] |
| }] | }]**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 70/91 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 31979ms
Tidyparse (proposed/total): 113/183
Tidyparse (accepted/proposed): 112/113
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|--------------------------------------------------------------|
| class LoginHandler(tornado.web.RequestHandler): | class LoginHandler(tornado.web.RequestHandler): |
| def get(self): | def get(self): |
| loginTemplate = templates.get_template("login.html") | loginTemplate = templates.get_template("login.html") |
| uri = urllib.quote('/') | uri = urllib.quote('/') |
| self.write(loginTemplate.render(redirect_uri = uri)~))~ | self.write(loginTemplate.render(redirect_uri = uri) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 115/115 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31563ms
Tidyparse (proposed/total): 113/184
Tidyparse (accepted/proposed): 112/113
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------|-------------------------|
| ~from rest_framework import mixins~ | **NO_REPAIR_PROPOSAL!** |
| ~from rest_framework.viewsets import GenericViewSet~ | |
| ~from.models import Project~ | |
| ~from.querysets import ProjectsQuerySet~ | |
| ~from.serializers import ProjectSerializer~ | |
| ~class ProjectViewSet(~ | |
| ~ mixins.ListModelMixin,~ | |
| ~ mixins.RetrieveModelMixin,~ | |
| ~ mixins.CreateModelMixin,~ | |
| ~ GenericViewSet):~ | |
| ~ serializer_class = ProjectSerializer~ | |
| ~ def get_queryset(self) -> ProjectsQuerySet:~ | |
| ~ return Project.objects.accessible_to(self.request.user)~ | |
| ~ def perform_create(self, serializer: ProjectSerializer) -> None:~ | |
| ~ serializer.save(owner = self.request.user)~ | |
| ~~ | |
Filtered out 2/2 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 43725ms
Tidyparse (proposed/total): 113/185
Tidyparse (accepted/proposed): 112/113
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------|-------------------------|
| ~def print_mult(s, i, j):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if i == j:~ | |
| ~ print("A" + str(i) + "", )~ | |
| ~ else:~ | |
| ~ print("(",~ | |
| ~ print_mult(s, i, s[i][j])~ | |
| ~ print(" x ", )~ | |
| ~ print_mult(s, s[i][j] + 1, j)~ | |
| ~~ | |
Filtered out 67/67 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32880ms
Tidyparse (proposed/total): 113/186
Tidyparse (accepted/proposed): 112/113
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-------------------------|
| ~Gauss Psudocode~ | **NO_REPAIR_PROPOSAL!** |
| ~Have the function import two equations from equations.py~ | |
| ~Have the user input an initial guess for one of them.~ | |
| ~x = Do f2(user_input_guess)~ | |
| ~Loop till % error is small:~ | |
| ~ y = f1(x)~ | |
| ~ x = f2(y)~ | |
| ~If the error keeps getting larger, then switch the functions.~ | |
| ~Display the intercection point to the user.~ | |
| ~Class Psudocode~ | |
| ~input functions~ | |
| ~input~ | |
| ~input initial guess~ | |
| ~While error > desired error:~ | |
| ~ for i in range(~ | |
| ~ solve each function~ | |
| ~ calculate error~ | |
| ~ (x2 - x1) /(y2 - y1) = % error~ | |
| ~ check for divergence~ | |
| ~~ | |
Filtered out 121/121 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 49150ms
Tidyparse (proposed/total): 113/187
Tidyparse (accepted/proposed): 112/113
Original error: invalid syntax
| original | repair |
|----------------------------------------------|-------------------------|
| ~def putline(self, line):~ | **NO_REPAIR_PROPOSAL!** |
| ~ line = line + CRLF~ | |
| ~ if self.debugging > 1:~ | |
| ~ print '*put*', self.sanitize(line)~ | |
| ~ self.sock.sendall(line)~ | |
| ~~ | |
Filtered out 0/4 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32823ms
Tidyparse (proposed/total): 114/188
Tidyparse (accepted/proposed): 113/114
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|---------------------------------------------------------------------------|
| def main(): | def main(): |
| if len(sys.argv) == 1: | if len(sys.argv) == 1: |
| print("""This script is called like so: """ %(sys.argv[0]))) | print("""This script is called like so: """ %(sys.argv**(**[0]))) |
| sys.exit(1) | sys.exit(1) |
| for x in sys.argv[1: ]: | for x in sys.argv[1: ]: |
| new_file(x) | new_file(x) |
| | |
Python parser ACCEPTED repair!
Filtered out 10/14 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32620ms
Tidyparse (proposed/total): 115/189
Tidyparse (accepted/proposed): 114/115
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------|---------------------------------------|
| from __future__ import print_function | from __future__ import print_function |
| import command | import command |
| response = command.run(['ls'~)~]) | response = command.run(['ls']) |
| print("\nOutput:") | print("\nOutput:") |
| print(response.output) | print(response.output) |
| print("\nReturn Code:") | print("\nReturn Code:") |
| print(response.exit) | print(response.exit) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 25ms
Tidyparse (proposed/total): 115/190
Tidyparse (accepted/proposed): 114/115
Original error: invalid syntax
| original | repair |
|-----------------------------------------------|-------------------------|
| ~def uint256_from_str(s):~ | **NO_REPAIR_PROPOSAL!** |
| ~ r = 0 l~ | |
| ~ t = struct.unpack("<iiiiiiii", s[: 32])~ | |
| ~ for i in xrange(8):~ | |
| ~ r += t[i] <<(i * 32)~ | |
| ~ return r~ | |
| ~~ | |
Filtered out 43/53 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 30963ms
Tidyparse (proposed/total): 116/191
Tidyparse (accepted/proposed): 115/116
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|-------------------------------------------------------|
| def make_testplot(): | def make_testplot(): |
| message = cPickle.dumps(('t', 'plot(range(10))'))~)~ | message = cPickle.dumps(('t', 'plot(range(10))')) |
| c = Client() | c = Client() |
| c.send(message) | c.send(message) |
| | |
Python parser ACCEPTED repair!
Filtered out 56/60 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32182ms
Tidyparse (proposed/total): 117/192
Tidyparse (accepted/proposed): 116/117
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------|-----------------------------------------------|
| def __init__(self, data = None): | def __init__(self, data = None): |
| self.order = "NMGXYZE FTSP IJRD" | self.order = "NMGXYZE FTSP IJRD" |
| self.dataType = 0x1080 | self.dataType = 0x1080 |
| self.hostCommand = "" | self.hostCommand = "" |
| self.originalCommand = "" | self.originalCommand = "" |
| self.parameterValue = [] | self.parameterValue = [] |
| for i in xrange(len(self.order)): | for i in xrange(len(self.order)): |
| self.parameterValue.~append~(~str(~"") | self.parameterValue.**appendstr**("") |
| if data != None: | if data != None: |
| self.parseLine(data) | self.parseLine(data) |
| | |
Python parser ACCEPTED repair!
Filtered out 96/96 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31881ms
Tidyparse (proposed/total): 117/193
Tidyparse (accepted/proposed): 116/117
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------|-------------------------|
| ~def merge_files(files, header = 'T'):~ | **NO_REPAIR_PROPOSAL!** |
| ~ filecount = 0~ | |
| ~ for file in files:~ | |
| ~ filecount += 1~ | |
| ~ fin = open(file, 'r')~ | |
| ~ if filecount > 1 and header == 'T':~ | |
| ~ linecount = 0~ | |
| ~ for line in fin.xreadlines():~ | |
| ~ linecount += 1~ | |
| ~ if linecount > 1: print line.rstrip()~ | |
| ~ else:~ | |
| ~ for line in fin.xreadlines(): print line.rstrip()~ | |
| ~~ | |
Filtered out 31/33 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 32267ms
Tidyparse (proposed/total): 118/194
Tidyparse (accepted/proposed): 117/118
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def main(): | def main(): |
| config_file = os.path.join(sys.path[0], '../conf/odinsys.conf') | config_file = os.path.join(sys.path[0], '../conf/odinsys.conf') |
| config.read(config_file) | config.read(config_file) |
| factory = protocol.ServerFactory() | factory = protocol.ServerFactory() |
| factory.protocol = OdinSysInfoProtocol | factory.protocol = OdinSysInfoProtocol |
| factory.clients = [] | factory.clients = [] |
| port = int(config.get("global", "bind_port") | port = int(config.get**)**("global", "bind_port") |
| reactor.listenTCP(port, factory) | reactor.listenTCP(port, factory) |
| logger.debug("ODINSYS: Server started and listen on the port: %i" %(port)) | logger.debug("ODINSYS: Server started and listen on the port: %i" %(port)) |
| reactor.run() | reactor.run() |
| | |
Python parser ACCEPTED repair!
Filtered out 101/101 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32601ms
Tidyparse (proposed/total): 118/195
Tidyparse (accepted/proposed): 117/118
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def render(self, cur_time):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if cur_time >(self.last_update~ | |
| ~ + datetime.timedelta(minutes = self.REFRESH_TIME_MINUTES)):~ | |
| ~ try:~ | |
| ~ self.forecast = forecastio.load_forecast(self.api_key,~ | |
| ~ self.lat,~ | |
| ~ self.lon)~ | |
| ~ except:~ | |
| ~ print("Error retrieving forecast, check Forecast.io key")~ | |
| ~ self.last_update = cur_time~ | |
| ~ self.renderForecast()~ | |
| ~~ | |
Filtered out 77/85 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31549ms
Tidyparse (proposed/total): 119/196
Tidyparse (accepted/proposed): 118/119
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|-----------------------------------------------------------------|
| def __init__(self, keyword_filters = None, ** kwargs): | def __init__(self, keyword_filters = None, ** kwargs): |
| self.filters = list(~map(str~.lower, keyword_filters or[]) | self.filters = list(**mapstr**.lower, keyword_filters or[]) |
| self.ignored = [] | self.ignored = [] |
| super(SanitizingJSONEncoder, self).__init__(** kwargs) | super(SanitizingJSONEncoder, self).__init__(** kwargs) |
| | |
Python parser ACCEPTED repair!
Filtered out 15/21 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 35740ms
Tidyparse (proposed/total): 120/197
Tidyparse (accepted/proposed): 119/120
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|------------------------------------------------------------|
| def start(self): | def start(self): |
| if self._started is False: | if self._started is False: |
| self._log.debug('Starting{0}'.format(self))~)~ | self._log.debug('Starting{0}'.format(self)) |
| self._started = True | self._started = True |
| self.dependency.start() | self.dependency.start() |
| else: | else: |
| self._log.debug('Already started{0}'.format(self)) | self._log.debug('Already started{0}'.format(self)) |
| | |
Python parser ACCEPTED repair!
Filtered out 235/241 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 67451ms
Tidyparse (proposed/total): 121/198
Tidyparse (accepted/proposed): 120/121
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def _add_hidden_layer_summary(value, tag): | def _add_hidden_layer_summary(value, tag): |
| logging_ops.scalar_summary("%s/fraction_of_zero_values" % tag, | logging_ops.scalar_summary("%s/fraction_of_zero_values" % tag, |
| nn.~zero_fraction(value~) | nn.**zero_fractionvalue**) |
| logging_ops.histogram_summary("%s/activation" % tag, value) | logging_ops.histogram_summary("%s/activation" % tag, value) |
| | |
Python parser ACCEPTED repair!
Filtered out 43/47 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 33708ms
Tidyparse (proposed/total): 122/199
Tidyparse (accepted/proposed): 121/122
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------|--------------------------------------------------|
| def read_strictarray(self): | def read_strictarray(self): |
| (l, ) = struct.unpack('>L', self.~_read(4~) | (l, ) = struct.unpack('>L', self.**_read4**) |
| return[self.read_value() for i in range(l)] | return[self.read_value() for i in range(l)] |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 30ms
Tidyparse (proposed/total): 122/200
Tidyparse (accepted/proposed): 121/122
Original error: expected an indented block
| original | repair |
|-----------------------------------|-------------------------|
| ~def get_data(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ count = 0~ | |
| ~ while True:~ | |
| ~ buf = self.conn.recv(chunk)~ | |
| ~ if len(buf) > 0:~ | |
| ~ if(len(buf) > 1):~ | |
| ~ stream.write(buf)~ | |
| ~ count = count + 1~ | |
| ~~ | |
Filtered out 74/74 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33020ms
Tidyparse (proposed/total): 122/201
Tidyparse (accepted/proposed): 121/122
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~def BoundingRect(self, pos, dir, width):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ angle = atan2(dir.y, dir.x)~ | |
| ~ except ValueError:~ | |
| ~ angle = 0~ | |
| ~ if width < 1.0:~ | |
| ~ width = 1.0~ | |
| ~ s = width * sin(angle)~ | |
| ~ c = width * cos(angle)~ | |
| ~ trafo = Trafo(c, s, - s, c, pos.x, pos.y)~ | |
| ~ return self.path.accurate_rect(trafo)~ | |
| ~~ | |
Filtered out 194/243 invalid samples!
Drew 49 samples before timeout
Synthesized repair in: 58200ms
Tidyparse (proposed/total): 123/202
Tidyparse (accepted/proposed): 122/123
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------|----------------------------------------------|
| from __future__ import print_function | from __future__ import print_function |
| import hashlib | import hashlib |
| import sys | import sys |
| print(hashlib.sha256(sys.argv[1]).hexdigest~(~) | print(hashlib.sha256(sys.argv[1]).hexdigest) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 17ms
Tidyparse (proposed/total): 123/203
Tidyparse (accepted/proposed): 122/123
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------|-------------------------|
| ~def MaxContacts(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Gets the most contacts of any conformation."""~ | |
| ~ n = 0~ | |
| ~ for cs in self._contactsets:~ | |
| ~ if len(cs) > n:~ | |
| ~ n = len(cs)~ | |
| ~ return n~ | |
| ~~ | |
Filtered out 196/241 invalid samples!
Drew 45 samples before timeout
Synthesized repair in: 135853ms
Tidyparse (proposed/total): 124/204
Tidyparse (accepted/proposed): 123/124
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|-------------------------------------------------------|
| class TestMessageHubInit(unittest.TestCase): | class TestMessageHubInit(unittest.TestCase): |
| def test_msg_hub_init(self): | def test_msg_hub_init(self): |
| mh = MessageHub() | mh = MessageHub() |
| self.assertEquals(mh.handler_resolver, dict()~))~ | self.assertEquals(mh.handler_resolver, dict() |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 78/117 invalid samples!
Drew 39 samples before timeout
Synthesized repair in: 30671ms
Tidyparse (proposed/total): 125/205
Tidyparse (accepted/proposed): 124/125
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| def input_captcha(sess, soup): | def input_captcha(sess, soup): |
| r = sess.get('https: //jaccount.sjtu.edu.cn/jaccount/' + captcha_src(soup), | r = sess.get('https: //jaccount.sjtu.edu.cn/jaccount/' + captcha_src(soup), |
| stream = True) | stream = True) |
| return image_to_string(Image.open(BytesIO(r.content))~))~ | return image_to_string(Image.open(BytesIO(r.content)) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 76/82 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30855ms
Tidyparse (proposed/total): 126/206
Tidyparse (accepted/proposed): 125/126
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|--------------------------------------------------------------------|
| def suite(): | def suite(): |
| suite = trytond.tests.test_tryton.suite() | suite = trytond.tests.test_tryton.suite() |
| suite.~addTests(unittest~.TestLoader().loadTestsFromTestCase( | suite.**addTestsunittest**.TestLoader().loadTestsFromTestCase( |
| StockSupplyDayTestCase) | StockSupplyDayTestCase) |
| return suite | return suite |
| | |
Python parser ACCEPTED repair!
Filtered out 26/28 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 34321ms
Tidyparse (proposed/total): 127/207
Tidyparse (accepted/proposed): 126/127
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|---------------------------------------------------------------------------|
| def magento_product_modified(session, model_name, record_id, vals): | def magento_product_modified(session, model_name, record_id, vals): |
| if session.context.get('connector_no_export'): | if session.context.get('connector_no_export'): |
| return | return |
| if session.env[model_name].browse(record_id).no_stock_sync: | if session.env[model_name].browse(record_id).no_stock_sync: |
| return | return |
| inventory_fields = list(set(vals).intersection(INVENTORY_FIELDS) | inventory_fields = list(set(vals).intersection(INVENTORY_FIELDS)**)** |
| if inventory_fields: | if inventory_fields: |
| export_product_inventory.delay(session, model_name, | export_product_inventory.delay(session, model_name, |
| record_id, fields = inventory_fields, | record_id, fields = inventory_fields, |
| priority = 20) | priority = 20) |
| | |
Python parser ACCEPTED repair!
Filtered out 7/7 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 44242ms
Tidyparse (proposed/total): 127/208
Tidyparse (accepted/proposed): 126/127
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------------------------------|-------------------------|
| ~def print_idea(self, num, l1, l2, l3, l4):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("{0:{l1}}) {1:{l2}} {2:{l3}} {3:{l4}}".format(num, self.name, self.id, )~ | |
| ~ self.status, l1 = l1, l2 = l2,~ | |
| ~ l3 = l3, l4 = l4)~ | |
| ~~ | |
Filtered out 72/72 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30284ms
Tidyparse (proposed/total): 127/209
Tidyparse (accepted/proposed): 126/127
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------------|-------------------------|
| ~def insertNewlines(text, lineLength):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Given text and a desired line length, wrap the text as a typewriter would."""~ | |
| ~ if len(text) <= lineLength:~ | |
| ~ return text~ | |
| ~ else:~ | |
| ~ i = findSpace(text, lineLength)~ | |
| ~ i += 1~ | |
| ~ result = text[: i] + "\n"~ | |
| ~ return result + insertNewlines(text[i: ], lineLength)~ | |
| ~~ | |
Filtered out 7/7 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 49501ms
Tidyparse (proposed/total): 127/210
Tidyparse (accepted/proposed): 126/127
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~def addentity(self, entity):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """entity ={"""~ | |
| ~ entity['creationdatetime'] = str(strftime("%Y-%m-%d %H: %M: %S")))~ | |
| ~ self.entities.insert(entity)~ | |
| ~ return True~ | |
| ~~ | |
Filtered out 16/20 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 38014ms
Tidyparse (proposed/total): 128/211
Tidyparse (accepted/proposed): 127/128
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------|------------------------------------------------|
| def inputs_from_results(results, keys = None): | def inputs_from_results(results, keys = None): |
| prefix = '--' | prefix = '--' |
| inputs = [] | inputs = [] |
| for idx, result in enumerate(results): | for idx, result in enumerate(results): |
| if keys is not None: | if keys is not None: |
| inputs.append(prefix + keys[idx]) | inputs.append(prefix + keys[idx]) |
| inputs.~append~(~str(~result) | inputs.**appendstr**(result) |
| return inputs | return inputs |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 27ms
Tidyparse (proposed/total): 128/212
Tidyparse (accepted/proposed): 127/128
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------------|-------------------------|
| ~def run_test6(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ i = (1 << 47)~ | |
| ~ if(self.debug): print "removing location(1, 1)"~ | |
| ~ self.bs.remove_name_for_location(datapathid.from_host(1), 1,~ | |
| ~ "office-5", Name.LOCATION)~ | |
| ~ self.next_fn = self.run_test7~ | |
| ~ self.wait_count = 1~ | |
| ~~ | |
Filtered out 32/63 invalid samples!
Drew 31 samples before timeout
Synthesized repair in: 33089ms
Tidyparse (proposed/total): 129/213
Tidyparse (accepted/proposed): 128/129
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|---------------------------------------------------------------|
| def read(self): | def read(self): |
| self.n = int(sys.stdin.readline()) | self.n = int(sys.stdin.readline()) |
| self.parent = list(map(int, sys.stdin.readline().split())~))~ | self.parent = list(map(int, sys.stdin.readline().split()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 8/13 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 32902ms
Tidyparse (proposed/total): 130/214
Tidyparse (accepted/proposed): 129/130
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def handle_success(self): | def handle_success(self): |
| """desc: """ | """desc: """ |
| logfile = self.logfile() | logfile = self.logfile() |
| if logfile is None: | if logfile is None: |
| logfile = u'Unknown logfile' | logfile = u'Unknown logfile' |
| with open(self.ext_resource(u'finished.md')) as fd: | with open(self.ext_resource(u'finished.md')) as fd: |
| md = fd.read() | md = fd.read() |
| md = md %{ | md = md %{ |
| u'time': time.ctime(), | u'time': time.ctime(), |
| u'logfile': logfile | u'logfile': logfile |
| } | } |
| self.tabwidget.open_markdown(md, u'os-finished-success', _(u'Finished') | self.tabwidget.open_markdown(md, u'os-finished-success', _(u'Finished')**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 33/33 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30315ms
Tidyparse (proposed/total): 130/215
Tidyparse (accepted/proposed): 129/130
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~class WMS extends Layer:~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self, name, url, options):~ | |
| ~ super(_newInstance(name, url, options))~ | |
| ~ JavaScriptObject _newInstance(String name, String url, String options){~ | |
| ~ JS("""return new $wnd.OpenLayers.Layer.WMS(name, url, options);""")~ | |
| ~~ | |
Filtered out 20/34 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 31698ms
Tidyparse (proposed/total): 131/216
Tidyparse (accepted/proposed): 130/131
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| def __eq__(self, x): | def __eq__(self, x): |
| if isinstance(x, Pocket): | if isinstance(x, Pocket): |
| return(self._pockettype != x._pockettype and self != x._items) | return(self._pockettype != x._pockettype and self != x._items) |
| try: return x == self | try: return x == self |
| except: raise TypeError( | except: raise TypeError( |
| "Cannot compare type: {} to Inventory 'Pocket' type.".format(type(x)) | "Cannot compare type: {} to Inventory 'Pocket' type.".format(type(x))**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 7/10 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 44760ms
Tidyparse (proposed/total): 132/217
Tidyparse (accepted/proposed): 131/132
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| def parse_mail(file_in): | def parse_mail(file_in): |
| """Extract Subject & Body of mail file""" | """Extract Subject & Body of mail file""" |
| with open(file_in, 'rb') as INFILE: | with open(file_in, 'rb') as INFILE: |
| raw_mail = email.message_from_binary_file(INFILE) | raw_mail = email.message_from_binary_file(INFILE) |
| charset = raw_mail.get_charsets()[0] | charset = raw_mail.get_charsets()[0] |
| formated_mail = { | formated_mail = { |
| "body": raw_mail.get_payload(decode = True).decode(charset), | "body": raw_mail.get_payload(decode = True).decode(charset), |
| "subject": str(email.header.make_header(email.header.decode_header(raw_mail["Subject"]))) | "subject": str(email.header.make_header(email.header.decode_header(raw_mail["Subject"])))**}** |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 48ms
Tidyparse (proposed/total): 132/218
Tidyparse (accepted/proposed): 131/132
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------------------------|-------------------------|
| ~def mostequivalent(strings, S):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Return the index of the most equivalent string in strings to S using a"""~ | |
| ~ Sshist = shist(S)~ | |
| ~ stringshist = map(shist, strings)~ | |
| ~ md = - 1~ | |
| ~ for i in xrange(len(stringshist)):~ | |
| ~ d = sum(map(lambda(a, b): abs(a - b), zip(stringshist[i], Sshist)))~ | |
| ~ if i == 0 or d < md:~ | |
| ~ mi, md = i, d~ | |
| ~ return mi~ | |
| ~~ | |
Filtered out 163/163 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 64598ms
Tidyparse (proposed/total): 132/219
Tidyparse (accepted/proposed): 131/132
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------------------|-------------------------|
| ~def generateRecords(self, records):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Generate multiple records.Refer to definition for generateRecord"""~ | |
| ~ if self.verbosity > 0:~ | |
| ~ print 'Generating', len(records), 'records...'~ | |
| ~ for record in records:~ | |
| ~ self.generateRecord(record)~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 47719ms
Tidyparse (proposed/total): 133/220
Tidyparse (accepted/proposed): 132/133
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def retranslateUi(self, SvnTagDialog): | def retranslateUi(self, SvnTagDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| SvnTagDialog.setWindowTitle(_translate("SvnTagDialog", "Subversion Tag")) | SvnTagDialog.setWindowTitle(_translate("SvnTagDialog", "Subversion Tag")) |
| self.tagCombo.setToolTip(_translate("SvnTagDialog", "Enter the name of the tag")) | self.tagCombo.setToolTip(_translate("SvnTagDialog", "Enter the name of the tag")) |
| self.tagCombo.setWhatsThis(_translate("SvnTagDialog", "<b>Tag Name</b>\n" | self.tagCombo.setWhatsThis(_translate("SvnTagDialog", "<b>Tag Name</b>\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 40/74 invalid samples!
Drew 34 samples before timeout
Synthesized repair in: 30628ms
Tidyparse (proposed/total): 134/221
Tidyparse (accepted/proposed): 133/134
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------|-------------------------------------------------------------|
| from django.conf.urls import patterns, include, url | from django.conf.urls import patterns, include, url |
| from django.contrib import admin | from django.contrib import admin |
| admin.autodiscover() | admin.autodiscover() |
| urlpatterns = patterns('', | urlpatterns = patterns('', |
| url(r'^admin/', include(admin.site.urls)), | url(r'^admin/', include(admin.site.urls)), |
| url(r'^messageboard/', include('messageboard.urls')~)~, ), | url(r'^messageboard/', include('messageboard.urls'), ), |
| ) | ) |
| | |
Python parser ACCEPTED repair!
Filtered out 8/25 invalid samples!
Drew 17 samples before timeout
Synthesized repair in: 34938ms
Tidyparse (proposed/total): 135/222
Tidyparse (accepted/proposed): 134/135
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def test_creation_auth_off(self): | def test_creation_auth_off(self): |
| course_id = SlashSeparatedCourseKey('blahx', 'blah101', 'ehhhhhhh') | course_id = SlashSeparatedCourseKey('blahx', 'blah101', 'ehhhhhhh') |
| self.assertTrue(CourseAuthorization.instructor_email_enabled(course_id)) | self.assertTrue(CourseAuthorization.instructor_email_enabled(course_id)) |
| cauth = CourseAuthorization(course_id = course_id, email_enabled = False) | cauth = CourseAuthorization(course_id = course_id, email_enabled = False) |
| cauth.save() | cauth.save() |
| self.assertTrue(CourseAuthorization.instructor_email_enabled(course_id))~)~ | self.assertTrue(CourseAuthorization.instructor_email_enabled(course_id |
| | )) |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 36ms
Tidyparse (proposed/total): 135/223
Tidyparse (accepted/proposed): 134/135
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------|-------------------------|
| ~def dump(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Print rubbish about self."""~ | |
| ~ print('%15s: %s' %('name', self.name))~ | |
| ~ if self.comment:~ | |
| ~ print '%15s: %s' %('comment', self.comment)~ | |
| ~ if self.sequence:~ | |
| ~ print('%15s: %s' %('sequence', self.sequence[: 25]), )~ | |
| ~ if len(self.sequence) > 25: print "..."~ | |
| ~ else: print ''~ | |
| ~~ | |
Filtered out 57/69 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 37654ms
Tidyparse (proposed/total): 136/224
Tidyparse (accepted/proposed): 135/136
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| def _compute_square_distance(city_a, city_b): | def _compute_square_distance(city_a, city_b): |
| """Compute the approximative distance between two cities.""" | """Compute the approximative distance between two cities.""" |
| delta_y = (city_a.latitude - city_b.latitude) * 111 | delta_y = (city_a.latitude - city_b.latitude) * 111 |
| mean_latitude = (city_a.latitude + city_b.latitude) / 2 | mean_latitude = (city_a.latitude + city_b.latitude) / 2 |
| delta_x = (city_a.longitude - city_b.longitude) * 111 * math.cos(math.radians(mean_latitude))~)~ | delta_x = (city_a.longitude - city_b.longitude) * 111 * math.cos(math.radians(mean_latitude)) |
| return delta_x * delta_x + delta_y * delta_y | return delta_x * delta_x + delta_y * delta_y |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 36ms
Tidyparse (proposed/total): 136/225
Tidyparse (accepted/proposed): 135/136
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def logs(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """ Return relevant who-did-what pairs from the bug history """~ | |
| ~ for record in self.history:~ | |
| ~ if(record["when"] >= self.options.since.date~ | |
| ~ and record["when"] < self.options.until.date):~ | |
| ~ for change in record["changes"]:~ | |
| ~ yield record["who"], change~ | |
| ~~ | |
Filtered out 21/25 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 34127ms
Tidyparse (proposed/total): 137/226
Tidyparse (accepted/proposed): 136/137
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def prune_stats(stats, big_stats, threshold): | def prune_stats(stats, big_stats, threshold): |
| """Prune statistics dict for efficiency of max()""" | """Prune statistics dict for efficiency of max()""" |
| for item, freq in ~list(stats~.items(): | for item, freq in **liststats**.items(): |
| if freq < threshold: | if freq < threshold: |
| del stats[item] | del stats[item] |
| if freq < 0: | if freq < 0: |
| big_stats[item] += freq | big_stats[item] += freq |
| else: | else: |
| big_stats[item] = freq | big_stats[item] = freq |
| | |
Python parser ACCEPTED repair!
Filtered out 276/310 invalid samples!
Drew 34 samples before timeout
Synthesized repair in: 82908ms
Tidyparse (proposed/total): 138/227
Tidyparse (accepted/proposed): 137/138
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------|----------------------------------------------|
| def get(self): | def get(self): |
| """Return this alarm.""" | """Return this alarm.""" |
| rbac.enforce('get_alarm', pecan.request) | rbac.enforce('get_alarm', pecan.request) |
| return Alarm.from_db_model(self._alarm()~))~ | return Alarm.from_db_model(self._alarm() |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 99/99 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30504ms
Tidyparse (proposed/total): 138/228
Tidyparse (accepted/proposed): 137/138
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------------------------------|-------------------------|
| ~class _BlockNotIndentedElementFactory(_BlockElementFactory):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Factory for elements based on marks."""~ | |
| ~ def _find_element(self, langmark, parent, lines, indentation, matches,~ | |
| ~ Element):~ | |
| ~ if indentation > parent.indentation_internal:~ | |
| ~ raise _BlockElementStartNotMatched()~ | |
| ~ return self._do_find_element(langmark, parent, lines, indentation,~ | |
| ~ matches, Element)~ | |
| ~ def _do_find_element(self, langmark, parent, lines, indentation, matches,~ | |
| ~ Element):~ | |
| ~ raise NotImplementedError()~ | |
| ~~ | |
Filtered out 35/35 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 42053ms
Tidyparse (proposed/total): 138/229
Tidyparse (accepted/proposed): 137/138
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------|-------------------------|
| ~def test_fields(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ query = self.query_class(models.SearchTest.objects.all(), "Hello", fields = ['title'])~ | |
| ~ expected_result = {'bool': {~ | |
| ~ 'filter': {'match': {'content_type': 'searchtests.SearchTest'}},~ | |
| ~ 'must': {'match': {'title': 'Hello'}~ | |
| ~ }}~ | |
| ~ self.assertDictEqual(query.get_query(), expected_result)~ | |
| ~~ | |
Filtered out 91/91 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31582ms
Tidyparse (proposed/total): 138/230
Tidyparse (accepted/proposed): 137/138
Original error: expected an indented block
| original | repair |
|---------------------------------------------|-------------------------|
| ~def __repr__(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ rs = []~ | |
| ~ for ch in self:~ | |
| ~ r = '%r' %(ch, )~ | |
| ~ if ch._priority > self._priority:~ | |
| ~ r = '(%s)' % r~ | |
| ~ rs.append(r)~ | |
| ~ return ' | '.join(rs)~ | |
| ~~ | |
Filtered out 0/1 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 30079ms
Tidyparse (proposed/total): 139/231
Tidyparse (accepted/proposed): 138/139
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def resize_images(imgs, new_dims, flatten = False): | def resize_images(imgs, new_dims, flatten = False): |
| flattened_dims = [- 1, np.prod(new_dims)] if flatten else[- 1] + new_dims | flattened_dims = [- 1, np.prod(new_dims)] if flatten else[- 1] + new_dims |
| return np.vstack([imresize(img.reshape(28, 28), | return np.vstack([imresize(img.reshape(28, 28), |
| new_dims).reshape(flattened_dims) | new_dims).reshape(flattened_dims)**])** |
| | |
Python parser ACCEPTED repair!
Filtered out 136/217 invalid samples!
Drew 81 samples before timeout
Synthesized repair in: 53322ms
Tidyparse (proposed/total): 140/232
Tidyparse (accepted/proposed): 139/140
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|--------------------------------------------------------------------------|
| def readline(self): | def readline(self): |
| r"""Reads the next line from the file.Leaves the '\n' at the end.""" | r"""Reads the next line from the file.Leaves the '\n' at the end.""" |
| self._preread_check() | self._preread_check() |
| return compat.as_str_any(self._read_buf.ReadLineAsString~(~) | return compat.as_str_any(self._read_buf.ReadLineAsString) |
| | |
Python parser ACCEPTED repair!
Filtered out 57/57 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33155ms
Tidyparse (proposed/total): 140/233
Tidyparse (accepted/proposed): 139/140
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def clean(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """A SessionKind can either have neither start nor end date or both."""~ | |
| ~ super(SessionKind, self).clean()~ | |
| ~ if self.closed is None:~ | |
| ~ if self.start_date is None or self.end_date is None:~ | |
| ~ raise forms.ValidationError(_("You have to specify a start and end date if you leave the 'closed' status undetermined")~ | |
| ~ if self.start_date >= self.end_date:~ | |
| ~ raise forms.ValidationError(_("The end date has to be after the start date"))~ | |
| ~~ | |
Filtered out 51/63 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 32507ms
Tidyparse (proposed/total): 141/234
Tidyparse (accepted/proposed): 140/141
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, CodeStyleCheckerDialog): | def retranslateUi(self, CodeStyleCheckerDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| CodeStyleCheckerDialog.setWindowTitle(_translate("CodeStyleCheckerDialog", "Code Style Check Result")) | CodeStyleCheckerDialog.setWindowTitle(_translate("CodeStyleCheckerDialog", "Code Style Check Result")) |
| CodeStyleCheckerDialog.setWhatsThis(_translate("CodeStyleCheckerDialog", "<b>Code Style Check Results</b>\n" | CodeStyleCheckerDialog.setWhatsThis(_translate("CodeStyleCheckerDialog", "<b>Code Style Check Results</b>\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 5/6 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 43563ms
Tidyparse (proposed/total): 142/235
Tidyparse (accepted/proposed): 141/142
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------|--------------------------------------------------------|
| class Ui_taskDetailItem(object): | class Ui_taskDetailItem(object): |
| def setupUi(self, taskDetailItem): | def setupUi(self, taskDetailItem): |
| taskDetailItem.setObjectName("taskDetailItem") | taskDetailItem.setObjectName("taskDetailItem") |
| taskDetailItem.resize(240, 40) | taskDetailItem.resize(240, 40) |
| taskDetailItem.setWindowTitle("") | taskDetailItem.setWindowTitle("") |
| taskDetailItem.setStyleSheet("QLabel ~{~\n" | taskDetailItem.setStyleSheet("QLabel \n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 53/77 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 30978ms
Tidyparse (proposed/total): 143/236
Tidyparse (accepted/proposed): 142/143
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| import peewee | import peewee |
| from pce_db import PceOrgano, PceExpediente | from pce_db import PceOrgano, PceExpediente |
| query = (PceExpediente | query = (PceExpediente |
| .select(PceExpediente.id_expediente, PceExpediente.num_expediente, PceOrgano.descripcion) | .select(PceExpediente.id_expediente, PceExpediente.num_expediente, PceOrgano.descripcion) |
| .where(PceExpediente.id_estado >> None) | .where(PceExpediente.id_estado >> None) |
| .join(PceOrgano) | .join(PceOrgano) |
| .naive())~)~ | .naive()) |
| for line in query: | for line in query: |
| print(line.id_expediente, line.num_expediente, line.descripcion) | print(line.id_expediente, line.num_expediente, line.descripcion) |
| | |
Python parser ACCEPTED repair!
Filtered out 14/14 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34494ms
Tidyparse (proposed/total): 143/237
Tidyparse (accepted/proposed): 142/143
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------|-------------------------|
| ~def invalid_proxy(self, index):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """将index指向的proxy设置为invalid,"""~ | |
| ~ if index < self.fixed_proxy:~ | |
| ~ self.inc_proxy_index()~ | |
| ~ return~ | |
| ~ if self.proxyes[index]["valid"]:~ | |
| ~ logger.info("invalidate %s" % self.proxyes[index])~ | |
| ~ self.proxyes[index]["valid"] = False~ | |
| ~ if index == self.proxy_index:~ | |
| ~ self.inc_proxy_index()~ | |
| ~ if self.proxyes[index]["count"] < self.dump_count_threshold:~ | |
| ~ self.dump_valid_proxy()~ | |
| ~~ | |
Filtered out 78/98 invalid samples!
Drew 20 samples before timeout
Synthesized repair in: 182611ms
Tidyparse (proposed/total): 144/238
Tidyparse (accepted/proposed): 143/144
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------|------------------------------------------------------------------|
| from sqlalchemy import Table, Column, Integer, Float | from sqlalchemy import Table, Column, Integer, Float |
| from sqlalchemy.orm import mapper | from sqlalchemy.orm import mapper |
| from eos.db import saveddata_meta | from eos.db import saveddata_meta |
| from eos.types import Override | from eos.types import Override |
| overrides_table = Table("overrides", saveddata_meta, | overrides_table = Table("overrides", saveddata_meta, |
| Column("itemID", Integer, primary_key = True, index = True), | Column("itemID", Integer, primary_key = True, index = True), |
| Column("attrID", Integer, primary_key = True, index = True), | Column("attrID", Integer, primary_key = True, index = True), |
| Column("value", Float, nullable = False))~)~ | Column("value", Float, nullable = False)) |
| mapper(Override, overrides_table) | mapper(Override, overrides_table) |
| | |
Python parser ACCEPTED repair!
Filtered out 24/28 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30423ms
Tidyparse (proposed/total): 145/239
Tidyparse (accepted/proposed): 144/145
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------|----------------------------------------------------|
| def make_pic(self, x_list, y_list): | def make_pic(self, x_list, y_list): |
| line_chart = pygal.Line() | line_chart = pygal.Line() |
| line_chart.title = 'Mem usage evolution(in %)' | line_chart.title = 'Mem usage evolution(in %)' |
| line_chart.x_labels = x_list | line_chart.x_labels = x_list |
| line_chart.add('Mem', y_list) | line_chart.add('Mem', y_list) |
| line_chart.render() | line_chart.render() |
| f = open('%s.html' % self.file_name, 'w') | f = open('%s.html' % self.file_name, 'w') |
| f.~write(line_chart~.render() | f.**writeline_chart**.render() |
| f.close() | f.close() |
| | |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 49141ms
Tidyparse (proposed/total): 146/240
Tidyparse (accepted/proposed): 145/146
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, Graph): | def retranslateUi(self, Graph): |
| Graph.setWindowTitle(QtGui.QApplication.translate("Graph", "Graphique", None, QtGui.QApplication.UnicodeUTF8)) | Graph.setWindowTitle(QtGui.QApplication.translate("Graph", "Graphique", None, QtGui.QApplication.UnicodeUTF8)) |
| self.taux_btn.setToolTip(QtGui.QApplication.translate("Graph", "Voir les taux moyens et marginaux d\'imposition", None, QtGui.QApplication.UnicodeUTF8)) | self.taux_btn.setToolTip(QtGui.QApplication.translate("Graph", "Voir les taux moyens et marginaux d\'imposition", None, QtGui.QApplication.UnicodeUTF8)) |
| self.taux_btn.setText(QtGui.QApplication.translate("Graph", "Taux moyens\n" | self.taux_btn.setText(QtGui.QApplication.translate("Graph", "Taux moyens\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 32/49 invalid samples!
Drew 17 samples before timeout
Synthesized repair in: 31035ms
Tidyparse (proposed/total): 147/241
Tidyparse (accepted/proposed): 146/147
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-----------------------------------------------------------------|
| def _translate_frequency(self, frequency): | def _translate_frequency(self, frequency): |
| frequency_msgid = ( | frequency_msgid = ( |
| frequency.lower() | frequency.lower() |
| if frequency in IndicadorsDataReporter.FREQUENCY_VALUES | if frequency in IndicadorsDataReporter.FREQUENCY_VALUES |
| else u'unknown') | else u'unknown') |
| return self.context.translate( | return self.context.translate( |
| _(u'category_freq_{0}'.format(frequency_msgid)) | _(u'category_freq_{0}'.format(frequency_msgid)) |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 26ms
Tidyparse (proposed/total): 147/242
Tidyparse (accepted/proposed): 146/147
Original error: unexpected indent
| original | repair |
|-------------------------------------------------------------------|-------------------------|
| ~def getStoredAlarm(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ alarmValue = ''~ | |
| ~ if os.path.isfile(AlarmFile):~ | |
| ~ try:~ | |
| ~ alarmValue = self.execCommand("cat " + AlarmFile)~ | |
| ~ except ValueError:~ | |
| ~ alarmValue = "0:7:00"~ | |
| ~ else:~ | |
| ~ log.message("Error reading " + AlarmFile, log.ERROR)~ | |
| ~ return alarmValue~ | |
| ~ def storeAlarm(self, alarmString):~ | |
| ~ self.execCommand("echo " + alarmString + " > " + AlarmFile)~ | |
| ~ return~ | |
| ~~ | |
Filtered out 119/119 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 154187ms
Tidyparse (proposed/total): 147/243
Tidyparse (accepted/proposed): 146/147
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------|-------------------------|
| ~def test_codingspec(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ for enc in ALL_CJKENCODINGS:~ | |
| ~ print('w'), '# coding:', enc)~ | |
| ~ exec open(TESTFN)~ | |
| ~ finally:~ | |
| ~ os.unlink(TESTFN)~ | |
| ~~ | |
Filtered out 16/22 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32509ms
Tidyparse (proposed/total): 148/244
Tidyparse (accepted/proposed): 147/148
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def test_gen_seating_plans_correct_length(self): | def test_gen_seating_plans_correct_length(self): |
| seating_plans = [seating_plan for seating_plan in ~gen_seating_plans~(~range(~10)] | seating_plans = [seating_plan for seating_plan in **gen_seating_plansrange**(10)] |
| self.assertEqual(len(seating_plans), math.factorial(10 - 1)) | self.assertEqual(len(seating_plans), math.factorial(10 - 1)) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 44ms
Tidyparse (proposed/total): 148/245
Tidyparse (accepted/proposed): 147/148
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~def update(self, dsetId, rank, size):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if dsetId > 0:~ | |
| ~ if dsetId in self.dsetsizes:~ | |
| ~ print(self.reqId)~ | |
| ~ print(dsetId)~ | |
| ~ raise Exception("Duplicate dataset in DeletionRequest!!!")~ | |
| ~ self.dsetsizes[dsetId] = size~ | |
| ~ self.dsetranks[dsetId] = rank~ | |
| ~ self.size = self.size + size~ | |
| ~ self.ndsets = self.ndsets + 1~ | |
| ~~ | |
Filtered out 44/59 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 31503ms
Tidyparse (proposed/total): 149/246
Tidyparse (accepted/proposed): 148/149
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| def delete_ha_interfaces_on_host(self, context, router_id, host): | def delete_ha_interfaces_on_host(self, context, router_id, host): |
| admin_ctx = context.elevated() | admin_ctx = context.elevated() |
| port_ids = (binding.port_id for binding | port_ids = (binding.port_id for binding |
| in self.get_ha_router_port_bindings(admin_ctx, | in self.get_ha_router_port_bindings(admin_ctx, |
| [router_id], host))~)~ | [router_id], host)) |
| for port_id in port_ids: | for port_id in port_ids: |
| self._core_plugin.delete_port(admin_ctx, port_id, | self._core_plugin.delete_port(admin_ctx, port_id, |
| l3_port_check = False) | l3_port_check = False) |
| | |
Python parser ACCEPTED repair!
Filtered out 7/8 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 39884ms
Tidyparse (proposed/total): 150/247
Tidyparse (accepted/proposed): 149/150
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, MainWindow): | def retranslateUi(self, MainWindow): |
| MainWindow.setWindowTitle(_translate("MainWindow", "tryTox", None)) | MainWindow.setWindowTitle(_translate("MainWindow", "tryTox", None)) |
| self.toxTryNotifications.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | self.toxTryNotifications.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 28/28 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31718ms
Tidyparse (proposed/total): 150/248
Tidyparse (accepted/proposed): 149/150
Original error: unexpected indent
| original | repair |
|----------------------------------------------------|-------------------------|
| ~def bridgeCheck(tileMap):~ | **NO_REPAIR_PROPOSAL!** |
| ~ found = False~ | |
| ~ if found == False:~ | |
| ~ logMap[9][: ].reverse()~ | |
| ~ logBuffer = logMap[9][: ].index(")")~ | |
| ~ logMap[9][: ].reverse()~ | |
| ~ if int(logBuffer) == 22:~ | |
| ~ found = True~ | |
| ~~ | |
Filtered out 35/35 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32648ms
Tidyparse (proposed/total): 150/249
Tidyparse (accepted/proposed): 149/150
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|-------------------------|
| ~def test_chrooted(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ fixture = self.useFixture(MockCmdRunnerPopenFixture()~ | |
| ~ cmd_runner.run(['foo', 'bar'], chroot = 'chroot_dir').wait()~ | |
| ~ self.assertEqual(~ | |
| ~ ['%s %s chroot_dir foo bar' %(sudo_args, chroot_args)],~ | |
| ~ fixture.mock.commands_executed)~ | |
| ~~ | |
Filtered out 144/144 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 56348ms
Tidyparse (proposed/total): 150/250
Tidyparse (accepted/proposed): 149/150
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------------|-------------------------|
| ~def putline(self, line):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Internal: send one line to the server, appending CRLF."""~ | |
| ~ line = line + CRLF~ | |
| ~ if self.debugging > 1:~ | |
| ~ print '*put*', repr(line)~ | |
| ~ self.sock.sendall(line)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 44ms
Tidyparse (proposed/total): 150/251
Tidyparse (accepted/proposed): 149/150
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------|-------------------------|
| ~def _count0Bits(num):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Find the highest bit set to 0 in an integer."""~ | |
| ~ num = long(num)~ | |
| ~ if num < 0:~ | |
| ~ raise ValueError, "Only positive Numbers please: %s" %(num)~ | |
| ~ ret = 0~ | |
| ~ while num > 0:~ | |
| ~ if num & 1 == 1:~ | |
| ~ break~ | |
| ~ num = num >> 1~ | |
| ~ ret += 1~ | |
| ~ return ret~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 43ms
Tidyparse (proposed/total): 150/252
Tidyparse (accepted/proposed): 149/150
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------|-------------------------|
| ~class ISYBinarySensorProgram(ISYBinarySensorDevice):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Representation of an ISY994 binary sensor program."""~ | |
| ~ def __init__(self, name, node) -> None~ | |
| ~ """Initialize the ISY994 binary sensor program."""~ | |
| ~ ISYBinarySensorDevice.__init__(self, node)~ | |
| ~ self._name = name~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 40790ms
Tidyparse (proposed/total): 151/253
Tidyparse (accepted/proposed): 150/151
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------|----------------------------------------------------|
| class Ui_snapshotItem(object): | class Ui_snapshotItem(object): |
| def setupUi(self, snapshotItem): | def setupUi(self, snapshotItem): |
| snapshotItem.setObjectName("snapshotItem") | snapshotItem.setObjectName("snapshotItem") |
| snapshotItem.setWindowTitle("") | snapshotItem.setWindowTitle("") |
| snapshotItem.setStyleSheet("QLabel ~{~\n" | snapshotItem.setStyleSheet("QLabel \n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 24/32 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32555ms
Tidyparse (proposed/total): 152/254
Tidyparse (accepted/proposed): 151/152
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------|----------------------------------------------------|
| def max_target_length(self): | def max_target_length(self): |
| '''the maximal length of the targets''' | '''the maximal length of the targets''' |
| part1 = max([~len(targets~.split(' ') | part1 = max([**lentargets**.split(' ') |
| for targets in self.target_dict.values()]) | for targets in self.target_dict.values()]) |
| return(part1, 1) | return(part1, 1) |
| | |
Python parser ACCEPTED repair!
Filtered out 57/63 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32438ms
Tidyparse (proposed/total): 153/255
Tidyparse (accepted/proposed): 152/153
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------|-------------------------------------------------|
| def scan_data(self): | def scan_data(self): |
| t = [] | t = [] |
| t.append(gevent.spawn(self.get_vrouters)) | t.append(gevent.spawn(self.get_vrouters)) |
| t.~append(gevent~.spawn(self.get_prouters) | t.**appendgevent**.spawn(self.get_prouters) |
| gevent.joinall(t) | gevent.joinall(t) |
| | |
Python parser ACCEPTED repair!
Filtered out 46/66 invalid samples!
Drew 20 samples before timeout
Synthesized repair in: 30881ms
Tidyparse (proposed/total): 154/256
Tidyparse (accepted/proposed): 153/154
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def main(package, version, news_path): | def main(package, version, news_path): |
| release_name, details = extract_description(package, version, news_path) | release_name, details = extract_description(package, version, news_path) |
| print("""%(release_name)s""".strip~(~).rstrip() %{ | print("""%(release_name)s""".strip).rstrip() %{ |
| 'base_url': BASE_URL, | 'base_url': BASE_URL, |
| 'package': package, | 'package': package, |
| 'version': version, | 'version': version, |
| 'release_name': release_name, | 'release_name': release_name, |
| 'details': details, | 'details': details, |
| } | } |
| | |
Python parser ACCEPTED repair!
Filtered out 15/18 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 32420ms
Tidyparse (proposed/total): 155/257
Tidyparse (accepted/proposed): 154/155
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|---------------------------------------------------------------------|
| def FormatItem(key, value): | def FormatItem(key, value): |
| sqlstr = "" | sqlstr = "" |
| if isinstance(value, Number): | if isinstance(value, Number): |
| sqlstr = " `%s`=%s " %(key, value) | sqlstr = " `%s`=%s " %(key, value) |
| else: | else: |
| sqlstr = " `%s`='%s' " ~%(key~, value.replace("'", "\\'") | sqlstr = " `%s`='%s' " **%key**, value.replace("'", "\\'") |
| return sqlstr | return sqlstr |
| | |
Python parser ACCEPTED repair!
Filtered out 62/74 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 33205ms
Tidyparse (proposed/total): 156/258
Tidyparse (accepted/proposed): 155/156
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-----------------------------------------------------------------|
| def __init__(self, conf, ks_client, nv_client, zabbix_hdl): | def __init__(self, conf, ks_client, nv_client, zabbix_hdl): |
| """Ceilometer polling handler""" | """Ceilometer polling handler""" |
| super(MongoHandler, self).__init__(conf, zabbix_hdl) | super(MongoHandler, self).__init__(conf, zabbix_hdl) |
| self.polling_interval = int(conf.read_option('zcp_configs', | self.polling_interval = int(conf.read_option('zcp_configs', |
| 'polling_interval'))~)~ | 'polling_interval')) |
| self.ks_client = ks_client | self.ks_client = ks_client |
| self.nv_client = nv_client | self.nv_client = nv_client |
| self.zabbix_hdl = zabbix_hdl | self.zabbix_hdl = zabbix_hdl |
| self.mongodb = impl_mongo.Connection() | self.mongodb = impl_mongo.Connection() |
| | |
Python parser ACCEPTED repair!
Filtered out 19/19 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31794ms
Tidyparse (proposed/total): 156/259
Tidyparse (accepted/proposed): 155/156
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~class STARFUSIONInstaller(ClusterSetup):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def run(self, nodes, master, user, user_shell, volumes):~ | |
| ~ for node in nodes:~ | |
| ~ log.info("Installing STAR-FUSION 0.3.1 on %s" %(node.alias))~ | |
| ~ node.ssh.execute('wget -c -P /opt/software/star-fusion https://github.com/STAR-Fusion/STAR-Fusion/archive/v0.3.1.tar.gz')~ | |
| ~ node.ssh.execute('tar -xzf /opt/software/star-fusion/v0.3.1.tar.gz -C /opt/software/star-fusion')~ | |
| ~ node.ssh.execute('cd /opt/software/star-fusion/STAR-Fusion-0.3.1 && make'~ | |
| ~ node.ssh.execute('mkdir -p /usr/local/Modules/applications/star-fusion/;touch /usr/local/Modules/applications/star-fusion/0.3.1')~ | |
| ~ node.ssh.execute('echo "#%Module" >> /usr/local/Modules/applications/star-fusion/0.3.1')~ | |
| ~ node.ssh.execute('echo "set root /opt/software/star-fusion/STAR-Fusion-0.3.1" >> /usr/local/Modules/applications/star-fusion/0.3.1')~ | |
| ~ node.ssh.execute('echo -e "prepend-path\tPATH\t\$root" >> /usr/local/Modules/applications/star-fusion/0.3.1')~ | |
| ~~ | |
Filtered out 59/79 invalid samples!
Drew 20 samples before timeout
Synthesized repair in: 30992ms
Tidyparse (proposed/total): 157/260
Tidyparse (accepted/proposed): 156/157
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def _handler_autosample_enter(self, * args, ** kwargs): | def _handler_autosample_enter(self, * args, ** kwargs): |
| """Enter autosample state.""" | """Enter autosample state.""" |
| self._init_params() | self._init_params() |
| for stream_name in self._param_dict.get_keys(): | for stream_name in self._param_dict.get_keys(): |
| self._create_scheduler(stream_name, self._param_dict.get(stream_name))~)~ | self._create_scheduler(stream_name, self._param_dict.get(stream_name)) |
| self.~_driver_event(DriverAsyncEvent~.STATE_CHANGE~)~ | self.**_driver_eventDriverAsyncEvent**.STATE_CHANGE**(** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 71/73 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 31340ms
Tidyparse (proposed/total): 158/261
Tidyparse (accepted/proposed): 157/158
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def load_report(self, filename = None): | def load_report(self, filename = None): |
| if filename is None: | if filename is None: |
| filename = self.run_file_dialog("Open report", "open", "Report", "*.kreport") | filename = self.run_file_dialog("Open report", "open", "Report", "*.kreport") |
| if filename is None: | if filename is None: |
| return | return |
| r = self._catch_io_error(lambda: report.Report(filename) | r = self._catch_io_error(lambda: report.Report(filename)**)** |
| self.window.add_tab(Tab("Report", report.ReportWidget(self, r))) | self.window.add_tab(Tab("Report", report.ReportWidget(self, r))) |
| | |
Python parser ACCEPTED repair!
Filtered out 65/90 invalid samples!
Drew 25 samples before timeout
Synthesized repair in: 32262ms
Tidyparse (proposed/total): 159/262
Tidyparse (accepted/proposed): 158/159
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def password_wrapper(): | def password_wrapper(): |
| '''Func to get password. Either from environment var or commandline''' | '''Func to get password. Either from environment var or commandline''' |
| ~return(os~.environ.get('EVILUSER'), os.environ.get('EVILPASS') or(get_input("Username for Evilzone Wiki: "), getpass("Password for Evilzone Wiki: ")) | **returnos**.environ.get('EVILUSER'), os.environ.get('EVILPASS') or(get_input("Username for Evilzone Wiki: "), getpass("Password for Evilzone Wiki: ")) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 38ms
Tidyparse (proposed/total): 159/263
Tidyparse (accepted/proposed): 158/159
Original error: invalid syntax
| original | repair |
|----------------------------------------------|-------------------------|
| ~def recv(pid, n = none):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(n is none):~ | |
| ~ return native rtl_recv(pid)~ | |
| ~ else:~ | |
| ~ retV = [0] * n~ | |
| ~ i = 0~ | |
| ~ while i < n:~ | |
| ~ retV[i] = native rtl_recv(pid)~ | |
| ~ i = i + 1~ | |
| ~ return retV~ | |
| ~~ | |
Filtered out 146/246 invalid samples!
Drew 100 samples before timeout
Synthesized repair in: 63231ms
Tidyparse (proposed/total): 160/264
Tidyparse (accepted/proposed): 159/160
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|------------------------------------------------------------------------|
| def language(self, value): | def language(self, value): |
| self._language = value | self._language = value |
| if not self._language: | if not self._language: |
| self.stopwords = [] | self.stopwords = [] |
| else: | else: |
| self.stopwords = ~set(stopwords~.words(self.language.lower()) | self.stopwords = **setstopwords**.words(self.language.lower()) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 26ms
Tidyparse (proposed/total): 160/265
Tidyparse (accepted/proposed): 159/160
Original error: expected an indented block
| original | repair |
|------------------------------------------------|-------------------------|
| ~def SocketListener(self, source, condition):~ | **NO_REPAIR_PROPOSAL!** |
| ~ Data = self.Receive()~ | |
| ~ self.DataHandlerCallback(Data)~ | |
| ~ if len(Data) > 0:~ | |
| ~ return True~ | |
| ~ else:~ | |
| ~ return False~ | |
| ~~ | |
Filtered out 15/21 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31580ms
Tidyparse (proposed/total): 161/266
Tidyparse (accepted/proposed): 160/161
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|-------------------------------------------------------------------------|
| def ask_user(options): | def ask_user(options): |
| if len(options) == 0: | if len(options) == 0: |
| return None | return None |
| for opt_index in range(len(options))~)~: | for opt_index in range(len(options)): |
| print(str(opt_index + 1) + ": " + options[opt_index]) | print(str(opt_index + 1) + ": " + options[opt_index]) |
| print("Please choose a valid number and press enter to continue: ") | print("Please choose a valid number and press enter to continue: ") |
| try: | try: |
| return options[int(input()) - 1] | return options[int(input()) - 1] |
| except: | except: |
| return None | return None |
| | |
Python parser ACCEPTED repair!
Filtered out 110/110 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32578ms
Tidyparse (proposed/total): 161/267
Tidyparse (accepted/proposed): 160/161
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------|-------------------------|
| ~def bin(integer):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(integer <= 1):~ | |
| ~ return str(integer)~ | |
| ~ else:~ | |
| ~ return str(bin(integer >> 1)) + str(integer & 1)~ | |
| ~~ | |
Filtered out 158/199 invalid samples!
Drew 41 samples before timeout
Synthesized repair in: 64464ms
Tidyparse (proposed/total): 162/268
Tidyparse (accepted/proposed): 161/162
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|----------------------------------------------------------------------------|
| def test_get_router_error(self): | def test_get_router_error(self): |
| self.mock_api.get_router.side_effect = w_exc.HTTPInternalServerError() | self.mock_api.get_router.side_effect = w_exc.HTTPInternalServerError() |
| self.assertRaises(midonet_lib.MidonetApiException, | self.assertRaises(midonet_lib.MidonetApiException, |
| self.client.get_router, uuidutils.generate_uuid~()~ | self.client.get_router, uuidutils.generate_uuid |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 25ms
Tidyparse (proposed/total): 162/269
Tidyparse (accepted/proposed): 161/162
Original error: expected an indented block
| original | repair |
|----------------------------------------------|-------------------------|
| ~def setSparseFeatSigmabyID(self, id, val):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if id < len(self.sparseSigma):~ | |
| ~ self.sparseSigma[id] = val~ | |
| ~ return 1~ | |
| ~ return - 1~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 40ms
Tidyparse (proposed/total): 162/270
Tidyparse (accepted/proposed): 161/162
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------------------------|-------------------------|
| ~import argparse~ | **NO_REPAIR_PROPOSAL!** |
| ~import os~ | |
| ~import sys~ | |
| ~import traceback~ | |
| ~import shlex~ | |
| ~from typing import List, Optional, Callable, Tuple~ | |
| ~def _parser_exit(parser: argparse.ArgumentParser, proc: "DirectoryListProcessor", _ = 0,~ | |
| ~ message: Optional[str] = None) -> None:~ | |
| ~ """Override the default exit in the parser."""~ | |
| ~ if message:~ | |
| ~ parser._print_message(message, sys.stderr)~ | |
| ~ proc.successful_parse = False~ | |
| ~~ | |
Filtered out 83/87 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 35571ms
Tidyparse (proposed/total): 163/271
Tidyparse (accepted/proposed): 162/163
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------|-------------------------------------------------------|
| def d1(self): | def d1(self): |
| ''' Helper function.''' | ''' Helper function.''' |
| d1 = ((log(self.initial_value / self.strike) | d1 = ((log(self.initial_value / self.strike) |
| +(self.short_rate - self.dividend_yield | +(self.short_rate - self.dividend_yield |
| + 0.5 * self.volatility ** 2) * self.ttm) | + 0.5 * self.volatility ** 2) * self.ttm) |
| /~(~self.volatility * sqrt(self.ttm)) | /self.volatility * sqrt(self.ttm)) |
| return d1 | return d1 |
| | |
Python parser ACCEPTED repair!
Filtered out 2/10 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 80642ms
Tidyparse (proposed/total): 164/272
Tidyparse (accepted/proposed): 163/164
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| class MyGfxButton(QtGui.QGraphicsItem): | class MyGfxButton(QtGui.QGraphicsItem): |
| Type = QtGui.QGraphicsItem.UserType + 1 | Type = QtGui.QGraphicsItem.UserType + 1 |
| def __init__(self, parent, text): | def __init__(self, parent, text): |
| QtGui.QGraphicsItem.__init__(self) | QtGui.QGraphicsItem.__init__(self) |
| self.txt = QtGui.QGraphicsSimpleTextItem(self) | self.txt = QtGui.QGraphicsSimpleTextItem(self) |
| self.txt.setText(text) | self.txt.setText(text) |
| self.setFlag(QtGui.QGraphicsItem.ItemIsMovable) | self.setFlag(QtGui.QGraphicsItem.ItemIsMovable) |
| self.graph = parent | self.graph = parent |
| def boundingRect(self): | def boundingRect(self): |
| adjust = 2.0 | adjust = 2.0 |
| return QtCore.QRectF~(~- 55 - adjust, - 30 - adjust, 113 + adjust, 63 | return QtCore.QRectF- 55 - adjust, - 30 - adjust, 113 + adjust, 63 |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 39ms
Tidyparse (proposed/total): 164/273
Tidyparse (accepted/proposed): 163/164
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------------------------------------------|-------------------------|
| ~def isPreviouslyContactedUser(self, userID):~ | **NO_REPAIR_PROPOSAL!** |
| ~ query = """SELECT COUNT (firstContact) from {tableName} where targetUserID={uid};""".format(~ | |
| ~ tableName = "ContactEvents"~ | |
| ~ uid = userID~ | |
| ~ )~ | |
| ~ r = self.DB.execute(query)~ | |
| ~ rowcount = r.fetchone()[0]~ | |
| ~ return rowcount > 0~ | |
| ~~ | |
Filtered out 40/61 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 31965ms
Tidyparse (proposed/total): 165/274
Tidyparse (accepted/proposed): 164/165
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def chunk_str(s, n, char): | def chunk_str(s, n, char): |
| """Insert `char` character every `n` characters in string `s`.""" | """Insert `char` character every `n` characters in string `s`.""" |
| if n < 1: | if n < 1: |
| raise ValueError( | raise ValueError( |
| "Cannot split string into chunks with n=%d.n must be >= 1." % n) | "Cannot split string into chunks with n=%d.n must be >= 1." % n) |
| return char.join(~(~s[i: i + n] for i in range(0, len(s), n)) | return char.join(s[i: i + n] for i in range(0, len(s), n)) |
| | |
Python parser ACCEPTED repair!
Filtered out 23/45 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 31534ms
Tidyparse (proposed/total): 166/275
Tidyparse (accepted/proposed): 165/166
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def by_date(instance, filename): | def by_date(instance, filename): |
| datepart = force_unicode(datetime.datetime.now().strftime(smart_str("%Y/%m/%d"))) | datepart = force_unicode(datetime.datetime.now().strftime(smart_str("%Y/%m/%d"))) |
| return os.path.join(datepart, ~get_valid_filename(filename)~ | return os.path.join(datepart, **get_valid_filenamefilename** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 12/13 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 52892ms
Tidyparse (proposed/total): 167/276
Tidyparse (accepted/proposed): 166/167
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, RegexDialog): | def retranslateUi(self, RegexDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| RegexDialog.setWindowTitle(_translate("RegexDialog", "Regular expression tester – Coquery")) | RegexDialog.setWindowTitle(_translate("RegexDialog", "Regular expression tester – Coquery")) |
| self.label_3.setText(_translate("RegexDialog", "Match groups:")) | self.label_3.setText(_translate("RegexDialog", "Match groups:")) |
| self.text_cheatsheet.setHtml(_translate("RegexDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | self.text_cheatsheet.setHtml(_translate("RegexDialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 22/22 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35145ms
Tidyparse (proposed/total): 167/277
Tidyparse (accepted/proposed): 166/167
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def validate(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Add validation for update_policy"""~ | |
| ~ super(InstanceGroup, self).validate()~ | |
| ~ if self.update_policy is not None:~ | |
| ~ self.update_policy.validate()~ | |
| ~ policy_name = self.ROLLING_UPDATE~ | |
| ~ if(policy_name in self.update_policy and~ | |
| ~ self.update_policy[policy_name] is not None):~ | |
| ~ pause_time = self.update_policy[policy_name][self.PAUSE_TIME]~ | |
| ~ if iso8601utils.parse_isoduration(pause_time) > 3600:~ | |
| ~ msg = _('Maximum %s is 1 hour.') % self.PAUSE_TIME~ | |
| ~ raise ValueError(msg)~ | |
| ~~ | |
Filtered out 43/47 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32457ms
Tidyparse (proposed/total): 168/278
Tidyparse (accepted/proposed): 167/168
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| def __init__(self, config = {}): | def __init__(self, config = {}): |
| self.config = config | self.config = config |
| plugin_path = self._get_config(self.PLUGIN_PATH) | plugin_path = self._get_config(self.PLUGIN_PATH) |
| if not plugin_path: | if not plugin_path: |
| plugin_path = os.path.join(os.path.dirname(os.path.realpath(__file__), 'plugins') | plugin_path = os.path.join(os.path.dirname(os.path.realpath(__file__), 'plugins')**)** |
| self.plugin_path = plugin_path | self.plugin_path = plugin_path |
| self.plugin_rgty = plugin.PluginRegistry(self.plugin_path) | self.plugin_rgty = plugin.PluginRegistry(self.plugin_path) |
| | |
Python parser ACCEPTED repair!
Filtered out 27/29 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 32830ms
Tidyparse (proposed/total): 169/279
Tidyparse (accepted/proposed): 168/169
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def test_parsing_notmuch_config_with_non_bool_synchronize_flag_fails(self): | def test_parsing_notmuch_config_with_non_bool_synchronize_flag_fails(self): |
| with tempfile.NamedTemporaryFile(delete = False) as f: | with tempfile.NamedTemporaryFile(delete = False) as f: |
| f.write(textwrap.dedent("""[maildir]""") | f.write(textwrap.dedent("""[maildir]""")**)** |
| self.addCleanup(os.unlink, f.name) | self.addCleanup(os.unlink, f.name) |
| with self.assertRaises(ConfigError): | with self.assertRaises(ConfigError): |
| SettingsManager(notmuch_rc = f.name) | SettingsManager(notmuch_rc = f.name) |
| | |
Python parser ACCEPTED repair!
Filtered out 81/92 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 37741ms
Tidyparse (proposed/total): 170/280
Tidyparse (accepted/proposed): 169/170
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| def __init__(self, conf, mapfactory, opsonlineresource): | def __init__(self, conf, mapfactory, opsonlineresource): |
| self.conf = conf | self.conf = conf |
| self.mapfactory = mapfactory | self.mapfactory = mapfactory |
| self.opsonlineresource = opsonlineresource | self.opsonlineresource = opsonlineresource |
| if self.conf.has_option('service', 'allowedepsgcodes'): | if self.conf.has_option('service', 'allowedepsgcodes'): |
| self.allowedepsgcodes = map(lambda code: 'epsg: %s' % code, self.conf.get('service', 'allowedepsgcodes'~)~.split(', '))) | self.allowedepsgcodes = map(lambda code: 'epsg: %s' % code, self.conf.get('service', 'allowedepsgcodes'.split(', '))) |
| else: | else: |
| raise ServerConfigurationError('Allowed EPSG codes not properly configured.') | raise ServerConfigurationError('Allowed EPSG codes not properly configured.') |
| self.capabilities = None | self.capabilities = None |
| | |
Python parser ACCEPTED repair!
Filtered out 22/43 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 31651ms
Tidyparse (proposed/total): 171/281
Tidyparse (accepted/proposed): 170/171
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| def avatar(self, size): | def avatar(self, size): |
| import hashlib | import hashlib |
| email_md5 = hashlib.md5(self.email).hexdigest() | email_md5 = hashlib.md5(self.email).hexdigest() |
| return 'http: //gravatar.com/avatar/{}?d=mm&s={}'.format(email_md5, ~str(size)~ | return 'http: //gravatar.com/avatar/{}?d=mm&s={}'.format(email_md5, **strsize** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 371/371 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 57172ms
Tidyparse (proposed/total): 171/282
Tidyparse (accepted/proposed): 170/171
Original error: unexpected indent
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~def l2_unfiltered_if_group(self, port):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """ An indirect OpenFlow interface with no VLAN filtering or tagging"""~ | |
| ~ MAX_PORT = 0xFFFF~ | |
| ~ assert(port <= MAX_PORT)~ | |
| ~ return self._ofdpa_group_id(port, 11)~ | |
| ~~ | |
Filtered out 4/7 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 30261ms
Tidyparse (proposed/total): 172/283
Tidyparse (accepted/proposed): 171/172
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| def rpc_finfo(self, arg): | def rpc_finfo(self, arg): |
| (path, idx) = logic.parse_clause(arg) | (path, idx) = logic.parse_clause(arg) |
| return render_list(self.__finfo0(path), idx, lambda i, t: logic.render_term((t[0], str(t[1]), str(t[2]))) | return render_list(self.__finfo0(path), idx, lambda i, t: logic.render_term((t[0], str(t[1]), str(t[2])))**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 52381ms
Tidyparse (proposed/total): 173/284
Tidyparse (accepted/proposed): 172/173
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, Dialog): | def retranslateUi(self, Dialog): |
| Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "About uRSSus", None, QtGui.QApplication.UnicodeUTF8)) | Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "About uRSSus", None, QtGui.QApplication.UnicodeUTF8)) |
| self.okButton.setText(QtGui.QApplication.translate("Dialog", "&Close", None, QtGui.QApplication.UnicodeUTF8)) | self.okButton.setText(QtGui.QApplication.translate("Dialog", "&Close", None, QtGui.QApplication.UnicodeUTF8)) |
| self.textBrowser.setHtml(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | self.textBrowser.setHtml(QtGui.QApplication.translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 24/27 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 36520ms
Tidyparse (proposed/total): 174/285
Tidyparse (accepted/proposed): 173/174
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|----------------------------------------------------------------------|
| class StackFilter(object): | class StackFilter(object): |
| def __init__(self, has_stack = True): | def __init__(self, has_stack = True): |
| self.has_stack = has_stack | self.has_stack = has_stack |
| def filter(self, record): | def filter(self, record): |
| has_stack = bool((record.exc_info and record.exc_info[0]) or | has_stack = bool((record.exc_info and record.exc_info[0]) or |
| ~getattr(record~, 'show_stack', False) | **getattrrecord**, 'show_stack', False) |
| return has_stack == self.has_stack | return has_stack == self.has_stack |
| | |
Python parser ACCEPTED repair!
Filtered out 41/48 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 36269ms
Tidyparse (proposed/total): 175/286
Tidyparse (accepted/proposed): 174/175
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------|----------------------------------------------------|
| def FromDict(cls, run_info, d): | def FromDict(cls, run_info, d): |
| assert d.get('units', None) == None | assert d.get('units', None) == None |
| return cls(run_info, name = d['name'], | return cls(run_info, name = d['name'], |
| description = d.get('description', None), | description = d.get('description', None), |
| value = d['value'], | value = d['value'], |
| important = d['important'], | important = d['important'], |
| ir_stable_id = d.get('ir_stable_id', None) | ir_stable_id = d.get('ir_stable_id', None) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 130/216 invalid samples!
Drew 86 samples before timeout
Synthesized repair in: 93460ms
Tidyparse (proposed/total): 176/287
Tidyparse (accepted/proposed): 175/176
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|--------------------------------------------------------|
| class NoticeTypeFactory(factory.DjangoModelFactory): | class NoticeTypeFactory(factory.DjangoModelFactory): |
| FACTORY_FOR = NoticeType | FACTORY_FOR = NoticeType |
| default = NOTICE_MEDIA_DEFAULTS[NOTICE_MEDIA[0][0]~]]~ | default = NOTICE_MEDIA_DEFAULTS[NOTICE_MEDIA[0][0] |
| | **]** |
Python parser ACCEPTED repair!
Filtered out 14/27 invalid samples!
Drew 13 samples before timeout
Synthesized repair in: 32211ms
Tidyparse (proposed/total): 177/288
Tidyparse (accepted/proposed): 176/177
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|------------------------------------------------------------|
| def send(self): | def send(self): |
| self.update() | self.update() |
| logger.debug(json.dumps({"uptime": self.uptime})) | logger.debug(json.dumps({"uptime": self.uptime})) |
| self.write_message(json.dumps({"uptime": self.uptime}) | self.write_message(json.dumps({"uptime": self.uptime}) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 3/3 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35806ms
Tidyparse (proposed/total): 177/289
Tidyparse (accepted/proposed): 176/177
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-------------------------|
| ~def __init__(self, title = 'menu', prompt = '$ '):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """the constructor"""~ | |
| ~ self.prefix = ''~ | |
| ~ self.postfix = ')'~ | |
| ~ self.maxtextlen = 80 -(len(self.prefix) + len(self.postfix) + 1 + len(os.linesep)~ | |
| ~ self.title = title~ | |
| ~ self.prompt = prompt~ | |
| ~ self.entries = []~ | |
| ~ self.myout = sys.stdout~ | |
| ~ self.myerr = sys.stderr~ | |
| ~~ | |
Filtered out 28/28 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 41568ms
Tidyparse (proposed/total): 177/290
Tidyparse (accepted/proposed): 176/177
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------|-------------------------|
| ~def mouseMoved(self, evt):~ | **NO_REPAIR_PROPOSAL!** |
| ~ pos = evt[0]~ | |
| ~ if self.plot.sceneBoundingRect().contains(pos):~ | |
| ~ vb = self.plot.vb~ | |
| ~ mousePoint = vb.mapSceneToView(pos)~ | |
| ~ t_ms = mousePoint.x() * MS_TO_SEC~ | |
| ~ if t_ms > 0:~ | |
| ~ self.d_label.setText(SPAN_FORMAT %(t_ms))~ | |
| ~ self.v_line.setPos(mousePoint.x())~ | |
| ~ self.h_line.setPos(mousePoint.y())~ | |
| ~~ | |
Filtered out 50/50 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 44116ms
Tidyparse (proposed/total): 177/291
Tidyparse (accepted/proposed): 176/177
Original error: invalid syntax
| original | repair |
|------------------------------------------------|-------------------------|
| ~def testRaisesOnNonJNIMethod(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ test_data = """class MyInnerClass {"""~ | |
| ~ self.assertRaises(SyntaxError,~ | |
| ~ ,~ | |
| ~ jni_generator.JNIFromJavaSource,~ | |
| ~ test_data, 'foo/bar', TestOptions())~ | |
| ~~ | |
Filtered out 184/184 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 149025ms
Tidyparse (proposed/total): 177/292
Tidyparse (accepted/proposed): 176/177
Original error: expected an indented block
| original | repair |
|-----------------------------------------|-------------------------|
| ~def run(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ self.result = self.func(self)~ | |
| ~ self.done = True~ | |
| ~ if self.connections["done"] >= 1:~ | |
| ~ glock.acquire()~ | |
| ~ try:~ | |
| ~ finally:~ | |
| ~ glock.release()~ | |
| ~~ | |
Filtered out 59/63 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 31105ms
Tidyparse (proposed/total): 178/293
Tidyparse (accepted/proposed): 177/178
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|-----------------------------------------------------------------|
| def create_configure_dialog(self): | def create_configure_dialog(self): |
| if not self.dlg: | if not self.dlg: |
| self.dlg = PythonConsoleConfigDialog(self.get_data_dir~(~) | self.dlg = PythonConsoleConfigDialog(self.get_data_dir) |
| dialog = self.dlg.dialog() | dialog = self.dlg.dialog() |
| window = cedit.app_get_default().get_active_window() | window = cedit.app_get_default().get_active_window() |
| if window: | if window: |
| dialog.set_transient_for(window) | dialog.set_transient_for(window) |
| return dialog | return dialog |
| | |
Python parser ACCEPTED repair!
Filtered out 74/80 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30039ms
Tidyparse (proposed/total): 179/294
Tidyparse (accepted/proposed): 177/179
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| """Meshing: Make and plot a 3D prism mesh""" | """Meshing: Make and plot a 3D prism mesh""" |
| from fatiando import mesher | from fatiando import mesher |
| from fatiando.vis import myv | from fatiando.vis import myv |
| mesh = mesher.PrismMesh(bounds = (- 2, 2, - 3, 3, 0, 1), shape = ~(~4, 4, 4) | mesh = mesher.PrismMesh(bounds = (- 2, 2, - 3, 3, 0, 1), shape = 4, 4, 4) |
| myv.figure() | myv.figure() |
| plot = myv.prisms(mesh) | plot = myv.prisms(mesh) |
| axes = myv.axes(plot) | axes = myv.axes(plot) |
| myv.show() | myv.show() |
| | |
Python parser REJECTED repair because: positional argument follows keyword argument (<unknown>, line 4)
Drew 0 samples before timeout
Synthesized repair in: 32ms
Tidyparse (proposed/total): 179/295
Tidyparse (accepted/proposed): 177/179
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def rotate_event(pin):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Convert rotary encoder pulses into a new image index to be used"""~ | |
| ~ global state~ | |
| ~ global counter~ | |
| ~ global direction~ | |
| ~ ra = GPIO.input(22)~ | |
| ~ rb = GPIO.input(23)~ | |
| ~ ns = (ra ^ rb) | rb << 1~ | |
| ~ if state == ns:~ | |
| ~ return~ | |
| ~ dt = (ns - state) % 4~ | |
| ~ if dt == 3:~ | |
| ~ direction = - 1~ | |
| ~ elif dt == 1:~ | |
| ~ direction = 1~ | |
| ~ counter = (counter + direction) % slideshow_length~ | |
| ~ state = ns~ | |
| ~~ | |
Filtered out 28/36 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31054ms
Tidyparse (proposed/total): 180/296
Tidyparse (accepted/proposed): 178/180
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, SettingsDialog_base): | def retranslateUi(self, SettingsDialog_base): |
| SettingsDialog_base.setWindowTitle(QtGui.QApplication.translate("SettingsDialog_base", "HP Device Manager - Settings", None, QtGui.QApplication.UnicodeUTF8)) | SettingsDialog_base.setWindowTitle(QtGui.QApplication.translate("SettingsDialog_base", "HP Device Manager - Settings", None, QtGui.QApplication.UnicodeUTF8)) |
| self.textLabel3_2_2.~setText(QtGui~.QApplication.translate("SettingsDialog_base", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | self.textLabel3_2_2.**setTextQtGui**.QApplication.translate("SettingsDialog_base", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 70/78 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31964ms
Tidyparse (proposed/total): 181/297
Tidyparse (accepted/proposed): 179/181
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|------------------------------------------------------------------------|
| def setCurrentFilePath(self, path): | def setCurrentFilePath(self, path): |
| print("TRACE: setCurrentFilePath()") | print("TRACE: setCurrentFilePath()") |
| self.currentFilePath = path | self.currentFilePath = path |
| self.dirPathCtrl.SetValue(os.path.~dirname(self~.currentFilePath) | self.dirPathCtrl.SetValue(os.path.**dirnameself**.currentFilePath) |
| self.fileNameCtrl.SetValue(os.path.basename(self.currentFilePath)) | self.fileNameCtrl.SetValue(os.path.basename(self.currentFilePath)) |
| | |
Python parser ACCEPTED repair!
Filtered out 35/43 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 34183ms
Tidyparse (proposed/total): 182/298
Tidyparse (accepted/proposed): 180/182
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| def run_gevent_server(host = "127.0.0.1", port = 9001): | def run_gevent_server(host = "127.0.0.1", port = 9001): |
| """Runs a gevent server on Python 2.x""" | """Runs a gevent server on Python 2.x""" |
| from gevent import monkey; monkey.patch_all() | from gevent import monkey; monkey.patch_all() |
| from ws4py.websocket import EchoWebSocket | from ws4py.websocket import EchoWebSocket |
| from ws4py.server.geventserver import WebSocketWSGIApplication, WSGIServer | from ws4py.server.geventserver import WebSocketWSGIApplication, WSGIServer |
| server = WSGIServer(~(~host, port), WebSocketWSGIApplication(handler_cls = EchoWebSocket) | server = WSGIServer(host, port), WebSocketWSGIApplication(handler_cls = EchoWebSocket) |
| logger = logging.getLogger('autobahn_testsuite') | logger = logging.getLogger('autobahn_testsuite') |
| logger.warning("Serving gevent server on %s: %s" %(host, port)) | logger.warning("Serving gevent server on %s: %s" %(host, port)) |
| server.serve_forever() | server.serve_forever() |
| | |
Python parser ACCEPTED repair!
Filtered out 176/176 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 183253ms
Tidyparse (proposed/total): 182/299
Tidyparse (accepted/proposed): 180/182
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~def _check_size(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if os.path.getsize(self.tar_path) > self.MAX_UPLOAD_SIZE~ | |
| ~ log.info("{0} won't be uploaded, its size is too important.\n"~ | |
| ~ "You can send it directly to support by email.")~ | |
| ~ sys.exit(1)~ | |
| ~~ | |
Filtered out 100/100 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33020ms
Tidyparse (proposed/total): 182/300
Tidyparse (accepted/proposed): 180/182
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~def calc_cluster((k, v), kvi, kvo, i):~ | **NO_REPAIR_PROPOSAL!** |
| ~ del k, kvi, i~ | |
| ~ min_id = 0~ | |
| ~ min_dst = kmeans.grid_size * kmeans.grid_size~ | |
| ~ for(idm, mean) in enumerate(kmeans.means):~ | |
| ~ dst = calc_sq_dist(v, mean)~ | |
| ~ if dst < min_dst:~ | |
| ~ min_id = idm~ | |
| ~ min_dst = dst~ | |
| ~ kvo.add(min_id, v)~ | |
| ~~ | |
Filtered out 7/9 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30305ms
Tidyparse (proposed/total): 183/301
Tidyparse (accepted/proposed): 181/183
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| def _write_quote(self): | def _write_quote(self): |
| quote = self.scraped['quote'] | quote = self.scraped['quote'] |
| if 'symbol' in quote: | if 'symbol' in quote: |
| self.g.add((self.id_node, NS['cp']['symbol'], Literal(quote['symbol'])) | self.g.add((self.id_node, NS**)**['cp']['symbol'], Literal(quote['symbol'])) |
| if 'name' in quote: | if 'name' in quote: |
| company_name = quote['name'] | company_name = quote['name'] |
| CPNodeBuilder(self.g, self.id_node).structured().string_value('companyName', company_name) | CPNodeBuilder(self.g, self.id_node).structured().string_value('companyName', company_name) |
| | |
Python parser ACCEPTED repair!
Filtered out 6/10 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30426ms
Tidyparse (proposed/total): 184/302
Tidyparse (accepted/proposed): 182/184
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| def handle_noargs(self, ** options): | def handle_noargs(self, ** options): |
| self.set_options(** options) | self.set_options(** options) |
| if(isinstance(self.storage, FileSystemStorage) and | if(isinstance(self.storage, FileSystemStorage) and |
| self.storage.location): | self.storage.location): |
| destination_path = self.storage.location | destination_path = self.storage.location |
| destination_display = ':\n\n %s' % destination_path | destination_display = ':\n\n %s' % destination_path |
| else: | else: |
| destination_path = None | destination_path = None |
| destination_display = '.' | destination_display = '.' |
| if self.clear: | if self.clear: |
| clear_display = 'This will DELETE EXISTING FILES!' | clear_display = 'This will DELETE EXISTING FILES!' |
| else: | else: |
| clear_display = 'This will overwrite existing files!' | clear_display = 'This will overwrite existing files!' |
| if self.interactive: | if self.interactive: |
| confirm = input("""You have requested to collect static files at the destination""" | confirm = input("""You have requested to collect static files at the destination""" |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 16ms
Tidyparse (proposed/total): 184/303
Tidyparse (accepted/proposed): 182/184
Original error: invalid syntax
| original | repair |
|----------------------------------------|-------------------------|
| ~def str2num(self, size, s):~ | **NO_REPAIR_PROPOSAL!** |
| ~ i = 0~ | |
| ~ n = 0~ | |
| ~ while i < size~ | |
| ~ n = n |(ord(s[i]) <<(i * 8))~ | |
| ~ i = i + 1~ | |
| ~ return n~ | |
| ~~ | |
Filtered out 64/83 invalid samples!
Drew 19 samples before timeout
Synthesized repair in: 30168ms
Tidyparse (proposed/total): 185/304
Tidyparse (accepted/proposed): 183/185
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------|--------------------------------------|
| def signout(): | def signout(): |
| session.pop('username') | session.pop('username') |
| session.pop('signed') | session.pop('signed') |
| logout_user() | logout_user() |
| return redirect(url_for('index')~))~ | return redirect(url_for('index') |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 35ms
Tidyparse (proposed/total): 185/305
Tidyparse (accepted/proposed): 183/185
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------|-------------------------|
| ~def pop(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if len(self.d) < 2:~ | |
| ~ raise KeyError, 'popitem(): dictionary is empty'~ | |
| ~ k = self.d[self.hs][2]~ | |
| ~ self.remove(k)~ | |
| ~ return k~ | |
| ~~ | |
Filtered out 33/34 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 31075ms
Tidyparse (proposed/total): 186/306
Tidyparse (accepted/proposed): 184/186
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| def retranslateUi(self, AddFileDialog): | def retranslateUi(self, AddFileDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| AddFileDialog.setWindowTitle(_translate("AddFileDialog", "Add Files")) | AddFileDialog.setWindowTitle(_translate("AddFileDialog", "Add Files")) |
| AddFileDialog.setWhatsThis(_translate("AddFileDialog", "<b>Add Files Dialog</b>\n" | AddFileDialog.setWhatsThis(_translate("AddFileDialog", "<b>Add Files Dialog</b>\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 16/18 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 31637ms
Tidyparse (proposed/total): 187/307
Tidyparse (accepted/proposed): 185/187
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def get_body(doc): | def get_body(doc): |
| [elem.drop_tree() for elem in doc.xpath('.//script |.//link |.//style')] | [elem.drop_tree() for elem in doc.xpath('.//script |.//link |.//style')] |
| raw_html = unicode(tostring(doc.body or doc) | raw_html = unicode(tostring(doc.body or doc)**)** |
| return clean_attributes(raw_html) | return clean_attributes(raw_html) |
| | |
Python parser ACCEPTED repair!
Filtered out 75/92 invalid samples!
Drew 17 samples before timeout
Synthesized repair in: 38249ms
Tidyparse (proposed/total): 188/308
Tidyparse (accepted/proposed): 186/188
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| def index(self, req, ** kw): | def index(self, req, ** kw): |
| maestrano = MaestranoService.getInstance() | maestrano = MaestranoService.getInstance() |
| auth_request_url = AuthRequest.create(**(maestrano.getSettings().getSamlSettings()))~)~ | auth_request_url = AuthRequest.create(**(maestrano.getSettings().getSamlSettings())) |
| redirect = werkzeug.utils.redirect(auth_request_url) | redirect = werkzeug.utils.redirect(auth_request_url) |
| return redirect | return redirect |
| | |
Python parser ACCEPTED repair!
Filtered out 19/29 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 32215ms
Tidyparse (proposed/total): 189/309
Tidyparse (accepted/proposed): 187/189
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|------------------------------------------------------------------------|
| def print_ip6(ip6, offset, tag = ''): | def print_ip6(ip6, offset, tag = ''): |
| margin = ' ' * offset | margin = ' ' * offset |
| print(tag + get_tag() + " %s -> %s, proto=%d, tclass=%x," %( | print(tag + get_tag() + " %s -> %s, proto=%d, tclass=%x," %( |
| ip6.src_prefix, ip6.dst_prefix, ip6.proto, ip6.traffic_class)) | ip6.src_prefix, ip6.dst_prefix, ip6.proto, ip6.traffic_class)) |
| print(tag + get_tag() + " %sttl=%d, hlen=%s, plen=%s" %( | print(tag + get_tag() + " %sttl=%d, hlen=%s, plen=%s" %( |
| margin, ip6.hop_limit, ip6.hdr_len, ip6.pkt_len), | margin, ip6.hop_limit, ip6.hdr_len, ip6.pkt_len), |
| print("flow_label=%x, payload_len=%d, next_hdr=%d" %( | print("flow_label=%x, payload_len=%d, next_hdr=%d" %( |
| ip6.flow_label, ip6.payload_len, ip6.next_hdr)) | ip6.flow_label, ip6.payload_len, ip6.next_hdr))**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 83/129 invalid samples!
Drew 46 samples before timeout
Synthesized repair in: 59188ms
Tidyparse (proposed/total): 190/310
Tidyparse (accepted/proposed): 188/190
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|------------------------------------------------------------|
| def test_suite(): | def test_suite(): |
| return unittest.TestSuite(( | return unittest.TestSuite(( |
| unittest.~makeSuite(RepositoryTestCase~, 'test_'~)~, | unittest.**makeSuiteRepositoryTestCase**, 'test_', |
| ) | ) |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 190/311
Tidyparse (accepted/proposed): 188/190
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------------------------------|-------------------------|
| ~def createSuggestedVGName(partitions):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Given list of partition requests, come up with a reasonable VG name"""~ | |
| ~ i = 0~ | |
| ~ while 1:~ | |
| ~ tmpname = "VolGroup%02d" %(i, )~ | |
| ~ if not partitions.isVolumeGroupNameInUse(tmpname):~ | |
| ~ break~ | |
| ~ i = i + 1~ | |
| ~ if i > 99:~ | |
| ~ tmpname = ""~ | |
| ~ return tmpname~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 17ms
Tidyparse (proposed/total): 190/312
Tidyparse (accepted/proposed): 188/190
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~def ser_uint256(u):~ | **NO_REPAIR_PROPOSAL!** |
| ~ rs = ""~ | |
| ~ for i in xrange(8):~ | |
| ~ rs += struct.pack("<i", u & 0xffffffff l)~ | |
| ~ u >>= 32~ | |
| ~ return rs~ | |
| ~~ | |
Filtered out 58/62 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 36153ms
Tidyparse (proposed/total): 191/313
Tidyparse (accepted/proposed): 189/191
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|-------------------------------------------------------------|
| def __getitem__(self, * keys): | def __getitem__(self, * keys): |
| no_keys = keys.__len__() | no_keys = keys.__len__() |
| if no_keys == 0: | if no_keys == 0: |
| return | return |
| elif no_keys == 1: | elif no_keys == 1: |
| return Configurable.findAttr(self, keys[0]) | return Configurable.findAttr(self, keys[0]) |
| else: | else: |
| vals = [] | vals = [] |
| for key in keys: | for key in keys: |
| vals.~append(Configurable~.findAttr(self, key) | vals.**appendConfigurable**.findAttr(self, key) |
| return vals | return vals |
| | |
Python parser ACCEPTED repair!
Filtered out 20/20 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31175ms
Tidyparse (proposed/total): 191/314
Tidyparse (accepted/proposed): 189/191
Original error: unexpected indent
| original | repair |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def variableName(name):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''Method 3'''~ | |
| ~ return len(filter(lambda x: x not in["_"] + list(string.ascii_letters) + list(string.digits), str(name))) < 1 and(name[0].isalpha() or name[0] == "_")~ | |
| ~~ | |
Filtered out 48/48 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32965ms
Tidyparse (proposed/total): 191/315
Tidyparse (accepted/proposed): 189/191
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------|-------------------------|
| ~import yaml~ | **NO_REPAIR_PROPOSAL!** |
| ~import json~ | |
| ~yaml_file = 'my_test1.yml'~ | |
| ~json_file = 'my_test1.json'~ | |
| ~my_dict = {~ | |
| ~ 'hostname': 'routerabc',~ | |
| ~ 'ntp': '10.1.1.1',~ | |
| ~ 'domain_name': 'gio.com'~ | |
| ~ }~ | |
| ~my_list = [~ | |
| ~ 'testing router 1',~ | |
| ~ 'testing router 2',~ | |
| ~ my_dict,~ | |
| ~ ]~ | |
| ~with open("my_test1.json") as f:~ | |
| ~ json_list = json.load(f)~ | |
| ~with open("my_test1.ymal" as f:~ | |
| ~ yaml_list = yaml.load(f)~ | |
| ~~ | |
Filtered out 51/66 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 33085ms
Tidyparse (proposed/total): 192/316
Tidyparse (accepted/proposed): 190/192
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def list_add(func, * lists): | def list_add(func, * lists): |
| """Add the values of the iterables passed together and return them""" | """Add the values of the iterables passed together and return them""" |
| if func in(operator.add, None): | if func in(operator.add, None): |
| sumfunc = lambda * x: sum(x) | sumfunc = lambda * x: sum(x) |
| else: | else: |
| sumfunc = lambda * x: functools.reduce(func, x) | sumfunc = lambda * x: functools.reduce(func, x) |
| return list(map(sumfunc, * lists))~)~ | return list(map(sumfunc, * lists)) |
| | |
Python parser ACCEPTED repair!
Filtered out 75/79 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32570ms
Tidyparse (proposed/total): 193/317
Tidyparse (accepted/proposed): 191/193
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| def _get_ellipsoid(code: int, conn: sqlite3.Connection) -> Ellipsoid: | def _get_ellipsoid(code: int, conn: sqlite3.Connection) -> Ellipsoid: |
| c = conn.execute('SELECT ellipsoid_name, semi_major_axis, inv_flattening, semi_minor_axis, uom_code ' | c = conn.execute('SELECT ellipsoid_name, semi_major_axis, inv_flattening, semi_minor_axis, uom_code ' |
| 'FROM epsg_ellipsoid ' | 'FROM epsg_ellipsoid ' |
| 'WHERE ellipsoid_code = ?; ', ~(~code, ) | 'WHERE ellipsoid_code = ?; ', code, ) |
| row = c.fetchone() | row = c.fetchone() |
| if row: | if row: |
| return None | return None |
| else: | else: |
| raise EPSGException(f"No ellipsoid with uid '{make_id(code)}'.") | raise EPSGException(f"No ellipsoid with uid '{make_id(code)}'.") |
| | |
Python parser ACCEPTED repair!
Filtered out 32/40 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 34569ms
Tidyparse (proposed/total): 194/318
Tidyparse (accepted/proposed): 192/194
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| def sendRequest(url, body, contentType): | def sendRequest(url, body, contentType): |
| request = urllib2.Request(url, body, {'Content-Type': contentType}) | request = urllib2.Request(url, body, {'Content-Type': contentType}) |
| response = urllib2.urlopen(request) | response = urllib2.urlopen(request) |
| if 200 <= response.getcode() < 300: | if 200 <= response.getcode() < 300: |
| logging.warn("POST to %r got response code %d: %r", url, response.getcode(), response.read~(~) | logging.warn("POST to %r got response code %d: %r", url, response.getcode(), response.read) |
| else: | else: |
| logging.info("POST to %r", url) | logging.info("POST to %r", url) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 44ms
Tidyparse (proposed/total): 194/319
Tidyparse (accepted/proposed): 192/194
Original error: expected an indented block
| original | repair |
|---------------------------------------------------|-------------------------|
| ~def GetJDPicSrc(str):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ start_int = str.index("src=\'http://")~ | |
| ~ end_int = str.index("\' />", start_int)~ | |
| ~ PicSrc = str[(start_int + 5): end_int]~ | |
| ~ str = str[end_int: len(str)]~ | |
| ~ return PicSrc + " " + GetJDPicSrc(str)~ | |
| ~ except:~ | |
| ~ return " "~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 40022ms
Tidyparse (proposed/total): 195/320
Tidyparse (accepted/proposed): 193/195
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, ApplyCalleeDialog): | def retranslateUi(self, ApplyCalleeDialog): |
| ApplyCalleeDialog.setWindowTitle(QtGui.QApplication.translate("ApplyCalleeDialog", "ApplyCalleeType", None, QtGui.QApplication.UnicodeUTF8)) | ApplyCalleeDialog.setWindowTitle(QtGui.QApplication.translate("ApplyCalleeDialog", "ApplyCalleeType", None, QtGui.QApplication.UnicodeUTF8)) |
| self.label.setText(QtGui.QApplication.translate("ApplyCalleeDialog", "Enter Type\n" | self.label.setText(QtGui.QApplication.translate("ApplyCalleeDialog", "Enter Type\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 57/63 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30943ms
Tidyparse (proposed/total): 196/321
Tidyparse (accepted/proposed): 194/196
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def _poly_points(N = 6): | def _poly_points(N = 6): |
| """returns the coordinates of a regular polygon on the unit circle""" | """returns the coordinates of a regular polygon on the unit circle""" |
| ts = np.pi *(.5 + 2. / N * np.~arange(N~) | ts = np.pi *(.5 + 2. / N * np.**arangeN**) |
| return np.stack([np.cos(ts), np.sin(ts)]) | return np.stack([np.cos(ts), np.sin(ts)]) |
| | |
Python parser ACCEPTED repair!
Filtered out 12/12 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31795ms
Tidyparse (proposed/total): 196/322
Tidyparse (accepted/proposed): 194/196
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~import sys~ | **NO_REPAIR_PROPOSAL!** |
| ~if len(sys.argv) < 2 or len(sys.argv[1]) < 2: print 'V'~ | |
| ~my_moves, opp_moves = sys.argv[1], sys.argv[2]~ | |
| ~moves = ('R', 'P', 'S', 'V', 'L')~ | |
| ~history = zip([moves.index(i) for i in my_moves],~ | |
| ~ [moves.index(i) for i in opp_moves])~ | |
| ~~ | |
Filtered out 16/41 invalid samples!
Drew 25 samples before timeout
Synthesized repair in: 30908ms
Tidyparse (proposed/total): 197/323
Tidyparse (accepted/proposed): 195/197
Original error: unbalanced (){}[]
| original | repair |
|-------------------------|------------------------------|
| class GUID(Structure): | class GUID(Structure): |
| _pack_ = 4 | _pack_ = 4 |
| _fields_ = [ | _fields_ = [ |
| ("data1", DWORD), | ("data1", DWORD), |
| ("data2", WORD), | ("data2", WORD), |
| ("data3", WORD), | ("data3", WORD), |
| ("data4", BYTE * 6) | ("data4", BYTE * 6)**]** |
| | |
Python parser ACCEPTED repair!
Filtered out 113/137 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 49220ms
Tidyparse (proposed/total): 198/324
Tidyparse (accepted/proposed): 195/198
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------|-------------------------------------------------|
| def local_getdatabases(): | def local_getdatabases(): |
| return~{~ | return |
| 'default': { | 'default': { |
| 'ENGINE': 'django.db.backends.sqlite3', | 'ENGINE': 'django.db.backends.sqlite3', |
| 'NAME': basedir() + 'localdatabase.db', | 'NAME': basedir() + 'localdatabase.db', |
| 'USER': '', | 'USER': '', |
| 'PASSWORD': '', | 'PASSWORD': '', |
| 'HOST': '', | 'HOST': '', |
| 'PORT': '', | 'PORT': '', |
| } | } |
| | |
Python parser REJECTED repair because: illegal target for annotation (<unknown>, line 3)
Filtered out 59/65 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32016ms
Tidyparse (proposed/total): 199/325
Tidyparse (accepted/proposed): 196/199
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def cb_group_clicked(barchart, group, bar): | def cb_group_clicked(barchart, group, bar): |
| print("Bar('%s', '%s')clicked." ~%(group~.get_label(), bar.get_label()) | print("Bar('%s', '%s')clicked." **%group**.get_label(), bar.get_label()) |
| barchart.set_rotate_group_labels(not barchart.get_rotate_group_labels()) | barchart.set_rotate_group_labels(not barchart.get_rotate_group_labels()) |
| | |
Python parser ACCEPTED repair!
Filtered out 46/54 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 33514ms
Tidyparse (proposed/total): 200/326
Tidyparse (accepted/proposed): 197/200
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| def experiment_results(experiment): | def experiment_results(experiment): |
| results = [chain_results(chain, experiment) for chain in basics.chain_codes[experiment - 1]] | results = [chain_results(chain, experiment) for chain in basics.chain_codes[experiment - 1]] |
| return{'data': results, 'experiment': experiment, 'starting_generation': 0, | return{'data': results, 'experiment': experiment, 'starting_generation': 0, |
| 'y_range': (3, 9)~}~, 'y_label': 'Average word length', 'data_type': 'word_length'} | 'y_range': (3, 9), 'y_label': 'Average word length', 'data_type': 'word_length'} |
| | |
Python parser ACCEPTED repair!
Filtered out 17/21 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30196ms
Tidyparse (proposed/total): 201/327
Tidyparse (accepted/proposed): 198/201
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, Form): | def retranslateUi(self, Form): |
| Form.setWindowTitle(_translate("Form", "Warming : Forgetting !", None)) | Form.setWindowTitle(_translate("Form", "Warming : Forgetting !", None)) |
| self.label_forget.~setText~(~_translate(~"Form", "Vous avez coché une case pour lancer la classification.\n" | self.label_forget.**setText_translate**("Form", "Vous avez coché une case pour lancer la classification.\n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 40/42 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30361ms
Tidyparse (proposed/total): 202/328
Tidyparse (accepted/proposed): 199/202
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------|--------------------------------------------------------------------|
| def _migrate_dates(model, fields): | def _migrate_dates(model, fields): |
| default_tz = timezone.get_default_timezone() | default_tz = timezone.get_default_timezone() |
| for obj in model.objects.all(): | for obj in model.objects.all(): |
| for field in fields: | for field in fields: |
| dt = getattr(obj, field) | dt = getattr(obj, field) |
| if dt: | if dt: |
| setattr(obj, field, _new_date(dt, default_tz) | setattr(obj, field, _new_date(dt, default_tz)**)** |
| obj.save() | obj.save() |
| | |
Python parser ACCEPTED repair!
Filtered out 17/25 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31188ms
Tidyparse (proposed/total): 203/329
Tidyparse (accepted/proposed): 200/203
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| def serve_thread_udp(host, port, handler): | def serve_thread_udp(host, port, handler): |
| try: | try: |
| if OsInterfaceIsSupported(): | if OsInterfaceIsSupported(): |
| server = ThreadingUDPServer((settings.Config.Bind_To, port), handler) | server = ThreadingUDPServer((settings.Config.Bind_To, port), handler) |
| server.serve_forever() | server.serve_forever() |
| else: | else: |
| server = ThreadingUDPServer((host, port), handler) | server = ThreadingUDPServer((host, port), handler) |
| server.serve_forever() | server.serve_forever() |
| except: | except: |
| ~print~(~color(~"[!] ", 1, 1) + "Error starting UDP server on port " + str( | **printcolor**("[!] ", 1, 1) + "Error starting UDP server on port " + str( |
| port) + ", check permissions or other servers running." | port) + ", check permissions or other servers running." |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 62ms
Tidyparse (proposed/total): 203/330
Tidyparse (accepted/proposed): 200/203
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------------------------------------|-------------------------|
| ~def getDateFromString(self, dateString):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''returns the list of items scheduled for the date given in the format of yyyy,mm,dd'''~ | |
| ~ items = []~ | |
| ~ for i in self.data:~ | |
| ~ if dateString == '{0:0>4},{1:0>2},{2:0>2}'.format(i[0], i[1], i[2])~ | |
| ~ items.append(i[3: ])~ | |
| ~ return items~ | |
| ~~ | |
Filtered out 59/106 invalid samples!
Drew 47 samples before timeout
Synthesized repair in: 31251ms
Tidyparse (proposed/total): 204/331
Tidyparse (accepted/proposed): 201/204
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def connection_made(self, s): | def connection_made(self, s): |
| self.connection = s | self.connection = s |
| self.connection.write(chr(len(protocol_name) + protocol_name + | self.connection.write(chr(len(protocol_name) + protocol_name + |
| (~chr(0)~ * 8) + self.downloadid) | **chr0**( * 8) + self.downloadid) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 4/6 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30568ms
Tidyparse (proposed/total): 205/332
Tidyparse (accepted/proposed): 202/205
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 205/333
Tidyparse (accepted/proposed): 202/205
Original error: expected an indented block
| original | repair |
|------------------------------------------------------|-------------------------|
| ~def movimientoArriba(self, listaObstaculos):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.orientacion != 'N':~ | |
| ~ self.ImagenVehiculo = self.__cargarVehiculo(0)~ | |
| ~ self.orientacion = 'N'~ | |
| ~ self.rect.top -= self.velocidad~ | |
| ~ self.__movimiento()~ | |
| ~ for muro in listaObstaculos:~ | |
| ~ if self.rect.colliderect(muro.rect):~ | |
| ~ if self.rect.top < muro.rect.bottom:~ | |
| ~ self.rect.top = muro.rect.bottom~ | |
| ~~ | |
Filtered out 74/74 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33110ms
Tidyparse (proposed/total): 205/334
Tidyparse (accepted/proposed): 202/205
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~def Gaussian(x):~ | **NO_REPAIR_PROPOSAL!** |
| ~ x = float(x)~ | |
| ~ if(x > 0.3 and x < 6.0):~ | |
| ~ x = 0.0~ | |
| ~ from math import pi, exp~ | |
| ~ return((1.0 / sqrt(2.0 * pi)) * exp(- x * x / 2.0))~ | |
| ~~ | |
Filtered out 43/47 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 33436ms
Tidyparse (proposed/total): 206/335
Tidyparse (accepted/proposed): 203/206
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def find_dic_dim(dic, dim): | def find_dic_dim(dic, dim): |
| """Find dimension in dictionary which corresponds to array dimension.""" | """Find dimension in dictionary which corresponds to array dimension.""" |
| dic_dims = [int(i[1]) - 1 for i in dic['layout'][1] | dic_dims = [int(i[1]) - 1 for i in dic['layout'][1]**]** |
| return dic_dims.index(dim) | return dic_dims.index(dim) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 41ms
Tidyparse (proposed/total): 206/336
Tidyparse (accepted/proposed): 203/206
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------------------------|-------------------------|
| ~def hessian(image, scale_range = (1, 10), scale_step = 2, beta1 = 0.5, beta2 = 15):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Filter an image with the Hessian filter."""~ | |
| ~ filtered, lambdas = _frangi_hessian_common_filter(image~ | |
| ~ scale_range, scale_step,~ | |
| ~ beta1, beta2)~ | |
| ~ filtered[lambdas < 0] = 0~ | |
| ~ out = np.max(filtered, axis = 0)~ | |
| ~ out[out <= 0] = 1~ | |
| ~ return out~ | |
| ~~ | |
Filtered out 52/70 invalid samples!
Drew 18 samples before timeout
Synthesized repair in: 70374ms
Tidyparse (proposed/total): 207/337
Tidyparse (accepted/proposed): 204/207
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| '''The settings for OSMC are handled by the OSMC Settings Addon(OSA).''' | '''The settings for OSMC are handled by the OSMC Settings Addon(OSA).''' |
| import xbmc | import xbmc |
| import xbmcaddon | import xbmcaddon |
| import xbmcgui | import xbmcgui |
| import subprocess | import subprocess |
| import sys | import sys |
| import os | import os |
| import threading | import threading |
| addonid = "script.module.osmcsetting.pi" | addonid = "script.module.osmcsetting.pi" |
| __addon__ = xbmcaddon.Addon(addonid) | __addon__ = xbmcaddon.Addon(addonid) |
| DIALOG = xbmcgui.Dialog() | DIALOG = xbmcgui.Dialog() |
| sys.path.append(xbmc.translatePath(os.path.join(xbmcaddon.Addon(addonid).getAddonInfo('path'), 'resources', 'lib')))~)~ | sys.path.append(xbmc.translatePath(os.path.join(xbmcaddon.Addon(addonid).getAddonInfo('path'), 'resources', 'lib'))) |
| import OSMC_ConfigParser as ct | import OSMC_ConfigParser as ct |
| from CompLogger import comprehensive_logger as clog | from CompLogger import comprehensive_logger as clog |
| | |
Python parser ACCEPTED repair!
Filtered out 57/63 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 35464ms
Tidyparse (proposed/total): 208/338
Tidyparse (accepted/proposed): 205/208
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------|-------------------------------------------------------------------|
| def create_tables(self): | def create_tables(self): |
| schema = ~open(os~.path.realpath("yamodb/schema.sql").read() | schema = **openos**.path.realpath("yamodb/schema.sql").read() |
| cursor = self.sqlcnx.cursor() | cursor = self.sqlcnx.cursor() |
| cursor.executescript(schema) | cursor.executescript(schema) |
| self.sqlcnx.commit() | self.sqlcnx.commit() |
| return True | return True |
| | |
Python parser ACCEPTED repair!
Filtered out 19/19 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33607ms
Tidyparse (proposed/total): 208/339
Tidyparse (accepted/proposed): 205/208
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def print_article(article: Article):~ | **NO_REPAIR_PROPOSAL!** |
| ~ title__format = "Title: {}".format(article.title)~ | |
| ~ print(title__format)~ | |
| ~ print(("=" * len(title__format) + "\n")~ | |
| ~ print("by: {}, on: {}\n\n".format(article.author, article.date_time))~ | |
| ~ print(article.content)~ | |
| ~~ | |
Filtered out 66/91 invalid samples!
Drew 25 samples before timeout
Synthesized repair in: 51200ms
Tidyparse (proposed/total): 209/340
Tidyparse (accepted/proposed): 206/209
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|-----------------------------------------------------------------|
| def writeheader(self): | def writeheader(self): |
| print("\t".join(~(~"QueryID", "UpdateID", "NuggetID", "Start", | print("\t".join("QueryID", "UpdateID", "NuggetID", "Start", |
| "End", "AutoP", "Score", "Label", "Update_Text", | "End", "AutoP", "Score", "Label", "Update_Text", |
| "Nugget_Text")) | "Nugget_Text" |
| | )) |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 23ms
Tidyparse (proposed/total): 209/341
Tidyparse (accepted/proposed): 206/209
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------|-------------------------|
| ~class A:~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self, x: int):~ | |
| ~ let self.x: int = x~ | |
| ~ let self.z: int = 0~ | |
| ~ def some_subclass(self, o: A, s: bool) -> self:~ | |
| ~ return self~ | |
| ~ def bar(self) -> int:~ | |
| ~ return self.x~ | |
| ~~ | |
Filtered out 18/37 invalid samples!
Drew 19 samples before timeout
Synthesized repair in: 33149ms
Tidyparse (proposed/total): 210/342
Tidyparse (accepted/proposed): 207/210
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|------------------------------------------------------------|
| def im2mat(I): | def im2mat(I): |
| """Converts and image to matrix(one pixel per line)""" | """Converts and image to matrix(one pixel per line)""" |
| return I.reshape((I.shape[0] * I.shape[1], I.shape[2]) | return I.reshape((I.shape[0] * I.shape[1], I.shape[2]) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 10/11 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 39109ms
Tidyparse (proposed/total): 211/343
Tidyparse (accepted/proposed): 208/211
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, Dialog): | def retranslateUi(self, Dialog): |
| Dialog.setWindowTitle(_("This book is DRMed")) | Dialog.setWindowTitle(_("This book is DRMed")) |
| self.msg.setText(_("<p>This book is locked by <b>DRM</b>. To learn more about DRM and why you cannot read or convert this book in calibre, \n" | self.msg.setText(_("<p>This book is locked by <b>DRM</b>. To learn more about DRM and why you cannot read or convert this book in calibre, \n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 57/61 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 52782ms
Tidyparse (proposed/total): 212/344
Tidyparse (accepted/proposed): 209/212
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| def __repr__(self): | def __repr__(self): |
| s = 'good / bad epochs received: %d / %d, epochs in queue: %d, ' %(self._n_good, self._n_bad, ~len(self~._epoch_queue) | s = 'good / bad epochs received: %d / %d, epochs in queue: %d, ' %(self._n_good, self._n_bad, **lenself**._epoch_queue) |
| s += ', tmin: %s(s)' % self.tmin | s += ', tmin: %s(s)' % self.tmin |
| s += ', tmax: %s(s)' % self.tmax | s += ', tmax: %s(s)' % self.tmax |
| s += ', baseline: %s' % str(self.baseline) | s += ', baseline: %s' % str(self.baseline) |
| return '<RtEpochs | %s>' % s | return '<RtEpochs | %s>' % s |
| | |
Python parser ACCEPTED repair!
Filtered out 25/28 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 40805ms
Tidyparse (proposed/total): 213/345
Tidyparse (accepted/proposed): 210/213
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def generate_password(size = 16, complex = False): | def generate_password(size = 16, complex = False): |
| """Generate a random password using either ascii+digits""" | """Generate a random password using either ascii+digits""" |
| if complex: | if complex: |
| password = ''.join(random.choice(string.printable) | password = ''.join(random.choice(string.printable) |
| for _ in range(size)) | for _ in range(size)) |
| else: | else: |
| password = ''.join(random.choice(string.ascii_letters + string.digits) | password = ''.join(random.choice(string.ascii_letters + string.digits) |
| for _ in ~range(size~) | for _ in **rangesize**) |
| return password | return password |
| | |
Python parser ACCEPTED repair!
Filtered out 59/67 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 33183ms
Tidyparse (proposed/total): 214/346
Tidyparse (accepted/proposed): 211/214
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| def selection(selector, cluster = 'ceph', overwrite = False): | def selection(selector, cluster = 'ceph', overwrite = False): |
| '''Generate pillar/ceph/cluster/{minion_id}.sls for all minions that match''' | '''Generate pillar/ceph/cluster/{minion_id}.sls for all minions that match''' |
| print('bootstraping all nodes that match{}'.format(selector))~)~ | print('bootstraping all nodes that match{}'.format(selector)) |
| return _get_minions_and_write_data(selector, cluster, overwrite) | return _get_minions_and_write_data(selector, cluster, overwrite) |
| | |
Python parser ACCEPTED repair!
Filtered out 5/5 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34342ms
Tidyparse (proposed/total): 214/347
Tidyparse (accepted/proposed): 211/214
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------|-------------------------|
| ~start = (0, 0)~ | **NO_REPAIR_PROPOSAL!** |
| ~end = (2, 2)~ | |
| ~'''(0,0), (0,1), (0,2), (1,2), (2,2)'''~ | |
| ~def move_right(x, y)~ | |
| ~ if x != end_x:~ | |
| ~ x += 1~ | |
| ~if __name__ == "__main__":~ | |
| ~ pos = start~ | |
| ~ num = 0~ | |
| ~ while pos != end:~ | |
| ~ next_a = (~ | |
| ~ print("%d" %(num))~ | |
| ~~ | |
Filtered out 235/285 invalid samples!
Drew 50 samples before timeout
Synthesized repair in: 167531ms
Tidyparse (proposed/total): 215/348
Tidyparse (accepted/proposed): 212/215
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def test_number_pestering_attempts_created_by_set_up(self): | def test_number_pestering_attempts_created_by_set_up(self): |
| self.assertEqual( | self.assertEqual( |
| len(self.pat_code_list), | len(self.pat_code_list), |
| PesteringAttempt.objects.all().count()~))~ | PesteringAttempt.objects.all().count() |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 215/349
Tidyparse (accepted/proposed): 212/215
Original error: expected an indented block
| original | repair |
|---------------------------------------------------------------------------------|-------------------------|
| ~def CheckConnection(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''Checks if we are still online if we haven't checked for 10 seconds.'''~ | |
| ~ if(time.time() - self.LastConnectionCheck) > 10.0:~ | |
| ~ self.LastConnectionCheck = time.time()~ | |
| ~ try:~ | |
| ~ response = urllib2.urlopen('http://google.com', timeout = 10)~ | |
| ~ self.ConnectionStatus = True~ | |
| ~ return self.ConnectionStatus~ | |
| ~ except:~ | |
| ~ self.ConnectionStatus = False~ | |
| ~ return self.ConnectionStatus~ | |
| ~~ | |
Filtered out 107/179 invalid samples!
Drew 72 samples before timeout
Synthesized repair in: 184089ms
Tidyparse (proposed/total): 216/350
Tidyparse (accepted/proposed): 213/216
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def get(self, key): | def get(self, key): |
| fields = self._client.hkeys(self._KEY_PREFIX + key) | fields = self._client.hkeys(self._KEY_PREFIX + key) |
| return dict(zip(fields, | return dict(zip(fields, |
| map(self._load, self._client.hmget(self._KEY_PREFIX + key, * fields))) | map(self._load, self._client.hmget(self._KEY_PREFIX + key, * fields))) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 40/52 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 31401ms
Tidyparse (proposed/total): 217/351
Tidyparse (accepted/proposed): 214/217
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|-----------------------------------------------------------------|
| def test_get_quota_clustermode_api(clustermode): | def test_get_quota_clustermode_api(clustermode): |
| clustermode.get_quota("volume", "qtree") | clustermode.get_quota("volume", "qtree") |
| assert clustermode.sent ==[~(~'quota_list_entries_iter', dict( | assert clustermode.sent ==['quota_list_entries_iter', dict( |
| query = dict( | query = dict( |
| quota_entry = dict( | quota_entry = dict( |
| quota_target = "/vol/volume/qtree" | quota_target = "/vol/volume/qtree" |
| ) | ) |
| ), | ), |
| max_records = 65536 | max_records = 65536 |
| )] | )] |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 217/352
Tidyparse (accepted/proposed): 214/217
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------|-------------------------|
| ~from smiles_parsers import Smiles, BuildMol~ | **NO_REPAIR_PROPOSAL!** |
| ~from perception import RingDetection, BasicAromaticity, sssr~ | |
| ~def smilin(smiles, transforms = [sssr.sssr,~ | |
| ~ BasicAromaticity.aromatize],~ | |
| ~ enable_vfgraph = 0):~ | |
| ~ """(smiles)->molecule"""~ | |
| ~ builder = BuildMol.BuildMol(enable_vfgraph)~ | |
| ~ Smiles.tokenize(smiles, builder)~ | |
| ~ mol = builder.mol~ | |
| ~ for transform in transforms:~ | |
| ~ mol = transform(mol)~ | |
| ~ for atom in mol.atoms:~ | |
| ~ if not atom.has_explicit_hcount:~ | |
| ~ atom.imp_hcount = atom.hcount - atom.explicit_hcount~ | |
| ~ return mol~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 32404ms
Tidyparse (proposed/total): 218/353
Tidyparse (accepted/proposed): 215/218
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| def set_module_carrent_booking_discount(self): | def set_module_carrent_booking_discount(self): |
| config = self.env["ir.model.data"].xmlid_to_object("carrent_booking.configuration") | config = self.env["ir.model.data"].xmlid_to_object("carrent_booking.configuration") |
| config.write({ | config.write({ |
| "module_carrent_booking_discount": self.module_carrent_booking_discount | "module_carrent_booking_discount": self.module_carrent_booking_discount |
| | **})** |
Python parser ACCEPTED repair!
Filtered out 240/246 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 59399ms
Tidyparse (proposed/total): 219/354
Tidyparse (accepted/proposed): 216/219
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|-------------------------------------|
| def connect_socket(): | def connect_socket(): |
| global sock | global sock |
| sock.connect(~(~'localhost', 5555) | sock.connect('localhost', 5555) |
| sock.settimeout(0.2) | sock.settimeout(0.2) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 23ms
Tidyparse (proposed/total): 219/355
Tidyparse (accepted/proposed): 216/219
Original error: expected an indented block
| original | repair |
|-------------------------------------|-------------------------|
| ~def max(dictionary):~ | **NO_REPAIR_PROPOSAL!** |
| ~ max = None~ | |
| ~ highest = None~ | |
| ~ for key in dictionary:~ | |
| ~ if max < dictionary[key]:~ | |
| ~ max = dictionary[key]~ | |
| ~ highest = key~ | |
| ~ return highest~ | |
| ~~ | |
Filtered out 78/84 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31904ms
Tidyparse (proposed/total): 220/356
Tidyparse (accepted/proposed): 217/220
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|----------------------------------------------------------------------|
| def from_storage(cls, diff_str, timestamp = None): | def from_storage(cls, diff_str, timestamp = None): |
| """Instantiates a diff object from a diff json str from redis""" | """Instantiates a diff object from a diff json str from redis""" |
| diff = json.~loads(diff_str~.decode('utf-8') | diff = json.**loadsdiff_str**.decode('utf-8') |
| return cls(diff['data'], diff['created'], timestamp) | return cls(diff['data'], diff['created'], timestamp) |
| | |
Python parser ACCEPTED repair!
Filtered out 32/48 invalid samples!
Drew 16 samples before timeout
Synthesized repair in: 31692ms
Tidyparse (proposed/total): 221/357
Tidyparse (accepted/proposed): 218/221
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def __init__(self, timeout = 60, close_callback = None, * args, ** kwargs): | def __init__(self, timeout = 60, close_callback = None, * args, ** kwargs): |
| self.timeout = timeout | self.timeout = timeout |
| self.close_callback = close_callback | self.close_callback = close_callback |
| self._store = {} | self._store = {} |
| self._time_to_keys = collections.defaultdict(list) | self._time_to_keys = collections.defaultdict(list) |
| self._keys_to_last_time = {} | self._keys_to_last_time = {} |
| self._last_visits = collections.deque() | self._last_visits = collections.deque() |
| self.~update~(~dict(~* args, ** kwargs) | self.**updatedict**(* args, ** kwargs) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 221/358
Tidyparse (accepted/proposed): 218/221
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------|-------------------------|
| ~def neighbors(self, window = None, modtwo = False):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if window is None:~ | |
| ~ window = self.window~ | |
| ~ if window > self.window:~ | |
| ~ raise IndexError('Requested delta outside window')~ | |
| ~ for i in itertools.chain(range(- window, 0),~ | |
| ~ range(1, window + 1)):~ | |
| ~ if modtwo and i % 2 == 1:~ | |
| ~ continue~ | |
| ~ n = self.neighbor(i)~ | |
| ~ if n is not None:~ | |
| ~ yield n~ | |
| ~~ | |
Filtered out 58/60 invalid samples!
Filtered out 14/18 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 33476ms
Tidyparse (proposed/total): 223/359
Tidyparse (accepted/proposed): 219/223
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------|----------------------------------------------|
| class Users(Base): | class Users(Base): |
| __tablename__ = "test_lock_users" | __tablename__ = "test_lock_users" |
| id = Column(Integer, primary_key = True) | id = Column(Integer, primary_key = True) |
| user_name = Column(String(32) | user_name = Column(String(32)**)** |
| created_at = Column(DateTime) | created_at = Column(DateTime) |
| def __init__(self, id, user_name): | def __init__(self, id, user_name): |
| self.id = id | self.id = id |
| self.user_name = user_name | self.user_name = user_name |
| self.created_at = dt.datetime.now() | self.created_at = dt.datetime.now() |
| | |
Python parser ACCEPTED repair!
Drew 4 samples before timeout
Synthesized repair in: 30828ms
Tidyparse (proposed/total): 223/360
Tidyparse (accepted/proposed): 220/223
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| def getSysbenchRegressionReport(run_id, test_data, dsn_string, diff_check_data = None): | def getSysbenchRegressionReport(run_id, test_data, dsn_string, diff_check_data = None): |
| """Returns a textual report of the regression over a series of runs""" | """Returns a textual report of the regression over a series of runs""" |
| bzr_branch = 'staging' | bzr_branch = 'staging' |
| report_notation = '' | report_notation = '' |
| full_commentary = None | full_commentary = None |
| (last_5_revs, last_20_revs) = get5and20RevisionRanges(run_id, bzr_branch, test_data, dsn_string) | (last_5_revs, last_20_revs) = get5and20RevisionRanges(run_id, bzr_branch, test_data, dsn_string) |
| report_text = """====================================================================================================""" %( | report_text = """====================================================================================================""" %( |
| report_notation | report_notation |
| , test_data['test_machine'] | , test_data['test_machine'] |
| , run_id | , run_id |
| , test_data['run_date'] | , test_data['run_date'] |
| , test_data['config_name'] | , test_data['config_name'] |
| , test_data['test_server_type'] | , test_data['test_server_type'] |
| , bzr_branch | , bzr_branch |
| , int(test_data['test_server_revno']) | , int(test_data['test_server_revno']) |
| , test_data['test_server_comment'] | , test_data['test_server_comment'] |
| , report_notation | , report_notation |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 25/27 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 75979ms
Tidyparse (proposed/total): 224/361
Tidyparse (accepted/proposed): 221/224
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def extractField(self, name, text): | def extractField(self, name, text): |
| """Extracts the value of one of the informative fields provided in""" | """Extracts the value of one of the informative fields provided in""" |
| pattern = r"^\s*%s\s*: \s*(?P<value>[^\s]*)\s*$" % name | pattern = r"^\s*%s\s*: \s*(?P<value>[^\s]*)\s*$" % name |
| expression = re.compile(pattern, flags = re.MULTILINE) | expression = re.compile(pattern, flags = re.MULTILINE) |
| match = expression.search(text) | match = expression.search(text) |
| if not match: | if not match: |
| return None | return None |
| value = match.group("value") | value = match.group("value") |
| print("%s=%s" ~%(name~, value) | print("%s=%s" **%name**, value) |
| return value | return value |
| | |
Python parser ACCEPTED repair!
Filtered out 108/139 invalid samples!
Drew 31 samples before timeout
Synthesized repair in: 33578ms
Tidyparse (proposed/total): 225/362
Tidyparse (accepted/proposed): 222/225
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| '''This module provides a table of data regarding bachelors degrees earned by''' | '''This module provides a table of data regarding bachelors degrees earned by''' |
| from __future__ import absolute_import | from __future__ import absolute_import |
| from bokeh.util.dependencies import import_required | from bokeh.util.dependencies import import_required |
| pd = import_required('pandas', | pd = import_required('pandas', |
| 'degrees sample data requires Pandas(http: //pandas.pydata.org)to be installed') | 'degrees sample data requires Pandas(http: //pandas.pydata.org)to be installed') |
| from os.path import dirname, join | from os.path import dirname, join |
| data = pd.~read_csv~(~join(~dirname(__file__), "percent-bachelors-degrees-women-usa.csv") | data = pd.**read_csvjoin**(dirname(__file__), "percent-bachelors-degrees-women-usa.csv") |
| | |
Python parser ACCEPTED repair!
Filtered out 54/60 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30090ms
Tidyparse (proposed/total): 226/363
Tidyparse (accepted/proposed): 223/226
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|----------------------------------------------------------------------|
| def test_tally_no_element(self): | def test_tally_no_element(self): |
| """Test tallying on non-present element is correct""" | """Test tallying on non-present element is correct""" |
| self.tally_frame.tally_percent("rating", "12") | self.tally_frame.tally_percent("rating", "12") |
| local_frame = self.tally_frame.to_pandas(self.tally_frame.count~(~) | local_frame = self.tally_frame.to_pandas(self.tally_frame.count) |
| for index, row in local_frame.iterrows(): | for index, row in local_frame.iterrows(): |
| self.assertEqual(row["rating_tally_percent"], 1.0) | self.assertEqual(row["rating_tally_percent"], 1.0) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 226/364
Tidyparse (accepted/proposed): 223/226
Original error: expected an indented block
| original | repair |
|---------------------------------------------|-------------------------|
| ~def both_ends(s):~ | **NO_REPAIR_PROPOSAL!** |
| ~ strng = ''~ | |
| ~ if len(s) > 2:~ | |
| ~ strng = s[0] + s[1] + s[- 2] + s[- 1]~ | |
| ~ return strng~ | |
| ~~ | |
Filtered out 91/91 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32105ms
Tidyparse (proposed/total): 226/365
Tidyparse (accepted/proposed): 223/226
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------------------------|-------------------------|
| ~import sys~ | **NO_REPAIR_PROPOSAL!** |
| ~import time~ | |
| ~if __name__ == "__main__":~ | |
| ~ for progress in range(100):~ | |
| ~ i = progress / 5~ | |
| ~ sys.stdout.write("Processing progress: [%-20s] %d%% \r" %('=' * i + '>', progress))~ | |
| ~ sys.stdout.flush()~ | |
| ~ time.sleep(1)~ | |
| ~~ | |
Filtered out 3/3 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30540ms
Tidyparse (proposed/total): 226/366
Tidyparse (accepted/proposed): 223/226
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|-------------------------|
| ~class Ui_Dialog(object):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def setupUi(self, Dialog):~ | |
| ~ Dialog.setObjectName(_fromUtf8("Dialog"))~ | |
| ~ Dialog.resize(395, 550)~ | |
| ~ Dialog.setStyleSheet(_fromUtf8("background-color:#212526;"))~ | |
| ~ self.sessionpartsListWidget = QtGui.QListWidget(Dialog)~ | |
| ~ self.sessionpartsListWidget.setGeometry(QtCore.QRect(30, 80, 341, 281))~ | |
| ~ self.sessionpartsListWidget.setStyleSheet(_fromUtf8("color: #98A6A8;\n"~ | |
| ~~ | |
Filtered out 93/93 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32671ms
Tidyparse (proposed/total): 226/367
Tidyparse (accepted/proposed): 223/226
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------|-------------------------|
| ~def update(self, observable, (addedcards, removedcards)):~ | **NO_REPAIR_PROPOSAL!** |
| ~ self.cards = self.cards + len(addedcards) - len(removedcards)~ | |
| ~ if self.cards > 0:~ | |
| ~ self.dispatcher.update_inserted(True)~ | |
| ~ else:~ | |
| ~ self.dispatcher.update_inserted(False)~ | |
| ~~ | |
Filtered out 97/126 invalid samples!
Drew 29 samples before timeout
Synthesized repair in: 34859ms
Tidyparse (proposed/total): 227/368
Tidyparse (accepted/proposed): 224/227
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|-----------------------------------------|
| def sizeRec(): | def sizeRec(): |
| if(instance(myStack, noneNode)): | if(instance(myStack, noneNode)): |
| return 0 | return 0 |
| else: | else: |
| return 1 + ~size(myStack~.next | return 1 + **sizemyStack**.next |
| | |
Python parser ACCEPTED repair!
Filtered out 76/78 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 33391ms
Tidyparse (proposed/total): 228/369
Tidyparse (accepted/proposed): 225/228
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def run_socketio(path): | def run_socketio(path): |
| print('\nrun_socketio(path=%s)' % repr(path) | print('\nrun_socketio(path=%s)' % repr(path)**)** |
| socketio_manage(request.environ, {'/api': Namespace}, request) | socketio_manage(request.environ, {'/api': Namespace}, request) |
| return Response() | return Response() |
| | |
Python parser ACCEPTED repair!
Filtered out 46/46 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31335ms
Tidyparse (proposed/total): 228/370
Tidyparse (accepted/proposed): 225/228
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------------|-------------------------|
| ~def send(self, str):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Send `str' to the server."""~ | |
| ~ if self.debuglevel > 0: print 'send: ', repr(str)~ | |
| ~ if hasattr(self, 'sock') and self.sock:~ | |
| ~ try:~ | |
| ~ self.sock.sendall(str)~ | |
| ~ except socket.error:~ | |
| ~ self.close()~ | |
| ~ raise SMTPServerDisconnected('Server not connected')~ | |
| ~ else:~ | |
| ~ raise SMTPServerDisconnected('please run connect() first')~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 35ms
Tidyparse (proposed/total): 228/371
Tidyparse (accepted/proposed): 225/228
Original error: unexpected indent
| original | repair |
|------------------------------------------------------|-------------------------|
| ~def solution(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ n = 600851475143~ | |
| ~ primess = []~ | |
| ~ maxPrime = 0~ | |
| ~ nextPrime = 0~ | |
| ~ while(n > 1):~ | |
| ~ nextPrime = self.getNextPrime(primess)~ | |
| ~ while(not n % nextPrime):~ | |
| ~ if(nextPrime > maxPrime):~ | |
| ~ maxPrime = nextPrime~ | |
| ~ n /= nextPrime~ | |
| ~ print("%d, %d" %(maxPrime, n))~ | |
| ~ return maxPrime~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 43ms
Tidyparse (proposed/total): 228/372
Tidyparse (accepted/proposed): 225/228
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------|-------------------------|
| ~class MockRecognizer(object):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self):~ | |
| ~ self.transcriptions = []~ | |
| ~ def recognize_mycroft(self, audio, key = None,~ | |
| ~ language = None, show_all = False):~ | |
| ~ if len(self.transcriptions) > 0:~ | |
| ~ return self.transcriptions.pop(0)~ | |
| ~ else:~ | |
| ~ raise speech_recognition.UnknownValueError()~ | |
| ~ def set_transcriptions(self, transcriptions):~ | |
| ~ self.transcriptions = transcriptions~ | |
| ~~ | |
Filtered out 37/49 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 33000ms
Tidyparse (proposed/total): 229/373
Tidyparse (accepted/proposed): 226/229
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------|--------------------------------------------|
| def _get_default_parameters(self, algo): | def _get_default_parameters(self, algo): |
| self.lease_duration_secs = int( | self.lease_duration_secs = int( |
| self.get_named_parameter( | self.get_named_parameter( |
| algo, 'lease_duration_secs', | algo, 'lease_duration_secs', |
| _kDefaultLeaseDuration)) | _kDefaultLeaseDuration)) |
| self.decay_factor = float( | self.decay_factor = float( |
| self.get_named_parameter( | self.get_named_parameter( |
| algo, 'decay_factor', | algo, 'decay_factor', |
| _kDefaultDecayFactor)) | _kDefaultDecayFactor)) |
| self.refresh_interval = int( | self.refresh_interval = int( |
| self.get_named_parameter( | self.get_named_parameter( |
| algo, 'refresh_interval', | algo, 'refresh_interval', |
| _kDefaultRefreshInterval) | _kDefaultRefreshInterval)**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 0/2 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 33217ms
Tidyparse (proposed/total): 230/374
Tidyparse (accepted/proposed): 227/230
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------|--------------------------------------------------------|
| def gen_pca(): | def gen_pca(): |
| npz = gen_first_two() | npz = gen_first_two() |
| idx_train = npz['idx_train'] | idx_train = npz['idx_train'] |
| idx_test = npz['idx_test'] | idx_test = npz['idx_test'] |
| iris = sklearn.datasets.load_iris() | iris = sklearn.datasets.load_iris() |
| X = iris.data | X = iris.data |
| X = np.vstack([X[idx_train], X[idx_test]) | X = np.vstack([X[idx_train]**]**, X[idx_test]) |
| X_reduced = PCA(n_components = 3).fit_transform(X) | X_reduced = PCA(n_components = 3).fit_transform(X) |
| return{'X': X_reduced} | return{'X': X_reduced} |
| | |
Python parser ACCEPTED repair!
Filtered out 39/47 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 36923ms
Tidyparse (proposed/total): 231/375
Tidyparse (accepted/proposed): 228/231
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|-------------------------------------------------------------------|
| def processJobs(srcdb, uuid2name, excludedUUIDs): | def processJobs(srcdb, uuid2name, excludedUUIDs): |
| d = defaultdict(lambda: defaultdict(lambda: defaultdict(int))~)~ | d = defaultdict(lambda: defaultdict(lambda: defaultdict(int)) |
| [JOB_OWNER, JOB_READ, TASKS]) | [JOB_OWNER, JOB_READ, TASKS]) |
| processJobRecs(d, recs, uuid2name, excludedUUIDs) | processJobRecs(d, recs, uuid2name, excludedUUIDs) |
| return d | return d |
| | |
Python parser ACCEPTED repair!
Filtered out 37/43 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30732ms
Tidyparse (proposed/total): 232/376
Tidyparse (accepted/proposed): 228/232
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def main(args): | def main(args): |
| feature_files = glob.glob(os.path.join(args.feature_directory, "*.npz") | feature_files = glob.glob(os.path.join(args.feature_directory, "*.npz") |
| (files, time_points, | (files, time_points, |
| features) = morphine.~sample_feature_files(feature_files~, | features) = morphine.**sample_feature_filesfeature_files**, |
| args.num_samples) | args.num_samples) |
| connections = morphine.build_kneighbors_table(features, args.k_neighbors) | connections = morphine.build_kneighbors_table(features, args.k_neighbors) |
| path = morphine.rand_acyclic_walk(connections) | path = morphine.rand_acyclic_walk(connections) |
| print(path) | print(path) |
| | |
Python parser REJECTED repair because: expression cannot contain assignment, perhaps you meant "=="? (<unknown>, line 2)
Filtered out 46/49 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 44434ms
Tidyparse (proposed/total): 233/377
Tidyparse (accepted/proposed): 229/233
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def authenticate_credentials(self, userid, password): | def authenticate_credentials(self, userid, password): |
| """Authenticate the user by userid(email)and password.""" | """Authenticate the user by userid(email)and password.""" |
| user = get_user(email = userid, password = password) | user = get_user(email = userid, password = password) |
| if userid and not user: | if userid and not user: |
| raise exceptions.~AuthenticationFailed~(~_(~'Invalid username/password.') | raise exceptions.**AuthenticationFailed_**('Invalid username/password.') |
| elif userid is None and password is None: | elif userid is None and password is None: |
| raise exceptions.NotAuthenticated() | raise exceptions.NotAuthenticated() |
| check_user(user) | check_user(user) |
| return user, None | return user, None |
| | |
Python parser ACCEPTED repair!
Filtered out 56/102 invalid samples!
Drew 46 samples before timeout
Synthesized repair in: 47824ms
Tidyparse (proposed/total): 234/378
Tidyparse (accepted/proposed): 230/234
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| def testModule(): | def testModule(): |
| from getDefaultContext import getDefaultContext | from getDefaultContext import getDefaultContext |
| from mepinta.testing.plugins_testing.PluginManifestAutoTester import PluginManifestAutoTester | from mepinta.testing.plugins_testing.PluginManifestAutoTester import PluginManifestAutoTester |
| PluginManifestAutoTester(getDefaultContext().~test(manifest)~ | PluginManifestAutoTester(getDefaultContext().**testmanifest** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 164/164 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 84086ms
Tidyparse (proposed/total): 234/379
Tidyparse (accepted/proposed): 230/234
Original error: expected an indented block
| original | repair |
|-------------------------------------------------|-------------------------|
| ~num1 = int(input("Introduce número entero:"))~ | **NO_REPAIR_PROPOSAL!** |
| ~num2 = 0~ | |
| ~intnumero = num1 + num2~ | |
| ~print(intnumero)~ | |
| ~if intnumero < 0:~ | |
| ~print("Revisa, ese no es un numero entero")~ | |
| ~~ | |
Filtered out 100/103 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 54239ms
Tidyparse (proposed/total): 235/380
Tidyparse (accepted/proposed): 231/235
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def _save_config(filename, config): | def _save_config(filename, config): |
| """Save configuration.""" | """Save configuration.""" |
| try: | try: |
| with open(filename, 'w') as fdesc: | with open(filename, 'w') as fdesc: |
| fdesc.~write(json~.dumps( | fdesc.**writejson**.dumps( |
| config, cls = JSONBytesDecoder, indent = 4, sort_keys = True) | config, cls = JSONBytesDecoder, indent = 4, sort_keys = True) |
| except(IOError, TypeError) as error: | except(IOError, TypeError) as error: |
| _LOGGER.error("Saving config file failed: %s", error) | _LOGGER.error("Saving config file failed: %s", error) |
| return False | return False |
| return True | return True |
| | |
Python parser ACCEPTED repair!
Filtered out 31/35 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30553ms
Tidyparse (proposed/total): 236/381
Tidyparse (accepted/proposed): 232/236
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------|-----------------------------------------------------------|
| def __init__(self, parent): | def __init__(self, parent): |
| """Window initialisation.""" | """Window initialisation.""" |
| QtGui.QDialog.__init__(self, parent) | QtGui.QDialog.__init__(self, parent) |
| self.initUI() | self.initUI() |
| self.setWindowTitle(_('EXPORT_MAP_DIALOG_TITLE') | self.setWindowTitle(_('EXPORT_MAP_DIALOG_TITLE')**)** |
| self.setModal(True) | self.setModal(True) |
| self.show() | self.show() |
| | |
Python parser ACCEPTED repair!
Filtered out 22/22 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32978ms
Tidyparse (proposed/total): 236/382
Tidyparse (accepted/proposed): 232/236
Original error: unexpected indent
| original | repair |
|---------------------------------------------------------------------------|-------------------------|
| ~def test_replace__all(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ with self.recorder.use_cassette(~ | |
| ~ 'TestCommentForest.test_replace__all',~ | |
| ~ match_requests_on = ['uri', 'method', 'body']):~ | |
| ~ submission = Submission(self.reddit, '3hahrw')~ | |
| ~ before_count = len(submission.comments.list())~ | |
| ~ skipped = submission.comments.replace_more(None, threshold = 0)~ | |
| ~ assert len(skipped) == 0~ | |
| ~ assert all(x.submission == submission for x in~ | |
| ~ submission.comments.list())~ | |
| ~ assert before_count < len(submission.comments.list())~ | |
| ~~ | |
Filtered out 61/63 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30114ms
Tidyparse (proposed/total): 237/383
Tidyparse (accepted/proposed): 233/237
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| def run(* args, ** kwargs): | def run(* args, ** kwargs): |
| env = os.environ.copy() | env = os.environ.copy() |
| env.update(kwargs.get('env', {}) | env.update(kwargs.get('env', {})**)** |
| ret = subprocess.call(args, stdout = sys.stdout, stderr = subprocess.STDOUT, env = env) | ret = subprocess.call(args, stdout = sys.stdout, stderr = subprocess.STDOUT, env = env) |
| if ret != 0: | if ret != 0: |
| exit(ret) | exit(ret) |
| | |
Python parser ACCEPTED repair!
Filtered out 20/25 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 33459ms
Tidyparse (proposed/total): 238/384
Tidyparse (accepted/proposed): 234/238
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| import cookies, requests | import cookies, requests |
| import sys | import sys |
| import subprocess, shlex | import subprocess, shlex |
| id = int(sys.argv[2]) | id = int(sys.argv[2]) |
| key = "test" | key = "test" |
| cookie_descriptor = cookies.CookieDescriptor(id, key) | cookie_descriptor = cookies.CookieDescriptor(id, key) |
| cookie = cookie_descriptor.generateTextCookie() | cookie = cookie_descriptor.generateTextCookie() |
| cmd = 'wget --header=network-cookie: %s %s' %(cookie.toBase64(), sys.argv[1]) | cmd = 'wget --header=network-cookie: %s %s' %(cookie.toBase64(), sys.argv[1]) |
| subprocess.call(shlex.~split(cmd~) | subprocess.call(shlex.**splitcmd**) |
| | |
Python parser ACCEPTED repair!
Filtered out 43/51 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30216ms
Tidyparse (proposed/total): 239/385
Tidyparse (accepted/proposed): 235/239
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| def get(cls, pk = None): | def get(cls, pk = None): |
| db = get_database() | db = get_database() |
| cursor = db.cursor | cursor = db.cursor |
| if pk: | if pk: |
| cursor.execute( | cursor.execute( |
| "SELECT * FROM {table} WHERE id=%(id)s".format(table = cls.TABLE_NAME), {'id': pk} | "SELECT * FROM {table} WHERE id=%(id)s".format(table = cls.TABLE_NAME), {'id': pk}**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 110/121 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 33906ms
Tidyparse (proposed/total): 240/386
Tidyparse (accepted/proposed): 235/240
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
| def bibauthorid_daemon(): | def bibauthorid_daemon(): |
| """Constructs the Bibauthorid bibtask.""" | """Constructs the Bibauthorid bibtask.""" |
| bibtask.task_init(authorization_action = 'runbibclassify', | bibtask.task_init(authorization_action = 'runbibclassify', |
| authorization_msg = "Bibauthorid Task Submission", | authorization_msg = "Bibauthorid Task Submission", |
| description = """Purpose:""", | description = """Purpose:""", |
| help_specific_usage = """--repair-personid Deletes untouched person entities to then""", | help_specific_usage = """--repair-personid Deletes untouched person entities to then""", |
| version = "Invenio Bibauthorid v%s" % bconfig.VERSION, | version = "Invenio Bibauthorid v%s" % bconfig.VERSION, |
| specific_params = ~(~"r:", | specific_params = "r:", |
| [ | [ |
| "record-ids=", | "record-ids=", |
| "all-records", | "all-records", |
| "repair-personid", | "repair-personid", |
| "fast-update-personid", | "fast-update-personid", |
| "personid-gc" | "personid-gc" |
| ~])~, | , |
| task_submit_elaborate_specific_parameter_fnc | task_submit_elaborate_specific_parameter_fnc |
| | **])** |
Python parser REJECTED repair because: positional argument follows keyword argument (<unknown>, line 9)
Filtered out 29/39 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 30979ms
Tidyparse (proposed/total): 241/387
Tidyparse (accepted/proposed): 236/241
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------|-----------------------------------------------------|
| class Migration(migrations.Migration): | class Migration(migrations.Migration): |
| dependencies = [ | dependencies = [ |
| ('experiments', '0016_auto_20160512_1704'), | ('experiments', '0016_auto_20160512_1704'), |
| ] | ] |
| operations = [ | operations = [ |
| migrations.AddField( | migrations.AddField( |
| model_name = 'experiment', | model_name = 'experiment', |
| name = 'discourse_url', | name = 'discourse_url', |
| field = models.URLField(blank = True), | field = models.URLField(blank = True), |
| ) | )**]** |
| | |
Python parser ACCEPTED repair!
Filtered out 37/61 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 33064ms
Tidyparse (proposed/total): 242/388
Tidyparse (accepted/proposed): 237/242
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------|------------------------------------------------------|
| def testRepr(self): | def testRepr(self): |
| self.assertEquals(repr(self.f), | self.assertEquals(repr(self.f), |
| "_fileio._FileIO(%d, %s)" %(self.f.fileno(), | "_fileio._FileIO(%d, %s)" %(self.f.fileno(), |
| repr(self.f.mode)) | repr(self.f.mode)) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 26/26 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 37824ms
Tidyparse (proposed/total): 242/389
Tidyparse (accepted/proposed): 237/242
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------|-------------------------|
| ~"""Queries for incremental mapping."""~ | **NO_REPAIR_PROPOSAL!** |
| ~from google.appengine.ext import ndb~ | |
| ~__all__ = [~ | |
| ~ 'incremental_map',~ | |
| ~ 'page_queries',~ | |
| ~ 'pop_future_done',~ | |
| ~]~ | |
| ~def _process_chunk_of_items(~ | |
| ~ map_fn, action_futures, items_to_process, max_inflight, map_page_size):~ | |
| ~ """Maps as many items as possible and throttles down to 'max_inflight'."""~ | |
| ~ pop_future_done(action_futures)~ | |
| ~ while len(action_futures) > max_inflight:~ | |
| ~ ndb.Future.wait_any(action_futures)~ | |
| ~ pop_future_done(action_futures)~ | |
| ~ action_futures.extend(map_fn(items_to_process[: map_page_size]) or[])~ | |
| ~ return items_to_process[map_page_size: ]~ | |
| ~~ | |
Filtered out 23/29 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 37082ms
Tidyparse (proposed/total): 243/390
Tidyparse (accepted/proposed): 238/243
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|----------------------------------------------------------------------|
| def _extract_params(self, actual_params, allowed_params): | def _extract_params(self, actual_params, allowed_params): |
| """Extract a subset of keys from a dictionary.The filters key""" | """Extract a subset of keys from a dictionary.The filters key""" |
| try: | try: |
| result = dict(actual_params.get('filters'))~)~ | result = dict(actual_params.get('filters')) |
| except TypeError: | except TypeError: |
| result = {} | result = {} |
| for allowed_param in allowed_params: | for allowed_param in allowed_params: |
| if allowed_param in actual_params: | if allowed_param in actual_params: |
| result[allowed_param] = actual_params[allowed_param] | result[allowed_param] = actual_params[allowed_param] |
| return result | return result |
| | |
Python parser ACCEPTED repair!
Filtered out 8/16 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 32768ms
Tidyparse (proposed/total): 244/391
Tidyparse (accepted/proposed): 239/244
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def testDeleteParameterFromJobFile(self): | def testDeleteParameterFromJobFile(self): |
| original_job_file = ( | original_job_file = ( |
| '[global]\n' | '[global]\n' |
| 'directory=/dev/sdb\n' | 'directory=/dev/sdb\n' |
| 'filename=foo12_3\n' | 'filename=foo12_3\n' |
| '...') | '...') |
| expected_job_file = ( | expected_job_file = ( |
| '[global]\n' | '[global]\n' |
| '...') | '...') |
| self.assertEqual( | self.assertEqual( |
| expected_job_file, | expected_job_file, |
| fio.DeleteParameterFromJobFile( | fio.DeleteParameterFromJobFile( |
| fio.DeleteParameterFromJobFile(original_job_file, 'directory'), | fio.DeleteParameterFromJobFile(original_job_file, 'directory'), |
| 'filename') | 'filename') |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 74/78 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30753ms
Tidyparse (proposed/total): 245/392
Tidyparse (accepted/proposed): 240/245
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| def test_simple(self): | def test_simple(self): |
| response = self.client.get(reverse('item_chooser') | response = self.client.get(reverse('item_chooser')**)** |
| self.assertEqual(response.status_code, 200) | self.assertEqual(response.status_code, 200) |
| self.assertTemplateUsed(response, 'wagtailmodelchooser/chooser/model_chooser.html') | self.assertTemplateUsed(response, 'wagtailmodelchooser/chooser/model_chooser.html') |
| self.assertTemplateUsed(response, 'wagtailmodelchooser/chooser/model_chooser.js') | self.assertTemplateUsed(response, 'wagtailmodelchooser/chooser/model_chooser.js') |
| | |
Python parser ACCEPTED repair!
Filtered out 196/204 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 136600ms
Tidyparse (proposed/total): 246/393
Tidyparse (accepted/proposed): 241/246
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 36/48 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 30829ms
Tidyparse (proposed/total): 247/394
Tidyparse (accepted/proposed): 242/247
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| def prepare_from_flask_request(req): | def prepare_from_flask_request(req): |
| url_data = urlparse(req.url) | url_data = urlparse(req.url) |
| return{ | return{ |
| 'http_host': req.host, | 'http_host': req.host, |
| 'server_port': url_data.port, | 'server_port': url_data.port, |
| 'script_name': req.path, | 'script_name': req.path, |
| 'get_data': req.args.copy(), | 'get_data': req.args.copy(), |
| 'post_data': req.form.copy(), | 'post_data': req.form.copy(), |
| 'https': ("on" if current_app.config.get("ONELOGIN_HTTPS") else "off") | 'https': ("on" if current_app.config.get("ONELOGIN_HTTPS") else "off")**}** |
| | |
Python parser ACCEPTED repair!
Filtered out 33/36 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 47816ms
Tidyparse (proposed/total): 248/395
Tidyparse (accepted/proposed): 243/248
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def inactivateAdmin(pk): | def inactivateAdmin(pk): |
| try: | try: |
| admin = Admin.objects.get(id = pk) | admin = Admin.objects.get(id = pk) |
| user = admin.user | user = admin.user |
| logger.info('inactivate admin username={}'.~format(user~.username) | logger.info('inactivate admin username={}'.**formatuser**.username) |
| return inactivateUser(user) | return inactivateUser(user) |
| except ObjectDoesNotExist as e: | except ObjectDoesNotExist as e: |
| logger.error(e) | logger.error(e) |
| raise UserNotExist | raise UserNotExist |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 34ms
Tidyparse (proposed/total): 248/396
Tidyparse (accepted/proposed): 243/248
Original error: expected an indented block
| original | repair |
|--------------------------------------------------|-------------------------|
| ~def find_duplicates(treeroot, tbl = None):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Find duplicate files in a directory."""~ | |
| ~ dup = {}~ | |
| ~ if tbl is None: tbl = {}~ | |
| ~ os.path.walk(treeroot, file_walker, tbl)~ | |
| ~ for k, v in tbl.items():~ | |
| ~ if len(v) > 1:~ | |
| ~ dup[k] = v~ | |
| ~ return dup~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 248/397
Tidyparse (accepted/proposed): 243/248
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def adjust_hue((m_saturated, s_saturated, h_saturated), m_unsaturated):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if m_saturated >= m_unsaturated:~ | |
| ~ return h_saturated~ | |
| ~ else:~ | |
| ~ h_spin = (s_saturated * math.sqrt(m_unsaturated ** 2 - m_saturated ** 2)) /(m_saturated * math.sin(s_saturated))~ | |
| ~ if h_saturated > -(math.pi / 3.0):~ | |
| ~ return h_saturated + h_spin~ | |
| ~ else:~ | |
| ~ return h_saturated - h_spin~ | |
| ~~ | |
Filtered out 26/33 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 170549ms
Tidyparse (proposed/total): 249/398
Tidyparse (accepted/proposed): 244/249
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def stop_all_downloads(session_handle, db, magnet_statuses): | def stop_all_downloads(session_handle, db, magnet_statuses): |
| dbc = db.execute("""UPDATE""", { | dbc = db.execute("""UPDATE""", { |
| 'status_id_ready': magnet_statuses['ready'], | 'status_id_ready': magnet_statuses['ready'], |
| 'status_id_watching': magnet_statuses['watching'], | 'status_id_watching': magnet_statuses['watching'], |
| 'status_id_start_watching': magnet_statuses['start watching'] | 'status_id_start_watching': magnet_statuses**}**['start watching']**)** |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 35ms
Tidyparse (proposed/total): 249/399
Tidyparse (accepted/proposed): 244/249
Original error: expected an indented block
| original | repair |
|------------------------------------|-------------------------|
| ~def getarpa(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ ip = self.dec2ip(self.ip, 1)~ | |
| ~ ret = ""~ | |
| ~ for a in ip.split(':'):~ | |
| ~ while len(a) < 4:~ | |
| ~ a = "0%s" % a~ | |
| ~ for b in a:~ | |
| ~ ret = "%s.%s" %(b, ret)~ | |
| ~ ret += "ip6.arpa"~ | |
| ~ return ret~ | |
| ~~ | |
Filtered out 168/217 invalid samples!
Drew 49 samples before timeout
Synthesized repair in: 45713ms
Tidyparse (proposed/total): 250/400
Tidyparse (accepted/proposed): 245/250
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------|-----------------------------------------------------------------|
| def _assert_progress(self, meter, * progresses): | def _assert_progress(self, meter, * progresses): |
| """Variadic helper used to verify progress calculations.""" | """Variadic helper used to verify progress calculations.""" |
| self.assertEqual(meter.progress, list(progresses))~)~ | self.assertEqual(meter.progress, list(progresses)) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 27ms
Tidyparse (proposed/total): 250/401
Tidyparse (accepted/proposed): 245/250
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def validateDOF(value):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Validate list of fixed degrees of freedom."""~ | |
| ~ try:~ | |
| ~ size = len(value)~ | |
| ~ num = map(int, value)~ | |
| ~ for v in num:~ | |
| ~ if v < 0:~ | |
| ~ raise ValueError~ | |
| ~ except:~ | |
| ~ raise ValueError, "'bc_dof' must be a zero based list of indices of degrees of " "freedom at a vertex."~ | |
| ~ return num~ | |
| ~~ | |
Filtered out 67/79 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 30998ms
Tidyparse (proposed/total): 251/402
Tidyparse (accepted/proposed): 246/251
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| def test_boto_stubs(tmpdir): | def test_boto_stubs(tmpdir): |
| with vcr.use_cassette(str(tmpdir.join('boto-stubs.yml')))~)~: | with vcr.use_cassette(str(tmpdir.join('boto-stubs.yml'))): |
| from boto.https_connection import CertValidatingHTTPSConnection | from boto.https_connection import CertValidatingHTTPSConnection |
| from vcr.stubs.boto_stubs import VCRCertValidatingHTTPSConnection | from vcr.stubs.boto_stubs import VCRCertValidatingHTTPSConnection |
| assert issubclass(CertValidatingHTTPSConnection, VCRCertValidatingHTTPSConnection) | assert issubclass(CertValidatingHTTPSConnection, VCRCertValidatingHTTPSConnection) |
| CertValidatingHTTPSConnection('hostname.does.not.matter') | CertValidatingHTTPSConnection('hostname.does.not.matter') |
| | |
Python parser ACCEPTED repair!
Filtered out 4/9 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 39791ms
Tidyparse (proposed/total): 252/403
Tidyparse (accepted/proposed): 247/252
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------|-------------------------------------|
| def paragraph(): | def paragraph(): |
| return( | return( |
| sentence001() + space() + | sentence001() + space() + |
| sentence002() + space() + | sentence002() + space() + |
| sentence003() + space() + | sentence003() + space() + |
| sentence004() + space() + | sentence004() + space() + |
| sentence005() + space() + | sentence005() + space() + |
| sentence006() + para() | sentence006() + para()**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 128/165 invalid samples!
Drew 37 samples before timeout
Synthesized repair in: 95166ms
Tidyparse (proposed/total): 253/404
Tidyparse (accepted/proposed): 248/253
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| __author__ = 'root' | __author__ = 'root' |
| from pagrant.vendors.docker import Client | from pagrant.vendors.docker import Client |
| docker = Client() | docker = Client() |
| ~print(docker~.inspect_container("4ebadf848eeeb8d75067516df2aaecab7e4ca3e9d1a77710146d279d9f34d902")['NetworkSettings'][ | **printdocker**.inspect_container("4ebadf848eeeb8d75067516df2aaecab7e4ca3e9d1a77710146d279d9f34d902")['NetworkSettings'][ |
| 'IPAddress'] | 'IPAddress'] |
| | |
Python parser ACCEPTED repair!
Filtered out 28/39 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 35782ms
Tidyparse (proposed/total): 254/405
Tidyparse (accepted/proposed): 249/254
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def fetch_single_source_by_citekey(citekey): | def fetch_single_source_by_citekey(citekey): |
| """Grab source data and its linked note id given source citekey.This is used""" | """Grab source data and its linked note id given source citekey.This is used""" |
| rows = dbq('SELECT sources.*, notes.id AS nid FROM sources, notes WHERE sources.citekey LIKE ? AND notes.source_id = sources.id', (unicode(citekey, 'utf-8'), ))~)~ | rows = dbq('SELECT sources.*, notes.id AS nid FROM sources, notes WHERE sources.citekey LIKE ? AND notes.source_id = sources.id', (unicode(citekey, 'utf-8'), )) |
| if len(rows) > 0: | if len(rows) > 0: |
| return rows[0] | return rows[0] |
| else: | else: |
| return None | return None |
| | |
Python parser ACCEPTED repair!
Filtered out 85/117 invalid samples!
Drew 32 samples before timeout
Synthesized repair in: 32170ms
Tidyparse (proposed/total): 255/406
Tidyparse (accepted/proposed): 250/255
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|------------------------------------------------------------------------|
| def hmset(self, key, field, value, * pairs): | def hmset(self, key, field, value, * pairs): |
| """Set multiple hash fields to multiple values.""" | """Set multiple hash fields to multiple values.""" |
| if len(pairs) % 2 != 0: | if len(pairs) % 2 != 0: |
| raise TypeError("length of pairs must be even number") | raise TypeError("length of pairs must be even number") |
| return wait_ok(self.execute(b'HMSET', key, field, value, * pairs))~)~ | return wait_ok(self.execute(b'HMSET', key, field, value, * pairs)) |
| | |
Python parser ACCEPTED repair!
Filtered out 58/60 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 33761ms
Tidyparse (proposed/total): 256/407
Tidyparse (accepted/proposed): 251/256
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|--------------------------------------------|
| def swap_slot(self, a, b): | def swap_slot(self, a, b): |
| """Swap two character slots.""" | """Swap two character slots.""" |
| if(a != b and 0 <=(a and b) <= 4: | if(a != b and 0 <=(a and b)**)** <= 4: |
| tmp = self._st_gi(a) | tmp = self._st_gi(a) |
| self._st_si(a, self._st_gi(b)) | self._st_si(a, self._st_gi(b)) |
| self._st_si(b, tmp) | self._st_si(b, tmp) |
| | |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 50613ms
Tidyparse (proposed/total): 257/408
Tidyparse (accepted/proposed): 252/257
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30838ms
Tidyparse (proposed/total): 257/409
Tidyparse (accepted/proposed): 252/257
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------|-------------------------|
| ~def pushRegister(self, reg):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if reg == 0:~ | |
| ~ self.byteCodeGenerator.pushConst(0)~ | |
| ~ elif reg == mips.R_MEM:~ | |
| ~ nr = self.regToLocalVariable(reg)~ | |
| ~ if config.aloadMemory:~ | |
| ~ self.byteCodeGenerator.aload(nr)~ | |
| ~ else:~ | |
| ~ self.byteCodeGenerator.getstatic("CRunTime/memory [I")~ | |
| ~ elif regIsStatic(reg):~ | |
| ~ self.byteCodeGenerator.getstatic(staticRegs[reg])~ | |
| ~ else:~ | |
| ~ nr = self.regToLocalVariable(reg)~ | |
| ~ self.byteCodeGenerator.iload(nr)~ | |
| ~~ | |
Filtered out 121/121 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 50552ms
Tidyparse (proposed/total): 257/410
Tidyparse (accepted/proposed): 252/257
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------------------------------------|-------------------------|
| ~def draw(self, screen, room):~ | **NO_REPAIR_PROPOSAL!** |
| ~ self.eyesclosedcounter += 1~ | |
| ~ if self.eyesclosedcounter > 23:~ | |
| ~ self.stimlibeyesclosed.draw(screen, self.x - 40 + room.relativex, self.y + room.relativey)~ | |
| ~ if self.eyesclosedcounter > 26:~ | |
| ~ self.eyesclosedcounter = 0~ | |
| ~ else:~ | |
| ~ self.stimlib.draw(screen, self.x - 40 + room.relativex, self.y + room.relativey)~ | |
| ~~ | |
Filtered out 87/90 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 44088ms
Tidyparse (proposed/total): 258/411
Tidyparse (accepted/proposed): 253/258
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| def sortkeysbyvalue(lexicon, whethertoreverse = False): | def sortkeysbyvalue(lexicon, whethertoreverse = False): |
| '''Accepts a dictionary where keys point to a(presumably numeric)value, and''' | '''Accepts a dictionary where keys point to a(presumably numeric)value, and''' |
| tuplelist = list() | tuplelist = list() |
| for key, value in lexicon.items(): | for key, value in lexicon.items(): |
| tuplelist.append(~(~value, key) | tuplelist.append(value, key) |
| tuplelist = sorted(tuplelist, reverse = whethertoreverse) | tuplelist = sorted(tuplelist, reverse = whethertoreverse) |
| return tuplelist | return tuplelist |
| | |
Python parser ACCEPTED repair!
Filtered out 68/76 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30143ms
Tidyparse (proposed/total): 259/412
Tidyparse (accepted/proposed): 254/259
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| def get_loaded_element(browser, xpath): | def get_loaded_element(browser, xpath): |
| WebDriverWait(browser, timeout).~until(EC~.presence_of_element_located((By.XPATH, xpath)) | WebDriverWait(browser, timeout).**untilEC**.presence_of_element_located((By.XPATH, xpath)) |
| print(xpath) | print(xpath) |
| return browser.find_element_by_xpath(xpath) | return browser.find_element_by_xpath(xpath) |
| | |
Python parser ACCEPTED repair!
Filtered out 12/19 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 78377ms
Tidyparse (proposed/total): 260/413
Tidyparse (accepted/proposed): 255/260
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def request(query, params): | def request(query, params): |
| offset = (params['pageno'] - 1) * 8 | offset = (params['pageno'] - 1) * 8 |
| language = 'en-US' | language = 'en-US' |
| if params['language'] != 'all': | if params['language'] != 'all': |
| language = params['language'].replace('_', '-') | language = params['language'].replace('_', '-') |
| params['url'] = search_url.~format(offset~ = 0 | params['url'] = search_url.**formatoffset** = 0 |
| | |
Python parser ACCEPTED repair!
Filtered out 17/31 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 34034ms
Tidyparse (proposed/total): 261/414
Tidyparse (accepted/proposed): 255/261
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------|------------------------------------------------------------------|
| class TestOpanEnumValueCheck(unittest.TestCase): | class TestOpanEnumValueCheck(unittest.TestCase): |
| def test_OpanEnum_ValueCheck(self): | def test_OpanEnum_ValueCheck(self): |
| from opan.const import EnumDispDirection as EDD | from opan.const import EnumDispDirection as EDD |
| self.assertTrue(EDD.NEGATIVE in EDD) | self.assertTrue(EDD.NEGATIVE in EDD) |
| def test_OpanEnum_IterCheck(self): | def test_OpanEnum_IterCheck(self): |
| from opan.const import EnumDispDirection as EDD | from opan.const import EnumDispDirection as EDD |
| self.assertSetEqual({'NEGATIVE', 'NO_DISP', 'POSITIVE'}, | self.assertSetEqual({'NEGATIVE', 'NO_DISP', 'POSITIVE'}, |
| ~set(k~ for k in EDD) | **setk** for k in EDD) |
| | |
Python parser REJECTED repair because: Generator expression must be parenthesized (<unknown>, line 8)
Filtered out 1/1 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 40257ms
Tidyparse (proposed/total): 261/415
Tidyparse (accepted/proposed): 255/261
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------|-------------------------|
| ~def test_ToRawUri(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("***==== Test To Raw Uri Value ====***"~ | |
| ~ gid96 = self._gid96.encode(self._generalManager, None, self._objectClass, None, self._serialNumber)~ | |
| ~ print(gid96.toEPCRawUri())~ | |
| ~ print("***==== END Test To EPC Tag Uri Value ====***"~ | |
| ~ print(""~ | |
| ~~ | |
Filtered out 93/93 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31895ms
Tidyparse (proposed/total): 261/416
Tidyparse (accepted/proposed): 255/261
Original error: unexpected indent
| original | repair |
|------------------------------------------------------------------------------------------------------|-------------------------|
| ~def check(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Read status messages from manager and check heartbeat"""~ | |
| ~ self.read_status_updates()~ | |
| ~ if self._running_id and self._hb_deadline is not None and time.time() > self._hb_deadline:~ | |
| ~ self.cmd({'cmd': 'run', 'session': self._running_id, 'break': 'finished'})~ | |
| ~ self.cmd({'cmd': 'stop', 'session': self._running_id})~ | |
| ~~ | |
Filtered out 27/33 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30535ms
Tidyparse (proposed/total): 262/417
Tidyparse (accepted/proposed): 256/262
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| def on_render(self): | def on_render(self): |
| self._display_surf.blit(self._surf_image.subsurface(camera), (0, 0)) | self._display_surf.blit(self._surf_image.subsurface(camera), (0, 0)) |
| font = pygame.font.SysFont("None", 20) | font = pygame.font.SysFont("None", 20) |
| self._display_surf.blit(font.render("FPS: %f" %(self.fps.get_fps~(~)), 0, (255, 0, 0), (0, 0)) | self._display_surf.blit(font.render("FPS: %f" %(self.fps.get_fps)), 0, (255, 0, 0), (0, 0)) |
| pygame.display.flip() | pygame.display.flip() |
| | |
Python parser ACCEPTED repair!
Filtered out 67/87 invalid samples!
Drew 20 samples before timeout
Synthesized repair in: 33939ms
Tidyparse (proposed/total): 263/418
Tidyparse (accepted/proposed): 257/263
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|-----------------------------------------------------------------|
| def test_has_body_no_content_length(self): | def test_has_body_no_content_length(self): |
| request = wsgi.Request.blank('/') | request = wsgi.Request.blank('/') |
| request.method = 'POST' | request.method = 'POST' |
| request.body = b'asdf' | request.body = b'asdf' |
| request.headers.pop('Content-Length') | request.headers.pop('Content-Length') |
| self.assertFalse(rpc.RPCJSONDeserializer().has_body(request))~)~ | self.assertFalse(rpc.RPCJSONDeserializer().has_body(request |
| | )) |
Python parser ACCEPTED repair!
Filtered out 100/104 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32928ms
Tidyparse (proposed/total): 264/419
Tidyparse (accepted/proposed): 258/264
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| def load_game(filepath): | def load_game(filepath): |
| global gamedata | global gamedata |
| if gamedata._game is not None: | if gamedata._game is not None: |
| from gui.prompts import QuitPrompt | from gui.prompts import QuitPrompt |
| prompt = QuitPrompt(~(~"""There is already a game in progress.\nDo you wish to load a new game?\n(Your progress will not be saved.)""") | prompt = QuitPrompt("""There is already a game in progress.\nDo you wish to load a new game?\n(Your progress will not be saved.)""") |
| if prompt.get_input() == True: | if prompt.get_input() == True: |
| _do_loading_stuff(filepath) | _do_loading_stuff(filepath) |
| else: _do_loading_stuff(filepath) | else: _do_loading_stuff(filepath) |
| | |
Python parser ACCEPTED repair!
Filtered out 51/51 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34773ms
Tidyparse (proposed/total): 264/420
Tidyparse (accepted/proposed): 258/264
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def eval_spline(self, index, spline, output, grid, label = 'noname'):~ | **NO_REPAIR_PROPOSAL!** |
| ~ center = self.coordinates[index]~ | |
| ~ if log.do_debug:~ | |
| ~ number = self.numbers[index]~ | |
| ~ log(' Evaluating spline(%s)for atom %i(n=%i)on %i grid points' %(label, index, number, grid.size)~ | |
| ~ grid.eval_spline(spline, center, output)~ | |
| ~~ | |
Filtered out 64/92 invalid samples!
Drew 28 samples before timeout
Synthesized repair in: 30855ms
Tidyparse (proposed/total): 265/421
Tidyparse (accepted/proposed): 259/265
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def get_all_credentials(tenant_id): | def get_all_credentials(tenant_id): |
| """Lists all the creds for a tenant.""" | """Lists all the creds for a tenant.""" |
| session = db.get_session() | session = db.get_session() |
| return(session.query(network_models_v2.Credential). | return(session.query(network_models_v2.Credential). |
| filter_by(tenant_id = tenant_id).all~()~ | filter_by(tenant_id = tenant_id).all |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 28ms
Tidyparse (proposed/total): 265/422
Tidyparse (accepted/proposed): 259/265
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------------------------|-------------------------|
| ~def readS16(self, reg):~ | **NO_REPAIR_PROPOSAL!** |
| ~ "Reads a signed 16-bit value from the I2C device"~ | |
| ~ while True:~ | |
| ~ try:~ | |
| ~ hibyte = self.bus.read_byte_data(self.address, reg)~ | |
| ~ if(hibyte > 127):~ | |
| ~ hibyte -= 256~ | |
| ~ result = (hibyte << 8) + self.bus.read_byte_data(self.address, reg + 1)~ | |
| ~ return result~ | |
| ~ except IOError, err:~ | |
| ~ self.misses += 1~ | |
| ~~ | |
Filtered out 50/54 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 42691ms
Tidyparse (proposed/total): 266/423
Tidyparse (accepted/proposed): 260/266
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| def is_probably_packed(pe): | def is_probably_packed(pe): |
| """Returns True is there is a high likelihood that a file is packed or contains compressed data.""" | """Returns True is there is a high likelihood that a file is packed or contains compressed data.""" |
| total_pe_data_length = ~len(pe~.trim() | total_pe_data_length = **lenpe**.trim() |
| has_significant_amount_of_compressed_data = False | has_significant_amount_of_compressed_data = False |
| total_compressed_data = 0 | total_compressed_data = 0 |
| for section in pe.sections: | for section in pe.sections: |
| s_entropy = section.get_entropy() | s_entropy = section.get_entropy() |
| s_length = len(section.get_data()) | s_length = len(section.get_data()) |
| if s_entropy > 7.4: | if s_entropy > 7.4: |
| total_compressed_data += s_length | total_compressed_data += s_length |
| if((1.0 * total_compressed_data) / total_pe_data_length) > .2: | if((1.0 * total_compressed_data) / total_pe_data_length) > .2: |
| has_significant_amount_of_compressed_data = True | has_significant_amount_of_compressed_data = True |
| return has_significant_amount_of_compressed_data | return has_significant_amount_of_compressed_data |
| | |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 31013ms
Tidyparse (proposed/total): 267/424
Tidyparse (accepted/proposed): 261/267
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| class Ui_frmSelArcos(object): | class Ui_frmSelArcos(object): |
| def setupUi(self, frmSelArcos): | def setupUi(self, frmSelArcos): |
| frmSelArcos.setObjectName(_fromUtf8("frmSelArcos")) | frmSelArcos.setObjectName(_fromUtf8("frmSelArcos")) |
| frmSelArcos.resize(452, 201) | frmSelArcos.resize(452, 201) |
| frmSelArcos.setWindowTitle(QtGui.QApplication.translate("frmSelArcos", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) | frmSelArcos.setWindowTitle(QtGui.QApplication.translate("frmSelArcos", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) |
| self.label = QtGui.QLabel(frmSelArcos) | self.label = QtGui.QLabel(frmSelArcos) |
| self.label.setGeometry(QtCore.QRect(30, 10, 381, 51)) | self.label.setGeometry(QtCore.QRect(30, 10, 381, 51)) |
| self.label.setText(QtGui.QApplication.translate("frmSelArcos", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | self.label.setText(QtGui.QApplication.translate("frmSelArcos", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 390/390 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 63819ms
Tidyparse (proposed/total): 267/425
Tidyparse (accepted/proposed): 261/267
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------------------------------|-------------------------|
| ~import pathlib~ | **NO_REPAIR_PROPOSAL!** |
| ~from exactly_lib.processing.test_case_handling_setup import TestCaseHandlingSetup~ | |
| ~from exactly_lib.section_document import document_parser~ | |
| ~from exactly_lib.test_suite import suite_file_reading~ | |
| ~def resolve_handling_setup_from_suite(default_handling_setup: TestCaseHandlingSetup,~ | |
| ~ configuration_section_parser: document_parser.SectionElementParser,~ | |
| ~ suite_to_read_config_from: pathlib.Path) -> TestCaseHandlingSetup:~ | |
| ~ if not suite_to_read_config_from:~ | |
| ~ return default_handling_setup~ | |
| ~ suite_document = suite_file_reading.read_suite_document(suite_to_read_config_from,~ | |
| ~ configuration_section_parser)~ | |
| ~ return suite_file_reading.resolve_test_case_handling_setup(suite_document,~ | |
| ~ default_handling_setup)~ | |
| ~~ | |
Filtered out 72/72 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31962ms
Tidyparse (proposed/total): 267/426
Tidyparse (accepted/proposed): 261/267
Original error: expected an indented block
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~"""QA utility functions for testing jobs"""~ | **NO_REPAIR_PROPOSAL!** |
| ~import re~ | |
| ~import sys~ | |
| ~import threading~ | |
| ~import time~ | |
| ~from ganeti import locking~ | |
| ~from ganeti import utils~ | |
| ~from ganeti.utils import retry~ | |
| ~import qa_config~ | |
| ~import qa_error~ | |
| ~from qa_utils import AssertCommand, GetCommandOutput, GetObjectInfo~ | |
| ~AVAILABLE_LOCKS = [locking.LEVEL_NODE, ]~ | |
| ~def GetOutputFromMaster(cmd,~ | |
| ~ use_multiplexer = True, log_cmd = True):~ | |
| ~ """ Gets the output of a command executed on master."""~ | |
| ~ if isinstance(cmd, basestring):~ | |
| ~ cmdstr = cmd~ | |
| ~ else:~ | |
| ~ cmdstr = utils.ShellQuoteArgs(cmd)~ | |
| ~ cmdstr += " 2>&1"~ | |
| ~ return GetCommandOutput(qa_config.GetMasterNode().primary, cmdstr)~ | |
| ~~ | |
Filtered out 276/289 invalid samples!
Drew 13 samples before timeout
Synthesized repair in: 132126ms
Tidyparse (proposed/total): 268/427
Tidyparse (accepted/proposed): 262/268
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------|-----------------------------------------------------|
| import os | import os |
| import jinja2 | import jinja2 |
| import webapp2 | import webapp2 |
| template_dir = os.path.realpath(os.path.join( | template_dir = os.path.realpath(os.path.join( |
| os.path.~dirname(__file__~), "../templates" | os.path.**dirname__file__**), "../templates" |
| ) | ) |
| jinja_env = jinja2.Environment( | jinja_env = jinja2.Environment( |
| loader = jinja2.FileSystemLoader(template_dir), | loader = jinja2.FileSystemLoader(template_dir), |
| autoescape = True | autoescape = True |
| ) | ) |
| | |
Python parser ACCEPTED repair!
Filtered out 316/316 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 103190ms
Tidyparse (proposed/total): 268/428
Tidyparse (accepted/proposed): 262/268
Original error: unexpected indent
| original | repair |
|-----------------------|-------------------------|
| ~Fib()~ | **NO_REPAIR_PROPOSAL!** |
| ~ a, b = b, a + b~ | |
| ~ str(a)~ | |
| ~if len(a) > 1000~ | |
| ~print(a)~ | |
| ~~ | |
Filtered out 71/83 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 31270ms
Tidyparse (proposed/total): 269/429
Tidyparse (accepted/proposed): 263/269
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| from django.conf.urls import patterns, include, url | from django.conf.urls import patterns, include, url |
| from django.contrib import admin | from django.contrib import admin |
| admin.autodiscover() | admin.autodiscover() |
| urlpatterns = patterns('', | urlpatterns = patterns('', |
| url(r'^$', 'tracecode.browser.views.home', name = 'home'), | url(r'^$', 'tracecode.browser.views.home', name = 'home'), |
| url(r'^admin/doc/', include('django.contrib.admindocs.urls'), | url(r'^admin/doc/', include('django.contrib.admindocs.urls'), |
| url(r'^admin/', include(admin.site.urls)), | url**)**(r'^admin/', include(admin.site.urls)), |
| ) | ) |
| | |
Python parser ACCEPTED repair!
Filtered out 63/67 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 54455ms
Tidyparse (proposed/total): 270/430
Tidyparse (accepted/proposed): 264/270
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| def get_last_position_of_misspelled_word(misspelled_word, buffer): | def get_last_position_of_misspelled_word(misspelled_word, buffer): |
| input_pos = weechat.buffer_get_integer(buffer, 'input_pos') | input_pos = weechat.buffer_get_integer(buffer, 'input_pos') |
| input_line = weechat.buffer_get_string(buffer, 'input') | input_line = weechat.buffer_get_string(buffer, 'input') |
| x = input_line.~rfind(misspelled_word~, 0, int(input_pos) | x = input_line.**rfindmisspelled_word**, 0, int(input_pos) |
| y = x + len(misspelled_word) | y = x + len(misspelled_word) |
| return x, y, input_pos | return x, y, input_pos |
| | |
Python parser ACCEPTED repair!
Filtered out 66/72 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 34802ms
Tidyparse (proposed/total): 271/431
Tidyparse (accepted/proposed): 265/271
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------|------------------------------|
| def encodeNum(n): | def encodeNum(n): |
| if n == 0: | if n == 0: |
| return b'\0' | return b'\0' |
| if n > 0: | if n > 0: |
| return encodeUNum(n) | return encodeUNum(n) |
| s = ~encodeUNum~(~abs(~n) | s = **encodeUNumabs**(n) |
| s = bytearray(s) | s = bytearray(s) |
| s[- 1] = s[- 1] | 0x80 | s[- 1] = s[- 1] | 0x80 |
| return bytes(s) | return bytes(s) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 41ms
Tidyparse (proposed/total): 271/432
Tidyparse (accepted/proposed): 265/271
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def _read(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ data = self.response.read()~ | |
| ~ if self.response.getheader('Content-Encoding', '').find('gzip') >= 0:~ | |
| ~ try:~ | |
| ~ compressed = StringIO(data)~ | |
| ~ f = GzipFile(fileobj = compressed)~ | |
| ~ data = f.read()~ | |
| ~ except:~ | |
| ~ raise IOError, ('http error', 'got corrupt response')~ | |
| ~ return data~ | |
| ~~ | |
Filtered out 72/80 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 30537ms
Tidyparse (proposed/total): 272/433
Tidyparse (accepted/proposed): 266/272
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def AddResults(self, tab, results, trace_name = 'cpu_utilization'): | def AddResults(self, tab, results, trace_name = 'cpu_utilization'): |
| assert self._results, 'Must call Stop() first' | assert self._results, 'Must call Stop() first' |
| for process_type in self._results: | for process_type in self._results: |
| trace_name_for_process = '%s_%s' ~%(trace_name~, process_type.lower() | trace_name_for_process = '%s_%s' **%trace_name**, process_type.lower() |
| cpu_percent = 100 * self._results[process_type] | cpu_percent = 100 * self._results[process_type] |
| results.Add(trace_name_for_process, '%', cpu_percent, | results.Add(trace_name_for_process, '%', cpu_percent, |
| chart_name = 'cpu_utilization', data_type = 'unimportant') | chart_name = 'cpu_utilization', data_type = 'unimportant') |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 272/434
Tidyparse (accepted/proposed): 266/272
Original error: invalid syntax
| original | repair |
|-------------------------------------------|-------------------------|
| ~def set_output(self, int i, float val):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if(len(self.outputs) > i):~ | |
| ~ self.outputs[i].setv(val)~ | |
| ~ return~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 272/435
Tidyparse (accepted/proposed): 266/272
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~def __getstate__(self) -> Dict[str, Any]:~ | **NO_REPAIR_PROPOSAL!** |
| ~ state = thor.events.EventEmitter.__getstate__(self)~ | |
| ~ for key in[~ | |
| ~ '_md5_processor',~ | |
| ~ '_md5_post_processor',~ | |
| ~ '_gzip_processor',~ | |
| ~ 'add_note']:~ | |
| ~ if key in state:~ | |
| ~ del state[key]~ | |
| ~ return state~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 37ms
Tidyparse (proposed/total): 272/436
Tidyparse (accepted/proposed): 266/272
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------------------------------|-------------------------|
| ~def set(self, text):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Fit (set) `text` (a string) to the billboard."""~ | |
| ~ for i in range(self.height if self.height < self.width else self.width,~ | |
| ~ 1, - 1):~ | |
| ~ if self.check_size(i, text):~ | |
| ~ return i~ | |
| ~ return 0~ | |
| ~~ | |
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 30806ms
Tidyparse (proposed/total): 273/437
Tidyparse (accepted/proposed): 267/273
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------|---------------------------------------------------------------------|
| class Ui_Form(object): | class Ui_Form(object): |
| def setupUi(self, Form): | def setupUi(self, Form): |
| Form.setObjectName(_fromUtf8("Form")) | Form.setObjectName(_fromUtf8("Form")) |
| Form.resize(165, 290) | Form.resize(165, 290) |
| Form.setStyleSheet(_fromUtf8("background-color: b;")) | Form.setStyleSheet(_fromUtf8("background-color: b;")) |
| self.bt1 = QtGui.QPushButton(Form) | self.bt1 = QtGui.QPushButton(Form) |
| self.bt1.setGeometry(QtCore.QRect(10, 10, 45, 45)) | self.bt1.setGeometry(QtCore.QRect(10, 10, 45, 45)) |
| self.bt1.setStyleSheet(_fromUtf8("background-color:grey;\n" | self.bt1.setStyleSheet(_fromUtf8("background-color:grey;\n" |
| | **))** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 61ms
Tidyparse (proposed/total): 273/438
Tidyparse (accepted/proposed): 267/273
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------|-------------------------|
| ~class CheckHTML(object):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def process_response(self, request, response):~ | |
| ~ if(settings.DEBUG and~ | |
| ~ settings.WARN_ABOUT_INVALID_HTML5_OUTPUT and~ | |
| ~ 200 <= response.status_code < 300):~ | |
| ~ proc = Popen(["tidy"], stdout = PIPE, stderr = PIPE, stdin = PIPE)~ | |
| ~ _out, err = proc.communicate(response.content)~ | |
| ~ for l in err.split('\n\n')[0].split('\n')[: - 2]:~ | |
| ~ logger.warning(l)~ | |
| ~ return response~ | |
| ~~ | |
Filtered out 41/44 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 40893ms
Tidyparse (proposed/total): 274/439
Tidyparse (accepted/proposed): 268/274
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------|---------------------------------------------------|
| def checkBackgroundJobs(self): | def checkBackgroundJobs(self): |
| for job in job_manager.getPendingJobs(): | for job in job_manager.getPendingJobs(): |
| print("type(job): ", ~type(job~) | print("type(job): ", **typejob**) |
| print("Process.DVDJob: ", Process.DVDJob) | print("Process.DVDJob: ", Process.DVDJob) |
| if type(job) == Process.DVDJob: | if type(job) == Process.DVDJob: |
| self.backgroundJob = job | self.backgroundJob = job |
| return | return |
| self.backgroundJob = None | self.backgroundJob = None |
| | |
Python parser ACCEPTED repair!
Filtered out 84/84 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30964ms
Tidyparse (proposed/total): 274/440
Tidyparse (accepted/proposed): 268/274
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------|-------------------------|
| ~def test_generate_arbiter_buffer(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """generate an arbiter buffer"""~ | |
| ~ result = arbiter.generate_arbiter_buffer(2, debug = self.dbg)~ | |
| ~ if(self.dbg):~ | |
| ~ print "generated arbiter buffer: \n" + result~ | |
| ~ self.assertEqual((len(result) > 0), True)~ | |
| ~~ | |
Filtered out 76/84 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 34152ms
Tidyparse (proposed/total): 275/441
Tidyparse (accepted/proposed): 269/275
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|-------------------------------------------------------------|
| def _sumw(y, j_l, j_u, logWmax, p, phi): | def _sumw(y, j_l, j_u, logWmax, p, phi): |
| j = np.arange(j_l, j_u + 1) | j = np.arange(j_l, j_u + 1) |
| sumw = np.~sum(np~.exp(_logWj(y, j, p, phi) - logWmax) | sumw = np.**sumnp**.exp(_logWj(y, j, p, phi) - logWmax) |
| return sumw | return sumw |
| | |
Python parser ACCEPTED repair!
Filtered out 43/60 invalid samples!
Drew 17 samples before timeout
Synthesized repair in: 33002ms
Tidyparse (proposed/total): 276/442
Tidyparse (accepted/proposed): 270/276
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------|----------------------------------|
| class Ship: | class Ship: |
| SHIP_INFO = ~[~ | SHIP_INFO = **(** |
| ("Aircraft Carrier", 5), | ("Aircraft Carrier", 5), |
| ("Battleship", 4), | ("Battleship", 4), |
| ("Submarine", 3), | ("Submarine", 3), |
| ("Cruiser", 3), | ("Cruiser", 3), |
| ("Patrol Boat", 2) | ("Patrol Boat", 2)**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 42/52 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 37317ms
Tidyparse (proposed/total): 277/443
Tidyparse (accepted/proposed): 271/277
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-----------------------------------------------------------|
| def _collapse(self): | def _collapse(self): |
| self.resize(self.startwidth, self.parent().height())~)~ | self.resize(self.startwidth, self.parent().height()) |
| self.move(self.parent().width() - self.startwidth, 0) | self.move(self.parent().width() - self.startwidth, 0) |
| self.expaned = False | self.expaned = False |
| | |
Python parser ACCEPTED repair!
Filtered out 12/25 invalid samples!
Drew 13 samples before timeout
Synthesized repair in: 32569ms
Tidyparse (proposed/total): 278/444
Tidyparse (accepted/proposed): 272/278
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|-----------------------------------------------------------------------|
| def get_authorization_headers(self): | def get_authorization_headers(self): |
| seconds_since_epoch = int(time.time()) | seconds_since_epoch = int(time.time()) |
| token = jwt.JWT(header = dict(alg = 'ES256', kid = '8937YX2XGP'), | token = jwt.JWT(header = dict(alg = 'ES256', kid = '8937YX2XGP'), |
| claims = dict(iss = 'CYEL96ZVC2', | claims = dict(iss = 'CYEL96ZVC2', |
| iat = seconds_since_epoch, | iat = seconds_since_epoch, |
| exp = seconds_since_epoch + 2592000)) | exp = seconds_since_epoch + 2592000)) |
| token.make_signed_token(self.key) | token.make_signed_token(self.key) |
| return dict(Authorization = 'Bearer ' + token.serialize~(~) | return dict(Authorization = 'Bearer ' + token.serialize) |
| | |
Python parser ACCEPTED repair!
Filtered out 39/60 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 31488ms
Tidyparse (proposed/total): 279/445
Tidyparse (accepted/proposed): 273/279
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| class LiveArticleManager(CachingManager): | class LiveArticleManager(CachingManager): |
| def get_query_set(self): | def get_query_set(self): |
| return super(LiveArticleManager, self).get_query_set().filter(is_live = True, pubdate__lte = datetime.now~()~ | return super(LiveArticleManager, self).get_query_set().filter(is_live = True, pubdate__lte = datetime.now |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 112/136 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 55084ms
Tidyparse (proposed/total): 280/446
Tidyparse (accepted/proposed): 274/280
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def verify_request(self, request): | def verify_request(self, request): |
| """A wrapper method that calls verify_request on `server_class` instance.""" | """A wrapper method that calls verify_request on `server_class` instance.""" |
| core = self.get_oauthlib_core() | core = self.get_oauthlib_core() |
| return core.verify_request(request, scopes = self.get_scopes~(~) | return core.verify_request(request, scopes = self.get_scopes) |
| | |
Python parser ACCEPTED repair!
Filtered out 2/2 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32429ms
Tidyparse (proposed/total): 280/447
Tidyparse (accepted/proposed): 274/280
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|-------------------------|
| ~def create_workplace(request):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if request.method == 'POST':~ | |
| ~ form = CreateWorkplaceForm(request.POST)~ | |
| ~ if form.is_valid():~ | |
| ~ form.save()~ | |
| ~ identifier = form.cleaned_data['identifier']~ | |
| ~ redirect_url = reverse(~ | |
| ~ 'auth:create_workplace_identifier',~ | |
| ~ kwargs = {'identifier': identifier, },~ | |
| ~ ))~ | |
| ~ return HttpResponseRedirect(redirect_url)~ | |
| ~ else:~ | |
| ~ form = CreateWorkplaceForm()~ | |
| ~ return render(request, 'auth/create_workplace.html', {~ | |
| ~ 'form': form,~ | |
| ~ })~ | |
| ~~ | |
Filtered out 53/53 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31442ms
Tidyparse (proposed/total): 280/448
Tidyparse (accepted/proposed): 274/280
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|-------------------------|
| ~def anagrams_for(word):~ | **NO_REPAIR_PROPOSAL!** |
| ~ word_array = array('u', word)~ | |
| ~ [print new_word.tobytes()~ | |
| ~ for new_word in~ | |
| ~ list(itertools.permutations(word_array, word_array.length))~ | |
| ~ if new_word in~ | |
| ~ words.words())]~ | |
| ~~ | |
Filtered out 53/56 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 32612ms
Tidyparse (proposed/total): 281/449
Tidyparse (accepted/proposed): 275/281
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------|----------------------------------------------------------------|
| def get_outputs(self): | def get_outputs(self): |
| """convert pubkeys to addresses""" | """convert pubkeys to addresses""" |
| o = [] | o = [] |
| for type, x, v in self.outputs: | for type, x, v in self.outputs: |
| if type == 'address': | if type == 'address': |
| addr = x | addr = x |
| elif type == 'pubkey': | elif type == 'pubkey': |
| addr = ~public_key_to_bc_address(x~.decode('hex') | addr = **public_key_to_bc_addressx**.decode('hex') |
| else: | else: |
| addr = 'SCRIPT ' + x.encode('hex') | addr = 'SCRIPT ' + x.encode('hex') |
| o.append((addr, v)) | o.append((addr, v)) |
| return o | return o |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 36ms
Tidyparse (proposed/total): 281/450
Tidyparse (accepted/proposed): 275/281
Original error: expected an indented block
| original | repair |
|-------------------------------------------------|-------------------------|
| ~def print_prec(self, arr, prec):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ nparr = np.array(arr)~ | |
| ~ np.set_printoptions(precision = prec)~ | |
| ~ if len(nparr) > 1:~ | |
| ~ strvals = str(nparr)[1: - 1]~ | |
| ~ return strvals~ | |
| ~ except:~ | |
| ~ return "Error in the array."~ | |
| ~~ | |
Filtered out 1/1 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30982ms
Tidyparse (proposed/total): 281/451
Tidyparse (accepted/proposed): 275/281
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def printCSofEnabledInterfaces(ip):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if args.ifupcs~ | |
| ~ print("\033[1m" + "Printing comma separated integers for all Enabled Interfaces" + "\033[0m")~ | |
| ~ commaintlist = subprocess.call("grep -oP '(?<=\d\.)\d+(?= = INTEGER: 1)' intlistupstatus | paste -s -d , >> csv", shell = True)~ | |
| ~~ | |
Filtered out 68/73 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 32148ms
Tidyparse (proposed/total): 282/452
Tidyparse (accepted/proposed): 276/282
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| def acquire(streams): | def acquire(streams): |
| """ Start an acquisition task for the given streams.""" | """ Start an acquisition task for the given streams.""" |
| future = model.ProgressiveFuture() | future = model.ProgressiveFuture() |
| task = AcquisitionTask(streams, future) | task = AcquisitionTask(streams, future) |
| future.task_canceller = task.cancel | future.task_canceller = task.cancel |
| thread = threading.Thread(target = _futures.executeTask, name = "Acquisition task", | thread = threading.Thread(target = _futures.executeTask, name = "Acquisition task", |
| args = (future, task.run))~)~ | args = (future, task.run)) |
| thread.start() | thread.start() |
| return future | return future |
| | |
Python parser ACCEPTED repair!
Filtered out 77/92 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 37041ms
Tidyparse (proposed/total): 283/453
Tidyparse (accepted/proposed): 277/283
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def get_coreference(self): | def get_coreference(self): |
| """Return all the coreference entity in the document""" | """Return all the coreference entity in the document""" |
| return self.root.findall( | return self.root.findall( |
| "{0}/{1}".format( | "{0}/{1}".format( |
| self.COREFERENCE_LAYER_TAG, | self.COREFERENCE_LAYER_TAG, |
| self.COREFERENCE_OCCURRENCE_TAG) | self.COREFERENCE_OCCURRENCE_TAG) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 49/49 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 36014ms
Tidyparse (proposed/total): 283/454
Tidyparse (accepted/proposed): 277/283
Original error: unexpected indent
| original | repair |
|------------------------------------------------------------------------------|-------------------------|
| ~class ConfigurationParameterTestImpl(ConfigurationParameterDocumentation):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self,~ | |
| ~ name: Name,~ | |
| ~ description: Description,~ | |
| ~ default_value: str):~ | |
| ~ super().__init__(name_and_ref_target(name,~ | |
| ~ 'ConfigurationParameterTestImpl single_line_description'))~ | |
| ~ self.description = description~ | |
| ~ self.default_value = default_value~ | |
| ~ def default_value_str(self) -> str:~ | |
| ~ return self.default_value~ | |
| ~ def purpose(self) -> DescriptionWithSubSections:~ | |
| ~ return from_simple_description(self.description)~ | |
| ~~ | |
Filtered out 118/157 invalid samples!
Drew 39 samples before timeout
Synthesized repair in: 85858ms
Tidyparse (proposed/total): 284/455
Tidyparse (accepted/proposed): 278/284
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|----------------------------------------------------------|
| def openFile(self): | def openFile(self): |
| '''Fonction permettant d'ouvrir le fichier''' | '''Fonction permettant d'ouvrir le fichier''' |
| desktopService = QDesktopServices() | desktopService = QDesktopServices() |
| desktopService.openUrl(QUrl(self.outFile.fileName()) | desktopService.openUrl(QUrl(self.outFile.fileName()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 7/7 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 36508ms
Tidyparse (proposed/total): 284/456
Tidyparse (accepted/proposed): 278/284
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~import BoostBuild~ | **NO_REPAIR_PROPOSAL!** |
| ~t = BoostBuild.Tester()~ | |
| ~t.write("jamroot.jam", """exe hello : hello.cpp ;""")~ | |
| ~t.write("hello.cpp", """int main() {}"""~ | |
| ~t.run_build_system()~ | |
| ~file_list = BoostBuild.List("bin/$toolset/debug/") * BoostBuild.List("hello.exe hello.obj")~ | |
| ~t.expect_addition(file_list)~ | |
| ~t.run_build_system("clean")~ | |
| ~t.expect_removal(file_list)~ | |
| ~t.cleanup()~ | |
| ~~ | |
Filtered out 48/52 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30423ms
Tidyparse (proposed/total): 285/457
Tidyparse (accepted/proposed): 279/285
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|------------------------------------------------------------------------|
| def _parse_networks(self, entries): | def _parse_networks(self, entries): |
| self.flat_networks = entries | self.flat_networks = entries |
| if '*' in self.flat_networks: | if '*' in self.flat_networks: |
| LOG.info(_LI("Arbitrary flat physical_network names allowed")) | LOG.info(_LI("Arbitrary flat physical_network names allowed")) |
| self.flat_networks = None | self.flat_networks = None |
| elif not self.flat_networks: | elif not self.flat_networks: |
| LOG.~info~(~_LI(~"Flat networks are disabled") | LOG.**info_LI**("Flat networks are disabled") |
| else: | else: |
| LOG.info(_LI("Allowable flat physical_network names: %s"), | LOG.info(_LI("Allowable flat physical_network names: %s"), |
| self.flat_networks) | self.flat_networks) |
| | |
Python parser ACCEPTED repair!
Filtered out 65/75 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 32357ms
Tidyparse (proposed/total): 286/458
Tidyparse (accepted/proposed): 280/286
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def _eval_number(cls, arg): | def _eval_number(cls, arg): |
| if arg.is_Number: | if arg.is_Number: |
| if arg.is_Rational: | if arg.is_Rational: |
| if not arg.q: | if not arg.q: |
| return arg | return arg |
| return C.Integer(arg.p // arg.q) | return C.Integer(arg.p // arg.q) |
| elif arg.is_Float: | elif arg.is_Float: |
| return C.Integer(~int(arg~.floor()) | return C.Integer(**intarg**.floor()) |
| if arg.is_NumberSymbol: | if arg.is_NumberSymbol: |
| return arg.approximation_interval(C.Integer)[0] | return arg.approximation_interval(C.Integer)[0] |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 36ms
Tidyparse (proposed/total): 286/459
Tidyparse (accepted/proposed): 280/286
Original error: expected an indented block
| original | repair |
|----------------------------------|-------------------------|
| ~def Nearest2(V, x):~ | **NO_REPAIR_PROPOSAL!** |
| ~ n = inf~ | |
| ~ result = 0~ | |
| ~ for i in range(0, len(V)):~ | |
| ~ n1 = LA.norm(V[i] - x)~ | |
| ~ if(n1 < n):~ | |
| ~ n = n1~ | |
| ~ result = i~ | |
| ~ return result~ | |
| ~~ | |
Filtered out 68/91 invalid samples!
Drew 23 samples before timeout
Synthesized repair in: 32205ms
Tidyparse (proposed/total): 287/460
Tidyparse (accepted/proposed): 281/287
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|---------------------------------------------------------------------|
| def generate_camo_config_file(camo_key): | def generate_camo_config_file(camo_key): |
| camo_config = """ENABLED=yes""" %(camo_key, ) | camo_config = """ENABLED=yes""" %(camo_key, ) |
| with open(CAMO_CONFIG_FILENAME, 'w') as camo_file: | with open(CAMO_CONFIG_FILENAME, 'w') as camo_file: |
| camo_file.write(camo_config) | camo_file.write(camo_config) |
| print("Generated Camo config file %s" %(CAMO_CONFIG_FILENAME, )~))~ | print("Generated Camo config file %s" %(CAMO_CONFIG_FILENAME, ) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 50/61 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 32922ms
Tidyparse (proposed/total): 288/461
Tidyparse (accepted/proposed): 282/288
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 324/336 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 68346ms
Tidyparse (proposed/total): 289/462
Tidyparse (accepted/proposed): 283/289
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------|--------------------------------------------------|
| import warnings as _warnings | import warnings as _warnings |
| _warnings.resetwarnings() | _warnings.resetwarnings() |
| _warnings.filterwarnings('error') | _warnings.filterwarnings('error') |
| from tdi import html | from tdi import html |
| template = html.from_string("""<node>""".lstrip~(~) | template = html.from_string("""<node>""".lstrip) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 289/463
Tidyparse (accepted/proposed): 283/289
Original error: expected an indented block
| original | repair |
|---------------------------|-------------------------|
| ~def reduce(s):~ | **NO_REPAIR_PROPOSAL!** |
| ~ zero = s.find("\0")~ | |
| ~ if zero >= 0:~ | |
| ~ return s[0: zero]~ | |
| ~ else:~ | |
| ~ return s~ | |
| ~~ | |
Filtered out 12/13 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 52371ms
Tidyparse (proposed/total): 290/464
Tidyparse (accepted/proposed): 284/290
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 39/45 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32741ms
Tidyparse (proposed/total): 291/465
Tidyparse (accepted/proposed): 285/291
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|-----------------------------------------------------------|
| def unit(self, units = 'K'): | def unit(self, units = 'K'): |
| u"""Set unit for temperature.""" | u"""Set unit for temperature.""" |
| if units == 'K': | if units == 'K': |
| return self.__factory(self.data) | return self.__factory(self.data) |
| elif units == 'C': | elif units == 'C': |
| return self.__factory(constants.C2K(self.data)) | return self.__factory(constants.C2K(self.data)) |
| elif units == 'F': | elif units == 'F': |
| return self.__factory(constants.~F2K(self~.data) | return self.__factory(constants.**F2Kself**.data) |
| else: | else: |
| raise ValueError("Wrong temperature input code") | raise ValueError("Wrong temperature input code") |
| | |
Python parser ACCEPTED repair!
Filtered out 26/48 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 31725ms
Tidyparse (proposed/total): 292/466
Tidyparse (accepted/proposed): 286/292
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| class TestQuoting: | class TestQuoting: |
| def testQuoting(self): | def testQuoting(self): |
| for line in([': foo', 'is\\', 'ja|', u't|�', u'baAz�'], [], ['', '']): | for line in([': foo', 'is\\', 'ja|', u't|�', u'baAz�'], [], ['', '']): |
| assert line == unpackLine(~packLine(line)~ | assert line == unpackLine(**packLineline** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 88/99 invalid samples!
Drew 11 samples before timeout
Synthesized repair in: 40087ms
Tidyparse (proposed/total): 293/467
Tidyparse (accepted/proposed): 287/293
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|----------------------------------------|
| def sortlistoflistvalues(listoflists): | def sortlistoflistvalues(listoflists): |
| new_list = [] | new_list = [] |
| for l in listoflists: | for l in listoflists: |
| new_list.append(sorted(l))~)~ | new_list.append(sorted(l)) |
| return new_list | return new_list |
| | |
Python parser ACCEPTED repair!
Filtered out 7/17 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 44368ms
Tidyparse (proposed/total): 294/468
Tidyparse (accepted/proposed): 288/294
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|--------------------------------------------------------------|
| import sys | import sys |
| file = open(sys.argv[1], 'r') | file = open(sys.argv[1], 'r') |
| program = oct(len(file.read()~)~ - 1)) | program = oct(len(file.read() - 1)) |
| for i in range(len(program)): | for i in range(len(program)): |
| program[i] = ['>', '<', '+', '-', '.', ',', '[', ']'][i] | program[i] = ['>', '<', '+', '-', '.', ',', '[', ']'][i] |
| | |
Python parser ACCEPTED repair!
Filtered out 19/26 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 32322ms
Tidyparse (proposed/total): 295/469
Tidyparse (accepted/proposed): 289/295
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def wrong_type(self, num, value, expected): | def wrong_type(self, num, value, expected): |
| if type(value) == types.InstanceType: | if type(value) == types.InstanceType: |
| got = "%s.%s instance" %( | got = "%s.%s instance" %( |
| value.__class__.__module__, value.__class__.__name__) | value.__class__.__module__, value.__class__.__name__) |
| else: | else: |
| got = type(value).__name__ | got = type(value).__name__ |
| raise Errors.PlexTypeError("Invalid type for argument %d of Plex.%s " | raise Errors.PlexTypeError("Invalid type for argument %d of Plex.%s " |
| ~"(expected~ %s, got %s" %( | **"expected** %s, got %s" %( |
| num, self.__class__.__name__, expected, got) | num, self.__class__.__name__, expected, got)**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 8/13 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 37028ms
Tidyparse (proposed/total): 296/470
Tidyparse (accepted/proposed): 290/296
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| class OracleExecutionContext_cx_oracle_with_unicode(OracleExecutionContext_cx_oracle): | class OracleExecutionContext_cx_oracle_with_unicode(OracleExecutionContext_cx_oracle): |
| """Support WITH_UNICODE in Python 2.xx.""" | """Support WITH_UNICODE in Python 2.xx.""" |
| def __init__(self, * arg, ** kw): | def __init__(self, * arg, ** kw): |
| OracleExecutionContext_cx_oracle.__init__(self, * arg, ** kw) | OracleExecutionContext_cx_oracle.__init__(self, * arg, ** kw) |
| self.statement = unicode(self.statement) | self.statement = unicode(self.statement) |
| def _execute_scalar(self, stmt): | def _execute_scalar(self, stmt): |
| return super(OracleExecutionContext_cx_oracle_with_unicode, self)._execute_scalar(unicode(stmt) | return super(OracleExecutionContext_cx_oracle_with_unicode, self)._execute_scalar(unicode(stmt) |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 45ms
Tidyparse (proposed/total): 296/471
Tidyparse (accepted/proposed): 290/296
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~class Question(models.Model):~ | **NO_REPAIR_PROPOSAL!** |
| ~ question_text = models.CharField(max_length = 200)~ | |
| ~ pub_date = models.DateTimeField('date published')~ | |
| ~ def __unicode__(self):~ | |
| ~ return self.question_text~ | |
| ~ def was_published_recently(self):~ | |
| ~ return timezone.now() >= self.pub_date >= timezone.now() - datetime.timedelta(days = 1)~ | |
| ~ was_published_recently.admin_order_field = 'pub_date'~ | |
| ~ was_published_recently.boolean = True~ | |
| ~ was_published_recently.short_description = 'Published recently?'~ | |
| ~~ | |
Filtered out 76/106 invalid samples!
Drew 30 samples before timeout
Synthesized repair in: 32447ms
Tidyparse (proposed/total): 297/472
Tidyparse (accepted/proposed): 291/297
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| def write_tsv(output_stream, * tup, ** kwargs): | def write_tsv(output_stream, * tup, ** kwargs): |
| """Write argument list in `tup` out as a tab-separeated row to the stream.""" | """Write argument list in `tup` out as a tab-separeated row to the stream.""" |
| encoding = kwargs.get('encoding') or 'utf-8' | encoding = kwargs.get('encoding') or 'utf-8' |
| value = '\t'.join([s for s in tup]) + '\n' | value = '\t'.join([s for s in tup]) + '\n' |
| output_stream.write(value.encode(encoding))~)~ | output_stream.write(value.encode(encoding)) |
| | |
Python parser ACCEPTED repair!
Filtered out 74/80 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 33664ms
Tidyparse (proposed/total): 298/473
Tidyparse (accepted/proposed): 292/298
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| def kill_jobs(job_ids): | def kill_jobs(job_ids): |
| host_script = make_temp_script("""#!/bin/sh""" % " ".join(~map(str~, job_ids)) | host_script = make_temp_script("""#!/bin/sh""" % " ".join(**mapstr**, job_ids)) |
| try: | try: |
| p = subprocess.Popen( | p = subprocess.Popen( |
| host_script, stdout = subprocess.PIPE, stderr = subprocess.PIPE) | host_script, stdout = subprocess.PIPE, stderr = subprocess.PIPE) |
| stdout, stderr = p.communicate(host_script) | stdout, stderr = p.communicate(host_script) |
| return stdout, stderr | return stdout, stderr |
| finally: | finally: |
| os.unlink(host_script) | os.unlink(host_script) |
| | |
Python parser ACCEPTED repair!
Filtered out 25/31 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32644ms
Tidyparse (proposed/total): 299/474
Tidyparse (accepted/proposed): 293/299
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------|-------------------------------------------------------|
| def read_file_into_string(filename): | def read_file_into_string(filename): |
| path = os.path.abspath(os.path.dirname(__file__))~)~ | path = os.path.abspath(os.path.dirname(__file__)) |
| filepath = os.path.join(path, filename) | filepath = os.path.join(path, filename) |
| try: | try: |
| return open(filepath).read() | return open(filepath).read() |
| except IOError: | except IOError: |
| return '' | return '' |
| | |
Python parser ACCEPTED repair!
Filtered out 0/1 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 30816ms
Tidyparse (proposed/total): 300/475
Tidyparse (accepted/proposed): 294/300
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| class Ui_Dialog(object): | class Ui_Dialog(object): |
| def setupUi(self, Dialog): | def setupUi(self, Dialog): |
| Dialog.setObjectName(_fromUtf8("Dialog")) | Dialog.setObjectName(_fromUtf8("Dialog")) |
| Dialog.resize(936, 610) | Dialog.resize(936, 610) |
| icon = QtGui.QIcon() | icon = QtGui.QIcon() |
| icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/lambda.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) | icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/lambda.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
| Dialog.setWindowIcon(icon) | Dialog.setWindowIcon(icon) |
| Dialog.setStyleSheet(_fromUtf8("QToolTip\n" | Dialog.setStyleSheet(_fromUtf8("QToolTip\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 34/46 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 32006ms
Tidyparse (proposed/total): 301/476
Tidyparse (accepted/proposed): 295/301
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| class link(rfc2396_full): | class link(rfc2396_full): |
| def validate(self): | def validate(self): |
| rfc2396_full.validate(self) | rfc2396_full.validate(self) |
| if hasattr(self.parent.parent, 'link') and self.parent.parent.link and self.parent.parent.link != self.value: | if hasattr(self.parent.parent, 'link') and self.parent.parent.link and self.parent.parent.link != self.value: |
| self.log(ImageLinkDoesntMatch({"parent": self.parent.name, "element": self.name}) | self.log(ImageLinkDoesntMatch({"parent": self.parent.name, "element": self.name}) |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 37ms
Tidyparse (proposed/total): 301/477
Tidyparse (accepted/proposed): 295/301
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------------|-------------------------|
| ~def draw_samples(nsubj, ngroups, split_method = 'default'):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Draw randomly ngroups sets of samples from [0..nsubj-1]"""~ | |
| ~ if split_method == 'default':~ | |
| ~ if nsubj > 10 * ngroups:~ | |
| ~ samples = split_group(nsubj, ngroups)~ | |
| ~ else:~ | |
| ~ samples = bootstrap_group(nsubj, ngroups)~ | |
| ~ elif split_method == 'bootstrap':~ | |
| ~ samples = bootstrap_group(nsubj, ngroups)~ | |
| ~ elif split_method == '':~ | |
| ~ samples = plit_group(nsubj, ngroups)~ | |
| ~ else: raise ValueError, 'unknown splitting method'~ | |
| ~ return samples~ | |
| ~~ | |
Filtered out 142/242 invalid samples!
Drew 100 samples before timeout
Synthesized repair in: 53703ms
Tidyparse (proposed/total): 302/478
Tidyparse (accepted/proposed): 296/302
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|-----------------------------------------------------------------------|
| def DumpExpandedConfigToString(self): | def DumpExpandedConfigToString(self): |
| """Dump the SiteConfig to Json with all configs full expanded.""" | """Dump the SiteConfig to Json with all configs full expanded.""" |
| return json.dumps(self, cls = self._JSONEncoder, | return json.dumps(self, cls = self._JSONEncoder, |
| sort_keys = True, indent = 4, separators = (', ', ': '))~)~ | sort_keys = True, indent = 4, separators = (', ', ': ')) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 26ms
Tidyparse (proposed/total): 302/479
Tidyparse (accepted/proposed): 296/302
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------|-------------------------|
| ~def is_finished(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.nprocs > 1 or self.length == "long"~ | |
| ~ file = os.environ["HOME"] + "/lock/" + self.random~ | |
| ~ try:~ | |
| ~ os.remove(file)~ | |
| ~ return True~ | |
| ~ except OSError:~ | |
| ~ return False~ | |
| ~ else:~ | |
| ~ return True~ | |
| ~~ | |
Filtered out 24/26 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30731ms
Tidyparse (proposed/total): 303/480
Tidyparse (accepted/proposed): 297/303
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------|-----------------------------------------------------------------------|
| def tick(self): | def tick(self): |
| if self.should_reload.is_set(): | if self.should_reload.is_set(): |
| self.should_reload.clear() | self.should_reload.clear() |
| ctx.log.info("Reloading script: %s" % self.name) | ctx.log.info("Reloading script: %s" % self.name) |
| self.ns = load_script(self.path, self.args) | self.ns = load_script(self.path, self.args) |
| self.start() | self.start() |
| self.~configure(self~.last_options, self.last_options.keys() | self.**configureself**.last_options, self.last_options.keys() |
| else: | else: |
| self.run("tick") | self.run("tick") |
| | |
Python parser ACCEPTED repair!
Filtered out 36/39 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 32075ms
Tidyparse (proposed/total): 304/481
Tidyparse (accepted/proposed): 298/304
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def test_movie_list_list(self, api_client): | def test_movie_list_list(self, api_client): |
| rsp = api_client.get('/movie_list/') | rsp = api_client.get('/movie_list/') |
| assert rsp.status_code == 200, 'Response code is %s' % rsp.status_code | assert rsp.status_code == 200, 'Response code is %s' % rsp.status_code |
| rsp = api_client.get('/movie_list/?name=name') | rsp = api_client.get('/movie_list/?name=name') |
| assert rsp.status_code == 200, 'Response code is %s' % rsp.status_code | assert rsp.status_code == 200, 'Response code is %s' % rsp.status_code |
| payload = {'name': 'name'} | payload = {'name': 'name'} |
| rsp = api_client.json_post('/movie_list/', data = json.~dumps(payload~) | rsp = api_client.json_post('/movie_list/', data = json.**dumpspayload**) |
| assert rsp.status_code == 201, 'Response code is %s' % rsp.status_code | assert rsp.status_code == 201, 'Response code is %s' % rsp.status_code |
| | |
Python parser ACCEPTED repair!
Filtered out 40/46 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 30180ms
Tidyparse (proposed/total): 305/482
Tidyparse (accepted/proposed): 299/305
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def test_get_size(): | def test_get_size(): |
| pp = [grpc_producer, h2frame_producer, h2header_producer, ProxyResponse] | pp = [grpc_producer, h2frame_producer, h2header_producer, ProxyResponse] |
| for each in dir(producers): | for each in dir(producers): |
| if not each.endswith('_producer'): | if not each.endswith('_producer'): |
| continue | continue |
| pp.append(~getattr(producers~, each) | pp.append(**getattrproducers**, each) |
| for p in pp: | for p in pp: |
| assert hasattr(p, 'get_size') | assert hasattr(p, 'get_size') |
| | |
Python parser ACCEPTED repair!
Filtered out 3/4 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 33184ms
Tidyparse (proposed/total): 306/483
Tidyparse (accepted/proposed): 300/306
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 40/42 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 31620ms
Tidyparse (proposed/total): 307/484
Tidyparse (accepted/proposed): 301/307
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| def add_stderr_logger(level = logging.DEBUG): | def add_stderr_logger(level = logging.DEBUG): |
| """Helper for quickly adding a StreamHandler to the logger.Useful for""" | """Helper for quickly adding a StreamHandler to the logger.Useful for""" |
| logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) |
| handler = logging.StreamHandler() | handler = logging.StreamHandler() |
| handler.~setFormatter(logging~.Formatter('%(asctime)s %(levelname)s %(message)s') | handler.**setFormatterlogging**.Formatter('%(asctime)s %(levelname)s %(message)s') |
| logger.addHandler(handler) | logger.addHandler(handler) |
| logger.setLevel(level) | logger.setLevel(level) |
| logger.debug('Added a stderr logging handler to logger: %s' % __name__) | logger.debug('Added a stderr logging handler to logger: %s' % __name__) |
| return handler | return handler |
| | |
Python parser ACCEPTED repair!
Filtered out 31/45 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 30316ms
Tidyparse (proposed/total): 308/485
Tidyparse (accepted/proposed): 302/308
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| def copyBSPDrivers(self): | def copyBSPDrivers(self): |
| """ delete all directories under POD dir, then copy""" | """ delete all directories under POD dir, then copy""" |
| bspdir = self.getBSPDirectory() | bspdir = self.getBSPDirectory() |
| if bspdir == None: | if bspdir == None: |
| raise Error("Set directory before", 0) | raise Error("Set directory before", 0) |
| sy.deleteAllDir(bspdir) | sy.deleteAllDir(bspdir) |
| for directory in sy.listDirectory(settings.projectpath + DRIVERSPATH + "/"): | for directory in sy.listDirectory(settings.projectpath + DRIVERSPATH + "/"): |
| sy.copyDirectory(settings.projectpath + DRIVERSPATH + "/" + directory, | sy.copyDirectory(settings.projectpath + DRIVERSPATH + "/" + directory, |
| self.getBSPDirectory() | self.getBSPDirectory()**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 12/27 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 35513ms
Tidyparse (proposed/total): 309/486
Tidyparse (accepted/proposed): 303/309
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------|-----------------------------------------|
| def showarray(a, fmt = 'jpeg'): | def showarray(a, fmt = 'jpeg'): |
| a = np.uint8(np.clip(a, 0, 255)) | a = np.uint8(np.clip(a, 0, 255)) |
| f = StringIO() | f = StringIO() |
| PIL.Image.fromarray(a).save(f, fmt) | PIL.Image.fromarray(a).save(f, fmt) |
| display(Image(data = f.getvalue()) | display(Image(data = f.getvalue()) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 84/108 invalid samples!
Drew 24 samples before timeout
Synthesized repair in: 169255ms
Tidyparse (proposed/total): 310/487
Tidyparse (accepted/proposed): 304/310
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|-------------------------------------------------------------|
| def write_copy_button(self, text, text_to_copy): | def write_copy_button(self, text, text_to_copy): |
| """Writes a button with 'text' which can be used""" | """Writes a button with 'text' which can be used""" |
| self.write_copy_script = True | self.write_copy_script = True |
| self.write('<button onclick="cp(\'{}\'); ">{}</button>' | self.write('<button onclick="cp(\'{}\'); ">{}</button>' |
| .~format(text_to_copy~, text) | .**formattext_to_copy**, text) |
| | |
Python parser ACCEPTED repair!
Filtered out 355/355 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 144921ms
Tidyparse (proposed/total): 310/488
Tidyparse (accepted/proposed): 304/310
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------------------|-------------------------|
| ~def _start_fps_display(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ self.fps_interval = 5~ | |
| ~ self.frame_cnt = 0~ | |
| ~ def display_fps():~ | |
| ~ if self.frame_cnt > 0:~ | |
| ~ fps = self.frame_cnt / self.fps_interval~ | |
| ~ self.frame_cnt = 0~ | |
| ~ logging.debug("Plot: %2.1f FPS" % fps)~ | |
| ~ return self.is_running()~ | |
| ~ gobject.timeout_add_seconds(self.fps_interval, display_fps)~ | |
| ~~ | |
Filtered out 193/232 invalid samples!
Drew 39 samples before timeout
Synthesized repair in: 91941ms
Tidyparse (proposed/total): 311/489
Tidyparse (accepted/proposed): 305/311
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------|----------------------------------------------------------|
| def mycowsay(connection, channel, nick, cmd, args): | def mycowsay(connection, channel, nick, cmd, args): |
| if not args or not args.strip(): | if not args or not args.strip(): |
| return | return |
| plugins.say(connection, channel, cowsay(args.strip~(~)) | plugins.say(connection, channel, cowsay(args.strip)) |
| | |
Python parser ACCEPTED repair!
Filtered out 62/91 invalid samples!
Drew 29 samples before timeout
Synthesized repair in: 32727ms
Tidyparse (proposed/total): 312/490
Tidyparse (accepted/proposed): 306/312
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| def add_window_properties_for_menu(widget, object_path, bus): | def add_window_properties_for_menu(widget, object_path, bus): |
| op = unicode(object_path) | op = unicode(object_path) |
| set_X_window_properties(widget.effectiveWinId(), _UNITY_OBJECT_PATH = op, _GTK_UNIQUE_BUS_NAME = unicode(bus.get_unique_name())~)~, _GTK_MENUBAR_OBJECT_PATH = op~)~ | set_X_window_properties(widget.effectiveWinId(), _UNITY_OBJECT_PATH = op, _GTK_UNIQUE_BUS_NAME = unicode(bus.get_unique_name()), _GTK_MENUBAR_OBJECT_PATH = op |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 29/29 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 33808ms
Tidyparse (proposed/total): 312/491
Tidyparse (accepted/proposed): 306/312
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|-------------------------|
| ~def mapper(record):~ | **NO_REPAIR_PROPOSAL!** |
| ~ key = record[0]~ | |
| ~ value = record[1]~ | |
| ~ words = value.split()~ | |
| ~ dwords = list(set(words)~ | |
| ~ for w in dwords:~ | |
| ~ mr.emit_intermediate(w, key)~ | |
| ~~ | |
Filtered out 19/44 invalid samples!
Drew 25 samples before timeout
Synthesized repair in: 31417ms
Tidyparse (proposed/total): 313/492
Tidyparse (accepted/proposed): 307/313
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|---------------------------------------------------------------|
| def serve_docs(self): | def serve_docs(self): |
| self.doc([]) | self.doc([]) |
| import webbrowser | import webbrowser |
| webbrowser.open("file: //" + path.abspath(path.join( | webbrowser.open("file: //" + path.abspath(path.join( |
| self.get_target_dir(), "doc", "servo", "index.html"))~))~ | self.get_target_dir(), "doc", "servo", "index.html")) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 5/5 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31756ms
Tidyparse (proposed/total): 313/493
Tidyparse (accepted/proposed): 307/313
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|-------------------------|
| ~class ReproChangedDeepDependency(ReproChangedDependency):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def test(self):~ | |
| ~ self.recreate_file1()~ | |
| ~ self.settings.parse_args('repro{}'.format(self.file_name_res)~ | |
| ~ CmdRepro(self.settings).run()~ | |
| ~ self.assertEqual(open(self.file_name_res).read().strip(), 'Goodbye\nBobby')~ | |
| ~~ | |
Filtered out 56/62 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 31676ms
Tidyparse (proposed/total): 314/494
Tidyparse (accepted/proposed): 308/314
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------|----------------------------------|
| def _set(self, kw): | def _set(self, kw): |
| options = [] | options = [] |
| for k, v in kw.items(): | for k, v in kw.items(): |
| options.append("-" + k) | options.append("-" + k) |
| options.append(~str(v~) | options.append(**strv**) |
| return tuple(options) | return tuple(options) |
| | |
Python parser ACCEPTED repair!
Filtered out 322/336 invalid samples!
Drew 14 samples before timeout
Synthesized repair in: 68352ms
Tidyparse (proposed/total): 315/495
Tidyparse (accepted/proposed): 309/315
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------|-------------------------------------|
| import timeit | import timeit |
| import time | import time |
| from datetime import datetime, date | from datetime import datetime, date |
| start_time = timeit.default_timer() | start_time = timeit.default_timer() |
| print(start_time) | print(start_time) |
| ~print(datetime~.now() | **printdatetime**.now() |
| | |
Python parser ACCEPTED repair!
Filtered out 59/59 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35981ms
Tidyparse (proposed/total): 315/496
Tidyparse (accepted/proposed): 309/315
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------------|-------------------------|
| ~def save_non_contigs_to_file(self, filename, min_length):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Saves all graph segments which are not short read contigs to a FASTA file."""~ | |
| ~ log.log('Saving ' + filename, 1)~ | |
| ~ with open(filename, 'w') as fasta:~ | |
| ~ for segment in sorted(self.segments.values(), reverse = True,~ | |
| ~ key = lambda x: x.get_length()):~ | |
| ~ if segment.contig or segment.get_length() < min_length:~ | |
| ~ continue~ | |
| ~ fasta.write(segment.fasta_record())~ | |
| ~~ | |
Filtered out 52/73 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 30191ms
Tidyparse (proposed/total): 316/497
Tidyparse (accepted/proposed): 310/316
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| def validation_process_ip(request, exposed_ip, template_name = 'app/environment/validation_ip.html'): | def validation_process_ip(request, exposed_ip, template_name = 'app/environment/validation_ip.html'): |
| if exposed_ip == EXPOSE: | if exposed_ip == EXPOSE: |
| return render_to_response(template_name, dict({"validation_ip": validate_ip(request)}.items()), | return render_to_response(template_name, dict({"validation_ip": validate_ip(request)}.items()), |
| context_instance = ~RequestContext(request)~ | context_instance = **RequestContextrequest** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 40/55 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 30596ms
Tidyparse (proposed/total): 317/498
Tidyparse (accepted/proposed): 311/317
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------|-------------------------------------------|
| def write_vocab(vocab, out_f): | def write_vocab(vocab, out_f): |
| with gzip.open(out_f, 'wb') as out: | with gzip.open(out_f, 'wb') as out: |
| for word in sorted(vocab): | for word in sorted(vocab): |
| out.write('{}\n'.format(word)~))~ | out.write('{}\n'.format(word) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 13/17 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30286ms
Tidyparse (proposed/total): 318/499
Tidyparse (accepted/proposed): 312/318
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| def serve_thread_tcp(host, port, handler): | def serve_thread_tcp(host, port, handler): |
| try: | try: |
| if OsInterfaceIsSupported(): | if OsInterfaceIsSupported(): |
| server = ThreadingTCPServer((settings.Config.Bind_To, port), handler) | server = ThreadingTCPServer((settings.Config.Bind_To, port), handler) |
| server.serve_forever() | server.serve_forever() |
| else: | else: |
| server = ThreadingTCPServer((host, port), handler) | server = ThreadingTCPServer((host, port), handler) |
| server.serve_forever() | server.serve_forever() |
| except: | except: |
| print(color("[!] ", 1, 1) + "Error starting TCP server on port " + str( | print(color("[!] ", 1, 1)**)** + "Error starting TCP server on port " + str( |
| port) + ", check permissions or other servers running." | port) + ", check permissions or other servers running." |
| | |
Python parser ACCEPTED repair!
Filtered out 5/6 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 39074ms
Tidyparse (proposed/total): 319/500
Tidyparse (accepted/proposed): 313/319
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def retranslateUi(self, FormFunctions): | def retranslateUi(self, FormFunctions): |
| FormFunctions.setWindowTitle(_translate("FormFunctions", "Form", None)) | FormFunctions.setWindowTitle(_translate("FormFunctions", "Form", None)) |
| self.labelScipyFunc.setText(_translate("FormFunctions", "Scipy\n" | self.labelScipyFunc.setText(_translate("FormFunctions", "Scipy\n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 73/75 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 32224ms
Tidyparse (proposed/total): 320/501
Tidyparse (accepted/proposed): 314/320
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| def yaml_field_to_file(fid, data, field, indent = '', force_string = False): | def yaml_field_to_file(fid, data, field, indent = '', force_string = False): |
| """ Handy function for writing pretty yaml """ | """ Handy function for writing pretty yaml """ |
| if data is None: | if data is None: |
| fid.write('%s%s: \n' ~%(indent~, field) | fid.write('%s%s: \n' **%indent**, field) |
| else: | else: |
| if force_string: | if force_string: |
| fid.write('%s%s: \"%s\"\n' %(indent, field, data)) | fid.write('%s%s: \"%s\"\n' %(indent, field, data)) |
| else: | else: |
| fid.write('%s%s: %s\n' %(indent, field, data)) | fid.write('%s%s: %s\n' %(indent, field, data)) |
| | |
Python parser ACCEPTED repair!
Filtered out 3/10 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 47199ms
Tidyparse (proposed/total): 321/502
Tidyparse (accepted/proposed): 315/321
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------|-------------------------------------------------|
| class Ball(): | class Ball(): |
| def __init__(self, screensize): | def __init__(self, screensize): |
| self.screensize = screensize | self.screensize = screensize |
| self.centerx = int(screensize[0] * 0.5) | self.centerx = int(screensize[0] * 0.5) |
| self.centery = int(screensize[1] * 0.5) | self.centery = int(screensize[1] * 0.5) |
| self.rect = pygame.Rect(screensize | self.rect = pygame.Rect(screensize |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 81/91 invalid samples!
Drew 10 samples before timeout
Synthesized repair in: 30609ms
Tidyparse (proposed/total): 322/503
Tidyparse (accepted/proposed): 316/322
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|----------------------------------------------------------------------------|
| def turn_on(self, ** kwargs): | def turn_on(self, ** kwargs): |
| """Turn the device on.""" | """Turn the device on.""" |
| newvalue = 255 | newvalue = 255 |
| if ATTR_BRIGHTNESS in kwargs: | if ATTR_BRIGHTNESS in kwargs: |
| newvalue = kwargs[ATTR_BRIGHTNESS] | newvalue = kwargs[ATTR_BRIGHTNESS] |
| if self._qsusb.set(self._id, round(~min(newvalue~, 255) / 2.55) >= 0: | if self._qsusb.set(self._id, round(**minnewvalue**, 255) / 2.55) >= 0: |
| self.update_value(newvalue) | self.update_value(newvalue) |
| | |
Python parser ACCEPTED repair!
Filtered out 19/19 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34754ms
Tidyparse (proposed/total): 322/504
Tidyparse (accepted/proposed): 316/322
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~def test_parse_spaces(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ definition = """(f o o, 1): """~ | |
| ~ msgs = sendlib.parse(definition)~ | |
| ~ self.assertNotEqual(None, msgs.get_message('f o o')~ | |
| ~ foo = msgs.get_message('f o o')~ | |
| ~ self.assertEqual('ba r', foo.fields[0].name)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 38ms
Tidyparse (proposed/total): 322/505
Tidyparse (accepted/proposed): 316/322
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------------|-------------------------|
| ~def print_headers(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ row_str = ''~ | |
| ~ for iindex, llength in enumerate(self.longest):~ | |
| ~ row_str += '{0} {1: <{2}}'.format('|', self.headers[iindex], (llength + 3))~ | |
| ~ row_str += '|'~ | |
| ~ return row_str~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 322/506
Tidyparse (accepted/proposed): 316/322
Original error: invalid syntax
| original | repair |
|--------------------------------------------------------------------|-------------------------|
| ~def dump(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Print rubbish about self."""~ | |
| ~ print('%15s: %s' %('name', self.name))~ | |
| ~ if self.comment: print '%15s: %s' %('comment', self.comment)~ | |
| ~ if self.sequence:~ | |
| ~ print('%15s: %s' %('sequence', self.sequence[: 25]), )~ | |
| ~ if len(self.sequence) > 25:~ | |
| ~ print "..."~ | |
| ~ else:~ | |
| ~ print ''~ | |
| ~~ | |
Filtered out 70/102 invalid samples!
Drew 32 samples before timeout
Synthesized repair in: 31516ms
Tidyparse (proposed/total): 323/507
Tidyparse (accepted/proposed): 317/323
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| def testDefault(self): | def testDefault(self): |
| """Tests the default option of properties.""" | """Tests the default option of properties.""" |
| for default in(1, object(), "test", None): | for default in(1, object(), "test", None): |
| prop = make_prop(default = default) | prop = make_prop(default = default) |
| self.assertEqual(default, prop.interpret(recipe_api.PROPERTY_SENTINEL)~))~ | self.assertEqual(default, prop.interpret(recipe_api.PROPERTY_SENTINEL) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 35/56 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 46142ms
Tidyparse (proposed/total): 324/508
Tidyparse (accepted/proposed): 318/324
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------|------------------------------------------------|
| from django.conf.urls import include, url | from django.conf.urls import include, url |
| from django.contrib import admin | from django.contrib import admin |
| urlpatterns = [ | urlpatterns = [ |
| url(r'^admin/', include(admin.site.urls))~)~, | url(r'^admin/', include(admin.site.urls)), |
| ] | ] |
| | |
Python parser ACCEPTED repair!
Filtered out 27/32 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 31978ms
Tidyparse (proposed/total): 325/509
Tidyparse (accepted/proposed): 319/325
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| def states_validate(value): | def states_validate(value): |
| assert isinstance(value, dict), 'states must be a dict' | assert isinstance(value, dict), 'states must be a dict' |
| for state in value: | for state in value: |
| if state == 'icon': | if state == 'icon': |
| continue | continue |
| assert isinstance(value[state], (bool, PYSON))~)~, 'values of states must be PYSON' | assert isinstance(value[state], (bool, PYSON)), 'values of states must be PYSON' |
| if hasattr(value[state], 'types'): | if hasattr(value[state], 'types'): |
| assert value[state].types() == set([bool]), 'values of states must return boolean' | assert value[state].types() == set([bool]), 'values of states must return boolean' |
| | |
Python parser ACCEPTED repair!
Filtered out 19/21 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 31017ms
Tidyparse (proposed/total): 326/510
Tidyparse (accepted/proposed): 320/326
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, SvnNewProjectOptionsDialog): | def retranslateUi(self, SvnNewProjectOptionsDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| SvnNewProjectOptionsDialog.setWindowTitle(_translate("SvnNewProjectOptionsDialog", "New Project from Repository")) | SvnNewProjectOptionsDialog.setWindowTitle(_translate("SvnNewProjectOptionsDialog", "New Project from Repository")) |
| SvnNewProjectOptionsDialog.setWhatsThis(_translate("SvnNewProjectOptionsDialog", "<b>New Project from Repository Dialog</b>\n" | SvnNewProjectOptionsDialog.setWhatsThis(_translate("SvnNewProjectOptionsDialog", "<b>New Project from Repository Dialog</b>\n" |
| | **))** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 27ms
Tidyparse (proposed/total): 326/511
Tidyparse (accepted/proposed): 320/326
Original error: invalid syntax
| original | repair |
|------------------------------------------------|-------------------------|
| ~class A:~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self, x: int, arr: [] int):~ | |
| ~ self.x = x~ | |
| ~ self.arr = arr~ | |
| ~ def get(self) -> int:~ | |
| ~ return self.arr[3] + self.x~ | |
| ~~ | |
Filtered out 72/98 invalid samples!
Drew 26 samples before timeout
Synthesized repair in: 31770ms
Tidyparse (proposed/total): 327/512
Tidyparse (accepted/proposed): 321/327
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| import numpy as np | import numpy as np |
| N = 100 | N = 100 |
| print(np.~power(np~.sum(np.arange(N + 1)), 2) - np.sum(np.power(np.arange(N + 1), 2)) | print(np.**powernp**.sum(np.arange(N + 1)), 2) - np.sum(np.power(np.arange(N + 1), 2)) |
| | |
Python parser ACCEPTED repair!
Filtered out 39/43 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30679ms
Tidyparse (proposed/total): 328/513
Tidyparse (accepted/proposed): 321/328
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| def connect_zodb(self): | def connect_zodb(self): |
| super(RoomBookingImporter, self).connect_zodb(~)~ | super(RoomBookingImporter, self).connect_zodb( |
| self.rb_root = UnbreakingDB(get_storage(self.rb_zodb_uri))).open().root() | self.rb_root = UnbreakingDB(get_storage(self.rb_zodb_uri))).open().root() |
| | |
Python parser REJECTED repair because: expression cannot contain assignment, perhaps you meant "=="? (<unknown>, line 3)
Filtered out 25/33 invalid samples!
Drew 8 samples before timeout
Synthesized repair in: 31324ms
Tidyparse (proposed/total): 329/514
Tidyparse (accepted/proposed): 322/329
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------|-----------------------------------------------------|
| def tMin(tree): | def tMin(tree): |
| if tree.children is None or tree.children ==[]~]~: | if tree.children is None or tree.children ==[]: |
| return tree.name[1] | return tree.name[1] |
| return min([tMax(t) for t in tree.children]) | return min([tMax(t) for t in tree.children]) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 329/515
Tidyparse (accepted/proposed): 322/329
Original error: invalid syntax
| original | repair |
|------------------------------------------------------------------------------|-------------------------|
| ~def getTemp(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for i in range(10):~ | |
| ~ temp = self.thermocouple.readTempC()~ | |
| ~ if temp:~ | |
| ~ if(temp > 100): print '\n%s\n' % temp~ | |
| ~ return temp~ | |
| ~ print("**Error reading thermocouple: \n %s" % self.thermocouple.error)~ | |
| ~ self.heatOff()~ | |
| ~ return None~ | |
| ~~ | |
Filtered out 44/83 invalid samples!
Drew 39 samples before timeout
Synthesized repair in: 32570ms
Tidyparse (proposed/total): 330/516
Tidyparse (accepted/proposed): 323/330
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------|----------------------------------------|
| def process(self, pyfile): | def process(self, pyfile): |
| self.download_html() | self.download_html() |
| if not self.file_exists(): | if not self.file_exists(): |
| self.offline() | self.offline() |
| pyfile.name = self.get_file_name() | pyfile.name = self.get_file_name() |
| self.download(self.get_file_url()~))~ | self.download(self.get_file_url() |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 46/49 invalid samples!
Drew 3 samples before timeout
Synthesized repair in: 30348ms
Tidyparse (proposed/total): 331/517
Tidyparse (accepted/proposed): 324/331
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| def popCount(self, * args): | def popCount(self, * args): |
| """Get the number of populated facts in the listed predicates.""" | """Get the number of populated facts in the listed predicates.""" |
| if not args: | if not args: |
| raise ValueError("Empty argument list of predicate names") | raise ValueError("Empty argument list of predicate names") |
| command_line = "bloxbatch -db %s -popCount %s " ~%(self~._workspace, ', '.join(args) | command_line = "bloxbatch -db %s -popCount %s " **%self**._workspace, ', '.join(args) |
| counters = collections.OrderedDict() | counters = collections.OrderedDict() |
| for(pred, num) in( | for(pred, num) in( |
| line.rsplit(': ', 1) for | line.rsplit(': ', 1) for |
| line in self._process_lines(command_line) | line in self._process_lines(command_line) |
| ): | ): |
| counters[pred] = int(num) | counters[pred] = int(num) |
| return counters | return counters |
| | |
Python parser ACCEPTED repair!
Filtered out 20/42 invalid samples!
Drew 22 samples before timeout
Synthesized repair in: 31097ms
Tidyparse (proposed/total): 332/518
Tidyparse (accepted/proposed): 325/332
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|------------------------------------------------------------------------|
| def test_hardware_discovery_without_flavor(self): | def test_hardware_discovery_without_flavor(self): |
| instance = self.MockInstance() | instance = self.MockInstance() |
| instance.flavor = {} | instance.flavor = {} |
| self.discovery.nova_cli.instance_get_all.return_value = [instance] | self.discovery.nova_cli.instance_get_all.return_value = [instance] |
| resources = self.discovery.discover(self.manager) | resources = self.discovery.discover(self.manager) |
| self.assertEqual(0, ~len(resources)~ | self.assertEqual(0, **lenresources** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 32/34 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 33587ms
Tidyparse (proposed/total): 333/519
Tidyparse (accepted/proposed): 326/333
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| '''usage: metadata.py <first.pdf> [<next.pdf> ...]''' | '''usage: metadata.py <first.pdf> [<next.pdf> ...]''' |
| import sys | import sys |
| import os | import os |
| import find_pdfrw | import find_pdfrw |
| from pdfrw import PdfReader, PdfWriter, IndirectPdfDict | from pdfrw import PdfReader, PdfWriter, IndirectPdfDict |
| inputs = sys.argv[1: ] | inputs = sys.argv[1: ] |
| assert inputs | assert inputs |
| outfn = 'output.pdf' | outfn = 'output.pdf' |
| writer = PdfWriter() | writer = PdfWriter() |
| for inpfn in inputs: | for inpfn in inputs: |
| writer.addpages(PdfReader(inpfn.pages) | writer.addpages(PdfReader(inpfn.pages)**)** |
| writer.trailer.Info = IndirectPdfDict( | writer.trailer.Info = IndirectPdfDict( |
| Title = 'your title goes here', | Title = 'your title goes here', |
| Author = 'your name goes here', | Author = 'your name goes here', |
| Subject = 'what is it all about?', | Subject = 'what is it all about?', |
| Creator = 'some script goes here', | Creator = 'some script goes here', |
| ) | ) |
| writer.write(outfn) | writer.write(outfn) |
| | |
Python parser ACCEPTED repair!
Filtered out 263/313 invalid samples!
Drew 50 samples before timeout
Synthesized repair in: 53569ms
Tidyparse (proposed/total): 334/520
Tidyparse (accepted/proposed): 327/334
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| import os | import os |
| import pytest | import pytest |
| from strongsup.predicate import Predicate | from strongsup.predicate import Predicate |
| from strongsup.value import check_denotation | from strongsup.value import check_denotation |
| from strongsup.tables.graph import TablesKnowledgeGraph | from strongsup.tables.graph import TablesKnowledgeGraph |
| from strongsup.tables.executor import TablesPostfixExecutor | from strongsup.tables.executor import TablesPostfixExecutor |
| from strongsup.tables.structure import Date, NeqInfiniteSet, RangeInfiniteSet, GenericDateInfiniteSet | from strongsup.tables.structure import Date, NeqInfiniteSet, RangeInfiniteSet, GenericDateInfiniteSet |
| from strongsup.tables.value import StringValue, NumberValue, DateValue | from strongsup.tables.value import StringValue, NumberValue, DateValue |
| DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__))), 'data'~)~ | DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__))), 'data' |
| | |
Python parser ACCEPTED repair!
Filtered out 70/70 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30808ms
Tidyparse (proposed/total): 334/521
Tidyparse (accepted/proposed): 327/334
Original error: expected an indented block
| original | repair |
|-------------------------------------------------------|-------------------------|
| ~def tick(self, deltaTime):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """tick should be called once each game loop"""~ | |
| ~ self.currentTime -= deltaTime~ | |
| ~ self.count += 1~ | |
| ~ if self.currentTime <= 0:~ | |
| ~ if self in Globals.TIMERS:~ | |
| ~ Globals.TIMERS.remove(self)~ | |
| ~ elif self in Globals.MoveTIMERS:~ | |
| ~ Globals.MoveTIMERS.remove(self)~ | |
| ~ if self.actionArgs !=[]:~ | |
| ~ self.actionFunction(self.actionArgs)~ | |
| ~ else:~ | |
| ~ self.actionFunction()~ | |
| ~~ | |
Filtered out 84/84 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31071ms
Tidyparse (proposed/total): 334/522
Tidyparse (accepted/proposed): 327/334
Original error: unexpected indent
| original | repair |
|------------------------------------------------------------|-------------------------|
| ~def toggleScreen(value):~ | **NO_REPAIR_PROPOSAL!** |
| ~ file = open(SCREEN, 'r')~ | |
| ~ current_status = int(file.read(1))~ | |
| ~ if current_status != value:~ | |
| ~ os.system("echo " + str(value) + " > " + SCREEN)~ | |
| ~~ | |
Filtered out 20/20 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34104ms
Tidyparse (proposed/total): 334/523
Tidyparse (accepted/proposed): 327/334
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~def postimport(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for rb in RelatedBill.objects.filter(~ | |
| ~ bill__legislative_session__jurisdiction_id = self.jurisdiction_id,~ | |
| ~ related_bill = None):~ | |
| ~ candidates = list(Bill.objects.filter(~ | |
| ~ legislative_session__identifier = rb.legislative_session,~ | |
| ~ legislative_session__jurisdiction_id = self.jurisdiction_id,~ | |
| ~ identifier = rb.identifier)~ | |
| ~ )~ | |
| ~ if len(candidates) == 1:~ | |
| ~ rb.related_bill = candidates[0]~ | |
| ~ rb.save()~ | |
| ~ elif len(candidates) > 1:~ | |
| ~ raise PupaInternalError('multiple related_bill candidates found for {}'.format(rb))~ | |
| ~~ | |
Filtered out 135/153 invalid samples!
Drew 18 samples before timeout
Synthesized repair in: 138507ms
Tidyparse (proposed/total): 335/524
Tidyparse (accepted/proposed): 328/335
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------|-----------------------------------------------------------|
| def ndnb_enumerate(names): | def ndnb_enumerate(names): |
| out = bytearray() | out = bytearray() |
| for name in names: | for name in names: |
| out += ndnb.dtag(ndnb.DTAG_LINK, name.get_ndnb())~)~ | out += ndnb.dtag(ndnb.DTAG_LINK, name.get_ndnb()) |
| return ndnb.~dtag(ndnb~.DTAG_COLLECTION, out~)~ | return ndnb.**dtagndnb**.DTAG_COLLECTION, out**(** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 30/30 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32729ms
Tidyparse (proposed/total): 335/525
Tidyparse (accepted/proposed): 328/335
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|-------------------------|
| ~class VirtualEarth extends Layer:~ | **NO_REPAIR_PROPOSAL!** |
| ~ def __init__(self, name):~ | |
| ~ super(_newInstance(name))~ | |
| ~ JavaScriptObject _newInstance(String name){~ | |
| ~ JS("""return new $wnd.OpenLayers.Layer.VirtualEarth(name);""")~ | |
| ~~ | |
Filtered out 35/39 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 78889ms
Tidyparse (proposed/total): 336/526
Tidyparse (accepted/proposed): 329/336
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------|---------------------------------------------------------|
| def extend(envs, variables, values): | def extend(envs, variables, values): |
| if len(variables) != len(values): | if len(variables) != len(values): |
| raise ValueError("Too few or too many values.") | raise ValueError("Too few or too many values.") |
| else: | else: |
| bindings = list(~zip(variables~, values) | bindings = list(**zipvariables**, values) |
| new_envs = [bindings] | new_envs = [bindings] |
| for env in envs: | for env in envs: |
| new_envs.append(env) | new_envs.append(env) |
| return new_envs | return new_envs |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 40ms
Tidyparse (proposed/total): 336/527
Tidyparse (accepted/proposed): 329/336
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------|-------------------------|
| ~def load_verses(inputfile = 'input/verses.csv'):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''Loads verses from CSV data file'''~ | |
| ~ verses = {}~ | |
| ~ with open(inputfile, 'r') as csvfile:~ | |
| ~ versereader = csv.reader(csvfile)~ | |
| ~ for row in versereader:~ | |
| ~ if len(row) < 3:~ | |
| ~ print row~ | |
| ~ (verse_id, input_string, real_scan) = row~ | |
| ~ if not 'x' in verse_id:~ | |
| ~ verses[verse_id] = input_string.strip()~ | |
| ~ return verses~ | |
| ~~ | |
Filtered out 29/58 invalid samples!
Drew 29 samples before timeout
Synthesized repair in: 32718ms
Tidyparse (proposed/total): 337/528
Tidyparse (accepted/proposed): 330/337
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|-----------------------------------------------------------|
| def test_object_factory_defaults_to_Bunch(self): | def test_object_factory_defaults_to_Bunch(self): |
| value = { | value = { |
| "command": b"echo 1", | "command": b"echo 1", |
| "verbosity": 2 | "verbosity": 2 |
| } | } |
| validator = V.make_validator_from_schema(self.schema) | validator = V.make_validator_from_schema(self.schema) |
| result = validator(value) | result = validator(value) |
| self.assert_(~isinstance(result~, V.Bunch~)~ | self.assert_(**isinstanceresult**, V.Bunch |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 134/134 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 86681ms
Tidyparse (proposed/total): 337/529
Tidyparse (accepted/proposed): 330/337
Original error: unexpected indent
| original | repair |
|------------------------------------------------------------|-------------------------|
| ~def draw_label_in_box(ctx, color, label, x, y, w, maxx):~ | **NO_REPAIR_PROPOSAL!** |
| ~ label_w = ctx.text_extents(label)[2]~ | |
| ~ label_x = x + w / 2 - label_w / 2~ | |
| ~ if label_w + 10 > w:~ | |
| ~ label_x = x + w + 5~ | |
| ~ if label_x + label_w > maxx:~ | |
| ~ label_x = x - label_w - 5~ | |
| ~ draw_text(ctx, label, color, label_x, y)~ | |
| ~~ | |
Filtered out 72/79 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 43293ms
Tidyparse (proposed/total): 338/530
Tidyparse (accepted/proposed): 331/338
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| def kill(self, task): | def kill(self, task): |
| """Kill a submitted task""" | """Kill a submitted task""" |
| if task.state in['hold', 'waiting']: | if task.state in['hold', 'waiting']: |
| task.state = 'killed' | task.state = 'killed' |
| elif task.state == 'launched': | elif task.state == 'launched': |
| subprocess.call(['qdel', task.submit_id]) | subprocess.call(['qdel', task.submit_id]) |
| task.state = 'killed' | task.state = 'killed' |
| task.end_time = time.strftime("%a, %d %b %Y %H: %M: %S", time.localtime())~)~ | task.end_time = time.strftime("%a, %d %b %Y %H: %M: %S", time.localtime()) |
| self.remove_logs(task) | self.remove_logs(task) |
| else: | else: |
| pass | pass |
| | |
Python parser ACCEPTED repair!
Filtered out 84/84 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31327ms
Tidyparse (proposed/total): 338/531
Tidyparse (accepted/proposed): 331/338
Original error: unexpected indent
| original | repair |
|---------------------------------------------------------------------------------|-------------------------|
| ~def string(self, expr):~ | **NO_REPAIR_PROPOSAL!** |
| ~ return self.context.evaluateString(expr)~ | |
| ~ def stripped(self, expr):~ | |
| ~ return re.sub(r'</?\w+[^>]*>', r'', context.evaluateString(expr))~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 43ms
Tidyparse (proposed/total): 338/532
Tidyparse (accepted/proposed): 331/338
Original error: expected an indented block
| original | repair |
|----------------------------------------------------------------------------------------------|-------------------------|
| ~def get(self, key, offset = 0):~ | **NO_REPAIR_PROPOSAL!** |
| ~ assert not self.db.uncommitted~ | |
| ~ key_from = self._key(key, offset)~ | |
| ~ for k, v in self.db.db.RangeIter(include_value = True,~ | |
| ~ key_from = key_from):~ | |
| ~ if k.startswith(self.namespace + key) and struct.unpack('>I', k[- 4: ]) >= offset:~ | |
| ~ yield v~ | |
| ~~ | |
Filtered out 2/2 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31550ms
Tidyparse (proposed/total): 338/533
Tidyparse (accepted/proposed): 331/338
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------|-------------------------|
| ~class MyException(Exception):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """This class inherits from class Exception."""~ | |
| ~ def __init__(self, extradata):~ | |
| ~ """The __init__ function runs when an object of this class is created."""~ | |
| ~ self.extra = extradata~ | |
| ~ self._secret = 'Not intended for use outside of this class'~ | |
| ~ def notifyUser(self):~ | |
| ~ print(str(self.args))~ | |
| ~ print(str(self.message)))~ | |
| ~ print(str(len(self.extra)) + ' data items: ' + str(self.extra))~ | |
| ~~ | |
Filtered out 17/17 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30160ms
Tidyparse (proposed/total): 338/534
Tidyparse (accepted/proposed): 331/338
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------|-------------------------|
| ~"""easel"""~ | **NO_REPAIR_PROPOSAL!** |
| ~from setuptools import setup, find_packages~ | |
| ~from easel import __version__~ | |
| ~setup(~ | |
| ~ name = "tudor-easel",~ | |
| ~ version = __version__,~ | |
| ~ license = "BSD",~ | |
| ~ description = __doc__,~ | |
| ~ packages = ["easel"],~ | |
| ~ namespace_packages = ["easel"],~ | |
| ~ include_package_data = True,~ | |
| ~ install_requires = ["PyGTK >= 2.12", "commons >= 0.0.1"]~ | |
| ~ entry_points = {~ | |
| ~ "console_scripts": ["easel = easel.application:main"]~ | |
| ~ }~ | |
| ~)~ | |
| ~~ | |
Filtered out 86/88 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 31899ms
Tidyparse (proposed/total): 339/535
Tidyparse (accepted/proposed): 332/339
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def __init__(self): | def __init__(self): |
| """ Publishers and Subscribers """ | """ Publishers and Subscribers """ |
| self.location = rospy.Publisher('location/location', | self.location = rospy.Publisher('location/location', |
| rospy.init_node('location') | rospy.init_node('location')**)** |
| rospy.Subscriber('/cam0/tags', TagPoseArray, self.__aprilCallback) | rospy.Subscriber('/cam0/tags', TagPoseArray, self.__aprilCallback) |
| rospy.Subscriber('/ardrone/navdata', Navdata, self.__navdataCallback) | rospy.Subscriber('/ardrone/navdata', Navdata, self.__navdataCallback) |
| self.location_x = 0.0 | self.location_x = 0.0 |
| self.location_y = 0.0 | self.location_y = 0.0 |
| self.location_z = 0.0 | self.location_z = 0.0 |
| self.location_w = 0.0 | self.location_w = 0.0 |
| self.velocity_x = 0.0 | self.velocity_x = 0.0 |
| self.velocity_y = 0.0 | self.velocity_y = 0.0 |
| self.delta_time = 0.0 | self.delta_time = 0.0 |
| self.pixel_ratio = 0.0 | self.pixel_ratio = 0.0 |
| self.tag_tally = 0 | self.tag_tally = 0 |
| self.stationary = 0 | self.stationary = 0 |
| | |
Python parser ACCEPTED repair!
Filtered out 176/176 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 177922ms
Tidyparse (proposed/total): 339/536
Tidyparse (accepted/proposed): 332/339
Original error: expected an indented block
| original | repair |
|---------------------------------------|-------------------------|
| ~def both_ends(s):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if len(s) < 2:~ | |
| ~ return ''~ | |
| ~ else:~ | |
| ~ return s[: 2] + s[len(s) - 2: ]~ | |
| ~~ | |
Filtered out 8/9 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 31153ms
Tidyparse (proposed/total): 340/537
Tidyparse (accepted/proposed): 333/340
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| def check_readiness_step(self): | def check_readiness_step(self): |
| """Fail early on RHEL 5.x and derivatives because of known bug in libc.""" | """Fail early on RHEL 5.x and derivatives because of known bug in libc.""" |
| super(EB_Clang, self).check_readiness_step() | super(EB_Clang, self).check_readiness_step() |
| if get_os_name() in['redhat', 'RHEL', 'centos', 'SL'] and get_os_version().startswith('5.'): | if get_os_name() in['redhat', 'RHEL', 'centos', 'SL'] and get_os_version().startswith('5.'): |
| raise EasyBuildError("Can not build Clang on %s v5.x: libc is buggy, building stage 2 will fail." | raise EasyBuildError("Can not build Clang on %s v5.x: libc is buggy, building stage 2 will fail." |
| "See http: //stackoverflow.com/questions/7276828/", get_os_name() | "See http: //stackoverflow.com/questions/7276828/", get_os_name()**)** |
| | |
Python parser ACCEPTED repair!
Filtered out 6/10 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 30941ms
Tidyparse (proposed/total): 341/538
Tidyparse (accepted/proposed): 334/341
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| class Ui_LoginDialog(object): | class Ui_LoginDialog(object): |
| def setupUi(self, LoginDialog): | def setupUi(self, LoginDialog): |
| LoginDialog.setObjectName("LoginDialog") | LoginDialog.setObjectName("LoginDialog") |
| LoginDialog.setWindowModality(QtCore.Qt.ApplicationModal) | LoginDialog.setWindowModality(QtCore.Qt.ApplicationModal) |
| LoginDialog.resize(374, 324) | LoginDialog.resize(374, 324) |
| LoginDialog.setStyleSheet("QWidget\n" | LoginDialog.setStyleSheet("QWidget\n" |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 4/6 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30615ms
Tidyparse (proposed/total): 342/539
Tidyparse (accepted/proposed): 335/342
Original error: unbalanced (){}[]
...
Python parser ACCEPTED repair!
Filtered out 188/200 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 69587ms
Tidyparse (proposed/total): 343/540
Tidyparse (accepted/proposed): 336/343
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------|------------------------------------------------------------|
| import sublime, sublime_plugin, re, sys, os | import sublime, sublime_plugin, re, sys, os |
| sys.path.append(os.path.~join(os~.path.dirname(__file__)) | sys.path.append(os.path.**joinos**.path.dirname(__file__)) |
| import my | import my |
| regions = {} | regions = {} |
| | |
Python parser ACCEPTED repair!
Filtered out 3/3 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 31172ms
Tidyparse (proposed/total): 343/541
Tidyparse (accepted/proposed): 336/343
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|-------------------------|
| ~class Ui_Progress(object):~ | **NO_REPAIR_PROPOSAL!** |
| ~ def setupUi(self, Progress):~ | |
| ~ Progress.setObjectName(_fromUtf8("Progress"))~ | |
| ~ Progress.resize(250, 110)~ | |
| ~ Progress.setMinimumSize(QtCore.QSize(250, 110))~ | |
| ~ Progress.setMaximumSize(QtCore.QSize(250, 110))~ | |
| ~ self.centralWidget = QtGui.QWidget(Progress)~ | |
| ~ self.centralWidget.setStyleSheet(_fromUtf8("/* sets background color */\n"~ | |
| ~~ | |
Filtered out 22/43 invalid samples!
Drew 21 samples before timeout
Synthesized repair in: 32585ms
Tidyparse (proposed/total): 344/542
Tidyparse (accepted/proposed): 337/344
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------|------------------------------------------------------------------|
| def test_body(self): | def test_body(self): |
| data = "BODY DATA" | data = "BODY DATA" |
| self.request(response = data) | self.request(response = data) |
| logger_message = self.logger_message.getvalue() | logger_message = self.logger_message.getvalue() |
| self.assertThat(logger_message, matchers.Contains('BODY: ')) | self.assertThat(logger_message, matchers.Contains('BODY: ')) |
| self.assertThat(logger_message, matchers.~Contains(data)~ | self.assertThat(logger_message, matchers.**Containsdata** |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 8/13 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 43416ms
Tidyparse (proposed/total): 345/543
Tidyparse (accepted/proposed): 338/345
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------|---------------------------------------------------------------------|
| def test_more_sheets_than_models(self): | def test_more_sheets_than_models(self): |
| self.content.update({"IgnoreMe": [~[~1, 2, 3]}) | self.content.update({"IgnoreMe": [1, 2, 3]}) |
| model = FakeDjangoModel() | model = FakeDjangoModel() |
| pe.save_book_as(dest_models = [model], bookdict = self.content) | pe.save_book_as(dest_models = [model], bookdict = self.content) |
| assert model.objects.objs == self.result1 | assert model.objects.objs == self.result1 |
| | |
Python parser ACCEPTED repair!
Filtered out 106/106 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30099ms
Tidyparse (proposed/total): 345/544
Tidyparse (accepted/proposed): 338/345
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------|-------------------------|
| ~def importCollectionMapping(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ q = QSqlQuery("""SELECT image, tag"""~ | |
| ~ while(q.next()):~ | |
| ~ d = extractCollectionData(q)~ | |
| ~ self.collectionMapping.append(d)~ | |
| ~~ | |
Filtered out 20/25 invalid samples!
Drew 5 samples before timeout
Synthesized repair in: 39509ms
Tidyparse (proposed/total): 346/545
Tidyparse (accepted/proposed): 339/346
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------|----------------------------------------------------------------------|
| def GetNodeByOrder(self, order): | def GetNodeByOrder(self, order): |
| if order > 0: | if order > 0: |
| nodeindexes = self.SlaveNodes.keys() | nodeindexes = self.SlaveNodes.keys() |
| nodeindexes.sort() | nodeindexes.sort() |
| if order <= len(nodeindexes): | if order <= len(nodeindexes): |
| return self.SlaveNodes[~nodeindexes[order~ - 1]["Node"] | return self.SlaveNodes[**nodeindexesorder** - 1]["Node"] |
| return None | return None |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 33ms
Tidyparse (proposed/total): 346/546
Tidyparse (accepted/proposed): 339/346
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def _execute_statements(self, cursor, statements, parameters, verbosity):~ | **NO_REPAIR_PROPOSAL!** |
| ~ for template in statements:~ | |
| ~ stmt = template % parameters~ | |
| ~ if verbosity >= 2:~ | |
| ~ print(stmt)~ | |
| ~ try:~ | |
| ~ cursor.execute(stmt)~ | |
| ~ except Exception, err:~ | |
| ~ sys.stderr.write("Failed (%s)\n" %(err))~ | |
| ~ raise~ | |
| ~~ | |
Filtered out 12/14 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 30390ms
Tidyparse (proposed/total): 347/547
Tidyparse (accepted/proposed): 340/347
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def getLastCommitRevision(): | def getLastCommitRevision(): |
| svn_revision_file = os.path.expanduser('~/AppData/Local/TortoiseSVN/logfile.txt') | svn_revision_file = os.path.expanduser('~/AppData/Local/TortoiseSVN/logfile.txt') |
| revision_num_generated = False | revision_num_generated = False |
| revision_list = [] | revision_list = [] |
| for line in open(svn_revision_file): | for line in open(svn_revision_file): |
| if revision_num_generated: | if revision_num_generated: |
| if 'At revision' in line: | if 'At revision' in line: |
| revision_num = line.split(': ')[- 1] | revision_num = line.split(': ')[- 1] |
| revision_list.append(revision_num.strip() | revision_list.append(revision_num.strip()**)** |
| revision_num_generated = False | revision_num_generated = False |
| if 'Committing transaction' in line: | if 'Committing transaction' in line: |
| revision_num_generated = True | revision_num_generated = True |
| return revision_list[- 1] | return revision_list[- 1] |
| | |
Python parser ACCEPTED repair!
Filtered out 37/53 invalid samples!
Drew 16 samples before timeout
Synthesized repair in: 31065ms
Tidyparse (proposed/total): 348/548
Tidyparse (accepted/proposed): 341/348
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| def authorize_url(self, scope = '', ** kwargs): | def authorize_url(self, scope = '', ** kwargs): |
| """Returns the url to redirect the user to for user consent""" | """Returns the url to redirect the user to for user consent""" |
| oauth_params = { | oauth_params = { |
| 'redirect_uri': self.redirect_uri, | 'redirect_uri': self.redirect_uri, |
| 'client_id': self.client_id | 'client_id': self.client_id |
| } | } |
| oauth_params.update(kwargs) | oauth_params.update(kwargs) |
| return "%s%s?%s" %(self.site, ~quote(self~.authorization_url), urlencode(oauth_params) | return "%s%s?%s" %(self.site, **quoteself**.authorization_url), urlencode(oauth_params) |
| | |
Python parser ACCEPTED repair!
Filtered out 145/149 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 32677ms
Tidyparse (proposed/total): 349/549
Tidyparse (accepted/proposed): 342/349
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------|-------------------------------------------------------------|
| def local(): | def local(): |
| """Run all local tests""" | """Run all local tests""" |
| suite = ServiceTestSuite() | suite = ServiceTestSuite() |
| suite.addTest(unittest.~makeSuite(Test~, 'test_local') | suite.addTest(unittest.**makeSuiteTest**, 'test_local') |
| return suite | return suite |
| | |
Python parser ACCEPTED repair!
Filtered out 15/19 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 18ms
Tidyparse (proposed/total): 350/550
Tidyparse (accepted/proposed): 342/350
Original error: unexpected indent
| original | repair |
|-------------------------------------------|-------------------------|
| ~def normalize(self, input_angle):~ | **NO_REPAIR_PROPOSAL!** |
| ~ new_angle = int(input_angle)~ | |
| ~ if(new_angle > 360):~ | |
| ~ new_angle = new_angle - 360~ | |
| ~ if new_angle < 0:~ | |
| ~ new_angle += 360;~ | |
| ~ return new_angle~ | |
| ~~ | |
Drew 4 samples before timeout
Synthesized repair in: 37058ms
Tidyparse (proposed/total): 350/551
Tidyparse (accepted/proposed): 343/350
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| def retranslateUi(self, VariablesFilterDialog): | def retranslateUi(self, VariablesFilterDialog): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| VariablesFilterDialog.setWindowTitle(_translate("VariablesFilterDialog", "Variables Type Filter")) | VariablesFilterDialog.setWindowTitle(_translate("VariablesFilterDialog", "Variables Type Filter")) |
| VariablesFilterDialog.~setWhatsThis~(~_translate(~"VariablesFilterDialog", "<b>Filter Dialog</b>\n" | VariablesFilterDialog.**setWhatsThis_translate**("VariablesFilterDialog", "<b>Filter Dialog</b>\n" |
| | **)** |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 19ms
Tidyparse (proposed/total): 350/552
Tidyparse (accepted/proposed): 343/350
Original error: invalid syntax
| original | repair |
|----------------------------------------------------------------|-------------------------|
| ~def int2bin(n):~ | **NO_REPAIR_PROPOSAL!** |
| ~ '''convert denary integer n to binary string b.'''~ | |
| ~ b = ''~ | |
| ~ if n < 0: raise ValueError, 'must be a positive integer'~ | |
| ~ if n == 0: return '0b0'~ | |
| ~ while n > 0:~ | |
| ~ b = '%s%s' %(str(n % 2), b)~ | |
| ~ n = n >> 1~ | |
| ~ return '0b%s' % b~ | |
| ~~ | |
Filtered out 0/2 invalid samples!
Drew 2 samples before timeout
Synthesized repair in: 32335ms
Tidyparse (proposed/total): 351/553
Tidyparse (accepted/proposed): 344/351
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------|-------------------------------------------------------------------------|
| def test_remove_below_percentile(self): | def test_remove_below_percentile(self): |
| seriesList = self._generate_series_list() | seriesList = self._generate_series_list() |
| percent = 50 | percent = 50 |
| results = functions.removeBelowPercentile({}, seriesList, percent) | results = functions.removeBelowPercentile({}, seriesList, percent) |
| expected = [[], [], [1]]] | expected = [[**[**], [], [1]]] |
| for i, result in enumerate(results): | for i, result in enumerate(results): |
| self.assertListEqual(return_less(result, percent), expected[i]) | self.assertListEqual(return_less(result, percent), expected[i]) |
| | |
Python parser ACCEPTED repair!
Filtered out 32/32 invalid samples!
Filtered out 18/33 invalid samples!
Drew 15 samples before timeout
Synthesized repair in: 34056ms
Tidyparse (proposed/total): 352/554
Tidyparse (accepted/proposed): 345/352
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------|---------------------------------------------------------------|
| def get(self, tenant_id): | def get(self, tenant_id): |
| response = self.clients.designate().quotas.get(tenant_id) | response = self.clients.designate().quotas.get(tenant_id) |
| return dict(~[~(k, response.get(k)) | return dict((k, response.get(k)) |
| for k in self.QUOTAS_SCHEMA["properties"]) | for k in self.QUOTAS_SCHEMA["properties"]) |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 32653ms
Tidyparse (proposed/total): 352/555
Tidyparse (accepted/proposed): 345/352
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------------|-------------------------|
| ~def test_wrong_shape(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ wrong_shape = (~ | |
| ~ """ #######"""~ | |
| ~ assert Layout.layout_shape(Layout.strip_layout(small_shape)) ==(3, 3)~ | |
| ~ large_shape = (~ | |
| ~ """ #######"""~ | |
| ~ l = Layout(unordered,~ | |
| ~ TestLayoutChecks.layout_chars, 4)~ | |
| ~~ | |
Filtered out 21/21 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34192ms
Tidyparse (proposed/total): 352/556
Tidyparse (accepted/proposed): 345/352
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------|
| ~class Posts(api.Interface):~ | **NO_REPAIR_PROPOSAL!** |
| ~ entity = model.Post~ | |
| ~ method_authorization = {~ | |
| ~ (LIST, GET): None,~ | |
| ~ (CREATE, UPDATE, DELETE), admin_or_user)~ | |
| ~ }~ | |
| ~ enabled_filters = ('title', 'slug', 'content')~ | |
| ~ enabled_sort = ('published', 'created', 'modified', 'slug')~ | |
| ~ default_sort = ('-published', '-modified')~ | |
| ~~ | |
Filtered out 18/18 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 41148ms
Tidyparse (proposed/total): 352/557
Tidyparse (accepted/proposed): 345/352
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|-------------------------|
| ~def retranslateUi(self, Dialog):~ | **NO_REPAIR_PROPOSAL!** |
| ~ _translate = QtCore.QCoreApplication.translate~ | |
| ~ Dialog.setWindowTitle(_translate("Dialog", "Dialog"))~ | |
| ~ self.label_2.setText(_translate("Dialog", "Instrukcja użycia:"))~ | |
| ~ self.label.setText(_translate("Dialog", "1) Załaduj pliki\n"~ | |
| ~~ | |
Filtered out 39/102 invalid samples!
Drew 63 samples before timeout
Synthesized repair in: 32598ms
Tidyparse (proposed/total): 353/558
Tidyparse (accepted/proposed): 346/353
Original error: unbalanced (){}[]
| original | repair |
|-----------------------------------------------------------------------|-----------------------------------------------------------------------|
| def summarize(x): | def summarize(x): |
| from Goulib.itertools2 import compress, flatten, swap | from Goulib.itertools2 import compress, flatten, swap |
| from Goulib.math2 import digits, num_from_digits | from Goulib.math2 import digits, num_from_digits |
| return num_from_digits(flatten(swap(compress(sorted(digits(x))))) | return num_from_digits(flatten(swap(compress(sorted(digits(x))))) |
| | **)** |
Python parser ACCEPTED repair!
Filtered out 100/104 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 37502ms
Tidyparse (proposed/total): 354/559
Tidyparse (accepted/proposed): 347/354
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------|-----------------------------------------|
| def variables(self): | def variables(self): |
| res = self.input_layer.variables() | res = self.input_layer.variables() |
| for layer in self.layers: | for layer in self.layers: |
| res.~extend(layer~.variables() | res.**extendlayer**.variables() |
| return res | return res |
| | |
Python parser ACCEPTED repair!
Drew 0 samples before timeout
Synthesized repair in: 28ms
Tidyparse (proposed/total): 354/560
Tidyparse (accepted/proposed): 347/354
Original error: invalid syntax
| original | repair |
|---------------------------------------------------------------|-------------------------|
| ~def _file_exists_and_is_newer_than(self, potential, other):~ | **NO_REPAIR_PROPOSAL!** |
| ~ try:~ | |
| ~ other_stbuf = os.stat(other)~ | |
| ~ potential_stbuf = os.stat(potential)~ | |
| ~ except OSError, e:~ | |
| ~ return False~ | |
| ~ return potential_stbuf.st_mtime > other_stbuf.st_mtime~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 21ms
Tidyparse (proposed/total): 354/561
Tidyparse (accepted/proposed): 347/354
Original error: invalid syntax
| original | repair |
|-----------------------------------------------------|-------------------------|
| ~def moveright(self, W):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if self.x < 39:~ | |
| ~ if self.checkWall(self.x + 1, self.y, W):~ | |
| ~ self.x = self.x~ | |
| ~ else:~ | |
| ~ self.x = (self.x) + 1~ | |
| ~ return self~ | |
| ~~ | |
Filtered out 19/19 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 34604ms
Tidyparse (proposed/total): 354/562
Tidyparse (accepted/proposed): 347/354
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------------------------|-------------------------|
| ~def test_parsePlaylistFeed(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ self._mockFeedCall('playlists', 'playlists')~ | |
| ~ plEntries = list(yt.iPlaylistEntries(self.account.username)~ | |
| ~ self.assertEqual(len(plEntries), 13)~ | |
| ~ pls = map(yt.entry2group, plEntries)~ | |
| ~ extId, name = pls[0]~ | |
| ~ self.assertEqual(name, "Ads")~ | |
| ~ self.assertEqual(extId,~ | |
| ~ 'http: //gdata.youtube.com/feeds/playlists/FFF43205215330C')~ | |
| ~ self.cliMock.verify()~ | |
| ~~ | |
Filtered out 68/68 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30418ms
Tidyparse (proposed/total): 354/563
Tidyparse (accepted/proposed): 347/354
Original error: expected an indented block
| original | repair |
|-----------------------------------------------------------------------------------------------|-------------------------|
| ~def _probabilistic_init(self, probability):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Initialises the network with a link probability"""~ | |
| ~ for u in xrange(self.parameters.nodes_end_middle):~ | |
| ~ for v in xrange(self.parameters.nodes_in,~ | |
| ~ self.parameters.nodes_total):~ | |
| ~ if self.parameters.conserves_structure(u, v) and random.random() < probability:~ | |
| ~ self.add_edge(u, v)~ | |
| ~~ | |
Filtered out 33/33 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 35062ms
Tidyparse (proposed/total): 354/564
Tidyparse (accepted/proposed): 347/354
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------|-------------------------|
| ~from django.shortcuts import get_object_or_404, render~ | **NO_REPAIR_PROPOSAL!** |
| ~from django.http import HttpResponseRedirect, HttpResponse~ | |
| ~from django.core.urlresolvers import reverse~ | |
| ~from.models import Image~ | |
| ~def album(request, image_id)~ | |
| ~ pic = get_object_or_404(Image, pk = image_id)~ | |
| ~ try:~ | |
| ~ selected_choice = pic.choice_set.get(pk = request.POST['Album']~ | |
| ~ except(KeyError, Image.DoesNotExist):~ | |
| ~ return render(request, 'home_page.html', {~ | |
| ~ 'error message': "No pictures available in this album.",~ | |
| ~ })~ | |
| ~ else:~ | |
| ~ img = Image.open(~ | |
| ~ img.show()~ | |
| ~~ | |
Filtered out 57/63 invalid samples!
Drew 6 samples before timeout
Synthesized repair in: 32808ms
Tidyparse (proposed/total): 355/565
Tidyparse (accepted/proposed): 348/355
Original error: unbalanced (){}[]
| original | repair |
|------------------------------------------------------|------------------------------------------------------|
| VERSION = (0, 0, 1, 'alpha') | VERSION = (0, 0, 1, 'alpha') |
| if VERSION[- 1] != "final": | if VERSION[- 1] != "final": |
| __version__ = '.'.~join~(~map(~str, VERSION) | __version__ = '.'.**joinmap**(str, VERSION) |
| else: | else: |
| __version__ = '.'.join(map(str, VERSION[: - 1])) | __version__ = '.'.join(map(str, VERSION[: - 1])) |
| | |
Python parser ACCEPTED repair!
Filtered out 41/48 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 44451ms
Tidyparse (proposed/total): 356/566
Tidyparse (accepted/proposed): 349/356
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------|---------------------------------------------------------------------------|
| def get_reqs(* fns): | def get_reqs(* fns): |
| lst = [] | lst = [] |
| for fn in fns: | for fn in fns: |
| for package in open(os.path.~join(CURRENT_DIR~, fn).readlines(): | for package in open(os.path.**joinCURRENT_DIR**, fn).readlines(): |
| package = package.strip() | package = package.strip() |
| if not package: | if not package: |
| continue | continue |
| lst.append(package.strip()) | lst.append(package.strip()) |
| return lst | return lst |
| | |
Python parser ACCEPTED repair!
Filtered out 1/1 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 32070ms
Tidyparse (proposed/total): 356/567
Tidyparse (accepted/proposed): 349/356
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------|-------------------------|
| ~def test_ParseEPCTagUri(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ print("***==== Test Decode EPC Tag Uri Value ====***"~ | |
| ~ tagUri = "urn:tagpy:tag:gid-96:%s.%s.%s" %(self._generalManager, self._objectClass, self._serialNumber)~ | |
| ~ factory = EPCFactory()~ | |
| ~ gid96 = factory.parse(tagUri)~ | |
| ~ self._checkFields(gid96)~ | |
| ~ print(tagUri)~ | |
| ~ print(gid96.toHex())~ | |
| ~ print(gid96.toBinary())~ | |
| ~ print("***==== END Test Decode EPC Tag Uri Value ====***"~ | |
| ~ print(""~ | |
| ~~ | |
Filtered out 54/61 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 36771ms
Tidyparse (proposed/total): 357/568
Tidyparse (accepted/proposed): 350/357
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| def expand_filename_pattern(pattern, base_dir): | def expand_filename_pattern(pattern, base_dir): |
| """Expand a file name pattern containing wildcards, environment variables etc.""" | """Expand a file name pattern containing wildcards, environment variables etc.""" |
| pattern = os.path.normpath(os.path.join(base_dir, pattern)) | pattern = os.path.normpath(os.path.join(base_dir, pattern)) |
| pattern = os.path.expandvars(os.path.expanduser(pattern))~)~ | pattern = os.path.expandvars(os.path.expanduser(pattern)) |
| fileList = glob.glob(pattern) | fileList = glob.glob(pattern) |
| return fileList | return fileList |
| | |
Python parser ACCEPTED repair!
Filtered out 12/13 invalid samples!
Drew 1 samples before timeout
Synthesized repair in: 52209ms
Tidyparse (proposed/total): 358/569
Tidyparse (accepted/proposed): 351/358
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------|---------------------------------------------------------------------|
| def retranslateUi(self, MainWindow): | def retranslateUi(self, MainWindow): |
| _translate = QtCore.QCoreApplication.translate | _translate = QtCore.QCoreApplication.translate |
| MainWindow.setWindowTitle(_translate("MainWindow", "Aquarium")) | MainWindow.setWindowTitle(_translate("MainWindow", "Aquarium")) |
| self.text.setText(_translate("MainWindow", "Score:")) | self.text.setText(_translate("MainWindow", "Score:")) |
| self.buy_fish.setText(_translate("MainWindow", "Fish \n" | self.buy_fish.setText(_translate("MainWindow", "Fish \n" |
| | **))** |
Python parser ACCEPTED repair!
Filtered out 18/25 invalid samples!
Drew 7 samples before timeout
Synthesized repair in: 30776ms
Tidyparse (proposed/total): 359/570
Tidyparse (accepted/proposed): 351/359
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| def _parser_add_arguments(self): | def _parser_add_arguments(self): |
| """overwritten method of class Memacs""" | """overwritten method of class Memacs""" |
| Memacs._parser_add_arguments(self) | Memacs._parser_add_arguments(self) |
| self._parser.add_argument( | self._parser.add_argument( |
| "-f", "--file", dest = "csvfile", | "-f", "--file", dest = "csvfile", |
| action = "store", | action = "store", |
| help = "input csv file") | help = "input csv file") |
| self._parser.add_argument( | self._parser.add_argument( |
| "-d", "--delimiter", dest = "delimiter", | "-d", "--delimiter", dest = "delimiter", |
| action = "store", | action = "store", |
| help = "delimiter, default \";\"") | help = "delimiter, default \";\"") |
| self._parser.add_argument( | self._parser.add_argument( |
| "-e", "--encoding", dest = "encoding", | "-e", "--encoding", dest = "encoding", |
| action = "store", | action = "store", |
| help = "default encoding utf-8, see " + "http://docs.python.org/library/codecs.html#standard-encodings" + "for possible encodings") | help = "default encoding utf-8, see " + "http://docs.python.org/library/codecs.html#standard-encodings" + "for possible encodings") |
| self._parser.add_argument( | self._parser.add_argument( |
| "-ti", "--timestamp-index", dest = "timestamp_index", | "-ti", "--timestamp-index", dest = "timestamp_index", |
| action = "store", | action = "store", |
| help = "on which column is timestamp?") | help = "on which column is timestamp?") |
| self._parser.add_argument( | self._parser.add_argument( |
| "-tf", "--timestamp-format", dest = "timestamp_format", | "-tf", "--timestamp-format", dest = "timestamp_format", |
| action = "store", | action = "store", |
| self._parser.add_argument( | self._parser.add_argument( |
| "-oi", "--output-indices", dest = "output_indices", | "-oi", "--output-indices", dest = "output_indices", |
| action = "store", | action = "store", |
| help = "indices to use for output i.e. \"1 2 3\"") | help = "indices to use for output i.e. \"1 2 3\"")**)** |
| | |
Python parser REJECTED repair because: positional argument follows keyword argument (<unknown>, line 23)
Filtered out 26/38 invalid samples!
Drew 12 samples before timeout
Synthesized repair in: 34412ms
Tidyparse (proposed/total): 360/571
Tidyparse (accepted/proposed): 352/360
Original error: unbalanced (){}[]
| original | repair |
|---------------------------------------------------------------------|---------------------------------------------------------------------|
| class TransmitThread(threading.Thread): | class TransmitThread(threading.Thread): |
| def get_message(self): | def get_message(self): |
| return """have you ever went over a friends house to eat""" | return """have you ever went over a friends house to eat""" |
| def run(self): | def run(self): |
| morsecodelib.sound.config.config.WORDS_PER_MINUTE = 20 | morsecodelib.sound.config.config.WORDS_PER_MINUTE = 20 |
| laser = laserControl.LaserController() | laser = laserControl.LaserController() |
| with laser: | with laser: |
| morse = laserControl.MorseRenderLaser(laser) | morse = laserControl.MorseRenderLaser(laser) |
| morse.~text_to_sound(self~.get_message() | morse.**text_to_soundself**.get_message() |
| | |
Python parser ACCEPTED repair!
Filtered out 138/213 invalid samples!
Drew 75 samples before timeout
Synthesized repair in: 95842ms
Tidyparse (proposed/total): 361/572
Tidyparse (accepted/proposed): 353/361
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------|-------------------------------------------------------------------|
| def _write_processor_info(self, processor_info_file, processors): | def _write_processor_info(self, processor_info_file, processors): |
| with safe_open(processor_info_file, 'w') as f: | with safe_open(processor_info_file, 'w') as f: |
| for processor in processors: | for processor in processors: |
| f.write('%s\n' % processor.strip())~)~ | f.write('%s\n' % processor.strip()) |
| | |
Python parser ACCEPTED repair!
Filtered out 224/224 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 61759ms
Tidyparse (proposed/total): 361/573
Tidyparse (accepted/proposed): 353/361
Original error: expected an indented block
| original | repair |
|------------------------------------------------------------------|-------------------------|
| ~def convlon(coord):~ | **NO_REPAIR_PROPOSAL!** |
| ~ """Convert longitude from decimal degrees to ddd mm.mmm"""~ | |
| ~ if coord < 0:~ | |
| ~ return 'W' + convcoord(- coord)~ | |
| ~ else:~ | |
| ~ return 'E' + convcoord(coord)~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 361/574
Tidyparse (accepted/proposed): 353/361
Original error: unexpected indent
| original | repair |
|---------------------------------------|-------------------------|
| ~def calcrc16(self, data_list):~ | **NO_REPAIR_PROPOSAL!** |
| ~ length = len(data_list)~ | |
| ~ CRC_CCITT = 0x1021~ | |
| ~ crc = 0;~ | |
| ~ while length > 0:~ | |
| ~ for data in data_list:~ | |
| ~ length -= 1~ | |
| ~ i = 0x80~ | |
| ~ while i >= 1:~ | |
| ~ crc *= 2;~ | |
| ~ if(crc & 0x10000) != 0:~ | |
| ~ crc ^= 0x11021~ | |
| ~ crc = crc & 0xffffffff~ | |
| ~ if data & i != 0:~ | |
| ~ crc ^= CRC_CCITT~ | |
| ~ i /= 2~ | |
| ~ return crc~ | |
| ~~ | |
Drew 0 samples before timeout
Synthesized repair in: 29ms
Tidyparse (proposed/total): 361/575
Tidyparse (accepted/proposed): 353/361
Original error: invalid syntax
| original | repair |
|-------------------------------------------------------|-------------------------|
| ~def filesNewerThan(files, dt):~ | **NO_REPAIR_PROPOSAL!** |
| ~ if dt:~ | |
| ~ return filter(lambda(x, y): y >= dt, files)~ | |
| ~ else:~ | |
| ~ return files~ | |
| ~~ | |
Filtered out 161/177 invalid samples!
Drew 16 samples before timeout
Synthesized repair in: 157740ms
Tidyparse (proposed/total): 362/576
Tidyparse (accepted/proposed): 354/362
Original error: unbalanced (){}[]
| original | repair |
|-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| def relative_path(self, absolute_path, output_filename): | def relative_path(self, absolute_path, output_filename): |
| """Rewrite paths relative to the output stylesheet path""" | """Rewrite paths relative to the output stylesheet path""" |
| absolute_path = os.path.join(settings.PIPELINE_ROOT, absolute_path) | absolute_path = os.path.join(settings.PIPELINE_ROOT, absolute_path) |
| output_path = os.path.join(settings.PIPELINE_ROOT, os.path.~dirname(output_filename~) | output_path = os.path.join(settings.PIPELINE_ROOT, os.path.**dirnameoutput_filename**) |
| return relpath(absolute_path, output_path) | return relpath(absolute_path, output_path) |
| | |
Python parser ACCEPTED repair!
Filtered out 0/0 invalid samples!
Drew 0 samples before timeout
Synthesized repair in: 30078ms
Tidyparse (proposed/total): 362/577
Tidyparse (accepted/proposed): 354/362
Original error: unbalanced (){}[]
| original | repair |
|--------------------------------------------------------------------------------------------------------|-------------------------|
| ~def crop_test_before(self):~ | **NO_REPAIR_PROPOSAL!** |
| ~ samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()~ | |
| ~ cropped_samples = numpy.array([[2, 3, 4], [7, 8, 9]).transpose()~ | |
| ~ numpy.testing.assert_array_equal(block_functions.fix_frame_count(samples, - 3), cropped_samples)~ | |
| ~~ | |
Filtered out 56/60 invalid samples!
Drew 4 samples before timeout
Synthesized repair in: 53381ms
Tidyparse (proposed/total): 363/578
Tidyparse (accepted/proposed): 355/363
Original error: unbalanced (){}[]
| original | repair |
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| def extendFields(self): | def extendFields(self):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment