code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ExtendedInterpolationConfig(Config): <NEW_LINE> <INDENT> def _create_config_parser(self): <NEW_LINE> <INDENT> inter = configparser.ExtendedInterpolation() <NEW_LINE> return configparser.ConfigParser( defaults=self.create_defaults, interpolation=inter) | Configuration class extends using advanced interpolation with
``configparser.ExtendedInterpolation``. | 62598fc73346ee7daa3377e2 |
class OrbitPointTransition(ParamTransition): <NEW_LINE> <INDENT> command_attributes = {'type': 'ORBPOINT'} <NEW_LINE> state_keys = ['orbit_point'] <NEW_LINE> transition_key = 'orbit_point' <NEW_LINE> cmd_param_key = 'event_type' | Orbit point state based on backstop ephemeris entries | 62598fc7283ffb24f3cf3bba |
class FontAlphabetsDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, folder_path,info_path = None,transform=None,custom_path=None): <NEW_LINE> <INDENT> self.root_dir = folder_path <NEW_LINE> self.transform = transform <NEW_LINE> self.im_width = 30 <NEW_LINE> self.im_height = 30 <NEW_LINE> path_pattern = '/*/sin... | Create a Dataset class from from folder path. | 62598fc7ad47b63b2c5a7b8d |
class TruncateParams(BaseModel): <NEW_LINE> <INDENT> before: datetime <NEW_LINE> creator_name: Optional[str] <NEW_LINE> execution_id: Optional[str] | Parameters passed to DELETE /audit endpoint. | 62598fc8ff9c53063f51a982 |
class ScanSceneHook(Hook): <NEW_LINE> <INDENT> def execute(self, **kwargs): <NEW_LINE> <INDENT> items = [] <NEW_LINE> scene_name = cmds.file(query=True, sn=True) <NEW_LINE> if not scene_name: <NEW_LINE> <INDENT> raise TankError("Please Save your file before Publishing") <NEW_LINE> <DEDENT> scene_path = os.path.abspath(... | Hook to scan scene for items to publish | 62598fc850812a4eaa620d7f |
class ChannelAwareMixin(object): <NEW_LINE> <INDENT> def get_channel(self): <NEW_LINE> <INDENT> memokey = '_cache_get_channel' <NEW_LINE> if not hasattr(self, memokey): <NEW_LINE> <INDENT> if self.kwargs.get('channel_slug', None) is not None: <NEW_LINE> <INDENT> channel = get_object_or_404(Channel, slug=self.kwargs['ch... | Mixin to make views aware of channels with a ``get_channel`` method | 62598fc89f28863672818a17 |
class ChannelDescription(db.JsonNode): <NEW_LINE> <INDENT> _discriminator_ = CHANNEL_DESCRIPTION | This ORM class represents channel descriptions. | 62598fc8d486a94d0ba2c308 |
class NaiveBayes(Classifier): <NEW_LINE> <INDENT> def __init__(self, documents, k=1): <NEW_LINE> <INDENT> Classifier.__init__(self, documents) <NEW_LINE> self.vocabulary = self.get_vocabulary(documents) <NEW_LINE> self.class_vocabularies = self.get_class_vocabularies(documents) <NEW_LINE> self.class_word_counts = self.... | A Naive Bayes classifier;
given the documents for training, it generates lists and dictionaries for probability estimation. | 62598fc8f9cc0f698b1c546d |
class RegistrationDetail(APIView): <NEW_LINE> <INDENT> def get_object(self, pk, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> obj=Registration.objects.get(pk=pk) <NEW_LINE> obj.inject_request(request) <NEW_LINE> return obj <NEW_LINE> <DEDENT> except Registration.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 ... | Retrieve, update? or delete??? a registration instance | 62598fc8adb09d7d5dc0a8b1 |
class CircularArray(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.arr = [] <NEW_LINE> <DEDENT> def add_item(self, item): <NEW_LINE> <INDENT> self.arr.append(item) <NEW_LINE> <DEDENT> def get_by_index(self, index): <NEW_LINE> <INDENT> if index < len(self.arr): <NEW_LINE> <INDENT> return self.... | An array that may be rotated, and items retrieved by index | 62598fc8be7bc26dc9251ff6 |
class ESRILayer(object): <NEW_LINE> <INDENT> def __init__(self, baseurl, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update({"_" + k: v for k, v in diter(kwargs)}) <NEW_LINE> if hasattr(self, "_fields"): <NEW_LINE> <INDENT> self.variables = pd.DataFrame(self._fields) <NEW_LINE> <DEDENT> self._baseurl = baseurl + "/" +... | The fundamental building block to access a single Geography/Layer in an ESRI MapService | 62598fc8091ae35668704f5f |
class OptionItem: <NEW_LINE> <INDENT> def __init__(self, opt): <NEW_LINE> <INDENT> self.short = opt.get("short") <NEW_LINE> self.long = opt.get("long") <NEW_LINE> self.target = self.long[2:].replace("-", "_") <NEW_LINE> self.help = opt.get("help") <NEW_LINE> self.status = opt.get("status") <NEW_LINE> self.func = opt.ge... | class to hold module ArgumentParser options data | 62598fc8a219f33f346c6b3e |
class Grub2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'grub2' <NEW_LINE> profiles = ('boot',) <NEW_LINE> packages = ('grub2',) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.add_copy_spec([ "/boot/efi/EFI/*/grub.cfg", "/boot/grub2/grub.cfg", "/boot/grub2/grubenv", "/boot... | GRUB2 bootloader
| 62598fc860cbc95b06364674 |
class Eof(Parser): <NEW_LINE> <INDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return "''" <NEW_LINE> <DEDENT> def parse(self, tokens: Tokens) -> Result: <NEW_LINE> <INDENT> if tokens: <NEW_LINE> <INDENT> raise CantParse(self, tokens) <NEW_LINE> <DEDENT> return Result(None, empty=True) | EOF checker. | 62598fc8ad47b63b2c5a7b8f |
class CaptureDataBase(Capture): <NEW_LINE> <INDENT> def __init__(self, data_name, callback=None): <NEW_LINE> <INDENT> self._data_name = data_name <NEW_LINE> def identity(x): <NEW_LINE> <INDENT> return x <NEW_LINE> <DEDENT> if not callback: <NEW_LINE> <INDENT> callback = identity <NEW_LINE> <DEDENT> routingKey = ("stats... | Base class for CaptureData methods. | 62598fc87047854f4633f709 |
class TestComponentProperty_i(TestComponentProperty_base): <NEW_LINE> <INDENT> def initialize(self): <NEW_LINE> <INDENT> TestComponentProperty_base.initialize(self) <NEW_LINE> <DEDENT> def process(self): <NEW_LINE> <INDENT> self._log.debug("process() example log message") <NEW_LINE> return NOOP | <DESCRIPTION GOES HERE> | 62598fc8377c676e912f6f11 |
@total_ordering <NEW_LINE> class EncryptConfig(object): <NEW_LINE> <INDENT> def __init__(self, encryptMode=None, encryptTarget=None): <NEW_LINE> <INDENT> self._encryptMode = None <NEW_LINE> self._encryptTarget = None <NEW_LINE> self.encryptMode = encryptMode <NEW_LINE> self.encryptTarget = encryptTarget <NEW_LINE> <DED... | Class representing encrypt configuration.
Encrypt configuration is used for encrypting staging directories.
The following restrictions exist on data in this class:
- The encrypt mode must be one of the values in ``VALID_ENCRYPT_MODES``
- The encrypt target value must be a non-empty string | 62598fc897e22403b383b23c |
class ReferralCodeCondition(CustomConditionMixin, Condition): <NEW_LINE> <INDENT> _description = "User used referral code." <NEW_LINE> def is_satisfied(self, offer, basket, request=None): <NEW_LINE> <INDENT> if request.user.is_authenticated and request.user.is_referral_code_used: <NEW_LINE> <INDENT> return False <NEW_L... | Custom condition, which allows referee (referral code applicant) to
qualify for the discount. | 62598fc8a8370b77170f0712 |
@add_start_docstrings( CAMEMBERT_START_DOCSTRING, ) <NEW_LINE> class CamembertForTokenClassification(RobertaForTokenClassification): <NEW_LINE> <INDENT> config_class = CamembertConfig | This class overrides [`RobertaForTokenClassification`]. Please check the superclass for the appropriate
documentation alongside usage examples. | 62598fc87c178a314d78d7d8 |
class SensorInfo(object): <NEW_LINE> <INDENT> def __init__(self, name, data_key, units, max_value, min_value, value_modifier): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.data_key = data_key <NEW_LINE> self.units = units <NEW_LINE> self.max = max_value <NEW_LINE> self.min = min_value <NEW_LINE> self.value_modi... | Xiaomi Sensor info | 62598fc8091ae35668704f61 |
class ServiceEnvironmentSet(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.EnvironmentList = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW_LINE> if params.get("EnvironmentLi... | Details of environments bound to service
| 62598fc8cc40096d6161a374 |
class MediaLabelDataStatistics(Document): <NEW_LINE> <INDENT> media_type = StringField(required=False, verbose_name='媒体类型') <NEW_LINE> first_cate = StringField(default='', verbose_name='一级类目') <NEW_LINE> second_cate = StringField(default='', verbose_name='二级类目') <NEW_LINE> number = IntField(required=False, default=0,ve... | @summary: 媒体资源库 | 62598fc860cbc95b06364676 |
class JAVAC(Compiler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(JAVAC, self).__init__("javac", "{base}") <NEW_LINE> self.add_args(r"{file}") <NEW_LINE> <DEDENT> def bin_file_name(self, src_filename=""): <NEW_LINE> <INDENT> return substitute("{base}", src_filename) | Javac | 62598fc8bf627c535bcb17e2 |
class LabPlanProperties(LabPlanUpdateProperties): <NEW_LINE> <INDENT> _validation = { 'shared_gallery_id': {'max_length': 2000, 'min_length': 3}, 'linked_lms_instance': {'max_length': 2000, 'min_length': 3}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'default_connection_profile': {'key': ... | Lab plan resource properties.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar default_connection_profile: The default lab connection profile. This can be changed on a
lab resource and only provides a default profile.
:vartype default_connection_profile: ~azure.mgmt.labse... | 62598fc8099cdd3c6367557e |
class MachineLearningServicer(BaseServicer): <NEW_LINE> <INDENT> def __init__( self, salary_model, social_ads_model, mall_customers_segmentation_model, campaign_ad_optimization_model, restaurant_review_prediction_model, bank_leaving_prediction_model, cat_or_dog_prediction_model, ): <NEW_LINE> <INDENT> self.__salary_mod... | Provides methods that implement functionality of machine learning server. | 62598fc863b5f9789fe854ae |
class DMA_PWMServo (adapter.adapters.DMAAdapter): <NEW_LINE> <INDENT> mandatoryParameters = {'frequency': 50.0, 'rate': 50.0} <NEW_LINE> optionalParametes = {'value.inverse': False, 'millisecond.min': 1.0, 'millisecond.max' : 2.0 } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> adapter.adapters.DMAAdapter.__init__... | outputs a pwm signal to a pin with attached servo.
Output is inverse, as a transistor line driver with pullup is used.
Input 'rate' : float, 0.0 to 100.0
Configuration 'frequency': float, [Hz]
uses pwm-feature of RPi.GPIO-Library. | 62598fc8377c676e912f6f12 |
class Command(BaseCommand): <NEW_LINE> <INDENT> help = 'Export hth flat pages as Hugo markdown files' <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('output_dir', help='Output directory.') <NEW_LINE> <DEDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> for page in FlatPa... | Usage:
1. Put this file in:
yourdjangoproject/
management/
commands/
djangoflatpage2hugo.py
2. Make sure there are __init__.py files in both management and commands folders
3. Run: python manage.py djangoflatpage2hugo /chosen/output/directory/
4. Find the co... | 62598fc84c3428357761a5f7 |
class ZipCodeResource(object): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> <DEDENT> def on_get(self, req, resp, zip_code=None): <NEW_LINE> <INDENT> limit = req.get_param('limit') <NEW_LINE> zipcodes = [] <NEW_LINE> if zip_code: <NEW_LINE> <INDENT> if validate_zipcode... | ZipCodeResource
| 62598fc84a966d76dd5ef210 |
@total_ordering <NEW_LINE> class Register: <NEW_LINE> <INDENT> def __init__(self, value=0): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> if isinstance(other, Register): <NEW_LINE> <INDENT> return self.value < other.value <NEW_LINE> <DEDENT> return self.value < ... | A Register capable of storing a single value.
Args:
value: Initial Register value. | 62598fc84428ac0f6e658860 |
class DLV(rdtypes.dsbase.DSBase): <NEW_LINE> <INDENT> pass | DLV record | 62598fc85fcc89381b2662ea |
class User(Document): <NEW_LINE> <INDENT> username = StringField(max_length=30, required=True) <NEW_LINE> first_name = StringField(max_length=30) <NEW_LINE> last_name = StringField(max_length=30) <NEW_LINE> email = StringField() <NEW_LINE> password = StringField(max_length=128) <NEW_LINE> is_staff = BooleanField(defaul... | A User document that aims to mirror most of the API specified by Django
at http://docs.djangoproject.com/en/dev/topics/auth/#users | 62598fc89f28863672818a19 |
class Equal(Expression): <NEW_LINE> <INDENT> def execute(self, item): <NEW_LINE> <INDENT> return self.resolve_lhs(item) == self.resolve_rhs(item) | Equal expression class. | 62598fc860cbc95b06364678 |
class TaskStepProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'base_image_dependencies': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDepe... | Base properties for any task step.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: DockerBuildStep, EncodedTaskStep, FileTaskStep.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to... | 62598fc8fbf16365ca7943f3 |
class BaseCaseLogForm(forms.Form): <NEW_LINE> <INDENT> LOG_EVENT_KEY = None <NEW_LINE> NOTES_MANDATORY = False <NEW_LINE> notes = forms.CharField(required=False, max_length=5000) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.case = kwargs.pop("case") <NEW_LINE> super(BaseCaseLogForm, self).__... | Use this class if your event is of one of these types:
1. one code event where something happens and you want an event
log to get created
2. implicit code event where something happens and the system
chooses which code to use.
In this case, you need to override the `get_kwargs` method
... | 62598fc84527f215b58ea20a |
class TitleWidget(forms.TextInput): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.model = kwargs.pop("model") <NEW_LINE> self.field = kwargs.pop("field") <NEW_LINE> super(TitleWidget, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def render(self, name, value, attrs): <NEW_LINE>... | A text widget that renders a property of the instance. | 62598fc8bf627c535bcb17e4 |
class WebDBDirichletGroup(WebDirichletGroup, WebDBDirichlet): <NEW_LINE> <INDENT> headers = ['orbit label', 'order', 'primitive'] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._contents = None <NEW_LINE> self.maxrows = 30 <NEW_LINE> self.maxcols = 30 <NEW_LINE> self.rowtruncate = False <NEW_LINE> se... | A class using data stored in the database. Currently this is all Dirichlet
characters with modulus up to 10000. | 62598fc8167d2b6e312b72b2 |
class KeyActor(pykka.ThreadingActor): <NEW_LINE> <INDENT> use_daemon_thread = True <NEW_LINE> def __init__(self, hub_actor, motor_actor): <NEW_LINE> <INDENT> super(KeyActor, self).__init__() <NEW_LINE> self.hub_actor = hub_actor <NEW_LINE> self.motor_actor = motor_actor <NEW_LINE> self._working = False <NEW_LINE> <DEDE... | 鍵を扱うアクター | 62598fc8ab23a570cc2d4f0b |
class ToNumpyImage(object): <NEW_LINE> <INDENT> def __call__(self, pic): <NEW_LINE> <INDENT> return to_numpy_image(pic) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> format_string = self.__class__.__name__ <NEW_LINE> return format_string | Convert a tensor of shape C x H x W to ndarray image while preserving the value range. | 62598fc8dc8b845886d538f6 |
class Card: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.part1 = {'Color': 'N', 'Dot': 'N'} <NEW_LINE> self.part2 = {'Color': 'N', 'Dot': 'N'} <NEW_LINE> self.rotation = None <NEW_LINE> <DEDENT> def _set_card_side(self, side1_color, side1_dot, side2_color, side2_dot): <NEW_LINE> <INDENT> self.part1[... | Instance represent a Card Object.
===========
Description
===========
Represent the card which will be placed by Players on the board. | 62598fc8ad47b63b2c5a7b93 |
@attrs.define(kw_only=True) <NEW_LINE> class ItemPerk: <NEW_LINE> <INDENT> hash: typing.Optional[int] <NEW_LINE> icon: assets.Image <NEW_LINE> is_active: bool <NEW_LINE> is_visible: bool | Represents a Destiny 2 perk. | 62598fc87c178a314d78d7dc |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, k): <NEW_LINE> <INDENT> self.key = k <NEW_LINE> self.children = [] | A node in a tree. | 62598fc8283ffb24f3cf3bc2 |
class PropertySelection(Selection): <NEW_LINE> <INDENT> token = 'prop' <NEW_LINE> ops = dict([ ('>', np.greater), ('<', np.less), ('>=', np.greater_equal), ('<=', np.less_equal), ('==', np.equal), ('!=', np.not_equal), ]) <NEW_LINE> _op_symbols = ('<=', '>=', '==', '!=', '<', '>') <NEW_LINE> opposite_ops = { '==': '=='... | Some of the possible properties:
x, y, z, radius, mass, | 62598fc8fbf16365ca7943f5 |
class ImageNetPolicy(object): <NEW_LINE> <INDENT> def __init__(self, fillcolor=(128, 128, 128)): <NEW_LINE> <INDENT> self.policies = [ SubPolicy(0.4, "posterize", 8, 0.6, "rotate", 9, fillcolor), SubPolicy(0.6, "solarize", 5, 0.6, "autocontrast", 5, fillcolor), SubPolicy(0.8, "equalize", 8, 0.6, "equalize", 3, fillcolo... | Randomly choose one of the best 24 Sub-policies on ImageNet.
Example:
# >>> policy = ImageNetPolicy()
# >>> transformed = policy(image)
Example as a PyTorch Transform:
# >>> transform=transforms.Compose([
# >>> transforms.Resize(256),
# >>> ImageNetPolicy(),
# >>> transforms.ToTensor()]) | 62598fc863b5f9789fe854b2 |
class PlacementAuthProtocol(auth_token.AuthProtocol): <NEW_LINE> <INDENT> def __init__(self, app, conf): <NEW_LINE> <INDENT> self._placement_app = app <NEW_LINE> super(PlacementAuthProtocol, self).__init__(app, conf) <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> if environ['PATH_I... | A wrapper on Keystone auth_token middleware.
Does not perform verification of authentication tokens
for root in the API. | 62598fc8099cdd3c63675580 |
class SurveillanceOutcome(AbstractNameList): <NEW_LINE> <INDENT> pass | SurveillanceOutcome
kintrak table: lt_f691 | 62598fc85fc7496912d48418 |
class RecordIOWriterNotCompletedError(Exception): <NEW_LINE> <INDENT> def __init__(self, amount): <NEW_LINE> <INDENT> self.amount = amount <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return (u"RecordIOWriter failed to write %s entries" % (self.amount)) | Gets raised if the not all changes were applied. | 62598fc897e22403b383b242 |
class VerifyNodePublicKey(monitor_processors.NodeProcessor): <NEW_LINE> <INDENT> def process(self, context, node): <NEW_LINE> <INDENT> verified = identity_policy.verify_identity( node, public_key_models.PublicKeyIdentityConfig, context.identity.certificate or None, ) <NEW_LINE> if not verified: <NEW_LINE> <INDENT> even... | A processor that verifies a node's public key against the known identities. In
case verification fails, further processing of this node is aborted.
The processor expects a PEM-encoded X509 certificate or public key to be
present in 'context.identity.certificate'. | 62598fc850812a4eaa620d83 |
@python_2_unicode_compatible <NEW_LINE> class PaidTimeOff(models.Model): <NEW_LINE> <INDENT> MAX_INT_VALUE = 2**32-1 <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.user.__str__() + " PTO Summary: \n" + "\nSick Days Taken: " + str(self.sick_days_taken) + "\nSick Days Earned: " + str(... | Class defining the PaidTimeOff model | 62598fc87d847024c075c6fa |
class CommentairesViewAdd(generics.CreateAPIView): <NEW_LINE> <INDENT> permission_classes = (IsauthenticatedD,) <NEW_LINE> queryset = Commentaires.objects.all() <NEW_LINE> serializer_class = CommentairesAddSerializer <NEW_LINE> def create(self, request): <NEW_LINE> <INDENT> serializer = self.get_serializer(data=request... | API endpoint that allows groups to be viewed or edited. | 62598fc83617ad0b5ee06485 |
class EarlyStopping: <NEW_LINE> <INDENT> def __init__(self, patience: typing.Optional[int]=None, key: typing.Any=None): <NEW_LINE> <INDENT> self._patience = patience <NEW_LINE> self._key = key <NEW_LINE> self._best_so_far = 0 <NEW_LINE> self._epochs_with_no_improvement = 0 <NEW_LINE> self._is_best_so_far = False <NEW_L... | EarlyStopping stops training if no improvement after a given patience. | 62598fc84a966d76dd5ef214 |
class MySolution: <NEW_LINE> <INDENT> def twoSum(self, nums, target): <NEW_LINE> <INDENT> index = [] <NEW_LINE> for i in range(len(nums)): <NEW_LINE> <INDENT> for j in range(i + 1, len(nums)): <NEW_LINE> <INDENT> if nums[i] + nums[j] == target: <NEW_LINE> <INDENT> index.append(i) <NEW_LINE> index.append(j) <NEW_LINE> r... | my own solution | 62598fc84428ac0f6e658864 |
class InitializeOAuthInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'APIKey', value) <NEW_LINE> <DEDENT> def set_AccountName(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccountName', value) <NEW_LINE> <DEDENT> def set_AppKeyName(self, ... | An InputSet with methods appropriate for specifying the inputs to the InitializeOAuth
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598fc8656771135c4899ae |
class TestRwriteValue(JNTTFactory, JNTTFactoryConfigCommon): <NEW_LINE> <INDENT> entry_name='rwrite_value' | Test the value factory
| 62598fc8be7bc26dc9251ffa |
class OptionMove(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self, parent, project): <NEW_LINE> <INDENT> QtGui.QVBoxLayout .__init__(self) <NEW_LINE> self.project = project <NEW_LINE> self.noWrapRadio = QtGui.QRadioButton("no wrap", self) <NEW_LINE> self.noWrapRadio.pressed.connect(self.noWrapPressed) <NEW_LINE> s... | contextual option for the select tool | 62598fc860cbc95b0636467c |
class PlanasAdd( views.LoginRequiredMixin, views.FormValidMessageMixin, generic.edit.CreateView): <NEW_LINE> <INDENT> form_class = PlanasAddForm <NEW_LINE> form_valid_message = 'Įvestas naujas kodas: ' <NEW_LINE> template_name = 'planas_create.html' <NEW_LINE> success_url = reverse_lazy('planas_add') <NEW_LINE> def for... | Naujo VP kodo pridejimo forma (planas_create.html).
| 62598fc87b180e01f3e491ef |
class DummyController(MessageHandler): <NEW_LINE> <INDENT> def __init__(self, pipe_in, pipe_out, driver): <NEW_LINE> <INDENT> MessageHandler.__init__(self, pipe_in, pipe_out) <NEW_LINE> self.__dummy = driver <NEW_LINE> self.__value = 0 <NEW_LINE> self.__logger = logging.getLogger(LOGGER_NAME) <NEW_LINE> <DEDENT> def ha... | Example implementation of driver.
Need to extends `MessageHandler` from `amber.driver.common.amber_pipes`. | 62598fc8167d2b6e312b72b6 |
class FixedTypedArrayBase(FixedArrayBase): <NEW_LINE> <INDENT> kBasePointerOffset = FixedArrayBase.kHeaderSize <NEW_LINE> kExternalPointerOffset = kBasePointerOffset + kPointerSize <NEW_LINE> kHeaderSize = DOUBLE_POINTER_ALIGN(kExternalPointerOffset + kPointerSize) <NEW_LINE> kDataOffset = kHeaderSize <NEW_LINE> kSize ... | class FixedTypedArrayBase: public FixedArrayBase; | 62598fc8ab23a570cc2d4f0d |
class GameboardView: <NEW_LINE> <INDENT> def __init__(self, board): <NEW_LINE> <INDENT> self._boardImage = pygame.image.load('tictacboard.png') <NEW_LINE> self._board = board <NEW_LINE> self._height = board.height * CELL_SIZE <NEW_LINE> self._width = board.width * CELL_SIZE <NEW_LINE> <DEDENT> def draw(self): <NEW_LINE... | Gameboard's widget, shows board on the screen, and checks mouse's click's place in the board | 62598fc8dc8b845886d538fa |
class RemoteFontFamily(object): <NEW_LINE> <INDENT> name: str <NEW_LINE> fonts: List[RemoteFont] <NEW_LINE> def __init__(self, name: str, fonts: List[RemoteFont]) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fonts = fonts <NEW_LINE> <DEDENT> @property <NEW_LINE> def variants(self) -> List[FontAttribute... | Class to manage a remote font family. | 62598fc8ad47b63b2c5a7b98 |
class Benchmark: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def run(function, runs, print_output=True): <NEW_LINE> <INDENT> timings = [] <NEW_LINE> if print_output: <NEW_LINE> <INDENT> print("Runs Median Mean Stddev") <NEW_LINE> <DEDENT> for i in range(runs): <NEW_LINE> <INDENT> startTime = time.time() <NEW_LINE> fun... | This class runs a benchmark on a function passed to the
run method. It calls the function a specified number of times
and calculates the mean and standard deviation across all runs. | 62598fc8099cdd3c63675581 |
class Component(api_types.Base): <NEW_LINE> <INDENT> assembly_uuid = wtypes.text <NEW_LINE> services = [service.Service] <NEW_LINE> operations = [operation.Operation] <NEW_LINE> sensors = [sensor.Sensor] <NEW_LINE> abbreviated = bool <NEW_LINE> components_ids = [wtypes.text] <NEW_LINE> resource_uri = common_types.Uri <... | The Component resource represents one part of an Assembly.
For example, an instance of a database service may be a
Component. A Component resource may also represent a static artifact, such
as an archive file that contains data for initializing your application.
An Assembly may have different components that represent... | 62598fc87047854f4633f711 |
class G2Source(object): <NEW_LINE> <INDENT> def __init__(self, area, timeslot): <NEW_LINE> <INDENT> areaSettings = ss.Area.objects.get(name=area) <NEW_LINE> sourceSettings = areaSettings.source <NEW_LINE> self.name = None <NEW_LINE> for specSource in sourceSettings.specificsource_set.all(): <NEW_LINE> <INDENT> if specS... | ... | 62598fc8d486a94d0ba2c312 |
class Series(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/NPR/StoryFinder/Series') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return SeriesInputSet() <NEW_LINE> <DEDENT> def _make_result_set(self, r... | Create a new instance of the Series Choreography. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 62598fc83d592f4c4edbb1f3 |
class AbstractItemCategory(models.Model): <NEW_LINE> <INDENT> item = models.ForeignKey('product.Item') <NEW_LINE> category = models.ForeignKey('product.Category') <NEW_LINE> is_canonical = models.BooleanField(default=False, db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> ordering = ... | Joining model between items and categories. | 62598fc8a219f33f346c6b49 |
class HelpCommand(Command): <NEW_LINE> <INDENT> @property <NEW_LINE> def short_name(self): <NEW_LINE> <INDENT> return 'help' <NEW_LINE> <DEDENT> async def exec(self, args): <NEW_LINE> <INDENT> global g_commands <NEW_LINE> for command in g_commands: <NEW_LINE> <INDENT> cmd = command() <NEW_LINE> print(' {:<22}: {}'.fo... | Show this help message. | 62598fc8ad47b63b2c5a7b9a |
class Consumer(Thread): <NEW_LINE> <INDENT> def __init__(self, thread_id: int, thread_name: str, modify_event: Event, queue:OwnQueue): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.thread_id = thread_id <NEW_LINE> self.thread_name = thread_name <NEW_LINE> self.modify_event = modify_event <NEW_LINE> self.que... | Consumers are of 2 types:
1. Pop Consumers that pop the last element and modify the queue
2. Peek Consumers that peek the last element and do not modify the queue | 62598fc8851cf427c66b85f5 |
class Object(object): <NEW_LINE> <INDENT> def __init__(self, fields): <NEW_LINE> <INDENT> self.fields = fields <NEW_LINE> <DEDENT> def get_field(self, name): <NEW_LINE> <INDENT> return self.fields.get(name) | Generic container for opensocial.* objects. | 62598fc8bf627c535bcb17ea |
class Team(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200, primary_key=True) <NEW_LINE> logo = models.ImageField(upload_to='media/') | Model class for the cricket_app Teams
| 62598fc85fdd1c0f98e5e2cd |
class ScaledDotProductAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_model, n_head, attention_dropout): <NEW_LINE> <INDENT> super(ScaledDotProductAttention, self).__init__() <NEW_LINE> self.temper = np.power(d_model // n_head, 0.5) <NEW_LINE> self.attention_dropout = nn.Dropout(attention_dropout) <NEW_L... | Scaled Dot-Product Attention | 62598fc8a05bb46b3848abad |
class MapServiceBot(MapBaseServer): <NEW_LINE> <INDENT> service_bot = True <NEW_LINE> hidden = True | Represents a service bot. | 62598fc87cff6e4e811b5d69 |
class Map: <NEW_LINE> <INDENT> __listScent = [] <NEW_LINE> def __init__(self, xSize, ySize): <NEW_LINE> <INDENT> self.xSize = xSize <NEW_LINE> self.ySize = ySize <NEW_LINE> <DEDENT> def addScent(self, Scent): <NEW_LINE> <INDENT> self.__listScent.append(Scent) <NEW_LINE> <DEDENT> def checkScent(self, Scent): <NEW_LINE> ... | Definition of the map | 62598fc871ff763f4b5e7ac1 |
class PastebayDownloadQueue(RecentItemsDownloader): <NEW_LINE> <INDENT> def __init__(self, name, interval): <NEW_LINE> <INDENT> RecentItemsDownloader.__init__(self, name, interval) <NEW_LINE> self.download_url = 'http://www.pastebay.net/pastebay.php?dl={id}' <NEW_LINE> self.details_url = 'http://www.pastebay.net/{id}' ... | Downloader thread for pastebin. | 62598fc855399d3f0562685b |
@six.add_metaclass(StoreType) <NEW_LINE> class Store(object): <NEW_LINE> <INDENT> key = None <NEW_LINE> service = None <NEW_LINE> abstract = True <NEW_LINE> manager = Manager() <NEW_LINE> def __init__(self, key, active=True, **kwargs): <NEW_LINE> <INDENT> super(Store, self).__init__() <NEW_LINE> key = key.lower() <NEW_... | Abstract base class to implement session and stored data | 62598fc87047854f4633f715 |
class AdditionalFightingStyle(FeatureSelector): <NEW_LINE> <INDENT> options = {'archery 2': Archery, 'defense 2': Defense, 'dueling 2': Dueling, 'great 2': GreatWeaponFighting, 'great-weapon fighting 2': GreatWeaponFighting, 'projection 2': Protection, 'two-weapon fighting 2': TwoWeaponFighting, 'two-weapon 2': TwoWeap... | Select a Fighting Style by choosing in feature_choices:
archery 2
defense 2
dueling 2
great-weapon fighting 2
protection 2
two-weapon fighting 2 | 62598fc8d8ef3951e32c7ffd |
class Array(Subconstruct): <NEW_LINE> <INDENT> def __init__(self, count, subcon, discard=False): <NEW_LINE> <INDENT> super().__init__(subcon) <NEW_LINE> self.count = count <NEW_LINE> self.discard = discard <NEW_LINE> <DEDENT> def _parse(self, stream, context, path): <NEW_LINE> <INDENT> count = evaluate(self.count, cont... | Homogenous array of elements, similar to C# generic T[].
Parses into a ListContainer (a list). Parsing and building processes an exact amount of elements. If given list has more or less than count elements, raises RangeError. Size is defined as count multiplied by subcon size, but only if subcon is fixed size.
Operat... | 62598fc84c3428357761a601 |
class CollectionAJAXView(JSONResponseMixin, TemplateView, ContextDataMixin): <NEW_LINE> <INDENT> http_method_names = ('get',) <NEW_LINE> @method_decorator(dcolumn_login_required) <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(CollectionAJAXView, self).dispatch(*args, **kwargs) <NEW_LIN... | Web service endpoint used in the Django admin to format ``KeyValue``
values as per the ``DynamicColumn`` meta data. | 62598fc83617ad0b5ee0648b |
class TaskLog(BASE, NovaBase): <NEW_LINE> <INDENT> __tablename__ = 'task_log' <NEW_LINE> id = Column(Integer, primary_key=True, nullable=False, autoincrement=True) <NEW_LINE> task_name = Column(String(255), nullable=False) <NEW_LINE> state = Column(String(255), nullable=False) <NEW_LINE> host = Column(String(255)) <NEW... | Audit log for background periodic tasks | 62598fc87cff6e4e811b5d6b |
class DeebotMopAttachedBinarySensor(BinarySensorEntity): <NEW_LINE> <INDENT> def __init__(self, vacbot: VacBot, device_id: str): <NEW_LINE> <INDENT> self._vacbot = vacbot <NEW_LINE> self._id = device_id <NEW_LINE> if self._vacbot.vacuum.get("nick", None) is not None: <NEW_LINE> <INDENT> self._vacbot_name = "{}".format(... | Deebot mop attached binary sensor | 62598fc8a8370b77170f071f |
class Event(object): <NEW_LINE> <INDENT> __slots__ = ['event_type', 'data', 'origin'] <NEW_LINE> def __init__(self, event_type, data=None, origin=EventOrigin.local): <NEW_LINE> <INDENT> self.event_type = event_type <NEW_LINE> self.data = data or {} <NEW_LINE> self.origin = origin <NEW_LINE> <DEDENT> def __repr__(self):... | Represents an event within the Bus. | 62598fc860cbc95b06364682 |
class GenericPtrType(TypeGeneric): <NEW_LINE> <INDENT> def __getitem__(self, vtype): <NEW_LINE> <INDENT> if not isinstance(vtype, TypeGeneric): <NEW_LINE> <INDENT> raise TypeError(f"Ptr expects a type argument, but received {type(vtype).__name__}") <NEW_LINE> <DEDENT> return ConcreteType(tvm.ir.PointerType(vtype.evalua... | TVM script typing class generator for PtrType
[] operator is overloaded, accepts a ConcreteType and returns a ConcreteType wrapping PtrType | 62598fc863b5f9789fe854ba |
class Event(EventItem): <NEW_LINE> <INDENT> objects = InheritanceManager() <NEW_LINE> e_title = CharField(max_length=128) <NEW_LINE> e_description = TextField() <NEW_LINE> blurb = TextField(blank=True) <NEW_LINE> duration = DurationField() <NEW_LINE> notes = TextField(blank=True) <NEW_LINE> event_id = AutoField(primary... | Event is the base class for any scheduled happening at the expo.
Events fall broadly into "shows" and "classes". Classes break down
further into master classes, panels, workshops, etc. Shows are not
biddable (though the Acts comprising them are) , but classes arise
from participant bids. | 62598fc8a219f33f346c6b4d |
class ListModelTest(TestCase): <NEW_LINE> <INDENT> def test_get_absolute_url(self): <NEW_LINE> <INDENT> ls = List.objects.create() <NEW_LINE> self.assertEqual(ls.get_absolute_url(), '/lists/%d/' % (ls.id)) <NEW_LINE> <DEDENT> def test_lists_can_have_owners(self): <NEW_LINE> <INDENT> user = User.objects.create(email='a@... | test_get_absolute_url: get_absolute_url 返回 /lists/<id> | 62598fc84527f215b58ea214 |
class ActionIoFileOutbound(BaseAction): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> if self.active(): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> outbound = str(self.properties['comms']['file'].get('outbound')) <NEW_LINE> smp = self.properties['comms']['file']['semaphore_extension'] <NEW_LINE> msg = sel... | Scan the messages table in the control DB for
outbound messages and create an outbound file if any found.
MSG Format:
CREATE TABLE messages (
message_id INTEGER NOT NULL PRIMARY KEY, -- Record ID in recipient messages table
sender TEXT NOT NULL, -- Return address of sender
sender_id INTEGE... | 62598fc8ad47b63b2c5a7b9e |
class User(db.Model): <NEW_LINE> <INDENT> name = db.StringProperty(required=True) <NEW_LINE> pw_hash = db.StringProperty(required=True) <NEW_LINE> email = db.StringProperty() <NEW_LINE> @classmethod <NEW_LINE> def by_id(cls, uid): <NEW_LINE> <INDENT> return User.get_by_id(uid, parent=users_key()) <NEW_LINE> <DEDENT> @c... | Creates a user class in the datastore, and creates
class methods for accessing users by id or by name,
also class method for user login | 62598fc8ab23a570cc2d4f10 |
class NoDataReturned(TrumbaException): <NEW_LINE> <INDENT> pass | Exception when there is empty data in the response | 62598fc8ec188e330fdf8bda |
class VersionController(wsgi.Controller): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> <DEDENT> @utils.wrap_error <NEW_LINE> def get_version_info(self, req, file="version"): <NEW_LINE> <INDENT> resp = Response() <NEW_LINE> resp.charset = 'UTF-8' <NEW_LINE> if u... | Controller for version related methods | 62598fc8167d2b6e312b72bc |
class TestSubprocessJob(TestQless): <NEW_LINE> <INDENT> def test_basic(self): <NEW_LINE> <INDENT> job = mock.Mock(data={ 'command': 'date' }, sandbox='/tmp') <NEW_LINE> SubprocessJob.process(job) <NEW_LINE> self.assertTrue(job.complete.called) <NEW_LINE> <DEDENT> def test_fails(self): <NEW_LINE> <INDENT> job = mock.Moc... | Test the SubprocesJob. | 62598fc85fdd1c0f98e5e2d1 |
@parametric(metaclass=IterableMeta) <NEW_LINE> class _ParametricIterable: <NEW_LINE> <INDENT> pass | Parametric iterable type. | 62598fc85fc7496912d4841c |
class Solution(ThermoPhase, Kinetics, Transport): <NEW_LINE> <INDENT> __slots__ = () | A class for chemically-reacting solutions. Instances can be created to
represent any type of solution -- a mixture of gases, a liquid solution, or
a solid solution, for example.
Class `Solution` derives from classes `ThermoPhase`, `Kinetics`, and
`Transport`. It defines no methods of its own, and is provided so that ... | 62598fc87cff6e4e811b5d6d |
class CppCodeGen(CodeGenVisitor): <NEW_LINE> <INDENT> def visit_CppInclude(self, node): <NEW_LINE> <INDENT> if node.angled_brackets: <NEW_LINE> <INDENT> return "#include <%s>" % node.target <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return '#include "%s"' % node.target <NEW_LINE> <DEDENT> <DEDENT> def visit_CppComme... | Visitor to generate C preprocessor directives. | 62598fc8656771135c4899b6 |
class Positions(object): <NEW_LINE> <INDENT> def __init__(self, filePath, umToPix): <NEW_LINE> <INDENT> if not os.path.exists(filePath): <NEW_LINE> <INDENT> filePath = os.sep.join( [merlin.POSITION_HOME, filePath]) <NEW_LINE> <DEDENT> self.umToPix = umToPix <NEW_LINE> self.data = pandas.read_csv(filePath, names = ["x",... | Provides positions of simulated images. | 62598fc8adb09d7d5dc0a8c1 |
class Lorem(Cli): <NEW_LINE> <INDENT> def ipsum(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def sit(self): <NEW_LINE> <INDENT> pass | Lorem ipsum is placeholder text commonly used for previewing
layouts and visual mockups. | 62598fc855399d3f0562685f |
class EntityTypeFilter(object): <NEW_LINE> <INDENT> swagger_types = { 'relation_type': 'str', 'entity_types': 'list[str]' } <NEW_LINE> attribute_map = { 'relation_type': 'relationType', 'entity_types': 'entityTypes' } <NEW_LINE> def __init__(self, relation_type=None, entity_types=None): <NEW_LINE> <INDENT> self._relati... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fc8a8370b77170f0721 |
class BoldElement(Element): <NEW_LINE> <INDENT> def __init__(self, subelements): <NEW_LINE> <INDENT> super(BoldElement, self).__init__(subelements) | An Element object that represents bolded text | 62598fc8be7bc26dc9251ffe |
class VolcanoPolygonBuildingFunctionMetadata(ImpactFunctionMetadata): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def as_dict(): <NEW_LINE> <INDENT> dict_meta = { 'id': 'VolcanoPolygonBuildingFunction', 'name': tr('Polygon volcano on buildings'), 'impact': tr('Be affected'), 'title': tr('Be affected'), 'function_type'... | Metadata for VolcanoPolygonBuildingFunctionMetadata.
.. versionadded:: 2.1
We only need to re-implement as_dict(), all other behaviours
are inherited from the abstract base class. | 62598fc863b5f9789fe854bb |
class Option(peewee.Model): <NEW_LINE> <INDENT> name = peewee.TextField() <NEW_LINE> poll = peewee.ForeignKeyField(Poll, related_name='related_poll') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> database = PSQL_DB | DB model for poll options
| 62598fc860cbc95b06364684 |
@RequestType.UNKNOWN <NEW_LINE> class UVRequest(object): <NEW_LINE> <INDENT> __slots__ = ['__weakref__', 'loop', 'finished', 'base_request'] <NEW_LINE> uv_request_type = None <NEW_LINE> uv_request_init = None <NEW_LINE> def __init__(self, loop, arguments, uv_handle=None, request_init=None): <NEW_LINE> <INDENT> self.loo... | The base class of all libuv based requests.
:raises uv.LoopClosedError:
loop has already been closed
:param loop:
loop where the request should run on
:param arguments:
arguments passed to the libuv request initializer
:param uv_handle:
libuv handle the requests belongs to
:param request_init:
lib... | 62598fc8ad47b63b2c5a7ba0 |
class File: <NEW_LINE> <INDENT> def __init__(self, url: urls.URL, id=None, verified=0, hash=None): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.id = id <NEW_LINE> self.verified = verified <NEW_LINE> self.hash = hash <NEW_LINE> self.folder = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "F... | Representation of a tracked file in a Source. | 62598fc8cc40096d6161a37b |
class LruMemoryStrategy(BaseStrategy): <NEW_LINE> <INDENT> def __init__(self, maxsize=None, maxcount=None): <NEW_LINE> <INDENT> super(LruMemoryStrategy, self).__init__(maxsize, maxcount) <NEW_LINE> self._keys = [] <NEW_LINE> self._lock = threading.RLock() <NEW_LINE> self._log = get_logger(self) <NEW_LINE> <DEDENT> def ... | Least recently used strategy | 62598fc826068e7796d4cca3 |
class GiveItemForm(asb.forms.CSRFTokenForm): <NEW_LINE> <INDENT> pokemon = asb.forms.MultiSubmitField(coerce=int) | A form for choosing a Pokémon to give a particular item or use an item
on. | 62598fc8a05bb46b3848abb3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.