code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SimpleFragmenter(object): <NEW_LINE> <INDENT> def __init__(self, size=70): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def __call__(self, text, tokens): <NEW_LINE> <INDENT> size = self.size <NEW_LINE> first = None <NEW_LINE> frag = [] <NEW_LINE> for t in tokens: <NEW_LINE> <INDENT> if first is None: ...
Simply splits the text into roughly equal sized chunks.
62599043004d5f362081f963
class AutoAuthPage(PageObject): <NEW_LINE> <INDENT> def __init__(self, browser, username=None, email=None, password=None, staff=None, course_id=None, roles=None): <NEW_LINE> <INDENT> super().__init__(browser) <NEW_LINE> self._params = {} <NEW_LINE> if username is not None: <NEW_LINE> <INDENT> self._params['username'] =...
The automatic authorization page. When allowed via the django settings file, visiting this url will create a user and log them in.
6259904366673b3332c316f5
class SourceError(errors.PartsError): <NEW_LINE> <INDENT> pass
Base class for source handler errors.
62599043711fe17d825e161b
class Pagination(object): <NEW_LINE> <INDENT> def __init__(self, builder, entries, page, per_page, url_key): <NEW_LINE> <INDENT> self.builder = builder <NEW_LINE> self.entries = entries <NEW_LINE> self.page = page <NEW_LINE> self.per_page = per_page <NEW_LINE> self.url_key = url_key <NEW_LINE> <DEDENT> @property <NEW_L...
Internal helper class for paginations
62599043d99f1b3c44d0699b
class Redo(Trace): <NEW_LINE> <INDENT> def __init__(self, name, *args, **kwargs): <NEW_LINE> <INDENT> self._start_at = kwargs.pop('start_at', None) <NEW_LINE> self._end_at = kwargs.pop('start_at', None) <NEW_LINE> super(Redo, self).__init__(name, *args, **kwargs) <NEW_LINE> <DEDENT> def before_exec_msg(self): <NEW_LINE...
Redo log object
6259904350485f2cf55dc282
class QueueFull(Exception): <NEW_LINE> <INDENT> pass
Raised when trying to enqueue a full queue.
625990438c3a8732951f7857
class VideoListYoutube(VideoList): <NEW_LINE> <INDENT> def __init__(self, keyword=None, username=None, playlist=None, page=1): <NEW_LINE> <INDENT> super(VideoListYoutube, self).__init__() <NEW_LINE> self.get_style_context().add_class('video_list_youtube') <NEW_LINE> start_index = page_to_index(page) <NEW_LINE> entries ...
A video collection list used for videos on YouTube
6259904323849d37ff8523b7
class Property(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey(settings.AUTH_USER_MODEL) <NEW_LINE> help_text = _("Utilize este espaço para descrever seu anúncio.") <NEW_LINE> cep = models.CharField(max_length=8, default='') <NEW_LINE> address = models.CharField(_('Endereço'), max_length=140) <NEW_LINE> st...
Model for all properties.
6259904376d4e153a661dbf3
class Theme(models.Model): <NEW_LINE> <INDENT> site = models.OneToOneField(Site, related_name='theme', on_delete=models.CASCADE) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> def __eq__(self, other): <NEW_LINE> <INDENT> return (self.name, self.path) == (other.name, other.path) <NEW_LINE> <DEDENT> def __...
Django ORM model for Theme db table. Fields: site (ForeignKey): Foreign Key field pointing to django Site model theme_dir_name (CharField): Contains directory name for any site's theme (e.g. 'red-theme')
62599043287bf620b6272ee4
class Float(Numeric): <NEW_LINE> <INDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return float(self.client.get(self.prefixer(self.key)) or 0) <NEW_LINE> <DEDENT> @value.setter <NEW_LINE> def value(self, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> self.client.set(self.prefixer...
Redis float <-> Python float.
62599043507cdc57c63a6099
class Memory(): <NEW_LINE> <INDENT> def __init__(self, memeLabels): <NEW_LINE> <INDENT> self.freeRows = list() <NEW_LINE> self.columns = dict() <NEW_LINE> for i, label in enumerate(memeLabels): <NEW_LINE> <INDENT> self.columns[label] = i <NEW_LINE> <DEDENT> self.ID2Row = dict() <NEW_LINE> self.memory = np.zero...
deprecated
625990433eb6a72ae038b95e
class AdminReport(FlaskForm): <NEW_LINE> <INDENT> period = SelectField('统计周期', validators=[DataRequired()], choices=[('D', '今天'), ('W', '本周'), ('M', '本月')]) <NEW_LINE> unit = SelectField('统计单位', validators=[DataRequired()], choices=[('department', '部门'), ('individual', '个人')]) <NEW_LINE> submit = SubmitField('生成报表')
管理员报表
6259904373bcbd0ca4bcb588
class TVMContext(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [("device_type", ctypes.c_int), ("device_id", ctypes.c_int)] <NEW_LINE> MASK2STR = { 1 : 'cpu', 2 : 'gpu', 4 : 'opencl', 7 : 'vulkan', 8 : 'metal', 9 : 'vpi', 10: 'rocm', 11: 'opengl', 12: 'ext_dev', } <NEW_LINE> STR2MASK = { 'llvm': 1, 'stackvm': 1, 'c...
TVM context strucure.
62599043004d5f362081f964
class EddiBoost: <NEW_LINE> <INDENT> log = logging.getLogger(__name__) <NEW_LINE> def __init__(self, server_conn): <NEW_LINE> <INDENT> self._sc = server_conn <NEW_LINE> self.desired_temp = 35 <NEW_LINE> self._in_time_window = False <NEW_LINE> self._heater = 1 <NEW_LINE> <DEDENT> def _stop_boost(self, eddi): <NEW_LINE> ...
Class for setting the Eddi boost
6259904324f1403a9268624b
class ReduceMana(ManaConsequence): <NEW_LINE> <INDENT> def resolve(self, game_state): <NEW_LINE> <INDENT> game_state.reduce_mana(self.c_dict) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Reduce mana with: ' + str(self.c_dict)
Pay Mana
62599043b57a9660fecd2d7a
class CloudLoggingHandler(logging.StreamHandler): <NEW_LINE> <INDENT> def __init__(self, client, name=DEFAULT_LOGGER_NAME, transport=BackgroundThreadTransport): <NEW_LINE> <INDENT> super(CloudLoggingHandler, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.client = client <NEW_LINE> self.transport = transpo...
Handler that directly makes Stackdriver logging API calls. This is a Python standard ``logging`` handler using that can be used to route Python standard logging messages directly to the Stackdriver Logging API. This handler supports both an asynchronous and synchronous transport. :type client: :class:`google.cloud.l...
625990433617ad0b5ee07437
class TopEventsView(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if 'me' in request.query_params: <NEW_LINE> <INDENT> qs = Event.objects.filter(user=request.user) <NEW_LINE> <DEDENT> elif request.query_params.get('user'): <...
Get the types of events and number of events for each type.
625990438a43f66fc4bf3490
class NotMatched(Exception): <NEW_LINE> <INDENT> pass
This is raised when the path provided cannot be parsed with the current rule.
6259904326238365f5fade58
class Scipy2Corpus: <NEW_LINE> <INDENT> def __init__(self, vecs): <NEW_LINE> <INDENT> self.vecs = vecs <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for vec in self.vecs: <NEW_LINE> <INDENT> if isinstance(vec, np.ndarray): <NEW_LINE> <INDENT> yield full2sparse(vec) <NEW_LINE> <DEDENT> else: <NEW_LINE> <IN...
Convert a sequence of dense/sparse vectors into a streamed Gensim corpus object. See Also -------- :func:`~gensim.matutils.corpus2csc` Convert corpus in Gensim format to `scipy.sparse.csc` matrix.
62599043d53ae8145f91975c
class DropoutLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, incoming, p=0.5, rescale=True, **kwargs): <NEW_LINE> <INDENT> super(DropoutLayer, self).__init__(incoming, **kwargs) <NEW_LINE> self._srng = RandomStreams(get_rng().randint(1, 2147462579)) <NEW_LINE> self.p = p <NEW_LINE> self.rescale = rescale <NEW_LINE...
Dropout layer Sets values to zero with probability p. See notes for disabling dropout during testing. Parameters ---------- incoming : a :class:`Layer` instance or a tuple the layer feeding into this layer, or the expected input shape p : float or scalar tensor The probability of setting a value to zero resca...
6259904323849d37ff8523b9
class Chibi_object( metaclass=Chibi_object_meta ): <NEW_LINE> <INDENT> class Meta( Chibi_object_meta_base ): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__( self, *args, **kargs ): <NEW_LINE> <INDENT> for name, field in self._meta._fields.items(): <NEW_LINE> <INDENT> setattr( self, name, kargs.get( name, fie...
Notes ----- la clase de Meta se guarda como una clase interna llamada _meta en la instancia atributos de la clase _meta --------------------------- _fields: este dicionario guarda el nombre y la instancia del campo
6259904323e79379d538d7fd
class DictWithGames(dict): <NEW_LINE> <INDENT> SORTING_KEY_ATTRIBUTE = 'sorting_key' <NEW_LINE> def at_least(self, n): <NEW_LINE> <INDENT> return DictWithGames((key, games) for (key, games) in self.items() if len(games) >= n) <NEW_LINE> <DEDENT> def get_sorting_key(self): <NEW_LINE> <INDENT> default_key = lambda t: (-t...
Type: Dict[str, GameList]
6259904391af0d3eaad3b123
class SelectedLattice(MessageData): <NEW_LINE> <INDENT> INTENT = "DOCUMENT" <NEW_LINE> def __init__(self, data_model, lattice_format, solution): <NEW_LINE> <INDENT> if lattice_format in INDEXING_FORMATS: <NEW_LINE> <INDENT> self._lattice_format = lattice_format <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueE...
Lattice selected message
625990430fa83653e46f61db
class TestInlineResponse20115(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 testInlineResponse20115(self): <NEW_LINE> <INDENT> pass
InlineResponse20115 unit test stubs
6259904330dc7b76659a0b30
class PairwiseHingeLoss(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.margin = float(config["margin"]) <NEW_LINE> <DEDENT> def ops(self, score_pos, score_neg): <NEW_LINE> <INDENT> return tf.reduce_mean(tf.maximum(0., score_neg + self.margin - score_pos))
a layer class: pairwise hinge loss
6259904363b5f9789fe8646c
class String(Concatenable, TypeEngine): <NEW_LINE> <INDENT> __visit_name__ = 'string' <NEW_LINE> def __init__(self, length=None, collation=None, convert_unicode=False, unicode_error=None, _warn_on_bytestring=False ): <NEW_LINE> <INDENT> if unicode_error is not None and convert_unicode != 'force': <NEW_LINE> <INDENT> ra...
The base for all string and character types. In SQL, corresponds to VARCHAR. Can also take Python unicode objects and encode to the database's encoding in bind params (and the reverse for result sets.) The `length` field is usually required when the `String` type is used within a CREATE TABLE statement, as VARCHAR r...
62599043711fe17d825e161d
class AliasedLoader(object): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self.wrapped = wrapped <NEW_LINE> <DEDENT> def __getitem__(self, name): <NEW_LINE> <INDENT> return self.wrapped[name] <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self.wrapped, name)
Light wrapper around the LazyLoader to redirect 'cmd.run' calls to 'cmd.shell', for easy use of shellisms during templating calls Dotted aliases ('cmd.run') must resolve to another dotted alias (e.g. 'cmd.shell') Non-dotted aliases ('cmd') must resolve to a dictionary of function aliases for that module (e.g. {'run':...
62599043d99f1b3c44d0699e
class FuncClass(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.theta = None <NEW_LINE> <DEDENT> def set_x(self, x): <NEW_LINE> <INDENT> self.theta = x <NEW_LINE> <DEDENT> def func(self): <NEW_LINE> <INDENT> x = self.theta[0] <NEW_LINE> y = self.theta[1] <NEW_LINE> return (2 * x ** 2 - 4 * x *...
Function has local minima: 1 at (-1, -1) and 1 at (1, 1), saddle point at (0, 0)
62599043d99f1b3c44d0699f
class InstanceMultiParam(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CurrentValue = None <NEW_LINE> self.DefaultValue = None <NEW_LINE> self.EnumValue = None <NEW_LINE> self.NeedRestart = None <NEW_LINE> self.ParamName = None <NEW_LINE> self.Status = None <NEW_LINE> self.Tips = None...
实例可修改参数Multi类型集合。
625990433eb6a72ae038b961
class RemoveTabAction(TextStoreAction): <NEW_LINE> <INDENT> def isDoable(self): <NEW_LINE> <INDENT> return not (self.column == 0) <NEW_LINE> <DEDENT> def performDoOperation(self): <NEW_LINE> <INDENT> operation = RemoveTabOperation(self.cursor, self.textStore, self.settings) <NEW_LINE> operation.perform() <NEW_LINE> <DE...
Action to remove a tab
62599043a79ad1619776b380
class AllocateParams(NamedTuple): <NEW_LINE> <INDENT> account_pubkey: PublicKey <NEW_LINE> space: int
Allocate account with seed system transaction params.
6259904373bcbd0ca4bcb58d
class LazyContext(object): <NEW_LINE> <INDENT> instance = None <NEW_LINE> def __init__(self, *args, **params): <NEW_LINE> <INDENT> kwargs = params.copy() <NEW_LINE> for norm in args: <NEW_LINE> <INDENT> kwargs = norm(kwargs) <NEW_LINE> <DEDENT> self.kwargs = kwargs <NEW_LINE> self.__prev_instance = None <NEW_LINE> self...
Context manager for actual parameters values lookup.
62599043b57a9660fecd2d7d
class MobileNetV3(nn.Layer): <NEW_LINE> <INDENT> def __init__(self, config, last_channel, scale=1.0, num_classes=1000, with_pool=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.config = config <NEW_LINE> self.scale = scale <NEW_LINE> self.last_channel = last_channel <NEW_LINE> self.num_classes = num_class...
MobileNetV3 model from `"Searching for MobileNetV3" <https://arxiv.org/abs/1905.02244>`_. Args: config (list[InvertedResidualConfig]): MobileNetV3 depthwise blocks config. last_channel (int): The number of channels on the penultimate layer. scale (float, optional): Scale of channels in each layer. Default:...
6259904382261d6c52730845
class CloudFilesUSStorageDriver(CloudFilesStorageDriver): <NEW_LINE> <INDENT> type = Provider.CLOUDFILES_US <NEW_LINE> name = 'CloudFiles (US)' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['region'] = 'ord' <NEW_LINE> super(CloudFilesUSStorageDriver, self).__init__(*args, **kwargs)
Cloudfiles storage driver for the US endpoint.
625990434e696a045264e7a1
class VaultDict(Vault): <NEW_LINE> <INDENT> def __init__(self, d=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._dict = { } if d is None else d <NEW_LINE> <DEDENT> @contextlib.contextmanager <NEW_LINE> def _write_context(self, i): <NEW_LINE> <INDENT> f = io.BytesIO() <NEW_LINE> yield f <NEW_LINE> f.seek(...
A Vault that uses a dictionary for storage.
625990431f5feb6acb163ef6
class OutOfRangeError(AlluxioError): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(OutOfRangeError, self).__init__(Status.OUT_OF_RANGE, message)
Exception indicating that and operation was attempted past the valid range. E.g., seeking or reading past end of file. Unlike :class:`InvalidArgumentException`, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate :class:`InvalidArgumentException...
6259904324f1403a9268624d
class TextClassifier(Pretrained, ABC): <NEW_LINE> <INDENT> def __init__(self, num_classes=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.tokenizer = BertTokenizer.from_pretrained('bert-base-uncased', do_lower_case=True) <NEW_LINE> model_state_dict = torch.load(self.local_paths[0], map_l...
A pre-trained TextClassifier class based on Google AI's BERT model. Attributes: model: Type of BERT model to be used for the classification task. E.g:- Uncased, Cased, etc. The current pre-trained models are using 'bert-base-uncased'. tokenizer: Tokenizer used with BERT model.
625990438e05c05ec3f6f7db
class JettyServer(Server): <NEW_LINE> <INDENT> async def check_server(self): <NEW_LINE> <INDENT> status = Config.UP <NEW_LINE> if await self._jetty_is_down(): <NEW_LINE> <INDENT> status = status | Config.assertions['JETTY_DOWN'] <NEW_LINE> if await self._server_is_down(): <NEW_LINE> <INDENT> status = status | Config.as...
The JettyServer uniquely identifies services provided by the PASTA Gatekeeper service as identified by the host name "pasta".
6259904307f4c71912bb0733
class UOPFTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> case = self.case = Case.load(DATA_FILE) <NEW_LINE> self.solver = UDOPF(case, dc=True) <NEW_LINE> <DEDENT> def test_dc(self): <NEW_LINE> <INDENT> solution = self.solver.solve() <NEW_LINE> generators = self.case.generators <NE...
Defines a test case for the UOPF routine.
625990438a43f66fc4bf3494
class x_charmm_mdin_method(MCategory): <NEW_LINE> <INDENT> m_def = Category( a_legacy=LegacyDefinition(name='x_charmm_mdin_method'))
Parameters of mdin belonging to section method.
62599043379a373c97d9a32c
class CheckingAccount(BankAccount): <NEW_LINE> <INDENT> WITHDRAW_FEE = 1 <NEW_LINE> def __init__(self, cust_email, account_type, initial_balance = BankAccount.MIN_BALANCE): <NEW_LINE> <INDENT> BankAccount.__init__(self, cust_email ,account_type, initial_balance) <NEW_LINE> <DEDENT> def withdraw(self, amount): <NEW_LINE...
CheckingAccount inherits from the BankAccount class. The main additions here will be a withdrawal fee
6259904396565a6dacd2d90b
class ImageWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, video_service, CameraID, parent=None): <NEW_LINE> <INDENT> QWidget.__init__(self, parent) <NEW_LINE> self.video_service = video_service <NEW_LINE> self._image = QImage() <NEW_LINE> self.setWindowTitle('Robot') <NEW_LINE> self._imgWidth = 320 <NEW_LINE> ...
Tiny widget to display camera images from Naoqi.
62599043d53ae8145f919760
class CryptoURL(object): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> if not PYCRYPTOFOUND: <NEW_LINE> <INDENT> raise RuntimeError('pyCrypto could not be found,' + ' please install it before using libthumbor') <NEW_LINE> <DEDENT> if isinstance(key, str): <NEW_LINE> <INDENT> key = bytes(key, encoding...
Class responsible for generating encrypted URLs for thumbor.
6259904307d97122c4217fa2
class DoPredictions(luigi.WrapperTask): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> yield predictions.TrainAndPredict()
Dummy task to trigger final predictions
62599043baa26c4b54d505ab
class IProfilePortlet(IPortletDataProvider): <NEW_LINE> <INDENT> pass
A portlet which can render the logged user profile information.
6259904323e79379d538d800
class InvalidPersonName(Exception): <NEW_LINE> <INDENT> pass
An exception which is raised when a person is attempted to be created with an invalid name.
62599043c432627299fa4283
class UniqueCharactersTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_edge(self): <NEW_LINE> <INDENT> self.assertFalse(self.assertFalse()) <NEW_LINE> <DEDENT> def test_space(self): <NEW_LINE> <INDENT> self.assertEqual(" ", first_non_repeat_of(" hello")) <NEW_LINE> self.assertFalse(first_non_repeat_of(" hello ")) ...
Unit test for first_non_repeat_of
62599043a79ad1619776b382
class OptionConfig(BareConfig): <NEW_LINE> <INDENT> def __init__(self, options=None, defaults=None, root=None): <NEW_LINE> <INDENT> BareConfig.__init__(self, root=root) <NEW_LINE> if options and 'output' in options: <NEW_LINE> <INDENT> self.output = options['output'] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.o...
This subclasses BareConfig adding functions to make overriding or resetting defaults and/or setting options much easier by using dictionaries.
6259904382261d6c52730846
class RemoteGitRepo(RemoteRepo): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.uri = url <NEW_LINE> self.dir = mkdtemp() <NEW_LINE> if call(['git', 'clone', '--depth=1', '--bare', url, self.dir]) > 0: <NEW_LINE> <INDENT> raise RuntimeError() <NEW_LINE> <DEDENT> self.repo = Repo(self.dir) <NEW_LI...
A class responsible for git remotes
625990433c8af77a43b688be
class ValidationWarning: <NEW_LINE> <INDENT> def __init__(self, message: str, value: str = None, row: int = -1, column: str = None): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.value = value <NEW_LINE> self.row = row <NEW_LINE> self.column = column <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE>...
Represents a difference between the schema and data frame, found during the validation of the data frame
62599043004d5f362081f967
class VisualSoftDotAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, h_dim, v_dim, dot_dim=256): <NEW_LINE> <INDENT> super(VisualSoftDotAttention, self).__init__() <NEW_LINE> self.linear_in_h = nn.Linear(h_dim, dot_dim, bias=True) <NEW_LINE> self.linear_in_v = nn.Linear(v_dim, dot_dim, bias=True) <NEW_LINE> ...
Visual Dot Attention Layer.
62599043a4f1c619b294f809
class AILocalData(AITask): <NEW_LINE> <INDENT> date = ClosestDateParameter(default=datetime.date.today()) <NEW_LINE> batchsize = luigi.IntParameter(default=25000, significant=False) <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> return AILicensing(date=self.date, drop=True) <NEW_LINE> <DEDENT> def run(self): <NEW_L...
Extract a CSV about source, id, doi and institutions for deduplication.
625990431f5feb6acb163ef8
class MattijnError(Exception): <NEW_LINE> <INDENT> pass
42000 42001 42002 42003 42004 42005
62599043498bea3a75a58e21
class Billboard(_CZMLBaseObject): <NEW_LINE> <INDENT> image = None <NEW_LINE> show = None <NEW_LINE> _color = None <NEW_LINE> scale = None <NEW_LINE> def __init__(self, color=None, image=None, scale=None): <NEW_LINE> <INDENT> self.image = image <NEW_LINE> self.color = color <NEW_LINE> self.scale = scale <NEW_LINE> <DED...
A billboard, or viewport-aligned image. The billboard is positioned in the scene by the position property. A billboard is sometimes called a marker.
62599043b57a9660fecd2d80
class InlineQueryResultCachedAudio(InlineQueryResult): <NEW_LINE> <INDENT> def __init__(self, id, audio_file_id, caption=None, reply_markup=None, input_message_content=None, **kwargs): <NEW_LINE> <INDENT> super(InlineQueryResultCachedAudio, self).__init__('audio', id) <NEW_LINE> self.audio_file_id = audio_file_id <NEW_...
Represents a link to an mp3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use :attr:`input_message_content` to send amessage with the specified content instead of the audio. Attributes: type (:obj:`str`): 'audio'. id (:obj:`str`): Unique...
62599043d164cc617582227b
class InvalidClientError(OAuthError): <NEW_LINE> <INDENT> error = 'invalid_client' <NEW_LINE> description = __doc__
Either your client_id or client_secret is invalid.
625990438a43f66fc4bf3496
class PlayerCmdSet(CmdSet): <NEW_LINE> <INDENT> key = "DefaultPlayer" <NEW_LINE> priority = -10 <NEW_LINE> def at_cmdset_creation(self): <NEW_LINE> <INDENT> self.add(player.CmdOOCLook()) <NEW_LINE> self.add(player.CmdIC()) <NEW_LINE> self.add(player.CmdOOC()) <NEW_LINE> self.add(player.CmdCharCreate()) <NEW_LINE> self....
Implements the player command set.
62599043d7e4931a7ef3d37a
class WENSS_Survey(HEASARC_Survey, SkyView_Survey): <NEW_LINE> <INDENT> def __init__(self, coord, radius, **kwargs): <NEW_LINE> <INDENT> HEASARC_Survey.__init__(self, coord, radius, 'wenss', **kwargs) <NEW_LINE> SkyView_Survey.__init__(self, coord, radius, 'wenss', **kwargs) <NEW_LINE> self.survey = 'WENSS'
Uses SkyView an HEASARC to get both images and catalogs for the WSRT northern sky survey at 325 MHz.
6259904363b5f9789fe86470
class Divzero(NumError): <NEW_LINE> <INDENT> pass
除以0的错误
62599043462c4b4f79dbcd01
class JSLintTest(gocept.jslint.TestCase): <NEW_LINE> <INDENT> jshint_command = os.environ.get('JSHINT_COMMAND', '/bin/false') <NEW_LINE> options = (gocept.jslint.TestCase.options + ( 'evil', 'eqnull', 'multistr', 'sub', 'undef', 'browser', 'jquery', 'devel' ))
Base test class for JS lint tests.
6259904326238365f5fade5e
class EditableFile(object): <NEW_LINE> <INDENT> platform_default_editors: Mapping[str, str] = collections.defaultdict( lambda: 'edit', win32='notepad', linux2='vi', ) <NEW_LINE> encoding = 'utf-8' <NEW_LINE> def __init__(self, data='', content_type='text/plain'): <NEW_LINE> <INDENT> self.data = str(data) <NEW_LINE> sel...
EditableFile saves some data to a temporary file, launches a platform editor for interactive editing, and then reloads the data, setting .changed to True if the data was edited. e.g.:: x = EditableFile('foo') x.edit() if x.changed: print(x.data) The EDITOR environment variabl...
62599043d53ae8145f919762
class MatchExpression(Element): <NEW_LINE> <INDENT> typeof = 'match_expression' <NEW_LINE> @classmethod <NEW_LINE> def create(cls, name, user=None, network_element=None, domain_name=None, zone=None, executable=None): <NEW_LINE> <INDENT> ref_list = [] <NEW_LINE> if user: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> if n...
A match expression is used in the source / destination / service fields to group together elements into an 'AND'ed configuration. For example, a normal rule might have a source field that could include network=172.18.1.0/24 and zone=Internal objects. A match expression enables you to AND these elements together to enf...
625990436fece00bbaccccb7
class GameStats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_stats() <NEW_LINE> self.game_active = False <NEW_LINE> self.high_score = 0 <NEW_LINE> <DEDENT> def reset_stats(self): <NEW_LINE> <INDENT> self.ship_left = self.ai_settings.shi...
Track statistics for alien invasion
6259904345492302aabfd7df
class About(wx.Dialog): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> wx.Dialog.__init__(self, parent, wx.ID_ANY, 'About pyBrew', style=wx.DEFAULT_DIALOG_STYLE|wx.CLOSE_BOX) <NEW_LINE> lines = [] <NEW_LINE> lines.append(wx.StaticText(self,-1,'This is pyBrew Version 1.1')) <NEW_LINE> lines.append(w...
Show info about the program
6259904326068e7796d4dc4a
class TroubleshootingDetails(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'reason_type': {'key': 'reasonType', 'type': 'str'}, 'summary': {'key': 'summary', 'type': 'str'}, 'detail': {'key': 'detail', 'type': 'str'}, 'recommended_actions': {'key': 'recommendedA...
Information gained from troubleshooting of specified resource. :param id: The id of the get troubleshoot operation. :type id: str :param reason_type: Reason type of failure. :type reason_type: str :param summary: A summary of troubleshooting. :type summary: str :param detail: Details on troubleshooting results. :type ...
625990431d351010ab8f4e23
class Channel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.userdict = IRCDict() <NEW_LINE> self.operdict = IRCDict() <NEW_LINE> self.voiceddict = IRCDict() <NEW_LINE> self.modes = {} <NEW_LINE> <DEDENT> def users(self): <NEW_LINE> <INDENT> return self.userdict.keys() <NEW_LINE> <DEDENT> def opers(s...
A class for keeping information about an IRC channel. This class can be improved a lot.
625990446e29344779b01957
class Metaio(Package): <NEW_LINE> <INDENT> homepage = "https://www.lsc-group.phys.uwm.edu/daswg/projects/metaio.html" <NEW_LINE> url = "http://software.ligo.org/lscsoft/source/metaio-8.4.0.tar.gz" <NEW_LINE> version('8.4.0', '65661cfb47643623bc8cbe97ddbe7b91') <NEW_LINE> version('8.3.1', '2a68dc6aed8da8582cee66d4b...
LIGO Light-Weight XML Library. This code implements a simple recursive-descent parsing scheme for LIGO_LW files, based on the example in Chapter 2 of "Compilers: Principles, Techniques and Tools" by Aho, Sethi and Ullman.
62599044596a897236128f31
class Meta(SelfClosingTag): <NEW_LINE> <INDENT> tag = "meta charset" <NEW_LINE> def render(self, file_out, cur_ind=""): <NEW_LINE> <INDENT> file_out.write(cur_ind + "<{}=\"UTF-8\" /> \n".format(self.tag))
Meta subclass of SelfClosingTag
625990443c8af77a43b688bf
class Activity(object): <NEW_LINE> <INDENT> def __init__(self, date, hour, name, description): <NEW_LINE> <INDENT> self.date = date <NEW_LINE> self.hour = hour <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> from pprint import pformat <NE...
Represent an activity definition.
625990441f5feb6acb163efa
class C2H5OH2(Chemical): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(C2H5OH2, self).__init__() <NEW_LINE> pos = self.get_positions() <NEW_LINE> adj = self.get_edges() <NEW_LINE> sym = [strToSym('H'), strToSym('H'), strToSym('H'), strToSym('C'), strToSym('C'), strToSym('H'), strToSym('H'), strToSym...
Class for C2H5OH2. Needs plus sign
62599044ec188e330fdf9ba0
class PrivateClassroomApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(sample_user()) <NEW_LINE> <DEDENT> def test_retrive_classroom_list(self): <NEW_LINE> <INDENT> sample_classroom(name='CR 1', identifier='BC01') <NEW_LINE>...
Test the classroom api with authenticated requests
62599044be383301e0254b1c
class MinimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> def max_score(gameState,depth,ghosts): <NEW_LINE> <INDENT> if gameState.isWin() or gameState.isLose() or (depth==0): <NEW_LINE> <INDENT> return self.evaluationFunction(gameState) <NEW_LINE> <DEDENT> totalL...
Your minimax agent (question 2)
62599044d164cc617582227d
class MutatorFlag(object): <NEW_LINE> <INDENT> NO_LOG_SYNC = 1 <NEW_LINE> IGNORE_UNKNOWN_CFS = 2 <NEW_LINE> NO_LOG = 4 <NEW_LINE> _VALUES_TO_NAMES = { 1: "NO_LOG_SYNC", 2: "IGNORE_UNKNOWN_CFS", 4: "NO_LOG", } <NEW_LINE> _NAMES_TO_VALUES = { "NO_LOG_SYNC": 1, "IGNORE_UNKNOWN_CFS": 2, "NO_LOG": 4, }
Mutator creation flags NO_LOG_SYNC: Do not sync the commit log IGNORE_UNKNOWN_CFS: Don't throw exception if mutator writes to unknown column family NO_LOG: Don't write to the commit log
62599044d7e4931a7ef3d37c
class DuelingDQN(DQN): <NEW_LINE> <INDENT> def _build_net(self): <NEW_LINE> <INDENT> self.eval_net = PADuelingDQNNet(self.n_states, self.n_actions) <NEW_LINE> self.target_net = PADuelingDQNNet(self.n_states, self.n_actions)
DuelingDQN和DQN只是在Net上不同,所以可以直接继承DQN
62599044d99f1b3c44d069a4
class _KeyBuffer(object): <NEW_LINE> <INDENT> def __init__(self, bufferSize, kb_id): <NEW_LINE> <INDENT> self.bufferSize = bufferSize <NEW_LINE> self._evts = deque() <NEW_LINE> allInds, names, keyboards = hid.get_keyboard_indices() <NEW_LINE> self._keys = deque() <NEW_LINE> self._keysStillDown = deque() <NEW_LINE> if k...
This is our own local buffer of events with more control over clearing. The user shouldn't use this directly. It is fetched from the _keybuffers It stores events from a single physical device It's built on a collections.deque which is like a more efficient list that also supports a max length
6259904450485f2cf55dc28c
class MockInstancesApi(MockApiBase): <NEW_LINE> <INDENT> def get(self, project='wrong_project', instance='wrong_instance', **kwargs): <NEW_LINE> <INDENT> return self.RegisterRequest({'project': project, 'instance': instance}, **kwargs) <NEW_LINE> <DEDENT> def insert(self, project='wrong_project', body='wrong_instance_r...
Mock return result of the MockApi.instances() method.
62599044d99f1b3c44d069a5
class GrpcContext: <NEW_LINE> <INDENT> def __init__(self, request_stream, response_stream): <NEW_LINE> <INDENT> self.request_stream = request_stream <NEW_LINE> self.response_stream = response_stream <NEW_LINE> <DEDENT> def set_code(self, code): <NEW_LINE> <INDENT> self.response_stream.trailers.set(("grpc-status", str(c...
Context object passed to GRPC methods. Gives access to request metadata and allows response metadata to be set.
6259904476d4e153a661dbf8
class LocationsResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[Location]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(LocationsResponse, self).__init__(**kwargs) <NEW_LINE> self.value = kwargs.get('value', None)
Locations response. :param value: locations. :type value: list[~storage_import_export.models.Location]
6259904491af0d3eaad3b12b
class PiMotionArray(PiArrayOutput): <NEW_LINE> <INDENT> def flush(self): <NEW_LINE> <INDENT> super(PiMotionArray, self).flush() <NEW_LINE> width, height = self.size or self.camera.resolution <NEW_LINE> cols = ((width + 15) // 16) + 1 <NEW_LINE> rows = (height + 15) // 16 <NEW_LINE> b = self.getvalue() <NEW_LINE> frames...
Produces a 3-dimensional array of motion vectors from the H.264 encoder. This custom output class is intended to be used with the *motion_output* parameter of the :meth:`~picamera.PiCamera.start_recording` method. Once recording has finished, the class generates a 3-dimensional numpy array organized as (frames, rows,...
625990446e29344779b01959
class HiddenProducts(grok.GlobalUtility): <NEW_LINE> <INDENT> implements(INonInstallable) <NEW_LINE> grok.name('iloactemp.backgroundnote.upgrades') <NEW_LINE> def getNonInstallableProducts(self): <NEW_LINE> <INDENT> return [ 'iloactemp.backgroundnote.upgrades', ]
This hides the upgrade profiles from the quick installer tool.
6259904415baa72349463299
class TotalEnrollmentDAO(EnrollmentsDAO): <NEW_LINE> <INDENT> DTO = TotalEnrollmentDTO <NEW_LINE> ENTITY = TotalEnrollmentEntity <NEW_LINE> @classmethod <NEW_LINE> def get(cls, namespace_name): <NEW_LINE> <INDENT> return cls.load_or_default(namespace_name).get() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def set(cls, ...
A single total enrollment counter for each course.
62599044b57a9660fecd2d83
class ReferencePointType(Serializable): <NEW_LINE> <INDENT> _fields = ('ECF', 'Line', 'Sample', 'name') <NEW_LINE> _required = ('ECF', 'Line', 'Sample') <NEW_LINE> _set_as_attribute = ('name', ) <NEW_LINE> _numeric_format = {'Line': FLOAT_FORMAT, 'Sample': FLOAT_FORMAT} <NEW_LINE> ECF = SerializableDescriptor( 'ECF', X...
The reference point definition
625990443eb6a72ae038b968
class FilterVsIn(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.random = random.Random() <NEW_LINE> self.random.seed(42) <NEW_LINE> <DEDENT> def __call__(self, name, _): <NEW_LINE> <INDENT> if 'vs_in' in grouptools.split(name): <NEW_LINE> <INDENT> return self.random.random() <= .2 <NEW_LINE> ...
Filter out 80% of the Vertex Attrib 64 vs_in tests.
62599044d53ae8145f919765
class GroupScale(object): <NEW_LINE> <INDENT> def __init__(self, size, interpolation=Image.BILINEAR): <NEW_LINE> <INDENT> self.worker = torchvision.transforms.Resize(size, interpolation) <NEW_LINE> <DEDENT> def __call__(self, img_group): <NEW_LINE> <INDENT> return [self.worker(img) for img in img_group]
Rescales the input PIL.Image to the given 'size'. 'size' will be the size of the smaller edge. For example, if height > width, then image will be rescaled to (size * height / width, size) size: size of the smaller edge interpolation: Default: PIL.Image.BILINEAR
6259904407d97122c4217fa7
class getCat_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'name', None, None, ), ) <NEW_LINE> def __init__(self, name=None,): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isin...
Attributes: - name
62599044a4f1c619b294f80b
@zm.pipeline.Ingress.register("entity.delete") <NEW_LINE> class EntityDeleteMessage(formencode.Schema): <NEW_LINE> <INDENT> id = formencode.validators.Int()
Message received upon deletion of an entity.
625990443617ad0b5ee07441
class RBFLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, low=0, high=30, gap=0.1, dim=1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._low = low <NEW_LINE> self._high = high <NEW_LINE> self._gap = gap <NEW_LINE> self._dim = dim <NEW_LINE> self._n_centers = int(np.ceil((high - low) / gap)) <NEW_LINE>...
Radial basis functions Layer. e(d) = exp(- gamma * ||d - mu_k||^2) default settings: gamma = 10 0 <= mu_k <= 30 for k=1~300
625990448a43f66fc4bf349a
class DaySchedule(Schedule): <NEW_LINE> <INDENT> type = 'Day' <NEW_LINE> def __init__(self, start, builder, range=None): <NEW_LINE> <INDENT> super(DaySchedule, self).__init__( start=start, range=range if range else datetime.timedelta(days=1), builder=builder ) <NEW_LINE> <DEDENT> def up(self): <NEW_LINE> <INDENT> retur...
A schedule type that specifically works for day schedule ranges.
62599044d7e4931a7ef3d37e
@component.adapter( interfaces.IQuerySchemaSearch, IPluggableAuthentication) <NEW_LINE> @zope.interface.implementer( ILocation, IQueriableAuthenticator, interfaces.IQuerySchemaSearch) <NEW_LINE> class QuerySchemaSearchAdapter(object): <NEW_LINE> <INDENT> def __init__(self, authplugin, pau): <NEW_LINE> <INDENT> if (ILoc...
Performs schema-based principal searches on behalf of a PAU. Delegates the search to the adapted authenticator (which also provides IQuerySchemaSearch) and prepends the PAU prefix to the resulting principal IDs.
6259904463b5f9789fe86474
class MathsOutput(TraitedSpec): <NEW_LINE> <INDENT> out_file = File(desc='image written after calculations')
Output Spec for seg_maths interfaces.
6259904494891a1f408ba07a
@method_decorator(csrf_exempt, name='dispatch') <NEW_LINE> @method_decorator(login_required, name="dispatch") <NEW_LINE> class PreviewMarkdownAjaxView(View): <NEW_LINE> <INDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return HttpResponse(markdown_filter(request.POST['text']))
Transform Markdown text into HTML.
6259904445492302aabfd7e3
class Question(models.Model): <NEW_LINE> <INDENT> question_text = models.CharField(max_length=200) <NEW_LINE> pub_date = models.DateTimeField('date published') <NEW_LINE> end_date = models.DateTimeField('end date') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.question_text <NEW_LINE> <DEDENT> def is_pu...
Class that contain question option.
62599044379a373c97d9a332
class MCQToRating(Change): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def applies_to(node): <NEW_LINE> <INDENT> return node.tag in ("pb-mcq", "pb-mrq") and "type" in node.attrib <NEW_LINE> <DEDENT> def apply(self): <NEW_LINE> <INDENT> if self.node.tag == "pb-mcq" and self.node.get("type") == "rating": <NEW_LINE> <IND...
<mcq type="rating"> is now just <rating>, and we never use type="choices" on MCQ/MRQ
625990441d351010ab8f4e27
class TestRandomWalk(unittest.TestCase): <NEW_LINE> <INDENT> alpha = 0.95 <NEW_LINE> err_tol = 1e-3 <NEW_LINE> max_iter = 100 <NEW_LINE> def test_random_walk(self): <NEW_LINE> <INDENT> data = [0, 1, 1, 0] <NEW_LINE> matrix = construct_2x2_csr_matrix(data) <NEW_LINE> pi = random_walk(matrix, alpha=self.alpha, err_tol=se...
Unit tests for random_walk
625990443eb6a72ae038b969
class Tsallis_pdf(PDF) : <NEW_LINE> <INDENT> def __init__ ( self , pt , mass = 0 , n = None , T = None , name = '' ) : <NEW_LINE> <INDENT> PDF.__init__ ( self , name ) <NEW_LINE> if not isinstance ( pt , ROOT.RooAbsReal ) : <N...
Useful function to describe pT-spectra of particles - C. Tsallis, Possible generalization of Boltzmann-Gibbs statistics, J. Statist. Phys. 52 (1988) 479. - C. Tsallis, Nonextensive statistics: theoretical, experimental and computational evidences and connections, Braz. J. Phys. 29 (1999) 1. \f[ \frac{d\sigma}{dp_...
62599044a79ad1619776b388
@registry.register("classification_report") <NEW_LINE> class ClassficationReport(UnionReport): <NEW_LINE> <INDENT> def __init__(self, datasets): <NEW_LINE> <INDENT> self._datasets = datasets <NEW_LINE> super().__init__() <NEW_LINE> <DEDENT> @property <NEW_LINE> def required_measurements(self): <NEW_LINE> <INDENT> metri...
Computes commonly used classification metrics. The model should compute the class probabilities (not logits). This report will compute accuracy, expected calibration error, negative log-likelihood, and Brier scores of the predictions.
62599044d10714528d69f011
class UserDeleteResult(bb.Union): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> other = None <NEW_LINE> @classmethod <NEW_LINE> def success(cls, val): <NEW_LINE> <INDENT> return cls('success', val) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def invalid_user(cls, val): <NEW_LINE> <INDENT> return cls('invalid_user...
Result of trying to delete a user's secondary emails. 'success' is the only value indicating that a user was successfully retrieved for deleting secondary emails. The other values explain the type of error that occurred, and include the user for which the error occurred. This class acts as a tagged union. Only one of ...
625990446e29344779b0195b
class Course_Object(): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.data = pd.read_csv(filename).drop_duplicates(subset='module_id', keep='first') <NEW_LINE> self.module_ids = [] <NEW_LINE> self.course_info = {} <NEW_LINE> self.module_info = {} <NEW_LINE> self.course_info_count = {} <NEW_L...
Course_Object class to load the data from object.csv Args: filename (str): path of the file Attributes: get_data (df): get the pandas dataframe get_module_ids (list): get the list of modules ids get_module_info (dict): get the dictionary of module information get_course_info (dict): get the dictio...
6259904407d97122c4217fa9
class UniversalRecipe(object, metaclass=MetaUniversalRecipe): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._recipes = {} <NEW_LINE> self._proxy_recipe = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if list(self._recipes.values()): <NEW_LINE...
Stores similar recipe objects that are going to be built together Useful for the universal architecture, where the same recipe needs to be built for different architectures before being merged. For the other targets, it will likely be a unitary group
6259904430dc7b76659a0b3a
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> self.__size = size <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return self.__size <NEW_LINE> <DEDENT> @size.setter <NEW_LINE> def size(self, size): <NEW_LINE> <INDENT> if isinstance(size, int) is False: <N...
class square
625990448da39b475be044f9