code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class _uuidsTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_unique_machine32(self): <NEW_LINE> <INDENT> seen = set() <NEW_LINE> for i in range(250): <NEW_LINE> <INDENT> uuid = unique_machine32() <NEW_LINE> self.assertTrue((uuid <= 0xffffffff) and (uuid >= 0)) <NEW_LINE> self.assertFalse(uuid in seen) <NEW_LINE> ...
Simple Testcases for uuid generation.
62598f6b1f5feb6acb1623c9
class DivineSmite(Feature): <NEW_LINE> <INDENT> name = "Divine Smite" <NEW_LINE> source = "Paladin"
Starting at 2nd level, when you hit a creature with a melee weapon attack, you can expend one paladin spell slot to deal radiant damage to the target, in addition to the weapon’s damage. The extra damage is 2d8 for a 1st-level spell slot, plus 1d8 for each spell level higher than 1st, to a maximum of 5d8. The damage in...
62598f6b9b70327d1c57e53c
class ResBlock1d(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_channels: int, hidden_channels: int, kernel_size: int = 3, dilation: int = 1, scale_factor: int = 1, activation: callable = F.relu, normalization: nn.Module = None, spectral_norm: bool = False, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> s...
Residual block with option for upsampling or downsampling. Increases dilation by a factor of 2. Architecture adapted from GBlock and DBlock in GAN-TTS. Args: in_channels: number of channels of input hidden_channels: number of projected / output channels kernel_size: temporal size of convolutional filters ...
62598f6bcad5886f8bdc4ab0
class ParserModel(nn.Module): <NEW_LINE> <INDENT> def __init__(self, embeddings, n_features=36, hidden_size=200, n_classes=3, dropout_prob=0.5): <NEW_LINE> <INDENT> super(ParserModel, self).__init__() <NEW_LINE> self.n_features = n_features <NEW_LINE> self.n_classes = n_classes <NEW_LINE> self.dropout_prob = dropout_pr...
Feedforward neural network with an embedding layer and single hidden layer. The ParserModel will predict which transition should be applied to a given partial parse configuration. PyTorch Notes: - Note that "ParserModel" is a subclass of the "nn.Module" class. In PyTorch all neural networks are a subclass ...
62598f6b8a349b6b436859d3
class Shapefiles(object): <NEW_LINE> <INDENT> def __init__(self, suffix): <NEW_LINE> <INDENT> self.suffix = suffix <NEW_LINE> <DEDENT> def tile_shapefile(self, lon, lat, outdir): <NEW_LINE> <INDENT> fname = 'tile_shape_' + self.suffix + '.shp' <NEW_LINE> outfile = os.path.join(outdir, fname) <NEW_LINE> logger.info('Out...
Functions that create different shapefiles. Outputs ------- Shapefile outlining the tile coverage. Shapefile with wind components (u,v) and positions of each (u, v) pair. Parameters ---------- suffix : string String that will be added at the end of all outfile names, before .shp
62598f6b6e29344779affdef
class Point: <NEW_LINE> <INDENT> def __init__(self, x, y, z): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z <NEW_LINE> <DEDENT> def distanceTo(self, new_point): <NEW_LINE> <INDENT> x = self.x <NEW_LINE> y = self.y <NEW_LINE> z = self.z <NEW_LINE> return (math.sqrt((new_point.x - x)**2 + (ne...
Creates Point Objects that have three coordinates: x, y, z.
62598f6b50485f2cf55da701
class JobAcceptEdit(UI): <NEW_LINE> <INDENT> process = UI() <NEW_LINE> JobPosts() <NEW_LINE> JobActiveHot() <NEW_LINE> process.wait() <NEW_LINE> res = find_white_rows(process) <NEW_LINE> job_number = res['job_number'] <NEW_LINE> if job_number is None: <NEW_LINE> <INDENT> ui.log.warning('{} :: job_number not available; ...
Check that the JS alert box appears when trying to cancel an edited job. Looks for the Reset button element on the screen; if it can see Reset, then the drawer dismissed as expected.
62598f6b6aa9bd52df0d4665
class Api_DocView(STLView): <NEW_LINE> <INDENT> access = 'is_admin' <NEW_LINE> template = '/ui/ikaaro/root/api_docs.xml' <NEW_LINE> def get_namespace(self, resource, context): <NEW_LINE> <INDENT> i = 1 <NEW_LINE> dispatcher = context.server.dispatcher <NEW_LINE> namespace = {'endpoints': []} <NEW_LINE> for pattern, dat...
Doc of the api
62598f6b8e05c05ec3f6ea0f
class Frame(object): <NEW_LINE> <INDENT> def __init__(self, body, title='', style='', width=None, height=None, key_bindings=None, modal=False): <NEW_LINE> <INDENT> assert is_container(body) <NEW_LINE> assert is_formatted_text(title) <NEW_LINE> assert isinstance(style, six.text_type) <NEW_LINE> assert is_dimension(width...
Draw a border around any container, optionally with a title text. Changing the title and body of the frame is possible at runtime by assigning to the `body` and `title` attributes of this class. :param body: Another container object. :param title: Text to be displayed in the top of the frame (can be formatted text). ...
62598f6b76d4e153a661c3ac
class ITeacher(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def teacher_name(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def cours...
Should be implemented by Teachers.
62598f6bec188e330fdf8034
class Node(object): <NEW_LINE> <INDENT> def __init__(self, data, next_data=None, previous_data=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next = next_data <NEW_LINE> self.previous = previous_data
Create a Node class.
62598f6b507cdc57c63a452e
class LocalRunnerTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_run_wait(self): <NEW_LINE> <INDENT> ws = DummyWebService() <NEW_LINE> r = LocalRunner(['/bin/sleep', '60']) <NEW_LINE> pid = r._run(ws) <NEW_LINE> self.assertIsInstance(pid, str) <NEW_LINE> for i in range(20): <NEW_LINE> <INDENT> if pid in LocalRunn...
Check LocalRunner class
62598f6b7c178a314d78cc36
class FlightInfo: <NEW_LINE> <INDENT> def __init__(self, flight_number, departure_airport: Airport, arrival_airport: Airport, flight_schedule: FlightSchedule): <NEW_LINE> <INDENT> self.flight_number = flight_number <NEW_LINE> self.departure_airport = departure_airport <NEW_LINE> self.arrival_airport = arrival_airport <...
Boarding passes for passengers
62598f6b1d351010ab8f32d5
class IonGroup(Group): <NEW_LINE> <INDENT> def __init__(self, atom): <NEW_LINE> <INDENT> Group.__init__(self, atom) <NEW_LINE> self.type = 'ION' <NEW_LINE> self.residue_type = atom.res_name.strip() <NEW_LINE> info('Found ion group:', atom)
Ion group.
62598f6b6fece00bbaccb11f
class TestV1ReplicationControllerList(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testV1ReplicationControllerList(self): <NEW_LINE> <INDENT> pass
V1ReplicationControllerList unit test stubs
62598f6bd10714528d69d660
class RemoteApi(object): <NEW_LINE> <INDENT> def __init__(self, obj, api_prefix): <NEW_LINE> <INDENT> self._obj = obj <NEW_LINE> self._api_prefix = api_prefix <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return functools.partial(self._obj.request, self._api_prefix + name)
Wrapper to allow api methods to be called like python methods.
62598f6b30c21e258be97f94
class Contact(Common): <NEW_LINE> <INDENT> first_name = django.db.models.CharField('First name', max_length=50, null=True, blank=True) <NEW_LINE> last_name = django.db.models.CharField('Last name', max_length=100, null=True, blank=True) <NEW_LINE> organization = django.db.models.CharField('Organization', max_length=200...
Represents a contact
62598f6b15baa7234946171b
class Fornum(Statement): <NEW_LINE> <INDENT> def __init__( self, target: Name, start: Expression, stop: Expression, step: Expression, body: Block, **kwargs ): <NEW_LINE> <INDENT> super(Fornum, self).__init__("Fornum", **kwargs) <NEW_LINE> self.target: Name = target <NEW_LINE> self.start: Expression = start <NEW_LINE> s...
Define the numeric for lua statement. Attributes: target (`Name`): Target name. start (`Expression`): Start index value. stop (`Expression`): Stop index value. step (`Expression`): Step value. body (`Block`): List of statements to execute.
62598f6c7b25080760ed6c2f
class Manager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.converter = Converter() <NEW_LINE> self.calculator = Calculator() <NEW_LINE> self.parser = Parser() <NEW_LINE> global trigonometry <NEW_LINE> <DEDENT> def calculation(self, expression): <NEW_LINE> <INDENT> expression = self.trigonom...
Manages main processes between calculator, converter and parser.
62598f6c8a349b6b436859d5
class Page(object): <NEW_LINE> <INDENT> def __init__(self, item_count, page_index=1, page_size=_PAGE_SIZE): <NEW_LINE> <INDENT> self.__item_count = item_count <NEW_LINE> self.__page_size = page_size <NEW_LINE> self.__page_count = item_count // page_size + (1 if item_count % page_size > 0 else...
docstring for Page
62598f6c5e10d32532ce34b5
class SearchResults(object): <NEW_LINE> <INDENT> def __init__(self, items=None): <NEW_LINE> <INDENT> self._results = items or [] <NEW_LINE> <DEDENT> def links(self): <NEW_LINE> <INDENT> return [row.get('link') for row in self._results] <NEW_LINE> <DEDENT> def titles(self): <NEW_LINE> <INDENT> return [row.get('title') f...
Stores the search results
62598f6cd4950a0f3b110a02
class DataChannel(anasysfile.AnasysElement): <NEW_LINE> <INDENT> def __init__(self, datachannels): <NEW_LINE> <INDENT> anasysfile.AnasysElement.__init__(self, etree=datachannels)
Data structure for holding spectral Data
62598f6c6aa9bd52df0d4667
class MonthlyPerHourCollectionImmutable( _ImmutableCollectionBase, MonthlyPerHourCollection): <NEW_LINE> <INDENT> def to_mutable(self): <NEW_LINE> <INDENT> new_obj = MonthlyPerHourCollection(self.header, self.values, self.datetimes) <NEW_LINE> new_obj._validated_a_period = self._validated_a_period <NEW_LINE> return new...
Immutable Monthly Per Hour Data Collection.
62598f6c8e05c05ec3f6ea10
class BaseLifecycleTask(task.Task): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.task_utils = task_utilities.TaskUtils() <NEW_LINE> super().__init__(**kwargs)
Base task to instansiate common classes.
62598f6c3eb6a72ae0389dd7
@navigator.register(Tag, 'Add') <NEW_LINE> class TagsAdd(CFMENavigateStep): <NEW_LINE> <INDENT> prerequisite = NavigateToSibling('All') <NEW_LINE> def step(self): <NEW_LINE> <INDENT> fill(tag_form, {'category': self.obj.category.display_name}) <NEW_LINE> sel.click(tag_form.new)
Unlike most other Add operations, this one requires an instance
62598f6c6fece00bbaccb120
class MavenCommand(CommandProgram): <NEW_LINE> <INDENT> def __init__(self, allow_install: bool, update_package_manager: bool = True) -> NoReturn: <NEW_LINE> <INDENT> windows = WindowsInstallationPackage( windows_download_link="https://maven.apache.org/download.cgi", scoop_command="scoop install maven", choco_command="c...
Command to verify if ``mvn`` command is recognized by the operating system. If its not verify, the class install it automatically if you want.
62598f6c66673b3332c2fb52
class Runtime2to3SourceFileLoader(SourceFileLoader): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def loader(cls, *a, **kw): <NEW_LINE> <INDENT> def loader_for_Runtime2to3SourceFileLoader(fullname, path): <NEW_LINE> <INDENT> return cls(fullname, path, *a, **kw) <NEW_LINE> <DEDENT> return loader_for_Runtime2to3SourceFile...
Source file loader which runs source code through 2to3. Initial source loading will be _very_ slow, but results are cached so future imports will be faster. The cached source code is stored in the `__pycache__` directory with a `.<TAG>.py` suffix.
62598f6cc432627299fa276b
class SpanXPathSelector(SimpleSelector): <NEW_LINE> <INDENT> def __init__(self, session, config, parent): <NEW_LINE> <INDENT> self.sources = [] <NEW_LINE> SimpleSelector.__init__(self, session, config, parent) <NEW_LINE> if len(self.sources[0]) != 2: <NEW_LINE> <INDENT> raise ConfigFileException("SpanXPathSelector '{0}...
Selects data from between two given XPaths. Requires exactly two XPaths. The span starts at first configured XPath and ends at the second. The same XPath may be given as both start and end point, in which case each matching element acts as a start and stop point (e.g. an XPath for a page break).
62598f6c9b70327d1c57e540
@unique <NEW_LINE> class Type(IntEnum): <NEW_LINE> <INDENT> KW_DEF = 1 <NEW_LINE> KW_END = 2 <NEW_LINE> KW_RETURN = 3 <NEW_LINE> ADD = 100 <NEW_LINE> SUB = 101 <NEW_LINE> MUL = 102 <NEW_LINE> DIV = 103 <NEW_LINE> MOD = 104 <NEW_LINE> COMMA = 200 <NEW_LINE> DOT = 201 <NEW_LINE> L_BRACE = 300 <NEW_LINE> R_BRACE = 301 <NE...
(Type , Value) pairs of all language categories.
62598f6cff9c53063f519ded
class EMDES(pyrat.FilterWorker): <NEW_LINE> <INDENT> gui = {'menu': 'SAR|Speckle filter', 'entry': 'EMDES'} <NEW_LINE> para = [ {'var': 'win', 'value': [7, 7], 'type': 'int', 'range': [3, 999], 'text': 'Window size', 'subtext': ['range', 'azimuth']}, {'var': 'looks', 'value': 2.0, 'type': 'float', 'range': [1.0, 99.0],...
Test filter :author: Andreas Reigber
62598f6cd10714528d69d663
class EntityDetector(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.disallowed = ['i', 'you', 'it', 'north', 'south', 'east', 'west', 'northeast', 'northwest', 'southeast', 'southwest'] <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def detect(self, observation_text): <NEW_LINE> <INDENT> raise N...
Detect and extract entities from text.
62598f6c711fe17d825dfe81
class AuthorizationCode(GrantFlow): <NEW_LINE> <INDENT> @GrantFlow.error_on_inequality('response_type', "code") <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> throw_invalid_request_on_key_error(kwargs, 'client_id') <NEW_LINE> super(AuthorizationCode, self).generate_access_token(**kwargs)
[RFC6749 - Section:] 4.1. Authorization Code Grant The authorization code grant type is used to obtain both access tokens and refresh tokens and is optimized for confidential clients. [...] this is a redirection-based flow [...]
62598f6c8e05c05ec3f6ea11
class CheckTitle(regex): <NEW_LINE> <INDENT> pass
第\d+周(周.*).*【.*】
62598f6c56b00c62f0fb204c
class Filter: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.kmask = enmap.read_map(self.filename) <NEW_LINE> self.modrmap = self.kmask.modrmap() <NEW_LINE> self.wcs = self.kmask.wcs <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"Filt...
Class used to filter a real-space profile in Fourier space
62598f6c3eb6a72ae0389dd8
class EchoRequestReassemblyTimeoutTestCase(ComplianceTestCase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> self.logger.info("Sending fragment to nut") <NEW_LINE> self.node(1).send( util.pad( IPv6(src=str(self.router(1).global_ip().network()), dst=str(self.target(1).global_ip()))/ I...
Error Condition With Non-Unique Source - Anycast - Echo Request Reassembly Timeout Verify that a node properly handles the reception of an error condition caused by a packet with a source address that does not uniquely identify a single node. @private Source: IPv6 Ready Phase-1/Phase-2 Test Specification Core...
62598f6c1f5feb6acb1623cf
class NoChildException(Exception): <NEW_LINE> <INDENT> pass
NoChildException is raised by the reproduce() method in the SimpleBacteria and ResistantBacteria classes to indicate that a bacteria cell does not reproduce. You should use NoChildException as is; you do not need to modify it or add any code.
62598f6cc432627299fa276d
class Entry(Base): <NEW_LINE> <INDENT> __slots__ = ['scanner_paths', 'cachedir_csig', 'cachesig', 'repositories', 'srcdir', 'entries', 'searched', '_sconsign', 'variant_dirs', 'root', 'dirname', 'on_disk_entries', 'released_target_info', 'contentsig'] <NEW_LINE> def __init__(self, name, directory, fs): <NEW_LINE> <INDE...
This is the class for generic Node.FS entries--that is, things that could be a File or a Dir, but we're just not sure yet. Consequently, the methods in this class really exist just to transform their associated object into the right class when the time comes, and then call the same-named method in the transformed class...
62598f6c6fece00bbaccb123
class MultipleMachines(Test): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.docker1 = ContainerHelper() <NEW_LINE> self.docker1.setUp() <NEW_LINE> self.docker2 = ContainerHelper() <NEW_LINE> self.docker2.setUp() <NEW_LINE> <DEDENT> def testMultipleInstance(self): <NEW_LINE> <INDENT> self.docker1.start()...
Test two containers running at the same time. :avocado: enable
62598f6cd10714528d69d664
class CloseFilter(OpenFilter): <NEW_LINE> <INDENT> __filter_name__ = 'Close Filter' <NEW_LINE> __output_names__ = ('close_image',) <NEW_LINE> def generate_data(self): <NEW_LINE> <INDENT> self._logger.info(self.name) <NEW_LINE> input_ = self.input().image <NEW_LINE> output = self.output().image <NEW_LINE> MorphoMath.mor...
Close Filter
62598f6c30c21e258be97f98
class Solution: <NEW_LINE> <INDENT> def binaryTreePathSum(self, root, target): <NEW_LINE> <INDENT> result = [] <NEW_LINE> path = [] <NEW_LINE> self.helper(root, path, target, 0, result) <NEW_LINE> return result <NEW_LINE> <DEDENT> def helper(self, root, path, target, sum, result): <NEW_LINE> <INDENT> if root is None: <...
@param: root: the root of binary tree @param: target: An integer @return: all valid paths
62598f6c15fb5d323ce7e4bd
class FeedbackThreadModel(base_models.BaseModel): <NEW_LINE> <INDENT> exploration_id = ndb.StringProperty(required=True, indexed=True) <NEW_LINE> state_name = ndb.StringProperty(indexed=True) <NEW_LINE> original_author_id = ndb.StringProperty(indexed=True) <NEW_LINE> status = ndb.StringProperty( default=STATUS_CHOICES_...
Threads for each exploration. The id/key of instances of this class has the form [EXPLORATION_ID].[THREAD_ID]
62598f6c38b623060ffa8833
class UnifiVideoHTTPError(ValueError): <NEW_LINE> <INDENT> def __init__(self, code=None, message=None, caused_by=None): <NEW_LINE> <INDENT> msg = 'HTTP {} from UniFi Video.'.format(code) <NEW_LINE> if message: <NEW_LINE> <INDENT> msg += ' Error: {}.'.format(message) <NEW_LINE> <DEDENT> if caused_by: <NEW_LINE> <INDENT>...
HTTP error with message from UniFi Video server
62598f6c1d351010ab8f32da
class KuberlabClientException(Exception): <NEW_LINE> <INDENT> message = "An unknown exception occurred" <NEW_LINE> code = "UNKNOWN_EXCEPTION" <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.message <NEW_LINE> <DEDENT> def __init__(self, message=message): <NEW_LINE> <INDENT> self.message = message <NEW_LIN...
Base Exception for Kuberlab client To correctly use this class, inherit from it and define a 'message' and 'code' properties.
62598f6c287bf620b6271357
class PostView(DetailView): <NEW_LINE> <INDENT> http_method_names = ['get'] <NEW_LINE> template_name = 'blog/detail.html' <NEW_LINE> model = Post <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(PostView, self).get_context_data(**kwargs) <NEW_LINE> return context
Blog post view
62598f6c91af0d3eaad395a2
class class_nice_mesh_spin(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "bear.nice_mesh_spin" <NEW_LINE> bl_label = "Nice Mesh Spin" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> spin_angle = FloatProperty( name="Angle", description="Width", min=0.0, max=360.0, default=360.0, ) <NEW_LINE> spin_steps =...
Nice Mesh Spin
62598f6c167d2b6e312b6716
class SessionStore(SessionBase): <NEW_LINE> <INDENT> def __init__(self, session_key=None): <NEW_LINE> <INDENT> super(SessionStore, self).__init__(session_key) <NEW_LINE> self.db = Redis( settings.RSESSION.get('HOST', 'localhost'), settings.RSESSION.get('PORT', 6379), settings.RSESSION.get('DB', 0), settings.RSESSION.ge...
Implements database session store.
62598f6c76d4e153a661c3b2
class NumericalValue(Value): <NEW_LINE> <INDENT> def __init__(self, value: Optional[float]): <NEW_LINE> <INDENT> self._value = value <NEW_LINE> <DEDENT> @property <NEW_LINE> def value_type(self): <NEW_LINE> <INDENT> return ValueType.Numeric <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> r...
A numerical value
62598f6cec188e330fdf803a
class TestOfxFile(TransactionCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestOfxFile, self).setUp() <NEW_LINE> self.statement_import_model = self.registry('account.bank.statement.import') <NEW_LINE> self.bank_statement_model = self.registry('account.bank.statement') <NEW_LINE> <DEDENT> def tes...
Tests for import bank statement ofx file format (account.bank.statement.import)
62598f6cd99f1b3c44d04e4d
class AnonymousDepositSearch(B2ShareRecordsError): <NEW_LINE> <INDENT> code = 401 <NEW_LINE> description = 'Only authenticated users can search for drafts.'
Error raised when an anonymous user tries to search for drafts.
62598f6ccad5886f8bdc4ab8
class max(Modifier): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> dependencies = [Feature.or_constant(arg) for arg in args] <NEW_LINE> returns = float <NEW_LINE> name = "max({0})".format(", ".join(f.name for f in dependencies)) <NEW_LINE> super().__init__(name, self._process, returns=returns, depe...
Generates a feature that represents the maximum of a set of :class:`~revscoring.features.feature.Feature` or constant values.
62598f6c8c3a8732951f5ce9
class ResourceRegister(RestrictionRegister): <NEW_LINE> <INDENT> def __init__(self, fit, stat_name, usage_attr, restriction_type): <NEW_LINE> <INDENT> self.__restriction_type = restriction_type <NEW_LINE> self._fit = fit <NEW_LINE> self.__stat_name = stat_name <NEW_LINE> self.__usage_attr = usage_attr <NEW_LINE> self._...
Class which implements common functionality for all registers, which track amount of resource, which is used by various fit holders.
62598f6c1d351010ab8f32dc
class SeriesTeacher(EventStaffMember): <NEW_LINE> <INDENT> objects = SeriesTeacherManager() <NEW_LINE> @property <NEW_LINE> def netHours(self): <NEW_LINE> <INDENT> if self.specifiedHours is not None: <NEW_LINE> <INDENT> return self.specifiedHours <NEW_LINE> <DEDENT> return self.event.duration - sum([sub.netHours for su...
A proxy model that provides staff member properties specific to keeping track of series teachers.
62598f6ca4f1c619b294dd90
class ApplicantStatusForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Applicant <NEW_LINE> exclude = ('position', 'applicant', 'project', 'status')
Form for User to apply to Position
62598f6c66656f66f7d59b8a
class CatanGame(Frame): <NEW_LINE> <INDENT> TITLE = "Settlers of Catan: Buxom Wenches Expansion" <NEW_LINE> STATES = [ "LOAD_SCREEN" ] <NEW_LINE> def __init__(self, master, debug=True): <NEW_LINE> <INDENT> Frame.__init__(self, master) <NEW_LINE> self.focus_set() <NEW_LINE> self.master.title(self.TITLE) <NEW_LINE> self....
Main frame to contain settlers of catan game.
62598f6cd4950a0f3b110a05
class IncludeError(Exception): <NEW_LINE> <INDENT> def __init__(self, include_url, ref_url, message=None, *args): <NEW_LINE> <INDENT> Exception.__init__(self, include_url, ref_url, message, *args) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> include_url = self.args[0] <NEW_LINE> ref_url = self.args[1] <NE...
An exception raised when an include cannot be resolved.
62598f6c56b00c62f0fb2050
class Block(OneRollAfterAttackPhase): <NEW_LINE> <INDENT> def __init__(self, attacker, defender, hit_result): <NEW_LINE> <INDENT> super(Block, self).__init__(attacker, defender, hit_result) <NEW_LINE> self.result = self.calculate_result() <NEW_LINE> <DEDENT> def calculate_result(self): <NEW_LINE> <INDENT> result = self...
Has: implementation for result
62598f6cbe8e80087fbbe7f8
class NodeEllipse(QGraphicsEllipseItem, NodeMixIn): <NEW_LINE> <INDENT> pass
an QGraphicsEllipseItem with node behaviour
62598f6c167d2b6e312b6718
class Configurator(eventer.Configurator): <NEW_LINE> <INDENT> def attract(self, ring): <NEW_LINE> <INDENT> ring.focus(self) <NEW_LINE> return self <NEW_LINE> <DEDENT> def arise(self): <NEW_LINE> <INDENT> loop = asyncio.get_event_loop() <NEW_LINE> try: <NEW_LINE> <INDENT> self._intro() <NEW_LINE> loop.run_forever() <NEW...
The `Configurator` core
62598f6c0a366e3fb87dc160
class TidIndex(models.Model): <NEW_LINE> <INDENT> tid = models.IntegerField( primary_key=True, verbose_name='thread ID', help_text='Thread ID in Gmail. If a groups of mails have an identical number, then they are threaded.' ) <NEW_LINE> diary_date = models.DateField( db_index=True ) <NEW_LINE> profile = models.ForeignK...
Alarm mail is generally discarded, but it has an important property, diary date. Because diary date comes from MIME header, all alarm mails should be fetched, and parsed first.
62598f6c30c21e258be97f9c
@util.export <NEW_LINE> class Plugin(plugin.PluginBase): <NEW_LINE> <INDENT> @plugin.event( stage=plugin.Stages.STAGE_INIT, ) <NEW_LINE> def _init(self): <NEW_LINE> <INDENT> self.environment.setdefault(SAN_WIPE_AFTER_DELETE, None) <NEW_LINE> <DEDENT> @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, before=( oeng...
storage plugin.
62598f6c23e79379d538bc9d
class test_example_app(Command): <NEW_LINE> <INDENT> description = "Run tests in example_feedback application" <NEW_LINE> user_options = [] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self): <NEW_L...
Runs all tests under the sympy/ folder
62598f6c1f037a2d8b9e388b
class ChipIdentifierBase(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> LOG = logging.getLogger(__name__) <NEW_LINE> @abc.abstractmethod <NEW_LINE> def read(self, samba): <NEW_LINE> <INDENT> pass
Base class for SAM chip identification modules. Derived instances should override all methods listed here.
62598f6c6e29344779affdf9
class Configs(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.config_dir = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "config") <NEW_LINE> self.configs = self.get_configs() <NEW_LINE> <DEDENT> def get_configs(self): <NEW_LINE> <INDENT> config_files = [os.path.join(self.config_dir, c...
Parses the config files in /config and outputs the information
62598f6cd4950a0f3b110a06
class Atom: <NEW_LINE> <INDENT> def __init__(self, symbol, protons, mass): <NEW_LINE> <INDENT> self.symbol = symbol <NEW_LINE> self.protons = protons <NEW_LINE> self.mass = mass
Base class from which al elements must inherit
62598f6c6aa9bd52df0d466f
class CommentsViewSet(GetUserMixin, CommentActivityLogMixin, ModelViewSet): <NEW_LINE> <INDENT> serializer_class = CommentSerializer <NEW_LINE> queryset = Comment.objects.all() <NEW_LINE> filter_class = CommentsFilter <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return super().get_queryset().select_related('u...
This endpoint used to show, create and modify commentaries. It's provide filters for all comments presentation: single, paginated first level comments list-view by object (content_type + object_id) or parent instance and child list-view by parent or object.
62598f6c50485f2cf55da70c
class GPLVM(GP): <NEW_LINE> <INDENT> def __init__(self, Y, input_dim, init='PCA', X = None, kernel=None, normalize_Y=False): <NEW_LINE> <INDENT> if X is None: <NEW_LINE> <INDENT> X = self.initialise_latent(init, input_dim, Y) <NEW_LINE> <DEDENT> if kernel is None: <NEW_LINE> <INDENT> kernel = kern.rbf(input_dim, ARD=in...
Gaussian Process Latent Variable Model :param Y: observed data :type Y: np.ndarray :param input_dim: latent dimensionality :type input_dim: int :param init: initialisation method for the latent space :type init: 'PCA'|'random'
62598f6c7c178a314d78cc40
@inherit_doc <NEW_LINE> class RFormula(JavaEstimator, HasFeaturesCol, HasLabelCol, MLReadable, MLWritable): <NEW_LINE> <INDENT> formula = Param(Params._dummy(), "formula", "R model formula") <NEW_LINE> @keyword_only <NEW_LINE> def __init__(self, formula=None, featuresCol="features", labelCol="label"): <NEW_LINE> <INDEN...
.. note:: Experimental Implements the transforms required for fitting a dataset against an R model formula. Currently we support a limited subset of the R operators, including '~', '.', ':', '+', and '-'. Also see the R formula docs: http://stat.ethz.ch/R-manual/R-patched/library/stats/html/formula.html >>> df = sqlC...
62598f6c0a366e3fb87dc162
class RemoveObstacle: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.threshold = Parameter("Threshold",0,255,12) <NEW_LINE> self.vertical_blur = Parameter("Vertical Blur",0,255,18) <NEW_LINE> self.horizontal_blur = Parameter("Horizontal Blur",0,255,3) <NEW_LINE> <DEDENT> def execute(self, image): <NEW...
Remove obstacles from an image
62598f6cd10714528d69d66a
class BamlLocalizableResource(object): <NEW_LINE> <INDENT> def Equals(self,other): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetHashCode(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(self,content=None,...
Represents a localizable resource in a BAML stream. BamlLocalizableResource() BamlLocalizableResource(content: str,comments: str,category: LocalizationCategory,modifiable: bool,readable: bool)
62598f6ccad5886f8bdc4abc
class GetSprintCommand(controller.ICommand): <NEW_LINE> <INDENT> parameters = {'sprint': validator.MandatorySprintValidator} <NEW_LINE> def _execute(self, sp_controller, date_converter, as_key): <NEW_LINE> <INDENT> return self.return_as_value_object(self.sprint, date_converter, as_key)
Command to get a sprint for a given name
62598f6cfb3f5b602db47d80
class CSVLoggerIteration(CSVLogger): <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> super(CSVLoggerIteration, self).__init__(file) <NEW_LINE> <DEDENT> def on_epoch_end(self, epoch, logs=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def on_iteration(self, iteration, logs=None): <NEW_LINE> <INDEN...
Log every time validation is run if you set up validate_every on your trainer
62598f6c287bf620b627135d
class TestSandboxes(object): <NEW_LINE> <INDENT> SANDBOX_TYPE = SandboxCommandBase <NEW_LINE> def __init__(self, params, env): <NEW_LINE> <INDENT> self.sandboxes = [] <NEW_LINE> self.params = params <NEW_LINE> self.env = env <NEW_LINE> pop = self.params.object_params(self.__class__.__name__) <NEW_LINE> self.count = int...
Aggregate manager class of SandboxCommandBase or subclass instances
62598f6cac7a0e7691f71cb3
class Driver(_Driver): <NEW_LINE> <INDENT> lang = "de" <NEW_LINE> ExitMatcher = ExitMatcher <NEW_LINE> NAMELESS = "<namenloser Raum>" <NEW_LINE> LOOK = "schau" <NEW_LINE> EXAMINE = "untersuche" <NEW_LINE> _dir_local = tuple("norden sueden osten westen nordosten nordwesten suedosten suedwesten oben unten rein raus".spli...
Adaption for (generic) German MUDs
62598f6c1d351010ab8f32e1
class Mutation(graphene.ObjectType): <NEW_LINE> <INDENT> create_user = CreateUser.Field()
for create
62598f6c9b70327d1c57e54a
class ArrayStack: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._data = [] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._data) <NEW_LINE> <DEDENT> def is_empty(self): <NEW_LINE> <INDENT> return len(self._data) == 0 <NEW_LINE> <DEDENT> def push(self, obj): <NEW_LINE> <IND...
Inplement a Stack Data Structure that conforms to LIFO
62598f6cd164cc6175820714
class Stack: <NEW_LINE> <INDENT> def __init__(self,loads=None): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> if loads is not None: <NEW_LINE> <INDENT> for load in loads: <NEW_LINE> <INDENT> self.push(load) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def push(self, item): <NEW_LINE> <INDENT> self.items.append(item) <NEW_LIN...
Stack class implemented using the Python List object. Attributes: items: A List of items in the stack.
62598f6c15fb5d323ce7e4c5
class DocumentUserInformation(object): <NEW_LINE> <INDENT> openapi_types = { 'tenants': 'list[TenantInformation]' } <NEW_LINE> attribute_map = { 'tenants': 'tenants' } <NEW_LINE> def __init__(self, tenants=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT>...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598f6c1d351010ab8f32e2
class Service(object): <NEW_LINE> <INDENT> _rpcpath = '' <NEW_LINE> _methods = () <NEW_LINE> def __init__(self, server, endpoint, methods, verbose=False): <NEW_LINE> <INDENT> if isinstance(server, basestring): <NEW_LINE> <INDENT> self._rpcpath = rpcpath = server + '/xmlrpc/' <NEW_LINE> proxy = ServerProxy(rpcpath + end...
A wrapper around XML-RPC endpoints. The connected endpoints are exposed on the Client instance. The `server` argument is the URL of the server (scheme+host+port). If `server` is an ``openerp`` module, it is used to connect to the local server. The `endpoint` argument is the name of the service (examples: ``"object"``...
62598f6c30c21e258be97fa1
class GridMol(Grid): <NEW_LINE> <INDENT> def __init__(self, shape, center=None, spacing=1., dtype=float, probe_radius=1.4): <NEW_LINE> <INDENT> super(GridMol, self).__init__(shape, center, spacing, dtype) <NEW_LINE> self.probe_radius = probe_radius <NEW_LINE> self.atoms = [] <NEW_LINE> <DEDENT> def get_num_atoms(self):...
Molecule on a grid. Keeps track of the distance of each grid point to the molecular surface. Points inside the molecule are assigned negative values. Parameters ---------- shape : tuple Number of grid points in each dimension. center : tuple, optional (defaults to the origin) Grid center. spacing : float, opt...
62598f6cd4950a0f3b110a08
class MemoryInfo_proc(MemoryInfo_base): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._parse_proc_meminfo() <NEW_LINE> <DEDENT> except (IOError, ValueError): <NEW_LINE> <INDENT> raise OSError('/proc/meminfo is not available') <NEW_LINE> <DEDENT> <DEDENT> def _parse_proc_memin...
Provide information from ``/proc/`` pseudo-filesystem on most UNIXes EXAMPLES:: sage: from sage.misc.memory_info import MemoryInfo sage: mem = MemoryInfo() sage: mem.total_ram() # random output 16708194304
62598f6cbe8e80087fbbe7fe
class URLToHyperlink: <NEW_LINE> <INDENT> __implements__ = itransform <NEW_LINE> if ITransform: <NEW_LINE> <INDENT> implements(ITransform) <NEW_LINE> <DEDENT> __name__ = "url_to_hyperlink" <NEW_LINE> output = "text/plain" <NEW_LINE> def __init__(self, name=None, inputs=('text/plain',)): <NEW_LINE> <INDENT> self.config ...
transform which replaces urls and email into hyperlinks
62598f6c167d2b6e312b671e
class Lattice(object): <NEW_LINE> <INDENT> def __init__(self,x_size=2,y_size=2,x_h=1,x_A=0,): <NEW_LINE> <INDENT> self.X_size=x_size <NEW_LINE> self.Y_size=y_size <NEW_LINE> self.x_H=x_h <NEW_LINE> self.x_A=x_A <NEW_LINE> self.x_B=1-self.x_H-self.x_A <NEW_LINE> self.Grid=[[Particle(x=col,y=row) for col in range(self.X_...
defines a square 2D Lattice of Particle's type A and B and H(holes) Copyright M.Kotelyanskii 7/30/2017 - just set up a 2D rectangular PBC grid and flip particles at random, no interactions
62598f6c6fece00bbaccb12c
class AlternateMappingDescriptorTestClass(object): <NEW_LINE> <INDENT> prop = answer.BooleanAnswer('Herp', False, {'T': True, 'F': False})
Class for testing descriptor with alternative str-bool mapping
62598f6c50485f2cf55da710
class FillLevelMeasurement(State): <NEW_LINE> <INDENT> def __init__(self, fsm): <NEW_LINE> <INDENT> super(FillLevelMeasurement, self).__init__(fsm) <NEW_LINE> self.fillwithhelium_csv = self.fsm.data['FilePaths']['fillwithhelium_csv'] <NEW_LINE> <DEDENT> def enter(self): <NEW_LINE> <INDENT> self.log.info('===> Measure h...
measure helium level
62598f6c3eb6a72ae0389de2
class SearchClient(CoreApiRestClient): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(lisaConfig.slideSearch) <NEW_LINE> <DEDENT> def getSlideRatingsData(self, slideHierarchy, ratedResultsCountMin=20): <NEW_LINE> <INDENT> queryObjects = self.getModelInstances("queries") <NEW_LINE> for quer...
SearchClient is a REST API client which can make search queries to ZenCentral REST API for slide search.
62598f6c66673b3332c2fb5e
class PhysicianViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Physician.objects.all() <NEW_LINE> serializer_class = PhysicianSerializer
API endpoint that allows Physicians to be viewed.
62598f6c7c178a314d78cc44
class MySetForm(forms.Form): <NEW_LINE> <INDENT> setSpec = forms.CharField(label='Set spec', required=True) <NEW_LINE> setName = forms.CharField(label='Set name', required=True) <NEW_LINE> description = forms.CharField(label='Description', required=True, widget=forms.Textarea(attrs = {'cols': '60', 'rows': '5', 'style'...
A MyMetadataFormatForm form
62598f6c507cdc57c63a453c
class ModifyTargetGroupInstancesPortRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TargetGroupId = None <NEW_LINE> self.TargetGroupInstances = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TargetGroupId = params.get("TargetGroupId") <NEW_LINE...
ModifyTargetGroupInstancesPort请求参数结构体
62598f6cd10714528d69d66e
class Membership(LarvaeBase): <NEW_LINE> <INDENT> _type = "membership" <NEW_LINE> _schema = schema <NEW_LINE> __slots__ = ("organization_id", "person_id", "post_id", "role", "start_date", "end_date", "contact_details", "district", "chamber") <NEW_LINE> def __init__(self, person_id, organization_id, **kwargs): <NEW_LINE...
A single popolo encoded Membership.
62598f6c38b623060ffa883d
class StockDetail(APIView): <NEW_LINE> <INDENT> def get_object(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> stock = Stock.objects.get(name=name) <NEW_LINE> controller = Controller() <NEW_LINE> stock_data = controller.get_ticker_data(stock.name) <NEW_LINE> print(stock_data) <NEW_LINE> return Stock.objects.g...
Retrieve, update or delete a code snippet.
62598f6c5166f23b2e242b7d
class CurrentFeedTypeKpi(Kpi): <NEW_LINE> <INDENT> icon = 'cutlery' <NEW_LINE> description = 'Current feed type' <NEW_LINE> action_name = 'Register feeding transition' <NEW_LINE> def __init__(self, flock): <NEW_LINE> <INDENT> self.flock = flock <NEW_LINE> used_types = self.__get_actual_feeding_types() <NEW_LINE> recomm...
Kpi for displaying the recommended feed type. This KPI is used to show the recommended feed types. With the colors, the match between the recommended and the actually being used feed-types are displayed.
62598f6c5e10d32532ce34bc
class ThresholdSelector(Process): <NEW_LINE> <INDENT> _serves = ConstructType.terminus <NEW_LINE> def __init__(self, source: Symbol, threshold: float = 0.85): <NEW_LINE> <INDENT> super().__init__(expected=(source,)) <NEW_LINE> self.threshold = threshold <NEW_LINE> <DEDENT> def call(self, inputs: Mapping[Any, nd.NumDict...
Propagator for extracting nodes above a thershold. Targets feature nodes by default.
62598f6c7b25080760ed6c3d
class listFetchRecord_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(FetchRecord, FetchRecord.thrift_spec)), None, ), (1, TType.STRUCT, 'e', (error.ttypes.ServiceException, error.ttypes.ServiceException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, e=None,):...
Attributes: - success - e
62598f6cd4950a0f3b110a09
class _CAxisImageX( _pyqtgraph.AxisItem): <NEW_LINE> <INDENT> def tickStrings(self, values, scale, spacing): <NEW_LINE> <INDENT> strns = [] <NEW_LINE> gqe = self.gqe <NEW_LINE> for ix in values: <NEW_LINE> <INDENT> if hasattr( gqe, 'xMin'): <NEW_LINE> <INDENT> x = float(ix)/float( gqe.width)*(gqe.xMax - gqe.xMin) + gqe...
Formats axis label to human readable time.
62598f6c925a0f43d25e77dd
class NotEnoughLinesError(CliParsersBaseError, ValueError): <NEW_LINE> <INDENT> pass
Not enough lines for parsing
62598f6c76d4e153a661c3bd
class SJSetBoneLy28(bpy.types.Operator): <NEW_LINE> <INDENT> ly = 28 <NEW_LINE> bl_idname = "object.sj_set_bone_ly{}".format(ly) <NEW_LINE> bl_label = str(ly) <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> sbl = SJSetBoneLy(self.ly) <NEW_LINE> del sbl <NEW_LINE> return {'FINISHED'}
Ser Bone Layer
62598f6c66673b3332c2fb60
class ImageStatus(object): <NEW_LINE> <INDENT> PENDING = "PENDING" <NEW_LINE> READY = "READY" <NEW_LINE> FAILED = "FAILED"
Represents the status of an image.
62598f6cec188e330fdf8044
class SqlalchemyCsvDebugPanel(DebugPanel): <NEW_LINE> <INDENT> name = "sqlalchemy-csv" <NEW_LINE> template = "pyramid_debugtoolbar_api_sqlalchemy:templates/sqlalchemy_csv.dbtmako" <NEW_LINE> title = _("SQLAlchemy Queries CSV") <NEW_LINE> nav_title = _("SQLAlchemy CSV") <NEW_LINE> def __init__(self, original_request): <...
Panel that displays a link to SQLACSV download
62598f6c7c178a314d78cc46
class Knight(AbstractGameUnit): <NEW_LINE> <INDENT> def __init__(self, name: str = "Sir Foo"): <NEW_LINE> <INDENT> super().__init__(name=name) <NEW_LINE> self.max_hp = 40 <NEW_LINE> self.health_meter = self.max_hp <NEW_LINE> self.unit_type = "friend" <NEW_LINE> <DEDENT> def info(self): <NEW_LINE> <INDENT> print("I am a...
Class that represents the game character 'Knight' The player instance in the game is a Knight instance. Other Knight instances are considered as 'friends' of the player and is indicated by the attribute `self.unit_type` . :arg str name: Name of this game character (optional) :ivar int max_hp: Maximum number of hit p...
62598f6cb57a9660fecd1231
class TestRegularUserOffersListAPIView(_TestOffersListAPIView): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.client.force_login(UserFactory()) <NEW_LINE> <DEDENT> def test_offer_list_length(self): <NEW_LINE> <INDENT> OfferFactory.create_batch(34, offer_status='published') <NE...
Tests for REST API's list offers view for regular user.
62598f6c91af0d3eaad395ae