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
11,201
[ 0.008651478216052055, 0.009916868060827255, 0.007163111586123705, 0.02987881563603878, -0.009978186339139938, -0.0314396508038044, -0.019610760733485222, 0.020212795585393906, 0.032353851944208145, 0.04212021082639694, 0.02695782668888569, 0.0019663716666400433, 0.012720794416964054, -0.00...
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": "cpu", "annotation": null, "type_comment": null}}], "kwarg": null,...
def get_cpuidle_states(self, cpu=0): if isinstance(cpu, int): cpu = 'cpu{}'.format(cpu) states_dir = self.device.path.join(self.device.path.dirname(self.root_path), cpu, 'cpuidle') idle_states = [] for state in self.device.listdir(states_dir): if state.startswith(...
11,202
[ 0.02983219362795353, 0.024554364383220673, 0.004493516869843006, 0.003185385139659047, -0.013341808691620827, 0.0023048031143844128, -0.04389885440468788, -0.01698872074484825, 0.052506472915410995, -0.008211215026676655, 0.005725198891013861, -0.02602672018110752, -0.0071069481782615185, ...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "cpuidle"}}, "targets": [{"_type": "Name", "_fields": {"id": "name", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ...
class Cpuidle(Module): name = 'cpuidle' description = """ Adds cpuidle state query and manupution APIs to a Device interface. """ capabilities = ['cpuidle'] root_path = '/sys/devices/system/cpu/cpuidle' def probe(self, device): return device.file_exists(self.root_path) def i...
11,203
[ -0.025374963879585266, 0.007897088304162025, 0.012763519771397114, -0.0070932586677372456, 0.010840845294296741, -0.027265051379799843, 0.011677263304591179, 0.013458725064992905, -0.003782890038564801, -0.04731735587120056, 0.017619088292121887, -0.02800370566546917, 0.03050209768116474, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Doc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockES", "annotation": null, "type_comment": null}}], "kwarg": nul...
def test_default_client_injected(Doc, MockES): try: Doc._es = MockES() doc = Doc(id=MockES.test_id) doc.save() Doc.get(id=MockES.test_id) except ClientError: pytest.fail("Doc has no default connection")
11,204
[ -0.015796279534697533, 0.022231392562389374, 0.00898715853691101, -0.019096337258815765, 0.02294640615582466, -0.013805244117975235, -0.01633528806269169, 0.003968320321291685, 0.0027115480042994022, -0.038038671016693115, 0.013794243335723877, -0.04558480530977249, 0.025212446227669716, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "Doc", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockES", "annotation": null, "type_comment": null}}], "kwarg": nul...
def test_default_client_injected_as_lambda(Doc, MockES): try: Doc._es = classmethod(lambda cls: MockES()) doc = Doc(id=MockES.test_id) doc.save() Doc.get(id=MockES.test_id) except ClientError: pytest.fail("Doc has no default connection")
11,205
[ -0.0003590405103750527, 0.008519507944583893, 0.01612170599400997, -0.03494947403669357, 0.02235940843820572, 0.019481351599097252, 0.026900088414549828, -0.04783766716718674, 0.008525241166353226, -0.033412981778383255, 0.01762380078434944, -0.054121233522892, 0.013805501163005829, 0.0012...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "DocWithDefaultClient", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "MockES", "annotation": null, "type_comment": null...
def test_compare_attributed_values_against_fields(DocWithDefaultClient, MockES): doc = DocWithDefaultClient(id=MockES.test_id) doc.document_id = 123456 doc.house_number = "42" with pytest.raises(KeyError): # invalid field doc.name = 'Bruno' with pytest.raises(ValueError): # uncastable ...
11,206
[ 0.014296120032668114, 0.03493570536375046, 0.05802405998110771, 0.010477214120328426, -0.030924398452043533, -0.004028800874948502, -0.018237465992569923, -0.012080571614205837, 0.021735699847340584, 0.03980991616845131, 0.027472805231809616, -0.05727776885032654, 0.02130425162613392, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "MockES", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": ...
def test_validators(MockES): def if_city_state_is_required(obj): if obj.city and not obj.state: raise ValidationError("If city, state is required") def max_len_10(field_name, value): if len(value) > 10: raise ValidationError("Invalid Length") class Address(Document)...
11,207
[ 0.012042525224387646, -0.0026620468124747276, 0.058141037821769714, 0.02335657924413681, -0.00045885093277320266, -0.010039231739938259, -0.01969146355986595, 0.005270027555525303, -0.015001935884356499, -0.014535259455442429, 0.011075025424361229, -0.06574444472789764, 0.04445945471525192, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "doc_type"}}, "targets": [{"_type": "Name", "_fields": {"id": "_doctype", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": nul...
class Address(Document): _doctype = "doc_type" _index = "index" _es = MockES() _validators = [if_city_state_is_required] street = StringField(validators=[max_len_10]) number = IntegerField(required=True) city = StringField() state = StringField()
11,208
[ -0.042876072227954865, -0.05529065430164337, 0.05909247323870659, -0.04217202961444855, -0.025627076625823975, 0.012707932852208614, -0.020076891407370567, -0.010366997681558132, 0.01077182125300169, -0.018328523263335228, -0.0029657708946615458, -0.0003225019318051636, 0.029194217175245285,...
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 TestOTLPHTTPExporter(BaseTestOTLPExporter, TestBase): # pylint: disable=no-self-use def get_span_processor(self): return ExportStatusSpanProcessor(OTLPSpanExporter()) def setUp(self): super().setUp() trace.set_tracer_provider(TracerProvider()) self.tracer = trace.get_...
11,209
[ 0.020905103534460068, -0.02330060303211212, 0.054500505328178406, -0.017317699268460274, -0.024585992097854614, -0.013204453513026237, 0.04491851106286049, 0.009102893061935902, -0.016604892909526825, -0.030031368136405945, -0.005670319776982069, 0.02097521536052227, -0.010879067704081535, ...
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): super().setUp() trace.set_tracer_provider(TracerProvider()) self.tracer = trace.get_tracer(__name__) self.span_processor = self.get_span_processor() trace.get_tracer_provider().add_span_processor(self.span_processor)
11,210
[ -0.006248779129236937, -0.03390771523118019, -0.002495777327567339, -0.015870902687311172, 0.007449988275766373, 0.02320263721048832, 0.006391928065568209, 0.012858543545007706, 0.008638749830424786, 0.01457633450627327, 0.02773362398147583, -0.03848849609494209, -0.028505386784672737, 0.0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class ViewsExceptionTestCase(UrlResetMixin, ModuleStoreTestCase): @patch.dict("django.conf.settings.FEATURES", {"ENABLE_DISCUSSION_SERVICE": True}) def setUp(self): # Patching the ENABLE_DISCUSSION_SERVICE value affects the contents of urls.py, # so we need to call super.setUp() which reloads ...
11,211
[ 0.03450670465826988, -0.03763212636113167, 0.018676308915019035, -0.0012228535488247871, 0.014394733123481274, 0.017609091475605965, 0.02062016911804676, 0.05244612321257591, -0.003973479848355055, -0.005656888708472252, 0.05135349556803703, -0.04101165011525154, -0.040910009294748306, -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 setUp(self): # Patching the ENABLE_DISCUSSION_SERVICE value affects the contents of urls.py, # so we need to call super.setUp() which reloads urls.py (because # of the UrlResetMixin) super(ViewsExceptionTestCase, self).setUp() # create a course self.course = CourseF...
11,212
[ 0.004958662670105696, -0.03192894905805588, -0.030569780617952347, -0.013799019157886505, 0.03222842514514923, 0.015181224793195724, 0.019765539094805717, 0.016932018101215363, 0.03503891080617905, -0.005937724839895964, 0.030754074454307556, -0.055288221687078476, 0.0020761878695338964, -...
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": "mock_threads", "annotation": null, "type_comment": null}}, {"_typ...
def test_user_profile_exception(self, mock_threads, mock_from_django_user): # Mock the code that makes the HTTP requests to the cs_comment_service app # for the profiled user's active threads mock_threads.return_value = [], 1, 1 # Mock the code that makes the HTTP request to the cs_com...
11,213
[ -0.014014466665685177, -0.0070016048848629, -0.01629955694079399, -0.0022231785114854574, -0.0007232365314848721, -0.049934275448322296, -0.0017757286550477147, -0.006179873365908861, 0.01652468927204609, 0.003599297720938921, 0.03674153983592987, -0.022850897163152695, 0.024201689288020134,...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "text", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "thread_id", "annotation": null, "type_comment": null}}], "kwarg":...
def make_mock_request_impl(text, thread_id="dummy_thread_id"): def mock_request_impl(*args, **kwargs): url = args[1] data = None if url.endswith("threads"): data = { "collection": [make_mock_thread_data(text, thread_id, False)] } elif thread_id...
11,214
[ -0.0033021748531609774, -0.027800509706139565, -0.015306416898965836, -0.020227981731295586, 0.019075391814112663, 0.0316271148622036, 0.01345074363052845, 0.020608337596058846, 0.03040536679327488, 0.017311925068497658, 0.035776443779468536, -0.04179297015070915, -0.03420891985297203, -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": "mock_threads", "annotation": null, "type_comment": null}}, {"_typ...
def test_user_followed_threads_exception(self, mock_threads, mock_from_django_user): # Mock the code that makes the HTTP requests to the cs_comment_service app # for the profiled user's active threads mock_threads.return_value = [], 1, 1 # Mock the code that makes the HTTP request to t...
11,215
[ -0.016845660284161568, -0.0034088415559381247, -0.019038058817386627, -0.014966463670134544, 0.010000013746321201, -0.02868012897670269, -0.009491064585745335, -0.011263998225331306, 0.029373642057180405, 0.019407186657190323, 0.03552577644586563, -0.03872488811612129, 0.016756175085902214, ...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": {"_type": "arg", "_fields": {"arg": "kwargs", "annotation": null, "type_comment": null}}, "vararg": {"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment"...
def mock_request_impl(*args, **kwargs): url = args[1] data = None if url.endswith("threads"): data = { "collection": [make_mock_thread_data(text, thread_id, False)] } elif thread_id and url.endswith(thread_id): data = make_mock_thread_d...
11,216
[ -0.004446936305612326, -0.03657658398151398, 0.018508045002818108, -0.03013051114976406, 0.02746906317770481, 0.018959758803248405, 0.01076787244528532, -0.010426036082208157, 0.028372490778565407, -0.00343668507412076, 0.04385283216834068, -0.051959261298179626, -0.0381636843085289, -0.02...
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 SingleThreadTestCase(ModuleStoreTestCase): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory.create(user=self.student, course_id=self.course.id) def test_ajax(self, mock_request): text = "dummy content" ...
11,217
[ -0.01623011752963066, -0.0212110448628664, 0.0021520848385989666, 0.0001522701495559886, 0.013029812835156918, -0.0062141260132193565, 0.003594327485188842, -0.0031822582241147757, 0.04971300810575485, -0.03072774037718773, 0.06905921548604965, -0.02040495164692402, -0.012777157127857208, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_ajax(self, mock_request): text = "dummy content" thread_id = "test_thread_id" mock_request.side_effect = make_mock_request_impl(text, thread_id) request = RequestFactory().get( "dummy_url", HTTP_X_REQUESTED_WITH="XMLHttpRequest" ) request...
11,218
[ 0.020083481445908546, 0.010454929433763027, 0.0012270455481484532, -0.0332554392516613, -0.010730388574302197, 0.0006679103244096041, 0.003856428898870945, 0.01021703239530325, 0.011644411832094193, -0.008426547981798649, 0.048856448382139206, -0.0028970171697437763, -0.04592656344175339, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_skip_limit(self, mock_request): text = "dummy content" thread_id = "test_thread_id" response_skip = "45" response_limit = "15" mock_request.side_effect = make_mock_request_impl(text, thread_id) request = RequestFactory().get( "dummy_url", ...
11,219
[ -0.021877657622098923, -0.014619396068155766, -0.01746554858982563, -0.023054981604218483, 0.02382081374526024, -0.03310224413871765, -0.016002466902136803, 0.018722886219620705, 0.010767373256385326, -0.022209137678146362, 0.014299346134066582, -0.019008643925189972, -0.02871299721300602, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_not_found(self, mock_request): request = RequestFactory().get("dummy_url") request.user = self.student # Mock request to return 404 for thread request mock_request.side_effect = make_mock_request_impl("dummy", thread_id=None) self.assertRaises( Http404, ...
11,220
[ -0.03247147798538208, -0.029161645099520683, 0.00446952972561121, -0.020322883501648903, 0.034678034484386444, -0.024171819910407066, -0.024510324001312256, 0.014806493185460567, 0.039442189037799835, -0.002532524522393942, 0.04220038652420044, -0.05370958149433136, -0.031669095158576965, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_post(self, mock_request): request = RequestFactory().post("dummy_url") response = views.single_thread( request, self.course.id.to_deprecated_string(), "dummy_discussion_id", "dummy_thread_id" ) self.assertEquals(response.status_cod...
11,221
[ -0.023623300716280937, -0.02838851511478424, 0.024472421035170555, -0.0074456483125686646, 0.04058036953210831, 0.004432537127286196, 0.017755495384335518, -0.005674534477293491, 0.046105992048978806, 0.020632367581129074, 0.031176673248410225, -0.0487927608191967, -0.014891296625137329, -...
14
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "userprofile-test-text"}}, "targets": [{"_type": "Name", "_fields": {"id": "TEST_THREAD_TEXT", "ctx": {"_type": "Store", "_fields": {}}}}]...
class UserProfileTestCase(ModuleStoreTestCase): TEST_THREAD_TEXT = 'userprofile-test-text' TEST_THREAD_ID = 'userprofile-test-thread-id' def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() self.profiled_user = UserFactory.create() Cours...
11,222
[ -0.024054473266005516, 0.004261164925992489, -0.046894073486328125, -0.008048529736697674, 0.0060075437650084496, -0.051607780158519745, -0.01028996892273426, 0.01908564567565918, 0.016862429678440094, -0.016352182254195213, 0.04252053424715996, -0.015453176572918892, -0.012130500748753548, ...
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": "mock_request", "annotation": null, "type_comment": null}}, {"_typ...
def get_response(self, mock_request, params, **headers): mock_request.side_effect = make_mock_request_impl(self.TEST_THREAD_TEXT, self.TEST_THREAD_ID) request = RequestFactory().get("dummy_url", data=params, **headers) request.user = self.student mako_middleware_process_request(request)...
11,223
[ -0.019438646733760834, 0.0010423645144328475, -0.011884053237736225, -0.012392294593155384, 0.04896681755781174, -0.0009678538772277534, 0.003422782989218831, 0.004335734527558088, 0.04025769978761673, 0.020793955773115158, 0.04575423151254654, -0.049393489956855774, -0.03586549684405327, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def check_html(self, mock_request, **params): response = self.get_response(mock_request, params) self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'text/html; charset=utf-8') html = response.content self.assertRegexpMatches(html, r'data-page="...
11,224
[ -0.009069296531379223, -0.010609136894345284, -0.04081183299422264, -0.015362029895186424, 0.032421521842479706, 0.018259840086102486, -0.02521943300962448, -0.019629934802651405, 0.047674428671598434, -0.028177866712212563, 0.042436547577381134, -0.0694989413022995, -0.006480666808784008, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def check_ajax(self, mock_request, **params): response = self.get_response(mock_request, params, HTTP_X_REQUESTED_WITH="XMLHttpRequest") self.assertEqual(response.status_code, 200) self.assertEqual(response['Content-Type'], 'application/json; charset=utf-8') response_data = json.loads(re...
11,225
[ -0.030923984944820404, -0.04079548269510269, -0.013661450706422329, -0.009909273125231266, 0.037018124014139175, -0.023293718695640564, -0.008776065893471241, 0.03648929297924042, 0.014001413248479366, -0.0028865323401987553, 0.036917395889759064, -0.03550717979669571, -0.0019217317458242178...
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": "mock_request", "annotation": null, "type_comment": null}}], "kwar...
def test_404_profiled_user(self, mock_request): request = RequestFactory().get("dummy_url") request.user = self.student with self.assertRaises(Http404): response = views.user_profile( request, self.course.id.to_deprecated_string(), -999...
11,226
[ -0.04031973332166672, -0.031780872493982315, 0.007309601176530123, -0.0036907787434756756, 0.036985740065574646, -0.04456517845392227, -0.023673752322793007, 0.025256799533963203, 0.010775514878332615, 0.004053560551255941, 0.03880864381790161, -0.049362294375896454, -0.009582233615219593, ...
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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_404_course(self, mock_request): request = RequestFactory().get("dummy_url") request.user = self.student with self.assertRaises(Http404): response = views.user_profile( request, "non/existent/course", self.profiled_user.id ...
11,227
[ 0.018215522170066833, -0.019643733277916908, -0.0013843094930052757, -0.043876465409994125, 0.005127505864948034, 0.011086182668805122, -0.027065739035606384, 0.06012527272105217, 0.03172497823834419, -0.0024130300153046846, 0.02622286044061184, -0.048699598759412766, -0.0489337332546711, ...
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}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class CommentsServiceRequestHeadersTestCase(UrlResetMixin, ModuleStoreTestCase): @patch.dict("django.conf.settings.FEATURES", {"ENABLE_DISCUSSION_SERVICE": True}) def setUp(self): username = "foo" password = "bar" # Invoke UrlResetMixin super(CommentsServiceRequestHeadersTestCas...
11,228
[ -0.04130592569708824, -0.0402570478618145, -0.010264048352837563, -0.000913088268134743, 0.030817117542028427, -0.04807370528578758, -0.003056114073842764, 0.008103853091597557, 0.03423846885561943, -0.009052840992808342, 0.03908329829573631, -0.03401370719075203, -0.03348926827311516, -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_request", "annotation": null, "type_comment": null}}], "kwar...
def test_post(self, mock_request): mock_request.side_effect = make_mock_request_impl(self.TEST_THREAD_TEXT, self.TEST_THREAD_ID) request = RequestFactory().post("dummy_url") request.user = self.student response = views.user_profile( request, self.course.id.to_depr...
11,229
[ 0.009819131344556808, 0.008138676173985004, 0.007529099006205797, -0.025613214820623398, 0.0010132157476618886, -0.03402647376060486, -0.007935483939945698, -0.014113628305494785, 0.04360397160053253, -0.012641857378184795, 0.042769238352775574, -0.04665734991431236, 0.007633441127836704, ...
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_request", "annotation": null, "type_comment": null}}, {"_typ...
def assert_all_calls_have_header(self, mock_request, key, value): expected = call( ANY, # method ANY, # url data=ANY, params=ANY, headers=PartialDictMatcher({key: value}), timeout=ANY ) for actual in mock_request.call_args_l...
11,230
[ -0.0018848719773814082, -0.04419949650764465, 0.01846873015165329, -0.008528669364750385, 0.008474384434521198, -0.002791118575260043, 0.02165341004729271, 0.07286161184310913, 0.019337279722094536, -0.012045086361467838, 0.024777773767709732, -0.040580540895462036, -0.0032118218950927258, ...
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): username = "foo" password = "bar" # Invoke UrlResetMixin super(CommentsServiceRequestHeadersTestCase, self).setUp() self.course = CourseFactory.create() self.student = UserFactory.create(username=username, password=password) CourseEnrollmentFacto...
11,231
[ 0.03182470425963402, -0.025535855442285538, -0.0010231967316940427, -0.016292816027998924, 0.013002920895814896, -0.022391432896256447, -0.044670961797237396, 0.04281340166926384, 0.0393892265856266, -0.03473413363099098, 0.05313069373369217, -0.05841243267059326, -0.04109012335538864, -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": "mock_request", "annotation": null, "type_comment": null}}], "kwar...
def test_api_key(self, mock_request): mock_request.side_effect = make_mock_request_impl("dummy", "dummy") self.client.get( reverse( "django_comment_client.forum.views.forum_form_discussion", kwargs={"course_id": self.course.id.to_deprecated_string()} ...
11,232
[ 0.013914327137172222, -0.004257284104824066, -0.007150418125092983, 0.009247798472642899, 0.00021616800222545862, -0.007002635393291712, -0.032307613641023636, 0.026919221505522728, 0.004106658976525068, -0.021189792081713676, 0.04478958249092102, -0.06265994161367416, -0.029965821653604507,...
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": "mock_request", "annotation": null, "type_comment": null}}], "kwar...
def test_accept_language(self, mock_request): lang = "eo" text = "dummy content" thread_id = "test_thread_id" mock_request.side_effect = make_mock_request_impl(text, thread_id) self.client.get( reverse( "django_comment_client.forum.views.single_thread...
11,233
[ 0.012234210968017578, -0.00392391299828887, 0.01235905010253191, -0.014696941711008549, -0.0003741620166692883, -0.005717053543776274, 0.03629406914114952, 0.005484399385750294, -0.003160693682730198, -0.020450878888368607, 0.020553020760416985, -0.020428180694580078, -0.046712443232536316, ...
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 InlineDiscussionUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory(user=self.student, course_id=self.course.id) @patch('lms.lib.comment_client.utils.requests.requ...
11,234
[ -0.01592063531279564, 0.0066667660139501095, -0.003453373210504651, -0.00990357156842947, 0.000674212584272027, -0.028493255376815796, -0.0019008185481652617, -0.008194444701075554, 0.017477579414844513, -0.013122817501425743, 0.04818333312869072, -0.01452757976949215, -0.035353176295757294,...
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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _test_unicode_data(self, text, mock_request): mock_request.side_effect = make_mock_request_impl(text) request = RequestFactory().get("dummy_url") request.user = self.student response = views.inline_discussion(request, self.course.id.to_deprecated_string(), "dummy_discussion_id") ...
11,235
[ -0.013982734642922878, -0.006729409098625183, -0.00813233945518732, 0.004540605004876852, 0.001816241885535419, -0.02454255148768425, -0.005250801797956228, -0.01755700632929802, 0.031202105805277824, -0.014623075723648071, 0.04889881983399391, -0.014308726415038109, -0.026894351467490196, ...
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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _test_unicode_data(self, text, mock_request): mock_request.side_effect = make_mock_request_impl(text) request = RequestFactory().get("dummy_url") request.user = self.student request.META["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" # so request.is_ajax() == True response = vi...
11,236
[ 0.02006302773952484, -0.026187768206000328, 0.01623506471514702, 0.0026246875058859587, -0.012362067587673664, 0.0002042401029029861, 0.037581585347652435, 0.022449875250458717, 0.009969591163098812, 0.0002594781690277159, 0.009507983922958374, -0.012564724311232567, -0.04773694649338722, ...
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 ForumFormDiscussionUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory(user=self.student, course_id=self.course.id) @patch('lms.lib.comment_client.utils.requests.r...
11,237
[ 0.012067576870322227, -0.028849927708506584, 0.016434354707598686, -0.020947067067027092, -0.0035950152669101954, -0.0058710165321826935, 0.054466865956783295, 0.0016052683349698782, 0.003830753965303302, -0.01640067808330059, 0.012336992658674717, -0.021081775426864624, -0.04328611865639686...
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 SingleThreadUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory(user=self.student, course_id=self.course.id) @patch('lms.lib.comment_client.utils.requests.request'...
11,238
[ -0.013459684327244759, -0.020525135099887848, 0.003326650010421872, -0.009137983433902264, -0.0017810824792832136, -0.020678220316767693, 0.01747521571815014, -0.019971676170825958, 0.034785572439432144, -0.025223661214113235, 0.05068283900618553, -0.0003981676127295941, -0.02230327390134334...
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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _test_unicode_data(self, text, mock_request): thread_id = "test_thread_id" mock_request.side_effect = make_mock_request_impl(text, thread_id) request = RequestFactory().get("dummy_url") request.user = self.student request.META["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" # so ...
11,239
[ 0.011603268794715405, -0.038289669901132584, 0.007860459387302399, -0.015508322976529598, -0.01267743855714798, -0.022960374131798744, 0.033008333295583725, 0.0035414027515798807, 0.019816190004348755, 0.000034835331462090835, 0.0010280137648805976, -0.03484337404370308, -0.03741690516471863...
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 UserProfileUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory(user=self.student, course_id=self.course.id) @patch('lms.lib.comment_client.utils.requests.request')...
11,240
[ -0.030430786311626434, -0.012992662377655506, -0.0050412449054419994, -0.006931711453944445, 0.0009738768567331135, -0.03260768949985504, 0.002998967655003071, -0.026145728304982185, 0.039848748594522476, -0.018858838826417923, 0.04335470497608185, -0.016681937500834465, -0.01700274460017681...
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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _test_unicode_data(self, text, mock_request): mock_request.side_effect = make_mock_request_impl(text) request = RequestFactory().get("dummy_url") request.user = self.student request.META["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" # so request.is_ajax() == True response = vi...
11,241
[ -0.03301210701465607, -0.013014388270676136, 0.0015474425163120031, -0.013449376448988914, 0.002507062628865242, -0.026404982432723045, 0.00020022700482513756, -0.022196173667907715, 0.03710335120558739, -0.011027548462152481, 0.04857764393091202, -0.014201789163053036, -0.02861519530415535,...
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": "text", "annotation": null, "type_comment": null}}, {"_type": "arg...
def _test_unicode_data(self, text, mock_request): mock_request.side_effect = make_mock_request_impl(text) request = RequestFactory().get("dummy_url") request.user = self.student request.META["HTTP_X_REQUESTED_WITH"] = "XMLHttpRequest" # so request.is_ajax() == True response = vi...
11,242
[ -0.004277219995856285, -0.030727088451385498, 0.019072381779551506, -0.02471027337014675, -0.0023897888604551554, -0.004825507756322622, 0.0353660061955452, 0.011218372732400894, 0.0100643839687109, 0.016374001279473305, 0.020082838833332062, -0.021518146619200706, -0.06338322907686234, -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 FollowedThreadsUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin): def setUp(self): self.course = CourseFactory.create() self.student = UserFactory.create() CourseEnrollmentFactory(user=self.student, course_id=self.course.id) @patch('lms.lib.comment_client.utils.requests.reque...
11,243
[ 0.02951834350824356, 0.04368207976222038, 0.024210108444094658, -0.05422253534197807, 0.025248952209949493, 0.001966833835467696, 0.03717030957341194, 0.034459181129932404, -0.01265614852309227, 0.001036467612721026, 0.03048117272555828, 0.002654117066413164, 0.03283757343888283, 0.0226645...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_TShift_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore=dict(argstr='-ignore %s', ), ignore_exception=dict(nohash=True, usedefault=True, ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, ...
11,244
[ 0.036554258316755295, 0.04275453835725784, 0.08765053749084473, -0.07858667522668839, -0.05333734303712845, -0.03271954506635666, 0.045394014567136765, -0.013433938845992088, 0.029681658372282982, 0.01898679882287979, 0.04479639604687691, 0.02756509743630886, -0.00540968170389533, 0.027963...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "args", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def main(args): train = open(args.base_name + '.train', 'w') validate = open(args.base_name + '.validate', 'w') test = open(args.base_name + '.test', 'w') if args.validation_ratio + args.test_ratio >= 0.9: test_th = 0.8 val_th = 0.6 else: test_th = 1.0 - args.test_ratio ...
11,245
[ 0.013225858099758625, 0.010676294565200806, -0.012622613459825516, 0.013851866126060486, -0.0018410348566249013, -0.007551942020654678, 0.0422954298555851, 0.021455027163028717, -0.0387897789478302, -0.022615989670157433, 0.024266375228762627, -0.0070340619422495365, 0.010129960253834724, ...
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": "sink_id", "annotation": null, "type_comment": null}}], "kwarg": n...
def __init__(self, sink_id): self.data = StringIO() self.sink_id = sink_id self.struct = TidyOutputSink() self.struct.sinkData = ctypes.cast( ctypes.pointer(ctypes.c_int(sink_id)), ctypes.c_void_p) # Windows fix write_func = self.data.write # Avoid 2 attr accesses per...
11,246
[ 0.06512230634689331, 0.03419974446296692, 0.037383295595645905, -0.053652167320251465, 0.01913640834391117, 0.003443968016654253, 0.05018771439790726, 0.01738077402114868, -0.007081056013703346, -0.025164082646369934, 0.030220307409763336, 0.00416377792134881, 0.011598886922001839, -0.0026...
13
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def test_TShift_outputs(): output_map = dict(out_file=dict(), ) outputs = TShift.output_spec() for key, metadata in output_map.items(): for metakey, value in metadata.items(): yield assert_equal, getattr(outputs.traits()[key], metakey), value
11,247
[ -0.01715804450213909, 0.018415125086903572, -0.0005572091904468834, -0.0637802928686142, 0.017191126942634583, 0.023355230689048767, -0.023289069533348083, 0.007239239756017923, 0.03023609332740307, -0.01033231895416975, 0.045210786163806915, -0.027766039595007896, 0.04234376177191734, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def parse_args(argv): # Set up CLI argument parser parser = argparse.ArgumentParser(description='A GUI viewer for inspecting xanespy results.') parser.add_argument('hdf_filename', metavar='filename', type=str, help='Path to HDF5 file with processed data.') parser.add_argument('-g...
11,248
[ -0.042201749980449677, 0.042467474937438965, 0.008418609388172626, -0.05043918639421463, -0.03282895311713219, -0.015967577695846558, 0.020581506192684174, 0.01578640192747116, 0.022683139890432358, -0.002414159942418337, 0.038022641092538834, -0.009946520440280437, 0.023637328296899796, -...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "argv", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "Presenter", "annotation": null, "type_comment": null}}], "kwarg":...
def launch_viewer(argv, Presenter): # Validate arguments args = parse_args(argv) if not os.path.exists(args.hdf_filename): sys.exit("File not found: {}".format(os.path.abspath(args.hdf_filename))) # Prepare logging if args.debug: loglevel = logging.DEBUG else: loglevel = ...
11,249
[ 0.01730346865952015, 0.0018331882311031222, 0.015436000190675259, -0.04730049893260002, 0.02570054866373539, 0.008240369148552418, 0.022853637114167213, 0.02295811101794243, 0.015135637484490871, -0.04061418026685715, 0.03390173986554146, -0.023140940815210342, 0.00024098345602396876, -0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def test_102(self): logger.info("--- test_002 ----------------------------------") # m = pyss_model.PyssModel(optionz=None) t = Storage(m, storageName="S_1", storageSize=3) logger.info("STORAGE_NAME=%s" % t[STORAGE_NAME]) expected = "S_1" self.assertEqual(t[STORA...
11,250
[ -0.0020095373038202524, 0.010184225626289845, -0.04384678602218628, -0.03937472403049469, 0.026729576289653778, 0.002104311715811491, 0.011051652021706104, -0.005336277186870575, 0.02588142640888691, -0.011225136928260326, 0.01994437538087368, -0.015819283202290535, -0.011976906098425388, ...
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_101(self): logger.info("--- test_001 ----------------------------------") # m = pyss_model.PyssModel(optionz=None) t = Storage(m, storageName="S_1", storageSize=3) logger.info("STORAGE_NAME=%s" % t[STORAGE_NAME]) expected = "S_1" self.assertEqual...
11,251
[ 0.017494743689894676, 0.00541346799582243, 0.027305005118250847, -0.04148564860224724, 0.029311949387192726, -0.009315126575529575, 0.019435670226812363, 0.016755344346165657, 0.012252923101186752, -0.04835151135921478, 0.026988118886947632, -0.013758131302893162, -0.017138248309493065, -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_103(self): logger.info("--- test_003 ----------------------------------") # m = pyss_model.PyssModel(optionz=None) t = Storage(m, storageName="S_1", storageSize=3) logger.info("STORAGE_NAME=%s" % t[STORAGE_NAME]) expected = "S_1" self.assertEqual(t[STORA...
11,252
[ -0.0017464145785197616, 0.020229844376444817, -0.04045968875288963, -0.02264495939016342, 0.029500773176550865, 0.02068430185317993, 0.008582751266658306, -0.012250871397554874, 0.03059147112071514, -0.034045346081256866, 0.025956006720662117, -0.017555037513375282, 0.001907097757793963, 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_104(self): logger.info("--- test_004 ----------------------------------") # m = pyss_model.PyssModel(optionz=None) t = Storage(m, storageName="S_1", storageSize=3) logger.info("STORAGE_NAME=%s" % t[STORAGE_NAME]) expected = "S_1" self.assertEqual(t[STORA...
11,253
[ 0.03677240014076233, 0.013676898553967476, 0.0672936961054802, -0.023074522614479065, -0.008333049714565277, -0.006177679169923067, -0.013246873393654823, -0.032933637499809265, -0.03429713100194931, 0.035429880023002625, -0.021385887637734413, -0.03297559171915054, -0.010430732741951942, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": {"_type": "arg", "_fields": {"arg": "options", "annotation": null, "type_comment": null}}, "...
def handle(self, **options): app_name, target = options.pop('name'), options.pop('directory') self.validate_name(app_name, "app") # Check that the app_name cannot be imported. try: import_module(app_name) except ImportError: pass else: ...
11,254
[ 0.022005977109074593, -0.011352874338626862, 0.03811914101243019, -0.03600141033530235, 0.005289721302688122, -0.01998032256960869, 0.012282833456993103, -0.032410476356744766, -0.03881891071796417, 0.030292745679616928, -0.05137797072529793, -0.05425071716308594, 0.0456693060696125, -0.04...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "Creates a Django app directory structure for the given app name in the current directory or optionally in the given directory."}}, "targe...
class Command(TemplateCommand): help = ("Creates a Django app directory structure for the given app " "name in the current directory or optionally in the given " "directory.") missing_args_message = "You must provide an application name." def handle(self, **options): app_nam...
11,255
[ 0.03173629194498062, 0.02303706295788288, -0.005158913321793079, 0.012289573438465595, -0.023766905069351196, 0.041247762739658356, 0.013478507287800312, 0.005188342183828354, -0.017728062346577644, 0.001506031840108335, 0.05659795552492142, -0.008793401531875134, -0.015526768751442432, -0...
13
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs...
class ChunkIndexer: def __init__(self): self.chunks = [ ] # Check if a chunk fits def canHouse(self, chunk, index): if index > 1: if chunk.offset + chunk.size > self.chunks[index-1].offset: return False # We could test now that it fits in the memory ...
11,256
[ 0.0026398468762636185, -0.0411529615521431, -0.03251718357205391, -0.03204651549458504, -0.004872973542660475, -0.00022414397972170264, -0.030716359615325928, -0.015869777649641037, 0.0003434103273320943, 0.029979657381772995, -0.013567585498094559, -0.04878601059317589, -0.00358118768781423...
6
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"args": [], "func": {"_type": "Name", "_fields": {"id": "ForumSimpleSerializer", "ctx": {"_type": "Load", "_fields": {}}}}, "keywords": []}}, "targets": [{"_type": "...
class TopicSerializer(serializers.ModelSerializer): forum = ForumSimpleSerializer() posted_by = UserSimpleSerializer() last_post = PostSimpleSerializer() class Meta: model = Topic fields = ( 'subject', 'forum', 'topic_type', 'posted_by', 'sticky', 'closed', 'hidd...
11,257
[ 0.042937129735946655, 0.039992161095142365, 0.015256910584867, 0.027172891423106194, -0.01509605161845684, 0.03071180172264576, 0.042937129735946655, 0.014749584719538689, -0.026974910870194435, -0.012138710357248783, 0.051722537726163864, 0.009694881737232208, 0.000453190878033638, -0.002...
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": "obj", "annotation": null, "type_comment": null}}], "kwarg": null,...
def yieldChunks(self, obj): while len(self.chunks) > 0: chunk = self.chunks.pop() current_pos = obj.current_size//8 # Check if padding needed size = chunk.offset - current_pos if size > 0: obj.info("Padding of %u bytes needed: curr=%u ...
11,258
[ 0.034385547041893005, -0.00819533783942461, 0.004533591214567423, 0.03108416311442852, -0.015309588983654976, 0.0318746343255043, 0.019157329574227333, -0.00020760796905960888, -0.02496962621808052, 0.019645562395453453, 0.05007874593138695, -0.014286625199019909, -0.027224797755479813, -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": "new_chunk", "annotation": null, "type_comment": null}}], "kwarg":...
def addChunk(self, new_chunk): index = 0 # Find first chunk whose value is bigger while index < len(self.chunks): offset = self.chunks[index].offset if offset < new_chunk.offset: if not self.canHouse(new_chunk, index): raise ParserError...
11,259
[ -0.016848579049110413, -0.006368495058268309, -0.05921582877635956, -0.05362943187355995, 0.0325128436088562, 0.004603192675858736, -0.05738349258899689, -0.04297058284282684, 0.010373943485319614, 0.01239063311368227, 0.03454629331827164, 0.00458922702819109, -0.008005309849977493, 0.0525...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "val", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}...
def parseChannelType(val): val = val.value if val<8: return "Left Sample Channel %u" % val if val<16: return "Right Sample Channel %u" % (val-8) if val<32: return "Adlib channel %u" % (val-16) return "Value %u unknown" % val
11,260
[ 0.045721206814050674, 0.027782851830124855, 0.05788473039865494, 0.007326533552259207, -0.04947257414460182, 0.027419082820415497, -0.003978722728788853, -0.0352855883538723, -0.017176713794469833, 0.0473354309797287, 0.00986154843121767, -0.004385120701044798, -0.0058203027583658695, -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": "size", "annotation": null, "type_comment": null}}], "kwarg": null...
def setCheckedSizes(self, size): # First set size so that end is aligned, if needed self.real_size = size size *= 8 if self.ALIGN: size = alignValue(self.absolute_address+size, 8*self.ALIGN) \ - self.absolute_address if self._parent._size: ...
11,261
[ 0.06896365433931351, 0.014086093753576279, 0.021292120218276978, 0.001834975671954453, 0.0057566724717617035, -0.025029011070728302, 0.006123376544564962, -0.052758824080228806, -0.03450511023402214, -0.007380647584795952, 0.028102340176701546, 0.019708890467882156, -0.039091821759939194, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "parent", "annotation": null, "type_comment": null}}, {"_type": "a...
def __init__(self, parent, name, size, desc=None): Header.__init__(self, parent, name, size, desc) # Overwrite real_size size = 0x60 + self["num_orders"].value + \ 2*(self["num_instruments"].value + self["num_patterns"].value) if self["panning_info"].value == 252: ...
11,262
[ 0.046562064439058304, 0.02384101040661335, 0.033486608415842056, -0.02790084108710289, -0.04314620792865753, -0.01374042872339487, -0.022945046424865723, -0.01986517384648323, 0.02043915167450905, -0.006303238216787577, 0.02734086476266384, -0.02405100129544735, -0.011577518656849861, -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 getLastProperties(self): yield UInt8(self, "glob_vol", "Global volume") yield UInt8(self, "init_speed", "Initial speed (command A)") yield UInt8(self, "init_tempo", "Initial tempo (command T)") yield Bits(self, "volume", 7) yield Bit(self, "stereo") yield UInt8(self, ...
11,263
[ 0.06012703478336334, 0.0339970625936985, 0.04653842747211456, -0.04906713590025902, -0.0054724798537790775, -0.018658792600035667, 0.0014894468476995826, 0.010268083773553371, -0.009067585691809654, -0.01908024400472641, 0.03404814749956131, -0.02799457497894764, 0.005162776913493872, 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 getHeaderEndFields(self): instr = self["num_instruments"].value patterns = self["num_patterns"].value # File pointers if instr > 0: yield GenericVector(self, "instr_pptr", instr, UInt16, "offset") if patterns > 0: yield GenericVector(self, "pattern_ppt...
11,264
[ 0.030750766396522522, -0.004427140578627586, 0.015912801027297974, -0.02664804272353649, -0.0030524658504873514, 0.01713182032108307, 0.01684345118701458, -0.0069602117873728275, -0.020199032500386238, -0.021077251061797142, 0.024262433871626854, -0.03305773064494133, 0.01311429776251316, ...
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 getSubChunks(self): # Instruments - no warranty that they are concatenated for index in xrange(self["num_instruments"].value): yield Chunk(S3MInstrument, "instrument[]", 16*self["instr_pptr/offset[%u]" % index].value, S3MInstrument.static_...
11,265
[ 0.025419851765036583, -0.0006572219426743686, 0.05508081987500191, -0.043350644409656525, 0.00979080330580473, 0.01242136862128973, 0.019192390143871307, 0.0049423761665821075, -0.021031102165579796, -0.0005615955451503396, 0.03164731338620186, -0.006724047474563122, 0.01998424530029297, 0...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "BinOp", "_fields": {"op": {"_type": "Mult", "_fields": {}}, "left": {"_type": "Constant", "_fields": {"kind": null, "value": 8}}, "right": {"_type": "Constant", "_fields": {"kind": nul...
class PTMHeader(Header): # static_size should prime over _size, right? static_size = 8*608 def getTrackerVersion(self, val): val = val.value return "ProTracker x%04X" % val def getFileVersionField(self): yield UInt16(self, "type") yield RawBytes(self, "reserved[]", 1) ...
11,266
[ 0.036169540137052536, 0.004085573833435774, 0.0637851133942604, 0.00010622326954035088, 0.009022584185004234, 0.006544178351759911, 0.024011822417378426, -0.011788101866841316, -0.05454472079873085, 0.022176943719387054, 0.0288564283400774, -0.022810570895671844, 0.0287772249430418, -0.019...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def getSubChunks(self): # It goes like this in the BS: patterns->instruments->instr. samples if self._parent._size: min_off = self.absolute_address+self._parent._size else: min_off = 99999999999 # Instruments and minimal end position for last pattern cou...
11,267
[ 0.06381312757730484, 0.023517338559031487, 0.01979261264204979, 0.010303161107003689, 0.007627089973539114, -0.0513438954949379, 0.009919228032231331, -0.04941850155591965, -0.021672166883945465, 0.0022291045170277357, 0.035092636942863464, 0.02392992377281189, -0.0042318603955209255, -0.0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": 24}}, "targets": [{"_type": "Name", "_fields": {"id": "static_size", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, ...
class S3MUInt24(Field): static_size = 24 def __init__(self, parent, name, desc=None): Field.__init__(self, parent, name, size=24, description=desc) addr = self.absolute_address val = parent.stream.readBits(addr, 8, LITTLE_ENDIAN) << 20 val += parent.stream.readBits(addr+8, 16, LI...
11,268
[ 0.04317331686615944, -0.021610459312796593, -0.037032902240753174, -0.03612849861383438, -0.03205868974328041, -0.008597773499786854, -0.029345480725169182, -0.03151128813624382, 0.0022163810208439827, 0.02491866797208786, -0.025513669475913048, -0.020860757678747177, -0.0014413914177566767,...
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 createDescription(self): info = [self["c4_speed"].display] if "flags/stereo" in self: if self["flags/stereo"].value: info.append("stereo") else: info.append("mono") info.append("%u bits" % self.getSampleBits()) return ", ".join(...
11,269
[ 0.026487192139029503, 0.0008781567448750138, 0.010073586367070675, -0.013384485617280006, 0.00625036284327507, -0.028562108054757118, -0.003320505144074559, -0.026435960084199905, -0.003992931451648474, -0.009612494148314, 0.011751450598239899, -0.037732724100351334, 0.003794405609369278, ...
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 getInstrumentFields(self): yield S3MUInt24(self, "sample_offset") yield UInt32(self, "sample_size") yield UInt32(self, "loop_begin") yield UInt32(self, "loop_end") yield UInt8(self, "volume") yield UInt8(self, "reserved[]") yield Enum(UInt8(self, "packing"), s...
11,270
[ -0.030363423749804497, -0.01619701087474823, 0.02835671417415142, -0.04751601070165634, 0.004577805753797293, -0.02164379321038723, 0.009591593407094479, 0.0058200545608997345, -0.019278744235634804, 0.025131646543741226, -0.003885013284161687, -0.016173122450709343, 0.05346447229385376, -...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"keys": [{"_type": "Constant", "_fields": {"kind": null, "value": 0}}, {"_type": "Constant", "_fields": {"kind": null, "value": 1}}, {"_type": "Constant", "_fields":...
class PTMType(FieldSet): TYPES = {0: "No sample", 1: "Regular", 2: "OPL2/OPL2 instrument", 3: "MIDI instrument" } static_size = 8 def createFields(self): yield Bits(self, "unused", 2) yield Bit(self, "is_tonable") yield Bit(self, "16bits") yield Bit(self, "loop_bidir") ...
11,271
[ -0.0022301978897303343, 0.018147818744182587, -0.020145010203123093, -0.010951269418001175, 0.0004431269771885127, -0.024885013699531555, -0.014166749082505703, -0.007848965004086494, 0.02417933940887451, -0.010125763714313507, 0.022967709228396416, -0.03464462608098984, 0.009346858598291874...
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 getInstrumentFields(self): yield UInt8(self, "volume") yield UInt16(self, "c4_speed") yield UInt16(self, "sample_segment") yield UInt32(self, "sample_offset") yield UInt32(self, "sample_size") yield UInt32(self, "loop_begin") yield UInt32(self, "loop_end") ...
11,272
[ -0.009353677742183208, 0.0008613592362962663, 0.008153371512889862, -0.005429361946880817, 0.009254170581698418, 0.018918806686997414, -0.026618177071213722, 0.009882309474050999, -0.012799113988876343, -0.027215220034122467, -0.004866524133831263, -0.03358368203043938, 0.05522650107741356, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "PTMI"}}, "targets": [{"_type": "Name", "_fields": {"id": "MAGIC", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": null}}, {"...
class PTMInstrument(Instrument): MAGIC = "PTMI" ALIGN = 0 def getType(self): return PTMType(self, "flags") # Hack to have more common code # PTM doesn't pretend to manage 16bits def getSampleBits(self): return 8 def getInstrumentFields(self): yield UInt8(self, "volume"...
11,273
[ 0.06291978061199188, 0.027013907209038734, -0.009359967894852161, -0.01029596384614706, -0.0145859494805336, -0.062087785452604294, 0.016886942088603973, -0.028261901810765266, -0.02714390493929386, 0.019629931077361107, -0.007500973995774984, -0.007552973926067352, -0.006347227841615677, ...
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 createFields(self): # Used by Row to check if end of Row info = self.NOTE_INFO(self, "info") yield info if info["has_note"].value: yield UInt8(self, "note") yield UInt8(self, "instrument") if info["has_volume"].value: yield UInt8(self, "vol...
11,274
[ 0.03892914578318596, -0.005097168032079935, -0.01682094670832157, -0.027161501348018646, -0.010978065431118011, -0.05614780634641647, 0.020201511681079865, -0.017850322648882866, -0.03932685777544975, 0.009773227386176586, -0.01214196253567934, -0.011750098317861557, 0.0016625014832243323, ...
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 Note(FieldSet): def createFields(self): # Used by Row to check if end of Row info = self.NOTE_INFO(self, "info") yield info if info["has_note"].value: yield UInt8(self, "note") yield UInt8(self, "instrument") if info["has_volume"].value: ...
11,275
[ 0.05885313078761101, 0.01730824075639248, 0.05864860117435455, 0.0241216029971838, 0.009203791618347168, -0.05547840893268585, 0.01649012602865696, -0.016387861222028732, -0.04417819902300835, 0.03415629267692566, 0.01859932765364647, 0.0069348011165857315, 0.0005828269058838487, -0.030193...
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 createFields(self): addr = self.absolute_address while True: # Check empty note byte = self.stream.readBits(addr, 8, self.endian) if not byte: yield NullBytes(self, "terminator", 1) return note = self.NOTE(self, "note[]...
11,276
[ 0.05001470074057579, -0.006908955983817577, 0.03716711327433586, -0.0018331763567402959, 0.0001871175627456978, -0.05659816786646843, 0.02586713247001171, -0.029920386150479317, -0.04814774543046951, 0.021826159209012985, 0.000020019180738017894, -0.014653128571808338, 0.007037923205643892, ...
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 Row(FieldSet): def createFields(self): addr = self.absolute_address while True: # Check empty note byte = self.stream.readBits(addr, 8, self.endian) if not byte: yield NullBytes(self, "terminator", 1) return note ...
11,277
[ 0.047458674758672714, 0.04736827686429024, 0.010412659496068954, -0.0338764525949955, 0.005330625921487808, 0.04809145629405975, 0.02815881371498108, -0.006926706526428461, 0.004906888119876385, 0.013152833096683025, 0.0634138286113739, -0.005172430537641048, -0.042622409760951996, 0.00707...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "LITTLE_ENDIAN", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "endian", "ctx": {"_type": "Store", "_fields": {}}}...
class Module(Parser): # MARKER / HEADER are defined in derived classes endian = LITTLE_ENDIAN def validate(self): marker = self.stream.readBits(0x1C*8, 8, LITTLE_ENDIAN) if marker != 0x1A: return "Invalid start marker %u" % marker marker = self.stream.readBytes(0x2C*8, 4...
11,278
[ 0.05420331656932831, 0.04058404639363289, 0.03786931931972504, -0.008743022568523884, 0.0001751955132931471, -0.007129013538360596, 0.0014229511143639684, -0.06602036952972412, -0.035382721573114395, -0.03170985355973244, -0.0061423578299582005, 0.0030882887076586485, 0.05009700357913971, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Name", "_fields": {"id": "S3MRow", "ctx": {"_type": "Load", "_fields": {}}}}, "targets": [{"_type": "Name", "_fields": {"id": "ROW", "ctx": {"_type": "Store", "_fields": {}}}}], "type_...
class S3MPattern(Pattern): ROW = S3MRow def __init__(self, parent, name, size, desc=None): Pattern.__init__(self, parent, name, size, desc) # Get real_size from header addr = self.absolute_address size = self.stream.readBits(addr, 16, LITTLE_ENDIAN) self.setCheckedSizes(...
11,279
[ 0.018163906410336494, 0.002386923646554351, 0.04294624179601669, -0.02269875630736351, -0.0029736964497715235, 0.040151793509721756, -0.029243646189570427, 0.006667453330010176, -0.01962241344153881, 0.052702296525239944, 0.008916492573916912, -0.025027461349964142, 0.0054418183863162994, ...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Dict", "_fields": {"k...
def test_limit_facet_elements(): config = {'FACETS_SIZE_LIMIT': 2} with patch.dict(current_app.config, config): expected = ['foo', 'bar'] result = limit_facet_elements(['foo', 'bar', 'baz']) assert expected == result
11,280
[ 0.07309729605913162, 0.006381609011441469, -0.0037293899804353714, -0.02557653747498989, -0.012199582532048225, 0.04664399102330208, 0.01878785900771618, -0.0020212603267282248, -0.006757366470992565, 0.042786214500665665, 0.04852277413010597, 0.03707470744848251, -0.023522399365901947, 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 validate(self): marker = self.stream.readBits(0x1C*8, 8, LITTLE_ENDIAN) if marker != 0x1A: return "Invalid start marker %u" % marker marker = self.stream.readBytes(0x2C*8, 4) if marker != self.MARKER: return "Invalid marker %s!=%s" % (marker, self.MARKER) ...
11,281
[ 0.026473965495824814, -0.011725238524377346, 0.004467635415494442, -0.03785506635904312, -0.004249476827681065, 0.010342544876039028, -0.020771123468875885, -0.01696103624999523, -0.02716223895549774, -0.020451568067073822, 0.01342134177684784, -0.030431540682911873, 0.01664148084819317, 0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r_r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_replace_refs", "annotation": null, "type_comment": null}}], "...
def test_publication_info_from_conference_recid_and_parent_recid(r_r, mock_replace_refs): conf_rec = {'$ref': 'http://x/y/976391'} parent_rec = {'$ref': 'http://x/y/1402672'} with_title = '2005 International Linear Collider Workshop (LCWS 2005)' r_r.side_effect = mock_replace_refs(with_title, [(conf_re...
11,282
[ 0.03804953023791313, -0.00018108950462192297, 0.02176562137901783, -0.05298161506652832, -0.025721879675984383, 0.019223198294639587, -0.011788161471486092, -0.005630536936223507, -0.03899208828806877, -0.007912516593933105, 0.02056262083351612, -0.047400686889886856, 0.01943403296172619, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r_r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_replace_refs", "annotation": null, "type_comment": null}}], "...
def test_publication_info_from_conference_recid_and_parent_recid_with_pages(r_r, mock_replace_refs): with_title = '50th Rencontres de Moriond on EW Interactions and Unified Theories' conf_rec = {'$ref': 'http://x/y/1331207'} parent_rec = {'$ref': 'http://x/y/1402672'} r_r.side_effect = mock_replace_ref...
11,283
[ 0.025595970451831818, -0.008512658067047596, -0.014370346441864967, -0.044644735753536224, -0.011928032152354717, 0.01121918112039566, -0.00945994071662426, -0.006914521101862192, -0.01818525418639183, -0.01766972616314888, 0.020414913073182106, -0.03564877063035965, 0.00008447814616374671, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r_r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_replace_refs", "annotation": null, "type_comment": null}}], "...
def test_publication_info_with_pub_info_and_conf_info(r_r, mock_replace_refs): with_title = '2005 International Linear Collider Workshop (LCWS 2005)' conf_rec = {'$ref': 'http://x/y/976391'} parent_rec = {'$ref': 'http://x/y/706120'} r_r.side_effect = mock_replace_refs(with_title, [(conf_rec, 976391), ...
11,284
[ 0.028005799278616905, -0.022878505289554596, 0.019894897937774658, -0.036003872752189636, -0.012229031883180141, 0.02017069421708584, -0.02637609653174877, 0.0014487109147012234, -0.022840896621346474, -0.02533559501171112, 0.019067510962486267, -0.018841858953237534, 0.03164128586649895, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "r_r", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "mock_replace_refs", "annotation": null, "type_comment": null}}], "...
def test_publication_info_from_conference_recid_and_not_parent_recid(r_r, mock_replace_refs): with_title = '20th International Workshop on Deep-Inelastic Scattering and Related Subjects' conf_rec = {'$ref': 'http://x/y/1086512'} r_r.side_effect = mock_replace_refs(with_title, [(conf_rec, 1086512)]) wi...
11,285
[ -0.010468159802258015, 0.028535250574350357, 0.046753354370594025, 0.0163938757032156, -0.0027469105552881956, 0.008311707526445389, -0.04095448553562164, -0.005306566134095192, -0.011495042592287064, 0.0005779988714493811, 0.02058597281575203, -0.06765343248844147, -0.001060105045326054, ...
9
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module", "annotation":...
class HBACRuleIPAClient(IPAClient): def __init__(self, module, host, port, protocol): super(HBACRuleIPAClient, self).__init__(module, host, port, protocol) def hbacrule_find(self, name): return self._post_json(method='hbacrule_find', name=None, item={'all': True, 'cn': name}) def hbacrule...
11,286
[ -0.01152616087347269, 0.04668063670396805, 0.03100355714559555, -0.03403379023075104, -0.011569986119866371, 0.04505282640457153, -0.016879158094525337, -0.0037846628110855818, 0.01738002337515354, 0.041972506791353226, 0.03521082550287247, -0.02533125877380371, -0.008107755333185196, 0.00...
16
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): module = AnsibleModule(argument_spec=dict( name=dict(required=True), template=dict(), recreate_instances=dict(type='bool', default=False), # Do not set a default size here. For Create and some update # operations, it is required and should be explicitly set. ...
11,287
[ 0.0027258179616183043, 0.011226502247154713, 0.029414014890789986, -0.013483347371220589, -0.027266837656497955, -0.014199072495102882, -0.03320043161511421, 0.004502145107835531, -0.02507348544895649, 0.0012258244678378105, 0.028652112931013107, -0.061506226658821106, 0.012709901668131351, ...
7
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "description", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "hostcategory", "annotation": null, "type_comment": null}},...
def get_hbacrule_dict(description=None, hostcategory=None, ipaenabledflag=None, servicecategory=None, sourcehostcategory=None, usercategory=None): data = {} if description is not None: data['description'] = description if hostcategory is not None: ...
11,288
[ -0.00758236413821578, 0.006353418342769146, 0.026944058015942574, -0.005194035358726978, 0.003967987839132547, 0.0106895100325346, -0.03223084658384323, -0.008370744995772839, 0.053006988018751144, -0.0061563230119645596, 0.04164503514766693, -0.06116904318332672, -0.06984122842550278, -0....
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "ipa_hbcarule", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "module_hbcarule", "annotation": null, "type_comment": nul...
def get_hbcarule_diff(ipa_hbcarule, module_hbcarule): data = [] for key in module_hbcarule.keys(): module_value = module_hbcarule.get(key, None) ipa_value = ipa_hbcarule.get(key, None) if isinstance(ipa_value, list) and not isinstance(module_value, list): module_value = [modu...
11,289
[ -0.019383665174245834, 0.038105688989162445, -0.012148485518991947, -0.010065537877380848, -0.00877288542687893, 0.04535924643278122, -0.016896381974220276, -0.01521777082234621, 0.04597188159823418, 0.018734276294708252, 0.056607164442539215, -0.04550627991557121, -0.019003834575414658, 0...
10
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "name", "annotation": null, "type_comment": null}}, {"_type": "a...
def modify_if_diff(module, name, ipa_list, module_list, add_method, remove_method, item): changed = False diff = list(set(ipa_list) - set(module_list)) if len(diff) > 0: changed = True if not module.check_mode: remove_method(name=name, item={item: diff}) diff = list(set(modu...
11,290
[ -0.02779184654355049, 0.05157601088285446, 0.026639310643076897, 0.006908670533448458, -0.053802501410245895, 0.02594516985118389, -0.029573040083050728, -0.012815420515835285, 0.031563784927129745, 0.02834192104637623, 0.05320004001259804, -0.05752205103635788, -0.017445212230086327, 0.03...
12
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "module", "annotation": null, "type_comment": null}}, {"_type": "arg", "_fields": {"arg": "client", "annotation": null, "type_comment": null}}], "kwarg": ...
def ensure(module, client): name = module.params['name'] state = module.params['state'] if state in ['present', 'enabled']: ipaenabledflag = 'TRUE' else: ipaenabledflag = 'FALSE' host = module.params['host'] hostcategory = module.params['hostcategory'] hostgroup = module.pa...
11,291
[ -0.03345433622598648, 0.020559966564178467, 0.03347882628440857, -0.006532901898026466, -0.02244575321674347, 0.0340421125292778, -0.02418459579348564, 0.010292229242622852, 0.028825588524341583, 0.040360722690820694, 0.030588921159505844, -0.07092515379190445, -0.01140043418854475, 0.0074...
11
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []}}, "body": [{"_type": "Assign", "_fields": {"value": {"_type": "Call", "_fields": {"a...
def main(): module = AnsibleModule( argument_spec=dict( cn=dict(type='str', required=True, aliases=['name']), description=dict(type='str', required=False), host=dict(type='list', required=False), hostcategory=dict(type='str', required=False, choices=['all']), ...
11,292
[ -0.012497595511376858, -0.010561501607298851, 0.05495026335120201, -0.050730012357234955, -0.041984956711530685, -0.010082916356623173, 0.04335545375943184, 0.0018912266241386533, -0.010474485345184803, -0.015162443742156029, 0.005710389465093613, 0.0066403672099113464, 0.026844268664717674,...
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 Base_Include(ParserTest): def setUp(self): ParserTest.setUp(self) (handle, self._path) = tempfile.mkstemp(prefix="include-", text=True) ks = self.includeKS if six.PY3: ks = ks.encode('utf-8') os.write(handle, ks) os.close(handle) def tearDown(...
11,293
[ 0.0030903241131454706, -0.0069218589924275875, 0.034597624093294144, -0.044636070728302, -0.03938339278101921, -0.012688130140304565, 0.04426254704594612, 0.012221225537359715, -0.009851684793829918, 0.0022250916808843613, 0.03177285194396973, -0.011911900714039803, 0.024722592905163765, -...
8
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def setUp(self): ParserTest.setUp(self) (handle, self._path) = tempfile.mkstemp(prefix="include-", text=True) ks = self.includeKS if six.PY3: ks = ks.encode('utf-8') os.write(handle, ks) os.close(handle)
11,294
[ -0.025916779413819313, -0.03461310639977455, 0.05467493087053299, -0.06479194760322571, -0.006011013872921467, -0.015659848228096962, -0.014239160344004631, -0.01729579083621502, 0.012075841426849365, 0.025658471509814262, -0.015853578224778175, -0.014518992975354195, 0.04662436991930008, ...
11
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n%%packages\n%%include %s\n-packageB\n%%end\n"}}, "targets": [{"_type": "Name", "_fields": {"id": "ks", "ctx": {"_type": "Store", "_fiel...
class Include_Packages_TestCase(Base_Include): ks = """ %%packages %%include %s -packageB %%end """ includeKS = """ packageA """ def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(len(self.handler.packages.packageList), 1) self.assertEqua...
11,295
[ -0.015196633525192738, -0.022538702934980392, 0.05780068784952164, -0.025847647339105606, -0.00841719750314951, 0.003144611371681094, -0.01699037104845047, 0.004099971614778042, 0.015542011708021164, 0.03707800433039665, 0.011313916184008121, -0.017580857500433922, 0.04298285394906998, -0....
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\nrootpw 123456\n%%include %s\ntext\n"}}, "targets": [{"_type": "Name", "_fields": {"id": "ks", "ctx": {"_type": "Store", "_fields": {}}}...
class Include_Commands_TestCase(Base_Include): ks = """ rootpw 123456 %%include %s text """ includeKS = """ autopart clearpart --all zerombr """ def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(self.handler.rootpw.password, "123456") se...
11,296
[ 0.022084185853600502, 0.03665195405483246, 0.023378819227218628, -0.04097577929496765, 0.0030040524434298277, 0.005125114694237709, 0.0161263570189476, 0.04069925472140312, 0.030090801417827606, 0.025628715753555298, -0.011494586244225502, -0.02168196812272072, 0.010608453303575516, -0.008...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(self.handler.rootpw.password, "123456") self.assertEqual(self.handler.displaymode.displayMode, constants.DISPLAY_MODE_TEXT) self.assertTrue(self.handler.autopart.autopart) self.assertEq...
11,297
[ -0.007523464970290661, -0.02307550422847271, 0.04172731563448906, -0.03481530025601387, -0.013207269832491875, -0.0057157063856720924, -0.01755652390420437, -0.012898887507617474, 0.02839243970811367, 0.028286101296544075, -0.0034214486368000507, -0.01331360824406147, 0.015206437557935715, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n%%include %s\n"}}, "targets": [{"_type": "Name", "_fields": {"id": "ks", "ctx": {"_type": "Store", "_fields": {}}}}], "type_comment": n...
class Include_Whole_Script_TestCase(Base_Include): ks = """ %%include %s """ includeKS = """ %pre ls /tmp %end """ def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(len(self.handler.scripts), 1) # Verify the script defaults. scri...
11,298
[ 0.019661521539092064, 0.02415391616523266, 0.01532081700861454, -0.05586905777454376, 0.011417684145271778, 0.0008868104196153581, -0.010064131580293179, 0.014445675536990166, 0.03969643637537956, 0.024340612813830376, -0.0038418727926909924, -0.03932304307818413, 0.006598569918423891, 0.0...
9
{"_type": "Module", "_fields": {"body": [{"_type": "FunctionDef", "_fields": {"args": {"_type": "arguments", "_fields": {"args": [{"_type": "arg", "_fields": {"arg": "self", "annotation": null, "type_comment": null}}], "kwarg": null, "vararg": null, "defaults": [], "kwonlyargs": [], "kw_defaults": [], "posonlyargs": []...
def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(len(self.handler.scripts), 1) # Verify the script defaults. script = self.handler.scripts[0] self.assertEqual(script.interp, "/bin/sh") self.assertFalse(script.inChroot) ...
11,299
[ 0.01534988172352314, 0.02338806353509426, 0.013064974918961525, -0.05286920815706253, 0.010657035745680332, -0.0014346573734655976, -0.011412812396883965, 0.013240736909210682, 0.04152670130133629, 0.02420828677713871, -0.00199343403801322, -0.04054243490099907, 0.0026554709766060114, 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 runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(len(self.handler.scripts), 1) # Verify the script defaults. script = self.handler.scripts[0] self.assertEqual(script.interp, "/bin/sh") self.assertTrue(script.inChroot) ...
11,300
[ -0.014983647502958775, -0.029989009723067284, 0.03533100709319115, -0.02764374390244484, -0.014191034249961376, -0.013029258698225021, -0.01989133469760418, -0.012909824028611183, 0.026992280036211014, 0.017947804182767868, -0.0034961842466145754, -0.023126933723688126, 0.01193262916058302, ...
10
{"_type": "Module", "_fields": {"body": [{"_type": "ClassDef", "_fields": {"body": [{"_type": "Assign", "_fields": {"value": {"_type": "Constant", "_fields": {"kind": null, "value": "\n%%post\n%%include %s\n%%end\n"}}, "targets": [{"_type": "Name", "_fields": {"id": "ks", "ctx": {"_type": "Store", "_fields": {}}}}], "t...
class Include_Post_TestCase(Base_Include): ks = """ %%post %%include %s %%end """ includeKS = """ ls /tmp """ def runTest(self): self.parser.readKickstartFromString(self.ks % self._path) self.assertEqual(len(self.handler.scripts), 1) # Verify the script defaults. script = ...