Search is not available for this dataset
id int64 0 10.8M | vector listlengths 1.54k 1.54k | ast_depth int64 3 164 | ast_data stringlengths 297 510k | full_path stringlengths 0 319 | code stringlengths 60 56.5k |
|---|---|---|---|---|---|
20,001 | [
0.0452536940574646,
-0.02785584144294262,
0.00933146569877863,
-0.00495188171043992,
-0.009265200234949589,
-0.030651064589619637,
0.01557854749262333,
-0.001489480258896947,
0.0056808083318173885,
0.019530415534973145,
0.016723142936825752,
-0.0009947438957169652,
-0.03686802461743355,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "clip_input", "annotation": {"_type": "Attribute", "_fields": {"ct... | def forward_onnx(self, clip_input: torch.FloatTensor, images: torch.FloatTensor):
pooled_output = self.vision_model(clip_input)[1] # pooled_output
image_embeds = self.visual_projection(pooled_output)
special_cos_dist = cosine_distance(image_embeds, self.special_care_embeds)
cos_dist = ... | |
20,002 | [
0.02302018366754055,
-0.010433703660964966,
0.011437452398240566,
-0.013385516591370106,
-0.027338944375514984,
-0.04498378932476044,
0.021224001422524452,
0.020946649834513664,
-0.014395869337022305,
0.052274174988269806,
0.025291824713349342,
-0.01805426925420761,
-0.04479888826608658,
-... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "clip_input", "annotation": null, "type_comment": null}}, {"_type"... | def forward(self, clip_input, images):
pooled_output = self.vision_model(clip_input)[1] # pooled_output
image_embeds = self.visual_projection(pooled_output)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
special_cos_dist = cosine_... | |
20,003 | [
-0.0013678519753739238,
-0.026344524696469307,
-0.011498580686748028,
-0.024223675951361656,
0.014884273521602154,
0.03717874363064766,
0.0018701163353398442,
-0.04441007226705551,
0.02456863410770893,
0.060405876487493515,
0.0022486113011837006,
-0.04584100842475891,
-0.014117701910436153,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_classif():
# Test whether the F test yields meaningful results
# on a simple simulated classification problem
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_redundant=2,
n_repeated=0, n_classes=8,
... | |
20,004 | [
0.005503344349563122,
-0.04245016723871231,
0.01643649861216545,
-0.025272440165281296,
-0.008994776755571365,
-0.006021029315888882,
-0.022578123956918716,
-0.04659164696931839,
0.0441444106400013,
0.0520508699119091,
0.05313330516219139,
0.010047795251011848,
-0.044591501355171204,
0.053... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_oneway_vs_scipy_stats():
# Test that our f_oneway gives the same result as scipy.stats
rng = np.random.RandomState(0)
X1 = rng.randn(10, 3)
X2 = 1 + rng.randn(10, 3)
f, pv = stats.f_oneway(X1, X2)
f2, pv2 = f_oneway(X1, X2)
assert_true(np.allclose(f, f2))
assert_true(np.allclo... | |
20,005 | [
-0.0025617978535592556,
-0.028997370973229408,
0.002729858970269561,
0.0013740138383582234,
-0.004781416617333889,
0.02662331610918045,
0.013154195621609688,
-0.04287831857800484,
0.02589656598865986,
0.06400255113840103,
0.0048056417144834995,
0.0011961112031713128,
-0.010410710237920284,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_regression():
# Test whether the F test yields meaningful results
# on a simple simulated regression problem
X, y = make_regression(n_samples=200, n_features=20, n_informative=5,
shuffle=False, random_state=0)
F, pv = f_regression(X, y)
assert_true((F > 0).all(... | |
20,006 | [
-0.010313348844647408,
0.002702021272853017,
0.011862797662615776,
-0.013156723231077194,
0.017299460247159004,
0.0015562446787953377,
-0.0093619329854846,
-0.02498690038919449,
0.04523303359746933,
0.03896999731659889,
0.012439084239304066,
-0.0110201146453619,
-0.059890273958444595,
0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_regression_input_dtype():
# Test whether f_regression returns the same value
# for any numeric data_type
rng = np.random.RandomState(0)
X = rng.rand(10, 20)
y = np.arange(10).astype(np.int)
F1, pv1 = f_regression(X, y)
F2, pv2 = f_regression(X, y.astype(np.float))
assert_arra... | |
20,007 | [
0.004203892312943935,
-0.025289040058851242,
0.005645696073770523,
-0.027167655527591705,
0.003747375914826989,
0.0318182110786438,
-0.00042244192445650697,
-0.029348423704504967,
0.01240148302167654,
0.06589601188898087,
0.012408051639795303,
-0.041776180267333984,
-0.017722034826874733,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_classif_multi_class():
# Test whether the F test yields meaningful results
# on a simple simulated classification problem
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_redundant=2,
n_repeated=0, n_classes=... | |
20,008 | [
-0.005052254535257816,
-0.006622714456170797,
0.0536634661257267,
0.006147924344986677,
-0.007359247654676437,
0.04127022251486778,
-0.007974040694534779,
-0.009934071451425552,
-0.0012318674707785249,
0.04129457101225853,
-0.004108760971575975,
0.0032383124344050884,
-0.009763633832335472,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_f_regression_center():
# Test whether f_regression preserves dof according to 'center' argument
# We use two centered variates so we have a simple relationship between
# F-score with variates centering and F-score without variates centering.
# Create toy example
X = np.arange(-5, 6).reshape... | |
20,009 | [
-0.009767443872988224,
0.010392887517809868,
-0.0035217744298279285,
0.0019669330213218927,
0.02108972892165184,
0.0037585077807307243,
0.00732412189245224,
0.010135696269571781,
0.013806524686515331,
0.052607420831918716,
0.0017170477658510208,
-0.05859297513961792,
-0.009276441298425198,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_percentile_classif():
# Test whether the relative univariate feature selection
# gets the correct items in a simple classification problem
# with the percentile heuristic
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_redundant=... | |
20,010 | [
-0.009110814891755581,
0.001071459730155766,
-0.005939597263932228,
-0.008165810257196426,
0.01795509085059166,
0.011152267456054688,
0.011867078952491283,
0.0011199215659871697,
0.008614081889390945,
0.043906375765800476,
-0.006584744900465012,
-0.04935832694172859,
0.002404916100203991,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_percentile_classif_sparse():
# Test whether the relative univariate feature selection
# gets the correct items in a simple classification problem
# with the percentile heuristic
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_red... | |
20,011 | [
-0.018671732395887375,
0.01619979739189148,
-0.010278650559484959,
-0.021810514852404594,
0.006708716508001089,
-0.018441785126924515,
-0.005599220283329487,
-0.009169153869152069,
0.00811714492738247,
0.0539916567504406,
0.015394981019198895,
-0.06788048148155212,
0.004598948638886213,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_kbest_classif():
# Test whether the relative univariate feature selection
# gets the correct items in a simple classification problem
# with the k best heuristic
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_redundant=2,
... | |
20,012 | [
0.0006811618804931641,
0.00018615921726450324,
0.0026577599346637726,
-0.009932132437825203,
0.03470512852072716,
-0.021098272874951363,
-0.00927144568413496,
0.0026632200460880995,
0.0013671014457941055,
0.05307329446077347,
0.013563175685703754,
-0.04660839959979057,
0.01937284506857395,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_kbest_all():
# Test whether k="all" correctly returns all features.
X, y = make_classification(n_samples=20, n_features=10,
shuffle=False, random_state=0)
univariate_filter = SelectKBest(f_classif, k='all')
X_r = univariate_filter.fit(X, y).transform(X)
... | |
20,013 | [
-0.011127423495054245,
-0.004835200496017933,
0.0011764870723709464,
-0.03374652564525604,
-0.0030139221344143152,
0.005601900164037943,
0.015051985159516335,
0.00618059653788805,
0.016579508781433105,
0.06072494760155678,
0.011973436921834946,
-0.061335958540439606,
-0.0013527398696169257,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_heuristics_classif():
# Test whether the relative univariate feature selection
# gets the correct items in a simple classification problem
# with the fdr, fwe and fpr heuristics
X, y = make_classification(n_samples=200, n_features=20,
n_informative=3, n_red... | |
20,014 | [
-0.026577064767479897,
-0.021373163908720016,
-0.0033744045067578554,
-0.02718108892440796,
0.029736576601862907,
-0.0474855937063694,
0.0030259289778769016,
0.021303469315171242,
0.03963328152894974,
0.06830120086669922,
0.010599463246762753,
-0.042095839977264404,
0.00024847028544172645,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_kbest_zero():
# Test whether k=0 correctly returns no features.
X, y = make_classification(n_samples=20, n_features=10,
shuffle=False, random_state=0)
univariate_filter = SelectKBest(f_classif, k=0)
univariate_filter.fit(X, y)
support = univariate_filt... | |
20,015 | [
-0.006798101123422384,
0.013735175132751465,
0.007492966949939728,
-0.00015743047697469592,
0.012982404790818691,
-0.014186837710440159,
0.016526218503713608,
0.026219593361020088,
0.007186067756265402,
0.05336567386984825,
-0.003384574316442013,
-0.03921357914805412,
-0.01902773417532444,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_percentile_regression():
# Test whether the relative univariate feature selection
# gets the correct items in a simple regression problem
# with the percentile heuristic
X, y = make_regression(n_samples=200, n_features=20,
n_informative=5, shuffle=False, random... | |
20,016 | [
-0.010661144740879536,
0.005567361135035753,
0.023724006488919258,
0.0036025759764015675,
0.017725350335240364,
-0.013756315223872662,
0.016360994428396225,
0.027242014184594154,
-0.007351735606789589,
0.044786956161260605,
-0.0009274237090721726,
-0.03276709094643593,
-0.023115120828151703,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_percentile_regression_full():
# Test whether the relative univariate feature selection
# selects all features when '100%' is asked.
X, y = make_regression(n_samples=200, n_features=20,
n_informative=5, shuffle=False, random_state=0)
univariate_filter = SelectP... | |
20,017 | [
-0.00848698802292347,
-0.0006707620341330767,
0.016147097572684288,
-0.031168723478913307,
-0.008854489773511887,
-0.0030290165450423956,
0.028619181364774704,
0.016790226101875305,
0.023726817220449448,
0.06169431656599045,
0.0064772143959999084,
-0.03564764931797981,
0.006098228506743908,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_heuristics_regression():
# Test whether the relative univariate feature selection
# gets the correct items in a simple regression problem
# with the fpr, fdr or fwe heuristics
X, y = make_regression(n_samples=200, n_features=20, n_informative=5,
shuffle=False, ... | |
20,018 | [
-0.019536670297384262,
0.02282961644232273,
0.008331815712153912,
-0.009381580166518688,
-0.00027815307839773595,
-0.03412287309765816,
0.0054946886375546455,
0.0018053187523037195,
0.0002828148426488042,
0.05737239494919777,
0.0076798563823103905,
-0.04523932561278343,
-0.001377815962769091... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_kbest_regression():
# Test whether the relative univariate feature selection
# gets the correct items in a simple regression problem
# with the k best heuristic
X, y = make_regression(n_samples=200, n_features=20, n_informative=5,
shuffle=False, random_state=0,... | |
20,019 | [
-0.00655677355825901,
-0.0462675541639328,
0.025975927710533142,
0.003493200521916151,
0.020397381857037544,
0.02596270851790905,
0.0038302927277982235,
0.017647767439484596,
-0.027152445167303085,
0.05277145281434059,
0.03172632306814194,
-0.013351494446396828,
-0.020542794838547707,
0.03... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_select_fdr_regression():
# Test that fdr heuristic actually has low FDR.
def single_fdr(alpha, n_informative, random_state):
X, y = make_regression(n_samples=150, n_features=20,
n_informative=n_informative, shuffle=False,
random_stat... | |
20,020 | [
0.020892910659313202,
-0.018168317154049873,
0.047706570476293564,
0.016570238396525383,
0.005550702568143606,
0.0008972816867753863,
0.02064402960240841,
0.004221153911203146,
-0.01951751485466957,
0.08682019263505936,
0.028817806392908096,
-0.012273766100406647,
-0.012502998113632202,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_boundary_case_ch2():
# Test boundary case, and always aim to select 1 feature.
X = np.array([[10, 20], [20, 20], [20, 30]])
y = np.array([[1], [0], [0]])
scores, pvalues = chi2(X, y)
assert_array_almost_equal(scores, np.array([4., 0.71428571]))
assert_array_almost_equal(pvalues, np.arra... | |
20,021 | [
-0.0005441735847853124,
-0.05490449443459511,
0.011105457320809364,
0.040376756340265274,
0.01008802279829979,
0.018992120400071144,
0.005848709959536791,
-0.010353172197937965,
-0.010445666499435902,
0.06126808747649193,
0.0018853379879146814,
-0.020484358072280884,
0.013935777358710766,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "alpha", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n_informative", "annotation": null, "type_comment": null}}, {"_t... | def single_fdr(alpha, n_informative, random_state):
X, y = make_regression(n_samples=150, n_features=20,
n_informative=n_informative, shuffle=False,
random_state=random_state, noise=10)
with warnings.catch_warnings(record=True):
... | |
20,022 | [
-0.009776542894542217,
-0.002514792140573263,
0.028493287041783333,
-0.014846501871943474,
-0.02473263442516327,
-0.020879695191979408,
0.015965469181537628,
0.0026503370609134436,
0.010849366895854473,
0.056294430047273636,
0.012700853869318962,
-0.03949838504195213,
-0.02874707244336605,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_select_fwe_regression():
# Test whether the relative univariate feature selection
# gets the correct items in a simple regression problem
# with the fwe heuristic
X, y = make_regression(n_samples=200, n_features=20,
n_informative=5, shuffle=False, random_state=0)
... | |
20,023 | [
0.003688876051455736,
-0.008984150364995003,
0.04902145266532898,
0.002567317569628358,
0.004302228335291147,
-0.010187489911913872,
0.030796127393841743,
0.034885141998529434,
-0.024721018970012665,
0.02668374590575695,
0.015222819522023201,
-0.06177917867898941,
-0.042642589658498764,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_selectpercentile_tiebreaking():
# Test if SelectPercentile selects the right n_features in case of ties.
Xs = [[0, 1, 1], [0, 0, 1], [1, 0, 0], [1, 1, 0]]
y = [1]
dummy_score = lambda X, y: (X[0], X[0])
for X in Xs:
sel = SelectPercentile(dummy_score, percentile=34)
X1 = ign... | |
20,024 | [
-0.0027210209518671036,
-0.00425766920670867,
0.05791887640953064,
-0.02803623490035534,
-0.008600370027124882,
-0.04037800803780556,
0.004114937037229538,
0.02016470953822136,
-0.027307389304041862,
0.04122832790017128,
0.03153469040989876,
-0.06394399702548981,
-0.023335184901952744,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_selectkbest_tiebreaking():
# Test whether SelectKBest actually selects k features in case of ties.
# Prior to 0.11, SelectKBest would return more features than requested.
Xs = [[0, 1, 1], [0, 0, 1], [1, 0, 0], [1, 1, 0]]
y = [1]
dummy_score = lambda X, y: (X[0], X[0])
for X in Xs:
... | |
20,025 | [
0.010495324619114399,
0.012759687379002571,
0.04021509364247322,
-0.01657513901591301,
0.021069901064038277,
-0.004327764268964529,
0.010365122929215431,
0.01543163601309061,
-0.025587305426597595,
0.051536910235881805,
-0.008530989289283752,
-0.03489384055137634,
-0.02830454148352146,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_scorefunc_multilabel():
# Test whether k-best and percentiles works with multilabels with chi2.
X = np.array([[10000, 9999, 0], [100, 9999, 0], [1000, 99, 0]])
y = [[1, 1], [0, 1], [1, 0]]
Xt = SelectKBest(chi2, k=2).fit_transform(X, y)
assert_equal(Xt.shape, (3, 2))
assert_not_in(0, ... | |
20,026 | [
0.00953629706054926,
-0.016584353521466255,
0.046900972723960876,
-0.010181830264627934,
0.030938681215047836,
-0.011760454624891281,
0.008667760528624058,
0.02913118526339531,
0.007411903236061335,
0.0411968007683754,
0.0014671225799247622,
-0.01784021034836769,
-0.03443630039691925,
0.04... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_tied_pvalues():
# Test whether k-best and percentiles work with tied pvalues from chi2.
# chi2 will return the same p-values for the following features, but it
# will return different scores.
X0 = np.array([[10000, 9999, 9998], [1, 1, 1]])
y = [0, 1]
for perm in itertools.permutations(... | |
20,027 | [
0.007597001735121012,
0.020001918077468872,
0.001605744007974863,
-0.01243597548455,
0.01749236136674881,
-0.04340788722038269,
-0.028897181153297424,
-0.0013238847022876143,
0.03523319214582443,
0.05580659210681915,
0.018001725897192955,
-0.0531231053173542,
-0.065000019967556,
0.04976874... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"c... | def test_nans():
# Assert that SelectKBest and SelectPercentile can handle NaNs.
# First feature has zero variance to confuse f_classif (ANOVA) and
# make it return a NaN.
X = [[0, 1, 0], [0, -1, -1], [0, .5, .5]]
y = [1, 0, 1]
for select in (SelectKBest(f_classif, 2),
Select... | |
20,028 | [
0.000010871359336306341,
0.003822332015261054,
0.054160501807928085,
-0.031096938997507095,
0.013302579522132874,
-0.02811681479215622,
-0.0014738653553649783,
-0.0025792643427848816,
-0.02412172220647335,
0.02705865539610386,
-0.0318959578871727,
-0.025525404140353203,
0.002834356389939785,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_tied_scores():
# Test for stable sorting in k-best with tied scores.
X_train = np.array([[0, 0, 0], [1, 1, 1]])
y_train = [0, 1]
for n_features in [1, 2, 3]:
sel = SelectKBest(chi2, k=n_features).fit(X_train, y_train)
X_test = sel.transform([[0, 1, 2]])
assert_array_equ... | |
20,029 | [
-0.0016133517492562532,
0.011119716800749302,
0.04333711043000221,
-0.010685352608561516,
-0.0057056802324950695,
-0.03343361243605614,
-0.006140044424682856,
0.00821568351238966,
-0.004356049466878176,
0.04845019429922104,
0.018764521926641464,
-0.026210760697722435,
-0.011175563558936119,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_no_feature_selected():
rng = np.random.RandomState(0)
# Generate random uncorrelated data: a strict univariate test should
# rejects all the features
X = rng.rand(40, 10)
y = rng.randint(0, 4, size=40)
strict_selectors = [
SelectFwe(alpha=0.01).fit(X, y),
SelectFdr(alph... | |
20,030 | [
-0.006264534313231707,
0.00415913388133049,
-0.00614182697609067,
-0.0014361606445163488,
0.024851471185684204,
0.00657776091247797,
0.013988640159368515,
0.004856628831475973,
-0.02162232995033264,
0.05316458269953728,
0.008014729246497154,
-0.05678122118115425,
0.01307156402617693,
0.009... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_mutual_info_classif():
X, y = make_classification(n_samples=100, n_features=5,
n_informative=1, n_redundant=1,
n_repeated=0, n_classes=2,
n_clusters_per_class=1, flip_y=0.0,
class_sep... | |
20,031 | [
-0.011759965680539608,
-0.028530094772577286,
0.03789432719349861,
-0.0342361144721508,
0.04278520122170448,
-0.04461430758237839,
-0.02592560462653637,
-0.01083547156304121,
-0.002907683840021491,
-0.01275404542684555,
0.009135594591498375,
0.004455963149666786,
0.01369842141866684,
0.002... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "txt_file", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs"... | def txt_to_xls(txt_file):
with open(txt_file,'r') as f:
# print(f)
file_content = json.load(f)
print(file_content)
print(file_content[0])
xls_workbook = xlwt3.Workbook()
xls_sheet = xls_workbook.add_sheet('numbers')
style = xlwt3.XFStyle()
font = xlwt3.Font()
font.name = '黑体'
style.font = font
fo... | |
20,032 | [
-0.003820516634732485,
0.015612952411174774,
0.02617681957781315,
0.015735503286123276,
0.010551610961556435,
-0.009565078653395176,
0.02563759684562683,
0.005628138780593872,
-0.0298533383756876,
0.05058890953660011,
-0.005039895419031382,
-0.027426835149526596,
0.016274726018309593,
0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_mutual_info_regression():
X, y = make_regression(n_samples=100, n_features=10, n_informative=2,
shuffle=False, random_state=0, noise=10)
# Test in KBest mode.
univariate_filter = SelectKBest(mutual_info_regression, k=2)
X_r = univariate_filter.fit(X, y).transform(X)
... | |
20,033 | [
0.029364032670855522,
0.042728133499622345,
0.03951427713036537,
-0.0158496405929327,
0.00411269860342145,
-0.0022297590039670467,
0.013976817019283772,
-0.0020274475682526827,
-0.00681499857455492,
0.011751392856240273,
-0.019757138565182686,
0.02732935920357704,
0.009416143409907818,
0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": true}}, "targets": [{"_type": "Name", "_fields": {"id": "initial", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"... | class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
... | |
20,034 | [
0.012233615852892399,
-0.048629168421030045,
0.031227340921759605,
-0.03855442628264427,
-0.03552328050136566,
0.009480507113039494,
-0.00666743004694581,
0.008117582648992538,
-0.02885039895772934,
0.0297226719558239,
0.010450909845530987,
-0.028697751462459564,
0.009747641161084175,
-0.0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "G", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def build_graph(self, G):
G.add_edge('A','B')
G.add_edge('A','C')
G.add_edge('A','C')
G.add_edge('B','C')
G.add_edge('A','D')
G.add_node('E')
return G | |
20,035 | [
0.02086975798010826,
0.017111405730247498,
0.059517934918403625,
-0.03912277892231941,
-0.0070869955234229565,
0.014456188306212425,
-0.017906688153743744,
-0.03145214915275574,
0.00040004646871238947,
0.048178739845752716,
0.01951008103787899,
-0.04558765888214111,
-0.028450598940253258,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "G", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def agraph_checks(self, G):
G = self.build_graph(G)
A=nx.to_agraph(G)
H=nx.from_agraph(A)
self.assert_equal(G, H)
fname=tempfile.mktemp()
nx.drawing.nx_agraph.write_dot(H,fname)
Hin=nx.drawing.nx_agraph.read_dot(fname)
os.unlink(fname)
self.assert... | |
20,036 | [
0.0006711711757816374,
0.026046426966786385,
0.015677988529205322,
0.0026846847031265497,
0.015393141657114029,
0.013308060355484486,
0.028211263939738274,
-0.0019725668244063854,
0.01997348479926586,
0.02229783684015274,
0.04598572850227356,
-0.03577680513262749,
-0.0055003990419209,
0.01... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "Comment", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load... | class ActiveIssueCommands(BaseModel):
comment = pw.ForeignKeyField(Comment, related_name="command")
issue = pw.ForeignKeyField(Issue)
chaos_response = pw.ForeignKeyField(Comment,
related_name="command_response",
null=True)
s... | |
20,037 | [
0.005021221935749054,
0.0010937957558780909,
0.009580987505614758,
0.02687983214855194,
0.05302133411169052,
-0.02676446922123432,
-0.04136956110596657,
0.025749264284968376,
-0.04593798145651817,
0.013336088508367538,
-0.04150800034403801,
-0.04676860198378563,
0.041784875094890594,
-0.00... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def do_request(self, url, tenant_id=None, admin=False,
expect_errors=False):
if admin:
if not tenant_id:
tenant_id = 'admin'
headers = {'X-Tenant-Id': tenant_id,
'X-Roles': 'admin'}
else:
headers = {'X-Tenant-I... | |
20,038 | [
-0.012916769832372665,
0.0006154240109026432,
0.0621446818113327,
-0.025617258623242378,
0.016148965805768967,
-0.03378786891698837,
-0.004073288291692734,
0.034773144870996475,
-0.04027629271149635,
0.0014861795352771878,
-0.018936585634946823,
-0.045875560492277145,
0.008771387860178947,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class PecanFunctionalTest(testlib_api.SqlTestCase):
def setUp(self):
self.setup_coreplugin('neutron.plugins.ml2.plugin.Ml2Plugin')
super(PecanFunctionalTest, self).setUp()
self.addCleanup(extensions.PluginAwareExtensionManager.clear_instance)
self.addCleanup(set_config, {}, overwrit... | |
20,039 | [
0.02557854726910591,
-0.04628844931721687,
0.011899110861122608,
-0.020952124148607254,
0.04122602939605713,
-0.03701138123869896,
-0.03378983959555626,
0.026111433282494545,
-0.004284285474568605,
-0.03686605021357536,
0.013697601854801178,
-0.048177774995565414,
0.006303803529590368,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestRequestID(PecanFunctionalTest):
def test_request_id(self):
response = self.app.get('/v2.0/')
self.assertIn('x-openstack-request-id', response.headers)
self.assertTrue(
response.headers['x-openstack-request-id'].startswith('req-'))
id_part = response.headers['x-... | |
20,040 | [
-0.019333628937602043,
0.0030384997371584177,
0.05678548663854599,
0.04312790185213089,
0.04841551557183266,
0.00027722393861040473,
-0.011233051307499409,
0.031424976885318756,
0.02591182477772236,
0.0073550487868487835,
0.02571134641766548,
-0.06841322779655457,
0.0061051915399730206,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestErrors(PecanFunctionalTest):
def test_404(self):
response = self.app.get('/assert_called_once', expect_errors=True)
self.assertEqual(response.status_int, 404)
def test_bad_method(self):
response = self.app.patch('/v2.0/ports/44.json',
expect_... | |
20,041 | [
-0.015302595682442188,
0.002120537916198373,
0.0012331051984801888,
0.005428452976047993,
0.04600699245929718,
-0.028670664876699448,
-0.01163195725530386,
0.02456599846482277,
0.0211061742156744,
-0.04702385887503624,
0.01956847310066223,
-0.02688494883477688,
-0.009052588604390621,
0.022... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestExceptionTranslationHook(PecanFunctionalTest):
def test_neutron_nonfound_to_webob_exception(self):
# this endpoint raises a Neutron notfound exception. make sure it gets
# translated into a 404 error
with mock.patch(
'neutron.pecan_wsgi.controllers.resource.'
... | |
20,042 | [
0.0351373516023159,
0.04687445983290672,
0.037775736302137375,
-0.018887868151068687,
0.021033095195889473,
-0.022598866373300552,
0.002046596724539995,
0.009222013875842094,
-0.003436679719015956,
-0.0047373780980706215,
0.015065910294651985,
-0.02658109925687313,
0.004879160318523645,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestInvalidAuth(PecanFunctionalTest):
def setup_app(self):
# disable normal app setup since it will fail
pass
def test_invalid_auth_strategy(self):
cfg.CONF.set_override('auth_strategy', 'badvalue')
with testtools.ExpectedException(n_exc.InvalidConfigurationOption):
... | |
20,043 | [
0.004160573706030846,
-0.011121653020381927,
0.0065345121547579765,
-0.0024666700046509504,
0.049382857978343964,
-0.0010409161914139986,
-0.04018384963274002,
0.03679604083299637,
-0.004475862719118595,
-0.056974515318870544,
0.027003547176718712,
-0.025519834831357002,
-0.00247748894616961... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_unexpected_exception(self):
with mock.patch(
'neutron.pecan_wsgi.controllers.resource.'
'CollectionsController.get',
side_effect=ValueError('secretpassword')
):
response = self.app.get('/v2.0/ports.json', expect_errors=True)
self.asser... | |
20,044 | [
-0.02287883870303631,
-0.0014908435987308621,
-0.0017377145122736692,
-0.00047731041559018195,
0.05822305381298065,
-0.043885305523872375,
-0.046963177621364594,
0.01873653754591942,
0.04203858599066734,
-0.0023661130107939243,
0.019531654193997383,
-0.04250026494264603,
0.01204858161509037,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_neutron_nonfound_to_webob_exception(self):
# this endpoint raises a Neutron notfound exception. make sure it gets
# translated into a 404 error
with mock.patch(
'neutron.pecan_wsgi.controllers.resource.'
'CollectionsController.get',
side_effect=n_exc.... | |
20,045 | [
-0.011483888141810894,
-0.014683932065963745,
-0.06266704201698303,
-0.03914935141801834,
0.016006071120500565,
-0.019551275297999382,
0.020978717133402824,
-0.013116085901856422,
0.023283684626221657,
0.04928185045719147,
0.05775289982557297,
-0.049609459936618805,
0.016485784202814102,
-... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_url = self._search_regex(r'flv_url=(.*?)&',
webpage, 'video URL')
video_url = compat_urllib_parse_unquote(video_url)
vid... | |
20,046 | [
0.003107428550720215,
-0.021465249359607697,
-0.0829583927989006,
-0.05248101428151131,
0.021125832572579384,
-0.02040017955005169,
0.005562355276197195,
0.011054486967623234,
0.007385263219475746,
0.02771521918475628,
0.061610180884599686,
-0.03225639462471008,
-0.009995268657803535,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "^https?://(?:video|www)\\.xnxx\\.com/video(?P<id>[0-9]+)/(.*)"}}, "targets": [{"_type": "Name", "_fields": {"id": "_VALID_URL", "ctx": {"... | class XNXXIE(InfoExtractor):
_VALID_URL = r'^https?://(?:video|www)\.xnxx\.com/video(?P<id>[0-9]+)/(.*)'
_TEST = {
'url': 'http://video.xnxx.com/video1135332/lida_naked_funny_actress_5_',
'md5': '0831677e2b4761795f68d417e0b7b445',
'info_dict': {
'id': '1135332',
'... | |
20,047 | [
-0.0003621159412432462,
-0.014181973412632942,
0.034186627715826035,
-0.0163150355219841,
0.004249307326972485,
-0.006845972966402769,
-0.05442188307642937,
-0.05134719982743263,
0.01400902308523655,
-0.005539232864975929,
-0.028075696900486946,
0.0019000577740371227,
0.010300186462700367,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "defaultport", "annotation": null, "type_comment": null}}], "kwarg": ... | def parse_spec(s, defaultport):
match = re.match('\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s)
if match: # ipv6
host = match.group(1)
port = match.group(2)
else:
(host,_,port) = s.partition(':')
if not port:
port = defaultport
else:
port = int(port)
host = na... | |
20,048 | [
0.03342021629214287,
-0.052960995584726334,
0.03733648732304573,
0.046630024909973145,
0.013564914464950562,
-0.05117533728480339,
-0.012408294714987278,
0.00915657076984644,
0.0045275562442839146,
-0.012864855118095875,
0.011424153111875057,
0.03382604569196701,
0.03218242898583412,
-0.03... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "addr", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], True)
if len(vchAddr) != 16-len(pchOnionCat):
raise ValueError('Invalid onion %s' % s)
return pchOnionCat + vchAddr
elif '.' in addr: # IPv4
return pchIPv4 + bytearray(... | |
20,049 | [
-0.015192368067800999,
-0.0015131633263081312,
0.03898821398615837,
-0.038964513689279556,
-0.01849866285920143,
-0.047378383576869965,
-0.006008213851600885,
0.005196453537791967,
0.004997957032173872,
0.030195126309990883,
0.03213861212134361,
0.023381076753139496,
-0.02737470343708992,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value... | def main():
if len(sys.argv)<2:
print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)
exit(1)
g = sys.stdout
indir = sys.argv[1]
g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n')
g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n')
g.write('/**\n')
g.write(' * List... | |
20,050 | [
0.008693787269294262,
0.04483216628432274,
0.029065029695630074,
-0.029219357296824455,
-0.008880266919732094,
-0.025759847834706306,
-0.035623952746391296,
-0.05028507485985756,
0.02422943152487278,
0.008841685019433498,
0.038993436843156815,
-0.006668237969279289,
-0.01970248855650425,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "g", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f... | def process_nodes(g, f, structname, defaultport):
g.write('static SeedSpec6 %s[] = {\n' % structname)
first = True
for line in f:
comment = line.find('#')
if comment != -1:
line = line[0:comment]
line = line.strip()
if not line:
continue
if not... | |
20,051 | [
0.020437678322196007,
-0.01693069189786911,
0.028506118804216385,
-0.02675262652337551,
0.007185769733041525,
-0.02471478283405304,
-0.015141654759645462,
-0.014928392134606838,
-0.022309651598334312,
0.04895564541220665,
-0.019608324393630028,
-0.054453086107969284,
-0.007867025211453438,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ar", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "lo", "annotation": null, "type_comment": null}}, {"_type": "arg", "... | def merge(ar, lo, mid, hi):
aux = ar[:]
i = lo
j = mid + 1
k = lo
while k <= hi:
if i > mid:
ar[k] = aux[j]
j += 1
elif j > hi:
ar[k] = aux[i]
i += 1
elif aux[i] < aux[j]:
ar[k] = aux[i]
i += 1
el... | |
20,052 | [
0.0057453433983027935,
0.019104082137346268,
0.029606439173221588,
-0.027260515838861465,
0.01805058866739273,
-0.006711951456964016,
0.004442051984369755,
-0.02743428759276867,
-0.06090715900063515,
0.04596274718642235,
-0.03675282374024391,
-0.010898775421082973,
0.00479502696543932,
0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ar", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}... | def bottom_up_merge_sort(ar):
n = len(ar)
sz = 1
while sz < n:
lo = 0
while lo < n - sz:
merge(ar, lo, lo + sz - 1, min(lo+sz+sz - 1, n - 1))
lo += sz + sz
sz = sz + sz | |
20,053 | [
-0.022739509120583534,
0.007096557877957821,
0.022152530029416084,
-0.009514905512332916,
-0.0011453398037701845,
-0.007601358462125063,
0.052123602479696274,
-0.009080542251467705,
0.04594859853386879,
0.043365899473428726,
0.04731038585305214,
-0.00046481279423460364,
0.026648778468370438,... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "session", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "create_window", "annotation": null, "type_comment": null}}], "... | def test_closed_context(session, create_window):
# Step 5
new_window = create_window()
session.window_handle = new_window
session.close()
response = session.transport.send("POST",
"session/%s/elements" % session.session_id,
... | |
20,054 | [
0.023699872195720673,
0.018362365663051605,
0.012554889544844627,
-0.009695910848677158,
-0.018216898664832115,
-0.013975987210869789,
0.010065172798931599,
-0.019089698791503906,
-0.054784972220659256,
0.031913142651319504,
0.033009737730026245,
0.010109931230545044,
0.0007636998780071735,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "For", "_fields": {"body"... | def populate():
try:
for i in load_all():
add_index_to_database(i)
add_bulk_to_database(load_bulk())
set_related_links()
except FileNotFoundError:
print('No scraped data found! Please run "manage.py scrape" to scrape '
'the website, then try again.') | |
20,055 | [
-0.03289621323347092,
-0.00022072331921663135,
0.0071206167340278625,
-0.034482404589653015,
0.04153980314731598,
0.0021781385876238346,
-0.02482733130455017,
-0.04694204777479172,
0.03331000357866287,
0.01676994375884533,
0.049240875989198685,
0.000408760184654966,
-0.0032298520673066378,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "session", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "using", "annotation": null, "type_comment": null}}, {"_type": ... | def test_xhtml_namespace(session, using, value):
session.url = inline("""<p><a href="#" id="linkText">full link text</a></p>""", doctype="xhtml")
expected = session.execute_script("return document.links[0]")
response = find_elements(session, using, value)
value = assert_success(response)
assert isi... | |
20,056 | [
0.003709611250087619,
0.003042456228286028,
0.047805096954107285,
-0.05355643108487129,
-0.0005729767726734281,
-0.01721949689090252,
0.017173485830426216,
0.0024888901971280575,
0.0014838444767519832,
0.02117641642689705,
-0.010628467425704002,
-0.004069069400429726,
0.03147130459547043,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "rpath"}}, "targets": [{"_type": "Name", "_fields": {"id": "pluginName", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null... | class PluginTest(testbase.BasePluginTest):
pluginName = 'rpath'
BootUuid = "dc9f04e1-1599-4ff7-9b3e-cec839cb2409"
ZoneAddresses = [ '1.2.3.4:5678', '2.3.4.5:6789' ]
ConaryProxies = [ '3.4.5.6', '4.5.6.7' ]
PluginData = """
[rpath-tools]
boot-uuid = %s
zone-addresses = %s
conary-proxies = %s
""" % (... | |
20,057 | [
0.042996492236852646,
0.016819670796394348,
0.07212480902671814,
-0.03467043116688728,
0.03271136060357094,
-0.017464103177189827,
0.025571053847670555,
0.007810513488948345,
0.026086600497364998,
0.016291236504912376,
0.01040757354348898,
0.0002642170584294945,
0.03405177593231201,
-0.003... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testFiles(self):
rpathCfgDir = os.path.join(self.rootDir,
"etc/conary/rpath-tools/config.d")
bootUuidPath = os.path.join(rpathCfgDir, '..', 'boot-uuid')
self.assertEquals(file(bootUuidPath).read(), self.BootUuid)
directMethodPath = os.path.join(rpathCfgDir, 'directMethod'... | |
20,058 | [
0.06546600908041,
-0.006525736767798662,
-0.006160620134323835,
0.015972407534718513,
0.03312709927558899,
0.005992550402879715,
0.004781290423125029,
-0.022695191204547882,
-0.028258875012397766,
0.010994070209562778,
-0.015497175976634026,
-0.03117980808019638,
0.022521326318383217,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "pipe", "annotation": {"_type": "Constant", "_fields": {"kind": nu... | def __init__(self, pipe: "callable", *extra_pipes, message: str=None):
self.message = message
if extra_pipes:
pipes = reversed((pipe,) + extra_pipes)
self.pipe = compose(*pipes)
else:
self.pipe = pipe | |
20,059 | [
0.05120358243584633,
0.04837886616587639,
0.06940730661153793,
0.01106347143650055,
-0.008872074075043201,
0.011141935363411903,
0.059812240302562714,
-0.012912987731397152,
-0.030780436471104622,
0.039164911955595016,
0.006764746271073818,
-0.02620708756148815,
-0.0336499884724617,
-0.016... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mapping", "annotation": {"_type": "Name", "_fields": {"id": "dict... | def __init__(self, mapping: dict, messages=None):
required = set()
optional = set()
dependent = set()
self.messages = {
'required': _("Field `{0}` is required.")
}
if messages:
self.messages.update(messages)
for field in mapping:
... | |
20,060 | [
0.06659908592700958,
0.03882082179188728,
0.03602795675396919,
0.03486784175038338,
0.038391150534152985,
0.02494243159890175,
-0.002316197846084833,
-0.01015636045485735,
0.009227195754647255,
0.026596665382385254,
0.007777054328471422,
-0.051044974476099014,
-0.054525312036275864,
-0.005... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": {"_type": "Name", "_fields": {"id": "object"... | def validate(self, data: object) -> object:
messages = []
for condition in self.conditions:
try:
return condition.validate(data)
except SchemaError as err:
messages.append(err.error)
message = self.message.format(messages=", ".join(messag... | |
20,061 | [
0.04889647290110588,
0.05958446487784386,
0.06529626250267029,
0.004557000007480383,
0.04491552338004112,
0.008318891748785973,
0.049545541405677795,
-0.0075778719037771225,
-0.027369044721126556,
0.035677116364240646,
0.022100772708654404,
-0.0036374866031110287,
-0.0009384445147588849,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": {"_type": "Name", "_fields": {"id": "dict", ... | def validate(self, data: dict) -> dict:
# normal fields validation
fields = self.required | self.optional & set(data.keys())
result = self._validate(data, fields, dict.__getitem__)
# dependent fields validation
fields = self.dependent
result.update(self._validate(data, ... | |
20,062 | [
0.06084302440285683,
0.06530116498470306,
0.02352200634777546,
0.004495293367654085,
0.018373914062976837,
-0.018840957432985306,
0.02997569739818573,
-0.033181313425302505,
-0.0023020466323941946,
0.023330943658947945,
0.04640713706612587,
-0.024668386206030846,
-0.025517556816339493,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": {"_type": "Name", "_fields": {"id": "dict", ... | def _validate(self, data: dict, fields: dict, value_getter: "function") -> dict:
errors = {}
result = {}
for field in fields:
try:
value = value_getter(data, field)
cleaned_value = self.mapping[field].validate(value)
except KeyError:
... | |
20,063 | [
-0.030917400494217873,
0.01775614731013775,
0.015366340056061745,
0.018044771626591682,
-0.04363994672894478,
-0.020180588588118553,
-0.029716724529862404,
-0.011810492724180222,
-0.029347285628318787,
0.003529871115460992,
-0.017513703554868698,
0.006851932965219021,
0.008745306171476841,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_widgets(self):
return [QApplication,
self.focused_column().toggle_sidebars_button,
self.focused_column().bookmark_button,
self.focused_column().search_bar,
self.focused_column().view,
self.focused_column().view.verticalScrol... | |
20,064 | [
-0.02525116316974163,
0.018529538065195084,
0.02989964373409748,
-0.025598833337426186,
-0.028740743175148964,
0.010610382072627544,
0.015606531873345375,
-0.014009824022650719,
-0.04699987173080444,
0.01836214028298855,
0.009979424066841602,
0.020255012437701225,
0.01059106644243002,
0.00... | 18 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "app", "annotation": null, "type_comment": null}}], "kwarg": null,... | def __init__(self, app):
super(MainWindow, self).__init__()
self.app = app
app.setStyle("Fusion")
self.light_palette = app.palette()
self.light_palette.setColor(QPalette.Highlight, model.SELECTION_LIGHT_BLUE)
self.light_palette.setColor(QPalette.AlternateBase, model.ALTER... | |
20,065 | [
0.004733178298920393,
0.016370471566915512,
-0.01147112250328064,
-0.008067307993769646,
-0.08327820897102356,
0.005121802911162376,
0.0205300934612751,
-0.03276238590478897,
0.006373441778123379,
0.0006422354490496218,
0.006641458719968796,
0.03675047680735588,
0.013443727046251297,
-0.01... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setup_tag_model(self):
self.tag_view.model().setupModelData(self.item_model.get_tags_set())
def expand_node(parent_index, bool_expand):
self.tag_view.setExpanded(parent_index, bool_expand)
for row_num in range(self.tag_view.model().rowCount(parent_index)):
ch... | |
20,066 | [
-0.013605086132884026,
0.0066776215098798275,
-0.0012506344355642796,
-0.04054270312190056,
-0.042723149061203,
0.012662496417760849,
-0.0019561569206416607,
0.03974774852395058,
-0.007080777082592249,
-0.018261250108480453,
0.0010597032960504293,
-0.03858938440680504,
0.052875861525535583,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def fill_bookmarkShortcutsMenu(self):
self.bookmarkShortcutsMenu.clear()
for index in self.item_model.indexes():
item = self.bookmark_model.getItem(index)
if item.shortcut:
self.bookmarkShortcutsMenu.addAction(
QAction(item.text, self, shortcut... | |
20,067 | [
0.001580135547555983,
0.003305264748632908,
-0.025660928338766098,
-0.013765526004135609,
-0.050327613949775696,
-0.026607826352119446,
0.01117339264601469,
0.03075050376355648,
-0.03870444372296333,
0.019435076043009758,
0.001165128080174327,
0.01818043552339077,
0.011427871882915497,
-0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def change_active_tree(self):
if not hasattr(self, 'item_views_splitter'):
return
self.focused_column().filter_proxy.setSourceModel(self.item_model)
self.quicklinks_view.setModel(self.item_model)
self.quicklinks_view.setItemDelegate(model.BookmarkDelegate(self, self.item_mode... | |
20,068 | [
0.009375727735459805,
0.03310136869549751,
0.008651494048535824,
0.0034162455704063177,
-0.04513823240995407,
-0.018661627545952797,
0.018291089683771133,
0.05600733682513237,
-0.011155431158840656,
-0.01616891846060753,
0.009426254779100418,
-0.028475262224674225,
0.026835914701223373,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def set_undo_actions(self):
if hasattr(self, 'undoAction'):
self.fileMenu.removeAction(self.undoAction)
self.fileMenu.removeAction(self.redoAction)
self.undoAction = self.item_model.undoStack.createUndoAction(self)
self.undoAction.setShortcut(QKeySequence.Undo)
se... | |
20,069 | [
0.012260387651622295,
0.016941193491220474,
0.037921663373708725,
-0.032433003187179565,
-0.029272863641381264,
-0.005666865035891533,
0.014089941047132015,
-0.008743842132389545,
-0.013781055808067322,
-0.0040392749942839146,
-0.00031761027639731765,
-0.009569517336785793,
-0.01394737884402... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "event", "annotation": null, "type_comment": null}}], "kwarg": nul... | def closeEvent(self, event):
settings = self.getQSettings()
settings.setValue('pos', self.pos())
settings.setValue('size', self.size())
settings.setValue('mainSplitter', self.mainSplitter.saveState())
settings.setValue('first_column_splitter', self.third_column_splitter.saveState... | |
20,070 | [
-0.006984608713537455,
0.03884182125329971,
0.010450072586536407,
0.007020396646112204,
-0.013754489831626415,
0.010473931208252907,
0.019313545897603035,
0.0067042699083685875,
-0.006057105027139187,
-0.004661376588046551,
0.031636521220207214,
-0.01356362085789442,
0.01035463809967041,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def update_actions(self): # enable / disable menu items whether they are doable right now
def toggle_actions(bool_focused, actions_list):
for action in actions_list:
action.setEnabled(bool_focused)
toggle_actions(len(self.bookmarks_view.selectedIndexes()) > 0, self.bookmark... | |
20,071 | [
-0.008558905683457851,
0.035314615815877914,
-0.006288519594818354,
-0.06487458944320679,
-0.030076993629336357,
-0.0028717010281980038,
-0.04428376629948616,
-0.03623626008629799,
-0.043362125754356384,
0.03317910432815552,
-0.008598243817687035,
-0.0206807442009449,
0.03661840409040451,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "column", "annotation": null, "type_comment": null}}], "kwarg": nu... | def toggle_sorting(self, column):
if column == 0: # order manually
self.filter(model.SORT, 'all')
elif column == 1: # order by start date
order = model.DESC # toggle between ASC and DESC
if model.DESC in self.focused_column().search_bar.text():
orde... | |
20,072 | [
0.014524098485708237,
-0.03311103209853172,
-0.012829439714550972,
-0.017446300014853477,
-0.06848161667585373,
0.019303906708955765,
0.0003416815889067948,
0.016436021775007248,
-0.0041144369170069695,
0.025137444958090782,
-0.01973843388259411,
-0.0004752649983856827,
0.011428086087107658,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def filter_tag(self):
current_index = self.tag_view.selectionModel().currentIndex()
current_tag = self.tag_view.model().data(current_index, tag_model.FULL_PATH)
if current_tag is not None:
search_bar_text = self.focused_column().search_bar.text()
new_text = re.sub(r':\S* ... | |
20,073 | [
0.0431336984038353,
0.004968279507011175,
-0.06711693853139877,
-0.0192633755505085,
-0.03421337902545929,
-0.008383971638977528,
-0.006029684562236071,
0.052663762122392654,
0.012059369124472141,
0.03672010451555252,
-0.008869508281350136,
-0.014227346517145634,
0.0007240702980197966,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def filter(self, key, value):
character = value[0]
search_bar_text = self.focused_column().search_bar.text()
# 'all' selected: remove existing same filter
if value == 'all':
search_bar_text = re.sub(' ' + key + r'(<|>|=|\w|\d)* ', '', search_bar_text)
else:
... | |
20,074 | [
0.009317305870354176,
0.0063157216645777225,
-0.008767644874751568,
-0.016144968569278717,
-0.05375907942652702,
0.010395074263215065,
-0.002451922744512558,
0.023258239030838013,
-0.020218931138515472,
-0.022590022534132004,
0.021684696897864342,
-0.00039540621219202876,
0.04561115056276321... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bookmark_index", "annotation": null, "type_comment": null}}], "kw... | def filter_bookmark(self, bookmark_index):
bookmark_item = self.bookmark_model.getItem(bookmark_index)
if bookmark_item.saved_root_item_creation_date_time:
focus_index = self.get_index_by_creation_date(bookmark_item.saved_root_item_creation_date_time)
if focus_index:
... | |
20,075 | [
0.00848371535539627,
-0.030612224712967873,
-0.005112217273563147,
-0.007011738605797291,
-0.043731749057769775,
0.0015956591814756393,
0.018262282013893127,
0.0014719765167683363,
0.005942875985056162,
-0.005017546471208334,
0.04727426543831825,
0.0037410191725939512,
0.01825006492435932,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def reset_view(self):
self.hideFutureStartdateCheckBox.setChecked(False)
self.hideTagsCheckBox.setChecked(False)
self.task_dropdown.setCurrentIndex(0)
self.estimate_dropdown.setCurrentIndex(0)
self.color_dropdown.setCurrentIndex(0)
self.date_dropdown.setCurrentIndex(0)
... | |
20,076 | [
0.017514513805508614,
0.009123298339545727,
0.014153591357171535,
-0.02684301882982254,
-0.03700343146920204,
-0.01662714220583439,
-0.005551624111831188,
-0.0027536277193576097,
-0.058522216975688934,
0.019122878089547157,
0.03651537746191025,
0.00231410120613873,
0.05515019968152046,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index_from", "annotation": null, "type_comment": null}}, {"_type"... | def select_from_to(self, index_from, index_to):
if self.focused_column().view.state() != QAbstractItemView.EditingState:
view = self.current_view()
if index_from.model() is self.item_model:
index_to = self.filter_proxy_index_from_model_index(index_to)
inde... | |
20,077 | [
0.007403508760035038,
0.014043299481272697,
0.0012275063199922442,
0.019776886329054832,
-0.05567165091633797,
0.018580013886094093,
-0.007015950512140989,
-0.012561457231640816,
0.023572681471705437,
0.016368651762604713,
0.01700698211789131,
-0.006035654805600643,
0.021270127967000008,
-... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def toggle_sidebars(self):
self.path_bar.setMaximumWidth(0)
if self.is_sidebar_shown(): # hide
self.mainSplitter.moveSplitter(0, 1)
self.mainSplitter.moveSplitter(self.width(), 2)
margin = TOOLBAR_MARGIN
else:
self.mainSplitter.moveSplitter(INITIA... | |
20,078 | [
0.003567670239135623,
0.0068087028339505196,
-0.026153529062867165,
0.022943470627069473,
-0.019294140860438347,
-0.0029003159143030643,
0.00679743941873312,
0.015228066593408585,
-0.0044912658631801605,
0.02417117729783058,
0.03998493775725365,
0.022290196269750595,
0.01857328601181507,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def toggle_fullscreen(self):
if self.windowState() != Qt.WindowFullScreen:
self.showFullScreen()
self.search_holder.hide()
self.menuBar().setMaximumHeight(0)
else:
self.showMaximized()
self.search_holder.show()
self.menuBar().setMax... | |
20,079 | [
0.00996637623757124,
0.03948056325316429,
0.005503460299223661,
-0.017021631821990013,
-0.036064207553863525,
0.006237254943698645,
0.015145041979849339,
0.01165049523115158,
-0.03223884850740433,
0.01798398606479168,
0.010116743855178356,
0.00884763989597559,
0.046241097152233124,
0.02254... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "search_text", "annotation": null, "type_comment": null}}], "kwarg... | def search(self, search_text):
self.old_search_text = search_text # needed by the line above next time this method is called
# sort
if model.SORT in search_text:
if model.ASC in search_text:
order = Qt.DescendingOrder # it's somehow reverted
elif model.... | |
20,080 | [
0.011813695542514324,
0.015226298943161964,
0.0035185685846954584,
-0.017802054062485695,
-0.008026139810681343,
0.010313889011740685,
-0.014530736953020096,
-0.024866361171007156,
-0.037190861999988556,
0.002127443440258503,
0.02230147458612919,
0.035017229616642,
0.022910092025995255,
0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def toggle_columns(self):
if self.focused_column().view.isHeaderHidden():
self.focused_column().view.showColumn(1)
self.focused_column().view.showColumn(2)
self.focused_column().view.setHeaderHidden(False)
else:
self.focused_column().view.hideColumn(1)
... | |
20,081 | [
0.027148673310875893,
0.01928529143333435,
0.012654959224164486,
-0.005329684820026159,
-0.03357349708676338,
-0.008063480257987976,
-0.043372977524995804,
0.016397366300225258,
-0.05931606516242027,
0.023319736123085022,
0.016570424661040306,
0.016894910484552383,
0.03234045207500458,
0.0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def expand(self):
for index in self.selected_indexes():
if self.focused_column().view.isExpanded(index): # select all children
for row_num in range(self.focused_column().filter_proxy.rowCount(index)):
child_index = self.focused_column().filter_proxy.index(row_num... | |
20,082 | [
0.0350329652428627,
0.02184193767607212,
0.025673668831586838,
-0.005162639543414116,
0.002523629227653146,
0.019244518131017685,
-0.0172266885638237,
-0.015155191533267498,
-0.0577872209250927,
0.01147372554987669,
0.010030117817223072,
-0.02251812443137169,
0.023999297991394997,
0.023612... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def is_selection_visible(self):
if not self.focused_column().view.selectionModel().selectedRows():
return False
# check if the parent of the selection is the current root
# if not, the check if one of it's parent is the current root - then the selection is visible
# if we do... | |
20,083 | [
-0.012791060842573643,
0.045231547206640244,
-0.03875186666846275,
-0.019449565559625626,
0.007126598618924618,
-0.015105233527719975,
0.005314706824719906,
0.02715996652841568,
0.027559686452150345,
0.028043558821082115,
-0.012086289934813976,
-0.02352040447294712,
0.014211121015250683,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null... | def is_no_text_search(self, text):
def is_filter_keyword(token):
return token.startswith(model.SORT) or token.startswith('c=') or token.startswith('t=') or \
re.match(r'e(<|>|=)', token) or token.startswith(model.DATE_BELOW) or \
token.startswith(model.HIDE_TAGS... | |
20,084 | [
0.003953018691390753,
0.017636990174651146,
0.04271223768591881,
-0.01644732989370823,
-0.035966984927654266,
-0.030238140374422073,
-0.04229643568396568,
-0.009280499070882797,
-0.04238883778452873,
0.015511773526668549,
-0.0031705002766102552,
-0.0012820601696148515,
0.01740598864853382,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def collapse(self):
for index in self.selected_indexes():
# jump to parent
if not self.focused_column().view.isExpanded(index) or \
not self.item_model.hasChildren(self.focused_column().filter_proxy.mapToSource(index)):
index_parent_to = index.parent()... | |
20,085 | [
-0.007415988016873598,
0.03017984703183174,
-0.01968998648226261,
-0.015724044293165207,
-0.03637058660387993,
-0.014326829463243484,
0.01547684520483017,
0.005279861390590668,
0.011113234795629978,
0.00712042348459363,
0.014133368618786335,
0.03308175504207611,
0.04305572435259819,
0.0450... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "point", "annotation": null, "type_comment": null}}], "kwarg": nul... | def open_rename_tag_contextmenu(self, point):
index = self.tag_view.indexAt(point)
# show context menu only when clicked on an item, not when clicked on empty space
if not index.isValid():
return
menu = QMenu()
menu.addAction(self.renameTagAction)
menu.exec_(s... | |
20,086 | [
-0.003956994041800499,
0.047483932226896286,
0.025199273601174355,
-0.028154367581009865,
-0.043516818434000015,
-0.006886789109557867,
0.015281486324965954,
0.04481220245361328,
-0.02050350420176983,
-0.005222017876803875,
0.05436566099524498,
-0.006962690502405167,
0.04890075698494911,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "point", "annotation": null, "type_comment": null}}], "kwarg": nul... | def open_edit_bookmark_contextmenu(self, point):
index = self.bookmarks_view.indexAt(point)
if not index.isValid():
return
menu = QMenu()
menu.addAction(self.editBookmarkAction)
menu.addAction(self.deleteBookmarkAction)
menu.addAction(self.moveBookmarkUpAction... | |
20,087 | [
0.035376496613025665,
0.03967075049877167,
0.02469765581190586,
-0.016188666224479675,
-0.01919919066131115,
0.023425284773111343,
-0.01534799113869667,
-0.009378066286444664,
-0.06002870947122574,
0.0016799290897324681,
-0.015768328681588173,
0.03692151978611946,
-0.00046577915782108903,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def move_down(self):
if self.current_view().header().isSortIndicatorShown():
QMessageBox(QMessageBox.NoIcon, ' ',
"Moving is not possible when the tree is sorted.\n"
"Click the first column or Esc to disable sorting.").exec()
else:
... | |
20,088 | [
0.026100749149918556,
0.037796296179294586,
0.021723605692386627,
-0.014949453063309193,
-0.02098250202834606,
0.022684725001454353,
-0.023587943986058235,
-0.009339066222310066,
-0.06016836687922478,
0.005118248052895069,
-0.016616936773061752,
0.04131653904914856,
0.0014735228614881635,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def move_up(self):
if self.current_view().header().isSortIndicatorShown():
QMessageBox(QMessageBox.NoIcon, ' ',
"Moving is not possible when the tree is sorted.\n"
"Click the first column or Esc to disable sorting.").exec()
else:
in... | |
20,089 | [
0.03566944599151611,
0.03107069991528988,
0.015371942892670631,
0.005042277276515961,
-0.029483316466212273,
0.011257585138082504,
-0.026868803426623344,
-0.007219093851745129,
-0.06447578966617584,
0.023215485736727715,
-0.003910099621862173,
0.0294366292655468,
0.020717691630125046,
0.01... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def move_right(self):
if self.focusWidget() is self.focused_column().view:
if self.current_view().header().isSortIndicatorShown():
QMessageBox(QMessageBox.NoIcon, ' ',
"Moving is not possible when the tree is sorted.\n"
"Click t... | |
20,090 | [
0.035996973514556885,
0.033360324800014496,
0.02205401286482811,
0.007306648418307304,
-0.02286958508193493,
0.010770044289529324,
-0.027908269315958023,
-0.016825402155518532,
-0.05916821211576462,
0.022970136255025864,
-0.02274669148027897,
0.02520458586513996,
0.008976899087429047,
0.02... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def move_left(self):
if self.focusWidget() is self.focused_column().view:
if self.current_view().header().isSortIndicatorShown():
QMessageBox(QMessageBox.NoIcon, ' ',
"Moving is not possible when the tree is sorted.\n"
"Click th... | |
20,091 | [
0.04898372292518616,
0.042601555585861206,
0.004734786227345467,
-0.03317806497216225,
-0.024952668696641922,
-0.032141249626874924,
-0.0002790038997773081,
0.027487102895975113,
-0.0570017546415329,
0.01814425364136696,
0.01603606343269348,
0.02799399010837078,
0.03693363443017006,
0.0016... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def insert_row(self):
# focus view after search with enter
if self.focused_column().search_bar.hasFocus():
self.current_view().setFocus()
if not self.selected_indexes():
self.set_top_row_selected()
elif self.current_view().hasFocus() and self.current_view(... | |
20,092 | [
0.019379323348402977,
-0.005346947815269232,
0.03053349256515503,
-0.0517897754907608,
-0.05676312744617462,
-0.029720541089773178,
-0.018243582919239998,
-0.05858031287789345,
-0.05757607892155647,
0.011722039431333542,
0.016282934695482254,
-0.01686873845756054,
0.038615185767412186,
-0.... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def copy(self):
if len(self.selected_indexes()) == 1:
date = self.current_view().model().getItem(self.selected_indexes()[0]).date
if date != "":
date = " [[" + date + "]]"
rows_string = self.selected_indexes()[0].data() + date
else:
selecte... | |
20,093 | [
0.03717741742730141,
0.029234079644083977,
-0.0024443119764328003,
-0.005303695797920227,
-0.032641466706991196,
0.018762333318591118,
0.006245068274438381,
0.00008672763942740858,
-0.0447952039539814,
0.025978615507483482,
0.020780721679329872,
-0.0003236814518459141,
0.04449136182665825,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def edit_row_without_check(self):
current_index = self.current_index()
if self.current_view().state() == QAbstractItemView.EditingState: # change column with tab key
if not self.focused_column().view.isHeaderHidden():
next_column_number = (current_index.column() + 2)
... | |
20,094 | [
0.022859694436192513,
0.010112930089235306,
0.02543140947818756,
-0.03968144580721855,
-0.010951532982289791,
-0.02608986757695675,
0.010448371060192585,
-0.013939443975687027,
-0.09059396386146545,
0.03282354027032852,
0.017989585176110268,
0.017244160175323486,
0.05058949813246727,
0.004... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def paste(self):
position = 0
# if there are no entries, pressing enter shall create a child of the current root entry
root_index = self.focused_column().view.rootIndex() if len(
self.focused_column().filter_proxy.getItem(self.current_view().rootIndex()).childItems) == 0 else None
... | |
20,095 | [
0.025857092812657356,
-0.018028903752565384,
-0.0050860303454101086,
-0.00847576279193163,
-0.040596552193164825,
0.008275186643004417,
-0.013650619424879551,
0.02073381282389164,
-0.015278149396181107,
-0.014281000941991806,
-0.0027564852498471737,
0.014166385866701603,
0.04084870591759682,... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "index", "annotation": null, "type_comment": null}}], "kwarg": nul... | def focus_index(self, index):
self.tab_bar.setCurrentIndex(0)
if index.model() is self.planned_view.model():
real_index = index.internalPointer()
index = self.focused_column().filter_proxy.mapFromSource(real_index)
else:
real_index = self.focused_column().filt... | |
20,096 | [
0.036892447620630264,
0.02037288434803486,
0.02220010571181774,
-0.020385313779115677,
-0.04591667652130127,
0.023244230076670647,
0.023256661370396614,
-0.02970786765217781,
-0.05722804367542267,
0.01905529759824276,
-0.014456171542406082,
-0.014182710088789463,
0.05141076818108559,
-0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def append_repeat(self):
if self.current_view() != self.planned_view:
index = self.current_index()
self.focused_column().filter_proxy.set_data(model.TASK, indexes=[index], field='type')
self.focused_column().filter_proxy.set_data(QDate.currentDate().toString('dd.MM.yy'), inde... | |
20,097 | [
0.01695491187274456,
0.013684306293725967,
0.025483470410108566,
0.002259897766634822,
-0.032501645386219025,
0.010669216513633728,
0.0068989344872534275,
0.013900075107812881,
-0.007540563587099314,
0.029957842081785202,
-0.007517850957810879,
0.015524021349847317,
0.007438356988132,
-0.0... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def refresh_path_bar(self):
while self.path_bar.layout().itemAt(0):
self.path_bar.layout().itemAt(0).widget().setParent(None)
widgets_to_add = []
def add_parents(current_index):
item = self.focused_column().filter_proxy.getItem(current_index)
text = item.tex... | |
20,098 | [
-0.001146642491221428,
0.022946877405047417,
0.027491368353366852,
-0.034964531660079956,
-0.02457391656935215,
-0.042774323374032974,
-0.01456481497734785,
-0.006861621048301458,
-0.030004864558577538,
0.04396374523639679,
-0.012062539346516132,
-0.012881669215857983,
0.04044036194682121,
... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def open_links_or_files(self):
for row_index in self.focused_column().view.selectionModel().selectedRows():
match = re.search(model.FIND_INTERNAL_LINK, row_index.data())
# open file
if row_index.data().startswith('file:///'):
QDesktopServices.openUrl(QUrl.from... | |
20,099 | [
0.035458583384752274,
0.020661618560552597,
0.011193589307367802,
-0.017199218273162842,
-0.014345839619636536,
-0.0032030020374804735,
0.024225521832704544,
-0.006783823017030954,
-0.01961274817585945,
0.06261643022298813,
-0.006095854099839926,
0.04754878953099251,
-0.008509383536875248,
... | 18 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def set_indentation_and_style_tree(self, i, view=None):
space_left_of_arrow = str(int(i) - 30 * 2)
if not view:
space_left_of_arrow = str(int(i) - 30)
view = self.focused_column().view
view.setIndentation(int(i))
padding_vertical = '8'
view.setStyleSheet(
... | |
20,100 | [
-0.0017292730044573545,
0.022121943533420563,
-0.009970812126994133,
-0.025143787264823914,
-0.046972472220659256,
-0.0005809401045553386,
-0.0009586706873960793,
-0.01498171966522932,
-0.033941563218832016,
0.023294979706406593,
0.01573399268090725,
0.013706679455935955,
0.0528886578977108,... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def split_window(self): # creates another item_view
new_column = QWidget()
new_column.toggle_sidebars_button = QPushButton()
new_column.toggle_sidebars_button.setToolTip(self.tr('Hide / show the sidebars'))
new_column.toggle_sidebars_button.setIcon(QIcon(':/toggle_sidebars'))
n... |