code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Lista(db.Model): <NEW_LINE> <INDENT> __tablename__ = "Lista" <NEW_LINE> id = db.Column(db.String(10), primary_key=True) <NEW_LINE> descripcion = db.Column(db.String(50)) <NEW_LINE> frente_id = db.Column(db.Integer, db.ForeignKey('Frente.id')) <NEW_LINE> frente = db.relationship('Frente', backref=db.backref( 'list...
docstring for Lista
6259904bb5575c28eb7136cb
class ApiCallHandler(object): <NEW_LINE> <INDENT> __metaclass__ = registry.MetaclassRegistry <NEW_LINE> args_type = None <NEW_LINE> result_type = None <NEW_LINE> max_execution_time = 60 <NEW_LINE> strip_json_root_fields_types = True <NEW_LINE> def Handle(self, args, token=None): <NEW_LINE> <INDENT> raise NotImplemented...
Baseclass for restful API renderers.
6259904b009cb60464d0293a
class FrameOperation(HookBaseClass): <NEW_LINE> <INDENT> def get_frame_range(self, **kwargs): <NEW_LINE> <INDENT> app = self.parent <NEW_LINE> engine = sgtk.platform.current_engine() <NEW_LINE> dcc_app = engine.app <NEW_LINE> frame_range = dcc_app.get_frame_range() <NEW_LINE> start_frame = frame_range.get("start_frame"...
Hook called to perform a frame operation with the current scene
6259904bd6c5a102081e3521
class ExpressionAttributeLookupSpecial(ExpressionAttributeLookup): <NEW_LINE> <INDENT> kind = "EXPRESSION_ATTRIBUTE_LOOKUP_SPECIAL" <NEW_LINE> def computeExpression(self, constraint_collection): <NEW_LINE> <INDENT> return self.getLookupSource().computeExpressionAttributeSpecial( lookup_node = self, attribute_...
Special lookup up an attribute of an object. Typically from code like this: with source: pass These directly go to slots, and are performed for with statements of Python2.7 or higher.
6259904ba8ecb03325872616
class BadParameter (SinonException) : <NEW_LINE> <INDENT> def __init__ (self, msg, obj=None) : <NEW_LINE> <INDENT> SinonException.__init__(self, obj)
:param msg: Error message, indicating the cause for the exception being raised. :type msg: string :raises: -- A given parameter is out of bound or ill formatted.
6259904b7d847024c075d7d7
class UserPreferencesView(FormView, MailmanClientMixin): <NEW_LINE> <INDENT> form_class = UserPreferences <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> data = super(UserPreferencesView, self).get_context_data(**kwargs) <NEW_LINE> data['mm_user'] = self.mm_user <NEW_LINE> return data <NEW_LINE> <D...
Generic view for the logged-in user's various preferences.
6259904b1f5feb6acb163ffa
class AttachmentManagerTestCase(test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AttachmentManagerTestCase, self).setUp() <NEW_LINE> self.manager = importutils.import_object(CONF.volume_manager) <NEW_LINE> self.configuration = mock.Mock(conf.Configuration) <NEW_LINE> self.context = context...
Attachment related test for volume.manager.py.
6259904b004d5f362081f9ea
class CheckinsEndpointTestCase(BaseAuthenticatedEndpointTestCase): <NEW_LINE> <INDENT> def test_checkin(self): <NEW_LINE> <INDENT> response = self.api.checkins.add(params={'venueId': self.default_venueid}) <NEW_LINE> assert 'checkin' in response <NEW_LINE> <DEDENT> def test_recent(self): <NEW_LINE> <INDENT> response = ...
General
6259904b50485f2cf55dc390
class ScheduleSerializer(serializers.Serializer): <NEW_LINE> <INDENT> user = serializers.HiddenField( default=serializers.CurrentUserDefault() ) <NEW_LINE> school = serializers.HiddenField( default=CurrentSchoolDefault() ) <NEW_LINE> sport = serializers.PrimaryKeyRelatedField(queryset=Sports.objects.all(), required=Tru...
约运动序列化
6259904b24f1403a926862d0
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.set_filename('button10.xlsx') <NEW_LINE> <DEDENT> def test_create_file(self): <NEW_LINE> <INDENT> workbook = Workbook(self.got_filename) <NEW_LINE> worksheet1 = workbook.add_worksheet() <NEW_LINE> worksheet2 =...
Test file created by XlsxWriter against a file created by Excel.
6259904bb830903b9686ee7d
class Thread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> (threading.Thread.__init__)(self, *args, **kw) <NEW_LINE> self.killed = False <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self._Thread__run_backup = self.run <NEW_LINE> self.run = self._Thread__run <NEW...
A traced thread wrapper.
6259904b462c4b4f79dbce05
class Parallel(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import pypar <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDENT> self._not_parallel() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if pypar.size() >= 2: <NEW_LINE> <INDENT> self.rank = pypar.rank() <NEW...
Parallelise to run on a cluster. :param rank: What is the id of this node in the cluster. :param size: How many processors are there in the cluster. :param node: name of the cluster node. :param is_parallel: True if parallel is operational :param file_tag: A string that can be added to files to identify who wrote th...
6259904b63b5f9789fe86573
class BookReviewListByUser(APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticated, IsOwnerOrReadOnly,) <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> reviews = book_review.objects.filter(reviewed_by=self.request.user.id) <NEW_LINE> serializer = BookReviewSerializer(reviews,...
Retrieve all books reviews made by a user - User must be authenticated
6259904b45492302aabfd8d9
class DatasetServiceFactory(PRecord): <NEW_LINE> <INDENT> agent_service_factory = field(initial=AgentService.from_configuration) <NEW_LINE> configuration_factory = field(initial=get_configuration) <NEW_LINE> def get_service(self, reactor, options): <NEW_LINE> <INDENT> configuration = self.configuration_factory(options)...
A helper for creating most of the pieces that go into a dataset convergence agent.
6259904bcb5e8a47e493cb8a
class SmoothClassifier(nn.Module): <NEW_LINE> <INDENT> ABSTAIN = -1 <NEW_LINE> def __init__(self, base_classifier: nn.Module, num_classes: int, sigma: float): <NEW_LINE> <INDENT> super(SmoothClassifier, self).__init__() <NEW_LINE> self.base_classifier = base_classifier <NEW_LINE> self.num_classes = num_classes <NEW_LIN...
Randomized smoothing classifier.
6259904bcad5886f8bdc5a81
class CacheableObject(object): <NEW_LINE> <INDENT> CACHE_NAME = "defaultcache" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CacheableObject, self).__init__(*args, **kwargs) <NEW_LINE> self.cache = LocMemCache() <NEW_LINE> <DEDENT> def _cached(self, method, key=None, *args, **kwargs): <NEW_L...
Object whose methods can be cached
6259904b07f4c71912bb083b
class AT_081: <NEW_LINE> <INDENT> play = Buff(ENEMY_MINIONS, "AT_081e")
Eadric the Pure
6259904b498bea3a75a58f27
class PluginsDialog(aw.Dialog): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> aw.Dialog.__init__(self, *args, **kwargs) <NEW_LINE> p = PluginsPanel(self) <NEW_LINE> self.AddSizedPanel(p) <NEW_LINE> self.Bind(wx.EVT_BUTTON, self.OnClose, id=wdr.ID_PLUGINEND) <NEW_LINE> <DEDENT> def OnClose...
Dialog Informazioni sui plugin installati.
6259904b379a373c97d9a431
class PopulationTree(AbstractTree): <NEW_LINE> <INDENT> def __init__(self, world, root=None, subtrees=None, data_size=0): <NEW_LINE> <INDENT> if world: <NEW_LINE> <INDENT> region_trees = _load_data() <NEW_LINE> AbstractTree.__init__(self, 'World', region_trees) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if subtrees ...
A tree representation of country population data. This tree always has three levels: - The root represents the entire world. - Each node in the second level is a region (defined by the World Bank). - Each node in the third level is a country. The data_size attribute corresponds to the 2014 population of the cou...
6259904b63d6d428bbee3bd2
class EnabledLink(ItemLink): <NEW_LINE> <INDENT> def _enable(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def AppendToMenu(self, menu, window, selection): <NEW_LINE> <INDENT> menuItem = super(EnabledLink, self).AppendToMenu(menu, window, selection) <NEW_LINE> menuItem.Enable(self._enable()) <NEW_LINE> ret...
A menu item that may be disabled. The item is by default enabled. Override _enable() to disable\enable based on some condition. Subclasses MUST define self.text, preferably as a class attribute.
6259904b3eb6a72ae038ba63
class TriangularScheduler(optim.lr_scheduler._LRScheduler): <NEW_LINE> <INDENT> def __init__(self, step_size:int, min_lr:float, max_lr:float, optimizer:optim.Optimizer): <NEW_LINE> <INDENT> self.step_size = step_size <NEW_LINE> self.min_lr = min_lr <NEW_LINE> self.max_lr = max_lr <NEW_LINE> super().__init__(optimizer) ...
TODO: docstring
6259904ba79ad1619776b487
class MultiRateCyclicSendTask(CyclicSendTask): <NEW_LINE> <INDENT> def __init__(self, channel, message, count, initial_period, subsequent_period): <NEW_LINE> <INDENT> super(MultiRateCyclicSendTask, self).__init__(channel, message, subsequent_period) <NEW_LINE> msg_frame = _build_can_frame(message) <NEW_LINE> frame = _c...
Exposes more of the full power of the TX_SETUP opcode. Transmits a message `count` times at `initial_period` then continues to transmit message at `subsequent_period`.
6259904b4e696a045264e824
class Variable(metaclass=_VariableMeta): <NEW_LINE> <INDENT> def __init__(self, tosh): <NEW_LINE> <INDENT> self._tosh = tosh <NEW_LINE> self._var_name = None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def load_task(cls, tosh, argument): <NEW_LINE> <INDENT> return LoadVariableTask(tosh, cls, argument) <NEW_LINE> <DEDEN...
Class representing a Variable. Subclasses must/can implement: - `__init__`, calling the parent with a tosh instance - `prefix` attribute if they want to be loaded as literals, e.g: u"username" (optional) - `_load()` to initialize the variable, called from a task - `tokens()` for screen representation - `load_in_b...
6259904b3cc13d1c6d466b40
class SSSDCheck8to9(Actor): <NEW_LINE> <INDENT> name = 'sssd_check_8to9' <NEW_LINE> consumes = (SSSDConfig8to9,) <NEW_LINE> produces = (Report,) <NEW_LINE> tags = (IPUWorkflowTag, ChecksPhaseTag) <NEW_LINE> def process(self): <NEW_LINE> <INDENT> model = next(self.consume(SSSDConfig8to9), None) <NEW_LINE> if not model: ...
Check SSSD configuration for changes in RHEL9 and report them in model. Implicit files domain is disabled by default. This may affect local smartcard authentication if there is not explicit files domain created. If there is no files domain and smartcard authentication is enabled, we will notify the administrator.
6259904bdc8b845886d549c5
class DataProvider: <NEW_LINE> <INDENT> def all(self) -> Collection[str]: <NEW_LINE> <INDENT> raise NotImplementedError
Data provider interface (contract)
6259904bb830903b9686ee7e
class HTTPAuth(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> def default_auth_error(): <NEW_LINE> <INDENT> return "Unauthorized Access" <NEW_LINE> <DEDENT> self.auth_error_callback = None <NEW_LINE> self.get_verify_token_callback = None <NEW_LINE> self.error_handler(default_auth_error) <NEW_LINE>...
HTTP Bases authentication using authorization token
6259904be76e3b2f99fd9e13
class S3OrgMenuLayout(S3NavigationItem): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def layout(item): <NEW_LINE> <INDENT> name = "IFRC" <NEW_LINE> logo = None <NEW_LINE> root_org = current.auth.root_org() <NEW_LINE> if root_org: <NEW_LINE> <INDENT> s3db = current.s3db <NEW_LINE> table = s3db.org_organisation <NEW_LIN...
Layout for the organisation-specific menu
6259904b009cb60464d0293e
class OpticalGaussian(RegriddableModel1D): <NEW_LINE> <INDENT> def __init__(self, name='opticalgaussian'): <NEW_LINE> <INDENT> self.fwhm = Parameter(name, 'fwhm', 100., tinyval, hard_min=tinyval, units="km/s") <NEW_LINE> self.pos = Parameter(name, 'pos', 5000., tinyval, frozen=True, units='angstroms') <NEW_LINE> self.t...
Gaussian function for modeling absorption (optical depth). This model is intended to be used to modify another model (e.g. by multiplying the two together). It is for use when the independent axis is in Angstroms. Attributes ---------- fwhm The full-width half-maximum of the model in km/s. pos The center of t...
6259904b94891a1f408ba0f9
class Win32Wrapper: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> pythoncom.CoInitialize() <NEW_LINE> self.wmi = win32com.client.GetObject("winmgmts:") <NEW_LINE> <DEDENT> def _read_cdispatch_fields(self, win32_element: Any, element_fields_list: List[str]) -> dict: <NEW_LINE> <INDENT> if not win32...
Wraps win32 objects and methods in order to simplify their use.
6259904bd53ae8145f91986a
class ContinousColorRange(ColorRange): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [ColorRange]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ContinousColorRange, name, value) <NEW_LINE> __swig_getmethods__ ...
Proxy of C++ pythonapi::ContinousColorRange class
6259904bb57a9660fecd2e85
class UserDetailsConfirmForm(forms.ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.fields['first_name'].required = True <NEW_LINE> self.fields['last_name'].required = True <NEW_LINE> self.confirm_button_text = 'Confirm' <NEW_LINE...
These details may be prepopulated with the Oauth Scope Data
6259904b91af0d3eaad3b22d
class TransformixCoordinateTransformationWorkflow(WorkflowBase): <NEW_LINE> <INDENT> input_path = luigi.Parameter() <NEW_LINE> input_key = luigi.Parameter() <NEW_LINE> output_path = luigi.Parameter() <NEW_LINE> output_key = luigi.Parameter() <NEW_LINE> transformation_file = luigi.Parameter() <NEW_LINE> elastix_director...
Apply elastix transform via transformix based on transforming coordinates.
6259904b07f4c71912bb083d
class LoginTestCase(APITestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> cls.login_url = reverse('api:auth:login') <NEW_LINE> cls.user = UserFactory() <NEW_LINE> cls.user_password = 'Hola.Chau' <NEW_LINE> cls.user.set_password(cls.user_password) <NEW_LINE> cls.user.save(...
Test JWT login.
6259904bec188e330fdf9ca7
class MutationHelper(object): <NEW_LINE> <INDENT> num_trials = 1000 <NEW_LINE> def _always_mutate(self, mutator, expected_percent): <NEW_LINE> <INDENT> num_mutations = 0 <NEW_LINE> for trial in range(self.num_trials): <NEW_LINE> <INDENT> new_org = mutator.mutate(self.organism) <NEW_LINE> if new_org != self.organism: <N...
Mixin class which provides useful functions for testing mutations.
6259904b435de62698e9d210
class BaconDecorator(DecoratorFood): <NEW_LINE> <INDENT> def __init__(self, food_wrapper): <NEW_LINE> <INDENT> DecoratorFood.__init__(self, food_wrapper) <NEW_LINE> <DEDENT> def description(self): <NEW_LINE> <INDENT> return DecoratorFood.description(self) + ', with bacon' <NEW_LINE> <DEDENT> def price(self): <NEW_LINE>...
This class is responsible to decorate a food with Bacon
6259904b4e696a045264e825
class Game: <NEW_LINE> <INDENT> def __init__( self, p1_cls: Type[Player], p2_cls: Type[Player], p1_kwargs: Dict[str, object]={}, p2_kwargs: Dict[str, object]={}): <NEW_LINE> <INDENT> self._board: Board = Board() <NEW_LINE> self._pnum2player: Dict[int, Player] = { 1: p1_cls(1, self._board, **p1_kwargs), 2: p2_cls(2, sel...
Connect 4 game class. Creates and plays connect 4 game instances
6259904b8e05c05ec3f6f85f
class EyeballTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def check40BitOptions(self): <NEW_LINE> <INDENT> userPass = 'userpass' <NEW_LINE> for canPrint in (0, 1): <NEW_LINE> <INDENT> for canModify in (0, 1): <NEW_LINE> <INDENT> for canCopy in (0, 1): <NEW_LINE> <INDENT> for canAnnotate in (0, 1): <NEW_LINE> <INDEN...
This makes a gaxillion self-explanatory files
6259904c097d151d1a2c2478
class CreateWhitelistResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Msg = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Msg = params.get("Msg") <NEW_LINE> self.RequestId = params.get("RequestId")
CreateWhitelist返回参数结构体
6259904c1f037a2d8b9e5271
class TransmissionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL <NEW_LINE> @staticmethod <NEW_LINE> @callback <NEW_LINE> def async_get_options_flow(config_entry): <NEW_LINE> <INDENT> return TransmissionOptionsFlo...
Handle Tansmission config flow.
6259904c6e29344779b01a4c
class DCAMTimeoutError(DCAMError): <NEW_LINE> <INDENT> pass
Timeout while waiting.
6259904cb57a9660fecd2e87
class ConnectionError(Exception): <NEW_LINE> <INDENT> pass
Raised when connection to Cloud Datastore Emulator is lost.
6259904ccb5e8a47e493cb8c
class StatePyDriver(py_driver.PyDriver): <NEW_LINE> <INDENT> def run( self, time_step, policy_state = () ): <NEW_LINE> <INDENT> num_steps = 0 <NEW_LINE> num_episodes = 0 <NEW_LINE> while num_steps < self._max_steps and num_episodes < self._max_episodes: <NEW_LINE> <INDENT> action_step = self.policy.action(time_step, po...
A PyDriver that adds policy state to observations. These policy states are used to compute attention weights in the attention architecture.
6259904c8e71fb1e983bced0
class ProfileForm(CSRFForm): <NEW_LINE> <INDENT> email = EmailField("Team E-Mail", validators=[required_validator]) <NEW_LINE> old_password = PasswordField( "Old Password", validators=[password_required_and_valid_if_pw_change], description=("This only needs to be entered if you wish to change " "your password, otherwis...
A form to edit a team's profile. Attrs: ``email``: The email address. Required ``old_password``: The old password, needed only for a password change. ``password``: The password. Optional, only needed if wanting to change. ``password_repeat``: Repeat the new password. ``avatar``: Display an avat...
6259904c10dbd63aa1c71fe7
class MockedGoal(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name
Mocked Goal for testing
6259904cd4950a0f3b111848
class _DigitalUnit(_Unit): <NEW_LINE> <INDENT> pass
Defines the abstract digital-unit class for tagging. @since 2018.07.23 @author tsungjung411@gmail.com @see http://tw.bestconverter.org/unitconverter_number.php
6259904cb57a9660fecd2e88
class ChangeLogEntry(object): <NEW_LINE> <INDENT> version_class = Version <NEW_LINE> def __init__(self, date=None, version=None, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> if version: <NEW_LINE> <INDENT> self.version = self.version_class(version) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>...
a change log entry, ie a set of messages associated to a version and its release date
6259904c379a373c97d9a435
class JSONRPCv1(JSONRPC): <NEW_LINE> <INDENT> allow_batches = False <NEW_LINE> @classmethod <NEW_LINE> def _message_id(cls, message, require_id): <NEW_LINE> <INDENT> if 'id' not in message: <NEW_LINE> <INDENT> raise ProtocolError.invalid_request('request has no "id"') <NEW_LINE> <DEDENT> return message['id'] <NEW_LINE>...
JSON RPC version 1.0.
6259904c50485f2cf55dc396
class CloudServiceOsProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'secrets': {'key': 'secrets', 'type': '[CloudServiceVaultSecretGroup]'}, } <NEW_LINE> def __init__( self, *, secrets: Optional[List["CloudServiceVaultSecretGroup"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(CloudServiceO...
Describes the OS profile for the cloud service. :ivar secrets: Specifies set of certificates that should be installed onto the role instances. :vartype secrets: list[~azure.mgmt.compute.v2021_03_01.models.CloudServiceVaultSecretGroup]
6259904c435de62698e9d212
class AlcatelSrosSSH(CiscoSSHConnection): <NEW_LINE> <INDENT> def session_preparation(self): <NEW_LINE> <INDENT> self._test_channel_read() <NEW_LINE> self.set_base_prompt() <NEW_LINE> self.disable_paging(command="environment no more") <NEW_LINE> time.sleep(.3 * self.global_delay_factor) <NEW_LINE> self.clear_buffer() <...
Alcatel-Lucent SROS support.
6259904c8e05c05ec3f6f860
class SettingOptions(SettingItem): <NEW_LINE> <INDENT> options = ListProperty([]) <NEW_LINE> popup = ObjectProperty(None, allownone=True) <NEW_LINE> def on_panel(self, instance, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.bind(on_release=self._create_popup) <NEW_LIN...
Implementation of an option list on top of :class:`SettingItem`. It is visualized with a :class:`~kivy.uix.label.Label` widget that, when clicked, will open a :class:`~kivy.uix.popup.Popup` with a list of options from which the user can select.
6259904c596a897236128fb4
class CapsuleNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, classes, routings): <NEW_LINE> <INDENT> super(CapsuleNet, self).__init__() <NEW_LINE> self.input_size = input_size <NEW_LINE> self.classes = classes <NEW_LINE> self.routings = routings <NEW_LINE> self.conv1 = nn.Conv2d(input_size[0], 256, k...
A Capsule Network on peptide. :param input_size: data size = [channels, width, height] :param classes: number of classes :param routings: number of routing iterations Shape: - Input: (batch, channels, width, height), optional (batch, classes) . - Output:((batch, classes), (batch, channels, width, height))
6259904c76d4e153a661dc7d
class worker_test(unittest.TestCase): <NEW_LINE> <INDENT> def NOtest_notutf8(self): <NEW_LINE> <INDENT> b='username=alexmadon&password=invalid\xff' <NEW_LINE> con = http.client.HTTPConnection('atpic.faa:80') <NEW_LINE> params=b <NEW_LINE> headers={} <NEW_LINE> headers = { "Content-type": "application/x-www-form-urlenco...
USER legacy urls
6259904c96565a6dacd2d98f
class CityTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_city_country(self): <NEW_LINE> <INDENT> cityc = city_country('richmond', 'virginia') <NEW_LINE> self.assertEqual(cityc, 'Richmond, Virginia')
testing some city funcs
6259904cb5575c28eb7136cf
class IsUserLeagueStatusOwner(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return UserLeagueStatus.objects.filter(pk=view.kwargs['pk'], user=request.user).exists()
Check if request user is the owner of the UserLeagueStatus
6259904ce76e3b2f99fd9e17
class CharEntity(Entity): <NEW_LINE> <INDENT> char_race = ('Earth Pony', 'Unicorn', 'Pegasus') <NEW_LINE> def __init__(self, name, race, type='None', ignoreerror=False): <NEW_LINE> <INDENT> Entity.__init__(self, name, 'PonyEn') <NEW_LINE> if race.title() in CharEntity.char_race: <NEW_LINE> <INDENT> self.race = race.tit...
Character Entity. The child of the Entity type class
6259904ca8ecb0332587261e
class UpdateMatch(graphene.Mutation): <NEW_LINE> <INDENT> match = graphene.Field(lambda: Matches, description="Match updated by this mutation.") <NEW_LINE> class Arguments: <NEW_LINE> <INDENT> input = UpdateMatchInput(required=True) <NEW_LINE> <DEDENT> def mutate(self, info, input): <NEW_LINE> <INDENT> data = utils.inp...
Update a match.
6259904c07f4c71912bb0841
class LeadSentenceSelectorTests(unittest.TestCase): <NEW_LINE> <INDENT> Preprocessor.load_models() <NEW_LINE> def test_select_content(self): <NEW_LINE> <INDENT> sentence_1 = 'In a park somewhere, a bunch of puppies played fetch with their owners today.' <NEW_LINE> doc_id_1 = 'TST_ENG_20190101.0001' <NEW_LINE> sentence_...
Tests for LeadSentenceSelector
6259904cd4950a0f3b111849
class GBRModel(BaseModel): <NEW_LINE> <INDENT> def __init__(self, n_estimators=100, learning_rate=0.1, max_depth=20, random_state=1, verbose=0, n_features=None, max_features=None, validation_data=None): <NEW_LINE> <INDENT> BaseModel.__init__(self, "GradientBoostingClassifierModel", n_features=n_features) <NEW_LINE> sel...
All sk-learn models need to inherit from this model.
6259904ce64d504609df9dd6
class AlignedCorpora: <NEW_LINE> <INDENT> def __init__(self, parallel_dict): <NEW_LINE> <INDENT> self.langs = list(parallel_dict.keys()) <NEW_LINE> self.langs.sort() <NEW_LINE> self.parallel_dict = parallel_dict <NEW_LINE> <DEDENT> def generate_fastalign_output(self, output_dir): <NEW_LINE> <INDENT> all_lang_pairs = li...
This class works with multiple aligned
6259904c1f5feb6acb164002
class ISQLFolderEngine(Interface): <NEW_LINE> <INDENT> pass
Interface for getting an Engine from a SQLFolder
6259904cd7e4931a7ef3d484
class LayerCall: <NEW_LINE> <INDENT> def __init__(self, call_collection, call_fn, name): <NEW_LINE> <INDENT> self.call_collection = call_collection <NEW_LINE> self.wrapped_call = tf.function( layer_call_wrapper(call_collection, call_fn, name)) <NEW_LINE> self.original_layer_call = call_collection.layer_call_method <NEW...
Function that triggers traces of other functions in the same collection.
6259904c07d97122c42180b0
class SACReplayBuffer: <NEW_LINE> <INDENT> def __init__(self, env_spec, max_size): <NEW_LINE> <INDENT> obs_dim = env_spec.observation_space.shape[0] <NEW_LINE> act_dim = env_spec.action_space.shape[0] <NEW_LINE> self.obs1_buf = np.zeros([max_size, obs_dim], dtype=np.float32) <NEW_LINE> self.obs2_buf = np.zeros([max_siz...
A simple FIFO experience replay buffer for SAC agents.
6259904c0a366e3fb87dddf3
class CBCT16(CBCTBankMixin, TestCase): <NEW_LINE> <INDENT> file_path = ['CBCT_16.zip'] <NEW_LINE> expected_roll = 0.2 <NEW_LINE> slice_locations = {'HU': 32, 'UN': 6, 'SR': 44, 'LC': 20} <NEW_LINE> hu_values = {'Poly': -37, 'Acrylic': 128, 'Delrin': 342, 'Air': -995, 'Teflon': 1000, 'PMP': -181, 'LDPE': -87} <NEW_LINE>...
A Varian CBCT dataset
6259904c435de62698e9d214
class CourseInfoAPIHandler(UMBaseHandler): <NEW_LINE> <INDENT> @is_super_admin <NEW_LINE> def get(self): <NEW_LINE> <INDENT> units = Courses.get_units() <NEW_LINE> dict_units = {} <NEW_LINE> for unit in units: <NEW_LINE> <INDENT> dict_units[unit['unit_id']] = unit['title'] <NEW_LINE> <DEDENT> self.write_json(dict_units...
Handlers for /api/course/info
6259904cdc8b845886d549ca
class TaskapiStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.addTask = channel.unary_unary( '/Taskapi/addTask', request_serializer=google_dot_protobuf_dot_wrappers__pb2.StringValue.SerializeToString, response_deserializer=task__pb2.Task.FromString, ) <NEW_LINE> self.delTask = cha...
Task service API
6259904c24f1403a926862d4
class StoryCommitLogEntryModelUnitTest(test_utils.GenericTestBase): <NEW_LINE> <INDENT> def test_get_export_policy(self) -> None: <NEW_LINE> <INDENT> expexted_export_policy_dict = { 'story_id': base_models.EXPORT_POLICY.NOT_APPLICABLE, 'created_on': base_models.EXPORT_POLICY.NOT_APPLICABLE, 'last_updated': base_models....
Test the StoryCommitLogEntryModel class.
6259904c07d97122c42180b1
class EmailForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = EmailMailing <NEW_LINE> fields = ("email",)
Форма emaila
6259904cd6c5a102081e352b
class TestRouterInit(RouterTestCase): <NEW_LINE> <INDENT> def test_sets_default_route_to_not_found_handler(self): <NEW_LINE> <INDENT> default = Route(path=None, endpoint=not_found) <NEW_LINE> verify(self.routes.setdefault).called_with(default)
Router()
6259904c82261d6c527308cd
class PrometheusScrapeTarget(ops.framework.Object): <NEW_LINE> <INDENT> relation_name: str = None <NEW_LINE> def __init__(self, charm: ops.charm.CharmBase, relation_name: str): <NEW_LINE> <INDENT> super().__init__(charm, relation_name) <NEW_LINE> self.relation_name = relation_name <NEW_LINE> <DEDENT> def publish_info( ...
Provides side of a Prometheus Scrape endpoint
6259904cd53ae8145f91986f
class ModifyBackupNameRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.BackupId = None <NEW_LINE> self.BackupName = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") <NEW_LINE>...
ModifyBackupName请求参数结构体
6259904cd53ae8145f919870
class DBRouter: <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'store': <NEW_LINE> <INDENT> return 'db_store' <NEW_LINE> <DEDENT> elif model._meta.app_label == 'warehouse': <NEW_LINE> <INDENT> return 'db_warehouse' <NEW_LINE> <DEDENT> return 'default' <NEW_LIN...
A router to control all database operations on models in the store and warehouse applications.
6259904c711fe17d825e16a5
class Task( namedtuple('Task', ( 'func args caller_id exception_handler should_return_results arg_checker ' 'fail_on_error'))): <NEW_LINE> <INDENT> pass
Task class representing work to be completed. Args: func: The function to be executed. args: The arguments to func. caller_id: The globally-unique caller ID corresponding to the Apply call. exception_handler: The exception handler to use if the call to func fails. should_return_results: True iff the results ...
6259904cac7a0e7691f738e9
class MinimalIfError(InterpreterError): <NEW_LINE> <INDENT> pass
Raised when the top of stack is not boolean processing OP_IF or OP_NOTIF.
6259904c07f4c71912bb0843
class Groups(list): <NEW_LINE> <INDENT> def append(self, value): <NEW_LINE> <INDENT> if isinstance(value, basestring): <NEW_LINE> <INDENT> if not list.__contains__(self, value): <NEW_LINE> <INDENT> list.append(self, value) <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> raise GroupException("Only strings can be ...
A list of strings used to identify associations that an element might have. Enforces that all elements must be strings, and that the same element cannot be provided more than once. >>> g = Groups() >>> g.append("hello") >>> g[0] 'hello' >>> g.append("hello") # not added as already present >>> len(g) 1 >>> g ['hello'...
6259904cd7e4931a7ef3d486
class CitationDictsDataCacher(DataCacher): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> def fill(): <NEW_LINE> <INDENT> alldicts = {} <NEW_LINE> from invenio.bibrank_tag_based_indexer import fromDB <NEW_LINE> redis = get_redis() <NEW_LINE> serialized_weights = redis.get('citations_weights') <NEW_LINE> if...
Cache holding all citation dictionaries (citationdict, reversedict, selfcitdict, selfcitedbydict).
6259904cbaa26c4b54d506b9
class NuSTAR(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._ref_epoch = Time('2010-01-01T00:00:00', format='fits', scale='utc') <NEW_LINE> self._raw_pixel = 604.8 * u.micron <NEW_LINE> self._pixel_um = self._raw_pixel / 5. <NEW_LINE> self._pixel = 2.54 * u.arcsec <NEW_LINE> self._launch = Time('20...
Class for holding constant attributes about NuSTAR and for time conversion from MET to 'TIME' objects and back again
6259904c8da39b475be045ff
class SpatialFieldPrimitiveHideMode(Enum, IComparable, IFormattable, IConvertible): <NEW_LINE> <INDENT> def __eq__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> de...
Defines modes which can be used by a SpatialFieldPrimitive to hide the original referenced element. enum SpatialFieldPrimitiveHideMode, values: Default (0), HideNone (1), HideOnlyReference (2), HideWholeElement (3)
6259904c4e696a045264e828
class Plugin(object): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def instance(cls, obj): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return _instances[cls][obj] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> instances = _instances.setdefa...
Base class for plugins. A Plugin is coupled to another object and is automatically garbage collected as soon as the other object disappears. Use the instance() class method to get/create the Plugin instance for an object. Implement the __init__() method if you want to do some setup. The instances() class method ret...
6259904c3eb6a72ae038ba6b
class TimezoneField(fields.String): <NEW_LINE> <INDENT> pass
Schema for timezone
6259904c3c8af77a43b68945
class DefaultOrchestratorInfo(NodesFilterMixin, BaseHandler): <NEW_LINE> <INDENT> _serializer = None <NEW_LINE> @content_json <NEW_LINE> def GET(self, cluster_id): <NEW_LINE> <INDENT> cluster = self.get_object_or_404(objects.Cluster, cluster_id) <NEW_LINE> nodes = self.get_nodes(cluster) <NEW_LINE> return self._seriali...
Base class for default orchestrator data. Need to redefine serializer variable
6259904c50485f2cf55dc39b
class Monitoring(Service, Singletone): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Monitoring, self).__init__() <NEW_LINE> self.listeners = [] <NEW_LINE> self.clients = [] <NEW_LINE> self.client_classes = { 'server-agent': ServerAgentClient, 'graphite': GraphiteClient, 'local': LocalClient, } <NEW...
:type clients: list[ServerAgentClient] :type listeners: list[MonitoringListener]
6259904c097d151d1a2c247e
class ZoomOAuth2(BaseOAuth2): <NEW_LINE> <INDENT> name = 'zoom-oauth2' <NEW_LINE> AUTHORIZATION_URL = 'https://zoom.us/oauth/authorize' <NEW_LINE> ACCESS_TOKEN_URL = 'https://zoom.us/oauth/token' <NEW_LINE> USER_DETAILS_URL = 'https://api.zoom.us/v2/users/me' <NEW_LINE> DEFAULT_SCOPE = ['user:read'] <NEW_LINE> ACCESS_T...
Zoom OAuth2 authentication backend Doc Reference: https://marketplace.zoom.us/docs/guides/auth/oauth
6259904cb5575c28eb7136d1
class TBufferedTransport(TTransportBase): <NEW_LINE> <INDENT> DEFAULT_BUFFER = 4096 <NEW_LINE> def __init__(self, trans, rbuf_size=DEFAULT_BUFFER): <NEW_LINE> <INDENT> self.__trans = trans <NEW_LINE> self.__wbuf = BytesIO() <NEW_LINE> self.__rbuf = BytesIO(b"") <NEW_LINE> self.__rbuf_size = rbuf_size <NEW_LINE> <DEDENT...
Class that wraps another transport and buffers its I/O. The implementation uses a (configurable) fixed-size read buffer but buffers all writes until a flush is performed.
6259904c23849d37ff8524cd
class define(object): <NEW_LINE> <INDENT> def __init__(self, _name, **kwargs): <NEW_LINE> <INDENT> self.name = _name <NEW_LINE> if _name in Forge._registry: <NEW_LINE> <INDENT> raise DuplicateFactoryError <NEW_LINE> <DEDENT> Forge._registry[_name] = dict(**kwargs) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <IN...
Defines a factory with default attributes. **Parameters**: * `_name`: Name representing the factory you're defining. * `kwargs`: Default attributes to set when building this factory. **Example**: :: # Forge.define as a method: Forge.define('user', name='Frankenstein') # Forge.define using `w...
6259904c45492302aabfd8e3
class Cube(module3d.Object3D): <NEW_LINE> <INDENT> def __init__(self, width, height=0, depth=0, texture=None): <NEW_LINE> <INDENT> module3d.Object3D.__init__(self, 'cube_%s' % texture) <NEW_LINE> self.width = width <NEW_LINE> self.height = height or width <NEW_LINE> self.depth = depth or width <NEW_LINE> fg = self.crea...
A cube. :param width: The width. :type width: int or float :param height: The height, if 0 it will be equal to width. :type height: int or float :param depth: The depth, if 0 it will be equal to width. :type depth: int or float :param texture: The texture. :type texture: str
6259904ca8ecb03325872622
class OpQueryExports(OpCode): <NEW_LINE> <INDENT> OP_ID = "OP_BACKUP_QUERY" <NEW_LINE> __slots__ = ["nodes", "use_locking"]
Compute the list of exported images.
6259904c3cc13d1c6d466b49
class PluginInfo(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self._filename = filename <NEW_LINE> self._parser = DesktopParser() <NEW_LINE> self._parser.read(filename) <NEW_LINE> if not self._parser.has_section('Gazpacho Plugin'): <NEW_LINE> <INDENT> msg = "The plugin file %s should h...
This class parses and stores the metada of a .plugin file for a Plugin. The format of such files is: [Gazpacho Plugin] name = plugin_name title = short human readable string class = plugin.dotted.class.name description = text description author = author name and e-mail version = plugin version
6259904c0c0af96317c57769
@method_decorator(login_required, name='dispatch') <NEW_LINE> class ShopGroups(ListView): <NEW_LINE> <INDENT> template_name = 'shop_groups.html' <NEW_LINE> model = Group <NEW_LINE> context_object_name = 'groups' <NEW_LINE> paginate_by = 12 <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> groups = Group.objects.al...
ShopGroups - view for shop template with product groups of a category
6259904cd7e4931a7ef3d488
class IoThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> global stopFlag, utcTime <NEW_LINE> with serial.Serial(os.getenv("SERIAL_PORT"), baudrate=os.getenv("SERIAL_BAUD"), timeout=1) as ser: <NEW...
I/O Thread for server This thread handles input and output from the NTP Server. This includes both the Serial and optional display
6259904c711fe17d825e16a6
class Operation(object): <NEW_LINE> <INDENT> reversible = True <NEW_LINE> reduces_to_sql = True <NEW_LINE> atomic = False <NEW_LINE> serialization_expand_args = [] <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> self = object.__new__(cls) <NEW_LINE> self._constructor_args = (args, kwargs) <NEW_LINE> r...
Base class for migration operations. It's responsible for both mutating the in-memory model state (see db/migrations/state.py) to represent what it performs, as well as actually performing it against a live database. Note that some operations won't modify memory state at all (e.g. data copying operations), and some w...
6259904cac7a0e7691f738eb
class Hand(): <NEW_LINE> <INDENT> def __init__(self, PCC, PlayerC): <NEW_LINE> <INDENT> self.PCC = PCC <NEW_LINE> self.PlayerC = PlayerC <NEW_LINE> <DEDENT> def FromPCToPlayer(self, PCC, PlayerC): <NEW_LINE> <INDENT> temp0 = PCC[len(PCC) - 1] <NEW_LINE> PlayerC.insert(0,temp0) <NEW_LINE> temp0 = PlayerC[len(PlayerC) - ...
This is the Hand class. Each player has a Hand, and can add or remove cards from that hand. There should be an add and remove card method here.
6259904ce64d504609df9dd8
class IdentityServicer(object): <NEW_LINE> <INDENT> def CreateUser(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def GetUser(self, ...
A simple identity service.
6259904c8e71fb1e983bced7
class BaseRecipeViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, mixins.CreateModelMixin): <NEW_LINE> <INDENT> authentication_classes = TokenAuthentication, <NEW_LINE> permission_classes = IsAuthenticated, <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> assigned_only = bool(self.request.query_params.get('...
Base viewset for user owned recipe attributes
6259904c6fece00bbacccdca
class digest_deregister_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is no...
Attributes: - success
6259904c30c21e258be99c17
class FileSignalHandlerTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.signal_file = './foo.txt' <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.remove(self.signal_file) <NEW_LINE> <DEDENT> except OSError: <NEW_LINE> <INDENT> pass <NEW_L...
Test case class for FileSignalHandler class
6259904cd6c5a102081e352e
class FCSEIDR(AbstractRegister): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(FCSEIDR, self).__init__() <NEW_LINE> <DEDENT> def set_pid(self, pid): <NEW_LINE> <INDENT> self.value[0:7] = pid <NEW_LINE> <DEDENT> def get_pid(self): <NEW_LINE> <INDENT> return self.value[0:7]
FCSE Process ID Register
6259904cb830903b9686ee83
class Database: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.guilds = {} <NEW_LINE> <DEDENT> async def setup(self) -> None: <NEW_LINE> <INDENT> self.pool = await create_pool( host=getenv("DB_HOST", "127.0.0.1"), port=getenv("DB_PORT", 5432), database=getenv("DB_DATABASE", "magoji"), user=getenv("DB_...
A database interface for the bot to connect to Postgres.
6259904c097d151d1a2c2480
class NodeVisitor: <NEW_LINE> <INDENT> def get_visitor(self, node: Node) -> "t.Optional[VisitCallable]": <NEW_LINE> <INDENT> return getattr(self, f"visit_{type(node).__name__}", None) <NEW_LINE> <DEDENT> def visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any: <NEW_LINE> <INDENT> f = self.get_visitor(node) ...
Walks the abstract syntax tree and call visitor functions for every node found. The visitor functions may return values which will be forwarded by the `visit` method. Per default the visitor functions for the nodes are ``'visit_'`` + class name of the node. So a `TryFinally` node visit function would be `visit_TryFi...
6259904c1f037a2d8b9e5275
class PilotDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Pilot.objects.all() <NEW_LINE> serializer_class = PilotSerializer <NEW_LINE> name = 'pilot-detail' <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,)
飞行员详情
6259904cf7d966606f7492c1
class BeamSearchState(object): <NEW_LINE> <INDENT> def __init__(self, token_list, finished, decoder_input, hidden, probability=0.0): <NEW_LINE> <INDENT> super(BeamSearchState, self).__init__() <NEW_LINE> self.token_list = token_list <NEW_LINE> self.finished = finished <NEW_LINE> self.decoder_input = decoder_input <NEW_...
docstring for BeamSearchState
6259904c1f5feb6acb164008