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 |
|---|---|---|---|---|---|
18,001 | [
0.014642489142715931,
0.052323635667562485,
-0.005331834312528372,
-0.034012503921985626,
0.008171557448804379,
0.05728646740317345,
-0.028814366087317467,
0.03285736218094826,
0.0659286379814148,
0.0076742046512663364,
0.012749340385198593,
-0.04770306870341301,
-0.004240867216140032,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "RPC command used to log the current user out of their session."}}], "func": {"_type": "Name", "_fi... | class session_logout(Command):
__doc__ = _('RPC command used to log the current user out of their'
' session.')
NO_CLI = True
def execute(self, *args, **options):
ccache_name = getattr(context, 'ccache_name', None)
if ccache_name is None:
logger.debug('session lo... | |
18,002 | [
0.041433095932006836,
0.017772849649190903,
0.009157555177807808,
-0.08087421208620071,
-0.03755980730056763,
0.01948816329240799,
0.024147171527147293,
-0.002503802767023444,
-0.010496605187654495,
0.03213720768690109,
0.024279970675706863,
-0.01960989460349083,
-0.00993774551898241,
0.02... | 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 main():
parser = optparse.OptionParser(usage='%prog OUTFILE.md')
options, args = parser.parse_args()
if len(args) != 1:
parser.error('Expected an output filename')
outfile, = args
with io.open(README_FILE, encoding='utf-8') as f:
readme = f.read()
readme = re.sub(r'(?s)^.*... | |
18,003 | [
0.013476370833814144,
0.04296569898724556,
-0.00926275085657835,
-0.04991426691412926,
-0.017443545162677765,
0.0006593173020519316,
0.002428391482681036,
-0.0073032071813941,
-0.02052110992372036,
0.059579744935035706,
0.00712288124486804,
-0.031977828592061996,
0.009533239528536797,
0.05... | 15 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "readme", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def filter_options(readme):
ret = ''
in_options = False
for line in readme.split('\n'):
if line.startswith('# '):
if line[2:].startswith('OPTIONS'):
in_options = True
else:
in_options = False
if in_options:
if line.lstrip()... | |
18,004 | [
-0.03225260227918625,
-0.04907017946243286,
0.035843104124069214,
0.015651695430278778,
0.015517567284405231,
0.00030307748238556087,
-0.029033534228801727,
-0.013319933786988258,
0.0014238193398341537,
-0.008088944479823112,
0.05538450926542282,
0.03613199666142464,
0.021728722378611565,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def test_getpeername():
print_name()
ts = jsocket.socket(socket.AF_INET, socket.SOCK_STREAM)
ts.connect((HOST, PORT))
assert(ts)
host, port = ts.getpeername()
assert(host in HOST_IPS)
assert(port == 80) | |
18,005 | [
0.011780614964663982,
-0.03013891726732254,
0.03986797109246254,
-0.0052769542671740055,
0.008846036158502102,
0.008031756617128849,
-0.012277643196284771,
0.013758150860667229,
0.018316000699996948,
-0.023180527612566948,
0.06628446280956268,
0.003955071792006493,
-0.017448846250772476,
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": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def test_accept_timeout():
print_name()
with raises(jsocket.timeout):
s = jsocket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(jsocket.SOL_SOCKET, jsocket.SO_REUSEADDR, 1)
s.bind(("", LISTEN_PORT))
s.listen(1)
s.settimeout(2)
result = s.accept() | |
18,006 | [
0.006122414954006672,
-0.03280341625213623,
0.013343066908419132,
-0.020014600828289986,
0.022950075566768646,
-0.009997036308050156,
-0.005119118839502335,
-0.03050430305302143,
-0.02305271476507187,
-0.03442511335015297,
0.05653354898095131,
0.02613188326358795,
-0.0036693434230983257,
0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def test_sockname():
print_name()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
shost, sport = s.getsockname()
ts = jsocket.socket(jsocket.AF_INET, jsocket.SOCK_STREAM)
host, port = ts.getsockname()
assert(host == shost)
assert(port == sport) | |
18,007 | [
0.015797870233654976,
-0.01697823964059353,
0.056466955691576004,
-0.0595669150352478,
-0.04084792733192444,
0.04680939018726349,
-0.004277348052710295,
0.004235617816448212,
0.028781931847333908,
0.0021908367052674294,
0.006283379625529051,
-0.020829344168305397,
0.035911839455366135,
-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 ExtensionsV2TestJSON(base.BaseVolumeTest):
@test.idempotent_id('94607eb0-43a5-47ca-82aa-736b41bd2e2c')
def test_list_extensions(self):
# List of all extensions
extensions = (self.volumes_extension_client.list_extensions()
['extensions'])
if len(CONF.volume_fe... | |
18,008 | [
0.0028772964142262936,
0.025724347680807114,
0.07445535808801651,
-0.05102698504924774,
-0.003429327392950654,
0.009412347339093685,
-0.005868806038051844,
0.008598211221396923,
0.001953340135514736,
0.02591177448630333,
0.020054683089256287,
-0.04238191992044449,
-0.02504492551088333,
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": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "... | def handle(self, *args, **options):
course_key, filename, pipe_results = self._parse_arguments(args)
export_course_to_tarfile(course_key, filename)
results = self._get_results(filename) if pipe_results else None
self.stdout.write(results, ending="") | |
18,009 | [
0.00883168913424015,
-0.0018241232028231025,
0.059291910380125046,
-0.06338576972484589,
-0.03548774868249893,
0.031646884977817535,
-0.03268184885382652,
0.01164333987981081,
0.033693812787532806,
0.039765600115060806,
-0.01026338804513216,
-0.02851899527013302,
0.019514812156558037,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_list_extensions(self):
# List of all extensions
extensions = (self.volumes_extension_client.list_extensions()
['extensions'])
if len(CONF.volume_feature_enabled.api_extensions) == 0:
raise self.skipException('There are not any extensions configured')
... | |
18,010 | [
-0.016319362446665764,
-0.07868635654449463,
-0.022218240424990654,
-0.0012627692194655538,
0.021022872999310493,
0.007782880682498217,
-0.029234526678919792,
0.03326239436864853,
0.027545420452952385,
0.027519434690475464,
0.024401085451245308,
-0.03599094972014427,
-0.06730438023805618,
... | 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 loop(self):
req = urllib2.Request(url, data, head)
result = urllib2.urlopen(req)
beauty = json.loads(result.read())
ltcusd = beauty["result"]["XLTCZUSD"]
timenow = strftime("%H:%M:%S", localtime())
ask = ltcusd["a"][0]
bid = ltcusd["b"][0]
askint = float(ask)
bidint = float(bid)
self.ask.setTe... | |
18,011 | [
-0.027170522138476372,
-0.04298431798815727,
-0.011671489104628563,
0.008076871745288372,
0.006244939286261797,
0.0032263421453535557,
-0.0096444021910429,
0.0304692592471838,
0.015788616612553596,
0.03872869536280632,
0.00825943611562252,
-0.002518120687454939,
-0.007881717756390572,
-0.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}}, {"_type": "arg", "_fields": {"arg": "templist", "annotation... | class Controller_Main(PyQt4.QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, templist, humlist):
PyQt4.QtGui.QMainWindow.__init__(self)
self.setupUi(self)
self.refresh.clicked.connect(self.loop)
def loopstarter(self):
timer.timeout.connect(self.loop)
timer.start(delay)
def loop(self):
req = urll... | |
18,012 | [
0.02580219879746437,
0.0167430117726326,
0.006427816580981016,
-0.01458335667848587,
-0.019777895882725716,
0.01651567965745926,
0.024551872164011,
-0.01620878092944622,
-0.0049188993871212006,
-0.050422269850969315,
0.018914034590125084,
-0.08988712728023529,
0.006439182907342911,
0.02759... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "Screenshot", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "object_class", "ctx": {"_type": "Store", "_fields": {... | class Meta:
object_class = Screenshot
allowed_methods = ('get', 'post')
resource_name = "screenshots"
authentication = MultiAuthentication(CRITsApiKeyAuthentication(),
CRITsSessionAuthentication())
authorization = authorization.Authori... | |
18,013 | [
0.022825807332992554,
0.020371420308947563,
0.00685183284804225,
0.008621037937700748,
0.03841117024421692,
-0.007342710625380278,
0.0045840805396437645,
0.00953631941229105,
0.018571535125374794,
-0.0010520631913095713,
0.025177929550409317,
-0.002173156011849642,
0.05211483687162399,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "DataFrame", "value": {"_type": "Name", "_fields... | def get_must_have_dict_from_data(data: pd.DataFrame) -> dict:
must_have_list = must_have_item(data)
list_of_asset_names = list(data.columns)
must_have_dict = dict(
[
(asset_name, must_have)
for asset_name, must_have in zip(list_of_asset_names, must_have_list)
]
)
... | |
18,014 | [
0.023921359330415726,
0.0017410236177965999,
0.02398805320262909,
-0.019308270886540413,
-0.004624203313142061,
-0.0023676808923482895,
0.0033792254980653524,
0.0048659732565283775,
0.03379225358366966,
0.07109712064266205,
0.01816333644092083,
-0.019352734088897705,
-0.03350324183702469,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "weights", "annotation": {"_type": "Name", "_fields": {"id": "portfolioWeights", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_typ... | def clean_weights(
weights: portfolioWeights, must_haves: dict, fraction: float = 0.5
) -> portfolioWeights:
(
asset_names,
list_of_weights,
list_of_must_haves,
) = get_lists_from_dicts_of_weights_and_must_haves(
weights=weights, must_haves=must_haves
)
cleaned_list... | |
18,015 | [
0.06635598838329315,
0.0443880632519722,
0.01138262264430523,
0.0038913930766284466,
0.01382813137024641,
-0.024776393547654152,
0.01845734193921089,
0.011888384819030762,
0.029655510559678078,
0.03436802327632904,
0.021563315764069557,
-0.021599017083644867,
-0.0014399344800040126,
-0.010... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "idx", "annotation": null, "type_comment": null}}, {"_type": "arg... | def _good_weight(
value, idx, needs_replacing, keep_empty, each_missing_weight, adjustment_on_rest
):
if needs_replacing[idx]:
return each_missing_weight
if keep_empty[idx]:
return 0.0
else:
return value * adjustment_on_rest | |
18,016 | [
-0.014153316617012024,
0.014254141598939896,
0.03004586510360241,
-0.014808679930865765,
-0.017808225005865097,
-0.0009877703851088881,
0.03541480004787445,
0.020530501380562782,
0.03859078884124756,
0.023845124989748,
0.048396024852991104,
0.03410407528281212,
-0.013926460407674313,
-0.04... | 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 _posttask(self, key, value, dsk, state, id):
duration = default_timer() - self.starttimes[key]
deps = state["dependencies"][key]
if deps:
duration += max(self.durations.get(k, 0) for k in deps)
self.durations[key] = duration
nb = self._nbytes(value) + overhead + s... | |
18,017 | [
-0.00917639210820198,
0.0617666132748127,
0.025018854066729546,
-0.045706167817115784,
0.008269300684332848,
-0.0006957006407901645,
-0.012706315144896507,
-0.02065918780863285,
-0.0065394979901611805,
0.048293840140104294,
0.04179653525352478,
-0.0415433906018734,
-0.029026933014392853,
0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "fName", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def runit(fName):
inLines = open(fName, 'r').readlines()
nFailed = 0
nPassed = 0
nTried = 0
for line in inLines:
if len(line):
smi = splitExpr.split(line)[1]
if smi[-1] == '\n':
smi = smi[:-1]
if smi[-1] == '\r':
smi = smi[:-1]
nTried += 1
print('trying: "%s"'... | |
18,018 | [
-0.02195877954363823,
0.0033222425263375044,
0.05520252510905266,
-0.007525678724050522,
0.006520123220980167,
0.013253438286483288,
0.006783059798181057,
-0.022541504353284836,
-0.012578330002725124,
-0.0022669420577585697,
0.030642801895737648,
-0.040677040815353394,
0.019116219133138657,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def setUpClass(cls):
super(TestOpsPatientFlow, cls).setUpClass()
cr, uid = cls.cr, cls.uid
cls.users_pool = cls.registry('res.users')
cls.groups_pool = cls.registry('res.groups')
cls.partner_pool = cls.registry('res.partner')
cls.activity_pool = cls.registry('nh.activity... | |
18,019 | [
0.008340353146195412,
0.030145198106765747,
0.034506168216466904,
0.006483534350991249,
0.016776101663708687,
0.020033201202750206,
0.01910649612545967,
-0.0018210452981293201,
0.013723424635827541,
0.00133299152366817,
0.03412458300590515,
-0.02686084248125553,
0.021464144811034203,
0.053... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs"... | class TestOpsPatientFlow(common.SingleTransactionCase):
@classmethod
def setUpClass(cls):
super(TestOpsPatientFlow, cls).setUpClass()
cr, uid = cls.cr, cls.uid
cls.users_pool = cls.registry('res.users')
cls.groups_pool = cls.registry('res.groups')
cls.partner_pool = cls.... | |
18,020 | [
-0.021512994542717934,
-0.0035670290235430002,
0.02529473789036274,
0.04305369406938553,
0.009572104550898075,
0.0007943565724417567,
0.029339678585529327,
0.01458672434091568,
-0.005444047972559929,
0.015875009819865227,
0.03529627248644829,
-0.024976128712296486,
0.016041241586208344,
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 test_referral(self):
cr, uid = self.cr, self.uid
patient_ids = self.patient_ids
patient_id = fake.random_element(patient_ids)
code = str(fake.random_int(min=1000001, max=9999999))
spell_data = {
'patient_id': patient_id,
'pos_id': self.pos_id,
... | |
18,021 | [
0.005955215077847242,
0.03412040323019028,
0.016337202861905098,
0.020472241565585136,
-0.006456239614635706,
-0.011066933162510395,
0.040107328444719315,
0.037748072296381,
0.004109669476747513,
0.027347058057785034,
0.022501707077026367,
-0.035845447331666946,
0.04043711721897125,
0.0352... | 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 test_referral_form(self):
cr, uid = self.cr, self.uid
# Submit an empty form
form_id = self.form_pool.create(cr, self.refteam_id, {})
self.assertTrue(form_id, msg="Referral form not created")
form = self.form_pool.browse(cr, uid, form_id)
self.assertTrue(form.source =... | |
18,022 | [
0.005271995905786753,
-0.008646310307085514,
0.02312798984348774,
-0.023851480334997177,
0.014256330206990242,
0.04592388495802879,
-0.04395504295825958,
-0.024124272167682648,
-0.020257746800780296,
0.011190389283001423,
-0.02730288915336132,
-0.025476370006799698,
0.02131333202123642,
0.... | 13 | {"_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 TestReactor(NonReactor, CoreReactor, Clock):
def __init__(self):
super().__init__()
# whether there are calls that should run right now
self._pendingCurrentCalls = False
self.stop_called = False
def _executeCurrentDelayedCalls(self):
while self.getDelayedCalls():... | |
18,023 | [
0.061699800193309784,
-0.00896376185119152,
0.026891283690929413,
0.03362547978758812,
0.017267754301428795,
0.006631818599998951,
0.0005353515734896064,
0.02627701684832573,
0.011716592125594616,
0.01581171154975891,
0.015618330799043179,
-0.023080548271536827,
0.024707220494747162,
-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}}, {"_type": "arg", "_fields": {"arg": "onResult", "annotation": null, "type_comment": null}}, {"_type": ... | def callInThreadWithCallback(self, onResult, func, *args, **kw):
self.calls += 1
try:
result = func(*args, **kw)
except: # noqa pylint: disable=bare-except
# We catch *everything* here, since normally this code would be
# running in a thread, where there is n... | |
18,024 | [
0.007909061387181282,
-0.0011604056926444173,
0.039437294006347656,
-0.01118550170212984,
-0.023451147601008415,
0.03206830471754074,
0.0027033628430217505,
0.018410470336675644,
-0.00031297950772568583,
0.0164302047342062,
-0.03478066995739937,
-0.03466065227985382,
-0.02353515848517418,
... | 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 _executeCurrentDelayedCalls(self):
while self.getDelayedCalls():
first = sorted(self.getDelayedCalls(),
key=lambda a: a.getTime())[0]
if first.getTime() > self.seconds():
break
self.advance(0)
self._pendingCurrentCalls =... | |
18,025 | [
-0.0024437429383397102,
-0.010485433973371983,
0.0053407116793096066,
0.03390616923570633,
0.0355965755879879,
0.027708003297448158,
-0.029373914003372192,
0.04279918968677521,
0.004320953972637653,
0.001361973350867629,
-0.008219306357204914,
-0.017626797780394554,
0.0007326635532081127,
... | 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": "what", "annotation": null, "type_comment": null}}], "kwarg": {"_t... | def _catchPrintExceptions(self, what, *a, **kw):
try:
r = what(*a, **kw)
if isinstance(r, defer.Deferred):
yield r
except Exception as e:
log.msg('Unhandled exception from deferred when doing '
'TestReactor.advance()', e)
... | |
18,026 | [
0.03063327446579933,
-0.015079845674335957,
0.027442827820777893,
-0.004290278535336256,
-0.002344542182981968,
0.005274830386042595,
-0.016488129273056984,
0.0054866960272192955,
0.009976377710700035,
0.020688053220510483,
-0.016413353383541107,
-0.0064743636175990105,
-0.007190967909991741... | 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": "when", "annotation": null, "type_comment": null}}, {"_type": "arg... | def callLater(self, when, what, *a, **kw):
# Buildbot often uses callLater(0, ...) to defer execution of certain
# code to the next iteration of the reactor. This means that often
# there are pending callbacks registered to the reactor that might
# block other code from proceeding unless... | |
18,027 | [
-0.03788655623793602,
-0.003433631034567952,
0.04651598259806633,
-0.04900374636054039,
-0.07090124487876892,
0.008441549725830555,
0.026108553633093834,
-0.005328606814146042,
0.047500722110271454,
0.05670026317238808,
0.025784626603126526,
0.010747913271188736,
0.05066225305199623,
-0.02... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "view", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "start_pt", "annotation": null, "type_comment": null}}], "kwarg": ... | def view_tracker(view, start_pt, *conds):
pts = defaultdict(list)
failed = False
for i, (direction, condition) in enumerate(conds):
for pt in pt_range(view, start_pt, direction):
if failed: break
if not condition(view, pt):
if not pts[i]: failed = True
... | |
18,028 | [
0.009672122076153755,
-0.02361707016825676,
0.03584733605384827,
-0.023483891040086746,
0.007335941307246685,
0.015004829503595829,
0.004558605141937733,
-0.04909864440560341,
-0.009255938231945038,
-0.006975247990339994,
0.023284122347831726,
-0.05904267355799675,
0.03216271847486496,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "faux_conn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}, {"_ty... | def test_set_arraysize_not_set_if_false(faux_conn, metadata, arraysize):
engine = sqlalchemy.create_engine("bigquery://", arraysize=arraysize)
sqlalchemy.Table("t", metadata, sqlalchemy.Column("c", sqlalchemy.Integer))
conn = engine.connect()
metadata.create_all(engine)
# Because we gave a false ar... | |
18,029 | [
0.05049058794975281,
0.01333620771765709,
0.07706458121538162,
-0.049678605049848557,
0.00048634406994096935,
-0.004023007117211819,
-0.005216376390308142,
-0.023190731182694435,
-0.018724823370575905,
0.01534156035631895,
0.006754223257303238,
0.01963522844016552,
0.020570239052176476,
0.... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "main", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "value": ... | def test_run(main=False):
datas = [testcommon.getdata(i) for i in range(chkdatas)]
testcommon.runtest(datas,
testcommon.TestStrategy,
main=main,
plot=main,
chkind=chkind,
chkmin=chkmin,
... | |
18,030 | [
0.010529871098697186,
-0.02122661843895912,
0.0293034128844738,
-0.024675387889146805,
0.028391158208251,
0.017421847209334373,
-0.006719537544995546,
-0.04859426990151405,
-0.03032691776752472,
-0.006775162648409605,
0.01261582039296627,
-0.06470336019992828,
0.03548894822597504,
0.029080... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "faux_conn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}], "kwa... | def test_arraysize_querystring_takes_precedence_over_default(faux_conn, metadata):
arraysize = 42
engine = sqlalchemy.create_engine(
f"bigquery://myproject/mydataset?arraysize={arraysize}"
)
sqlalchemy.Table("t", metadata, sqlalchemy.Column("c", sqlalchemy.Integer))
conn = engine.connect()
... | |
18,031 | [
0.017010066658258438,
-0.022019503638148308,
0.04919157177209854,
-0.026665618643164635,
0.021270839497447014,
0.017516514286398888,
-0.003410270670428872,
-0.04218936711549759,
-0.011824472807347775,
0.0026671122759580612,
0.04773828387260437,
-0.05284680798649788,
0.02657753974199295,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "faux_conn", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "metadata", "annotation": null, "type_comment": null}}], "kwa... | def test_set_arraysize(faux_conn, metadata):
engine = sqlalchemy.create_engine("bigquery://", arraysize=42)
sqlalchemy.Table("t", metadata, sqlalchemy.Column("c", sqlalchemy.Integer))
conn = engine.connect()
metadata.create_all(engine)
# Because we gave a false array size, the array size wasn't set... | |
18,032 | [
-0.04081696271896362,
-0.06701599806547165,
0.022364402189850807,
0.011671180836856365,
-0.006562626454979181,
-0.019816558808088303,
-0.020678706467151642,
0.05286131054162979,
0.02993072383105755,
-0.016342226415872574,
0.012102254666388035,
-0.06228061020374298,
-0.01654811203479767,
-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 testUC6(self):
client = Client()
auction = Auction()
response = client.get('/addbid/'+auction.id)
response.status_code
self.client.login(username='anh', password='anh')
response = client.get('/addbid/'+auction.id)
response.status_code | |
18,033 | [
-0.012087712064385414,
0.005617928691208363,
0.02210509404540062,
-0.05456184223294258,
-0.020692525431513786,
0.029545344412326813,
0.03784823417663574,
0.017802687361836433,
-0.048307716846466064,
0.0014314396539703012,
-0.0007514384342357516,
0.0018802809063345194,
-0.024196989834308624,
... | 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 skipgram():
batch_inputs = tf.placeholder(tf.int32, shape=[batch_size,])
batch_labels = tf.placeholder(tf.int32, shape=[batch_size, 1])
val_dataset = tf.constant(val_data, dtype=tf.int32)
with tf.variable_scope("word2vec") as scope:
embeddings = tf.Variable(tf.random_uniform([vocabulary_siz... | |
18,034 | [
0.012910458259284496,
0.04050804302096367,
0.05366615951061249,
-0.04711940512061119,
0.005830703303217888,
0.008533393032848835,
0.044578228145837784,
0.054915208369493484,
-0.025950128212571144,
0.03042948618531227,
-0.012598195113241673,
0.0035048825666308403,
-0.042489297688007355,
-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 run():
batch_inputs, batch_labels, normalized_embeddings, loss = skipgram()
optimizer = tf.train.GradientDescentOptimizer(1.0).minimize(loss)
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
average_loss = 0.0
for step, batch_data in enume... | |
18,035 | [
-0.012716325931251049,
0.015873253345489502,
0.010500937700271606,
-0.018265873193740845,
0.018210487440228462,
-0.0009692321764305234,
-0.012716325931251049,
-0.038924362510442734,
0.04517175629734993,
0.04714345186948776,
0.010107707232236862,
-0.020370490849018097,
0.021278800442814827,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "/tasks/available"}}, "targets": [{"_type": "Name", "_fields": {"id": "URL_TEMPLATE", "ctx": {"_type": "Store", "_fields": {}}}}], "type_c... | class AvailableTasksPage(Base):
URL_TEMPLATE = '/tasks/available'
_available_tasks_list_locator = (By.CSS_SELECTOR, '.task-list > li')
_displayed_profile_name_locator = (By.CSS_SELECTOR, '.content-container > h3')
@property
def available_tasks(self):
return [Task(self, web_element) for we... | |
18,036 | [
-0.009536916390061378,
0.002451665000990033,
-0.0004975261399522424,
0.056346334517002106,
-0.030187249183654785,
-0.014853852801024914,
-0.05797678232192993,
-0.006911417469382286,
0.01933758147060871,
-0.024037105962634087,
0.01807878166437149,
-0.00006308054435066879,
0.05485974997282028,... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "index", "annotation": {"_type": "Name", "_fields": {"id": "int", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}], "kwarg": null, "vara... | def get_addrtype_from_bip44_purpose(index: int) -> Optional['AddressType']:
purpose = index & ~HARDENED_FLAG
if purpose == 44:
return AddressType.LEGACY
elif purpose == 49:
return AddressType.SH_WIT
elif purpose == 84:
return AddressType.WIT
elif purpose == 86:
retur... | |
18,037 | [
0.012615219689905643,
0.024023767560720444,
0.00606079027056694,
0.016312027350068092,
-0.008364439010620117,
-0.017233487218618393,
-0.016081662848591805,
0.012823645025491714,
0.034598611295223236,
-0.04039064422249794,
0.0036172771360725164,
-0.007810466457158327,
-0.024528374895453453,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "xpub", "annotation": {"_type": "Name", "_fields": {"id": "str", "ctx": {"_type": "Load", "_fields": {}}}}, "type_comment": null}}, {"_type": "arg", "_fie... | def convert_xpub(xpub: str, xtype='standard') -> str:
bip32node = BIP32Node.from_xkey(xpub)
return BIP32Node(
xtype=xtype,
eckey=bip32node.eckey,
chaincode=bip32node.chaincode,
depth=bip32node.depth,
fingerprint=bip32node.fingerprint,
child_number=bip32node.child_... | |
18,038 | [
0.012922858819365501,
0.00789015181362629,
0.03619430214166641,
0.04299038648605347,
0.024738779291510582,
0.033156655728816986,
-0.019384287297725677,
-0.02349025569856167,
0.02150806412100792,
0.038948774337768555,
-0.005837167613208294,
-0.009260952472686768,
0.03959234431385994,
-0.005... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": {"_type": "Subscript", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "slice": {"_type": "Name", "_fields": {"id": "int", "ctx... | def is_standard_path(
path: Sequence[int],
addrtype: 'AddressType',
chain: 'Chain',
) -> bool:
if len(path) != 5:
return False
if not is_hardened(path[0]) or not is_hardened(path[1]) or not is_hardened(path[2]):
return False
if is_hardened(path[3]) or is_hardened(path[4]):
... | |
18,039 | [
0.0066356598399579525,
-0.009129165671765804,
0.02612021006643772,
-0.018070586025714874,
0.02698853611946106,
0.028795596212148666,
-0.03825331851840019,
0.009604399092495441,
-0.009357981383800507,
0.04339287430047989,
-0.024876389652490616,
0.018469545990228653,
0.03175260126590729,
-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": "If", "_fields": {"body": [{"_type": "Return", "_fields": {"val... | def get_chain() -> 'Chain':
if constants.net.NET_NAME == "mainnet":
return Chain.MAIN
elif constants.net.NET_NAME == "testnet":
return Chain.TEST
elif constants.net.NET_NAME == "signet":
return Chain.SIGNET
elif constants.net.NET_NAME == "regtest":
return Chain.REGTEST
... | |
18,040 | [
0.026011008769273758,
-0.046898990869522095,
-0.013878747820854187,
0.013250012882053852,
0.016172466799616814,
0.011404558084905148,
0.016649840399622917,
0.02131878212094307,
-0.01248155813664198,
-0.043289583176374435,
-0.009291308932006359,
-0.0038044301327317953,
-0.013424661010503769,
... | 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": "hidDevice", "annotation": {"_type": "Constant", "_fields": {"kind... | def __init__(self, hidDevice: 'HID', *, product_key: Tuple[int, int],
plugin: HW_PluginBase):
Ledger_Client.__init__(self, plugin=plugin)
# Hack, we close the old object and instantiate a new one
hidDevice.close()
dev = hid.device()
dev.open_path(hidDevice.path)... | |
18,041 | [
0.021029410883784294,
-0.006840514950454235,
0.01791951432824135,
0.0011285908985882998,
-0.00774338748306036,
-0.011492816731333733,
0.00144679076038301,
0.04607158899307251,
0.01813269406557083,
-0.016489965841174126,
0.009078886359930038,
0.014345644041895866,
-0.03792065382003784,
-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": "bip32_path", "annotation": null, "type_comment": null}}, {"_type"... | def get_xpub(self, bip32_path, xtype):
self.checkDevice()
# bip32_path is of the form 44'/0'/1'
# S-L-O-W - we don't handle the fingerprint directly, so compute
# it manually from the previous node
# This only happens once so it's bearable
# self.get_client() # prompt for... | |
18,042 | [
0.015141598880290985,
-0.03255443647503853,
0.030685395002365112,
0.06051907688379288,
-0.015023305080831051,
-0.03702593967318535,
-0.03785399720072746,
0.03984133154153824,
-0.004583882167935371,
-0.030874665826559067,
0.0036523190792649984,
-0.001278311712667346,
0.023540453985333443,
-... | 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": "address_path", "annotation": {"_type": "Name", "_fields": {"id": ... | def show_address(self, address_path: str, txin_type: str):
self.handler.show_message(_("Showing address ..."))
segwit = is_segwit_script_type(txin_type)
segwitNative = txin_type == 'p2wpkh'
try:
self.dongleObject.getWalletPublicKey(address_path, showOnScreen=True, segwit=segw... | |
18,043 | [
0.026872357353568077,
-0.024249542504549026,
-0.043023381382226944,
-0.0003086194337811321,
-0.005648256745189428,
0.03089861012995243,
0.0004676923272199929,
0.012653935700654984,
0.0020548265893012285,
-0.0733928233385086,
0.03115168958902359,
0.027608586475253105,
-0.0023999339900910854,
... | 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": "client", "annotation": {"_type": "Constant", "_fields": {"kind": ... | def is_pin_validated(self, client: 'btchip'):
try:
# Invalid SET OPERATION MODE to verify the PIN status
client.dongle.exchange(bytearray([0xe0, 0x26, 0x00, 0x00, 0x01, 0xAB]))
except BTChipException as e:
if (e.sw == 0x6982):
return False
... | |
18,044 | [
0.004438035190105438,
-0.02306768111884594,
-0.0073735774494707584,
-0.019494526088237762,
-0.00507880374789238,
-0.02157781459391117,
-0.022108105942606926,
0.0621703676879406,
0.0017123996512964368,
0.019696542993187904,
-0.010902540758252144,
0.03328210487961769,
-0.04214555025100708,
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 _perform_hw1_preflight(self):
assert self.is_hw1()
if self._preflightDone:
return
try:
firmwareInfo = self.dongleObject.getFirmwareVersion()
firmware = firmwareInfo['version']
if versiontuple(firmware) < versiontuple(self.MIN_SUPPORTED_HW1_FW_V... | |
18,045 | [
0.03777722269296646,
-0.0549200177192688,
0.0009785022120922804,
-0.003218497848138213,
0.011950397863984108,
-0.0031396544072777033,
0.009573834016919136,
0.039511777460575104,
-0.013966534286737442,
-0.030636269599199295,
-0.02013884112238884,
-0.005513402167707682,
-0.02563534863293171,
... | 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": "product_key", "annotation": {"_type": "Subscript", "_fields": {"c... | def __init__(self, product_key: Tuple[int, int],
plugin: HW_PluginBase, device: 'Device'):
# note: Ledger_Client_Legacy.__init__ is *not* called
Ledger_Client.__init__(self, plugin=plugin)
self._product_key = product_key
assert self.is_hw1()
ledger = device.prod... | |
18,046 | [
0.014568183571100235,
-0.045712754130363464,
0.004721600562334061,
0.001342188217677176,
0.008462315425276756,
0.007301504258066416,
0.001329129096120596,
0.02470206841826439,
0.009315512143075466,
-0.015322711318731308,
-0.008386862464249134,
0.011463013477623463,
0.0051104724407196045,
-... | 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": "hidDevice", "annotation": {"_type": "Constant", "_fields": {"kind... | def __init__(self, hidDevice: 'HID', *, product_key: Tuple[int, int],
plugin: HW_PluginBase):
Ledger_Client.__init__(self, plugin=plugin)
transport = ledger_bitcoin.TransportClient('hid', hid=hidDevice)
self.client = ledger_bitcoin.client.NewClient(transport, get_chain())
... | |
18,047 | [
0.009474624879658222,
0.009837348945438862,
0.025165602564811707,
0.006441493984311819,
-0.02181352488696575,
0.008580319583415985,
-0.02566591277718544,
0.022914206609129906,
0.04582841321825981,
-0.030468890443444252,
-0.009568432345986366,
-0.0487552285194397,
0.012514009140431881,
-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": "bip32_path", "annotation": null, "type_comment": null}}, {"_type"... | def get_xpub(self, bip32_path, xtype):
# try silently first; if not a standard path, repeat with on-screen display
bip32_path = bip32_path.replace('h', '\'')
# cache known path/xpubs combinations in order to avoid requesting them many times
if bip32_path in self._known_xpubs:
... | |
18,048 | [
0.030801892280578613,
0.0023436222691088915,
0.04802693799138069,
0.02863144502043724,
-0.028677623718976974,
-0.024844704195857048,
-0.020192096009850502,
-0.011365991085767746,
0.024913974106311798,
-0.008895373903214931,
-0.0008918463718146086,
-0.007989096455276012,
0.01470824982970953,
... | 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": "addr_type", "annotation": {"_type": "Constant", "_fields": {"kind... | def get_singlesig_default_wallet_policy(self, addr_type: 'AddressType', account: int) -> 'WalletPolicy':
assert account >= HARDENED_FLAG
if addr_type == AddressType.LEGACY:
template = "pkh(@0/**)"
elif addr_type == AddressType.WIT:
template = "wpkh(@0/**)"
elif a... | |
18,049 | [
0.038253579288721085,
0.003317850874736905,
0.03740672767162323,
-0.018969517201185226,
-0.03568882495164871,
0.01648944616317749,
-0.019925251603126526,
-0.0010116874473169446,
0.05540841072797775,
-0.0007735099061392248,
0.020977769047021866,
-0.006363498978316784,
0.012079759500920773,
... | 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": "path", "annotation": {"_type": "Name", "_fields": {"id": "str", "... | def get_singlesig_policy_for_path(self, path: str, xtype: str, master_fp: bytes) -> Optional['WalletPolicy']:
path = path.replace("h", "'")
path_parts = path.split("/")
if not 5 <= len(path_parts) <= 6:
raise UserFacingException(f"Unsupported path: {path}")
path_root = "/".... | |
18,050 | [
0.009526205249130726,
-0.02353532984852791,
0.022320222109556198,
-0.02134105935692787,
-0.014593084342777729,
-0.03024791181087494,
-0.040086742490530014,
-0.0102930199354887,
-0.01198001392185688,
-0.0031291961204260588,
0.030460260808467865,
0.03664197400212288,
-0.026378445327281952,
-... | 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": "parent", "annotation": null, "type_comment": null}}, {"_type": "a... | def __init__(self, parent, config, name):
self.segwit = config.get("segwit")
HW_PluginBase.__init__(self, parent, config, name)
self.libraries_available = self.check_libraries_available()
if not self.libraries_available:
_logger.info("Library unavailable")
return
... | |
18,051 | [
0.010638601146638393,
-0.024030452594161034,
0.04902857169508934,
0.03831509128212929,
-0.02944479137659073,
-0.011554431170225143,
-0.01645037718117237,
0.003297563176602125,
0.010920838452875614,
0.0008603904279880226,
-0.00014453838230110705,
-0.026680022478103638,
0.047185394912958145,
... | 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": "address_path", "annotation": {"_type": "Name", "_fields": {"id": ... | def show_address(self, address_path: str, txin_type: str):
client_ledger = self.client
self.handler.show_message(_("Showing address ..."))
# TODO: generalize for multisignature
try:
master_fp = client_ledger.get_master_fingerprint()
wallet_policy = self.get_sing... | |
18,052 | [
0.0031326469033956528,
0.021590201184153557,
-0.0032704833429306746,
0.0071048429235816,
-0.016176987439393997,
0.05739009007811546,
0.009673613123595715,
0.022617710754275322,
-0.005685754120349884,
0.019096614792943,
0.018620451912283897,
0.05663825571537018,
-0.006547231692820787,
0.033... | 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 update_changedtick(self):
if self.bufnr == vim.current.buffer.number:
self._changedtick = int(vim.eval(u'b:changedtick'.encode(u'utf-8')))
else:
vim.command(u'unlet! g:org_changedtick | let g:org_lz = &lz | let g:org_hidden = &hidden | set lz hidden'.encode(u'utf-8'))
# TODO is this likely to fail? may... | |
18,053 | [
0.027783812955021858,
-0.007325940765440464,
0.010689950548112392,
0.04363153874874115,
-0.009712040424346924,
-0.033282458782196045,
-0.03614354133605957,
0.044413864612579346,
-0.002564917551353574,
-0.01512127835303545,
-0.012908408418297768,
0.01574714109301567,
0.026889722794294357,
-... | 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": "wallet", "annotation": null, "type_comment": null}}, {"_type": "a... | def show_address(self, wallet, address, keystore=None):
if keystore is None:
keystore = wallet.get_keystore()
if not self.show_address_helper(wallet, address, keystore):
return
if type(wallet) is not Standard_Wallet:
keystore.handler.show_error(_('This functio... | |
18,054 | [
0.03809788450598717,
0.05299364775419235,
0.07777351886034012,
-0.015069779008626938,
-0.022749681025743484,
0.0020113340578973293,
0.00975649245083332,
-0.0008766052196733654,
-0.028306590393185616,
0.05276162922382355,
0.011833082884550095,
-0.02433902770280838,
-0.04361999034881592,
-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": "Call", "_fields": {"a... | def binaryFindInDocument():
hi = len(self.headings)
lo = 0
while lo < hi:
mid = (lo+hi)//2
h = self.headings[mid]
if h.end_of_last_child < position:
lo = mid + 1
elif h.start > position:
hi = mid
else:
return binaryFindHeading(h) | |
18,055 | [
0.0030319970101118088,
0.020296981558203697,
-0.022692915052175522,
-0.006183790974318981,
-0.04408518224954605,
-0.0071535734459757805,
-0.03603028133511543,
0.001918173162266612,
0.05668094754219055,
0.0638459324836731,
0.02982367016375065,
-0.037125565111637115,
-0.013086361810564995,
-... | 13 | {"_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": "stop", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def parse_states(s, stop=0):
res = []
if not s:
return res
if type(s[0]) in (unicode, str):
r = []
for i in s:
_i = i
if type(_i) == str:
_i = _i.decode(u'utf-8')
if type(_i) == unicode and _i:
if strip_access_key and u'(' in _i:
_i = _i[:_i.index(u'(')]
if ... | |
18,056 | [
-0.012815345078706741,
-0.015718337148427963,
-0.0014204811304807663,
-0.02570512518286705,
-0.025506630539894104,
-0.011934522539377213,
-0.0046894485130906105,
0.010904829017817974,
-0.008467059582471848,
0.008640742860734463,
0.026151739060878754,
-0.04265164956450462,
0.00005524524021893... | 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": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def __setslice__(self, i, j, other):
o = []
o_tmp = other
if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
o_tmp = list(o_tmp)
for item in o_tmp:
if type(item) == unicode:
o.append(item.encode(u'utf-8'))
else:
o.append(item)
MultiPurposeList.__setslice__(self, i, j, o) | |
18,057 | [
0.07132694870233536,
0.046642232686281204,
0.06862305104732513,
-0.01468496024608612,
-0.05253952369093895,
-0.007150176912546158,
0.020838657394051552,
-0.01092630997300148,
-0.017680225893855095,
0.0700216218829155,
0.01813475973904133,
-0.040651701390743256,
-0.037341754883527756,
-0.02... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "heading", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def binaryFindHeading(heading):
if not heading.children or heading.end >= position:
return heading
hi = len(heading.children)
lo = 0
while lo < hi:
mid = (lo+hi)//2
h = heading.children[mid]
if h.end_of_last_child < position:
lo = mid + 1
elif h.start > position:
hi = mid
... | |
18,058 | [
0.008476863615214825,
-0.020006107166409492,
0.009979392401874065,
0.012410649098455906,
0.032061830163002014,
-0.0017095698276534677,
0.016693446785211563,
0.009210381656885147,
0.004108291584998369,
0.01840893179178238,
-0.03776433691382408,
-0.009399676695466042,
0.04898006096482277,
-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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __radd__(self, other):
raise NotImplementedError()
# TODO: implement me
if isinstance(other, UserList):
return self.__class__(other.data + self.data)
elif isinstance(other, type(self.data)):
return self.__class__(other + self.data)
else:
return self.__class__(list(other) + self.data) | |
18,059 | [
0.01294519193470478,
-0.0237310528755188,
-0.025156211107969284,
0.013150328770279884,
0.04206377640366554,
0.003077047411352396,
0.026991643011569977,
0.01537444069981575,
0.0020270724780857563,
0.013020768761634827,
-0.04059543088078499,
-0.014715843833982944,
0.03115915320813656,
-0.028... | 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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __add__(self, other):
raise NotImplementedError()
# TODO: implement me
if isinstance(other, UserList):
return self.__class__(self.data + other.data)
elif isinstance(other, type(self.data)):
return self.__class__(self.data + other)
else:
return self.__class__(self.data + list(other)) | |
18,060 | [
-0.02261403203010559,
-0.0090574836358428,
0.007775428239256144,
0.0037601019721478224,
-0.00876664649695158,
-0.016714202240109444,
-0.00911683775484562,
0.01899341307580471,
0.015728918835520744,
0.018174320459365845,
-0.0062440843321383,
-0.02692316100001335,
0.005187575705349445,
-0.01... | 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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __iadd__(self, other):
o = []
o_tmp = other
if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
o_tmp = list(o_tmp)
for i in o_tmp:
if type(i) is unicode:
o.append(i.encode(u'utf-8'))
else:
o.append(i)
return MultiPurposeList.__iadd__(self, o) | |
18,061 | [
-0.02360350266098976,
0.001121703302487731,
0.02687314711511135,
0.005936674308031797,
-0.036562755703926086,
-0.010369788855314255,
-0.024104688316583633,
0.024235950782895088,
0.004847786854952574,
0.02847217209637165,
0.009242119267582893,
-0.017076143994927406,
0.008001086302101612,
-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": "other", "annotation": null, "type_comment": null}}], "kwarg": nul... | def extend(self, other):
o = []
o_tmp = other
if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
o_tmp = list(o_tmp)
for i in o_tmp:
if type(i) is unicode:
o.append(i.encode(u'utf-8'))
else:
o.append(i)
MultiPurposeList.extend(self, o) | |
18,062 | [
0.007068146951496601,
0.002838521497324109,
-0.006775923538953066,
-0.017509035766124725,
-0.03923095390200615,
-0.0077500008046627045,
0.042445410043001175,
-0.01972506195306778,
-0.007622153032571077,
-0.03246111795306206,
0.02527729980647564,
-0.07042577117681503,
0.033142972737550735,
... | 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 MockSelector(object):
def __init__(self):
self.files_watched = 0
self.register = MagicMock(side_effect=self._register)
self.unregister = MagicMock(side_effect=self._unregister)
self.close = MagicMock()
self.get_map = MagicMock(side_effect=self._get_map)
self.sel... | |
18,063 | [
-0.0017890608869493008,
0.004318738356232643,
0.01566571183502674,
-0.03401349112391472,
0.024114225059747696,
-0.016250889748334885,
0.03155086562037468,
0.006723455619066954,
0.008021820336580276,
-0.013398146256804466,
0.027186410501599312,
-0.06593009829521179,
0.0017677262658253312,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mocker", "annotation": null, "type_comment": null}}], "kwarg":... | def mock_run_env(request, mocker):
pc = PlayContext()
new_stdin = StringIO()
conn = ssh.Connection(pc, new_stdin)
conn._send_initial_data = MagicMock()
conn._examine_output = MagicMock()
conn._terminate_process = MagicMock()
conn.sshpass_pipe = [MagicMock(), MagicMock()]
request.cls.pc... | |
18,064 | [
0.0022947208490222692,
0.038488008081912994,
0.026264842599630356,
-0.048432279378175735,
-0.05368064343929291,
-0.02612672932446003,
0.037797436118125916,
0.0025695119984447956,
-0.022305550053715706,
-0.016470197588205338,
0.014340926893055439,
-0.08448025584220886,
0.014329417608678341,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "OozieJavaAction", "value": {"_type": "Name", "_fields": {"id": "models", "ctx": {"_type": "Load", "_fields": {... | class Meta:
model = models.OozieJavaAction
exclude = ('action_type',)
widgets = {
'job_properties': forms.widgets.HiddenInput(),
'files': forms.HiddenInput(),
'archives': forms.HiddenInput()
}
name = forms.CharField(label=_('Name'))
description = forms.CharField(label=_('Descr... | |
18,065 | [
0.019282715395092964,
0.0486600399017334,
0.014571152627468109,
-0.04704848304390907,
-0.042034752666950226,
-0.0315372571349144,
0.03802824765443802,
0.007016983814537525,
-0.02108452469110489,
-0.022125322371721268,
0.00032157677924260497,
-0.06884925812482834,
0.008270416408777237,
0.01... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "OozieMapreduceAction", "value": {"_type": "Name", "_fields": {"id": "models", "ctx": {"_type": "Load", "_field... | class Meta:
model = models.OozieMapreduceAction
exclude = ('action_type',)
widgets = {
'job_properties': forms.widgets.HiddenInput(),
'files': forms.HiddenInput(),
'archives': forms.HiddenInput()
}
name = forms.CharField(label=_('Name'))
description = forms.CharField(label=_('... | |
18,066 | [
0.02580283209681511,
0.04143659397959709,
0.010109673254191875,
-0.05350642651319504,
-0.06210736930370331,
-0.010899676941335201,
0.03236045688390732,
0.00030107758357189596,
-0.023593198508024216,
-0.026515617966651917,
0.005806231405586004,
-0.07774113118648529,
0.009973056614398956,
0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "OozieStreamingAction", "value": {"_type": "Name", "_fields": {"id": "models", "ctx": {"_type": "Load", "_field... | class Meta:
model = models.OozieStreamingAction
exclude = ('action_type',)
widgets = {
'job_properties': forms.widgets.HiddenInput(),
'files': forms.widgets.HiddenInput(),
'archives': forms.widgets.HiddenInput(),
}
name = forms.CharField(label=_('Name'))
description = forms.Ch... | |
18,067 | [
0.041790228337049484,
0.05399288609623909,
0.025866976007819176,
0.0004176669754087925,
0.028192346915602684,
-0.013797197490930557,
0.018791206181049347,
0.018160035833716393,
-0.024493901059031487,
0.008011454716324806,
-0.02203565277159214,
-0.027173614129424095,
0.04052788391709328,
-0... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "design_obj", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}], "kwarg"... | def design_form_by_instance(design_obj, data=None):
action_obj = design_obj.get_root_action()
cls = _ACTION_TYPE_TO_FORM_CLS[action_obj.action_type]
instances = dict(wf=design_obj, action=action_obj)
res = MultiForm(wf=WorkflowDesignForm, action=cls)
res.bind(data=data, instances=instances)
return res | |
18,068 | [
0.0013874911237508059,
0.06891250610351562,
0.03393746539950371,
-0.04167607054114342,
-0.050538722425699234,
0.03184068948030472,
-0.01962752640247345,
-0.012061850167810917,
-0.017357824370265007,
0.050365790724754333,
0.009030175395309925,
-0.0331592820584774,
0.018049543723464012,
0.02... | 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 main():
parser, args = parse_args()
if args.add_rule and args.rule_name and args.scan_regex:
add_rule( args.rule_name, args.scan_regex )
elif args.list_rules:
list_rule()
elif args.file:
if args.scan_regex:
single_scan(args.file, args.scan_regex)
elif args.rule_name:
scan_full(args.file, args.rul... | |
18,069 | [
0.020945081487298012,
-0.023358505219221115,
0.019867658615112305,
-0.030189359560608864,
0.036093633621931076,
0.01846701093018055,
0.02881026081740856,
-0.015073131769895554,
-0.0423857755959034,
0.07929825037717819,
-0.014631388708949089,
-0.031913235783576965,
-0.059602975845336914,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "n1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "n2", "annotation": null, "type_comment": null}}], "kwarg": null, "v... | def perfeitos_entre(n1,n2):
if n1>n2:
return []
else:
if perfeito(n1):
return [n1]+perfeitos_entre(n1+1,n2)
else:
return perfeitos_entre(n1+1,n2) | |
18,070 | [
-0.014092115685343742,
0.05461546778678894,
0.02163972333073616,
-0.09022070467472076,
-0.03743613883852959,
-0.020120464265346527,
-0.033871717751026154,
-0.014919918030500412,
-0.00009358426177641377,
0.06252341717481613,
0.006563984788954258,
-0.017890267074108124,
0.02421078085899353,
... | 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 parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help="Path to file", metavar="FILE")
parser.add_argument("-l", "--list_rules", help="List rules", action="store_true")
parser.add_argument("-a", "--add_rule", help="Add Scan rule to match", action="store_true")
parser.add... | |
18,071 | [
0.01748793013393879,
0.06312239915132523,
-0.011945207603275776,
-0.002393309725448489,
0.00015158264432102442,
0.041658833622932434,
-0.003454292891547084,
-0.01779280975461006,
0.004301859997212887,
-0.009774460457265377,
0.016378166154026985,
-0.04485397785902023,
0.0076342010870575905,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Behavior"}}, "targets": [{"_type": "Name", "_fields": {"id": "subact_group", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment":... | class shiftFighterPosition(SubAction):
subact_group = 'Behavior'
fields = [NodeMap('new_x','int','shiftPosition>xPos',None),
NodeMap('x_relative','bool','shiftPosition>xPos|relative',False),
NodeMap('new_y','int','shiftPosition>yPos',None),
NodeMap('y_relative','bo... | |
18,072 | [
0.0021931922528892756,
0.06240483373403549,
-0.004770593252032995,
-0.0091104069724679,
0.013563737273216248,
0.014518437907099724,
0.025078359991312027,
-0.014728006906807423,
0.013214456848800182,
-0.02326210029423237,
-0.02826845832169056,
-0.061333708465099335,
-0.0077074626460671425,
... | 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": "_action", "annotation": null, "type_comment": null}}, {"_type": "... | def execute(self, _action, _actor):
SubAction.execute(self, _action, _actor)
if self.new_x:
if self.x_relative: _actor.posx += self.new_x * _actor.facing
else: _actor.posx = self.new_x
if self.new_y:
if self.y_relative: _actor.posy += self.new_y
... | |
18,073 | [
0.051548246294260025,
0.03153618052601814,
0.001450209878385067,
0.014604597352445126,
0.0292313564568758,
0.05225742235779762,
0.030915649607777596,
-0.03787444159388542,
-0.018604794517159462,
-0.01454919297248125,
-0.002047192305326462,
-0.0023920845706015825,
-0.009900764562189579,
-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 getXmlElement(self):
elem = ElementTree.Element('shiftPosition')
if self.new_x is not None:
x_elem = ElementTree.Element('xPos')
if self.x_relative: x_elem.attrib['relative'] = 'True'
x_elem.text = str(self.new_x)
elem.append(x_elem)
... | |
18,074 | [
-0.016683686524629593,
0.0029990915209054947,
0.03845192864537239,
0.00384397036395967,
-0.021487122401595116,
-0.04580986127257347,
-0.00448259525001049,
-0.011336351744830608,
-0.0178937129676342,
0.002597277285531163,
-0.012833605520427227,
0.0029288120567798615,
0.03490740805864334,
0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "data", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "bounds", "annotation": null, "type_comment": null}}, {"_type": "a... | def good_guess_params(data, bounds, nparams):
inds = np.searchsorted(bounds, data)-1
counts = np.bincount(inds, minlength=bounds.shape[0]-1)
p0s = (counts + 0.5)/(np.sum(counts) + (bounds.shape[0]-1)*0.5)
params = np.array([np.random.lognormal(mean=np.log(p0s), sigma=1.0/np.sqrt(0.5+counts)) for i in... | |
18,075 | [
-0.03850339725613594,
-0.0023251213133335114,
0.046901460736989975,
0.02446979284286499,
-0.00004537056156550534,
-0.02432245761156082,
-0.012609370984137058,
-0.007489500101655722,
-0.021817773580551147,
0.010822941549122334,
0.013923102989792824,
-0.020295316353440285,
0.01759418658912182,... | 13 | {"_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": "data", "annotation": n... | class HistogramPosterior(object):
def __init__(self, data, bounds):
assert np.all(data > bounds[0]), 'data below min bound'
assert np.all(data < bounds[-1]), 'data above max bound'
assert np.all(bounds[:-1] < bounds[1:]), 'bounds not sorted'
self.data = data
self.bounds = b... | |
18,076 | [
-0.00296766241081059,
0.03564197197556496,
0.10923159867525101,
-0.014794780872762203,
0.009667044505476952,
-0.0211113840341568,
-0.0011265709763392806,
-0.028244581073522568,
-0.0392686128616333,
0.034272972494363785,
0.03155899792909622,
-0.0011123105650767684,
0.014698711223900318,
0.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": "data", "annotation": null, "type_comment": null}}, {"_type": "arg... | def __init__(self, data, bounds):
assert np.all(data > bounds[0]), 'data below min bound'
assert np.all(data < bounds[-1]), 'data above max bound'
assert np.all(bounds[:-1] < bounds[1:]), 'bounds not sorted'
self.data = data
self.bounds = bounds
inds = np.searc... | |
18,077 | [
0.03208545222878456,
0.00661366106942296,
0.07213519513607025,
0.03348046913743019,
0.0467204749584198,
-0.012517130933701992,
-0.02030387707054615,
0.014305291697382927,
0.013417552225291729,
0.030766524374485016,
-0.0151930321007967,
-0.01727287843823433,
0.0003537088050507009,
0.0164105... | 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": "p", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def density(self, p, xs):
xs = np.atleast_1d(xs)
rhos = self.rhos(p)
inds = np.searchsorted(self.bounds, xs)-1
outside = (inds<0) | (inds==self.bounds.shape[0])
inside = ~outside
ds = np.zeros(xs.shape)
ds[inside] = rhos[inds[inside]]
return ds | |
18,078 | [
0.016275689005851746,
0.023581186309456825,
0.0054162475280463696,
-0.03334181010723114,
0.029078274965286255,
-0.007461188361048698,
0.024718929082155228,
0.04881509393453598,
0.022682970389723778,
0.06907886266708374,
-0.0032844797242432833,
0.03767720237374306,
-0.042060501873493195,
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": "p", "annotation": null, "type_comment": null}}], "kwarg": null, "... | def log_prior(self, p):
if np.any(p < 0):
return np.NINF
if np.sum(p) > 1.0:
return np.NINF
return -0.5*(np.sum(np.log(p)) + np.log1p(-np.sum(p))) | |
18,079 | [
0.01775667630136013,
-0.0017438066424801946,
-0.09524969011545181,
-0.04314291104674339,
0.0026686335913836956,
-0.021366175264120102,
-0.015413069166243076,
-0.012487836182117462,
0.021451707929372787,
0.0238808486610651,
0.011564078740775585,
0.01582362875342369,
0.046051036566495895,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "value", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def list_dict_str(value):
if isinstance(value, list):
return value
elif isinstance(value, dict):
return value
elif isinstance(value, string_types):
return value
raise TypeError | |
18,080 | [
0.0031487818341702223,
0.04246831685304642,
0.024048075079917908,
-0.021036874502897263,
0.011691766791045666,
-0.04743160679936409,
-0.04348589852452278,
-0.023134330287575722,
0.00990581326186657,
0.004213085863739252,
-0.009703336283564568,
-0.034265391528606415,
0.018575996160507202,
-... | 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": "kind", "annotation": null, "type_comment": null}}, {"_type": "arg... | def find_resource(self, kind, api_version, fail=False):
for attribute in ['kind', 'name', 'singular_name']:
try:
return self.client.resources.get(**{'api_version': api_version, attribute: kind})
except (ResourceNotFoundError, ResourceNotUniqueError):
pass
... | |
18,081 | [
-0.005510937888175249,
0.0059217242524027824,
0.01718900538980961,
-0.026866490021348,
-0.035146232694387436,
-0.02105146273970604,
-0.05117223411798477,
0.016484800726175308,
-0.005252195987850428,
0.005542947445064783,
-0.009826861321926117,
-0.06529901176691055,
0.032692186534404755,
-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": {"_type": "arg", "_fields": {"arg": "auth_params", "annotation": null, "type_comment": null}... | def get_api_client(self, **auth_params):
auth_args = AUTH_ARG_SPEC.keys()
auth_params = auth_params or getattr(self, 'params', {})
auth = copy.deepcopy(auth_params)
# If authorization variables aren't defined, look for them in environment variables
for key, value in iteritems(a... | |
18,082 | [
0.0019682692363858223,
0.06370765715837479,
0.027455348521471024,
-0.021530456840991974,
-0.0009144669747911394,
0.013074931688606739,
-0.025487080216407776,
-0.030166739597916603,
0.028640327975153923,
0.009635481983423233,
-0.014089193195104599,
-0.07724452763795853,
-0.012321767397224903,... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": null}}, "targets": [{"_type": "Name", "_fields": {"id": "resource_definition", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment"... | class KubernetesAnsibleModule(AnsibleModule, K8sAnsibleMixin):
resource_definition = None
api_version = None
kind = None
def __init__(self, *args, **kwargs):
kwargs['argument_spec'] = self.argspec
AnsibleModule.__init__(self, *args, **kwargs)
if not HAS_K8S_MODULE_HELPER:
... | |
18,083 | [
0.039872728288173676,
0.057460423558950424,
0.041882749646902084,
-0.007138857152312994,
0.04893967881798744,
-0.04170796647667885,
-0.04780357703566551,
-0.012355083599686623,
-0.030259577557444572,
-0.008892164565622807,
-0.011612249538302422,
-0.02722269482910633,
0.004986822139471769,
... | 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": "kind", "annotation": null, "type_comment": null}}, {"_type": "arg... | def kubernetes_facts(self, kind, api_version, name=None, namespace=None, label_selectors=None, field_selectors=None):
resource = self.find_resource(kind, api_version)
try:
result = resource.get(name=name,
namespace=namespace,
... | |
18,084 | [
0.010350402444601059,
-0.009524540975689888,
0.035035841166973114,
-0.02558363974094391,
0.014310923404991627,
-0.021713541820645332,
0.009500428102910519,
-0.005048609338700771,
0.03940025344491005,
0.04053355008363724,
-0.029682809486985207,
-0.035084068775177,
-0.015793858096003532,
-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 CosTests(TestCase):
def test_null(self):
IntegerModel.objects.create()
obj = IntegerModel.objects.annotate(null_cos=Cos("normal")).first()
self.assertIsNone(obj.null_cos)
def test_decimal(self):
DecimalModel.objects.create(n1=Decimal("-12.9"), n2=Decimal("0.6"))
ob... | |
18,085 | [
0.023865124210715294,
0.0272486861795187,
0.01144204568117857,
0.009735248982906342,
0.01783877983689308,
0.028610119596123695,
-0.03325500711798668,
-0.007047418970614672,
0.011742361821234226,
0.04004215449094772,
0.004527266137301922,
-0.08304742723703384,
-0.014625396579504013,
-0.0035... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
kwargs['argument_spec'] = self.argspec
AnsibleModule.__init__(self, *args, **kwargs)
if not HAS_K8S_MODULE_HELPER:
self.fail_json(msg="This module requires the OpenShift Python client. Try `pip install openshift`")
self.openshift_version... | |
18,086 | [
0.00544841168448329,
-0.02009660005569458,
0.0016454091528430581,
-0.03936700522899628,
0.007167787291109562,
0.011348996311426163,
0.014089949429035187,
0.042403824627399445,
0.04751729220151901,
-0.021257735788822174,
0.027487682178616524,
-0.0062020341865718365,
0.021213077008724213,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "populate", "value": {... | class TestCaseAndUserKeywordCopyingTest(unittest.TestCase):
controller = TestCaseFileController(
TestCaseFile(source=COMPLEX_SUITE_PATH).populate())
def test_test_case_copy(self):
test = self.controller.tests[0]
copy = test.copy('New Name')
assert_equals(copy.name, 'New Name')
... | |
18,087 | [
0.02143571898341179,
0.006724931299686432,
0.011036092415452003,
-0.013437854126095772,
-0.005391953978687525,
-0.01902194879949093,
0.015515376813709736,
-0.007307358551770449,
0.042991526424884796,
0.023741409182548523,
-0.011882713064551353,
-0.04777102917432785,
-0.019658414646983147,
... | 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_integer(self):
IntegerModel.objects.create(small=-20, normal=15, big=-1)
obj = IntegerModel.objects.annotate(
small_cos=Cos("small"),
normal_cos=Cos("normal"),
big_cos=Cos("big"),
).first()
self.assertIsInstance(obj.small_cos, float)
s... | |
18,088 | [
0.05468970537185669,
-0.047253213822841644,
-0.0054374998435378075,
-0.0603778101503849,
-0.01746060885488987,
0.010257233865559101,
0.003671623533591628,
-0.01637660712003708,
0.033289387822151184,
0.002296221675351262,
0.05072668567299843,
-0.014907957054674625,
0.0070343646220862865,
-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_test_case_copy(self):
test = self.controller.tests[0]
copy = test.copy('New Name')
assert_equals(copy.name, 'New Name')
for orig, copied in zip(test.settings, copy.settings):
assert_equals(orig.value, copied.value)
assert_true(copied is not orig)
... | |
18,089 | [
0.038744229823350906,
-0.029626548290252686,
-0.029152903705835342,
-0.054516639560461044,
-0.027613554149866104,
0.0005335916648618877,
0.0018042947631329298,
0.032492104917764664,
0.040733546018600464,
0.015346125699579716,
0.05603230744600296,
-0.016956521198153496,
-0.014079123735427856,... | 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_keyword_copy(self):
test = self.controller.keywords[0]
copy = test.copy('New Name')
assert_equals(copy.name, 'New Name')
for orig, copied in zip(test.settings, copy.settings):
assert_equals(orig.value, copied.value)
assert_true(copied is not orig)
... | |
18,090 | [
-0.017898250371217728,
-0.00472188601270318,
-0.0052620177157223225,
-0.036865394562482834,
-0.051852621138095856,
0.034568414092063904,
0.03531891107559204,
0.000644959625788033,
-0.003684265073388815,
-0.002670807996764779,
-0.022219302132725716,
-0.02626744471490383,
0.045894116163253784,... | 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": "cvars", "annotation": null, "type_comment": null}}, {"_type": "ar... | def _set_become_plugin(self, cvars, templar, connection):
# load become plugin if needed
if cvars.get('ansible_become') is not None:
become = boolean(templar.template(cvars['ansible_become']))
else:
become = self._task.become
if become:
if cvars.get('... | |
18,091 | [
0.00553961843252182,
-0.0062570637091994286,
0.027568716555833817,
-0.021029379218816757,
-0.0021993813570588827,
-0.0011408556019887328,
0.024934163317084312,
-0.053114473819732666,
0.005842474289238453,
0.045657746493816376,
-0.014231291599571705,
-0.03603692352771759,
-0.02905065380036831... | 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_parses_well_formatted_strings(self):
well_formatted_strings_with_expectations = (
('en-US', [('en_US', 1.0)]),
('en-US,el-GR,fr', [('en_US', 1.0), ('el_GR', 1.0), ('fr', 1.0)]),
('en-US,el;q=0.8', [('en_US', 1.0), ('el', 0.8)]))
for acc_lang, expectations in ... | |
18,092 | [
-0.019987262785434723,
-0.024328386411070824,
0.003416940104216337,
-0.050556015223264694,
-0.03995191305875778,
0.03355327621102333,
0.011169352568686008,
-0.05060123652219772,
-0.03680912032723427,
0.002913867123425007,
0.01988551765680313,
-0.05394751951098442,
0.037351761013269424,
0.0... | 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": "variables", "annotation": null, "type_comment": null}}, {"_type":... | def _set_connection_options(self, variables, templar):
# keep list of variable names possibly consumed
varnames = []
# grab list of usable vars for this plugin
option_vars = C.config.get_plugin_vars('connection', self._connection._load_name)
varnames.extend(option_vars)
... | |
18,093 | [
-0.022934863343834877,
-0.001354676322080195,
0.0038754199631512165,
-0.05090989172458649,
-0.029245655983686447,
0.006210201885551214,
0.014400468207895756,
-0.02899152971804142,
-0.0374835729598999,
-0.00860322080552578,
0.001539314747788012,
-0.038605961948633194,
0.05590770021080971,
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": "plugin_type", "annotation": null, "type_comment": null}}, {"_type... | def _set_plugin_options(self, plugin_type, variables, templar, task_keys):
try:
plugin = getattr(self._connection, '_%s' % plugin_type)
except AttributeError:
# Some plugins are assigned to private attrs, ``become`` is not
plugin = getattr(self._connection, plugin_typ... | |
18,094 | [
0.04758530482649803,
0.06546704471111298,
0.009661108255386353,
-0.0014202947495505214,
0.008798065595328808,
-0.012585518881678581,
-0.015137392096221447,
0.03760133311152458,
0.013684500940144062,
0.055185046046972275,
0.025096530094742775,
-0.031243378296494484,
-0.05334720015525818,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "res", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "errors", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _clean_res(res, errors='surrogate_or_strict'):
if isinstance(res, binary_type):
return to_unsafe_text(res, errors=errors)
elif isinstance(res, dict):
for k in res:
try:
res[k] = _clean_res(res... | |
18,095 | [
0.05161552503705025,
0.04962484538555145,
-0.031779807060956955,
-0.005050761625170708,
0.04464814066886902,
0.03251446411013603,
0.042965542525053024,
-0.008531492203474045,
0.060952771455049515,
0.03668541461229324,
0.004286482464522123,
0.01445613894611597,
0.0126550467684865,
-0.021482... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _evaluate_failed_when_result(result):
if self._task.failed_when:
cond = Conditional(loader=self._loader)
cond.when = self._task.failed_when
failed_when_result = cond.evaluate_conditional(templar, vars_copy)
result['faile... | |
18,096 | [
0.0038760097231715918,
0.026903750374913216,
0.028429443016648293,
-0.02368045784533024,
0.02067205123603344,
0.04435250908136368,
-0.04469632729887962,
-0.023744923993945122,
-0.03771252557635307,
-0.017975229769945145,
0.026194626465439796,
-0.03584301471710205,
0.04585671424865723,
-0.0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "DomainsTable", "value": {"_type": "Name", "_fields": {"id": "project_tables", "ctx": {"_type": "Load", "_field... | class IndexView(tables.DataTableView):
table_class = project_tables.DomainsTable
template_name = constants.DOMAINS_INDEX_VIEW_TEMPLATE
page_title = _("Domains")
def get_data(self):
domains = []
domain_context = self.request.session.get('domain_context', None)
if policy.check((("... | |
18,097 | [
0.0032299445010721684,
0.007717085536569357,
0.0322016216814518,
-0.02233244851231575,
-0.011506790295243263,
-0.0001479787315474823,
-0.014970420859754086,
0.019390536472201347,
0.03472326323390007,
-0.013195129111409187,
0.053679030388593674,
-0.012716887518763542,
0.02462221309542656,
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": "client_info", "annotation": null, "type_comment": null}}], "kwarg... | def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.create_backup_plan: gapic_v1.method.wrap_method(
self.create_backup_plan,
default_timeout=300.0,
client_info=client_info,
... | |
18,098 | [
-0.0011961573036387563,
-0.006930844392627478,
0.014605710282921791,
0.002843019785359502,
0.05595039948821068,
0.009443347342312336,
-0.061444710940122604,
0.04711371660232544,
0.0016540165524929762,
0.03795653209090233,
0.03191278874874115,
-0.02598351240158081,
-0.007297131698578596,
-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 get_data(self):
domains = []
domain_context = self.request.session.get('domain_context', None)
if policy.check((("identity", "identity:list_domains"),),
self.request):
try:
if domain_context:
domain = api.keystone.domain... | |
18,099 | [
0.015667147934436798,
0.017094427719712257,
0.013668954372406006,
0.007037590257823467,
-0.005283682141453028,
0.0013792469399049878,
0.002945138141512871,
-0.020838294178247452,
-0.039634477347135544,
0.038273073732852936,
0.020025841891765594,
-0.01617218554019928,
-0.03293723985552788,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "UpdateDomain", "value": {"_type": "Name", "_fields": {"id": "project_workflows", "ctx": {"_type": "Load", "_fi... | class UpdateDomainView(workflows.WorkflowView):
workflow_class = project_workflows.UpdateDomain
def get_initial(self):
initial = super(UpdateDomainView, self).get_initial()
domain_id = self.kwargs['domain_id']
initial['domain_id'] = domain_id
try:
# get initial dom... | |
18,100 | [
-0.02313564158976078,
0.04675327613949776,
0.03778821602463722,
0.00649484945461154,
0.01761682704091072,
-0.026871083304286003,
0.05210339277982712,
-0.013989833183586597,
0.00842884462326765,
0.02335253916680813,
0.03282369300723076,
-0.0010890018893405795,
-0.00981457345187664,
-0.01267... | 6 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Expr", "_fields": {"value": {"_type": "Call", "_fields": {"arg... | def init():
glutInit([])
glMaterialfv(GL_FRONT, GL_AMBIENT, [0.2, 0.2, 0.2, 1.0])
glMaterialfv(GL_FRONT, GL_DIFFUSE, [0.8, 0.8, 0.8, 1.0])
glMaterialfv(GL_FRONT, GL_SPECULAR, [1.0, 0.0, 1.0, 1.0])
glMaterialfv(GL_FRONT, GL_SHININESS, 50.0)
glLightfv(GL_LIGHT0, GL_AMBIENT, [0.0, 1.0, 0.0, 1.0])
glLightfv(GL_LIGHT... |