Unnamed: 0
int64 0
2.44k
| repo
stringlengths 32
81
| hash
stringlengths 40
40
| diff
stringlengths 113
1.17k
| old_path
stringlengths 5
84
| rewrite
stringlengths 34
79
| initial_state
stringlengths 75
980
| final_state
stringlengths 76
980
|
---|---|---|---|---|---|---|---|
800 |
https://:@github.com/ankush13r/BvSalud.git
|
10216a189e9f63ab1a1d8cf7c647a026b7b941bb
|
@@ -195,7 +195,7 @@ def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
else:
if len(header_before_slash) != 0:
final_header = str(header_code) +'/'+ str(header_after_slash)
- elif len(header_after_slash) == 0:
+ elif len(header_before_slash) == 0:
final_header = '/' + str(decsCodes_list_dict)
else:
print(header,"--",header_before_slash,"--",header_after_slash)
|
BvSalud/makeSet.py
|
ReplaceText(target='header_before_slash' @(198,21)->(198,39))
|
def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
else:
if len(header_before_slash) != 0:
final_header = str(header_code) +'/'+ str(header_after_slash)
elif len(header_after_slash) == 0:
final_header = '/' + str(decsCodes_list_dict)
else:
print(header,"--",header_before_slash,"--",header_after_slash)
|
def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
else:
if len(header_before_slash) != 0:
final_header = str(header_code) +'/'+ str(header_after_slash)
elif len(header_before_slash) == 0:
final_header = '/' + str(decsCodes_list_dict)
else:
print(header,"--",header_before_slash,"--",header_after_slash)
|
801 |
https://:@github.com/Hypers-HFA/paraer.git
|
8a5fd8156012b94e50b1e6a3413244b95f3e323b
|
@@ -112,7 +112,7 @@ def para_ok_or_400(itemset):
]
value = None # 与 '' 区别
para = paramap.get(name)
- if required and para not in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
+ if required and para in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
result.error(name, 'required')
if para is not None:
if para:
|
paraer/para.py
|
ReplaceText(target=' in ' @(115,36)->(115,44))
|
def para_ok_or_400(itemset):
]
value = None # 与 '' 区别
para = paramap.get(name)
if required and para not in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
result.error(name, 'required')
if para is not None:
if para:
|
def para_ok_or_400(itemset):
]
value = None # 与 '' 区别
para = paramap.get(name)
if required and para in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
result.error(name, 'required')
if para is not None:
if para:
|
802 |
https://:@github.com/davidenunes/tensorx.git
|
34fb24ae4eeca927a7d7b5f376aeeddbb0b7aacd
|
@@ -2604,7 +2604,7 @@ class SaltPepperNoise(Layer):
else:
batch_size = noise_shape[0]
- noise = salt_pepper_noise(batch_size, noise_shape[1], density, salt_value, pepper_value, seed)
+ noise = salt_pepper_noise(noise_shape[1], batch_size, density, salt_value, pepper_value, seed)
if layer.is_sparse():
tensor = transform.sparse_put(layer.tensor, noise)
|
tensorx/layers.py
|
ArgSwap(idxs=0<->1 @(2607,24)->(2607,41))
|
class SaltPepperNoise(Layer):
else:
batch_size = noise_shape[0]
noise = salt_pepper_noise(batch_size, noise_shape[1], density, salt_value, pepper_value, seed)
if layer.is_sparse():
tensor = transform.sparse_put(layer.tensor, noise)
|
class SaltPepperNoise(Layer):
else:
batch_size = noise_shape[0]
noise = salt_pepper_noise(noise_shape[1], batch_size, density, salt_value, pepper_value, seed)
if layer.is_sparse():
tensor = transform.sparse_put(layer.tensor, noise)
|
803 |
https://:@github.com/sauliusl/dgw.git
|
9120263028d2e64983b9b9babe31c46b8f2caedd
|
@@ -98,7 +98,7 @@ def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
path_rev = (_reverse_path(path[0]), path[1])
if scale_first:
- path_rev = _scaled_path(path, scaling_path, flip_paths)
+ path_rev = _scaled_path(path_rev, scaling_path, flip_paths)
# TODO: Reverse cost matrix here
cost = None
|
dgw/dtw/distance.py
|
ReplaceText(target='path_rev' @(101,40)->(101,44))
|
def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
path_rev = (_reverse_path(path[0]), path[1])
if scale_first:
path_rev = _scaled_path(path, scaling_path, flip_paths)
# TODO: Reverse cost matrix here
cost = None
|
def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
path_rev = (_reverse_path(path[0]), path[1])
if scale_first:
path_rev = _scaled_path(path_rev, scaling_path, flip_paths)
# TODO: Reverse cost matrix here
cost = None
|
804 |
https://:@bitbucket.org/slicedice/aboutyou-shop-sdk-python.git
|
c125675219cbb473f47c78c57e9205d1be44d4f2
|
@@ -439,7 +439,7 @@ class Search(object):
else:
product = Product(self.easy, p)
- self.easy.product_cach[p.id] = product
+ self.easy.product_cach[product.id] = product
self.products.buffer[i+offset] = product
|
collins/easy.py
|
ReplaceText(target='product' @(442,35)->(442,36))
|
class Search(object):
else:
product = Product(self.easy, p)
self.easy.product_cach[p.id] = product
self.products.buffer[i+offset] = product
|
class Search(object):
else:
product = Product(self.easy, p)
self.easy.product_cach[product.id] = product
self.products.buffer[i+offset] = product
|
805 |
https://:@github.com/neizod/extmath.git
|
b66496463e3d724a29d652e97867f41e4e1d2aea
|
@@ -117,7 +117,7 @@ def factorized(n):
break
while not n % i:
factor.append(i)
- n /= i
+ n //= i
if n == 1:
break
return factor
|
mathapi/__init__.py
|
ReplaceText(target='//=' @(120,14)->(120,16))
|
def factorized(n):
break
while not n % i:
factor.append(i)
n /= i
if n == 1:
break
return factor
|
def factorized(n):
break
while not n % i:
factor.append(i)
n //= i
if n == 1:
break
return factor
|
806 |
https://:@github.com/storborg/axibot.git
|
4ffd9fc0f715bbe4ae8c1708fbeae45186d35f6e
|
@@ -64,7 +64,7 @@ async def handle_user_message(app, ws, msg):
except Exception as e:
notify_error(app, ws, str(e))
else:
- app['document'] = msg.document
+ app['document'] = job.document
app['job'] = job
app['estimated_time'] = job.duration().total_seconds()
notify_new_document(app, exclude_client=ws)
|
axibot/server/handlers.py
|
ReplaceText(target='job' @(67,30)->(67,33))
|
async def handle_user_message(app, ws, msg):
except Exception as e:
notify_error(app, ws, str(e))
else:
app['document'] = msg.document
app['job'] = job
app['estimated_time'] = job.duration().total_seconds()
notify_new_document(app, exclude_client=ws)
|
async def handle_user_message(app, ws, msg):
except Exception as e:
notify_error(app, ws, str(e))
else:
app['document'] = job.document
app['job'] = job
app['estimated_time'] = job.duration().total_seconds()
notify_new_document(app, exclude_client=ws)
|
807 |
https://:@github.com/storborg/axibot.git
|
4ad752828696a789ef25fa001f1489f87344c3e4
|
@@ -116,7 +116,7 @@ async def client_handler(request):
elif raw_msg.tp == aiohttp.MsgType.closed:
break
elif raw_msg.tp == aiohttp.MsgType.error:
- log.info("User websocket error: %s", msg)
+ log.info("User websocket error: %s", raw_msg)
break
else:
log.error("Unknown user message type: %s, ignoring.",
|
axibot/server/handlers.py
|
ReplaceText(target='raw_msg' @(119,53)->(119,56))
|
async def client_handler(request):
elif raw_msg.tp == aiohttp.MsgType.closed:
break
elif raw_msg.tp == aiohttp.MsgType.error:
log.info("User websocket error: %s", msg)
break
else:
log.error("Unknown user message type: %s, ignoring.",
|
async def client_handler(request):
elif raw_msg.tp == aiohttp.MsgType.closed:
break
elif raw_msg.tp == aiohttp.MsgType.error:
log.info("User websocket error: %s", raw_msg)
break
else:
log.error("Unknown user message type: %s, ignoring.",
|
808 |
https://:@github.com/tsuyukimakoto/biisan.git
|
4465b109a4e71dcb64499c14b579c762e54b4db4
|
@@ -116,7 +116,7 @@ def process_image(elm, registry, container):
img.alt = subitem[1]
elif subitem[0] == 'witdh':
img.witdh = subitem[1]
- elif subitem[1] == 'height':
+ elif subitem[0] == 'height':
img.height = subitem[1]
elif subitem[0] == 'uri':
img.uri = subitem[1]
|
biisan/processors/__init__.py
|
ReplaceText(target='0' @(119,21)->(119,22))
|
def process_image(elm, registry, container):
img.alt = subitem[1]
elif subitem[0] == 'witdh':
img.witdh = subitem[1]
elif subitem[1] == 'height':
img.height = subitem[1]
elif subitem[0] == 'uri':
img.uri = subitem[1]
|
def process_image(elm, registry, container):
img.alt = subitem[1]
elif subitem[0] == 'witdh':
img.witdh = subitem[1]
elif subitem[0] == 'height':
img.height = subitem[1]
elif subitem[0] == 'uri':
img.uri = subitem[1]
|
809 |
https://:@github.com/csm10495/csmlog.git
|
010e00e53545842d2dc1342c375c068c90138ca2
|
@@ -262,7 +262,7 @@ def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
gsheets_handler_no_thread._add_rows_time = 99
assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
- assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time > 0
+ assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time >= 0
def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception("RESOURCE_EXHAUSTED uh-oh")) as mock:
|
csmlog/tests/test_google_sheets_handler.py
|
ReplaceText(target='>=' @(265,102)->(265,103))
|
def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
gsheets_handler_no_thread._add_rows_time = 99
assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time > 0
def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception("RESOURCE_EXHAUSTED uh-oh")) as mock:
|
def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
gsheets_handler_no_thread._add_rows_time = 99
assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time >= 0
def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception("RESOURCE_EXHAUSTED uh-oh")) as mock:
|
810 |
https://:@github.com/JorrandeWit/django-oscar-fees.git
|
7d18c7bdbeb881f4af5f81c1adf989422e134995
|
@@ -26,7 +26,7 @@ class FeeApplications(object):
'fee': fee,
'result': result,
'name': fee.name,
- 'description': result.description,
+ 'description': fee.description,
'freq': 0,
'amount': D('0.00')}
self.applications[fee.id]['amount'] += result.fee
|
django_oscar_fees/results.py
|
ReplaceText(target='fee' @(29,31)->(29,37))
|
class FeeApplications(object):
'fee': fee,
'result': result,
'name': fee.name,
'description': result.description,
'freq': 0,
'amount': D('0.00')}
self.applications[fee.id]['amount'] += result.fee
|
class FeeApplications(object):
'fee': fee,
'result': result,
'name': fee.name,
'description': fee.description,
'freq': 0,
'amount': D('0.00')}
self.applications[fee.id]['amount'] += result.fee
|
811 |
https://:@gitlab.com/yhtang/graphdot.git
|
2ac46e719092b1e78bc2bd860bce1dd23e152638
|
@@ -27,7 +27,7 @@ class OctileGraph(object):
nnz = len(edges)
''' add phantom label if none exists to facilitate C++ interop '''
- assert(len(edges.columns) >= 1)
+ assert(len(nodes.columns) >= 1)
if len(nodes.columns) == 1:
nodes['labeled'] = np.zeros(len(nodes), np.bool_)
|
graphdot/kernel/marginalized/_octilegraph.py
|
ReplaceText(target='nodes' @(30,19)->(30,24))
|
class OctileGraph(object):
nnz = len(edges)
''' add phantom label if none exists to facilitate C++ interop '''
assert(len(edges.columns) >= 1)
if len(nodes.columns) == 1:
nodes['labeled'] = np.zeros(len(nodes), np.bool_)
|
class OctileGraph(object):
nnz = len(edges)
''' add phantom label if none exists to facilitate C++ interop '''
assert(len(nodes.columns) >= 1)
if len(nodes.columns) == 1:
nodes['labeled'] = np.zeros(len(nodes), np.bool_)
|
812 |
https://:@gitlab.com/yhtang/graphdot.git
|
c1d46fe384aaac63a6e32b0a30cf6f3aa2b04183
|
@@ -315,7 +315,7 @@ class MarginalizedGraphKernel:
if traits.eval_gradient is True:
output_shape = (output_length, 1 + self.n_dims)
else:
- output_shape = (output_shape, 1)
+ output_shape = (output_length, 1)
output = backend.empty(int(np.prod(output_shape)), np.float32)
timer.toc('creating output buffer')
|
graphdot/kernel/marginalized/_kernel.py
|
ReplaceText(target='output_length' @(318,28)->(318,40))
|
class MarginalizedGraphKernel:
if traits.eval_gradient is True:
output_shape = (output_length, 1 + self.n_dims)
else:
output_shape = (output_shape, 1)
output = backend.empty(int(np.prod(output_shape)), np.float32)
timer.toc('creating output buffer')
|
class MarginalizedGraphKernel:
if traits.eval_gradient is True:
output_shape = (output_length, 1 + self.n_dims)
else:
output_shape = (output_length, 1)
output = backend.empty(int(np.prod(output_shape)), np.float32)
timer.toc('creating output buffer')
|
813 |
https://:@gitlab.com/yhtang/graphdot.git
|
f1499423ac76e790b77f729e92b2cc3223d64f58
|
@@ -117,7 +117,7 @@ class SpectralApprox(FactorApprox):
def __init__(self, X, rcut=0, acut=0):
if isinstance(X, np.ndarray):
U, S, _ = np.linalg.svd(X, full_matrices=False)
- mask = (S >= S.max() * rcut) | (S >= acut)
+ mask = (S >= S.max() * rcut) & (S >= acut)
self.U = U[:, mask]
self.S = S[mask]
elif isinstance(X, tuple) and len(X) == 2:
|
graphdot/linalg/low_rank.py
|
ReplaceText(target='&' @(120,41)->(120,42))
|
class SpectralApprox(FactorApprox):
def __init__(self, X, rcut=0, acut=0):
if isinstance(X, np.ndarray):
U, S, _ = np.linalg.svd(X, full_matrices=False)
mask = (S >= S.max() * rcut) | (S >= acut)
self.U = U[:, mask]
self.S = S[mask]
elif isinstance(X, tuple) and len(X) == 2:
|
class SpectralApprox(FactorApprox):
def __init__(self, X, rcut=0, acut=0):
if isinstance(X, np.ndarray):
U, S, _ = np.linalg.svd(X, full_matrices=False)
mask = (S >= S.max() * rcut) & (S >= acut)
self.U = U[:, mask]
self.S = S[mask]
elif isinstance(X, tuple) and len(X) == 2:
|
814 |
https://:@github.com/straga/micropython.git
|
1679696612007107dac55d936006b1923eda2475
|
@@ -7,7 +7,7 @@ desc = {
data = bytearray(b"01234567")
-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
+S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
# Arrays of UINT8 are accessed as bytearrays
print(S.arr)
|
tests/extmod/uctypes_bytearray.py
|
ArgSwap(idxs=0<->1 @(10,4)->(10,18))
|
desc = {
data = bytearray(b"01234567")
S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
# Arrays of UINT8 are accessed as bytearrays
print(S.arr)
|
desc = {
data = bytearray(b"01234567")
S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
# Arrays of UINT8 are accessed as bytearrays
print(S.arr)
|
815 |
https://:@github.com/straga/micropython.git
|
1679696612007107dac55d936006b1923eda2475
|
@@ -22,7 +22,7 @@ desc = {
data = bytearray(b"01")
-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
+S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
#print(S)
print(hex(S.s0))
|
tests/extmod/uctypes_le.py
|
ArgSwap(idxs=0<->1 @(25,4)->(25,18))
|
desc = {
data = bytearray(b"01")
S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
#print(S)
print(hex(S.s0))
|
desc = {
data = bytearray(b"01")
S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
#print(S)
print(hex(S.s0))
|
816 |
https://:@github.com/straga/micropython.git
|
1679696612007107dac55d936006b1923eda2475
|
@@ -31,7 +31,7 @@ desc = {
data = bytearray(b"01")
-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.NATIVE)
+S = uctypes.struct(uctypes.addressof(data), desc, uctypes.NATIVE)
#print(S)
print(hex(S.s0))
|
tests/extmod/uctypes_native_le.py
|
ArgSwap(idxs=0<->1 @(34,4)->(34,18))
|
desc = {
data = bytearray(b"01")
S = uctypes.struct(desc, uctypes.addressof(data), uctypes.NATIVE)
#print(S)
print(hex(S.s0))
|
desc = {
data = bytearray(b"01")
S = uctypes.struct(uctypes.addressof(data), desc, uctypes.NATIVE)
#print(S)
print(hex(S.s0))
|
817 |
https://:@github.com/straga/micropython.git
|
1679696612007107dac55d936006b1923eda2475
|
@@ -16,7 +16,7 @@ bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc))
-S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)
+S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
print(S.ptr[0])
assert S.ptr[0] == ord("0")
|
tests/extmod/uctypes_ptr_le.py
|
ArgSwap(idxs=0<->1 @(19,4)->(19,18))
|
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc))
S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)
print(S.ptr[0])
assert S.ptr[0] == ord("0")
|
bytes = b"01"
addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc))
S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
print(S.ptr[0])
assert S.ptr[0] == ord("0")
|
818 |
https://:@github.com/IL2HorusTeam/il2fb-ds-airbridge.git
|
bc69d1a47a4994071d0b46c7dd29aebf6a7d4169
|
@@ -60,7 +60,7 @@ class TextFileWatchDog:
def stop(self) -> None:
with self._stop_lock:
- self._do_stop = False
+ self._do_stop = True
def run(self) -> None:
try:
|
il2fb/ds/airbridge/watch_dog.py
|
ReplaceText(target='True' @(63,28)->(63,33))
|
class TextFileWatchDog:
def stop(self) -> None:
with self._stop_lock:
self._do_stop = False
def run(self) -> None:
try:
|
class TextFileWatchDog:
def stop(self) -> None:
with self._stop_lock:
self._do_stop = True
def run(self) -> None:
try:
|
819 |
https://:@github.com/south-coast-science/scs_dfe_eng.git
|
060bd36c51a20f4586ed199b1e3996c70b0318a7
|
@@ -49,7 +49,7 @@ class AFE(object):
self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
- self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000_conf else None
+ self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000 else None
self.__tconv = self.__wrk_adc.tconv
|
scs_dfe/gas/afe.py
|
ReplaceText(target='pt1000' @(52,80)->(52,91))
|
class AFE(object):
self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000_conf else None
self.__tconv = self.__wrk_adc.tconv
|
class AFE(object):
self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000 else None
self.__tconv = self.__wrk_adc.tconv
|
820 |
https://:@github.com/ionox0/toil.git
|
3f065a27c433b1cb9c5266ed4c28b643419d4466
|
@@ -456,7 +456,7 @@ def mainLoop(config, batchSystem):
reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
logger.info("Reissued any over long jobs")
- hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, config, childCounts)
+ hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, childCounts, config)
if hasNoMissingJobs:
timeSinceJobsLastRescued = time.time()
else:
|
src/master.py
|
ArgSwap(idxs=4<->5 @(459,35)->(459,53))
|
def mainLoop(config, batchSystem):
reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
logger.info("Reissued any over long jobs")
hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, config, childCounts)
if hasNoMissingJobs:
timeSinceJobsLastRescued = time.time()
else:
|
def mainLoop(config, batchSystem):
reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
logger.info("Reissued any over long jobs")
hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, childCounts, config)
if hasNoMissingJobs:
timeSinceJobsLastRescued = time.time()
else:
|
821 |
https://:@github.com/ionox0/toil.git
|
a0e4eadb87f09791088b6c11dc6aec0bf8002991
|
@@ -99,7 +99,7 @@ please ensure you re-import targets defined in main" % self.__class__.__name__)
"""Takes a file (as a path) and uploads it to to the global file store, returns
an ID that can be used to retrieve the file.
"""
- return self.jobStore.writeFile(localFileName, self.job.jobStoreID)
+ return self.jobStore.writeFile(self.job.jobStoreID, localFileName)
def updateGlobalFile(self, fileStoreID, localFileName):
"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID.
|
src/target.py
|
ArgSwap(idxs=0<->1 @(102,15)->(102,38))
|
please ensure you re-import targets defined in main" % self.__class__.__name__)
"""Takes a file (as a path) and uploads it to to the global file store, returns
an ID that can be used to retrieve the file.
"""
return self.jobStore.writeFile(localFileName, self.job.jobStoreID)
def updateGlobalFile(self, fileStoreID, localFileName):
"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID.
|
please ensure you re-import targets defined in main" % self.__class__.__name__)
"""Takes a file (as a path) and uploads it to to the global file store, returns
an ID that can be used to retrieve the file.
"""
return self.jobStore.writeFile(self.job.jobStoreID, localFileName)
def updateGlobalFile(self, fileStoreID, localFileName):
"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID.
|
822 |
https://:@github.com/ionox0/toil.git
|
06718f425d5981afabd30bcfa39d866edb5c09b4
|
@@ -46,7 +46,7 @@ class Job( object ):
#The IDs of predecessors that have finished.
#When len(predecessorsFinished) == predecessorNumber then the
#job can be run.
- self.predecessorsFinished = predecessorNumber or set()
+ self.predecessorsFinished = predecessorsFinished or set()
#The list of successor jobs to run. Successor jobs are stored
#as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber).
|
src/jobTree/job.py
|
ReplaceText(target='predecessorsFinished' @(49,36)->(49,53))
|
class Job( object ):
#The IDs of predecessors that have finished.
#When len(predecessorsFinished) == predecessorNumber then the
#job can be run.
self.predecessorsFinished = predecessorNumber or set()
#The list of successor jobs to run. Successor jobs are stored
#as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber).
|
class Job( object ):
#The IDs of predecessors that have finished.
#When len(predecessorsFinished) == predecessorNumber then the
#job can be run.
self.predecessorsFinished = predecessorsFinished or set()
#The list of successor jobs to run. Successor jobs are stored
#as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber).
|
823 |
https://:@github.com/ionox0/toil.git
|
47ec5287d747036c524100cc49fa4262a73293cf
|
@@ -107,7 +107,7 @@ class JobWrapper( object ):
"""
if self.logJobStoreFileID is not None:
self.clearLogFile(jobStore)
- self.logJobStoreFileID = jobStore.writeFile( self.jobStoreID, logFile )
+ self.logJobStoreFileID = jobStore.writeFile( logFile, self.jobStoreID )
assert self.logJobStoreFileID is not None
def getLogFileHandle( self, jobStore ):
|
src/toil/jobWrapper.py
|
ArgSwap(idxs=0<->1 @(110,33)->(110,51))
|
class JobWrapper( object ):
"""
if self.logJobStoreFileID is not None:
self.clearLogFile(jobStore)
self.logJobStoreFileID = jobStore.writeFile( self.jobStoreID, logFile )
assert self.logJobStoreFileID is not None
def getLogFileHandle( self, jobStore ):
|
class JobWrapper( object ):
"""
if self.logJobStoreFileID is not None:
self.clearLogFile(jobStore)
self.logJobStoreFileID = jobStore.writeFile( logFile, self.jobStoreID )
assert self.logJobStoreFileID is not None
def getLogFileHandle( self, jobStore ):
|
824 |
https://:@github.com/ionox0/toil.git
|
cad17f6cbe391264e00675c51a8bfe9221ba1091
|
@@ -159,7 +159,7 @@ class AbstractJobStore( object ):
break
#Reset the retry count of the jobWrapper
- if jobWrapper.remainingRetryCount < self._defaultTryCount():
+ if jobWrapper.remainingRetryCount != self._defaultTryCount():
jobWrapper.remainingRetryCount = self._defaultTryCount()
changed = True
|
src/toil/jobStores/abstractJobStore.py
|
ReplaceText(target='!=' @(162,46)->(162,47))
|
class AbstractJobStore( object ):
break
#Reset the retry count of the jobWrapper
if jobWrapper.remainingRetryCount < self._defaultTryCount():
jobWrapper.remainingRetryCount = self._defaultTryCount()
changed = True
|
class AbstractJobStore( object ):
break
#Reset the retry count of the jobWrapper
if jobWrapper.remainingRetryCount != self._defaultTryCount():
jobWrapper.remainingRetryCount = self._defaultTryCount()
changed = True
|
825 |
https://:@github.com/ionox0/toil.git
|
dcd5e6f86c0f9d376140f4626e97666348683b73
|
@@ -437,7 +437,7 @@ class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
:rtype: toil.resource.Resource
"""
- if self._runningOnWorker():
+ if not self._runningOnWorker():
log.warn('The localize() method should only be invoked on a worker.')
resource = Resource.lookup(self._resourcePath)
if resource is None:
|
src/toil/resource.py
|
ReplaceText(target='not ' @(440,11)->(440,11))
|
class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
:rtype: toil.resource.Resource
"""
if self._runningOnWorker():
log.warn('The localize() method should only be invoked on a worker.')
resource = Resource.lookup(self._resourcePath)
if resource is None:
|
class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
:rtype: toil.resource.Resource
"""
if not self._runningOnWorker():
log.warn('The localize() method should only be invoked on a worker.')
resource = Resource.lookup(self._resourcePath)
if resource is None:
|
826 |
https://:@github.com/ionox0/toil.git
|
bee00f3fc4f68af0e7c00b884627f728ca20f792
|
@@ -649,7 +649,7 @@ def main(args=None, stdout=sys.stdout):
if options.logLevel:
cwllogger.setLevel(options.logLevel)
- useStrict = not args.not_strict
+ useStrict = not options.not_strict
try:
t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
resolver=cwltool.resolver.tool_resolver, strict=useStrict)
|
src/toil/cwl/cwltoil.py
|
ReplaceText(target='options' @(652,20)->(652,24))
|
def main(args=None, stdout=sys.stdout):
if options.logLevel:
cwllogger.setLevel(options.logLevel)
useStrict = not args.not_strict
try:
t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
resolver=cwltool.resolver.tool_resolver, strict=useStrict)
|
def main(args=None, stdout=sys.stdout):
if options.logLevel:
cwllogger.setLevel(options.logLevel)
useStrict = not options.not_strict
try:
t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
resolver=cwltool.resolver.tool_resolver, strict=useStrict)
|
827 |
https://:@github.com/ionox0/toil.git
|
231b6665bde956aae5b3469a7147e2358097fca4
|
@@ -143,7 +143,7 @@ class SingleMachineBatchSystem(BatchSystemSupport):
startTime = time.time() # Time job is started
popen = None
statusCode = None
- forkWorker = not (self.debugWorker and "_toil_worker" not in jobCommand)
+ forkWorker = not (self.debugWorker and "_toil_worker" in jobCommand)
if forkWorker:
with self.popenLock:
popen = subprocess.Popen(jobCommand,
|
src/toil/batchSystems/singleMachine.py
|
ReplaceText(target=' in ' @(146,61)->(146,69))
|
class SingleMachineBatchSystem(BatchSystemSupport):
startTime = time.time() # Time job is started
popen = None
statusCode = None
forkWorker = not (self.debugWorker and "_toil_worker" not in jobCommand)
if forkWorker:
with self.popenLock:
popen = subprocess.Popen(jobCommand,
|
class SingleMachineBatchSystem(BatchSystemSupport):
startTime = time.time() # Time job is started
popen = None
statusCode = None
forkWorker = not (self.debugWorker and "_toil_worker" in jobCommand)
if forkWorker:
with self.popenLock:
popen = subprocess.Popen(jobCommand,
|
828 |
https://:@github.com/ionox0/toil.git
|
f5054aca67788f976c72b1e3f42334afe3a1dfaa
|
@@ -138,7 +138,7 @@ class AbstractProvisioner(with_metaclass(ABCMeta, object)):
self._spotBidsMap[nodeType] = bid
else:
self.nodeTypes.append(nodeTypeStr)
- self.nodeShapes.append(self.getNodeShape(nodeType, preemptable=False))
+ self.nodeShapes.append(self.getNodeShape(nodeTypeStr, preemptable=False))
@staticmethod
def retryPredicate(e):
|
src/toil/provisioners/abstractProvisioner.py
|
ReplaceText(target='nodeTypeStr' @(141,57)->(141,65))
|
class AbstractProvisioner(with_metaclass(ABCMeta, object)):
self._spotBidsMap[nodeType] = bid
else:
self.nodeTypes.append(nodeTypeStr)
self.nodeShapes.append(self.getNodeShape(nodeType, preemptable=False))
@staticmethod
def retryPredicate(e):
|
class AbstractProvisioner(with_metaclass(ABCMeta, object)):
self._spotBidsMap[nodeType] = bid
else:
self.nodeTypes.append(nodeTypeStr)
self.nodeShapes.append(self.getNodeShape(nodeTypeStr, preemptable=False))
@staticmethod
def retryPredicate(e):
|
829 |
https://:@github.com/ionox0/toil.git
|
59f716aed0363adba211e7c1f18ebe3802edb636
|
@@ -108,7 +108,7 @@ class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
if not self.boss.config.manualMemArgs:
# for UGE instead of SGE; see #2309
reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
- elif self.boss.config.manualMemArgs and sgeArgs:
+ elif self.boss.config.manualMemArgs and not sgeArgs:
raise ValueError("--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set."
"Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for "
"your system. Default adds the arguments: vf=<mem> h_vmem=<mem> "
|
src/toil/batchSystems/gridengine.py
|
ReplaceText(target='not ' @(111,56)->(111,56))
|
class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
if not self.boss.config.manualMemArgs:
# for UGE instead of SGE; see #2309
reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
elif self.boss.config.manualMemArgs and sgeArgs:
raise ValueError("--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set."
"Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for "
"your system. Default adds the arguments: vf=<mem> h_vmem=<mem> "
|
class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
if not self.boss.config.manualMemArgs:
# for UGE instead of SGE; see #2309
reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
elif self.boss.config.manualMemArgs and not sgeArgs:
raise ValueError("--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set."
"Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for "
"your system. Default adds the arguments: vf=<mem> h_vmem=<mem> "
|
830 |
https://:@github.com/tkf/railgun.git
|
f49414f39ca7c6bbbd5e000d45db46b77a4e514d
|
@@ -64,7 +64,7 @@ DATA_TEST_CDEC_PARSE = [
("int a[i] =2", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
("int a[i][j]=3", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
- (cmem('obj', DmyCDT), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
+ (cmem(DmyCDT, 'obj'), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
]
|
tests/test_cdata.py
|
ArgSwap(idxs=0<->1 @(67,5)->(67,9))
|
DATA_TEST_CDEC_PARSE = [
("int a[i] =2", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
("int a[i][j]=3", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
(cmem('obj', DmyCDT), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
]
|
DATA_TEST_CDEC_PARSE = [
("int a[i] =2", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
("int a[i][j]=3", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
(cmem(DmyCDT, 'obj'), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
]
|
831 |
https://:@github.com/hubzero/hublib.git
|
8921395b8feda7af6d59ed2133dd1a4068ae9803
|
@@ -486,7 +486,7 @@ def copy_files(errnum, etime, toolname, runName):
else:
# nonparametric run. Results are in current working directory.
# Use the timestamp to copy all newer files to the cacheName.
- if errnum > 0:
+ if errnum == 0:
files = os.listdir('.')
for f in files:
if os.path.getmtime(f) > self.start_time:
|
hublib/ui/submit.py
|
ReplaceText(target='==' @(489,18)->(489,19))
|
def copy_files(errnum, etime, toolname, runName):
else:
# nonparametric run. Results are in current working directory.
# Use the timestamp to copy all newer files to the cacheName.
if errnum > 0:
files = os.listdir('.')
for f in files:
if os.path.getmtime(f) > self.start_time:
|
def copy_files(errnum, etime, toolname, runName):
else:
# nonparametric run. Results are in current working directory.
# Use the timestamp to copy all newer files to the cacheName.
if errnum == 0:
files = os.listdir('.')
for f in files:
if os.path.getmtime(f) > self.start_time:
|
832 |
https://:@github.com/tjstretchalot/ignite-simple.git
|
944f32fd5421cb01c0c75be5959277e1a1a2c741
|
@@ -240,7 +240,7 @@ class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
# remove from params_to_task
# add to in_progress
# return built disp.Task
- if cores > self.sweep_cores and self.sweeps:
+ if cores >= self.sweep_cores and self.sweeps:
swp: ParamsTask = self.sweeps.pop()
del self.params_to_sweeps_ind[swp.params]
self._len -= 1
|
ignite_simple/gen_sweep/sweeper.py
|
ReplaceText(target='>=' @(243,17)->(243,18))
|
class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
# remove from params_to_task
# add to in_progress
# return built disp.Task
if cores > self.sweep_cores and self.sweeps:
swp: ParamsTask = self.sweeps.pop()
del self.params_to_sweeps_ind[swp.params]
self._len -= 1
|
class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
# remove from params_to_task
# add to in_progress
# return built disp.Task
if cores >= self.sweep_cores and self.sweeps:
swp: ParamsTask = self.sweeps.pop()
del self.params_to_sweeps_ind[swp.params]
self._len -= 1
|
833 |
https://:@github.com/jessemyers/lxmlbind.git
|
35bb1bbc635ea9dca813dffe25165b14576c4a00
|
@@ -75,7 +75,7 @@ class Base(object):
child = etree.SubElement(parent, head)
else:
return None
- return self.search(child, tail, create) if tail else child
+ return self.search(tail, child, create) if tail else child
def __str__(self):
"""
|
lxmlbind/base.py
|
ArgSwap(idxs=0<->1 @(78,15)->(78,26))
|
class Base(object):
child = etree.SubElement(parent, head)
else:
return None
return self.search(child, tail, create) if tail else child
def __str__(self):
"""
|
class Base(object):
child = etree.SubElement(parent, head)
else:
return None
return self.search(tail, child, create) if tail else child
def __str__(self):
"""
|
834 |
https://:@github.com/dieterv/etk.docking.git
|
f7e423f2e5d2a68183238c2d1eb39dcb4cf7ec30
|
@@ -521,7 +521,7 @@ class DockPaned(gtk.Container):
width = max(width, w)
height += h
# Store the minimum weight for usage in do_size_allocate
- item.min_size = w
+ item.min_size = h
# Add handles
if self._orientation == gtk.ORIENTATION_HORIZONTAL:
|
lib/etk/docking/dockpaned.py
|
ReplaceText(target='h' @(524,32)->(524,33))
|
class DockPaned(gtk.Container):
width = max(width, w)
height += h
# Store the minimum weight for usage in do_size_allocate
item.min_size = w
# Add handles
if self._orientation == gtk.ORIENTATION_HORIZONTAL:
|
class DockPaned(gtk.Container):
width = max(width, w)
height += h
# Store the minimum weight for usage in do_size_allocate
item.min_size = h
# Add handles
if self._orientation == gtk.ORIENTATION_HORIZONTAL:
|
835 |
https://:@github.com/isnok/asciidrumming.git
|
66e35371a4b96774d931516f7131e19ccf6e2c43
|
@@ -42,7 +42,7 @@ def assemble_pieces(phrases, pieces):
def clean_phrases(phrases):
for phrase in phrases.values():
phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
- phrase['length'] = (len(phrase['pattern']) // phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
+ phrase['length'] = (len(phrase['pattern']) / phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
def assemble_phrases(config):
|
asciidrumming/assemble.py
|
ReplaceText(target='/' @(45,51)->(45,53))
|
def assemble_pieces(phrases, pieces):
def clean_phrases(phrases):
for phrase in phrases.values():
phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
phrase['length'] = (len(phrase['pattern']) // phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
def assemble_phrases(config):
|
def assemble_pieces(phrases, pieces):
def clean_phrases(phrases):
for phrase in phrases.values():
phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
phrase['length'] = (len(phrase['pattern']) / phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
def assemble_phrases(config):
|
836 |
https://:@github.com/FedericoCinus/WoMG.git
|
75addc91cd520c8e7ebf8975ceaf24b79b2cf49f
|
@@ -390,7 +390,7 @@ class LDA(TLTTopicModel):
saved_model_fname = str(hash(saved_model))+'.model'
if os.path.exists(saved_model_fname):
#lda_model = pickle.load(os.path.abspath(saved_model))
- lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model))
+ lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model_fname))
else:
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
id2word=self.dictionary,
|
src/test_version/topic/lda.py
|
ReplaceText(target='saved_model_fname' @(393,77)->(393,88))
|
class LDA(TLTTopicModel):
saved_model_fname = str(hash(saved_model))+'.model'
if os.path.exists(saved_model_fname):
#lda_model = pickle.load(os.path.abspath(saved_model))
lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model))
else:
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
id2word=self.dictionary,
|
class LDA(TLTTopicModel):
saved_model_fname = str(hash(saved_model))+'.model'
if os.path.exists(saved_model_fname):
#lda_model = pickle.load(os.path.abspath(saved_model))
lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model_fname))
else:
lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
id2word=self.dictionary,
|
837 |
https://:@github.com/waikato-datamining/wai-annotations.git
|
1c1e29a44b802c45c83af7278b1637aa98855a68
|
@@ -63,4 +63,4 @@ def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
if shards == 0:
raise ValueError(f"{filename} is not a shard filename")
- return tuple(format_sharded_filename(base_name, shards, i) for i in range(index))
+ return tuple(format_sharded_filename(base_name, shards, i) for i in range(shards))
|
src/wai/annotations/tf/utils/_sharded_filenames.py
|
ReplaceText(target='shards' @(66,78)->(66,83))
|
def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
if shards == 0:
raise ValueError(f"{filename} is not a shard filename")
return tuple(format_sharded_filename(base_name, shards, i) for i in range(index))
|
def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
if shards == 0:
raise ValueError(f"{filename} is not a shard filename")
return tuple(format_sharded_filename(base_name, shards, i) for i in range(shards))
|
838 |
https://:@github.com/broundal/Pytolemaic.git
|
c407b7b2410fe04641d0261ca209a2e57a728ded
|
@@ -220,7 +220,7 @@ class SensitivityAnalysis():
vulnerability_report = self._vulnerability_report(
shuffled_sensitivity=self.shuffled_sensitivity,
missing_sensitivity=self.missing_sensitivity,
- shuffled_sensitivity_stats=missing_stats_report)
+ shuffled_sensitivity_stats=shuffle_stats_report)
return SensitivityFullReport(
shuffle_report=self.shuffled_sensitivity,
|
pytolemaic/analysis_logic/model_analysis/sensitivity/sensitivity.py
|
ReplaceText(target='shuffle_stats_report' @(223,39)->(223,59))
|
class SensitivityAnalysis():
vulnerability_report = self._vulnerability_report(
shuffled_sensitivity=self.shuffled_sensitivity,
missing_sensitivity=self.missing_sensitivity,
shuffled_sensitivity_stats=missing_stats_report)
return SensitivityFullReport(
shuffle_report=self.shuffled_sensitivity,
|
class SensitivityAnalysis():
vulnerability_report = self._vulnerability_report(
shuffled_sensitivity=self.shuffled_sensitivity,
missing_sensitivity=self.missing_sensitivity,
shuffled_sensitivity_stats=shuffle_stats_report)
return SensitivityFullReport(
shuffle_report=self.shuffled_sensitivity,
|
839 |
https://:@github.com/damoti/shipmaster.git
|
f81614acecb36da1343ec9e114679b06f0d8b0ba
|
@@ -94,7 +94,7 @@ class LayerBase:
# Only tag image if container was built successfully.
repository, tag = self.image_name, None
if ':' in repository:
- repository, tag = tag.split(':')
+ repository, tag = repository.split(':')
conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
client.commit(container, repository=repository, tag=tag, conf=conf)
client.remove_container(container)
|
shipmaster/base/builder.py
|
ReplaceText(target='repository' @(97,34)->(97,37))
|
class LayerBase:
# Only tag image if container was built successfully.
repository, tag = self.image_name, None
if ':' in repository:
repository, tag = tag.split(':')
conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
client.commit(container, repository=repository, tag=tag, conf=conf)
client.remove_container(container)
|
class LayerBase:
# Only tag image if container was built successfully.
repository, tag = self.image_name, None
if ':' in repository:
repository, tag = repository.split(':')
conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
client.commit(container, repository=repository, tag=tag, conf=conf)
client.remove_container(container)
|
840 |
https://:@github.com/ldo/pybidi.git
|
ef93e8fdd0220fb446238060c7b4f30422251943
|
@@ -1352,7 +1352,7 @@ def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
if position_from_this_list != None :
c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
else :
- position_from_this_list = None
+ c_position_from_this_list = None
#end if
if embedding_levels != None :
c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)
|
fribidi.py
|
ReplaceText(target='c_position_from_this_list' @(1355,8)->(1355,31))
|
def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
if position_from_this_list != None :
c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
else :
position_from_this_list = None
#end if
if embedding_levels != None :
c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)
|
def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
if position_from_this_list != None :
c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
else :
c_position_from_this_list = None
#end if
if embedding_levels != None :
c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)
|
841 |
https://:@github.com/wbolster/cardinality.git
|
cfc729bc337f8d796d7bfe11a64ef3a3d516575b
|
@@ -68,7 +68,7 @@ def between(min, max, iterable):
"""
if min < 0:
raise ValueError("'min' must be positive (or zero)")
- if min < 0:
+ if max < 0:
raise ValueError("'max' must be positive (or zero)")
if min > max:
raise ValueError("'max' must be greater or equal than 'min'")
|
cardinality.py
|
ReplaceText(target='max' @(71,7)->(71,10))
|
def between(min, max, iterable):
"""
if min < 0:
raise ValueError("'min' must be positive (or zero)")
if min < 0:
raise ValueError("'max' must be positive (or zero)")
if min > max:
raise ValueError("'max' must be greater or equal than 'min'")
|
def between(min, max, iterable):
"""
if min < 0:
raise ValueError("'min' must be positive (or zero)")
if max < 0:
raise ValueError("'max' must be positive (or zero)")
if min > max:
raise ValueError("'max' must be greater or equal than 'min'")
|
842 |
https://:@github.com/zongzhenh/pymysql-pool.git
|
66b07cdf844554245cf209a72de89bd17133269c
|
@@ -169,7 +169,7 @@ class Pool(object):
if self.ping_check:
now = int(time())
timeout = now
- if isinstance(int, self.ping_check):
+ if isinstance(self.ping_check, int):
timeout = timeout - self.ping_check
if not hasattr(c, '__ping_check_timestamp'):
c.__ping_check_timestamp = now
|
pymysqlpool/pool.py
|
ArgSwap(idxs=0<->1 @(172,15)->(172,25))
|
class Pool(object):
if self.ping_check:
now = int(time())
timeout = now
if isinstance(int, self.ping_check):
timeout = timeout - self.ping_check
if not hasattr(c, '__ping_check_timestamp'):
c.__ping_check_timestamp = now
|
class Pool(object):
if self.ping_check:
now = int(time())
timeout = now
if isinstance(self.ping_check, int):
timeout = timeout - self.ping_check
if not hasattr(c, '__ping_check_timestamp'):
c.__ping_check_timestamp = now
|
843 |
https://:@github.com/kanzure/python-vba-wrapper.git
|
98edf03512c8f7960f10fa615867269cdf0821d6
|
@@ -315,7 +315,7 @@ class VBA(object):
# 29 registers
buf = (ctypes.c_int32 * self.register_count)()
buf[:] = registers
- self._vba.set_registers(registers)
+ self._vba.set_registers(buf)
def _get_max_save_size(self):
return self._vba.get_max_save_size()
|
vba_wrapper/core.py
|
ReplaceText(target='buf' @(318,32)->(318,41))
|
class VBA(object):
# 29 registers
buf = (ctypes.c_int32 * self.register_count)()
buf[:] = registers
self._vba.set_registers(registers)
def _get_max_save_size(self):
return self._vba.get_max_save_size()
|
class VBA(object):
# 29 registers
buf = (ctypes.c_int32 * self.register_count)()
buf[:] = registers
self._vba.set_registers(buf)
def _get_max_save_size(self):
return self._vba.get_max_save_size()
|
844 |
https://:@github.com/severb/flowy.git
|
82cbab85d672880b7c3db69b5e1707e90da7686e
|
@@ -191,7 +191,7 @@ class DecisionPoller(object):
elif e_type == 'StartChildWorkflowExecutionFailed':
SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
id = _subworkflow_id(e[SCWEFEA]['workflowId'])
- reason = e[SCWEIEA]['cause']
+ reason = e[SCWEFEA]['cause']
errors[id] = reason
elif e_type == 'TimerStarted':
id = e['timerStartedEventAttributes']['timerId']
|
flowy/swf/poller.py
|
ReplaceText(target='SCWEFEA' @(194,27)->(194,34))
|
class DecisionPoller(object):
elif e_type == 'StartChildWorkflowExecutionFailed':
SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
id = _subworkflow_id(e[SCWEFEA]['workflowId'])
reason = e[SCWEIEA]['cause']
errors[id] = reason
elif e_type == 'TimerStarted':
id = e['timerStartedEventAttributes']['timerId']
|
class DecisionPoller(object):
elif e_type == 'StartChildWorkflowExecutionFailed':
SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
id = _subworkflow_id(e[SCWEFEA]['workflowId'])
reason = e[SCWEFEA]['cause']
errors[id] = reason
elif e_type == 'TimerStarted':
id = e['timerStartedEventAttributes']['timerId']
|
845 |
https://:@github.com/brthor/codetransformer-py2.git
|
7c327683df810265d01a995d2704c9f8218b0ef7
|
@@ -141,7 +141,7 @@ class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
'little',
)
- yield cls(arg)
+ yield instr(arg)
@classmethod
def from_opcode(cls, opcode):
|
codetransformer/instructions.py
|
ReplaceText(target='instr' @(144,18)->(144,21))
|
class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
'little',
)
yield cls(arg)
@classmethod
def from_opcode(cls, opcode):
|
class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
'little',
)
yield instr(arg)
@classmethod
def from_opcode(cls, opcode):
|
846 |
https://:@github.com/bacadra/bacadra.git
|
74346189dfe3cac99821fd0a32ddeb3290886c4d
|
@@ -1256,7 +1256,7 @@ class texme(TeXM, object, metaclass=texmemeta):
elif type(inherit)==str:
self.store(inherit, tex)
elif inherit is False:
- self.data = [tex + '\n%']
+ self.data += [tex + '\n%']
if self.echo:
print('[texme.' + name + ']\n' + tex)
|
bacadra/pinky/texme/texme.py
|
ReplaceText(target='+=' @(1259,22)->(1259,23))
|
class texme(TeXM, object, metaclass=texmemeta):
elif type(inherit)==str:
self.store(inherit, tex)
elif inherit is False:
self.data = [tex + '\n%']
if self.echo:
print('[texme.' + name + ']\n' + tex)
|
class texme(TeXM, object, metaclass=texmemeta):
elif type(inherit)==str:
self.store(inherit, tex)
elif inherit is False:
self.data += [tex + '\n%']
if self.echo:
print('[texme.' + name + ']\n' + tex)
|
847 |
https://:@github.com/bacadra/bacadra.git
|
3e4cd62c6a0769ea886aaae2104aeb5dff18dbea
|
@@ -1131,7 +1131,7 @@ class texme(metaclass=texmemeta):
return self.add(
submodule = _name1,
- code = code,
+ code = tex,
inherit = inherit,
echo = echo,
)
|
bacadra/pinky/texme/texme.py
|
ReplaceText(target='tex' @(1134,24)->(1134,28))
|
class texme(metaclass=texmemeta):
return self.add(
submodule = _name1,
code = code,
inherit = inherit,
echo = echo,
)
|
class texme(metaclass=texmemeta):
return self.add(
submodule = _name1,
code = tex,
inherit = inherit,
echo = echo,
)
|
848 |
https://:@github.com/ulif/diceware-list.git
|
744223382d439315c8195d3ddff170e3542d80f0
|
@@ -92,4 +92,4 @@ def local_android_download(request, monkeypatch, tmpdir):
monkeypatch.setattr(
"diceware_list.libwordlist.AndroidWordList.base_url",
fake_base_url)
- return dictfile
+ return tmpdir
|
tests/conftest.py
|
ReplaceText(target='tmpdir' @(95,11)->(95,19))
|
def local_android_download(request, monkeypatch, tmpdir):
monkeypatch.setattr(
"diceware_list.libwordlist.AndroidWordList.base_url",
fake_base_url)
return dictfile
|
def local_android_download(request, monkeypatch, tmpdir):
monkeypatch.setattr(
"diceware_list.libwordlist.AndroidWordList.base_url",
fake_base_url)
return tmpdir
|
849 |
https://:@github.com/AeGean-Studio/pysolr_aio.git
|
056f4e2d4284fc740bcc7862fabab673ea1a439b
|
@@ -747,7 +747,7 @@ class Solr(object):
m = force_unicode(m)
end_time = time.time()
- self.log.debug("Built add request of %s docs in %0.2f seconds.", len(docs), end_time - start_time)
+ self.log.debug("Built add request of %s docs in %0.2f seconds.", len(message), end_time - start_time)
return self._update(m, commit=commit, waitFlush=waitFlush, waitSearcher=waitSearcher)
def delete(self, id=None, q=None, commit=True, waitFlush=None, waitSearcher=None):
|
pysolr.py
|
ReplaceText(target='message' @(750,77)->(750,81))
|
class Solr(object):
m = force_unicode(m)
end_time = time.time()
self.log.debug("Built add request of %s docs in %0.2f seconds.", len(docs), end_time - start_time)
return self._update(m, commit=commit, waitFlush=waitFlush, waitSearcher=waitSearcher)
def delete(self, id=None, q=None, commit=True, waitFlush=None, waitSearcher=None):
|
class Solr(object):
m = force_unicode(m)
end_time = time.time()
self.log.debug("Built add request of %s docs in %0.2f seconds.", len(message), end_time - start_time)
return self._update(m, commit=commit, waitFlush=waitFlush, waitSearcher=waitSearcher)
def delete(self, id=None, q=None, commit=True, waitFlush=None, waitSearcher=None):
|
850 |
https://:@bitbucket.org/nidusfr/grapheekdb.git
|
4f9ca53b0ea54eb7b531290818619a0a2082750f
|
@@ -49,7 +49,7 @@ class Optimizer(object):
def get_kind_ids(self, txn, kind):
ENTITY_COUNTER = METADATA_VERTEX_COUNTER if kind == KIND_VERTEX else METADATA_EDGE_COUNTER
METADATA_ID_LIST_PREFIX = METADATA_VERTEX_ID_LIST_PREFIX if kind == KIND_VERTEX else METADATA_EDGE_ID_LIST_PREFIX
- limit = int(self._graph._get(None, ENTITY_COUNTER)) / CHUNK_SIZE
+ limit = int(self._graph._get(None, ENTITY_COUNTER)) // CHUNK_SIZE
keys = [build_key(METADATA_ID_LIST_PREFIX, i) for i in range(0, limit + 1)]
list_entity_ids = self._graph._bulk_get_lst(txn, keys)
for entity_ids in list_entity_ids:
|
grapheekdb/backends/data/optimizer.py
|
ReplaceText(target='//' @(52,60)->(52,61))
|
class Optimizer(object):
def get_kind_ids(self, txn, kind):
ENTITY_COUNTER = METADATA_VERTEX_COUNTER if kind == KIND_VERTEX else METADATA_EDGE_COUNTER
METADATA_ID_LIST_PREFIX = METADATA_VERTEX_ID_LIST_PREFIX if kind == KIND_VERTEX else METADATA_EDGE_ID_LIST_PREFIX
limit = int(self._graph._get(None, ENTITY_COUNTER)) / CHUNK_SIZE
keys = [build_key(METADATA_ID_LIST_PREFIX, i) for i in range(0, limit + 1)]
list_entity_ids = self._graph._bulk_get_lst(txn, keys)
for entity_ids in list_entity_ids:
|
class Optimizer(object):
def get_kind_ids(self, txn, kind):
ENTITY_COUNTER = METADATA_VERTEX_COUNTER if kind == KIND_VERTEX else METADATA_EDGE_COUNTER
METADATA_ID_LIST_PREFIX = METADATA_VERTEX_ID_LIST_PREFIX if kind == KIND_VERTEX else METADATA_EDGE_ID_LIST_PREFIX
limit = int(self._graph._get(None, ENTITY_COUNTER)) // CHUNK_SIZE
keys = [build_key(METADATA_ID_LIST_PREFIX, i) for i in range(0, limit + 1)]
list_entity_ids = self._graph._bulk_get_lst(txn, keys)
for entity_ids in list_entity_ids:
|
851 |
https://:@github.com/AnonSolutions/django-indy-community.git
|
274dcaf28dd3b433f5205f8bef13063a09047fa7
|
@@ -559,7 +559,7 @@ def send_claims_for_proof_request(wallet, connection, my_conversation, credentia
except:
raise
- return proof_data
+ return my_conversation
######################################################################
|
indy_community_demo/indy_community/agent_utils.py
|
ReplaceText(target='my_conversation' @(562,11)->(562,21))
|
def send_claims_for_proof_request(wallet, connection, my_conversation, credentia
except:
raise
return proof_data
######################################################################
|
def send_claims_for_proof_request(wallet, connection, my_conversation, credentia
except:
raise
return my_conversation
######################################################################
|
852 |
https://:@github.com/AnonSolutions/django-indy-community.git
|
7c1d4634416f608a4886444e51691036e6ba5e70
|
@@ -336,7 +336,7 @@ def check_connection_status(wallet, connection, initialize_vcx=True):
my_connection.status = return_state
my_connection.save()
- check_connection_callback(connection, prev_status)
+ check_connection_callback(my_connection, prev_status)
except:
raise
finally:
|
indy_community_demo/indy_community/agent_utils.py
|
ReplaceText(target='my_connection' @(339,34)->(339,44))
|
def check_connection_status(wallet, connection, initialize_vcx=True):
my_connection.status = return_state
my_connection.save()
check_connection_callback(connection, prev_status)
except:
raise
finally:
|
def check_connection_status(wallet, connection, initialize_vcx=True):
my_connection.status = return_state
my_connection.save()
check_connection_callback(my_connection, prev_status)
except:
raise
finally:
|
853 |
https://:@github.com/jisson/django-simple-domain.git
|
794a491f075a8d43fbc12f18aa6ace33a590bc86
|
@@ -48,7 +48,7 @@ class DjangoSimpleSiteConfig(AppConfig):
if SIMPLE_DOMAIN_ENABLED is True
"""
std_logger.info("Checking if module should be enabled...")
- return simple_site_settings.ENABLED and simple_site_utils.is_item_in_list_a_in_list_b(
+ return simple_site_settings.ENABLED and not simple_site_utils.is_item_in_list_a_in_list_b(
simple_site_settings.DEACTIVATING_COMMANDS, sys.argv
)
|
django_simple_domain/app.py
|
ReplaceText(target='not ' @(51,48)->(51,48))
|
class DjangoSimpleSiteConfig(AppConfig):
if SIMPLE_DOMAIN_ENABLED is True
"""
std_logger.info("Checking if module should be enabled...")
return simple_site_settings.ENABLED and simple_site_utils.is_item_in_list_a_in_list_b(
simple_site_settings.DEACTIVATING_COMMANDS, sys.argv
)
|
class DjangoSimpleSiteConfig(AppConfig):
if SIMPLE_DOMAIN_ENABLED is True
"""
std_logger.info("Checking if module should be enabled...")
return simple_site_settings.ENABLED and not simple_site_utils.is_item_in_list_a_in_list_b(
simple_site_settings.DEACTIVATING_COMMANDS, sys.argv
)
|
854 |
https://:@github.com/pkumza/libradar.git
|
5c3676fd09674f198c20b17d4462e0b6e528bc30
|
@@ -318,7 +318,7 @@ class Tree(object):
# JSON support
utg_lib_obj = dict() # untagged library object
utg_lib_obj["Package"] = node.pn
- utg_lib_obj["Standard Package"] = u
+ utg_lib_obj["Standard Package"] = a
utg_lib_obj["Library"] = "Unknown"
utg_lib_obj["Popularity"] = int(c)
utg_lib_obj["Weight"] = node.weight
|
LibRadar/dex_tree.py
|
ReplaceText(target='a' @(321,42)->(321,43))
|
class Tree(object):
# JSON support
utg_lib_obj = dict() # untagged library object
utg_lib_obj["Package"] = node.pn
utg_lib_obj["Standard Package"] = u
utg_lib_obj["Library"] = "Unknown"
utg_lib_obj["Popularity"] = int(c)
utg_lib_obj["Weight"] = node.weight
|
class Tree(object):
# JSON support
utg_lib_obj = dict() # untagged library object
utg_lib_obj["Package"] = node.pn
utg_lib_obj["Standard Package"] = a
utg_lib_obj["Library"] = "Unknown"
utg_lib_obj["Popularity"] = int(c)
utg_lib_obj["Weight"] = node.weight
|
855 |
https://:@github.com/moremoban/gease.git
|
492b0e368076bf3f48eafce06e4eb960d9188360
|
@@ -83,5 +83,5 @@ def which_org_has(repo):
org_repo = Repo(org_info['repos_url'])
for arepo in org_repo.get_all_repos():
if repo == arepo['name']:
- return arepo['login']
+ return org_info['login']
return None
|
gease/release.py
|
ReplaceText(target='org_info' @(86,23)->(86,28))
|
def which_org_has(repo):
org_repo = Repo(org_info['repos_url'])
for arepo in org_repo.get_all_repos():
if repo == arepo['name']:
return arepo['login']
return None
|
def which_org_has(repo):
org_repo = Repo(org_info['repos_url'])
for arepo in org_repo.get_all_repos():
if repo == arepo['name']:
return org_info['login']
return None
|
856 |
https://:@github.com/eflynch/dspy.git
|
27d706cdf4e25c5750560d957e34319cfd51e145
|
@@ -21,7 +21,7 @@ def rechannel(buf, in_channels, out_channels):
in_channel = (in_channel + 1) % in_channels
elif out_channels > in_channels:
out_channel = 0
- for in_channel in range(out_channels):
+ for in_channel in range(in_channels):
output[out_channel::out_channels] += buf[in_channel::in_channels]
out_channel = (out_channel + 1) % out_channels
|
dspy/lib.py
|
ReplaceText(target='in_channels' @(24,32)->(24,44))
|
def rechannel(buf, in_channels, out_channels):
in_channel = (in_channel + 1) % in_channels
elif out_channels > in_channels:
out_channel = 0
for in_channel in range(out_channels):
output[out_channel::out_channels] += buf[in_channel::in_channels]
out_channel = (out_channel + 1) % out_channels
|
def rechannel(buf, in_channels, out_channels):
in_channel = (in_channel + 1) % in_channels
elif out_channels > in_channels:
out_channel = 0
for in_channel in range(in_channels):
output[out_channel::out_channels] += buf[in_channel::in_channels]
out_channel = (out_channel + 1) % out_channels
|
857 |
https://:@gitlab.com/AmosEgel/smuthi.git
|
3de13ee6ce0382c2657d94d62dab15c6bc0dca0f
|
@@ -168,7 +168,7 @@ class PiecewiseFieldExpansion(FieldExpansion):
else:
pfe_sum.expansion_list.append(fex)
if not added:
- pfe_sum.expansion_list.append(fex)
+ pfe_sum.expansion_list.append(other)
return pfe_sum
|
smuthi/field_expansion.py
|
ReplaceText(target='other' @(171,46)->(171,49))
|
class PiecewiseFieldExpansion(FieldExpansion):
else:
pfe_sum.expansion_list.append(fex)
if not added:
pfe_sum.expansion_list.append(fex)
return pfe_sum
|
class PiecewiseFieldExpansion(FieldExpansion):
else:
pfe_sum.expansion_list.append(fex)
if not added:
pfe_sum.expansion_list.append(other)
return pfe_sum
|
858 |
https://:@github.com/inkeye/cyscore.git
|
f7b659afcfa4dce73a8915e8fccd916a68248d83
|
@@ -40,4 +40,4 @@ class Score:
"--nodisplays",
orcname,
sconame])
- return fname
+ return outname
|
cyscore/score.py
|
ReplaceText(target='outname' @(43,15)->(43,20))
|
class Score:
"--nodisplays",
orcname,
sconame])
return fname
|
class Score:
"--nodisplays",
orcname,
sconame])
return outname
|
859 |
https://:@github.com/DMSC-Instrument-Data/lewis.git
|
b2797261ac0f3ab9f02dc67f28db1620732d3f0b
|
@@ -101,7 +101,7 @@ class TestAdapterCollection(unittest.TestCase):
collection.device = 'foo'
self.assertEqual(mock_adapter1.device, 'foo')
- self.assertEqual(mock_adapter1.device, 'foo')
+ self.assertEqual(mock_adapter2.device, 'foo')
mock_adapter3 = MagicMock()
mock_adapter3.device = 'other'
|
test/test_core_adapters.py
|
ReplaceText(target='mock_adapter2' @(104,25)->(104,38))
|
class TestAdapterCollection(unittest.TestCase):
collection.device = 'foo'
self.assertEqual(mock_adapter1.device, 'foo')
self.assertEqual(mock_adapter1.device, 'foo')
mock_adapter3 = MagicMock()
mock_adapter3.device = 'other'
|
class TestAdapterCollection(unittest.TestCase):
collection.device = 'foo'
self.assertEqual(mock_adapter1.device, 'foo')
self.assertEqual(mock_adapter2.device, 'foo')
mock_adapter3 = MagicMock()
mock_adapter3.device = 'other'
|
860 |
https://:@github.com/DMSC-Instrument-Data/lewis.git
|
50911fba54fc6f9b4099191c7c81f52f66a6ba47
|
@@ -82,7 +82,7 @@ class ExposedObject(object):
exposed_members = members if members else self._public_members()
exclude = list(exclude or [])
- if not exclude_inherited:
+ if exclude_inherited:
for base in inspect.getmro(type(obj))[1:]:
exclude += dir(base)
|
lewis/core/control_server.py
|
ReplaceText(target='' @(85,11)->(85,15))
|
class ExposedObject(object):
exposed_members = members if members else self._public_members()
exclude = list(exclude or [])
if not exclude_inherited:
for base in inspect.getmro(type(obj))[1:]:
exclude += dir(base)
|
class ExposedObject(object):
exposed_members = members if members else self._public_members()
exclude = list(exclude or [])
if exclude_inherited:
for base in inspect.getmro(type(obj))[1:]:
exclude += dir(base)
|
861 |
https://:@github.com/fafhrd91/player.git
|
8bffaa237459e1d9a79c8ba6cd01a482f72ce2f8
|
@@ -41,7 +41,7 @@ def add_layer(cfg, layer, name='', path='', description=''):
layers.insert(0, intr)
cfg.action(discr, introspectables=(intr,))
- log.info("Add layer: %s path:%s"%(layer, directory))
+ log.info("Add layer: %s path:%s"%(layer, path))
def add_layers(cfg, name='', path='', description=''):
|
player/layer.py
|
ReplaceText(target='path' @(44,45)->(44,54))
|
def add_layer(cfg, layer, name='', path='', description=''):
layers.insert(0, intr)
cfg.action(discr, introspectables=(intr,))
log.info("Add layer: %s path:%s"%(layer, directory))
def add_layers(cfg, name='', path='', description=''):
|
def add_layer(cfg, layer, name='', path='', description=''):
layers.insert(0, intr)
cfg.action(discr, introspectables=(intr,))
log.info("Add layer: %s path:%s"%(layer, path))
def add_layers(cfg, name='', path='', description=''):
|
862 |
https://:@github.com/clumsyme/ziroom_watcher.git
|
91498a31498833d88401888b7cfc7c32cffb7464
|
@@ -58,7 +58,7 @@ class Watcher:
self.info_url, headers=self.headers)
info = json.loads(response.text)
status = info['data']['status']
- if status == 'tzpzz':
+ if status != 'tzpzz':
self.sendmail('房源状态已更新', '状态更新了')
else:
raise NotDoneError(status)
|
ziroom_watcher.py
|
ReplaceText(target='!=' @(61,18)->(61,20))
|
class Watcher:
self.info_url, headers=self.headers)
info = json.loads(response.text)
status = info['data']['status']
if status == 'tzpzz':
self.sendmail('房源状态已更新', '状态更新了')
else:
raise NotDoneError(status)
|
class Watcher:
self.info_url, headers=self.headers)
info = json.loads(response.text)
status = info['data']['status']
if status != 'tzpzz':
self.sendmail('房源状态已更新', '状态更新了')
else:
raise NotDoneError(status)
|
863 |
https://:@github.com/kovpas/itc.cli.git
|
ed0f4e9946469673f2d75ca713ade2b69ac19c25
|
@@ -244,7 +244,7 @@ class ITCServerParser(BaseParser):
for ratingTr in appRatingTable:
inputs = ratingTr.xpath('.//input')
- if len(inputs) != 2:
+ if len(inputs) < 2:
continue
appRating = {'name': inputs[0].attrib['name'], 'ratings': []}
for inpt in inputs:
|
itc/parsers/serverparser.py
|
ReplaceText(target='<' @(247,27)->(247,29))
|
class ITCServerParser(BaseParser):
for ratingTr in appRatingTable:
inputs = ratingTr.xpath('.//input')
if len(inputs) != 2:
continue
appRating = {'name': inputs[0].attrib['name'], 'ratings': []}
for inpt in inputs:
|
class ITCServerParser(BaseParser):
for ratingTr in appRatingTable:
inputs = ratingTr.xpath('.//input')
if len(inputs) < 2:
continue
appRating = {'name': inputs[0].attrib['name'], 'ratings': []}
for inpt in inputs:
|
864 |
https://:@github.com/seebye/media-layer.git
|
e906f0a4648683f27aa99a5a549020064052edd5
|
@@ -170,7 +170,7 @@ class ForcedCoverImageScaler(DistortImageScaler, OffsetImageScaler):
width: int, height: int):
width, height = self.calculate_resolution(image, width, height)
image_width, image_height = image.width, image.height
- if image_width < image_height:
+ if image_width > image_height:
image_height = int(image_height * width / image_width)
image_width = width
else:
|
ueberzug/scaling.py
|
ReplaceText(target='>' @(173,23)->(173,24))
|
class ForcedCoverImageScaler(DistortImageScaler, OffsetImageScaler):
width: int, height: int):
width, height = self.calculate_resolution(image, width, height)
image_width, image_height = image.width, image.height
if image_width < image_height:
image_height = int(image_height * width / image_width)
image_width = width
else:
|
class ForcedCoverImageScaler(DistortImageScaler, OffsetImageScaler):
width: int, height: int):
width, height = self.calculate_resolution(image, width, height)
image_width, image_height = image.width, image.height
if image_width > image_height:
image_height = int(image_height * width / image_width)
image_width = width
else:
|
865 |
https://:@github.com/lvapeab/multimodal_keras_wrapper.git
|
965b970084e59e945036df9cc7cd836d052cb279
|
@@ -1286,7 +1286,7 @@ class Dataset(object):
elif(type_out == 'binary'):
y = np.array(y).astype(np.uint8)
elif(type_out == 'text'):
- y = self.loadText(y, self.vocabulary[id_out], self.max_text_len[id_out], self.text_offset[id_in])
+ y = self.loadText(y, self.vocabulary[id_out], self.max_text_len[id_out], self.text_offset[id_out])
#if max_len == 0:
y_aux = np.zeros(list(y.shape)+[self.n_classes_text[id_out]]).astype(np.uint8)
for idx in range(y.shape[0]):
|
keras_wrapper/dataset.py
|
ReplaceText(target='id_out' @(1289,110)->(1289,115))
|
class Dataset(object):
elif(type_out == 'binary'):
y = np.array(y).astype(np.uint8)
elif(type_out == 'text'):
y = self.loadText(y, self.vocabulary[id_out], self.max_text_len[id_out], self.text_offset[id_in])
#if max_len == 0:
y_aux = np.zeros(list(y.shape)+[self.n_classes_text[id_out]]).astype(np.uint8)
for idx in range(y.shape[0]):
|
class Dataset(object):
elif(type_out == 'binary'):
y = np.array(y).astype(np.uint8)
elif(type_out == 'text'):
y = self.loadText(y, self.vocabulary[id_out], self.max_text_len[id_out], self.text_offset[id_out])
#if max_len == 0:
y_aux = np.zeros(list(y.shape)+[self.n_classes_text[id_out]]).astype(np.uint8)
for idx in range(y.shape[0]):
|
866 |
https://:@github.com/mic159/komodo.git
|
9b5fcd652ace81e3ee53bedec1eadc1189b08efc
|
@@ -94,7 +94,7 @@ class Server(object):
scheduler = Scheduler()
if not self.without_checks:
for name, server in servers.items():
- scheduler.register(name, server)
+ scheduler.register(server, name)
checks_thread = threading.Thread(target=self.start_checks, args=(scheduler, self.thread_stopper, ))
checks_thread.daemon = True
|
python_dashing/server/server.py
|
ArgSwap(idxs=0<->1 @(97,20)->(97,38))
|
class Server(object):
scheduler = Scheduler()
if not self.without_checks:
for name, server in servers.items():
scheduler.register(name, server)
checks_thread = threading.Thread(target=self.start_checks, args=(scheduler, self.thread_stopper, ))
checks_thread.daemon = True
|
class Server(object):
scheduler = Scheduler()
if not self.without_checks:
for name, server in servers.items():
scheduler.register(server, name)
checks_thread = threading.Thread(target=self.start_checks, args=(scheduler, self.thread_stopper, ))
checks_thread.daemon = True
|
867 |
https://:@github.com/mic159/komodo.git
|
10d4ba791b59d5873a561d58ee8a096ad104a581
|
@@ -32,7 +32,7 @@ class JsonDataStore(object):
def save(self):
with open(self.location, 'wb') as fle:
- return json.dump(fle, self.data)
+ return json.dump(self.data, fle)
def set(self, prefix, key, value):
self.data[prefix][key] = value
|
dashmat/datastore.py
|
ArgSwap(idxs=0<->1 @(35,19)->(35,28))
|
class JsonDataStore(object):
def save(self):
with open(self.location, 'wb') as fle:
return json.dump(fle, self.data)
def set(self, prefix, key, value):
self.data[prefix][key] = value
|
class JsonDataStore(object):
def save(self):
with open(self.location, 'wb') as fle:
return json.dump(self.data, fle)
def set(self, prefix, key, value):
self.data[prefix][key] = value
|
868 |
https://:@github.com/krvss/graph-talk.git
|
f91b24ea9c154f6659faecc806f562ef1ee448e3
|
@@ -103,6 +103,6 @@ def get_callable(c):
def tuples(*args):
res = ()
for arg in args:
- res += tuple(arg) if is_list(args) else (arg, )
+ res += tuple(arg) if is_list(arg) else (arg, )
return res
|
utils.py
|
ReplaceText(target='arg' @(106,37)->(106,41))
|
def get_callable(c):
def tuples(*args):
res = ()
for arg in args:
res += tuple(arg) if is_list(args) else (arg, )
return res
|
def get_callable(c):
def tuples(*args):
res = ()
for arg in args:
res += tuple(arg) if is_list(arg) else (arg, )
return res
|
869 |
https://:@github.com/reichlab/zoltpy.git
|
8653aa031af8e1dfd2a33e63eb25b642ab719acd
|
@@ -70,7 +70,7 @@ def upload_forecast(project_name, model_name, timezero_date, forecast_csv_file):
print('* working with', model)
# upload a new forecast
- upload_file_job = model.upload_forecast(timezero_date, forecast_csv_file)
+ upload_file_job = model.upload_forecast(forecast_csv_file, timezero_date)
busy_poll_upload_file_job(upload_file_job)
# get the new forecast from the upload_file_job by parsing the generic 'output_json' field
|
zoltpy/functions.py
|
ArgSwap(idxs=0<->1 @(73,22)->(73,43))
|
def upload_forecast(project_name, model_name, timezero_date, forecast_csv_file):
print('* working with', model)
# upload a new forecast
upload_file_job = model.upload_forecast(timezero_date, forecast_csv_file)
busy_poll_upload_file_job(upload_file_job)
# get the new forecast from the upload_file_job by parsing the generic 'output_json' field
|
def upload_forecast(project_name, model_name, timezero_date, forecast_csv_file):
print('* working with', model)
# upload a new forecast
upload_file_job = model.upload_forecast(forecast_csv_file, timezero_date)
busy_poll_upload_file_job(upload_file_job)
# get the new forecast from the upload_file_job by parsing the generic 'output_json' field
|
870 |
https://:@github.com/awbirdsall/popmodel.git
|
918e2083f541a4c85145fea3f007ed646bc60d19
|
@@ -34,7 +34,7 @@ def k_solved(hpar, par):
def k_sweep(hpar, par):
par_sweep = deepcopy(par)
par_sweep['sweep']['dosweep'] = True
- k_sweep = pm.KineticsRun(hpar, **par)
+ k_sweep = pm.KineticsRun(hpar, **par_sweep)
k_sweep.solveode()
return k_sweep
|
tests/test_main.py
|
ReplaceText(target='par_sweep' @(37,37)->(37,40))
|
def k_solved(hpar, par):
def k_sweep(hpar, par):
par_sweep = deepcopy(par)
par_sweep['sweep']['dosweep'] = True
k_sweep = pm.KineticsRun(hpar, **par)
k_sweep.solveode()
return k_sweep
|
def k_solved(hpar, par):
def k_sweep(hpar, par):
par_sweep = deepcopy(par)
par_sweep['sweep']['dosweep'] = True
k_sweep = pm.KineticsRun(hpar, **par_sweep)
k_sweep.solveode()
return k_sweep
|
871 |
https://:@github.com/jezeniel/jellyfish-wheel.git
|
22e790ad922b0122ad40293d594d32e2819d6387
|
@@ -422,7 +422,7 @@ def metaphone(s):
elif next == 'h' and nextnext and nextnext not in 'aeiou':
i += 1
elif c == 'h':
- if i == 0 or next in 'aeiou' or s[i-1] in 'aeiou':
+ if i == 0 or next in 'aeiou' or s[i-1] not in 'aeiou':
result.append('h')
elif c == 'k':
if i == 0 or s[i-1] != 'c':
|
jellyfish/_jellyfish.py
|
ReplaceText(target=' not in ' @(425,50)->(425,54))
|
def metaphone(s):
elif next == 'h' and nextnext and nextnext not in 'aeiou':
i += 1
elif c == 'h':
if i == 0 or next in 'aeiou' or s[i-1] in 'aeiou':
result.append('h')
elif c == 'k':
if i == 0 or s[i-1] != 'c':
|
def metaphone(s):
elif next == 'h' and nextnext and nextnext not in 'aeiou':
i += 1
elif c == 'h':
if i == 0 or next in 'aeiou' or s[i-1] not in 'aeiou':
result.append('h')
elif c == 'k':
if i == 0 or s[i-1] != 'c':
|
872 |
https://:@github.com/tourbillonpy/tourbillon-log.git
|
cee5b1f59349b7b95b7d9c406b36eab609ef386e
|
@@ -27,7 +27,7 @@ def get_logfile_metrics(agent):
db_config['duration'],
db_config['replication'],
db_config['name'])
- logger.info('database "%s" created successfully', config['name'])
+ logger.info('database "%s" created successfully', db_config['name'])
except:
pass
|
tourbillon/log/log.py
|
ReplaceText(target='db_config' @(30,58)->(30,64))
|
def get_logfile_metrics(agent):
db_config['duration'],
db_config['replication'],
db_config['name'])
logger.info('database "%s" created successfully', config['name'])
except:
pass
|
def get_logfile_metrics(agent):
db_config['duration'],
db_config['replication'],
db_config['name'])
logger.info('database "%s" created successfully', db_config['name'])
except:
pass
|
873 |
https://:@github.com/OriHoch/ckanext-upload_via_email.git
|
9f12f3b51b7a1ac8db665a673f8cca571a840529
|
@@ -33,7 +33,7 @@ def get_sender_organization_id(from_email, to_email, allowed_senders, config):
default_sender_organization_id = config.get('default_sender_organization_id')
if default_sender_to_address and default_sender_organization_id:
default_sender_to_address = default_sender_to_address.lower().strip()
- if is_email_match(from_email, default_sender_to_address):
+ if is_email_match(to_email, default_sender_to_address):
return default_sender_organization_id
return None
|
ckanext/upload_via_email/pipelines/download_messages.py
|
ReplaceText(target='to_email' @(36,30)->(36,40))
|
def get_sender_organization_id(from_email, to_email, allowed_senders, config):
default_sender_organization_id = config.get('default_sender_organization_id')
if default_sender_to_address and default_sender_organization_id:
default_sender_to_address = default_sender_to_address.lower().strip()
if is_email_match(from_email, default_sender_to_address):
return default_sender_organization_id
return None
|
def get_sender_organization_id(from_email, to_email, allowed_senders, config):
default_sender_organization_id = config.get('default_sender_organization_id')
if default_sender_to_address and default_sender_organization_id:
default_sender_to_address = default_sender_to_address.lower().strip()
if is_email_match(to_email, default_sender_to_address):
return default_sender_organization_id
return None
|
874 |
https://:@github.com/portfors-lab/sparkle.git
|
5be995abef4100cdce6e2feb5cee977476140a84
|
@@ -62,7 +62,7 @@ class ProtocolRunner(ListAcquisitionRunner):
self.avg_buffer[irep,:] = response
if irep == self.nreps -1:
avg_response = self.avg_buffer.mean(axis=0)
- self.datafile.append(self.current_dataset_name, response)
+ self.datafile.append(self.current_dataset_name, avg_response)
self.avg_buffer = np.zeros_like(self.avg_buffer)
else:
self.datafile.append(self.current_dataset_name, response)
|
sparkle/run/protocol_runner.py
|
ReplaceText(target='avg_response' @(65,68)->(65,76))
|
class ProtocolRunner(ListAcquisitionRunner):
self.avg_buffer[irep,:] = response
if irep == self.nreps -1:
avg_response = self.avg_buffer.mean(axis=0)
self.datafile.append(self.current_dataset_name, response)
self.avg_buffer = np.zeros_like(self.avg_buffer)
else:
self.datafile.append(self.current_dataset_name, response)
|
class ProtocolRunner(ListAcquisitionRunner):
self.avg_buffer[irep,:] = response
if irep == self.nreps -1:
avg_response = self.avg_buffer.mean(axis=0)
self.datafile.append(self.current_dataset_name, avg_response)
self.avg_buffer = np.zeros_like(self.avg_buffer)
else:
self.datafile.append(self.current_dataset_name, response)
|
875 |
https://:@github.com/a1ezzz/wasp-general.git
|
5795c4cb45c70e120a94c0dd3598762505131b29
|
@@ -59,7 +59,7 @@ def test_abstract():
pytest.raises(NotImplementedError, WSignalSourceProto.remove_callback, None, 'signal', C())
pytest.raises(TypeError, WSignalCallbackProto)
- pytest.raises(NotImplementedError, WSignalCallbackProto.__call__, None, 'signal', S(), 1)
+ pytest.raises(NotImplementedError, WSignalCallbackProto.__call__, None, S(), 'signal', 1)
pytest.raises(TypeError, WSignalProxyProto.ProxiedMessageProto)
pytest.raises(NotImplementedError, WSignalProxyProto.ProxiedMessageProto.is_weak, None)
|
tests/wasp_general_signals_proto_test.py
|
ArgSwap(idxs=3<->4 @(62,1)->(62,14))
|
def test_abstract():
pytest.raises(NotImplementedError, WSignalSourceProto.remove_callback, None, 'signal', C())
pytest.raises(TypeError, WSignalCallbackProto)
pytest.raises(NotImplementedError, WSignalCallbackProto.__call__, None, 'signal', S(), 1)
pytest.raises(TypeError, WSignalProxyProto.ProxiedMessageProto)
pytest.raises(NotImplementedError, WSignalProxyProto.ProxiedMessageProto.is_weak, None)
|
def test_abstract():
pytest.raises(NotImplementedError, WSignalSourceProto.remove_callback, None, 'signal', C())
pytest.raises(TypeError, WSignalCallbackProto)
pytest.raises(NotImplementedError, WSignalCallbackProto.__call__, None, S(), 'signal', 1)
pytest.raises(TypeError, WSignalProxyProto.ProxiedMessageProto)
pytest.raises(NotImplementedError, WSignalProxyProto.ProxiedMessageProto.is_weak, None)
|
876 |
https://:@github.com/drasmuss/hessianfree.git
|
883099364fb68ec67b538fffa804a3783d23ad02
|
@@ -80,7 +80,7 @@ class CrossEntropy(LossFunction):
class ClassificationError(LossFunction):
@output_loss
def loss(self, output, targets):
- return (np.argmax(output, axis=-1) ==
+ return (np.argmax(output, axis=-1) !=
np.argmax(np.nan_to_num(targets), axis=-1))
# note: not defining d_loss or d2_loss; classification error should only
|
hessianfree/loss_funcs.py
|
ReplaceText(target='!=' @(83,43)->(83,45))
|
class CrossEntropy(LossFunction):
class ClassificationError(LossFunction):
@output_loss
def loss(self, output, targets):
return (np.argmax(output, axis=-1) ==
np.argmax(np.nan_to_num(targets), axis=-1))
# note: not defining d_loss or d2_loss; classification error should only
|
class CrossEntropy(LossFunction):
class ClassificationError(LossFunction):
@output_loss
def loss(self, output, targets):
return (np.argmax(output, axis=-1) !=
np.argmax(np.nan_to_num(targets), axis=-1))
# note: not defining d_loss or d2_loss; classification error should only
|
877 |
https://:@github.com/GalakVince/dermoscopic_symmetry.git
|
cbad346417689f3a698035f0393fef710ae6dedd
|
@@ -338,7 +338,7 @@ def classifierTrainer(maxLeafNodes, data=None, data_backup_file='patchesDataSet/
clf: The fitted classifier.
acc: The accuracy score of the classifier
"""
- if data is not None:
+ if data is None:
data = pd.read_csv(f"{package_path()}/data/patchesDataSet/{data_backup_file}.csv", index_col=False)
features = list(data)
del features[0]
|
dermoscopic_symmetry/classifier_feeder.py
|
ReplaceText(target=' is ' @(341,11)->(341,19))
|
def classifierTrainer(maxLeafNodes, data=None, data_backup_file='patchesDataSet/
clf: The fitted classifier.
acc: The accuracy score of the classifier
"""
if data is not None:
data = pd.read_csv(f"{package_path()}/data/patchesDataSet/{data_backup_file}.csv", index_col=False)
features = list(data)
del features[0]
|
def classifierTrainer(maxLeafNodes, data=None, data_backup_file='patchesDataSet/
clf: The fitted classifier.
acc: The accuracy score of the classifier
"""
if data is None:
data = pd.read_csv(f"{package_path()}/data/patchesDataSet/{data_backup_file}.csv", index_col=False)
features = list(data)
del features[0]
|
878 |
https://:@github.com/interputed/grapi.git
|
8174ec31bc0572ec562f147a2becc65498774d56
|
@@ -47,7 +47,7 @@ class Grapi:
keys = kwargs.keys()
endpoints.check(keys, self._endpoint)
- if date_step:
+ if not date_step:
return self._methods(method.lower())(**kwargs)
else:
|
grapi/grapi.py
|
ReplaceText(target='not ' @(50,11)->(50,11))
|
class Grapi:
keys = kwargs.keys()
endpoints.check(keys, self._endpoint)
if date_step:
return self._methods(method.lower())(**kwargs)
else:
|
class Grapi:
keys = kwargs.keys()
endpoints.check(keys, self._endpoint)
if not date_step:
return self._methods(method.lower())(**kwargs)
else:
|
879 |
https://:@github.com/chen0040/pycompressor.git
|
273f7e1592566e82b62afa250d29c08b0bbcacdd
|
@@ -19,7 +19,7 @@ class Node(object):
def char_at(text, i):
- if len(text) - 1 <= i:
+ if len(text) - 1 < i:
return -1
return ord(text[i])
|
pycompressor/huffman.py
|
ReplaceText(target='<' @(22,21)->(22,23))
|
class Node(object):
def char_at(text, i):
if len(text) - 1 <= i:
return -1
return ord(text[i])
|
class Node(object):
def char_at(text, i):
if len(text) - 1 < i:
return -1
return ord(text[i])
|
880 |
https://:@github.com/scattering-central/saxskit.git
|
e696feaed288160cf35a34d4f43de44e4af4b90f
|
@@ -114,7 +114,7 @@ def train_classification_models(data,hyper_parameters_search=False):
print('--> average unweighted f1: {}, accuracy: {}'.format(f1_score,acc))
else:
print('--> {} untrainable- default value: {}'.format(model_id,model.default_val))
- cls_models['main_classifiers'][struct_nm] = model
+ cls_models['main_classifiers'][model_id] = model
# There are 2**n possible outcomes for n binary classifiers.
# For the (2**n)-1 non-null outcomes, a second classifier is used,
|
xrsdkit/models/train.py
|
ReplaceText(target='model_id' @(117,39)->(117,48))
|
def train_classification_models(data,hyper_parameters_search=False):
print('--> average unweighted f1: {}, accuracy: {}'.format(f1_score,acc))
else:
print('--> {} untrainable- default value: {}'.format(model_id,model.default_val))
cls_models['main_classifiers'][struct_nm] = model
# There are 2**n possible outcomes for n binary classifiers.
# For the (2**n)-1 non-null outcomes, a second classifier is used,
|
def train_classification_models(data,hyper_parameters_search=False):
print('--> average unweighted f1: {}, accuracy: {}'.format(f1_score,acc))
else:
print('--> {} untrainable- default value: {}'.format(model_id,model.default_val))
cls_models['main_classifiers'][model_id] = model
# There are 2**n possible outcomes for n binary classifiers.
# For the (2**n)-1 non-null outcomes, a second classifier is used,
|
881 |
https://:@github.com/scattering-central/saxskit.git
|
4e384359736c5191648f3a5971ccc7d34fb98b27
|
@@ -413,7 +413,7 @@ class XRSDFitGUI(object):
# TODO: toggles for hyperparam selection? feature selection?
dataset_dir = self._vars['io_control']['dataset_dir'].get()
output_dir = self._vars['io_control']['output_dir'].get()
- model_config_path = os.path.join(dataset_dir,'model_config.yml')
+ model_config_path = os.path.join(output_dir,'model_config.yml')
self._print_to_listbox(display,'LOADING DATASET FROM: {}'.format(dataset_dir))
df, idx_df = read_local_dataset(dataset_dir,downsampling_distance=1.,
message_callback=partial(self._print_to_listbox,display))
|
xrsdkit/visualization/gui.py
|
ReplaceText(target='output_dir' @(416,41)->(416,52))
|
class XRSDFitGUI(object):
# TODO: toggles for hyperparam selection? feature selection?
dataset_dir = self._vars['io_control']['dataset_dir'].get()
output_dir = self._vars['io_control']['output_dir'].get()
model_config_path = os.path.join(dataset_dir,'model_config.yml')
self._print_to_listbox(display,'LOADING DATASET FROM: {}'.format(dataset_dir))
df, idx_df = read_local_dataset(dataset_dir,downsampling_distance=1.,
message_callback=partial(self._print_to_listbox,display))
|
class XRSDFitGUI(object):
# TODO: toggles for hyperparam selection? feature selection?
dataset_dir = self._vars['io_control']['dataset_dir'].get()
output_dir = self._vars['io_control']['output_dir'].get()
model_config_path = os.path.join(output_dir,'model_config.yml')
self._print_to_listbox(display,'LOADING DATASET FROM: {}'.format(dataset_dir))
df, idx_df = read_local_dataset(dataset_dir,downsampling_distance=1.,
message_callback=partial(self._print_to_listbox,display))
|
882 |
https://:@github.com/rohinkumar/correlcalc.git
|
9a13668ff7ef2396ce22175d3f21599af7279766
|
@@ -18,7 +18,7 @@ def generate_rand_from_pdf(pdf, x_grid, N):
cdf = cdf / cdf[-1]
values = np.random.rand(N)
value_bins = np.searchsorted(cdf, values)
- random_from_cdf, nz = x_grid[value_bins], cdf[value_bins]
+ random_from_cdf, nz = x_grid[value_bins], pdf[value_bins]
return random_from_cdf, nz
|
correlcalc/genrand.py
|
ReplaceText(target='pdf' @(21,46)->(21,49))
|
def generate_rand_from_pdf(pdf, x_grid, N):
cdf = cdf / cdf[-1]
values = np.random.rand(N)
value_bins = np.searchsorted(cdf, values)
random_from_cdf, nz = x_grid[value_bins], cdf[value_bins]
return random_from_cdf, nz
|
def generate_rand_from_pdf(pdf, x_grid, N):
cdf = cdf / cdf[-1]
values = np.random.rand(N)
value_bins = np.searchsorted(cdf, values)
random_from_cdf, nz = x_grid[value_bins], pdf[value_bins]
return random_from_cdf, nz
|
883 |
https://:@github.com/deepfield/builder.git
|
4410007757b043e278d5a9a8deec2ae7cd5da2b6
|
@@ -489,7 +489,7 @@ class Job(object):
str_targets = collections.defaultdict(list)
for target_type, targets in targets_dict.iteritems():
for target in targets:
- str_dependencies[target_type].append(target.unexpanded_id)
+ str_targets[target_type].append(target.unexpanded_id)
this_dict = {"depends": str_dependencies, "targets": str_targets}
|
jobs.py
|
ReplaceText(target='str_targets' @(492,16)->(492,32))
|
class Job(object):
str_targets = collections.defaultdict(list)
for target_type, targets in targets_dict.iteritems():
for target in targets:
str_dependencies[target_type].append(target.unexpanded_id)
this_dict = {"depends": str_dependencies, "targets": str_targets}
|
class Job(object):
str_targets = collections.defaultdict(list)
for target_type, targets in targets_dict.iteritems():
for target in targets:
str_targets[target_type].append(target.unexpanded_id)
this_dict = {"depends": str_dependencies, "targets": str_targets}
|
884 |
https://:@github.com/allonkleinlab/scrublet.git
|
afe329d90fa0bddadccf9e707112f835fe83e46e
|
@@ -66,7 +66,7 @@ def sparse_zscore(E, gene_mean=None, gene_stdev=None):
''' z-score normalize each column of E '''
if gene_mean is None:
- gene_stdev = E.mean(0)
+ gene_mean = E.mean(0)
if gene_stdev is None:
gene_stdev = np.sqrt(sparse_var(E))
return sparse_multiply((E - gene_mean).T, 1/gene_stdev).T
|
src/scrublet/helper_functions.py
|
ReplaceText(target='gene_mean' @(69,8)->(69,18))
|
def sparse_zscore(E, gene_mean=None, gene_stdev=None):
''' z-score normalize each column of E '''
if gene_mean is None:
gene_stdev = E.mean(0)
if gene_stdev is None:
gene_stdev = np.sqrt(sparse_var(E))
return sparse_multiply((E - gene_mean).T, 1/gene_stdev).T
|
def sparse_zscore(E, gene_mean=None, gene_stdev=None):
''' z-score normalize each column of E '''
if gene_mean is None:
gene_mean = E.mean(0)
if gene_stdev is None:
gene_stdev = np.sqrt(sparse_var(E))
return sparse_multiply((E - gene_mean).T, 1/gene_stdev).T
|
885 |
https://:@github.com/SheldonYS/Zappa.git
|
513bfe44f24cee37e8dc720f3a55c8f8d0c73163
|
@@ -1053,7 +1053,7 @@ class Zappa(object):
if count:
# We can end up in a situation where we have more resources being created
# than anticipated.
- if (count - current_resources) >= 0:
+ if (count - current_resources) > 0:
progress.update(count - current_resources)
current_resources = count
progress.close()
|
zappa/zappa.py
|
ReplaceText(target='>' @(1056,51)->(1056,53))
|
class Zappa(object):
if count:
# We can end up in a situation where we have more resources being created
# than anticipated.
if (count - current_resources) >= 0:
progress.update(count - current_resources)
current_resources = count
progress.close()
|
class Zappa(object):
if count:
# We can end up in a situation where we have more resources being created
# than anticipated.
if (count - current_resources) > 0:
progress.update(count - current_resources)
current_resources = count
progress.close()
|
886 |
https://:@github.com/moser/pylint.git
|
4d29d8e4559938bef1eb52b1613d2596aeba395b
|
@@ -174,7 +174,7 @@ class ClassDiagram(Figure, FilterMixIn):
value = value._proxied
try:
ass_obj = self.object_from_node(value)
- self.add_relationship(obj, ass_obj, 'association', name)
+ self.add_relationship(ass_obj, obj, 'association', name)
except KeyError:
continue
|
pyreverse/diagrams.py
|
ArgSwap(idxs=0<->1 @(177,24)->(177,45))
|
class ClassDiagram(Figure, FilterMixIn):
value = value._proxied
try:
ass_obj = self.object_from_node(value)
self.add_relationship(obj, ass_obj, 'association', name)
except KeyError:
continue
|
class ClassDiagram(Figure, FilterMixIn):
value = value._proxied
try:
ass_obj = self.object_from_node(value)
self.add_relationship(ass_obj, obj, 'association', name)
except KeyError:
continue
|
887 |
https://:@github.com/moser/pylint.git
|
2ac99b2a24d44a3b56c035a889f6bd78f4f41b7f
|
@@ -242,7 +242,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
if node.name.startswith('cb_') or \
node.name.endswith('_cb'):
continue
- self.add_message('W0613', args=name, node=node)
+ self.add_message('W0613', args=name, node=stmt)
else:
self.add_message('W0612', args=name, node=stmt)
|
checkers/variables.py
|
ReplaceText(target='stmt' @(245,58)->(245,62))
|
builtins. Remember that you should avoid to define new builtins when possible.'
if node.name.startswith('cb_') or \
node.name.endswith('_cb'):
continue
self.add_message('W0613', args=name, node=node)
else:
self.add_message('W0612', args=name, node=stmt)
|
builtins. Remember that you should avoid to define new builtins when possible.'
if node.name.startswith('cb_') or \
node.name.endswith('_cb'):
continue
self.add_message('W0613', args=name, node=stmt)
else:
self.add_message('W0612', args=name, node=stmt)
|
888 |
https://:@github.com/moser/pylint.git
|
dbb2f3e65b9a452cf981e1bda318ec019b43bd8c
|
@@ -714,7 +714,7 @@ class BasicErrorChecker(_BasicChecker):
if defined_self is not node and not astroid.are_exclusive(node, defined_self):
dummy_variables_rgx = lint_utils.get_global_option(
self, 'dummy-variables-rgx', default=None)
- if dummy_variables_rgx and dummy_variables_rgx.match(defined_self.name):
+ if dummy_variables_rgx and dummy_variables_rgx.match(node.name):
return
self.add_message('function-redefined', node=node,
args=(redeftype, defined_self.fromlineno))
|
pylint/checkers/base.py
|
ReplaceText(target='node' @(717,65)->(717,77))
|
class BasicErrorChecker(_BasicChecker):
if defined_self is not node and not astroid.are_exclusive(node, defined_self):
dummy_variables_rgx = lint_utils.get_global_option(
self, 'dummy-variables-rgx', default=None)
if dummy_variables_rgx and dummy_variables_rgx.match(defined_self.name):
return
self.add_message('function-redefined', node=node,
args=(redeftype, defined_self.fromlineno))
|
class BasicErrorChecker(_BasicChecker):
if defined_self is not node and not astroid.are_exclusive(node, defined_self):
dummy_variables_rgx = lint_utils.get_global_option(
self, 'dummy-variables-rgx', default=None)
if dummy_variables_rgx and dummy_variables_rgx.match(node.name):
return
self.add_message('function-redefined', node=node,
args=(redeftype, defined_self.fromlineno))
|
889 |
https://:@github.com/moser/pylint.git
|
02688062140cc7ffa9c4f1a1f04c13d6f198a400
|
@@ -697,7 +697,7 @@ def error_of_type(handler: astroid.ExceptHandler, error_type) -> bool:
error_type = (error_type,) # type: ignore
expected_errors = {stringify_error(error) for error in error_type} # type: ignore
if not handler.type:
- return True
+ return False
return handler.catch(expected_errors)
|
pylint/checkers/utils.py
|
ReplaceText(target='False' @(700,15)->(700,19))
|
def error_of_type(handler: astroid.ExceptHandler, error_type) -> bool:
error_type = (error_type,) # type: ignore
expected_errors = {stringify_error(error) for error in error_type} # type: ignore
if not handler.type:
return True
return handler.catch(expected_errors)
|
def error_of_type(handler: astroid.ExceptHandler, error_type) -> bool:
error_type = (error_type,) # type: ignore
expected_errors = {stringify_error(error) for error in error_type} # type: ignore
if not handler.type:
return False
return handler.catch(expected_errors)
|
890 |
https://:@github.com/ogrisel/pygbm.git
|
2e019bfc2b3ea35ec5bd7c3c56301f8fc7a64b60
|
@@ -426,7 +426,7 @@ def _find_best_bin_to_split_helper(context, feature_idx, histogram, n_samples):
context.sum_gradients, context.sum_hessians,
context.l2_regularization)
- if gain > best_split.gain and gain >= context.min_gain_to_split:
+ if gain > best_split.gain and gain > context.min_gain_to_split:
best_split.gain = gain
best_split.feature_idx = feature_idx
best_split.bin_idx = bin_idx
|
pygbm/splitting.py
|
ReplaceText(target='>' @(429,43)->(429,45))
|
def _find_best_bin_to_split_helper(context, feature_idx, histogram, n_samples):
context.sum_gradients, context.sum_hessians,
context.l2_regularization)
if gain > best_split.gain and gain >= context.min_gain_to_split:
best_split.gain = gain
best_split.feature_idx = feature_idx
best_split.bin_idx = bin_idx
|
def _find_best_bin_to_split_helper(context, feature_idx, histogram, n_samples):
context.sum_gradients, context.sum_hessians,
context.l2_regularization)
if gain > best_split.gain and gain > context.min_gain_to_split:
best_split.gain = gain
best_split.feature_idx = feature_idx
best_split.bin_idx = bin_idx
|
891 |
https://:@github.com/happz/ducky.git
|
e56b0f3d47fb108865973efe411e6767d51d72a1
|
@@ -330,7 +330,7 @@ class MathCoprocessor(ISnapshotable, Coprocessor):
i = i32(tos.value).value
j = i32(lr.value).value
D(' i=%i, j=%i (%s, %s)', i, j, type(i), type(j))
- i /= j
+ i //= j
D(' i=%i (%s)', i, type(i))
tos.value = i
|
ducky/cpu/coprocessor/math_copro.py
|
ReplaceText(target='//=' @(333,6)->(333,8))
|
class MathCoprocessor(ISnapshotable, Coprocessor):
i = i32(tos.value).value
j = i32(lr.value).value
D(' i=%i, j=%i (%s, %s)', i, j, type(i), type(j))
i /= j
D(' i=%i (%s)', i, type(i))
tos.value = i
|
class MathCoprocessor(ISnapshotable, Coprocessor):
i = i32(tos.value).value
j = i32(lr.value).value
D(' i=%i, j=%i (%s, %s)', i, j, type(i), type(j))
i //= j
D(' i=%i (%s)', i, type(i))
tos.value = i
|
892 |
https://:@github.com/happz/ducky.git
|
fb1a93bdb8055874aef7077850e784dc90e8295c
|
@@ -680,7 +680,7 @@ class Machine(ISnapshotable, IMachineWorker):
self.hdt.create()
- pages = self.memory.alloc_pages(segment = 0x00, count = align(PAGE_SIZE, self.hdt.size()) / PAGE_SIZE)
+ pages = self.memory.alloc_pages(segment = 0x00, count = align(PAGE_SIZE, self.hdt.size()) // PAGE_SIZE)
self.memory.update_pages_flags(pages[0].index, len(pages), 'read', True)
self.hdt_address = pages[0].base_address
|
ducky/machine.py
|
ReplaceText(target='//' @(683,94)->(683,95))
|
class Machine(ISnapshotable, IMachineWorker):
self.hdt.create()
pages = self.memory.alloc_pages(segment = 0x00, count = align(PAGE_SIZE, self.hdt.size()) / PAGE_SIZE)
self.memory.update_pages_flags(pages[0].index, len(pages), 'read', True)
self.hdt_address = pages[0].base_address
|
class Machine(ISnapshotable, IMachineWorker):
self.hdt.create()
pages = self.memory.alloc_pages(segment = 0x00, count = align(PAGE_SIZE, self.hdt.size()) // PAGE_SIZE)
self.memory.update_pages_flags(pages[0].index, len(pages), 'read', True)
self.hdt_address = pages[0].base_address
|
893 |
https://:@github.com/happz/ducky.git
|
f266fb16a7f0e10e19cba8d17eb15d0d69d3c24a
|
@@ -134,7 +134,7 @@ def show_pages(logger, state):
CPR = 32
- for i in range(0, 256 / CPR):
+ for i in range(0, 256 // CPR):
s = []
t = []
|
ducky/tools/coredump.py
|
ReplaceText(target='//' @(137,26)->(137,27))
|
def show_pages(logger, state):
CPR = 32
for i in range(0, 256 / CPR):
s = []
t = []
|
def show_pages(logger, state):
CPR = 32
for i in range(0, 256 // CPR):
s = []
t = []
|
894 |
https://:@github.com/tpircher/quine-mccluskey.git
|
31df780f3ec5a14d70840e755f23da133a8fc282
|
@@ -372,7 +372,7 @@ class QuineMcCluskey:
# Add the unused terms to the list of marked terms
for g in list(groups.values()):
- marked |= group - used
+ marked |= g - used
if len(used) == 0:
done = True
|
quine_mccluskey/qm.py
|
ReplaceText(target='g' @(375,26)->(375,31))
|
class QuineMcCluskey:
# Add the unused terms to the list of marked terms
for g in list(groups.values()):
marked |= group - used
if len(used) == 0:
done = True
|
class QuineMcCluskey:
# Add the unused terms to the list of marked terms
for g in list(groups.values()):
marked |= g - used
if len(used) == 0:
done = True
|
895 |
https://:@github.com/SUSE/azurectl.git
|
09c62dc074497f862c0a4fee6798ffee14f7e61c
|
@@ -81,7 +81,7 @@ class Image:
service_call = service.add_os_image(
label, media_link, name, 'Linux'
)
- add_os_image_result = service_call.get_operation_status(
+ add_os_image_result = service.get_operation_status(
service_call.request_id
)
status = add_os_image_result.status
|
azurectl/image.py
|
ReplaceText(target='service' @(84,34)->(84,46))
|
class Image:
service_call = service.add_os_image(
label, media_link, name, 'Linux'
)
add_os_image_result = service_call.get_operation_status(
service_call.request_id
)
status = add_os_image_result.status
|
class Image:
service_call = service.add_os_image(
label, media_link, name, 'Linux'
)
add_os_image_result = service.get_operation_status(
service_call.request_id
)
status = add_os_image_result.status
|
896 |
https://:@github.com/robocomp/learnbot.git
|
e0af147e7b8ab58add721fefe425c6ac28183043
|
@@ -1,6 +1,6 @@
def obstacle_free(lbot, threshold= 200, verbose=False):
sonarsValue = lbot.getSonars()
- if min(sonarsValue) > threshold:
+ if min(sonarsValue) < threshold:
if verbose:
print('No obstacles around Learnbot')
return True
|
learnbot_dsl/functions/perceptual/obstacle_free.py
|
ReplaceText(target='<' @(3,21)->(3,22))
|
-1,6 +1,6 @@
def obstacle_free(lbot, threshold= 200, verbose=False):
sonarsValue = lbot.getSonars()
if min(sonarsValue) > threshold:
if verbose:
print('No obstacles around Learnbot')
return True
|
-1,6 +1,6 @@
def obstacle_free(lbot, threshold= 200, verbose=False):
sonarsValue = lbot.getSonars()
if min(sonarsValue) < threshold:
if verbose:
print('No obstacles around Learnbot')
return True
|
897 |
https://:@github.com/robocomp/learnbot.git
|
f43f97e705c26d2e6d1a9fded44ee913dbba6e84
|
@@ -9,7 +9,7 @@ from learnbot_dsl.learnbotCode.Language import getLanguage
import tempfile, uuid, sys
def str2hex(text):
- if sys.version_info[0]>3:
+ if sys.version_info[0]>=3:
return text.encode('utf-8').hex()
else:
return str(binascii.hexlify(bytes(text)))
|
learnbot_dsl/learnbotCode/Button.py
|
ReplaceText(target='>=' @(12,26)->(12,27))
|
from learnbot_dsl.learnbotCode.Language import getLanguage
import tempfile, uuid, sys
def str2hex(text):
if sys.version_info[0]>3:
return text.encode('utf-8').hex()
else:
return str(binascii.hexlify(bytes(text)))
|
from learnbot_dsl.learnbotCode.Language import getLanguage
import tempfile, uuid, sys
def str2hex(text):
if sys.version_info[0]>=3:
return text.encode('utf-8').hex()
else:
return str(binascii.hexlify(bytes(text)))
|
898 |
https://:@github.com/robocomp/learnbot.git
|
b5f0d9f8bc119b2c1f05c2b8c0a8e7e8b40ed8e0
|
@@ -1,4 +1,4 @@
def look_front(lbot):
- lbot.setJointAngle("CAMERA",0)
+ lbot.setJointAngle(0, "CAMERA")
|
learnbot_dsl/functions/motor/jointmotor/look_front.py
|
ArgSwap(idxs=0<->1 @(4,4)->(4,22))
|
-1,4 +1,4 @@
def look_front(lbot):
lbot.setJointAngle("CAMERA",0)
|
-1,4 +1,4 @@
def look_front(lbot):
lbot.setJointAngle(0, "CAMERA")
|
899 |
https://:@github.com/robocomp/learnbot.git
|
b5f0d9f8bc119b2c1f05c2b8c0a8e7e8b40ed8e0
|
@@ -1,4 +1,4 @@
def setAngleCamera(lbot,angle):
- lbot.setJointAngle("CAMERA", angle)
+ lbot.setJointAngle(angle, "CAMERA")
|
learnbot_dsl/functions/motor/jointmotor/setAngleCamera.py
|
ArgSwap(idxs=0<->1 @(4,4)->(4,22))
|
-1,4 +1,4 @@
def setAngleCamera(lbot,angle):
lbot.setJointAngle("CAMERA", angle)
|
-1,4 +1,4 @@
def setAngleCamera(lbot,angle):
lbot.setJointAngle(angle, "CAMERA")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.