Best Python code snippet using avocado_python
repository.py
Source:repository.py
...10class Repository:11 # def __init__(self, file_location):12 # self.__file_location = file_location13 # # self.__environment = Environment()14 # self.__load_environment()15 def __int__(self):16 pass17 def get_environment(self):18 return self.__environment19 def __load_environment(self):20 self.__environment.loadEnvironment(self.__file_location)21 def searchAStar(self, mapM, droneD, initialX, initialY, finalX, finalY):22 # TO DO23 # implement the search function and put it in controller24 # returns a list of moves as a list of pairs [x,y]25 # Create start and end node26 start = (initialX, initialY)27 end = (finalX, finalY)28 start_node = Node(None, start)29 start_node.g = start_node.h = start_node.f = 030 end_node = Node(None, end)31 end_node.g = end_node.h = end_node.f = 032 open_list = []33 closed_list = []...
template_content.py
Source:template_content.py
...14 """15 def __init__(self, name, description, environment_config):16 self.name = name17 self.description = description18 self.environment = self.__load_environment(environment_config)19 self.provider = self.environment.provider20 # TODO delete21 self.resource = defaultdict(list)22 self.cluster_info = None23 self.units = []24 @classmethod25 def load_from_template(cls, template):26 env_cfg = template.unit_config()27 return TemplateContent(template.name, template.description, env_cfg)28 @property29 def docker_image(self):30 if self.provider != VE_PROVIDER.DOCKER:31 return ""32 return self.environment.image33 @property34 def network_configs(self):35 if self.provider != VE_PROVIDER.DOCKER:36 return []37 return self.environment.network_configs38 @property39 def yml_template(self):40 if self.provider != VE_PROVIDER.K8S:41 return ""42 return self.environment.yml_template43 @property44 def template_args(self):45 if self.provider != VE_PROVIDER.K8S:46 return {}47 return self.environment.template_args48 def is_valid(self):49 if self.provider is None:50 return False51 if self.provider == VE_PROVIDER.DOCKER:52 return True53 if self.provider == VE_PROVIDER.K8S:54 return self.environment.is_valid() is True55 @classmethod56 def __load_environment(cls, environment_config):57 provider = int(environment_config[TEMPLATE.VIRTUAL_ENVIRONMENT_PROVIDER])58 if provider == VE_PROVIDER.DOCKER:59 return DockerTemplateUnit(environment_config)60 elif provider == VE_PROVIDER.K8S:61 return K8STemplateUnit(environment_config)62 else:63 raise Exception("unsupported virtual environment provider")64 # todo delete65 def get_resource(self, resource_type):66 # always return a list of resource desc dict or empty67 return self.resource[resource_type]68 # FIXME deprecated this when support K8s ONLY69 def to_dict(self):70 dic = {...
front.py
Source:front.py
...10 return flask.render_template(11 'index.html',12 title='Volunteering',13 session=flask.session['user_session'],14 environment=__load_environment()15 )16 17def __load_environment():18 return {19 'env': properties.environment_name()...
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!!