Best Python code snippet using autotest_python
_modidx.py
Source:_modidx.py
1# Autogenerated by nbdev2d = { 'settings': { 'branch': 'main',3 'doc_baseurl': '/gingado/',4 'doc_host': 'https://dkgaraujo.github.io',5 'git_url': 'https://github.com/dkgaraujo/gingado',6 'lib_path': 'gingado'},7 'syms': { 'gingado.augmentation': { 'gingado.augmentation.AugmentSDMX': ('augmentation.html#augmentsdmx', 'gingado/augmentation.py'),8 'gingado.augmentation.AugmentSDMX.__init__': ( 'augmentation.html#augmentsdmx.__init__',9 'gingado/augmentation.py'),10 'gingado.augmentation.AugmentSDMX._format_string': ( 'augmentation.html#augmentsdmx._format_string',11 'gingado/augmentation.py'),12 'gingado.augmentation.AugmentSDMX._get_dates': ( 'augmentation.html#augmentsdmx._get_dates',13 'gingado/augmentation.py'),14 'gingado.augmentation.AugmentSDMX._transform': ( 'augmentation.html#augmentsdmx._transform',15 'gingado/augmentation.py'),16 'gingado.augmentation.AugmentSDMX.fit': ( 'augmentation.html#augmentsdmx.fit',17 'gingado/augmentation.py'),18 'gingado.augmentation.AugmentSDMX.fit_transform': ( 'augmentation.html#augmentsdmx.fit_transform',19 'gingado/augmentation.py'),20 'gingado.augmentation.AugmentSDMX.transform': ( 'augmentation.html#augmentsdmx.transform',21 'gingado/augmentation.py')},22 'gingado.benchmark': { 'gingado.benchmark.ClassificationBenchmark': ( 'benchmark.html#classificationbenchmark',23 'gingado/benchmark.py'),24 'gingado.benchmark.ClassificationBenchmark.__init__': ( 'benchmark.html#classificationbenchmark.__init__',25 'gingado/benchmark.py'),26 'gingado.benchmark.ClassificationBenchmark.fit': ( 'benchmark.html#classificationbenchmark.fit',27 'gingado/benchmark.py'),28 'gingado.benchmark.RegressionBenchmark': ('benchmark.html#regressionbenchmark', 'gingado/benchmark.py'),29 'gingado.benchmark.RegressionBenchmark.__init__': ( 'benchmark.html#regressionbenchmark.__init__',30 'gingado/benchmark.py'),31 'gingado.benchmark.RegressionBenchmark.fit': ( 'benchmark.html#regressionbenchmark.fit',32 'gingado/benchmark.py'),33 'gingado.benchmark._benchmark_has': ('benchmark.html#_benchmark_has', 'gingado/benchmark.py'),34 'gingado.benchmark.ggdBenchmark': ('benchmark.html#ggdbenchmark', 'gingado/benchmark.py'),35 'gingado.benchmark.ggdBenchmark._check_is_time_series': ( 'benchmark.html#ggdbenchmark._check_is_time_series',36 'gingado/benchmark.py'),37 'gingado.benchmark.ggdBenchmark._creates_estimator': ( 'benchmark.html#ggdbenchmark._creates_estimator',38 'gingado/benchmark.py'),39 'gingado.benchmark.ggdBenchmark._fit': ('benchmark.html#ggdbenchmark._fit', 'gingado/benchmark.py'),40 'gingado.benchmark.ggdBenchmark._read_attr': ( 'benchmark.html#ggdbenchmark._read_attr',41 'gingado/benchmark.py'),42 'gingado.benchmark.ggdBenchmark._read_candidate_params': ( 'benchmark.html#ggdbenchmark._read_candidate_params',43 'gingado/benchmark.py'),44 'gingado.benchmark.ggdBenchmark.compare': ( 'benchmark.html#ggdbenchmark.compare',45 'gingado/benchmark.py'),46 'gingado.benchmark.ggdBenchmark.compare_fitted_candidates': ( 'benchmark.html#ggdbenchmark.compare_fitted_candidates',47 'gingado/benchmark.py'),48 'gingado.benchmark.ggdBenchmark.decision_function': ( 'benchmark.html#ggdbenchmark.decision_function',49 'gingado/benchmark.py'),50 'gingado.benchmark.ggdBenchmark.document': ( 'benchmark.html#ggdbenchmark.document',51 'gingado/benchmark.py'),52 'gingado.benchmark.ggdBenchmark.fit_predict': ( 'benchmark.html#ggdbenchmark.fit_predict',53 'gingado/benchmark.py'),54 'gingado.benchmark.ggdBenchmark.predict': ( 'benchmark.html#ggdbenchmark.predict',55 'gingado/benchmark.py'),56 'gingado.benchmark.ggdBenchmark.predict_log_proba': ( 'benchmark.html#ggdbenchmark.predict_log_proba',57 'gingado/benchmark.py'),58 'gingado.benchmark.ggdBenchmark.predict_proba': ( 'benchmark.html#ggdbenchmark.predict_proba',59 'gingado/benchmark.py'),60 'gingado.benchmark.ggdBenchmark.score': ('benchmark.html#ggdbenchmark.score', 'gingado/benchmark.py'),61 'gingado.benchmark.ggdBenchmark.score_samples': ( 'benchmark.html#ggdbenchmark.score_samples',62 'gingado/benchmark.py'),63 'gingado.benchmark.ggdBenchmark.set_benchmark': ( 'benchmark.html#ggdbenchmark.set_benchmark',64 'gingado/benchmark.py')},65 'gingado.datasets': { 'gingado.datasets.load_BarroLee_1994': ('datasets.html#load_barrolee_1994', 'gingado/datasets.py'),66 'gingado.datasets.make_causal_effect': ('datasets.html#make_causal_effect', 'gingado/datasets.py')},67 'gingado.model_documentation': { 'gingado.model_documentation.ModelCard': ( 'documentation.html#modelcard',68 'gingado/model_documentation.py'),69 'gingado.model_documentation.ModelCard.__init__': ( 'documentation.html#modelcard.__init__',70 'gingado/model_documentation.py'),71 'gingado.model_documentation.ModelCard.autofill_template': ( 'documentation.html#modelcard.autofill_template',72 'gingado/model_documentation.py'),73 'gingado.model_documentation.ModelCard.fill_model_info': ( 'documentation.html#modelcard.fill_model_info',74 'gingado/model_documentation.py'),75 'gingado.model_documentation.ggdModelDocumentation': ( 'documentation.html#ggdmodeldocumentation',76 'gingado/model_documentation.py'),77 'gingado.model_documentation.ggdModelDocumentation.__getitem__': ( 'documentation.html#ggdmodeldocumentation.__getitem__',78 'gingado/model_documentation.py'),79 'gingado.model_documentation.ggdModelDocumentation.__repr__': ( 'documentation.html#ggdmodeldocumentation.__repr__',80 'gingado/model_documentation.py'),81 'gingado.model_documentation.ggdModelDocumentation.__setitem__': ( 'documentation.html#ggdmodeldocumentation.__setitem__',82 'gingado/model_documentation.py'),83 'gingado.model_documentation.ggdModelDocumentation.__str__': ( 'documentation.html#ggdmodeldocumentation.__str__',84 'gingado/model_documentation.py'),85 'gingado.model_documentation.ggdModelDocumentation._read_attr': ( 'documentation.html#ggdmodeldocumentation._read_attr',86 'gingado/model_documentation.py'),87 'gingado.model_documentation.ggdModelDocumentation.documentation_path': ( 'documentation.html#ggdmodeldocumentation.documentation_path',88 'gingado/model_documentation.py'),89 'gingado.model_documentation.ggdModelDocumentation.fill_info': ( 'documentation.html#ggdmodeldocumentation.fill_info',90 'gingado/model_documentation.py'),91 'gingado.model_documentation.ggdModelDocumentation.open_questions': ( 'documentation.html#ggdmodeldocumentation.open_questions',92 'gingado/model_documentation.py'),93 'gingado.model_documentation.ggdModelDocumentation.read_json': ( 'documentation.html#ggdmodeldocumentation.read_json',94 'gingado/model_documentation.py'),95 'gingado.model_documentation.ggdModelDocumentation.read_model': ( 'documentation.html#ggdmodeldocumentation.read_model',96 'gingado/model_documentation.py'),97 'gingado.model_documentation.ggdModelDocumentation.save_json': ( 'documentation.html#ggdmodeldocumentation.save_json',98 'gingado/model_documentation.py'),99 'gingado.model_documentation.ggdModelDocumentation.setup_template': ( 'documentation.html#ggdmodeldocumentation.setup_template',100 'gingado/model_documentation.py'),101 'gingado.model_documentation.ggdModelDocumentation.show_json': ( 'documentation.html#ggdmodeldocumentation.show_json',102 'gingado/model_documentation.py'),103 'gingado.model_documentation.ggdModelDocumentation.show_template': ( 'documentation.html#ggdmodeldocumentation.show_template',104 'gingado/model_documentation.py')},105 'gingado.utils': { 'gingado.utils.Lag': ('utils.html#lag', 'gingado/utils.py'),106 'gingado.utils.Lag.__init__': ('utils.html#lag.__init__', 'gingado/utils.py'),107 'gingado.utils.Lag.fit': ('utils.html#lag.fit', 'gingado/utils.py'),108 'gingado.utils.Lag.transform': ('utils.html#lag.transform', 'gingado/utils.py'),109 'gingado.utils.get_datetime': ('utils.html#get_datetime', 'gingado/utils.py'),110 'gingado.utils.list_SDMX_sources': ('utils.html#list_sdmx_sources', 'gingado/utils.py'),111 'gingado.utils.list_all_dataflows': ('utils.html#list_all_dataflows', 'gingado/utils.py'),...
0030_remove_model_documentation_source_code_tag.py
Source:0030_remove_model_documentation_source_code_tag.py
1# Generated by Django 2.2.1 on 2019-05-09 17:202from collections import defaultdict3from django.db import migrations4from django.conf import settings5def remove_model_documentation_source_code_tag(apps, schema_editor):6 PublicationModelDocumentations = apps.get_model('citation', 'PublicationModelDocumentations')7 ModelDocumentation = apps.get_model('citation', 'ModelDocumentation')8 AuditCommand = apps.get_model('citation', 'AuditCommand')9 AuditLog = apps.get_model('citation', 'AuditLog')10 User = apps.get_model('auth', 'User')11 def datetime_json_serialize(datetime_obj):12 return str(datetime_obj)13 def date_json_serialize(date_obj):14 return str(date_obj)15 def identity_json_serialize(obj):16 return obj17 DISPATCH_JSON_SERIALIZE = defaultdict(lambda: identity_json_serialize,18 DateTimeField=datetime_json_serialize,19 DateField=date_json_serialize)20 def json_serialize(field_type, obj):21 return DISPATCH_JSON_SERIALIZE[field_type](obj)22 def make_payload(instance):23 """Make an auditlog payload for an INSERT or DELETE statement"""24 data = {}25 labels = {}26 labels['publication'] = '{} ({})'.format(instance.publication.title, instance.publication.id)27 labels['model_documentation'] = '{} ({})'.format(instance.model_documentation.name, instance.model_documentation.id)28 for field in instance._meta.concrete_fields:29 data[field.attname] = json_serialize(field.get_internal_type(), getattr(instance, field.attname))30 payload = {'data': data, 'labels': labels}31 return payload32 def log_delete(self, audit_command: 'AuditCommand'):33 payload = make_payload(self)34 AuditLog.objects.create(35 action='DELETE',36 row_id=self.id,37 table=self._meta.model_name,38 payload=payload,39 audit_command=audit_command)40 info = self.delete()41 return info42 ac = AuditCommand(action='MANUAL', creator=User.objects.get_or_create(defaults={'is_active': False}, username=settings.AUDIT_ACCOUNT_USERNAME)[0])43 ac.save()44 # Delete one at a time so we I don;t have to reindex solr45 for pmd in PublicationModelDocumentations.objects.filter(model_documentation__name='Source code'):46 log_delete(pmd, ac)47 ModelDocumentation.objects.filter(name='Source code').delete()48class Migration(migrations.Migration):49 dependencies = [50 ('citation', '0029_email_workflow'),51 ]52 operations = [53 migrations.RunPython(code=remove_model_documentation_source_code_tag)...
views.py
Source:views.py
...8def handle_rpc(request):9 return rpc_handler_obj.handle_rpc_request(request)10def rpc_documentation(request):11 return rpc_handler_obj.get_rpc_documentation()12def model_documentation(request):13 model_names = ('Plan', 'Host', 'ControlFile', 'TestConfig', 'Job', 'Bug',14 'TestRun', 'DataType', 'History', 'SavedObject', 'KeyVal',15 'AutoProcess')...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!