Best Python code snippet using autotest_python
FireworkShowMixin.py
Source:FireworkShowMixin.py  
...34        self.restoreCameraLens()35        if hasattr(self.getHood(), 'loader'):36            self.getGeom().clearColorScale()37        if hasattr(self.getHood(), 'sky'):38            self.getSky().show()39            self.getSky().clearColorScale()40        if hasattr(base, 'localAvatar') and base.localAvatar:41            base.localAvatar.clearColorScale()42        base.setBackgroundColor(DefaultBackgroundColor)43        self.ignoreAll()44        return45    def startMusic(self):46        if self.timestamp:47            self.getLoader().music.stop()48            t = globalClockDelta.localElapsedTime(self.timestamp) - self.startDelay49            base.playMusic(self.showMusic, 0, 1, 1, max(0, t))50    def shootFirework(self, x, y, z, style, color1, color2):51        amp = 552        Fireworks.shootFirework(style, x, y, z, color1, color2, amp)...graph_radial_setting.py
Source:graph_radial_setting.py  
1# coding: utf-82"""3    SevOne API Documentation4    Supported endpoints by the new RESTful API  # noqa: E5015    OpenAPI spec version: 2.1.18, Hash: db562e66    7    Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9import pprint10import re  # noqa: F40111import six12class GraphRadialSetting(object):13    """NOTE: This class is auto generated by the swagger code generator program.14    Do not edit the class manually.15    """16    """17    Attributes:18      swagger_types (dict): The key is attribute name19                            and the value is attribute type.20      attribute_map (dict): The key is attribute name21                            and the value is json key in definition.22    """23    swagger_types = {24        'draw_graph_outline': 'bool',25        'scaled': 'bool',26        'show_aggregation': 'bool',27        'show_average': 'bool',28        'show_frequency': 'bool',29        'show_last': 'bool',30        'show_legend': 'bool',31        'show_peak': 'bool',32        'show_timespan': 'bool',33        'show_title': 'bool',34        'show_valley': 'bool'35    }36    attribute_map = {37        'draw_graph_outline': 'drawGraphOutline',38        'scaled': 'scaled',39        'show_aggregation': 'showAggregation',40        'show_average': 'showAverage',41        'show_frequency': 'showFrequency',42        'show_last': 'showLast',43        'show_legend': 'showLegend',44        'show_peak': 'showPeak',45        'show_timespan': 'showTimespan',46        'show_title': 'showTitle',47        'show_valley': 'showValley'48    }49    def __init__(self, draw_graph_outline=None, scaled=None, show_aggregation=None, show_average=None, show_frequency=None, show_last=None, show_legend=None, show_peak=None, show_timespan=None, show_title=None, show_valley=None):  # noqa: E50150        """GraphRadialSetting - a model defined in Swagger"""  # noqa: E50151        self._draw_graph_outline = None52        self._scaled = None53        self._show_aggregation = None54        self._show_average = None55        self._show_frequency = None56        self._show_last = None57        self._show_legend = None58        self._show_peak = None59        self._show_timespan = None60        self._show_title = None61        self._show_valley = None62        self.discriminator = None63        if draw_graph_outline is not None:64            self.draw_graph_outline = draw_graph_outline65        if scaled is not None:66            self.scaled = scaled67        if show_aggregation is not None:68            self.show_aggregation = show_aggregation69        if show_average is not None:70            self.show_average = show_average71        if show_frequency is not None:72            self.show_frequency = show_frequency73        if show_last is not None:74            self.show_last = show_last75        if show_legend is not None:76            self.show_legend = show_legend77        if show_peak is not None:78            self.show_peak = show_peak79        if show_timespan is not None:80            self.show_timespan = show_timespan81        if show_title is not None:82            self.show_title = show_title83        if show_valley is not None:84            self.show_valley = show_valley85    @property86    def draw_graph_outline(self):87        """Gets the draw_graph_outline of this GraphRadialSetting.  # noqa: E50188        :return: The draw_graph_outline of this GraphRadialSetting.  # noqa: E50189        :rtype: bool90        """91        return self._draw_graph_outline92    @draw_graph_outline.setter93    def draw_graph_outline(self, draw_graph_outline):94        """Sets the draw_graph_outline of this GraphRadialSetting.95        :param draw_graph_outline: The draw_graph_outline of this GraphRadialSetting.  # noqa: E50196        :type: bool97        """98        self._draw_graph_outline = draw_graph_outline99    @property100    def scaled(self):101        """Gets the scaled of this GraphRadialSetting.  # noqa: E501102        :return: The scaled of this GraphRadialSetting.  # noqa: E501103        :rtype: bool104        """105        return self._scaled106    @scaled.setter107    def scaled(self, scaled):108        """Sets the scaled of this GraphRadialSetting.109        :param scaled: The scaled of this GraphRadialSetting.  # noqa: E501110        :type: bool111        """112        self._scaled = scaled113    @property114    def show_aggregation(self):115        """Gets the show_aggregation of this GraphRadialSetting.  # noqa: E501116        :return: The show_aggregation of this GraphRadialSetting.  # noqa: E501117        :rtype: bool118        """119        return self._show_aggregation120    @show_aggregation.setter121    def show_aggregation(self, show_aggregation):122        """Sets the show_aggregation of this GraphRadialSetting.123        :param show_aggregation: The show_aggregation of this GraphRadialSetting.  # noqa: E501124        :type: bool125        """126        self._show_aggregation = show_aggregation127    @property128    def show_average(self):129        """Gets the show_average of this GraphRadialSetting.  # noqa: E501130        :return: The show_average of this GraphRadialSetting.  # noqa: E501131        :rtype: bool132        """133        return self._show_average134    @show_average.setter135    def show_average(self, show_average):136        """Sets the show_average of this GraphRadialSetting.137        :param show_average: The show_average of this GraphRadialSetting.  # noqa: E501138        :type: bool139        """140        self._show_average = show_average141    @property142    def show_frequency(self):143        """Gets the show_frequency of this GraphRadialSetting.  # noqa: E501144        :return: The show_frequency of this GraphRadialSetting.  # noqa: E501145        :rtype: bool146        """147        return self._show_frequency148    @show_frequency.setter149    def show_frequency(self, show_frequency):150        """Sets the show_frequency of this GraphRadialSetting.151        :param show_frequency: The show_frequency of this GraphRadialSetting.  # noqa: E501152        :type: bool153        """154        self._show_frequency = show_frequency155    @property156    def show_last(self):157        """Gets the show_last of this GraphRadialSetting.  # noqa: E501158        :return: The show_last of this GraphRadialSetting.  # noqa: E501159        :rtype: bool160        """161        return self._show_last162    @show_last.setter163    def show_last(self, show_last):164        """Sets the show_last of this GraphRadialSetting.165        :param show_last: The show_last of this GraphRadialSetting.  # noqa: E501166        :type: bool167        """168        self._show_last = show_last169    @property170    def show_legend(self):171        """Gets the show_legend of this GraphRadialSetting.  # noqa: E501172        :return: The show_legend of this GraphRadialSetting.  # noqa: E501173        :rtype: bool174        """175        return self._show_legend176    @show_legend.setter177    def show_legend(self, show_legend):178        """Sets the show_legend of this GraphRadialSetting.179        :param show_legend: The show_legend of this GraphRadialSetting.  # noqa: E501180        :type: bool181        """182        self._show_legend = show_legend183    @property184    def show_peak(self):185        """Gets the show_peak of this GraphRadialSetting.  # noqa: E501186        :return: The show_peak of this GraphRadialSetting.  # noqa: E501187        :rtype: bool188        """189        return self._show_peak190    @show_peak.setter191    def show_peak(self, show_peak):192        """Sets the show_peak of this GraphRadialSetting.193        :param show_peak: The show_peak of this GraphRadialSetting.  # noqa: E501194        :type: bool195        """196        self._show_peak = show_peak197    @property198    def show_timespan(self):199        """Gets the show_timespan of this GraphRadialSetting.  # noqa: E501200        :return: The show_timespan of this GraphRadialSetting.  # noqa: E501201        :rtype: bool202        """203        return self._show_timespan204    @show_timespan.setter205    def show_timespan(self, show_timespan):206        """Sets the show_timespan of this GraphRadialSetting.207        :param show_timespan: The show_timespan of this GraphRadialSetting.  # noqa: E501208        :type: bool209        """210        self._show_timespan = show_timespan211    @property212    def show_title(self):213        """Gets the show_title of this GraphRadialSetting.  # noqa: E501214        :return: The show_title of this GraphRadialSetting.  # noqa: E501215        :rtype: bool216        """217        return self._show_title218    @show_title.setter219    def show_title(self, show_title):220        """Sets the show_title of this GraphRadialSetting.221        :param show_title: The show_title of this GraphRadialSetting.  # noqa: E501222        :type: bool223        """224        self._show_title = show_title225    @property226    def show_valley(self):227        """Gets the show_valley of this GraphRadialSetting.  # noqa: E501228        :return: The show_valley of this GraphRadialSetting.  # noqa: E501229        :rtype: bool230        """231        return self._show_valley232    @show_valley.setter233    def show_valley(self, show_valley):234        """Sets the show_valley of this GraphRadialSetting.235        :param show_valley: The show_valley of this GraphRadialSetting.  # noqa: E501236        :type: bool237        """238        self._show_valley = show_valley239    def to_dict(self):240        """Returns the model properties as a dict"""241        result = {}242        for attr, _ in six.iteritems(self.swagger_types):243            value = getattr(self, attr)244            if isinstance(value, list):245                result[attr] = list(map(246                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,247                    value248                ))249            elif hasattr(value, "to_dict"):250                result[attr] = value.to_dict()251            elif isinstance(value, dict):252                result[attr] = dict(map(253                    lambda item: (item[0], item[1].to_dict())254                    if hasattr(item[1], "to_dict") else item,255                    value.items()256                ))257            else:258                result[attr] = value259        if issubclass(GraphRadialSetting, dict):260            for key, value in self.items():261                result[key] = value262        return result263    def to_str(self):264        """Returns the string representation of the model"""265        return pprint.pformat(self.to_dict())266    def __repr__(self):267        """For `print` and `pprint`"""268        return self.to_str()269    def __eq__(self, other):270        """Returns true if both objects are equal"""271        if not isinstance(other, GraphRadialSetting):272            return False273        return self.__dict__ == other.__dict__274    def __ne__(self, other):275        """Returns true if both objects are not equal"""...data_inserter.py
Source:data_inserter.py  
...79                execute_dml_statement(statement, show)80                inserted_ids.append(show['id'])81                if len(show['genres']) > 0:82                    genre_ids = get_genre_ids(show['genres'])83                    insert_genres_of_show(genre_ids, show)84            except DataError:85                print('Error while inserting ' + show['title'] + '. Skipping this show...')86            # except IntegrityError:87            #    print('Show (' + show['title'] + ') already exists...')88            insert_seasons_of_show(show['id'])89            insert_cast_of_show(show['id'])90            progress_bar(total_counter + 1, max_show_count, prefix='Inserting shows:', suffix=show['title'])91            total_counter += 192    clear_progress_bar('Inserted ' + str(len(inserted_ids)) + ' shows')93    return inserted_ids94def insert_seasons_of_show(show_id):95    url = f'{TRAKT_API_URL}/shows/{str(show_id)}/seasons?extended=full,episodes'96    season_request = requests.get(url, headers=headers)97    for season_raw in season_request.json():98        statement = """99            INSERT INTO seasons ( id, season_number, title, overview, show_id)100            VALUES (%(id)s, %(season_number)s, %(title)s, %(overview)s, %(show_id)s);101        """102        season = get_season_entity(season_raw, show_id)103        execute_dml_statement(statement, season)104        insert_episodes_of_season(season)105def insert_cast_of_show(show_id):106    url = "{api_url}/shows/{show_id}/people?extended=full".format(107        api_url=TRAKT_API_URL,108        show_id=show_id109    )110    result_set = requests.get(url, headers=headers).json()111    if 'cast' in result_set:112        for actor in result_set['cast']:113            insert_actor_of_show(show_id, actor)114def insert_genres_of_show(genre_ids, show_entity):115    for genre_id in genre_ids:116        execute_dml_statement("""117            INSERT INTO show_genres (show_id, genre_id)118            VALUES (%(show_id)s, %(genre_id)s); """, {119            'show_id': show_entity['id'],120            'genre_id': genre_id121        })122def insert_actor_of_show(show_id, actor):123    actor_id = actor['person']['ids']['trakt']124    existing_actor = execute_select("SELECT id FROM actors WHERE id=%(actor_id)s", {'actor_id': actor_id})125    if len(existing_actor) == 0:126        execute_dml_statement("""127            INSERT INTO actors (id, name, birthday, death, biography)128            VALUES (%(id)s, %(name)s, %(birthday)s, %(death)s, %(biography)s);129        """, {130            "id": actor_id,131            "name": actor['person']['name'],132            "birthday": actor['person']['birthday'],133            "death": actor['person']['death'],134            "biography": actor['person']['biography']135        })136    execute_dml_statement("""...graph_pie_setting.py
Source:graph_pie_setting.py  
1# coding: utf-82"""3    SevOne API Documentation4    Supported endpoints by the new RESTful API  # noqa: E5015    OpenAPI spec version: 2.1.18, Hash: db562e66    7    Generated by: https://github.com/swagger-api/swagger-codegen.git8"""9import pprint10import re  # noqa: F40111import six12class GraphPieSetting(object):13    """NOTE: This class is auto generated by the swagger code generator program.14    Do not edit the class manually.15    """16    """17    Attributes:18      swagger_types (dict): The key is attribute name19                            and the value is attribute type.20      attribute_map (dict): The key is attribute name21                            and the value is json key in definition.22    """23    swagger_types = {24        'show_aggregation': 'bool',25        'show_average': 'bool',26        'show_frequency': 'bool',27        'show_last': 'bool',28        'show_legend': 'bool',29        'show_peak': 'bool',30        'show_timespan': 'bool',31        'show_title': 'bool',32        'show_valley': 'bool'33    }34    attribute_map = {35        'show_aggregation': 'showAggregation',36        'show_average': 'showAverage',37        'show_frequency': 'showFrequency',38        'show_last': 'showLast',39        'show_legend': 'showLegend',40        'show_peak': 'showPeak',41        'show_timespan': 'showTimespan',42        'show_title': 'showTitle',43        'show_valley': 'showValley'44    }45    def __init__(self, show_aggregation=None, show_average=None, show_frequency=None, show_last=None, show_legend=None, show_peak=None, show_timespan=None, show_title=None, show_valley=None):  # noqa: E50146        """GraphPieSetting - a model defined in Swagger"""  # noqa: E50147        self._show_aggregation = None48        self._show_average = None49        self._show_frequency = None50        self._show_last = None51        self._show_legend = None52        self._show_peak = None53        self._show_timespan = None54        self._show_title = None55        self._show_valley = None56        self.discriminator = None57        if show_aggregation is not None:58            self.show_aggregation = show_aggregation59        if show_average is not None:60            self.show_average = show_average61        if show_frequency is not None:62            self.show_frequency = show_frequency63        if show_last is not None:64            self.show_last = show_last65        if show_legend is not None:66            self.show_legend = show_legend67        if show_peak is not None:68            self.show_peak = show_peak69        if show_timespan is not None:70            self.show_timespan = show_timespan71        if show_title is not None:72            self.show_title = show_title73        if show_valley is not None:74            self.show_valley = show_valley75    @property76    def show_aggregation(self):77        """Gets the show_aggregation of this GraphPieSetting.  # noqa: E50178        :return: The show_aggregation of this GraphPieSetting.  # noqa: E50179        :rtype: bool80        """81        return self._show_aggregation82    @show_aggregation.setter83    def show_aggregation(self, show_aggregation):84        """Sets the show_aggregation of this GraphPieSetting.85        :param show_aggregation: The show_aggregation of this GraphPieSetting.  # noqa: E50186        :type: bool87        """88        self._show_aggregation = show_aggregation89    @property90    def show_average(self):91        """Gets the show_average of this GraphPieSetting.  # noqa: E50192        :return: The show_average of this GraphPieSetting.  # noqa: E50193        :rtype: bool94        """95        return self._show_average96    @show_average.setter97    def show_average(self, show_average):98        """Sets the show_average of this GraphPieSetting.99        :param show_average: The show_average of this GraphPieSetting.  # noqa: E501100        :type: bool101        """102        self._show_average = show_average103    @property104    def show_frequency(self):105        """Gets the show_frequency of this GraphPieSetting.  # noqa: E501106        :return: The show_frequency of this GraphPieSetting.  # noqa: E501107        :rtype: bool108        """109        return self._show_frequency110    @show_frequency.setter111    def show_frequency(self, show_frequency):112        """Sets the show_frequency of this GraphPieSetting.113        :param show_frequency: The show_frequency of this GraphPieSetting.  # noqa: E501114        :type: bool115        """116        self._show_frequency = show_frequency117    @property118    def show_last(self):119        """Gets the show_last of this GraphPieSetting.  # noqa: E501120        :return: The show_last of this GraphPieSetting.  # noqa: E501121        :rtype: bool122        """123        return self._show_last124    @show_last.setter125    def show_last(self, show_last):126        """Sets the show_last of this GraphPieSetting.127        :param show_last: The show_last of this GraphPieSetting.  # noqa: E501128        :type: bool129        """130        self._show_last = show_last131    @property132    def show_legend(self):133        """Gets the show_legend of this GraphPieSetting.  # noqa: E501134        :return: The show_legend of this GraphPieSetting.  # noqa: E501135        :rtype: bool136        """137        return self._show_legend138    @show_legend.setter139    def show_legend(self, show_legend):140        """Sets the show_legend of this GraphPieSetting.141        :param show_legend: The show_legend of this GraphPieSetting.  # noqa: E501142        :type: bool143        """144        self._show_legend = show_legend145    @property146    def show_peak(self):147        """Gets the show_peak of this GraphPieSetting.  # noqa: E501148        :return: The show_peak of this GraphPieSetting.  # noqa: E501149        :rtype: bool150        """151        return self._show_peak152    @show_peak.setter153    def show_peak(self, show_peak):154        """Sets the show_peak of this GraphPieSetting.155        :param show_peak: The show_peak of this GraphPieSetting.  # noqa: E501156        :type: bool157        """158        self._show_peak = show_peak159    @property160    def show_timespan(self):161        """Gets the show_timespan of this GraphPieSetting.  # noqa: E501162        :return: The show_timespan of this GraphPieSetting.  # noqa: E501163        :rtype: bool164        """165        return self._show_timespan166    @show_timespan.setter167    def show_timespan(self, show_timespan):168        """Sets the show_timespan of this GraphPieSetting.169        :param show_timespan: The show_timespan of this GraphPieSetting.  # noqa: E501170        :type: bool171        """172        self._show_timespan = show_timespan173    @property174    def show_title(self):175        """Gets the show_title of this GraphPieSetting.  # noqa: E501176        :return: The show_title of this GraphPieSetting.  # noqa: E501177        :rtype: bool178        """179        return self._show_title180    @show_title.setter181    def show_title(self, show_title):182        """Sets the show_title of this GraphPieSetting.183        :param show_title: The show_title of this GraphPieSetting.  # noqa: E501184        :type: bool185        """186        self._show_title = show_title187    @property188    def show_valley(self):189        """Gets the show_valley of this GraphPieSetting.  # noqa: E501190        :return: The show_valley of this GraphPieSetting.  # noqa: E501191        :rtype: bool192        """193        return self._show_valley194    @show_valley.setter195    def show_valley(self, show_valley):196        """Sets the show_valley of this GraphPieSetting.197        :param show_valley: The show_valley of this GraphPieSetting.  # noqa: E501198        :type: bool199        """200        self._show_valley = show_valley201    def to_dict(self):202        """Returns the model properties as a dict"""203        result = {}204        for attr, _ in six.iteritems(self.swagger_types):205            value = getattr(self, attr)206            if isinstance(value, list):207                result[attr] = list(map(208                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,209                    value210                ))211            elif hasattr(value, "to_dict"):212                result[attr] = value.to_dict()213            elif isinstance(value, dict):214                result[attr] = dict(map(215                    lambda item: (item[0], item[1].to_dict())216                    if hasattr(item[1], "to_dict") else item,217                    value.items()218                ))219            else:220                result[attr] = value221        if issubclass(GraphPieSetting, dict):222            for key, value in self.items():223                result[key] = value224        return result225    def to_str(self):226        """Returns the string representation of the model"""227        return pprint.pformat(self.to_dict())228    def __repr__(self):229        """For `print` and `pprint`"""230        return self.to_str()231    def __eq__(self, other):232        """Returns true if both objects are equal"""233        if not isinstance(other, GraphPieSetting):234            return False235        return self.__dict__ == other.__dict__236    def __ne__(self, other):237        """Returns true if both objects are not equal"""...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!!
