code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class AboutRegex(Koan): <NEW_LINE> <INDENT> def test_matching_literal_text(self): <NEW_LINE> <INDENT> string = "Hello, my name is Felix and these koans are based " + "on Ben's book: Regular Expressions in 10 minutes." <NEW_LINE> m = re.search('Felix', string) <NEW_LINE> self.assertTrue( m and m.group(0) and m.gr... | These koans are based on Ben's book: Regular Expressions in 10
minutes. I found this book very useful, so I decided to write
a koan file in order to practice everything it taught me.
http://www.forta.com/books/0672325667/ | 62598ee844b2445a339b5cdb |
class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): <NEW_LINE> <INDENT> _validation = { 'display_name': {'readonly': True}, 'description': {'readonly': True}, 'is_enabled': {'required': True}, 'rule_type': {'required': True}, 'value_type': {'readonly': True}, 'allowlist_values': {'required': True}, } <NEW_LINE> _... | Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar display_name: The display name of the custom ... | 62598ee899fddb7c1ca62177 |
class MySolution: <NEW_LINE> <INDENT> def plusOne(self, digits): <NEW_LINE> <INDENT> n = len(digits) <NEW_LINE> for num in range(n-1,-1,-1): <NEW_LINE> <INDENT> if digits[num]== 9: <NEW_LINE> <INDENT> digits[num] = 0 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> digits[num] += 1 <NEW_LINE> break <NEW_LINE> <DEDENT> <D... | 思路很简单,如果是9就判断一下,如果不是就直接+1返回结果,要注意的是遍历完后如果第一位是0,则说明需要加1
效率:Runtime: 56 ms, faster than 95.99% of Python3 online submissions for Plus One. | 62598ee80c0af96317c54a82 |
class InvalidDOIPrefix(object): <NEW_LINE> <INDENT> def __init__(self, prefix='10.5072', message=None, message_testing=None): <NEW_LINE> <INDENT> self.doi_prefix = prefix <NEW_LINE> if self.doi_prefix[-1] == '/': <NEW_LINE> <INDENT> self.doi_prefix = self.doi_prefix[:-1] <NEW_LINE> <DEDENT> if not message_testing: <NEW... | Validates if DOI | 62598ee8bd1bec0571e1443d |
class RubyRole(Role): <NEW_LINE> <INDENT> version = "1.9.2" <NEW_LINE> patch = 290 <NEW_LINE> url = "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-%s-p%d.tar.gz" <NEW_LINE> def __symlink_from_local(self): <NEW_LINE> <INDENT> commands = "erb gem irb rake rdoc ri ruby testrb" <NEW_LINE> for command in commands.split(): <NEW... | This role provides `Ruby <http://www.ruby-lang.org/>`_ utilities for Debian distributions.
Example:
::
from provy.core import Role
from provy.more.debian import RubyRole
class MySampleRole(Role):
def provision(self):
self.provision_role(RubyRole) | 62598ee84f6381625f19882e |
class Goblinshark(Shark): <NEW_LINE> <INDENT> _validation = { 'fishtype': {'required': True}, 'length': {'required': True}, 'birthday': {'required': True}, } <NEW_LINE> _attribute_map = { 'fishtype': {'key': 'fishtype', 'type': 'str'}, 'species': {'key': 'species', 'type': 'str'}, 'length': {'key': 'length', 'type': 'f... | Goblinshark.
All required parameters must be populated in order to send to Azure.
:param fishtype: Required. Constant filled by server.
:type fishtype: str
:param species:
:type species: str
:param length: Required.
:type length: float
:param siblings:
:type siblings: list[~bodycomplex.models.Fish]
:param age:
:type ... | 62598ee8adb09d7d5dc08cad |
class Dataset(object): <NEW_LINE> <INDENT> def __init__(self, folder_path, train_file, val_file, test_file, glove_file, batch_size): <NEW_LINE> <INDENT> tokenizer = lambda x: x.split() <NEW_LINE> TEXT = tt.data.Field(sequential=True, lower=True, tokenize=tokenizer) <NEW_LINE> POS = tt.data.Field(sequential=True, lower=... | torchtext dataset which provides train, val and test iterators,
loads the embeddings for each tokens and has easy-to-use
text_vocab and bio_vocab | 62598ee80a50d4780f703a91 |
class Agileone(unittest.TestCase): <NEW_LINE> <INDENT> con = None <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.con = Connection('192.168.248.131') <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls): <NEW_LINE> <INDENT> cls.con.close() <NEW_LINE> <DEDENT> def test_01_ac... | Agileone接口测试示例 | 62598ee84428ac0f6e656c37 |
class Wrapper(IOperator): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> self.obj = obj <NEW_LINE> <DEDENT> def operator(self): <NEW_LINE> <INDENT> return self.obj.operator() + 5.0 | Декоратор | 62598ee860cbc95b06362a23 |
class CanvasColorBackground(CanvasComponent): <NEW_LINE> <INDENT> DEFAULTS = { 'paper_bgcolor' : '#fff', 'plot_bgcolor' : '#fff' } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._parameters = {} <NEW_LINE> self._parameters['paper_bgcolor'] = '#fff' <NEW_LINE> self._parameters['plot_bgcolor'] = '#fff' <NEW_LINE... | Configures background colors for paper and plot. | 62598ee82c8b7c6e89bd1ea5 |
class SessionManager(object): <NEW_LINE> <INDENT> def __init__( self, redis_config: RedisConfig, app_secret: str, ttl: int = 600, whitelist: Optional[List[str]] = None, raise_on_unknown: bool = False, ): <NEW_LINE> <INDENT> self.pool = get_redis_pool(redis_config) <NEW_LINE> self.ttl = ttl <NEW_LINE> self.secret = app_... | Factory objects that hold some configuration data and provide
session objects. | 62598ee8e76e3b2f99fd711c |
class StoppedTrackingResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'created_time_entry': 'TimeEntryResponse' } <NEW_LINE> attribute_map = { 'created_time_entry': 'createdTimeEntry' } <NEW_LINE> def __init__(self, created_time_entry=None): <NEW_LINE> <INDENT> self._created_time_entry = None <NEW_LINE> self.dis... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ee83cc13d1c6d463e54 |
class Counter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Counter, self).__init__() <NEW_LINE> self.lock = Lock() <NEW_LINE> self.counter = 0 <NEW_LINE> <DEDENT> def inc(self, val=1): <NEW_LINE> <INDENT> with self.lock: <NEW_LINE> <INDENT> self.counter = self.counter + val <NEW_LINE> <DED... | An incrementing and decrementing metric | 62598ee87047854f4633daba |
class ScopesNotSupported(VerificationError): <NEW_LINE> <INDENT> pass | JWT contains a 'scope' claim, which is not suppported.
| 62598ee8a79ad16197768701 |
class InvalidComboForTree(Exception): <NEW_LINE> <INDENT> pass | While attempting to calculate the EV of a combo at a point in the game tree,
it turns out that some branches of the sub-tree are not possible while
holding this combo, so there's no meaningful answer to the EV question. | 62598ee8851cf427c66b69b7 |
class HelloWorldDisallowAuth(HelloWorldDisallowByRobots): <NEW_LINE> <INDENT> class RobotsTxt(HelloWorldDisallowByRobots.RobotsTxt): <NEW_LINE> <INDENT> def render_GET(self, request): <NEW_LINE> <INDENT> if request.requestHeaders.hasHeader('Authorization'): <NEW_LINE> <INDENT> return super(HelloWorldDisallowAuth.Robots... | Disallow itself via robots.txt if a request to robots.txt
contains basic auth header. | 62598ee8090684286d592a53 |
class FiniteWordPath_square_grid_list(WordDatatype_list, FiniteWordPath_square_grid, FiniteWord_class): <NEW_LINE> <INDENT> pass | TESTS::
sage: P = WordPaths('abcd', steps='square')
sage: p = P(['a','b','b']); p
Path: abb
sage: type(p)
<class 'sage.combinat.words.paths.FiniteWordPath_square_grid_list'>
sage: p == loads(dumps(p))
True | 62598ee8dd821e528d6d762a |
class Neko(BrainFuck.BrainFuck): <NEW_LINE> <INDENT> OPTOKEN_DICT = dict( inc = 'にゃにゃ', dec = 'にゃー', nxt = 'にゃっ', prv = 'にゃん', put = 'にゃ。', get = 'にゃ、', opn = '「', cls = '」' ) | 猫語
https://qiita.com/zakuroishikuro/items/2acaaf174844b08495a7 | 62598ee80c0af96317c54a83 |
class _LoggingHandler(io.TextIOWrapper): <NEW_LINE> <INDENT> def __init__(self, level, stderr=sys.stderr): <NEW_LINE> <INDENT> io.TextIOWrapper.__init__(self, io.StringIO(), encoding=stderr.encoding) <NEW_LINE> self.level = level <NEW_LINE> self.stderr = stderr <NEW_LINE> <DEDENT> def write(self, out): <NEW_LINE> <INDE... | Logging replacement for stdout and stderr in GCF Python 3.7. | 62598ee816aa5153ce3febe4 |
class TestSingleEnemyGame(unittest.TestCase): <NEW_LINE> <INDENT> def test_win(self): <NEW_LINE> <INDENT> difficulty = {"width": 1, "height": 1, "hp": 10, "enemies": Counter({1: 1}), "xp thresholds": XP_THRESHOLDS} <NEW_LINE> local_game = LocalGame(difficulty) <NEW_LINE> local_game.reveal(Point(0, 0)) <NEW_LINE> self.a... | Test that a suitable first move is made. | 62598ee85fdd1c0f98e5c688 |
@dataclasses.dataclass(init=True, repr=True) <NEW_LINE> class FirmwareKeys: <NEW_LINE> <INDENT> __slots__ = ("image", "filename", "kbag", "key", "iv", "date") <NEW_LINE> image: str <NEW_LINE> filename: str <NEW_LINE> kbag: str <NEW_LINE> key: str <NEW_LINE> iv: str <NEW_LINE> date: Optional[str] <NEW_LINE> def __init__... | Dataclass object of firmware decryption keys. | 62598ee8aad79263cf42cef0 |
class NoHTML5SeleniumTestCase(SeleniumTestCase): <NEW_LINE> <INDENT> firefox_path = '/opt/ff/firefox-16.0/firefox' <NEW_LINE> @classmethod <NEW_LINE> def getWebDriver(cls, **kwargs): <NEW_LINE> <INDENT> firefox_binary = FirefoxBinary(firefox_path=cls.firefox_path) <NEW_LINE> return super(NoHTML5SeleniumTestCase, cls).g... | Run live server integration tests using the specified firefox binary,
which does not support our required HTML5 functionality.
HTML5 ref:
https://html5test.com/compare/feature/security-sandbox.html | 62598ee88c0ade5d55dc29f5 |
class TAOBAOAuth(BaseOAuth2): <NEW_LINE> <INDENT> name = 'taobao' <NEW_LINE> ID_KEY = 'taobao_user_id' <NEW_LINE> ACCESS_TOKEN_METHOD="POST" <NEW_LINE> AUTHORIZATION_URL = 'https://oauth.taobao.com/authorize' <NEW_LINE> ACCESS_TOKEN_URL = 'https://oauth.taobao.com/token' <NEW_LINE> def user_data(self, access_token, *ar... | Taobao OAuth authentication mechanism | 62598ee8d7e4931a7ef3a786 |
class MtimeFileWatcher(object): <NEW_LINE> <INDENT> def __init__(self, directory): <NEW_LINE> <INDENT> self._directory = directory <NEW_LINE> self._quit_event = threading.Event() <NEW_LINE> self._filename_to_mtime = None <NEW_LINE> self._has_changes = False <NEW_LINE> self._has_changes_lock = threading.Lock() <NEW_LINE... | Monitors a directory tree for changes using mtime polling. | 62598ee826068e7796d4b043 |
class VideoStreamInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Bitrate = None <NEW_LINE> self.Height = None <NEW_LINE> self.Width = None <NEW_LINE> self.Codec = None <NEW_LINE> self.Fps = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Bitrate = ... | 视频流信息。
| 62598ee8be383301e0251ec0 |
class WebDriverWrapper(WrapperFindOverride, WebDriver): <NEW_LINE> <INDENT> def __init__(self, logging_prefs=None, capabilities=None, **kwargs): <NEW_LINE> <INDENT> if capabilities is None: <NEW_LINE> <INDENT> capabilities = dc.DesiredCapabilities.FIREFOX <NEW_LINE> <DEDENT> if logging_prefs is None: <NEW_LINE> <INDENT... | Wrapper for webdriver to return WebElementWrapper on find_element. | 62598ee8a8370b77170eeaca |
class BaseError(Exception): <NEW_LINE> <INDENT> def __init__(self, message=None): <NEW_LINE> <INDENT> if message is not None: <NEW_LINE> <INDENT> self.__message = message <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.__message = "Can't operate on numbers with different bases." <NEW_LINE> <DEDENT> <DEDENT> def __st... | The BaseError exception is used when some operations/conversions can't be applied due to the operands having different or inadequate bases. | 62598ee823849d37ff84f79e |
class MCSTNode: <NEW_LINE> <INDENT> def __init__(self, move=None, parent=None, state=None): <NEW_LINE> <INDENT> self.move = move <NEW_LINE> self.parent = parent <NEW_LINE> self.childNodes = [] <NEW_LINE> self.wins = 0 <NEW_LINE> self.visits = 0 <NEW_LINE> self.untriedMoves = getMoves(state) <NEW_LINE> self.player = sta... | A node in the Monte Carlo Search tree. | 62598ee857b8e32f52507478 |
class INGBankStatementParser(BankStatementParser): <NEW_LINE> <INDENT> newFormatHeader = ['id', 'timestamp', 'transaction', 'amount', 'partner', 'details'] <NEW_LINE> INGFormatHeader = ['Data', 'Detalii tranzactie', 'Debit', 'Credit'] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(INGBankStatementParser, self... | ING implementation | 62598ee830bbd7224646831a |
class RawExporter(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "export_mesh.raw" <NEW_LINE> bl_label = "Export RAW" <NEW_LINE> filepath = StringProperty( subtype='FILE_PATH', ) <NEW_LINE> check_existing = BoolProperty( name="Check Existing", description="Check and warn on overwriting existing files", default=Tr... | Save Raw triangle mesh data | 62598ee801c39578d7f11490 |
class GH_NaturalComparer(object, IComparer[str]): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __repr__(self, *args): <NEW_LINE> <INDENT> pass | GH_NaturalComparer() | 62598ee84c342835776189ca |
class EditExerciseCommentTestCase(WgerEditTestCase): <NEW_LINE> <INDENT> object_class = ExerciseComment <NEW_LINE> url = 'exercise:comment:edit' <NEW_LINE> pk = 1 <NEW_LINE> data = {'comment': 'an edited comment'} | Tests editing a comment to an exercise | 62598ee82ae34c7f260a97ce |
class OTNConsent(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User) <NEW_LINE> techcash = models.BooleanField(default=False) <NEW_LINE> otn = models.BooleanField(default=False) <NEW_LINE> read = models.BooleanField(default=False) <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True) | Model used to record user consent | 62598ee8adb09d7d5dc08caf |
class AutoloadJsHandler(RequestHandler): <NEW_LINE> <INDENT> def __init__(self, tornado_app, *args, **kw): <NEW_LINE> <INDENT> self.application_context = kw['application_context'] <NEW_LINE> self.bokeh_websocket_path = kw['bokeh_websocket_path'] <NEW_LINE> super(AutoloadJsHandler, self).__init__(tornado_app, *args, **k... | Implements a custom Tornado handler for the autoload JS chunk
| 62598ee85fcc89381b265499 |
@tf_export('keras.metrics.Accuracy') <NEW_LINE> class Accuracy(MeanMetricWrapper): <NEW_LINE> <INDENT> def __init__(self, name='accuracy', dtype=None): <NEW_LINE> <INDENT> super(Accuracy, self).__init__(accuracy, name, dtype=dtype) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_config(cls, config): <NEW_LINE> <IN... | Calculates how often predictions matches labels.
For example, if `y_true` is [1, 2, 3, 4] and `y_pred` is [0, 2, 3, 4]
then the accuracy is 3/4 or .75. If the weights were specified as
[1, 1, 0, 0] then the accuracy would be 1/2 or .5.
This metric creates two local variables, `total` and `count` that are used to
com... | 62598ee85166f23b2e241abf |
class Patch(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parcels = {} <NEW_LINE> self.area = 0 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> l = [p.id for (p, v) in self.parcels.iteritems() if v] <NEW_LINE> l.sort() <NEW_LINE> return "Patch({})".format(l) <NEW_LINE> <DEDENT> de... | A geographically contiguous set of parcels.
The total area of the patch is available in the field `area`. | 62598ee856b00c62f0fb0fb7 |
class PloidyCaller(Caller): <NEW_LINE> <INDENT> def __init__(self, hybrid_inference_params: HybridInferenceParameters, ploidy_workspace: PloidyWorkspace): <NEW_LINE> <INDENT> self.hybrid_inference_params = hybrid_inference_params <NEW_LINE> self.ploidy_basic_caller = PloidyBasicCaller(hybrid_inference_params, ploidy_wo... | This class is a wrapper around `PloidyBasicCaller` to be used in a `HybridInferenceTask`. | 62598ee86e29344779afed1a |
class SheepdogImage(object): <NEW_LINE> <INDENT> def __init__(self, addr, port, name, chunk_size): <NEW_LINE> <INDENT> self.addr = addr <NEW_LINE> self.port = port <NEW_LINE> self.name = name <NEW_LINE> self.chunk_size = chunk_size <NEW_LINE> <DEDENT> def _run_command(self, command, data, *params): <NEW_LINE> <INDENT> ... | Class describing an image stored in Sheepdog storage. | 62598ee867a9b606de5446b5 |
class BaseModel(db.Model): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> archived = db.Column(db.Boolean, default=False) <NEW_LINE> created_at = db.Column(db.DateTime, default=db.func.current_timestamp()) <NEW_LINE> updated_at = db.Column(db.DateTime, default... | Base Abstract controlled model
not showing on Database | 62598ee867a9b606de5446b6 |
class OnlineVariance: <NEW_LINE> <INDENT> def __init__(self, ddof: int = 1) -> None: <NEW_LINE> <INDENT> self.reset() <NEW_LINE> self.ddof: int = ddof <NEW_LINE> <DEDENT> def reset(self) -> None: <NEW_LINE> <INDENT> self.n: int = 0 <NEW_LINE> self.mean: float = 0.0 <NEW_LINE> self.M2: float = 0.0 <NEW_LINE> self.delta:... | Welford's algorithm computes the sample variance incrementally. | 62598ee8f548e778e5969c72 |
class ModelProperties(_Properties): <NEW_LINE> <INDENT> def to_dict(self, include=None): <NEW_LINE> <INDENT> base = {'type': 'ModelProperties'} <NEW_LINE> attr = include if include is not None else self._extension_attributes <NEW_LINE> for atr in attr: <NEW_LINE> <INDENT> var = getattr(self, atr) <NEW_LINE> if not hasa... | Dragonfly Model Properties. This class will be extended by extensions.
Usage:
.. code-block:: python
model = Model('South Boston District', list_of_buildings)
model.properties -> ModelProperties
model.properties.radiance -> ModelRadianceProperties
model.properties.energy -> ModelEnergyProperties | 62598ee8009cb60464cffc36 |
class MexicanHat(Filter): <NEW_LINE> <INDENT> def __init__(self, G, Nf=6, lpfactor=20, scales=None, normalize=False): <NEW_LINE> <INDENT> self.lpfactor = lpfactor <NEW_LINE> self.normalize = normalize <NEW_LINE> lmin = G.lmax / lpfactor <NEW_LINE> if scales is None: <NEW_LINE> <INDENT> scales = utils.compute_log_scales... | Design a filter bank of Mexican hat wavelets.
The Mexican hat wavelet is the second oder derivative of a Gaussian. Since
we express the filter in the Fourier domain, we find:
.. math:: \hat{g}_b(x) = x * \exp(-x)
for the band-pass filter. Note that in our convention the eigenvalues of
the Laplacian are equivalent to... | 62598ee810dbd63aa1c6f25b |
class CredentialResults(Model): <NEW_LINE> <INDENT> _validation = { 'kubeconfigs': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(CredentialResults, self).__init__(**kwargs) <NE... | The list of credential result response.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar kubeconfigs:
:vartype kubeconfigs:
list[~azure.mgmt.containerservice.models.CredentialResult] | 62598ee8e1aae11d1e7cdbb3 |
class IMacroTaskCreationCondition(ICreationCondition): <NEW_LINE> <INDENT> pass | Creation condition of macro task. | 62598ee8cc0a2c11144796eb |
class CustomQTabWidget(QTabWidget): <NEW_LINE> <INDENT> def __init__(self,parent): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.parent=parent <NEW_LINE> <DEDENT> def currentChanged(self): <NEW_LINE> <INDENT> print("Change in tab") | A class for my custom QTabWidget | 62598ee8b7558d5895461d2d |
class ExitSdkMode(object): <NEW_LINE> <INDENT> __slots__ = ( '_isExternalSdkMode', ) <NEW_LINE> @property <NEW_LINE> def isExternalSdkMode(self): <NEW_LINE> <INDENT> return self._isExternalSdkMode <NEW_LINE> <DEDENT> @isExternalSdkMode.setter <NEW_LINE> def isExternalSdkMode(self, value): <NEW_LINE> <INDENT> self._isEx... | Generated message-passing message. | 62598ee807f4c71912badb3d |
class OnTheDayThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, remote): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.should_run = True <NEW_LINE> self.remote = remote <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while self.should_run: <NEW_LINE> <INDENT> self.submit_results() <NEW_LI... | OnTheDay.net worker actually does the REST call to submit a result.
Doing REST calls and waiting synchronously for results to come back will block for an
intolerably long time, so we do this in a separate thread such that we don't block the UI. This
is important for latching finish times accurately. | 62598ee855399d3f05624c1c |
class GetableAPIResource(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get(cls, id, **params): <NEW_LINE> <INDENT> return APIClient.submit('GET', cls._class_url + "/" + str(id), **params) | Getable API Resource | 62598ee8aad79263cf42cef2 |
class TariffGroup(models.Model): <NEW_LINE> <INDENT> group_name = models.CharField(max_length=255, unique=True, verbose_name=_(u"Tariff group name")) <NEW_LINE> objects = BillingManager() <NEW_LINE> def save(self, *args, **kwargs): <NEW_LINE> <INDENT> k = str(self.id) <NEW_LINE> kwargs["using"] = settings.BILLING_DB <N... | Модель - тарифная группа пользователей | 62598ee8cad5886f8bdc39ea |
class GenAuth(requests.auth.AuthBase): <NEW_LINE> <INDENT> def __init__(self, email, password, url): <NEW_LINE> <INDENT> payload = { 'email': email, 'password': password } <NEW_LINE> r = requests.post(url + '/user/ajax/login/', data=payload) <NEW_LINE> if r.status_code == 403: <NEW_LINE> <INDENT> raise Exception('Inval... | Attach HTTP Genesis Authentication to Request object. | 62598ee8379a373c97d976de |
class AMG(PreconditionerTag): <NEW_LINE> <INDENT> vcl_tag_type = _v.amg_tag <NEW_LINE> vcl_precond_type_name = 'amg_precond' <NEW_LINE> def __init__(self, coarse=1, interpol=1, threshold=0.25, interpol_weight=0.2, jacobi_weight=1.0, presmooth=1, postsmooth=1, coarse_levels=0): <NEW_LINE> <INDENT> if not backend.WITH_OP... | TODO docstring | 62598ee8d6c5a102081e0819 |
class Reader: <NEW_LINE> <INDENT> def topic(self): <NEW_LINE> <INDENT> return self._reader.topic() <NEW_LINE> <DEDENT> def read_next(self, timeout_millis=None): <NEW_LINE> <INDENT> if timeout_millis is None: <NEW_LINE> <INDENT> msg = self._reader.read_next() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> _check_type(int... | Pulsar topic reader. | 62598ee876e4537e8c3edca1 |
class Controller(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def version_info(): <NEW_LINE> <INDENT> return {'status': 'stable', 'id': 'v1.0', 'links': [{ 'href': '%s/v1/' % pecan.request.host_url, 'rel': 'self'}]} <NEW_LINE> <DEDENT> @pecan.expose('json') <NEW_LINE> def index(self): <NEW_LINE> <INDENT> retur... | Version 1 API controller root. | 62598ee8dd821e528d6d762d |
class Solution: <NEW_LINE> <INDENT> def topSort(self, graph): <NEW_LINE> <INDENT> if not graph: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> node_to_indegree = self.get_node_to_indegree(graph) <NEW_LINE> start_nodes = [n for n in graph if node_to_indegree[n] == 0] <NEW_LINE> import collections <NEW_LINE> queue =... | @param: graph: A list of Directed graph node
@return: Any topological order for the given graph. | 62598ee856ac1b37e63008d5 |
class ColumnDirective(Directive): <NEW_LINE> <INDENT> required_arguments = 0 <NEW_LINE> optional_arguments = 1 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> has_content = True <NEW_LINE> option_spec = {'width': float} <NEW_LINE> def run(self): <NEW_LINE> <INDENT> self.assert_has_content() <NEW_LINE> width = se... | A directive to explicitly create an individual column.
This can only be used within the columnset directive. It can takes a
single optional argument 'width' to determine the column width on
page. If no width is given, it is recorded as None and should be
later assigned by the enclosing columnset. | 62598ee8e5267d203ee69fef |
class SimpleEstimateSimilarityTransform(CommonConfigurationMixin, EstimateSimilarityTransform): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> EstimateSimilarityTransform.__init__(self) | Implementation of EstimateSimilarityTransform to test it
Examples: | 62598ee8bd1bec0571e1443f |
class BatchRename(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.path = 'E:\\learning\\dachuang\\cyclegan\\carDS\\complete\\final\\finalABmohu4\\train2\\' <NEW_LINE> <DEDENT> def rename(self): <NEW_LINE> <INDENT> filelist = os.listdir(self.path) <NEW_LINE> total_num = len(filelist) <NEW_LINE> i = 3... | 批量重命名文件夹中的图片文件 | 62598ee8d7e4931a7ef3a789 |
class TestExtensionTag(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestExtensionTag, self).setUp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super(TestExtensionTag, self).tearDown() <NEW_LINE> <DEDENT> def _test_init(self, value): <NEW_LINE> <INDENT> if (isinstance(value,... | A test suite for the ExtensionTag class.
Since ExtensionTag is a simple wrapper for the Integer primitive, only a
few tests pertaining to construction are needed. | 62598ee821bff66bcd72133c |
class ModerationFrequencyUpdateViewTest(ConnectTestMixin, TestCase): <NEW_LINE> <INDENT> def test_success(self): <NEW_LINE> <INDENT> superuser = self.create_superuser(moderator_notification_period=1) <NEW_LINE> self.client.login(username=superuser.email, password='moo') <NEW_LINE> response = self.client.post( reverse('... | Tests for ModerationFrequencyUpdateView. | 62598ee8adb09d7d5dc08cb1 |
class SSE(Loss): <NEW_LINE> <INDENT> def loss(self, predicted: Tensor, actual: Tensor) -> float: <NEW_LINE> <INDENT> squared_errors = tensor_combine( lambda predicted, actual: (predicted - actual) ** 2, predicted, actual) <NEW_LINE> return tensor_sum(squared_errors) <NEW_LINE> <DEDENT> def gradient(self, predicted: Ten... | Loss function that computes the sum of the squared errors. | 62598ee85fcc89381b26549a |
class DimmerGroup(Group): <NEW_LINE> <INDENT> def __init__(self, bridge, number, name): <NEW_LINE> <INDENT> super().__init__(bridge, number, name, DIMMER) <NEW_LINE> <DEDENT> @property <NEW_LINE> def brightness(self): <NEW_LINE> <INDENT> return self._brightness <NEW_LINE> <DEDENT> @brightness.setter <NEW_LINE> def brig... | Dimmer LimitlessLED group. | 62598ee87d43ff2487426770 |
class Jitter(Augmentation): <NEW_LINE> <INDENT> def __init__(self, sigma=0.01, clip=0.05): <NEW_LINE> <INDENT> self.sigma = sigma <NEW_LINE> self.clip = clip <NEW_LINE> <DEDENT> def apply(self, data): <NEW_LINE> <INDENT> assert (self.clip > 0) <NEW_LINE> jittered_data = np.clip(self.sigma * np.random.randn(*data.shape)... | Applies a small jitter to the position of each point | 62598ee88da39b475be01895 |
class InternalServerError(ServerError): <NEW_LINE> <INDENT> code = 500 | Exception mapping a '500 Internal Server Error' response. | 62598ee87047854f4633dabd |
class MockResponse: <NEW_LINE> <INDENT> def __init__(self, code=200, msg='OK'): <NEW_LINE> <INDENT> data = load_data("raw_data/test_rates.json") <NEW_LINE> self.resp_data = codecs.encode(json.dumps(data)) <NEW_LINE> self.code = code <NEW_LINE> self.msg = msg <NEW_LINE> self.headers = {'content-type': 'text/plain; chars... | Simple mock for urllib.request for downloading exchange_rates | 62598ee892d797404e387eef |
class DrugSynonyms(Item): <NEW_LINE> <INDENT> url = Field() <NEW_LINE> name = Field() <NEW_LINE> synonyms = Field() | Синонимы лекарств:
-название
-список синонимовы | 62598ee82c8b7c6e89bd1eaa |
class DirectoryTraversal(ContextDerived): <NEW_LINE> <INDENT> __slots__ = ( 'dirs', ) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> ContextDerived.__init__(self, context) <NEW_LINE> self.dirs = [] | Describes how directory traversal for building should work.
This build object is likely only of interest to the recursive make backend.
Other build backends should (ideally) not attempt to mimic the behavior of
the recursive make backend. The only reason this exists is to support the
existing recursive make backend wh... | 62598ee8e76e3b2f99fd7120 |
class EntryLogicalExpressionWithSet(EntryLogicalExpression): <NEW_LINE> <INDENT> IN = "in" <NEW_LINE> NOTIN = "not in" <NEW_LINE> def __init__(self, op, identifier, setExpression): <NEW_LINE> <INDENT> self.op = op <NEW_LINE> self.identifier = identifier <NEW_LINE> self.setExpression = setExpression <NEW_LINE> self.isBi... | Class representing an entry of logical expression with sets in the AST of the MLP | 62598ee87047854f4633dabe |
class DebugAppList(object): <NEW_LINE> <INDENT> def __init__(self, amdevice): <NEW_LINE> <INDENT> self.s = amdevice.start_service(u'com.apple.debugserver.applist') <NEW_LINE> if self.s is None: <NEW_LINE> <INDENT> raise RuntimeError(u'Unable to launch:', u'com.apple.debugserver.applist') <NEW_LINE> <DEDENT> <DEDENT> de... | Debugserver class; starts an instance of debugserver and spawns an lldb
instance to talk to it | 62598ee8cc0a2c11144796ed |
class Polygonal_set_quantity_operator(Set_quantity_operator): <NEW_LINE> <INDENT> def __init__(self, domain, quantity, value=0.0, polygon=None, verbose=False): <NEW_LINE> <INDENT> Set_elevation_operator.__init__(self, domain, quantity, value=value, polygon=polygon, verbose=verbose) | Add water at certain rate (ms^{-1} = vol/Area/sec) over a
polygonal region
rate can be a function of time. | 62598ee8fff4ab517ebcbec1 |
class ElementLoad: <NEW_LINE> <INDENT> def __init__(self, element): <NEW_LINE> <INDENT> self.element = element <NEW_LINE> <DEDENT> def nodal_equivalent_loads(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def apply_load(self, f_eq): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def plot_load(self): <NEW_LINE> <INDE... | Parent class for a load applied to a finite element.
:cvar element: Finite element to which the load is applied
:vartype element: :class:`~feastruct.fea.fea.FiniteElement` | 62598ee8a219f33f346c4f24 |
class getChatMembersCount(BaseMethod): <NEW_LINE> <INDENT> def __init__(self, chat_id, propagate_values: bool = False, propagate_fields: dict = None): <NEW_LINE> <INDENT> super().__init__(propagate_values=propagate_values, propagate_fields=propagate_fields) <NEW_LINE> self.chat_id = chat_id | Use this method to get the number of members in a chat. Returns Int on success.
Parameters
----------
chat_id : Integer or String
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | 62598ee855399d3f05624c1e |
class Concat(Function): <NEW_LINE> <INDENT> def __init__(self, concat_dim=0, flatten=False, name=None): <NEW_LINE> <INDENT> self._concat_dim = concat_dim <NEW_LINE> self._flatten = flatten <NEW_LINE> def tf_concat(*inputs): <NEW_LINE> <INDENT> inputs = list(inputs) <NEW_LINE> for i in self._scalar_indices: <NEW_LINE> <... | Concatenates a non-empty tuple of tensors into a single tensor. | 62598ee897e22403b38395da |
class TestMacOSIPResponderDisruptService(LocalIPResponderTestCaseWithDisrupter): <NEW_LINE> <INDENT> def __init__(self, devices, parameters): <NEW_LINE> <INDENT> super().__init__(MacOSServiceDisrupter, devices, parameters) | Summary:
Tests whether traffic leaving the user's device has the public IP hidden when the network
service is disabled.
Details:
This test will connect to VPN then disable the primary network service, which will be the one
used to connect to the VPN.
This test uses a simple UDP client which spams UDP packets to a p... | 62598ee8aad79263cf42cef5 |
class RelationshipSmartFamilySession(abc_relationship_sessions.RelationshipSmartFamilySession, osid_sessions.OsidSession): <NEW_LINE> <INDENT> def get_family_id(self): <NEW_LINE> <INDENT> return self._provider_session.get_family_id() <NEW_LINE> <DEDENT> family_id = property(fget=get_family_id) <NEW_LINE> def get_family... | Adapts underlying RelationshipSmartFamilySession methodswith authorization checks. | 62598ee8379a373c97d976e0 |
class ColValLt(RowQualifier): <NEW_LINE> <INDENT> class _LtRowFunc(object): <NEW_LINE> <INDENT> def __init__(self, label: object, value: Number) -> None: <NEW_LINE> <INDENT> self.label = label <NEW_LINE> self.value = value <NEW_LINE> self.__doc__ = f"df[{label}] < {value}" <NEW_LINE> <DEDENT> def __call__(self, df: pan... | A row qualifier that qualifies rows with a value lesser than a value.
Parameters
----------
label : object
The label of the column the qualifier checks.
value : Number
The value to check against. | 62598ee8d486a94d0ba2a6b8 |
class ArtistGenre(Base): <NEW_LINE> <INDENT> __tablename__ = 'artistgenre' <NEW_LINE> artist = Column(Integer, ForeignKey('artist.art_id'), primary_key=True) <NEW_LINE> genre = Column(Integer, ForeignKey('genre.gen_id'), primary_key=True) <NEW_LINE> @property <NEW_LINE> def serialize(self): <NEW_LINE> <INDENT> return {... | Database table to list all relevant genres to a specific artist
This table will contain a single row for every genre that is relevant
to a specific artist.
Columns:
* (REQ) artist: Int, database id for artist
* (REQ) genre: Int, database id for genre | 62598ee8d58c6744b42db62b |
class CoefficientList: <NEW_LINE> <INDENT> def __init__(self, exp, vars=None): <NEW_LINE> <INDENT> if vars is None: <NEW_LINE> <INDENT> vars = variables(exp) <NEW_LINE> <DEDENT> self.height = len(vars) <NEW_LINE> if self.height == 0: <NEW_LINE> <INDENT> self.val = exp <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if is... | A list of coefficients of an expression. | 62598ee8435de62698e9a4c0 |
class TestDevelopersController(BaseTestCase): <NEW_LINE> <INDENT> def test_add_inventory(self): <NEW_LINE> <INDENT> data = dict(upfile=(BytesIO(b'some file data'), 'file.txt'), inventoryItem='inventoryItem_example', userId='userId_example') <NEW_LINE> response = self.client.open( '/vaas/vaas2/1.0.0/inventory', method='... | DevelopersController integration test stubs | 62598ee863b5f9789fe83848 |
class CourseListView(View): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> all_courses = Courses.objects.order_by("-add_time") <NEW_LINE> keywords = request.GET.get("keywords", "") <NEW_LINE> if keywords: <NEW_LINE> <INDENT> all_courses = all_courses.filter(Q(name__icontains=keywords) ... | 课程列表视图 | 62598ee81f037a2d8b9e27f3 |
class get_grid_type_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, error=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.error = error <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadabl... | Attributes:
- success
- error | 62598ee856ac1b37e63008d7 |
class Preferences: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.preference = { "mycallsign": "", "myclass": "", "mysection": "", "power": "0", "usehamdb": 0, "useqrz": 0, "usehamqth": 0, "lookupusername": "", "lookuppassword": "", "userigctld": 0, "useflrig": 0, "CAT_ip": "localhost", "CAT_p... | Process preferences | 62598ee81f5feb6acb16133c |
class RemoteService(object): <NEW_LINE> <INDENT> def __init__(self, state_queue, event): <NEW_LINE> <INDENT> self.state_queue = state_queue <NEW_LINE> self.event = event <NEW_LINE> <DEDENT> def dummy(self): <NEW_LINE> <INDENT> self.state_queue.put("call-dummy") <NEW_LINE> <DEDENT> def echo(self, value): <NEW_LINE> <IND... | Exported service | 62598ee8a8370b77170eeace |
class Object: <NEW_LINE> <INDENT> session = None <NEW_LINE> edge = None <NEW_LINE> def __init__(self, session=None, identifier: int = None, data: dict = None): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.id = identifier <NEW_LINE> self.createdDate = None <NEW_LINE> self.lastUpdateDate = None <NEW_LINE> s... | Object base class
https://developer.yahoo.com/nativeandsearch/guide/objects.html
The Native & Search API exposes lastUpdateDate and createdDate as read-only fields in API
responses for all Native & Search API objects. These fields provide UNIX timestamps for when an
object was created and last updated. | 62598ee86aa9bd52df0d359c |
class SuspendableListDirectory(ClientActionStub): <NEW_LINE> <INDENT> in_rdfvalue = rdf_client.ListDirRequest <NEW_LINE> out_rdfvalues = [rdf_client.StatEntry] | Lists a directory as a suspendable client action. | 62598ee8460517430c430b73 |
class ProctoredExamStudentAllowanceHistory(TimeStampedModel): <NEW_LINE> <INDENT> allowance_id = models.IntegerField() <NEW_LINE> user = models.ForeignKey(User) <NEW_LINE> proctored_exam = models.ForeignKey(ProctoredExam) <NEW_LINE> key = models.CharField(max_length=255) <NEW_LINE> value = models.CharField(max_length=2... | This should be the same schema as ProctoredExamStudentAllowance
but will record (for audit history) all entries that have been updated. | 62598ee899fddb7c1ca6217a |
class RHManageRegFormSectionBase(RHManageRegFormBase): <NEW_LINE> <INDENT> normalize_url_spec = { 'locators': { lambda self: self.section } } <NEW_LINE> def _checkParams(self, params): <NEW_LINE> <INDENT> RHManageRegFormBase._checkParams(self, params) <NEW_LINE> self.section = RegistrationFormSection.get_one(request.vi... | Base class for a specific registration form section | 62598ee8a8ecb0332586f8d4 |
class Board(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=20) <NEW_LINE> has_side_HE_sensor = models.BooleanField() <NEW_LINE> l_ir_detector_thresh = models.IntegerField(null=True, blank=True) <NEW_LINE> r_ir_detector_thresh = models.IntegerField(null=True, blank=True) <NEW_LINE> use_ir_detector... | Hardware info about individual boards | 62598ee84e4d562566370b04 |
class BpsFormatter(string.Formatter): <NEW_LINE> <INDENT> def get_field(self, field_name, args, kwargs): <NEW_LINE> <INDENT> _, val = args[0].search(field_name, opt=args[1]) <NEW_LINE> return val, field_name <NEW_LINE> <DEDENT> def get_value(self, key, args, kwargs): <NEW_LINE> <INDENT> _, val = args[0].search(key, opt... | String formatter class that allows BPS config search options. | 62598ee80a50d4780f703a97 |
class SimpleRoot(Controller): <NEW_LINE> <INDENT> @index <NEW_LINE> def index(self, request): <NEW_LINE> <INDENT> return 'root.index' <NEW_LINE> <DEDENT> rest = Rest() <NEW_LINE> sub = Sub() <NEW_LINE> swi = SubIndex() <NEW_LINE> unknown = Unknown | A SimpleRoot controller (docs should come from index). | 62598ee87d847024c075aab9 |
class BlackjackDealer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = 'Dealer' <NEW_LINE> self.hand = list() <NEW_LINE> self.score = 0 <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.hand) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return sel... | Contains attributes and operators for a Blackjack card dealer. | 62598ee8cc0a2c11144796ef |
class TestTestSuite(unittest.TestCase): <NEW_LINE> <INDENT> def _full_tree(self, node): <NEW_LINE> <INDENT> if isinstance(node, TestCase): <NEW_LINE> <INDENT> return (type(node), node._child_labels) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return dict( ((type(sub_tree), sub_node), self._full_tree(sub_tree)) for su... | Tests for the process of converting the output of the Discoverer
into an internal tree. | 62598ee801c39578d7f11495 |
class VirtualMachineScaleSetVMExtensionsSummary(Model): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'statuses_summary': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMachineStatusCodeCount]'... | Extensions summary for virtual machines of a virtual machine scale set.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The extension name.
:vartype name: str
:ivar statuses_summary: The extensions information.
:vartype statuses_summary:
list[~azure.mgmt.compute.v2... | 62598ee871ff763f4b5e5e48 |
class Nesterov(Optimizer): <NEW_LINE> <INDENT> def __init__(self, lr, momentum): <NEW_LINE> <INDENT> Optimizer.__init__(self, lr=lr, momentum=momentum) <NEW_LINE> <DEDENT> def get_updates(self, params, grads, lr, momentum): <NEW_LINE> <INDENT> updates = [] <NEW_LINE> for param, grad in zip(params, grads): <NEW_LINE> <I... | Implementation of "Nesterov's Accelerated Gradient" (NAG) which is explained
in further detail in
"On the importance of initialization and momentum in deep learning"
But the equation for NAG has been reshuffled by Nicolas Boulanger in
https://github.com/lisa-lab/pylearn2/pull/136#issuecomment-10381617
for easier im... | 62598ee8fff4ab517ebcbec3 |
class LoginPage(View): <NEW_LINE> <INDENT> username = TextInput(id="username") <NEW_LINE> password = TextInput(id="password") <NEW_LINE> log_in = Button("Log In") <NEW_LINE> @property <NEW_LINE> def is_displayed(self): <NEW_LINE> <INDENT> return self.log_in.is_displayed | View for login page | 62598ee897e22403b38395dc |
class WinFolderPermissionTool: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.win_tool_name = "icacls" <NEW_LINE> <DEDENT> def set_rights( self, path: PureWindowsPath, username: str, rights_collection: RightsCollection ): <NEW_LINE> <INDENT> specific_rights_string = ( "(" + ",".join([x.code for x in l... | Wraps a windows-only tool for settings windows-only file permissions
Internally uses the 'icacls' windows executable | 62598ee8091ae35668703304 |
class InvalidApplicationPolicyError(ServerlessRepoError): <NEW_LINE> <INDENT> MESSAGE = "Invalid application policy: '{error_message}'" | Raised when invalid application policy is provided. | 62598ee97d847024c075aaba |
class Vertex(EqualityMixin): <NEW_LINE> <INDENT> def __init__(self, key, adj_dict): <NEW_LINE> <INDENT> self.__key = key <NEW_LINE> self.__adjacency_dict = adj_dict <NEW_LINE> self.reset_vertex() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Vertex: %s Neighbors: %s Distance: %s Predecessor: %s'... | Defines a Vertex, which is used for various different graph algorithms. | 62598ee963b5f9789fe8384a |
class BasePage: <NEW_LINE> <INDENT> def __init__(self, driver): <NEW_LINE> <INDENT> self._driver = driver <NEW_LINE> self._wait = WebDriverWait(self._driver, 10) <NEW_LINE> <DEDENT> def click(self, webelement): <NEW_LINE> <INDENT> el = self._wait.until(expected_conditions.element_to_be_clickable(webelement)) <NEW_LINE>... | Wrapper for selenium operations | 62598ee9435de62698e9a4c3 |
class TestSQLiteStore(unittest.TestCase): <NEW_LINE> <INDENT> def test_sqlite(self): <NEW_LINE> <INDENT> from openid.store import sqlstore <NEW_LINE> try: <NEW_LINE> <INDENT> from pysqlite2 import dbapi2 as sqlite <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> <IND... | Test `SQLiteStore` class. | 62598ee96aa9bd52df0d359e |
class ScheduleEntertainmentInformation: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Type = 'Lighting' <NEW_LINE> self.Brightness = 0 <NEW_LINE> self.Name = None <NEW_LINE> self.Rate = 0 <NEW_LINE> self.Duration = None <NEW_LINE> self.Room = None | This is the lighting specific part.
| 62598ee9d7e4931a7ef3a78d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.