How to use describe_domain method in localstack

Best Python code snippet using localstack_python

aws_codeartifact_info.py

Source:aws_codeartifact_info.py Github

copy

Full Screen

...229 repository=module.params['repository'],230 packagePrefix=module.params['prefix'],231 ), False232 elif module.params['describe_domain']:233 return client.describe_domain(234 domain=module.params['domain'],235 ), False236 elif module.params['describe_repository']:237 return client.describe_repository(238 domain=module.params['domain'],239 repository=module.params['repository'],240 ), False241 else:242 if client.can_paginate('list_domains'):243 paginator = client.get_paginator('list_domains')244 return paginator.paginate(), True245 else:246 return client.list_domains(), False247 except (BotoCoreError, ClientError) as e:...

Full Screen

Full Screen

report.py

Source:report.py Github

copy

Full Screen

...33 :param domain: domain whose description is added to the report34 :type domain: Orange.data.Domain35 """36 name, domain = self._fix_args(name, domain)37 self.report_items(name, describe_domain(domain))38 def report_data_brief(self, name, data=None):39 """40 Add description of data table to the report.41 See :obj:`describe_data_brief` for details.42 The first argument, `name` can be omitted.43 :param name: report section name (can be omitted)44 :type name: str or tuple or OrderedDict45 :param data: data whose description is added to the report46 :type data: Orange.data.Table47 """48 name, data = self._fix_args(name, data)49 self.report_items(name, describe_data_brief(data))50# For backwards compatibility Report shadows the one from the base51Report = DataReport52def describe_domain(domain):53 """54 Return an :obj:`OrderedDict` describing a domain55 Description contains keys "Features", "Meta attributes" and "Targets"56 with the corresponding clipped lists of names. If the domain contains no57 meta attributes or targets, the value is `False`, which prevents it from58 being rendered by :obj:`~Orange.widgets.report.render_items`.59 :param domain: domain60 :type domain: Orange.data.Domain61 :rtype: OrderedDict62 """63 def clip_attrs(items, s):64 return clipped_list([a.name for a in items], 1000,65 total_min=10, total=" (total: {{}} {})".format(s))66 return OrderedDict(67 [("Features", clip_attrs(domain.attributes, "features")),68 ("Meta attributes", bool(domain.metas) and69 clip_attrs(domain.metas, "meta attributes")),70 ("Target", bool(domain.class_vars) and71 clip_attrs(domain.class_vars, "targets variables"))])72def describe_data(data):73 """74 Return an :obj:`OrderedDict` describing the data75 Description contains keys "Data instances" (with the number of instances)76 and "Features", "Meta attributes" and "Targets" with the corresponding77 clipped lists of names. If the domain contains no meta attributes or78 targets, the value is `False`, which prevents it from being rendered.79 :param data: data80 :type data: Orange.data.Table81 :rtype: OrderedDict82 """83 items = OrderedDict()84 if data is None:85 return items86 if isinstance(data, SqlTable):87 items["Data instances"] = data.approx_len()88 else:89 items["Data instances"] = len(data)90 items.update(describe_domain(data.domain))91 return items92def describe_domain_brief(domain):93 """94 Return an :obj:`OrderedDict` with the number of features, metas and classes95 Description contains "Features" and "Meta attributes" with the number of96 featuers, and "Targets" that contains either a name, if there is a single97 target, or the number of targets if there are multiple.98 :param domain: data99 :type domain: Orange.data.Domain100 :rtype: OrderedDict101 """102 items = OrderedDict()103 if domain is None:104 return items...

Full Screen

Full Screen

sagemakerdomain.py

Source:sagemakerdomain.py Github

copy

Full Screen

...11SAGEMAKER_NETWORK_ACCESS_TYPE = 'VpcOnly'12SAGEMAKER_EFS_RETENTION_POLICY = 'Delete'13def delete_domain(domain_id):14 try:15 sm_client.describe_domain(DomainId=domain_id)16 except:17 return18 sm_client.delete_domain(DomainId=domain_id,RetentionPolicy={'HomeEfsFileSystem': SAGEMAKER_EFS_RETENTION_POLICY})19 try:20 while sm_client.describe_domain(DomainId=domain_id):21 time.sleep(5)22 except ClientError as error:23 if error.response['Error']['Code'] == 'ResourceNotFound':24 logger.info(f'SageMaker domain {domain_id} has been deleted')25 return26def handler(event, context):27 response_data = {}28 physicalResourceId = event.get('PhysicalResourceId')29 config = event.get('ResourceProperties')30 try:31 if event['RequestType'] in ['Create', 'Update']:32 if event['RequestType'] == 'Create':33 physicalResourceId = sm_client.create_domain(34 DomainName=config['DomainName'],35 AuthMode=SAGEMAKER_DOMAIN_AUTH_MODE,36 DefaultUserSettings=config['DefaultUserSettings'],37 SubnetIds=config['SageMakerStudioSubnetIds'].split(','),38 VpcId=config['VpcId'],39 AppNetworkAccessType=SAGEMAKER_NETWORK_ACCESS_TYPE40 )['DomainArn'].split('/')[-1]41 logger.info(f'Created SageMaker Studio Domain:{physicalResourceId}')42 else:43 sm_client.update_domain(DomainId=physicalResourceId, DefaultUserSettings=config['DefaultUserSettings'])44 while sm_client.describe_domain(DomainId=physicalResourceId)['Status'] != 'InService':45 time.sleep(5)46 response_data = {'DomainId': physicalResourceId}47 elif event['RequestType'] == 'Delete':48 delete_domain(physicalResourceId)49 cfnresponse.send(event, context, cfnresponse.SUCCESS, response_data, physicalResourceId=physicalResourceId)50 except ClientError as exception:51 logging.error(exception)...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful