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 |
|---|---|---|---|---|---|
13,601 | [
0.02713683433830738,
0.01496388390660286,
-0.016733136028051376,
0.0039870464242994785,
0.006821587216109037,
0.033815138041973114,
-0.006454031448811293,
0.024333441630005836,
0.030226795002818108,
-0.00905184168368578,
0.026912562549114227,
0.06558690965175629,
-0.017144300043582916,
0.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": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen... | def wrapper(self, *args):
if not self.initialized:
util.SMlog("LVMCache: will initialize now")
self.refresh()
#util.SMlog("%s(%s): %s" % (op, args, self.toString()))
try:
ret = op(self, *args)
except KeyError:
util.logException("LVMCach... | |
13,602 | [
0.013575012795627117,
0.08496952056884766,
-0.03760781139135361,
0.010828586295247078,
0.01695619709789753,
0.06546172499656677,
-0.021594325080513954,
0.00969105027616024,
-0.025453148409724236,
0.01764751598238945,
0.07255090028047562,
0.03381183743476868,
-0.03637600690126419,
0.0334347... | 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": "ns", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def deactivate(self, ns, ref, lvName, binary):
lock = Lock(ref, ns)
lock.acquire()
try:
count = RefCounter.put(ref, binary, ns)
if count > 0:
return
refreshed = False
while True:
lvInfo = self.getLVInfo(lvName)
... | |
13,603 | [
0.035241495817899704,
0.09829625487327576,
-0.0062835561111569405,
0.020056234672665596,
0.02374599687755108,
0.05226555094122887,
0.014795582741498947,
0.03319568559527397,
-0.03745779022574425,
-0.008627712726593018,
0.057623621076345444,
0.0586952343583107,
-0.0106735210865736,
0.042864... | 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": "ns", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def activate(self, ns, ref, lvName, binary):
lock = Lock(ref, ns)
lock.acquire()
try:
count = RefCounter.get(ref, binary, ns)
if count == 1:
try:
self.activateNoRefcount(lvName)
except util.CommandException:
... | |
13,604 | [
0.006479533854871988,
0.06485366076231003,
-0.03270677477121353,
-0.0008915920043364167,
0.013029053807258606,
0.030887138098478317,
-0.03247348591685295,
-0.0008376445039175451,
-0.006409547757357359,
-0.013215682469308376,
0.04917680472135544,
0.05132304131984711,
-0.014463765546679497,
... | 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": "lvName", "annotation": null, "type_comment": null}}], "kwarg": nu... | def deactivateNoRefcount(self, lvName):
path = self._getPath(lvName)
if self.checkLV(lvName):
lvutil.deactivateNoRefcount(path)
self.lvs[lvName].active = False
else:
util.SMlog("LVMCache.deactivateNoRefcount: no LV %s" % lvName)
lvutil._lvmBugClean... | |
13,605 | [
-0.008045416325330734,
0.002991665154695511,
-0.03960636630654335,
-0.010653610341250896,
-0.0024276506155729294,
0.04960941895842552,
-0.020889433100819588,
-0.04495405778288841,
0.005881867371499538,
-0.024780835956335068,
0.016914471983909607,
0.06240568682551384,
0.012306859716773033,
... | 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": "lvName", "annotation": null, "type_comment": null}}, {"_type": "a... | def setHidden(self, lvName, hidden=True):
path = self._getPath(lvName)
if hidden:
lvutil.setHidden(path)
self._addTag(lvName, lvutil.LV_TAG_HIDDEN)
else:
lvutil.setHidden(path, hidden=False)
self._removeTag(lvName, lvutil.LV_TAG_HIDDEN) | |
13,606 | [
-0.015945561230182648,
0.006579635199159384,
-0.03186538442969322,
-0.012876137159764767,
-0.005015966482460499,
0.008461829274892807,
-0.039896078407764435,
-0.05688408389687538,
-0.020449956879019737,
0.013937887735664845,
0.013056312687695026,
0.0461764931678772,
-0.0006454960093833506,
... | 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": "lvName", "annotation": null, "type_comment": null}}], "kwarg": nu... | def getLVInfo(self, lvName = None):
result = dict()
lvs = []
if lvName == None:
lvs = self.lvs.keys()
elif self.lvs.get(lvName):
lvs = [lvName]
for lvName in lvs:
lvInfo = self.lvs[lvName]
lvutilInfo = lvutil.LVInfo(lvName)
... | |
13,607 | [
-0.04588139429688454,
-0.042596761137247086,
-0.038122422993183136,
-0.07045147567987442,
0.014599801041185856,
-0.02607014961540699,
0.004018501378595829,
-0.017884433269500732,
0.01845342479646206,
0.030078953132033348,
0.04303643852472305,
-0.06874450296163559,
-0.01615159586071968,
0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "twitter:card"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class TwitterCardIE(InfoExtractor):
IE_NAME = 'twitter:card'
_VALID_URL = r'https?://(?:www\.)?twitter\.com/i/cards/tfw/v1/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://twitter.com/i/cards/tfw/v1/560070183650213889',
'md5': '4fa26a35f9d1bf4b646590ba8e84be19',
'info_di... | |
13,608 | [
-0.031152885407209396,
-0.010482524521648884,
-0.0647595077753067,
-0.06076616793870926,
0.009165443480014801,
-0.026028897613286972,
-0.0025965748354792595,
0.009454119019210339,
-0.006188478320837021,
0.039524469524621964,
0.016971707344055176,
-0.04565882310271263,
-0.01176352147012949,
... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "twitter"}}, "targets": [{"_type": "Name", "_fields": {"id": "IE_NAME", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}... | class TwitterIE(InfoExtractor):
IE_NAME = 'twitter'
_VALID_URL = r'https?://(?:www\.|m\.|mobile\.)?twitter\.com/(?P<user_id>[^/]+)/status/(?P<id>\d+)'
_TEMPLATE_URL = 'https://twitter.com/%s/status/%s'
_TESTS = [{
'url': 'https://twitter.com/freethenipple/status/643211948184596480',
'md... | |
13,609 | [
-0.05736462026834488,
-0.027037793770432472,
-0.05083492025732994,
-0.0551396869122982,
0.018331527709960938,
-0.0060399724170565605,
0.010072666220366955,
-0.017243243753910065,
0.019359350204467773,
0.040024641901254654,
0.05078655481338501,
-0.059250980615615845,
0.01630006544291973,
-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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
video_id = self._match_id(url)
# Different formats served for different User-Agents
USER_AGENTS = [
'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/20.0 (Chrome)', # mp4
'Mozilla/5.0 (Windows NT 5.2; WOW64; rv:38.0) Gecko/2... | |
13,610 | [
-0.011708364821970463,
-0.004843830596655607,
-0.05674368888139725,
-0.04413918778300285,
-0.00017077138181775808,
-0.013143356889486313,
-0.011778649874031544,
0.005816110875457525,
0.0013251713244244456,
0.04388147592544556,
0.020874742418527603,
-0.05196428671479225,
0.0055320411920547485... | 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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
user_id = mobj.group('user_id')
twid = mobj.group('id')
webpage = self._download_webpage(self._TEMPLATE_URL % (user_id, twid), twid)
username = remove_end(self._og_search_title(webpage), ' on Twitter')
... | |
13,611 | [
0.031908318400382996,
-0.05133185535669327,
0.06555754691362381,
-0.023912586271762848,
0.027232743799686432,
0.03168448805809021,
0.04745212197303772,
0.011875465512275696,
-0.008462046273052692,
0.04620862007141113,
-0.00019779489957727492,
-0.0015504943439736962,
0.004625835921615362,
-... | 14 | {"_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}}, {"_type": "arg", "_fields": {"arg": "metrics", "annotation"... | class DNNLinearCombinedClassifierBenchmark(test.Benchmark):
def _assertSingleClassMetrics(self, metrics):
estimator_test_utils.assert_in_range(0.9, 1.0, 'auc', metrics)
estimator_test_utils.assert_in_range(0.9, 1.0,
'accuracy/threshold_0.500000_mean',
... | |
13,612 | [
0.02041057124733925,
-0.024520335718989372,
0.05263514444231987,
-0.029258504509925842,
-0.011876841075718403,
0.04114791378378868,
-0.011462094262242317,
-0.015584426932036877,
0.025739440694451332,
0.060427356511354446,
0.02394220419228077,
-0.07938003540039062,
-0.00015729745791759342,
... | 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": "metrics", "annotation": null, "type_comment": null}}], "kwarg": n... | def _assertSingleClassMetrics(self, metrics):
estimator_test_utils.assert_in_range(0.9, 1.0, 'auc', metrics)
estimator_test_utils.assert_in_range(0.9, 1.0,
'accuracy/threshold_0.500000_mean',
metrics)
estimator_test_utils.asse... | |
13,613 | [
0.031867966055870056,
-0.024880021810531616,
0.030839966610074043,
-0.02459854632616043,
-0.014538842253386974,
0.038207292556762695,
-0.01277655828744173,
-0.011834225617349148,
0.022334501147270203,
0.03637158125638962,
0.021575739607214928,
-0.025406258180737495,
0.0003560517216101289,
... | 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": "metrics", "annotation": null, "type_comment": null}}], "kwarg": n... | def _assertCommonMetrics(self, metrics):
estimator_test_utils.assert_in_range(_ITERS, _ITERS + 5, 'global_step',
metrics)
estimator_test_utils.assert_in_range(0.9, 1.0, 'accuracy', metrics)
estimator_test_utils.assert_in_range(0.0, 0.2, 'loss', metrics)
self.repo... | |
13,614 | [
0.028482818976044655,
-0.00643337843939662,
0.019454095512628555,
0.00488826772198081,
0.012679803185164928,
-0.011986978352069855,
0.041877444833517075,
0.01483525987714529,
-0.0017458099173381925,
0.04548453539609909,
-0.0010000603506341577,
0.007769541349261999,
0.026745257899165154,
-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 benchmarkMatrixData(self):
iris = test_data.prepare_iris_data_for_logistic_regression()
cont_feature = feature_column.real_valued_column('feature', dimension=4)
bucketized_feature = feature_column.bucketized_column(
cont_feature, test_data.get_quantile_based_buckets(iris.data, 10))
classifi... | |
13,615 | [
0.024642392992973328,
-0.03489362820982933,
0.023547174409031868,
-0.03664597496390343,
0.03640502691268921,
-0.006620589178055525,
0.01995486207306385,
0.01539875753223896,
-0.009577676653862,
0.04494772478938103,
0.011543591506779194,
0.01764395274221897,
0.03373269736766815,
-0.03835451... | 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 benchmarkTensorData(self):
def _input_fn():
iris = test_data.prepare_iris_data_for_logistic_regression()
features = {}
for i in range(4):
# The following shows how to provide the Tensor data for
# RealValuedColumns.
features.update({
str(i):
... | |
13,616 | [
0.013342230580747128,
-0.03571111336350441,
0.04531938210129738,
-0.01552910078316927,
0.029127242043614388,
-0.013656302355229855,
0.05225222557783127,
0.01762291230261326,
-0.012155737727880478,
0.04573814570903778,
-0.01834411360323429,
-0.0020182013977319,
0.02463717944920063,
-0.00847... | 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 benchmarkMultiClass(self):
iris = base.load_iris()
cont_feature = feature_column.real_valued_column('feature', dimension=4)
bucketized_feature = feature_column.bucketized_column(
cont_feature, test_data.get_quantile_based_buckets(iris.data, 10))
classifier = dnn_linear_combined.DNNLinearCom... | |
13,617 | [
0.041091371327638626,
-0.017988640815019608,
0.02909894287586212,
-0.012461405247449875,
0.007431061938405037,
-0.019909216091036797,
0.04569181799888611,
0.012450238689780235,
-0.0007334753754548728,
0.04089038074016571,
-0.004734440706670284,
0.016168560832738876,
0.005356952548027039,
-... | 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 benchmarkCustomOptimizer(self):
iris = test_data.prepare_iris_data_for_logistic_regression()
cont_feature = feature_column.real_valued_column('feature', dimension=4)
bucketized_feature = feature_column.bucketized_column(
cont_feature, test_data.get_quantile_based_buckets(iris.data, 10))
cla... | |
13,618 | [
0.02935270592570305,
-0.02307172492146492,
0.010100357234477997,
-0.039883196353912354,
0.01615849882364273,
-0.04523136094212532,
0.025289760902523994,
0.03337419405579567,
0.0017334887525066733,
0.04966743290424347,
0.012468681670725346,
0.02674081362783909,
0.03426555171608925,
-0.02446... | 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 _input_fn():
iris = test_data.prepare_iris_data_for_logistic_regression()
features = {}
for i in range(4):
# The following shows how to provide the Tensor data for
# RealValuedColumns.
features.update({
str(i):
array_ops.reshape(
... | |
13,619 | [
0.018659697845578194,
-0.022966671735048294,
0.043185193091630936,
-0.0426771305501461,
0.0170315932482481,
-0.0031147608533501625,
0.05149891972541809,
0.014191070571541786,
0.003790251212194562,
0.001802750863134861,
0.014687584713101387,
0.016373423859477043,
0.008902615867555141,
-0.00... | 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 benchmarkPartitionedVariables(self):
def _input_fn():
features = {
'language':
sparse_tensor.SparseTensor(
values=('en', 'fr', 'zh'),
indices=((0, 0), (0, 1), (2, 0)),
dense_shape=(3, 2))
}
labels = constant_op.cons... | |
13,620 | [
-0.02700059302151203,
0.0009247430716641247,
0.03993474692106247,
-0.004733269102871418,
-0.006102351471781731,
-0.021154092624783516,
0.061404574662446976,
0.055656060576438904,
-0.008769748732447624,
-0.003124665468931198,
-0.02046819031238556,
0.005114325787872076,
0.030832935124635696,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "settings", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "integ_db", "annotation": {"_type": "Name", "_fields": {"id": ... | def create_instance(settings, integ_db: MySqlIntegrationDb, auth: AbstractAuth):
plugin_conf = settings.get('plugins', 'user_items')
if integ_db.is_active and 'mysql_host' not in plugin_conf:
logging.getLogger(__name__).info(f'mysql_user_items uses integration_db[{integ_db.info}]')
db_backend = ... | |
13,621 | [
0.05388403311371803,
-0.01821720413863659,
0.03894183412194252,
-0.023027364164590836,
0.029065651819109917,
0.007503082975745201,
-0.04400785267353058,
-0.01163521595299244,
-0.03756019100546837,
0.016566909849643707,
0.010931601747870445,
-0.02850276045501232,
0.023679807782173157,
-0.01... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def import_legacy_record(data):
ans = FavoriteItem()
ans.ident = data['id']
ans.name = data.get('name', '??')
ans.corpora = [dict(id=data['corpus_id'], name=data['name'])]
if data.get('corpora', None):
for item in data.get('corpora', []):
try:
ans.corpora.append(d... | |
13,622 | [
-0.03561101108789444,
-0.00798655953258276,
0.019698170945048332,
-0.029583420604467392,
0.030306732282042503,
-0.017660845071077347,
-0.015997229143977165,
-0.006455550901591778,
0.0012416839599609375,
0.006895564962178469,
0.026907170191407204,
-0.032139118760824203,
-0.03700941428542137,
... | 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 HasWorkingProject(HasUserLoggedIn, HasVariablesInSession):
def __init__(self):
HasUserLoggedIn.__init__(self)
HasVariablesInSession.__init__(self)
self.listOfProjects = None
self.project = None
self.project_id = None
self.project_name = None
def get_context_data(self, **kwargs):
kwargs['proj... | |
13,623 | [
-0.008824980817735195,
-0.05170513316988945,
-0.01310714427381754,
0.0014668405055999756,
0.02171402797102928,
-0.01306458842009306,
-0.011245334520936012,
0.00969737209379673,
-0.007011045701801777,
0.0006147298845462501,
0.001005377504043281,
-0.025575954467058182,
0.019543688744306564,
... | 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": "request", "annotation": null, "type_comment": null}}, {"_type": "... | def setProject(self, request, project_folder):
if Project.objects.filter(folder=str(project_folder)).exists():
t_project = Project.objects.get(folder=str(project_folder))
if t_project.user == request.user or t_project.access == Project.PUBLIC:
self.project_id = t_project.id
# request.session['project... | |
13,624 | [
0.02297096699476242,
0.032191332429647446,
0.06502223014831543,
-0.047487545758485794,
-0.031791605055332184,
0.0062290760688483715,
0.00017966887389775366,
-0.04466281086206436,
-0.04381005838513374,
0.04181142523884773,
-0.0004971602465957403,
-0.0005304708029143512,
-0.026914939284324646,... | 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 ApplyScalingFactorTest(systemtesting.MantidSystemTest):
def runTest(self):
scaling_factor_file = FileFinder.getFullPath("directBeamDatabaseFall2014_IPTS_11601_2.cfg")
LiquidsReflectometryReduction(RunNumbers=[119814],
NormalizationRunNumber=119690,
... | |
13,625 | [
0.011688253842294216,
-0.02220594510436058,
-0.0018051022198051214,
-0.010065690614283085,
0.05729968100786209,
-0.017952509224414825,
0.002739525167271495,
-0.011728818528354168,
0.0012285126140341163,
-0.01547230500727892,
0.03854747861623764,
-0.038964711129665375,
0.009289178065955639,
... | 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": "request", "annotation": null, "type_comment": null}}], "kwarg": n... | def __loadProject(self, request, *args):
if self.hasProjectInSession():
self.project_id = self.getProjectFromSession()
if self.project_id is not None and Project.objects.filter(id=self.project_id).exists():
self.project = Project.objects.get(id=self.project_id)
self.project_name = self.project.name
eli... | |
13,626 | [
0.022195294499397278,
0.043220214545726776,
0.03924930468201637,
-0.03780723735690117,
0.020157590508461,
-0.00901291985064745,
-0.005966814234852791,
-0.04351281002163887,
0.00565854599699378,
-0.028778644278645515,
0.03864321857690811,
-0.02771276794373989,
0.0534609816968441,
0.02076367... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "table", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "col", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _convert_data_type(table, col, from_t, to_t, pk_attr='id'):
temp_col_n = 'convert_data_type_temp_col'
# Override column we're going to convert with from_t, since the type we're
# replacing could be custom and we need to tell SQLALchemy how to perform
# CRUD operations with it.
table = sa.Table(t... | |
13,627 | [
0.04948592185974121,
0.059292830526828766,
0.011437976732850075,
-0.02312215231359005,
-0.0050675878301262856,
0.01832127943634987,
-0.0018311021849513054,
0.0022221989929676056,
-0.03885834664106369,
-0.025727754458785057,
0.01496682409197092,
-0.01551051251590252,
-0.02896936982870102,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "migrate_engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl... | def upgrade(migrate_engine):
if migrate_engine.name == 'mysql':
meta = sa.MetaData(bind=migrate_engine)
for table_name, col_name, pk_attr in to_convert:
table = sa.Table(table_name, meta, autoload=True)
_convert_data_type(table, col_name, sa.DateTime(),
... | |
13,628 | [
0.04054556414484978,
0.05888359993696213,
0.005509822629392147,
-0.04283781722187996,
-0.0028101145289838314,
0.02201825939118862,
0.0024867805186659098,
-0.0011310119880363345,
-0.0420386828482151,
-0.019925789907574654,
-0.0062826694920659065,
-0.0330168753862381,
-0.011640025302767754,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "migrate_engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl... | def downgrade(migrate_engine):
if migrate_engine.name == 'mysql':
meta = sa.MetaData(bind=migrate_engine)
for table_name, col_name, pk_attr in to_convert:
table = sa.Table(table_name, meta, autoload=True)
_convert_data_type(table, col_name, models.PreciseTimestamp(),
... | |
13,629 | [
-0.029036784544587135,
-0.030927255749702454,
-0.03190435469150543,
0.012298681773245335,
0.01154461782425642,
0.028335824608802795,
0.020115461200475693,
-0.017778923735022545,
0.02453364059329033,
0.03649246320128441,
-0.021517382934689522,
-0.040252164006233215,
-0.004027871415019035,
-... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user_addon", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null... | def user_settings(user_addon, *args, **kwargs):
code = request.json.get('code')
if code is None:
raise HTTPError(code=http.BAD_REQUEST)
if user_addon.verify_code(code):
user_addon.is_confirmed = True
user_addon.save()
return {'message': 'Successfully verified two-factor aut... | |
13,630 | [
0.002686604391783476,
0.019923478364944458,
0.018072128295898438,
-0.006528770551085472,
-0.007350231055170298,
0.018721939995884895,
-0.028199385851621628,
-0.02611508220434189,
-0.008588551543653011,
-0.02084302343428135,
-0.004183930344879627,
-0.07160191982984543,
0.01070350594818592,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "my", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}... | def is_general_asset(my):
if my.has_value('asset_type') and \
my.get_value("asset_type") in ["general", 'image']:
return True
if not my.has_value('asset_library'):
return False
return False | |
13,631 | [
0.01801162213087082,
-0.004962626378983259,
-0.0440153144299984,
-0.02480134554207325,
0.015158996917307377,
0.0003545522631611675,
0.021052852272987366,
0.01692715287208557,
0.002501941751688719,
-0.04465185105800629,
0.00431430246680975,
-0.00018049933714792132,
0.04941408708691597,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "flash/shot"}}, "targets": [{"_type": "Name", "_fields": {"id": "SEARCH_TYPE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"... | class FlashShot(Shot):
SEARCH_TYPE = "flash/shot"
def get_foreign_key(my):
return "shot_code"
def get_code(my):
return my.get_value("code")
def get_all_instances(my):
return FlashInstance.get_all_by_shot(my)
def get_icon_context(my, context=None):
return "publish"... | |
13,632 | [
-0.0002913250937126577,
0.006254961248487234,
-0.03656914457678795,
-0.01058867760002613,
0.01158204860985279,
-0.025827640667557716,
-0.012837407179176807,
-0.020336810499429703,
0.012138772755861282,
-0.038905203342437744,
-0.0001697122206678614,
-0.05043267086148262,
0.03645998239517212,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "flash/asset"}}, "targets": [{"_type": "Name", "_fields": {"id": "SEARCH_TYPE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment... | class FlashAsset(FlashSObject):
SEARCH_TYPE = "flash/asset"
def get_code(my):
return my.get_value("code")
def get_asset_type(my):
return my.get_value("asset_type")
def get_asset_type_obj(my):
search = Search("prod/asset_type")
search.add_filter("code", my.get_asset... | |
13,633 | [
-0.017246363684535027,
0.005406257230788469,
-0.03663913160562515,
-0.0588114969432354,
0.0353083610534668,
-0.0010262498399242759,
0.004429643042385578,
0.008226096630096436,
-0.01000224705785513,
-0.011923279613256454,
0.0021544538903981447,
-0.024876832962036133,
0.02223675511777401,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "flash/layer"}}, "targets": [{"_type": "Name", "_fields": {"id": "SEARCH_TYPE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment... | class FlashLayer(FlashSObject):
SEARCH_TYPE = "flash/layer"
def get_foreign_key(my):
return "layer_id"
def get_frame_range(my):
shot = my.get_shot()
return shot.get_frame_range()
def get_shot(my):
return FlashShot.get_by_code( my.get_value("shot_code") )
def get(... | |
13,634 | [
0.0437566339969635,
-0.011644355952739716,
-0.03171667829155922,
-0.0009560296894051135,
0.0005826478009112179,
-0.02008952386677265,
0.048435017466545105,
0.03875718638300896,
-0.018025532364845276,
0.02628150023519993,
0.02992788702249527,
-0.007952103391289711,
-0.0003701569221448153,
-... | 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": "route53connection", "annotation": null, "type_comment": null}}, {... | def __init__(self, route53connection, change_dict):
self.route53connection = route53connection
for key in change_dict:
if key == 'Id':
self.__setattr__(key.lower(),
change_dict[key].replace('/change/', ''))
else:
se... | |
13,635 | [
0.0510513074696064,
0.06164075434207916,
0.0471438504755497,
-0.02003440074622631,
0.008011448197066784,
0.026936039328575134,
0.01642751507461071,
0.01182064414024353,
-0.058403804898262024,
-0.015595157630741596,
0.01747952401638031,
0.004043295979499817,
-0.02769903466105461,
0.04212657... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "migrate_engine", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonl... | def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
cn = Table('compute_nodes', meta, autoload=True)
shadow_cn = Table('shadow_compute_nodes', meta, autoload=True)
cn.create_column(Column('disk_allocation_ratio', Float, nullable=True))
shadow_cn.create_column(Column('disk_... | |
13,636 | [
0.02482416480779648,
-0.010939356870949268,
0.03225019946694374,
-0.012418323196470737,
-0.025535566732287407,
-0.034321997314691544,
-0.010783348232507706,
0.0032356283627450466,
0.01920783892273903,
0.029779013246297836,
-0.0029938144143670797,
-0.04425665736198425,
-0.02635929547250271,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "s", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}},... | def _string_to_perm(s):
rv = [Perm(range(20))]
p = None
for si in s:
if si not in '01':
count = int(si) - 1
else:
count = 1
if si == '0':
p = _f0
elif si == '1':
p = _f... | |
13,637 | [
-0.01770315133035183,
-0.008540185168385506,
0.05148329958319664,
0.05176009237766266,
0.018902583047747612,
0.028624899685382843,
0.018671922385692596,
-0.00905340351164341,
-0.005645402241498232,
0.021451376378536224,
0.014347049407660961,
-0.019075578078627586,
0.035429369658231735,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "polyh", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "ordered_faces", "annotation": null, "type_comment": null}}, {"_t... | def _pgroup_of_double(polyh, ordered_faces, pgroup):
n = len(ordered_faces[0])
# the vertices of the double which sits inside a give polyhedron
# can be found by tracking the faces of the outer polyhedron.
# A map between face and the vertex of the double is made so that
# after ... | |
13,638 | [
0.011236729100346565,
0.005089699290692806,
-0.024442996829748154,
0.009598903357982635,
0.005934527143836021,
-0.006172944791615009,
-0.0282784104347229,
-0.03592851012945175,
0.04992259293794632,
-0.01737339422106743,
-0.003985721617937088,
-0.002161308191716671,
0.010790991596877575,
-0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _generate_sum(
name, value, attributes=None, description=None, unit=None
) -> Sum:
if attributes is None:
attributes = BoundedAttributes(attributes={"a": 1, "b": True})
return _generate_metric(
name,
Sum(
data_points=[
NumberDataPoint(
... | |
13,639 | [
-0.019006522372364998,
0.010510638356208801,
-0.028144868090748787,
0.012664162553846836,
0.016991769894957542,
0.0078482860699296,
-0.03377795219421387,
-0.06632238626480103,
0.04934089258313179,
-0.014041596092283726,
-0.005183363799005747,
-0.013476231135427952,
0.013866846449673176,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _generate_metric(
name, data, attributes=None, description=None, unit=None
) -> Metric:
if description is None:
description = "foo"
if unit is None:
unit = "s"
return Metric(
name=name,
description=description,
unit=unit,
data=data,
) | |
13,640 | [
0.015647849068045616,
0.002840968081727624,
0.03017965517938137,
0.03492283821105957,
-0.043781425803899765,
0.0001612122287042439,
-0.010073448531329632,
0.0045135789550840855,
-0.012474102899432182,
0.10825614631175995,
0.03696891665458679,
-0.036410894244909286,
0.036294639110565186,
-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": "states", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, states, first):
self.regexes = {}
self.toks = {}
for state, rules in states.items():
parts = []
for tok in rules:
groupid = "t%d" % tok.id
self.toks[groupid] = tok
parts.append("(?P<%s>%s)" % (groupid, to... | |
13,641 | [
-0.01201668195426464,
0.0317399688065052,
-0.02177291549742222,
0.0008322958019562066,
-0.024970337748527527,
0.0049278936348855495,
-0.04998752474784851,
-0.08025176078081131,
0.0631520003080368,
-0.00876070000231266,
0.009340452030301094,
-0.021409839391708374,
-0.009527847170829773,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _generate_gauge(
name, value, attributes=None, description=None, unit=None
) -> Gauge:
if attributes is None:
attributes = BoundedAttributes(attributes={"a": 1, "b": True})
return _generate_metric(
name,
Gauge(
data_points=[
NumberDataPoint(
... | |
13,642 | [
0.04129321128129959,
0.051422569900751114,
-0.016656924039125443,
0.009065444581210613,
-0.04167001321911812,
0.02294067293405533,
-0.01793140545487404,
-0.031030861660838127,
0.02289634384214878,
0.0362839438021183,
0.026376232504844666,
-0.0034937425516545773,
0.025245822966098785,
0.030... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "State", "value": {"_type": "Name", "_fields": {"id": "QValidator", "ctx... | class RuleExpressionValidator(QValidator):
validation_status_changed = pyqtSignal(QValidator.State, str)
def __init__(self, sim_expression_parser, is_formula=True, parent=None):
super().__init__(parent)
self.parser = sim_expression_parser
self.is_formula = is_formula
def validate(s... | |
13,643 | [
0.07710061222314835,
0.031081870198249817,
-0.022936150431632996,
-0.017883973196148872,
0.06231017783284187,
0.0067362356930971146,
-0.0064250510185956955,
0.02463851310312748,
-0.062163740396499634,
-0.02504122443497181,
-0.007116063963621855,
-0.06055290251970291,
-0.0038326068315654993,
... | 10 | {"_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 DictTreeItem(SequenceTreeItem):
def keys(self):
keys = list(self.object.keys())
try:
keys.sort()
except:
pass
return keys | |
13,644 | [
0.026876967400312424,
0.025077080354094505,
-0.008215777575969696,
0.021113283932209015,
-0.004221645649522543,
-0.06180286779999733,
0.00005399503788794391,
0.006613068748265505,
-0.022286243736743927,
0.010243178345263004,
0.00024694731109775603,
-0.047686900943517685,
-0.00554122589528560... | 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": "user", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, user, surveyapp_id, *args, **kwargs):
super(SurveyResponseForm, self).__init__(*args, **kwargs)
self.fields['surveyquestion'].widget = forms.HiddenInput()
self.fields['key'].widget.attrs['class'] = "input-small"
self.fields['keyvalue'].widget.attrs['class'] = "input-sm... | |
13,645 | [
0.04186338558793068,
0.017803968861699104,
-0.009776871651411057,
0.03851693868637085,
-0.0015747981378808618,
-0.04031045734882355,
0.0006817973917350173,
-0.014096630737185478,
-0.02155504934489727,
0.0035596999805420637,
-0.00869966670870781,
-0.029921164736151695,
-0.011526647955179214,
... | 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": "user", "annotation": null, "type_comment": null}}], "kwarg": {"_t... | def __init__(self, user, *args, **kwargs):
super(SurveyQuestionForm, self).__init__(*args, **kwargs)
self.fields['question'].widget.attrs['class'] = 'span5'
self.fields['surveyapp'].widget = forms.HiddenInput()
self.fields['audio_message'].choices = get_audiofile_list(user)
self.... | |
13,646 | [
0.06122136116027832,
0.024370985105633736,
0.022596290335059166,
-0.034838300198316574,
0.004360439721494913,
-0.02276584692299366,
0.016526151448488235,
0.03418268263339996,
0.0212172269821167,
-0.02620219998061657,
-0.00802004337310791,
-0.03759642690420151,
-0.021556340157985687,
-0.025... | 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 NotImplementedKeyManagerTestCase(test_key_mgr.KeyManagerTestCase):
def _create_key_manager(self):
return not_implemented_key_mgr.NotImplementedKeyManager()
def setUp(self):
super(NotImplementedKeyManagerTestCase, self).setUp()
def test_create_key(self):
self.assertRaises(Not... | |
13,647 | [
0.04944463074207306,
0.01654559001326561,
0.023249223828315735,
0.012393181212246418,
0.001110822893679142,
-0.060076504945755005,
-0.017826540395617485,
0.023953745141625404,
-0.04122520610690117,
0.029974205419421196,
-0.006895775441080332,
-0.03902624547481537,
-0.0007005189545452595,
-... | 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": "user", "annotation": null, "type_comment": null}}], "kwarg": {"_t... | def __init__(self, user, *args, **kwargs):
super(SurveyReportForm, self).__init__(*args, **kwargs)
self.fields.keyOrder = ['campaign']
# To get user's campaign list which are attached with survey app
if user:
list = []
try:
camp_list = Campaign.obj... | |
13,648 | [
0.03553082421422005,
-0.018567176535725594,
-0.07642080634832382,
-0.048105865716934204,
-0.015729350969195366,
0.004151240922510624,
0.03439147397875786,
-0.008044017478823662,
0.004074756521731615,
0.0007127527496777475,
0.07279177010059357,
-0.012638338841497898,
0.007516541518270969,
-... | 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": "season_list", "annotation": null, "type_comment": null}}, {"_type... | def _extract_playlist(self, season_list, video_id, program_info, prompt=True):
episode_title = program_info['title']
content_id = season_list['contentId']
if prompt:
self.to_screen('Downloading playlist %s - add --no-playlist to just download video %s' % (content_id, video_id))
... | |
13,649 | [
-0.015193793922662735,
-0.022449124604463577,
-0.07863082736730576,
-0.07938463240861893,
0.02276713401079178,
-0.016124267131090164,
0.010582653805613518,
0.004990984685719013,
-0.005638781934976578,
0.000595899997279048,
0.05238914489746094,
0.000976849114522338,
-0.008309474214911461,
-... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "https?://(?:www\\.)?litv\\.tv/(?:vod|promo)/[^/]+/(?:content\\.do)?\\?.*?\\b(?:content_)?id=(?P<id>[^&]+)"}}, "targets": [{"_type": "Name... | class LiTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?litv\.tv/(?:vod|promo)/[^/]+/(?:content\.do)?\?.*?\b(?:content_)?id=(?P<id>[^&]+)'
_URL_TEMPLATE = 'https://www.litv.tv/vod/%s/content.do?id=%s'
_TESTS = [{
'url': 'https://www.litv.tv/vod/drama/content.do?brc_id=root&id=VOD00041610&is... | |
13,650 | [
-0.010160711593925953,
0.006374145392328501,
-0.00835944339632988,
-0.028262615203857422,
0.013506718911230564,
-0.03029252588748932,
0.011075287126004696,
0.028396455571055412,
0.007522941567003727,
0.03582459315657616,
0.00021696771727874875,
-0.04523802921175957,
0.0030755391344428062,
... | 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": "uri", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def get_parts_information(self, uri, upload_id):
multipart_response = self.s3.list_multipart(uri, upload_id)
tree = getTreeFromXml(multipart_response['data'])
parts = defaultdict(lambda: None)
for elem in parseNodes(tree):
try:
parts[int(elem['PartNumber'])] ... | |
13,651 | [
-0.0393456406891346,
-0.002877576043829322,
-0.05901845917105675,
-0.0614045225083828,
0.020439768210053444,
-0.025345798581838608,
-0.02147453837096691,
-0.002690404187887907,
0.008752943947911263,
-0.0047477721236646175,
0.04759946092963219,
-0.00017404694517608732,
-0.0031834421679377556,... | 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": "url", "annotation": null, "type_comment": null}}], "kwarg": null,... | def _real_extract(self, url):
url, data = unsmuggle_url(url, {})
video_id = self._match_id(url)
noplaylist = self._downloader.params.get('noplaylist')
noplaylist_prompt = True
if 'force_noplaylist' in data:
noplaylist = data['force_noplaylist']
noplaylis... | |
13,652 | [
0.03649269789457321,
-0.027353394776582718,
-0.02909523993730545,
-0.009499498642981052,
-0.003126179100945592,
-0.04765339940786362,
0.04343856871128082,
0.0329660028219223,
-0.005475517362356186,
0.0008225372293964028,
0.00411537429317832,
-0.017289411276578903,
-0.0004505810793489218,
-... | 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": "uri", "annotation": null, "type_comment": null}}], "kwarg": null,... | def get_unique_upload_id(self, uri):
upload_id = None
multipart_response = self.s3.get_multipart(uri)
tree = getTreeFromXml(multipart_response['data'])
for mpupload in parseNodes(tree):
try:
mp_upload_id = mpupload['UploadId']
mp_path = mpuploa... | |
13,653 | [
-0.006533000618219376,
-0.004781362134963274,
-0.02535802312195301,
0.041224610060453415,
0.037700966000556946,
0.007113485597074032,
0.025072872638702393,
0.07601296901702881,
0.02216026373207569,
0.01676277443766594,
-0.022689830511808395,
0.005820124410092831,
0.00598815968260169,
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}}, {"_type": "arg", "_fields": {"arg": "username", "annotation": null, "type_comment": null}}, {"_type": ... | def authenticate(self, username=None, password=None):
user = self.user_entity.objects(username=username).first()
if user:
if password and user.check_password(password):
backend = auth.get_backends()[0]
user.backend = "%s.%s" % (backend.__module__, backend.__cl... | |
13,654 | [
0.017105640843510628,
-0.03173040598630905,
0.010531319305300713,
-0.0182468444108963,
-0.004530699923634529,
-0.025106467306613922,
0.012646266259253025,
0.0034112047869712114,
0.01801116019487381,
0.0002056413795799017,
0.03609674796462059,
0.007777546998113394,
-0.05517468601465225,
-0.... | 8 | {"_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(self):
super(ComputeValidateDeviceTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
# check if test name includes "xen"
if 'xen' in self.id():
self.flags(compute_driver='xenapi.XenAPIDriver')
self.instance = {
... | |
13,655 | [
0.026453780010342598,
-0.005948810372501612,
0.029085997492074966,
-0.022531777620315552,
0.025414055213332176,
0.007370207458734512,
-0.004122709855437279,
-0.009219340048730373,
0.04982786625623703,
0.005215079989284277,
0.04003601893782616,
-0.0026289266534149647,
-0.04100994020700455,
... | 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 ComputeValidateDeviceTestCase(test.TestCase):
def setUp(self):
super(ComputeValidateDeviceTestCase, self).setUp()
self.context = context.RequestContext('fake', 'fake')
# check if test name includes "xen"
if 'xen' in self.id():
self.flags(compute_driver='xenapi.XenAP... | |
13,656 | [
0.050737228244543076,
-0.00037629040889441967,
0.02637036330997944,
-0.03771449252963066,
0.037281304597854614,
-0.01123583223670721,
-0.007059622555971146,
0.012014218606054783,
0.026614032685756683,
0.0024637607857584953,
0.01493147388100624,
0.017503531649708748,
0.0033470597118139267,
... | 8 | {"_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_later(self):
self.data = [
self._fake_bdm('/dev/vdc'),
self._fake_bdm('/dev/vdd'),
self._fake_bdm('/dev/vde'),
]
device = self._validate_device()
self.assertEqual(device, '/dev/vdf') | |
13,657 | [
0.015653979033231735,
0.009825127199292183,
-0.005497732665389776,
-0.03503020480275154,
0.008021094836294651,
0.03612632676959038,
0.03685707226395607,
0.020883390679955482,
-0.022755930200219154,
0.01629338413476944,
0.016544578596949577,
0.000042928735638270155,
-0.03228989988565445,
-0... | 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": "instance_type_info", "annotation": null, "type_comment": null}}],... | def _update_instance_type(self, instance_type_info):
self.instance_type = {
'id': 1,
'name': 'foo',
'memory_mb': 128,
'vcpus': 1,
'root_gb': 10,
'ephemeral_gb': 10,
'flavorid': 1,
'swap': 0,
'rxtx_factor'... | |
13,658 | [
0.00927609484642744,
0.015555604360997677,
0.02197495475411415,
-0.04123300686478615,
0.031244391575455666,
0.031883664429187775,
0.01382424496114254,
0.03502674773335457,
0.02430563233792782,
-0.02959294058382511,
0.011906430125236511,
0.0144635159522295,
-0.023839497938752174,
0.00199772... | 8 | {"_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_ephemeral_xenapi(self):
self._update_instance_type({
'ephemeral_gb': 10,
'swap': 0,
})
self.stubs.Set(instance_types, 'get_instance_type',
lambda instance_type_id, ctxt=None: self.instance_type)
device = self._valida... | |
13,659 | [
0.05353228375315666,
-0.03084619529545307,
0.03057583048939705,
-0.042398158460855484,
0.01931881345808506,
0.0012220193166285753,
-0.02070750668644905,
-0.009106386452913284,
0.07344098389148712,
-0.03249296545982361,
0.00828300230205059,
0.0353686660528183,
-0.005889656953513622,
0.02312... | 7 | {"_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_name_conversion(self):
self.data = []
device = self._validate_device('/dev/c')
self.assertEqual(device, '/dev/vdc')
device = self._validate_device('/dev/sdc')
self.assertEqual(device, '/dev/vdc')
device = self._validate_device('/dev/xvdc')
self.assertEqua... | |
13,660 | [
0.0015529313823208213,
0.010669403709471226,
0.028771426528692245,
-0.044494759291410446,
0.013666427694261074,
0.017477380111813545,
0.003381904447451234,
0.028064759448170662,
0.02022833190858364,
-0.05007237568497658,
0.03179999813437462,
0.004590178374201059,
-0.038866665214300156,
0.0... | 8 | {"_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_swap_xenapi(self):
self._update_instance_type({
'ephemeral_gb': 0,
'swap': 10,
})
self.stubs.Set(instance_types, 'get_instance_type',
lambda instance_type_id, ctxt=None: self.instance_type)
device = self._validate_de... | |
13,661 | [
0.014357890002429485,
0.011929024942219257,
0.02131480537354946,
-0.03859271854162216,
0.019605854526162148,
0.03541702777147293,
0.013227559626102448,
0.030841879546642303,
0.015299832448363304,
-0.037704601883888245,
0.026360925287008286,
0.007286595646291971,
-0.029846111312508583,
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_swap_and_ephemeral_xenapi(self):
self._update_instance_type({
'ephemeral_gb': 10,
'swap': 10,
})
self.stubs.Set(instance_types, 'get_instance_type',
lambda instance_type_id, ctxt=None: self.instance_type)
device = se... | |
13,662 | [
0.018197303637862206,
0.014528810977935791,
0.04093403369188309,
-0.03900741785764694,
0.0015125931240618229,
-0.010259900242090225,
0.01838204637169838,
0.03140651434659958,
0.00040206604171544313,
-0.051094964146614075,
0.022591575980186462,
-0.0016618729569017887,
-0.022050539031624794,
... | 8 | {"_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_swap_and_one_attachment_xenapi(self):
self._update_instance_type({
'ephemeral_gb': 0,
'swap': 10,
})
self.stubs.Set(instance_types, 'get_instance_type',
lambda instance_type_id, ctxt=None: self.instance_type)
device ... | |
13,663 | [
-0.010829034261405468,
-0.018891729414463043,
0.004493562504649162,
-0.03731081634759903,
-0.03920137882232666,
-0.02764948457479477,
0.015319121070206165,
0.009786443784832954,
-0.02632887102663517,
0.006262490060180426,
0.02231142483651638,
-0.01802985556423664,
-0.043955590575933456,
-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 setUp(self):
def fake_get_nw_info(cls, ctxt, instance):
self.assertTrue(ctxt.is_admin)
return fake_network.fake_get_instance_nw_info(self.stubs, 1, 1,
spectacular=True)
super(UsageInfoTestCase, self).setUp()
s... | |
13,664 | [
0.013225801289081573,
0.02162865921854973,
0.03458099439740181,
-0.05205794796347618,
-0.01909288577735424,
0.00538851972669363,
0.04780679568648338,
-0.004785651806741953,
0.008477440103888512,
0.021317902952432632,
0.020112168043851852,
0.024152003228664398,
-0.00697959354147315,
-0.0066... | 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_notify_usage_exists(self):
# Ensure 'exists' notification generates appropriate usage data.
instance_id = self._create_instance()
instance = db.instance_get(self.context, instance_id)
# Set some system metadata
sys_metadata = {'image_md_key1': 'val1',
... | |
13,665 | [
0.028587019070982933,
0.029409319162368774,
0.019747294485569,
-0.05751263350248337,
-0.011826609261333942,
0.015139995142817497,
0.055432695895433426,
0.0064937518909573555,
0.0028009596280753613,
0.023508107289671898,
0.01852593570947647,
0.007358376402407885,
-0.01536975521594286,
-0.00... | 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_notify_usage_exists_deleted_instance(self):
# Ensure 'exists' notification generates appropriate usage data.
instance_id = self._create_instance()
instance = db.instance_get(self.context, instance_id)
# Set some system metadata
sys_metadata = {'image_md_key1': 'val1',
... | |
13,666 | [
0.02063238061964512,
0.015452283434569836,
0.016885612159967422,
-0.03666302561759949,
-0.023222429677844048,
0.016282103955745697,
0.06060212105512619,
0.021147876977920532,
0.011422619223594666,
0.030728543177247047,
0.023159565404057503,
0.017401106655597687,
-0.02866656333208084,
-0.01... | 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_notify_about_instance_usage(self):
instance_id = self._create_instance()
instance = db.instance_get(self.context, instance_id)
# Set some system metadata
sys_metadata = {'image_md_key1': 'val1',
'image_md_key2': 'val2',
'other_data... | |
13,667 | [
0.0093664126470685,
0.01673150807619095,
0.0323442667722702,
-0.05474410206079483,
-0.007532907649874687,
-0.003893866902217269,
0.04315883666276932,
-0.0009983278578147292,
0.0026772276032716036,
0.00865787174552679,
0.009571515955030918,
0.0136984558776021,
-0.0025094153825193644,
-0.006... | 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_notify_usage_exists_instance_not_found(self):
# Ensure 'exists' notification generates appropriate usage data.
instance_id = self._create_instance()
instance = db.instance_get(self.context, instance_id)
self.compute.terminate_instance(self.context, instance)
compute_util... | |
13,668 | [
-0.008388507179915905,
0.038943976163864136,
0.034534018486738205,
0.03562052920460701,
-0.00598646467551589,
0.0010618785163387656,
0.00854828767478466,
-0.008063619025051594,
-0.023818034678697586,
0.03361793980002403,
-0.04848823323845863,
-0.06962194293737411,
0.034065328538417816,
0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "res.partner"}}, "targets": [{"_type": "Name", "_fields": {"id": "_inherit", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": ... | class res_partner_country_code(models.Model):
_inherit = 'res.partner'
def default_country_id(self):
email = self.env.context.get('default_email', False)
if email:
top_level_domain = email.split(".")[-1]
if len(top_level_domain) == 2:
if top_level_domain ... | |
13,669 | [
-0.0044278488494455814,
-0.0024632401764392853,
0.043081771582365036,
0.02922266162931919,
0.029838114976882935,
-0.013562779873609543,
0.0023848838172852993,
0.050467219203710556,
-0.019455181434750557,
0.038203731179237366,
-0.023011136800050735,
-0.02703438140451908,
0.013312038965523243,... | 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 default_country_id(self):
email = self.env.context.get('default_email', False)
if email:
top_level_domain = email.split(".")[-1]
if len(top_level_domain) == 2:
if top_level_domain == 'uk':
top_level_domain = 'GB'
country = s... | |
13,670 | [
0.04303567856550217,
-0.028202632442116737,
0.030410224571824074,
-0.029889332130551338,
0.019521081820130348,
0.00020037325157318264,
0.014212936162948608,
0.0462106429040432,
-0.018144438043236732,
-0.013592825271189213,
0.03447815030813217,
0.029492462053894997,
-0.005208929535001516,
-... | 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 setUp(self):
# It is easier to write test vectors in text form,
# and convert them to byte strigs dynamically here
for mname, mvalue in ImportKeyTests.__dict__.items():
if mname[:4] in ('der_', 'pem_', 'ssh_'):
if mname[:4] == 'der_':
mvalue =... | |
13,671 | [
0.0763794556260109,
-0.00903183501213789,
0.05713050812482834,
-0.021394308656454086,
0.03254779428243637,
0.024914590641856194,
-0.008024347014725208,
0.04146110266447067,
-0.000964521779678762,
0.0006726465071551502,
0.04098698869347572,
-0.02657398208975792,
-0.03207368403673172,
-0.026... | 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 testImportKey2(self):
for pem in (self.pem_public, tostr(self.pem_public)):
key_obj = DSA.importKey(pem)
self.failIf(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q)
... | |
13,672 | [
0.07444272190332413,
0.005242866929620504,
0.05665891245007515,
0.001411080127581954,
0.03671804443001747,
0.012666766531765461,
-0.010228084400296211,
0.0395941324532032,
0.0006280205561779439,
-0.01550690270960331,
0.03980983793735504,
-0.02564510889351368,
-0.022361576557159424,
-0.0414... | 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 testImportKey4(self):
for pem in (self.pem_private, tostr(self.pem_private)):
key_obj = DSA.importKey(pem)
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_o... | |
13,673 | [
0.06436188519001007,
-0.007595916744321585,
0.05119805783033371,
-0.035605479031801224,
0.032836705446243286,
0.011336192488670349,
-0.01534970197826624,
0.048113543540239334,
0.01214982382953167,
-0.02737201564013958,
0.03213236853480339,
-0.028537817299365997,
-0.02329171635210514,
-0.02... | 8 | {"_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 testImportKey3(self):
key_obj = DSA.importKey(self.der_private)
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q)
self.assertEqual(self.g, key_obj.g)
self.assertEq... | |
13,674 | [
0.06008836627006531,
0.008121170103549957,
0.031821247190237045,
-0.022841161116957664,
0.026750696823000908,
0.019061945378780365,
-0.020696841180324554,
0.04208081215620041,
0.019298886880278587,
-0.021312888711690903,
0.03793433681130409,
-0.031205197796225548,
-0.030399596318602562,
-0... | 8 | {"_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 testImportKey5(self):
key_obj = DSA.importKey(self.der_pkcs8)
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q)
self.assertEqual(self.g, key_obj.g)
self.assertEqua... | |
13,675 | [
0.06681317836046219,
0.005563877057284117,
0.058881450444459915,
-0.015245256014168262,
0.028834180906414986,
0.016411688178777695,
-0.0034497203305363655,
0.04899011179804802,
0.0022497542668133974,
-0.022687086835503578,
0.024775000289082527,
-0.021100740879774094,
-0.02577812969684601,
... | 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 testImportKey6(self):
for pem in (self.pem_pkcs8, tostr(self.pem_pkcs8)):
key_obj = DSA.importKey(pem)
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q... | |
13,676 | [
0.07443778961896896,
0.006080488208681345,
0.05999882146716118,
-0.009444908238947392,
0.027382640168070793,
0.023399073630571365,
0.00434570899233222,
0.06415762007236481,
0.0035776167642325163,
-0.010443720035254955,
0.028527477756142616,
-0.010011485777795315,
-0.012406298890709877,
-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 testImportKey8(self):
for pem in (self.pem_private_encrypted, tostr(self.pem_private_encrypted)):
key_obj = DSA.importKey(pem, "PWDTEST")
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
... | |
13,677 | [
0.04295460879802704,
-0.016392651945352554,
0.03878316283226013,
-0.026674699038267136,
0.03152259439229965,
-0.0022449702955782413,
-0.01271727029234171,
0.044848669320344925,
-0.013224608264863491,
-0.03134220838546753,
0.021950820460915565,
-0.009921274147927761,
-0.007734084501862526,
... | 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 testImportKey7(self):
for ssh in (self.ssh_pub, tostr(self.ssh_pub)):
key_obj = DSA.importKey(ssh)
self.failIf(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q)
... | |
13,678 | [
0.05152490735054016,
-0.011190793476998806,
0.06131609529256821,
-0.0093912985175848,
0.01787376217544079,
0.031724411994218826,
-0.007755395490676165,
0.07406402379274368,
0.004529029596596956,
-0.011202910915017128,
0.03305737301707268,
-0.0253019779920578,
-0.028016366064548492,
-0.0394... | 7 | {"_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 testExportKey8(self):
tup = (self.y, self.g, self.p, self.q, self.x)
key = DSA.construct(tup)
encoded = key.export_key('PEM', pkcs8=False, passphrase="PWDTEST")
key = DSA.importKey(encoded, "PWDTEST")
self.assertEqual(self.y, key.y)
self.assertEqual(self.p, key.p)
... | |
13,679 | [
0.061553362756967545,
0.005402658134698868,
0.05222569778561592,
-0.017985772341489792,
0.050886575132608414,
0.009991454891860485,
0.007093875203281641,
0.06464719027280807,
0.00891207717359066,
-0.013137233443558216,
0.023365342989563942,
-0.009598953649401665,
-0.015007384121418,
-0.039... | 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 testImportKey9(self):
for pem in (self.pem_pkcs8_encrypted, tostr(self.pem_pkcs8_encrypted)):
key_obj = DSA.importKey(pem, "PWDTEST")
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
sel... | |
13,680 | [
0.06299595534801483,
0.007496243808418512,
0.04947062209248543,
-0.01845405623316765,
0.029434790834784508,
0.024918705224990845,
0.0022021648474037647,
0.06418801844120026,
0.02494163066148758,
-0.01970342919230461,
0.03819186985492706,
-0.02092987857758999,
-0.016849355772137642,
-0.0321... | 8 | {"_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 testImportKey10(self):
key_obj = DSA.importKey(self.der_pkcs8_encrypted, "PWDTEST")
self.failUnless(key_obj.has_private())
self.assertEqual(self.y, key_obj.y)
self.assertEqual(self.p, key_obj.p)
self.assertEqual(self.q, key_obj.q)
self.assertEqual(self.g, key_obj.g)
... | |
13,681 | [
0.020593518391251564,
-0.006415426731109619,
0.041648950427770615,
-0.0357724167406559,
0.06066427379846573,
0.021299216896295547,
-0.022877411916851997,
-0.0025437166914343834,
0.009623140096664429,
-0.020965613424777985,
0.04970672354102135,
-0.04311166703701019,
-0.029793240129947662,
-... | 10 | {"_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 ImportKeyFromX509Cert(unittest.TestCase):
def test_x509v1(self):
# Sample V1 certificate with a 1024 bit DSA key
x509_v1_cert = """
-----BEGIN CERTIFICATE-----
MIIDUjCCArsCAQIwDQYJKoZIhvcNAQEFBQAwfjENMAsGA1UEChMEQWNtZTELMAkG
A1UECxMCUkQxHDAaBgkqhkiG9w0BCQEWDXNwYW1AYWNtZS5vcmcxEzARBgNVBAcT
Ck... | |
13,682 | [
0.03053937666118145,
-0.016697699204087257,
0.04138724505901337,
-0.0259547121822834,
0.043090835213661194,
0.021344995126128197,
-0.0233492199331522,
0.0008063873974606395,
0.00833632331341505,
-0.01628432795405388,
0.047049179673194885,
-0.044493794441223145,
-0.022823112085461617,
-0.03... | 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_x509v3(self):
# Sample V3 certificate with a 1024 bit DSA key
x509_v3_cert = """
-----BEGIN CERTIFICATE-----
MIIFhjCCA26gAwIBAgIBAzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEL
MAkGA1UECAwCTUQxEjAQBgNVBAcMCUJhbHRpbW9yZTEQMA4GA1UEAwwHVGVzdCBD
QTEfMB0GCSqGSIb3DQEJARYQdGVzdEBleGFtcGxlLmNvbTAeFw0xNDA... | |
13,683 | [
0.034500282257795334,
-0.017828013747930527,
0.04482823237776756,
-0.023348551243543625,
0.03799211233854294,
0.026655955240130424,
-0.023655930534005165,
0.0030307623092085123,
0.004564586095511913,
-0.005981605965644121,
0.052475836127996445,
-0.05065615102648735,
-0.025180533528327942,
... | 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_x509v1(self):
# Sample V1 certificate with a 1024 bit DSA key
x509_v1_cert = """
-----BEGIN CERTIFICATE-----
MIIDUjCCArsCAQIwDQYJKoZIhvcNAQEFBQAwfjENMAsGA1UEChMEQWNtZTELMAkG
A1UECxMCUkQxHDAaBgkqhkiG9w0BCQEWDXNwYW1AYWNtZS5vcmcxEzARBgNVBAcT
Ck1ldHJvcG9saXMxETAPBgNVBAgTCE5ldyBZb3JrMQswCQYDVQQGEwJ... | |
13,684 | [
-0.029738420620560646,
0.03844050318002701,
0.05206115171313286,
0.017681622877717018,
-0.015058386139571667,
0.02033008262515068,
-0.04658766835927963,
0.014907045289874077,
0.03564070165157318,
0.06669074296951294,
-0.0024782016407698393,
-0.024857686832547188,
0.01524756196886301,
-0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "config", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def to_health_check(config):
return HealthCheck(
config.get('IPAddress'),
int(config.get('Port')),
config.get('Type'),
config.get('ResourcePath'),
fqdn=config.get('FullyQualifiedDomainName'),
string_match=config.get('SearchString'),
request_interval=int(config... | |
13,685 | [
0.0018471739022061229,
-0.010301893576979637,
0.0711129754781723,
-0.020284108817577362,
-0.010879377834498882,
-0.009662536904215813,
-0.014983635395765305,
-0.0365670844912529,
-0.025883637368679047,
0.022068120539188385,
-0.06327569484710693,
-0.0036788794677704573,
0.03169972077012062,
... | 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 coordinates(self) -> List[Dict[str, Any]]:
coordinates = []
for location in self.locations.all():
coordinate = location.coordinates()
if coordinate:
coordinates.append(coordinate)
return coordinates | |
13,686 | [
0.0024967961944639683,
-0.008207890205085278,
-0.016603074967861176,
-0.023885510861873627,
0.011887669563293457,
0.03254511207342148,
-0.004707142245024443,
-0.00686377938836813,
0.045523494482040405,
0.024039754644036293,
0.03239087015390396,
-0.07015818357467651,
-0.0028755159582942724,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "a", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "b", "annotation": null, "type_comment": null}}], "kwarg": null, "var... | def health_check_diff(a, b):
a = a.__dict__
b = b.__dict__
if a == b:
return {}
diff = {}
for key in set(a.keys()) | set(b.keys()):
if a.get(key) != b.get(key):
diff[key] = b.get(key)
return diff | |
13,687 | [
-0.0341520830988884,
0.0035319721791893244,
0.015522713772952557,
-0.008390084840357304,
-0.02432490512728691,
-0.01891467534005642,
-0.03789275139570236,
-0.046029232442379,
0.05351056531071663,
0.030094409361481667,
-0.004335053265094757,
-0.04911475256085396,
0.06433102488517761,
-0.014... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "health_check", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya... | def to_template_params(health_check):
params = {
'ip_addr_part': '',
'port': health_check.port,
'type': health_check.hc_type,
'resource_path_part': '',
'fqdn_part': '',
'string_match_part': '',
'request_interval': health_check.request_interval,
'failur... | |
13,688 | [
0.01839669793844223,
-0.010877839289605618,
0.010393715463578701,
0.012162858620285988,
0.012156881392002106,
0.029669007286429405,
-0.0066044023260474205,
0.006963012274354696,
0.020189747214317322,
0.030840467661619186,
0.021887168288230896,
-0.0169383492320776,
-0.002278668340295553,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "conn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "health_check_id", "annotation": null, "type_comment": null}}, {"_... | def update_health_check(conn, health_check_id, health_check_version, health_check):
uri = '/%s/healthcheck/%s' % (conn.Version, health_check_id)
params = to_template_params(health_check)
params.update(
xmlns=conn.XMLNameSpace,
health_check_version=health_check_version,
)
xml_body = U... | |
13,689 | [
0.030048390850424767,
0.020535407587885857,
0.05017425864934921,
0.01548053789883852,
0.007792923599481583,
-0.004387907683849335,
-0.004996364004909992,
-0.005288891028612852,
0.0234723798930645,
0.03266943246126175,
-0.00956563837826252,
-0.006043611094355583,
0.03107808530330658,
-0.020... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "conn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "health_check", "annotation": null, "type_comment": null}}, {"_typ... | def create_health_check(conn, health_check, caller_ref=None):
if caller_ref is None:
caller_ref = str(uuid.uuid4())
uri = '/%s/healthcheck' % conn.Version
params = to_template_params(health_check)
params.update(xmlns=conn.XMLNameSpace, caller_ref=caller_ref)
xml_body = POSTXMLBody % params
... | |
13,690 | [
0.0067973025143146515,
0.009475027211010456,
0.01981259137392044,
-0.01819050870835781,
-0.01257114764302969,
0.0614846907556057,
-0.00016615091590210795,
0.000033466534659964964,
0.026725756004452705,
0.07919887453317642,
0.04755536839365959,
-0.06364746391773224,
0.018344992771744728,
0.... | 11 | {"_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 main():
argument_spec = ec2_argument_spec()
argument_spec.update(dict(
state=dict(choices=['present', 'absent'], default='present'),
ip_address=dict(),
port=dict(type='int'),
type=dict(required=True, choices=['HTTP', 'HTTPS', 'HTTP_STR_MATCH', 'HTTPS_STR_MATCH', 'TCP']),
... | |
13,691 | [
0.012369602918624878,
0.07214882969856262,
0.04006113484501839,
0.017940234392881393,
-0.031764451414346695,
-0.022304074838757515,
-0.005818454083055258,
-0.02182997763156891,
-0.030493009835481644,
0.0008377496269531548,
-0.029760316014289856,
0.0057861292734742165,
-0.03650541231036186,
... | 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": "igm_ref", "annotation": null, "type_comment": null}}, {"_type": "... | def GetAutoscalerResource(self, igm_ref, args):
autoscaler = managed_instance_groups_utils.AutoscalerForMig(
mig_name=args.name,
autoscalers=managed_instance_groups_utils.AutoscalersForLocations(
regions=None,
zones=[igm_ref.zone],
project=self.project,
... | |
13,692 | [
0.014399316161870956,
0.08197585493326187,
0.052129171788692474,
0.031236492097377777,
-0.04392702877521515,
-0.025176020339131355,
0.011557046324014664,
-0.027818933129310608,
-0.029185956344008446,
-0.0026486085262149572,
-0.022191351279616356,
0.007655332796275616,
-0.024857047945261,
0... | 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": "igm_ref", "annotation": null, "type_comment": null}}, {"_type": "... | def GetAutoscalerResource(self, igm_ref, args):
if _IsZonalGroup(igm_ref):
scope_name = igm_ref.zone
scope_type = 'zone'
zones, regions = [scope_name], None
else:
scope_name = igm_ref.region
scope_type = 'region'
zones, regions = None, [scope_name]
autoscaler = managed_i... | |
13,693 | [
0.0005788133130408823,
0.012569364160299301,
0.07674426585435867,
-0.0013688452308997512,
-0.031802862882614136,
-0.031968872994184494,
-0.018012136220932007,
-0.019269071519374847,
-0.026609105989336967,
0.0025034970603883266,
-0.010221501812338829,
-0.02658539079129696,
-0.0156524162739515... | 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": "args", "annotation": null, "type_comment": null}}], "kwarg": null... | def CreateRequests(self, args):
igm_ref = self.CreateGroupReference(args)
service = self.GetAutoscalerServiceForGroup(igm_ref)
managed_instance_groups_utils.AssertInstanceGroupManagerExists(
igm_ref, self.project, self.compute, self.http, self.batch_url)
autoscaler = self.GetAutoscalerResource... | |
13,694 | [
0.020657850429415703,
-0.00020555724040605128,
0.07490260154008865,
-0.0009027373162098229,
0.011795966885983944,
0.0389779768884182,
0.016340216621756554,
0.0020991810597479343,
0.03170240670442581,
-0.012762066908180714,
0.021695513278245926,
-0.03730817139148712,
0.011617058888077736,
0... | 10 | {"_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 OracleChecks(unittest.TestCase):
@unittest.skipUnless(connection.vendor == 'oracle',
"No need to check Oracle cursor semantics")
def test_dbms_session(self):
# If the backend is Oracle, test that we can call a standard
# stored procedure through our cursor wrapper... | |
13,695 | [
0.04467281699180603,
-0.008661305531859398,
0.0445508249104023,
-0.02205583080649376,
0.00034081016201525927,
0.010759537108242512,
-0.011772055178880692,
-0.011589069850742817,
0.010045894421637058,
0.025617944076657295,
0.025983914732933044,
-0.002557219937443733,
-0.020445559173822403,
... | 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_long_string(self):
# If the backend is Oracle, test that we can save a text longer
# than 4000 chars and read it properly
c = connection.cursor()
c.execute('CREATE TABLE ltext ("TEXT" NCLOB)')
long_str = ''.join([unicode(x) for x in xrange(4000)])
c.execute('INSE... | |
13,696 | [
0.06422849744558334,
-0.006693998817354441,
0.023767933249473572,
-0.043765194714069366,
-0.006492755375802517,
0.011227277107536793,
0.02230626903474331,
0.01162976399064064,
-0.03238963335752487,
-0.018419088795781136,
-0.00807092897593975,
0.020982297137379646,
0.0539756640791893,
0.007... | 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 ConnectionCreatedSignalTest(TestCase):
@skipUnlessDBFeature('test_db_allows_multiple_connections')
def test_signal(self):
data = {}
def receiver(sender, connection, **kwargs):
data["connection"] = connection
connection_created.connect(receiver)
connection.close... | |
13,697 | [
-0.03150887414813042,
-0.012677926570177078,
0.033920496702194214,
-0.02362038567662239,
-0.030810179188847542,
0.009004144929349422,
-0.0018101262394338846,
-0.039194513112306595,
-0.00430767796933651,
0.04899877682328224,
0.024206388741731644,
-0.038315512239933014,
-0.013692161068320274,
... | 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}}, {"_type": "arg", "_fields": {"arg": "version_string", "anno... | class PostgresVersionTest(TestCase):
def assert_parses(self, version_string, version):
self.assertEqual(pg_version._parse_version(version_string), version)
def test_parsing(self):
self.assert_parses("PostgreSQL 8.3 beta4", (8, 3, None))
self.assert_parses("PostgreSQL 8.3", (8, 3, None))... | |
13,698 | [
-0.011993765830993652,
-0.0010233239736407995,
0.08898977190256119,
-0.026977213099598885,
-0.01140984334051609,
0.028285199776291847,
0.019129296764731407,
0.006855248473584652,
0.02295982837677002,
-0.025202089920639992,
-0.017541028559207916,
-0.05871923267841339,
0.011293058283627033,
... | 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 EscapingChecks(TestCase):
@unittest.skipUnless(connection.vendor == 'sqlite',
"This is a sqlite-specific issue")
def test_parameter_escaping(self):
#13648: '%s' escaping support for sqlite3
cursor = connection.cursor()
response = cursor.execute(
... | |
13,699 | [
0.04765305295586586,
-0.031130021438002586,
0.001107358722947538,
-0.039267558604478836,
-0.011282096616923809,
0.0024753552861511707,
-0.004790101200342178,
0.009890150278806686,
-0.014460469596087933,
-0.03658509999513626,
0.0221359021961689,
0.013964553363621235,
0.05067363381385803,
0.... | 8 | {"_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_signal(self):
data = {}
def receiver(sender, connection, **kwargs):
data["connection"] = connection
connection_created.connect(receiver)
connection.close()
cursor = connection.cursor()
self.assertTrue(data["connection"] is connection)
connec... | |
13,700 | [
-0.0068151624873280525,
-0.016401078552007675,
0.07391658425331116,
-0.035081326961517334,
-0.008005023002624512,
-0.0017023939872160554,
0.01606590673327446,
0.01028419192880392,
0.03157319501042366,
-0.02199845016002655,
-0.02069127932190895,
-0.029919680207967758,
0.014512944035232067,
... | 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 test_parameter_escaping(self):
#13648: '%s' escaping support for sqlite3
cursor = connection.cursor()
response = cursor.execute(
"select strftime('%%s', date('now'))").fetchall()[0][0]
self.assertNotEqual(response, None)
# response should be an non-zero integer
... |