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 |
|---|---|---|---|---|---|
21,201 | [
0.008881968446075916,
0.0399833619594574,
0.02166248857975006,
-0.023333296179771423,
0.0072169615887105465,
0.027521919459104538,
-0.0193187166005373,
0.012855938635766506,
-0.009554932825267315,
0.029123108834028244,
0.02875181846320629,
-0.011016889475286007,
0.01740424893796444,
-0.021... | 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": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def checkConfig(self,
name,
image='buildbot/buildbot-worker',
namespace=None,
masterFQDN=None,
kube_config=None,
**kwargs):
super().checkConfig(name, None, **kwargs)
kubeclientservice... | |
21,202 | [
0.002804391784593463,
0.014956756494939327,
0.05611049756407738,
-0.001951743382960558,
-0.04040590301156044,
0.016214484348893166,
0.000876726524438709,
0.015217366628348827,
-0.038819581270217896,
0.04221884533762932,
-0.003815672593191266,
0.006991150323301554,
0.03295018896460533,
-0.0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "arg... | def reconfigService(self,
name,
image='buildbot/buildbot-worker',
namespace=None,
masterFQDN=None,
kube_config=None,
**kwargs):
# Set build_wait_timeout to 0 if not ex... | |
21,203 | [
0.02982008457183838,
0.03165019676089287,
-0.01754755899310112,
-0.007153590675443411,
-0.022413507103919983,
0.03742043673992157,
-0.0016349911456927657,
0.05447278916835785,
0.01948532648384571,
-0.010463942773640156,
0.023856068029999733,
0.01633107103407383,
-0.018796341493725777,
-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": "fast", "annotation": null, "type_comment": null}}, {"_type": "arg... | def stop_instance(self, fast=False, reportFailure=True):
self.current_pod_spec = None
self.resetWorkerPropsOnStop()
try:
yield self._kube.deletePod(self.namespace, self.getContainerName())
except kubeclientservice.KubeError as e:
if reportFailure and e.reason != '... | |
21,204 | [
0.008936058729887009,
0.03884735703468323,
0.031217876821756363,
-0.013135773129761219,
0.009513519704341888,
-0.009233538061380386,
0.012190837413072586,
0.034927625209093094,
0.01249414961785078,
0.0031876997090876102,
0.009531018324196339,
0.013159104622900486,
-0.00946685578674078,
-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": "build", "annotation": null, "type_comment": null}}], "kwarg": nul... | def start_instance(self, build):
yield self.stop_instance(reportFailure=False)
pod_spec = yield self.renderWorkerPropsOnStart(build)
try:
yield self._kube.createPod(self.namespace, pod_spec)
except kubeclientservice.KubeError as e:
raise LatentWorkerFailedToSubsta... | |
21,205 | [
-0.019935792312026024,
-0.01811540313065052,
-0.012717442587018013,
-0.023273173719644547,
0.021301085129380226,
-0.019253145903348923,
-0.0313764326274395,
0.003149336902424693,
-0.01720520853996277,
0.019581828266382217,
0.036559488624334335,
-0.052235063165426254,
0.04341123253107071,
-... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def profile_stats(request):
user = request.user
if is_instructor(user) and is_email_checked(user):
profiles = Profile.objects.all()
rworkshops = RequestedWorkshop.objects.filter(status='ACCEPTED')
pworkshops = ProposeWorkshopDate.objects.filter(status='ACCEPTED')
iprofile = Pro... | |
21,206 | [
-0.013132195919752121,
-0.014885715208947659,
0.013618573546409607,
-0.0383470356464386,
0.02982262894511223,
-0.00943316612392664,
-0.03258730098605156,
-0.007212468422949314,
-0.007545252796262503,
0.03448161482810974,
0.04395317658782005,
-0.04359479621052742,
0.010617111809551716,
-0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":... | def workshop_stats(request):
user = request.user
today = datetime.now()
upto = today + dt.timedelta(days=15)
#For Monthly Chart
workshop_count = monthly_accepted_chart()
#For Monthly Workshop Mean
workshop_mean = monthly_avg()
# For Pie Chart
workshoptype_count = pie_chart()
... | |
21,207 | [
0.03543718531727791,
-0.013043006882071495,
0.012888259254395962,
-0.03327072039246559,
-0.04472203925251961,
-0.03629935160279274,
0.027147138491272926,
0.05504591017961502,
-0.03647620603442192,
-0.022924741730093956,
-0.0010998127982020378,
-0.02683764509856701,
-0.021963097155094147,
-... | 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 batch_reader():
r = reader()
b = []
for instance in r:
b.append(instance)
if len(b) == batch_size:
yield b
b = []
if b:
yield b | |
21,208 | [
0.03785918653011322,
0.020759711042046547,
0.08802205324172974,
-0.027562016621232033,
-0.00687947915866971,
-0.010407417081296444,
0.02202756330370903,
0.00020878227951470762,
-0.04678927734494209,
0.010247557424008846,
-0.023747432976961136,
0.010600351728498936,
0.0009977449662983418,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "List", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Tuple", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "elts": [{"_type": "Constant", "_fields": {... | class Migration(migrations.Migration):
dependencies = [
('students', '0001_initial'),
('courses', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='certificate',
name='assignment',
field=models.OneToOneField(to='students.CourseAs... | |
21,209 | [
0.0380169078707695,
-0.02100381627678871,
-0.003763183718547225,
0.044014666229486465,
0.013792506419122219,
-0.021132173016667366,
0.027421649545431137,
0.007514698896557093,
0.03444625809788704,
0.06133114546537399,
0.009089984931051731,
-0.022602440789341927,
-0.05591682717204094,
0.004... | 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": "value", "annotation": null, "type_comment": null}}], "kwarg": nul... | def clean(self, value):
super(USPhoneNumberField, self).clean(value)
if value in EMPTY_VALUES:
return ''
value = re.sub(r'\D+', '', smart_text(value))
if len(value) == 10:
value = '1' + value
elif len(value) != 11 or value[0] != '1':
raise for... | |
21,210 | [
-0.0008028569282032549,
-0.04728065803647041,
-0.03047340176999569,
-0.022808169946074486,
0.047585390508174896,
-0.02232762798666954,
-0.011673657223582268,
-0.01020273007452488,
0.03234868869185448,
-0.06685395538806915,
-0.00503690168261528,
-0.062259506434202194,
-0.010929402895271778,
... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "node", "value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Exchanges... | class PhilipsHue(Interface):
exchange = messages.Exchanges.node
measurement_key = 'actuator.light'
bridge_id = field.Char()
access_token = field.Char()
light_id = field.Integer()
def data(self, data=None): pass
def parse_data(self, data): pass | |
21,211 | [
0.02083725295960903,
0.01388075016438961,
0.021181315183639526,
0.05199636518955231,
-0.0024205297231674194,
-0.04326579347252846,
0.023632757365703583,
0.03644906356930733,
-0.000013807418326905463,
0.033374011516571045,
-0.04382489249110222,
-0.012106680311262608,
-0.005553375463932753,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "USPhoneNumberField", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": [{"_type": "keyword", "_fields":... | class SendToDeviceWidgetForm(forms.Form):
number = USPhoneNumberField(required=False)
email = forms.EmailField(max_length=100, required=False)
platform = forms.ChoiceField(choices=(
('ios', 'ios'),
('android', 'android'),
('all', 'all'),
)) | |
21,212 | [
-0.009836597368121147,
-0.04634229466319084,
0.06880047917366028,
-0.019105056300759315,
-0.02809501625597477,
-0.029921971261501312,
-0.0031693228520452976,
0.029565492644906044,
-0.002702836412936449,
-0.018113598227500916,
0.012098012492060661,
-0.01603042334318161,
-0.0108781848102808,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def setUp(self):
super(TestClientRedirects, self).setUp()
self.port_one = utils.get_unused_port()
self.port_two = utils.get_unused_port()
server_one = wsgi.Server()
server_two = wsgi.Server()
self.config(bind_host='127.0.0.1')
self.config(workers=0)
server... | |
21,213 | [
0.007054008077830076,
-0.015562450513243675,
0.008479353971779346,
-0.04340032860636711,
0.008794480934739113,
-0.048946574330329895,
-0.005294141825288534,
-0.020362084731459618,
0.00809150468558073,
0.014495864510536194,
-0.01001620665192604,
0.006641917861998081,
-0.012711758725345135,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Convert a CSV file to a custom output format."}}, "targets": [{"_type": "Name", "_fields": {"id": "description", "ctx": {"_type": "Store"... | class CSVFormat(CSVKitUtility):
description = 'Convert a CSV file to a custom output format.'
override_flags = ['l', 'zero', 'H']
def add_arguments(self):
self.argparser.add_argument('-D', '--out-delimiter', dest='out_delimiter',
help='Delimiting character of the output CSV file.')
... | |
21,214 | [
0.04114658385515213,
0.005780015606433153,
0.026872094720602036,
-0.010045593604445457,
-0.047497786581516266,
0.00853639654815197,
-0.017764508724212646,
-0.016464922577142715,
0.024880792945623398,
0.024503493681550026,
-0.02217681333422661,
0.0066551403142511845,
0.02211393043398857,
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 add_arguments(self):
self.argparser.add_argument('-D', '--out-delimiter', dest='out_delimiter',
help='Delimiting character of the output CSV file.')
self.argparser.add_argument('-T', '--out-tabs', dest='out_tabs', action='store_true',
help='Specifies that the output CSV file ... | |
21,215 | [
0.03521221876144409,
-0.010516664013266563,
0.019388262182474136,
-0.059183161705732346,
-0.009650067426264286,
-0.03779732063412666,
0.022521719336509705,
-0.005865439306944609,
-0.01722421869635582,
0.0007264478481374681,
-0.018761571496725082,
-0.03464427962899208,
0.0035275868140161037,
... | 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 _extract_csv_writer_kwargs(self):
kwargs = {}
if self.args.out_tabs:
kwargs['delimiter'] = '\t'
elif self.args.out_delimiter:
kwargs['delimiter'] = self.args.out_delimiter
if self.args.out_quotechar:
kwargs['quotechar'] = self.args.out_quotechar
... | |
21,216 | [
-0.020082710310816765,
0.03470628336071968,
0.007317962124943733,
-0.027542710304260254,
0.061557337641716,
0.03201376646757126,
-0.01669853925704956,
-0.033520590513944626,
-0.010986206121742725,
0.02485019341111183,
0.05385031923651695,
-0.04651383310556412,
0.007212978787720203,
0.03972... | 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": "file_name", "annotatio... | class AboutWithStatements(Koan):
def count_lines(self, file_name):
try:
file = open(file_name)
try:
return len(file.readlines())
finally:
file.close()
except IOError:
# should never happen
self.fail()
de... | |
21,217 | [
0.010477029718458652,
0.03762022405862808,
0.025100374594330788,
-0.03393910452723503,
0.02505992352962494,
-0.0359819233417511,
0.016241420060396194,
-0.020033780485391617,
-0.026657771319150925,
0.059868741780519485,
0.041786763817071915,
-0.025464441627264023,
0.04316212609410286,
0.025... | 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": "file_name", "annotation": null, "type_comment": null}}], "kwarg":... | def count_lines(self, file_name):
try:
file = open(file_name)
try:
return len(file.readlines())
finally:
file.close()
except IOError:
# should never happen
self.fail() | |
21,218 | [
0.03742925822734833,
0.0370466373860836,
0.0069940718822181225,
-0.02372245118021965,
-0.004599882289767265,
-0.022563336417078972,
0.008772130124270916,
0.0004782752366736531,
-0.02354239486157894,
0.034908466041088104,
0.03981500491499901,
-0.024960340932011604,
0.02968682534992695,
0.05... | 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": "file_name", "annotation": null, "type_comment": null}}], "kwarg":... | def find_line(self, file_name):
try:
file = open(file_name)
try:
for line in file.readlines():
match = re.search('e', line)
if match:
return line
finally:
file.close()
exce... | |
21,219 | [
0.04514717310667038,
0.031492795795202255,
0.025576651096343994,
-0.03369729220867157,
-0.02676887810230255,
0.024384422227740288,
0.03144780918955803,
0.019896699115633965,
0.03680158406496048,
-0.009194771759212017,
0.007996921427547932,
-0.04786905273795128,
0.01257462427020073,
-0.0035... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def deleteLogsFromOldActivations(args):
db = couchdb.client.Server(args.dbUrl)[args.dbName]
endkey = long(time.time() * 1000) - args.days * DAY
while True:
activations = db.view("logCleanup/byDateWithLogs", limit=args.docsPerRequest, start_key=0, end_key=endkey, include_docs=True)
if activat... | |
21,220 | [
0.013966184109449387,
0.002880196087062359,
0.04882366955280304,
-0.03613289073109627,
-0.005507419817149639,
0.01348131988197565,
-0.011699972674250603,
0.016696177423000336,
0.02135508507490158,
0.038177747279405594,
-0.0024546226486563683,
-0.05299771577119827,
0.005257082171738148,
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}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": n... | class StatusCommand(Command):
def run(self, args, opts):
# type: (List[str], Any) -> None
if len(args) < 1:
raise UsageError()
elif len(args) > 1:
raise UsageError(
"running 'scrapy crawl' with more than one spider is no longer supported")
spna... | |
21,221 | [
0.015218861401081085,
0.014940793626010418,
0.0687469020485878,
-0.06087544560432434,
-0.03392426297068596,
-0.016512945294380188,
-0.004534643143415451,
0.021389825269579887,
0.01656641997396946,
0.019700029864907265,
0.006342083215713501,
-0.06729239225387573,
-0.015742911025881767,
0.00... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}, {"_type": "arg... | def run(self, args, opts):
# type: (List[str], Any) -> None
if len(args) < 1:
raise UsageError()
elif len(args) > 1:
raise UsageError(
"running 'scrapy crawl' with more than one spider is no longer supported")
spname = args[0]
crawler = se... | |
21,222 | [
-0.02011374570429325,
-0.002845736686140299,
-0.01423836313188076,
0.005401092115789652,
-0.024333953857421875,
0.017577748745679855,
0.034497298300266266,
-0.023559601977467537,
-0.06671026349067688,
0.014615858905017376,
-0.014422271400690079,
-0.010221421718597412,
0.017916526645421982,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "x1", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "y1", "annotation": null, "type_comment": null}}, {"_type": "arg", "... | def alinear(x1,y1,x2,y2,dim_1_x,dim_1_y,dim_2_x,dim_2_y, actual): # 1: Referencia 2: Pos. de la imagen actual
diferencia_x = x1 - x2
diferencia_y = y1 - y2
matriz_final = np.zeros((dim_1_x,dim_1_y))
for i in range(dim_2_x):
for j in range(dim_2_y):
x = i + diferencia_x
... | |
21,223 | [
-0.007701773662120104,
-0.005627583712339401,
0.026686260476708412,
-0.04720228910446167,
-0.029198426753282547,
-0.036690853536129,
-0.006869893986731768,
-0.020207514986395836,
0.02595905400812626,
0.02911028079688549,
-0.014874670654535294,
-0.03138004615902901,
0.04601231589913368,
-0.... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "tests", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": [... | def __get_testrail_testcases(tests):
testcases = []
for testclass_obj, tests_list in tests.iteritems():
default_section = get_section(testclass_obj)
default_suite = get_suite(testclass_obj)
for test in tests_list:
if test[1].__doc__ is not None:
title = get_te... | |
21,224 | [
0.03691558912396431,
-0.014123283326625824,
0.007374689448624849,
-0.0013026109663769603,
0.04912446439266205,
0.0762874037027359,
0.00263532274402678,
-0.03217170760035515,
0.04324879124760628,
0.015989530831575394,
0.016362780705094337,
0.015905248001217842,
0.007808140479028225,
0.03872... | 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 DenseTest(test.TestCase):
def testDenseProperties(self):
dense = core_layers.Dense(2, activation=nn_ops.relu, name='my_dense')
self.assertEqual(dense.units, 2)
self.assertEqual(dense.activation, nn_ops.relu)
self.assertEqual(dense.kernel_regularizer, None)
self.assertEqual(dense.bias_regula... | |
21,225 | [
0.02195744402706623,
-0.00611846661195159,
0.01296068262308836,
-0.04101989045739174,
0.05153096094727516,
0.06458071619272232,
-0.014753353781998158,
-0.04792334884405136,
0.025052865967154503,
0.01027724239975214,
-0.02667851746082306,
0.014619738794863224,
-0.014319104142487049,
0.03126... | 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 testDenseProperties(self):
dense = core_layers.Dense(2, activation=nn_ops.relu, name='my_dense')
self.assertEqual(dense.units, 2)
self.assertEqual(dense.activation, nn_ops.relu)
self.assertEqual(dense.kernel_regularizer, None)
self.assertEqual(dense.bias_regularizer, None)
self.assertEqual(d... | |
21,226 | [
0.017353296279907227,
-0.0209946446120739,
0.005698139779269695,
-0.031406622380018234,
0.06613597273826599,
0.03673209249973297,
0.021882222965359688,
-0.007840276695787907,
0.020209478214383125,
0.007424935232847929,
-0.01946982927620411,
0.008318203501403332,
0.010377840138971806,
0.051... | 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 testCall(self):
dense = core_layers.Dense(2, activation=nn_ops.relu, name='my_dense')
inputs = random_ops.random_uniform((5, 2), seed=1)
_ = dense(inputs)
self.assertListEqual(dense.variables, [dense.kernel, dense.bias])
self.assertListEqual(dense.trainable_variables, [dense.kernel, dense.bias])... | |
21,227 | [
0.009734675288200378,
0.005086397752165794,
-0.013143612071871758,
-0.017044683918356895,
0.03598589077591896,
0.04580458998680115,
-0.000513141043484211,
0.00155292684212327,
0.035817842930555344,
0.025446994230151176,
-0.011319111101329327,
0.006847882177680731,
-0.002102077705785632,
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 testNonTrainable(self):
dense = core_layers.Dense(2, trainable=False, name='my_dense')
inputs = random_ops.random_uniform((5, 2), seed=1)
_ = dense(inputs)
self.assertListEqual(dense.variables, [dense.kernel, dense.bias])
self.assertListEqual(dense.non_trainable_variables,
... | |
21,228 | [
0.03686189278960228,
-0.009519084356725216,
-0.010882355272769928,
0.021538490429520607,
0.055197592824697495,
0.04067191109061241,
0.015251966193318367,
-0.01726412959396839,
0.019097700715065002,
0.018252352252602577,
-0.01320408284664154,
0.006709198001772165,
0.015728218480944633,
0.05... | 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 testNoBias(self):
dense = core_layers.Dense(2, use_bias=False, name='my_dense')
inputs = random_ops.random_uniform((5, 2), seed=1)
_ = dense(inputs)
self.assertListEqual(dense.variables, [dense.kernel])
self.assertListEqual(dense.trainable_variables, [dense.kernel])
self.assertListEqual(dens... | |
21,229 | [
0.03372444584965706,
-0.03679255396127701,
0.03216565027832985,
0.0005149596836417913,
0.03609975799918175,
0.0036186357028782368,
0.0010067230323329568,
-0.005412489175796509,
0.021414900198578835,
0.006631072610616684,
0.02010353095829487,
0.0006568442331627011,
0.03394713252782822,
-0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testCallOnPlaceHolder(self):
inputs = array_ops.placeholder(dtype=dtypes.float32)
dense = core_layers.Dense(4, name='my_dense')
with self.assertRaises(ValueError):
dense(inputs)
inputs = array_ops.placeholder(dtype=dtypes.float32, shape=[None, None])
dense = core_layers.Dense(4, name='my_... | |
21,230 | [
0.0014090283075347543,
-0.03818846121430397,
0.045156337320804596,
-0.027332060039043427,
0.0675659254193306,
0.043425608426332474,
0.002729553496465087,
0.012238739058375359,
0.0036384679842740297,
-0.0005626279744319618,
-0.026320593431591988,
0.03524396941065788,
0.008945855312049389,
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 testOutputShape(self):
dense = core_layers.Dense(7, activation=nn_ops.relu, name='my_dense')
inputs = random_ops.random_uniform((5, 3), seed=1)
outputs = dense.apply(inputs)
self.assertEqual(outputs.get_shape().as_list(), [5, 7])
inputs = random_ops.random_uniform((5, 2, 3), seed=1)
outputs... | |
21,231 | [
0.019505508244037628,
0.018897898495197296,
0.014855434186756611,
0.02406877838075161,
0.0633401945233345,
0.06889548897743225,
0.012226592749357224,
0.0013299209531396627,
0.02715642750263214,
0.04357428476214409,
-0.03566296026110649,
0.021960746496915817,
-0.028520449995994568,
0.009907... | 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 testActivityRegularizer(self):
regularizer = lambda x: math_ops.reduce_sum(x) * 1e-3
dense = core_layers.Dense(
2, name='my_dense', activity_regularizer=regularizer)
inputs = random_ops.random_uniform((5, 3), seed=1)
_ = dense(inputs)
loss_keys = ops.get_collection(ops.GraphKeys.REGULARI... | |
21,232 | [
0.025173882022500038,
-0.016507463529706,
0.018765777349472046,
-0.03572031855583191,
0.07001916319131851,
0.052365344017744064,
0.017642352730035782,
-0.008058852516114712,
0.014317932538688183,
-0.0016693746438249946,
-0.03443640470504761,
0.034367624670267105,
-0.007726410403847694,
0.0... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def testActivation(self):
dense = core_layers.Dense(2, activation=nn_ops.relu, name='dense1')
inputs = random_ops.random_uniform((5, 3), seed=1)
outputs = dense(inputs)
self.assertEqual(outputs.op.name, 'dense1/Relu')
dense = core_layers.Dense(2, name='dense2')
inputs = random_ops.random_unifor... | |
21,233 | [
0.01680857315659523,
0.028545085340738297,
0.0131991533562541,
0.024369481950998306,
0.04491722583770752,
0.06586601585149765,
0.004393820185214281,
0.008156581781804562,
0.027294764295220375,
0.04659218713641167,
-0.046662960201501846,
0.030054908245801926,
-0.024487437680363655,
0.019214... | 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 testKernelRegularizer(self):
regularizer = lambda x: math_ops.reduce_sum(x) * 1e-3
dense = core_layers.Dense(
2, name='my_dense', kernel_regularizer=regularizer)
inputs = random_ops.random_uniform((5, 3), seed=1)
_ = dense(inputs)
loss_keys = ops.get_collection(ops.GraphKeys.REGULARIZATI... | |
21,234 | [
0.02702890895307064,
0.018802719190716743,
0.03983336314558983,
-0.0004253870283719152,
0.027836838737130165,
0.058562636375427246,
0.000755138520617038,
0.014787554740905762,
0.007889552041888237,
0.04472990706562996,
-0.04470542445778847,
0.004097793251276016,
-0.008721964433789253,
0.03... | 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 testKernelRegularizerWithReuse(self):
regularizer = lambda x: math_ops.reduce_sum(x) * 1e-3
inputs = random_ops.random_uniform((5, 3), seed=1)
_ = core_layers.dense(
inputs, 2, name='my_dense', kernel_regularizer=regularizer)
self.assertEqual(
len(ops.get_collection(ops.GraphKeys.REG... | |
21,235 | [
0.041571613401174545,
0.013646387495100498,
0.009316517971456051,
0.04458792880177498,
0.03950398042798042,
0.07706195116043091,
-0.0025495756417512894,
-0.008063774555921555,
0.012770683504641056,
0.044612254947423935,
-0.03884720429778099,
0.02020200528204441,
-0.013901800848543644,
0.02... | 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 testBiasRegularizer(self):
regularizer = lambda x: math_ops.reduce_sum(x) * 1e-3
dense = core_layers.Dense(2, name='my_dense', bias_regularizer=regularizer)
inputs = random_ops.random_uniform((5, 3), seed=1)
_ = dense(inputs)
loss_keys = ops.get_collection(ops.GraphKeys.REGULARIZATION_LOSSES)
... | |
21,236 | [
0.023185210302472115,
-0.0015873046359047294,
0.009927643463015556,
-0.04515276104211807,
0.061628423631191254,
0.02954685315489769,
0.024365592747926712,
-0.009113799780607224,
0.031808219850063324,
-0.0015088713262230158,
-0.013443942181766033,
0.014201872982084751,
-0.0025518019683659077,... | 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 testFunctionalDense(self):
inputs = random_ops.random_uniform((5, 3), seed=1)
outputs = core_layers.dense(
inputs, 2, activation=nn_ops.relu, name='my_dense')
self.assertEqual(
len(ops.get_collection(ops.GraphKeys.TRAINABLE_VARIABLES)), 2)
self.assertEqual(outputs.op.name, 'my_dense/... | |
21,237 | [
0.029383838176727295,
-0.015512410551309586,
0.03615289181470871,
-0.028768470510840416,
0.030281251296401024,
0.043409109115600586,
0.02505061961710453,
-0.025640347972512245,
0.008576696738600731,
-0.004823590628802776,
0.00411848071962595,
-0.020153313875198364,
0.004256297834217548,
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 testFunctionalDenseTwiceReuseFromScope(self):
with variable_scope.variable_scope('scope'):
inputs = random_ops.random_uniform((5, 3), seed=1)
core_layers.dense(inputs, 2, name='my_dense')
vars1 = variables.trainable_variables()
with variable_scope.variable_scope('scope', reuse=True):
... | |
21,238 | [
0.0021046537440270185,
-0.005211366806179285,
0.03747173771262169,
-0.027503885328769684,
0.03852653503417969,
0.03826283663511276,
0.026660047471523285,
-0.03438644856214523,
0.028374094516038895,
0.017641514539718628,
-0.005056443158537149,
-0.015268216840922832,
0.010666655376553535,
0.... | 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 testFunctionalDenseTwice(self):
inputs = random_ops.random_uniform((5, 3), seed=1)
core_layers.dense(inputs, 2)
vars1 = variables.trainable_variables()
core_layers.dense(inputs, 2)
vars2 = variables.trainable_variables()
self.assertEqual(len(vars1), 2)
self.assertEqual(len(vars2), 4) | |
21,239 | [
0.03567805886268616,
-0.020626377314329147,
0.008446313440799713,
-0.01956329494714737,
0.027406765148043633,
0.017333416268229485,
-0.0033172685652971268,
-0.011544807814061642,
0.0056427596136927605,
-0.026732614263892174,
0.008925996720790863,
0.0033091658260673285,
-0.010144651867449284,... | 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 testFunctionalDenseWithCustomGetter(self):
called = [0]
def custom_getter(getter, *args, **kwargs):
called[0] += 1
return getter(*args, **kwargs)
with variable_scope.variable_scope('test', custom_getter=custom_getter):
inputs = random_ops.random_uniform((5, 3), seed=1)
core_lay... | |
21,240 | [
0.048565253615379333,
0.019372491165995598,
0.00915624387562275,
0.002968316664919257,
0.04098683223128319,
-0.005144675727933645,
0.038281992077827454,
0.008065779693424702,
0.04279005900025368,
0.03328657150268555,
0.0155832814052701,
0.018409959971904755,
-0.04176660627126694,
0.0237587... | 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 testFunctionalDenseInitializerFromScope(self):
with self.test_session() as sess:
with variable_scope.variable_scope(
'scope', initializer=init_ops.ones_initializer()):
inputs = random_ops.random_uniform((5, 3), seed=1)
core_layers.dense(inputs, 2)
sess.run(variables.globa... | |
21,241 | [
0.003906602971255779,
-0.05715175345540047,
0.028989387676119804,
-0.019250085577368736,
0.08644583076238632,
0.047314513474702835,
-0.012971227988600731,
0.023787839338183403,
0.002204945543780923,
0.01129541452974081,
-0.01885833777487278,
0.05349543318152428,
0.02112177200615406,
0.0307... | 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 testComputeOutputShape(self):
dense = core_layers.Dense(2, activation=nn_ops.relu, name='dense1')
ts = tensor_shape.TensorShape
# pylint: disable=protected-access
with self.assertRaises(ValueError):
dense._compute_output_shape(ts(None))
with self.assertRaises(ValueError):
dense._comp... | |
21,242 | [
0.01803174801170826,
-0.0003005687613040209,
0.014557275921106339,
-0.02206416428089142,
0.025246983394026756,
0.01812051236629486,
0.018779899924993515,
-0.04922591149806976,
0.030965913087129593,
-0.0030037062242627144,
0.022901080548763275,
0.009123658761382103,
-0.017993707209825516,
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 testFunctionalDenseInScope(self):
with variable_scope.variable_scope('test'):
inputs = random_ops.random_uniform((5, 3), seed=1)
core_layers.dense(inputs, 2, name='my_dense')
var = variables.trainable_variables()[0]
self.assertEqual(var.name, 'test/my_dense/kernel:0')
with variable_s... | |
21,243 | [
0.00838107243180275,
-0.01107183750718832,
0.018098074942827225,
-0.04237167909741402,
0.015892529860138893,
0.03937213495373726,
0.03541475906968117,
0.047337304800748825,
0.04721127450466156,
0.04799266904592514,
0.022471357136964798,
-0.019534830003976822,
-0.025521311908960342,
0.00408... | 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 testBooleanLearningPhase(self):
with self.test_session() as sess:
dp = core_layers.Dropout(0.5)
inputs = array_ops.ones((5, 3))
dropped = dp.apply(inputs, training=True)
sess.run(variables.global_variables_initializer())
np_output = sess.run(dropped)
self.assertAlmostEqual(0.... | |
21,244 | [
0.02001478336751461,
-0.0076563311740756035,
0.017442157492041588,
-0.05765635892748833,
0.004763666074723005,
0.049950793385505676,
-0.00460980087518692,
0.04086659103631973,
0.023818328976631165,
0.03892173618078232,
0.016543583944439888,
-0.003375801956281066,
-0.0265386663377285,
0.011... | 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 DropoutTest(test.TestCase):
def testDropoutProperties(self):
dp = core_layers.Dropout(0.5, name='dropout')
self.assertEqual(dp.rate, 0.5)
self.assertEqual(dp.noise_shape, None)
dp.apply(np.ones(()))
self.assertEqual(dp.name, 'dropout')
def testBooleanLearningPhase(self):
with self.te... | |
21,245 | [
0.010566093027591705,
-0.026960868388414383,
0.03409907966852188,
-0.014777123928070068,
0.02592094987630844,
0.026164881885051727,
0.020901093259453773,
0.03291793912649155,
0.0012974918354302645,
0.005796587094664574,
-0.0019370100926607847,
0.025484440848231316,
-0.017498888075351715,
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 testCustomNoiseShape(self):
with self.test_session() as sess:
inputs = array_ops.ones((5, 3, 2))
noise_shape = [5, 1, 2]
dp = core_layers.Dropout(0.5, noise_shape=noise_shape, seed=1)
dropped = dp.apply(inputs, training=True)
sess.run(variables.global_variables_initializer())
... | |
21,246 | [
0.014362316578626633,
0.0004407320520840585,
0.009165993891656399,
-0.04346912354230881,
0.02316462993621826,
0.03979532793164253,
0.029908137395977974,
0.05804101750254631,
0.03328605741262436,
0.037280384451150894,
0.028404101729393005,
-0.0244467593729496,
-0.03306414932012558,
-0.00339... | 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 testDynamicLearningPhase(self):
with self.test_session() as sess:
dp = core_layers.Dropout(0.5, seed=1)
inputs = array_ops.ones((5, 5))
training = array_ops.placeholder(dtype='bool')
dropped = dp.apply(inputs, training=training)
sess.run(variables.global_variables_initializer())
... | |
21,247 | [
0.009115400724112988,
0.017623519524931908,
0.006382639054208994,
-0.04632680490612984,
0.042013876140117645,
0.05433299019932747,
0.02316340245306492,
0.026546820998191833,
0.045831069350242615,
0.02443993091583252,
0.019420573487877846,
-0.030983686447143555,
-0.030116142705082893,
-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 testFunctionalDropout(self):
with self.test_session() as sess:
inputs = array_ops.ones((5, 5))
training = array_ops.placeholder(dtype='bool')
dropped = core_layers.dropout(inputs, 0.5, training=training, seed=1)
self.assertEqual(dropped.op.name, 'dropout/cond/Merge')
sess.run(vari... | |
21,248 | [
-0.002745851408690214,
-0.008157436735928059,
0.08124806731939316,
-0.027082689106464386,
-0.0319538451731205,
-0.03125463426113129,
-0.05766142159700394,
-0.0059840623289346695,
0.017386993393301964,
0.030368970707058907,
-0.016314873471856117,
-0.060085345059633255,
0.013063551858067513,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class ApiParameters(Parameters):
@property
def address_ranges(self):
if self._values['addresses'] is None:
return None
result = []
for address_range in self._values['addresses']:
if '-' not in address_range['name']:
continue
result.appe... | |
21,249 | [
0.019739367067813873,
-0.03152244910597801,
0.03939225152134895,
-0.014982893131673336,
-0.014053218066692352,
-0.04313256964087486,
-0.012464123778045177,
0.006675278767943382,
0.024366118013858795,
0.00014948436000850052,
-0.0102047985419631,
-0.00863732397556305,
0.043781179934740067,
-... | 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 address_lists(self):
if self._values['address_lists'] is None:
return None
result = []
for x in self._values['address_lists']:
item = '/{0}/{1}'.format(x['partition'], x['name'])
result.append(item)
result = sorted(result)
return result | |
21,250 | [
0.01695553958415985,
-0.01501491293311119,
0.08662961423397064,
-0.015957502648234367,
-0.020437579602003098,
-0.03599586710333824,
-0.04247201979160309,
0.002068154513835907,
0.029586253687739372,
0.0386573001742363,
-0.02194572426378727,
-0.02956407517194748,
0.01235348079353571,
-0.0608... | 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 address_ranges(self):
if self._values['addresses'] is None:
return None
result = []
for address_range in self._values['addresses']:
if '-' not in address_range['name']:
continue
result.append(address_range['name'].strip())
result = ... | |
21,251 | [
0.013077206909656525,
-0.022006088867783546,
0.06406611204147339,
0.0017275444697588682,
0.013853630982339382,
-0.04463331773877144,
-0.06211395934224129,
0.01872292160987854,
0.04804958403110504,
0.02307089976966381,
-0.011590908281505108,
-0.031123530119657516,
-0.014962809160351753,
-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 addresses(self):
if self._values['addresses'] is None:
return None
result = []
for x in self._values['addresses']:
if is_valid_ip(x):
result.append(str(ip_address(u'{0}'.format(x))))
elif is_valid_ip_interface(x):
result.app... | |
21,252 | [
-0.04787483438849449,
-0.03347498178482056,
0.035184796899557114,
0.019636163488030434,
-0.01892819255590439,
0.020023543387651443,
0.005052638705819845,
0.015882583335042,
0.02320273220539093,
0.049130480736494064,
-0.013705240562558174,
-0.039539486169815063,
-0.04592457786202431,
0.0021... | 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": "params", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, params=None):
super(ModuleParameters, self).__init__(params=params)
self.country_iso_map = {
'Afghanistan': 'AF',
'Albania': 'AL',
'Algeria': 'DZ',
'American Samoa': 'AS',
'Andorra': 'AD',
'Angola': 'AO',
... | |
21,253 | [
0.003996721934527159,
-0.020980827510356903,
0.07969364523887634,
-0.02782786451280117,
-0.028372276574373245,
-0.02533612959086895,
-0.04078907519578934,
0.0013584144180640578,
0.03270664066076279,
0.05586512014269829,
-0.019326651468873024,
-0.027115941047668457,
-0.016719751060009003,
-... | 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 address_ranges(self):
if self._values['address_ranges'] is None:
return None
result = []
for address_range in self._values['address_ranges']:
start, stop = address_range.split('-')
start = start.strip()
stop = stop.strip()
start = ... | |
21,254 | [
0.0178859680891037,
-0.010970519855618477,
0.04925820603966713,
-0.024261504411697388,
-0.011722947470843792,
-0.03404881805181503,
-0.071222223341465,
-0.005189457908272743,
-0.011269193142652512,
0.028259139508008957,
-0.00025236501824110746,
-0.006743135862052441,
0.01515195332467556,
-... | 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 address_lists(self):
if self._values['address_lists'] is None:
return None
result = []
for x in self._values['address_lists']:
item = fq_name(self.partition, x)
result.append(item)
result = sorted(result)
return result | |
21,255 | [
0.03829117864370346,
0.014289316721260548,
0.031000947579741478,
-0.03896662965416908,
0.03959549963474274,
-0.008489741012454033,
-0.09488945454359055,
-0.027903182432055473,
-0.015220976434648037,
0.05436229333281517,
0.006667183246463537,
0.006498320493847132,
-0.054734956473112106,
-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 fqdns(self):
if self._values['fqdns'] is None:
return None
result = []
for x in self._values['fqdns']:
if self.is_valid_hostname(x):
result.append(x)
else:
raise F5ModuleError(
"The hostname '{0}' looks i... | |
21,256 | [
0.005529115442186594,
0.0013836260186508298,
0.0836372971534729,
-0.029962847009301186,
-0.061779510229825974,
0.011230678297579288,
-0.008412230759859085,
-0.021178774535655975,
0.01621011644601822,
0.019184844568371773,
-0.047336988151073456,
0.006617693696171045,
-0.027548573911190033,
... | 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 geo_locations(self):
if self._values['geo_locations'] is None:
return None
result = []
for x in self._values['geo_locations']:
if x['region'] is not None and x['region'].strip() != '':
tmp = '{0}:{1}'.format(x['country'], x['region'])
else:... | |
21,257 | [
0.013765528798103333,
-0.020997725427150726,
0.07950122654438019,
-0.014040839858353138,
-0.03178778290748596,
-0.024248508736491203,
-0.04254607483744621,
-0.011541866697371006,
0.024523818865418434,
0.037844616919755936,
-0.03248664736747742,
-0.03610804304480553,
-0.014422038570046425,
... | 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 address_ranges(self):
result = []
for item in self._values['addresses']:
if '-' not in item['name']:
continue
start, stop = item['name'].split('-')
start = start.strip()
stop = stop.strip()
start = ip_address(u'{0}'.format(... | |
21,258 | [
0.020009851083159447,
0.0002238825400127098,
0.11681941151618958,
-0.018342362716794014,
-0.029347781091928482,
0.001564758364111185,
-0.03813782334327698,
-0.03327828645706177,
0.024261943995952606,
0.016734428703784943,
-0.008522052317857742,
-0.031706083565950394,
-0.029562171548604965,
... | 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 ReportableChanges(Changes):
@property
def addresses(self):
result = []
for item in self._values['addresses']:
if '-' in item['name']:
continue
result.append(item['name'])
return result
@property
def address_ranges(self):
resu... | |
21,259 | [
0.02792569436132908,
-0.02572358213365078,
0.08334150165319443,
-0.022843895480036736,
-0.014579922892153263,
-0.023594066500663757,
-0.01748380810022354,
0.028216082602739334,
0.03085377998650074,
0.02263820357620716,
-0.014108041301369667,
-0.04326788708567619,
0.03182173892855644,
-0.06... | 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 addresses(self):
if self._values['addresses'] is None and self._values['address_ranges'] is None:
return None
result = []
if self._values['addresses']:
result += [dict(name=str(x)) for x in self._values['addresses']]
if self._values['address_ranges']:
... | |
21,260 | [
0.019773516803979874,
-0.014164444990456104,
0.1010865569114685,
0.005257733631879091,
-0.015643760561943054,
-0.033432528376579285,
-0.02189386822283268,
-0.003883203025907278,
0.026923540979623795,
0.0004946460830979049,
-0.0038924487307667732,
-0.028205614537000656,
0.008931366726756096,
... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class UsableChanges(Changes):
@property
def addresses(self):
if self._values['addresses'] is None and self._values['address_ranges'] is None:
return None
result = []
if self._values['addresses']:
result += [dict(name=str(x)) for x in self._values['addresses']]
... | |
21,261 | [
0.00969047099351883,
-0.022849857807159424,
-0.005283289588987827,
0.008246075361967087,
0.05109843611717224,
-0.01939278095960617,
-0.018895529210567474,
-0.031279440969228745,
-0.009950934909284115,
0.0010818163864314556,
0.0007344068726524711,
-0.06094874069094658,
0.00959575641900301,
... | 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": "want", "annotation": n... | class Difference(object):
def __init__(self, want, have=None):
self.want = want
self.have = have
def compare(self, param):
try:
result = getattr(self, param)
return result
except AttributeError:
return self.__default(param)
def __default(... | |
21,262 | [
0.026915859431028366,
-0.027315080165863037,
0.03231584280729294,
-0.01629449613392353,
0.00451224111020565,
-0.03964889049530029,
-0.011598403565585613,
0.020297205075621605,
0.0035535867791622877,
0.0169038325548172,
0.008341604843735695,
-0.019813938066363335,
0.048368703573942184,
-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 address_lists(self):
if self._values['address_lists'] is None:
return None
result = []
for x in self._values['address_lists']:
partition, name = x.split('/')[1:]
result.append(dict(
name=name,
partition=partition
... | |
21,263 | [
-0.0033508851192891598,
0.0664171501994133,
0.0019220981048420072,
-0.033974114805459976,
0.012598404660820961,
0.03233744576573372,
-0.022055456414818764,
0.0032898399513214827,
0.034211695194244385,
0.0462227463722229,
0.02192346751689911,
-0.055013254284858704,
-0.04273822158575058,
0.0... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "an... | class ModuleManager(object):
def __init__(self, *args, **kwargs):
self.module = kwargs.get('module', None)
self.client = kwargs.get('client', None)
self.want = ModuleParameters(params=self.module.params)
self.have = ApiParameters()
self.changes = UsableChanges()
def _upd... | |
21,264 | [
0.03614393249154091,
-0.006861278321594,
-0.015576956793665886,
-0.030681883916258812,
0.03369387984275818,
-0.029647916555404663,
-0.00885054375976324,
-0.010474547743797302,
0.007912104949355125,
-0.006833181716501713,
-0.03259247913956642,
-0.02160094492137432,
-0.0008703034254722297,
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": "param", "annotation": null, "type_comment": null}}], "kwarg": nul... | def __default(self, param):
attr1 = getattr(self.want, param)
try:
attr2 = getattr(self.have, param)
if attr1 != attr2:
return attr1
except AttributeError:
return attr1 | |
21,265 | [
0.016795065253973007,
0.03193557262420654,
0.006434387993067503,
-0.01160816103219986,
-0.0006918608560226858,
0.06287316232919693,
-0.004336646292358637,
0.010124312713742256,
0.028153730556368828,
0.032854773104190826,
0.031357791274785995,
-0.03555984050035477,
0.009631884284317493,
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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def exec_module(self):
changed = False
result = dict()
state = self.want.state
if state == "present":
changed = self.present()
elif state == "absent":
changed = self.absent()
reportable = ReportableChanges(params=self.changes.to_return())
... | |
21,266 | [
0.003059339476749301,
0.0030374201014637947,
0.0025755444075912237,
0.013314546085894108,
0.017986536026000977,
0.016946924850344658,
0.033317681401968,
-0.021856898441910744,
0.018487554043531418,
0.030737439170479774,
0.016896823421120644,
-0.05506185069680214,
-0.03990606218576431,
0.05... | 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 _update_changed_options(self):
diff = Difference(self.want, self.have)
updatables = Parameters.updatables
changed = dict()
for k in updatables:
change = diff.compare(k)
if change is None:
continue
else:
if isinstance... | |
21,267 | [
-0.04799540713429451,
-0.010843085125088692,
0.02858348935842514,
0.019896594807505608,
0.03159097209572792,
-0.014080476015806198,
-0.03576664626598358,
0.02952798828482628,
0.019001806154847145,
0.06666167080402374,
0.012284686788916588,
-0.030049948021769524,
0.04081225395202637,
-0.019... | 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 exists(self):
uri = "https://{0}:{1}/mgmt/tm/security/firewall/address-list/{2}".format(
self.client.provider['server'],
self.client.provider['server_port'],
transform_name(self.want.partition, self.want.name)
)
resp = self.client.api.get(uri)
try:... | |
21,268 | [
0.04488178715109825,
0.015050110407173634,
-0.01556384563446045,
-0.0063224476762115955,
0.059499893337488174,
0.05819220468401909,
0.03652191162109375,
0.0071455915458500385,
0.015178544446825981,
0.00023898910149000585,
-0.0009143613278865814,
-0.010455681942403316,
-0.05730484426021576,
... | 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 update(self):
self.have = self.read_current_from_device()
if not self.should_update():
return False
if self.module.check_mode:
return True
self.update_on_device()
return True | |
21,269 | [
0.009789981879293919,
0.013024773448705673,
0.0044852918945252895,
0.01315930113196373,
0.00658576563000679,
0.008524194359779358,
-0.02282087132334709,
0.01695054955780506,
0.009447546675801277,
0.026269683614373207,
-0.0020301523618400097,
-0.005457563325762749,
-0.009777752682566643,
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 update_on_device(self):
params = self.changes.api_params()
uri = "https://{0}:{1}/mgmt/tm/security/firewall/address-list/{2}".format(
self.client.provider['server'],
self.client.provider['server_port'],
transform_name(self.want.partition, self.want.name)
)... | |
21,270 | [
0.028852121904492378,
-0.0036434736102819443,
0.011229166761040688,
0.013317312113940716,
0.005811694543808699,
-0.03653945028781891,
-0.03252331539988518,
0.005645382218062878,
0.0129846865311265,
0.011808180250227451,
-0.008999348618090153,
0.009676918387413025,
0.008789918385446072,
-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 create_on_device(self):
params = self.changes.api_params()
params['name'] = self.want.name
params['partition'] = self.want.partition
uri = "https://{0}:{1}/mgmt/tm/security/firewall/address-list/".format(
self.client.provider['server'],
self.client.provider['s... | |
21,271 | [
0.0048180376179516315,
0.0047495486214756966,
0.007206211797893047,
-0.0022571522276848555,
0.012482826597988605,
0.021809212863445282,
-0.04916899651288986,
0.042093805968761444,
0.047001175582408905,
0.040855053812265396,
0.030873555690050125,
-0.03835372254252434,
0.007801766507327557,
... | 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 remove_from_device(self):
uri = "https://{0}:{1}/mgmt/tm/security/firewall/address-list/{2}".format(
self.client.provider['server'],
self.client.provider['server_port'],
transform_name(self.want.partition, self.want.name)
)
resp = self.client.api.delete(ur... | |
21,272 | [
-0.014027806930243969,
0.007668141275644302,
-0.013414827175438404,
0.0031091042328625917,
0.04000872001051903,
-0.00574079155921936,
-0.06507015973329544,
0.030012434348464012,
0.021902238950133324,
0.028550712391734123,
-0.002541803289204836,
-0.042177725583314896,
0.003869435051456094,
... | 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 read_current_from_device(self):
uri = "https://{0}:{1}/mgmt/tm/security/firewall/address-list/{2}".format(
self.client.provider['server'],
self.client.provider['server_port'],
transform_name(self.want.partition, self.want.name)
)
resp = self.client.api.get... | |
21,273 | [
0.01879800111055374,
0.021420186385512352,
0.012509298510849476,
0.015392567031085491,
-0.04293118417263031,
0.0021794785279780626,
-0.018105562776327133,
-0.017276907339692116,
0.04236361384391785,
0.0499463826417923,
0.0066916802898049355,
-0.040229540318250656,
0.02697104588150978,
-0.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 ArgumentSpec(object):
def __init__(self):
self.supports_check_mode = True
argument_spec = dict(
description=dict(),
name=dict(required=True),
addresses=dict(type='list'),
address_ranges=dict(type='list'),
address_lists=dict(type='list... | |
21,274 | [
0.012376848608255386,
0.029329493641853333,
0.025382714346051216,
0.027874117717146873,
-0.03130288049578667,
0.02789878658950329,
0.0035150989424437284,
0.011482656933367252,
0.04065181314945221,
0.08697711676359177,
0.02379167079925537,
-0.026048732921481133,
0.04723799601197243,
-0.0234... | 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 __init__(self):
self.supports_check_mode = True
argument_spec = dict(
description=dict(),
name=dict(required=True),
addresses=dict(type='list'),
address_ranges=dict(type='list'),
address_lists=dict(type='list'),
geo_locations=di... | |
21,275 | [
0.0036409334279596806,
0.022228196263313293,
0.01929287053644657,
-0.033869147300720215,
-0.00887497141957283,
0.04056771099567413,
-0.019757002592086792,
-0.032965969294309616,
0.013773453421890736,
0.0373564139008522,
0.04159633070230484,
-0.022265829145908356,
-0.015078042633831501,
0.0... | 15 | {"_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():
module = AnsibleModule(
argument_spec = dict(
fstype=dict(required=True, aliases=['type']),
dev=dict(required=True, aliases=['device']),
opts=dict(),
force=dict(type='bool', default='no'),
resizefs=dict(type='bool', default='no'),
... | |
21,276 | [
0.005093493964523077,
0.030542520806193352,
0.009762786328792572,
-0.02872275561094284,
0.027689917013049126,
0.012529319152235985,
-0.027148906141519547,
-0.02941131591796875,
0.034870605915784836,
0.059314459562301636,
0.028821121901273727,
-0.028378477320075035,
0.015160598792135715,
0.... | 7 | {"_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": "kw", "annotation": null, "type_comment": null}}, "varar... | def check_fc(self,*k,**kw):
kw['compiler']='fc'
if not'compile_mode'in kw:
kw['compile_mode']='fc'
if not'type'in kw:
kw['type']='fcprogram'
if not'compile_filename'in kw:
kw['compile_filename']='test.f90'
if not'code'in kw:
kw['code']=FC_FRAGMENT
return self.check(*k,**kw) | |
21,277 | [
0.011286030523478985,
0.03804337978363037,
0.04942011460661888,
-0.044599901884794235,
0.029154498130083084,
0.024437949061393738,
-0.02671847864985466,
0.009873656556010246,
0.0411531925201416,
0.04913504794239998,
0.01845155842602253,
-0.0410236194729805,
0.02547455206513405,
0.037965636... | 11 | {"_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": "kw", "annotation": null, "type_comment": null}}, "varar... | def check_fortran_dummy_main(self,*k,**kw):
if not self.env.CC:
self.fatal('A c compiler is required for check_fortran_dummy_main')
lst=['MAIN__','__MAIN','_MAIN','MAIN_','MAIN']
lst.extend([m.lower()for m in lst])
lst.append('')
self.start_msg('Detecting whether we need a dummy main')
for main in lst:
kw['fo... | |
21,278 | [
0.0029458331409841776,
0.039225541055202484,
-0.031872257590293884,
-0.036935172975063324,
-0.017430894076824188,
0.045108165591955185,
-0.040165796875953674,
-0.0038514321204274893,
0.03570560738444328,
0.03249909356236458,
0.02895505353808403,
0.026688797399401665,
-0.0017931158654391766,
... | 11 | {"_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": "kw", "annotation": null, "type_comment": null}}, "varar... | def check_fortran_verbose_flag(self,*k,**kw):
self.start_msg('fortran link verbose flag')
for x in('-v','--verbose','-verbose','-V'):
try:
self.check_cc(features='fc fcprogram_test',fragment=FC_FRAGMENT2,compile_filename='test.f',linkflags=[x],mandatory=True)
except self.errors.ConfigurationError:
pass
el... | |
21,279 | [
-0.007756555452942848,
0.017395174130797386,
-0.020658161491155624,
-0.03862129896879196,
0.004721865523606539,
0.0004273622471373528,
-0.002732612658292055,
-0.010919313877820969,
0.022562500089406967,
0.04245224595069885,
0.005370565224438906,
0.020067928358912468,
0.009087364189326763,
... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "lexer", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "token", "annotation": null, "type_comment": null}}, {"_type": "a... | def _parse_flink_token(lexer,token,tmp_flags):
if _match_ignore(token):
pass
elif token.startswith('-lkernel32')and sys.platform=='cygwin':
tmp_flags.append(token)
elif SPACE_OPTS.match(token):
t=lexer.get_token()
if t.startswith('P,'):
t=t[2:]
for opt in t.split(os.pathsep):
tmp_flags.append('-L%s'%... | |
21,280 | [
-0.012551574036478996,
0.015412768349051476,
-0.020393364131450653,
-0.035747259855270386,
0.006528938189148903,
-0.0007682834984734654,
0.014647427946329117,
-0.010190795175731182,
0.03581790626049042,
0.046014588326215744,
0.048016246408224106,
0.0029789383988827467,
-0.029718736186623573,... | 7 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "line", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "final_flags", "annotation": null, "type_comment": null}}], "kwarg... | def _parse_flink_line(line,final_flags):
lexer=shlex.shlex(line,posix=True)
lexer.whitespace_split=True
t=lexer.get_token()
tmp_flags=[]
while t:
t=_parse_flink_token(lexer,t,tmp_flags)
final_flags.extend(tmp_flags)
return final_flags | |
21,281 | [
-0.048670798540115356,
0.03011322021484375,
-0.013918183743953705,
-0.04147300496697426,
-0.0023288780357688665,
0.025755371898412704,
-0.04808322340250015,
-0.03824134171009064,
0.009321632795035839,
0.0695297122001648,
0.026147088035941124,
-0.015338156372308731,
0.005306536797434092,
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": "autoadd", "annotation": null, "type_comment": null}}], "kwarg": {... | def check_fortran_clib(self,autoadd=True,*k,**kw):
if not self.env.FC_VERBOSE_FLAG:
self.fatal('env.FC_VERBOSE_FLAG is not set: execute check_fortran_verbose_flag?')
self.start_msg('Getting fortran runtime link flags')
try:
self.check_cc(fragment=FC_FRAGMENT2,compile_filename='test.f',features='fc fcprogram_test... | |
21,282 | [
0.043323662132024765,
-0.040829889476299286,
0.024779049679636955,
-0.02661537379026413,
-0.01507600024342537,
0.0014551740605384111,
-0.010031774640083313,
0.009215629659593105,
-0.001404873444698751,
0.0345727801322937,
0.01729772612452507,
-0.007350966800004244,
-0.009629369713366032,
0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "conf", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cmd", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def getoutput(conf,cmd,stdin=False):
if stdin:
stdin=Utils.subprocess.PIPE
else:
stdin=None
env=conf.env.env or None
try:
p=Utils.subprocess.Popen(cmd,stdin=stdin,stdout=Utils.subprocess.PIPE,stderr=Utils.subprocess.PIPE,env=env)
if stdin:
p.stdin.write('\n')
out,err=p.communicate()
except Exception:
... | |
21,283 | [
0.0006882218876853585,
0.05559176579117775,
0.02256387658417225,
-0.016899248585104942,
0.005451697390526533,
0.03498820215463638,
-0.02928301692008972,
-0.0016679557738825679,
-0.004346486646682024,
0.054375018924474716,
0.029553404077887535,
-0.030743110924959183,
0.016344953328371048,
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": {"_type": "arg", "_fields": {"arg": "kw", "annotation": null, "type_comment": null}}, "varar... | def check_fortran_mangling(self,*k,**kw):
if not self.env.CC:
self.fatal('A c compiler is required for link_main_routines')
if not self.env.FC:
self.fatal('A fortran compiler is required for link_main_routines')
if not self.env.FC_MAIN:
self.fatal('Checking for mangling requires self.env.FC_MAIN (execute "chec... | |
21,284 | [
0.013691174797713757,
0.000227329321205616,
0.03553829342126846,
-0.07159367948770523,
-0.002880728803575039,
-0.03076694905757904,
0.006134586408734322,
-0.0018538908334448934,
0.016758468002080917,
0.00402508769184351,
0.029239177703857422,
0.023186855018138885,
0.026442183181643486,
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": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def link_main_routines_tg_method(self):
def write_test_file(task):
task.outputs[0].write(task.generator.code)
bld=self.bld
bld(rule=write_test_file,target='main.c',code=MAIN_CODE%self.__dict__)
bld(rule=write_test_file,target='test.f',code=ROUTINES_CODE)
bld(features='fc fcstlib',source='test.f',target='test')
... | |
21,285 | [
-0.021957116201519966,
-0.0063702743500471115,
0.06258591264486313,
-0.027432842180132866,
-0.017750024795532227,
-0.0025616635102778673,
0.0722145140171051,
-0.03918667510151863,
0.014529647305607796,
0.011688775382936,
-0.041832372546195984,
-0.07984799891710281,
0.022770343348383904,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": "MAP_WIDGET_HEIGHT"}}, {"_type": "Constant", "_fields": {"kind": null, "value": "MAP_OPTIONS"}}, {"... | class AppSettings(object):
defaults = {
'MAP_WIDGET_HEIGHT': 480,
'MAP_OPTIONS': {},
'MARKER_OPTIONS': {},
'GOOGLE_MAPS_API_KEY': None,
}
prefix = 'GEOPOSITION'
required_settings = ['GOOGLE_MAPS_API_KEY']
def __init__(self, django_settings):
self.django_setti... | |
21,286 | [
0.0339050255715847,
0.05039217323064804,
0.010941572487354279,
-0.052430909126996994,
0.0013559239450842142,
0.020741896703839302,
-0.039289940148591995,
-0.032929979264736176,
0.04861936345696449,
-0.007944412529468536,
0.055444687604904175,
-0.02969459630548954,
-0.009744924493134022,
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 detect_openmp(self):
for x in('-fopenmp','-openmp','-mp','-xopenmp','-omp','-qsmp=omp'):
try:
self.check_fc(msg='Checking for OpenMP flag %s'%x,fragment='program main\n call omp_get_num_threads()\nend program main',fcflags=x,linkflags=x,uselib_store='OPENMP')
except self.errors.ConfigurationError:
pass
... | |
21,287 | [
0.012248295359313488,
0.0018715908518061042,
0.010525151155889034,
-0.015985656529664993,
0.005606040358543396,
-0.012725653126835823,
0.010001222603023052,
-0.023297376930713654,
-0.010775472968816757,
0.02424044907093048,
0.0003922190808225423,
-0.044359322637319565,
-0.002880154177546501,... | 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": "needs_http", "annotation": null, "type_comment": null}}], "kwarg"... | def check_build(self, needs_http):
if self.get_option('build') and not self._build_driver():
return False
if not self._check_driver():
return False
if self.get_option('pixel_tests'):
if not self.check_image_diff():
return False
if not s... | |
21,288 | [
-0.005330709274858236,
-0.01287033874541521,
0.034508734941482544,
0.006818349007517099,
0.009613309055566788,
-0.0014932748163118958,
0.01802072674036026,
-0.00962457899004221,
0.008706074208021164,
0.03561319410800934,
-0.016521817073225975,
-0.013005577959120274,
-0.024861617013812065,
... | 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, **kwargs):
base.Port.__init__(self, **kwargs)
self._cached_apache_path = None
# FIXME: disable pixel tests until they are run by default on the
# build machines.
if not hasattr(self._options, "pixel_tests") or self._options.pixel_tests == None:
sel... | |
21,289 | [
0.04131264612078667,
0.023641066625714302,
0.01190344337373972,
-0.06291650980710983,
-0.0046607013791799545,
0.024707047268748283,
0.01909288577735424,
0.00433498527854681,
0.024470163509249687,
0.03510627523064613,
0.020502349361777306,
-0.008006693795323372,
-0.02315545454621315,
0.0048... | 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": "sp", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def _diff_image_reply(self, sp, diff_filename):
timeout = 2.0
deadline = time.time() + timeout
output = sp.read_line(timeout)
while not sp.timed_out and not sp.crashed and output:
if output.startswith('Content-Length'):
m = re.match('Content-Length: (\d+)', ou... | |
21,290 | [
0.04171986132860184,
0.03167487308382988,
-0.008114169351756573,
-0.03570234403014183,
0.0015947007341310382,
-0.009470479562878609,
0.013266962952911854,
-0.03231453150510788,
0.019959671422839165,
0.028168605640530586,
0.0017501729307696223,
-0.013823701068758965,
-0.006337343715131283,
... | 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": "expected_contents", "annotation": null, "type_comment": null}}, {... | def _diff_image_request(self, expected_contents, actual_contents):
# FIXME: There needs to be a more sane way of handling default
# values for options so that you can distinguish between a default
# value of None and a default value that wasn't set.
if self.get_option('tolerance') is not... | |
21,291 | [
0.009784679859876633,
0.013448948040604591,
0.050057440996170044,
-0.009847365319728851,
-0.01723288930952549,
-0.003345140954479575,
-0.03713277354836464,
-0.0002703324134927243,
-0.0002299072075402364,
0.055528201162815094,
-0.03651731461286545,
-0.004721378441900015,
0.01918184757232666,
... | 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 _tests_for_disabled_features(self):
# FIXME: This should use the feature detection from
# webkitperl/features.pm to match run-webkit-tests.
# For now we hard-code a list of features known to be disabled on
# the Mac platform.
disabled_feature_tests = [
"fast/xhtml... | |
21,292 | [
-0.012291720137000084,
-0.005139727611094713,
0.047116443514823914,
-0.02567409910261631,
-0.006336725316941738,
0.004665291402488947,
-0.033243268728256226,
-0.023034706711769104,
-0.01815946213901043,
0.06679192185401917,
-0.05793577432632446,
-0.010181296616792679,
0.02702651545405388,
... | 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 _tests_for_other_platforms(self):
# By default we will skip any directory under LayoutTests/platform
# that isn't in our baseline search path (this mirrors what
# old-run-webkit-tests does in findTestsToRun()).
# Note this returns LayoutTests/platform/*, not platform/*/*.
ent... | |
21,293 | [
0.032947611063718796,
0.024146394804120064,
0.029116494581103325,
-0.04891405254602432,
0.015572975389659405,
-0.0028733382932841778,
0.01679479144513607,
-0.00999714620411396,
0.02072945237159729,
0.057487472891807556,
-0.043198440223932266,
-0.022510403767228127,
0.013439974747598171,
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 _expectations_from_skipped_files(self):
tests_to_skip = []
for filename in self._skipped_file_paths():
if not self._filesystem.exists(filename):
_log.warn("Failed to open Skipped file: %s" % filename)
continue
skipped_file_contents = self._file... | |
21,294 | [
0.012664282694458961,
0.0198200736194849,
0.014049273915588856,
-0.05279757082462311,
0.03290405124425888,
0.008955231867730618,
0.025097733363509178,
-0.0026414524763822556,
0.02013484574854374,
0.029462555423378944,
-0.0017233706312254071,
-0.0009443126618862152,
0.024594098329544067,
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": "skipped_file_contents", "annotation": null, "type_comment": null}... | def _tests_from_skipped_file_contents(self, skipped_file_contents):
tests_to_skip = []
for line in skipped_file_contents.split('\n'):
line = line.strip()
if line.startswith('#') or not len(line):
continue
tests_to_skip.append(line)
return tests... | |
21,295 | [
0.03306266665458679,
0.003903091186657548,
0.052512481808662415,
-0.06636769324541092,
-0.01137097179889679,
0.0015135208377614617,
-0.009447197429835796,
-0.03282029926776886,
-0.009149289689958096,
0.02124735713005066,
-0.03821292892098427,
-0.012744375504553318,
0.0006993248825892806,
-... | 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 _skips(self):
# Each Skipped file contains a list of files
# or directories to be skipped during the test run. The total list
# of tests to skipped is given by the contents of the generic
# Skipped file found in platform/X plus a version-specific file
# found in platform/X-ve... | |
21,296 | [
0.0017367007676512003,
-0.0004301664885133505,
0.05869259312748909,
-0.014959309250116348,
0.022557375952601433,
-0.005402520764619112,
0.05000909045338631,
-0.01309432927519083,
0.030648821964859962,
0.045114751905202866,
-0.033905137330293655,
-0.02595183625817299,
0.04024014621973038,
-... | 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 _path_to_apache(self):
if not self._cached_apache_path:
# The Apache binary path can vary depending on OS and distribution
# See http://wiki.apache.org/httpd/DistrosDefaultLayout
for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
if self._filesystem.exi... | |
21,297 | [
0.02645249105989933,
0.0029858630150556564,
0.012019599787890911,
-0.0772722065448761,
-0.002597803482785821,
-0.05346730351448059,
0.021133877336978912,
0.002499690279364586,
0.03331748768687248,
0.03919842094182968,
0.00564370583742857,
0.02328943833708763,
-0.030388735234737396,
-0.0272... | 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": "driver_input", "annotation": null, "type_comment": null}}], "kwar... | def run_test(self, driver_input):
uri = self._port.filename_to_uri(driver_input.filename)
if uri.startswith("file:///"):
command = uri[7:]
else:
command = uri
if driver_input.image_hash:
command += "'" + driver_input.image_hash
command += "\n"... | |
21,298 | [
0.03098270669579506,
-0.022565077990293503,
0.04396335780620575,
-0.02525288611650467,
0.007052889093756676,
-0.0047114756889641285,
-0.0031566107645630836,
0.005932969506829977,
0.01116794254630804,
0.07842563092708588,
-0.028274063020944595,
0.01548093557357788,
0.008261360228061676,
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 cmd_line(self):
cmd = self._command_wrapper(self._port.get_option('wrapper'))
cmd.append(self._port._path_to_driver())
if self._port.get_option('pixel_tests'):
cmd.append('--pixel-tests')
cmd.extend(self._port.get_option('additional_drt_flag', []))
cmd.append('-')... | |
21,299 | [
0.04316013678908348,
0.012813164852559566,
0.005034968256950378,
-0.027752332389354706,
0.03870238736271858,
-0.03717075288295746,
0.021305745467543602,
-0.02395753189921379,
0.015567824244499207,
0.02174009010195732,
0.04658917337656021,
0.01904258131980896,
-0.04654345288872719,
-0.00773... | 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": "deadline", "annotation": null, "type_comment": null}}], "kwarg": ... | def _read_block(self, deadline):
LENGTH_HEADER = 'Content-Length: '
HASH_HEADER = 'ActualHash: '
TYPE_HEADER = 'Content-Type: '
ENCODING_HEADER = 'Content-Transfer-Encoding: '
content_type = None
encoding = None
content_hash = None
content_length = None
... | |
21,300 | [
0.027551880106329918,
-0.020745104178786278,
0.10982861369848251,
-0.02254490740597248,
0.019865501672029495,
0.01539982296526432,
0.01699664071202278,
0.013099322095513344,
-0.037863537669181824,
0.018092762678861618,
-0.00938468985259533,
-0.033289600163698196,
-0.00011407354759285226,
0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "If", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "varar... | class DB_general(DB) :
if db.version() >= (4, 2) :
def test_bt_minkey(self) :
for i in [17, 108, 1030] :
self.db.set_bt_minkey(i)
self.assertEqual(i, self.db.get_bt_minkey())
def test_lorder(self) :
self.db.set_lorder(1234)
... |