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 |
|---|---|---|---|---|---|
14,601 | [
0.04687202349305153,
-0.002946484135463834,
0.02884780615568161,
-0.051581867039203644,
0.02097919210791588,
-0.030885718762874603,
-0.024115316569805145,
-0.019009210169315338,
0.02730804868042469,
0.0017902508843690157,
0.027149543166160583,
-0.03174617141485214,
-0.07635384798049927,
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": "headers", "annotation": null, "type_comment": null}}, {"_type": "... | def _format_special_header_values(self, headers, method):
is_change = method not in ("GET", "HEAD")
is_old_api = self.API_VERSION <= "2014-02-14"
special_header_keys = [
"content-encoding",
"content-language",
"content-length",
"content-md5",
... | |
14,602 | [
-0.026662802323698997,
0.014125237241387367,
-0.028351278975605965,
0.003997530322521925,
0.039464980363845825,
0.006665700580924749,
0.010534075088799,
0.005043377634137869,
0.046622101217508316,
0.0441775918006897,
-0.002885530237108469,
-0.05130951479077339,
-0.00002373681309109088,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "user_profile", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "cutoff", "annotation": null, "type_comment": null}}], "kw... | def inactive_since(user_profile, cutoff):
# Hasn't used the app in the last 24 business-day hours.
most_recent_visit = [row.last_visit for row in \
UserActivity.objects.filter(
user_profile=user_profile)]
if not most_recent_visit:
# This person has never use... | |
14,603 | [
0.03093036822974682,
0.03516140952706337,
0.01929500512778759,
0.01856551505625248,
0.028012407943606377,
0.05018889904022217,
0.0004240159469190985,
0.02969023399055004,
-0.02418258599936962,
0.030711520463228226,
-0.002644400577992201,
-0.03518572449684143,
-0.00618546549230814,
-0.01361... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Enqueue digest emails for users that haven't checked the app\nin a while.\n"}}, "targets": [{"_type": "Name", "_fields": {"id": "help", "... | class Command(BaseCommand):
help = """Enqueue digest emails for users that haven't checked the app
in a while.
"""
def handle(self, *args, **options):
# To be really conservative while we don't have user timezones or
# special-casing for companies with non-standard workweeks, only
# try ... | |
14,604 | [
0.04592536389827728,
0.027364185079932213,
0.05431532487273216,
0.03402452543377876,
0.026692988350987434,
0.04285334423184395,
0.014237120747566223,
0.02398238517343998,
-0.01559242233633995,
0.05232754722237587,
0.019671235233545303,
0.006256975699216127,
-0.0174898449331522,
-0.01087468... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "... | def handle(self, *args, **options):
# To be really conservative while we don't have user timezones or
# special-casing for companies with non-standard workweeks, only
# try to send mail on Tuesdays, Wednesdays, and Thursdays.
if datetime.datetime.utcnow().weekday() not in VALID_DIGEST_DA... | |
14,605 | [
0.04987192526459694,
0.0057149468921124935,
-0.02323131263256073,
-0.04412419721484184,
-0.04742422327399254,
0.013724613934755325,
0.029918784275650978,
-0.03990628197789192,
-0.013440505601465702,
-0.007818440906703472,
0.05975015088915825,
-0.02921944111585617,
-0.00912970956414938,
-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_page", "annotation": null, "type_comment": null}}, {"_type... | def _copy_title_extensions(self, source_page, target_page, language, clone=False):
source_title = source_page.title_set.get(language=language)
if target_page:
target_title = target_page.title_set.get(language=language)
else:
target_title = source_title.publisher_public
... | |
14,606 | [
0.05276215821504593,
0.003559559816494584,
0.02969180978834629,
-0.02453712746500969,
-0.029796579852700233,
0.01982247829437256,
-0.001017578411847353,
-0.008182534947991371,
-0.035852283239364624,
0.012698120437562466,
0.05301360413432121,
-0.04844563454389572,
-0.040105946362018585,
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": "source_page", "annotation": null, "type_comment": null}}, {"_type... | def copy_extensions(self, source_page, target_page, languages=None):
if not languages:
languages = source_page.get_languages()
if self.page_extensions:
self._copy_page_extensions(source_page, target_page, None, clone=True)
self._remove_orphaned_page_extensions()
... | |
14,607 | [
0.04053656756877899,
0.008202784694731236,
0.01788700744509697,
-0.022056985646486282,
-0.04551859572529793,
0.030594464391469955,
-0.006150716450065374,
-0.002699511591345072,
-0.003563684644177556,
0.037727322429418564,
0.0053688460029661655,
-0.04334581643342972,
-0.007626669015735388,
... | 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": "page", "annotation": null, "type_comment": null}}], "kwarg": null... | def get_page_extensions(self, page=None):
extensions = []
for extension in self.page_extensions:
if page:
extensions.extend(list(extension.objects.filter(extended_object=page)))
else:
extensions.extend(list(extension.objects.all()))
return ... | |
14,608 | [
-0.011825156398117542,
0.010232935659587383,
0.025553211569786072,
-0.0316631980240345,
0.033320147544145584,
0.059235814958810806,
-0.007624540012329817,
-0.01131383329629898,
0.05669861659407616,
0.07787645608186722,
0.02762439474463463,
-0.07254315912723541,
0.04996727406978607,
0.01958... | 16 | {"_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 = aci_argument_spec()
argument_spec.update({
'description': dict(type='str'),
'leaf_profile': dict(type='str', aliases=['leaf_profile_name']), # Not required for querying all objects
'leaf': dict(type='str', aliases=['name', 'leaf_name', 'leaf_profile_leaf_name... | |
14,609 | [
0.00868992693722248,
0.013364054262638092,
0.02158217877149582,
-0.03252139315009117,
-0.06337501853704453,
0.008256527595221996,
0.009375684894621372,
0.01587667129933834,
0.006654596887528896,
0.026881719008088112,
0.008706385269761086,
-0.0025784505996853113,
0.003895106026902795,
-0.02... | 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": "title", "annotation": null, "type_comment": null}}], "kwarg": nul... | def get_title_extensions(self, title=None):
extensions = []
for extension in self.title_extensions:
if title:
extensions.extend(list(extension.objects.filter(extended_object=title)))
else:
extensions.extend(list(extension.objects.all()))
re... | |
14,610 | [
0.04996894672513008,
0.023460540920495987,
0.04463518410921097,
0.02368110977113247,
-0.03280465304851532,
-0.045878391712903976,
0.010777812451124191,
-0.02478395588696003,
-0.0208137109875679,
0.05028977617621422,
0.007003071717917919,
0.010637450031936169,
-0.013434669002890587,
-0.0287... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v... | def __init__(self, *args, **kwargs):
parent_kwargs = {
'max_length': self.MAX_LENGTH,
'choices': GENDER_CHOICES,
'default': GENDER_UNKNOWN,
'blank': True,
}
parent_kwargs.update(kwargs)
super(GenderFieldBase, self).__init__(*args, **par... | |
14,611 | [
0.03825772926211357,
0.04788578301668167,
0.03577648848295212,
0.004395185504108667,
-0.0042308298870921135,
-0.038427386432886124,
-0.005171897821128368,
-0.011494284495711327,
0.009665166027843952,
0.02192820981144905,
0.03060194104909897,
-0.016764264553785324,
-0.0035230405628681183,
-... | 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 deconstruct(self):
name, path, args, kwargs = super(GenderFieldBase, self).deconstruct()
if kwargs['choices'] == GENDER_CHOICES:
del kwargs['choices']
if kwargs['max_length'] == self.MAX_LENGTH:
del kwargs['max_length']
if kwargs['default'] == GENDER_UNKNOWN:
... | |
14,612 | [
0.027134981006383896,
0.040208108723163605,
-0.020186448469758034,
0.023001564666628838,
0.013498828746378422,
0.04317428171634674,
0.016162890940904617,
0.0029249750077724457,
-0.017604779452085495,
0.045426372438669205,
0.004789131693542004,
-0.0377088338136673,
-0.024512115865945816,
0.... | 14 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "age", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "percent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def MOONPHASE(age, percent):
if (percent == 0) and (age == 0):
phase = LANGUAGE(32501)
elif (age < 17) and (age > 0) and (percent > 0) and (percent < 50):
phase = LANGUAGE(32502)
elif (age < 17) and (age > 0) and (percent == 50):
phase = LANGUAGE(32503)
elif (age < 17) and (age >... | |
14,613 | [
-0.003013556357473135,
-0.03752965107560158,
0.02798844873905182,
-0.00327072711661458,
-0.024439839646220207,
0.01346952747553587,
-0.03617648407816887,
-0.009920917451381683,
0.04987384006381035,
0.03313876688480377,
-0.006199710536748171,
0.024315569549798965,
-0.03142659738659859,
-0.0... | 18 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "spd", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def KPHTOBFT(spd):
if (spd < 1.0):
bft = '0'
elif (spd >= 1.0) and (spd < 5.6):
bft = '1'
elif (spd >= 5.6) and (spd < 12.0):
bft = '2'
elif (spd >= 12.0) and (spd < 20.0):
bft = '3'
elif (spd >= 20.0) and (spd < 29.0):
bft = '4'
elif (spd >= 29.0) and (sp... | |
14,614 | [
-0.0009179360349662602,
-0.018596362322568893,
-0.03186417743563652,
-0.006282464601099491,
-0.002257603919133544,
0.0108177550137043,
-0.02727198787033558,
-0.044475968927145004,
0.017672570422291756,
0.04967063292860985,
-0.014486151747405529,
0.017190590500831604,
-0.025906380265951157,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "T", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "V", "annotation": null, "type_comment": null}}, {"_type": "arg", "_f... | def FEELS_LIKE(T, V=0, R=0, ext=''):
if T <= 10 and V >= 8:
FeelsLike = WIND_CHILL(T, V)
elif T >= 26:
FeelsLike = HEAT_INDEX(T, R)
else:
FeelsLike = T
if ext == 'F':
FeelsLike = FeelsLike * 1.8 + 32
return str(int(round(FeelsLike))) | |
14,615 | [
-0.008881553076207638,
-0.03412320092320442,
0.0159592367708683,
0.01901579275727272,
0.009576794691383839,
0.013842194341123104,
-0.029638580977916718,
0.016109557822346687,
0.02748395875096321,
0.03612750023603439,
-0.023663261905312538,
0.013554076664149761,
-0.016547998413443565,
-0.04... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Tc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "RH", "annotation": null, "type_comment": null}}, {"_type": "arg", "... | def DEW_POINT(Tc=0, RH=93, ext='', minRH=( 0, 0.075 )[ 0 ]):
Es = 6.11 * 10.0**( 7.5 * Tc / ( 237.7 + Tc ) )
RH = RH or minRH
E = ( RH * Es ) / 100
try:
DewPoint = ( -430.22 + 237.7 * math.log( E ) ) / ( -math.log( E ) + 19.08 )
except ValueError:
DewPoint = 0
if ext == 'F':
... | |
14,616 | [
-0.02432127855718136,
-0.0029196799732744694,
0.0450625866651535,
0.001321366406045854,
-0.00411821948364377,
-0.06208622828125954,
-0.01654798351228237,
-0.0016820236342027783,
-0.0388539619743824,
0.02588595263659954,
-0.002365785650908947,
-0.03091794066131115,
0.03514881804585457,
-0.0... | 16 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def get_ui(self):
ui = self.app.inflate('myhosts:main')
t = ui.find('list')
for h in self.hosts:
t.append(UI.DTR(
UI.Label(text=h.ip),
UI.Label(text=h.name),
UI.Label(text=h.aliases),
UI.HContainer(
... | |
14,617 | [
-0.015897398814558983,
0.00841591227799654,
-0.005639935843646526,
-0.014768804423511028,
-0.019137553870677948,
-0.04283802583813667,
-0.01876135729253292,
0.018882710486650467,
-0.032644275575876236,
0.017766252160072327,
0.0030960487201809883,
-0.027984274551272392,
0.03281417116522789,
... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "My Hosts"}}, "targets": [{"_type": "Name", "_fields": {"id": "text", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}},... | class MyHostsPlugin(CategoryPlugin):
text = 'My Hosts'
icon = '/dl/hosts/icon.png'
folder = 'system'
def on_init(self):
be = backend.Config(self.app)
self.hosts = be.read()
def on_session_start(self):
self._editing = None
def get_ui(self):
ui = self.app.inflate... | |
14,618 | [
-0.0010616205399855971,
0.015645885840058327,
0.010261576622724533,
-0.035348113626241684,
0.0016041259514167905,
0.00593964196741581,
-0.04116703197360039,
0.03182296082377434,
-0.052346114069223404,
-0.004315898288041353,
0.05229782313108444,
-0.03464791178703308,
0.03626561909914017,
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": "event", "annotation": null, "type_comment": null}}, {"_type": "ar... | def on_click(self, event, params, vars = None):
if params[0] == 'add':
self._editing = len(self.hosts)
if params[0] == 'edit':
self._editing = int(params[1])
if params[0] == 'del':
self.hosts.pop(int(params[1]))
backend.Config(self.app).save(self.h... | |
14,619 | [
0.0011806089896708727,
0.02131461538374424,
-0.0048830839805305,
-0.01185761857777834,
0.010063214227557182,
0.009123576804995537,
-0.005271063186228275,
0.06110674887895584,
-0.031765807420015335,
0.005310467444360256,
0.04405990615487099,
-0.032202284783124924,
0.04709099233150482,
0.019... | 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": "event", "annotation": null, "type_comment": null}}, {"_type": "ar... | def on_submit(self, event, params, vars = None):
if params[0] == 'dlgEdit':
v = vars.getvalue('value', '')
if vars.getvalue('action', '') == 'OK':
h = backend.Host()
h.ip = vars.getvalue('ip', 'none')
h.name = vars.getvalue('name', 'none')
... | |
14,620 | [
0.006936024874448776,
0.006144809070974588,
0.02293010987341404,
-0.08483292162418365,
-0.018746668472886086,
-0.0017218802822753787,
-0.004601785913109779,
0.0018552654655650258,
-0.019122572615742683,
-0.0100099453702569,
0.013944805599749088,
-0.010955766774713993,
-0.04462337866425514,
... | 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": "primitive", "annotation": null, "type_comment": null}}, {"_type":... | def obj_make_compatible(self, primitive, target_version):
target_version = utils.convert_version_to_tuple(target_version)
if target_version < (1, 4) and 'default_route' in primitive:
del primitive['default_route']
if target_version < (1, 3) and 'instance' in primitive:
se... | |
14,621 | [
-0.0390707328915596,
0.013429802842438221,
0.05181807652115822,
-0.0233498215675354,
-0.006501633208245039,
-0.010200313292443752,
-0.005398732144385576,
-0.01639118418097496,
0.0014007150894030929,
0.01885290816426277,
0.011808964423835278,
-0.015538111329078674,
0.029808800667524338,
-0.... | 11 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "1.4"}}, "targets": [{"_type": "Name", "_fields": {"id": "VERSION", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class FixedIP(obj_base.NovaPersistentObject, obj_base.NovaObject):
# Version 1.0: Initial version
# Version 1.1: Added virtual_interface field
# Version 1.2: Instance version 1.14
# Version 1.3: Instance 1.15
# Version 1.4: Added default_route field
VERSION = '1.4'
fields = {
'id': ... | |
14,622 | [
0.03684138506650925,
0.01996050402522087,
0.031936805695295334,
0.008457550778985023,
-0.017371341586112976,
-0.02698660083115101,
0.030020596459507942,
0.002800173358991742,
-0.010162747465074062,
-0.0017280093161389232,
0.017645085230469704,
-0.01153146754950285,
0.02497914433479309,
-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": "context", "annotation": null, "type_comment": null}}], "kwarg": n... | def create(self, context):
updates = self.obj_get_changes()
if 'id' in updates:
raise exception.ObjectActionError(action='create',
reason='already created')
if 'address' in updates:
updates['address'] = str(updates['address'])... | |
14,623 | [
-0.0358789786696434,
0.008999309502542019,
0.024455415084958076,
-0.0014552923385053873,
-0.026371167972683907,
-0.036825031042099,
0.02620561048388481,
-0.018932843580842018,
0.02537781558930874,
0.06149330735206604,
0.001900971052236855,
-0.0076097967103123665,
0.059837717562913895,
-0.0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fixedip", "annotation": null, "type_comment": null}}, {"_type"... | def _from_db_object(context, fixedip, db_fixedip, expected_attrs=None):
if expected_attrs is None:
expected_attrs = []
for field in fixedip.fields:
if field in ('virtual_interface', 'default_route'):
# NOTE(danms): These fields are only set when doing a
... | |
14,624 | [
-0.05002143234014511,
0.0028607312124222517,
0.04774561896920204,
-0.018194889649748802,
-0.03683100640773773,
-0.022943906486034393,
-0.0042236060835421085,
-0.03467130661010742,
-0.007814397104084492,
0.04024472460150719,
0.007849231362342834,
-0.025150051340460777,
0.034044299274683,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "1.4"}}, "targets": [{"_type": "Name", "_fields": {"id": "VERSION", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {... | class FixedIPList(obj_base.ObjectListBase, obj_base.NovaObject):
# Version 1.0: Initial version
# Version 1.1: Added get_by_network()
# Version 1.2: FixedIP <= version 1.2
# Version 1.3: FixedIP <= version 1.3
# Version 1.4: FixedIP <= version 1.4
VERSION = '1.4'
fields = {
'objects... | |
14,625 | [
-0.03160790726542473,
0.006892823614180088,
0.025589684024453163,
-0.0081099234521389,
-0.008079343475401402,
-0.03762613236904144,
-0.0037736219819635153,
-0.0031406076159328222,
-0.025540754199028015,
0.029430583119392395,
0.0022843563929200172,
-0.020378781482577324,
0.01849502883851528,
... | 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": "context", "annotation": null, "type_comment": null}}, {"_type": "a... | def get_by_network(cls, context, network, host=None):
ipinfo = db.network_get_associated_fixed_ips(context,
network['id'],
host=host)
if not ipinfo:
return []
fips = cls(context... | |
14,626 | [
0.011836898513138294,
0.029261542484164238,
0.05387043207883835,
0.02065185271203518,
-0.036605436354875565,
-0.026000123471021652,
0.003575016977265477,
0.0014881649985909462,
0.006716698408126831,
0.01973956823348999,
0.017664119601249695,
-0.017607102170586586,
0.032203663140535355,
-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": "context", "annotation": null, "type_comment": null}}, {"_type": "... | def bulk_create(self, context, fixed_ips):
ips = []
for fixedip in fixed_ips:
ip = obj_base.obj_to_primitive(fixedip)
if 'id' in ip:
raise exception.ObjectActionError(action='create',
reason='already created')
... | |
14,627 | [
0.003293263027444482,
0.012705031782388687,
0.016472022980451584,
-0.03022724576294422,
0.028035541996359825,
0.01312739122658968,
-0.015615887939929962,
0.02794422022998333,
0.020364578813314438,
0.04725860804319382,
0.020364578813314438,
-0.010958517901599407,
-0.029496677219867706,
-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 Daemon(Base):
def __init__(self, *, domain, task_list=None, swf=None):
super().__init__(swf=swf)
self.task_list = task_list or 'floto_daemon'
self.domain = domain
def get_decisions(self):
signals = self.history.get_events_up_to_last_decision('WorkflowExecutionSignaled')
... | |
14,628 | [
0.01265698205679655,
0.022926270961761475,
0.00596370454877615,
-0.03168114274740219,
-0.019720572978258133,
-0.02858598716557026,
-0.016017436981201172,
0.03176957741379738,
-0.00715202372521162,
0.011253106407821178,
-0.02462860755622387,
0.009069915860891342,
0.02249515987932682,
-0.037... | 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 get_decision_start_child_workflow_execution(self):
# TODO: this is hardcoded, fix!
child_workflow_type = floto.api.WorkflowType(domain='d', name='child_workflow', version='v1')
child_workflow_id = str(uuid.uuid4())
child_workflow_task_list = 'task_list_{}'.format(child_workflow_id)
... | |
14,629 | [
0.03934093564748764,
0.02357417345046997,
-0.04525493085384369,
-0.003415742190554738,
-0.0026458122301846743,
0.01595376618206501,
-0.028821969404816628,
0.006626949179917574,
0.02582990750670433,
0.014609675854444504,
-0.0012082202592864633,
-0.01653815247118473,
0.0151589997112751,
-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": "signal_event", "annotation": null, "type_comment": null}}], "kwar... | def get_decision_child_workflow(self, signal_event):
decision = None
attributes = self.history.get_event_attributes(signal_event)
if attributes['signalName'] == 'startChildWorkflowExecution':
decision = self.get_decision_start_child_workflow_execution()
if 'input' in att... | |
14,630 | [
0.03161865472793579,
0.009130045771598816,
0.015110923908650875,
-0.07253243029117584,
-0.019783882424235344,
-0.005339616443961859,
0.0022936223540455103,
0.004428516607731581,
0.0005408662836998701,
-0.017891841009259224,
0.022501308470964432,
-0.038907453417778015,
-0.008152280002832413,
... | 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": "List", "_fields": {"c... | def main():
item_types = ['Carabiner', 'Cam']
dataframes = dict()
for item_type in item_types:
print('Scrapping weightmyrack for %s' % item_type)
print('Retrieving page contents')
item_names = set(get_names(item_type))
print('Found %d items of type %s' % (len(item_names), ... | |
14,631 | [
0.014579554088413715,
-0.0015846072928979993,
-0.03100343979895115,
-0.04400714114308357,
-0.043586913496255875,
0.0093967504799366,
-0.007960973307490349,
0.016540614888072014,
-0.04260638356208801,
-0.054162636399269104,
-0.0007660394185222685,
-0.0222953949123621,
0.0639212504029274,
-0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "item_type", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [{"_type": "Constant", "_fields": {"kind": null, "val... | def load_database(item_type='Carabiner'):
name = pickle_name(item_type)
if os.path.exists(name):
print('Loading existing database')
with open(name, 'rb') as handle:
return pickle.load(handle)
else:
return dict() | |
14,632 | [
-0.0009745629504323006,
0.040739137679338455,
0.005579673685133457,
0.0025356684345752,
-0.0432417206466198,
-0.029188761487603188,
0.012176021002233028,
-0.00007115588232409209,
-0.03335170820355415,
0.00586843304336071,
0.04328984394669533,
0.00758594973012805,
0.011574438773095608,
0.00... | 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": "Attribute", "_fields"... | def getppid():
CreateToolhelp32Snapshot = ctypes.windll.kernel32.CreateToolhelp32Snapshot
Process32First = ctypes.windll.kernel32.Process32First
Process32Next = ctypes.windll.kernel32.Process32Next
CloseHandle = ctypes.windll.kernel32.CloseHandle
hProcessSnap = CreateToolhelp32Sn... | |
14,633 | [
0.030062241479754448,
0.03934925049543381,
-0.02465355396270752,
-0.017358113080263138,
-0.015932567417621613,
0.006242002826184034,
0.023228008300065994,
-0.011100388132035732,
0.00027465992025099695,
0.039202503859996796,
0.007064836099743843,
0.0372738242149353,
0.016509076580405235,
-0... | 13 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "path", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "stream", "annotation": null, "type_comment": null}}, {"_type": "a... | def zip_dir(path, stream, include_dir=True): # TODO add ignore list
path = os.path.normpath(path)
len_prefix = len(os.path.dirname(path)) if include_dir else len(path)
if len_prefix:
len_prefix += 1
with zipfile.ZipFile(stream, 'w', compression=zipfile.ZIP_DEFLATED, allowZip64=True) as zip... | |
14,634 | [
-0.04982291907072067,
0.06531808525323868,
0.05659311264753342,
-0.013528471812605858,
0.04434001445770264,
0.01024468895047903,
0.041336335241794586,
0.03225378319621086,
0.022599102929234505,
0.03373178467154503,
0.05387549847364426,
-0.007026461884379387,
0.03501907363533974,
0.05973982... | 10 | {"_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 is_running_as_nt_service():
@contextmanager
def close_srv(srv):
try:
yield srv
finally:
ws.CloseServiceHandle(srv)
with close_srv(ws.OpenSCManager(None, None, ws.SC_MANAGER_ALL_ACCESS)) as hscm:
with close_srv(wsu.SmartOpen... | |
14,635 | [
0.009553472511470318,
-0.003739517880603671,
0.030867617577314377,
-0.02553493157029152,
-0.0025156002957373857,
-0.06244330853223801,
-0.016042310744524002,
0.049609459936618805,
-0.005346514750272036,
0.013608304783701897,
0.021618396043777466,
-0.04308190196752548,
-0.022879652678966522,
... | 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}}, {"_type": "arg", "_fields": {"arg": "env", "annotation": nu... | class WsgiRequest:
# pylint: disable=R0902
def __init__(self, env, start_response):
self.method = env['REQUEST_METHOD']
self.headers_in = env
self.path_info = env['PATH_INFO']
self.start_response = start_response
self.uri = self.unparsed_uri = env['REQUEST_URI']
... | |
14,636 | [
0.03696218505501747,
-0.041790369898080826,
-0.005778228864073753,
-0.009350277483463287,
0.024279534816741943,
-0.012174420058727264,
0.004132256843149662,
0.012601794674992561,
0.06126482039690018,
-0.004325730726122856,
0.01702570728957653,
-0.025573210790753365,
-0.053086936473846436,
... | 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": "status", "annotation": null, "type_comment": null}}], "kwarg": nu... | def send_http_header(self, status=None):
self.sent_header = 1
self.status = str(self.status)
if status is not None:
self.status = str(status)
if len(self.status) == 0 or self.status is None:
self.status = "200"
elif self.status.startswith("500"):
... | |
14,637 | [
0.0274925846606493,
-0.005019090138375759,
0.027702808380126953,
-0.009279039688408375,
-0.007387026213109493,
-0.05755457282066345,
-0.012204652652144432,
0.03854100778698921,
0.023778634145855904,
0.0343598909676075,
0.02840355411171913,
-0.04216152802109718,
-0.02005300298333168,
-0.019... | 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": "env", "annotation": null, "type_comment": null}}, {"_type": "arg"... | def __init__(self, env, start_response):
self.method = env['REQUEST_METHOD']
self.headers_in = env
self.path_info = env['PATH_INFO']
self.start_response = start_response
self.uri = self.unparsed_uri = env['REQUEST_URI']
self.server = WsgiServer(env['SERVER_NAME'], env['SE... | |
14,638 | [
0.005312199238687754,
-0.013248860836029053,
0.00740021513774991,
0.0037248667795211077,
-0.054976172745227814,
0.019444134086370468,
0.01229150965809822,
-0.010717933066189289,
0.05229118838906288,
0.015163564123213291,
0.035366978496313095,
-0.038756221532821655,
0.016561076045036316,
-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_setBegin(self):
atom = self.molecule.addAtom()
bond = self.molecule.addBond()
bond.setBegin(atom)
self.assertEqual(atom.id, bond.beginAtomId)
# check if setBegin added the bond to the atom
self.assert_(bond.id in atom.bonds) | |
14,639 | [
-0.014061955735087395,
0.022199390456080437,
0.03273707628250122,
-0.018183361738920212,
-0.05034672096371651,
0.015876779332756996,
0.007429067976772785,
-0.029107429087162018,
0.02699989080429077,
-0.0036062300205230713,
0.01071916799992323,
-0.06378812342882156,
0.038099586963653564,
-0... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs... | class TestBond(unittest.TestCase):
def setUp(self):
self.molecule = Avogadro.molecules.addMolecule()
# test with indices > 0
for x in range(5):
self.molecule.addAtom()
for x in range(7):
self.molecule.addBond()
def test_type(self):
bond = self.molecule.addBond()
self.assertEqual... | |
14,640 | [
0.03575946018099785,
0.004807970952242613,
0.014113811776041985,
-0.002170710824429989,
-0.05596355348825455,
0.02717718854546547,
-0.00569078279659152,
-0.004578887019306421,
0.057572729885578156,
0.008101752027869225,
0.05310279503464699,
-0.051270123571157455,
-0.0001943372917594388,
-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_setEnd(self):
atom = self.molecule.addAtom()
bond = self.molecule.addBond()
bond.setEnd(atom)
self.assertEqual(atom.id, bond.endAtomId)
# check if setEnd added the bond to the atom
self.assert_(bond.id in atom.bonds) | |
14,641 | [
0.0035050332080572844,
-0.011752665974199772,
0.005660249851644039,
0.0018002232536673546,
-0.053835514932870865,
0.01831934228539467,
-0.009603061713278294,
-0.01981227844953537,
0.05397021770477295,
0.005699537694454193,
0.04312678426504135,
-0.054060015827417374,
0.014805889688432217,
-... | 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_setAtoms(self):
beginAtom = self.molecule.addAtom()
endAtom = self.molecule.addAtom()
bond = self.molecule.addBond()
bond.setAtoms(beginAtom.id, endAtom.id, 2)
self.assertEqual(beginAtom.id, bond.beginAtomId)
self.assertEqual(endAtom.id, bond.endAtomId)
# check if setAtoms added th... | |
14,642 | [
-0.0002542759757488966,
0.00781533308327198,
0.019652318209409714,
0.0059623331762850285,
-0.04779219254851341,
0.006435812450945377,
-0.008049149997532368,
-0.031682200729846954,
0.030513117089867592,
0.01197142992168665,
0.028993306681513786,
-0.02398962341248989,
0.007704269606620073,
-... | 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_pos(self):
beginAtom = self.molecule.addAtom()
endAtom = self.molecule.addAtom()
bond = self.molecule.addBond()
#translate one atom
endAtom.pos = array([3.0, 0., 0.])
bond.setAtoms(beginAtom.id, endAtom.id, 1)
self.assertEqual(bond.beginPos[0], 0.0)
self.assertEqual(bond.midPos... | |
14,643 | [
0.03583163022994995,
0.01213832851499319,
0.034081555902957916,
-0.007219052407890558,
-0.0639449879527092,
0.017444640398025513,
-0.0011554970405995846,
-0.04543459415435791,
0.03334113955497742,
0.0503033883869648,
0.018487952649593353,
-0.03758170083165169,
0.00900838989764452,
-0.03226... | 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_length(self):
beginAtom = self.molecule.addAtom()
endAtom = self.molecule.addAtom()
bond = self.molecule.addBond()
#translate one atom
endAtom.pos = array([1.5, 0., 0.])
bond.setAtoms(beginAtom.id, endAtom.id, 1)
self.assertEqual(bond.length, 1.5) | |
14,644 | [
-0.00001138660627475474,
0.02299247495830059,
-0.04987157881259918,
0.006985703017562628,
-0.015239674597978592,
0.006781143601983786,
-0.01927972212433815,
0.0013424210483208299,
0.08403299748897552,
0.026306336745619774,
0.00313487253151834,
0.0002473890199325979,
0.005620269104838371,
0... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "source", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def _strip_comments(source):
# Strip comments and blank lines from the wrapper
buf = []
for line in source.splitlines():
l = line.strip()
if not l or l.startswith(u'#'):
continue
buf.append(line)
return u'\n'.join(buf) | |
14,645 | [
-0.004071293398737907,
-0.009575862437486649,
0.005685139447450638,
-0.0006260001682676375,
-0.05507390946149826,
0.027311241254210472,
-0.011996631510555744,
-0.016702743247151375,
0.04681282117962837,
-0.005566640291363001,
0.04164399951696396,
-0.05403563007712364,
0.026769530028104782,
... | 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_otherAtom(self):
beginAtom = self.molecule.addAtom()
endAtom = self.molecule.addAtom()
bond = self.molecule.addBond()
bond.setAtoms(beginAtom.id, endAtom.id, 2)
# check if setAtoms added the bond to the atoms
self.assertEqual(bond.otherAtom(beginAtom.id), endAtom.id) | |
14,646 | [
0.044119931757450104,
0.0096845468506217,
0.05745730921626091,
0.0005256629083305597,
-0.022631939500570297,
0.049735669046640396,
0.0225539430975914,
0.011198975145816803,
0.00505676306784153,
0.05631336197257042,
0.019434090703725815,
-0.059537213295698166,
-0.03543633967638016,
-0.00099... | 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 sanity_check_step(self):
custom_paths = {
'files': [os.path.join('site-packages', 'meep_mpi.py')],
'dirs': [],
}
self.options['modulename'] = 'meep_mpi'
return super(EB_python_minus_meep, self).sanity_check_step(custom_paths=custom_paths) | |
14,647 | [
0.0037845151964575052,
0.00770563306286931,
-0.0007777038845233619,
-0.04582398757338524,
0.004091870971024036,
0.007587657775729895,
-0.020490402355790138,
0.011915478855371475,
-0.012225939892232418,
0.018230248242616653,
0.009549768641591072,
-0.012468098662793636,
0.012331495992839336,
... | 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": "node", "annotation": null, "type_comment": null}}], "kwarg": null... | def visit_ImportFrom(self, node):
# Specialcase: six is a special case because of its
# import logic
if node.names[0].name == '_six':
self.submodules.add(('_six',))
elif node.module.startswith('ansible.module_utils'):
where_from = node.module[self.IMPORT_PREFIX_SI... | |
14,648 | [
0.031534139066934586,
-0.030991943553090096,
0.03997071459889412,
-0.03461381420493126,
-0.048537418246269226,
-0.00921733770519495,
0.017534630373120308,
0.00538672087714076,
-0.00658768555149436,
0.006175616290420294,
0.007335916627198458,
-0.004576137289404869,
0.0410551056265831,
-0.03... | 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": "verbosity", "annotation": null, "type_comment": null}}, {"_type":... | def _create_test_db(self, verbosity, autoclobber):
test_database_name = self._get_test_db_name()
if test_database_name != ':memory:':
# Erase the old test database
if verbosity >= 1:
print("Destroying old test database '%s'..." % self.connection.alias)
... | |
14,649 | [
-0.013779290951788425,
-0.0033365648705512285,
-0.045124124735593796,
-0.03781810402870178,
0.012080474756658077,
-0.024294190108776093,
-0.00019691145280376077,
-0.04519074410200119,
0.013845911249518394,
0.0036308043636381626,
-0.01596665568649769,
-0.03266613557934761,
-0.0015794554492458... | 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 __str__(self):
if self._soup:
text = self._soup
if not isinstance(self._soup, string_types):
text = self._soup.get_text()
return text_type(text.strip())
else:
return text_type("") | |
14,650 | [
0.030399441719055176,
0.024595513939857483,
0.01141074113547802,
-0.006252910941839218,
-0.02076273038983345,
-0.026303838938474655,
-0.024486005306243896,
0.03265530616044998,
-0.026303838938474655,
0.02249295823276043,
-0.01617434248328209,
-0.03618146851658821,
0.039839036762714386,
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": "cr", "annotation": null, "type_comment": null}}, {"_type": "arg",... | def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
if not args:
args = []
if not context:
context = {}
if name:
name = name.split(' / ')[-1]
ids = self.search(cr, uid, [('name', operator, name)] + args, limi... | |
14,651 | [
0.0011410152073949575,
0.016948450356721878,
-0.026248302310705185,
-0.018044883385300636,
-0.05902235209941864,
0.03199465945363045,
-0.019392304122447968,
-0.06277399510145187,
0.010052822530269623,
0.0064795129001140594,
-0.01048214826732874,
-0.049458302557468414,
0.01800525188446045,
... | 17 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "deviceType", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "variableId", "annotation": null, "type_comment": null}}], "... | def getRuleString(deviceType, variableId):
retVal = variableId + ":"
if(deviceType == 'g8272_cnos'):
if variableId in g8272_cnos:
retVal = retVal + g8272_cnos[variableId]
else:
retVal = "The variable " + variableId + " is not supported"
elif(deviceType == 'g8296_cnos'... | |
14,652 | [
0.020960433408617973,
0.0021549209486693144,
0.050305042415857315,
-0.014684079214930534,
0.01656816340982914,
-0.007701192982494831,
0.05765296891331673,
0.015955835580825806,
-0.06090301275253296,
0.007459794636815786,
0.035915348678827286,
-0.0086020203307271,
-0.003983071073889732,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "cls", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}... | def initdb(cls):
# connect to the db
doc_store_config = {
'host': HOST,
'port': PORT,
'db': DB,
'collection': COLLECTION,
}
cls.add_asset_collection(doc_store_config)
# since MongoModuleStore and MongoContentStore are basically ass... | |
14,653 | [
0.006154351867735386,
0.009667927399277687,
-0.02777291089296341,
0.01622510887682438,
-0.043326638638973236,
-0.01744478940963745,
-0.021741647273302078,
0.02175283618271351,
0.0014448739821091294,
0.011928252875804901,
0.01651604287326336,
-0.020756950601935387,
0.019738685339689255,
-0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"... | class DebugTriggerErrorView(View):
def get(self, request):
try:
raise ValueError('An example error')
except Exception:
client.captureException(request=request)
return Error500View.as_view()(request) | |
14,654 | [
0.01993178017437458,
0.03649325296282768,
0.010780842043459415,
-0.053621046245098114,
-0.001739541650749743,
-0.012051613070070744,
-0.019075389951467514,
-0.035360608249902725,
-0.0020580978598445654,
0.007507222704589367,
0.011340257711708546,
-0.013073756359517574,
-0.019020140171051025,... | 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_loads(self):
assert_not_none(
self.draft_store.get_item(Location('edX', 'toy', '2012_Fall', 'course', '2012_Fall'))
)
assert_not_none(
self.draft_store.get_item(Location('edX', 'simple', '2012_Fall', 'course', '2012_Fall')),
)
assert_not_none(
... | |
14,655 | [
0.013027765788137913,
0.011404244229197502,
0.02856340818107128,
-0.05298221856355667,
0.01017670426517725,
-0.016868777573108673,
-0.020947379991412163,
-0.030411317944526672,
-0.021105771884322166,
0.0043227896094322205,
0.007906414568424225,
-0.02903858572244644,
-0.016406800597906113,
... | 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_find_one(self):
assert_not_none(
self.draft_store._find_one(Location('edX', 'toy', '2012_Fall', 'course', '2012_Fall')),
)
assert_not_none(
self.draft_store._find_one(Location('edX', 'simple', '2012_Fall', 'course', '2012_Fall')),
)
assert_not_n... | |
14,656 | [
0.004814734682440758,
0.03729589655995369,
0.03475010022521019,
-0.06929653882980347,
-0.02601802535355091,
-0.024210510775446892,
0.017909668385982513,
0.024057762697339058,
0.0008973927469924092,
0.013989143073558807,
0.03622666373848915,
-0.01136697456240654,
-0.017400508746504784,
-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 setup_test():
course = self.draft_store.get_course(course_key)
# can't use item factory as it depends on django settings
p1ele = self.draft_store.create_item(
99,
course_key,
'problem',
block_id='p1',
... | |
14,657 | [
0.03953350707888603,
0.03994080796837807,
-0.0053617157973349094,
0.0016578362556174397,
-0.010653426870703697,
0.014433675445616245,
0.0021621875930577517,
-0.019715841859579086,
0.007299570366740227,
0.008171445690095425,
0.04719582945108414,
-0.021472319960594177,
-0.007458671927452087,
... | 8 | {"_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 check_xblock_fields():
def check_children(xblock):
for child in xblock.children:
assert_is_instance(child, UsageKey)
course = self.draft_store.get_course(course_key)
check_children(course)
refele = self.draft_store.get_item(self.r... | |
14,658 | [
0.035426024347543716,
0.05892443656921387,
0.031322721391916275,
-0.0065754777751863,
-0.04951997473835945,
0.010239141061902046,
-0.004370908718556166,
-0.005119570530951023,
-0.024390434846282005,
0.0032574739307165146,
0.03269898518919945,
-0.0016741345170885324,
0.03782173991203308,
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": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fie... | def check_mongo_fields():
def get_item(location):
return self.draft_store._find_one(as_draft(location))
def check_children(payload):
for child in payload['definition']['children']:
assert_is_instance(child, basestring)
refele = ge... | |
14,659 | [
-0.008791470900177956,
-0.014618507586419582,
0.04964861273765564,
-0.03903548792004585,
-0.021079163998365402,
-0.007094275671988726,
0.012876053340733051,
-0.010301974602043629,
0.01153526920825243,
0.021995648741722107,
0.021260198205709457,
-0.004879435990005732,
-0.043697115033864975,
... | 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_sns_server_get():
backend = server.create_backend_app("sns")
test_client = backend.test_client()
topic_data = test_client.action_data("CreateTopic", Name="testtopic")
topic_data.should.contain("CreateTopicResult")
topic_data.should.contain(
"<TopicArn>arn:aws:sns:us-east-1:12345678... | |
14,660 | [
-0.03633582964539528,
-0.001875370740890503,
0.03611372783780098,
-0.00897290650755167,
-0.007784662768244743,
-0.010944059118628502,
0.009861312806606293,
0.030672237277030945,
-0.058634836226701736,
-0.020899765193462372,
-0.025985892862081528,
-0.06725237518548965,
0.027740495279431343,
... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "conf_file", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "installroot", "annotation": null, "type_comment": null}}], "... | def yum_base(conf_file=None, installroot='/'):
my = yum.YumBase()
my.preconf.debuglevel = 0
my.preconf.errorlevel = 0
my.preconf.plugins = True
#my.preconf.releasever = '/'
if installroot != '/':
# do not setup installroot by default, because of error
# CRITICAL:yum.cli:Config E... | |
14,661 | [
-0.04104720056056976,
0.05691699683666229,
-0.0032057662028819323,
-0.006991862785071135,
-0.03290025517344475,
0.023972099646925926,
-0.011662404052913189,
0.014273890294134617,
-0.023927459493279457,
-0.00857103057205677,
0.009508486837148666,
-0.05066728964447975,
-0.029552198946475983,
... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def ensure_yum_utils(module):
repoquerybin = module.get_bin_path('repoquery', required=False)
if module.params['install_repoquery'] and not repoquerybin and not module.check_mode:
yum_path = module.get_bin_path('yum')
if yum_path:
rc, so, se = module.run_command('%s -y install yum-... | |
14,662 | [
-0.018971828743815422,
0.035033658146858215,
0.028736239299178123,
-0.029259130358695984,
0.01905139908194542,
0.016823431476950645,
-0.06915794312953949,
0.014436323195695877,
-0.04571881145238876,
0.037557173520326614,
0.01582312025129795,
-0.014856908470392227,
-0.010651051066815853,
-0... | 12 | {"_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": "repoq", "annotation": null, "type_comment": null}}, {"_type": "... | def is_installed(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=None, dis_repos=None, is_pkg=False, installroot='/'):
if en_repos is None:
en_repos = []
if dis_repos is None:
dis_repos = []
if not repoq:
pkgs = []
try:
my = yum_base(conf_file, installroot... | |
14,663 | [
-0.006963955704122782,
0.010816900990903378,
0.015125241130590439,
-0.02875637821853161,
0.05927293375134468,
-0.01924937590956688,
-0.04613300785422325,
0.0066415974870324135,
0.006314122583717108,
0.00919999461621046,
0.015995096415281296,
-0.02535882778465748,
-0.01647607423365116,
-0.0... | 12 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "spec", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}], "kwarg": nu... | def fetch_rpm_from_url(spec, module=None):
# download package so that we can query it
tempdir = tempfile.mkdtemp()
package = os.path.join(tempdir, str(spec.rsplit('/', 1)[1]))
try:
rsp, info = fetch_url(module, spec)
if not rsp:
module.fail_json(msg="Failure downloading %s, %... | |
14,664 | [
-0.015551240183413029,
0.03430016711354256,
0.022258883342146873,
-0.021821700036525726,
0.006895008031278849,
0.041669830679893494,
-0.02481953054666519,
0.023532962426543236,
-0.044917479157447815,
0.031452227383852005,
0.0026231007650494576,
-0.04868974909186363,
-0.02355794422328472,
0... | 12 | {"_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": "repoq", "annotation": null, "type_comment": null}}, {"_type": "... | def is_update(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=None, dis_repos=None, installroot='/'):
if en_repos is None:
en_repos = []
if dis_repos is None:
dis_repos = []
if not repoq:
retpkgs = []
pkgs = []
updates = []
try:
my = yum_... | |
14,665 | [
-0.010087101720273495,
0.04772572219371796,
0.03036874160170555,
-0.025928029790520668,
0.006052261218428612,
0.026262277737259865,
-0.058254506438970566,
0.025020787492394447,
-0.03511982783675194,
0.02161862887442112,
0.009937884286046028,
-0.05538953095674515,
-0.007986119948327541,
0.0... | 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": "repoq", "annotation": null, "type_comment": null}}, {"_type": "... | def is_available(module, repoq, pkgspec, conf_file, qf=def_qf, en_repos=None, dis_repos=None, installroot='/'):
if en_repos is None:
en_repos = []
if dis_repos is None:
dis_repos = []
if not repoq:
pkgs = []
try:
my = yum_base(conf_file, installroot)
... | |
14,666 | [
-0.020756399258971214,
0.0011963223805651069,
-0.0036892329808324575,
-0.04006237909197807,
0.0023088608868420124,
-0.0025602122768759727,
-0.041336990892887115,
-0.001745724119246006,
-0.0390954315662384,
0.04234788939356804,
0.00666973739862442,
-0.04377633333206177,
0.02514062449336052,
... | 8 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "pkgstr", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ... | def pkg_to_dict(pkgstr):
if pkgstr.strip():
n, e, v, r, a, repo = pkgstr.split('|')
else:
return {'error_parsing': pkgstr}
d = {
'name':n,
'arch':a,
'epoch':e,
'release':r,
'version':v,
'repo':repo,
'nevra': '%s:%s-%s-%s.%s' % (e, n, ... | |
14,667 | [
-0.010905974544584751,
0.03890842944383621,
0.027805009856820107,
-0.029268430545926094,
0.01585373282432556,
0.005177143961191177,
-0.04076674208045006,
0.014912961982190609,
-0.02564471960067749,
0.02980269491672516,
0.030499562621116638,
-0.03249724954366684,
-0.03082476742565632,
0.000... | 12 | {"_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": "repoq", "annotation": null, "type_comment": null}}, {"_type": "... | def what_provides(module, repoq, req_spec, conf_file, qf=def_qf, en_repos=None, dis_repos=None, installroot='/'):
if en_repos is None:
en_repos = []
if dis_repos is None:
dis_repos = []
if req_spec.endswith('.rpm') and '://' not in req_spec:
return req_spec
elif '://' in req_sp... | |
14,668 | [
0.0020341016352176666,
0.015137210488319397,
0.004158677067607641,
-0.04362711310386658,
-0.015885958448052406,
0.019068142399191856,
-0.05555718019604683,
-0.024696240201592445,
-0.028103047981858253,
0.037861745804548264,
0.008479583077132702,
-0.03613962233066559,
-0.005553222261369228,
... | 15 | {"_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": "repoquerybin", "annotation": null, "type_comment": null}}, {"_t... | def list_stuff(module, repoquerybin, conf_file, stuff, installroot='/', disablerepo='', enablerepo=''):
qf = "%{name}|%{epoch}|%{version}|%{release}|%{arch}|%{repoid}"
# is_installed goes through rpm instead of repoquery so it needs a slightly different format
is_installed_qf = "%{name}|%{epoch}|%{version}... | |
14,669 | [
0.025412488728761673,
0.03708849847316742,
0.016444899141788483,
-0.0032219174318015575,
-0.007639297284185886,
0.038669489324092865,
-0.042427584528923035,
-0.010023742914199829,
0.015563691966235638,
0.007917914539575577,
0.014060454443097115,
-0.029624145478010178,
0.004412520676851273,
... | 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": "repoq", "annotation": null, "type_comment": null}}, {"_type": "... | def repolist(module, repoq, qf="%{repoid}"):
cmd = repoq + ["--qf", qf, "-a"]
rc, out, err = module.run_command(cmd)
ret = []
if rc == 0:
ret = set([p for p in out.split('\n') if p.strip()])
return ret | |
14,670 | [
-0.010299425572156906,
0.04742525890469551,
0.017580879852175713,
-0.02955695614218712,
-0.009149721823632717,
-0.0045928251929581165,
-0.01795213855803013,
0.00344611587934196,
-0.032766543328762054,
0.04009590297937393,
0.04943723976612091,
-0.009550920687615871,
-0.025389280170202255,
-... | 15 | {"_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": "items", "annotation": null, "type_comment": null}}, {"_type": "... | def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, installroot='/'):
pkgs = []
res = {}
res['results'] = []
res['msg'] = ''
res['rc'] = 0
res['changed'] = False
tempdir = tempfile.mkdtemp()
for spec in items:
pkg = None
# check if pkgspec is... | |
14,671 | [
0.005330316722393036,
0.03729347139596939,
0.006436373107135296,
-0.0009756103972904384,
-0.030444668605923653,
0.040967825800180435,
-0.04031794145703316,
0.017072010785341263,
-0.002126190112903714,
0.04666682705283165,
0.04366735368967056,
-0.04216761514544487,
-0.003671232145279646,
-0... | 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": "items", "annotation": null, "type_comment": null}}, {"_type": "... | def remove(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, installroot='/'):
pkgs = []
res = {}
res['results'] = []
res['msg'] = ''
res['changed'] = False
res['rc'] = 0
for pkg in items:
is_group = False
# group remove - this is doom on a stick
if... | |
14,672 | [
-0.019971756264567375,
0.015693755820393562,
-0.024249758571386337,
-0.03231751173734665,
-0.02322675846517086,
0.07705052942037582,
0.028806759044528008,
-0.03373575955629349,
-0.027318758890032768,
0.03915301337838173,
0.020378632470965385,
-0.016949255019426346,
-0.03731626272201538,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "check_update_output", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "p... | def parse_check_update(check_update_output):
updates = {}
# remove incorrect new lines in longer columns in output from yum check-update
# yum line wrapping can move the repo to the next line
#
# Meant to filter out sets of lines like:
# some_looooooooooooooooooooooooooooooooooooong_package_na... | |
14,673 | [
-0.006231737323105335,
0.049578048288822174,
0.009479262866079807,
-0.04245606064796448,
-0.005560916382819414,
0.012363165616989136,
0.002539088251069188,
-0.010331894271075726,
-0.023961469531059265,
0.06179074943065643,
0.02733438089489937,
0.001503077568486333,
-0.023046143352985382,
-... | 15 | {"_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": "items", "annotation": null, "type_comment": null}}, {"_type": "... | def latest(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, installroot='/'):
res = {}
res['results'] = []
res['msg'] = ''
res['changed'] = False
res['rc'] = 0
pkgs = {}
pkgs['update'] = []
pkgs['install'] = []
updates = {}
update_all = False
cmd = None
... | |
14,674 | [
-0.0013615932548418641,
-0.02723495475947857,
0.03363591060042381,
-0.05249277874827385,
0.05140535905957222,
0.05649646744132042,
-0.020512714982032776,
0.006845809984952211,
-0.010392284952104092,
-0.014544256962835789,
0.041322000324726105,
0.012338521890342236,
0.010447892360389233,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "shelve_v21", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "plugin", "ctx": {"_type": "Store", "_fields": {}}}}],... | class ShelvePolicyTestV21(test.NoDBTestCase):
plugin = shelve_v21
prefix = 'os_compute_api:os-shelve'
offload = 'shelve_offload'
def setUp(self):
super(ShelvePolicyTestV21, self).setUp()
self.controller = self.plugin.ShelveController()
self.req = fakes.HTTPRequest.blank('')
... | |
14,675 | [
-0.03300488367676735,
0.03559863194823265,
0.017835009843111038,
-0.0403578095138073,
-0.025080854073166847,
0.031077416613698006,
-0.041714172810316086,
0.000629103509709239,
-0.00007245659071486443,
0.05301721394062042,
0.02166614681482315,
-0.05691973865032196,
-0.025532975792884827,
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": "Call", "_fields": {"a... | def main():
# state=installed name=pkgspec
# state=removed name=pkgspec
# state=latest name=pkgspec
#
# informational commands:
# list=installed
# list=updates
# list=available
# list=repos
# list=pkgspec
module = AnsibleModule(
argument_spec=dict(
... | |
14,676 | [
0.02731982059776783,
0.013758894987404346,
0.07112061977386475,
-0.008228115737438202,
0.04246450215578079,
0.0263547170907259,
-0.04642389714717865,
0.0014360536588355899,
-0.03996513411402702,
-0.0202176570892334,
0.04298417270183563,
-0.006452575325965881,
0.019252553582191467,
0.024251... | 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_shelve_offload_restricted_by_role(self):
rules = {'compute_extension:%s%s' % (self.prefix, self.offload):
'role:admin'}
policy.set_rules(oslo_policy.Rules.from_dict(rules))
self.assertRaises(exception.Forbidden,
self.controller._shelve_offload, self... | |
14,677 | [
-0.004578630439937115,
0.013824589550495148,
0.02708640694618225,
-0.04866744950413704,
0.028750251978635788,
0.01334745716303587,
-0.012099574320018291,
0.008270285092294216,
-0.03244496509432793,
-0.0674346312880516,
0.043308891355991364,
0.015268218703567982,
-0.02434595860540867,
-0.03... | 9 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []... | def test_shelve_offload_locked_server(self):
self.stub_out('nova.db.instance_get_by_uuid',
fake_instance_get_by_uuid)
self.stubs.Set(compute_api.API, 'shelve_offload',
fakes.fake_actions_to_locked_server)
self.assertRaises(webob.exc.HTTPConflict,
... | |
14,678 | [
0.004976898897439241,
-0.014971827156841755,
0.06449402868747711,
-0.024995232000947,
0.043535999953746796,
0.02099599502980709,
-0.0304245762526989,
0.011567413806915283,
-0.03994174674153328,
-0.03991643711924553,
0.029184306040406227,
-0.004350435920059681,
0.008011129684746265,
0.00011... | 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_shelve_allowed(self):
rules = {'compute:get': '',
'compute_extension:%sshelve' % self.prefix: ''}
policy.set_rules(oslo_policy.Rules.from_dict(rules))
self.stub_out('nova.db.instance_get_by_uuid',
fake_instance_get_by_uuid)
self.assertRaise... | |
14,679 | [
0.0019221431575715542,
-0.022970952093601227,
0.04129211977124214,
-0.06388401240110397,
0.04743286967277527,
0.07186951488256454,
-0.016463778913021088,
-0.003569468855857849,
-0.013039616867899895,
0.0012690566945821047,
0.05610067769885063,
0.010626276955008507,
0.011776087805628777,
0.... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "shelve_v2", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "plugin", "ctx": {"_type": "Store", "_fields": {}}}}], ... | class ShelvePolicyTestV2(ShelvePolicyTestV21):
plugin = shelve_v2
prefix = ''
offload = 'shelveOffload'
# These 3 cases are covered in ShelvePolicyEnforcementV21
def test_shelve_allowed(self):
rules = {'compute:get': '',
'compute_extension:%sshelve' % self.prefix: ''}
... | |
14,680 | [
0.022154366597533226,
0.000173377018654719,
0.06921660900115967,
-0.025476258248090744,
0.025135228410363197,
0.0211186446249485,
-0.032410550862550735,
-0.007231114432215691,
-0.0316779650747776,
-0.029758088290691376,
0.03382519632577896,
0.008083691820502281,
0.006896399427205324,
0.008... | 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_shelve_offload_allowed(self):
rules = {'compute:get': '',
'compute_extension:%s%s' % (self.prefix, self.offload): ''}
policy.set_rules(oslo_policy.Rules.from_dict(rules))
self.stub_out('nova.db.instance_get_by_uuid',
fake_instance_get_by_uuid)
... | |
14,681 | [
-0.0023213878739625216,
-0.007827861234545708,
0.07608243823051453,
-0.01785188913345337,
0.030566545203328133,
0.03878612071275711,
-0.024889901280403137,
0.017916105687618256,
-0.018956394866108894,
-0.037887103855609894,
0.0258146021515131,
0.0026312272530049086,
0.004106576554477215,
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_unshelve_allowed(self):
rules = {'compute:get': '',
'compute_extension:%sunshelve' % self.prefix: ''}
policy.set_rules(oslo_policy.Rules.from_dict(rules))
self.stub_out('nova.db.instance_get_by_uuid',
fake_instance_get_by_uuid)
self.assert... | |
14,682 | [
0.023776525631546974,
-0.011968630366027355,
0.02556934580206871,
-0.04236004874110222,
0.046860650181770325,
0.05336426571011543,
-0.024209273979067802,
-0.00400293804705143,
-0.01539353746920824,
-0.011381326243281364,
0.045055463910102844,
0.006621075794100761,
-0.002870060270652175,
-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 ShelvePolicyEnforcementV21(test.NoDBTestCase):
def setUp(self):
super(ShelvePolicyEnforcementV21, self).setUp()
self.controller = shelve_v21.ShelveController()
self.req = fakes.HTTPRequest.blank('')
def test_shelve_policy_failed(self):
rule_name = "os_compute_api:os-shelv... | |
14,683 | [
0.02586432546377182,
0.033301811665296555,
0.002945493906736374,
-0.02302759326994419,
0.03387392312288284,
0.024183740839362144,
-0.05182400345802307,
-0.026341088116168976,
-0.0069607216864824295,
-0.047413960099220276,
0.04159746319055557,
-0.03256282955408096,
-0.002482140902429819,
-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_shelve_policy_failed(self):
rule_name = "os_compute_api:os-shelve:shelve"
self.policy.set_rules({rule_name: "project:non_fake"})
exc = self.assertRaises(
exception.PolicyNotAuthorized,
self.controller._shelve, self.req, fakes.FAKE_UUID,
body={'shelve'... | |
14,684 | [
0.018032610416412354,
0.031298257410526276,
0.0047338614240288734,
-0.01752702333033085,
0.023437580093741417,
0.03288724645972252,
-0.056385014206171036,
-0.006662917323410511,
0.005413996521383524,
-0.04059142991900444,
0.04316752031445503,
-0.02995002456009388,
-0.0043937936425209045,
-... | 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_unshelve_policy_failed(self):
rule_name = "os_compute_api:os-shelve:unshelve"
self.policy.set_rules({rule_name: "project:non_fake"})
exc = self.assertRaises(
exception.PolicyNotAuthorized,
self.controller._unshelve, self.req, fakes.FAKE_UUID,
body={'u... | |
14,685 | [
0.02801191806793213,
0.038143374025821686,
0.006347202230244875,
-0.021947482600808144,
0.0183978620916605,
0.026423612609505653,
-0.055061224848032,
-0.027193700894713402,
-0.0034112450666725636,
-0.04464098438620567,
0.05048883333802223,
-0.02233252488076687,
-0.008416811004281044,
-0.03... | 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_shelve_offload_policy_failed(self):
rule_name = "os_compute_api:os-shelve:shelve_offload"
self.policy.set_rules({rule_name: "project:non_fake"})
exc = self.assertRaises(
exception.PolicyNotAuthorized,
self.controller._shelve_offload, self.req, fakes.FAKE_UUID,
... | |
14,686 | [
-0.027975870296359062,
0.02317092940211296,
0.016092577949166298,
-0.023885713890194893,
-0.03530241176486015,
-0.04066329449415207,
0.017611496150493622,
-0.011674812994897366,
0.04225170612335205,
-0.015169315040111542,
0.02211860753595829,
0.01323343999683857,
0.03508400544524193,
-0.02... | 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}}, {"_type": "arg", "_fields": {"arg": "text", "annotation": n... | class MenuButton(Gtk.Button):
def __init__(self, text):
Gtk.Button.__init__(self, text)
self.connect("clicked", self.onClicked)
def set_popup(self, menu):
self.menu = menu
def onClicked(self, widget):
x, y, w, h = self.getScreenCoordinates()
self.menu.popup(None, No... | |
14,687 | [
-0.01062724832445383,
0.0036320644430816174,
0.08940466493368149,
0.02295694500207901,
-0.03964721038937569,
-0.023792503401637077,
0.010689915157854557,
-0.011154694482684135,
-0.033234305679798126,
0.01626203954219818,
-0.003590286709368229,
0.0032691191881895065,
0.012606475502252579,
-... | 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 getScreenCoordinates(self):
parent = self.get_parent_window()
x, y = parent.get_root_origin()
w = parent.get_width()
h = parent.get_height()
extents = parent.get_frame_extents()
allocation = self.get_allocation()
return (x + (extents.width-w)/2 + allocation.x,... | |
14,688 | [
-0.001616010325960815,
0.04731789231300354,
0.018143704161047935,
0.009021914564073086,
-0.032203685492277145,
0.012706140987575054,
-0.02436915785074234,
0.006242099683731794,
-0.021106619387865067,
0.016911929473280907,
0.020218854770064354,
0.03746369481086731,
0.008894299156963825,
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}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class ResizeGrip(Gtk.Widget):
def __init__(self, parent):
Gtk.Widget.__init__(self)
self.parentWindow = parent
def do_realize(self):
self.set_realized(True)
allocation = self.get_allocation()
attr = Gdk.WindowAttr()
attr.window_type = Gdk.WindowType.CHILD
... | |
14,689 | [
0.025960780680179596,
0.050212010741233826,
0.011112093925476074,
0.045034509152173996,
-0.032164014875888824,
-0.021003078669309616,
0.0200994573533535,
0.010495433583855629,
-0.009127791039645672,
0.009939828887581825,
0.032164014875888824,
0.027181891724467278,
0.03162672743201256,
-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 do_realize(self):
self.set_realized(True)
allocation = self.get_allocation()
attr = Gdk.WindowAttr()
attr.window_type = Gdk.WindowType.CHILD
attr.wclass = Gdk.WindowWindowClass.INPUT_OUTPUT
attr.event_mask = self.get_events() | Gdk.EventMask.EXPOSURE_MASK | Gdk.Even... | |
14,690 | [
0.02372927963733673,
0.009633416309952736,
0.03937891870737076,
-0.028564633801579475,
-0.0060690524987876415,
0.0199132040143013,
-0.017041824758052826,
0.0024207844398915768,
-0.02483556978404522,
0.01218782551586628,
0.0031370753422379494,
-0.009453178383409977,
-0.00012177725875517353,
... | 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 CommandLine(Gtk.Entry):
def __init__(self):
Gtk.Entry.__init__(self)
self.settings = Gio.Settings.new("org.cinnamon")
self.history = self.settings.get_strv("looking-glass-history")
self.historyPosition = -1
self.lastText = ""
self.connect('key-press-event', self... | |
14,691 | [
0.024521976709365845,
0.002708617364987731,
0.03902295231819153,
0.011300151236355305,
-0.011930884793400764,
0.01394687406718731,
0.0319964624941349,
0.0077043804340064526,
-0.0031359835993498564,
0.012874037958681583,
-0.01526728831231594,
-0.006372177042067051,
0.010486681945621967,
-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):
Gtk.Entry.__init__(self)
self.settings = Gio.Settings.new("org.cinnamon")
self.history = self.settings.get_strv("looking-glass-history")
self.historyPosition = -1
self.lastText = ""
self.connect('key-press-event', self.onKeyPress)
self.connect(... | |
14,692 | [
0.04991862177848816,
-0.011386504396796227,
0.04911500960588455,
-0.006818902678787708,
-0.011752857826650143,
-0.005415532272309065,
0.006913445424288511,
0.0346263162791729,
-0.014441419392824173,
0.037533510476350784,
0.006340279709547758,
-0.007096622604876757,
-0.04105523228645325,
-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 historyPrev(self):
num = len(self.history)
if self.historyPosition == 0 or num == 0:
return
if self.historyPosition == -1:
self.historyPosition = num - 1
self.lastText = self.get_text()
else:
self.historyPosition -= 1
self.set_t... | |
14,693 | [
0.030140621587634087,
0.032929353415966034,
0.004166366532444954,
0.006759887561202049,
-0.01906377635896206,
0.04540056362748146,
-0.02033543772995472,
0.046761468052864075,
0.004871915560215712,
0.030698368325829506,
0.003499859245494008,
0.008360619656741619,
-0.010775662027299404,
-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}}, {"_type": "arg", "_fields": {"arg": "widget", "annotation": null, "type_comment": null}}, {"_type": "a... | def onKeyPress(self, widget, event):
if event.keyval == Gdk.KEY_Up:
self.historyPrev()
return True
if event.keyval == Gdk.KEY_Down:
self.historyNext()
return True
if event.keyval == Gdk.KEY_Return:
self.execute()
return True | |
14,694 | [
0.03519393503665924,
0.013373695313930511,
0.04303715378046036,
-0.006092949770390987,
0.007478711195290089,
0.0317750945687294,
-0.013838757760822773,
0.015233946032822132,
-0.006416608579456806,
0.027300437912344933,
0.00461291940882802,
-0.027124468237161636,
0.020022835582494736,
-0.02... | 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 execute(self):
self.historyPosition = -1
command = self.get_text()
if command != "":
num = len(self.history)
if num == 0 or self.history[num-1] != command:
self.history.append(command)
self.set_text("")
self.settings.set_strv("l... | |
14,695 | [
0.054716166108846664,
-0.01123803947120905,
0.0678291767835617,
0.0016479706391692162,
-0.003063043812289834,
0.012853581458330154,
0.005397914908826351,
0.03198065608739853,
-0.01357291080057621,
0.03445703163743019,
-0.0027166458312422037,
0.0006378885009326041,
-0.04315973445773125,
-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 historyNext(self):
if self.historyPosition == -1:
return
num = len(self.history)
if self.historyPosition == num-1:
self.historyPosition = -1
self.set_text(self.lastText)
else:
self.historyPosition += 1
self.set_text(self.his... | |
14,696 | [
0.006348293274641037,
0.033343471586704254,
-0.03286558762192726,
-0.03134503588080406,
-0.03447302430868149,
-0.027456775307655334,
0.016530543565750122,
-0.02218915894627571,
0.0031605702824890614,
0.030041709542274475,
0.01694326288998127,
-0.018311757594347,
0.028347382321953773,
-0.00... | 10 | {"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu... | def __init__(self, parent):
Gtk.Dialog.__init__(self, "Add a new file watcher", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(150, 100)
label = Gtk.Label("")
label.set_markup("<span size='large'... | |
14,697 | [
0.017034463584423065,
0.025046436116099358,
-0.0542311854660511,
-0.05702214315533638,
-0.012535247951745987,
-0.018514152616262436,
0.00576837919652462,
-0.008186407387256622,
0.01095330435782671,
0.024541174992918968,
0.0008060092222876847,
-0.02073969878256321,
0.011025483720004559,
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}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation":... | class NewLogDialog(Gtk.Dialog):
def __init__(self, parent):
Gtk.Dialog.__init__(self, "Add a new file watcher", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(150, 100)
label = Gtk.Label("")
... | |
14,698 | [
0.04842330142855644,
0.015499355271458626,
-0.0008697063312865794,
-0.017205258831381798,
0.003582398174330592,
0.022822557017207146,
0.051323335617780685,
0.03806602582335472,
-0.010735009796917439,
0.0628260001540184,
0.00014536357775796205,
0.02329777367413044,
0.03331386670470238,
0.02... | 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": "combo", "annotation": null, "type_comment": null}}], "kwarg": nul... | def onComboChanged(self, combo):
tree_iter = combo.get_active_iter()
if tree_iter != None:
model = combo.get_model()
name, self.filename = model[tree_iter][:2]
self.entry.set_text(name)
if name == "custom":
newFile = self.selectFile()
... | |
14,699 | [
0.03123767301440239,
0.033840812742710114,
-0.006153821479529142,
-0.058227021247148514,
0.027135126292705536,
-0.017940837889909744,
-0.004854855127632618,
0.028405457735061646,
0.014671294018626213,
0.028384631499648094,
-0.0110268983989954,
-0.024802712723612785,
0.032237280160188675,
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 selectFile(self):
dialog = Gtk.FileChooserDialog("Please select a log file", self,
Gtk.FileChooserAction.OPEN,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
filter_text = Gtk.FileFilter()
filter_text.set_name("Text fil... | |
14,700 | [
0.00037149680429138243,
0.07117228209972382,
-0.005077007692307234,
-0.057611435651779175,
-0.033924270421266556,
-0.0014776779571548104,
0.044250015169382095,
-0.05783301591873169,
-0.029559098184108734,
0.03029032051563263,
0.026013778522610664,
-0.00010187598672928289,
0.01433638390153646... | 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": "filename", "annotation... | class FileWatcherView(Gtk.ScrolledWindow):
def __init__(self, filename):
Gtk.ScrolledWindow.__init__(self)
self.filename = filename
self.changed = 0
self.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
se... |