code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@isaCard <NEW_LINE> class CriticalInfoCard(myuwCard): <NEW_LINE> <INDENT> def __init__(self, email=True, directory=True, residency=True): <NEW_LINE> <INDENT> self.email = email <NEW_LINE> self.directory = directory <NEW_LINE> self.residency = residency <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> @packElement <NEW_LINE>...
Update Critical Info Card
6259906e4428ac0f6e659da6
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = PAS_PLUGINS_Authomatic_PLONE_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer["portal"] <NEW_LINE> self.installer = get_installer(self.portal, self.layer["request"]) <NEW_LINE> <DEDENT> def test_product_installed...
Test that pas.plugins.authomatic is properly installed.
6259906e97e22403b383c776
class ResolutionKnowledgeBase(KnowledgeBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.rules = [] <NEW_LINE> <DEDENT> def print_kb(self): <NEW_LINE> <INDENT> print(self.rules) <NEW_LINE> <DEDENT> def add_to_kb(self, query): <NEW_LINE> <INDENT> query = self.string_to_set(query) <NEW_LINE> for rul...
Derived class used that represents the knowledge base when using resolution.
6259906e627d3e7fe0e086fb
class SimpleClient(EWrapper, EClient): <NEW_LINE> <INDENT> def __init__(self, addr, port, client_id): <NEW_LINE> <INDENT> EClient. __init__(self, self) <NEW_LINE> self.connect(addr, port, client_id) <NEW_LINE> thread = Thread(target=self.run) <NEW_LINE> thread.start() <NEW_LINE> <DEDENT> @iswrapper <NEW_LINE> def curre...
Serves as the client and the wrapper
6259906eaad79263cf430028
class CommentField(Field): <NEW_LINE> <INDENT> configuration = {"label": "", "value": "", "name": "", "height": 80, "width": 50 } <NEW_LINE> def __init__(self, data, event): <NEW_LINE> <INDENT> if not isinstance(data, dict): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> Field.__init__(self, data, event) <NEW_LINE> sel...
This class contains methods related the CommentField class.
6259906e379a373c97d9a893
class ItemCategory(LoggedModel): <NEW_LINE> <INDENT> event = models.ForeignKey( Event, on_delete=models.CASCADE, related_name='categories', ) <NEW_LINE> name = I18nCharField( max_length=255, verbose_name=_("Category name"), ) <NEW_LINE> internal_name = models.CharField( verbose_name=_("Internal name"), help_text=_("If ...
Items can be sorted into these categories. :param event: The event this category belongs to :type event: Event :param name: The name of this category :type name: str :param position: An integer, used for sorting :type position: int
6259906e1b99ca400229016f
class ChartTool(Folder): <NEW_LINE> <INDENT> meta_type = 'Naaya Chart Tool' <NEW_LINE> portal_id = 'portal_chart' <NEW_LINE> security = ClassSecurityInfo() <NEW_LINE> _properties = ( {'id': 'title', 'type': 'string', 'mode': 'w', 'label': 'Title'}, ) <NEW_LINE> manage_options = ( {'label':'Contents', 'action':'manage_m...
Tool for generating charts Usage example (ZPT): <span tal:replace="structure python: here.portal_chart.render(here.chart_data.absolute_url())"> CHART </span>
6259906e091ae356687064a8
class ProductionConfig(Config): <NEW_LINE> <INDENT> TOKEN_EXPIRE_HOURS = 1 <NEW_LINE> BCRYPT_LOG_ROUNDS = 13 <NEW_LINE> PRESERVE_CONTEXT_ON_EXCEPTION = True
Production configuration.
6259906e8a43f66fc4bf3a07
class TaxesNotAppliedToPartner(APIView): <NEW_LINE> <INDENT> permission_classes = [permissions.IsAuthenticatedOrReadOnly] <NEW_LINE> def get_object(self, id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return Partner.objects.get(id=id) <NEW_LINE> <DEDENT> except Partner.DoesNotExist: <NEW_LINE> <INDENT> raise Http404...
Retrouvez la/les taxe(s) pour laquelle/lesquelles le partenaire est exempté
6259906e5fcc89381b266d91
@_enum(*_module_filetype_map.keys()) <NEW_LINE> class ModuleFileType(object): <NEW_LINE> <INDENT> def __init__(self, name, value): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._value = value <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self._value == other._value <NEW_LINE> <DEDENT> ...
A module file type.
6259906e21bff66bcd7244db
class TimingTextReporter(VerboseTextReporter): <NEW_LINE> <INDENT> def stopTest(self, method): <NEW_LINE> <INDENT> super(TimingTextReporter, self).stopTest(method) <NEW_LINE> self.write("(%.03f secs)\n" % self._lastTime)
Prints out each test as it is running, followed by the time taken for each test to run.
6259906e796e427e5384ffeb
class CommandsPlugin(Plugin): <NEW_LINE> <INDENT> def get_dependencies(self) -> typing.Iterable[str]: <NEW_LINE> <INDENT> return { 'dewi_commands.commands.ImageHandlerCommandsPlugin', 'dewi_commands.commands.checksums.ChecksumsPlugin', 'dewi_commands.commands.dice.DicePlugin', 'dewi_commands.commands.edit.edit.EditPlug...
Commands of DEWI
6259906e7b180e01f3e49c9e
class AutoRestDurationTestService(object): <NEW_LINE> <INDENT> def __init__( self, base_url=None): <NEW_LINE> <INDENT> self.config = AutoRestDurationTestServiceConfiguration(base_url) <NEW_LINE> self._client = ServiceClient(None, self.config) <NEW_LINE> client_models = {k: v for k, v in models.__dict__.items() if isins...
Test Infrastructure for AutoRest :ivar config: Configuration for client. :vartype config: AutoRestDurationTestServiceConfiguration :ivar duration: Duration operations :vartype duration: .operations.DurationOperations :param str base_url: Service URL
6259906e5fdd1c0f98e5f7fa
class ParticleFilter(InferenceModule): <NEW_LINE> <INDENT> def __init__(self, ghostAgent, numParticles=300): <NEW_LINE> <INDENT> InferenceModule.__init__(self, ghostAgent); <NEW_LINE> self.setNumParticles(numParticles) <NEW_LINE> <DEDENT> def setNumParticles(self, numParticles): <NEW_LINE> <INDENT> self.numParticles = ...
A particle filter for approximately tracking a single ghost. Useful helper functions will include random.choice, which chooses an element from a list uniformly at random, and util.sample, which samples a key from a Counter by treating its values as probabilities.
6259906e2ae34c7f260ac95e
class RemoveUserFromProjectHandler(AuthedTemplateHandler): <NEW_LINE> <INDENT> def get(self, task_id, user_id): <NEW_LINE> <INDENT> user_key = ndb.Key(urlsafe=user_id) <NEW_LINE> task_key = ndb.Key(urlsafe=task_id) <NEW_LINE> task = task_key.get() <NEW_LINE> if not task.is_top_level: <NEW_LINE> <INDENT> return self.abo...
POST only route allowing to delete users from projects
6259906e8e7ae83300eea904
class JarBuilder(object): <NEW_LINE> <INDENT> def __init__(self, jarfile, sourcedir, tsa): <NEW_LINE> <INDENT> self.libjars = [] <NEW_LINE> self.tsa = tsa <NEW_LINE> self.jarfile = Path(jarfile) <NEW_LINE> self.sourcedir = Path(sourcedir) <NEW_LINE> self.sources = list(self.sourcedir.listdir('*.java')) <NEW_LINE> self....
Holds the information needed for building a Java Archive (`.jar`) file.
6259906ed486a94d0ba2d834
class FunctionTyped(Function): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.pop('direct',None) <NEW_LINE> super(FunctionTyped, self).__init__(*args, **kwargs) <NEW_LINE> self.direct = True <NEW_LINE> self.cursor_factory = simpycity.handle.TypedCursor
A Postgresql function that returns row(s) having only a single (typically composite) column
6259906e167d2b6e312b81c9
class IImioSmartwebCoreLayer( IImioSmartwebCommonLayer, IPloneAppContenttypesLayer, ILayerSpecific, IThemeSpecific, ICollectiveMessagesviewletLayer, ): <NEW_LINE> <INDENT> pass
Marker interface that defines a browser layer.
6259906e097d151d1a2c28e6
class Compose: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.nodes = [] <NEW_LINE> self.hierarchy = None <NEW_LINE> <DEDENT> def __getitem__(self, item): <NEW_LINE> <INDENT> return self._get_node(item) <NEW_LINE> <DEDENT> def __getattr__(self, item): <NEW_LINE> <INDENT> return self._get_node(item) <N...
This class provides an alternative way to build a hierarchy of Compare objects using a dictionary of parent-child relationships, as well as an alternative way to build Compare objects using a list or tuple of the necessary inputs.
6259906e4a966d76dd5f075f
class ValidationError(Exception): <NEW_LINE> <INDENT> pass
Raised when an object fails validation checks.
6259906ea05bb46b3848bd67
class ListAuth(Lister): <NEW_LINE> <INDENT> def take_action(self, args): <NEW_LINE> <INDENT> result = self.app.workspace.auth <NEW_LINE> header = ['auth_id', 'type'] <NEW_LINE> body = [] <NEW_LINE> for k, v in result.items(): <NEW_LINE> <INDENT> body.append((k, v['type'])) <NEW_LINE> <DEDENT> return [header, body]
List all authentication methods in current workspace
6259906ebaa26c4b54d50b20
class UdwPsclickSession: <NEW_LINE> <INDENT> def __init__(self, schema): <NEW_LINE> <INDENT> pass
udw中newcookiesort对应日志的结构化解析parser。可以移植海源的newcookiesort_parser,
6259906e5fdd1c0f98e5f7fc
class SuppressValidator(ValidatorBase): <NEW_LINE> <INDENT> property_names = ValidatorBase.property_names + ['external_validator'] <NEW_LINE> external_validator = fields.MethodField( 'external_validator', title="External Validator", description=( "Ignored, as a validator isn't used here."), default="", required=0, enab...
A validator that is actually not used.
6259906e99cbb53fe683275e
class GetServerDeliveryMessages(AdminService): <NEW_LINE> <INDENT> class SimpleIO(AdminSIO): <NEW_LINE> <INDENT> input_required = 'sub_key' <NEW_LINE> output_optional = List('msg_list') <NEW_LINE> <DEDENT> def handle(self): <NEW_LINE> <INDENT> ps_tool = self.pubsub.get_pubsub_tool_by_sub_key(self.request.input.sub_key)...
Returns a list of messages to be delivered to input endpoint. The messages must exist on current server.
6259906ea8370b77170f1c3e
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(128), unique=True) <NEW_LINE> email = db.Column(db.String(64), unique=True) <NEW_LINE> password = db.Column(db.String(64), unique=True) <NEW_LINE> role_id = db....
用户表 多
6259906ee1aae11d1e7cf447
class DeploymentNotFoundException(DeploymentException): <NEW_LINE> <INDENT> pass
Deployment is not found exception
6259906e32920d7e50bc78bd
class GaussianS(Sregion): <NEW_LINE> <INDENT> def __init__(self, beg, end, weight, sd, h=1.0, coupled=True, label=0): <NEW_LINE> <INDENT> if math.isinf(sd): <NEW_LINE> <INDENT> raise ValueError("fwdpy11.GaussianS: sd not finite") <NEW_LINE> <DEDENT> if math.isnan(sd): <NEW_LINE> <INDENT> raise ValueError("fwdpy11.Gauss...
Gaussian distribution on selection coefficients (effect sizes for sims of quantitative traits) Attributes: * b: the beginning of the region * e: the end of the region * w: the "weight" assigned to the region * sd: the standard deviation * h: the dominance ter * l: A label assigned to the region...
6259906e4527f215b58eb5db
class ESNHardLimiter(ESN): <NEW_LINE> <INDENT> def predict(self, X, testLen=None): <NEW_LINE> <INDENT> y = ESN.predict(self, X, testLen) <NEW_LINE> y = np.array([self.alphabet[np.argmin( [abs(yi - i) for i in self.alphabet])] for yi in y]) <NEW_LINE> if self.outSize == None: <NEW_LINE> <INDENT> y = y.reshape(y.shape[0]...
Builds an Echo State Network with hard limiter to adjust output Subclass of ESN; Changes predict method Parameters ---------- resSize : float, optional (default=1000) The number of nodes in the reservoir. a : float, optional (default=0.3) Leak rate of the neurons. initLen : float, optional (default=0) ...
6259906ef9cc0f698b1c5f06
class Post(models.Model): <NEW_LINE> <INDENT> STATUS_CHOICES = ( (1, _('Draft')), (2, _('Public')), ) <NEW_LINE> title = models.CharField(_('title'), max_length=200) <NEW_LINE> slug = models.SlugField(_('slug'), unique=True) <NEW_LINE> author = models.ForeignKey(User,related_name="blog_for...
Post model.
6259906e66673b3332c31c75
class CreateGroupResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.GroupId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.GroupId = params.get("GroupId") <NEW_LINE> self.RequestId = params.get("RequestId")
CreateGroup response structure.
6259906e76e4537e8c3f0dfb
class Response(object): <NEW_LINE> <INDENT> def __init__(self, clicker_id=None, response=None, click_time=None, seq_num=None, command=None): <NEW_LINE> <INDENT> if click_time is None: <NEW_LINE> <INDENT> self.click_time = time.time() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.click_time = click_time <NEW_LINE> ...
Keeps track of all relavent information about a clicker response
6259906e2c8b7c6e89bd505d
class CliffGridworld(BaseGridworld): <NEW_LINE> <INDENT> def __init__(self, width=12, height=4, start_state=(0,0), goal_state=(11,0), terminal_states=[(x,0) for x in range(1,11)]): <NEW_LINE> <INDENT> super().__init__(width, height, start_state, goal_state, terminal_states) <NEW_LINE> <DEDENT> def get_state_reward_tran...
Example 6.6
6259906e1f037a2d8b9e54a6
class derivfuncfloat(derivbase, funcfloat): <NEW_LINE> <INDENT> def __init__(self, func, n, accuracy, scaledown, funcstr=None, memoize=None, memo=None): <NEW_LINE> <INDENT> self.n = int(n) <NEW_LINE> self.accuracy = float(accuracy) <NEW_LINE> self.scaledown = float(scaledown) <NEW_LINE> if funcstr: <NEW_LINE> <INDENT> ...
Implements A Derivative Function Of A Fake Function.
6259906e38b623060ffaa48f
class Test_3_to_2(calculate_error, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> param_ref = np.array([0.5, 0.5, 0.5]) <NEW_LINE> Q_ref = linear_model1(param_ref) <NEW_LINE> sampler = bsam.sampler(linear_model1) <NEW_LINE> input_samples = sample.sample_set(3) <NEW_LINE> input_samples.set_...
Testing :meth:`bet.calculateP.calculateError` on a 3 to 2 map.
6259906ea05bb46b3848bd68
class MultipleWaiter(Waiter): <NEW_LINE> <INDENT> __slots__ = ['_values'] <NEW_LINE> def __init__(self, hub=None): <NEW_LINE> <INDENT> Waiter.__init__(self, hub) <NEW_LINE> self._values = [] <NEW_LINE> <DEDENT> def switch(self, value): <NEW_LINE> <INDENT> self._values.append(value) <NEW_LINE> Waiter.switch(self, True) ...
An internal extension of Waiter that can be used if multiple objects must be waited on, and there is a chance that in between waits greenlets might be switched out. All greenlets that switch to this waiter will have their value returned. This does not handle exceptions or throw methods.
6259906e56b00c62f0fb4145
class MarkdownMarkupFilter(MarkupFilter): <NEW_LINE> <INDENT> title = 'Markdown' <NEW_LINE> use_pygments = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import pygments <NEW_LINE> self.use_pygments = True <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DE...
Applies Markdown conversion to a string, and returns the HTML. If the pygments library is installed, it highlights code blocks with it.
6259906e7047854f46340c2f
class Person(BaseModel): <NEW_LINE> <INDENT> logger.info("Specifying details for the Person class.") <NEW_LINE> person_name = CharField(primary_key=True, max_length=30) <NEW_LINE> lives_in_town = CharField(max_length=40) <NEW_LINE> nickname = CharField(max_length=20, null=True)
This class defines Person, which maintains details of someone for whom we want to research career to date.
6259906e3d592f4c4edbc759
class PublicUserAPITests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_create_valid_user_success(self): <NEW_LINE> <INDENT> playload = { "name": "Test User", "email": "test@email.com", "password": "test12345", } <NEW_LINE> res = self.client.po...
Test user's api (public)
6259906e009cb60464d02daf
class gThread(threading.Thread, wx.EvtHandler): <NEW_LINE> <INDENT> requestId = 0 <NEW_LINE> def __init__(self, requestQ=None, resultQ=None, **kwds): <NEW_LINE> <INDENT> wx.EvtHandler.__init__(self) <NEW_LINE> self.terminate = False <NEW_LINE> threading.Thread.__init__(self, **kwds) <NEW_LINE> if requestQ is None: <NEW...
Thread for various backends
6259906ef548e778e596ce05
class Participant(models.Model): <NEW_LINE> <INDENT> game = models.ForeignKey(Event) <NEW_LINE> players = models.ManyToManyField(User, blank=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.game.title <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = 'Participants'
Lists of participants for each game.
6259906e4a966d76dd5f0762
class son(common.Common): <NEW_LINE> <INDENT> specialchars = u"ɲŋšžãõẽĩƝŊŠŽÃÕẼĨ"
This class represents Songhai.
6259906e92d797404e389797
class Float(Numeric): <NEW_LINE> <INDENT> __visit_name__ = "float" <NEW_LINE> scale = None <NEW_LINE> def __init__( self, precision=None, asdecimal=False, decimal_return_scale=None ): <NEW_LINE> <INDENT> self.precision = precision <NEW_LINE> self.asdecimal = asdecimal <NEW_LINE> self.decimal_return_scale = decimal_retu...
Type representing floating point types, such as ``FLOAT`` or ``REAL``. This type returns Python ``float`` objects by default, unless the :paramref:`.Float.asdecimal` flag is set to True, in which case they are coerced to ``decimal.Decimal`` objects. .. note:: The :class:`.Float` type is designed to receive data ...
6259906e71ff763f4b5e9021
class SignRepresentation_abstract(Representation_abstract): <NEW_LINE> <INDENT> def __init__(self, group, base_ring, sign_function=None): <NEW_LINE> <INDENT> self.sign_function = sign_function <NEW_LINE> if sign_function is None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.sign_function = self._default_sign <NEW_...
Generic implementation of a sign representation. The sign representation of a semigroup `S` over a commutative ring `R` is the `1`-dimensional `R`-module on which every element of `S` acts by 1 if order of element is even (including 0) or -1 if order of element if odd. This is simultaneously a left and right represen...
6259906eac7a0e7691f73d61
class ListDocumentTest(GSoCDjangoTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.init() <NEW_LINE> self.data.createHost() <NEW_LINE> <DEDENT> def testListDocument(self): <NEW_LINE> <INDENT> url = '/gsoc/documents/' + self.gsoc.key().name() <NEW_LINE> response = self.get(url) <NEW_LINE> self.ass...
Test document list page.
6259906e66673b3332c31c77
class MessageVoiceId(ServerMessage): <NEW_LINE> <INDENT> def clientAction(self, dummyClient, move): <NEW_LINE> <INDENT> if Sound.enabled: <NEW_LINE> <INDENT> move.player.voice = Voice.locate(move.source) <NEW_LINE> if not move.player.voice: <NEW_LINE> <INDENT> return Message.ClientWantsVoiceData, move.source
we got a voice id from the server. If we have no sounds for this voice, ask the server
6259906e1b99ca4002290172
class Bin(): <NEW_LINE> <INDENT> def __init__(self, posixdate): <NEW_LINE> <INDENT> self.posixdate = posixdate <NEW_LINE> self.datalist = [] <NEW_LINE> self.aurorasighting = "" <NEW_LINE> self.stormthreshold = "" <NEW_LINE> self.carrington_rotation = "" <NEW_LINE> <DEDENT> def average_datalist(self): <NEW_LINE> <INDENT...
DataBin - This objects allows us to crate a bin of values. Calculates the average value of the bin
6259906e167d2b6e312b81cb
class AmongUs2: <NEW_LINE> <INDENT> def __init__(self,citizens_list,angels_list,devils_list): <NEW_LINE> <INDENT> self.citizens_list=citizens_list <NEW_LINE> self.angels_list=angels_list <NEW_LINE> self.devils_list=devils_list
contains info about game at a given point of time
6259906eadb09d7d5dc0bde4
class EditProfileView(generics.UpdateAPIView): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = EditProfileSerializer <NEW_LINE> permission_classes = (PrivateTokenAccessPermission, ) <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.user <NEW_LINE> <DEDENT> def upda...
API for Profile Detail
6259906e3539df3088ecdb16
class NonExistingExternalProgram(ExternalProgram): <NEW_LINE> <INDENT> def __init__(self, name: str = 'nonexistingprogram') -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.command = [None] <NEW_LINE> self.path = None <NEW_LINE> <DEDENT> def __repr__(self) -> str: <NEW_LINE> <INDENT> r = '<{} {!r} -> {!r}>...
A program that will never exist
6259906e7d847024c075dc57
class DataGenerator(keras.utils.Sequence): <NEW_LINE> <INDENT> def __init__(self, id_list, example_count=270, batch_size=32, mean=0, disper=1): <NEW_LINE> <INDENT> self.id_list = id_list <NEW_LINE> self.example_count = example_count <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.mean = mean <NEW_LINE> self.dis...
Generates data for Keras
6259906e23849d37ff85292f
class PubPlanView(TemplateView): <NEW_LINE> <INDENT> template_name = 'publication-plan.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.year = int(self.kwargs['year']) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> self.year = timezone.now().year <NEW_LINE> <DEDENT> q...
Publication plan
6259906e5166f23b2e244c4e
class SelfPasswordChangeForm(forms.Form): <NEW_LINE> <INDENT> password = forms.CharField( required=True, min_length=6, max_length=20, error_messages={ "required": u"密码不能为空" }) <NEW_LINE> confirm_password = forms.CharField( required=True, min_length=6, max_length=20, error_messages={ "required": u"确认密码不能为空" }) <NEW_LINE...
用户自行修改密码
6259906e5fdd1c0f98e5f800
class PyNbclient(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://jupyter.org/" <NEW_LINE> pypi = "nbclient/nbclient-0.5.0.tar.gz" <NEW_LINE> version('0.5.0', sha256='8ad52d27ba144fca1402db014857e53c5a864a2f407be66ca9d74c3a56d6591d') <NEW_LINE> depends_on('python@3.6:', type=('build', 'run')) <NEW_LINE> depends_...
A client library for executing notebooks. Formally nbconvert's ExecutePreprocessor.
6259906e4c3428357761bb2d
class ItemError(PlaidError): <NEW_LINE> <INDENT> pass
There is invalid information about an item or it is not supported.
6259906e7d43ff248742804f
class DateSerializerWithTimezone(Serializer): <NEW_LINE> <INDENT> def format_datetime(self, data): <NEW_LINE> <INDENT> if is_naive(data) or self.datetime_formatting == 'rfc-2822': <NEW_LINE> <INDENT> return super(DateSerializerWithTimezone, self).format_datetime(data) <NEW_LINE> <DEDENT> return data.isoformat()
Our own serializer to format datetimes in ISO 8601 but with timezone offset.
6259906e4428ac0f6e659dad
class Product(models.Model): <NEW_LINE> <INDENT> product_id = models.AutoField(primary_key=True) <NEW_LINE> product_name = models.CharField( max_length=200, verbose_name="Product Name" ) <NEW_LINE> product_slug = models.CharField( max_length=400, unique=True, verbose_name="Product SLUG" ) <NEW_LINE> product_url = model...
Product Model
6259906ea8370b77170f1c42
class ClassList(models.Model): <NEW_LINE> <INDENT> branch = models.ForeignKey("Branch") <NEW_LINE> course = models.ForeignKey("Course") <NEW_LINE> class_type_choices = ((0,'脱产'),(1,'周末'),(2,'网络班')) <NEW_LINE> class_type = models.SmallIntegerField(choices=class_type_choices,default=0) <NEW_LINE> semester = models.SmallI...
班级列表
6259906ef548e778e596ce07
class BrowsableAPIRenderer(renderers.BrowsableAPIRenderer): <NEW_LINE> <INDENT> def get_default_renderer(self, view): <NEW_LINE> <INDENT> renderer = super(BrowsableAPIRenderer, self).get_default_renderer(view) <NEW_LINE> if view.request.method == 'OPTIONS' and not isinstance(renderer, renderers.JSONRenderer): <NEW_LINE...
Customizations to the default browsable API renderer.
6259906e009cb60464d02db1
class Manager(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self.parser = argparse.ArgumentParser(description="Manage %s" % self.app.app.capitalize()) <NEW_LINE> self.parsers = self.parser.add_subparsers(dest='sub_command') <NEW_LINE> self.handlers = {} <NEW_LINE> s...
example.py ```python from nougat import Nougat app = Nougat() async def middleware(response): response.content = 'Hello world' app.use(middleware) app.manager.up() ``` then just run `python example.py run`, the server is starting.
6259906e7b25080760ed8920
@op <NEW_LINE> class Shrs(Binop): <NEW_LINE> <INDENT> mode = "get_irn_mode(irn_left)" <NEW_LINE> flags = []
Returns its first operands bits shifted right by the amount of the 2nd operand. The leftmost bit (usually the sign bit) stays the same (sign extension). The right input (shift amount) must be an unsigned integer value. If the result mode has modulo_shift!=0, then the effective shift amount is the right input modulo thi...
6259906e442bda511e95d995
class DeleteReportsView(LoginRequiredMixin, UserPassesTestMixin, TemplateView): <NEW_LINE> <INDENT> login_url = 'usuarios:login' <NEW_LINE> def test_func(self): <NEW_LINE> <INDENT> return self.request.user.usuariosgrexco.tipo == 'A' <NEW_LINE> <DEDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> data ...
Vista para Eliminar un reporte Recibe por POST un objetoJSON: {'reporte': [id_reporte]}
6259906e97e22403b383c77e
class ShutterContactSensor(SHCEntity, BinarySensorEntity): <NEW_LINE> <INDENT> def __init__(self, device: SHCDevice, parent_id: str, entry_id: str) -> None: <NEW_LINE> <INDENT> super().__init__(device, parent_id, entry_id) <NEW_LINE> switcher = { "ENTRANCE_DOOR": DEVICE_CLASS_DOOR, "REGULAR_WINDOW": DEVICE_CLASS_WINDOW...
Representation of an SHC shutter contact sensor.
6259906ed486a94d0ba2d839
class PreprocessAllFiles(luigi.WrapperTask): <NEW_LINE> <INDENT> input_path: str = os.path.join("data", "raw") <NEW_LINE> output_path: str = os.path.join("data", "processed") <NEW_LINE> def requires(self) -> Generator[luigi.Task, None, None]: <NEW_LINE> <INDENT> for filename in os.listdir(self.input_path): <NEW_LINE> <...
Applies defined preprocessing steps to all files in the selected folder.
6259906e4f6381625f19a0e6
class OnsetDetectionFunction(Analyzer): <NEW_LINE> <INDENT> implements(IAnalyzer) <NEW_LINE> def __init__(self, blocksize=1024, stepsize=None): <NEW_LINE> <INDENT> super(OnsetDetectionFunction, self).__init__() <NEW_LINE> self.input_blocksize = blocksize <NEW_LINE> if stepsize: <NEW_LINE> <INDENT> self.input_stepsize =...
Onset Detection Function analyzer
6259906e8a43f66fc4bf3a0f
class BinaryExchangeType_(SamlBase): <NEW_LINE> <INDENT> c_tag = 'BinaryExchangeType' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_value_type = {'base': 'string'} <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_orde...
The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:BinaryExchangeType element
6259906eadb09d7d5dc0bde6
class HandleShipmentException(Wizard): <NEW_LINE> <INDENT> __name__ = 'purchase.handle.shipment.exception' <NEW_LINE> start_state = 'ask' <NEW_LINE> ask = StateView('purchase.handle.shipment.exception.ask', 'purchase.handle_shipment_exception_ask_view_form', [ Button('Cancel', 'end', 'tryton-cancel'), Button('Ok', 'han...
Handle Shipment Exception
6259906e38b623060ffaa491
class Vector2: <NEW_LINE> <INDENT> def __init__(self, x=0, y=0): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y
Class for storing pair of values.
6259906e3539df3088ecdb18
class TestSnapshotPattern(manager.ScenarioTest): <NEW_LINE> <INDENT> def _boot_image(self, image_id): <NEW_LINE> <INDENT> security_groups = [{'name': self.security_group['name']}] <NEW_LINE> create_kwargs = { 'key_name': self.keypair['name'], 'security_groups': security_groups } <NEW_LINE> return self.create_server(ima...
This test is for snapshotting an instance and booting with it. The following is the scenario outline: * boot a instance and create a timestamp file in it * snapshot the instance * boot a second instance from the snapshot * check the existence of the timestamp file in the second instance
6259906e2c8b7c6e89bd5062
class StataValueLabel: <NEW_LINE> <INDENT> def __init__(self, catarray): <NEW_LINE> <INDENT> self.labname = catarray.name <NEW_LINE> categories = catarray.cat.categories <NEW_LINE> self.value_labels = list(zip(np.arange(len(categories)), categories)) <NEW_LINE> self.value_labels.sort(key=lambda x: x[0]) <NEW_LINE> self...
Parse a categorical column and prepare formatted output Parameters ----------- value : int8, int16, int32, float32 or float64 The Stata missing value code Attributes ---------- string : string String representation of the Stata missing value value : int8, int16, int32, float32 or float64 The original enco...
6259906f4428ac0f6e659daf
class LineGlyph(XyGlyph): <NEW_LINE> <INDENT> width = Int(default=2) <NEW_LINE> dash = Enum(DashPattern, default='solid') <NEW_LINE> def __init__(self, x=None, y=None, line_color=None, width=None, dash=None, **kwargs): <NEW_LINE> <INDENT> kwargs['x'] = x <NEW_LINE> kwargs['y'] = y <NEW_LINE> kwargs['line_color'] = line...
Represents a group of data as a line.
6259906fd268445f2663a79b
class App(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.content = "" <NEW_LINE> self.startTime = 0 <NEW_LINE> <DEDENT> def launchApp(self): <NEW_LINE> <INDENT> cmd2 = 'adb shell am start -W -n com.mfcar.dealer/.ui.splash.SplashActivity' <NEW_LINE> self.content = os.popen(cmd2) <NEW_LINE> ret...
运行类
6259906f8e7ae83300eea90c
class TestQueueNonExisting(base.V1FunctionalTestBase): <NEW_LINE> <INDENT> server_class = base.MarconiServer <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestQueueNonExisting, self).setUp() <NEW_LINE> self.base_url = '{0}/{1}'.format(self.cfg.marconi.url, "v1") <NEW_LINE> self.queue_url = (self.base_url + '/qu...
Test Actions on non existing queue.
6259906f91f36d47f2231acd
class ArchiveBaseClass(object): <NEW_LINE> <INDENT> _compression = False <NEW_LINE> _ext = ".ext" <NEW_LINE> _mimetype = "" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._tar_ext = ".tar" <NEW_LINE> <DEDENT> @property <NEW_LINE> def support_compression(self): <NEW_LINE> <INDENT> return self._...
Base class for archive classes.
6259906ff9cc0f698b1c5f09
class PrintBvrFund(models.TransientModel): <NEW_LINE> <INDENT> _name = 'print.bvr.fund' <NEW_LINE> product_id = fields.Many2one( 'product.product', domain=[ ('fund_id', '!=', False), ('categ_id', '!=', 3), ('categ_id', '!=', 5)]) <NEW_LINE> draw_background = fields.Boolean() <NEW_LINE> state = fields.Selection([('new',...
Wizard for selecting a product and print payment slip of a partner.
6259906f3539df3088ecdb19
class Model(nn.Layer, ModelBase): <NEW_LINE> <INDENT> def __init___(self): <NEW_LINE> <INDENT> super(Model, self).__init__() <NEW_LINE> <DEDENT> def sync_weights_to(self, target_model, decay=0.0): <NEW_LINE> <INDENT> assert not target_model is self, "cannot copy between identical model" <NEW_LINE> assert isinstance(tar...
| `alias`: ``parl.Model`` | `alias`: ``parl.core.paddle.agent.Model`` | ``Model`` is a base class of PARL for the neural network. A ``Model`` is usually a policy or Q-value function, which predicts an action or an estimate according to the environmental observation. | To use the ``PaddlePaddle2.0`` backend model, u...
6259906fd486a94d0ba2d83b
class DSRScorecardReport(base_models.DSRScorecardReport): <NEW_LINE> <INDENT> serial_number = models.CharField(max_length=5) <NEW_LINE> goals = models.CharField(max_length=255, null=True, blank=True) <NEW_LINE> target = models.CharField(max_length=255, null=True, blank=True) <NEW_LINE> actual = models.CharField(max_len...
details of report
6259906f01c39578d7f14373
class EncryptionSetIdentity(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId'...
The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. Variables are only populated by the server, and will be ignored when sending a request. :ivar type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned i...
6259906f1b99ca4002290174
class MAVLink_status_gps_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_STATUS_GPS <NEW_LINE> name = 'STATUS_GPS' <NEW_LINE> fieldnames = ['csFails', 'gpsQuality', 'msgsType', 'posStatus', 'magVar', 'magDir', 'modeInd'] <NEW_LINE> ordered_fieldnames = [ 'magVar', 'csFails', 'gpsQuality', 'msgsType', ...
This contains the status of the GPS readings
6259906faad79263cf430033
class Meta: <NEW_LINE> <INDENT> model = Kunde <NEW_LINE> fields = ['template']
Eine Klasse zur Repräsentation der Metadaten ... Attributes ---------- model : Kunde Kundenobjekt fields : string Template-Feld
6259906f097d151d1a2c28ee
class PublisherForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Publisher <NEW_LINE> fields = ('pub_id', 'pub_name', 'city')
Form for adding a publisher
6259906f38b623060ffaa492
class ApproximateQAgent(PacmanQAgent): <NEW_LINE> <INDENT> def __init__(self, extractor='IdentityExtractor', **args): <NEW_LINE> <INDENT> self.featExtractor = util.lookup(extractor, globals())() <NEW_LINE> PacmanQAgent.__init__(self, **args) <NEW_LINE> self.weights = util.Counter() <NEW_LINE> <DEDENT> def getWeights(se...
ApproximateQLearningAgent You should only have to overwrite getQValue and update. All other QLearningAgent functions should work as is.
6259906f7047854f46340c34
class OrderedSet(collections.MutableSet): <NEW_LINE> <INDENT> def __init__(self, iterable=None): <NEW_LINE> <INDENT> self.end = end = [] <NEW_LINE> end += [None, end, end] <NEW_LINE> self.map = {} <NEW_LINE> if iterable is not None: <NEW_LINE> <INDENT> self |= iterable <NEW_LINE> <DEDENT> <DEDENT> def __len__(self): <N...
Ordered set
6259906f56b00c62f0fb414b
class Action: <NEW_LINE> <INDENT> __slots__ = ( 'namespaced_type', 'goal', 'result', 'feedback', 'send_goal_service', 'get_result_service', 'feedback_message', 'implicit_includes') <NEW_LINE> def __init__( self, namespaced_type: NamespacedType, goal: Message, result: Message, feedback: Message ): <NEW_LINE> <INDENT> su...
A namespaced type of an action including the derived types.
6259906f7d847024c075dc5b
class PSFResultSet(result.ResultDict): <NEW_LINE> <INDENT> def __init__(self, resultdir=None): <NEW_LINE> <INDENT> runlist = [] <NEW_LINE> self.runs = {} <NEW_LINE> self.resultnames = [] <NEW_LINE> self.resultdir = resultdir <NEW_LINE> runobjfile = os.path.join(resultdir,"runObjFile") <NEW_LINE> if os.path.exists(runob...
PSFResultSet class handles a PSF result directory A PSFResultSet may contain one or more runs (PSFRun objects) which in turn contain one or more results (PSFResult).
6259906f8da39b475be04a6b
class Nlopt(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://nlopt.readthedocs.io" <NEW_LINE> url = "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" <NEW_LINE> git = "https://github.com/stevengj/nlopt.git" <NEW_LINE> version('develop', branch='master') <NEW_LINE> version('2.5.0', 'ada08c648bf9b...
NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms.
6259906f7b180e01f3e49ca3
class TestHomeAppliance(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return HomeAppliance( da...
HomeAppliance unit test stubs
6259906f435de62698e9d684
class OrderSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> order_detail = OrderDetailSerializer(many=True, read_only=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Order <NEW_LINE> fields = ['id', 'user', 'status', 'total', 'created', 'order_detail']
Order Serializer
6259906f2ae34c7f260ac968
class ScriptEngine(object): <NEW_LINE> <INDENT> executor = ('%s %s' % ('Restricted Python', sys.version.split('\n')[0])).strip() <NEW_LINE> repository = None <NEW_LINE> _scripts = None <NEW_LINE> __allowedBuiltins = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.repository = dict() <NEW_LINE> self._script...
classdocs
6259906f4a966d76dd5f0768
class ArtifactParserTests(test_lib.GRRBaseTest): <NEW_LINE> <INDENT> def testValidation(self): <NEW_LINE> <INDENT> artifact_test.ArtifactTest.LoadTestArtifacts() <NEW_LINE> for p_cls in parsers.Parser.classes: <NEW_LINE> <INDENT> parser = parsers.Parser.classes[p_cls] <NEW_LINE> parser.Validate()
Test parsers validate.
6259906f67a9b606de5476e2
class EventClass(object): <NEW_LINE> <INDENT> _subclass_map = {} <NEW_LINE> def __init__(self, log_session, event_trace): <NEW_LINE> <INDENT> if (isinstance(event_trace, LP_EVENT_TRACE)): <NEW_LINE> <INDENT> header = event_trace.contents.Header <NEW_LINE> user_data, user_data_length = (event_trace.contents.MofData, eve...
Base class for event classes. The EventClass class is used to transform an event data buffer into a set of named attributes on the object. Classes that want to parse event data should derive from this class and define the _fields_ property: class MyEventClass(EventClass): _fields_ = [('IntField', field.Int32), ...
6259906f0a50d4780f706a00
class GuestbookEntryCreate(AjaxableResponseMixin, GuestbookEntryFormMixin, GuestbookMixin, CreateView): <NEW_LINE> <INDENT> form_class = GuestbookEntryForm <NEW_LINE> context_object_name = 'form' <NEW_LINE> template_name = 'guestbook/guestbook_form.html' <NEW_LINE> status = 'create' <NEW_LINE> form_title = 'Add a Note'...
This is for creating a guestbook entry with or without Ajax.
6259906f32920d7e50bc78c5
class PublicRecipeApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_auth_required(self): <NEW_LINE> <INDENT> response = self.client.get(RECIPES_URL) <NEW_LINE> self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
Test unauthorized recipe API access
6259906f8e7ae83300eea90f
class personne: <NEW_LINE> <INDENT> def __init__(self, nom, prenom): <NEW_LINE> <INDENT> self.nom = nom <NEW_LINE> self.prenom = prenom <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Le nom est {} {}".format(self.prenom, self.nom)
Objet qui représente une personne
6259906f7b25080760ed8922
class BankShort: <NEW_LINE> <INDENT> def __init__(self, account: str = None, name: str = None, bic: str = None, corr_acc: str = None): <NEW_LINE> <INDENT> self.__account = account <NEW_LINE> self.__name = name <NEW_LINE> self.__bic = bic <NEW_LINE> self.__corr_acc = corr_acc <NEW_LINE> <DEDENT> def __str__(self): <NEW_...
Короткие банковские реквизиты. Номер счета, Название банка, БИК и корр. счёт.
6259906ffff4ab517ebcf099
class PersonVehicle(models.Model): <NEW_LINE> <INDENT> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> updated_at = models.DateTimeField(auto_now=True) <NEW_LINE> vehicle = models.ForeignKey(Vehicle, on_delete=models.PROTECT) <NEW_LINE> person = models.ForeignKey(Person, on_delete=models.PROTECT) <NEW_L...
PersonVehicle register the relatioship between a vehicle in a person, in other words the owner of the vehicle at a given point in time
6259906f4e4d562566373c86
class RegistroC405(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'C405'), CampoData(2, 'DT_DOC'), Campo(3, 'CRO'), Campo(4, 'CRZ'), Campo(5, 'NUM_COO_FIN'), Campo(6, 'GT_FIN'), CampoNumerico(7, 'VL_BRT'), ] <NEW_LINE> nivel = 3
REDUÇÃO Z (CÓDIGO 02 E 2D)
6259906fd486a94d0ba2d83e
class Neighborhood(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def origin_of_dim(dim): <NEW_LINE> <INDENT> return tuple([0 for _ in range(dim)]) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def flatten(l): <NEW_LINE> <INDENT> list_type = type(l) <NEW_LINE> l = list(l) <NEW_LINE> i = 0 <NEW_LINE> while i < len...
convenience class for defining and testing neighborhoods
6259906ff548e778e596ce0c
class Package: <NEW_LINE> <INDENT> def __init__(self, package_name): <NEW_LINE> <INDENT> self.pkg = get_distribution(package_name) <NEW_LINE> self.result = namedtuple( "Result", [ "name", "environment", "description_license", "classifier_licenses", "lgtm", ], ) <NEW_LINE> self.result.name = "{0}".format(self.pkg.projec...
It creates a pkg_resources.DistInfoDistribution (setuptools) object and extracts the necessary information from its metadata attributes and classifiers.
6259906f7c178a314d78e82b
class ROSTopicIOException(ROSTopicException): <NEW_LINE> <INDENT> pass
ros_datafeed errors related to network I/O failures
6259906fa17c0f6771d5d7e9
class VmSnapshot: <NEW_LINE> <INDENT> def __init__(self, items): <NEW_LINE> <INDENT> self.__dict__.update(items) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def create(cls, apiclient, vmid, snapshotmemory="false", name=None, description=None): <NEW_LINE> <INDENT> cmd = createVMSnapshot.createVMSnapshotCmd() <NEW_LINE> ...
Manage VM Snapshot life cycle
6259906faad79263cf430035