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,901
[ 0.031065303832292557, 0.026326527819037437, 0.007604776881635189, -0.007796242367476225, -0.004601159133017063, -0.01925426535308361, 0.040159922093153, 0.005869619082659483, 0.005420871544629335, 0.004717833362519741, 0.02706845849752426, 0.034822817891836166, 0.0005964604206383228, -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 testAugmentVolumeWithNullInput(self): in_data = { 'config': { 'User': 'mattmoor', 'WorkingDir': '/usr/home/mattmoor', 'Volumes': None, } } volume = '/data' expected = self.base_expected.copy() expected.update({ 'config': { '...
21,902
[ 0.026896564289927483, 0.028518976643681526, 0.003716973355039954, -0.00973447784781456, -0.017631065100431442, -0.005019339732825756, 0.0267191119492054, -0.03107934631407261, -0.03581983596086502, 0.020432261750102043, 0.029254132881760597, 0.02495727315545082, 0.003989487886428833, -0.02...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testAugmentLabel(self): in_data = { 'config': { 'User': 'mattmoor', 'WorkingDir': '/usr/home/mattmoor', 'Label': [ 'baz=blah', 'blah=still around', ], } } labels = {'baz': 'replacement', 'foo': ...
21,903
[ 0.01937831938266754, -0.0020055840723216534, 0.00715894578024745, -0.008687866851687431, 0.0210211593657732, 0.0025062307249754667, 0.05396190285682678, -0.00033239033655263484, -0.011314013041555882, 0.012189394794404507, 0.023671288043260574, 0.0227839145809412, 0.020889252424240112, -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 testSetWorkingDir(self): in_data = { 'config': { 'User': 'bleh', 'WorkingDir': '/home/bleh', 'Volumes': { } } } workdir = '/some/path' expected = self.base_expected.copy() expected.update({ 'config': { 'User': 'b...
21,904
[ 0.03494660183787346, -0.019988128915429115, 0.034211136400699615, -0.03701065853238106, 0.03765122964978218, -0.003232501447200775, -0.0024688600096851587, 0.0013916067546233535, -0.03561089560389519, 0.03449583053588867, 0.011720041744410992, 0.00972122885286808, -0.02967970073223114, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def testLayersAddedToDiffIds(self): initial_diff_ids = [ 'sha256:1', 'sha256:2', ] in_data = { 'rootfs': { 'type': 'layers', 'diff_ids': initial_diff_ids, } } layers = ['3', '4'] expected = self.base_expected.copy() expected.update({ ...
21,905
[ 0.043034203350543976, -0.0003297720104455948, 0.017727090045809746, -0.016383027657866478, -0.005336895119398832, -0.019095368683338165, 0.00499179819598794, -0.007689003832638264, -0.024447400122880936, 0.014433532021939754, 0.023878293111920357, 0.011182354763150215, 0.003932289779186249, ...
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 testHistoryAdded(self): in_data = self.base_expected.copy() expected = self.base_expected.copy() expected.update({ 'history': [ { 'author': 'Bazel', 'created': '0001-01-01T00:00:00Z', 'created_by': 'bazel build ...' }, { ...
21,906
[ -0.030377302318811417, 0.04114394262433052, 0.001812346512451768, -0.025242792442440987, -0.032752297818660736, -0.011292530223727226, -0.0018604118376970291, -0.04293084144592285, -0.014928532764315605, 0.007373790256679058, -0.03474276885390282, -0.0842331126332283, 0.004979005083441734, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "Model", "value": {"_type": "Name", "_fields": {"id": "models", "ctx": {"_type": "Load", "_fields": {}}}}}}, "t...
class UIOptions(Options): model_class = models.Model meta_class_name = 'UIMeta' meta_name = '_ui_meta' attributes = { 'extra_selecbox_fields': {}, 'list_verbose_name': '%(verbose_name_plural)s', 'add_verbose_name': _('add %(verbose_name)s'), 'add_button_verbose_name': _(...
21,907
[ 0.004394981078803539, -0.009872982278466225, -0.000025682402338134125, -0.019330259412527084, 0.019691266119480133, -0.018247239291667938, 0.02273247204720974, 0.04108910635113716, 0.03931689262390137, 0.023410726338624954, 0.02933998592197895, -0.003995685838162899, -0.022119855508208275, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": n...
def process_request(self, request): # AuthenticationMiddleware is required so that request.user exists. if not hasattr(request, 'user'): raise ImproperlyConfigured( "The django-webtest auth middleware requires the " "'django.contrib.auth.middleware.Authenticat...
21,908
[ 0.029623739421367645, 0.025515006855130196, -0.0026190336793661118, -0.04208613932132721, 0.004066170193254948, -0.011560068465769291, 0.0010803868062794209, -0.038317907601594925, -0.03981612250208855, 0.06519492715597153, 0.004239259287714958, -0.02871573157608509, 0.0030701998621225357, ...
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": "cls", "annotation": null, "type_comment": null}}], "kwarg": null,...
def __init__(self, cls): self.cls = cls self.desc = cls.__doc__ self.class_name = cls.__name__ self.class_fqn = '{}.{}'.format(inspect.getmodule(cls).__name__, self.class_name) self.version = getattr(cls, 'VERSION', None) self.ci_wi...
21,909
[ -0.028221381828188896, 0.0030770120210945606, 0.006139001809060574, 0.00011023977276636288, 0.012328077107667923, -0.049432482570409775, 0.02315395139157772, 0.007681263145059347, -0.0343303382396698, 0.04554678499698639, -0.007490984164178371, -0.00579850235953927, -0.000218914748984389, ...
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": "address", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, address=None, type=None, **kwargs): super(IP, self).__init__() self['address'] = address self['type'] = type self['version'] = kwargs.pop('version', None) self._set_meta(kwargs) # determine version from address if not passed in if self['addre...
21,910
[ 0.006321887951344252, -0.018116751685738564, -0.003840072313323617, -0.008499094285070896, 0.011325467377901077, -0.03271801769733429, 0.052212998270988464, 0.009018427692353725, -0.031899068504571915, 0.08668876439332962, -0.013322903774678707, -0.07234716415405273, -0.010276813060045242, ...
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": "cidr", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, cidr=None, gateway=None, interface=None, **kwargs): super(Route, self).__init__() self['cidr'] = cidr self['gateway'] = gateway self['interface'] = interface self._set_meta(kwargs)
21,911
[ -0.0019870304968208075, 0.011982356198132038, 0.005321422126144171, -0.015038118697702885, 0.03233666345477104, -0.01647181622684002, 0.06785467267036438, 0.010339360684156418, -0.02905067428946495, 0.08020330220460892, -0.02104499377310276, -0.04491552338004112, 0.01009866688400507, -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}}, {"_type": "arg", "_fields": {"arg": "cidr", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__(self, cidr=None, dns=None, gateway=None, ips=None, routes=None, **kwargs): super(Subnet, self).__init__() self['cidr'] = cidr self['dns'] = dns or [] self['gateway'] = gateway self['ips'] = ips or [] self['routes'] = routes or [] sel...
21,912
[ 0.009342391043901443, 0.0037144129164516926, 0.005184974521398544, -0.012477491050958633, 0.01327437348663807, -0.02464042417705059, 0.049993846565485, 0.015885209664702415, -0.0601436048746109, 0.0794365331530571, -0.01740557700395584, -0.011051492765545845, -0.01195322722196579, -0.00759...
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": "id", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, id=None, bridge=None, label=None, subnets=None, **kwargs): super(Network, self).__init__() self['id'] = id self['bridge'] = bridge self['label'] = label self['subnets'] = subnets or [] self._set_meta(kwargs)
21,913
[ 0.011412357911467552, 0.015148445963859558, 0.015001042746007442, -0.014173321425914764, -0.022212428972125053, -0.018980911001563072, 0.01767696626484394, -0.00814682524651289, -0.026691198348999023, 0.06866690516471863, 0.021634157747030258, 0.01776767522096634, 0.039639946073293686, -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": "id", "annotation": null, "type_comment": null}}, {"_type": "arg",...
def __init__(self, id=None, address=None, network=None, type=None, details=None, devname=None, ovs_interfaceid=None, qbh_params=None, qbg_params=None, active=False, vnic_type=VNIC_TYPE_NORMAL, profile=None, preserve_on_delete=False, **kwargs): ...
21,914
[ -0.02599257044494152, -0.015332966111600399, 0.011990548111498356, -0.01783827506005764, -0.027341581881046295, 0.05280418321490288, -0.0021304150577634573, 0.021271027624607086, 0.01293606124818325, -0.005621886812150478, 0.0210542231798172, 0.016055651009082794, 0.012707211077213287, -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": "async_method", "annotation": null, "type_comment": null}}], "kwar...
def __init__(self, async_method, *args, **kwargs): self._gt = eventlet.spawn(async_method, *args, **kwargs) methods = ['json', 'fixed_ips', 'floating_ips'] for method in methods: fn = getattr(self, method) wrapper = functools.partial(self._sync_wrapper, fn) fu...
21,915
[ 0.01955338753759861, 0.009655695408582687, 0.07066323608160019, 0.007066323421895504, -0.021416768431663513, -0.01128917746245861, -0.00773181626573205, -0.017060814425349236, 0.027345703914761543, -0.0000777038439991884, -0.01715761423110962, -0.034049030393362045, 0.017629509791731834, -...
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": "orm", "annotation": null, "type_comment": null}}], "kwarg": null,...
def backwards(self, orm): # Adding model 'HistoricalDataPoint' db.create_table(u'datapoints_historicaldatapoint', ( ('region_id', self.gf('django.db.models.fields.IntegerField')(blank=True, null=True, db_index=True)), ('source_guid', self.gf('django.db.models.fields.CharField')(m...
21,916
[ 0.005129415076225996, 0.013355705887079239, 0.07591808587312698, -0.021918464452028275, -0.031971294432878494, -0.030405689030885696, 0.0010720614809542894, -0.055730029940605164, 0.0058092172257602215, -0.00009296850475948304, 0.008047756738960743, -0.06581032276153564, -0.01299863774329423...
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": "orm", "annotation": nu...
class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'HistoricalDataPoint' db.delete_table(u'datapoints_historicaldatapoint') def backwards(self, orm): # Adding model 'HistoricalDataPoint' db.create_table(u'datapoints_historicaldatapoint', ( ...
21,917
[ 0.03479645773768425, -0.016701415181159973, 0.03355767950415611, -0.059638429433107376, 0.006763520184904337, -0.004601184744387865, 0.0211698729544878, 0.015573239885270596, -0.012752802111208439, -0.014135370030999184, 0.03601311892271042, -0.01863700896501541, -0.010264180600643158, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "v...
def run(self, **kwargs): data1 = copy.deepcopy(kwargs[self.data1]) data2 = copy.deepcopy(kwargs[self.data2]) data2[self.resources_name].update( data1[self.resources_name] ) return { self.result: data2 }
21,918
[ 0.03869621083140373, 0.015699487179517746, -0.007114807143807411, -0.007104382384568453, 0.036569587886333466, -0.018660079687833786, 0.05041348934173584, -0.001806066487915814, -0.012353181838989258, 0.0021618069149553776, 0.009939881041646004, -0.026561947539448738, -0.022850779816508293, ...
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": "init", "annotation": n...
class Merge(action.Action): def __init__(self, init, data1, data2, result, resources_name): self.data1 = data1 self.data2 = data2 self.result = result self.resources_name = resources_name super(Merge, self).__init__(init) def run(self, **kwargs): data1 = copy.de...
21,919
[ 0.08398107439279556, 0.03916884958744049, -0.013869311660528183, 0.0033328195568174124, 0.04827955365180969, 0.01657143607735634, 0.022908277809619904, 0.028073400259017944, 0.03151681646704674, 0.016583392396569252, 0.043257907032966614, -0.06336840987205505, -0.048829544335603714, -0.008...
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 _next(self): with self._condition: while True: if self._values: return self._values.pop(0) elif not self._open: raise StopIteration() else: self._condition.wait()
21,920
[ 0.05664629489183426, 0.05026361346244812, -0.04618057608604431, 0.01210832130163908, 0.04040800407528877, 0.03930511325597763, 0.011380883865058422, 0.012929622083902359, 0.014677819795906544, 0.018842989578843117, 0.03226539120078087, -0.042285263538360596, -0.022679636254906654, 0.025671...
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 _Pipe(object): def __init__(self): self._condition = threading.Condition() self._values = [] self._open = True def __iter__(self): return self def _next(self): with self._condition: while True: if self._values: ...
21,921
[ 0.017013074830174446, 0.006913601420819759, -0.010654388926923275, -0.014832580462098122, -0.006750390864908695, 0.000996400834992528, 0.012625972740352154, 0.004236947745084763, 0.07228271663188934, 0.017809541895985603, 0.056666724383831024, -0.06632879376411438, -0.019546102732419968, 0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_stream_stream(stub): request_pipe = _Pipe() response_iterator = stub.StreStre(iter(request_pipe)) request_pipe.add(_application_common.STREAM_STREAM_REQUEST) first_responses = next(response_iterator), next(response_iterator), request_pipe.add(_application_common.STREAM_STREAM_REQUEST) s...
21,922
[ -0.012618724256753922, 0.03507022187113762, -0.015480312518775463, -0.027506548911333084, -0.0008934586076065898, -0.029901711270213127, 0.02783430926501751, 0.0013780063018202782, 0.07422482222318649, 0.0033311666920781136, 0.033154089003801346, -0.05607201159000397, 0.022489314898848534, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_stream_unary(stub): response, call = stub.StreUn.with_call( iter((_application_common.STREAM_UNARY_REQUEST,) * 3)) if (_application_common.STREAM_UNARY_RESPONSE == response and call.code() is grpc.StatusCode.OK): return _SATISFACTORY_OUTCOME else: return _UNSATIS...
21,923
[ -0.0018441944848746061, -0.007408465258777142, 0.0010044839000329375, -0.021293792873620987, -0.015564748086035252, -0.01503240317106247, 0.04469161480665207, 0.013612817041575909, 0.0746803730726242, 0.005351966246962547, 0.021864160895347595, -0.03891187161207199, 0.010779982432723045, -...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_concurrent_stream_unary(stub): future_calls = tuple( stub.StreUn.future( iter((_application_common.STREAM_UNARY_REQUEST,) * 3)) for _ in range(test_constants.THREAD_CONCURRENCY)) for future_call in future_calls: if future_call.code() is grpc.StatusCode.OK: ...
21,924
[ 0.03475857153534889, 0.0038334790151566267, 0.007088919170200825, -0.0014736821176484227, -0.0017738178139552474, 0.03493642807006836, 0.02731393463909626, 0.014368400909006596, 0.047310277819633484, -0.009559877216815948, 0.045328427106142044, -0.00835933443158865, -0.0037191417068243027, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_concurrent_stream_stream(stub): condition = threading.Condition() outcomes = [None] * test_constants.RPC_CONCURRENCY def run_stream_stream(index): outcome = _run_stream_stream(stub) with condition: outcomes[index] = outcome condition.notify() for index ...
21,925
[ 0.00777222728356719, 0.005562057252973318, -0.008364454843103886, -0.006624404340982437, 0.021393468603491783, -0.01849948801100254, 0.0006670195143669844, 0.03309149295091629, 0.03262748196721077, 0.009915237314999104, 0.04842836409807205, -0.06276394426822662, -0.02596033737063408, -0.02...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_infinite_request_stream(stub): def infinite_request_iterator(): while True: yield _application_common.STREAM_UNARY_REQUEST response_future_call = stub.StreUn.future( infinite_request_iterator(), timeout=_application_common.INFINITE_REQUEST_STREAM_TIMEOUT) if re...
21,926
[ -0.025891359895467758, 0.018438167870044708, -0.004521561786532402, -0.007189251482486725, -0.029561398550868034, -0.0035066455602645874, 0.02860618382692337, 0.023842675611376762, 0.077472984790802, 0.02667061612010002, 0.03235163167119026, -0.07546200603246689, 0.02023548074066639, -0.00...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "stub", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def _run_cancel_unary_unary(stub): response_future_call = stub.UnUn.future( _application_common.UNARY_UNARY_REQUEST) initial_metadata = response_future_call.initial_metadata() cancelled = response_future_call.cancel() if initial_metadata is not None and cancelled: return _SATISFACTORY_OU...
21,927
[ 0.0512889102101326, 0.024495292454957962, 0.05099859461188316, -0.014431053772568703, 0.0003298170049674809, 0.05530492588877678, 0.019886547699570656, -0.03423292562365532, 0.012568201869726181, -0.009078378789126873, 0.02188246138393879, -0.04741804674267769, 0.00004937804988003336, 0.04...
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_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_int)] class Z(X): pass self.assertEqual(sizeof(X), sizeof(c_int)) self.assertEqual(sizeof(Y), sizeof(c_int)*2) self.assertEqual(si...
21,928
[ 0.03794627636671066, 0.02436230331659317, 0.049051932990550995, -0.04119614139199257, -0.016658484935760498, 0.06527788192033768, 0.035117257386446, -0.023555682972073555, 0.007423254661262035, -0.00718945125117898, 0.013911296613514423, -0.042037833482027054, -0.00799022801220417, 0.02648...
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 SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_int)] class Z(X): pass self.assertEqual(sizeof(X), sizeof(c_int)) self.assertEqual(sizeof(Y),...
21,929
[ 0.07405365258455276, 0.03271497040987015, 0.04818250611424446, -0.01762346550822258, -0.014828279614448547, 0.0785660669207573, 0.019679119810461998, -0.04449737071990967, -0.0009157998138107359, -0.013762849383056164, 0.014765607193112373, -0.037427932024002075, -0.002065054140985012, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_subclass_delayed(self): class X(Structure): pass self.assertEqual(sizeof(X), 0) X._fields_ = [("a", c_int)] class Y(X): pass self.assertEqual(sizeof(Y), sizeof(X)) Y._fields_ = [("b", c_int)] class Z(X): pass ...
21,930
[ 0.034050773829221725, 0.015493867918848991, 0.08688817918300629, -0.0136305196210742, -0.00252222060225904, 0.0411723367869854, 0.010803590528666973, -0.0823446735739708, -0.005688955076038837, -0.011945849284529686, 0.011760789901018143, -0.04724736511707306, 0.015059937722980976, 0.04882...
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_struct_alignment(self): class X(Structure): _fields_ = [("x", c_char * 3)] self.assertEqual(alignment(X), calcsize("s")) self.assertEqual(sizeof(X), calcsize("3s")) class Y(Structure): _fields_ = [("x", c_char * 3), ("y", c_int)] ...
21,931
[ 0.02923138439655304, 0.028048885986208916, 0.05699646845459938, -0.02202996425330639, 0.0032193546649068594, 0.04453292489051819, 0.004839378874748945, -0.024666937068104744, -0.0019659053068608046, -0.007136383559554815, 0.010181319899857044, -0.05283407121896744, 0.011085931211709976, 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_fields(self): # test the offset and size attributes of Structure/Unoin fields. class X(Structure): _fields_ = [("x", c_int), ("y", c_char)] self.assertEqual(X.x.offset, 0) self.assertEqual(X.x.size, sizeof(c_int)) self.assertEqual(X....
21,932
[ 0.02003069594502449, 0.005085463169962168, 0.07581845670938492, 0.021625373512506485, 0.009859769605100155, 0.037390634417533875, 0.05022583529353142, -0.024905480444431305, 0.006787099875509739, 0.017748882994055748, 0.013729778118431568, -0.05476353317499161, 0.026733525097370148, 0.0158...
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_emtpy(self): # I had problems with these # # Although these are patological cases: Empty Structures! class X(Structure): _fields_ = [] class Y(Union): _fields_ = [] # Is this really the correct alignment, or should it be 0? self....
21,933
[ 0.027079937979578972, -0.004850138444453478, 0.050831351429224014, -0.009729995392262936, 0.0030788867734372616, 0.01126943901181221, 0.03247690573334694, -0.010056904517114162, 0.0017459903610870242, -0.023061932995915413, 0.044602252542972565, -0.054350078105926514, 0.017296448349952698, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test(self): # a Structure with a POINTER field class S(Structure): _fields_ = [("array", POINTER(c_int))] s = S() # We can assign arrays of the correct type s.array = (c_int * 3)(1, 2, 3) items = [s.array[i] for i in range(3)] self.assertEqual(ite...
21,934
[ 0.02104145474731922, -0.02807675488293171, 0.041481416672468185, -0.0168202742934227, -0.03527316823601723, 0.0034773715306073427, 0.007099745329469442, 0.015971742570400238, 0.035874661058187485, -0.04300662875175476, 0.01437134575098753, -0.04915042966604233, 0.010961105115711689, -0.032...
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 PointerMemberTestCase(unittest.TestCase): def test(self): # a Structure with a POINTER field class S(Structure): _fields_ = [("array", POINTER(c_int))] s = S() # We can assign arrays of the correct type s.array = (c_int * 3)(1, 2, 3) items = [s.arr...
21,935
[ 0.07200735807418823, 0.002995844464749098, 0.03433307632803917, 0.00022221187828108668, 0.0019302984001114964, 0.005798927042633295, 0.0024001561105251312, 0.012411738745868206, 0.029856709763407707, -0.06571046262979507, 0.019040614366531372, -0.017809078097343445, 0.03163440525531769, -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_none_to_pointer_fields(self): class S(Structure): _fields_ = [("x", c_int), ("p", POINTER(c_int))] s = S() s.x = 12345678 s.p = None self.assertEqual(s.x, 12345678)
21,936
[ 0.00885487999767065, 0.0027903432492166758, 0.05211305245757103, -0.027107007801532745, 0.03306735306978226, 0.0335925929248333, 0.011098572984337807, 0.005086845718324184, -0.011047190986573696, -0.01210338156670332, 0.0022907934617251158, -0.06175008416175842, 0.0136905238032341, 0.01939...
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 TestRecursiveStructure(unittest.TestCase): def test_contains_itself(self): class Recursive(Structure): pass try: Recursive._fields_ = [("next", Recursive)] except AttributeError as details: self.assertTrue("Structure or union cannot contain itself" ...
21,937
[ 0.011797640472650528, 0.026316054165363312, 0.042572107166051865, -0.009505560621619225, 0.04655038192868233, 0.029105419293045998, 0.006744774989783764, 0.015604437328875065, -0.01891966536641121, -0.005101450718939304, 0.019571280106902122, -0.07819366455078125, 0.0016304636374115944, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_contains_itself(self): class Recursive(Structure): pass try: Recursive._fields_ = [("next", Recursive)] except AttributeError as details: self.assertTrue("Structure or union cannot contain itself" in str(details)) ...
21,938
[ 0.017905350774526596, 0.0005239666206762195, 0.04266596585512161, -0.00343381823040545, 0.022137301042675972, 0.049026262015104294, -0.007486342452466488, -0.039374448359012604, 0.0076348320581018925, -0.0005711429985240102, 0.040141645818948746, -0.04533877596259117, 0.01404462568461895, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_vice_versa(self): class First(Structure): pass class Second(Structure): pass First._fields_ = [("second", Second)] try: Second._fields_ = [("first", First)] except AttributeError as details: self.assertTrue("_fields_ is f...
21,939
[ 0.024997664615511894, 0.07085137069225311, 0.04918179661035538, 0.00799974612891674, 0.03374931216239929, -0.0033126836642622948, 0.021065587177872658, -0.04782590642571449, -0.024319719523191452, 0.003251052228733897, 0.003046128200367093, -0.029040679335594177, -0.005519085098057985, 0.0...
19
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "fileName", "annotation...
class Mesh: def __init__(self, fileName): self.doc = Collada.DaeDocument() self.doc.LoadDocumentFromFile(fileName) self.geoms = {} self.fullGeoms = {} def _unflatten(self, array, stride): return [tuple(array[i * stride : (i + 1) * stride]) for i in range(len(array) / str...
21,940
[ 0.043235424906015396, 0.04318738356232643, -0.015204457566142082, 0.007055781316012144, 0.07085805386304855, -0.005440457724034786, 0.04217856004834175, -0.03699030727148056, 0.002490540500730276, -0.042466793209314346, 0.003960244823247194, -0.009589857421815395, 0.0024710246361792088, 0....
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "material", "annotation": null, "type_comment": null}}], "kwarg": ...
def setupMaterial(self, material): for m in material.techniqueCommon.iMaterials: if m.object: for fx in m.object.iEffects: if fx.object: shader = fx.object.profileCommon.technique.shader if isinstance(shader, Collada...
21,941
[ 0.009542963467538357, 0.06386356800794601, 0.010828692466020584, -0.004222904331982136, -0.00960582122206688, -0.010657262057065964, -0.004842911381274462, -0.052160583436489105, -0.033600375056266785, 0.012880143709480762, -0.015017310157418251, -0.031497493386268616, -0.017223048955202103,...
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": "geomName", "annotation": null, "type_comment": null}}], "kwarg": ...
def find(self, geomName = None): found = False if self.geoms: # render geometry for scene in self.doc.visualScenesLibrary.items: for node in scene.nodes: if geomName is not None and node.name != geomName: continue ...
21,942
[ 0.0025457534939050674, 0.04766243323683739, 0.07131330668926239, 0.0039160484448075294, -0.0048596360720694065, -0.006476294249296188, 0.018588349223136902, -0.03161178529262543, -0.023058312013745308, 0.03735704347491264, -0.0006577737512998283, -0.02180878259241581, -0.014427547343075275, ...
18
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "geomName", "annotation": null, "type_comment": null}}], "kwarg": ...
def render(self, geomName = None): if geomName in self.fullGeoms: self.fullGeoms[geomName]() return # Prepare a new list for all the geometry if not self.geoms: for geom in self.doc.geometriesLibrary.items: self.geoms[geom.name] = cmgl.List() ...
21,943
[ 0.021322010084986687, -0.008878364227712154, 0.006352472584694624, -0.012066214345395565, -0.02216978184878826, 0.01844191364943981, -0.008048013783991337, 0.006869264412671328, 0.022251073271036148, 0.0026565412990748882, -0.014748885296285152, -0.02002132125198841, 0.0005425586714409292, ...
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 OptionParser(self): if self._optparse is None: try: me = 'xrepo %s' % self.NAME usage = self.helpUsage.strip().replace('%prog', me) except AttributeError: usage = 'xrepo %s' % self.NAME self._optparse = optparse.OptionParser(usage = usage) self._Options(self._optp...
21,944
[ -0.02312227338552475, 0.002082750666886568, 0.007688716985285282, -0.015053173527121544, -0.0018208477413281798, -0.00046300666872411966, 0.018308250233530998, 0.04290216788649559, -0.000516790256369859, 0.056870315223932266, 0.008948344737291336, -0.06270700693130493, 0.012440381571650505, ...
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": "terms", "annotation": null, "type_comment": null}}, {"_type": "ar...
def run(self, terms, variables=None, **kwargs): terms = self._lookup_variables(terms) my_list = terms[:] if len(my_list) == 0: raise AnsibleError("with_cartesian requires at least one element in each list") return [self._flatten(x) for x in product(*my_list, fillvalue=None...
21,945
[ 0.051146991550922394, 0.01064087450504303, 0.0027321164961904287, -0.0328960083425045, 0.007659881375730038, 0.020595954731106758, -0.020330486819148064, 0.008212941698729992, 0.02296305261552334, 0.013538909144699574, 0.007936411537230015, -0.021834809333086014, 0.02246529795229435, -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": "context", "annotation": null, "type_comment": null}}], "kwarg": {...
def decorated_function(self, context, *args, **kwargs): try: return function(self, context, *args, **kwargs) except Exception as ex: with excutils.save_and_reraise_exception(): wrapped_func = safe_utils.get_wrapped_function(function) keyed_args = i...
21,946
[ 0.03812117129564285, 0.030196262523531914, 0.09475526958703995, -0.03313857316970825, 0.010480636730790138, -0.020155897364020348, 0.01741761714220047, 0.016397472470998764, -0.04258832708001137, -0.006512813735753298, -0.021648529917001724, 0.0063248928636312485, 0.010539698414504528, 0.0...
11
{"_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 = [ ("migrations", "0001_initial"), ] operations = [ migrations.CreateModel( "Book", [ ("id", models.AutoField(primary_key=True)), ("author", models.ForeignKey("migrations.Author", ...
21,947
[ 0.038037702441215515, -0.006563005968928337, -0.02287808433175087, -0.028886469081044197, -0.014963191002607346, 0.009064573794603348, -0.02005876414477825, 0.04464692622423172, 0.010445347055792809, 0.035056617110967636, 0.022069262340664864, -0.002748547587543726, 0.013160674832761288, -...
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": "context", "annotation": null, "type_comment": null}}], "kwarg": {...
def decorated_function(self, context, *args, **kwargs): try: return function(self, context, *args, **kwargs) except exception.UnexpectedTaskStateError as e: # Note(maoy): unexpected task state means the current # task is preempted. Do not clear task state in this ...
21,948
[ 0.029598049819469452, -0.012479606084525585, -0.03679390624165535, -0.02699577435851097, 0.039124637842178345, -0.0019106920808553696, -0.026203777641057968, 0.027312573045492172, -0.022334307432174683, 0.03360328823328018, 0.010488299652934074, -0.02733520232141018, 0.014459597878158092, ...
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": "context", "annotation": null, "type_comment": null}}], "kwarg": {...
def decorated_function(self, context, *args, **kwargs): try: return function(self, context, *args, **kwargs) except exception.InstanceNotFound: raise except Exception as e: # NOTE(gtt): If argument 'instance' is in args rather than kwargs, # we wil...
21,949
[ 0.062128178775310516, 0.027084896340966225, -0.0211161058396101, -0.03660418093204498, 0.014608696103096008, 0.0025185986887663603, 0.020665423944592476, 0.02323761023581028, -0.03000883385539055, 0.02345745451748371, -0.0017931102775037289, -0.02840396575629711, 0.0009961724281311035, -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": "context", "annotation": null, "type_comment": null}}], "kwarg": {...
def decorated_function(self, context, *args, **kwargs): def _load_instance(instance_or_dict): if isinstance(instance_or_dict, dict): # try to get metadata and system_metadata for most cases but # only attempt to load those if the db instance already has ...
21,950
[ 0.06855741888284683, 0.0008697096491232514, -0.04641612246632576, -0.061635300517082214, -0.03299859166145325, 0.00020853770547546446, 0.011615883558988571, 0.033970534801483154, 0.006821368355304003, 0.02797294408082962, 0.04513600468635559, -0.04798071086406708, -0.011503281071782112, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def decorated_function(self, context, image_id, instance, *args, **kwargs): try: return function(self, context, image_id, instance, *args, **kwargs) except Exception: with excutils.save_and_reraise_exception(): ...
21,951
[ 0.012977058999240398, 0.018527420237660408, 0.015044399537146091, 0.0051880148239433765, -0.05775072053074837, 0.02669566310942173, -0.028560765087604523, 0.02119024470448494, 0.027661921456456184, -0.010359175503253937, 0.012370339594781399, -0.019785800948739052, -0.03534703701734543, -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 cancel_all_events(self): if self._events is None: LOG.debug('Unexpected attempt to cancel events during shutdown.') return our_events = self._events # NOTE(danms): Block new events self._events = None for instance_uuid, events in our_events.items(): ...
21,952
[ 0.04667208343744278, 0.04335590824484825, -0.011340497061610222, -0.026693155989050865, 0.011524729430675507, 0.01416538655757904, 0.04495258629322052, 0.022394411265850067, -0.0415135882794857, 0.01644781604409218, -0.009743820875883102, -0.021186670288443565, 0.018576717004179955, -0.032...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "instance_or_dict", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "poso...
def _load_instance(instance_or_dict): if isinstance(instance_or_dict, dict): # try to get metadata and system_metadata for most cases but # only attempt to load those if the db instance already has # those fields joined metas = [meta for meta i...
21,953
[ -0.006420784164220095, 0.027895774692296982, -0.024773268029093742, 0.004306371323764324, -0.01307937502861023, 0.0015250655123963952, 0.02901243232190609, 0.016139846295118332, 0.035422876477241516, 0.03205222263932228, 0.03823520243167877, 0.014402822591364384, 0.0010675458470359445, 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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _set_instance_obj_error_state(self, context, instance, clean_task_state=False): try: instance.vm_state = vm_states.ERROR if clean_task_state: instance.task_state = None instance.save() except exception.Instance...
21,954
[ 0.03919125720858574, 0.034183770418167114, 0.010640911757946014, 0.00039939346606843174, -0.02764337696135044, 0.033877190202474594, -0.006700070109218359, 0.0025420666206628084, 0.021115759387612343, -0.019301822409033775, 0.008935555815696716, -0.010813363827764988, -0.0012550655519589782,...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "If", "_fields": {"body": [{"_type": "Expr", "_fields": {"value...
def _pop_event(): if not self._events: LOG.debug('Unexpected attempt to pop events during shutdown', instance=instance) return no_events_sentinel events = self._events.get(instance.uuid) if not events: return n...
21,955
[ 0.08150370419025421, 0.0793946385383606, 0.018009085208177567, -0.005858518183231354, -0.004985598847270012, 0.011558856815099716, 0.044618476182222366, 0.038314707577228546, -0.006286189891397953, -0.00979544222354889, 0.0728330984711647, 0.007235269993543625, -0.03728361055254936, -0.006...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _complete_deletion(self, context, instance, bdms, quotas, system_meta): if quotas: quotas.commit() # ensure block device mappings are not leaked for bdm in bdms: bdm.destroy() self._update_resource_tracker(context, instance) ...
21,956
[ 0.004640365485101938, 0.008477016352117062, 0.012164328247308731, -0.009226425550878048, 0.07159575819969177, -0.0014594478998333216, 0.01739933341741562, 0.01713866926729679, -0.017562247812747955, -0.022786393761634827, 0.006570909172296524, 0.02071194164454937, -0.004765267018228769, 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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _is_instance_storage_shared(self, context, instance, host=None): shared_storage = True data = None try: data = self.driver.check_instance_shared_storage_local(context, instance) if data: shared_sto...
21,957
[ 0.033313896507024765, 0.04708661884069443, -0.03154758736491203, -0.013649753294885159, -0.01580733060836792, 0.04708661884069443, -0.005807573441416025, 0.012598912231624126, 0.03501312807202339, 0.013616216368973255, 0.034051720052957535, 0.015483135357499123, -0.027210073545575142, -0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "event", "annotation": null, "type_comment": null}}], "kwarg": nul...
def handle_lifecycle_event(self, event): LOG.info(_LI("VM %(state)s (Lifecycle Event)"), {'state': event.get_name()}, instance_uuid=event.get_instance_uuid()) context = nova.context.get_admin_context(read_deleted='yes') instance = objects.Instance.get_by_uuid(co...
21,958
[ 0.03538953512907028, 0.040700167417526245, -0.011524735949933529, -0.02661927603185177, 0.007877807132899761, 0.041735850274562836, -0.021440858021378517, 0.014841128140687943, 0.000928947702050209, 0.02653113193809986, 0.0321723036468029, -0.03007890097796917, -0.004853390157222748, -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": "event", "annotation": null, "type_comment": null}}], "kwarg": nul...
def handle_events(self, event): if isinstance(event, virtevent.LifecycleEvent): try: self.handle_lifecycle_event(event) except exception.InstanceNotFound: LOG.debug("Event %s arrived for non-existent instance. The " "instance was ...
21,959
[ 0.019864283502101898, 0.029304374009370804, 0.022476406767964363, -0.019086720421910286, -0.029595959931612015, 0.028696903958916664, 0.0022491593845188618, 0.023788543418049812, 0.0212857648730278, 0.02185678668320179, -0.0010843347990885377, -0.004191546235233545, -0.023241819813847542, ...
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 init_virt_events(self): if CONF.workarounds.handle_virt_lifecycle_events: self.driver.register_event_listener(self.handle_events) else: # NOTE(mriedem): If the _sync_power_states periodic task is # disabled we should emit a warning in the logs. if CONF...
21,960
[ 0.050789572298526764, 0.002751006279140711, -0.003194439224898815, -0.0205270703881979, -0.01940198428928852, -0.014717955142259598, 0.018116172403097153, -0.009195852093398571, 0.029596636071801186, 0.024338584393262863, 0.021434025838971138, 0.06130567938089371, 0.003911968320608139, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _await_block_device_map_created(self, context, vol_id): # TODO(yamahata): creating volume simultaneously # reduces creation time? # TODO(yamahata): eliminate dumb polling start = time.time() retries = CONF.block_device_allocate_retries if retries < 0: ...
21,961
[ -0.015440385788679123, 0.01661519706249237, 0.014019422233104706, -0.04811134561896324, 0.00856493879109621, -0.03249194100499153, -0.0024321405217051506, 0.053392406553030014, -0.05742033198475838, -0.007451664190739393, -0.011294977739453316, 0.015753667801618576, 0.019748028367757797, 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 _build_networks_for_instance(self, context, instance, requested_networks, security_groups): # If we're here from a reschedule the network may already be allocated. if strutils.bool_from_string( instance.system_metadata.get('network_allocated', 'False')): # NO...
21,962
[ -0.009067431092262268, 0.023555872961878777, 0.034154798835515976, -0.02960892952978611, -0.009316602721810341, 0.04854600504040718, -0.00809505209326744, -0.006976816803216934, -0.018365802243351936, -0.010677932761609554, 0.04438908398151398, 0.0014350181445479393, -0.011583460494875908, ...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _validate_instance_group_policy(self, context, instance, filter_properties): # NOTE(russellb) Instance group policy is enforced by the scheduler. # However, there is a race condition with the enforcement of # the policy. Since more than one instance may be scheduled at the ...
21,963
[ 0.04381465166807175, -0.023333849385380745, -0.025840455666184425, -0.027572661638259888, 0.0018544805934652686, -0.029590174555778503, 0.0027970049995929003, -0.03452187031507492, -0.005380031652748585, -0.03900522738695145, -0.016812598332762718, 0.01372519414871931, -0.01567137986421585, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "instance", "annotation": null, "type_comment": null}}, {"_type": ...
def _get_device_name_for_instance(self, instance, bdms, block_device_obj): # NOTE(ndipanov): Copy obj to avoid changing the original block_device_obj = block_device_obj.obj_clone() try: return self.driver.get_device_name_for_instance( instance, bdms, block_device_obj)...
21,964
[ 0.07184050977230072, 0.03514701873064041, 0.07254344969987869, -0.011586801148951054, 0.005304271355271339, 0.0077674915082752705, 0.016683118417859077, -0.04037221148610115, -0.029453203082084656, 0.008124819956719875, -0.0033272511791437864, -0.0003298694209661335, 0.00073076511034742, -...
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": "bdms", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _add_missing_dev_names(self, bdms, instance): for bdm in bdms: if bdm.device_name is not None: continue device_name = self._get_device_name_for_instance(instance, bdms, bdm) values = {'device_na...
21,965
[ 0.005026298575103283, -0.004836735315620899, 0.02007072977721691, -0.05918969586491585, 0.011149766854941845, 0.04053207486867905, 0.05441040173172951, 0.013614089228212833, -0.05032043159008026, -0.020438367500901222, -0.016830921173095703, 0.020587719976902008, -0.02805536426603794, -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": "context", "annotation": null, "type_comment": null}}], "kwarg": n...
def _sync_scheduler_instance_info(self, context): if not self.send_instance_updates: return context = context.elevated() instances = objects.InstanceList.get_by_host(context, self.host, expected_attrs=[], ...
21,966
[ -0.01803470402956009, 0.017626114189624786, -0.017285622656345367, -0.03443504869937897, 0.016627337783575058, 0.001242794212885201, -0.03947432339191437, 0.04428660497069359, 0.0002605115296319127, 0.0020840922370553017, 0.020463543012738228, -0.01957826502621174, -0.021553117781877518, -...
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 _deallocate_network(self, context, instance, requested_networks=None): # If we were told not to allocate networks let's save ourselves # the trouble of calling the network API. if requested_networks and requested_networks.no_allocate: LOG.debug("Skippi...
21,967
[ 0.014432304538786411, 0.016884692013263702, 0.0684216320514679, -0.035093676298856735, -0.014150280505418777, 0.03644248843193054, -0.005309420637786388, 0.007761808577924967, -0.029624849557876587, 0.021777207031846046, -0.01129324734210968, -0.006327161565423012, -0.02079625241458416, -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 _build_failed(self): self._failed_builds += 1 limit = CONF.compute.consecutive_build_service_disable_threshold if limit and self._failed_builds >= limit: # NOTE(danms): If we're doing a bunch of parallel builds, # it is possible (although not likely) that we have alre...
21,968
[ 0.015720434486865997, 0.03576190024614334, 0.019062668085098267, -0.016985708847641945, -0.02819412760436535, -0.000490144535433501, 0.032443538308143616, 0.03156023472547531, -0.06044667959213257, -0.005284906830638647, -0.009268729947507381, 0.023025602102279663, -0.03351782634854317, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def build_and_run_instance(self, context, instance, image, request_spec, filter_properties, admin_password=None, injected_files=None, requested_networks=None, security_groups=None, block_device_mapping=None, node=None, limits=None): ...
21,969
[ 0.010844061151146889, 0.03024398721754551, 0.01917608082294464, -0.046485207974910736, -0.02651323191821575, -0.005795105826109648, 0.02448618784546852, 0.025592979043722153, -0.054021332412958145, 0.03074141964316368, 0.006065585650503635, 0.015718914568424225, -0.018852747976779938, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _do_build_and_run_instance(self, context, instance, image, request_spec, filter_properties, admin_password, injected_files, requested_networks, security_groups, block_device_mapping, node=None, limits=None): try: LOG.debug('Starting instance...', instance=ins...
21,970
[ 0.00912213884294033, 0.03694494813680649, -0.014353534206748009, -0.0005637156427837908, -0.02216924913227558, -0.0038393991999328136, -0.029049361124634743, -0.031445421278476715, 0.0008293501450680196, -0.0003932816907763481, -0.004455528687685728, 0.012219900265336037, -0.0461184307932853...
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": "requested_networks", "annotation": null, "type_comment": null}}, ...
def _check_device_tagging(self, requested_networks, block_device_mapping): tagging_requested = False if requested_networks: for net in requested_networks: if 'tag' in net and net.tag is not None: tagging_requested = True break i...
21,971
[ 0.005035148933529854, 0.025996243581175804, 0.03142688423395157, -0.03763670474290848, -0.012514086440205574, -0.039502013474702835, 0.026397638022899628, 0.029231015592813492, -0.028026830404996872, 0.006304265931248665, 0.011185940355062485, 0.006646632682532072, -0.010902602225542068, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _build_resources(self, context, instance, requested_networks, security_groups, image_meta, block_device_mapping): resources = {} network_info = None try: LOG.debug('Start building networks asynchronously for instance.', instance=inst...
21,972
[ 0.007876500487327576, 0.025607958436012268, 0.002595947589725256, -0.03757824748754501, -0.003748492570593953, -0.002863474888727069, 0.04230663552880287, 0.0453178733587265, -0.029390670359134674, 0.002333086682483554, 0.03904653713107109, 0.0431278832256794, -0.0032818750478327274, -0.03...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _build_and_run_instance(self, context, instance, image, injected_files, admin_password, requested_networks, security_groups, block_device_mapping, node, limits, filter_properties): image_name = image.get('name') self._notify_about_instance_usage(context, instance, 'create.st...
21,973
[ 0.009737037122249603, 0.023722345009446144, -0.019168199971318245, 0.00022126411204226315, -0.00804339349269867, 0.013775726780295372, -0.049619805067777634, 0.04039822518825531, -0.024515356868505478, 0.010620677843689919, 0.0536075159907341, -0.027370193973183632, -0.030315661802887917, ...
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 _cleanup_allocated_networks(self, context, instance, requested_networks): try: self._deallocate_network(context, instance, requested_networks) except Exception: msg = _LE('Failed to deallocate networks') LOG.exception(msg, instance=instance) ...
21,974
[ -0.008323557674884796, 0.02686391770839691, -0.02332388423383236, -0.009354199282824993, 0.0013135088374838233, 0.015504445880651474, -0.028297854587435722, 0.0509495809674263, -0.01688236929476261, 0.030403949320316315, 0.04104645177721977, -0.035512350499629974, -0.028992418199777603, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _try_deallocate_network(self, context, instance, requested_networks=None): try: # tear down allocated network structure self._deallocate_network(context, instance, requested_networks) except Exception as ex: with excutils.save_and_r...
21,975
[ 0.042054466903209686, 0.04883173480629921, 0.04200388863682747, 0.03805891424417496, -0.018371960148215294, 0.029208002611994743, 0.027286089956760406, 0.016702931374311447, -0.010633735917508602, 0.013592468574643135, 0.03613699972629547, 0.038160067051649094, -0.0055318186059594154, 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}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _rebuild_default_impl(self, context, instance, image_meta, injected_files, admin_password, bdms, detach_block_devices, attach_block_devices, network_info=None, recreate=False, block_device_info=No...
21,976
[ 0.04653029888868332, 0.05959457531571388, 0.0435774140059948, 0.0024145981296896935, -0.03670972213149071, 0.02268352173268795, 0.015994790941476822, 0.05744702368974686, 0.03335417062044144, 0.011095686815679073, 0.04653029888868332, -0.022784188389778137, -0.02650884911417961, -0.0137465...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _cleanup_volumes(self, context, instance_uuid, bdms, raise_exc=True): exc_info = None for bdm in bdms: LOG.debug("terminating bdm %s", bdm, instance_uuid=instance_uuid) if bdm.volume_id and bdm.delete_on_termination: try: ...
21,977
[ 0.003858554642647505, 0.016833258792757988, -0.02298903837800026, -0.03212197497487068, -0.015523756854236126, 0.015893103554844856, 0.036979448050260544, 0.01537825632840395, -0.010369690135121346, 0.010711056180298328, 0.025787120684981346, 0.033688902854919434, 0.0182882621884346, -0.02...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _snapshot_instance(self, context, image_id, instance, expected_task_state): context = context.elevated() instance.power_state = self._get_power_state(context, instance) try: instance.save() LOG.info(_LI('instance snapshotting'), instance=i...
21,978
[ 0.036545321345329285, 0.03846626356244087, 0.02893270179629326, -0.021628379821777344, -0.041572969406843185, 0.022185690701007843, 0.042023561894893646, 0.009812217205762863, -0.05008677393198013, 0.01555725559592247, 0.022944580763578415, 0.015272671356797218, -0.010606680996716022, 0.00...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _do_rebuild_instance(self, context, instance, orig_image_ref, image_ref, injected_files, new_pass, orig_sys_metadata, bdms, recreate, on_shared_storage, preserve_ephemeral): orig_vm_state = instance.vm_state if r...
21,979
[ 0.005402831826359034, 0.0049691395834088326, 0.03176340088248253, -0.006267162971198559, 0.00787365809082985, -0.0038360413163900375, -0.02538628689944744, 0.09812446683645248, -0.024482250213623047, 0.000700550910551101, 0.011728024110198021, 0.0007372010149993002, -0.01051857229322195, 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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def rescue_instance(self, context, instance, rescue_password, rescue_image_ref, clean_shutdown): context = context.elevated() LOG.info(_LI('Rescuing'), instance=instance) admin_password = (rescue_password if rescue_password else utils.generate_passw...
21,980
[ -0.012328454293310642, 0.0029593745712190866, 0.009443329647183418, -0.008934189565479755, 0.016437938436865807, -0.012358760461211205, -0.024511439725756645, 0.11365937441587448, -0.0014266518410295248, 0.024681152775883675, -0.0012970940442755818, 0.007455260027199984, -0.00605209497734904...
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 unrescue_instance(self, context, instance): context = context.elevated() LOG.info(_LI('Unrescuing'), instance=instance) network_info = self.network_api.get_instance_nw_info(context, instance) self._notify_about_instance_usage(context, instance, "unrescue.start", netw...
21,981
[ 0.038337722420692444, 0.04091930389404297, 0.057036105543375015, -0.006743482314050198, -0.017419656738638878, 0.017636800184845924, 0.02183488756418228, 0.04439358413219452, -0.05626404285430908, -0.024693932384252548, 0.008064432069659233, 0.0133180757984519, -0.019168861210346222, 0.044...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def confirm_resize(self, context, instance, reservations, migration): quotas = objects.Quotas.from_reservations(context, reservations, instance=instance) @utils.synchronized(instance.uuid) def d...
21,982
[ -0.004404054488986731, 0.06103219836950302, 0.015818405896425247, -0.024725744500756264, -0.012141064740717411, -0.002235590247437358, -0.003907905425876379, 0.04303073510527611, -0.09227209538221359, -0.001288528903387487, 0.022250836715102196, 0.03079627826809883, -0.017452780157327652, ...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _prep_resize(self, context, image, instance, instance_type, quotas, request_spec, filter_properties, node, clean_shutdown=True): if not filter_properties: filter_properties = {} if not instance.host: self._set_instance_obj_error_state(context, instan...
21,983
[ 0.027264120057225227, 0.06818442791700363, 0.006134427152574062, -0.029290832579135895, -0.022897034883499146, 0.019627753645181656, 0.004617407917976379, 0.05250152572989464, -0.048568736761808395, 0.030714357271790504, 0.04123396426439285, 0.04314004257321358, -0.024067221209406853, 0.03...
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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _finish_resize(self, context, instance, migration, disk_info, image_meta): resize_instance = False old_instance_type_id = migration['old_instance_type_id'] new_instance_type_id = migration['new_instance_type_id'] old_instance_type = instance.get_flavor() ...
21,984
[ -0.01924710161983967, 0.006068820133805275, -0.012315853498876095, -0.019170723855495453, 0.014957238920032978, 0.025522777810692787, 0.03495538607239723, 0.02221309021115303, -0.018916133791208267, -0.03393701836466789, 0.05621375888586044, 0.030500037595629692, -0.02562461420893669, 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}}, {"_type": "arg", "_fields": {"arg": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _shelve_instance(self, context, instance, image_id, clean_shutdown): LOG.info(_LI('Shelving'), instance=instance) compute_utils.notify_usage_exists(self.notifier, context, instance, current_period=True) self._notify_about_ins...
21,985
[ 0.006125234067440033, 0.01988517865538597, -0.000762925308663398, -0.022442558780312538, 0.01987270452082157, 0.024987461045384407, 0.012587293051183224, 0.023627685382962227, -0.014920121990144253, -0.03455580025911331, 0.04787911847233772, 0.04206576198339462, -0.04852782189846039, 0.020...
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 _shelve_offload_instance(self, context, instance, clean_shutdown): LOG.info(_LI('Shelve offloading'), instance=instance) self._notify_about_instance_usage(context, instance, 'shelve_offload.start') compute_utils.notify_about_instance_action(context, instance, ...
21,986
[ -0.017946867272257805, 0.014584190212190151, -0.0037027220241725445, -0.04196418076753616, 0.011416725814342499, 0.002991144545376301, 0.02999960444867611, 0.033072613179683685, -0.029873661696910858, -0.02186369150876999, 0.04846283793449402, 0.03853853419423103, -0.03256883844733238, -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": "context", "annotation": null, "type_comment": null}}, {"_type": "...
def _unshelve_instance(self, context, instance, image, filter_properties, node): LOG.info(_LI('Unshelving'), instance=instance) self._notify_about_instance_usage(context, instance, 'unshelve.start') compute_utils.notify_about_instance_action(context, instance, ...
21,987
[ 0.02425510622560978, 0.018180016428232193, 0.030092623084783554, 0.03129180148243904, 0.01579296961426735, -0.008315066806972027, -0.003999151289463043, -0.015295197255909443, 0.06195007637143135, 0.009938484989106655, 0.018655164167284966, -0.0351608544588089, -0.027626385912299156, -0.00...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_incoming_sms_no_data(self): resp = yield http_request_full( self.transport.get_transport_url('receive.xml'), None) self.assertEqual([], self.tx_helper.get_dispatched_failures()) self.assertEqual([], self.tx_helper.get_dispatched_events()) self.assertEqual([], self.t...
21,988
[ -0.001964836847037077, -0.057328443974256516, 0.03924151882529259, -0.0007074792520143092, -0.026455506682395935, -0.040713995695114136, -0.00433460483327508, 0.03398968279361725, 0.01124604418873787, -0.024541286751627922, -0.00004241999704390764, 0.011019038036465645, -0.01500699669122696,...
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 setUp(self): self.tx_helper = self.add_helper( TransportHelper(OperaTransport, mobile_addr='27761234567')) self.transport = yield self.tx_helper.get_transport({ 'url': 'http://testing.domain', 'channel': 'channel', 'service': 'service', 'pa...
21,989
[ 0.023493191227316856, -0.029492830857634544, 0.042088188230991364, -0.018543163314461708, -0.013385806232690811, 0.04366908594965935, 0.011228268034756184, 0.00017766887322068214, 0.07774911820888519, -0.007949846796691418, 0.005173555575311184, -0.05582386255264282, -0.037293657660484314, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "method_called", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "xmlrpc_payload", "annotation": null, "type_comment": nul...
def _cb(method_called, xmlrpc_payload): self.assertEqual(method_called, 'EAPIGateway.SendSMS') self.assertEqual(xmlrpc_payload['Priority'], 'standard') self.assertEqual(xmlrpc_payload['SMSText'], 'hello world') self.assertEqual(xmlrpc_payload['Service'], 'service') ...
21,990
[ 0.02172107808291912, 0.03452521190047264, 0.05658160522580147, 0.015039579942822456, 0.0025226380676031113, -0.007215520832687616, -0.009097021073102951, -0.028961436823010445, 0.05489260330796242, 0.023385241627693176, 0.0036357035860419273, -0.021547209471464157, -0.047143060714006424, -...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_incoming_sms_partial_data(self): xml_data = """ <?xml version="1.0"?> <!DOCTYPE bspostevent> <bspostevent> <field name="MOReference" type = "string">282341913</field> <field name="IsReceipt" type = "string">NO</field> <field name="RemoteNetwork" ty...
21,991
[ -0.005795030854642391, 0.020566677674651146, 0.043304916471242905, -0.009519506245851517, -0.0045009334571659565, 0.01816786453127861, -0.02367251180112362, 0.012473835609853268, 0.006104351952672005, 0.039769820868968964, 0.026437461376190186, 0.02977055124938488, 0.016046807169914246, 0....
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields": {}}, "attr": "_PathListingWidgetColumn", "value": {"_type": "Name", "_fields": {"id": "_GafferUI", "ctx": {"_type": "Load", ...
class PathListingWidget( GafferUI.Widget ) : Column = _GafferUI._PathListingWidgetColumn StandardColumn = _GafferUI._PathListingWidgetStandardColumn IconColumn = _GafferUI._PathListingWidgetIconColumn ## A collection of handy column definitions for FileSystemPaths defaultNameColumn = StandardColumn( "Name", "nam...
21,992
[ 0.0260018277913332, -0.004856223706156015, 0.047517064958810806, -0.015499128960072994, -0.0034063667990267277, 0.03413377329707146, 0.0013327529886737466, -0.010776737704873085, 0.06133372336626053, -0.013587229885160923, 0.047822970896959305, -0.032731711864471436, -0.012784232385456562, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "method_called", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "xmlrpc_payload", "annotation": null, "type_comment": nul...
def _cb(method_called, xmlrpc_payload): self.assertEqual(xmlrpc_payload['Delivery'], fixed_date) self.assertEqual(xmlrpc_payload['Expiry'], fixed_date + timedelta(hours=1)) self.assertEqual(xmlrpc_payload['Priority'], 'high') self.assertEqual(...
21,993
[ 0.0058810412883758545, -0.0066976891830563545, 0.01746099442243576, -0.004406374413520098, 0.014511660672724247, 0.05043242499232292, 0.030973875895142555, -0.020198822021484375, 0.02105659618973732, 0.05005641654133797, -0.028459304943680763, -0.0008856813074089587, 0.025568723678588867, ...
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": "path", "annotation": null, "type_comment": null}}], "kwarg": null...
def setPath( self, path ) : if path.isSame( self.__path ) : return self.__path = path self.__pathChangedConnection = self.__path.pathChangedSignal().connect( Gaffer.WeakMethod( self.__pathChanged ) ) self.__currentDir = None self.__currentPath = "" self.__update()
21,994
[ -0.015124705620110035, 0.029436878859996796, 0.024909913539886475, -0.002383911283686757, 0.0010221945121884346, 0.0030615050345659256, -0.0015539677115157247, -0.007336004637181759, -0.02224016562104225, 0.055530767887830734, -0.025606369599699974, 0.013337134383618832, 0.036053210496902466...
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": "path", "annotation": null, "type_comment": null}}, {"_type": "arg...
def __init__( self, path, columns = defaultFileSystemColumns, allowMultipleSelection = False, displayMode = DisplayMode.List, sortable = True, horizontalScrollMode = GafferUI.ScrollMode.Never, **kw ) : GafferUI.Widget.__init__( self, _TreeView(), **kw ) self._qtWidget().setAlternatingRowColors( T...
21,995
[ -0.0034759724512696266, 0.007345233112573624, 0.060288749635219574, -0.008033487014472485, -0.018611779436469078, -0.004791752435266972, -0.03472502529621124, 0.011642483994364738, 0.00263155996799469, 0.0013136110501363873, -0.0053961435332894325, 0.011567296460270882, 0.036182504147291183,...
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": "position", "annotation": null, "type_comment": null}}], "kwarg": ...
def pathAt( self, position ) : position = self._qtWidget().viewport().mapFrom( self._qtWidget(), QtCore.QPoint( position.x, position.y ) ) index = self._qtWidget().indexAt( position ) if not index.isValid() : return None return self.__pathForIndex( index )
21,996
[ -0.029830284416675568, 0.03150641545653343, -0.009212651289999485, -0.0010916111059486866, -0.013299739919602871, 0.040907327085733414, 0.013190426863729954, -0.012121588923037052, -0.0053350781090557575, 0.0655391737818718, -0.004679200705140829, -0.0066802348010241985, 0.01678560860455036,...
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": "displayMode", "annotation": null, "type_comment": null}}], "kwarg...
def setDisplayMode( self, displayMode ) : if displayMode == self.getDisplayMode() : return # It is possible to implement list mode as follows : # # ``` # self._qtWidget().setItemsExpandable( False ) # self._qtWidget().setRootIsDecorated( False ) # ``` # # However, even when doing this QTreeView w...
21,997
[ -0.0007714522653259337, 0.004233000334352255, 0.07954663783311844, -0.01911483146250248, -0.005432953592389822, 0.011571407318115234, 0.016208412125706673, 0.006614816840738058, 0.011330210603773594, 0.04242648184299469, 0.020007258281111717, -0.0453932024538517, 0.01058250106871128, 0.007...
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": "paths", "annotation": null, "type_comment": null}}, {"_type": "ar...
def setSelection( self, paths, scrollToFirst=True, expandNonLeaf=True ) : assert( isinstance( paths, IECore.PathMatcher ) ) # If there are pending changes to our path model, we must perform # them now, so that the model is valid with respect to the paths # we're trying to select. self.__updateLazily.flush( ...
21,998
[ -0.02288968861103058, -0.01729418709874153, -0.022370973601937294, -0.020483732223510742, -0.022514447569847107, 0.011036493815481663, -0.04072466492652893, -0.03293289989233017, -0.033219847828149796, 0.01765839010477066, -0.024169921875, 0.003443386172875762, 0.008194596506655216, -0.010...
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": "sortable", "annotation": null, "type_comment": null}}], "kwarg": ...
def setSortable( self, sortable ) : if sortable == self.getSortable() : return self._qtWidget().setSortingEnabled( sortable ) if not sortable : self._qtWidget().model().sort( -1 )
21,999
[ -0.0323796272277832, 0.02802647463977337, 0.018806595355272293, -0.0038579199463129044, 0.006817085202783346, 0.04827596992254257, 0.0005219808663241565, 0.002061939099803567, -0.012252411805093288, 0.10379088670015335, 0.03279537707567215, -0.0019641153048723936, -0.0018907475750893354, 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 __update( self ) : # update the listing if necessary. when the path itself changes, we only # want to update if the directory being viewed has changed. if the path # hasn't changed at all then we assume that the filter has changed and # we therefore have to update the listing anyway. # \todo Add an argum...
22,000
[ 0.013788069598376751, -0.01664756052196026, 0.07214714586734772, 0.0002751318970695138, -0.02348949946463108, -0.001694566453807056, 0.0010057418840005994, 0.007362898904830217, 0.0015556438593193889, 0.031164973974227905, -0.003368873381987214, -0.005814490374177694, 0.017782095819711685, ...
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": "pathOrPaths", "annotation": null, "type_comment": null}}, {"_type...
def setSelectedPaths( self, pathOrPaths, scrollToFirst=True, expandNonLeaf=True ) : paths = pathOrPaths if isinstance( pathOrPaths, Gaffer.Path ) : paths = [ pathOrPaths ] if self._qtWidget().selectionMode() != QtWidgets.QAbstractItemView.ExtendedSelection : assert( len( paths ) <= 1 ) self.setSelectio...