code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class token_case_in_range_bounded_by_tokens(rules.token_case): <NEW_LINE> <INDENT> def __init__(self, name, identifier, lTokens, oStart, oEnd): <NEW_LINE> <INDENT> rules.token_case.__init__(self, name=name, identifier=identifier, lTokens=lTokens) <NEW_LINE> self.oStart = oStart <NEW_LINE> self.oEnd = oEnd <NEW_LINE> <D... | Checks the case for words.
Parameters
----------
name : string
The group the rule belongs to.
identifier : string
unique identifier. Usually in the form of 00N.
lTokens : list of token types
oStart : token type
oEnd : token type | 62598fa0a79ad16197769e93 |
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = _(messages.PLURAL_SCAN_TASKS_MSG) | Metadata for model. | 62598fa0a8370b77170f0213 |
class UnderscoreToPascalCaseTest(unittest2.TestCase): <NEW_LINE> <INDENT> def testEmpty(self): <NEW_LINE> <INDENT> self.assertEqual( util.underscore_to_pascalcase(None), None) <NEW_LINE> self.assertEqual( util.underscore_to_pascalcase(''), '') <NEW_LINE> <DEDENT> def testUnderscores(self): <NEW_LINE> <INDENT> self.asse... | Behavioral tests of the underscore_to_pascalcase method. | 62598fa08e7ae83300ee8ecf |
class EntryDemo(Frame): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Frame.__init__(self) <NEW_LINE> self.pack(expand="yes", fill="both") <NEW_LINE> self.master.title("Testing entry component") <NEW_LINE> self.master.geometry("350x100") <NEW_LINE> self.frame1 = Frame(self) <NEW_LINE> self.frame1.pack(pad... | Demonstrate Entrys and Event binding | 62598fa0fbf16365ca793ee9 |
class SecondaryColorAttribute(AbstractAttribute): <NEW_LINE> <INDENT> plural = 'secondary_colors' <NEW_LINE> _fixed_count = 3 <NEW_LINE> def __init__(self, gl_type): <NEW_LINE> <INDENT> super().__init__(3, gl_type) <NEW_LINE> <DEDENT> def enable(self): <NEW_LINE> <INDENT> glEnableClientState(GL_SECONDARY_COLOR_ARRAY) <... | Secondary color attribute. | 62598fa03eb6a72ae038a472 |
class RoleDefinerTests(IdentityRequest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.public_tenant = Tenant.objects.get(tenant_name="public") <NEW_LINE> <DEDENT> def test_role_create(self): <NEW_LINE> <INDENT> self.try_seed_roles() <NEW_LINE> roles = Role.objects.filter(plat... | Test the role definer functions. | 62598fa0097d151d1a2c0e58 |
class HomeView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> photo_list = Photo.objects.filter(visibility=VISIBILITY_PUBLIC).order_by("-created_at")[:3] <NEW_LINE> context = { "photos": photo_list } <NEW_LINE> return render(request, "main.html", context) | Pagina de inicio | 62598fa0d7e4931a7ef3bec8 |
class RunProjectsLocationsDomainmappingsListRequest(_messages.Message): <NEW_LINE> <INDENT> continue_ = _messages.StringField(1) <NEW_LINE> fieldSelector = _messages.StringField(2) <NEW_LINE> includeUninitialized = _messages.BooleanField(3) <NEW_LINE> labelSelector = _messages.StringField(4) <NEW_LINE> limit = _message... | A RunProjectsLocationsDomainmappingsListRequest object.
Fields:
continue_: Optional encoded string to continue paging.
fieldSelector: Allows to filter resources based on a specific value for a
field name. Send this in a query string format. i.e.
'metadata.name%3Dlorem'. Not currently used by Cloud Run.
i... | 62598fa0097d151d1a2c0e59 |
class HypervisorSshAttachAction(AttachAction): <NEW_LINE> <INDENT> baseclass() <NEW_LINE> @db.ro_transact <NEW_LINE> def _do_connection(self, size): <NEW_LINE> <INDENT> self.write("Attaching to %s. Use ^] to force exit.\n" % self.name) <NEW_LINE> phy = self.context.__parent__.__parent__.__parent__.__parent__ <NEW_LINE>... | For consoles that are attached by running a command on the hypervisor host. | 62598fa091af0d3eaad39c3b |
class RangeSelectionsOverlay(RangeSelectionOverlay): <NEW_LINE> <INDENT> def _get_selection_screencoords(self): <NEW_LINE> <INDENT> ds = getattr(self.plot, self.axis) <NEW_LINE> selection = ds.metadata[self.metadata_name] <NEW_LINE> if selection is None or len(selection) == 1: <NEW_LINE> <INDENT> return [] <NEW_LINE> <... | Highlights the selected regions on a component.
Looks at a given metadata field of self.component for regions to draw as
selected. Re-implements the __get_selection_screencoords() method for a faster,
more efficient regions selection. | 62598fa04527f215b58e9d13 |
class PlottableData2D(Plottable): <NEW_LINE> <INDENT> def __init__(self, image=None, qx_data=None, qy_data=None, err_image=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None): <NEW_LINE> <INDENT> Plottable.__init__(self) <NEW_LINE> self.name = "Data2D" <NEW_LINE> self.label = None <NEW_LINE> self.da... | 2D data class for image plotting | 62598fa05f7d997b871f92f7 |
class Input(_io): <NEW_LINE> <INDENT> dir='in' <NEW_LINE> def __init__(self, **cfg): <NEW_LINE> <INDENT> super().__init__(**cfg) <NEW_LINE> self.on_data_reply = cfg.get('on', self.on_data) <NEW_LINE> self.off_data_reply = cfg.get('off', self.off_data) <NEW_LINE> <DEDENT> async def run(self, amqp, chip, started: anyio.a... | Represesent an Input pin: react whenever a specific AMQP message arrives. | 62598fa056ac1b37e630201a |
class PredictPurchaseInputSchema(Schema): <NEW_LINE> <INDENT> age = fields.Int(required = True) <NEW_LINE> salary = fields.Int(required = True) | Parameters:
- age (int)
- salary (int) | 62598fa0498bea3a75a57951 |
class WallAnt(Ant): <NEW_LINE> <INDENT> name = "Wall" <NEW_LINE> implemented = True <NEW_LINE> food_cost = 4 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Ant.__init__(self, 4) | The WallAnt sits there and blocks things using its large armor value. | 62598fa056ac1b37e630201b |
class AzureResourceReference(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'source_arm_resource_id': {'required': True}, } <NEW_LINE> _attribute_map = { 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(Azur... | Defines reference to an Azure resource.
All required parameters must be populated in order to send to Azure.
:param source_arm_resource_id: Required. Gets the ARM resource ID of the tracked resource being
referenced.
:type source_arm_resource_id: str | 62598fa0b7558d589546345d |
class Blog(BloggerEntry): <NEW_LINE> <INDENT> pass | Represents a blog which belongs to the user. | 62598fa0435de62698e9bc23 |
class TaskAddCollectionParameter(Model): <NEW_LINE> <INDENT> _validation = { 'value': {'required': True, 'max_items': 100}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[TaskAddParameter]'}, } <NEW_LINE> def __init__(self, value): <NEW_LINE> <INDENT> super(TaskAddCollectionParameter, self).__init_... | A collection of Azure Batch tasks to add.
:param value: The collection of tasks to add. The total serialized size of
this collection must be less than 4MB. If it is greater than 4MB (for
example if each task has 100's of resource files or environment
variables), the request will fail with code 'RequestBodyTooLarge'... | 62598fa02ae34c7f260aaf10 |
class DEEP(Market): <NEW_LINE> <INDENT> @property <NEW_LINE> def url(self): <NEW_LINE> <INDENT> return "deep" <NEW_LINE> <DEDENT> def _convert_output(self, out): <NEW_LINE> <INDENT> return out <NEW_LINE> <DEDENT> @property <NEW_LINE> def symbol_required(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> @proper... | Class to retrieve DEEP order book data
Real-time depth of book quotations direct from IEX. Returns aggregated
size of resting displayed orders at a price and side. Does not indicate
the size or number of individual orders at any price level. Non-displayed
orders and non-displayed portions of reserve orders are not co... | 62598fa01b99ca400228f446 |
class MemoryStorage(object): <NEW_LINE> <INDENT> __slots__ = ('_memory', '_lock') <NEW_LINE> def __init__(self, *, m_process=False): <NEW_LINE> <INDENT> super(MemoryStorage, self).__init__() <NEW_LINE> self._memory = dict() <NEW_LINE> self._lock = threading.Lock() if not m_process else multiprocessing.Lock() <NEW_LINE>... | Store key-value pairs just in memory. | 62598fa08e71fb1e983bb8e7 |
class IGalleryRight(interface.Interface): <NEW_LINE> <INDENT> pass | Marker interface for the gallery right viewlet
| 62598fa07d43ff248742731a |
class DocumentIdentifierResolver(utopia.citation.Resolver): <NEW_LINE> <INDENT> def _unidentifiedDocumentRef(self, document): <NEW_LINE> <INDENT> evidence = [kend.model.Evidence(type='fingerprint', data=f, srctype='document') for f in document.fingerprints()] <NEW_LINE> return kend.model.DocumentReference(evidence=evid... | Resolve a Utopia URI for this document. | 62598fa021a7993f00c65db4 |
class Donation(BaseModel): <NEW_LINE> <INDENT> gift_id = UUIDField(primary_key=True) <NEW_LINE> gift_num = SmallIntegerField() <NEW_LINE> value = FloatField() <NEW_LINE> donated_by = ForeignKeyField(Donor, null=False) | Schema definition | 62598fa0e5267d203ee6b73e |
class TestValidators(STCAdminTest): <NEW_LINE> <INDENT> def test_alphanumeric(self): <NEW_LINE> <INDENT> Validators.alphanumeric("a") <NEW_LINE> Validators.alphanumeric("1") <NEW_LINE> Validators.alphanumeric(" ") <NEW_LINE> with self.assertRaises(ValidationError): <NEW_LINE> <INDENT> Validators.alphanumeric("!") <NEW_... | Tests for Product Editor form validators. | 62598fa0ac7a0e7691f7233c |
class VaultRecord(models.Model): <NEW_LINE> <INDENT> vault = models.ForeignKey(Vault, related_name='records') <NEW_LINE> year = models.IntegerField(default=0) <NEW_LINE> month = models.IntegerField(default=0) <NEW_LINE> count = models.IntegerField(default=0) <NEW_LINE> @staticmethod <NEW_LINE> def update(vault, co... | Records a counter against a pages scraped. This could be extended to also log
API calls should that be necessary/ | 62598fa0d6c5a102081e1f77 |
class ComponentViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.Component.objects.all() <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,) <NEW_LINE> serializer_class = serializers.ComponentSerializer | API view for Component. | 62598fa03eb6a72ae038a474 |
class _Expr(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, backend): <NEW_LINE> <INDENT> self.backend = backend <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def Evaluate(self, obj): <NEW_LINE> <INDENT> pass | Expression base class. | 62598fa00a50d4780f70520b |
@registry.register_symbol_modality("ctc") <NEW_LINE> class CTCSymbolModality(SymbolModality): <NEW_LINE> <INDENT> def loss(self, logits, targets): <NEW_LINE> <INDENT> with tf.name_scope("ctc_loss", values=[logits, targets]): <NEW_LINE> <INDENT> targets_shape = targets.get_shape().as_list() <NEW_LINE> assert len(targets... | SymbolModality that uses CTC loss. | 62598fa067a9b606de545dfb |
class SensorParameter(Concept): <NEW_LINE> <INDENT> class Meta : <NEW_LINE> <INDENT> verbose_name="Sensed Parameter" <NEW_LINE> verbose_name_plural="Sensed Parameters" | A sensor parameter is measured by a sensor type.
This may be referenced by either an "observation procedure" or an "observed property". Parameters may be organised into generalisation hierarchies. Uses unadorned SKOS model, but may be extended later, for example to define UoM, precision etc. | 62598fa057b8e32f52508035 |
class FBCameraViewPlaneMode (object): <NEW_LINE> <INDENT> kFBViewPlaneDisabled=property(doc="Camera plane disabled. ") <NEW_LINE> kFBViewPlaneAlways=property(doc="Always draw camera plane. ") <NEW_LINE> kFBViewPlaneWhenMedia=property(doc="Camera plane when media. ") <NEW_LINE> pass | Camera plane viewing modes.
| 62598fa05f7d997b871f92f8 |
class ResolweAPI(slumber.API): <NEW_LINE> <INDENT> resource_class = ResolweResource | Use custom ResolweResource resource class in slumber's API. | 62598fa024f1403a926857cb |
class TestNewList(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 test_saving_a_POST_request(self): <NEW_LINE> <INDENT> lis = List.objects.create() <NEW_LINE> self.client.post('/lists/new',data={'item_text'... | Test case docstring. | 62598fa060cbc95b0636417f |
class EmailBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, username=None, password=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = User.objects.get(email=username) <NEW_LINE> <DEDENT> except User.DoesNotExist: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if ... | Authentication backend that uses users' email as the main
id. | 62598fa0cb5e8a47e493c08e |
@dataclass <NEW_LINE> class BaseOrder: <NEW_LINE> <INDENT> def __post_init__(self): <NEW_LINE> <INDENT> self.validate() <NEW_LINE> <DEDENT> def json(self): <NEW_LINE> <INDENT> order_dict = self._filter() <NEW_LINE> return json.dumps(order_dict, cls=EnhancedJSONEncoder) <NEW_LINE> <DEDENT> def asdict(self): <NEW_LINE> <... | Base Order dataclass
https://docs.python.org/3/library/dataclasses.html
https://stackoverflow.com/questions/12118695/efficient-way-to-remove-keys-with-empty-strings-from-a-dict | 62598fa06aa9bd52df0d4cfc |
class NgramDict(TextScore): <NEW_LINE> <INDENT> def __init__(self, ngramfile, sep=' '): <NEW_LINE> <INDENT> self.ngrams = {} <NEW_LINE> for line in file(ngramfile): <NEW_LINE> <INDENT> key,count = line.split(sep) <NEW_LINE> self.ngrams[key] = int(count) <NEW_LINE> <DEDENT> self.ngramLen = len(key) <NEW_LINE> self.all =... | use ngrams to score the text | 62598fa056ac1b37e630201c |
class TableCellStyle: <NEW_LINE> <INDENT> def __init__(self, obj=None): <NEW_LINE> <INDENT> if obj: <NEW_LINE> <INDENT> self.rborder = obj.rborder <NEW_LINE> self.lborder = obj.lborder <NEW_LINE> self.tborder = obj.tborder <NEW_LINE> self.bborder = obj.bborder <NEW_LINE> self.padding = obj.padding <NEW_LINE> self.longl... | Defines the style of a particular table cell. Characteristics are:
right border, left border, top border, bottom border, and padding. | 62598fa07d847024c075c1f8 |
class OpenSoundControlTest(ScriptedLoadableModuleTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> slicer.mrmlScene.Clear(0) <NEW_LINE> <DEDENT> def runTest(self): <NEW_LINE> <INDENT> self.setUp() <NEW_LINE> self.test_OpenSoundControl1() <NEW_LINE> <DEDENT> def test_OpenSoundControl1(self): <NEW_LINE> <IN... | This is the test case for your scripted module.
Uses ScriptedLoadableModuleTest base class, available at:
https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/ScriptedLoadableModule.py | 62598fa045492302aabfc309 |
class Walls(object): <NEW_LINE> <INDENT> def __init__(self, length, breadth): <NEW_LINE> <INDENT> self.length = length <NEW_LINE> self.breadth = breadth <NEW_LINE> self.matrix = [] <NEW_LINE> for i in range(0, self.length): <NEW_LINE> <INDENT> self.matrix.append([]) <NEW_LINE> for j in range(0, self.breadth): <NEW_LINE... | Class walls. | 62598fa021bff66bcd722a96 |
class DefaultUserAgentTestCase(TestCase): <NEW_LINE> <INDENT> net = False <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(DefaultUserAgentTestCase, self).setUp() <NEW_LINE> self.orig_format = config.user_agent_format <NEW_LINE> config.user_agent_format = ('{script_product} ({script_comments}) {pwb} ' '({revision}... | User agent formatting tests using the default config format string. | 62598fa0dd821e528d6d8d67 |
class Subject(object): <NEW_LINE> <INDENT> _sort_key = None <NEW_LINE> _order = 1 <NEW_LINE> def __init__(self, sid='', dset='', atrs=None): <NEW_LINE> <INDENT> self.sid = sid <NEW_LINE> self.dset = dset <NEW_LINE> self.atrs = None <NEW_LINE> self.ddir = '.' <NEW_LINE> self.dfile = '' <NEW_LINE> dir, file = os.... | a simple subject object holding an ID, dataset name, and an
attribute dictionary | 62598fa0a219f33f346c664c |
class GetSavedGifs(Object): <NEW_LINE> <INDENT> ID = 0x83bf3d52 <NEW_LINE> def __init__(self, hash: int): <NEW_LINE> <INDENT> self.hash = hash <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "GetSavedGifs": <NEW_LINE> <INDENT> hash = Int.read(b) <NEW_LINE> return GetSavedGifs(hash) <NEW_LINE... | Attributes:
ID: ``0x83bf3d52``
Args:
hash: ``int`` ``32-bit``
Raises:
:obj:`Error <pyrogram.Error>`
Returns:
Either :obj:`messages.SavedGifsNotModified <pyrogram.api.types.messages.SavedGifsNotModified>` or :obj:`messages.SavedGifs <pyrogram.api.types.messages.SavedGifs>` | 62598fa032920d7e50bc5e88 |
class User(structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = knowledge_base_pb2.User <NEW_LINE> def __init__(self, initializer=None, age=None, **kwargs): <NEW_LINE> <INDENT> if isinstance(initializer, KnowledgeBaseUser): <NEW_LINE> <INDENT> super(User, self).__init__(initializer=None, age=age, **kwargs) <NEW_LINE... | Information about the users. | 62598fa08c0ade5d55dc35a8 |
class RetinanetClassLoss(object): <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> self._num_classes = params.num_classes <NEW_LINE> self._focal_loss_alpha = params.focal_loss_alpha <NEW_LINE> self._focal_loss_gamma = params.focal_loss_gamma <NEW_LINE> <DEDENT> def __call__(self, cls_outputs, labels,... | RetinaNet class loss. | 62598fa0a17c0f6771d5c06d |
class TextSearch(BaseExpression): <NEW_LINE> <INDENT> def __init__(self, pattern, use_re=False, case=False): <NEW_LINE> <INDENT> self._pattern = unicode(pattern) <NEW_LINE> self.negated = 0 <NEW_LINE> self._build_re(self._pattern, use_re=use_re, case=case) <NEW_LINE> self.titlesearch = TitleSearch(self._pattern, use_re... | A term that does a normal text search
Both page content and the page title are searched, using an
additional TitleSearch term. | 62598fa09c8ee82313040087 |
class KeyedEnumField(EnumField): <NEW_LINE> <INDENT> def get_prep_value(self, value): <NEW_LINE> <INDENT> if isinstance(value, str): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> return value.name <NEW_LINE> <DEDENT> def to_python(self, value): <NEW_LINE> <INDENT> if isinstance(value, str): <NEW_LINE> <INDENT> r... | An enum field that stores the names of the values as strings, rather than the values. | 62598fa0adb09d7d5dc0a3bc |
class DummyFSStorageBackend(BaseStorageBackend): <NEW_LINE> <INDENT> require_fs = True <NEW_LINE> def acquire(self, context): <NEW_LINE> <INDENT> fshelper = getMultiAdapter((self, context), IStorageBackendFSAdapter) <NEW_LINE> return DummyFSStorage(context, fshelper.acquire()) <NEW_LINE> <DEDENT> def install(self, cont... | Dummy backend that provides direct access to file system contents. | 62598fa007f4c71912baf27b |
class Semantics(Enum): <NEW_LINE> <INDENT> STRONG = 'strong' <NEW_LINE> EMPHASIS = 'em' <NEW_LINE> MARK = 'mark' <NEW_LINE> DELETED = 'del' <NEW_LINE> INSERTED = 'ins' <NEW_LINE> SUBSCRIPT = 'sub' <NEW_LINE> SUPERSCRIPT = 'sup' <NEW_LINE> CODE = 'code' <NEW_LINE> UNARTICULATED = 'u' <NEW_LINE> STRIKETHROUGH = 's' <NEW_... | Semantic tags. Values are html tags. | 62598fa08a43f66fc4bf1faf |
@auto_str <NEW_LINE> class MetricDescription(object): <NEW_LINE> <INDENT> def __init__(self, metric_id, display_name, description, group_id, aggregation=MetricAggregation.SUM, value_type=MetricValueType.NUMERIC, properties=(MetricProperties.SIZE_METRIC,)): <NEW_LINE> <INDENT> self.metricId = metric_id <NEW_LINE> self.a... | Description of a metric type to be addded at configuration time.
Args:
metric_id (str): The globally unique metric id.
display_name (str): The metric's name that is displayed in the UI.
description (str): A description explaining what this metric means.
group_id (str): the name of an analysis group und... | 62598fa016aa5153ce400332 |
class ImportOrderLinter(ImportOrderChecker): <NEW_LINE> <INDENT> def __init__(self, tree, filename, lines, order_style='cryptography'): <NEW_LINE> <INDENT> super(ImportOrderLinter, self).__init__(filename, tree) <NEW_LINE> self.lines = lines <NEW_LINE> self.options = { 'import_order_style': order_style, } <NEW_LINE> <D... | Import order linter. | 62598fa04e4d562566372257 |
class ImageLoaderPIL(ImageLoaderBase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def extensions(): <NEW_LINE> <INDENT> return ('bmp', 'bufr', 'cur', 'dcx', 'fits', 'fl', 'fpx', 'gbr', 'gd', 'gif', 'grib', 'hdf5', 'ico', 'im', 'imt', 'iptc', 'jpeg', 'jpg', 'mcidas', 'mic', 'mpeg', 'msp', 'pcd', 'pcx', 'pixar', 'png',... | Image loader based on PIL library.
.. versionadded::
In 1.0.8, GIF animation have been supported.
Gif animation has a lot of issues(transparency/color depths... etc).
In order to keep it simple; what is implimented here is what is
natively supported by pil.
As a general rule, try to use gifs tha... | 62598fa03c8af77a43b67e59 |
class IllegalStateError(BaseException): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def navigate_without_paused(cls, direction): <NEW_LINE> <INDENT> if direction.startswith('f'): <NEW_LINE> <INDENT> direction = 'forward' <NEW_LINE> <DEDENT> elif direction.startswith('b'): <NEW_LINE> <INDENT> direction = 'backward' <NEW... | Raised if an operation is applied to the video player at a wrong state.
Several factory methods are provided for different illegal player
operations. | 62598fa08da39b475be03013 |
class TangoTree(BinarySearchTree): <NEW_LINE> <INDENT> def __init__(d): <NEW_LINE> <INDENT> raise NotImplementedError() | The basic idea of a Tango Tree is to store "preferred child" paths,
where each node stores its most recently accessed child as the
preferred child. These paths can be stored as auxiliary BBSTs
sorted by the original keys. | 62598fa00a50d4780f70520d |
class AutoRestHeadExceptionTestService(object): <NEW_LINE> <INDENT> def __init__( self, credentials, base_url=None): <NEW_LINE> <INDENT> self.config = AutoRestHeadExceptionTestServiceConfiguration(credentials, base_url) <NEW_LINE> self._client = ServiceClient(self.config.credentials, self.config) <NEW_LINE> client_mode... | Test Infrastructure for AutoRest
:ivar config: Configuration for client.
:vartype config: AutoRestHeadExceptionTestServiceConfiguration
:ivar head_exception: HeadException operations
:vartype head_exception: fixtures.acceptancetestsheadexceptions.operations.HeadExceptionOperations
:param credentials: Credentials nee... | 62598fa0379a373c97d98e49 |
class TraitConverter(Converter): <NEW_LINE> <INDENT> async def convert(self, ctx: Context, argument: str) -> bool: <NEW_LINE> <INDENT> bot: gb.GreedyGhost = ctx.bot <NEW_LINE> return bot.dbm.getTraitInfo(argument.lower()) | Validates a trait id NOTE: LANGUAGE NOT YET SUPPORTED | 62598fa0009cb60464d01358 |
class Restaurant: <NEW_LINE> <INDENT> def __init__(self, restaurant_name, cuisine_type): <NEW_LINE> <INDENT> self.restaurant_name = restaurant_name <NEW_LINE> self.cuisine_type = cuisine_type <NEW_LINE> <DEDENT> def describe_restaurant(self): <NEW_LINE> <INDENT> print("\nThe name of the restaurant is " + self.restauran... | 模拟餐馆 | 62598fa0fff4ab517ebcd621 |
class Baseview(object): <NEW_LINE> <INDENT> def __init__(self, view): <NEW_LINE> <INDENT> self.connected = set() <NEW_LINE> self.builder = view.builder <NEW_LINE> <DEDENT> def test_and_set_connected(self, window_id): <NEW_LINE> <INDENT> if window_id in self.connected: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT>... | Common parts in MVC view components. | 62598fa0d486a94d0ba2be09 |
class SetupGui: <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> self.master = master <NEW_LINE> master.title("Etool setup") <NEW_LINE> self.label = Label(master, text="Etool setup") <NEW_LINE> self.label.pack() <NEW_LINE> self.install_button = Button(master, text="Start Setup", command=self.install)... | DISABLED AT THE MOMENT | 62598fa010dbd63aa1c709e1 |
class BaseBackend(object): <NEW_LINE> <INDENT> def create_message(self, to: str, body: str): <NEW_LINE> <INDENT> raise NotImplemented( 'You should implement backend by yourself' ) | Base sms sender backend
Provide interface to be implemented for any sms backend | 62598fa045492302aabfc30a |
class SourceView(BaseVocabularyView): <NEW_LINE> <INDENT> def get_context(self): <NEW_LINE> <INDENT> if ISubForm.providedBy(self.context.form): <NEW_LINE> <INDENT> context = self.context.form.parentForm.context <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> context = self.context.context <NEW_LINE> <DEDENT> return conte... | Queries a field's source and returns JSON-formatted results. | 62598fa0498bea3a75a57955 |
class MinimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> numberOfAgents = gameState.getNumAgents() <NEW_LINE> numberOfGhosts = numberOfAgents - 1 <NEW_LINE> v, action = self.minimax(self.depth, gameState, True, 0 ) <NEW_LINE> return action <NEW_LINE> <DEDENT> de... | Your minimax agent (question 2) | 62598fa0e64d504609df92d2 |
class OBJECT_OT_LimitDOFButton(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "mocap.limitdof" <NEW_LINE> bl_label = "Set DOF Constraints" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> performer_obj = [obj for obj in context.selected_objects if obj != context.active_object][0] <NEW_LINE> mocap_tools.... | Create limit constraints on the active armature from the selected armature's animation's range of motion | 62598fa099cbb53fe6830d06 |
class get_high_scores_forms(messages.Message): <NEW_LINE> <INDENT> high_scores = messages.MessageField(get_high_scores_form, 1, repeated=True) | Used to return high score information | 62598fa0d268445f26639a9d |
class SimpleArraySurfacePointer(object, IDisposable): <NEW_LINE> <INDENT> def ConstPointer(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def NonConstPointer(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ToNonConstArray(self): <NEW_LINE> <IN... | Wrapper for a C++ ON_SimpleArray of ON_Surface* or const ON_Surface*. If
you are not writing C++ code then this class is not for you.
SimpleArraySurfacePointer() | 62598fa00a50d4780f70520e |
class SpcAlarm(alarm.AlarmControlPanel): <NEW_LINE> <INDENT> def __init__(self, area, api): <NEW_LINE> <INDENT> self._area = area <NEW_LINE> self._api = api <NEW_LINE> <DEDENT> async def async_added_to_hass(self): <NEW_LINE> <INDENT> self.async_on_remove( async_dispatcher_connect( self.hass, SIGNAL_UPDATE_ALARM.format(... | Representation of the SPC alarm panel. | 62598fa04e4d562566372258 |
class Curve(object): <NEW_LINE> <INDENT> def __init__(self, name, raw): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.raw = raw <NEW_LINE> if raw.get("value") is None: <NEW_LINE> <INDENT> self.raw["value"] = [] <NEW_LINE> <DEDENT> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.raw[key] <NEW... | A single curve within a CurveSet. | 62598fa0442bda511e95c28e |
class PpapProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples(self.load_data(os.path.join(data_dir, "train.pkl")), "train") <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples(self.l... | Processor for the MultiNLI data set (GLUE version). | 62598fa0b7558d5895463462 |
class Size(Vector): <NEW_LINE> <INDENT> def __init__(self, value, units, win=None): <NEW_LINE> <INDENT> Vector.__init__(self, value, units, win) | Class representing a size.
Parameters
----------
value : ArrayLike
Array of values representing size axis-aligned bounding box within a
coordinate system. Sizes are specified in a similar manner to
`~psychopy.layout.Vector` as either 1xN for single vectors, and Nx2 or
Nx3 for multiple positions.
units ... | 62598fa08c0ade5d55dc35a9 |
class BrowserImportsItem(BrowserItem): <NEW_LINE> <INDENT> def __init__(self, parent, text): <NEW_LINE> <INDENT> BrowserItem.__init__(self, parent, text) <NEW_LINE> self.type_ = BrowserItemImports <NEW_LINE> self.icon = UI.PixmapCache.getIcon("imports.png") <NEW_LINE> <DEDENT> def lessThan(self, other, column, order): ... | Class implementing the data structure for browser import items. | 62598fa0be383301e025362b |
class LoadAllModulesTest(SimpleTestCase): <NEW_LINE> <INDENT> @patch('os.walk') <NEW_LINE> @patch('importlib.import_module') <NEW_LINE> def test_should_import_all_modules(self, import_module, walk): <NEW_LINE> <INDENT> walk.return_value = [ ('module', [], ['file1.py', 'file2.py']), ('module/submodule', [], ['file3.py',... | :py:meth:`smarttest.utils.load_all_modules` | 62598fa030bbd72246469891 |
class GitHubException(ProviderException): <NEW_LINE> <INDENT> pass | GitHub returned an error from an API call. | 62598fa0925a0f43d25e7e72 |
class CSDM_Leaf_Dynamics(SimulationObject): <NEW_LINE> <INDENT> class Parameters(ParamTemplate): <NEW_LINE> <INDENT> CSDM_MAX = Float() <NEW_LINE> CSDM_MIN = Float() <NEW_LINE> CSDM_A = Float() <NEW_LINE> CSDM_B = Float() <NEW_LINE> CSDM_T1 = Float() <NEW_LINE> CSDM_T2 = Float() <NEW_LINE> <DEDENT> class StateVariable(... | Leaf dynamics according to the Canopy Structure Dynamic Model.
The only difference is that in the real CSDM the temperature sum is the
driving variable, while in this case it is simply the day number since the start of the model.
Reference:
Koetz et al. 2005. Use of coupled canopy structure dynamic and radiative
... | 62598fa03539df3088ecc0e9 |
class ProbabilisticMixIn: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> if "prob" in kwargs: <NEW_LINE> <INDENT> if "logprob" in kwargs: <NEW_LINE> <INDENT> raise TypeError("Must specify either prob or logprob " "(not both)") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ProbabilisticMixIn.set_p... | A mix-in class to associate probabilities with other classes
(trees, rules, etc.). To use the ``ProbabilisticMixIn`` class,
define a new class that derives from an existing class and from
ProbabilisticMixIn. You will need to define a new constructor for
the new class, which explicitly calls the constructors of both i... | 62598fa085dfad0860cbf98f |
class TestLbHttpResponseHeaderDeleteAction(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 testLbHttpResponseHeaderDeleteAction(self): <NEW_LINE> <INDENT> pass | LbHttpResponseHeaderDeleteAction unit test stubs | 62598fa03d592f4c4edbad03 |
class cc_dim_uc(cc_dim): <NEW_LINE> <INDENT> def __init__(self, X, cc_datatype_class, index, Z=None, n_grid=30, distargs=None): <NEW_LINE> <INDENT> super(cc_dim_uc, self).__init__(X, cc_datatype_class, index, Z=None, n_grid=30, distargs=None) <NEW_LINE> self.mode = 'uncollapsed' <NEW_LINE> self.params = dict() <NEW_LIN... | cc_dim. Column. Holds data, model type, and hyperparameters. | 62598fa091f36d47f2230dbb |
class link(object): <NEW_LINE> <INDENT> updating = False <NEW_LINE> def __init__(self, source, target, transform=None): <NEW_LINE> <INDENT> _validate_link(source, target) <NEW_LINE> self.source, self.target = source, target <NEW_LINE> self._transform, self._transform_inv = ( transform if transform else (lambda x: x,) *... | Link traits from different objects together so they remain in sync.
Parameters
----------
source : (object / attribute name) pair
target : (object / attribute name) pair
transform: iterable with two callables (optional)
Data transformation between source and target and target and source.
Examples
--------
>>> c ... | 62598fa0f7d966606f747e17 |
class Icmpv6(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "icmpv6" <NEW_LINE> self.a10_url="/axapi/v3/cgnv6/nat/icmpv6" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.respond_to_ping = "" <NEW_LINE> self.uu... | Class Description::
ICMPv6 configuration for IPv6 NAT.
Class icmpv6 supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param respond_to_ping: {"default": 0, "optional": true, "type": "number", "description": "Respond to ICMPv6 echo requests to NAT p... | 62598fa0a79ad16197769e9a |
class SubsampleTransform(Transform): <NEW_LINE> <INDENT> def __init__(self, width=5, **kwargs): <NEW_LINE> <INDENT> super(SubsampleTransform, self).__init__(**kwargs) <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> def transform(self, samples): <NEW_LINE> <INDENT> super(SubsampleTransform, self).transform(samples) <N... | Subsample time series by some width.
Pads sample if sample size is not a multiple of width.
Parameters
----------
width: integer (default 5)
Number of consecutive time points to average.
Returns
----
Re-indexed Dataframe with subsampled data for each sample. | 62598fa063d6d428bbee25e6 |
class KubernetesConfigSource(ConfigSource): <NEW_LINE> <INDENT> def __init__(self, label, client, name, **kwargs): <NEW_LINE> <INDENT> self.type = "kubernetes" <NEW_LINE> self.client = client <NEW_LINE> self.name = name <NEW_LINE> self.namespace = kwargs.get("namespace") or "default" <NEW_LINE> self.key = kwargs.get("k... | A kubernetes config data source.
This is meant to load things directly from the kubernetes API.
Specifically, it can load things from config maps.
Keyword Args:
client: A kubernetes client from the kubernetes package.
name (str): The name of the ConfigMap to load.
namespace (str): The namespace for the Co... | 62598fa04e4d562566372259 |
class StopAction(PlumberyAction): <NEW_LINE> <INDENT> def process(self, blueprint): <NEW_LINE> <INDENT> plogging.info("- process blueprint") | Stops nodes
:param settings: specific settings for this action
:type param: ``dict`` | 62598fa00c0af96317c561b6 |
class GroupDeviceItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DeviceId = None <NEW_LINE> self.NickName = None <NEW_LINE> self.Status = None <NEW_LINE> self.ExtraInformation = None <NEW_LINE> self.DeviceType = None <NEW_LINE> self.RTSPUrl = None <NEW_LINE> self.DeviceCode = None ... | 分组下设备信息
| 62598fa0d7e4931a7ef3bece |
class ResNet34(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ResNet34, self).__init__() <NEW_LINE> self.model_name = 'resnet34' <NEW_LINE> self.pre = nn.Sequential( nn.Conv2d(3, 64, 7, 2, 3, bias=False), nn.BatchNorm(64), nn.ReLU(inplace=True), nn.MaxPool2d(3, 2, 1) ) <NEW_LINE> self.lay... | ResNet34 used for feature extractors.
output is x, x_3.the size of them are (batch_size, 512, h/4, w/4) | 62598fa0009cb60464d0135a |
class GRRMemoryDriver(GRRSignedBlob): <NEW_LINE> <INDENT> class SchemaCls(GRRSignedBlob.SchemaCls): <NEW_LINE> <INDENT> INSTALLATION = aff4.Attribute( "aff4:driver/installation", rdf_client.DriverInstallTemplate, "The driver installation control protobuf.", "installation", default=rdf_client.DriverInstallTemplate( driv... | A driver for acquiring memory. | 62598fa07047854f4633f20f |
class Ally(Character): <NEW_LINE> <INDENT> def __init__(self, name: str, hp: int, max_hp: int, attack: int, speed: int): <NEW_LINE> <INDENT> super().__init__(name, hp, max_hp, attack, speed, team=1, level=1, exp=0, target_exp=200) <NEW_LINE> <DEDENT> def act(self, players): <NEW_LINE> <INDENT> all_enemy_locations = sel... | This is a subclass of characters specific to team 1 | 62598fa0bd1bec0571e14fde |
class UserHistorySerializer(serializers.Serializer): <NEW_LINE> <INDENT> sku_id = serializers.IntegerField(label='商品编号',min_value=1,required=True) <NEW_LINE> def validate_sku_id(self,value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> SKU.objects.get(pk=value) <NEW_LINE> <DEDENT> except SKU.DoesNotExist: <NEW_LINE> <I... | 添加用户浏览记录序列化器 | 62598fa00a50d4780f705210 |
class Tag(Base): <NEW_LINE> <INDENT> __tablename__ = 'tags' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> label = Column(String(63)) <NEW_LINE> description = Column(String(255), default='') <NEW_LINE> protected = Column(Boolean, default=False) <NEW_LINE> pinned = Column(Boolean, default=False) <NEW_LINE>... | ORM model representing a project tag | 62598fa001c39578d7f12bb5 |
class PooledConnection(ConnectionWrapper): <NEW_LINE> <INDENT> def __init__(self, pool, cnx, key, tid): <NEW_LINE> <INDENT> ConnectionWrapper.__init__(self, cnx) <NEW_LINE> self._pool = pool <NEW_LINE> self._key = key <NEW_LINE> self._tid = tid <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> if self.cnx: <NEW_... | A database connection that can be pooled. When closed, it gets returned
to the pool. | 62598fa08e7ae83300ee8ed6 |
class WatcherEventHandler: <NEW_LINE> <INDENT> def __init__(self, callback, patterns, timeout=3): <NEW_LINE> <INDENT> self.logger = logging.getLogger(__name__) <NEW_LINE> self.callback = callback <NEW_LINE> self.timeout = timeout <NEW_LINE> self.files = {} <NEW_LINE> self.patterns = patterns <NEW_LINE> self.handlers = ... | Watcher Event Handler Class | 62598fa08e71fb1e983bb8ed |
class ForcingTerm(object): <NEW_LINE> <INDENT> def __init__(self, weights, basis_functions): <NEW_LINE> <INDENT> self.w = weights <NEW_LINE> self.psi = basis_functions <NEW_LINE> <DEDENT> @property <NEW_LINE> def weights(self): <NEW_LINE> <INDENT> return self.w <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_linear... | Forcing term used in DMPs
This basically computes the unscaled forcing term, i.e. a weighted sum of basis functions, which is given by:
.. math:: f(s) = \frac{ sum_{i} \psi_i(s) w_i }{ \sum_i \psi_i(s) }
where :math:`w` are the learnable weight parameters, and :math:`\psi` are the basis functions evaluated at the
gi... | 62598fa092d797404e388a81 |
class ModelFileCached(BaseModelFile): <NEW_LINE> <INDENT> def __init__(self, cache_id): <NEW_LINE> <INDENT> self._cache_id = cache_id <NEW_LINE> <DEDENT> @cached_property <NEW_LINE> def filename(self): <NEW_LINE> <INDENT> return cache_path(CACHED_PRODUCT_FILE[self._cache_id]) | Model file with cache filename. | 62598fa032920d7e50bc5e8d |
class CallSubprocess(Action): <NEW_LINE> <INDENT> def __init__(self, command, kwargs={}, label=DEFAULT, *args, **kwds): <NEW_LINE> <INDENT> Action.__init__(self, " ".join(command) if label is DEFAULT else label, *args, **kwds) <NEW_LINE> self.__command = command <NEW_LINE> self.__kwargs = kwargs <NEW_LINE> <DEDENT> def... | A stock action that calls a subprocess. | 62598fa08e7ae83300ee8ed7 |
class SimulationYAMLReader: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.yaml = None <NEW_LINE> <DEDENT> def read_yaml_from_file(self, yaml_file) -> SimulationRepr: <NEW_LINE> <INDENT> with open(yaml_file, "r") as yf: <NEW_LINE> <INDENT> self.yaml = yaml.full_load(yf) <NEW_LINE> <DEDENT> return self... | Reads a simulation description from YAML, then validate, and then parse. | 62598fa0d7e4931a7ef3bed0 |
class APIError(Exception): <NEW_LINE> <INDENT> def __init__(self, response): <NEW_LINE> <INDENT> self.response = response <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return (( 'Mailgun API {method} at {url} failed ' 'with status code {status_code}:\n{text}').format( method=self.response.request.method, u... | Error response from the Mailgun server. | 62598fa07d847024c075c1fd |
class _Save_StatCosave(AppendableLink, OneItemLink): <NEW_LINE> <INDENT> def _enable(self): <NEW_LINE> <INDENT> if not super(_Save_StatCosave, self)._enable(): return False <NEW_LINE> self._cosave = self._get_cosave() <NEW_LINE> return bool(self._cosave) <NEW_LINE> <DEDENT> def _get_cosave(self): <NEW_LINE> <INDENT> ra... | Base for xSE and pluggy cosaves stats menus | 62598fa0462c4b4f79dbb843 |
class Pattern: <NEW_LINE> <INDENT> def search(self, document): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def __add__(self, other): <NEW_LINE> <INDENT> return OrPattern(self, other) <NEW_LINE> <DEDENT> def __mul__(self, other): <NEW_LINE> <INDENT> return AndPattern(self, other) <NEW_LINE> <DEDENT... | Check if the document have a specific pattern | 62598fa067a9b606de545e01 |
class Address(Base): <NEW_LINE> <INDENT> __tablename__ = 'address' <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True) <NEW_LINE> user_id = Column(Integer, ForeignKey('user.id'), nullable=False, comment='外键: 下单的用户id') <NEW_LINE> name = Column(String(30), nullable=False, comment='收货人姓名') <NEW_LINE> mob... | 配送信息 | 62598fa0d486a94d0ba2be0d |
class BagFactory(): <NEW_LINE> <INDENT> def __init__(self, color='turquoise', material='leather', length=1, width=1, height=1): <NEW_LINE> <INDENT> self.color = color <NEW_LINE> self.material = material <NEW_LINE> self.length = int(length) <NEW_LINE> self.width = int(width) <NEW_LINE> self.height = int(height) <NEW_LIN... | This is a factory that produces bags, preferably turquoise.
Founded in Australia, with subsidiary operations in the UK.
@param color: A C{str} giving the color.
@raises ValueError: if C{height} is not an integer. | 62598fa038b623060ffa8eca |
class AuditObjectReference(_messages.Message): <NEW_LINE> <INDENT> apiVersion = _messages.StringField(1) <NEW_LINE> name = _messages.StringField(2) <NEW_LINE> resource = _messages.StringField(3) <NEW_LINE> subresource = _messages.StringField(4) | AuditObjectReference contains enough information to let you inspect or
modify the referred object. Should match ObjectReference in https://github.
com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/apis/
audit/v1alpha1/generated.proto.
Fields:
apiVersion: +optional In alpha, this field follows ... | 62598fa030dc7b766599f685 |
class Solution: <NEW_LINE> <INDENT> def numRollsToTarget(self, d: int, f: int, target: int) -> int: <NEW_LINE> <INDENT> if target > d*f or target < d: return 0 <NEW_LINE> mod = 1000000007 <NEW_LINE> dp = [0]*(target+1) <NEW_LINE> dp[0] = 1 <NEW_LINE> i = 1 <NEW_LINE> while i <= d: <NEW_LINE> <INDENT> tmp = [0]*(target+... | https://www.cnblogs.com/Dylan-Java-NYC/p/12196018.html
e.g. 3 f=6 dices, target = 7
d ar 0 1 2 3 4 5 6 7
1 dp = [0, 1, 1, 1, 1, 1, 1, 0]
2 dp = [0, 0, 1, 2, 3, 4, 5, 6]
3 dp = [0, 0, 0, 1, 3, 6, 10, 15] | 62598fa0b7558d5895463465 |
class Profile(models.Model): <NEW_LINE> <INDENT> STUDENT = 'student' <NEW_LINE> TEACHER = 'teacher' <NEW_LINE> PARENT = 'parent' <NEW_LINE> PRINCIPAL = 'principal' <NEW_LINE> ADMIN = 'admin' <NEW_LINE> TYPES = ( (STUDENT, _('Student')), (TEACHER, _('Teacher')), (PARENT, _('Parent')), (PRINCIPAL, _('Principal')), (ADMIN... | Every user in the system has a profile, but not every profile has a user
associated with it. | 62598fa0f548e778e596b3e5 |
class HStoreField(forms.CharField): <NEW_LINE> <INDENT> widget = forms.Textarea <NEW_LINE> default_error_messages = { 'invalid_json': _('Could not load JSON data.'), 'invalid_format': _('Input must be a JSON dictionary.'), } <NEW_LINE> def prepare_value(self, value): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW... | A field for HStore data which accepts dictionary JSON input. | 62598fa0a8ecb03325871045 |
class GenderAgeTrafficDetail(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Gender = None <NEW_LINE> self.AgeGap = None <NEW_LINE> self.TrafficCount = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Gender = params.get("Gender") <NEW_LINE> self.AgeGap ... | 性别年龄分组下的客流信息
| 62598fa0796e427e5384e5cb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.