code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@base.ReleaseTracks(base.ReleaseTrack.ALPHA) <NEW_LINE> class CreatePull(base.CreateCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> flags.AddIdArg(parser, 'pull queue', 'to create') <NEW_LINE> flags.AddLocationFlag(parser) <NEW_LINE> flags.AddCreatePullQueueFlags(parser) <NE... | Create a pull queue.
The flags available to this command represent the fields of a pull queue
that are mutable.
For more information about the different queue target types, see:
https://cloud.google.com/cloud-tasks/docs/queue-types | 62598f01099cdd3c636748d3 |
class QuestionSet: <NEW_LINE> <INDENT> def __init__(self, prompts, questions): <NEW_LINE> <INDENT> self.__prompts = prompts <NEW_LINE> self.__questions = questions <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.remaining = True <NEW_LINE> self.responses = {} <NEW_LINE> self.__curr... | QuestionSet
A class for iterating through a set of questions, where responses to questions determine the next question asked. | 62598f0197e22403b38398df |
class BotTimeOccupied(BotCommandException): <NEW_LINE> <INDENT> pass | Booking time is already occupied by other booking item. | 62598f0126068e7796d4b354 |
class PyLinter(LinterBase): <NEW_LINE> <INDENT> linter_type = 'Python' <NEW_LINE> cli_dir = os.path.join('src', 'python', 'cli_new') <NEW_LINE> lib_dir = os.path.join('src', 'python', 'lib') <NEW_LINE> support_dir = os.path.join('support', 'python3') <NEW_LINE> source_dirs_to_lint_with_venv = [support_dir] <NEW_LINE> s... | The linter for Python files, uses pylint. | 62598f013346ee7daa336b63 |
class UtilityTests(TestCase): <NEW_LINE> <INDENT> def test_inTransactionSuccess(self): <NEW_LINE> <INDENT> class faketxn(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.commits = [] <NEW_LINE> self.aborts = [] <NEW_LINE> <DEDENT> def commit(self): <NEW_LINE> <INDENT> self.commits.append(Deferr... | Tests for supporting utilities. | 62598f015fdd1c0f98e5c99f |
class NaD2Transition: <NEW_LINE> <INDENT> wavelength=589.1583264e-9 <NEW_LINE> wavevectorMagnitude=2.0*pi/wavelength <NEW_LINE> NatGamma=9.7946 <NEW_LINE> dipoleStrength=3.0*sqrt(e0*hbar*(2.0*NatGamma*(10.0**6))*(wavelength**3)/(8.0*pi)) <NEW_LINE> v0=508.8487162e12 | Constants relating to the sodium D2 transition | 62598f01851cf427c66b6cc3 |
class UploadCommand(Command): <NEW_LINE> <INDENT> description = 'Build and publish the package.' <NEW_LINE> user_options = [] <NEW_LINE> @staticmethod <NEW_LINE> def status(s): <NEW_LINE> <INDENT> print('\033[1m{0}\033[0m'.format(s)) <NEW_LINE> <DEDENT> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> ... | Support setup.py upload. | 62598f015fc7496912d47770 |
class Stairs(TruncatedPyramid): <NEW_LINE> <INDENT> def __init__(self, finish_thickness=null, bottom_length=null, bottom_width=null, top_length=null, top_width=null, height=null, depth=null): <NEW_LINE> <INDENT> super().__init__(finish_thickness, bottom_length, bottom_width, top_length, top_width, height) <NEW_LINE> se... | Stairs.
| 62598f017047854f4633ddc1 |
class ImageInfo: <NEW_LINE> <INDENT> def __init__(self, center, size, radius = 0, lifespan = None, animated = False): <NEW_LINE> <INDENT> self.center = center <NEW_LINE> self.size = size <NEW_LINE> self.radius = radius <NEW_LINE> if lifespan: <NEW_LINE> <INDENT> self.lifespan = lifespan <NEW_LINE> <DEDENT> else: <NEW_L... | Get information from graphics. This includes center, size, radius, lifespan and if
its animated or not (e.g. explosions) | 62598f014c34283577618ce4 |
class TestMain(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.database_name = "host.docker.internal" <NEW_LINE> cls.database = Database(cls.database_name) <NEW_LINE> cls.gateway = IbGateway(port=4001, host="host.docker.internal", clientId=1) <NEW_LINE> while... | Test CSV reader | 62598f01be7bc26dc9251361 |
class Negate(Node): <NEW_LINE> <INDENT> def __init__(self, node, name="Negate"): <NEW_LINE> <INDENT> super().__init__([node], name) <NEW_LINE> self.node = self.children[0] <NEW_LINE> self.shape = self.node.shape <NEW_LINE> <DEDENT> def _eval(self): <NEW_LINE> <INDENT> return -self.node() <NEW_LINE> <DEDENT> def _partia... | Operation which does Negation on a Node | 62598f014a966d76dd5ed8cf |
class ContextIOWrapper: <NEW_LINE> <INDENT> def __init__(self, output, nocolor=False): <NEW_LINE> <INDENT> self.__newline = True <NEW_LINE> self.__colored = True <NEW_LINE> self.__output = output <NEW_LINE> self.__nocolor = nocolor <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(sel... | Context-aware text IO wrapper class.
| 62598f012c8b7c6e89bd21bf |
class LinuxBatterySensor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, battery_id, system): <NEW_LINE> <INDENT> self._battery = Batteries() <NEW_LINE> self._name = name <NEW_LINE> self._battery_stat = None <NEW_LINE> self._battery_id = battery_id - 1 <NEW_LINE> self._system = system <NEW_LINE> <DEDENT> @propert... | Representation of a Linux Battery sensor. | 62598f015fcc89381b265628 |
class GameEntry: <NEW_LINE> <INDENT> def __init__(self, name, score): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._score = score <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def get_score(self): <NEW_LINE> <INDENT> return self._score <NEW_LINE> <DEDENT> def... | Represents one entry of a list of high scores | 62598f01ff9c53063f51905d |
class FolderDelegate(pigui.pyqt5.widgets.delegate.FolderDelegate): <NEW_LINE> <INDENT> def action_event(self, state): <NEW_LINE> <INDENT> action = self.sender() <NEW_LINE> label = action.text() <NEW_LINE> if label == "Open in About": <NEW_LINE> <INDENT> event = dash.event.OpenInAboutEvent(index=self.index) <NEW_LINE> Q... | Append context-menu | 62598f01167d2b6e312b5998 |
class City(models.Model): <NEW_LINE> <INDENT> city_id = models.IntegerField(primary_key=True) <NEW_LINE> city = models.CharField(max_length=200) <NEW_LINE> country_id = models.IntegerField() <NEW_LINE> last_update = models.DateTimeField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'city' | Model class of City | 62598f0163b5f9789fe83b5c |
class AbstractDocument(models.Model): <NEW_LINE> <INDENT> document_link = models.URLField( help_text=_("The Internet address where the document may be found."), ) <NEW_LINE> date = models.DateTimeField( blank=True, null=True, help_text=_("Date of validity of the document"), ) <NEW_LINE> document_description = models.Te... | Document
Definition
Any document providing information about the building or building part or building unit.
Description
EXAMPLES: the building permit, a photo of facade or inner yard, a sketch of interior, the building code, the
energy performance assessment, an emergency plan | 62598f017b180e01f3e48545 |
class MufgPaymentToSelfRow(MufgPaymentRow): <NEW_LINE> <INDENT> pass | This class implements payment from self row model of MUFG bank CSV. | 62598f0150812a4eaa6200e9 |
class DescribeShipperTasksResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Tasks = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Tasks") is not None: <NEW_LINE> <INDENT> self.Tasks = [] <NEW_LINE> for... | DescribeShipperTasks返回参数结构体
| 62598f01be7bc26dc9251362 |
class MinerArgumentError(MinerError): <NEW_LINE> <INDENT> pass | Invalid argument error. | 62598f014a966d76dd5ed8d1 |
class Project(pm.ProvActivity,Core): <NEW_LINE> <INDENT> def __init__(self,attributes=None, empty_graph=False, uuid=None): <NEW_LINE> <INDENT> if (empty_graph): <NEW_LINE> <INDENT> self.graph = pm.ProvDocument() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.graph = Constants.NIDMDocument(namespaces=Constants.names... | Class for NIDM-Experiment Project-Level Objects.
Default constructor uses empty graph with namespaces added from NIDM/Scripts/Constants.py.
Additional alternate constructors for user-supplied graphs and default namespaces (i.e. from Constants.py)
and user-supplied graph and namespaces
@author: David Keator <dbkeator@... | 62598f0110dbd63aa1c6f57d |
class EntryQuerysetArchiveTodayTemplateResponseMixin( EntryQuerysetArchiveTemplateResponseMixin): <NEW_LINE> <INDENT> today = None <NEW_LINE> def get_archive_part_value(self, part): <NEW_LINE> <INDENT> parts_dict = {'year': '%Y', 'month': self.month_format, 'week': self.week_format, 'day': '%d'} <NEW_LINE> if self.toda... | Same as EntryQuerysetArchivetemplateResponseMixin
but use the current date of the day when getting
archive part values | 62598f018a349b6b43684c41 |
class VideoUploadConfig(ConfigurationModel): <NEW_LINE> <INDENT> profile_whitelist = TextField( blank=True, help_text="A comma-separated list of names of profiles to include in video encoding downloads." ) <NEW_LINE> @classmethod <NEW_LINE> def get_profile_whitelist(cls): <NEW_LINE> <INDENT> return [profile for profile... | Configuration for the video upload feature. | 62598f01283ffb24f3cf22a9 |
class JSONObjectField(models.TextField): <NEW_LINE> <INDENT> empty_strings_allowed = False <NEW_LINE> description = _lazy(u'JSON Object') <NEW_LINE> def pre_init(self, value, obj): <NEW_LINE> <INDENT> if obj._state.adding: <NEW_LINE> <INDENT> if isinstance(value, basestring): <NEW_LINE> <INDENT> return json.loads(value... | Represents a JSON object.
Note: This might be missing a lot of Django infrastructure to
work correctly across edge cases. Also it was tested with MySQL
and no other db backends. | 62598f014527f215b58e88fa |
class AlgoTests_Rule2(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> cells.reset() <NEW_LINE> self.x = cells.Cell(None, name="x", value=21) <NEW_LINE> self.captured_notify_flag = None <NEW_LINE> def a_rule(s, p): <NEW_LINE> <INDENT> self.captured_notify_flag = self.x.notifying <NEW_LINE> r... | 2. If a cell's value changes, it must tell all cells which call it to
recalculate. The cell must flag itself as being in the midst of
this process until all of its dependents have finished
recalculating. | 62598f017b180e01f3e48546 |
class ExternalNode(gpi.NodeAPI): <NEW_LINE> <INDENT> def initUI(self): <NEW_LINE> <INDENT> self.addWidget('SpinBox', 'dim', min=0) <NEW_LINE> self.addWidget('DoubleSpinBox', 'fraction', min=0.5, max=1.0, decimals=3, singlestep=0.01) <NEW_LINE> self.addInPort('kspace', 'NPYarray') <NEW_LINE> self.addOutPort('out', 'NPYa... | Usage: homodyne dim fraction <input> <output>
Perform homodyne reconstruction along dimension dim. | 62598f0123849d37ff84fac0 |
class DirectedGraph(Graph): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DirectedGraph, self).__init__() <NEW_LINE> <DEDENT> def get_outgoing_edges(self, vertex): <NEW_LINE> <INDENT> return [edge for edge in self.adjacency_list[vertex] if edge.a == vertex] <NEW_LINE> <DEDENT> def edge_exists(self, ... | Directed Graph implementation | 62598f014f88993c371ef9e9 |
class PublicUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_create_valid_user_success(self): <NEW_LINE> <INDENT> payload = { 'email': '59@ma.com', 'password': '59595959595', 'name': 'Django' } <NEW_LINE> res = self.client.post(CREAT... | Test the users API (public) | 62598f015166f23b2e241dde |
class Sound(BaseObject): <NEW_LINE> <INDENT> id_generator = DefaultObjectIdGenerator('soundId') <NEW_LINE> def __init__(self, client, sound_json): <NEW_LINE> <INDENT> super(Sound, self).__init__( client, client.swagger.sounds, sound_json, client.on_sound_event) | First class object API.
:param client: ARI client.
:type client: client.Client
:param sound_json: Instance data | 62598f01cc40096d616196d9 |
class DataPadder(DataTransformer): <NEW_LINE> <INDENT> def __init__(self, max_sequence_length: int = 100, invert_padding: bool = True) -> None: <NEW_LINE> <INDENT> self.max_sequence_length = max_sequence_length <NEW_LINE> self.invert_padding = invert_padding <NEW_LINE> <DEDENT> def preprocess(self, sequences: List[np.n... | Assembles a list of sequences into a numpy array of shape (num_sequences x max_sequence_length x num_features) and pads
with nan or cuts a sequence if necessary.
NOT USED | 62598f0150812a4eaa6200eb |
class DummyIndexParameter(IndexParameter): <NEW_LINE> <INDENT> def __init__(self, model, index, **kwargs): <NEW_LINE> <INDENT> super(DummyIndexParameter, self).__init__(model, **kwargs) <NEW_LINE> self._index = index <NEW_LINE> <DEDENT> def index(self, timestep, scenario_index): <NEW_LINE> <INDENT> return self._index <... | A simple IndexParameter which returns a constant value | 62598f017c178a314d78be9d |
class PatchDjangoTicket1476(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def apply_if_needed(patch): <NEW_LINE> <INDENT> import django <NEW_LINE> if django.VERSION[0:3] <= (1, 2, 4): <NEW_LINE> <INDENT> patch.apply() <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def apply(patch): <NEW_LINE> <INDENT> from... | Patch for bug http://code.djangoproject.com/ticket/1476 | 62598f01dc8b845886d51fc7 |
class OutMovementCopies(models.Model): <NEW_LINE> <INDENT> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> card = models.ForeignKey("search.Card", db_index=True) <NEW_LINE> movement = models.ForeignKey("OutMovement") <NEW_LINE> quantity = models.IntegerField(default=1, blank=True, null=True) | When the movement is about many cards (a basket), remember the
cards' quantities at that time. | 62598f017047854f4633ddc7 |
class SearchForLabelCommand(sublime_plugin.WindowCommand): <NEW_LINE> <INDENT> def is_visible(self): <NEW_LINE> <INDENT> return bool(INFOS.addon) and bool(INFOS.get_po_files()) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> listitems = [] <NEW_LINE> self.ids = [] <NEW_LINE> for po_file in INFOS.get_po_files(): ... | Search through all core / addon labels and insert selected entry | 62598f0123849d37ff84fac2 |
class Restaurant(): <NEW_LINE> <INDENT> def __init__(self, restaurant_name, cuisine_type): <NEW_LINE> <INDENT> self.restaurant_name = restaurant_name <NEW_LINE> self.cuisine_type = cuisine_type <NEW_LINE> self.number_served = 0 <NEW_LINE> <DEDENT> def describe_restaurant(self): <NEW_LINE> <INDENT> print("\n레스토랑 이름: " +... | 레스토랑을 모델화 | 62598f010fa83653e46f38e3 |
class ArgumentDefaultsRawHelpFormatter( argparse.ArgumentDefaultsHelpFormatter, argparse.RawTextHelpFormatter, argparse.RawDescriptionHelpFormatter): <NEW_LINE> <INDENT> pass | HelpFormatter that adds default values AND doesn't do line-wrapping | 62598f01aad79263cf42d211 |
class FirmwareCompatibilityRequest(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'storage_device_ids': 'list[str]', 'released_builds_only': 'bool' } <NEW_LINE> self.attribute_map = { 'storage_device_ids': 'storageDeviceIds', 'released_builds_only': 'releasedBuildsOnly' } <N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f01ad47b63b2c5a6219 |
class OperationsService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'operations' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(SpeechV1p1beta1.OperationsService, self).__init__(client) <NEW_LINE> self._upload_configs = { } <NEW_LINE> <DEDENT> def Get(self, request, global_params=None): <NE... | Service class for the operations resource. | 62598f01f548e778e5969f88 |
class APNS(object): <NEW_LINE> <INDENT> def __init__(self, app=None, address="push_sandbox", failure_callback=None, **cert_params): <NEW_LINE> <INDENT> self.session = Session() <NEW_LINE> self.failed_callback = failure_callback <NEW_LINE> self._cert_params = cert_params <NEW_LINE> self._address = address <NEW_LINE> sel... | APNS extension | 62598f0160cbc95b06362d33 |
class IPNetworkPrefixLen(RangeConstrainedInteger): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(IPNetworkPrefixLen, self).__init__( start=0, end=constants.IPV6_MAX_PREFIXLEN, **kwargs) | IP network (CIDR) prefix length custom Enum | 62598f01167d2b6e312b599e |
class BwList(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "bw-list" <NEW_LINE> self.a10_url="/axapi/v3/file/bw-list" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.action = "" <NEW_LINE> self.dst_file = "" ... | :param action: {"optional": true, "enum": ["create", "import", "export", "copy", "rename", "check", "replace", "delete"], "type": "string", "description": "'create': create; 'import': import; 'export': export; 'copy': copy; 'rename': rename; 'check': check; 'replace': replace; 'delete': delete; ", "format": "enum"}
... | 62598f01851cf427c66b6ccb |
class EnergyDemand(Consumer): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) | Allows to describe the total energy demand when differentiation between energy carriers is not possible or required, otherwise e.g. ElectricityDemand or HeatingDemand is an alternative | 62598f0150812a4eaa6200ec |
class Repository(ProjectRepository): <NEW_LINE> <INDENT> PARAMS: Tuple[str, ...] = ( "url", "needs_commit", "needs_merge", "needs_push", "status", "merge_failure", "remote_commit", ) | Repository object. | 62598f017c178a314d78be9f |
class cSimEnvironment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.threads = [] <NEW_LINE> self.schedule = cSimSchedule() <NEW_LINE> <DEDENT> def get_time(self): <NEW_LINE> <INDENT> return self.schedule.get_time() <NEW_LINE> <DEDENT> def get_the_schedule(self): <NEW_LINE> <INDENT> return self.sched... | Our environment consists of connected asyncronious threads (behaviours).
This class manages these threads: iterates over them to gather simulation schedule,
activates and deactives them. | 62598f013d592f4c4edb98f1 |
class Initializer(object): <NEW_LINE> <INDENT> def __call__(self, name, arr): <NEW_LINE> <INDENT> if not isinstance(name, string_types): <NEW_LINE> <INDENT> raise TypeError('name must be string') <NEW_LINE> <DEDENT> if not isinstance(arr, NDArray): <NEW_LINE> <INDENT> raise TypeError('arr must be NDArray') <NEW_LINE> <... | Base class for Initializer. | 62598f01a219f33f346c5230 |
class Industry(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=30) <NEW_LINE> latitude = models.FloatField() <NEW_LINE> longitude = models.FloatField() <NEW_LINE> id_cli = models.ForeignKey(Client, null=True, on_delete=models.CASCADE) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.n... | Model of Industry | 62598f01091ae3566870361d |
class TestActionShutterMultilevel(JNTTFactory, JNTTFactoryCommon): <NEW_LINE> <INDENT> entry_name='action_shutter_multilevel' | Test the value factory
| 62598f0123849d37ff84fac4 |
class Savepoint(dict): <NEW_LINE> <INDENT> def __init__(self, ser, savepoint): <NEW_LINE> <INDENT> self.savepoint = savepoint <NEW_LINE> self.serializer = ser <NEW_LINE> self.fields = ser.serializer.fields_at_savepoint(savepoint) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _reshape_array(array): <NEW_LINE> <INDENT... | Represents a serializer savepoint | 62598f014428ac0f6e656f50 |
class IHightPerson(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def getName(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def getHeight(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def appearance(self, person): <NEW_LINE> <INDENT> ... | 接口类,提供空实现的方法,由子类去实现 | 62598f015166f23b2e241de2 |
class ReadFifoQueueResponse(ModbusResponse): <NEW_LINE> <INDENT> function_code = 0x18 <NEW_LINE> @classmethod <NEW_LINE> def calculateRtuFrameSize(cls, buffer): <NEW_LINE> <INDENT> hi_byte = byte2int(buffer[2]) <NEW_LINE> lo_byte = byte2int(buffer[3]) <NEW_LINE> return (hi_byte << 16) + lo_byte + 6 <NEW_LINE> <DEDENT> ... | In a normal response, the byte count shows the quantity of bytes to
follow, including the queue count bytes and value register bytes
(but not including the error check field). The queue count is the
quantity of data registers in the queue (not including the count register).
If the queue count exceeds 31, an exception... | 62598f01099cdd3c636748d8 |
@partial(properties_for_args, arg_names='ARGNAMES') <NEW_LINE> class CavityCC(Component): <NEW_LINE> <INDENT> CDIM = 1 <NEW_LINE> ARGNAMES = ('hs', 'Delta', 'kappa') <NEW_LINE> DEFAULTS = { 'hs': 0, 'Delta': sympy.symbols('Delta', real=True), 'kappa': sympy.symbols('kappa', real=True)} <NEW_LINE> PORTSIN = ("in", ) <NE... | Single-sided cavity circuit component | 62598f01d486a94d0ba2a9cb |
class Variable(Base): <NEW_LINE> <INDENT> __tablename__ = 'variables' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(Unicode(60), unique=True) <NEW_LINE> is_var = Column(Integer, nullable=False) <NEW_LINE> def __init__(self, name, is_var): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self... | The Variable object represents a Random Event or Script Variable.
It has a name and a boolean to determine whether it is a variable
or random event. | 62598f015fdd1c0f98e5c9a9 |
class UpdatedVideoClip(VideoClip): <NEW_LINE> <INDENT> def __init__(self, world, ismask=False, duration=None): <NEW_LINE> <INDENT> self.world = world <NEW_LINE> def make_frame(t): <NEW_LINE> <INDENT> while self.world.clip_t < t: <NEW_LINE> <INDENT> world.update() <NEW_LINE> <DEDENT> return world.to_frame() <NEW_LINE> <... |
Class of clips whose make_frame requires some objects to
be updated. Particularly practical in science where some
algorithm needs to make some steps before a new frame can
be generated.
UpdatedVideoClips have the following make_frame:
>>> def make_frame(t):
>>> while self.world.clip_t < t:
>>> world.... | 62598f01956e5f7376df4b7d |
class HighlightOptions(object): <NEW_LINE> <INDENT> def __init__(self, criterion, description=None, font_attr=DEFAULT_TENSOR_ELEMENT_HIGHLIGHT_FONT_ATTR): <NEW_LINE> <INDENT> self.criterion = criterion <NEW_LINE> self.description = description <NEW_LINE> self.font_attr = font_attr | Options for highlighting elements of a tensor. | 62598f018a349b6b43684c47 |
class CharacterCmdSet(default_cmds.CharacterCmdSet): <NEW_LINE> <INDENT> key = "DefaultCharacter" <NEW_LINE> def at_cmdset_creation(self): <NEW_LINE> <INDENT> super(CharacterCmdSet, self).at_cmdset_creation() <NEW_LINE> self.add(general.CmdLook()) <NEW_LINE> self.add(general.CmdGoto()) <NEW_LINE> self.add(general.CmdIn... | The `CharacterCmdSet` contains general in-game commands like `look`,
`goto`, etc available on in-game Character objects. It is merged with
the `PlayerCmdSet` when a Player puppets a Character. | 62598f0160cbc95b06362d35 |
class GameEnded(Event): <NEW_LINE> <INDENT> def __init__(self, channel: str, results: typing.Dict["Player", typing.Optional[bool]]): <NEW_LINE> <INDENT> super().__init__(channel) <NEW_LINE> self.results: typing.Dict["Player", typing.Optional[bool]] = results | The game has advanced from the :py:const:`mifia.GameState.IN_PROGRESS` to the
:py:const:`mifia.GameState.ENDED`.
Attributes:
results: A dict that maps players to a value that is either :py:const:`None` (null result), :py:const:`True`
(win) or :py:const:`False` (loss). | 62598f017c178a314d78bea1 |
class UserRole(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> permissions = models.ManyToManyField(ActionType) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = ['name'] <NEW_LINE> verbose_name_plural = u"User Roles" <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT... | User roles in system
Engineer
Manager
etc | 62598f01a219f33f346c5232 |
class FrozenJSON: <NEW_LINE> <INDENT> def __init__(self, mapping): <NEW_LINE> <INDENT> self.__data = dict(mapping) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if hasattr(self.__data, name): <NEW_LINE> <INDENT> return getattr(self.__data, name) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> retur... | >>> from osconfeed import load
>>> raw_feed = load()
>>> feed = FrozenJSON(raw_feed)
>>> len(feed.Schedule.speakers)
357
>>> sorted(feed.Schedule.keys())
['conferences', 'events', 'speakers', 'venues']
>>> for key, value in sorted(feed.Schedule.items()):
... print('{:3} {}'.format(len(value), key))
...
1 conferen... | 62598f01656771135c48808f |
class Message(AsDictType, FieldCollection): <NEW_LINE> <INDENT> def __init__( self, name: [str], message_id: int, blockLength: Optional[int] = None, description: Optional[str] = None, semanticType: Optional[str] = None, sinceVersion: Optional[int] = 0, deprecated: Optional[int] = None, ) -> None: <NEW_LINE> <INDENT> su... | A message | 62598f01fff4ab517ebcc1d8 |
class SimpleObject: <NEW_LINE> <INDENT> def __init__(self, x: int, y: str, z: Optional[List[int]] = None) -> None: <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z or [] | Like 99% of your python classes, custom __new__ implementations are relatively bespoke and often unnecessary.
This class works just fine and has no pre/post instance manipulation from a __new__ implementation. Instead it
uses objects __new__ by default, implicitly. | 62598f0197e22403b38398eb |
class InvalidCmdOperation(TRIADBError): <NEW_LINE> <INDENT> pass | Raised when it fails to execute a query command | 62598f015166f23b2e241de4 |
class InventoryEventHandler(AskUserEventHandler): <NEW_LINE> <INDENT> TITLE: str = "<missing title>" <NEW_LINE> def on_render(self, console: tcod.Console) -> None: <NEW_LINE> <INDENT> super().on_render(console) <NEW_LINE> number_of_items_in_inventory: int = len(self.engine.player.inventory.items) <NEW_LINE> height: int... | This handler lets the user select an item.
What happens then depends on the subclass. | 62598f01283ffb24f3cf22b0 |
class VerletListLennardJonesCappedLocal(InteractionLocal, interaction_VerletListLennardJonesCapped): <NEW_LINE> <INDENT> def __init__(self, vl): <NEW_LINE> <INDENT> if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(): <NEW_LINE> <INDENT> cxxinit(self, interaction_Verl... | The (local) Lennard Jones interaction using Verlet lists. | 62598f0126068e7796d4b360 |
class RatingSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Rating <NEW_LINE> fields = '__all__' | This serializer presents all the fields, including "data". For use in detail endpoints. | 62598f013346ee7daa336b69 |
class ESPEAKWrapper(object): <NEW_LINE> <INDENT> TAG = "ESPEAKWrapper" <NEW_LINE> def __init__(self, logger=None): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> if self.logger == None: <NEW_LINE> <INDENT> self.logger = Logger() <NEW_LINE> <DEDENT> <DEDENT> def _log(self, message, severity=Logger.DEBUG): <NEW_LINE... | Wrapper around ``espeak`` to synthesize text into a ``wav`` audio file.
It will perform a call like ::
$ espeak -v language_code -w /tmp/output_file.wav < text
:param logger: the logger object
:type logger: :class:`aeneas.logger.Logger` | 62598f013617ad0b5ee04b31 |
class TestGoogleWifiSetup(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.hass = get_test_home_assistant() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.hass.stop() <NEW_LINE> <DEDENT> @requests_mock.Mocker() <NEW_LINE> def test_setup_minimum(self, mock_req): <NEW_LI... | Tests for setting up the Google Wifi sensor platform. | 62598f017b180e01f3e4854a |
class ProteinDomain(object): <NEW_LINE> <INDENT> def __init__(self, name, evalue): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.evalue = evalue | Class representing a single protein domain | 62598f01fbf16365ca792aa0 |
class SBE54tpsSampleDataParticle(DataParticle): <NEW_LINE> <INDENT> _data_particle_type = DataParticleType.PREST_REAL_TIME <NEW_LINE> LINE1 = r"<Sample Num='(\d+)' Type='([^']+)'>" <NEW_LINE> LINE2 = r"<Time>([^<]+)</Time>" <NEW_LINE> LINE3 = r"<PressurePSI>([0-9.+-]+)</PressurePSI>" <NEW_LINE> LINE4 = r"<PTemp>([0-9.+... | Routines for parsing raw data into a data particle structure. Override
the building of values, and the rest should come along for free. | 62598f0197e22403b38398ec |
class DomainDescriptionInterface(ImmutableInterface): <NEW_LINE> <INDENT> boundary_types = frozenset() <NEW_LINE> @property <NEW_LINE> def has_dirichlet(self): <NEW_LINE> <INDENT> return BoundaryType('dirichlet') in self.boundary_types <NEW_LINE> <DEDENT> @property <NEW_LINE> def has_neumann(self): <NEW_LINE> <INDENT> ... | Analytically describes a domain and its boundary (types).
Attributes
----------
boundary_types
Set of |BoundaryTypes| the domain has. | 62598f014527f215b58e8901 |
class UndefinedTransitionAmount(Exception): <NEW_LINE> <INDENT> pass | Raised when the user tries to create the scenarios but they
haven't filled in a transition amount. | 62598f01bf627c535bcafe7b |
class CondaTokenHandler(SimpleHTTPRequestHandler): <NEW_LINE> <INDENT> token_pattern = re.compile("^/t/([^/]+?)/") <NEW_LINE> def do_GET(self): <NEW_LINE> <INDENT> global api_key <NEW_LINE> match = self.token_pattern.search(self.path) <NEW_LINE> if match: <NEW_LINE> <INDENT> prefix_length = len(match.group(0)) - 1 <NEW... | Main class to present webpages and authentication. | 62598f017047854f4633ddcd |
class _RestructuredDataset(dataset_ops.Dataset): <NEW_LINE> <INDENT> def __init__(self, dataset, output_types, output_shapes=None, output_classes=None, allow_unsafe_cast=False): <NEW_LINE> <INDENT> super(_RestructuredDataset, self).__init__() <NEW_LINE> self._dataset = dataset <NEW_LINE> if not allow_unsafe_cast: <NEW_... | An internal helper for changing the structure and shape of a dataset. | 62598f01091ae35668703621 |
class FootprintWizard(pcbnew.FootprintWizardPlugin): <NEW_LINE> <INDENT> uMM = pcbnew.uMM <NEW_LINE> uMils = pcbnew.uMils <NEW_LINE> uFloat = pcbnew.uFloat <NEW_LINE> uInteger = pcbnew.uInteger <NEW_LINE> uBool = pcbnew.uBool <NEW_LINE> uRadians = pcbnew.uRadians <NEW_LINE> uDegrees = pcbnew.uDegrees <NEW_LINE> uPercen... | !
A class to simplify many aspects of footprint creation, leaving only
the foot-print specific routines to the wizards themselves.
Inherit this class to make a new wizard.
Provides simplified access to helpers like drawing functions, a transform
matrix stack and simple parameter checking.
Generally, you need to impl... | 62598f0197e22403b38398ed |
class ServicePlugin(Plugin): <NEW_LINE> <INDENT> def __init__(self, kwargs): <NEW_LINE> <INDENT> self.service_name = kwargs['service_name'] <NEW_LINE> self.process_names = kwargs['process_names'] <NEW_LINE> self.service_api_url = kwargs['service_api_url'] <NEW_LINE> self.search_pattern = kwargs['search_pattern'] <NEW_L... | Base class implemented by the monasca-agent plugin detection classes
for OpenStack Services | 62598f013d592f4c4edb98f6 |
class PermissionRequired(object): <NEW_LINE> <INDENT> def __init__(self, perm): <NEW_LINE> <INDENT> if isinstance(perm, _compat.string_types): <NEW_LINE> <INDENT> self.perms = (perm, ) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.perms = perm <NEW_LINE> <DEDENT> <DEDENT> def pre_dispatch(self, request, _): <NEW_L... | Certain permission is required for this API. | 62598f013617ad0b5ee04b33 |
class SVHDXOriginatorFlags(object): <NEW_LINE> <INDENT> SVHDX_ORIGINATOR_PVHDPARSER = 0x00000001 <NEW_LINE> SVHDX_ORIGINATOR_VHDMP = 0x00000004 | [MS-RSVD] 2.2.4.12 SVHDX_OPEN_DEVICE_CONTEXT OriginatorFlags
Used to indicate which component has originated or issued the operations. | 62598f01ff9c53063f519069 |
class Dog(Animal): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def say_hello(self): <NEW_LINE> <INDENT> return "こんにちは!私の名前は" + self.name + "だワン!" | 犬を定義 | 62598f01167d2b6e312b59a4 |
class ListItemView(generic.ListView): <NEW_LINE> <INDENT> model = Item <NEW_LINE> template_name = "item_list.html" <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(ListItemView, self).get_context_data(**kwargs) <NEW_LINE> context['categories'] = Category.objects.all() <NEW_LINE> cate... | Class-based view for result page. | 62598f017cff6e4e811b43ed |
class LegislativeSessionListView(ListView): <NEW_LINE> <INDENT> model = LegislativeSession <NEW_LINE> queryset = LegislativeSession.objects.all() <NEW_LINE> context_object_name = "sessions" <NEW_LINE> ordering = "name" <NEW_LINE> template_name = 'legislative/session_list.html' | View showing a list of all legislative session objects. | 62598f01be7bc26dc9251368 |
class ItemSpecification(ObjectSpecificationDescriptor): <NEW_LINE> <INDENT> def __get__(self, inst, cls=None): <NEW_LINE> <INDENT> if inst is None: <NEW_LINE> <INDENT> return getObjectSpecification(cls) <NEW_LINE> <DEDENT> cached = getattr(inst, '_v__providedBy', _marker) <NEW_LINE> if cached is not _marker: <NEW_LINE>... | __providedBy__ decorator | 62598f013d592f4c4edb98f8 |
class HeaderRecord: <NEW_LINE> <INDENT> def __init__(self, raw): <NEW_LINE> <INDENT> self.compression, = struct.unpack('>H', raw[0:2]) <NEW_LINE> self.non_text_offset, = struct.unpack('>H', raw[12:14]) <NEW_LINE> self.chapter_count, = struct.unpack('>H', raw[14:16]) <NEW_LINE> self.image_count, = struct.unpack('>H', ra... | The first record in the file is always the header record. It holds
information related to the location of text, images, and so on
in the file. This is used in conjunction with the sections
defined in the file header. | 62598f012c8b7c6e89bd21cd |
class Access(enum.Enum): <NEW_LINE> <INDENT> none, public, private = range(3) | If the machine can be accessed from outside | 62598f015fcc89381b26562f |
class VUMeter(progressbar.ProgressBar): <NEW_LINE> <INDENT> maxamp = 0 <NEW_LINE> def __init__(self, maxval): <NEW_LINE> <INDENT> widgets = [ "[",TimeSinceStart(), "][",MaxAmplitude(), "][", progressbar.Bar(marker=progressbar.RotatingMarker()),"]"] <NEW_LINE> progressbar.ProgressBar.__init__( self, maxval = maxval, wid... | extended progress bar | 62598f013346ee7daa336b6b |
class TechnicalProtection(TechnicalProtectionBaseType_): <NEW_LINE> <INDENT> c_tag = 'TechnicalProtection' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = TechnicalProtectionBaseType_.c_children.copy() <NEW_LINE> c_attributes = TechnicalProtectionBaseType_.c_attributes.copy() <NEW_LINE> c_child_order = Techn... | The urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken:TechnicalProtection element | 62598f01ff9c53063f51906b |
class Register(object): <NEW_LINE> <INDENT> def __init__(self, offset, name, size, access, min_raw, max_raw): <NEW_LINE> <INDENT> self.reg_offset = offset <NEW_LINE> self.reg_name = name <NEW_LINE> self.reg_size = size <NEW_LINE> self.reg_access = access <NEW_LINE> self.reg_min_raw = min_raw <NEW_LINE> self.reg_max_raw... | The Register class represents a single register contained within
a device type, and may be a base class. Derived classes will typically
override the fmt_derived and parse_derived methods. | 62598f013317a56b869bda69 |
class TopologyResource(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } <NEW_LINE> def __init__( self... | The network resource topology information for the given resource group.
:param name: Name of the resource.
:type name: str
:param id: ID of the resource.
:type id: str
:param location: Resource location.
:type location: str
:param associations: Holds the associations the resource has with other resources in the
resou... | 62598f01167d2b6e312b59a6 |
class TabWatch: <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> self.geditwindow = window <NEW_LINE> self.geditwindow.connect("tab_added", self.__tab_added) <NEW_LINE> self.language_manager = gtksourceview2.LanguageManager() <NEW_LINE> <DEDENT> def __tab_added(self, window, tab): <NEW_LINE> <INDENT>... | Monitor the tabs in gedit to find out when new tabs get opened | 62598f01bf627c535bcafe7f |
class BlockTypeDeducer(Deducer): <NEW_LINE> <INDENT> pass | Abstract class for block type deducers. | 62598f017047854f4633ddd1 |
class ForgetPwdView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> forget_form = ForgetForm(request.POST) <NEW_LINE> return render(request, "forgetpwd.html", {"forget_form": forget_form}) <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> forget_form = ForgetForm(request.POST) <NEW... | 忘记密码 | 62598f01956e5f7376df4b81 |
class VolumeBackup(base.Resource): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<VolumeBackup: %s>" % self.id <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> return self.manager.delete(self) <NEW_LINE> <DEDENT> def reset_state(self, state): <NEW_LINE> <INDENT> return self.manager.reset_... | A volume backup is a block level backup of a volume. | 62598f0110dbd63aa1c6f58b |
class DateRangeEventHandler(MulticastDelegate,ICloneable,ISerializable): <NEW_LINE> <INDENT> def BeginInvoke(self,sender,e,callback,object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CombineImpl(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def DynamicInvokeImpl(self,*args): <NEW_LINE> <INDENT> pass ... | Represents the method that will handle the System.Windows.Forms.MonthCalendar.DateChanged or System.Windows.Forms.MonthCalendar.DateSelected event of a System.Windows.Forms.MonthCalendar.
DateRangeEventHandler(object: object,method: IntPtr) | 62598f0171ff763f4b5e616f |
class BrandActivityPage(SuperPage): <NEW_LINE> <INDENT> def __init__(self, testcase, driver, logger): <NEW_LINE> <INDENT> super(BrandActivityPage, self).__init__(testcase, driver, logger) <NEW_LINE> <DEDENT> def validSelf(self): <NEW_LINE> <INDENT> API().assertElementByName(self.testcase, self.driver, self.logger, Bran... | 作者 宋波
首页=>我的飞凡=>消息中心=>品牌活动 | 62598f017b180e01f3e4854d |
class CartObjectMixin(object): <NEW_LINE> <INDENT> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.cart = Cart.objects.get_or_create_from_request(request) <NEW_LINE> for key in ['payment_modifier', 'shipping_modifier', 'annotation']: <NEW_LINE> <INDENT> self.cart.extra.pop(key, None) <NEW_LINE> <... | Cart object mixin adds cart, cart items and watch items to the context.
Resets the values from `extra` dict that are populated by the checkout. | 62598f01167d2b6e312b59a8 |
class ChangeDir(): <NEW_LINE> <INDENT> def __init__(self, new_path): <NEW_LINE> <INDENT> self.new_path = os.path.expanduser(new_path) <NEW_LINE> self.saved_path = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.saved_path = os.getcwd() <NEW_LINE> os.chdir(self.new_path) <NEW_LINE> <DEDENT> def __... | Context manager for changing the current working directory | 62598f01adb09d7d5dc08fbe |
class Manga(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.manga_name = name <NEW_LINE> self.chapters = 0 <NEW_LINE> self.list_location = None <NEW_LINE> self.description = None | Defines the Manga Properties
Gets Manga Name from User, Calculates all other properties itself. | 62598f019f28863672817203 |
class Address(BaseModel): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='所属用户') <NEW_LINE> receiver = models.CharField(max_length=20, verbose_name='收件人') <NEW_LINE> addr = models.CharField(max_length=256, verbose_name='收件地址') <NEW_LINE> zip_code = models.CharField(max_length=... | 地址模型类 | 62598f01a05bb46b38489284 |
class PMGNumberCtrl(PMGBaseEntryCtrl): <NEW_LINE> <INDENT> def __init__(self, layout_dir: str, title: str, initial_value: int, unit: str = '', range: tuple = None): <NEW_LINE> <INDENT> super().__init__(layout_dir=layout_dir) <NEW_LINE> self.on_check_callback = None <NEW_LINE> if range is None: <NEW_LINE> <INDENT> range... | 用于输入数值。 | 62598f027b180e01f3e4854e |
class TbHospitaldoctorrel(models.Model): <NEW_LINE> <INDENT> hospitaldocrelid = models.AutoField(primary_key=True) <NEW_LINE> temp_hospitalid = models.ForeignKey(TbHospitalinfo, related_name='hospitaldoctorrel', blank=True, null=True, on_delete=models.SET_NULL) <NEW_LINE> temp_doctorid = models.ForeignKey(TbTcmdcotorsi... | 医院医生关系表 | 62598f0255399d3f05624f34 |
class SRG_no_GCN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, han_num_meta_path, han_in_feats, han_hidden_feats, han_head_list, han_dropout, fc_hidden_feats ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.han = HAN(num_meta_paths=han_num_meta_path, in_feats=han_in_feats, hidden_feats=han_hidden_feats, h... | SRG without recurrent GCNs.
Parameter
---------
han_num_meta_path: int, the number of meta-path for HAN
han_in_feats: int, input features size for HAN
han_hidden_feats: int, hidden features size for HAN
han_head_list: List[int], the number of heads for each layer
han_dropout: int, drop out rate
... | 62598f02a8370b77170eedec |
class EmployeeDict(typing.TypedDict, total=False): <NEW_LINE> <INDENT> id: typing.Optional[int] <NEW_LINE> name: typing.Optional[str] <NEW_LINE> address: typing.Optional[str] <NEW_LINE> division: typing.Optional[str] | TypedDict for properties that are not required. | 62598f02091ae35668703629 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.