Best Python code snippet using molecule_python
scalarint.py
Source: scalarint.py
1# coding: utf-82from __future__ import print_function, absolute_import, division, unicode_literals3if False: # MYPY4 from typing import Text, Any, Dict, List # NOQA5__all__ = ['ScalarInt', 'BinaryInt', 'OctalInt', 'HexInt', 'HexCapsInt']6from .compat import no_limit_int # NOQA7class ScalarInt(no_limit_int):8 def __new__(cls, *args, **kw):9 # type: (Any, Any, Any) -> Any10 width = kw.pop('width', None) # type: ignore11 underscore = kw.pop('underscore', None) # type: ignore12 v = no_limit_int.__new__(cls, *args, **kw) # type: ignore13 v._width = width14 v._underscore = underscore15 return v16 def __iadd__(self, a): # type: ignore17 # type: (Any) -> Any18 x = type(self)(self + a)19 x._width = self._width # type: ignore20 x._underscore = ( # type: ignore21 self._underscore[:] if self._underscore is not None else None # type: ignore22 ) # NOQA23 return x24 def __ifloordiv__(self, a): # type: ignore25 # type: (Any) -> Any26 x = type(self)(self // a)27 x._width = self._width # type: ignore28 x._underscore = ( # type: ignore29 self._underscore[:] if self._underscore is not None else None # type: ignore30 ) # NOQA31 return x32 def __imul__(self, a): # type: ignore33 # type: (Any) -> Any34 x = type(self)(self * a)35 x._width = self._width # type: ignore36 x._underscore = ( # type: ignore37 self._underscore[:] if self._underscore is not None else None # type: ignore38 ) # NOQA39 return x40 def __ipow__(self, a): # type: ignore41 # type: (Any) -> Any42 x = type(self)(self ** a)43 x._width = self._width # type: ignore44 x._underscore = ( # type: ignore45 self._underscore[:] if self._underscore is not None else None # type: ignore46 ) # NOQA47 return x48 def __isub__(self, a): # type: ignore49 # type: (Any) -> Any50 x = type(self)(self - a)51 x._width = self._width # type: ignore52 x._underscore = ( # type: ignore53 self._underscore[:] if self._underscore is not None else None # type: ignore54 ) # NOQA55 return x56class BinaryInt(ScalarInt):57 def __new__(cls, value, width=None, underscore=None):58 # type: (Any, Any, Any) -> Any59 return ScalarInt.__new__(cls, value, width=width, underscore=underscore)60class OctalInt(ScalarInt):61 def __new__(cls, value, width=None, underscore=None):62 # type: (Any, Any, Any) -> Any63 return ScalarInt.__new__(cls, value, width=width, underscore=underscore)64# mixed casing of A-F is not supported, when loading the first non digit65# determines the case66class HexInt(ScalarInt):67 """uses lower case (a-f)"""68 def __new__(cls, value, width=None, underscore=None):69 # type: (Any, Any, Any) -> Any70 return ScalarInt.__new__(cls, value, width=width, underscore=underscore)71class HexCapsInt(ScalarInt):72 """uses upper case (A-F)"""73 def __new__(cls, value, width=None, underscore=None):74 # type: (Any, Any, Any) -> Any...
Check out the latest blogs from LambdaTest on this topic:
People love to watch, read and interact with quality content — especially video content. Whether it is sports, news, TV shows, or videos captured on smartphones, people crave digital content. The emergence of OTT platforms has already shaped the way people consume content. Viewers can now enjoy their favorite shows whenever they want rather than at pre-set times. Thus, the OTT platform’s concept of viewing anything, anytime, anywhere has hit the right chord.
When working on web automation with Selenium, I encountered scenarios where I needed to refresh pages from time to time. When does this happen? One scenario is that I needed to refresh the page to check that the data I expected to see was still available even after refreshing. Another possibility is to clear form data without going through each input individually.
Most test automation tools just do test execution automation. Without test design involved in the whole test automation process, the test cases remain ad hoc and detect only simple bugs. This solution is just automation without real testing. In addition, test execution automation is very inefficient.
I was once asked at a testing summit, “How do you manage a QA team using scrum?” After some consideration, I realized it would make a good article, so here I am. Understand that the idea behind developing software in a scrum environment is for development teams to self-organize.
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!!