code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Translate: <NEW_LINE> <INDENT> def __init__(self, src_lang: str, target_lang: str) -> None: <NEW_LINE> <INDENT> self.model = None <NEW_LINE> self.load_model(src_lang, target_lang) <NEW_LINE> <DEDENT> def load_model(self, src_lang: str, target_lang: str): <NEW_LINE> <INDENT> if src_lang == "th" and target_lang == ...
Machine Translation :param str src_lang: source language :param str target_lang: target language **Options for source & target language** * *th* - *en* - Thai to English * *en* - *th* - English to Thai * *th* - *zh* - Thai to Chinese * *zh* - *th* - Chinese to Thai * *th* - *fr* - Thai to French ...
62599031be8e80087fbc0124
class LazyProperty(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> if instance is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> value = self.func(instance) <NEW_L...
属性延迟初始化
625990318c3a8732951f7600
class SermonList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> sermons = Sermon.objects.all() <NEW_LINE> serializer = SermonSerializer(sermons, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> permission_classes = (permissions.IsAuthenticatedOrReadOnly,...
List all code series, or create a new sermon.
625990318a43f66fc4bf322f
class ConfigSampleColumn(Config): <NEW_LINE> <INDENT> sample_column = ParamCreator.create_int( help_string="what column to sample by", )
Configuration options for sampling
6259903156b00c62f0fb396a
class NoteLine(models.Model): <NEW_LINE> <INDENT> note = models.CharField(max_length=400) <NEW_LINE> is_permanent = models.BooleanField(default=False) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "%s" % self.note <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "Quoted Order Note"
Model to handle storage of note line.
625990315e10d32532ce4158
class DcmStack(NiftiGeneratorBase): <NEW_LINE> <INDENT> input_spec = DcmStackInputSpec <NEW_LINE> output_spec = DcmStackOutputSpec <NEW_LINE> def _get_filelist(self, trait_input): <NEW_LINE> <INDENT> if isinstance(trait_input, six.string_types): <NEW_LINE> <INDENT> if path.isdir(trait_input): <NEW_LINE> <INDENT> return...
Create one Nifti file from a set of DICOM files. Can optionally embed meta data. Example ------- >>> from nipype.interfaces.dcmstack import DcmStack >>> stacker = DcmStack() >>> stacker.inputs.dicom_files = 'path/to/series/' >>> stacker.run() # doctest: +SKIP >>> result.outputs.out_file # doctest: +SKIP '/path/to/cwd...
62599031d53ae8145f91950d
class Game: <NEW_LINE> <INDENT> def __init__(self, caption: str = "Game", size: ('x', 'y') = (600, 600), clear_screen: bool = True): <NEW_LINE> <INDENT> os.environ['SDL_VIDEO_WINDOW_POS'] = "15,30" <NEW_LINE> self.size = size <NEW_LINE> self.clear_screen = clear_screen <NEW_LINE> self.running = False <NEW_LINE> pygame....
A wrapper to make pygame games more easily. inherit this class and overwrite kbin and update fns
625990313eb6a72ae038b711
class Graph(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vertices = [] <NEW_LINE> self.edges = [] <NEW_LINE> self.vertex_map = {} <NEW_LINE> <DEDENT> def new_vertex(self): <NEW_LINE> <INDENT> vertex = Vertex(len(self.vertices)) <NEW_LINE> self.vertices.append(vertex) <NEW_LINE> return verte...
A directed graph that can easily be JSON serialized for visualization. When serializing, it generates the following fields: edge: The list of all serialized Edge instances. node: The list of all serialized Vertex instances.
62599031d4950a0f3b111693
class NotInTeam(LaunchpadFault): <NEW_LINE> <INDENT> error_code = 250 <NEW_LINE> msg_template = '%(person_name)s is not a member of %(team_name)s.' <NEW_LINE> def __init__(self, person_name, team_name): <NEW_LINE> <INDENT> LaunchpadFault.__init__( self, person_name=person_name, team_name=team_name)
Raised when a person needs to be a member of a team, but is not. In particular, this is used when a user tries to register a branch as being owned by a team that they themselves are not a member of.
62599031d6c5a102081e31d1
class PortBinding(model_base.BASEV2): <NEW_LINE> <INDENT> __tablename__ = 'ml2_port_bindings' <NEW_LINE> port_id = sa.Column(sa.String(36), sa.ForeignKey('ports.id', ondelete="CASCADE"), primary_key=True) <NEW_LINE> host = sa.Column(sa.String(255), nullable=False, default='', server_default='') <NEW_LINE> vnic_type = s...
Represent binding-related state of a port. A port binding stores the port attributes required for the portbindings extension, as well as internal ml2 state such as which MechanismDriver and which segment are used by the port binding.
6259903115baa72349463044
class NIPSDQNHead(chainer.ChainList): <NEW_LINE> <INDENT> def __init__(self, n_input_channels=4, n_output_channels=256, activation=F.relu, bias=0.1): <NEW_LINE> <INDENT> self.n_input_channels = n_input_channels <NEW_LINE> self.activation = activation <NEW_LINE> self.n_output_channels = n_output_channels <NEW_LINE> laye...
DQN's head (NIPS workshop version)
62599031c432627299fa40a1
class GradientDescentOptimizer(Optimizer): <NEW_LINE> <INDENT> def __init__(self, objective, *vars, minimize=True, eta=1.0, constraints={}, **kwargs): <NEW_LINE> <INDENT> super().__init__(objective, *vars, minimize=minimize, constraints=constraints, **kwargs) <NEW_LINE> self.eta = eta <NEW_LINE> <DEDENT> def grad_steps...
x <-- x - eta*grad(f)(x)
6259903171ff763f4b5e8843
class ListPort(quantumv20.ListCommand): <NEW_LINE> <INDENT> resource = 'port' <NEW_LINE> log = logging.getLogger(__name__ + '.ListPort') <NEW_LINE> _formatters = {'fixed_ips': _format_fixed_ips, } <NEW_LINE> list_columns = ['id', 'name', 'mac_address', 'fixed_ips'] <NEW_LINE> pagination_support = True <NEW_LINE> sortin...
List ports that belong to a given tenant.
62599031be8e80087fbc0128
class Usuario(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'first_name', 'last_name', 'email')
Clase que representa el modelo de Usuario de Django @typ ModelForm:
6259903130c21e258be998b8
class Solution: <NEW_LINE> <INDENT> def postorderTraversal(self, root): <NEW_LINE> <INDENT> results = [] <NEW_LINE> self.traverse(root, results) <NEW_LINE> return results <NEW_LINE> <DEDENT> def traverse(self, root, results): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.trave...
@param root: A Tree @return: Postorder in ArrayList which contains node values.
625990311d351010ab8f4bc5
class CourseTeamMembership(models.Model): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> unique_together = (('user', 'team'),) <NEW_LINE> <DEDENT> user = models.ForeignKey(User) <NEW_LINE> team = models.ForeignKey(CourseTeam, related_name='membership') <NEW_LINE> date_joined = models.DateTimeField(auto_now...
This model represents the membership of a single user in a single team.
625990318c3a8732951f7605
class ZorroT6(Structure): <NEW_LINE> <INDENT> _fields_ = [('time', c_double), ('fHigh', c_float), ('fLow', c_float), ('fOpen', c_float), ('fClose', c_float), ('fVal', c_float), ('fVol', c_float)]
struct { DATE time; // timestamp of the end of the tick in UTC, OLE date/time format (double float) float fHigh,fLow; float fOpen,fClose; float fVal,fVol; // additional data, like ask-bid spread, volume etc. }
6259903156b00c62f0fb396e
class PyramidAdd(function_node.FunctionNode): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.rhs_ch = None <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check.expect(in_types.size() == 2) <NEW_LINE> lhs = in_types[0] <NEW_LINE> rhs = in_types[1] <NEW_LINE> type_c...
Add different channel shaped array. This function is not commutable, lhs and rhs acts different! Add different channel shaped array. lhs is h, and rhs is x. h.shape[1] must be always equal or larger than x.shape[1]... output channel is always h.shape[1]. x.shape[1] is smaller than h.shape[1], x is virtually padded w...
6259903191af0d3eaad3aeda
class ConfigProxy: <NEW_LINE> <INDENT> def __init__(self, cfg, user): <NEW_LINE> <INDENT> self.base = cfg <NEW_LINE> self.user = user <NEW_LINE> self.filename = None <NEW_LINE> if user is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.cfg = Config() <NEW_LINE> path = os.path.split(self.base.filename)[0] + '/...
A proxy class that directs all writes into user's personal config file while reading from both personal and common configs. - *cfg* - :class:`Config` common for all users, - *user* - user name
625990316fece00bbaccca5d
class GsCompareCommitShowDiffCommand(TextCommand, GitCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> sublime.set_timeout_async(self.run_async) <NEW_LINE> <DEDENT> def run_async(self): <NEW_LINE> <INDENT> base_commit = self.view.settings().get("git_savvy.compare_commit_view.base_commit") <NEW_LINE...
Refresh view of all commits diff between branches.
62599031287bf620b6272c96
class PortableModel(object): <NEW_LINE> <INDENT> def __init__(self, model_name, debug): <NEW_LINE> <INDENT> self.model_name = model_name <NEW_LINE> self.debug = debug <NEW_LINE> units_accepted, self.kim_model = model_create( kimpy.numbering.zeroBased, kimpy.length_unit.A, kimpy.energy_unit.eV, kimpy.charge_unit.e, kimp...
Creates a KIM API Portable Model object and provides a minimal interface to it
625990316fece00bbaccca5e
class TestSequenceIdentifier(unittest.TestCase): <NEW_LINE> <INDENT> def test_read_casava_id(self): <NEW_LINE> <INDENT> seqid_string = "@EAS139:136:FC706VJ:2:2104:15343:197393 1:Y:18:ATCACG" <NEW_LINE> seqid = SequenceIdentifier(seqid_string) <NEW_LINE> self.assertEqual(str(seqid),seqid_string) <NEW_LINE> self.assertEq...
Tests of the SequenceIdentifier class
62599031e76e3b2f99fd9abb
class CompanyCategoriesEditView(CompanyCategoriesAddView): <NEW_LINE> <INDENT> save_button = Button('Save') <NEW_LINE> reset_button = Button('Reset') <NEW_LINE> @property <NEW_LINE> def is_displayed(self): <NEW_LINE> <INDENT> return ( self.company_categories.is_active() and self.name.is_displayed and self.save_button.i...
Edit Company Categories View
625990319b70327d1c57fe33
class M2Html(object): <NEW_LINE> <INDENT> def __init__(self, args=[]): <NEW_LINE> <INDENT> self.logger = logging.getLogger(type(self).__name__) <NEW_LINE> self.parser = argparse.ArgumentParser() <NEW_LINE> def getonoffargs(isOn=False): <NEW_LINE> <INDENT> return dict(choices=['on', 'off'], default=isOn, action=OnOffAct...
Port for m2html
62599031d6c5a102081e31d5
class Celebrity(models.Model): <NEW_LINE> <INDENT> CELEBRITY_CHOICES = (('A','Actors'), ('M','Musicians'), ('T','TV'), ('R','Radio'), ('S','Sports'), ('P','Politicians')) <NEW_LINE> name = models.CharField(max_length=200) <NEW_LINE> slug = models.SlugField(unique=True) <NEW_LINE> specificity = models.CharField(max_leng...
Celebrity Model
6259903115baa72349463048
class TipViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Tip.objects.all() <NEW_LINE> serializer_class = TipSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> http_method_names = ('options', 'head', 'get', 'post') <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = sup...
Follow the article url to get the CMS page.
6259903150485f2cf55dc02d
class Tags: <NEW_LINE> <INDENT> __slots__ = ('tags', 'tagstr') <NEW_LINE> def __init__(self, *, tags=None, tagstr=None): <NEW_LINE> <INDENT> self.tags = tags <NEW_LINE> self.tagstr = tagstr <NEW_LINE> if not self.tags: <NEW_LINE> <INDENT> self = self.parse(self.tagstr) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LIN...
Stores message tags. Message tags are a new feature proposed by IRCv3 to add enhanced out-of-band data to messages. Not presently tested a whole lot due to the lack of conforming servers.
6259903171ff763f4b5e8847
class File(ParamType): <NEW_LINE> <INDENT> name = 'filename' <NEW_LINE> envvar_list_splitter = os.path.pathsep <NEW_LINE> def __init__(self, mode='r', encoding=None, errors='strict', lazy=None): <NEW_LINE> <INDENT> self.mode = mode <NEW_LINE> self.encoding = encoding <NEW_LINE> self.errors = errors <NEW_LINE> self.lazy...
Declares a parameter to be a file for reading or writing. The file is automatically closed once the context tears down (after the command finished working). Files can be opened for reading or writing. The special value ``-`` indicates stdin or stdout depending on the mode. By default the file is opened for reading ...
62599031287bf620b6272c97
class SystemReady(unittest.TestCase): <NEW_LINE> <INDENT> def test_docker_installed(self): <NEW_LINE> <INDENT> self.assertTrue(application_is_installed('docker')) <NEW_LINE> <DEDENT> def test_java_installed(self): <NEW_LINE> <INDENT> self.assertTrue(application_is_installed('java')) <NEW_LINE> <DEDENT> def test_spark_i...
Check if everything is installed for lofn to run.
625990318a43f66fc4bf3237
class MockingDeviceDependenciesTestCase1(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> dev1 = DiskDevice("name", fmt=get_format("mdmember"), size=Size("1 GiB")) <NEW_LINE> dev2 = DiskDevice("other") <NEW_LINE> self.part = PartitionDevice("part", fmt=get_format("mdmember"), parents=[dev2])...
Test availability of external device dependencies.
62599031e76e3b2f99fd9abd
class ParticleObj(gameObjects.GameObject): <NEW_LINE> <INDENT> PARAMS = ["parent_id", "rect", "duration"] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.parent_id = None <NEW_LINE> self.duration = None <NEW_LINE> self.dead = False <NEW_LINE> self.die_on_impact = False <NEW_LINE> self.t0 = 0.0 <NEW_LI...
generic particle object
625990313eb6a72ae038b717
class DP6(IterDataPipe[int]): <NEW_LINE> <INDENT> def __iter__(self) -> Iterator: <NEW_LINE> <INDENT> raise NotImplementedError
DataPipe with plain Iterator
625990314e696a045264e67a
class Project(object): <NEW_LINE> <INDENT> def __init__(self, name, id=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.id = id <NEW_LINE> if self.id == None: <NEW_LINE> <INDENT> self.id = re.sub(r'_+', '_', re.sub(r'[^A-z0-9]', '_', self.name)) <NEW_LINE> <DEDENT> self.active = True <NEW_LINE> self.disabled...
Class that represents a project.
62599031711fe17d825e14f3
class KeyDoesNotExistError(Exception): <NEW_LINE> <INDENT> pass
Simple custom error
6259903191af0d3eaad3aede
class TestReleaseResources(TransactionTestCase): <NEW_LINE> <INDENT> fixtures = ['resource_ut.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> _, token_object = request(client=self.client, path="tests/get_token", method="get") <NEW_LINE> self.token = token_object.token <NEW_LINE>...
Assert operations of release resources request.
6259903196565a6dacd2d7e7
class CharityCollectionForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = CharityCollection <NEW_LINE> fields = ['purpose', 'items_needed', 'address', 'deadline'] <NEW_LINE> widgets = { 'deadline': forms.DateInput( attrs={'placeholder': 'Termin końcowy'}), 'purpose': forms.Textarea(attrs={'pla...
New charity collection form.
6259903130c21e258be998be
class StockFdmtKpiItem(scrapy.Item): <NEW_LINE> <INDENT> date = scrapy.Field() <NEW_LINE> code = scrapy.Field() <NEW_LINE> current_assets = scrapy.Field() <NEW_LINE> total_fixed_assets = scrapy.Field() <NEW_LINE> total_assets = scrapy.Field() <NEW_LINE> current_liabilities = scrapy.Field() <NEW_LINE> non_current_liabil...
The fundamental KPIs of a stock. They change on quarterly.
6259903130c21e258be998bf
class WordAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> Model = None <NEW_LINE> list_display = [ 'id', 'active', stats_field('num_funny_votes', 'NFV'), stats_field('percent_funny_votes', '%FV'), 'text' ] <NEW_LINE> list_editable = ['text'] <NEW_LINE> list_filter = ('active', 'tags') <NEW_LINE> list_per_page = 1000 <NEW_...
Abstract base word admin class.
6259903123e79379d538d5bd
class AudioReader(object): <NEW_LINE> <INDENT> def __init__(self, audio_dir, sample_rate, batch_size, num_mini_batches, mini_batch_size, window_size): <NEW_LINE> <INDENT> self.audio_dir = audio_dir <NEW_LINE> self.sample_rate = sample_rate <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.num_mini_batches = num_m...
Randomly load files from a directory and load samples into a batch. Note that all the files are assumed to be at least 48 minutes and 16000 sample rate.
625990318c3a8732951f760b
class StartSignalledError(Exception): <NEW_LINE> <INDENT> pass
User's start method threw an exception
62599031c432627299fa40a9
class ModifierCell(BaseRNNCell): <NEW_LINE> <INDENT> def __init__(self, base_cell): <NEW_LINE> <INDENT> super(ModifierCell, self).__init__() <NEW_LINE> base_cell._modified = True <NEW_LINE> self.base_cell = base_cell <NEW_LINE> <DEDENT> @property <NEW_LINE> def params(self): <NEW_LINE> <INDENT> self._own_params = False...
Base class for modifier cells. A modifier cell takes a base cell, apply modifications on it (e.g. Dropout), and returns a new cell. After applying modifiers the base cell should no longer be called directly. The modifer cell should be used instead.
6259903150485f2cf55dc031
class LoginView(MethodView): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> data = json.loads(request.data.decode()) <NEW_LINE> user = AdminUser.query.filter_by(email=data['email']).first() <NEW_LINE> if user and user.password_is_valid(data['password']): <NEW_LINE> <INDENT> access_toke...
This class-based view handles user login and access token generation.
625990311f5feb6acb163ca4
class CardDataIterator(): <NEW_LINE> <INDENT> def __init__(self, cards): <NEW_LINE> <INDENT> self.cards = cards <NEW_LINE> self.size = len(self.cards) <NEW_LINE> self.epochs = 0 <NEW_LINE> self.shuffle() <NEW_LINE> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> self.df = self.df.sample(frac=1).reset_index(drop=True) <...
This is the iterator we use to assemble cards into batches for training.
625990315e10d32532ce415d
class APIInfo(NamedTuple): <NEW_LINE> <INDENT> method: Callable <NEW_LINE> parameters: Set[str]
Parameter information about an API.
6259903196565a6dacd2d7e8
class EarlyStopping(Callback): <NEW_LINE> <INDENT> def __init__(self, monitor='acc', batch_period=2000, patience=2, min_delta=0.0002): <NEW_LINE> <INDENT> self.monitor = monitor <NEW_LINE> self.batch_period = batch_period <NEW_LINE> self.batch = 0 <NEW_LINE> self.patience = patience <NEW_LINE> self.wait = 0 <NEW_LINE> ...
Monitor val_acc, save model if it increases, early stop if it stops improving. Works on batch end, executed periodically after a certain number of training steps. Args: val_sequence (Sequence object): validation sequence. batch_period (int): monitor metric every number of batches. patience (int): number o...
6259903173bcbd0ca4bcb346
@attr.dataclass <NEW_LINE> class AuthExternalConfig: <NEW_LINE> <INDENT> tls_client_cert: str = attr.ib(validator=attr.validators.instance_of(str), default="./none")
External authentication configuration
6259903126238365f5fadc06
class RTmixclust(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/TMixClust/" <NEW_LINE> git = "https://git.bioconductor.org/packages/TMixClust.git" <NEW_LINE> version('1.0.1', commit='0ac800210e3eb9da911767a80fb5582ab33c0cad') <NEW_LINE> depends_on('r-gss', type=('build', 'run')) <NEW_...
Implementation of a clustering method for time series gene expression data based on mixed-effects models with Gaussian variables and non-parametric cubic splines estimation. The method can robustly account for the high levels of noise present in typical gene expression time series datasets.
6259903130c21e258be998c0
class A(Segment): <NEW_LINE> <INDENT> def __init__(self, dist: int): <NEW_LINE> <INDENT> super().__init__(dist)
This class itself is an instance of the metaclass Road. This class also has instances, each of which is a Segment. Similarly for the B and C classes.
6259903130c21e258be998c1
class FalseDateMatcher(object): <NEW_LINE> <INDENT> name = 'false_date' <NEW_LINE> regex_pat = re.compile(r"^([4-9][\d]|3[2-9]|(([0-9]{1,3},)*[0-9]{3}([.][0-9])?))$") <NEW_LINE> def __init__(self, nlp, pattern_list, match_id='FALSE_DATE', label='FALSE_DATE', regex_pat=regex_pat): <NEW_LINE> <INDENT> self.label = nlp.vo...
A spaCy pipeline component to flag arabic numbers if they include commas or are greater than 31. Its main use is to mitigate spaCy NER false positives.
62599031796e427e5384f831
class PlainEntry(_BaseEntry): <NEW_LINE> <INDENT> implements(IKnownHostEntry) <NEW_LINE> def __init__(self, hostnames, keyType, publicKey, comment): <NEW_LINE> <INDENT> self._hostnames = hostnames <NEW_LINE> super(PlainEntry, self).__init__(keyType, publicKey, comment) <NEW_LINE> <DEDENT> def fromString(cls, string): <...
A L{PlainEntry} is a representation of a plain-text entry in a known_hosts file. @ivar _hostnames: the list of all host-names associated with this entry. @type _hostnames: L{list} of L{str}
6259903191af0d3eaad3aee2
class MembershipAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ["id", "user", "group", "created", "active", ] <NEW_LINE> list_filter = ["group", ] <NEW_LINE> date_hierarchy = "created" <NEW_LINE> readonly_fields = ["created", ] <NEW_LINE> list_editable = ["active", ] <NEW_LINE> fieldsets = ( [None, {"field...
Customize Membership model for admin area.
6259903150485f2cf55dc033
class ArticleUpDown(models.Model): <NEW_LINE> <INDENT> nid = models.AutoField(primary_key=True) <NEW_LINE> user = models.ForeignKey('UserInfo', null=True) <NEW_LINE> article = models.ForeignKey("Article", null=True) <NEW_LINE> UporDown=models.BooleanField(verbose_name='是否赞',default=False) <NEW_LINE> def __str__(self): ...
文章点赞表
62599031d164cc6175822028
class LieAlgebraWithGenerators(LieAlgebra): <NEW_LINE> <INDENT> def __init__(self, R, names=None, index_set=None, category=None, prefix='L', **kwds): <NEW_LINE> <INDENT> self._indices = index_set <NEW_LINE> LieAlgebra.__init__(self, R, names, category) <NEW_LINE> <DEDENT> @cached_method <NEW_LINE> def lie_algebra_gener...
A Lie algebra with distinguished generators.
625990318e05c05ec3f6f6b6
class SkillBonus(models.Model): <NEW_LINE> <INDENT> skill = models.ForeignKey(Skill) <NEW_LINE> bonusType = models.CharField(max_length=254) <NEW_LINE> bonusValue = models.FloatField()
bonus values of skills (per skilllevel)
625990315e10d32532ce415e
class MedicationKnowledgeMonitoringProgram(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = "MedicationKnowledgeMonitoringProgram" <NEW_LINE> def __init__(self, jsondict=None, strict=True, **kwargs): <NEW_LINE> <INDENT> self.name = None <NEW_LINE> self.type = None <NEW_LINE> super(MedicationKnowled...
Program under which a medication is reviewed. The program under which the medication is reviewed.
625990318a349b6b436872f3
class InfoListView(ListView): <NEW_LINE> <INDENT> model = BasicInfo <NEW_LINE> @method_decorator(csrf_exempt) <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return super().dispatch(request, *args, **kwargs) <NEW_LINE> <DEDENT> def get(self, request): <NEW_LINE> <INDENT> queryset = self.get...
View for testing GET method
62599031287bf620b6272c9e
class RoleForm(FlaskForm): <NEW_LINE> <INDENT> name = StringField('Name', validators=[DataRequired()]) <NEW_LINE> description = StringField('Description', validators=[DataRequired()]) <NEW_LINE> submit = SubmitField('Submit')
Form to add or edit role
6259903130c21e258be998c3
class LossComputeBase(nn.Module): <NEW_LINE> <INDENT> def __init__(self,model,tgt_dict): <NEW_LINE> <INDENT> super(LossComputeBase,self).__init__() <NEW_LINE> self.model = model <NEW_LINE> self.tgt_dict = tgt_dict <NEW_LINE> self.padding_idx = Constant.PAD <NEW_LINE> <DEDENT> def _make_shard_state(self, batch, output, ...
Class for managing efficient loss computation. Handles sharding next step predictions and accumulating mutiple loss computations Users can implement their own loss computation strategy by making subclass of this one. Users need to implement the _compute_loss() and make_shard_state() methods. Args: generator (:o...
625990311d351010ab8f4bce
class R_2_instances_name_replace_disks(baserlib.OpcodeResource): <NEW_LINE> <INDENT> POST_OPCODE = opcodes.OpInstanceReplaceDisks <NEW_LINE> def GetPostOpInput(self): <NEW_LINE> <INDENT> static = { "instance_name": self.items[0], } <NEW_LINE> if self.request_body: <NEW_LINE> <INDENT> data = self.request_body <NEW_LINE>...
/2/instances/[instance_name]/replace-disks resource.
62599031d4950a0f3b111699
class City(PlaceRecord): <NEW_LINE> <INDENT> _valid_attributes = set(['confidence', 'geoname_id', 'names'])
Contains data for the city record associated with an IP address This class contains the city-level data associated with an IP address. This record is returned by ``city`` and ``insights``. Attributes: .. attribute:: confidence A value from 0-100 indicating MaxMind's confidence that the city is correct. This at...
625990319b70327d1c57fe3b
class Operation(object): <NEW_LINE> <INDENT> def __init__(self, uri, operation, http_client): <NEW_LINE> <INDENT> self.uri = uri <NEW_LINE> self.json = operation <NEW_LINE> self.http_client = http_client <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(%s)" % (self.__class__.__name__, self.json['n...
Operation object.
625990313eb6a72ae038b71c
class Dni(Model): <NEW_LINE> <INDENT> def __init__(self, dni: int=None, nombre: str=None, apellidos: str=None, asignatura: str=None, plazos: int=None): <NEW_LINE> <INDENT> self.swagger_types = { 'dni': int, 'nombre': str, 'apellidos': str, 'asignatura': str, 'plazos': int } <NEW_LINE> self.attribute_map = { 'dni': 'dni...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599031e76e3b2f99fd9ac3
class TestDocxTemplateApplicationRequest(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 testDocxTemplateApplicationRequest(self): <NEW_LINE> <INDENT> pass
DocxTemplateApplicationRequest unit test stubs
62599031ac7a0e7691f7359f
class QuickInsertActions(actioncollection.ShortcutCollection): <NEW_LINE> <INDENT> name = "quickinsert" <NEW_LINE> def __init__(self, panel): <NEW_LINE> <INDENT> super(QuickInsertActions, self).__init__(panel.mainwindow()) <NEW_LINE> self.panel = weakref.ref(panel) <NEW_LINE> <DEDENT> def createDefaultShortcuts(self): ...
Manages keyboard shortcuts for the QuickInsert module.
62599031c432627299fa40ad
class WebSocketProtocol: <NEW_LINE> <INDENT> def __init__(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter, server: "WebSocketServer"): <NEW_LINE> <INDENT> self.reader = reader <NEW_LINE> self.writer = writer <NEW_LINE> self.server = server <NEW_LINE> self.status = Status.OPEN <NEW_LINE> <DEDENT> async ...
The protocol that manages the WebSocket. Defaults to operating as a server.
625990318c3a8732951f7610
class MouseEventFlag: <NEW_LINE> <INDENT> Move = 0x0001 <NEW_LINE> LeftDown = 0x0002 <NEW_LINE> LeftUp = 0x0004 <NEW_LINE> RightDown = 0x0008 <NEW_LINE> RightUp = 0x0010 <NEW_LINE> MiddleDown = 0x0020 <NEW_LINE> MiddleUp = 0x0040 <NEW_LINE> XDown = 0x0080 <NEW_LINE> XUp = 0x0100 <NEW_LINE> Wheel = 0x0800 <NEW_LINE> HWh...
MouseEventFlag from Win32.
6259903130c21e258be998c5
class GameObject: <NEW_LINE> <INDENT> pass
d
62599031e76e3b2f99fd9ac5
class VisitViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Visit.objects.all() <NEW_LINE> serializer_class = srz.VisitSerializer <NEW_LINE> http_method_names = ['get', 'put', 'patch', 'delete'] <NEW_LINE> permission_classes = (IsOwnerOrReadOnly,)
Endpoints for a visit ('visits')
625990314e696a045264e67e
class Post(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User') <NEW_LINE> title = models.CharField(max_length=200) <NEW_LINE> text = models.TextField(); <NEW_LINE> created_at = models.DateTimeField(default=timezone.now) <NEW_LINE> published_at = models.DateTimeField(blank=True, null=True) <NEW_LI...
Post Model
62599031b57a9660fecd2b3d
class ModifyAddressesBandwidthRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.EcmRegion = None <NEW_LINE> self.AddressIds = None <NEW_LINE> self.InternetMaxBandwidthOut = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.EcmRegion = params.get("Ec...
ModifyAddressesBandwidth请求参数结构体
6259903121bff66bcd723d1e
class AutoMLDeleteDatasetOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ("dataset_id", "location", "project_id") <NEW_LINE> @apply_defaults <NEW_LINE> def __init__( self, dataset_id: Union[str, List[str]], location: str, project_id: Optional[str] = None, metadata: Optional[MetaData] = None, timeout: Opti...
Deletes a dataset and all of its contents. .. seealso:: For more information on how to use this operator, take a look at the guide: :ref:`howto/operator:AutoMLDeleteDatasetOperator` :param dataset_id: Name of the dataset_id, list of dataset_id or string of dataset_id coma separated to be deleted. :type da...
6259903156b00c62f0fb397b
class Encoder(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _encode(self, message): <NEW_LINE> <INDENT> description = self._create_information(message) <NEW_LINE> message = '' <NEW_LINE> message += self.build_header(description) <NEW_LINE> message += self.bulid_field...
Base class for a serializer object
6259903150485f2cf55dc037
class InvalidRequestError(Error): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.code = 'INVALID_REQUEST' <NEW_LINE> self.msg = msg
Not all of the required parameters are present.
62599031be8e80087fbc0137
class ModifyDomainLockResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.LockInfo = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("LockInfo") is not None: <NEW_LINE> <INDENT> self.LockInfo = LockInfo() <...
ModifyDomainLock返回参数结构体
6259903173bcbd0ca4bcb34c
class PDFTextbookTabs(TextbookTabsBase): <NEW_LINE> <INDENT> type = 'pdf_textbooks' <NEW_LINE> icon = 'icon-book' <NEW_LINE> def __init__(self, tab_dict=None): <NEW_LINE> <INDENT> super(PDFTextbookTabs, self).__init__( tab_id=self.type, ) <NEW_LINE> <DEDENT> def items(self, course): <NEW_LINE> <INDENT> for index, textb...
A tab representing the collection of all PDF textbook tabs.
62599031a8ecb033258722d7
class F3(FeatureExtractor): <NEW_LINE> <INDENT> def run(self, series): <NEW_LINE> <INDENT> return round(np.mean(np.abs(series)), 2)
对于有限长度信号序列时域幅值,先求绝对值,再求均值
625990311d351010ab8f4bd3
class PatternSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.patterns = [] <NEW_LINE> self._all_files = False <NEW_LINE> <DEDENT> def _compute_all_files(self): <NEW_LINE> <INDENT> self._all_files = any(pat.all_files() for pat in self.patterns) <NEW_LINE> <DEDENT> def all_files(self): <NE...
A set of :class:`Pattern` instances; :class:`PatternSet` provides a number of operations over the entire set. :class:`PatternSet` contains a number of implementation optimizations and is an integral part of various optimizations in :class:`FileSet`. This class is *not* an implementation of Apache Ant PatternSet
6259903123e79379d538d5c5
class PackageReferenceBase(Model): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'id': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, } <NEW_LINE> _subtype_map = { 'type': {'a...
A reference to a package to be installed on the compute nodes using a package manager. :param str id: The name of the package. :param str version: The version of the package to be installed. If omitted, the latest version (according to the package repository) will be installed.
6259903196565a6dacd2d7eb
class NudgeButton(GLBackground): <NEW_LINE> <INDENT> is_gl_container = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> GLBackground.__init__(self) <NEW_LINE> nudgeLabel = Label("Nudge", margin=8) <NEW_LINE> self.add(nudgeLabel) <NEW_LINE> self.shrink_wrap() <NEW_LINE> keys = [config.config.get("Keys", k).upper(...
A button that captures movement keys while pressed and sends them to a listener as nudge events. Poorly planned.
625990315166f23b2e244492
class LookupInterface(resource.TrackableResource): <NEW_LINE> <INDENT> def __init__(self, key_dtype, value_dtype): <NEW_LINE> <INDENT> self._key_dtype = dtypes.as_dtype(key_dtype) <NEW_LINE> self._value_dtype = dtypes.as_dtype(value_dtype) <NEW_LINE> super(LookupInterface, self).__init__() <NEW_LINE> <DEDENT> def _crea...
Represent a lookup table that persists across different steps.
62599031d99f1b3c44d0675f
class BoolSerialiser(Serialiser[bool]): <NEW_LINE> <INDENT> def __init__(self, true_byte: bytes = b'\x01', false_byte: bytes = b'\x00'): <NEW_LINE> <INDENT> if len(true_byte) != 1 or len(false_byte) != 1: <NEW_LINE> <INDENT> raise ValueError(f"true_byte and false_byte must be single-byte values") <NEW_LINE> <DEDENT> if...
Serialiser which serialises a boolean value to a single byte, with 0x00 representing False and 0x01 representing True.
62599031d164cc617582202d
class Account(object): <NEW_LINE> <INDENT> address = None <NEW_LINE> aliases = [] <NEW_LINE> realname = None <NEW_LINE> gpg_key = None <NEW_LINE> signature = None <NEW_LINE> signature_filename = None <NEW_LINE> signature_as_attachment = None <NEW_LINE> abook = None <NEW_LINE> def __init__(self, address=None, aliases=No...
Datastructure that represents an email account. It manages this account's settings, can send and store mails to maildirs (drafts/send). .. note:: This is an abstract class that leaves :meth:`send_mail` unspecified. See :class:`SendmailAccount` for a subclass that uses a sendmail command to send out mails.
625990318c3a8732951f7614
class Answer(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(Respondent, verbose_name="Пользователь", on_delete=models.CASCADE) <NEW_LINE> quiz = models.ForeignKey(Quiz, verbose_name="Опрос", on_delete=models.CASCADE, related_name='quiz_answer') <NEW_LINE> question = models.ForeignKey(Question, verbose_name...
Класс ответов на вопросы
6259903173bcbd0ca4bcb34e
class RunAutomationServiceEnabled(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Enabled = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Enabled = params.get("Enabled") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(se...
描述了 “云自动化助手” 服务相关的信息
6259903166673b3332c314ae
class ProductsPropertiesRelation(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey(Product, verbose_name=_(u"Product"), related_name="productsproperties") <NEW_LINE> property = models.ForeignKey(Property, verbose_name=_(u"Property")) <NEW_LINE> position = models.IntegerField( _(u"Position"), default=999) <...
Represents the m:n relationship between Products and Properties. This is done via an explicit class to store the position of the property within the product. Attributes: - product The product of the relationship. - property The property of the relationship. - position The position of the...
62599031d4950a0f3b11169c
class UserListResponse(object): <NEW_LINE> <INDENT> TYPE = 0x04 <NEW_LINE> PSEUDOHEADER_FORMAT_REP = '>BB8sBBBBH' <NEW_LINE> PSEUDOHEADER_SIZE_REP = struct.calcsize(PSEUDOHEADER_FORMAT_REP) <NEW_LINE> def __init__(self, dictdata=None, rawdata=None): <NEW_LINE> <INDENT> if dictdata: <NEW_LINE> <INDENT> self.user_list = ...
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type |R|S|A| Source ID | Group ID | Header Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
625990311d351010ab8f4bd5
class Tessellation(object): <NEW_LINE> <INDENT> def __init__(self,*args,**kwarg): <NEW_LINE> <INDENT> raise Exception("An abstract class") <NEW_LINE> <DEDENT> def create_verts_and_H(self,dim_range, valid_outside ): <NEW_LINE> <INDENT> if self.type == 'I': <NEW_LINE> <INDENT> return self.create_verts_and_H_type_I(dim_ra...
An abstract class
625990319b70327d1c57fe41
class EvolutionCandy(Item): <NEW_LINE> <INDENT> def __init__(self, name, description, coin_cost): <NEW_LINE> <INDENT> Item.__init__(self, name, description, coin_cost)
This class contains attributes of a candy to evolve a legendary creature.
6259903163f4b57ef00865d1
class MessageViewSet(SenyViewSet): <NEW_LINE> <INDENT> queryset = Message.objects.all() <NEW_LINE> permission_classes = [SenyAuth, MessagePermissions] <NEW_LINE> serializer_class = MessageSerializer <NEW_LINE> filterable_by = ['new', ['destination', 'username'], ['source', 'username']] <NEW_LINE> filter_backends = (fil...
## Filterable by: ## + new - 1 for true 0 for false + source/destination - username + search - checks if title, content, source, destination contain given query string ## Special Endpoints ## ### new ### /api/version/messages/new Creates a new thread and message at same time. ### User ### /api/version/mess...
62599031796e427e5384f839
class MaintenanceModeMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> namespace = htk_setting('HTK_URLS_NAMESPACE') <NEW_LINE> url_name_suffix = htk_setting('HTK_MAINTENANCE_MODE_URL_NAME') <NEW_LINE> if namespace: <NEW_LINE> <INDENT> url_name = '%s:%s' % (namespa...
Checks whether HTK_MAINTENANCE_MODE is set If so, redirects to the HTK_MAINTENANCE_MODE_URL_NAME page
6259903130c21e258be998ca
class FilesystemEventHandler(watchdog.events.FileSystemEventHandler): <NEW_LINE> <INDENT> def on_created(self, event): <NEW_LINE> <INDENT> key = 'filesystem:file_created' <NEW_LINE> data = { 'filepath': event.src_path, 'is_directory': event.is_directory, 'dirpath': os.path.dirname(event.src_path) } <NEW_LINE> bmsg = Br...
Subclass of `watchdog.events.FilesystemEventHandler` Manages on_created, on_deleted, on_moved events
62599031b830903b9686ecd9
class Meta: <NEW_LINE> <INDENT> managed = False <NEW_LINE> db_table = 'courts'
Django Meta class.
62599031287bf620b6272ca6
class VBackKey(VKey): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> VKey.__init__(self, u'\u21a9') <NEW_LINE> <DEDENT> def update_buffer(self, buffer): <NEW_LINE> <INDENT> return buffer[:-1]
Custom key for back.
6259903126068e7796d4da09
class TotalEnergy: <NEW_LINE> <INDENT> def __init__(self, core_hamiltonian): <NEW_LINE> <INDENT> self.core_hamiltonian = core_hamiltonian <NEW_LINE> <DEDENT> def restricted(self, density_matrix, hamiltonian): <NEW_LINE> <INDENT> length = density_matrix.shape[0] <NEW_LINE> total_energy = 0 <NEW_LINE> for i, j in itertoo...
Calculates the total energy for hartree fock methods. Attributes ---------- core_hamiltonian : np.matrix
62599031a8ecb033258722db
class DataSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Data <NEW_LINE> fields = ['pk', 'value', 'display']
Element Extra data CRUD serializer
62599031d4950a0f3b11169d
class DriverSchedule(BaseModel): <NEW_LINE> <INDENT> driver = ForeignKeyField(Driver) <NEW_LINE> schedule = ForeignKeyField(Schedule, backref='driver_schedules') <NEW_LINE> power_on = BooleanField(null=True, default=None)
Many-to-many relationship between drivers and schedules peewee docs: https://goo.gl/8SB4iY
6259903163f4b57ef00865d2
@context.configure(name="oslomsg", order=1000) <NEW_LINE> class OsloMsgContext(context.Context): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(OsloMsgContext, self).__init__(*args, **kwargs) <NEW_LINE> self.server_processes = [] <NEW_LINE> self.messages_received = multiprocessing.Qu...
Oslo messaging default context Cerate tranport and target; Set up servers
6259903115baa72349463058
class PhaseSplitter(AbstractStringSplitter): <NEW_LINE> <INDENT> def __init__(self, string): <NEW_LINE> <INDENT> self._season_index = None <NEW_LINE> self._year_index = None <NEW_LINE> self._phase_type_index = None <NEW_LINE> super(PhaseSplitter, self).__init__(string, 3) <NEW_LINE> <DEDENT> @property <NEW_LINE> def se...
Splits a phase into its components
6259903121bff66bcd723d24
class SAMLConfigurationFactory(DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = SAMLConfiguration <NEW_LINE> <DEDENT> site = SubFactory(SiteFactory) <NEW_LINE> enabled = True
Factory or SAMLConfiguration model in third_party_auth app.
6259903130c21e258be998cc
class XTSProfile(TestProfile): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> XTSTest.RESULTS_PATH = self.results_dir <NEW_LINE> try: <NEW_LINE> <INDENT> os.mkdir(os.path.join(self.results_dir, 'images')) <NEW_LINE> <DEDENT> except OSError as e: <NEW_LINE> <INDENT> if e.errno != 17: <NEW_LINE> <INDENT> raise
A subclass of TestProfile that provides a setup hook for XTS
625990318c3a8732951f7618