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
16,101
[ 0.017925925552845, -0.0436972938477993, 0.015975967049598694, -0.07726848870515823, -0.020024124532938004, 0.009738383814692497, -0.022977570071816444, 0.007987983524799347, 0.005684525240212679, -0.026090659201145172, 0.0376763716340065, 0.018872395157814026, -0.05195325240492821, -0.0230...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "outputname", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "nostamp", "annotation": null, "type_comment": null}}], "kwa...
def dotest(outputname, nostamp): pdf = FPDF() if nostamp: pdf._putinfo = lambda: common.test_putinfo(pdf) pdf.add_page() # Add a Unicode font (uses UTF-8) pdf.add_font('DejaVu', '', \ os.path.join(common.basepath, "font", 'DejaVuSansCondensed.ttf'), \ uni = True) pdf.set...
16,102
[ -0.008647538721561432, 0.036247167736291885, 0.01757124625146389, -0.001671397127211094, 0.00208277371712029, 0.0036649913527071476, -0.005060219671577215, 0.0004944429965689778, -0.02549959346652031, 0.004208698868751526, 0.014498867094516754, -0.020286906510591507, 0.040435727685689926, ...
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": "pzlType", "annotation": null, "type_comment": null}}, {"_type": "...
def __init__(self, pzlType='Puzzle 15', pos=wx.DefaultPosition): wx.Frame.__init__(self, None, -1, pzlType, pos) # check puzzle type if pzlType == 'Puzzle 15': self.size = 4 elif pzlType == 'Puzzle 8': self.size = 3 elif pzlType == 'Puzzle 3': self.size = 2 else: raise Va...
16,103
[ 0.04010289907455444, 0.02589558996260166, 0.00978641677647829, 0.004039888270199299, -0.04360434412956238, -0.022935735061764717, -0.0007797173457220197, 0.020907917991280556, 0.0005144323804415762, 0.029447417706251144, 0.016625573858618736, 0.0035896124318242073, -0.021487293764948845, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "i", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "state", "annotation": null, "type_comment": null}}], "kwarg": null, ...
def cg_step(i, state): z = operator.apply(state.p) alpha = state.gamma / util.dot(state.p, z) x = state.x + alpha * state.p r = state.r - alpha * z gamma = util.l2norm_squared(r) beta = gamma / state.gamma p = r + beta * state.p return i + 1, cg_state(i + 1, x, r, p, gamma)
16,104
[ -0.005434644408524036, 0.003447527764365077, 0.028474025428295135, -0.0806976854801178, -0.0027106718625873327, -0.017524931579828262, -0.024877529591321945, 0.01885499805212021, -0.0018940120935440063, 0.007634571287781, 0.004503598902374506, 0.04456248879432678, -0.022132277488708496, -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 run(self): tool_node = self.check_tool_result_node() lptlog.info("----------获取测试参数") cmd = self.processBin #args = ['-B', 'fileio', '-c', os.path.join(self.tmp_dir, 'loadfiles/client.txt'), '-R', '999999.99'] args = ['-c', os.path.join(self.tmp_dir...
16,105
[ -0.01119315717369318, 0.04275728762149811, 0.04873460531234741, -0.00819304771721363, -0.02736741304397583, -0.0003279580851085484, 0.013225674629211426, -0.035245563834905624, 0.02777964062988758, 0.03659675642848015, -0.010311445221304893, -0.011445075273513794, -0.028466690331697464, -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": "x", "annotation": null...
class VertivalSep(Widget): def __init__(self, x, y, h): w = 2 Widget.__init__(self, x, y, w, h) self.is_passive = True self.mapping = {} def draw(self): c = color_pair(COLOR_COMMENT.val) #| A_REVERSE for i in range(self.height): self.screen.addstr(i,...
16,106
[ -0.01688530296087265, -0.046462252736091614, -0.025051245465874672, -0.012304256670176983, 0.02811347506940365, -0.013761582784354687, -0.010607117787003517, 0.04882349073886871, -0.0007551807211712003, -0.048479143530130386, -0.0032651477959007025, -0.02104206196963787, 0.000797839777078479...
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_add(self): self.mock_access_token() url = reverse('api:v1:collaborator-list') data = { 'name': 'Collaborator 1', # The API is expecting the image to be base64 encoded. We are simulating that here. 'image': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...
16,107
[ 0.000287304341327399, -0.023803142830729485, -0.01135355792939663, -0.01889036037027836, 0.019109565764665604, 0.011224613524973392, 0.00711128581315279, 0.025079693645238876, 0.007614169269800186, -0.04925677552819252, 0.02746516652405262, -0.025788888335227966, -0.0025869477540254593, -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_modify(self): self.mock_access_token() url = reverse('api:v1:collaborator-list') data = { 'name': 'Collaborator 1', # The API is expecting the image to be base64 encoded. We are simulating that here. 'image': 'data:image/png;base64,iVBORw0KGgoAAAANSUh...
16,108
[ -0.009728220291435719, -0.02776130475103855, -0.01183384470641613, -0.022044358775019646, 0.02139737829566002, -0.008940081112086773, -0.005316995549947023, 0.035407427698373795, 0.006905036512762308, -0.03670138493180275, -0.022867785766720772, -0.025949761271476746, -0.004655311815440655, ...
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_add_fails_when_no_image(self): self.mock_access_token() url = reverse('api:v1:collaborator-list') data = { 'name': 'Collaborator 1', } response = self.client.post(url, data, format='json') assert response.status_code == 400
16,109
[ 0.051789749413728714, 0.011450896970927715, -0.00855262205004692, -0.03502308949828148, -0.03266654536128044, 0.07253815233707428, -0.016075950115919113, 0.038652703166007996, 0.05338786169886589, -0.036946240812540054, 0.030499611049890518, -0.03851727023720741, -0.012405702844262123, -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 testMotorizedDropTargetBank(self): motor = self.machine.motors["motorized_drop_target_bank"] coil = self.machine.digital_outputs["c_motor_run"] coil.enable = MagicMock() coil.disable = MagicMock() # reset should move it down motor.reset() self.advance_time_an...
16,110
[ 0.024186406284570694, -0.0019245430594310164, -0.014325055293738842, -0.05513017252087593, -0.02575213648378849, 0.03342970833182335, -0.004669720772653818, 0.004714357666671276, 0.049718793481588364, -0.0034009988885372877, 0.023073915392160416, -0.061860065907239914, -0.01446240022778511, ...
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 testMotorToyWithTwoEndSwitches(self): slimer = self.machine.motors["ghostbusters_slimer"] motor_left = self.machine.digital_outputs["c_slimer_motor_forward"].hw_driver motor_right = self.machine.digital_outputs["c_slimer_motor_backward"].hw_driver self.assertPlaceholderEvaluates("lef...
16,111
[ -0.0016716917743906379, 0.022963833063840866, -0.014349853619933128, 0.010286943055689335, 0.03152696415781975, -0.00015104022168088704, 0.01892634853720665, 0.004408689681440592, 0.00011592197552090511, 0.030448945239186287, -0.010073373094201088, -0.03813745453953743, 0.014146453700959682,...
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": "method", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None): # Default empty dicts for dict params. data = [] if data is None else data files = [] if files is None else files headers ...
16,112
[ 0.04409543052315712, -0.03538713604211807, -0.028961168602108955, -0.01075795479118824, 0.02867310866713524, -0.019111711531877518, 0.011577819474041462, 0.06523464620113373, -0.0024679037742316723, -0.0035869083367288113, 0.029692398384213448, -0.03713765740394592, 0.012652507051825523, -...
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 copy(self): p = PreparedRequest() p.method = self.method p.url = self.url p.headers = self.headers.copy() if self.headers is not None else None p._cookies = _copy_cookie_jar(self._cookies) p.body = self.body p.hooks = self.hooks p._body_position = self...
16,113
[ 0.04760171100497246, -0.020376989617943764, 0.0006160050397738814, -0.005482063628733158, 0.05637744441628456, -0.018260618671774864, 0.02630504220724106, 0.009357458911836147, 0.01717473194003105, 0.00013997753558214754, 0.028631940484046936, -0.04261549562215805, -0.029496217146515846, -...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def __init__(self): self._content = False self._content_consumed = False self._next = None #: Integer Code of responded HTTP Status, e.g. 404 or 200. self.status_code = None #: Case-insensitive Dictionary of Response Headers. #: For example, ``headers['content-e...
16,114
[ 0.07418818771839142, 0.021287089213728905, -0.03514561802148819, 0.033416345715522766, 0.07029123604297638, -0.01631847769021988, -0.009973756037652493, 0.026231344789266586, 0.011587337590754032, -0.007410293910652399, 0.046081434935331345, -0.012439794838428497, 0.027765769511461258, -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 __getstate__(self): # Consume everything; accessing the content attribute makes # sure the content has been fully read. if not self._content_consumed: self.content return dict( (attr, getattr(self, attr, None)) for attr in self.__attrs__ )
16,115
[ 0.022365987300872803, -0.0031448593363165855, -0.02040867879986763, -0.003697141306474805, 0.029279528185725212, -0.004423978738486767, 0.023762430995702744, 0.007188249845057726, 0.016871783882379532, -0.0017999240662902594, 0.04967676103115082, -0.018130872398614883, -0.04008479416370392, ...
10
{"_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": "Try", "_fields": {"body":...
def generate(): # Special case for urllib3. if hasattr(self.raw, 'stream'): try: for chunk in self.raw.stream(chunk_size, decode_content=True): yield chunk except ProtocolError as e: raise ChunkedEnco...
16,116
[ 0.040908049792051315, 0.024650854989886284, -0.026925979182124138, -0.0288035087287426, 0.007018646690994501, -0.002703089965507388, -0.04296229034662247, 0.014214001595973969, 0.03489995747804642, 0.013915806077420712, -0.010762660764157772, -0.015108589082956314, -0.03975944593548775, -0...
15
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Constant", "_fields": {"kind": null, "value": "ms_api.request"}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", "_fields":...
class RequestBodyLogger (object): logger = logging.getLogger('ms_api.request') allowed_methods = ['post', 'put', 'patch', 'delete'] def process_request(self, request): method = request.method.lower() if (method in self.allowed_methods and request.META.get('CONTENT_TYPE') == 'appl...
16,117
[ 0.07151616364717484, 0.005796502809971571, -0.03230910748243332, -0.00767118763178587, 0.02576717920601368, 0.048285648226737976, -0.03718217462301254, 0.053047459572553635, 0.05278044193983078, 0.025255396962165833, 0.024053817614912987, -0.045882489532232285, 0.005718622822314501, -0.010...
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": "request", "annotation": null, "type_comment": null}}], "kwarg": n...
def process_request(self, request): method = request.method.lower() if (method in self.allowed_methods and request.META.get('CONTENT_TYPE') == 'application/json'): # DELETE often has an empty string as body: if request.body == '' or request.body is None: ...
16,118
[ -0.015120591968297958, 0.006610008887946606, -0.025957016274333, -0.059306319802999496, 0.02177785336971283, -0.021651847288012505, -0.003178999526426196, 0.00621099304407835, 0.003788023255765438, -0.00712977908551693, -0.015005087479948997, -0.02683905139565468, 0.0024019689299166203, -0...
12
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "request", "annotation"...
class RequestTimeLogger (object): def process_request(self, request): self.start_time = time.time() def process_response(self, request, response): # NOTE: If there was some exception, or some other reason that the # process_request method was not called, we won't know the start time. ...
16,119
[ -0.01863294653594494, -0.01945103146135807, -0.009343383833765984, -0.04079657420516014, 0.008998927660286427, -0.027621109038591385, -0.003700216766446829, 0.02770722284913063, 0.026071054860949516, 0.008363835513591766, -0.00957481563091278, -0.01108719501644373, 0.022755660116672516, -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": "request", "annotation": null, "type_comment": null}}, {"_type": "...
def process_response(self, request, response): # NOTE: If there was some exception, or some other reason that the # process_request method was not called, we won't know the start time. # Check that we know it first. if hasattr(self, 'start_time'): duration = time.time() - sel...
16,120
[ -0.021689802408218384, -0.03762761130928993, -0.0026921608950942755, -0.04115724563598633, 0.04022036865353584, -0.029936503618955612, -0.027169445529580116, 0.010294757783412933, 0.030851593241095543, 0.003633123589679599, 0.021896786987781525, -0.0855826660990715, 0.006803255528211594, -...
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}}, {"_type": "...
def process_response(self, request, response): logger = logging.getLogger('utils.cookies_logger') logger.debug( '(%s)\n' '\n' 'Request cookies: %s\n' '\n' 'Response cookies: %s' % ( response.status_code, request...
16,121
[ 0.010163032449781895, 0.03199533745646477, -0.0031892021652311087, -0.047851625829935074, 0.024469582363963127, -0.00984220951795578, -0.015149389393627644, -0.002570665441453457, 0.0066067869774997234, 0.0006980627658776939, 0.0037356894463300705, -0.04802563041448593, -0.010364226996898651...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 1024}}, "targets": [{"_type": "Name", "_fields": {"id": "readsize", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {...
class FileResponse(object): readsize = 1024 def __init__(self, f, filename): self.size = os.path.getsize(filename) self.f = f def __iter__(self): output = '\n' while len(output) is not 0: output = self.f.read(self.readsize) yield output
16,122
[ -0.02404785342514515, -0.03995276987552643, -0.004175635986030102, -0.06761971116065979, 0.0321669802069664, -0.000562133442144841, -0.020964490249753, 0.019345426931977272, 0.012678694911301136, 0.04900047928094864, 0.036786071956157684, -0.044357575476169586, 0.03276222571730614, -0.0363...
17
{"_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": "If", "_fields": {"body": ...
def do_get(): if serve_file.endswith('/') or os.path.isdir(os.path.join(self.path, serve_file)): if os.path.isdir(os.path.join(self.path, serve_file)): start_response('200 OK', [('Cache-Control','no-cache'), ('Pragma','no-cache'), ...
16,123
[ 0.03464147821068764, -0.013833725824952126, 0.0034584314562380314, -0.0639323890209198, 0.052270904183387756, -0.047103263437747955, -0.001607741927728057, 0.04392493888735771, 0.014439665712416172, -0.004770348779857159, 0.06315495818853378, -0.013890889473259449, -0.010169503279030323, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Try", "_fields": {"body": [{"_type": "Assign", "_fields": {"va...
def do_put(): #Write file try: f = open(os.path.join(self.path, serve_file), 'w') logger.debug('opened file for writing %s' % serve_file) except: logger.error('failed to open file for writiing %s/%s' % (self.path, serve_file)) ...
16,124
[ -0.0018994148122146726, -0.006732465699315071, 0.03417227789759636, -0.021337619051337242, 0.03728926554322243, 0.006858520675450563, -0.0009497074061073363, -0.019229067489504814, 0.01800289936363697, -0.012605467811226845, 0.0017346842214465141, -0.028580034151673317, -0.006858520675450563...
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": "mock_hook", "annotatio...
class TestCloudSql(unittest.TestCase): @patch("airflow.providers.google.cloud.operators.speech_to_text.CloudSpeechToTextHook") def test_recognize_speech_green_path(self, mock_hook): mock_hook.return_value.recognize_speech.return_value = MagicMock() CloudSpeechToTextRecognizeSpeechOperator( # p...
16,125
[ 0.004605063237249851, 0.011368311010301113, 0.00898589938879013, -0.03139178827404976, 0.019944995641708374, 0.007976877503097057, -0.01662643626332283, -0.029799774289131165, 0.004167820326983929, -0.004969432018697262, -0.01097591407597065, -0.029508279636502266, 0.004893755540251732, 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": "mock_hook", "annotation": null, "type_comment": null}}], "kwarg":...
def test_missing_config(self, mock_hook): mock_hook.return_value.recognize_speech.return_value = True with self.assertRaises(AirflowException) as e: CloudSpeechToTextRecognizeSpeechOperator( # pylint: disable=missing-kwoa project_id=PROJECT_ID, gcp_conn_id=GCP_CONN_ID, audi...
16,126
[ -0.00373120722360909, 0.009371657855808735, 0.014030211605131626, 0.01925608329474926, 0.0036548373755067587, -0.00974805187433958, 0.0056131756864488125, -0.003908494021743536, 0.04573456197977066, 0.0007725617033429444, 0.02345641888678074, -0.03567557781934738, 0.003889401676133275, 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": "mock_hook", "annotation": null, "type_comment": null}}], "kwarg":...
def test_recognize_speech_green_path(self, mock_hook): mock_hook.return_value.recognize_speech.return_value = MagicMock() CloudSpeechToTextRecognizeSpeechOperator( # pylint: disable=no-value-for-parameter project_id=PROJECT_ID, gcp_conn_id=GCP_CONN_ID, config=CONFIG...
16,127
[ 0.02919549122452736, 0.006296604406088591, 0.0018409313634037971, -0.02304038405418396, -0.004303858615458012, 0.0031925197690725327, 0.04924086108803749, -0.00686259102076292, 0.00447778170928359, -0.03808620199561119, 0.017439471557736397, -0.017073938623070717, -0.02246260456740856, -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": "name", "annotation": n...
class Worker(Agent): def __init__(self, name, access, batch_size, state_size, action_size): super().__init__(name, access, batch_size, state_size, action_size) def run(self, sess, max_episodes, t_max=8): episode_score_list = [] episode = 0 while episode < max_episodes: ...
16,128
[ -0.013182546012103558, 0.02609989419579506, -0.021801477298140526, -0.009138277731835842, 0.02159152925014496, -0.009464249946177006, -0.032354142516851425, -0.027735279873013496, 0.014088639058172703, -0.015491977334022522, -0.009944921359419823, -0.025436898693442345, -0.001555275171995163...
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": "mock_hook", "annotation": null, "type_comment": null}}], "kwarg":...
def test_missing_audio(self, mock_hook): mock_hook.return_value.recognize_speech.return_value = True with self.assertRaises(AirflowException) as e: CloudSpeechToTextRecognizeSpeechOperator( # pylint: disable=missing-kwoa project_id=PROJECT_ID, gcp_conn_id=GCP_CONN_ID, confi...
16,129
[ 0.07163359224796295, 0.0272458977997303, -0.004012109246104956, -0.06881851702928543, -0.013271065428853035, 0.017066389322280884, 0.04205017536878586, 0.011235162615776062, 0.01332133449614048, -0.009991000406444073, 0.014992784708738327, -0.026114841923117638, -0.040718041360378265, -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": "sess", "annotation": null, "type_comment": null}}, {"_type": "arg...
def run(self, sess, max_episodes, t_max=8): episode_score_list = [] episode = 0 while episode < max_episodes: episode += 1 episode_socre, _ = self.run_episode(sess, t_max) episode_score_list.append(episode_socre) GD[str(self.name)] = episode_score_...
16,130
[ 0.01803247444331646, -0.04397982358932495, -0.03275463730096817, -0.022848600521683693, 0.016252871602773666, -0.003643206786364317, -0.03429779037833214, 0.025760676711797714, 0.026557141914963722, 0.027801619842648506, 0.05361207574605942, -0.04719057306647301, 0.0025418445002287626, 0.0...
17
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs":...
def index(request): try: member_id = request.POST['member_id'] if not member_id: return render_to_response('stats/index.html', context_instance = RequestContext(request)) try: member_id = int(member_id) except ValueError: return render_to_response('stats/index.html', context_instance ...
16,131
[ -0.005131478421390057, 0.001484305365011096, 0.007583465427160263, -0.027679648250341415, 0.04062209650874138, 0.012367368675768375, -0.003526311367750168, -0.035086166113615036, 0.045399680733680725, 0.03738648444414139, 0.05164340138435364, -0.07184069603681564, 0.020285770297050476, 0.0...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}], "kwa...
def classes(request, account_id): player_stats = get_player_objectives(request, account_id) if player_stats is None: return error_page(request, account_id, error_type = 1) elif player_stats is False: return error_page(request, account_id, error_type = 2) return render_to_response('stats/classes.html...
16,132
[ 0.0023410862777382135, -0.007839461788535118, -0.006018074229359627, -0.03750951215624809, 0.02841234765946865, -0.005975716281682253, 0.004291176795959473, -0.035215672105550766, 0.022104285657405853, 0.047675397247076035, 0.03174884244799614, -0.04996924102306366, -0.0031524021178483963, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}], "kwa...
def summary(request, account_id): player_stats = get_player_objectives(request, account_id) if not player_stats: return error_page(request, account_id, error_type = 2 if player_stats == False else 1) player_achievements = get_player_achievements(request, account_id) if not player_achievements: ret...
16,133
[ -0.0009046233608387411, 0.001896842266432941, 0.01509829144924879, -0.01879323087632656, 0.011231345124542713, -0.023392794653773308, 0.004481708165258169, -0.05397161468863487, 0.02810703031718731, 0.03218420594930649, 0.04472152143716812, -0.06574445962905884, 0.015238444320857525, 0.028...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}], "kwa...
def maps(request, account_id): player_stats = get_player_objectives(request, account_id) if not player_stats: return error_page(request, account_id, error_type = 2 if player_stats == False else 1) top_class = get_player_top_class_by_map(player_stats) worst_class = get_player_worst_class_by_map(player_s...
16,134
[ 0.019146546721458435, -0.0020569267217069864, 0.014813575893640518, -0.006943863816559315, 0.03483659401535988, -0.006024187430739403, 0.015332051552832127, -0.02320793643593788, 0.038391850888729095, 0.06577228009700775, 0.033577438443899155, -0.048860110342502594, 0.0034811904188245535, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}], "kwa...
def achievements(request, account_id): player_stats = get_player_objectives(request, account_id) player_achievements = get_player_achievements(request, account_id) if not player_stats or not player_achievements: return error_page(request, account_id, error_type = 2 if player_stats == False else 1) play...
16,135
[ -0.015216324478387833, 0.012802466750144958, 0.05436818674206734, -0.021521680057048798, 0.008442860096693039, 0.011911369860172272, -0.027454806491732597, 0.0006810122868046165, -0.02628171630203724, 0.05707531422376633, 0.01412219274789095, -0.050081897526979446, 0.006147440057247877, -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 get_server_list(): server_list = database.servers.find().sort('sgc_player_count', -1) if server_list.count() == 0: # No data about servers is available server_utils = ServerListUtils() server_list = server_utils.update_server_list(return_fetched_data = True) server_list = format_total_player_c...
16,136
[ 0.01830141805112362, -0.018375663086771965, 0.008408257737755775, -0.023424329236149788, 0.031405676156282425, 0.010697481222450733, -0.0038762129843235016, -0.04038933292031288, 0.022632380947470665, 0.0406368188560009, 0.03197488933801651, -0.06518720090389252, 0.02093711867928505, -0.01...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}], "kwa...
def leaderboards(request, account_id): player_stats = get_player_objectives(request, account_id) if player_stats is None: return error_page(request, account_id, error_type = 1) elif player_stats is False: return error_page(request, account_id, error_type = 2) return render_to_response('stats/leaderb...
16,137
[ 0.025014728307724, -0.003963156137615442, 0.03393542394042015, -0.042925089597702026, 0.06262879073619843, 0.008857467211782932, 0.06060553714632988, 0.00041492434684187174, 0.009805865585803986, 0.028693364933133125, 0.037108246237039566, -0.03474012389779091, -0.001556235714815557, -0.01...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}, {"_ty...
def get_player_achievements(request, account_id, fields = None): key = _get_cache_key_name('player.achievements', account_id) player_achievements = cache.get(key, False) if player_achievements != False: return player_achievements account_id = int(account_id) diff = datetime.datetime.now() - datetime....
16,138
[ 0.0011087199673056602, 0.01920892484486103, 0.004014202859252691, -0.05446280911564827, 0.04292086511850357, 0.008366132155060768, 0.04123815894126892, -0.037896446883678436, 0.025264298543334007, 0.006422725040465593, 0.038536347448825836, -0.04268386587500572, -0.0010516915936022997, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "request", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "account_id", "annotation": null, "type_comment": null}}, {"_ty...
def get_player_objectives(request, account_id, fields = None): key = _get_cache_key_name('player.objectives', account_id) player_stats = cache.get(key, False) if player_stats != False: return player_stats account_id = int(account_id) diff = datetime.datetime.now() - datetime.timedelta(seconds = setti...
16,139
[ 0.04553097486495972, -0.016687631607055664, 0.019641850143671036, -0.03655184432864189, 0.020340697839856148, 0.020372463390231133, 0.022003108635544777, -0.02198193036019802, 0.015004044398665428, 0.08081218600273132, -0.007152598351240158, -0.016253499314188957, -0.011689812876284122, -0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_achievements", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "p...
def get_player_latest_completed_achievements(player_achievements): completed_achievements = get_player_completed_achievements(player_achievements) achievements = [] for achievement in completed_achievements: achievements.append((achievement['completed_on'], achievement['id'], achievement['title'])) ach...
16,140
[ 0.037633948028087616, -0.017103437334299088, 0.02613941766321659, -0.02584141120314598, 0.00014384795213118196, 0.012239547446370125, 0.043104495853185654, -0.023797938600182533, 0.029417486861348152, 0.06692372262477875, 0.005640835035592318, -0.022073758766055107, -0.005922876764088869, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_achievements", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "p...
def get_player_completed_achievements(player_achievements): completed_achievements = [] for achievement in player_achievements['achievements']: if achievement['completed_on'] != '': completed_achievements.append(achievement) return completed_achievements
16,141
[ 0.028585897758603096, 0.025006655603647232, 0.009278406389057636, -0.05885332077741623, -0.008383595384657383, 0.029811007902026176, -0.03298188000917435, -0.041869934648275375, 0.019829966127872467, 0.031012095510959625, 0.013019795529544353, -0.02094697766005993, -0.029811007902026176, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_top_class_by_kills(player_stats): data = { 'soldier': player_stats['SGR_Soldier_KillsTotal'], 'commando': player_stats['SGR_Commando_KillsTotal'], 'scientist': player_stats['SGR_Scientist_KillsTotal'], 'goauld': player_stats['SGR_Goauld_KillsTotal'], 'jaffa': player_stats['SGR_Jaffa_Kill...
16,142
[ 0.007750749588012695, 0.01766103506088257, 0.04813035577535629, -0.03490009158849716, -0.017313523218035698, -0.022004930302500725, -0.007905888371169567, -0.054261453449726105, 0.002666841261088848, 0.019795749336481094, 0.011412032879889011, -0.004334586672484875, -0.025492457672953606, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_top_map_by_wins(player_stats): data = { 'sgc': player_stats['SGR_Account_WinsOnSGC'], 'amarna': player_stats['SGR_Account_WinsOnAmarna'], 'whiteout': player_stats['SGR_Account_WinsOnWhiteout'], 'leonops': (player_stats['SGR_Account_WinsOnCourt'] + player_stats['SGR_Account_WinsOnArena']...
16,143
[ -0.004953992087393999, 0.011511480435729027, 0.04107945039868355, -0.033941708505153656, -0.004170961678028107, -0.019154604524374008, 0.0059834741987288, -0.04095466434955597, 0.014487619511783123, 0.03139607980847359, 0.009883027523756027, -0.03915775194764137, -0.013938562013208866, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_worst_map_by_loses(player_stats): data = { 'sgc': player_stats['SGR_Account_LossesOnSGC'], 'amarna': player_stats['SGR_Account_LossesOnAmarna'], 'whiteout': player_stats['SGR_Account_LossesOnWhiteout'], 'leonops': (player_stats['SGR_Account_LossesOnCourt'] + player_stats['SGR_Account_Lo...
16,144
[ 0.016153747215867043, 0.010645605623722076, 0.017012158408761024, -0.04557385668158531, -0.01499619148671627, 0.02454276941716671, -0.022890977561473846, -0.045990053564310074, 0.021486304700374603, 0.03470063954591751, 0.015230303630232811, -0.046328216791152954, 0.0023606321774423122, 0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_rival_class(player_stats): data = { 'soldier': player_stats['SGR_Account_KilledBySoldier'], 'commando': player_stats['SGR_Account_KilledByCommando'], 'scientist': player_stats['SGR_Account_KilledByScientist'], 'goauld': player_stats['SGR_Account_KilledByGoauld'], 'jaffa': player_stats['S...
16,145
[ 0.01710945926606655, 0.009585113264620304, 0.009260733611881733, -0.04401392489671707, 0.00865013524889946, 0.0186232328414917, -0.025454295799136162, -0.03704293444752693, 0.03274330869317055, 0.02757866680622101, 0.025632387027144432, -0.03650866076350212, -0.00822398904711008, 0.0104119...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_easy_class(player_stats): data = { 'soldier': player_stats['SGR_Account_SoldierKills'], 'commando': player_stats['SGR_Account_CommandoKills'], 'scientist': player_stats['SGR_Account_ScientistKills'], 'goauld': player_stats['SGR_Account_GoauldKills'], 'jaffa': player_stats['SGR_Account_Ja...
16,146
[ 0.012349066324532032, 0.017166756093502045, 0.004025700036436319, -0.04877462983131409, 0.0064255790784955025, 0.021063944324851036, -0.029862506315112114, -0.04509262368083, 0.018720850348472595, 0.0424865260720253, -0.002109980909153819, -0.00005295499067869969, -0.017728621140122414, 0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "top_class", "annotation": null, "type_comment": null}}], ...
def get_player_top_class_data(player_stats, top_class): top_class_formatted = top_class[0].upper() + top_class[1:] data = { 'kills': player_stats['SGR_%s_KillsTotal' % (top_class_formatted)], 'deaths': player_stats['SGR_%s_KilledTotal' % (top_class_formatted)], 'streak': player_stats['SGR_%s_HighestMatchKi...
16,147
[ -0.00659349886700511, 0.006487253122031689, 0.03864852711558342, -0.03737357631325722, -0.007362219505012035, -0.007918448187410831, 0.0005753687000833452, -0.058547768741846085, 0.018549293279647827, 0.03629861772060394, -0.0017421211814507842, -0.04277336969971657, -0.002563964808359742, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_worst_class_by_map(player_stats): classes_losses = {} classes_worst = {} for map in ['SGC', 'Amarna', 'Whiteout', 'Court', 'Arena']: classes_losses[map] = {} classes_worst[map] = {} for player_class in ['Soldier', 'Commando', 'Scientist', 'Goauld', 'Jaffa', 'Ashrak']: classes_losse...
16,148
[ 0.022071490064263344, 0.007469664793461561, 0.02553568407893181, -0.05522330105304718, -0.020734211429953575, 0.008545856922864914, -0.0058171688579022884, -0.05771955847740173, 0.013003457337617874, 0.022071490064263344, 0.004228352569043636, -0.008233824744820595, 0.0010674361838027835, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_stats", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlya...
def get_player_top_class_by_map(player_stats): classes_wins = {} classes_top = {} for map in ['SGC', 'Amarna', 'Whiteout', 'Court', 'Arena']: classes_wins[map] = {} classes_top[map] = {} for player_class in ['Soldier', 'Commando', 'Scientist', 'Goauld', 'Jaffa', 'Ashrak']: classes_wins[map][playe...
16,149
[ 0.020381251350045204, -0.0240244772285223, 0.045550741255283356, -0.043302349746227264, 0.022025907412171364, -0.006828447803854942, 0.03274740278720856, -0.04542583227157593, 0.0006831049686297774, 0.04908987507224083, 0.019892018288373947, -0.017549943178892136, 0.0164777934551239, -0.05...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "player_achievements", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "p...
def format_achievements_dates(player_achievements): for achievement in player_achievements['achievements']: completed_on = achievement['completed_on'] if completed_on != '': achievement['completed_on'] = datetime.datetime.strptime(achievement['completed_on'].split('.000')[0], '%Y-%m-%dT%H:%M:%S') r...
16,150
[ 0.01699102856218815, 0.025543559342622757, -0.011580127291381359, -0.06239926815032959, 0.0005516382516361773, 0.0036034665536135435, -0.0020283753983676434, 0.033092595636844635, 0.008096395991742611, 0.018405048176646233, 0.05377831682562828, -0.01599893532693386, -0.048578377813100815, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "class_category", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "exp_current", "annotation": null, "type_comment": null}...
def get_next_rank_title_and_exp_points(class_category = 0, exp_current = 0): try: class_rank = ClassRank.objects.filter(category = class_category, exp_min__gt = exp_current).order_by('exp_min')[0] except IndexError: return None title = class_rank.title exp_total = class_rank.exp_min exp_needed = exp...
16,151
[ 0.019424447789788246, 0.06081445515155792, 0.03895656764507294, -0.02715546265244484, 0.02029660902917385, -0.004813042003661394, -0.01778779737651348, -0.005588297266513109, 0.07364923506975174, 0.027284672483801842, 0.03576941043138504, -0.022008631378412247, 0.008565491996705532, -0.000...
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": "iscsi_properties", "annotation": null, "type_comment": null}}, {"...
def _run_iscsiadm(self, iscsi_properties, iscsi_command, **kwargs): check_exit_code = kwargs.pop('check_exit_code', 0) (out, err) = utils.execute('iscsiadm', '-m', 'node', '-T', iscsi_properties['target_iqn'], '-p', iscsi_properties['...
16,152
[ 0.053965963423252106, -0.00136563868727535, 0.029045680537819862, -0.004802970681339502, -0.010073646903038025, -0.01556618232280016, -0.07651174813508987, -0.02179025672376156, 0.030676651746034622, -0.015734076499938965, 0.018504329025745392, -0.015002538450062275, -0.013443521223962307, ...
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 name(self): if len(self.parts) > 1: name = self.parts[1] return self.validated(name) if len(self.parts): name = self.parts[0] return self.validated(name) return 'amqp'
16,153
[ 0.004479558207094669, -0.04047030583024025, -0.0010109456488862634, -0.00015030542272143066, -0.040903374552726746, 0.0001191785850096494, 0.053354110568761826, 0.03811008110642433, -0.04267895966768265, -0.02392706647515297, 0.024360137060284615, -0.0411415621638298, 0.029383737593889236, ...
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 BuildEPYDoc(steps.BuildStepMixin, unittest.TestCase): def setUp(self): return self.setUpBuildStep() def tearDown(self): return self.tearDownBuildStep() def test_sample(self): self.setupStep(python.BuildEPYDoc()) self.expectCommands( ExpectShell(workdir='w...
16,154
[ 0.020154017955064774, -0.03220364823937416, 0.013998487032949924, 0.006452613044530153, -0.024717193096876144, -0.007290383335202932, 0.02923283353447914, 0.05304689705371857, 0.0023707114160060883, 0.007991496473550797, 0.029209066182374954, -0.03339197486639023, 0.03277404606342316, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_sample(self): self.setupStep(python.BuildEPYDoc()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'epydocs']) + ExpectShell.log('stdio', stdout=epydoc_output) + 1, ) self.expectOutcome(result=F...
16,155
[ 0.011192701756954193, -0.01468596514314413, 0.0026541079860180616, 0.006410257425159216, -0.012891806662082672, -0.0092619014903903, 0.010206508450210094, 0.04961860179901123, 0.00036091115907765925, 0.04771750792860985, 0.008863859809935093, 0.00033491963404230773, 0.044295534491539, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_error(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('W: 11: Bad indentation. Found 6 spaces, expected 4\n' ...
16,156
[ 0.01885826326906681, -0.016044119372963905, 0.007391504943370819, -0.012062282301485538, 0.020761605352163315, 0.001474943826906383, 0.013370099477469921, 0.05689006671309471, 0.016044119372963905, 0.03703926503658295, 0.010229001753032207, 0.014829717576503754, 0.008897830732166767, -0.04...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_success(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log('stdio', stdout='Your code has been rated at 10/10') + python.PyLint.RC_OK) ...
16,157
[ -0.0028511465061455965, -0.009123669005930424, 0.011898883618414402, -0.010791179724037647, -0.011857196688652039, -0.005139507818967104, 0.02207070216536522, 0.039281800389289856, 0.006979725789278746, 0.04404611885547638, 0.0076050423085689545, 0.006807019468396902, 0.021999238058924675, ...
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_failure(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('W: 11: Bad indentation. Found 6 spaces, expected 4\n' ...
16,158
[ 0.01908649131655693, -0.011522232554852962, 0.021876147016882896, -0.02401011623442173, 0.004324562847614288, -0.012243489734828472, 0.010055875405669212, 0.030781587585806847, 0.01223156787455082, 0.032617516815662384, 0.02882644534111023, 0.027014359831809998, 0.002473733387887478, -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 test_header_output(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', header='W: 11: Bad indentation. Found 6 spaces, expected 4\n') ...
16,159
[ 0.014068299904465675, -0.0036876904778182507, 0.006645026616752148, 0.007471165154129267, -0.024508774280548096, -0.003098019165918231, 0.012595618143677711, 0.027633732184767723, 0.004091780167073011, 0.05890726298093796, -0.007531030103564262, 0.005579427815973759, 0.029932552948594093, ...
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_regex_text(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('W: 11: Bad indentation. Found 6 spaces, expected 4\n' ...
16,160
[ -0.01108331698924303, -0.021746158599853516, -0.022878209128975868, 0.001551179215312004, -0.006646755617111921, -0.024301359429955482, 0.002680534729734063, 0.03008020855486393, 0.035708118230104446, 0.057745374739170074, -0.0036953375674784184, -0.00047404630458913743, 0.0045066406019032, ...
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_failure_zero_returncode(self): # Make sure that errors result in a failed step when pylint's # return code is 0, e.g. when run through a wrapper script. self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pyli...
16,161
[ 0.0067535508424043655, 0.009990639053285122, 0.021220238879323006, 0.0020725263748317957, -0.02199762687087059, -0.02431764081120491, 0.007694918196648359, -0.002807399956509471, -0.009480479173362255, 0.048125121742486954, -0.0005447024013847113, 0.00525951012969017, 0.0375332236289978, -...
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_regex_text_0_24(self): # pylint >= 0.24.0 prints out column offsets when using text format self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', ...
16,162
[ 0.027423536404967308, 0.005538881756365299, 0.04204443842172623, 0.001417411956936121, -0.0014936922816559672, -0.01569194160401821, 0.005040724761784077, 0.004483412019908428, -0.00302318949252367, 0.046677298843860626, -0.015804026275873184, 0.01910431496798992, 0.019477933645248413, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_regex_text_131(self): # at least pylint 1.3.1 prints out space padded column offsets when # using text format self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( ...
16,163
[ 0.0082694161683321, -0.005101104732602835, 0.004413005895912647, -0.0025429066736251116, -0.007590492721647024, -0.025101838633418083, 0.0011613576207309961, 0.003422143869102001, -0.01582932658493519, 0.041053492575883865, 0.019205598160624504, -0.01239189226180315, 0.05201414227485657, -...
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_regex_text_ids_0_24(self): # pylint >= 0.24.0 prints out column offsets when using text format self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', ...
16,164
[ 0.019959913566708565, -0.016594650223851204, -0.004438246134668589, -0.0010844134958460927, -0.013656141236424446, -0.005306995939463377, 0.0032616229727864265, 0.02972649410367012, -0.004237061832100153, 0.05423438921570778, 0.012095439247786999, -0.011260219849646091, 0.04238281026482582, ...
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_regex_text_ids(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('W0311: 11: Bad indentation.\n' 'C011...
16,165
[ 0.009962477721273899, -0.019029708579182625, -0.01269412413239479, 0.0018091422971338034, -0.013887785375118256, -0.006714342627674341, 0.010456010699272156, 0.019316647201776505, 0.01431245356798172, 0.0457952581346035, -0.0033743875101208687, -0.006352800875902176, 0.030644947662949562, ...
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_regex_parseable(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('test.py:9: [W] Bad indentation.\n' ...
16,166
[ 0.019359901547431946, -0.03624380752444267, -0.010116196237504482, -0.005839214660227299, -0.0025157849304378033, -0.01001008227467537, -0.0006064706831239164, 0.01579918898642063, 0.0022166024427860975, 0.04437921196222305, 0.006696969270706177, -0.019819727167487144, 0.047515470534563065, ...
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_regex_parseable_ids(self): self.setupStep(python.PyLint(command=['pylint'])) self.expectCommands( ExpectShell(workdir='wkdir', command=['pylint']) + ExpectShell.log( 'stdio', stdout=('test.py:9: [W0311] Bad indentation.\n' ...
16,167
[ 0.02158522605895996, 0.005555302370339632, -0.016751764342188835, -0.003354804590344429, 0.02800864353775978, -0.05166717246174812, 0.012172694317996502, 0.023811163380742073, 0.000884014880284667, 0.011702067218720913, 0.04741881415247917, 0.007173876278102398, -0.0123825678601861, -0.003...
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_content_in_header(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', # don't match pyflakes-like output in the header header=...
16,168
[ 0.0009500217856839299, -0.012809433043003082, 0.012548970058560371, -0.028103280812501907, -0.007980850525200367, -0.0215316005051136, 0.005670077167451382, -0.0021938991267234087, -0.0037900693714618683, 0.04365091398358345, 0.028023138642311096, -0.008668740279972553, -0.005102401599287987...
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 PyFlakes(steps.BuildStepMixin, unittest.TestCase): def setUp(self): return self.setUpBuildStep() def tearDown(self): return self.tearDownBuildStep() def test_success(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir'...
16,169
[ -0.019428417086601257, -0.033342327922582626, -0.0020743217319250107, 0.01034607831388712, -0.00835472997277975, -0.03324020653963089, 0.026015186682343483, 0.015011707320809364, 0.02519822306931019, 0.03344444930553436, 0.033010438084602356, 0.008935539983212948, 0.017220061272382736, -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_undefined(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', stdout="foo.py:1: undefined name 'bar'\n") + 1) self.expectO...
16,170
[ 0.0020329987164586782, 0.0027671842835843563, -0.007711491547524929, -0.017552629113197327, 0.003482718486338854, -0.01802739128470421, 0.001990609336644411, 0.025189515203237534, 0.007887831889092922, 0.04096517711877823, 0.010471893474459648, 0.017118562012910843, 0.018569976091384888, -...
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_unused(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', stdout="foo.py:1: 'bar' imported but unused\n") + 1) self.expec...
16,171
[ 0.03338745981454849, 0.023416666314005852, 0.041005898267030716, 0.0022855307906866074, -0.007564973086118698, 0.008520619012415409, 0.008707738481462002, 0.01392703503370285, -0.0030590693932026625, 0.04768873378634453, 0.035713087767362595, -0.005195906851440668, 0.006729618180543184, -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_redefs(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', stdout="foo.py:2: redefinition of unused 'foo' from line 1\n") + 1) ...
16,172
[ 0.0041229440830647945, -0.01555804256349802, 0.00043926548096351326, -0.02198062464594841, 0.010075503960251808, -0.016239415854215622, 0.006605543661862612, 0.026396937668323517, -0.012946108356118202, 0.0473681204020977, 0.02109736204147339, 0.03447248414158821, -0.009924087673425674, -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_importstar(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', stdout="foo.py:1: 'from module import *' used; unable to detect undefined names...
16,173
[ -0.0028436158318072557, -0.008447345346212387, 0.04926302656531334, -0.03194323554635048, -0.03726305812597275, -0.008483782410621643, 0.016991857439279556, 0.011338026262819767, -0.0180728267878294, 0.053295403718948364, 0.02447361871600151, -0.03580557182431221, 0.008119411766529083, -0....
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class TestSphinx(steps.BuildStepMixin, unittest.TestCase): def setUp(self): return self.setUpBuildStep() def tearDown(self): return self.tearDownBuildStep() def test_builddir_required(self): self.assertRaises(config.ConfigErrors, lambda: python.Sphinx()) ...
16,174
[ 0.008209175430238247, -0.006890913937240839, 0.01337569672614336, -0.00993356853723526, -0.015206616371870041, -0.013728564605116844, 0.0233292393386364, 0.03033333830535412, 0.011098699644207954, 0.04058648645877838, 0.02111881971359253, 0.0005904714344069362, 0.007110624574124813, -0.028...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_misc(self): self.setupStep(python.PyFlakes()) self.expectCommands( ExpectShell(workdir='wkdir', command=['make', 'pyflakes']) + ExpectShell.log( 'stdio', stdout="foo.py:2: redefinition of function 'bar' from line 1\n") + 1) ...
16,175
[ 0.000040661016100784764, -0.007908489555120468, 0.051594022661447525, -0.0061459606513381, -0.03600594401359558, -0.009390615858137608, 0.0431705079972744, 0.04710758849978447, -0.00890420377254486, 0.025659671053290367, 0.024263381958007812, -0.01021465566009283, -0.016457898542284966, -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_success(self): self.setupStep(python.Sphinx(sphinx_builddir="_build")) self.expectCommands( ExpectShell(workdir='wkdir', command=['sphinx-build', '.', '_build']) + ExpectShell.log('stdio', stdout=log_output_success) ...
16,176
[ -0.011515695601701736, 0.0003807964385487139, 0.047402363270521164, -0.007132680620998144, -0.0375552698969841, -0.008971666917204857, 0.049823008477687836, 0.03123338706791401, -0.01599271595478058, 0.02782568149268627, 0.014500375837087631, -0.016016216948628426, 0.00149527785833925, -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_failure(self): self.setupStep(python.Sphinx(sphinx_builddir="_build")) self.expectCommands( ExpectShell(workdir='wkdir', command=['sphinx-build', '.', '_build']) + ExpectShell.log('stdio', stdout='oh noes!') ...
16,177
[ 0.010176200419664383, -0.00553319463506341, 0.03214435279369354, -0.02143769897520542, -0.03221752122044563, -0.033461347222328186, 0.04114379733800888, 0.019791459664702415, -0.004755803383886814, 0.027851935476064682, 0.02182791940867901, -0.0015806949231773615, 0.0017011143499985337, 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_nochange(self): self.setupStep(python.Sphinx(sphinx_builddir="_build")) self.expectCommands( ExpectShell(workdir='wkdir', command=['sphinx-build', '.', '_build']) + ExpectShell.log('stdio', stdout=log_output_nochange)...
16,178
[ 0.0013389609521254897, 0.020266998559236526, 0.046498458832502365, 0.0020738679450005293, -0.06504915654659271, 0.0030202697962522507, 0.04143475368618965, 0.01799076609313488, -0.004747224971652031, 0.061105307191610336, 0.015081568621098995, -0.0234074704349041, -0.023285746574401855, -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_warnings(self): self.setupStep(python.Sphinx(sphinx_builddir="_build")) self.expectCommands( ExpectShell(workdir='wkdir', command=['sphinx-build', '.', '_build']) + ExpectShell.log('stdio', stdout=log_output_warnings)...
16,179
[ 0.007809806149452925, -0.007249901536852121, 0.052781131118535995, -0.032324399799108505, -0.047124359756708145, -0.0026018256321549416, 0.006482196971774101, 0.02268480323255062, -0.0004617771483026445, 0.05338143929839134, -0.004617771599441767, -0.01957935094833374, 0.022119125351309776, ...
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_constr_args(self): self.setupStep(python.Sphinx(sphinx_sourcedir='src', sphinx_builddir="bld", sphinx_builder='css', sphinx="/path/to/sphinx-build", tags=[...
16,180
[ 0.017603695392608643, 0.017794553190469742, 0.022397559136152267, -0.02211688831448555, -0.0017275310819968581, 0.0030340554658323526, 0.03801410272717476, -0.0010686555178835988, 0.013573258183896542, 0.038103919476270676, 0.021791310980916023, 0.032625216990709305, -0.007768978364765644, ...
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 ThreadRunningTests(BasicThreadTest): def newtask(self): with self.running_mutex: self.next_ident += 1 verbose_print("creating task %s" % self.next_ident) thread.start_new_thread(self.task, (self.next_ident,)) self.created += 1 self.running +...
16,181
[ 0.019892366603016853, -0.05164170265197754, 0.045522697269916534, -0.02667258121073246, -0.004662098363041878, 0.001996241044253111, 0.018244942650198936, -0.0021573409903794527, 0.02041909284889698, 0.021607032045722008, 0.0159026850014925, 0.02357945777475834, -0.017113037407398224, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_stack_size(self): # Various stack size tests. self.assertEqual(thread.stack_size(), 0, "initial stack size is not 0") thread.stack_size(0) self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default") if os.name not in ("nt", "os2", "posix"): ...
16,182
[ -0.0007919836789369583, 0.016564279794692993, 0.034264691174030304, -0.03470364958047867, 0.001817164709791541, -0.001807481748983264, 0.046297356486320496, 0.018061907961964607, 0.02147030085325241, -0.008469343185424805, 0.023742564022541046, 0.03111450746655464, 0.019520804286003113, -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": "ident", "annotation": null, "type_comment": null}}], "kwarg": nul...
def task(self, ident): with self.random_mutex: delay = random.random() / 10000.0 verbose_print("task %s will run for %sus" % (ident, round(delay*1e6))) time.sleep(delay) verbose_print("task %s done" % ident) with self.running_mutex: self.running -= 1 ...
16,183
[ 0.05380784720182419, 0.0038246940821409225, 0.04904187098145485, -0.0022191565949469805, -0.02523583173751831, 0.0032200112473219633, -0.03591161221265793, -0.0029266057536005974, 0.029120100662112236, 0.04449036717414856, -0.011313230730593204, 0.010181311517953873, -0.03155074641108513, ...
14
{"_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": "dummy_parent", "annota...
class EmptyOrDoubleValidator(QtGui.QValidator): def __init__(self, dummy_parent): super(EmptyOrDoubleValidator,self).__init__() def validate(self,teststring, pos): if len(str(teststring))==0: return returnValid(QtGui.QValidator.Acceptable,teststring,pos) else: tr...
16,184
[ 0.03379633650183678, 0.02064291574060917, -0.011128918267786503, -0.007957586087286472, 0.021040795370936394, 0.018887564539909363, 0.02569832280278206, 0.025815347209572792, 0.02843666821718216, 0.04243265837430954, 0.07686091959476471, 0.033515483140945435, -0.012790650129318237, -0.0010...
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__count(self): # Test the _count() function. orig = thread._count() mut = thread.allocate_lock() mut.acquire() started = [] def task(): started.append(None) mut.acquire() mut.release() thread.start_new_thread(task, ()) ...
16,185
[ -0.0020178009290248156, 0.0011457259533926845, 0.014578686095774174, -0.011168573051691055, 0.010681414045393467, -0.02338363602757454, -0.056871309876441956, 0.01816321536898613, 0.014674915000796318, 0.08896366506814957, 0.007812588475644588, 0.03752928972244263, -0.03382447734475136, 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": "teststring", "annotation": null, "type_comment": null}}, {"_type"...
def validate(self,teststring, pos): if len(str(teststring))==0: return returnValid(QtGui.QValidator.Acceptable,teststring,pos) else: try: float(str(teststring)) return returnValid(QtGui.QValidator.Acceptable,teststring,pos) except Value...
16,186
[ 0.026065396144986153, 0.0389074869453907, 0.04012260213494301, -0.03142619505524635, -0.02711373008787632, -0.017237946391105652, -0.03642960637807846, -0.03025873191654682, 0.026684865355491638, 0.04574548453092575, 0.020299559459090233, 0.02513619139790535, -0.021705279126763344, 0.00133...
14
{"_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": "dummy_parent", "annota...
class V3DValidator(QtGui.QValidator): def __init__(self, dummy_parent): super(V3DValidator,self).__init__() def validate(self,teststring, pos): parts=str(teststring).split(',') if len(parts)>3: return returnValid(QtGui.QValidator.Invalid,teststring,pos) if len(parts)...
16,187
[ -0.0012968372320756316, -0.001975026447325945, 0.03239043429493904, -0.029416276142001152, -0.009404610842466354, -0.022341035306453705, -0.06761561334133148, -0.002715661423280835, 0.012210310436785221, 0.06952092796564102, 0.001577116665430367, 0.023119427263736725, -0.03050835058093071, ...
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": "teststring", "annotation": null, "type_comment": null}}, {"_type"...
def validate(self,teststring, pos): parts=str(teststring).split(',') if len(parts)>3: return returnValid(QtGui.QValidator.Invalid,teststring,pos) if len(parts)==3: try: float(parts[0]) float(parts[1]) float(parts[2]) ...
16,188
[ 0.01639186590909958, -0.030474115163087845, -0.012638738378882408, 0.012446270324289799, -0.005455935839563608, -0.049314603209495544, 0.007377943955361843, 0.02976839989423752, 0.06958790868520737, 0.03857916221022606, -0.035713523626327515, -0.022197987884283066, 0.01078890636563301, -0....
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "number", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "character", "annotation": null, "type_comment": null}}], "kwarg...
def translation(number,character): if number==0: return '0' if number==1: return character if number==-1: return '-'+character return str(number)+character
16,189
[ 0.01138533465564251, -0.014971374534070492, 0.05107720196247101, 0.0015910493675619364, -0.04532317817211151, 0.017752941697835922, -0.006926646921783686, -0.02871558628976345, -0.05137717351317406, 0.042159825563430786, 0.00919007882475853, -0.01989365741610527, 0.007437963970005512, -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": "parent", "annotation": null, "type_comment": null}}], "kwarg": nu...
def __init__(self,parent=None): # pylint: disable=unused-argument,super-on-old-class super(DimensionSelectorWidget,self).__init__() #validators self.doubleValidator=EmptyOrDoubleValidator(self) self.positiveDoubleValidator=QtGui.QDoubleValidator(self) self.positiveDoubleV...
16,190
[ 0.014072269201278687, -0.012847169302403927, 0.07285085320472717, -0.018920257687568665, -0.051807962357997894, 0.0033002353738993406, -0.007861603051424026, -0.021566998213529587, -0.030712662264704704, 0.039753507822752, 0.002582864137366414, 0.013875729404389858, -0.014740505255758762, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [{"_type": "Name", "_fields": {"id": "dict", "ctx": {"_type": "Load", "_fields": {}}}}], "func": {"_type": "Attribute", "_fields": {"ctx": {"_type": "Load", ...
class DimensionSelectorWidget(QtGui.QWidget): changed=QtCore.pyqtSignal(dict) def __init__(self,parent=None): # pylint: disable=unused-argument,super-on-old-class super(DimensionSelectorWidget,self).__init__() #validators self.doubleValidator=EmptyOrDoubleValidator(self) ...
16,191
[ 0.03513064607977867, -0.025218263268470764, -0.00869762897491455, 0.02645731158554554, -0.03321133553981781, -0.015512390993535519, 0.0004065625253133476, -0.007361400872468948, -0.007646867539733648, 0.04076709598302841, 0.018354911357164383, 0.04560181125998497, -0.02093018777668476, 0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def stepChanged(self): sender = self.sender() validator = sender.validator() state = validator.validate(sender.text(), 0)[0] if state == QtGui.QValidator.Acceptable: color = '#ffffff' else: color = '#ff0000' sender.setStyleSheet('QLineEdit { backgr...
16,192
[ 0.011505592614412308, -0.017669063061475754, -0.011619112454354763, -0.005492367781698704, -0.04476696997880936, 0.0076659428887069225, 0.024453556165099144, -0.006627568509429693, 0.0010408788220956922, 0.01829676330089569, 0.010303614661097527, 0.001282108947634697, 0.022877631708979607, ...
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": "idx", "annotation": null, "type_comment": null}}], "kwarg": null,...
def comboChanged(self,idx): if self.inhibitSignal: return senderList=[self._comboDim1,self._comboDim2,self._comboDim3,self._comboDim4] senderIndex=senderList.index(self.sender()) #swap names, mins, maxes and steps self.dimNames[idx],self.dimNames[senderIndex]=self.dim...
16,193
[ 0.009538738057017326, -0.015608844347298145, 0.04537927731871605, 0.0317918062210083, -0.04360907897353172, -0.015465314500033855, -0.0167690422385931, -0.027605528011918068, -0.006859519053250551, 0.044853001832962036, -0.002792846877127886, 0.0707600936293602, -0.014795510098338127, 0.01...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def basisChanged(self): sender = self.sender() validator = sender.validator() state = validator.validate(sender.text(), 0)[0] if state == QtGui.QValidator.Acceptable: color = '#ffffff' elif state == QtGui.QValidator.Intermediate: color = '#ffaaaa' ...
16,194
[ 0.024038149043917656, -0.006676522549241781, 0.046955764293670654, -0.015434039756655693, -0.035243503749370575, -0.007296819239854813, 0.005555987358093262, -0.02036973088979721, -0.027773266658186913, 0.0052558439783751965, -0.00046939088497310877, 0.030361169949173927, -0.0340162515640258...
13
{"_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 limitsChanged(self): minSenders=[self._editMin1,self._editMin2,self._editMin3,self._editMin4] maxSenders=[self._editMax1,self._editMax2,self._editMax3,self._editMax4] sender=self.sender() if sender in minSenders: senderIndex=minSenders.index(sender) if len(str...
16,195
[ 0.008938277140259743, -0.0003429443167988211, 0.058893315494060516, -0.0041711959056556225, -0.045088641345500946, -0.022792605683207512, 0.0029328721575438976, -0.018658652901649475, -0.042705100029706955, 0.055020060390233994, -0.0033518539275974035, 0.042009901255369186, -0.01859658211469...
13
{"_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 validateBasis(self): color = '#ff0000' if self._editBasis1.validator().validate(self._editBasis1.text(), 0)[0]==QtGui.QValidator.Acceptable and \ self._editBasis2.validator().validate(self._editBasis2.text(), 0)[0]==QtGui.QValidator.Acceptable and \ self._editBasis3.validator()...
16,196
[ 0.008318261243402958, -0.01303577795624733, 0.10618135333061218, -0.025069845840334892, -0.0647592544555664, -0.0026379514019936323, -0.007458685431629419, 0.0014298069290816784, -0.042721617966890335, 0.04737821966409683, -0.0006176088936626911, 0.00492733484134078, -0.04123258590698242, ...
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": "basis", "annotation": null, "type_comment": null}}], "kwarg": nul...
def updateNames(self,basis): chars=['H','K','L'] for i in range(3): indexMax=numpy.argmax(numpy.abs(basis[i])) self.dimNames[i]='['+','.join([translation(x,chars[indexMax]) for x in basis[i]])+']' self.dimNames[3]='DeltaE' self.updateCombo() self.dimMin=[-...
16,197
[ -0.013771669007837772, -0.0034136571921408176, 0.010670117102563381, -0.010579085908830166, -0.03641234338283539, -0.03675045818090439, 0.0140577657148242, -0.006602988578379154, -0.008673940785229206, 0.008335825987160206, 0.004704344552010298, -0.021015124395489693, -0.04275849461555481, ...
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 updateGui(self): self._editMin1.setText(FloatToQString(self.dimMin[0])) self._editMin2.setText(FloatToQString(self.dimMin[1])) self._editMin3.setText(FloatToQString(self.dimMin[2])) self._editMin4.setText(FloatToQString(self.dimMin[3])) self._editMax1.setText(FloatToQString(s...
16,198
[ 0.03196321800351143, -0.026737485080957413, -0.014079036191105843, 0.0010717824334278703, -0.02825954183936119, 0.020218003541231155, 0.05240952968597412, -0.01826469600200653, -0.0039446670562028885, 0.03150659799575806, -0.004750089254230261, -0.005720401182770729, 0.007851282134652138, ...
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 updateCombo(self): self.inhibitSignal=True self._comboDim1.clear() self._comboDim2.clear() self._comboDim3.clear() self._comboDim4.clear() for name in self.dimNames: self._comboDim1.addItem(name) self._comboDim2.addItem(name) self._...
16,199
[ 0.025573432445526123, 0.0013723756419494748, -0.00619425717741251, -0.02052953839302063, 0.01941709965467453, 0.013374539092183113, -0.05415550619363785, -0.018064476549625397, 0.0295807383954525, -0.019669925794005394, 0.03901117667555809, -0.040073052048683167, 0.039466265588998795, -0.0...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_getitem(self): # Simple positive index self.assertCodeExecution(""" x = (1, 2, 3, 4, 5) print(x[2]) """) # Simple negative index self.assertCodeExecution(""" x = (1, 2, 3, 4, 5) print(x[-2]) """) #...
16,200
[ 0.0063974750228226185, -0.004730179440230131, 0.0027433186769485474, -0.016104839742183685, 0.0475240983068943, 0.02583690732717514, -0.0004403667408041656, -0.059627432376146317, 0.0035908606369048357, -0.0100161237642169, -0.014869806356728077, -0.037199217826128006, 0.034976158291101456, ...
8
{"_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 TupleTests(TranspileTestCase): def test_setattr(self): self.assertCodeExecution(""" x = (1, 2, 3) try: x.attr = 42 except AttributeError as err: print(err) """) def test_getattr(self): self.assertCodeExecution...