code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Open: <NEW_LINE> <INDENT> def __init__(self, search_strategy): <NEW_LINE> <INDENT> if search_strategy == _DEPTH_FIRST: <NEW_LINE> <INDENT> self.open = [] <NEW_LINE> self.insert = self.open.append <NEW_LINE> self.extract = self.open.pop <NEW_LINE> <DEDENT> elif search_strategy == _BREADTH_FIRST: <NEW_LINE> <INDENT... | Open objects hold the search frontier---the set of unexpanded
nodes. Depending on the search strategy used we want to extract
nodes from this set in different orders, so set up the object's
functions to operate as needed by the particular search
strategy | 625990448da39b475be04514 |
class IntrinsicPredictor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_model, action_dim, dropout=0.0): <NEW_LINE> <INDENT> super(IntrinsicPredictor, self).__init__() <NEW_LINE> self.dropout = nn.Dropout(dropout) <NEW_LINE> self.intrinsic_predict_FFN1 = nn.Linear(d_model+action_dim, d_model) <NEW_LINE> self.intr... | the intrinsic predictor provides intrinsic rewards **in the agent**
(a multi-task modeling). the predictor is also a self-supervised module. | 62599045d4950a0f3b1117d4 |
class Log(BaseAPIObject): <NEW_LINE> <INDENT> IDNAME = 'log_id' <NEW_LINE> PATH = ['job', 'log'] <NEW_LINE> SUBPATH = ['log'] <NEW_LINE> id = None <NEW_LINE> name = None <NEW_LINE> type = None <NEW_LINE> format = None <NEW_LINE> content = None | The 'Log' object from the API | 62599045baa26c4b54d505cf |
class _Comparison: <NEW_LINE> <INDENT> default_message = __("Comparison failed") <NEW_LINE> def __init__(self, fieldname: str, message: str = None) -> None: <NEW_LINE> <INDENT> self.fieldname = fieldname <NEW_LINE> self.message = message or self.default_message <NEW_LINE> <DEDENT> def __call__(self, form, field) -> Non... | Base class for validators that compare this field's value with another field. | 6259904510dbd63aa1c71eff |
class MyTopo( Topo ): <NEW_LINE> <INDENT> def __init__( self ): <NEW_LINE> <INDENT> Topo.__init__( self ) <NEW_LINE> sw1 = self.addSwitch( 's1' ) <NEW_LINE> h1 = self.addHost( 'h1', ip='100.0.0.10/24' ) <NEW_LINE> h2 = self.addHost( 'h2', ip='100.0.0.11/24' ) <NEW_LINE> fw1 = self.addSwitch( 's2' ) <NEW_LINE> sw2 = sel... | Simple topology example. | 62599045d7e4931a7ef3d39d |
class IRating(zope.interface.Interface): <NEW_LINE> <INDENT> id = zope.schema.TextLine( title=u'Id', description=u'The id of the rating used.', required=True) <NEW_LINE> value = zope.schema.Object( title=u'Value', description=u'A scoresystem-valid score that represents the rating.', schema=zope.interface.Interface, req... | A single rating for a definition and user. | 6259904526068e7796d4dc6c |
class ObjectMmap(test_mmap.test_mmap): <NEW_LINE> <INDENT> def __init__(self, fileno=-1, length=1024, access=test_mmap.ACCESS_WRITE, tagname='share_mmap'): <NEW_LINE> <INDENT> super(ObjectMmap, self).__init__(self, fileno, length, access=access, tagname=tagname) <NEW_LINE> self.length = length <NEW_LINE> self.access = ... | :param fileno: the file handle
:param length: memory size
:param access:
:param tagname: | 6259904523e79379d538d824 |
class TestValidator(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.config = configurator.Config() <NEW_LINE> self.test = validator.Validator() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.config.__init__() <NEW_LINE> <DEDENT> def test_check_values_true(self): <NEW_... | Class which contains methods for testing
the validator.py module. | 625990454e696a045264e7b4 |
class Kdump(CommandDispatcher): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__('kdump', [VmPhysSeg(), VmFreePages(), VmMapSeg(), PhysMap()]) | Examine kernel data structures. | 62599045b57a9660fecd2da3 |
class docker_event(Event): <NEW_LINE> <INDENT> pass | Docker Event | 62599045d10714528d69f020 |
class Literal(Formula): <NEW_LINE> <INDENT> def __init__(self, lit): <NEW_LINE> <INDENT> self.lit = lit <NEW_LINE> <DEDENT> def __str__(self, parens = False): <NEW_LINE> <INDENT> return str(self.lit) <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.lit) <NEW_LINE> <DEDENT> def __eq__(self, o... | The class for boolean literals (variables). | 62599045462c4b4f79dbcd25 |
@PRE_PYTEST_SKIP <NEW_LINE> class CloudClientTestCase(CloudTest): <NEW_LINE> <INDENT> PROVIDER = "digitalocean" <NEW_LINE> REQUIRED_PROVIDER_CONFIG_ITEMS = tuple() <NEW_LINE> IMAGE_NAME = "14.04.5 x64" <NEW_LINE> @pytest.mark.expensive_test <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> images = self.run_cloud("--list... | Integration tests for the CloudClient class. Uses DigitalOcean as a salt-cloud provider. | 62599045ec188e330fdf9bc2 |
class PNG(Pixmap): <NEW_LINE> <INDENT> gui = {'menu': 'File|Export to pixmap', 'entry': 'PNG'} <NEW_LINE> key = "PNG" | PNG format writer | 62599045d6c5a102081e3443 |
class RawWebSocketTransport(websocket.SockJSWebSocketHandler, base.BaseTransportMixin): <NEW_LINE> <INDENT> name = 'rawwebsocket' <NEW_LINE> def initialize(self, server): <NEW_LINE> <INDENT> self.server = server <NEW_LINE> self.session = None <NEW_LINE> self.active = True <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> ... | Raw Websocket transport | 6259904526238365f5fade82 |
class Header: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.last_checked = datetime.datetime.min <NEW_LINE> self.online_status = False <NEW_LINE> self.title = "" <NEW_LINE> self.game = "" <NEW_LINE> self.online_since = None <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> if datetime.datetim... | Object holding online status.
Acts as a cache so we don't ping other servers too much. | 625990458e05c05ec3f6f7ee |
class Mod_Mysql(BaseModule): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> BaseModule.__init__(self, name) <NEW_LINE> self.conf_file = BASE_DIR + self.path + "\my.ini" <NEW_LINE> self.parse_config_file() <NEW_LINE> self.cfg_ctr = {} <NEW_LINE> <DEDENT> def parse_config_file(self): <NEW_LINE> <INDENT... | Mysql模块类 | 62599045287bf620b6272f0f |
class LLO(SCPINode, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "@LLO" <NEW_LINE> args = [] | @LLO
Arguments: | 6259904550485f2cf55dc2ae |
class CheckMoneyAccountView(generics.RetrieveAPIView): <NEW_LINE> <INDENT> permission_classes = [TokenHasReadWriteScope | IsAdminUser] <NEW_LINE> required_scopes = ["can_check_if_exist"] <NEW_LINE> queryset = MoneyAccount.objects.all() <NEW_LINE> lookup_field = "slug" <NEW_LINE> serializer_class = MoneyAccountCheckSeri... | Check if MoneyAccount Bank/Api with this slug exists
-- is used to communicate with 3rd aplication | 6259904594891a1f408ba08a |
class GithubReviewRequestTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.valid_request = { 'action': 'review_requested', 'pull_request': { 'html_url': 'https://www.example.com', }, 'sender': { 'login': 'generic-person', }, } <NEW_LINE> <DEDENT> def test_is_valid_pull_request_good(self): <N... | Test the github review request functions. | 6259904507f4c71912bb075a |
class PTStepperMotor (PTSimpleGPIO): <NEW_LINE> <INDENT> def __init__ (self, p_pinTuple, p_scaling, p_speed, p_accuracy_level): <NEW_LINE> <INDENT> if len (p_pinTuple) == 2: <NEW_LINE> <INDENT> self.task_ptr = ptStepperMotor.stepperMotorFull (p_pinTuple[0], p_pinTuple[1], p_scaling, p_speed, p_accuracy_level) <NEW_LINE... | :param:p_pinTuple is a tuple containing GPIO pin numbers, 2 for full, 4 for half
:param:p_scaling is spatial scaling in steps/unit
:param:p_speed is speed in units/sec
:param:p_accuracy_level method to use for timing, as defined for PTSimpleGPIO | 6259904507d97122c4217fc9 |
class LineStickerDownloadView(TemplateResponseMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> context = {} <NEW_LINE> context["pack_url"] = pack_url = request.GET.get("url", "") <NEW_LINE> context["pack_meta"] = pack_meta = LineStickerUtils.get_pack_meta_from_url(pack_url) <NEW_LINE> if pa... | View of LINE sticker downloader UI. | 6259904530dc7b76659a0b5a |
class MeasuresLocal(MeasuresBase, LocalTask): <NEW_LINE> <INDENT> pass | Measures on local machine
| 62599045596a897236128f43 |
class TaskList(TaskMixIn, base.BaseListCommand): <NEW_LINE> <INDENT> columns = ('id', 'status', 'name', 'cluster', 'result', 'progress') | Show list of all avaliable nodes. | 625990458e71fb1e983bcdf8 |
class dm(_dm): <NEW_LINE> <INDENT> alias = 'DM', 'DirectionalMovement' <NEW_LINE> outputs = 'plusdm', 'minusdm' <NEW_LINE> _plus = True <NEW_LINE> _minus = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.o.plusdm = self._pdm <NEW_LINE> self.o.minusdm = self._mdm | Defined by J. Welles Wilder, Jr. in 1978 in his book *"New Concepts in
Technical Trading Systems"*.
Intended to measure trend strength and directionality
Formula:
- upmove = high - high(-1)
- downmove = low(-1) - low
- +dm1 = upmove if upmove > downmove and upmove > 0 else 0
- -dm1 = downmove if downmove > up... | 6259904507d97122c4217fca |
class TestScript(domainresource.DomainResource): <NEW_LINE> <INDENT> resource_type = "TestScript" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.contact = None <NEW_LINE> self.copyright = None <NEW_LINE> self.date = None <NEW_LINE> self.description = None <NEW_LINE> self.destination... | Describes a set of tests.
A structured set of tests against a FHIR server or client implementation to
determine compliance against the FHIR specification. | 62599045462c4b4f79dbcd27 |
class AzureWorkloadSAPHanaPointInTimeRecoveryPoint(AzureWorkloadPointInTimeRecoveryPoint): <NEW_LINE> <INDENT> _validation = { 'object_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'object_type': {'key': 'objectType', 'type': 'str'}, 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': '... | Recovery point specific to PointInTime in SAPHana.
All required parameters must be populated in order to send to Azure.
:ivar object_type: Required. This property will be used as the discriminator for deciding the
specific types in the polymorphic chain of types.Constant filled by server.
:vartype object_type: str
:... | 6259904529b78933be26aa57 |
class ManagedHsmSku(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'family': {'required': True}, 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'family': {'key': 'family', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, family: Union[str, "Manag... | SKU details.
All required parameters must be populated in order to send to Azure.
:param family: Required. SKU Family of the managed HSM Pool. Possible values include: "B".
:type family: str or ~azure.mgmt.keyvault.v2021_06_01_preview.models.ManagedHsmSkuFamily
:param name: Required. SKU of the managed HSM Pool. Poss... | 62599045ec188e330fdf9bc4 |
class GitHubCodeReview(zazu.code_reviewer.CodeReview): <NEW_LINE> <INDENT> def __init__(self, github_pull_request): <NEW_LINE> <INDENT> self._pr = github_pull_request <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._pr.title <NEW_LINE> <DEDENT> @property <NEW_LINE> def status(se... | Adapts a github pull request object into a zazu CodeReview object. | 625990458e05c05ec3f6f7ef |
class AddressEncoder(JSONEncoder): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if isinstance(o, corp.Address): <NEW_LINE> <INDENT> encoded_address = { o.__class__.__name__: True, "uid": o.uid_to_json(), "deleted": o.is_deleted(), "street": o.street, "house_number": o.house_number, "city": o.city, "sta... | JSON-Encoder for Address objects. | 625990450a366e3fb87ddd0f |
class AzureFirewallApplicationRuleCollection(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'priority': {'maximum': 65000, 'minimum': 100}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'},... | Application rule collection resource.
Variables are only populated by the server, and will be ignored when sending a request.
:param id: Resource ID.
:type id: str
:param name: The name of the resource that is unique within the Azure firewall. This name can
be used to access the resource.
:type name: str
:ivar etag:... | 62599045baa26c4b54d505d3 |
class ExpiredCredentials(Exception): <NEW_LINE> <INDENT> pass | Credentials used to assume the role has expired. | 62599045b830903b9686ee0f |
class DTNotation(object): <NEW_LINE> <INDENT> def __init__(self, code): <NEW_LINE> <INDENT> if isinstance(code, string_types): <NEW_LINE> <INDENT> self._init_from_string(code) <NEW_LINE> <DEDENT> elif isinstance(code, n.ndarray): <NEW_LINE> <INDENT> code = [code] <NEW_LINE> self._dt = code <NEW_LINE> <DEDENT> elif isin... | Class for containing and manipulation DT notation.
Parameters
----------
code : str or array-like
The DT code. Must be either a string of entries separated
by spaces, or an array. | 6259904596565a6dacd2d91f |
class BaseCompletionModel(QStandardItemModel): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setColumnCount(3) <NEW_LINE> <DEDENT> def new_category(self, name, sort=None): <NEW_LINE> <INDENT> cat = QStandardItem(name) <NEW_LINE> if sort is not None: <N... | A simple QStandardItemModel adopted for completions.
Used for showing completions later in the CompletionView. Supports setting
marks and adding new categories/items easily. | 6259904594891a1f408ba08b |
class SplashScreen(tkinter.Toplevel): <NEW_LINE> <INDENT> def __init__(self, master=None, borderwidth=4, relief=tkinter.RAISED, **kw): <NEW_LINE> <INDENT> tkinter.Toplevel.__init__(self, master, relief=relief, borderwidth=borderwidth, **kw) <NEW_LINE> if self.master.master is not None: <NEW_LINE> <INDENT> self.master.m... | Base class for splash screen
Subclass and override createWidgets().
In constructor of main window/application call
- S = SplashScreen(main=self) (if caller is Toplevel)
- S = SplashScreen(main=self.master) (if caller is Frame)
- S.Destroy() after you are done creating your widgets etc.
Based closely on news p... | 6259904515baa723494632bd |
class Swish(nn.Module): <NEW_LINE> <INDENT> def forward(self, input): <NEW_LINE> <INDENT> return input * torch.sigmoid(input) | Swish 活性化関数 | 6259904523849d37ff8523e6 |
class Pipeline(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.expected = 3530599.61 <NEW_LINE> self.infile = os.path.join(data_dir, 'metagenome.fa.gz') <NEW_LINE> self.observed = microbe_census.run_pipeline({'seqfiles':[self.infile]})[0] <NEW_LINE> <DEDENT> def test_ags_estimation(sel... | check whether ags is accurately estimated for test data | 625990458a349b6b43687575 |
class DataMapper(object): <NEW_LINE> <INDENT> content_type = 'text/plain' <NEW_LINE> charset = 'utf-8' <NEW_LINE> def format(self, response): <NEW_LINE> <INDENT> res = self._prepare_response(response) <NEW_LINE> res.content = self._format_data(res.content, self.charset) <NEW_LINE> return self._finalize_response(res) <N... | Base class for all data mappers.
This class also implements ``text/plain`` datamapper. | 625990451d351010ab8f4e44 |
class BaseTapeDownloader(abc.ABC): <NEW_LINE> <INDENT> def store_metadata(self, iddir, tapes, period_func=to_decade): <NEW_LINE> <INDENT> n_tapes_added = 0 <NEW_LINE> os.makedirs(iddir, exist_ok=True) <NEW_LINE> periods = sorted(list(set([period_func(t['date']) for t in tapes]))) <NEW_LINE> logger.debug(f"storing metad... | Abstract base class for a tape downloader.
Use one of the subclasses: IATapeDownloader or PhishinTapeDownloader. | 62599045498bea3a75a58e48 |
class Dog: <NEW_LINE> <INDENT> def speak(self): <NEW_LINE> <INDENT> return 'Woof' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Dog' | One of the objects to be return | 62599045462c4b4f79dbcd29 |
class ExportPlugin(BasePlugin): <NEW_LINE> <INDENT> to = Unicode("", config=True, help="destination to export to") <NEW_LINE> def export(self, gradebook): <NEW_LINE> <INDENT> raise NotImplementedError | Base class for export plugins. | 6259904591af0d3eaad3b14f |
class Pyscenarios(Scenarios): <NEW_LINE> <INDENT> def WhenTheGeneratorIsPyscenarios(self): <NEW_LINE> <INDENT> self.output = "py/pyscenarios" <NEW_LINE> self.folder = "py/pyunit_tests" <NEW_LINE> self.ext = "_scenarios.py" <NEW_LINE> self.header = "" <NEW_LINE> self.settings = cornichon.Settings(self.output) | Test class scenario | 62599045b57a9660fecd2da8 |
class EosClearSystemCommand(Switch.CmdInterpreter): <NEW_LINE> <INDENT> def __init__(self, switch): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._switch = switch <NEW_LINE> <DEDENT> def default(self, line): <NEW_LINE> <INDENT> return 'NOTICE: Ignoring unknown command "clear system ' + line + '"' <NEW_LINE> <D... | Commands starting with 'clear'. | 62599045b5575c28eb71365f |
class _TestSFTPServerProperties(_CheckSFTP): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> async def start_server(cls): <NEW_LINE> <INDENT> return await cls.create_server(sftp_factory=_CheckPropSFTPServer) <NEW_LINE> <DEDENT> @asynctest <NEW_LINE> async def test_properties(self): <NEW_LINE> <INDENT> async with self.conne... | Unit test for checking SFTP server properties | 6259904573bcbd0ca4bcb5b8 |
class _lazy_property(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.func_name = func.__name__ <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> value = self.func(obj) <NEW_... | meant to be used for lazy evaluation of an object attribute.
property should represent non-mutable data, as it replaces itself. | 6259904573bcbd0ca4bcb5b9 |
class Logger(object): <NEW_LINE> <INDENT> events = "" <NEW_LINE> errors = "" <NEW_LINE> @staticmethod <NEW_LINE> def log(message): <NEW_LINE> <INDENT> Logger.events += "[" + str(datetime.datetime.now()) + "] " + str(message) + "\n" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def log_error(message): <NEW_LINE> <INDENT>... | Class for saving log information and creating a log file
| 62599045d53ae8145f91978b |
class Gpon(models.Model): <NEW_LINE> <INDENT> ap_mac = models.CharField(u'ap_mac',max_length=32,default="",unique = True) <NEW_LINE> gpon_state = models.CharField(u'gpon_state',max_length=64,default="",blank=True) <NEW_LINE> off_reason = models.CharField(u'off_reason',max_length=64,default="",blank=True) <NEW_LINE> gpo... | Description: Model Description | 62599045004d5f362081f97c |
class OrganizationCourseAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('course_id', 'organization', 'active') <NEW_LINE> def formfield_for_foreignkey(self, db_field, request, **kwargs): <NEW_LINE> <INDENT> if db_field.name == 'organization': <NEW_LINE> <INDENT> kwargs['queryset'] = Organization.objects.fi... | Admin for the CourseOrganization table. | 62599045a8ecb0332587253d |
class DetalheOportunidadeUpdateValue(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'id': 'int', 'nome_campo': 'str', 'conteudo': 'str' } <NEW_LINE> self.attribute_map = { 'id': 'id', 'nome_campo': 'nomeCampo', 'conteudo': 'conteudo' } <NEW_LINE> self._id = None <NEW_LINE> s... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904530c21e258be99b33 |
class PetitionStatus(enum.Enum): <NEW_LINE> <INDENT> ongoing = 1 <NEW_LINE> pending = 2 <NEW_LINE> answered = 3 <NEW_LINE> expired = 4 <NEW_LINE> deleted = 5 | ongoing : 진행중인 청원
pending : 답변 대기중인 청원
answered : 답변 된 청원
expired : 기한이 지난 청원
deleted : 삭제 된 청원 | 6259904523e79379d538d82b |
class GraphConvolutionMulti(MultiLayer): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, adj_mats, dropout=0., act=tf.nn.relu, **kwargs): <NEW_LINE> <INDENT> super(GraphConvolutionMulti, self).__init__(**kwargs) <NEW_LINE> self.adj_mats = adj_mats <NEW_LINE> self.dropout = dropout <NEW_LINE> self.act = ac... | Basic graph convolution layer for undirected graph without edge labels. | 62599045a79ad1619776b3ac |
class IPasswordRoleSchema(Interface): <NEW_LINE> <INDENT> pass | Schema used to manage the usernames and passwords
| 625990453c8af77a43b688d3 |
class IsPrefixOfModifier(Modifier): <NEW_LINE> <INDENT> def __init__(self, prefix: str | list[Any] | Callable | Types) -> None: <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> <DEDENT> def validate(self, ctx: Ctx) -> None: <NEW_LINE> <INDENT> if isinstance(ctx.val, list): <NEW_LINE> <INDENT> if not self.resolve_par... | Has prefix modifier for checking if a str is suffix of another str. | 62599045cad5886f8bdc5a14 |
class TeamConfirmAskJoinView(LoginRequiredMixin, PlayerActionMixin, NavBarMixin, DetailView): <NEW_LINE> <INDENT> model = PlayerRequest <NEW_LINE> page_title = _("Itinerary Confirmation") | Confirmation page for person who's asked
to join a club | 62599045b57a9660fecd2da9 |
class Main(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_template_scope(cls, scope): <NEW_LINE> <INDENT> return scope <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_template_file_scope(cls, file, scope): <NEW_LINE> <INDENT> return scope <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_manifest_sc... | Contains the main application specific business logic. | 6259904507d97122c4217fce |
class Device(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length = 256) <NEW_LINE> begin_time = models.DateTimeField() <NEW_LINE> end_time = models.DateTimeField(default=max_datetime) <NEW_LINE> community = models.CharField(max_length = 128) <NEW_LINE> active = models.BooleanField(default = True) <NEW... | A system which is pollable via SNMP.
Referred to as a Managed Device in SNMP terminology. | 62599045462c4b4f79dbcd2b |
class RuleGroupGroup(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'ir.rule.group-res.group' <NEW_LINE> rule_group = fields.Many2One('ir.rule.group', 'Rule Group', ondelete='CASCADE', select=True, required=True) <NEW_LINE> group = fields.Many2One('res.group', 'Group', ondelete='CASCADE', select=True, required=True) <NEW_LI... | Rule Group - Group | 6259904526238365f5fade88 |
class UnexpectedJsonFormatError(Exception): <NEW_LINE> <INDENT> pass | Json is not in expected format, probably service has changed during time. | 62599045ec188e330fdf9bc8 |
@ui.register_ui( item_change_password=ui.UI(By.CSS_SELECTOR, '*[id*="action_change_password"]'), item_toggle_user=ui.UI(By.CSS_SELECTOR, '[id$="action_toggle"]')) <NEW_LINE> class DropdownMenu(_ui.DropdownMenu): <NEW_LINE> <INDENT> pass | Dropdown menu for user row. | 625990450a366e3fb87ddd13 |
class Database(cgtwq.Database): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_shot(cls, shot, default=None): <NEW_LINE> <INDENT> data = cgtwq.PROJECT.select_all().get_fields('code', 'database') <NEW_LINE> for i in data: <NEW_LINE> <INDENT> code, database = i <NEW_LINE> if unicode(shot).startswith(code): <NEW_LIN... | Optimized cgtwq database fro nuke. | 6259904510dbd63aa1c71f07 |
class BankAccount: <NEW_LINE> <INDENT> def __init__(self, name, initial_deposit, password): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.accnum = randint(10000,99999) <NEW_LINE> self.password = password <NEW_LINE> self.balance = int(initial_deposit) <NEW_LINE> self.transactions = {} <NEW_LINE> <DEDENT> def show... | A bank account class with the following properties:
AccNumber: A unique identifier for the bank account
Name: A string representing owner of bank account
Balance: Bank account balance
Transactions: List of transaction under the account | 62599045d4950a0f3b1117d8 |
class BatchTest(integration.ShellCase): <NEW_LINE> <INDENT> def test_batch_run(self): <NEW_LINE> <INDENT> ret = 'Executing run on [\'sub_minion\']' <NEW_LINE> cmd = self.run_salt('\'*\' test.echo \'batch testing\' -b 50%') <NEW_LINE> self.assertIn(ret, cmd) <NEW_LINE> <DEDENT> def test_batch_run_number(self): <NEW_LINE... | Integration tests for the salt.cli.batch module | 62599045287bf620b6272f15 |
class PLShift(PBinOp): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "(%s << %s)" % (self.a, self.b) <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> a = Pattern.value(self.a) <NEW_LINE> b = Pattern.value(self.b) <NEW_LINE> return None if a is None or b is None else a << b | PLShift: Binary left-shift (shorthand: patternA << patternB) | 625990453eb6a72ae038b98f |
class Index(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> value = models.FloatField() <NEW_LINE> min_value = models.FloatField() <NEW_LINE> max_value = models.FloatField() <NEW_LINE> unit = models.CharField(max_length=20) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> retur... | 体检指标 | 6259904573bcbd0ca4bcb5ba |
class Actor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fc1_units=200, fc2_units=150): <NEW_LINE> <INDENT> super(Actor, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fc1 = nn.Linear(state_size, fc1_units) <NEW_LINE> self.fc2 = nn.Linear(fc1_units, ... | Actor (Policy) Model. | 6259904515baa723494632c0 |
@nine <NEW_LINE> class BaseRootResource(object): <NEW_LINE> <INDENT> __name__ = '' <NEW_LINE> __parent__ = None <NEW_LINE> def __init__(self, request): <NEW_LINE> <INDENT> self._request = request <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<{}>'.format(type(self).__name__) <NEW_LINE> <DEDENT> de... | Base class for your Root resource. | 62599045004d5f362081f97d |
class TransformProcessor: <NEW_LINE> <INDENT> def __init__(self, survey, ftp_conn): <NEW_LINE> <INDENT> self._base_url = settings.SDX_TRANSFORM_CS_URL <NEW_LINE> self.survey = survey <NEW_LINE> self.tx_id = "" <NEW_LINE> self.logger = get_logger() <NEW_LINE> self._setup_logger() <NEW_LINE> self.ftp = ftp_conn <NEW_LINE... | Transforms and passes results to ftp | 6259904523849d37ff8523ea |
class SkysparkScramHaystackSession(HaystackSession, evalexpr.EvalOpsMixin): <NEW_LINE> <INDENT> _AUTH_OPERATION = SkysparkScramAuthenticateOperation <NEW_LINE> def __init__(self, uri, username, password, project, **kwargs): <NEW_LINE> <INDENT> super(SkysparkScramHaystackSession, self).__init__(uri, 'api/%s' % project,*... | The SkysparkHaystackSession class implements some base support for
Skyspark servers. | 625990451d351010ab8f4e48 |
class ValueItem(Item): <NEW_LINE> <INDENT> yaml_tag = '!ValueItem' <NEW_LINE> @classmethod <NEW_LINE> def from_yaml(cls, loader, node): <NEW_LINE> <INDENT> logging.debug('{}:from_yaml(loader={})'.format(cls.__name__, loader)) <NEW_LINE> default, select, value_desc = None, list(), None <NEW_LINE> for elem in node.value:... | Class to process VlaueItem tag | 625990458a43f66fc4bf34c2 |
class Table(object): <NEW_LINE> <INDENT> def __init__(self, table="", primary="", fields = None, readfields = None, joined = None, suffix=""): <NEW_LINE> <INDENT> self.table = table <NEW_LINE> self.primary = primary <NEW_LINE> if fields is not None: <NEW_LINE> <INDENT> self.fields = fields <NEW_LINE> <DEDENT> else: <NE... | Datos generales de una Tabla | 625990450fa83653e46f620a |
class gpio_write(LinuxCommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> LinuxCommand.__init__(self) <NEW_LINE> self.add_argument('gpio', metavar='GPIO', help="The gpio to write to") <NEW_LINE> self.add_argument('value', metavar='VALUE', help="The value to set") <NEW_LINE> <DEDENT> def run(self, con,... | gpio_write sets a gpio to output and assigns the value specified | 62599045d10714528d69f024 |
class AmpClientFactory(protocol.ReconnectingClientFactory): <NEW_LINE> <INDENT> initialDelay = 1 <NEW_LINE> factor = 1.5 <NEW_LINE> maxDelay = 1 <NEW_LINE> noisy = False <NEW_LINE> def __init__(self, portal): <NEW_LINE> <INDENT> self.portal = portal <NEW_LINE> self.protocol = AMPProtocol <NEW_LINE> <DEDENT> def started... | This factory creates an instance of the Portal, an AMPProtocol
instances to use to connect | 62599045462c4b4f79dbcd2d |
class ImportMassWorker(QThread): <NEW_LINE> <INDENT> signal = QtCore.Signal(int, int) <NEW_LINE> def __init__(self, window): <NEW_LINE> <INDENT> QThread.__init__(self) <NEW_LINE> self.window = window <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> imp_cnt = 0 <NEW_LINE> fail_cnt = 0 <NEW_LINE> input_dir = self.w... | The ImportMassWorker class runs as a separate thread in the
application to prevent application snag. This thread will attempt
to import specified binary files into the backend as individual
patches. | 62599045ec188e330fdf9bca |
class UserSignTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.base_url = "http://127.0.0.1:8000/api/user_sign/" <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> print(self.result) <NEW_LINE> <DEDENT> @parameterized.expand([ ("all_null", "", "", 10021, "parameter error")... | 用户签到 | 62599045d6c5a102081e344b |
class BooleanType(Type): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BooleanType, self).__init__("boolean", bool) <NEW_LINE> <DEDENT> VALUES = {"yes":1, "true":1, "on":1, "no":0, "false":0, "off":0} <NEW_LINE> def validate(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if isinstance(va... | A boolean schema type | 6259904576d4e153a661dc0d |
class OPT(SCPINode, SCPIQuery): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "*OPT" <NEW_LINE> args = [] | *OPT
Arguments: | 6259904521a7993f00c67299 |
class HashFunction(): <NEW_LINE> <INDENT> def __init__(self, out_len=0, key_len=0, N=0): <NEW_LINE> <INDENT> self.key_len, self.out_len, self.N = key_len, out_len, N <NEW_LINE> self.hashes = {} <NEW_LINE> self.hashes_int = {} <NEW_LINE> <DEDENT> def hash(self, message, key=None): <NEW_LINE> <INDENT> if (key is not None... | This class simulates a hash function. It can emulate a hash function with
or without a key and with any key or output length (in bytes).
Example Usage:
.. testcode::
from playcrypt.ideal.hash_function import HashFunction
h = HashFunction(16)
h1 = h.hash("Hello World!")
h2 = h.hash("H3110 W0r1d!")
... | 6259904596565a6dacd2d922 |
class Config(): <NEW_LINE> <INDENT> def load(cfgpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config.ini'), globals = globals()): <NEW_LINE> <INDENT> cfg = ConfigParser(inline_comment_prefixes=('#'), interpolation=ExtendedInterpolation()) <NEW_LINE> cfg.optionxform = str <NEW_LINE> try: <NEW_LINE> <... | Configuration constants. | 62599045d7e4931a7ef3d3a6 |
class TestInvalidResourceName(BaseTestCase): <NEW_LINE> <INDENT> def test_bad_syntax(self): <NEW_LINE> <INDENT> e = rname.InvalidResourceName.bad_syntax("syntax", "resource") <NEW_LINE> assert str(e) == "Could not parse 'resource'. The syntax is 'syntax'." <NEW_LINE> e = rname.InvalidResourceName.bad_syntax("syntax", "... | Test the creation of InvalidResourceName errors. | 6259904550485f2cf55dc2b7 |
class OpenStackAction(base.Action): <NEW_LINE> <INDENT> _kwargs_for_run = {} <NEW_LINE> _client_class = None <NEW_LINE> client_method_name = None <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._kwargs_for_run = kwargs <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def _get_client(self): <NEW_LINE... | OpenStack Action.
OpenStack Action is the basis of all OpenStack-specific actions,
which are constructed via OpenStack Action generators. | 62599045dc8b845886d548ea |
class GrayscaleHistograms(Histograms): <NEW_LINE> <INDENT> def __init__(self, image_kwargs, *args, **kwargs): <NEW_LINE> <INDENT> self.kwargs = image_kwargs <NEW_LINE> super(GrayscaleHistograms, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def predict(self, observations): <NEW_LINE> <INDENT> rankings = [] <NEW_L... | This class represents a task 1, subtask A model that ranks pairs of images based on the
difference in their grayscale histograms. | 625990454e696a045264e7b9 |
class Corps(): <NEW_LINE> <INDENT> def __init__(self, masse, position, vitesse): <NEW_LINE> <INDENT> self._masse = masse <NEW_LINE> self._position = position <NEW_LINE> self._vitesse = vitesse <NEW_LINE> <DEDENT> @property <NEW_LINE> def masse(self): <NEW_LINE> <INDENT> return self._masse <NEW_LINE> <DEDENT> @masse.set... | Cette classe est un corps qui a une masse, une position et une vitesse, ceci en 2D. | 62599045097d151d1a2c239b |
class ECCError(Exception): <NEW_LINE> <INDENT> pass | Indicates that something went wrong during communication with the ECC server. | 62599045e64d504609df9d69 |
class Menubar(tkinter.Menu): <NEW_LINE> <INDENT> def __init__(self, parent, main_window): <NEW_LINE> <INDENT> super().__init__(tearoff=0) <NEW_LINE> self.parent = parent <NEW_LINE> self.main_window = main_window <NEW_LINE> self.file_menu = tkinter.Menu(self, tearoff=0) <NEW_LINE> self.file_menu.add_command(label="New f... | Menu bar displayed on the main window. | 625990458da39b475be04520 |
class Loader: <NEW_LINE> <INDENT> def __init__(self, config='~/.f2mrc', silent=False): <NEW_LINE> <INDENT> self.silent = silent <NEW_LINE> try: <NEW_LINE> <INDENT> with open(os.path.expanduser(config), 'r') as f: <NEW_LINE> <INDENT> self.config = json.loads(f.read()) <NEW_LINE> <DEDENT> <DEDENT> except: <NEW_LINE> <IND... | Loads the config/list of feeds from a file | 62599045462c4b4f79dbcd2f |
class City: <NEW_LINE> <INDENT> def __init__(self, name, city_height, city_width, tiles): <NEW_LINE> <INDENT> self.name: str = name <NEW_LINE> self.CITY_HEIGHT: int = city_height <NEW_LINE> self.CITY_WIDTH: int = city_width <NEW_LINE> self.__tiles: list = tiles <NEW_LINE> assert len(self.__tiles) == self.CITY_HEIGHT an... | This class contains attributes of a city in Mithoter Planet. | 62599045ec188e330fdf9bcc |
class ConnectMongoDB(): <NEW_LINE> <INDENT> def __init__(self, host='localhost', port=27017): <NEW_LINE> <INDENT> self.client = MongoClient(host, port) <NEW_LINE> dbName = 'blog' <NEW_LINE> self.db = self.client[dbName] <NEW_LINE> <DEDENT> def get_collection(self, tableName): <NEW_LINE> <INDENT> return self.db[tableNam... | 连接MongoDB,且提供插入,更新,删除,查询的操作 | 6259904545492302aabfd80d |
@add_common_docstring(**_frame_parameters()) <NEW_LINE> class HeliographicCarrington(BaseHeliographic): <NEW_LINE> <INDENT> name = "heliographic_carrington" <NEW_LINE> _wrap_angle = 360*u.deg <NEW_LINE> observer = ObserverCoordinateAttribute(HeliographicStonyhurst) | A coordinate or frame in the Carrington Heliographic (HGC) system.
- The origin is the center of the Sun.
- The Z-axis (+90 degrees latitude) is aligned with the Sun's north pole.
- The X-axis and Y-axis rotate with a period of 25.38 days.
This system differs from Stonyhurst Heliographic (HGS) in its definition of lo... | 62599045d99f1b3c44d069d1 |
class ApiException(Exception): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_message(errorCode): <NEW_LINE> <INDENT> return ErrorCode.ERROR_MESSAGE.get(errorCode, 2000) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_error_result(errorCode): <NEW_LINE> <INDENT> return { "msg": ApiException.get_message(error... | 全局错误码exception,搭配ErrorCode使用 | 625990453eb6a72ae038b994 |
class NiceAverageCopier(Player): <NEW_LINE> <INDENT> name = 'Nice Average Copier' <NEW_LINE> classifier = { 'memory_depth': float('inf'), 'stochastic': True, 'makes_use_of': set(), 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } <NEW_LINE> @staticmethod <NEW_LINE> def strategy(oppone... | Same as Average Copier, but always starts by cooperating. | 6259904523849d37ff8523ee |
class CollisionSystem(system.System): <NEW_LINE> <INDENT> def __init__(self, entity_manager=None, *args, **kwargs): <NEW_LINE> <INDENT> super(CollisionSystem, self).__init__(*args, **kwargs) <NEW_LINE> self.entity_manager = entity_manager <NEW_LINE> <DEDENT> def update(self, dt): <NEW_LINE> <INDENT> col_components, tra... | Collision System. | 6259904573bcbd0ca4bcb5be |
class ProtectedItemOperationResultsOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = con... | ProtectedItemOperationResultsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.recoveryservicesba... | 6259904523e79379d538d831 |
class DivisionViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Division.objects.all() <NEW_LINE> serializer_class = DivisionSerializer <NEW_LINE> permission_classes = [permissions.AllowAny] | Division means Class | 625990456fece00bbacccce7 |
class time_tracker(object): <NEW_LINE> <INDENT> def __init__(self, f): <NEW_LINE> <INDENT> self.f = f <NEW_LINE> self.counter = 0 <NEW_LINE> self.total_time = 0 <NEW_LINE> self.__name__ = f.__name__ <NEW_LINE> <DEDENT> def __call__(self, *args): <NEW_LINE> <INDENT> from time import time, ctime <NEW_LINE> start_time = t... | track number of function calls, cost of time, and total time | 6259904573bcbd0ca4bcb5bf |
@final <NEW_LINE> class Const(Value): <NEW_LINE> <INDENT> src_loc = None <NEW_LINE> @staticmethod <NEW_LINE> def normalize(value, shape): <NEW_LINE> <INDENT> width, signed = shape <NEW_LINE> mask = (1 << width) - 1 <NEW_LINE> value &= mask <NEW_LINE> if signed and value >> (width - 1): <NEW_LINE> <INDENT> value |= ~mas... | A constant, literal integer value.
Parameters
----------
value : int
shape : int or tuple or None
Either an integer ``width`` or a tuple ``(width, signed)`` specifying the number of bits
in this constant and whether it is signed (can represent negative values).
``shape`` defaults to the minimum possible wi... | 62599045462c4b4f79dbcd31 |
class LsitsParam(Model): <NEW_LINE> <INDENT> def __init__(self, switchtype: str=None, line: str=None, station: str=None, eletype: str=None, swtichstatus: str=None): <NEW_LINE> <INDENT> self.swagger_types = { 'switchtype': str, 'line': str, 'station': str, 'eletype': str, 'swtichstatus': str } <NEW_LINE> self.attribute_... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904576d4e153a661dc0f |
class CheckingClassifier(ClassifierMixin, BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, check_y=None, check_X=None, foo_param=0, expected_fit_params=None): <NEW_LINE> <INDENT> self.check_y = check_y <NEW_LINE> self.check_X = check_X <NEW_LINE> self.foo_param = foo_param <NEW_LINE> self.expected_fit_params = ex... | Dummy classifier to test pipelining and meta-estimators.
Checks some property of X and y in fit / predict.
This allows testing whether pipelines / cross-validation or metaestimators
changed the input.
Parameters
----------
check_y
check_X
foo_param
expected_fit_params
Attributes
----------
classes_ | 62599045287bf620b6272f1b |
class PluginMount(type): <NEW_LINE> <INDENT> def __init__(cls, name, bases, attrs): <NEW_LINE> <INDENT> if not hasattr(cls, "plugins"): <NEW_LINE> <INDENT> cls.plugins = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not hasattr(cls, "__omitted__"): <NEW_LINE> <INDENT> cls.plugins.append(cls) | Generic plugin mount point (= entry point) for pydifact plugins.
.. note::
Plugins that have an **__omitted__** attriute are not added to the list! | 62599045baa26c4b54d505dd |
class OutputGadget(Gadget): <NEW_LINE> <INDENT> pass | any gadget that produces some signal to the outside world should inherit this. | 62599045d99f1b3c44d069d2 |
class LeNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LeNet, self).__init__() <NEW_LINE> self.conv1 = nn.Conv2d(1, 6, 3) <NEW_LINE> self.conv2 = nn.Conv2d(6, 16, 3) <NEW_LINE> self.drop1 = nn.Dropout(p=0.5) <NEW_LINE> self.fc1 = nn.Linear(16 * 6 * 6, 120) <NEW_LINE> self.drop2 = nn.D... | LeNet CNN architecture. | 6259904545492302aabfd80f |
class DeleteCharactersCharacterIdContactsInternalServerError(object): <NEW_LINE> <INDENT> def __init__(self, error=None): <NEW_LINE> <INDENT> self.swagger_types = { 'error': 'str' } <NEW_LINE> self.attribute_map = { 'error': 'error' } <NEW_LINE> self._error = error <NEW_LINE> <DEDENT> @property <NEW_LINE> def error(sel... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904550485f2cf55dc2ba |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.