code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class AirfieldGroup(Group): <NEW_LINE> <INDENT> def __init__(self, mcu_text: str, group_file: pathlib.Path): <NEW_LINE> <INDENT> super().__init__(group_file) <NEW_LINE> self.mcu_text = mcu_text <NEW_LINE> <DEDENT> def make(self): <NEW_LINE> <INDENT> for file_ext in self.files: <NEW_LINE> <INDENT> if file_ext == 'Group'... | Группа аэродрома | 62598f7721bff66bcd722567 |
class HelloWorldPanel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = "ShortCuts Panel" <NEW_LINE> bl_idname = "OBJECT_PT_hello" <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_region_type = 'TOOLS' <NEW_LINE> bl_category="Shortcuts" <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_... | Creates a Panel in the Object properties window | 62598f77d10714528d69d7d1 |
class Net(nn.Module): <NEW_LINE> <INDENT> torch_device = None <NEW_LINE> if torch.cuda.is_available(): <NEW_LINE> <INDENT> torch_device = torch.device("cuda:0") <NEW_LINE> if verbouse: <NEW_LINE> <INDENT> print("Running on the GPU") <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> torch_device = torch.device("cpu... | Реализация нейронной сети | 62598f778a349b6b43685b46 |
class getAllBuddyMembers_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING,None), None, ), (1, TType.STRUCT, 'e', (TalkException, TalkException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e =... | Attributes:
- success
- e | 62598f7782261d6c5272fb58 |
@python_2_unicode_compatible <NEW_LINE> class Work(RunnerModel): <NEW_LINE> <INDENT> kind = models.CharField(max_length=1, choices=RUNNERWORK_CHOICES) <NEW_LINE> period = models.CharField(max_length=4) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _('Work Info') <NEW_LINE> verbose_name_plural = _('Works Inf... | TODO: Doc
passage en python 3 | 62598f7776d4e153a661c519 |
class TestV1SelfSubjectRulesReviewSpec(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 testV1SelfSubjectRulesReviewSpec(self): <NEW_LINE> <INDENT> pass | V1SelfSubjectRulesReviewSpec unit test stubs | 62598f7776d4e153a661c51a |
class Discriminator(nn.Module): <NEW_LINE> <INDENT> def __init__(self, channel=1): <NEW_LINE> <INDENT> super(Discriminator, self).__init__() <NEW_LINE> self.channel = channel <NEW_LINE> self.net = nn.Sequential( nn.Conv2d(self.channel, 64, 5, 1, 0, bias=False), nn.ReLU(True), nn.Conv2d(64, 128, 3, 2, 1, bias=False), nn... | discriminator for GAN | 62598f778e05c05ec3f6eac8 |
class ApplyAbs3FloatsOverride(LeafClass, ApplyAbsOverride): <NEW_LINE> <INDENT> def __init__(self): pass <NEW_LINE> def compute(self, plug, dataBlock): pass <NEW_LINE> @staticmethod <NEW_LINE> def initializer(): pass <NEW_LINE> attrValue = None <NEW_LINE> kTypeId = None <NEW_LINE> kTypeName = 'applyAbs3FloatsOverride' ... | Apply a 3 floats absolute override. | 62598f774e696a045264da81 |
class LivingSpace(Room): <NEW_LINE> <INDENT> def __init__(self, room_name): <NEW_LINE> <INDENT> super(LivingSpace, self).__init__( room_name, room_type='Living Space', capacity=4) | The LivingSpace class inherits its properties and
methods from the Room class and overrides properties
such as capacity using the super function call. | 62598f7763f4b57ef00859f1 |
class job_types(SubCommand): <NEW_LINE> <INDENT> name = __name__.split('.').pop() <NEW_LINE> names = [name] <NEW_LINE> visible = False <NEW_LINE> def setOptions(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> return CommandResult(0, {'job_types': ['cmssw']}) | List all the job types the client supports | 62598f77be383301e02530fd |
class Student: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, age): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def to_json(self): <NEW_LINE> <INDENT> return self.__dict__ | A student class. | 62598f77e76e3b2f99fd8336 |
class MinimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def max_value(self, state, agent, maxAgents, depth, maxDepth): <NEW_LINE> <INDENT> if depth > maxDepth or state.isWin() or state.isLose(): <NEW_LINE> <INDENT> return [self.evaluationFunction(state), "none"] <NEW_LINE> <DEDENT> depth += 1 <NEW_LINE> v = -999... | Your minimax agent (question 2) | 62598f7715baa72349461885 |
class Identifier: <NEW_LINE> <INDENT> digit = None <NEW_LINE> userid = None <NEW_LINE> def __init__(self, digit, userid) : <NEW_LINE> <INDENT> self.digit = digit <NEW_LINE> self.userid = userid <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Identifier<" + str(self.digit) + ", " + str(self.userid) + ... | A single digit for a position | 62598f7738b623060ffa899f |
class AnalyticAccount(orm.Model): <NEW_LINE> <INDENT> _inherit = 'account.analytic.account' <NEW_LINE> _columns = { 'contact_id': fields.many2one( 'res.partner', 'Contact', domain="[('parent_id','child_of',partner_id)" ",('parent_id','!=',False)]"), } | Add Contact to Analytic Accounts | 62598f775e10d32532ce3570 |
class CornersProblem(search.SearchProblem): <NEW_LINE> <INDENT> def __init__(self, startingGameState): <NEW_LINE> <INDENT> self.walls = startingGameState.getWalls() <NEW_LINE> self.startingPosition = startingGameState.getPacmanPosition() <NEW_LINE> top, right = self.walls.height-2, self.walls.width-2 <NEW_LINE> self.co... | This search problem finds paths through all four corners of a layout.
You must select a suitable state space and successor function | 62598f7730c21e258be9810b |
class ImageLoaderFFPy(ImageLoaderBase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def extensions(): <NEW_LINE> <INDENT> return ('bmp', 'dpx', 'exr', 'gif', 'ico', 'jpeg', 'jpg2000', 'jpg', 'jls', 'pam', 'pbm', 'pcx', 'pgm', 'pgmyuv', 'pic', 'png', 'ppm', 'ptx', 'sgi', 'ras', 'tga', 'tiff', 'webp', 'xbm', 'xface', 'x... | Image loader based on the ffpyplayer library.
.. versionadded:: 1.8.1
.. note:
This provider may support more formats than what is listed in
:meth:`extensions`. | 62598f77d99f1b3c44d04fb2 |
class Session (object): <NEW_LINE> <INDENT> def __init__(self, manager, id): <NEW_LINE> <INDENT> self.touch() <NEW_LINE> self.id = id <NEW_LINE> self.data = {} <NEW_LINE> self.active = True <NEW_LINE> self.manager = manager <NEW_LINE> self.greenlets = [] <NEW_LINE> <DEDENT> def destroy(self): <NEW_LINE> <INDENT> self.a... | Holds the HTTP session data | 62598f7791af0d3eaad39711 |
class PortletsBase(object): <NEW_LINE> <INDENT> def get_portlets(self, slot): <NEW_LINE> <INDENT> return portlets.utils.get_portlets(self, slot) <NEW_LINE> <DEDENT> def get_slots(self): <NEW_LINE> <INDENT> return portlets.utils.is_blocked(self) <NEW_LINE> <DEDENT> def has_portlets(self, slot): <NEW_LINE> <INDENT> retur... | Mixin class to make objects portlets aware.
| 62598f77cad5886f8bdc4c28 |
class TestUserGETApi(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user1 = User.objects.create(first_name="Sanya", email="test1@test.com", password="secret_password") <NEW_LINE> self.user2 = User.objects.create(first_name="Yura", email="test2@test.com",... | Test user list and user detail for AllowAny | 62598f7721bff66bcd722569 |
class MlEngine(base.Group): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> resources.REGISTRY.RegisterApiByName('ml', 'v1') | (REMOVED) Manage Cloud ML Engine jobs and models.
This command group has been deprecated; please use `gcloud ml-engine versions`
instead.
The {command} command group lets you manage Google Cloud ML Engine jobs and
training models.
Cloud ML Engine is a managed service that enables you to easily build machine
learning... | 62598f77d99f1b3c44d04fb3 |
class MTingRule(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MTingRule, self).__init__() <NEW_LINE> self.__win_rule_mgr = None <NEW_LINE> self.__table_tile_mgr = None <NEW_LINE> self.__table_config = {} <NEW_LINE> <DEDENT> def setTableConfig(self, config): <NEW_LINE> <INDENT> self.__table_... | 听牌规则 | 62598f77ec188e330fdf81a6 |
class DeliveryRecord(models.Model, ToDictMixin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _('Delivery Record') <NEW_LINE> verbose_name_plural = _('Delivery Records') <NEW_LINE> <DEDENT> address_country = models.CharField(max_length=100, verbose_name=_('address country')) <NEW_LINE> address_sta... | This model contains delivery information | 62598f7771ff763f4b5e7072 |
class Distribution(core.Block): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._mean = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def mean(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def pdf(self, x): <NEW_LINE> <INDENT> raise NotImplemente... | Probability distribution.
Examples
--------
.. testsetup::
import numpy as np
from pypeline.util.math.stat import Wishart
import scipy.linalg as linalg
np.random.seed(0)
def hermitian_array(N: int) -> np.ndarray:
'''
Construct a (N, N) Hermitian matrix.
'''
D = np.arange(1... | 62598f778da39b475be02ae8 |
class CheckboxFormField(ChooseFormField): <NEW_LINE> <INDENT> __slots__ = ('input_type', 'name', 'values', 'value') <NEW_LINE> def __init__(self, name, values): <NEW_LINE> <INDENT> super(CheckboxFormField, self).__init__(name, values) <NEW_LINE> self.input_type = INPUT_TYPE_CHECKBOX | Represent a type="radio" with all the values in the "values" list.
<form action="demo_form.asp" method="get">
<input type="checkbox" name="vehicle" value="Bike"> I have a bike
<input type="checkbox" name="vehicle" value="Car" checked> I have a car
<input type="submit" value="Submit">
</form>
... | 62598f7782261d6c5272fb59 |
class RouterStatusEntryV3(RouterStatusEntry): <NEW_LINE> <INDENT> TYPE_ANNOTATION_NAME = 'network-status-consensus-3' <NEW_LINE> ATTRIBUTES = dict(RouterStatusEntry.ATTRIBUTES, **{ 'digest': (None, _parse_r_line), 'or_addresses': ([], _parse_a_line), 'identifier_type': (None, _parse_id_line), 'identifier': (None, _pars... | Information about an individual router stored within a version 3 network
status document.
:var list or_addresses: **\*** relay's OR addresses, this is a tuple listing
of the form (address (**str**), port (**int**), is_ipv6 (**bool**))
:var str identifier_type: identity digest key type
:var str identifier: base64 enc... | 62598f77b57a9660fecd1384 |
class ProcWithSpec(Process): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def define(cls, spec): <NEW_LINE> <INDENT> super(ProcWithSpec, cls).define(spec) <NEW_LINE> spec.input('a', default=1) | Process with a spec and a docstring | 62598f7776d4e153a661c51c |
class RandomAlgorithm(MovingAlgorithm): <NEW_LINE> <INDENT> def move_elevators(self, elevators: List[Elevator], waiting: Dict[int, List[Person]], max_floor: int) -> List[Direction]: <NEW_LINE> <INDENT> direction = [Direction.UP, Direction.STAY, Direction.DOWN] <NEW_LINE> result = [] <NEW_LINE> for elevator in elevators... | A moving algorithm that picks a random direction for each elevator. | 62598f778e05c05ec3f6eac9 |
class IEC104_IO_F_SC_NB_1_IOA(IEC104_IO_F_SC_NB_1): <NEW_LINE> <INDENT> name = 'F_SC_NB_1 (+ioa)' <NEW_LINE> fields_desc = [LEThreeBytesField('information_object_address', 0)] + IEC104_IO_F_SC_NB_1.fields_desc | extended version of IEC104_IO_F_SC_NB_1 containing an individual
information object address | 62598f7766656f66f7d59cf8 |
class Dim(object): <NEW_LINE> <INDENT> __slots__ = 'start', 'stop', 'size', 'stride' <NEW_LINE> def __init__(self, start, stop, size, stride): <NEW_LINE> <INDENT> if stop < start: <NEW_LINE> <INDENT> raise ValueError("end offset is before start offset") <NEW_LINE> <DEDENT> self.start = start <NEW_LINE> self.stop = stop... | A single dimension of the array
Attributes
----------
start:
start offset
stop:
stop offset
size:
number of items
stride:
item stride | 62598f770383005118f6d008 |
class Sloop(Ship): <NEW_LINE> <INDENT> classId = 'f' <NEW_LINE> _attrCost = [0, 0, 0, 0, 0, 0] <NEW_LINE> _attrVision = 7 <NEW_LINE> _attrMaxActions = 5 <NEW_LINE> _attrRecover = 5*60 <NEW_LINE> _attrDamage = 6 <NEW_LINE> _attrHealth = 10 | A buildable sloop. | 62598f7796565a6dacd2cbfe |
class Room(object): <NEW_LINE> <INDENT> current_room = '' <NEW_LINE> def __init__(self,room_name): <NEW_LINE> <INDENT> self.greeting = "You are now in the %s." % room_name <NEW_LINE> self.room_name = room_name <NEW_LINE> self.connecting_rooms = {} <NEW_LINE> <DEDENT> def connect_rooms(self,connecting_rooms): <NEW_LINE>... | All rooms have greeting, instructions, direction_choice, direction instructions, room instructions, and room name.
Dictionary that lists direction and corresponding room. | 62598f77287bf620b62714be |
@attr.s(frozen=True) <NEW_LINE> class MatchRule: <NEW_LINE> <INDENT> channel_names: Callable | set[str] | str = attr.ib( factory=frozenset, converter=set_or_callable ) <NEW_LINE> generic_ids: Callable | set[str] | str = attr.ib( factory=frozenset, converter=set_or_callable ) <NEW_LINE> manufacturers: Callable | set[str... | Match a ZHA Entity to a channel name or generic id. | 62598f776aa9bd52df0d47dd |
class HomeView(ListView): <NEW_LINE> <INDENT> model = Menu <NEW_LINE> template_name = 'reservations/home.html' <NEW_LINE> context_object_name = 'menus' <NEW_LINE> paginate_by = 10 <NEW_LINE> today_date = timezone.localdate() <NEW_LINE> queryset = Menu.objects.filter(created__date__lt=today_date) <NEW_LINE> def get_cont... | Simple ListView that uses the home template, the template itself differentiates
the content based on whether or not the user is authenticated and/or a chef. | 62598f77bde94217f37072ea |
class TestRecomputeCounts(unittest.TestCase): <NEW_LINE> <INDENT> def test_recompute_counts(self): <NEW_LINE> <INDENT> layer = load_test_vector_layer( 'gisv4', 'exposure', 'population.geojson', clone=True) <NEW_LINE> self.assertIn( female_count_field['key'], layer.keywords['inasafe_fields']) <NEW_LINE> layer = prepare_... | Test class. | 62598f778a43f66fc4bf1a85 |
@method_decorator(login_required, name='dispatch') <NEW_LINE> class EventDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> serializer_class = EventSerializer <NEW_LINE> permission_classes = [hasDataPermission] <NEW_LINE> queryset = Event.objects.all() | Visualize and modify an existing Event instance. | 62598f7730dc7b766599f163 |
class Betydningsbeskrivelse(ABC): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def text(self) -> dict: <NEW_LINE> <INDENT> return self._text <NEW_LINE> <DEDENT> @text.setter <NEW_LINE> def text(self, text: dict) -> None: <NEW_LINE> <INDENT> self._text... | A class representing a concept.
Attributes:
text:
remark:
scope:
relationtosource:
source:
modified:
example: | 62598f770383005118f6d009 |
class _WrappedHybridDecrypt(_hybrid_decrypt.HybridDecrypt): <NEW_LINE> <INDENT> def __init__(self, pset: core.PrimitiveSet): <NEW_LINE> <INDENT> self._primitive_set = pset <NEW_LINE> <DEDENT> def decrypt(self, ciphertext: bytes, context_info: bytes) -> bytes: <NEW_LINE> <INDENT> if len(ciphertext) > core.crypto_format.... | Implements HybridDecrypt for a set of HybridDecrypt primitives. | 62598f77796e427e5384e09e |
class metasploit(): <NEW_LINE> <INDENT> def __init__(self, ip=None, output=None): <NEW_LINE> <INDENT> self.ip = ip <NEW_LINE> self.output = output <NEW_LINE> <DEDENT> def nmap(self): <NEW_LINE> <INDENT> c = ("db_nmap -v -T4 -sV -PA --version-all --osscan-guess -sC -sS {ip}".format( ip=self.ip ) ) <NEW_LINE> c += ("\nse... | docstring for metasploit | 62598f77b57a9660fecd1386 |
class Report_8f21(Report): <NEW_LINE> <INDENT> _format = '>BHHHHhB' <NEW_LINE> _values = [] | Request Accuracy Information report | 62598f77d10714528d69d7d6 |
class TestClientLoadView(TestInspectViewBase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def CreateLeasedClientRequest( client_id=rdfvalue.ClientURN("C.0000000000000001"), token=None): <NEW_LINE> <INDENT> flow.GRRFlow.StartFlow(client_id=client_id, flow_name="ListProcesses", token=token) <NEW_LINE> with queue_manage... | Tests for ClientLoadView. | 62598f774d74a7450cd58b5a |
class SublayerConnection(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size, dropout): <NEW_LINE> <INDENT> super(SublayerConnection, self).__init__() <NEW_LINE> self.norm = LayerNorm(size) <NEW_LINE> self.dropout = nn.Dropout(dropout) <NEW_LINE> <DEDENT> def forward(self, x, sublayer): <NEW_LINE> <INDENT> temp = s... | A residual connection followed by a layer norm.
Note for code simplicity the norm is first as opposed to last. | 62598f7726238365f5fac47c |
class LabelProcessor: <NEW_LINE> <INDENT> def __init__(self, file_path): <NEW_LINE> <INDENT> self.colormap = self.read_color_map(file_path) <NEW_LINE> self.cm2lbl = self.encode_label_pix(self.colormap) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read_color_map(file_path): <NEW_LINE> <INDENT> pd_label_color = pd.re... | 对标签图像的编码 | 62598f77711fe17d825dffef |
class CDLHIKKAKEMOD(TAFunc): <NEW_LINE> <INDENT> __slots__ = ('open', 'high', 'low', 'close', 'outInt') <NEW_LINE> def __init__(self, open, high, low, close, outInt=None): <NEW_LINE> <INDENT> pass | CDLHIKKAKEMOD(open, high, low, close, outInt=None) -> CdlHikkakeMod
CdlHikkakeMod(stop, start=-1) -> outNBElement
Modified Hikkake Pattern (Pattern Recognition)
Inputs: [open, high, low, close]
Outputs: (outInt,i) | 62598f7773bcbd0ca4bc9b57 |
class ActivateContractWizard(models.TransientModel): <NEW_LINE> <INDENT> _name = 'recurring.contract.activate.wizard' <NEW_LINE> _description = 'Recurring contract activation wizard' <NEW_LINE> @api.multi <NEW_LINE> def activate_contract(self): <NEW_LINE> <INDENT> contract_obj = self.env['recurring.contract'] <NEW_LINE... | This wizard force activation of a contract. | 62598f77c432627299fa28e1 |
class BadRequestException(WbException): <NEW_LINE> <INDENT> @property <NEW_LINE> def status_code(self): <NEW_LINE> <INDENT> return 400 | An Exception used to indicate that request was bad | 62598f77be383301e0253100 |
class ResponseProvider(): <NEW_LINE> <INDENT> def __init__(self, exception=None): <NEW_LINE> <INDENT> if exception is not None: <NEW_LINE> <INDENT> self.exception = exception.name <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.exception = None <NEW_LINE> <DEDENT> <DEDENT> def provider(self): <NEW_LINE> <INDENT> if ... | Represent the provider of responses.
It selects appropriate response to the user question.
Methods:
provider() -- Provide repsonse function of the exception.
welcome() -- Presentation answer.
no_interrogation_mark() -- Select response when no interrogation mark.
no_spaces() -- Select response when no ... | 62598f77507cdc57c63a4693 |
class Review(core_models.TimeStampedModel): <NEW_LINE> <INDENT> review = models.TextField() <NEW_LINE> accuracy = models.IntegerField() <NEW_LINE> communication = models.IntegerField() <NEW_LINE> cleanliness = models.IntegerField() <NEW_LINE> location = models.IntegerField() <NEW_LINE> check_in = models.IntegerField() ... | Review Model Definition | 62598f778a43f66fc4bf1a87 |
class Context: <NEW_LINE> <INDENT> recomputed: Deque[Recomputed] <NEW_LINE> rng_states: Deque[RNGStates] <NEW_LINE> function: Function <NEW_LINE> input_atomic: bool <NEW_LINE> saved_tensors: Tuple[Tensor, ...] <NEW_LINE> def save_for_backward(self, *tensors: Tensor) -> None: <NEW_LINE> <INDENT> pass | The common interface between the :class:`Checkpoint` and
:class:`Recompute` context. | 62598f771d351010ab8f3448 |
class SectionTeamAdmin(ContentAdmin): <NEW_LINE> <INDENT> fieldsets = ( EntryAdmin.fieldset, ('Section Fields', { 'fields': ('display_title', 'page', 'background_image', 'background_color', 'order') },), ('Team Fields', { 'fields': ('team',) },) ) <NEW_LINE> def get_queryset(self, request): <NEW_LINE> <INDENT> return S... | Manages team admin | 62598f775e10d32532ce3572 |
class NoMoreError(AlienException): <NEW_LINE> <INDENT> pass | Can't get next/prev items of a Listing | 62598f7766673b3332c2fccb |
class File: <NEW_LINE> <INDENT> def __init__(self, file_name, is_antlr_file, enter_cnt, exit_cnt, visit_cnt): <NEW_LINE> <INDENT> self._file_name = file_name <NEW_LINE> self._is_antlr_file = is_antlr_file <NEW_LINE> self._enter_cnt = enter_cnt <NEW_LINE> self._exit_cnt = exit_cnt <NEW_LINE> self._visit_cnt = visit_cnt ... | [File class encapsultes the details of file including the complexity]
| 62598f77d10714528d69d7d7 |
class LVMCacheRequest(CacheRequest): <NEW_LINE> <INDENT> def __init__(self, size, fast_pvs, mode=None): <NEW_LINE> <INDENT> self._size = size <NEW_LINE> self._fast_pvs = fast_pvs <NEW_LINE> self._mode = mode or "writethrough" <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return self._size... | Class representing the LVM cache creation request | 62598f7771ff763f4b5e7076 |
class PActions(Process): <NEW_LINE> <INDENT> def __init__(self,name="",T = 0,sim=None): <NEW_LINE> <INDENT> Process.__init__(self,name = name,sim = sim) <NEW_LINE> self.T = T <NEW_LINE> <DEDENT> def ACTIONS(self): <NEW_LINE> <INDENT> yield hold,self,self.T | PActions class for testing | 62598f7782261d6c5272fb5b |
class Bus(models.Model): <NEW_LINE> <INDENT> num_plate = models.CharField(max_length=10) <NEW_LINE> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> created_by = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='buses', ) <NEW_LINE> driver = models.OneToOneField( settin... | Bus to be used to travel a route with passengers | 62598f7730c21e258be98110 |
class Transformer_x2(Transformer): <NEW_LINE> <INDENT> arg_num = 1 <NEW_LINE> context = 'none' <NEW_LINE> @staticmethod <NEW_LINE> def match(v): <NEW_LINE> <INDENT> return ( isinstance(v, sp.Pow) and str(v.args[0]) == 'x' and str(v.args[1]) == '2' ) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def transform(v): <NEW_LI... | x^2 → y*xy^(k-1) + c*xy^k | 62598f779b70327d1c57e6ba |
class UserCollection(ModelBaseCollection): <NEW_LINE> <INDENT> def _getModel(self): <NEW_LINE> <INDENT> class User(Model): <NEW_LINE> <INDENT> key = CharField(index=True, default="") <NEW_LINE> gitHostRefs = CharField(index=True, default="") <NEW_LINE> name = CharField(index=True, default="") <NEW_LINE> fullname = Char... | This class represent a collection of users | 62598f77d10714528d69d7d8 |
class SparkTests(unittest.TestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SparkTests, self).__init__(*args, **kwargs) <NEW_LINE> warnings.simplefilter('module') <NEW_LINE> <DEDENT> def run(self, result=None): <NEW_LINE> <INDENT> if os.environ.get('OMPI_COMM_WORLD_RANK', '0'... | Tests for horovod.spark.run(). | 62598f777c178a314d78cdb2 |
class Create(RequireStaffMixin, generic.CreateView): <NEW_LINE> <INDENT> form_class, model = forms.Create, VLAN <NEW_LINE> template_name = 'vlan/create.html' <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> self.object = form.save(commit=False) <NEW_LINE> try: <NEW_LINE> <INDENT> form = kickstart.vlan_create(... | Add a VLAN to Kickstart | 62598f77c432627299fa28e3 |
class RecoveryControllerUtil(object): <NEW_LINE> <INDENT> def __init__(self, config_object): <NEW_LINE> <INDENT> self.rc_config = config_object <NEW_LINE> <DEDENT> def syslogout_ex(self, msgid, logOutLevel): <NEW_LINE> <INDENT> monitoring_message = str(threading.current_thread()) + " --MonitoringMessage--ID:... | Other utility classes for VM recovery control | 62598f7763f4b57ef00859f4 |
class ReplyTopicTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.board = Boards.objects.create(name='Django', description='Django board.') <NEW_LINE> self.username = 'john' <NEW_LINE> self.password = '123' <NEW_LINE> user = User.objects.create_user(username=self.username, email='john@do... | Base test case to be used in all `reply_topic` view tests | 62598f774e696a045264da84 |
class FollowsItem(scrapy.Item): <NEW_LINE> <INDENT> _id = Field() <NEW_LINE> follows = Field() | 关注的人 | 62598f777b25080760ed6dab |
class TreeWalker(_base.NonRecursiveTreeWalker): <NEW_LINE> <INDENT> def getNodeDetails(self, node): <NEW_LINE> <INDENT> if isinstance(node, tuple): <NEW_LINE> <INDENT> parent, idx, parents = node <NEW_LINE> node = parent.childNodes[idx] <NEW_LINE> <DEDENT> if node.type in (1, 2): <NEW_LINE> <INDENT> return (_base.DOCUM... | Given that simpletree has no performant way of getting a node's
next sibling, this implementation returns "nodes" as tuples with the
following content:
1. The parent Node (Element, Document or DocumentFragment)
2. The child index of the current node in its parent's children list
3. A list used as a stack of all ance... | 62598f77be383301e0253102 |
class AccountDeleteForm(forms.Form): <NEW_LINE> <INDENT> authorization = forms.CharField( widget=forms.PasswordInput() ) <NEW_LINE> secret = forms.CharField( widget=forms.PasswordInput() ) <NEW_LINE> form_type = forms.CharField() <NEW_LINE> def clean(self): <NEW_LINE> <INDENT> data = super().clean() <NEW_LINE> return d... | Account delete form. | 62598f77bde94217f37072ec |
class PaveTarget(ApproximableAPave): <NEW_LINE> <INDENT> def get_target(self): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> def get_face(self): <NEW_LINE> <INDENT> return | Classe abstraite regroupant les objets approximable à des pavés ayant une cible sur une face | 62598f7715baa7234946188b |
class ServerForUpdate(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'stor... | Represents a server to be updated.
:param location: The location the resource resides in.
:type location: str
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku
:param tags: A set of tags. Application-specific metadata in the form of key-value pairs.
:t... | 62598f7750485f2cf55da87a |
class InvalidInputError(BaseInputError): <NEW_LINE> <INDENT> pass | InputError raised when invalid input is provided | 62598f776fece00bbaccb297 |
class DunceMixin(object): <NEW_LINE> <INDENT> def _get_next_recipient(self, task): <NEW_LINE> <INDENT> return choice(self.adjacencies) <NEW_LINE> <DEDENT> def _learn(self): <NEW_LINE> <INDENT> pass | A learner that doesn't learn | 62598f7723e79379d538be05 |
class StudentController: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__list_students = [] <NEW_LINE> self.__start_sid = 1001 <NEW_LINE> <DEDENT> @property <NEW_LINE> def list_students(self): <NEW_LINE> <INDENT> return self.__list_students <NEW_LINE> <DEDENT> def add_student(self, stu): <NEW_LINE> <... | 学生控制器
负责处理业务逻辑 | 62598f77b57a9660fecd138a |
class EnumType(type): <NEW_LINE> <INDENT> def __init__(cls, what, bases=None, dict=None): <NEW_LINE> <INDENT> super().__init__(what, bases, dict) <NEW_LINE> cls.process() <NEW_LINE> <DEDENT> def __contains__(self, k): <NEW_LINE> <INDENT> return k in self._value_to_name <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> ... | Metaclass for all enum types. | 62598f779b70327d1c57e6bc |
class Structure(object): <NEW_LINE> <INDENT> def __init__(self, payload): <NEW_LINE> <INDENT> self.payload = payload <NEW_LINE> <DEDENT> @property <NEW_LINE> def blocks(self): <NEW_LINE> <INDENT> for block_id in self.payload['blocks'].keys(): <NEW_LINE> <INDENT> yield Block(block_id, self.payload) <NEW_LINE> <DEDENT> <... | The course structure object, which represents a tree of nodes. | 62598f7773bcbd0ca4bc9b5b |
class TheilD: <NEW_LINE> <INDENT> def __init__(self, y, partition): <NEW_LINE> <INDENT> groups = np.unique(partition) <NEW_LINE> T = Theil(y).T <NEW_LINE> ytot = y.sum(axis=0) <NEW_LINE> gtot = np.array([y[partition == gid].sum(axis=0) for gid in groups]) <NEW_LINE> mm = np.dot <NEW_LINE> if ytot.size == 1: <NEW_LINE> ... | Decomposition of Theil's T based on partitioning of
observations into exhaustive and mutually exclusive groups
Parameters
----------
y : array (n,t) or (n, )
with n taken as the observations across which inequality is
calculated If y is (n,) then a scalar inequality value is
... | 62598f77c432627299fa28e5 |
class HmacAuthV3Handler(AuthHandler, HmacKeys): <NEW_LINE> <INDENT> capability = ['hmac-v3', 'route53', 'ses'] <NEW_LINE> def __init__(self, host, config, provider): <NEW_LINE> <INDENT> AuthHandler.__init__(self, host, config, provider) <NEW_LINE> HmacKeys.__init__(self, host, config, provider) <NEW_LINE> <DEDENT> def ... | Implements the new Version 3 HMAC authorization used by Route53. | 62598f77b57a9660fecd138b |
class Puppet(Base): <NEW_LINE> <INDENT> command_base = 'puppet-class' <NEW_LINE> @classmethod <NEW_LINE> def sc_params(cls, options=None): <NEW_LINE> <INDENT> cls.command_sub = 'sc-params' <NEW_LINE> return cls.execute(cls._construct_command(options), output_format='csv') <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def... | Search Foreman's puppet modules. | 62598f77b830903b9686e0f9 |
class Correction: <NEW_LINE> <INDENT> def __init__(self, id, code = None, span = None, error = None, fix = None): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.code = code <NEW_LINE> self.span = span <NEW_LINE> self.error_text = error <NEW_LINE> self.corrected_text = fix <NEW_LINE> <DEDENT> def i(self): <NEW_LINE> <... | Represents a correction applied to a span of a sentence. | 62598f775e10d32532ce3574 |
class ForeignKey(Field): <NEW_LINE> <INDENT> def __init__(self, model_class): <NEW_LINE> <INDENT> self.field_type = 'foreignkey' <NEW_LINE> self.is_foreign_key = True <NEW_LINE> self.model_class = model_class <NEW_LINE> self.python_type = int <NEW_LINE> <DEDENT> def field_sql(self, field_name): <NEW_LINE> <INDENT> retu... | Foreign field for other model | 62598f77287bf620b62714c5 |
class Solution: <NEW_LINE> <INDENT> @timeit <NEW_LINE> def numTriplets(self, nums1: List[int], nums2: List[int]) -> int: <NEW_LINE> <INDENT> d1, d2 = {}, {} <NEW_LINE> for x in nums1: <NEW_LINE> <INDENT> d1[x] = d1.get(x, 0) + 1 <NEW_LINE> <DEDENT> for x in nums2: <NEW_LINE> <INDENT> d2[x] = d2.get(x, 0) + 1 <NEW_LINE>... | [1577. 数的平方等于两数乘积的方法数](https://leetcode-cn.com/problems/number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers/) | 62598f770a366e3fb87dc2d6 |
class IBelowEditContentTitle(IViewletManager): <NEW_LINE> <INDENT> pass | A viewlet manager that sits below the content title in edit templates
| 62598f7730dc7b766599f169 |
class DataVendorPoloniex(DataVendor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DataVendorPoloniex, self).__init__() <NEW_LINE> <DEDENT> def load_ticker(self, market_data_request): <NEW_LINE> <INDENT> logger = LoggerManager().getLogger(__name__) <NEW_LINE> market_data_request_vendor = self.const... | Class for reading in data from various web sources into findatapy library including
| 62598f771d351010ab8f344d |
class Client(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connect_success(self, client): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def connect_failure(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def list_tables_suc... | Everything you need to implement to be a client. | 62598f77d53ae8145f917da3 |
@attr.s <NEW_LINE> class HParams(object): <NEW_LINE> <INDENT> input_shape = attr.ib(default=(28, 28, 1)) <NEW_LINE> conv_filters = attr.ib(default=[32, 64, 64]) <NEW_LINE> kernel_size = attr.ib(default=(3, 3)) <NEW_LINE> pool_size = attr.ib(default=(2, 2)) <NEW_LINE> dense_units = attr.ib(default=[64]) <NEW_LINE> num_c... | Hyper-parameters for training the model. | 62598f77baa26c4b54d4ebc0 |
class JscParser(BaseParser): <NEW_LINE> <INDENT> root = testTotal <NEW_LINE> def interpret(self, result, start, end): <NEW_LINE> <INDENT> c = Compound() <NEW_LINE> for cem_el in result.xpath('./cem'): <NEW_LINE> <INDENT> c.names=cem_el.xpath('./name/text()'), <NEW_LINE> c.labels=cem_el.xpath('./label/text()'), <NEW_LIN... | Test class for obtaining Pv attributes | 62598f77ec188e330fdf81ae |
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> name = serializers.ReadOnlyField(source='profile.name') <NEW_LINE> course_enrollments = serializers.SerializerMethodField() <NEW_LINE> def get_course_enrollments(self, model): <NEW_LINE> <INDENT> request = self.context.get('request') <NEW_LINE> api_... | Serializes User models | 62598f77d4950a0f3b110abd |
class SimpleLinearRegression1: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.a_ = None <NEW_LINE> self.b_ = None <NEW_LINE> <DEDENT> def fit(self, x_train, y_train): <NEW_LINE> <INDENT> x_mean = np.mean(x_train) <NEW_LINE> y_mean = np.mean(y_train) <NEW_LINE> num = 0.0 <NEW_LINE> d = 0.0 <NEW_LINE> f... | 模型训练中使用 for 循环 | 62598f7716aa5153ce3ffe0c |
class ActivationLimitUsages(ActivationLimitUsagesType_): <NEW_LINE> <INDENT> c_tag = 'ActivationLimitUsages' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = ActivationLimitUsagesType_.c_children.copy() <NEW_LINE> c_attributes = ActivationLimitUsagesType_.c_attributes.copy() <NEW_LINE> c_child_order = Activat... | The urn:oasis:names:tc:SAML:2.0:ac:classes:TLSClient:ActivationLimitUsages element | 62598f7763f4b57ef00859f6 |
class UserProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('Users must have an email address') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, n... | Helps Django work with our custom user model | 62598f77711fe17d825dfff5 |
class BuildPyWithExtras(build_py.build_py): <NEW_LINE> <INDENT> @contextlib.contextmanager <NEW_LINE> def temporary_path(self): <NEW_LINE> <INDENT> sys.path.insert(0, self.build_lib) <NEW_LINE> try: <NEW_LINE> <INDENT> yield <NEW_LINE> <DEDENT> finally: <NEW_LINE> <INDENT> del sys.path[0] <NEW_LINE> <DEDENT> <DEDENT> d... | Adds the creation of the CF standard names module and compilation
of the PyKE rules to the standard "build_py" command. | 62598f7796565a6dacd2cc02 |
class Pipeline(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, input_type, output_type, name=None): <NEW_LINE> <INDENT> if name is None: <NEW_LINE> <INDENT> self._name = type(self).__name__ <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> assert isinstance(name, basestring) <NEW_LINE... | An abstract class for data processing pipelines that transform datasets.
A Pipeline can transform one or many inputs to one or many outputs. When there
are many inputs or outputs, each input/output is assigned a string name.
The `transform` method converts a given input or dictionary of inputs to
a list of transforme... | 62598f77287bf620b62714c7 |
class ProcessTest(test_lib.GRRBaseTest): <NEW_LINE> <INDENT> def testUnknownPID(self): <NEW_LINE> <INDENT> def FailingOpen(requested_path, mode="rb"): <NEW_LINE> <INDENT> del requested_path, mode <NEW_LINE> raise OSError("Error in open64.") <NEW_LINE> <DEDENT> with utils.Stubber(process, "open64", FailingOpen): <NEW_LI... | Tests the Linux process reading. | 62598f7715baa7234946188e |
class ShadeObj(object): <NEW_LINE> <INDENT> def __init__(self, pershade=90, shd_width=1, shd_height=1, shd_x=4, shd_y=6, numberCells=96): <NEW_LINE> <INDENT> modHeight = modheight(numberCells) <NEW_LINE> module = np.empty([numberCells // modHeight, modHeight], dtype=int) <NEW_LINE> for n in range(numberCells // modHeig... | A Class for creating a rectangular shade object. Accounts for the fact that
the cells are ordered sequentially in PVMismatch according to their
electrical connections, but a user often wants to think about the layout of
shade on a real module.
The cell stringing layout of an example 96-cell module is as follows:
11 ... | 62598f7707d97122c42165b1 |
class StateEstimate: <NEW_LINE> <INDENT> def __init__(self, step: int, state_1: float, state_2: float, covariance, state_names=None): <NEW_LINE> <INDENT> self.step = step <NEW_LINE> self.x_1 = state_1 <NEW_LINE> self.x_2 = state_2 <NEW_LINE> self.state_names = state_names <NEW_LINE> self.covariance = covariance <NEW_LI... | data object to hold all information pertinent to the state estimate at a given time step | 62598f7715baa7234946188f |
class Solution: <NEW_LINE> <INDENT> def findMedian(self, nums): <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return 0.0 <NEW_LINE> <DEDENT> size = self.get_total_size(nums) <NEW_LINE> if size == 0: <NEW_LINE> <INDENT> return 0.0 <NEW_LINE> <DEDENT> smallest, largest = math.inf, -math.inf <NEW_LINE> for array in... | @param nums: the given k sorted arrays
@return: the median of the given k sorted arrays | 62598f77d99f1b3c44d04fbc |
class ContextsServicer(object): <NEW_LINE> <INDENT> def ListContexts(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def GetContext(s... | A context represents additional information included with user input or with
an intent returned by the Dialogflow API. Contexts are helpful for
differentiating user input which may be vague or have a different meaning
depending on additional details from your application such as user setting
and preferences, previous u... | 62598f77a8ecb03325870b18 |
class AppTestCase(TestCase): <NEW_LINE> <INDENT> user = None <NEW_LINE> install_apps = ( 'fluent_pages.tests.testapp', ) <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> from django.template.loaders import app_directories <NEW_LINE> User = get_user_model() <NEW_LINE> if cls.install_apps: <NEW... | Tests for URL resolving. | 62598f77b57a9660fecd138e |
class GroupViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Group.objects.all() <NEW_LINE> serializer_class = GroupSerializer | Views that allow groups to be viewed or edited via RESTful API | 62598f77d10714528d69d7de |
class ImportFormat(bb.Union): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> html = None <NEW_LINE> markdown = None <NEW_LINE> plain_text = None <NEW_LINE> other = None <NEW_LINE> def is_html(self): <NEW_LINE> <INDENT> return self._tag == 'html' <NEW_LINE> <DEDENT> def is_markdown(self): <NEW_LINE> <INDENT> return... | The import format of the incoming data.
This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar html: The provided data is interpreted as standard HTML.
:ivar markdown: The provided data i... | 62598f773eb6a72ae0389f52 |
class Codec(object): <NEW_LINE> <INDENT> formats = [] <NEW_LINE> def __init__(self, variant): <NEW_LINE> <INDENT> if variant not in self.formats: <NEW_LINE> <INDENT> raise CodecError('%r not supported by %r (supported: %s)' % (variant, self, ', '.join(self.formats))) <NEW_LINE> <DEDENT> self... | Abstract codec | 62598f77be383301e0253108 |
class App(tk.Frame, metaclass=_AppMeta): <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> super().__init__(master) <NEW_LINE> self._configure_master() <NEW_LINE> self._create_components() <NEW_LINE> self.pack() <NEW_LINE> self.update_widgets() <NEW_LINE> <DEDENT> @property <NEW_LINE> def input_choose... | Application main frame | 62598f77b57a9660fecd138f |
class BibschedCheck(PeriodicTask): <NEW_LINE> <INDENT> run_every = cfg['CFG_LWDAAP_BIBSCHED_CHECK_PERIOD'] <NEW_LINE> def run(self, *args, **kwargs): <NEW_LINE> <INDENT> tasks = webapi.get_bibsched_tasks() <NEW_LINE> for t in tasks: <NEW_LINE> <INDENT> task_id, proc, priority, user, runtime, status, progress = t <NEW_L... | Checks that everything is running fine in bibsched and
sets things back as expected is something weird is found | 62598f77bde94217f37072ef |
class SubnetValidator(validation.Validator): <NEW_LINE> <INDENT> def Validate(self, value, unused_key=None): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> raise validation.MissingAttribute('subnet must be specified') <NEW_LINE> <DEDENT> if not isinstance(value, six_subset.string_types): <NEW_LINE> <INDENT> ... | Checks that a subnet can be parsed and is a valid IPv4 or IPv6 subnet. | 62598f77b830903b9686e0fb |
class WMSConnectionFactory(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{F7C34345-87CE-4AB5-9CA8-2012D7241075}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{746F6817-89BB-4490-9829-83CA25FD505A}', 10, 2) | A factory object for WMS Connections. | 62598f7738b623060ffa89ab |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.