code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@six.add_metaclass(ABCMeta) <NEW_LINE> class AbstractErrorParser(object): <NEW_LINE> <INDENT> def __init__(self, err_file, out_file=None, run_err_file=None, batch_err_file=None): <NEW_LINE> <INDENT> self.files = {'err': err_file, 'out': out_file, 'run_err': run_err_file, 'batch_err': batch_err_file} <NEW_LINE> self.err...
Abstract class for parsing errors originating from the scheduler system and error that are not reported by the program itself, i.e. segmentation faults. A concrete implementation of this class for a specific scheduler needs a class attribute ERRORS for containing a dictionary specifying error: ERRORS = {ErrorClass: {...
62598f9b24f1403a92685775
class DistinctColumn(ValueOp): <NEW_LINE> <INDENT> arg = Arg(rlz.noop) <NEW_LINE> output_type = rlz.typeof('arg') <NEW_LINE> def count(self): <NEW_LINE> <INDENT> return CountDistinct(self.arg)
COUNT(DISTINCT ...) is really just syntactic suger, but we provide a distinct().count() nicety for users nonetheless. For all intents and purposes, like Distinct, but can be distinguished later for evaluation if the result should be array-like versus table-like. Also for calling count()
62598f9bc432627299fa2d5d
class SureBattery(SurePetcareSensor): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return f"{self._name} Battery Level" <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self) -> Optional[int]: <NEW_LINE> <INDENT> battery_percent: Optional[int] <NEW_LINE> try: <NEW_LINE> <INDENT>...
Sure Petcare Flap.
62598f9b6e29344779b003e1
class Scanner(object): <NEW_LINE> <INDENT> def __init__(self, symbtab, f): <NEW_LINE> <INDENT> self.symbtab = symbtab <NEW_LINE> self.f = f <NEW_LINE> self.lineno = 1 <NEW_LINE> <DEDENT> def fail(self): <NEW_LINE> <INDENT> if self.start == 0: <NEW_LINE> <INDENT> self.start = 3 <NEW_LINE> <DEDENT> elif self.start == 3: ...
Effectue l'analyse lexicale.
62598f9b3cc13d1c6d4654f3
class Solution: <NEW_LINE> <INDENT> def zombie(self, grid): <NEW_LINE> <INDENT> if not grid or not grid[0]: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> n = len(grid) <NEW_LINE> m = len(grid[0]) <NEW_LINE> zombie_queue = collections.deque([]) <NEW_LINE> human_num = 0 <NEW_LINE> for i in range(n): <NEW_LINE> <IND...
@param grid: a 2D integer grid @return: an integer
62598f9b851cf427c66b804e
class TeslaDevice(Entity): <NEW_LINE> <INDENT> def __init__(self, tesla_device, controller): <NEW_LINE> <INDENT> self.tesla_device = tesla_device <NEW_LINE> self.controller = controller <NEW_LINE> self._name = self.tesla_device.name <NEW_LINE> self.tesla_id = slugify(self.tesla_device.uniq_name) <NEW_LINE> <DEDENT> @pr...
Representation of a Tesla device.
62598f9bf7d966606f747d6e
class ModelParams(object): <NEW_LINE> <INDENT> def __init__(self, batch_size=64, num_steps=24, data_steps_ahead=1, model_state_size=256, model_learning_rate=1e-3, model_drop_out_rate=0.5, model_type="lstm", model_num_layers=2, embed_sz=10, embedding=None, trained_epochs=0): <NEW_LINE> <INDENT> self.batch_size = batch_s...
The class encapsulation of all universal tunable hyper-parameters.
62598f9bbd1bec0571e14f87
class InvalidateCache(BaseInvalidate): <NEW_LINE> <INDENT> def related_items(self, context, **kwargs): <NEW_LINE> <INDENT> getRelatedItems = getattr(context, 'getRelatedItems', lambda: []) <NEW_LINE> for item in getRelatedItems(): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> invalidate_cache = queryMultiAdapter( (item,...
View to invalidate Varnish and Memcache
62598f9b38b623060ffa8e16
class UnverifiedUserMixin(UserPassesTestMixin): <NEW_LINE> <INDENT> def test_func(self): <NEW_LINE> <INDENT> self.unverified_user = self.get_unverified_user() <NEW_LINE> return bool(self.unverified_user is not None) <NEW_LINE> <DEDENT> def get_unverified_user(self): <NEW_LINE> <INDENT> user = None <NEW_LINE> try: <NEW_...
Verify that the session is associated with a User. Note that the user may not be fully authenticated.
62598f9b63b5f9789fe84efd
class ImageToLatexModel(nn.Module): <NEW_LINE> <INDENT> def __init__(self, encoder, decoder): <NEW_LINE> <INDENT> super(ImageToLatexModel, self).__init__() <NEW_LINE> self.encoder = encoder <NEW_LINE> self.decoder = decoder <NEW_LINE> <DEDENT> def forward(self, batch): <NEW_LINE> <INDENT> images, formulas = batch <NEW_...
Model translating images to latex code
62598f9b004d5f362081eec0
class Metric(SearchableAPIResource, SendableAPIResource): <NEW_LINE> <INDENT> _class_url = None <NEW_LINE> _json_name = 'series' <NEW_LINE> _METRIC_QUERY_ENDPOINT = '/query' <NEW_LINE> _METRIC_SUBMIT_ENDPOINT = '/series' <NEW_LINE> @classmethod <NEW_LINE> def _process_points(cls, points): <NEW_LINE> <INDENT> now = time...
A wrapper around Metric HTTP API
62598f9b91f36d47f2230d63
class Admonitions(Transform): <NEW_LINE> <INDENT> default_priority = 920 <NEW_LINE> def apply(self): <NEW_LINE> <INDENT> lcode = self.document.settings.language_code <NEW_LINE> language = languages.get_language(lcode) <NEW_LINE> for node in self.document.traverse(nodes.Admonition): <NEW_LINE> <INDENT> node_name = node....
Transform specific admonitions, like this: <note> <paragraph> Note contents ... into generic admonitions, like this:: <admonition classes="note"> <title> Note <paragraph> Note contents ... The admonition title is localized.
62598f9b507cdc57c63a4b1d
class ScopeBox(Element): <NEW_LINE> <INDENT> _revit_object_category = DB.BuiltInCategory.OST_VolumeOfInterest <NEW_LINE> _collector_params = {'of_category': _revit_object_category, 'is_type': False} <NEW_LINE> def __repr__(self, data=None): <NEW_LINE> <INDENT> if not data: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDE...
VolumeOfInterest wrapper commonly called ScopeBox Inherits from rpw.db.Element >>> from rpw.db import ScopeBox Example to return a dictionary of fluids in use with system as key >>> FluidType.in_use_dict() # return format: {system.name:{'name':fluid.name, 'temperature':temperature} {'Hydronic Return': {'name': 'Water'...
62598f9b0fa83653e46f4c72
class LegalRight(Enumeration): <NEW_LINE> <INDENT> class Meta(MetaEnumeration): <NEW_LINE> <INDENT> db_table = 'legal_rights' <NEW_LINE> verbose_name = _("legal rights")
Collection legal rights
62598f9b090684286d59359d
class DecodingError(Exception): <NEW_LINE> <INDENT> pass
The incoming data is not valid WebSocket protocol data.
62598f9bdd821e528d6d8cbc
class CheckPlatformUsage(AstChecker): <NEW_LINE> <INDENT> def _warn_platform_module_usage(self, node): <NEW_LINE> <INDENT> with self.node_context(node): <NEW_LINE> <INDENT> self.warn("It looks like you're using platform-dependent code." " Make sure you thought about the platform key in your pull request." " Also consid...
If the plugin uses the platform package and/or sublime.platform(), issue a warning.
62598f9b32920d7e50bc5ddf
class ExtendedModel(Model): <NEW_LINE> <INDENT> def get_fields(self, exclude=('id',)): <NEW_LINE> <INDENT> fields = {} <NEW_LINE> for field in self._meta.fields: <NEW_LINE> <INDENT> if not field.name in exclude and getattr(self, field.name): <NEW_LINE> <INDENT> fields[field.name] = getattr(self, field.name) <NEW_LINE> ...
Model with reusable custom methods.
62598f9b5f7d997b871f92a2
class SimplePoseGaussianTargetGenerator(object): <NEW_LINE> <INDENT> def __init__(self, num_joints, image_size, heatmap_size, sigma=2): <NEW_LINE> <INDENT> self._num_joints = num_joints <NEW_LINE> self._sigma = sigma <NEW_LINE> self._image_size = np.array(image_size) <NEW_LINE> self._heatmap_size = np.array(heatmap_siz...
Gaussian heatmap target generator for simple pose. Adapted from https://github.com/Microsoft/human-pose-estimation.pytorch Parameters ---------- num_joints : int Number of joints defined by dataset image_size : tuple of int Image size, as (width, height). heatmap_size : tuple of int Heatmap size, as (width...
62598f9b63d6d428bbee253c
class Expression(Function): <NEW_LINE> <INDENT> def __init__(self, tokens=None, coefficient=None, power=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.coefficient = 1 <NEW_LINE> self.power = 1 <NEW_LINE> self.tokens = [] <NEW_LINE> if tokens is not None: <NEW_LINE> <INDENT> self.tokens.extend(tokens) <NE...
Class for expression type
62598f9bfff4ab517ebcd576
class AddReviewView(View): <NEW_LINE> <INDENT> def post(self, request, pk): <NEW_LINE> <INDENT> form = ReviewForm(request.POST) <NEW_LINE> book = Book.objects.get(pk=pk) <NEW_LINE> if form.is_valid(): <NEW_LINE> <INDENT> form = form.save(commit=False) <NEW_LINE> if request.POST.get('parent', None): <NEW_LINE> <INDENT> ...
Добавление отзыва
62598f9b30bbd7224646983a
class Command(Command): <NEW_LINE> <INDENT> option_list = Command.option_list + tuple(extra_options)
Implement the ``test`` command.
62598f9b097d151d1a2c0dae
@dataclass <NEW_LINE> class Config: <NEW_LINE> <INDENT> n_locations: int = 0 <NEW_LINE> exclude_files: List[Path] = field(default_factory=list) <NEW_LINE> filter_codes: List[str] = field(default_factory=list) <NEW_LINE> random_seed: Optional[int] = None <NEW_LINE> break_on_survival: bool = False <NEW_LINE> break_on_det...
Run configuration used for mutation trials.
62598f9b91af0d3eaad39b92
class SettingsManager: <NEW_LINE> <INDENT> cleanup_files = False <NEW_LINE> continue_on_failure = False <NEW_LINE> log_enabled = False <NEW_LINE> output_directory = os.getcwd() <NEW_LINE> reset_device = False <NEW_LINE> retry_count = 1 <NEW_LINE> silent = False <NEW_LINE> @staticmethod <NEW_LINE> def get(*settings): <N...
Controls settings set by command-line arguments.
62598f9bbd1bec0571e14f88
class NodeDefaultsDisksHandler(JSONHandler): <NEW_LINE> <INDENT> @content_json <NEW_LINE> def GET(self, node_id): <NEW_LINE> <INDENT> node = self.get_object_or_404(Node, node_id) <NEW_LINE> if not node.attributes: <NEW_LINE> <INDENT> return web.notfound() <NEW_LINE> <DEDENT> volumes = DisksFormatConvertor.format_disks_...
Node default disks handler
62598f9b8e7ae83300ee8e27
class LockError(RpcError): <NEW_LINE> <INDENT> def __init__(self, rsp): <NEW_LINE> <INDENT> RpcError.__init__(self, rsp=rsp) <NEW_LINE> self.rpc_error = jxml.rpc_error(rsp)
Generated in response to attempting to take an exclusive lock on the configuration database.
62598f9b63b5f9789fe84eff
class _krb5_creds(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [ ("magic", krb5_magic), ("client", krb5_principal), ("server", krb5_principal), ("keyblock", krb5_keyblock), ("times", krb5_ticket_times), ("is_skey", krb5_boolean), ("ticket_flags", krb5_flags), ("addresses", ctypes.POINTER(krb5_address_p)), ("ticket...
krb5/krb5.h struct _krb5_creds
62598f9b3539df3088ecc03e
class DataverseNotEmptyError(OperationFailedError): <NEW_LINE> <INDENT> pass
Raised when a Dataverse has accessioned Datasets.
62598f9b435de62698e9bb7e
class FileOps(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def save_data(self,to_save,data_type): <NEW_LINE> <INDENT> self.dict_to_save = to_save <NEW_LINE> self.data_type = str(data_type) <NEW_LINE> with open(self.data_type,'wb') as f: <NEW_LINE> <INDENT> pickle.dump(self.dic...
Save and retrieve data
62598f9b21a7993f00c65d0b
class IORedirector: <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self._redirectTo = args <NEW_LINE> <DEDENT> def write(self, s): <NEW_LINE> <INDENT> for r in self._redirectTo: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> r.write(s) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> pass <NEW_LINE> <D...
This class works to redirect the write function to many streams
62598f9bac7a0e7691f72295
class OmoideConfirmViewTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.req_fac = RequestFactory() <NEW_LINE> self.test_user_men = ParentToChild_UserFactory(is_men = True) <NEW_LINE> self.test_user_girl = ParentToChild_UserFactory(is_girl = True) <NEW_LINE> self.test_couple = ParentToChild...
OmoideConfirmViewのテストクラス
62598f9b10dbd63aa1c7093f
class Parameters: <NEW_LINE> <INDENT> def __init__(self, feature_name, dataset_name): <NEW_LINE> <INDENT> self.feature_name = feature_name <NEW_LINE> self.dataset_name = dataset_name
Works as a Parent Class that for every set of FeatureExtraction procedure contains the parameters.
62598f9b63d6d428bbee253d
class outsourcingTags(models.Model): <NEW_LINE> <INDENT> _name = "outsourcing.tags" <NEW_LINE> _description = "outsourcing Tags" <NEW_LINE> name = fields.Char('Tag Name', required=True) <NEW_LINE> color = fields.Integer(string='Color Index') <NEW_LINE> _sql_constraints = [ ('name_uniq', 'unique (name)', "Tag name alrea...
Tags of outsourcing's tasks
62598f9b0a50d4780f705162
class Reader: <NEW_LINE> <INDENT> def __init__( self, read_topic: salobj.topics.ReadTopic, nitems: int, name: str ) -> None: <NEW_LINE> <INDENT> self.read_topic = read_topic <NEW_LINE> self.nitems = nitems <NEW_LINE> self.name = name <NEW_LINE> self.data: typing.List[salobj.BaseMsgType] = [] <NEW_LINE> self.read_loop_t...
Read data from a ReadTopic using next Parameters ---------- read_topic : `topics.ReadTopic` Topic to read. nitems : `int` Number of DDS samples to read. name : `str` Reader name
62598f9b8e71fb1e983bb83f
@Singleton <NEW_LINE> class ClientRedis(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.r = redis.StrictRedis( host=config.get('redis', 'host'), port=config.get('redis', 'port'), db=config.get('redis', 'db'))
Operations with Redis.
62598f9b96565a6dacd2ce3e
@python_2_unicode_compatible <NEW_LINE> class TestDropbox(models.Model): <NEW_LINE> <INDENT> file_test = models.FileField(upload_to=".",storage = STORAGE, null=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return os.path.basename(self.file_test.name)
Model for test django-dropbox storage
62598f9b56ac1b37e6301f73
class FlowctrlItem(ManagedObject): <NEW_LINE> <INDENT> consts = FlowctrlItemConsts() <NEW_LINE> naming_props = set([u'name']) <NEW_LINE> mo_meta = MoMeta("FlowctrlItem", "flowctrlItem", "policy-[name]", VersionMeta.Version101e, "InputOutput", 0x1ff, [], ["admin", "ls-network", "ls-network-policy", "ls-qos-policy"], [u'...
This is FlowctrlItem class.
62598f9b0fa83653e46f4c74
class Meta: <NEW_LINE> <INDENT> unique_together = ['questao', 'usuario']
todo.
62598f9b090684286d59359e
class NotificationViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Notification.objects.all() <NEW_LINE> serializer_class = NotificationSerializer <NEW_LINE> @action(detail=False, methods=['post']) <NEW_LINE> def serve(self, request, pk=None): <NEW_LINE> <INDENT> data = request.data <NEW_LINE> notificatio...
API endpoint for all notifications
62598f9b4e4d5625663721ad
class MMALComponent(MMALBaseComponent): <NEW_LINE> <INDENT> __slots__ = ('_connection',) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(MMALComponent, self).__init__() <NEW_LINE> assert len(self.opaque_input_subformats) == 1 <NEW_LINE> self._connection = None <NEW_LINE> <DEDENT> def connect(self, source): <NE...
Represents an MMAL component that acts as a filter of some sort, with a single input that connects to an upstream source port. This is an asbtract base class.
62598f9b07f4c71912baf1d5
class SimpleUpgradeRequestHandler(SimpleHTTPRequestHandler): <NEW_LINE> <INDENT> def send_head(self): <NEW_LINE> <INDENT> print("path = ", self.path) <NEW_LINE> code = self.path.split('?',1)[1]; <NEW_LINE> print("code1 = ", code) <NEW_LINE> code = code.rstrip("/") <NEW_LINE> print("code2 = ", code) <NEW_LINE> if code i...
Simple upgrade server
62598f9b8c0ade5d55dc3554
class InputFn(object): <NEW_LINE> <INDENT> def __init__(self, file_pattern: Text, params: params_dict.ParamsDict, mode: Text, batch_size: int, num_examples: Optional[int] = -1): <NEW_LINE> <INDENT> assert file_pattern is not None <NEW_LINE> assert mode is not None <NEW_LINE> assert batch_size is not None <NEW_LINE> sel...
Input function that creates dataset from files.
62598f9bcc0a2c111447ad96
class ResolverError(InterpreterError): <NEW_LINE> <INDENT> pass
Represents an error that occurred during the resolution of a variable name.
62598f9b8da39b475be02f6e
class RemoveDiacritics(Builtin): <NEW_LINE> <INDENT> def apply(self, s, evaluation): <NEW_LINE> <INDENT> return String(unicodedata.normalize( 'NFKD', s.get_string_value()).encode('ascii', 'ignore').decode('ascii'))
<dl> <dt>'RemoveDiacritics[$s$]' <dd>returns a version of $s$ with all diacritics removed. </dl> >> RemoveDiacritics["en prononçant pêcher et pécher"] = en prononcant pecher et pecher >> RemoveDiacritics["piñata"] = pinata
62598f9b435de62698e9bb7f
class GameResult: <NEW_LINE> <INDENT> __slots__ = ('winners', 'eliminated', 'player_names', 'turns', 'game_time', 'thinking_time') <NEW_LINE> def __init__(self, winners, eliminated, player_names, turns, game_time, thinking_time): <NEW_LINE> <INDENT> self.winners = winners <NEW_LINE> self.eliminated = eliminated <NEW_LI...
The outcome of a single game.
62598f9bfff4ab517ebcd578
class Gauge(QDial): <NEW_LINE> <INDENT> def paintEvent(self, event): <NEW_LINE> <INDENT> painter = QPainter(self) <NEW_LINE> font = painter.font() <NEW_LINE> font.setPointSize(self.width() / 6.0) <NEW_LINE> painter.setFont(font) <NEW_LINE> painter.drawText(self.rect(), Qt.AlignCenter | Qt.AlignVCenter, str(self.value()...
Custom QDial with current value shown in middle.
62598f9b30bbd7224646983b
class YamldataWriter(YamldataBase): <NEW_LINE> <INDENT> def __init__(self, outstream, stream_type, stream_version, stream_options=None): <NEW_LINE> <INDENT> self._header = YamldataBase.build_header_dict(stream_type, stream_version, stream_options) <NEW_LINE> self._outstream = outstream <NEW_LINE> <DEDENT> def write_doc...
>>> stream0 = cStringIO.StringIO() >>> yw0 = YamldataWriter(stream0, 'MyType', '0') >>> src = (('var0', 0), ('var1', 1)) >>> yw0.write_document(src) >>> print stream0.getvalue() --- - __onyx_yaml__stream_version: "0" __onyx_yaml__meta_version: "1" __onyx_yaml__stream_type: "MyType" - - var0 0 - var1 1 <BLANKLINE...
62598f9b3cc13d1c6d4654f7
class GAFlags(): <NEW_LINE> <INDENT> noauth_local_webserver = True <NEW_LINE> logging_level = "DEBUG"
total hack. If you want to see why, examine apiclient.sample_tools. The python bindings as well as the documentation kind've forgot to mention this... Which is a big deal... But actually though.
62598f9b1b99ca400228f3f2
class FTEmbeddings(Embeddings): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(FTEmbeddings, self).__init__() <NEW_LINE> self.load_embeddings() <NEW_LINE> print('Embeddings cargados') <NEW_LINE> <DEDENT> def load_vectors(self, fname='../wiki-news-300d-1M.vec'): <NEW_LINE> <INDENT> fin = io.open(fname...
Class to load the FastText embeddings
62598f9be5267d203ee6b699
class XMLDecryptor(object): <NEW_LINE> <INDENT> def __init__(self, key, hmac=None): <NEW_LINE> <INDENT> self.__key = key <NEW_LINE> self.__hmac = hmac <NEW_LINE> <DEDENT> def __call__(self, element, mac=None): <NEW_LINE> <INDENT> algo, mode, klen = fetch( element, "./xenc:EncryptionMethod/@Algorithm", convertAlgorithm)...
This decrypts values from XML as specified in: * http://www.w3.org/TR/xmlenc-core/ * RFC 6931
62598f9b7b25080760ed722f
class MediaGraphCognitiveServicesVisionExtension(MediaGraphExtensionProcessorBase): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'name': {'required': True}, 'inputs': {'required': True}, 'endpoint': {'required': True}, 'image': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': '@typ...
A processor that allows the media graph to send video frames to a Cognitive Services Vision extension. Inference results are relayed to downstream nodes. All required parameters must be populated in order to send to Azure. :param type: Required. The discriminator for derived types.Constant filled by server. :type typ...
62598f9b7cff6e4e811b57ac
class ElfFileIdent(StructBase): <NEW_LINE> <INDENT> magic = None <NEW_LINE> elfClass = None <NEW_LINE> elfData = None <NEW_LINE> fileVersion = None <NEW_LINE> osabi = None <NEW_LINE> abiversion = None <NEW_LINE> coder = struct.Struct(b'=4sBBBBBxxxxxxx') <NEW_LINE> assert (coder.size == EI_NIDENT), 'coder.size = {0}({0}...
This class corresponds to the first, byte-endian-independent, values in an elf file. These tell us about the encodings for the rest of the file. This is the *e_ident* field of the `elf file header <http://www.sco.com/developers/gabi/latest/ch4.eheader.html#elfid>`_. Most attributes are :py:class:`int`'s. Some have ...
62598f9b45492302aabfc263
class form(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> animeCatForm = AnimeCatalogForm() <NEW_LINE> return render(request, 'catalogs/add.html', { 'form' : animeCatForm }) <NEW_LINE> <DEDENT> ''' Takes the information entered into the form and saves it to the database''' <NEW_LINE> def post(se...
Gets the form and displays it to the webpage
62598f9bfbf16365ca793e42
class GiveUpTask(ActionIntent): <NEW_LINE> <INDENT> required_fields = ['task_session_id'] <NEW_LINE> auto_fields = []
Student has given up a task
62598f9bd268445f26639a49
class TestTestCyclePermission(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 testTestCyclePermission(self): <NEW_LINE> <INDENT> model = swagger_client.models.test_cycle_permission.TestCyclePermiss...
TestCyclePermission unit test stubs
62598f9b379a373c97d98d9f
class TriggersList(ConflictsList): <NEW_LINE> <INDENT> TAG = "triggers"
A database of Triggers:
62598f9b3539df3088ecc040
class GrantAccessData(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'access': {'required': True}, 'duration_in_seconds': {'required': True}, } <NEW_LINE> _attribute_map = { 'access': {'key': 'access', 'type': 'str'}, 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, } <NEW_LINE> def...
Data used for requesting a SAS. All required parameters must be populated in order to send to Azure. :ivar access: Required. Possible values include: "None", "Read". :vartype access: str or ~azure.mgmt.compute.v2016_04_30_preview.models.AccessLevel :ivar duration_in_seconds: Required. Time duration in seconds until t...
62598f9b63b5f9789fe84f01
@registerElement <NEW_LINE> class EmailAddressProperty (WebDAVTextElement): <NEW_LINE> <INDENT> namespace = calendarserver_namespace <NEW_LINE> name = "email-address" <NEW_LINE> protected = True <NEW_LINE> hidden = True
A property representing email address of a principal
62598f9b76e4537e8c3ef341
class OpenMSGSVC(BaseRESTAPI): <NEW_LINE> <INDENT> CHAT_TYPE_C2C = 'C2C' <NEW_LINE> CHAT_TYPE_GROUP = 'Group' <NEW_LINE> def get_history(self, chat_type, msg_time=None): <NEW_LINE> <INDENT> data = { 'ChatType': chat_type, 'MsgTime': msg_time or time.strftime('%Y%m%d%H', time.localtime(time.time() - 60 * 60 * 3)) } <NEW...
消息记录
62598f9b23849d37ff850e52
class ObtainRedditorComments(): <NEW_LINE> <INDENT> def __init__(self, redditor_name, comment_limit): <NEW_LINE> <INDENT> self.redditor_name = redditor_name <NEW_LINE> self.comment_limit = comment_limit <NEW_LINE> self.base_url = 'https://api.pushshift.io/reddit/comment/search?author={}' '&sort=d...
Class obtains a specified number of comments from a specified redditor using the Pushshift Reddit API (https://github.com/pushshift/api). Using this API allows the user to bypass comment request limits of PRAW.
62598f9b07f4c71912baf1d6
class UUID(TypeDecorator): <NEW_LINE> <INDENT> impl = BINARY <NEW_LINE> def load_dialect_impl(self, dialect): <NEW_LINE> <INDENT> if dialect.name == 'postgresql': <NEW_LINE> <INDENT> return dialect.type_descriptor(psqlUUID()) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return dialect.type_descriptor(BINARY(16)) <NEW_...
Platform-independent GUID type. Uses Postgresql's UUID type, otherwise uses BINARY(16), to store UUID.
62598f9b96565a6dacd2ce3f
class DictType(FieldType): <NEW_LINE> <INDENT> def __init__(self, key_type=StrType(), val_type=StrType()): <NEW_LINE> <INDENT> self.key_type = key_type <NEW_LINE> self.val_type = val_type <NEW_LINE> <DEDENT> def check(self, field_value): <NEW_LINE> <INDENT> if isinstance(field_value, dict): <NEW_LINE> <INDENT> _dict = ...
This field type requires field value must be a dict. 'key_type' could be an instance of 'StrType', 'ChoiceType', or 'ObjectTpye'. 'val_type' could be an instance of 'StrType', 'ChoiceType', or 'ObjectTpye'.
62598f9bb7558d58954633ba
class RiskAppetiteAnalysis: <NEW_LINE> <INDENT> def __init__(self, risk_appetite_data): <NEW_LINE> <INDENT> self.riskAppetiteData = risk_appetite_data <NEW_LINE> <DEDENT> def generate_asset_weights(self): <NEW_LINE> <INDENT> physicalAssetQuantities = [] <NEW_LINE> physicalQuestions = [ 'riskAssetImportance', 'riskQuant...
A class that generates a risk appetite score from data inserted in the Mongo collection `risk-appetite-data`.
62598f9b44b2445a339b6832
class OrConst(UserDefinedExpress): <NEW_LINE> <INDENT> def __init__(self, a, b, c, label): <NEW_LINE> <INDENT> express = Constraint(a * b + (a + b) * (1 - 2 * c) + c, label=label) <NEW_LINE> super(OrConst, self).__init__(express)
Constraint: OR(a, b) = c. Args: a (:class:`Express`): expression to be binary b (:class:`Express`): expression to be binary c (:class:`Express`): expression to be binary label (str): label to identify the constraint Examples: In this example, when the binary variables satisfy the co...
62598f9bbe383301e0253583
class Autoscaler(_messages.Message): <NEW_LINE> <INDENT> class StatusValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> ACTIVE = 0 <NEW_LINE> DELETING = 1 <NEW_LINE> ERROR = 2 <NEW_LINE> PENDING = 3 <NEW_LINE> <DEDENT> autoscalingPolicy = _messages.MessageField('AutoscalingPolicy', 1) <NEW_LINE> creationTimestamp = _...
Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. Enums: StatusValueValuesEnum: [Output Only] The status of the autoscaler...
62598f9b9b70327d1c57eb2d
class UnrecoverableExceptionBase(Exception): <NEW_LINE> <INDENT> pass
Exception for negative ack to service bus
62598f9ba17c0f6771d5bfc6
class TestBase(unittest.TestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kws): <NEW_LINE> <INDENT> unittest.TestCase.__init__(self, *args, **kws) <NEW_LINE> self.human_user = None <NEW_LINE> self.project = None <NEW_LINE> self.shot = None <NEW_LINE> self.asset = None <NEW_LINE> s...
Base class for tests. Sets up mocking and database test data.
62598f9bcc0a2c111447ad98
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = 'dfdQbTOExternjy5xmCNaA' <NEW_LINE> DEBUG = False <NEW_LINE> TESTING = False <NEW_LINE> WTF_CSRF_SECRET_KEY = 'f7Z-JN0ftel5Sp_TywHuxA' <NEW_LINE> CWD = dirname(abspath(__file__)) <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'sqlite:///' + join(CWD, 'cscourses.sqlite') <NEW...
Set Flask base configuration
62598f9b2ae34c7f260aae6d
class BetaEndorserServicer(object): <NEW_LINE> <INDENT> def ProcessProposal(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
The Beta API is deprecated for 0.15.0 and later. It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This class was generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.
62598f9bbe8e80087fbbedec
class TestOFPQueueGetConfigReply(unittest.TestCase): <NEW_LINE> <INDENT> class Datapath(object): <NEW_LINE> <INDENT> ofproto = ofproto <NEW_LINE> ofproto_parser = ofproto_v1_0_parser <NEW_LINE> <DEDENT> c = OFPQueueGetConfigReply(Datapath) <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tea...
Test case for ofproto_v1_0_parser.OFPQueueGetConfigReply
62598f9b8a43f66fc4bf1f08
class Response(object): <NEW_LINE> <INDENT> def __init__(self, metadata=None, value=None): <NEW_LINE> <INDENT> self.status = 0 <NEW_LINE> if metadata is None: <NEW_LINE> <INDENT> metadata = {} <NEW_LINE> <DEDENT> self.metadata = metadata <NEW_LINE> self.value = value <NEW_LINE> self.iterstate = None
Response from the server to the client.
62598f9b63d6d428bbee2540
class Transaction(Enum): <NEW_LINE> <INDENT> BUY = 'buy' <NEW_LINE> SELL = 'sell'
Enum for buy/sell orders
62598f9b3617ad0b5ee05edc
class AdapterTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def testAdapterGetComponent(self): <NEW_LINE> <INDENT> o = object() <NEW_LINE> a = Adept(o) <NEW_LINE> self.assertRaises(components.CannotAdapt, ITest, a) <NEW_LINE> self.assertEqual(ITest(a, None), None)
Test adapters.
62598f9ba219f33f346c65a7
class TableConfig( collections.namedtuple('TableConfig', [ 'vocabulary_size', 'dimension', 'initializer', 'combiner', 'hot_id_replication', 'learning_rate', 'learning_rate_fn' ])): <NEW_LINE> <INDENT> def __new__(cls, vocabulary_size, dimension, initializer=None, combiner='mean', hot_id_replication=False, learning_rate...
Embedding table configuration.
62598f9b8e7ae83300ee8e2b
class TestPartitionGraphs(object): <NEW_LINE> <INDENT> def test_complete(self): <NEW_LINE> <INDENT> graph = pydevDAG.PyudevGraphs.PARTITION_GRAPHS.complete(CONTEXT) <NEW_LINE> block_devices = CONTEXT.list_devices(subsytem="block") <NEW_LINE> partitions = list(block_devices.match_property('DEVTYPE', 'partition')) <NEW_L...
Test the partition graph.
62598f9b91af0d3eaad39b96
@click.option( "-s", "--shell", help="shell to spawn", type=str, ) <NEW_LINE> @click.option( "-u", "--user", help="container user to run shell", type=str, ) <NEW_LINE> @kiwi_command( short_help="Spawn shell", ) <NEW_LINE> class ShellCommand(KiwiCommand): <NEW_LINE> <INDENT> type = KiwiCommandType.SERVICES <NEW_LINE> en...
Spawn shell inside a project's service
62598f9bbaa26c4b54d4f03f
class LaunchpadServiceTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(LaunchpadServiceTests, self).setUp() <NEW_LINE> self.overrideEnv('BRZ_LP_XMLRPC_URL', None) <NEW_LINE> <DEDENT> def test_default_service(self): <NEW_LINE> <INDENT> service = LaunchpadService() <NEW_LINE> self.assertEqu...
Test that the correct Launchpad instance is chosen.
62598f9b8da39b475be02f71
@implementer(IAwardV3_1) <NEW_LINE> class Award(BaseAward): <NEW_LINE> <INDENT> class Options: <NEW_LINE> <INDENT> roles = { 'create': blacklist('id', 'status', 'date', 'documents', 'complaints', 'complaintPeriod', 'verificationPeriod', 'signingPeriod'), 'Administrator': whitelist('verificationPeriod', 'signingPeriod',...
Award model for Awarding 3.1 procedure
62598f9b2ae34c7f260aae6e
class QtLogHandler(logging.Handler, QtCore.QObject): <NEW_LINE> <INDENT> new_record = QtCore.Signal(object) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> logging.Handler.__init__(self) <NEW_LINE> QtCore.QObject.__init__(self) <NEW_LINE> <DEDENT> def handle(self, record): <NEW_LINE> <INDENT> new_record.emit(record)
Log handler that emits a Qt signal for each record.
62598f9b925a0f43d25e7dc9
class Utils(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_shared_attrs(objs): <NEW_LINE> <INDENT> methods = list(map(dir, objs.values())) <NEW_LINE> if len(methods) <= 1: <NEW_LINE> <INDENT> return set() <NEW_LINE> <DEDENT> shared = set(Utils.clear_dunders(methods[0])).intersection(*methods) <NEW_LINE> ...
General useful functions used in Pyroute, not necessarily related to one another
62598f9bac7a0e7691f72299
class CDMQueryClient(object): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url = url + '/dmwebservices/index.php?q=' <NEW_LINE> <DEDENT> def query(self, alias, search='0', fields='0', sortby='0', maxrec=1024, start=1, suppress='1', docptr='0', suggest='0', facets='0', unpub='1', denormalize='1'...
A CONTENTdm Query session.
62598f9bcc0a2c111447ad99
class Device(Resource): <NEW_LINE> <INDENT> def __init__(self, uid, type, group, hrn, tags, pir, channels): <NEW_LINE> <INDENT> super().__init__(uid, type, group, hrn, tags) <NEW_LINE> self.maintenance_topic = '{}/{}/{}'.format(self.basename, 'management', self.uid) <NEW_LINE> self.status_topic = '{}/{}/{}'.format(self...
The inheritor class to represent physical devices. Additional properties: pir: is it movement detector onboard? channels: list of channels to receive commands (for switches) of to send measurements.
62598f9beab8aa0e5d30bb12
class Singleton(type): <NEW_LINE> <INDENT> _instances = {} <NEW_LINE> def __call__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if cls not in cls._instances: <NEW_LINE> <INDENT> cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) <NEW_LINE> <DEDENT> return cls._instances[cls]
@created on: 2/4/19, @author: Kevin Xavier, Description: classes which interit from this class will have Singleton Properties
62598f9bd53ae8145f91821b
class TwentyFortyEight: <NEW_LINE> <INDENT> def __init__(self, grid_height, grid_width): <NEW_LINE> <INDENT> self._grid_height = grid_height; <NEW_LINE> self._grid_width = grid_width; <NEW_LINE> self.reset(); <NEW_LINE> self._starts = {UP:[(0, col) for col in range(self._grid_width)], DOWN:[(self._grid_height - 1, col)...
Class to run the game logic.
62598f9b0c0af96317c56110
class WLEDSwitch(WLEDDeviceEntity, SwitchDevice): <NEW_LINE> <INDENT> def __init__( self, entry_id: str, wled: WLED, name: str, icon: str, key: str ) -> None: <NEW_LINE> <INDENT> self._key = key <NEW_LINE> self._state = False <NEW_LINE> super().__init__(entry_id, wled, name, icon) <NEW_LINE> <DEDENT> @property <NEW_LIN...
Defines a WLED switch.
62598f9bd486a94d0ba2bd63
class CIDARCassetteVector(vectors.CassetteVector): <NEW_LINE> <INDENT> cutter = BsaI <NEW_LINE> @staticmethod <NEW_LINE> def structure(): <NEW_LINE> <INDENT> return ( "GAAGAC" "NN" "(NNNN)" "(N" "GAGACC" "N*" "GGTCTC" "N)" "(NNNN)" "NN" "GTCTTC" )
A CIDAR Moclo cassette vector. References: *Iverson et al.*, Figure 1.
62598f9ba79ad16197769df2
class PostForm(Form): <NEW_LINE> <INDENT> body = PageDownField("在想什么呢?", validators=[Required()]) <NEW_LINE> submit = SubmitField('提交')
发布博客文章表单
62598f9b627d3e7fe0e06c38
class CTD_ANON_91 (CommandListModifier): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/Users/ethanwaldie/thesis/malmo/S...
Complex type [anonymous] with content type ELEMENT_ONLY
62598f9bbe383301e0253585
class GhdlVersion(LooseVersion): <NEW_LINE> <INDENT> pass
Version numbering class for GHDL.
62598f9b45492302aabfc266
class LRUSizeCache(LRUCache): <NEW_LINE> <INDENT> def __init__(self, max_size=1024*1024, after_cleanup_size=None, compute_size=None): <NEW_LINE> <INDENT> LRUCache.__init__(self, max_cache=int(max_size/512)) <NEW_LINE> self._max_size = max_size <NEW_LINE> if after_cleanup_size is None: <NEW_LINE> <INDENT> self._after_cl...
An LRUCache that removes things based on the size of the values. This differs in that it doesn't care how many actual items there are, it just restricts the cache to be cleaned up after so much data is stored. The values that are added must support len(value).
62598f9ba17c0f6771d5bfc8
class BooleanVar(Variable): <NEW_LINE> <INDENT> _default = False <NEW_LINE> def __init__(self, master=None, value=None, name=None): <NEW_LINE> <INDENT> Variable.__init__(self, master, value, name) <NEW_LINE> <DEDENT> def set(self, value): <NEW_LINE> <INDENT> return self._tk.globalsetvar(self._name, self._tk.getboolean(...
Value holder for boolean variables.
62598f9be76e3b2f99fd87c4
class Document (Model) : <NEW_LINE> <INDENT> def __init__ (self, string, word_count=None, title=None, url=None, created_on=None) : <NEW_LINE> <INDENT> self.string = string <NEW_LINE> self.word_count = word_count <NEW_LINE> self.title = title <NEW_LINE> self.url = url <NEW_LINE> self.created_on = created_on ...
A class for textual documents.
62598f9b07f4c71912baf1d9
class PasswordException(AuthException): <NEW_LINE> <INDENT> pass
Raised if password is invalid.
62598f9b2c8b7c6e89bd355e
@registry.register_problem <NEW_LINE> class SegmentSouthwesternOjibwe(spiel_problems.SegmentationProblem): <NEW_LINE> <INDENT> @property <NEW_LINE> def language_code(self): <NEW_LINE> <INDENT> return 'swo'
Segmentation task for Southwestern Ojibwe
62598f9b16aa5153ce40028c
class ValueHiddenInput(forms.HiddenInput): <NEW_LINE> <INDENT> template_name = 'custom_hidden.html' <NEW_LINE> def _get_name(self, name): <NEW_LINE> <INDENT> detail = re.match(r'^ORDER_(\d+)_(\d+)$', name) <NEW_LINE> if detail and int(detail.group(2)) < len(PAYU_ORDER_DETAILS): <NEW_LINE> <INDENT> name = 'ORDER_%s[]' %...
Widget that renders only if it has a value. Used to remove unused fields from PayU buttons.
62598f9ba17c0f6771d5bfc9
class ProviderInstance(ProxyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key...
A provider instance associated with a SAP monitor. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceTyp...
62598f9b435de62698e9bb83
class OptionParser(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parser = argparse.ArgumentParser(prog='dump2hdfs') <NEW_LINE> self.parser.add_argument("--fin", action="store", dest="fin", default="", help="Input avro schema file")
User based option parser
62598f9b009cb60464d012b3
class Maze: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.lines = [] <NEW_LINE> for line in stdin: <NEW_LINE> <INDENT> self.lines.append(line.strip('\n')) <NEW_LINE> <DEDENT> self.rows, self.cols = len(self.lines), len(self.lines[0]) <NEW_LINE> for j in range(1,self.rows-1): <NEW_LINE> <INDENT> asser...
a simple maze class
62598f9badb09d7d5dc0a317
class VerseConnectDialogOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "scene.verse_connect_dialog_operator" <NEW_LINE> bl_label = "Connect Dialog" <NEW_LINE> bl_description = "Dialog for setting verse server and port" <NEW_LINE> vrs_server_name = bpy.props.StringProperty(name="Verse Server") <NEW_LINE> ...
Class with connect dialog, where user can choose URL of Verse server
62598f9b30dc7b766599f5db
class read_result(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'systemException', (SystemException, SystemException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, systemException=None,): <NEW_LINE> <INDENT> self.systemException = systemException <NEW_LINE> <DEDENT> def read(self, iprot):...
Attributes: - systemException
62598f9b8a43f66fc4bf1f0a
class SafeToyTester(SafeTester): <NEW_LINE> <INDENT> def __init__(self, test_name): <NEW_LINE> <INDENT> SafeTester.__init__(self, test_name) <NEW_LINE> <DEDENT> def set_dir(self): <NEW_LINE> <INDENT> self.working_dir = os.path.join(os.path.join(os.path.join(os.path.dirname(__file__), 'tmp'), self.test_class), self.test...
General template for safe "Toy" modules testing
62598f9b4428ac0f6e6582ba