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,801 | [
-0.003343105548992753,
0.033681340515613556,
0.008962621912360191,
-0.030225010588765144,
-0.0022689613979309797,
0.06087908148765564,
-0.04593343660235405,
-0.008908988907933235,
0.0738939568400383,
0.0547768734395504,
0.036732446402311325,
-0.02088100090622902,
-0.0004886535461992025,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "mod", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "def_freq", "annotation": null, "type_comment": null}}], "kwarg": n... | def fixup_handler(mod, def_freq=PER_INSTANCE):
if not hasattr(mod, "handler_version"):
setattr(mod, "handler_version", 1)
if not hasattr(mod, 'frequency'):
setattr(mod, 'frequency', def_freq)
else:
freq = mod.frequency
if freq and freq not in FREQUENCIES:
LOG.warn... | |
13,802 | [
0.001616406487300992,
-0.03258756175637245,
0.049379996955394745,
-0.02001345343887806,
-0.03517515957355499,
0.01176548469811678,
0.007621285039931536,
0.02161722630262375,
-0.0003855706308968365,
0.004090291913598776,
0.024339593946933746,
-0.06210235506296158,
0.008935299701988697,
-0.0... | 15 | {"_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 SpatioTemporalBidder(object):
def __init__(self):
self.bidder = ExplorationBidder()
self.grids_schedule = ExplorationSchedule()
self.objects_schedule = ExplorationSchedule()
self.bidder_timer = rospy.get_param("~bidder_timer",3600)
self.rescheduleInterval = ro... | |
13,803 | [
0.0023136360105127096,
-0.000003331353809699067,
0.025771867483854294,
-0.029183173552155495,
-0.024143245071172714,
-0.025793876498937607,
0.032110296189785004,
-0.015846068039536476,
0.02643212117254734,
-0.0040137870237231255,
-0.03719424083828926,
0.008764856494963169,
0.0628560706973075... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "payload", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "default", "annotation": null, "type_comment": null}}], "kwarg"... | def type_from_starts_with(payload, default=None):
try:
payload_lc = util.decode_binary(payload).lower()
except UnicodeDecodeError:
return default
payload_lc = payload_lc.lstrip()
for text in INCLUSION_SRCH:
if payload_lc.startswith(text):
return INCLUSION_TYPES_MAP[te... | |
13,804 | [
0.0013628813903778791,
-0.022161444649100304,
0.008007020689547062,
-0.04043782502412796,
-0.003535644616931677,
0.007302260957658291,
-0.006402063183486462,
-0.02935118041932583,
0.03953762724995613,
0.009659357368946075,
0.025300290435552597,
0.0022149598225951195,
-0.016499673947691917,
... | 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": "slot_duration", "annotation": null, "type_comment": null}}], "kwa... | def getCurrentTimeSlot(self, slot_duration):
numSlots = 24*3600/slot_duration;
now = rospy.get_rostime().secs
currentSlot = (now-self.grids_schedule.timeInfo[0])/slot_duration;
if currentSlot > numSlots:
currentSlot = numSlots
retur... | |
13,805 | [
0.018428746610879898,
-0.024301372468471527,
0.05415594205260277,
-0.0009897772688418627,
-0.04644044116139412,
0.003744106972590089,
-0.0016555156325921416,
0.006456203758716583,
0.012691263109445572,
-0.012248973362147808,
0.0358746238052845,
-0.04703015834093094,
0.03010028414428234,
-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 __init__(self):
self.bidder = ExplorationBidder()
self.grids_schedule = ExplorationSchedule()
self.objects_schedule = ExplorationSchedule()
self.bidder_timer = rospy.get_param("~bidder_timer",3600)
self.rescheduleInterval = rospy.get_param('~rescheduleInterval', 8640... | |
13,806 | [
0.022359149530529976,
-0.0017098948592320085,
-0.008263393305242062,
-0.022169306874275208,
-0.05336664617061615,
0.008305580355226994,
-0.02354038693010807,
-0.04611046984791756,
-0.0014488622546195984,
0.0623524934053421,
-0.024131005629897118,
-0.035837918519973755,
0.06846962124109268,
... | 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 __repr__(self):
if self.args:
args_str = ', ' + repr(self.args)
else:
args_str = ''
return ("TimelineEvent(name='%s', start=%f, duration=%s, " +
"thread_start=%s, thread_duration=%s%s)") % (
self.name,
self.start,
self.duration,
... | |
13,807 | [
0.004340896382927895,
-0.02080659754574299,
0.041181132197380066,
-0.039938945323228836,
-0.03162170574069023,
0.0005966200842522085,
0.014514660462737083,
0.03199976310133934,
0.020766090601682663,
0.012010037899017334,
0.006318940781056881,
-0.04895828664302826,
-0.014744195155799389,
-0... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def add_task(self, *args, **kwargs):
# print "Availabe tokens: ", self.bidder.available_tokens
# print "Currently bid tokens: ", self.bidder.currently_bid_tokens
currentTime = rospy.Time.now()
midnight = self.getMidnightTime(currentTime.secs)
#print 'Current time: ... | |
13,808 | [
-0.015638096258044243,
0.038113199174404144,
0.01962842233479023,
-0.011287274770438671,
-0.009671255946159363,
0.006718912161886692,
0.004475131165236235,
-0.021841125562787056,
0.002335458993911743,
0.020299691706895828,
-0.0017714060377329588,
-0.045696061104536057,
0.008372224867343903,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "ar... | def add(cls, client, resource) :
try :
if resource and type(resource) is not list :
updateresource = netbridge_nsip6_binding()
updateresource.name = resource.name
updateresource.ipaddress = resource.ipaddress
updateresource.netmask = resource.netmask
return updateresource.update_resource(client... | |
13,809 | [
0.012674792669713497,
0.05951641872525215,
0.019189758226275444,
-0.024051491171121597,
-0.014450488612055779,
0.010366388596594334,
-0.018173325806856155,
0.011113405227661133,
0.0016272106440737844,
0.00607104180380702,
0.04739270359277725,
-0.0689704641699791,
0.009735709987580776,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "ar... | def delete(cls, client, resource) :
try :
if resource and type(resource) is not list :
deleteresource = netbridge_nsip6_binding()
deleteresource.name = resource.name
deleteresource.ipaddress = resource.ipaddress
deleteresource.netmask = resource.netmask
return deleteresource.delete_resource(cli... | |
13,810 | [
-0.006558883469551802,
0.022507458925247192,
0.04354896396398544,
-0.04483799263834953,
-0.01783156953752041,
-0.01677001640200615,
-0.01941126212477684,
0.012100445106625557,
0.03404553607106209,
0.033742234110832214,
0.0126754529774189,
-0.02944546937942505,
-0.02058655396103859,
-0.0488... | 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": "finish_event", "annotation": null, "type_comment": null}}], "kwar... | def run(self, finish_event):
num_req = 0
long_times = 0
short_times = 0
max_delay = 0
min_delay = -1
start_time = time.time()
success_time = start_time
curtime = start_time
self.client.start()
while (curtime - start_time < self.timeout or s... | |
13,811 | [
-0.0016633643535897136,
-0.003001319244503975,
0.0219070166349411,
0.011586894281208515,
-0.008396721445024014,
0.04788164794445038,
0.023987311869859695,
0.04416268691420555,
0.018978333100676537,
0.01893184520304203,
0.04014155641198158,
-0.03051874041557312,
0.01162175927311182,
-0.0627... | 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": "uri", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __init__(self, uri='/', max_deadtime=1, timeout=20):
self.uri = uri
self.timeout = timeout
self.max_deadtime = max_deadtime
self.stop_procedures = [self.__stop]
self.client = deproxy.Client()
self.client.set_tester(self)
self.message_chains = [chains.base()]
... | |
13,812 | [
0.00853715930134058,
-0.02194756455719471,
0.05076795816421509,
-0.02526424452662468,
-0.019852187484502792,
0.026629231870174408,
0.00015790152247063816,
-0.006477704271674156,
-0.006525598466396332,
-0.010339182801544666,
-0.02016350068151951,
0.013266721740365028,
-0.0112910820171237,
-... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def append_extra_server_groups(self):
sgid = 0
for ifc in range(self.num_extra_interfaces):
server = self.servers[self.extra_servers_base + ifc]
for listener in server.config.listeners:
sg = tempesta.ServerGroup('extra-%i' % sgid)
sg.add_server(ser... | |
13,813 | [
0.010663692839443684,
0.007825423963367939,
0.0554984025657177,
-0.006887615192681551,
-0.073385089635849,
0.031947605311870575,
-0.020992010831832886,
0.06151031702756882,
0.04677864536643028,
-0.0008803601958788931,
0.057187702506780624,
-0.030879370868206024,
-0.008297434076666832,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def tearDown(self):
has_base_excpt = False
# stopping client
if self.client != None:
self.client.stop()
# stopping tempesta and servers
try:
stress.StressTest.tearDown(self)
except Exception as exc:
has_base_excpt = True
exc... | |
13,814 | [
0.02503128908574581,
0.01335163600742817,
0.05994908884167671,
-0.039037179201841354,
0.0010351454839110374,
-0.013387983664870262,
-0.016719834879040718,
0.00395581591874361,
-0.00848713330924511,
0.001844633836299181,
0.01754371076822281,
-0.004289000760763884,
0.0061699822545051575,
-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 create_servers(self):
self.servers = []
# default server
defport=tempesta.upstream_port_start_from()
server = multi_backend.NginxMP(listen_port=defport)
self.setup_nginx_config(server.config)
self.servers.append(server)
server = multi_backend.NginxMP(listen_p... | |
13,815 | [
0.028815867379307747,
-0.002081555314362049,
0.05137431621551514,
-0.013501061126589775,
0.015654882416129112,
-0.028906553983688354,
0.013263006694614887,
0.038156650960445404,
-0.017264580354094505,
-0.009442807175219059,
0.02911059930920601,
0.022025659680366516,
-0.011579625308513641,
... | 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": "config", "annotation": null, "type_comment": null}}], "kwarg": nu... | def setup_nginx_config(self, config):
config.enable_multi_accept()
config.set_worker_connections(32768)
config.set_workers(4096)
config.set_worker_rlimit_nofile(16384)
config.set_ka(timeout = 180)
for listener in config.listeners:
listener.backlog = 9000
... | |
13,816 | [
0.015048613771796227,
-0.016612805426120758,
0.08527547866106033,
-0.04622459411621094,
-0.02446073852479458,
0.03605734184384346,
0.003086246782913804,
0.0069512189365923405,
0.028452128171920776,
-0.0006771707558073103,
0.002101883990690112,
-0.0028064451180398464,
-0.03578765317797661,
... | 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 AddingBackendNewSG(DontModifyBackend):
def test(self):
self.pre_test()
for i in range(self.num_attempts):
tf_cfg.dbg(2, "Adding server group #%i" % i)
self.append_server_group(i)
t1 = time.time()
self.tempesta.reload()
t2 = time.time... | |
13,817 | [
0.027086716145277023,
-0.006752675399184227,
0.03864101320505142,
-0.02044806443154812,
-0.0006940337480045855,
0.03380138427019119,
0.009799614548683167,
-0.00035612285137176514,
0.0029012432787567377,
0.015861818566918373,
0.011953375302255154,
0.049207113683223724,
-0.005897505208849907,
... | 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 pre_test(self):
if remote.server != remote.tempesta:
remote.server.run_cmd("sysctl -w net.core.somaxconn=8192")
remote.server.run_cmd("sysctl -w net.ipv4.tcp_max_orphans=1000000")
# tempesta somaxconn sysctl setups from tempesta.sh
remote.tempesta.run_cmd("sysctl -w n... | |
13,818 | [
-0.003812348935753107,
-0.022067571058869362,
0.06278684735298157,
-0.04253564774990082,
-0.03630033880472183,
0.015628935769200325,
0.002939744619652629,
0.020888283848762512,
0.026676276698708534,
0.009800278581678867,
0.01911257579922676,
0.007997460663318634,
-0.04519243165850639,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test(self):
self.pre_test()
for i in range(self.num_attempts):
tf_cfg.dbg(2, "Adding server group #%i" % i)
self.append_server_group(i)
t1 = time.time()
self.tempesta.reload()
t2 = time.time()
tf_cfg.dbg(4, "tempesta.reload() %f... | |
13,819 | [
0.00045462159323506057,
-0.013392974622547626,
0.053977131843566895,
-0.04368419572710991,
-0.04090159013867378,
0.026056528091430664,
-0.012636538594961166,
0.028339345008134842,
0.0315541997551918,
0.01677667535841465,
0.033526334911584854,
0.003115234198048711,
-0.04984374716877937,
-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 test(self):
self.pre_test()
for i in range(self.num_attempts):
tf_cfg.dbg(2, "Removing server group #%i" % i)
self.remove_server_group(i)
t1 = time.time()
self.tempesta.reload()
t2 = time.time()
tf_cfg.dbg(4, "tempesta.reload() ... | |
13,820 | [
0.021145083010196686,
0.03756804019212723,
0.03648153692483902,
-0.039176907390356064,
0.01599462516605854,
-0.005949666257947683,
-0.005401189438998699,
-0.0410991869866848,
0.008279385976493359,
-0.025616472586989403,
0.042833417654037476,
-0.020434673875570297,
0.05399100109934807,
0.02... | 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', index=False):
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... | |
13,821 | [
-0.008498652838170528,
-0.022546900436282158,
0.06798922270536423,
-0.03624662384390831,
-0.024209097027778625,
0.011662189848721027,
-0.003124997718259692,
0.02024127170443535,
0.02478550374507904,
0.01115280669182539,
0.01520106103271246,
0.004835787229239941,
-0.04369970038533211,
-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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test(self):
self.pre_test()
for i in range(self.num_attempts):
tf_cfg.dbg(2, "Adding new server to default group")
server = self.servers[1]
self.def_sg.add_server(server.ip,
server.config.listeners[i].port, server.conns_n)
t1 = time.tim... | |
13,822 | [
0.03235410898923874,
0.06126385182142258,
0.005002946592867374,
-0.03547700494527817,
-0.004661379847675562,
0.029483802616596222,
0.00670503918081522,
0.00558848911896348,
-0.04716489836573601,
-0.019116250798106194,
-0.007336506620049477,
-0.036992527544498444,
-0.0005489463801495731,
0.... | 9 | {"_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)
event = sa.Table('event', meta, autoload=True)
_convert_data_type(event, 'generated', models.PreciseTimestamp(),
sa.Float(), pk_attr='id', index=True)
... | |
13,823 | [
0.040406983345746994,
0.06329675018787384,
0.01330721564590931,
-0.018092848360538483,
-0.009520472027361393,
0.03325111046433449,
0.004653010983020067,
0.012212390080094337,
-0.04921073839068413,
-0.024199042469263077,
0.014255313202738762,
-0.019187673926353455,
-0.017923545092344284,
0.... | 9 | {"_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)
event = sa.Table('event', meta, autoload=True)
_convert_data_type(event, 'generated', sa.Float(),
models.PreciseTimestamp(),
pk_attr='... | |
13,824 | [
0.0015482133021578193,
-0.012073406018316746,
-0.0507388673722744,
-0.025661800056695938,
-0.008751059882342815,
0.015375817194581032,
0.011216240003705025,
0.022020509466528893,
0.03487134352326393,
0.01055841613560915,
0.0063024903647601604,
-0.0454762727022171,
0.02299063466489315,
0.00... | 19 | {"_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": "PERSONA", "annotation"... | class MusicMode(object):
def __init__(self, PERSONA, mic, mpdwrapper):
self._logger = logging.getLogger(__name__)
self.persona = PERSONA
# self.mic - we're actually going to ignore the mic they passed in
self.music = mpdwrapper
# index spotify playlists into new dictionary ... | |
13,825 | [
0.011575092561542988,
-0.007718835491687059,
-0.02217663824558258,
-0.0114107271656394,
-0.013756089843809605,
0.0024986648932099342,
0.004497912712395191,
0.03064775839447975,
0.03714650124311447,
-0.0023753910791128874,
-0.0028574231546372175,
-0.035603996366262436,
0.03454194590449333,
... | 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": "PERSONA", "annotation": null, "type_comment": null}}, {"_type": "... | def __init__(self, PERSONA, mic, mpdwrapper):
self._logger = logging.getLogger(__name__)
self.persona = PERSONA
# self.mic - we're actually going to ignore the mic they passed in
self.music = mpdwrapper
# index spotify playlists into new dictionary and language models
ph... | |
13,826 | [
0.0276689101010561,
-0.021328119561076164,
-0.04898476600646973,
-0.014263715595006943,
0.0011160775320604444,
0.03205963224172592,
-0.01746477372944355,
0.026933034881949425,
0.011694285087287426,
0.01587037742137909,
-0.003654847387224436,
-0.028625547885894775,
-0.005224714521318674,
0.... | 18 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "input", "annotation": null, "type_comment": null}}], "kwarg": nul... | def delegateInput(self, input):
command = input.upper()
# check if input is meant to start the music module
if "PLAYLIST" in command:
command = command.replace("PLAYLIST", "")
elif "STOP" in command:
self.mic.say("Stopping music")
self.music.stop()
... | |
13,827 | [
0.023815447464585304,
-0.019808614626526833,
-0.031868916004896164,
-0.006139609031379223,
-0.017645984888076782,
0.00900210626423359,
0.0218916367739439,
0.01763271726667881,
0.03553079068660736,
0.0017728907987475395,
0.03192198649048805,
-0.02887042425572872,
-0.006318722385913134,
-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 handleForever(self):
self.music.play()
self.mic.say("Playing %s" % self.music.current_song())
while True:
threshold, transcribed = self.mic.passiveListen(self.persona)
if not transcribed or not threshold:
self._logger.info("Nothing has been said or... | |
13,828 | [
0.0011459883535280824,
0.0032547463197261095,
-0.010020606219768524,
0.010460888035595417,
0.02467811107635498,
0.04681484401226044,
-0.005896441172808409,
0.03430859372019768,
0.040795791894197464,
0.04376073181629181,
0.0037173216696828604,
-0.008370939642190933,
0.05684659630060196,
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}}], "kwarg": {"_type": "arg", "_fields": {"arg": "default_kwargs", "annotation": null, "type_comment": nu... | def wrap(self, *default_args, **default_kwargs):
try:
self.client.connect(self.server, self.port)
except:
pass
# sometimes not enough to just connect
try:
return func(self, *default_args, **default_kwargs)
except:
self.client = mpd... | |
13,829 | [
-0.005757092498242855,
0.01082174014300108,
0.019412951543927193,
-0.012292418628931046,
-0.030124392360448837,
0.01824866607785225,
0.017856484279036522,
0.020969420671463013,
0.030222436413168907,
0.020283102989196777,
0.018420245498418808,
-0.0029765914659947157,
-0.033604998141527176,
... | 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": "level", "annotation": null, "type_comment": null}}, {"_type": "ar... | def volume(self, level=None, interval=None):
if level:
self.client.setvol(int(level))
return
if interval:
level = int(self.client.status()['volume']) + int(interval)
self.client.setvol(int(level))
return | |
13,830 | [
0.012142010033130646,
0.0019295888487249613,
0.009129547514021397,
-0.007637715898454189,
-0.04167912155389786,
-0.004432294517755508,
0.012752566486597061,
-0.03384556621313095,
-0.003242861246690154,
-0.013962159864604473,
-0.04172519966959953,
-0.04075752571225166,
0.008639950305223465,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "app_label", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "overrides", "annotation": null, "type_comment": null}}], "kw... | def get_app_label(app_label, overrides):
pattern = app_label.replace('oscar.apps.', '')
for override in overrides:
if override.endswith(pattern):
if 'dashboard' in override and 'dashboard' not in pattern:
continue
return override
re... | |
13,831 | [
-0.01592934876680374,
-0.0163864828646183,
-0.0020028899889439344,
-0.0655459314584732,
-0.02365373633801937,
-0.005154475104063749,
0.03183525428175926,
-0.010033497586846352,
-0.004310535732656717,
0.03682856261730194,
-0.008556604385375977,
-0.0028424335177987814,
-0.05298061668872833,
... | 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": "BinOp", "_fields": {"... | def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
# Append 3rd digit if > 0
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
elif VERSION[3] != 'final':
version = '%s %s' % (version, VERSION[3])
if len(VERSION) == 5:
version = '%s %s' % (version,... | |
13,832 | [
-0.028902309015393257,
-0.02501244843006134,
0.027272479608654976,
-0.01800418272614479,
0.008236071094870567,
0.03348756209015846,
-0.009768110699951649,
-0.011506595648825169,
-0.008219772949814796,
0.003262375248596072,
0.0339873768389225,
-0.05550112575292587,
-0.03642125427722931,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "IntegerField", "value": {"_type": "Name", "_fields": {"id": ... | class Issue(models.Model):
num = models.IntegerField()
cc = models.ManyToManyField(User, blank=True, related_name='test_issue_cc')
client = models.ForeignKey(User, models.CASCADE, related_name='test_issue_client')
class Meta:
ordering = ('num',)
def __str__(self):
return str(self.n... | |
13,833 | [
0.014694707468152046,
0.02969769574701786,
0.027770942077040672,
-0.03907456248998642,
-0.03948560357093811,
0.061707496643066406,
-0.02443123608827591,
-0.02062910981476307,
-0.016236111521720886,
0.020346518605947495,
0.04156649857759476,
-0.05253614857792854,
-0.022029217332601547,
0.00... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "metering_label_rules"}}], "values": [{"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fiel... | class TestMeteringLabelRulesClient(base.BaseServiceTest):
FAKE_METERING_LABEL_RULES = {
"metering_label_rules": [
{
"remote_ip_prefix": "20.0.0.0/24",
"direction": "ingress",
"metering_label_id": "e131d186-b02d-4c0b-83d5-0c0725c4f812",
... | |
13,834 | [
0.001570393331348896,
-0.019118359312415123,
0.07447890192270279,
-0.050787705928087234,
-0.03106125444173813,
-0.024956027045845985,
0.009084870107471943,
-0.012478013522922993,
-0.03305578976869583,
0.03855292871594429,
0.018984580412507057,
-0.012052350677549839,
0.014436064288020134,
-... | 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": "project", "annotation": null, "type_comment": null}}], "kwarg": n... | def generate_project(self, project):
def linked_folder_id(source_set):
return source_set.source_base.replace(os.path.sep, '.')
def base_path(source_set):
return os.path.join(source_set.root_dir, source_set.source_base)
def create_source_base_template(source_set):
source_base = base_path(... | |
13,835 | [
0.029558058828115463,
-0.01535625010728836,
0.05876760929822922,
-0.024678910151124,
0.0012388464529067278,
-0.007787034846842289,
0.017654241994023323,
-0.039664868265390396,
-0.02367694303393364,
0.031888723373413086,
-0.0038254489190876484,
-0.04726675525307655,
0.0145176462829113,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
super(EclipseGen, self).__init__(*args, **kwargs)
version = _VERSIONS[self.get_options().version]
self.project_template = os.path.join(_TEMPLATE_BASEDIR, 'project-{}.mustache'.format(version))
self.classpath_template = os.path.join(_TEMPLATE_BASEDIR, 'classpath-{}.m... | |
13,836 | [
0.006898508407175541,
0.005302115809172392,
0.06913163512945175,
-0.030085451900959015,
-0.029897024855017662,
-0.018570492044091225,
0.04610171541571617,
-0.04463617503643036,
0.01011746283620596,
0.013462035916745663,
-0.0007916535250842571,
-0.0369734913110733,
0.045682989060878754,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "base_id", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "sources", "annotation": null, "type_comment": null}}], "kwarg"... | def create_sourcepath(base_id, sources):
def normalize_path_pattern(path):
return '{}/'.format(path) if not path.endswith('/') else path
includes = [normalize_path_pattern(src_set.path) for src_set in sources if src_set.path]
excludes = []
for source_set in sources:
excludes.ext... | |
13,837 | [
0.042335983365774155,
0.008767617866396904,
-0.035198312252759933,
-0.005864609498530626,
0.021924370899796486,
-0.014243383891880512,
0.016267500817775726,
0.024907279759645462,
-0.06562396883964539,
-0.020368998870253563,
0.03336595371365547,
-0.0118890181183815,
0.027996718883514404,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "dto", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _fill_dto(cls, dto, fields):
for field_name, field_value in fields.iteritems():
# We assume the setters are named the
# same way as the attributes themselves.
try:
getattr(dto, field_name)(field_value)
except AttributeError:
pas... | |
13,838 | [
0.006698888726532459,
-0.004574085120111704,
-0.0245346799492836,
-0.08683434128761292,
-0.03211279958486557,
-0.021352708339691162,
0.007243173196911812,
-0.014716621488332748,
0.0193221066147089,
0.03738817200064659,
-0.0010179170640185475,
-0.029496043920516968,
0.016736755147576332,
-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": "source_dir", "annotation": null, "type_comment": null}}, {"_type"... | def _get_archive_content_list(
self, source_dir, exclude_list=None, file_list=None
):
final_archive_contents = []
archive_contents = file_list
if not archive_contents:
archive_contents = os.listdir(source_dir)
for item in archive_contents:
if not excl... | |
13,839 | [
0.011673768050968647,
0.011997012421488762,
0.02947995811700821,
-0.04968739673495293,
-0.026857053861021996,
0.030311159789562225,
0.05205170437693596,
-0.0570758581161499,
0.02037367969751358,
0.05460072308778763,
-0.01316069532185793,
-0.03298947587609291,
0.024862170219421387,
-0.01005... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def find_settings_module(path):
path = os.path.abspath(path)
project_path = None
settings_name = "settings"
if os.path.isdir(path):
project_path = None
if not is_setting_mod(path):
for d in os.listdir(path):
if d in ('..', '.'):
continue
... | |
13,840 | [
0.010384608991444111,
-0.008223987184464931,
0.04270634055137634,
-0.011328664608299732,
-0.00520690344274044,
-0.018160900101065636,
0.037042006850242615,
-0.0004753732355311513,
-0.025362972170114517,
0.0390663743019104,
-0.017002729699015617,
-0.0022786285262554884,
-0.018267957493662834,... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cfg", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def make_default_env(cfg):
if cfg.django_settings:
os.environ['DJANGO_SETTINGS_MODULE'] = cfg.django_settings
if cfg.pythonpath and cfg.pythonpath is not None:
paths = cfg.pythonpath.split(",")
for path in paths:
pythonpath = os.path.abspath(cfg.pythonpath)
if py... | |
13,841 | [
-0.004326028283685446,
0.02485465630888939,
0.02570197358727455,
-0.017172308638691902,
-0.018603334203362465,
-0.007880055345594883,
0.008044811896979809,
0.0017840747023001313,
-0.009527618065476418,
0.053286876529455185,
-0.011212838813662529,
-0.04583048075437546,
-0.056713804602622986,
... | 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": "parser", "annotation":... | class DjangoApplication(Application):
def init(self, parser, opts, args):
if args:
if ("." in args[0] and not (os.path.isfile(args[0])
or os.path.isdir(args[0]))):
self.cfg.set("django_settings", args[0])
else:
# not settings env s... | |
13,842 | [
-0.0005354401655495167,
0.01199972815811634,
0.04576913267374039,
-0.02798958495259285,
-0.047060057520866394,
-0.012684308923780918,
0.029593460261821747,
0.0020708576776087284,
-0.012870123609900475,
0.046160321682691574,
-0.01356448419392109,
-0.027344122529029846,
-0.01179435383528471,
... | 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": "parser", "annotation": null, "type_comment": null}}, {"_type": "a... | def init(self, parser, opts, args):
if args:
if ("." in args[0] and not (os.path.isfile(args[0])
or os.path.isdir(args[0]))):
self.cfg.set("django_settings", args[0])
else:
# not settings env set, try to build one.
proje... | |
13,843 | [
0.03022688254714012,
0.017612973228096962,
0.04460402950644493,
-0.03199011832475662,
0.0010753795504570007,
-0.03026563487946987,
0.02681667171418667,
0.007905492559075356,
-0.0035918643698096275,
0.04770422354340553,
-0.009034156799316406,
0.010685978457331657,
-0.035109687596559525,
-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 load(self):
# chdir to the configured path before loading,
# default is the current dir
os.chdir(self.cfg.chdir)
# set settings
make_default_env(self.cfg)
# load wsgi application and return it.
mod = util.import_module("gunicorn.app.django_wsgi")
ret... | |
13,844 | [
0.014624279923737049,
-0.025239162147045135,
0.029569312930107117,
-0.02860705740749836,
-0.021490374580025673,
-0.029489124193787575,
0.050959452986717224,
-0.005958968307822943,
-0.009356933645904064,
0.057174019515514374,
-0.012058265507221222,
-0.030451379716396332,
-0.02572029083967209,... | 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": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_commen... | def init(self, *args):
if 'settings' in self.options:
self.options['django_settings'] = self.options.pop('settings')
cfg = {}
for k, v in self.options.items():
if k.lower() in self.cfg.settings and v is not None:
cfg[k.lower()] = v
return cfg | |
13,845 | [
0.01857687160372734,
0.014578218571841717,
0.043782833963632584,
-0.026747610419988632,
-0.006147325504571199,
-0.022238288074731827,
-0.0004914006567560136,
-0.0032013305462896824,
-0.01889483630657196,
0.061511795967817307,
-0.018827389925718307,
-0.05253169313073158,
-0.010136342607438564... | 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}}, {"_type": "arg", "_fields": {"arg": "options", "annotation"... | class DjangoApplicationCommand(Application):
def __init__(self, options, admin_media_path):
self.usage = None
self.prog = None
self.cfg = None
self.config_file = options.get("config") or ""
self.options = options
self.admin_media_path = admin_media_path
self.... | |
13,846 | [
0.022326024249196053,
0.019252724945545197,
0.04659516364336014,
-0.03146660700440407,
0.002612303476780653,
-0.03656233474612236,
0.0229803379625082,
0.0092645063996315,
0.0006137301679700613,
0.04096408933401108,
-0.0002814608160406351,
0.010419472120702267,
-0.029563143849372864,
-0.051... | 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 load(self):
# chdir to the configured path before loading,
# default is the current dir
os.chdir(self.cfg.chdir)
# set settings
make_default_env(self.cfg)
# load wsgi application and return it.
mod = util.import_module("gunicorn.app.django_wsgi")
ret... | |
13,847 | [
0.009122075513005257,
0.017431175336241722,
0.019272327423095703,
-0.09028822928667068,
-0.02226121351122856,
-0.00484797079116106,
-0.06723795086145401,
-0.07039421051740646,
-0.03510146215558052,
0.0360339917242527,
0.010120362974703312,
-0.006139168981462717,
0.003156262217089534,
0.012... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "class_list", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "columns", "annotation": null, "type_comment": null}}], "kwa... | def make_class_list(class_list,columns):
f=open("class_list.txt","wb")
prev=0
col_max = len(class_list) / columns + 1
print("col max is ", col_max)
col_count = 0
row_count = 0
last_initial = ""
fit_columns=[]
for n in range(0,columns):
fit_columns+=[[]]
indexers=[]
last_initial=""
idx=0
for n... | |
13,848 | [
0.006141554098576307,
0.02813110686838627,
-0.001893090084195137,
-0.019170379266142845,
-0.026069775223731995,
0.00840295571833849,
-0.017606191337108612,
-0.03540639206767082,
0.0036103606689721346,
0.00702671380713582,
0.03259328007698059,
-0.011513140052556992,
-0.003886215388774872,
-... | 20 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def dokuize_text(text):
pos=0
while(True):
pos = text.find("[",pos)
if (pos==-1):
break
endq_pos=text.find("]",pos+1)
if (endq_pos==-1):
break
pre_text=text[:pos]
post_text=text[endq_pos+1:]
tag_text=text[pos+1:endq_pos]
if (tag_text in class_names):
tag_text="[["+tag_text.lower()+"|"... | |
13,849 | [
0.03379115089774132,
0.062148552387952805,
-0.02120134048163891,
-0.0372600220143795,
-0.046696316450834274,
0.0024136537685990334,
-0.043470025062561035,
-0.03890955448150635,
0.03951599821448326,
0.019466904923319817,
0.03973431885242462,
-0.0320931039750576,
0.004636276978999376,
-0.012... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "f", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg", ... | def make_method(f,name,m,declare,event=False):
s=" * "
ret_type="void"
args=list(m)
mdata={}
mdata["argidx"]=[]
for a in args:
if (a.tag=="return"):
idx=-1
elif (a.tag=="argument"):
idx=int(a.attrib["index"])
else:
continue
mdata["argidx"].append(idx)
mdata[idx]=a
if (not event): ... | |
13,850 | [
-0.01664370484650135,
0.016115333884954453,
-0.006533094681799412,
0.004840654321014881,
0.009163944981992245,
0.04222569614648819,
0.01024270337074995,
0.07991620153188705,
0.008998828940093517,
-0.016335489228367805,
0.030051134526729584,
-0.014310063794255257,
0.017810525372624397,
0.01... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def check_user_password(module, client, user_name, user_password):
try:
client.switch_user(user_name, user_password)
client.get_list_users()
except influx.exceptions.InfluxDBClientError as e:
if e.code == 401:
return False
except ansible.module_utils.urls.ConnectionError ... | |
13,851 | [
0.000799726287368685,
-0.012290394864976406,
-0.010692231357097626,
-0.018054096028208733,
-0.02478700503706932,
-0.0016484286170452833,
-0.025220055133104324,
0.010470550507307053,
0.017012711614370346,
-0.02173502743244171,
-0.011218078434467316,
-0.029612427577376366,
0.014331920072436333... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def find_user(module, client, user_name):
name = None
try:
names = client.get_list_users()
for u_name in names:
if u_name['user'] == user_name:
name = u_name
break
except ansible.module_utils.urls.ConnectionError as e:
module.fail_json(msg... | |
13,852 | [
0.009229877963662148,
0.0255728866904974,
0.011163962073624134,
-0.009777868166565895,
-0.01140034943819046,
0.015386711806058884,
0.018083684146404266,
0.04091661795973778,
0.02888231910765171,
-0.0018038017442449927,
0.005318730603903532,
-0.04388221353292465,
0.00860667321830988,
-0.026... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def create_user(module, client, user_name, user_password, admin):
if not module.check_mode:
try:
client.create_user(user_name, user_password, admin)
except ansible.module_utils.urls.ConnectionError as e:
module.fail_json(msg=str(e))
module.exit_json(changed=True) | |
13,853 | [
0.007245701737701893,
-0.0007525729015469551,
0.020051943138241768,
-0.009155887179076672,
-0.05496532469987869,
0.057885605841875076,
0.03246314451098442,
0.034083303064107895,
0.04064393788576126,
-0.023002227768301964,
0.010391006246209145,
-0.057885605841875076,
0.0010213489877060056,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def set_user_password(module, client, user_name, user_password):
if not module.check_mode:
try:
client.set_user_password(user_name, user_password)
except ansible.module_utils.urls.ConnectionError as e:
module.fail_json(msg=str(e))
module.exit_json(changed=True) | |
13,854 | [
-0.007443845272064209,
0.04553043097257614,
-0.0005847992724739015,
-0.004577400162816048,
0.020020557567477226,
0.04132433235645294,
0.024012787267565727,
0.017537295818328857,
0.03723704814910889,
0.05869528278708458,
0.022527582943439484,
-0.020210662856698036,
0.056604113429784775,
0.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 main():
argument_spec = influx.InfluxDb.influxdb_argument_spec()
argument_spec.update(
state=dict(default='present', type='str', choices=['present', 'absent']),
user_name=dict(required=True, type='str'),
user_password=dict(required=False, type='str', no_log=True),
admin=dict(... | |
13,855 | [
0.01594298519194126,
0.04953593760728836,
0.009873717091977596,
-0.022425051778554916,
0.015162012539803982,
0.06145133823156357,
-0.00672751571983099,
0.055739086121320724,
0.04268569499254227,
-0.00816673506051302,
0.021878371015191078,
-0.020550720393657684,
-0.006939493585377932,
-0.01... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": ... | def drop_user(module, client, user_name):
if not module.check_mode:
try:
client.drop_user(user_name)
except influx.exceptions.InfluxDBClientError as e:
module.fail_json(msg=e.content)
module.exit_json(changed=True) | |
13,856 | [
0.010410607792437077,
0.025824371725320816,
-0.006099175661802292,
-0.039090316742658615,
-0.021528732031583786,
0.005688562989234924,
-0.03762474283576012,
0.007574222516268492,
-0.05114337429404259,
0.0301958154886961,
0.0013013259740546346,
-0.053265925496816635,
-0.01857232116162777,
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 _init(self):
assert ('query' in self._modules) is ('main' in self._paraminfo)
if 'query' in self._modules:
return
_mw_ver = MediaWikiVersion(self.site.version())
if _mw_ver < MediaWikiVersion('1.15'):
self._parse_help(_mw_ver)
# The paraminfo api dep... | |
13,857 | [
0.01826133020222187,
-0.037596140056848526,
0.02103041671216488,
-0.05826059728860855,
-0.0074289580807089806,
0.019566582515835762,
-0.002958164783194661,
-0.0325947068631649,
-0.0032509316224604845,
0.00417802669107914,
0.011747268959879875,
-0.03437570482492447,
0.02869114838540554,
0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ArchiveViews(DiaryTestsMixin, TestCase):
def setUp(self):
super(ArchiveViews, self).setUp()
self.time_patch = patch("django.utils.timezone.now")
time_mock = self.time_patch.start()
time_mock.return_value = self._fake_now
def tearDown(self):
self.time_patch.stop()
... | |
13,858 | [
0.03143411502242088,
0.05499812588095665,
0.01980256475508213,
-0.0013020389014855027,
-0.030508218333125114,
0.026804640889167786,
0.0439336858689785,
0.009449909441173077,
-0.04759097099304199,
-0.0026055246125906706,
0.014698573388159275,
-0.026550021022558212,
0.03180447220802307,
0.04... | 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": "error", "annotation": null, "type_comment": null}}], "kwarg": nul... | def _is_wikibase_error_retryable(self, error):
ERR_MSG = u'edit-already-exists'
messages = error.pop("messages", None)
# bug T68619; after Wikibase breaking change 1ca9cee change we have a
# list of messages
if isinstance(messages, list):
for item in messages:
... | |
13,859 | [
0.010587763041257858,
0.029178958386182785,
0.003921788185834885,
-0.05878419801592827,
-0.029434727504849434,
0.03126773610711098,
0.009617973119020462,
0.008919937536120415,
0.011157914064824581,
0.01131776999682188,
0.005296545568853617,
-0.0508127361536026,
0.0031784602906554937,
-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": "path", "annotation": null, "type_comment": null}}], "kwarg": null... | def _module_set(self, path):
# Load the submodules of all action modules available
self.fetch(self.action_modules)
modules = set(self.action_modules)
for parent_module in self._modules:
submodules = self.submodules(parent_module, path)
assert not submodules & modu... | |
13,860 | [
0.019688718020915985,
0.018234437331557274,
-0.014256918802857399,
0.018992653116583824,
-0.03328686207532883,
-0.023815393447875977,
0.008812690153717995,
0.00640753423795104,
0.007905318401753902,
0.06557933986186981,
-0.015487464144825935,
-0.0399492047727108,
-0.02354194037616253,
-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}}, {"_type": "arg", "_fields": {"arg": "result", "annotation": null, "type_comment": null}}], "kwarg": nu... | def _handle_warnings(self, result):
if 'warnings' in result:
for mod, warning in result['warnings'].items():
if mod == 'info':
continue
if '*' in warning:
text = warning['*']
elif 'html' in warning:
... | |
13,861 | [
0.05590217933058739,
0.03437228500843048,
-0.017275603488087654,
0.012882152572274208,
-0.021350974217057228,
-0.03280177712440491,
0.040276605635881424,
-0.008767020888626575,
0.03725486621260643,
-0.027394454926252365,
-0.023219682276248932,
-0.02715589478611946,
-0.016371069476008415,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "key", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "content", "annotation": null, "type_comment": null}}, {"_type": "a... | def _generate_MIME_part(key, content, keytype=None, headers=None):
if not keytype:
try:
content.encode("ascii")
keytype = ("text", "plain")
except (UnicodeError, AttributeError):
keytype = ("application", "octet-stream")
submsg = MI... | |
13,862 | [
-0.038023751229047775,
-0.004208260681480169,
0.06877642869949341,
-0.0008590827928856015,
0.011105824261903763,
-0.00681040994822979,
-0.010601580142974854,
0.01467911060899496,
0.0013944532256573439,
0.05343744158744812,
0.00777532160282135,
-0.02719183824956417,
-0.03456252068281174,
-0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_hwe_normalized_pca():
mt = hl.balding_nichols_model(3, 100, 50)
eigenvalues, scores, loadings = hl.hwe_normalized_pca(mt.GT, k=2, compute_loadings=True)
assert len(eigenvalues) == 2
assert isinstance(scores, hl.Table)
scores.count() == 100
assert isinstance(loadings, hl.Table)
_, ... | |
13,863 | [
0.04002736136317253,
0.03570070117712021,
-0.004468372091650963,
-0.0020273972768336535,
-0.008416157215833664,
0.0033548942301422358,
0.030055224895477295,
0.05335438996553421,
-0.011892521753907204,
0.03146659582853317,
0.020661521703004837,
-0.03595521301031113,
0.005414105486124754,
-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 _query_continue(self):
if all(key not in self.data[self.continue_name]
for key in self.continuekey):
pywikibot.log(
u"Missing '%s' key(s) in ['%s'] value."
% (self.continuekey, self.continue_name))
return True
for query_continue_... | |
13,864 | [
-0.007922363467514515,
-0.007751282770186663,
0.07274888455867767,
-0.026807067915797234,
0.018476741388440132,
-0.04434944689273834,
0.018871543928980827,
-0.01946374773979187,
-0.02889952063560486,
0.01810825988650322,
0.0009820704581215978,
0.03184737637639046,
-0.013515395112335682,
0.... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_blanczos_against_numpy():
def concatToNumpy(field, horizontal=True):
blocks = field.collect()
if horizontal:
return np.concatenate(blocks, axis=0)
else:
return np.concatenate(blocks, axis=1)
mt = hl.import_vcf(resource('tiny_m.vcf'))
mt = mt.filter_... | |
13,865 | [
-0.03866596147418022,
-0.03293193131685257,
0.08683698624372482,
-0.016168933361768723,
0.0012527048820629716,
-0.005537084769457579,
-0.011719893664121628,
-0.0011550390627235174,
-0.003438481129705906,
0.041300516575574875,
0.02021116577088833,
-0.010124954394996166,
0.020546942949295044,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def test_pca_against_numpy():
mt = hl.import_vcf(resource('tiny_m.vcf'))
mt = mt.filter_rows(hl.len(mt.alleles) == 2)
mt = mt.annotate_rows(AC=hl.agg.sum(mt.GT.n_alt_alleles()),
n_called=hl.agg.count_where(hl.is_defined(mt.GT)))
mt = mt.filter_rows((mt.AC > 0) & (mt.AC < 2 * mt... | |
13,866 | [
-0.019113458693027496,
0.01052055787295103,
0.06761626899242401,
-0.024140194058418274,
0.007165693677961826,
-0.01948416233062744,
0.0034067626111209393,
0.004251966252923012,
-0.010883847251534462,
0.007925635203719139,
0.0007363092736341059,
0.016548192128539085,
-0.04371332377195358,
0... | 13 | {"_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": "Constant", "_fields":... | def test_blanczos_against_hail():
k = 10
def concatToNumpy(field, horizontal=True):
blocks = field.collect()
if horizontal:
return np.concatenate(blocks, axis=0)
else:
return np.concatenate(blocks, axis=1)
hl.utils.get_1kg('data/')
hl.import_vcf('data/1k... | |
13,867 | [
-0.0330369733273983,
-0.00007430336700053886,
0.04674248397350311,
-0.01634499803185463,
-0.007187338080257177,
-0.011728992685675621,
-0.029368950054049492,
-0.01290003303438425,
0.017522234469652176,
0.042330943048000336,
0.02055826596915722,
-0.006375664845108986,
0.0028733862563967705,
... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def test_spectra():
def make_spectral_matrix(index_func, k, m, n):
sigma_dim = min(m, n)
answer = np.zeros((m, n))
for j in range(sigma_dim):
answer[j, j] = index_func(j + 1, k)
return answer
def matrix_table_from_numpy(np_mat):
rows, cols = np_mat.shape
... | |
13,868 | [
0.023590784519910812,
-0.03058231808245182,
0.017151808366179466,
-0.022722480818629265,
0.03626575693488121,
-0.016542868688702583,
-0.03132657706737518,
-0.020207785069942474,
-0.016824785619974136,
0.027334637939929962,
0.04258069023489952,
-0.03331127017736435,
-0.0014857007190585136,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a... | def sample_read_tensorboard_blob_data():
# Create a client
client = aiplatform_v1beta1.TensorboardServiceClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.ReadTensorboardBlobDataRequest(
time_series="time_series_value",
)
# Make the request
stream = client.read... | |
13,869 | [
-0.005391449201852083,
0.0060203466564416885,
0.050589870661497116,
-0.015042965300381184,
0.01955585554242134,
-0.015434840694069862,
-0.007300262805074453,
0.014840707182884216,
-0.004408600274473429,
0.018595127388834953,
0.0036564518231898546,
-0.02750713750720024,
0.0017618599813431501,... | 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_basic_flow(self):
# Default database should exist
response = self.client.get("/metastore/databases")
assert_true(self.db_name in response.context["databases"])
# Table should have been created
response = self.client.get("/metastore/tables/")
assert_equal(200, response.status_code)
... | |
13,870 | [
0.013056181371212006,
0.041323691606521606,
0.013106301426887512,
-0.030372537672519684,
-0.02078714594244957,
0.0001464435044908896,
-0.017516834661364555,
-0.026362963020801544,
-0.0031074213329702616,
0.0250974390655756,
0.04022105783224106,
-0.030172059312462807,
0.04876646772027016,
-... | 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_describe_view(self):
resp = self.client.get('/metastore/table/%s/myview' % self.db_name)
assert_equal(None, resp.context['sample'])
assert_true(resp.context['table'].is_view)
assert_true("View" in resp.content)
assert_true("Drop View" in resp.content)
# Breadcrumbs
assert_true(self.... | |
13,871 | [
-0.004682572092860937,
0.000097467411251273,
0.09440594911575317,
-0.058825019747018814,
0.005010186694562435,
0.008564308285713196,
-0.0032844189554452896,
-0.005178957711905241,
-0.0024885472375899553,
-0.022992586717009544,
0.02409125491976738,
-0.022714611142873764,
0.01743306778371334,
... | 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_show_tables(self):
# Set max limit to 3
resets = [
HS2_GET_TABLES_MAX.set_for_testing(3)
]
try:
hql = """
CREATE TABLE test_show_tables_1 (a int) COMMENT 'Test for show_tables';
CREATE TABLE test_show_tables_2 (a int) COMMENT 'Test for show_tables';
CREATE T... | |
13,872 | [
0.00564856780692935,
0.018047554418444633,
0.062463533133268356,
-0.0002683386264834553,
0.010980511084198952,
-0.012481307610869408,
-0.020111940801143646,
0.0617036372423172,
0.006953057367354631,
0.004584711976349354,
0.010302936658263206,
-0.026723043993115425,
0.032143641263246536,
-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 test_describe_partitioned_table_with_limit(self):
# Limit to 90
finish = BROWSE_PARTITIONED_TABLE_LIMIT.set_for_testing("90")
try:
response = self.client.get("/metastore/table/%s/test_partitions" % self.db_name)
assert_true("0x%x" % 89 in response.content, response.content)
assert_fals... | |
13,873 | [
-0.01765710674226284,
-0.002930328482761979,
0.07373407483100891,
-0.00864697340875864,
0.024882744997739792,
-0.01194672379642725,
-0.026723593473434448,
0.029027782380580902,
0.03125683590769768,
0.028326507657766342,
0.008427824825048447,
-0.04513206705451012,
0.05580146610736847,
-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_describe_partitions(self):
response = self.client.get("/metastore/table/%s/test_partitions" % self.db_name)
assert_true("Show Partitions (2)" in response.content, response.content)
response = self.client.get("/metastore/table/%s/test_partitions/partitions" % self.db_name, follow=True)
assert_t... | |
13,874 | [
0.02133774757385254,
-0.005632580723613501,
0.05163150280714035,
0.002901056781411171,
0.013539238832890987,
-0.04216105118393898,
0.012989718466997147,
0.034233931452035904,
0.020706383511424065,
0.035894181579351425,
0.017444338649511337,
-0.029603932052850723,
0.04038387909531593,
-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_browse_partition(self):
partition_spec = "baz='baz_one',boom='boom_two'"
response = self.client.get("/metastore/table/%s/test_partitions/partitions/%s/browse" % (self.db_name, partition_spec), follow=True)
if is_live_cluster():
path = '/user/hive/warehouse/%s.db/test_partitions/baz=baz_one/bo... | |
13,875 | [
-0.0005553609225898981,
0.014368976466357708,
0.09094987064599991,
-0.04901545122265816,
0.012587223201990128,
0.04804985597729683,
-0.026369944214820862,
0.03027830645442009,
0.004161255434155464,
-0.010874440893530846,
0.03110595978796482,
-0.026415925472974777,
0.009598475880920887,
-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_drop_multi_tables(self):
hql = """
CREATE TABLE test_drop_1 (a int);
CREATE TABLE test_drop_2 (a int);
CREATE TABLE test_drop_3 (a int);
"""
resp = _make_query(self.client, hql, database=self.db_name)
resp = wait_for_query_to_finish(self.client, resp, max=30.0)
# Drop the... | |
13,876 | [
0.005006893537938595,
-0.006565590389072895,
0.09823154658079147,
-0.05557483434677124,
-0.013792785815894604,
0.02536526881158352,
-0.03009742870926857,
0.033573657274246216,
0.013310599140822887,
0.0025398910511285067,
0.014353468082845211,
-0.009256865829229355,
0.00035217858385294676,
... | 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_drop_multi_databases(self):
db1 = '%s_test_drop_1' % self.db_name
db2 = '%s_test_drop_2' % self.db_name
db3 = '%s_test_drop_3' % self.db_name
try:
hql = """
CREATE DATABASE %(db1)s;
CREATE DATABASE %(db2)s;
CREATE DATABASE %(db3)s;
""" % {'db1': db1, 'db2': ... | |
13,877 | [
0.04167177900671959,
0.021651046350598335,
0.06244591623544693,
-0.015426216647028923,
0.06570654362440109,
0.009182860143482685,
-0.014524604193866253,
0.03697845712304115,
0.022503254935145378,
-0.05266404151916504,
0.059580519795417786,
-0.03011138178408146,
-0.011961801908910275,
0.017... | 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_has_write_access_frontend(self):
client = make_logged_in_client(username='write_access_frontend', groupname='write_access_frontend', is_superuser=False)
grant_access("write_access_frontend", "write_access_frontend", "metastore")
user = User.objects.get(username='write_access_frontend')
def che... | |
13,878 | [
0.02110692858695984,
0.036156680434942245,
0.05376908555626869,
-0.01274336688220501,
0.0020355605520308018,
0.010040934197604656,
-0.009860383346676826,
0.0368322916328907,
0.01394315343350172,
0.006680366117507219,
0.03655272722244263,
-0.061829790472984314,
0.01012247335165739,
0.006493... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "assertz", "annotation": null, "type_comment": null}}], "kwarg":... | def check(client, assertz):
response = client.get("/metastore/databases")
assertz("Drop</button>" in response.content, response.content)
assertz("Create a new database" in response.content, response.content)
response = client.get("/metastore/tables/")
assertz("Drop</button>" in response.c... | |
13,879 | [
0.03103523701429367,
0.023030322045087814,
0.0636766329407692,
-0.01986980438232422,
0.04261516034603119,
0.021644357591867447,
-0.02764156647026539,
0.026022449135780334,
0.0064926594495773315,
-0.05147496983408928,
0.05142315849661827,
-0.02784881368279457,
-0.007253644522279501,
0.01546... | 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_has_write_access_backend(self):
client = make_logged_in_client(username='write_access_backend', groupname='write_access_backend', is_superuser=False)
grant_access("write_access_backend", "write_access_backend", "metastore")
grant_access("write_access_backend", "write_access_backend", "beeswax")
... | |
13,880 | [
-0.02228669822216034,
-0.011589082889258862,
-0.017871810123324394,
-0.046908192336559296,
0.03234754875302315,
0.042217373847961426,
-0.013446307741105556,
-0.034788474440574646,
0.009280817583203316,
0.022668756544589996,
0.019495554268360138,
-0.031222602352499962,
0.049412794411182404,
... | 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 TestParser(object):
def test_parse_simple(self):
name = 'simple'
type = 'string'
comment = 'test_parse_simple'
column = {'name': name, 'type': type, 'comment': comment}
parse_tree = parser.parse_column(name, type, comment)
assert_equal(parse_tree, column)
def test_parse_array(self):... | |
13,881 | [
-0.013255986385047436,
0.006232675164937973,
-0.00030499164131470025,
-0.055365048348903656,
0.022569062188267708,
0.003162543522194028,
-0.04805423319339752,
0.010103710927069187,
-0.005498513113707304,
0.047438155859708786,
0.04719172418117523,
-0.0039275093004107475,
0.0162542425096035,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "nums", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def sort2(nums):
index_p=0
index=0
while index<len(nums):
if nums[index]>=0:
temp=nums[index]
nums.pop(index)
nums.insert(index_p,temp)
index_p+=1
index+=1
return nums | |
13,882 | [
0.030941613018512726,
0.02348480373620987,
0.038694798946380615,
-0.030870482325553894,
0.019382964819669724,
0.014937330037355423,
0.008565254509449005,
-0.004584930371493101,
-0.00873122550547123,
-0.01684598997235298,
-0.026697514578700066,
-0.027100585401058197,
0.0025636490900069475,
... | 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_standard_properties(self):
metadata = ExposureLayerMetadata(unique_filename())
with self.assertRaises(KeyError):
metadata.get_property('non_existing_key')
# from BaseMetadata
metadata.get_property('title')
# from ExposureLayerMetadata
metadata.get_p... | |
13,883 | [
0.03717082738876343,
0.02014354057610035,
0.032843947410583496,
-0.02555774711072445,
0.00952810700982809,
0.018305175006389618,
0.0019756811670958996,
-0.006451088935136795,
-0.007017171010375023,
-0.010660270228981972,
-0.03463747352361679,
-0.038740161806344986,
0.01911226287484169,
-0.... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestExposureMetadata(TestCase):
def test_standard_properties(self):
metadata = ExposureLayerMetadata(unique_filename())
with self.assertRaises(KeyError):
metadata.get_property('non_existing_key')
# from BaseMetadata
metadata.get_property('title')
# from E... | |
13,884 | [
0.0016831218963488936,
0.04119124263525009,
-0.0273884367197752,
-0.012825509533286095,
0.0002028493763646111,
0.02024572528898716,
0.056948643177747726,
-0.005682799033820629,
-0.013766610063612461,
0.021223021671175957,
0.04027427360415459,
-0.001636368571780622,
0.015383373014628887,
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": "Global", "_fields": {"names": ["_mtimes", "_win"]}}, {"_type":... | def code_changed():
global _mtimes, _win
for filename in filter(lambda v: v, map(lambda m: getattr(m, "__file__", None), sys.modules.values())):
if filename.endswith(".pyc") or filename.endswith(".pyo"):
filename = filename[:-1]
if filename.endswith("$py.class"):
filename... | |
13,885 | [
0.023483026772737503,
0.04782503470778465,
-0.006846584379673004,
-0.000045593893446493894,
-0.010497253388166428,
0.05093252286314964,
0.01955445110797882,
0.00883613619953394,
0.007497136015444994,
0.041584789752960205,
0.034940317273139954,
0.0336771085858345,
0.012581545859575272,
0.04... | 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": "Assign", "_fields": {"val... | def ensure_echo_on():
if termios:
fd = sys.stdin
if fd.isatty():
attr_list = termios.tcgetattr(fd)
if not attr_list[3] & termios.ECHO:
attr_list[3] |= termios.ECHO
if hasattr(signal, 'SIGTTOU'):
old_handler = signal.signal(s... | |
13,886 | [
0.08634141087532043,
0.07884696125984192,
0.03842569887638092,
-0.03044344112277031,
-0.043614163994789124,
0.03886915743350983,
0.05237247422337532,
0.049933452159166336,
0.025410184636712074,
0.05006648972630501,
0.023237235844135284,
0.00000645808404442505,
-0.012915735132992268,
0.0259... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "main_func", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type":... | def python_reloader(main_func, args, kwargs):
if os.environ.get("RUN_MAIN") == "true":
thread.start_new_thread(main_func, args, kwargs)
try:
reloader_thread()
except KeyboardInterrupt:
pass
else:
try:
exit_code = restart_with_reloader()
... | |
13,887 | [
0.03145376965403557,
-0.014217857271432877,
-0.001970281358808279,
0.012520203366875648,
0.030109791085124016,
0.01959376409649849,
-0.0403192974627018,
0.028695078566670418,
0.015090263448655605,
0.008164068683981895,
0.011824635788798332,
-0.03772565722465515,
0.07809211313724518,
-0.029... | 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 do_GET(self):
pattern_handlers = {
"/api/v1/users/(?P<user_id>\\d+)/active_threads$": self.do_user_profile,
"/api/v1/users/(?P<user_id>\\d+)$": self.do_user,
"/api/v1/search/threads$": self.do_search_threads,
"/api/v1/threads$": self.do_threads,
"/... | |
13,888 | [
0.038563791662454605,
-0.03471386432647705,
-0.008721482008695602,
0.00035521757672540843,
0.024712659418582916,
0.021819837391376495,
-0.0024747608695179224,
0.04813483729958534,
0.04959738254547119,
-0.040133874863386154,
0.035638708621263504,
-0.01671169325709343,
0.050672780722379684,
... | 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 do_PUT(self):
if self.path.startswith('/set_config'):
return StubHttpRequestHandler.do_PUT(self)
pattern_handlers = {
"/api/v1/users/(?P<user_id>\\d+)$": self.do_put_user,
}
if self.match_pattern(pattern_handlers):
return
self.send_response... | |
13,889 | [
0.018958738073706627,
0.020393017679452896,
0.037917476147413254,
-0.009534922428429127,
0.014605400152504444,
0.027130085974931717,
-0.004234657157212496,
-0.022887853905558586,
0.028948185965418816,
0.06686566025018692,
-0.009141000919044018,
-0.03567515313625336,
0.06888577342033386,
-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": "pattern_handlers", "annotation": null, "type_comment": null}}], "... | def match_pattern(self, pattern_handlers):
path = urlparse.urlparse(self.path).path
for pattern in pattern_handlers:
match = re.match(pattern, path)
if match:
pattern_handlers[pattern](**match.groupdict())
return True
return None | |
13,890 | [
0.011783238500356674,
-0.043173886835575104,
-0.028490254655480385,
0.006690323818475008,
0.050315242260694504,
0.017327187582850456,
0.0067216455936431885,
0.032273922115564346,
0.003849441884085536,
0.021085795015096664,
-0.0020703671034425497,
-0.03568172827363014,
0.04252239316701889,
... | 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": "user_id", "annotation": null, "type_comment": null}}], "kwarg": n... | def do_user_profile(self, user_id):
if 'active_threads' in self.server.config:
user_threads = self.server.config['active_threads'][:]
params = self._params
page = int(params.get("page", ["1"])[0])
per_page = int(params.get("per_page", ["20"])[0])
num_p... | |
13,891 | [
-0.0058515844866633415,
-0.0067664338275790215,
-0.02711176685988903,
-0.026996690779924393,
0.0384812168776989,
-0.0007781974272802472,
-0.020897693932056427,
0.03500593826174736,
0.0041829911060631275,
0.014959802851080894,
-0.0012212378205731511,
-0.04184141755104065,
0.022129001095891,
... | 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_id", "annotation": null, "type_comment": null}}], "kwarg": n... | def do_user(self, user_id):
response = {
"id": user_id,
"default_sort_key": self.server.config.get("default_sort_key", "date"),
"upvoted_ids": [],
"downvoted_ids": [],
"subscribed_thread_ids": [],
}
if 'course_id' in self._params:
... | |
13,892 | [
0.03176844120025635,
-0.025943409651517868,
0.002577514387667179,
-0.02574761025607586,
0.001953404163941741,
0.014183213002979755,
-0.03167054057121277,
0.04363877326250076,
-0.02426687814295292,
0.012861567549407482,
0.014501387253403664,
-0.05286581814289093,
0.0434429757297039,
-0.0134... | 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": "thread_id", "annotation": null, "type_comment": null}}], "kwarg":... | def do_thread(self, thread_id):
if thread_id in self.server.config.get('threads', {}):
thread = self.server.config['threads'][thread_id].copy()
params = urlparse.parse_qs(urlparse.urlparse(self.path).query)
if "recursive" in params and params["recursive"][0] == "True":
... | |
13,893 | [
0.05128682777285576,
-0.0314704105257988,
-0.06932277232408524,
0.013064498081803322,
0.00432400219142437,
0.07108011841773987,
-0.012983568012714386,
0.01494902279227972,
0.029874922707676888,
-0.01928458735346794,
0.02390918880701065,
-0.006682548671960831,
0.023862941190600395,
-0.01380... | 15 | {"_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": "commentable_id", "annotation": null, "type_comment": null}}], "kw... | def do_commentable(self, commentable_id):
self.send_json_response({
"collection": [
thread
for thread in self.server.config.get('threads', {}).values()
if thread.get('commentable_id') == commentable_id
],
"page": 1,
... | |
13,894 | [
-0.008358394727110863,
0.01835147850215435,
0.03746660798788071,
-0.00406584283336997,
-0.0038421170320361853,
-0.029710780829191208,
-0.011275778524577618,
-0.0222293920814991,
0.030164198949933052,
0.026608450338244438,
-0.015595177188515663,
0.0000586814021517057,
0.025224333629012108,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "TextInputForm", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "default_form", "ctx": {"_type": "Store", "_fields"... | class TestTextInput(WebTest):
default_form = TextInputForm
urls = 'tests.integration.tests.test_textinput'
def test_default_usecase(self):
page = self.app.get(self.test_default_usecase.url)
self.assertIn('id="id_test_field_container"', page.body.decode('utf-8'))
self.assertIn('id="... | |
13,895 | [
0.03084896318614483,
-0.015223395079374313,
-0.008285927586257458,
0.006097638048231602,
0.02188289165496826,
-0.02990267612040043,
0.009433300234377384,
-0.012207104824483395,
0.0028802617453038692,
0.007469754666090012,
-0.004574707243591547,
-0.01234904769808054,
0.020073117688298225,
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_default_usecase(self):
page = self.app.get(self.test_default_usecase.url)
self.assertIn('id="id_test_field_container"', page.body.decode('utf-8'))
self.assertIn('id="id_test_field"', page.body.decode('utf-8'))
self.assertIn('maxlength="20"', page.body.decode('utf-8'))
s... | |
13,896 | [
0.01933431439101696,
0.04169021546840668,
0.044061582535505295,
-0.02650579623878002,
0.04230218008160591,
-0.007596989627927542,
0.03872600197792053,
-0.0037387325428426266,
-0.014782814309000969,
0.01379793044179678,
-0.004259860143065453,
0.006344371009618044,
0.0143525255843997,
-0.028... | 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": "svnadmin_filepath", "a... | class Admin(svn.common_base.CommonBase):
def __init__(self, svnadmin_filepath='svnadmin', env={}, *args, **kwargs):
super(Admin, self).__init__(*args, **kwargs)
self.__env = env
self.__svnadmin_filepath = svnadmin_filepath
def create(self, path, svnadmin_filepath='svnadmin'):
r... | |
13,897 | [
-0.005800607148557901,
0.0353451706469059,
0.05098702386021614,
-0.06081785634160042,
0.027409691363573074,
-0.07214830815792084,
0.006175511982291937,
-0.02474370412528515,
-0.01989077217876911,
0.055444225668907166,
-0.01733933761715889,
0.043405622243881226,
0.05515263229608536,
-0.0462... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "_args", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "env", "annotation": null, "type_comment": null}}, {"_type": "arg... | def CreateTestRun(_args, env, test_instance, error_func):
if isinstance(env, local_device_environment.LocalDeviceEnvironment):
if isinstance(test_instance, gtest_test_instance.GtestTestInstance):
return local_device_gtest_run.LocalDeviceGtestRun(env, test_instance)
if isinstance(test_instance,
... | |
13,898 | [
0.028714224696159363,
0.009678550995886326,
0.057632528245449066,
-0.012081606313586235,
-0.0005793992895632982,
-0.02683667652308941,
0.018663225695490837,
-0.06016313657164574,
-0.05151009187102318,
0.05436722934246063,
0.012887727469205856,
-0.01045916136354208,
-0.01246936060488224,
-0... | 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": "bpp", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __init__(self, bpp, width, height, pixels, metadata=None):
assert bpp in [3, 4], 'Invalid bytes per pixel'
assert width > 0, 'Invalid width'
assert height > 0, 'Invalid height'
assert pixels, 'Must specify pixels'
assert bpp * width * height == len(pixels), 'Dimensions and pixels mismatch'
... | |
13,899 | [
0.010839435271918774,
0.035717934370040894,
0.09241463243961334,
0.04782862588763237,
-0.027267474681138992,
0.031148791313171387,
0.02354583330452442,
-0.0435296967625618,
0.03001878783106804,
0.06185540556907654,
0.01680266112089157,
-0.035496849566698074,
0.02589181810617447,
0.01687635... | 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 TestBoundary(unittest.TestCase):
def test_no_polygon_boundary_reversal(self):
# Check that polygons preserve their clockwise or counter-clockwise
# ordering when they are attached to the boundary.
# Failure to do so will result in invalid polygons (their boundaries
# cross-over... | |
13,900 | [
0.03182497248053551,
0.029232168570160866,
0.08342869579792023,
0.06461364775896072,
-0.029622236266732216,
0.04327462241053581,
0.02281898818910122,
-0.029966413974761963,
0.0172547809779644,
0.03577154502272606,
0.019228067249059677,
-0.030998947098851204,
0.01927395723760128,
0.01905597... | 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_no_polygon_boundary_reversal(self):
# Check that polygons preserve their clockwise or counter-clockwise
# ordering when they are attached to the boundary.
# Failure to do so will result in invalid polygons (their boundaries
# cross-over).
polygon = sgeom.Polygon([(-10, 3... |