code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@dataclasses.dataclass <NEW_LINE> class ArchiveState: <NEW_LINE> <INDENT> file_size: Optional[int] = None <NEW_LINE> error_message: str = '' <NEW_LINE> def has_error(self) -> bool: <NEW_LINE> <INDENT> return self.error_message <NEW_LINE> <DEDENT> def serialize_to_string(self) -> str: <NEW_LINE> <INDENT> payload = datac... | Additional information (state) of the archive
Includes information like expected file size of the archive file in the case
the archive file is expected to be successfully created.
If the archive can not be created, this state will contain error message
indicating details of error. | 62598ee76fb2d068a7693181 |
class Session(requests.Session): <NEW_LINE> <INDENT> def __init__(self, token): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.headers = { 'content-type': 'application/json', 'x-access-token': token, } <NEW_LINE> <DEDENT> def request(self, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> response ... | An HTTP session for making API requests.
This session sets the content type to JSON and injects the API token. | 62598ee72c8b7c6e89bd1e7a |
class RedMilitaryFactory(MilitaryFactory): <NEW_LINE> <INDENT> def create_infantry_unit(self) -> Rifleman: <NEW_LINE> <INDENT> return Rifleman(50) <NEW_LINE> <DEDENT> def create_land_unit(self) -> Tank: <NEW_LINE> <INDENT> return Tank(175) <NEW_LINE> <DEDENT> def create_air_unit(self) -> Helicopter: <NEW_LINE> <INDENT>... | Concrete factory A | 62598ee76e29344779afecec |
class DisallowedWordsPasswordValidator(object): <NEW_LINE> <INDENT> disallowed_words = ['todo', 'task', 'list'] <NEW_LINE> def __init__(self, min_length=1): <NEW_LINE> <INDENT> self.min_length = min_length <NEW_LINE> <DEDENT> def validate(self, password, user=None): <NEW_LINE> <INDENT> if any(word in password for word ... | DisallowedWordsPasswordValidator ensures that the user's password
does not contain any of the words in disallowed_words. | 62598ee771ff763f4b5e5e16 |
class IndexView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> all_banners = Banner.objects.all().order_by('index') <NEW_LINE> courses = Course.objects.filter(is_banner=False)[:6] <NEW_LINE> banner_course = Course.objects.filter(is_banner=True)[:2] <NEW_LINE> course_orgs = CourseOrg.objects.all(... | 首页功能 | 62598ee730dc7b766599df42 |
class StrategyParam(QtGui.QStandardItemModel): <NEW_LINE> <INDENT> signal = QtCore.Signal(type(Event())) <NEW_LINE> def __init__(self, eventEngine, ctaEngine=None): <NEW_LINE> <INDENT> super(StrategyParam, self).__init__(None) <NEW_LINE> self.eventEngine = eventEngine <NEW_LINE> self.ctaEngine = ctaEngine <NEW_LINE> se... | 用于回测的策略信息 | 62598ee7a8370b77170eea9e |
class NonElementContent (_Content): <NEW_LINE> <INDENT> def __init__ (self, value): <NEW_LINE> <INDENT> super(NonElementContent, self).__init__(six.text_type(value)) | Marking wrapper for non-element content.
The value will be unicode text, and should be appended as character
data. | 62598ee78e71fb1e983ba126 |
class OAuth2UnsupportedGrantError(OAuth2Error): <NEW_LINE> <INDENT> ERROR_CODE = 12080 <NEW_LINE> @property <NEW_LINE> def handler_type(self): <NEW_LINE> <INDENT> return self._handler_type <NEW_LINE> <DEDENT> def __init__(self, handler_type): <NEW_LINE> <INDENT> self._handler_type = handler_type <NEW_LINE> msg = "Handl... | This class provides a concrete exception for notifying unsupport oauth2 grant type. | 62598ee72ae34c7f260a97a2 |
class frotz(Runner): <NEW_LINE> <INDENT> def __init__(self, settings=None): <NEW_LINE> <INDENT> super(frotz, self).__init__() <NEW_LINE> self.package = "frotz" <NEW_LINE> self.executable = "frotz" <NEW_LINE> self.platform = "Z-Code" <NEW_LINE> self.is_installable = True <NEW_LINE> self.description = "Z Code interpreter... | Runner for z-code games such as Zork | 62598ee7e76e3b2f99fd70f1 |
class TPUConfig( collections.namedtuple('TPUConfig', [ 'iterations_per_loop', 'num_shards', 'per_host_input_for_training', 'tpu_job_name', ])): <NEW_LINE> <INDENT> def __new__(cls, iterations_per_loop=2, num_shards=2, per_host_input_for_training=True, tpu_job_name=None): <NEW_LINE> <INDENT> util_lib.check_positive_inte... | TPU related configuration required by `TPUEstimator`.
Args:
iterations_per_loop: This is the number of train steps runnining in TPU
system before returning to CPU host for each `Session.run`. This means
global step is increased `iterations_per_loop` times in one `Session.run`.
It is recommended to be set... | 62598ee707f4c71912badb0f |
class MineMapData(ModelBase): <NEW_LINE> <INDENT> __tablename__ = 'mine_map_data' <NEW_LINE> mine_map_id = foreign_key_column(None, db.Integer, "mine_maps.id") <NEW_LINE> row_num = db.Column(db.Integer, nullable=False) <NEW_LINE> col_num = db.Column(db.Integer, nullable=False) <NEW_LINE> __table_args__ = ( db.PrimaryKe... | A Mine's position in a MineMap. | 62598ee745492302aabfab68 |
class VtkPointCloud: <NEW_LINE> <INDENT> def __init__(self, zMin=-10.0, zMax=10.0, maxNumPoints=1e9): <NEW_LINE> <INDENT> self.maxNumPoints = maxNumPoints <NEW_LINE> self.vtkPolyData = vtk.vtkPolyData() <NEW_LINE> self.clearPoints() <NEW_LINE> mapper = vtk.vtkPolyDataMapper() <NEW_LINE> mapper.SetInputData(self.vtkPoly... | Class for unstructured point data.
| 62598ee756b00c62f0fb0f8b |
class OutTemplateSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "CreateTime": fields.Int(required=False, load_from="CreateTime"), "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), "Purpose": fields.Int(required=False, load_from="Purpose"), "Remark": fields.Str(required=False, load_from="R... | OutTemplate - 模板状态 | 62598ee723849d37ff84f772 |
class Multiplier(Runnable): <NEW_LINE> <INDENT> pass | TODO. | 62598ee74f88993c371ef844 |
class ExportedMethods(server.ExportedMethods): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ExportedMethods, self).__init__() <NEW_LINE> self._db = shelve.open('messages') <NEW_LINE> self._db.setdefault('messages', []) <NEW_LINE> <DEDENT> @callback(retval=[str]) <NEW_LINE> def get_messages(self): <... | this provides the methods that are exposed to the client ('AJAX' stuff)
| 62598ee7460517430c430b43 |
class ConfigForDisplay(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._contributed = {} <NEW_LINE> self._uncontributed = {} <NEW_LINE> <DEDENT> def add_module(self, module: ConfigModule): <NEW_LINE> <INDENT> if module.contributed: <NEW_LINE> <INDENT> self._contributed[module.name] = module <NEW_LIN... | The config as a iterable data structure for displaying | 62598ee767a9b606de544689 |
class PrometheusConfigItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Name = None <NEW_LINE> self.Config = None <NEW_LINE> self.TemplateId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Name = params.get("Name") <NEW_LINE> self.Config = params.g... | prometheus配置
| 62598ee76fb2d068a7693182 |
class MultiStepLR(_TorchScheduler): <NEW_LINE> <INDENT> SCHEDULER_CLASS = lr_scheduler.MultiStepLR <NEW_LINE> def __init__(self, milestones, gamma=0.1, start=1, end=None, on_event='epoch_end', optimizer=None, verbose=False): <NEW_LINE> <INDENT> super(MultiStepLR, self).__init__({'milestones': milestones, 'gamma': gamma... | Decays the learning rate of each parameter group by gamma once the
number of epoch reaches one of the milestones. Notice that such decay can
happen simultaneously with other changes to the learning rate from outside
this scheduler. | 62598ee73cc13d1c6d463e2b |
class BuilderMgr: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__carBuilder = CarBuilder() <NEW_LINE> self.__manorBuilder = ManorBuilder() <NEW_LINE> <DEDENT> def buildCar(self, num): <NEW_LINE> <INDENT> count = 0 <NEW_LINE> products = [] <NEW_LINE> while(count < num): <NEW_LINE> <INDENT> car = self... | 建构类的管理类 | 62598ee730dc7b766599df44 |
class NetworkSecurityGroupResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'evaluated_network_security_groups': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'security_rule_access_result': {'key': 'securityRuleAccessResult', 'type': 'str'}, 'evaluated_network_security_groups': {'key': 'eval... | Network configuration diagnostic result corresponded provided traffic query.
Variables are only populated by the server, and will be ignored when sending a request.
:param security_rule_access_result: The network traffic is allowed or denied. Possible values
are 'Allow' and 'Deny'. Possible values include: "Allow", ... | 62598ee7cad5886f8bdc39be |
class SingleQubitGate(raw_types.Gate, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def num_qubits(self) -> int: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> def validate_args(self, qubits): <NEW_LINE> <INDENT> if len(qubits) != 1: <NEW_LINE> <INDENT> raise ValueError( 'Single-qubit gate applied to {} qubits, instead... | A gate that must be applied to exactly one qubit. | 62598ee76aa9bd52df0d356d |
class NWjs(Task): <NEW_LINE> <INDENT> def __init__(self, progress_hook, debug=False): <NEW_LINE> <INDENT> super(NWjs, self).__init__(debug) <NEW_LINE> self.progress_hook = progress_hook <NEW_LINE> self.folders = [ 'nwjs-v0.24.3-osx-x64' ] <NEW_LINE> self.files = [ 'nwjs-v0.24.3-osx-x64.zip' ] <NEW_LINE> self.sdk = Fals... | docstring for NWjs | 62598ee710dbd63aa1c6f22f |
class ProductsViewTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.category = Category.objects.create( description='Category' ) <NEW_LINE> Product.objects.create( barcode='5901234123457', title='Mattress', description='Mattress', image='mattress.jpg', price=800.724, category=self.category )... | Test case for the ProductsView | 62598ee701c39578d7f11465 |
class Medication(domainresource.DomainResource): <NEW_LINE> <INDENT> resource_type = "Medication" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.amount = None <NEW_LINE> self.batch = None <NEW_LINE> self.code = None <NEW_LINE> self.form = None <NEW_LINE> self.identifier = None <NEW_... | Definition of a Medication.
This resource is primarily used for the identification and definition of a
medication for the purposes of prescribing, dispensing, and administering a
medication as well as for making statements about medication use. | 62598ee756ac1b37e63008a9 |
class CommandRunner(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.manager = CommandManager() <NEW_LINE> self.parser = HelpfulArgumentParser(add_help=True) <NEW_LINE> self.parser.add_argument( '--version', action='version', version='Pecan %s' % self.version ) <NEW_LINE> self.parse_sub_command... | Dispatches `pecan` command execution requests. | 62598ee799cbb53fe682f56d |
class EntryForm(FlaskForm): <NEW_LINE> <INDENT> title = StringField('Title', validators=[DataRequired()]) <NEW_LINE> date = DateField('Date', validators=[DataRequired()]) <NEW_LINE> spent = StringField('Time Spent', validators=[DataRequired()]) <NEW_LINE> learned = StringField('What I learned', validators=[DataRequired... | Entry form to create a new blog entry | 62598ee73317a56b869bd8c4 |
class Search: <NEW_LINE> <INDENT> pass | basic search class that can be inherited by other search agents like Google, Yandex | 62598ee7a17c0f6771d5a910 |
class Handler(object): <NEW_LINE> <INDENT> def __init__(self, *responses): <NEW_LINE> <INDENT> self.lookup = dict((r.word, r) for r in responses) <NEW_LINE> self.remaining = 10 <NEW_LINE> h = self.handler() <NEW_LINE> h.next() <NEW_LINE> self.__h = h.send <NEW_LINE> <DEDENT> def __call__(self, val): <NEW_LINE> <INDENT... | Handler: generic response consumer for beanstalk.
Each handler object has a __call__ method, allowing it to be fed data. | 62598ee77b25080760ed5b57 |
class FrontProductViewSet(PermissionHelperMixin, mixins.ListModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = Product.objects.none() <NEW_LINE> serializer_class = FrontProductSerializer <NEW_LINE> filter_backends = (OrderingFilter, DjangoFilterBackend) <NEW_LINE> filter_class = FrontProductFilter <NE... | list: Lists all available products to be present in storefront. | 62598ee73539df3088eca96f |
class Constants: <NEW_LINE> <INDENT> IMAGE_URL = 'ImageURL' <NEW_LINE> POST_ID = 'PostID' <NEW_LINE> ACCOUNT_ID = 'AccountID' <NEW_LINE> SOURCE_DEVICE = 'SourceDevice' <NEW_LINE> CREATED_TIMESTAMP = 'CreatedTimestamp' <NEW_LINE> ROOT_TRACE_ID = 'RootTraceID' <NEW_LINE> IMAGE_PAYLOAD = 'ImagePayload' <NEW_LINE> SCORER =... | Holds constants definitions for Lambdas. This mostly contains string
constants for JSON keys. | 62598ee70a50d4780f703a68 |
class QueenCreation: <NEW_LINE> <INDENT> def __init__(self, main): <NEW_LINE> <INDENT> self.main = main <NEW_LINE> self.hatcheries_and_hives = None <NEW_LINE> <DEDENT> async def should_handle(self): <NEW_LINE> <INDENT> self.hatcheries_and_hives = self.main.townhalls.exclude_type(UnitTypeId.LAIR).idle.ready <NEW_LINE> r... | It possibly can get better but it seems good enough for now | 62598ee7a8370b77170eeaa1 |
class Webdownload(ModuleGuess): <NEW_LINE> <INDENT> def _set_vectors(self): <NEW_LINE> <INDENT> self.vectors.add_vector(name='putcontent', interpreter='shell.php', payloads=[ 'file_put_contents("$rpath", file_get_contents("$url"));']) <NEW_LINE> self.vectors.add_vector( name='wget', interpreter='shell.sh', payloads=['w... | Download web URL to remote filesystem | 62598ee7f548e778e5969c48 |
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0, position=(0, 0)): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.position = position <NEW_LINE> <DEDENT> @property <NEW_LINE> def position(self): <NEW_LINE> <INDENT> return self.__position <NEW_LINE> <DEDENT> @position.setter <NEW_LINE> def position(sel... | a square
Attributes:
__size (int): Size of square
__position (int, int): Position offset to print, [0] horizontal, [1]
vertical | 62598ee74e4d562566370ad7 |
class Group(models.Model): <NEW_LINE> <INDENT> name = models.CharField(blank = False, unique=True, max_length=60) <NEW_LINE> created = models.DateTimeField(blank=False, auto_now_add=True) <NEW_LINE> modified = models.DateTimeField(blank=False, auto_now=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return ... | Groups data | 62598ee744b2445a339b5cc7 |
class RUI(object): <NEW_LINE> <INDENT> server_greediness = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.cpu_time = 0 <NEW_LINE> self.memory_used = 0 <NEW_LINE> self.disk_bytes_read = 0 <NEW_LINE> self.disk_bytes_written = 0 <NEW_LINE> self.network_bytes_received = 0 <NEW_LINE> self.network_bytes_transmitt... | This class represents the RUI data model (resource utilization information) | 62598ee7498bea3a75a561ef |
class PubChannel: <NEW_LINE> <INDENT> def __init__(self, address): <NEW_LINE> <INDENT> self.context = zmq.Context() <NEW_LINE> self.publisher = self.context.socket(zmq.PUB) <NEW_LINE> self.publisher.bind(address) <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> self.publisher.close() <NEW_LINE> self.conte... | Use a message queue technology to share events.
Based on http://zguide.zeromq.org/py:psenvpub | 62598ee7cad5886f8bdc39c0 |
class Meta: <NEW_LINE> <INDENT> Product | Meta class. | 62598ee7167d2b6e312b5658 |
class Rules(Bcfg2.Server.Plugin.PrioDir): <NEW_LINE> <INDENT> __author__ = 'bcfg-dev@mcs.anl.gov' <NEW_LINE> options = Bcfg2.Server.Plugin.PrioDir.options + [ Bcfg2.Options.BooleanOption( cf=("rules", "regex"), dest="rules_regex", help="Allow regular expressions in Rules")] <NEW_LINE> def __init__(self, core): <NEW_LIN... | This is a generator that handles service assignments. | 62598ee7435de62698e9a494 |
class CustomFunctions(jmespath_functions.Functions): <NEW_LINE> <INDENT> @jmespath_functions.signature({"types": ["string"]}) <NEW_LINE> def _func_remove_proto(self, s): <NEW_LINE> <INDENT> if re.search("^[a-zA-Z]{0,5}://", s): <NEW_LINE> <INDENT> return s[s.index("//") + 2:] <NEW_LINE> <DEDENT> return s <NEW_LINE> <DE... | Custom jmespath functions | 62598ee756ac1b37e63008ab |
class Unique(TextModifier): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.set = set() <NEW_LINE> <DEDENT> def _process(self, seq): <NEW_LINE> <INDENT> for result in seq: <NEW_LINE> <INDENT> if result.val in self.set: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> self.set.add(result.val) <NEW_LINE>... | Modifier that filters duplicate words.
Note that this ignores provenance - if a source generates the same word from
several different provenances, only the first one generated will make it
through Unique | 62598ee78e71fb1e983ba12a |
class FileRegion: <NEW_LINE> <INDENT> def __init__(self, start, end): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> return <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> start = [] <NEW_LINE> if self.start.line: <NEW_LINE> <INDENT> start.append("line={.line!r}".format(self.star... | A locator that records information about a region of a file | 62598ee77d847024c075aa8c |
class UpdateImage_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerat... | Attributes:
- success | 62598ee73317a56b869bd8c5 |
class ConnectionStringDictionary(ProxyOnlyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, '... | String dictionary resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource Name.
:vartype name: str
:ivar kind: Kind of resource.
:vartype kind: str
:ivar type: Resource type.
:vartype type: str
:ivar properties: Con... | 62598ee799fddb7c1ca62164 |
class CallError(BTZenError): <NEW_LINE> <INDENT> pass | Error when starting an asynchronous call is not possible. | 62598ee7aad79263cf42cec9 |
class ForumPost(ThreadedEntry): <NEW_LINE> <INDENT> collection = models.ForeignKey(Thread) <NEW_LINE> body = models.TextField() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> text = u"Forumpost #{0} av {1}. {2}...".format(self.id, self.created_by, self.body[:10]) <NEW_LINE> return text | A post in the forum. | 62598ee7d268445f26638eed |
class ResizeToCover(object): <NEW_LINE> <INDENT> def __init__(self, width, height, upscale=True): <NEW_LINE> <INDENT> self.width, self.height = width, height <NEW_LINE> self.upscale = upscale <NEW_LINE> <DEDENT> def process(self, img): <NEW_LINE> <INDENT> original_width, original_height = img.size <NEW_LINE> ratio = ma... | Resizes the image to the smallest possible size that will entirely cover the
provided dimensions. You probably won't be using this processor directly,
but it's used internally by ``ResizeToFill`` and ``SmartResize``. | 62598ee755399d3f05624bf2 |
class DetectionTable: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._target_id = [] <NEW_LINE> self._action_id = [] <NEW_LINE> self._filename = [] <NEW_LINE> self._timestamp = [] <NEW_LINE> self._x = [] <NEW_LINE> self._y = [] <NEW_LINE> self._threshold = [] <NEW_LINE> self._delta_flux = [] <NEW_LINE... | Helper class for managing the table of detected objects | 62598ee73c8af77a43b67293 |
class TestLinuxDNSDisruptInterface(DNSDuringDisruptionTestCase): <NEW_LINE> <INDENT> def __init__(self, devices, parameters): <NEW_LINE> <INDENT> super().__init__(LinuxInterfaceDisrupter, devices, parameters) | Summary:
Test whether DNS leaks when the network's interface is disrupted.
Details:
This test will connect to VPN then disable the primary network service's underlying interface -
which will be the one used to connect to the VPN. Once the app notices the disruption the test
will reenable the interface then make DNS ... | 62598ee70a50d4780f703a6a |
class PetitionModelTestCases(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_petition = Petition( office=1, contested_by=2, created_by=2, body='Some reason for the petition', evidence='http://get.go.com' ) <NEW_LINE> <DEDENT> def test_petition_object_creation(self): <NEW_LINE> <IND... | Test class for petition model | 62598ee797e22403b38395b0 |
@attr.s(slots=True, repr=False) <NEW_LINE> class BaseOffsetInterval(Interval): <NEW_LINE> <INDENT> def __attrs_post_init__(self): <NEW_LINE> <INDENT> if self.start.datum == Datum.CDS_END: <NEW_LINE> <INDENT> self.end.datum = Datum.CDS_END <NEW_LINE> <DEDENT> self.check_datum() <NEW_LINE> <DEDENT> def check_datum(self):... | BaseOffsetInterval isa Interval of BaseOffsetPositions. The only
additional functionality over Interval is to ensure that the dutum
of end and start are compatible. | 62598ee7dd821e528d6d7604 |
class Planet(Body): <NEW_LINE> <INDENT> PLANETIMAGE = pg.image.load("graphics/planet.png") <NEW_LINE> def __init__(self, parent, root, cylpos=[0, 0], name="unknown"): <NEW_LINE> <INDENT> Body.__init__(self, parent, root, cylpos, name) <NEW_LINE> self.structure = None <NEW_LINE> self.massE = 0 <NEW_LINE> self.mass = 0 <... | Basic Planet class | 62598ee74428ac0f6e656c11 |
class Ray(object): <NEW_LINE> <INDENT> def __init__(self, origin, direction): <NEW_LINE> <INDENT> self.origin = origin <NEW_LINE> self.direction = direction.normalize() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Ray(%s,%s)' % (repr(self.origin), repr(self.direction)) <NEW_LINE> <DEDENT> def poi... | Klasse zum Erstellen eines Strahls | 62598ee75fdd1c0f98e5c663 |
class FileInfo(object): <NEW_LINE> <INDENT> def __init__(self, file_reference=None, timestamp_desc=None, std_info_event=None, std_info_timestamp=None, file_names=None): <NEW_LINE> <INDENT> self.file_reference = file_reference <NEW_LINE> self.timestamp_desc = timestamp_desc <NEW_LINE> self.std_info_event = std_info_even... | Datastructure to track all timestamps for a file and timestamp type. | 62598ee78a43f66fc4bf0832 |
class Galaxy(SkyObject): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Galaxy, self).__init__(**kwargs) <NEW_LINE> self.name = kwargs.pop("name", None) <NEW_LINE> self.redshift = kwargs.pop("redshift", None) <NEW_LINE> self.type = kwargs.pop("galaxy_type", None) <NEW_LINE> self.names = kwa... | This class ... | 62598ee710dbd63aa1c6f233 |
class ToggleTicketActionView(BaseView): <NEW_LINE> <INDENT> def toggle(self): <NEW_LINE> <INDENT> listing = self.context.__parent__ <NEW_LINE> if not getattr(listing, 'visible_tickets', None): <NEW_LINE> <INDENT> listing.visible_tickets = [] <NEW_LINE> <DEDENT> tnum = int(self.context.getId()) <NEW_LINE> if tnum in lis... | Toggles ticket as hidden or shown in listing | 62598ee771ff763f4b5e5e1c |
class Uninstall(actions.ActionPlugin): <NEW_LINE> <INDENT> out_rdfvalues = [rdf_protodict.DataBlob] <NEW_LINE> def Run(self, unused_arg): <NEW_LINE> <INDENT> raise RuntimeError("Not implemented") | Uninstall GRR. Place holder, does nothing.
Note this needs to handle the different distributions separately, e.g. Redhat
vs Debian. | 62598ee7f548e778e5969c4b |
class TestCpuUsage(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 testCpuUsage(self): <NEW_LINE> <INDENT> pass | CpuUsage unit test stubs | 62598ee7cad5886f8bdc39c2 |
class DIFM(nn.Module): <NEW_LINE> <INDENT> def __init__(self,sparse_feat_and_nums, dense_feat, embed_dim, transformer_hidden_dim, transformer_num_attention_heads, bit_layers, sigmoid_out=False): <NEW_LINE> <INDENT> super(DIFM, self).__init__() <NEW_LINE> self.embed = SparseEmbeddingLayer(feat_and_nums=sparse_feat_and_n... | A Dual Input-aware Factorization Machine for CTR Prediction | 62598ee7d486a94d0ba2a68d |
class NetworkLink(models.Model): <NEW_LINE> <INDENT> ETHERNET = 'ETHERNET' <NEW_LINE> CELLULAR = 'CELLULAR' <NEW_LINE> SATELLITE = 'SATELLITE' <NEW_LINE> NETWORK_TYPE_CHOICES = ( (ETHERNET, 'Ethernet or WiFi'), (CELLULAR, 'Cellular'), (SATELLITE, 'Satellite'), ) <NEW_LINE> name = models.CharField( _(u"name"), null=True... | A class for network link
- Ethernet
- Cellular
- Satellite | 62598ee74f88993c371ef846 |
class Role: <NEW_LINE> <INDENT> def __init__(self, name, required=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.required = required <NEW_LINE> <DEDENT> @property <NEW_LINE> def get_name(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if isinsta... | Roles identify a type or category of user. Admin, user,
manager, and employee are all typical roles that may exist in an organization.
https://keycloak.gitbooks.io/documentation/server_admin/topics/roles.html | 62598ee7d6c5a102081e07f1 |
class capture_stdstream: <NEW_LINE> <INDENT> def __init__(self, stream, forward=True): <NEW_LINE> <INDENT> self._stream = stream <NEW_LINE> self._str_stream = io.StringIO() <NEW_LINE> self._sys_stream = None <NEW_LINE> self._forward = forward <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._sys_stream... | Capture a std stream such as stdout or stderr.
Parameters
----------
stream : str
name of the stream to capture.
forward : bool
whether to forward the content to the original stream. | 62598ee7a219f33f346c4efa |
class Sforzando(Dynamic): <NEW_LINE> <INDENT> _command = "\\sfz" | Sforzando (\\sfz). | 62598ee7cc0a2c11144796c4 |
class in_group(Predicate): <NEW_LINE> <INDENT> message = 'The current user must belong to the group "%(group_name)s"' <NEW_LINE> def __init__(self, group_name, **kwargs): <NEW_LINE> <INDENT> super(in_group, self).__init__(**kwargs) <NEW_LINE> self.group_name = group_name <NEW_LINE> <DEDENT> def evaluate(self, environ, ... | Check that the user belongs to the specified group.
:param group_name: The name of the group to which the user must belong.
:type group_name: str
Example::
p = in_group('customers') | 62598ee72ae34c7f260a97a8 |
class InscDict(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.__dict__[key.lower()][-1] <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDE... | Improved version of the header dictionary from
`requests.structures.CaseInsensitiveDict`. | 62598ee726068e7796d4b01c |
class CodeElement(object): <NEW_LINE> <INDENT> def emit(self, source_file): <NEW_LINE> <INDENT> raise NotImplementedError("%s is an Abstract class." % (self.__class__.__name__,)) | Base class for any code element | 62598ee763b5f9789fe8381e |
class AddFeedsFormTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.opml_file = SimpleUploadedFile("feeds_reader.opml", INVALID_OPML) <NEW_LINE> <DEDENT> def test_invalid_opml(self): <NEW_LINE> <INDENT> form = AddFeedsForm({}, {'opml_file': self.opml_file}) <NEW_LINE> self.assertEqual(form.i... | Test AddFeedsForm feeds. | 62598ee7a79ad161977686db |
class PolyvException(Exception): <NEW_LINE> <INDENT> pass | Base polyv Exception. | 62598ee7442bda511e95ab22 |
class _aflowlib_version(Keyword): <NEW_LINE> <INDENT> name = "aflowlib_version" <NEW_LINE> ptype = str <NEW_LINE> atype = "string" | aflowlib version (`optional`). Units: ``.
Returns:
str: Returns the version of the AFLOW post-processor which generated the entry for the library.
| 62598ee7e5267d203ee69fc6 |
class TinyTradeOrder(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TinyTradeOrder, self).__init__() <NEW_LINE> self.symbol = '' <NEW_LINE> self.order_id = '' <NEW_LINE> self.direction = '' <NEW_LINE> self.price = 0 <NEW_LINE> self.total_volume = 0 <NEW_LINE> self.trade_volume = 0 <NEW_LINE>... | 订单信息 | 62598ee732920d7e50bc46ed |
class XSerializerRegistry(XRegistry, metaclass=XSerializerRegistryMetaclass): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.register(XMxmlSerializer()) <NEW_LINE> self.register(XMxmlGZIPSerializer()) <NEW_LINE> self.register(XesXmlSerializer()) <NEW_LINE> self.set_curren... | System-wide registry for XES serializer implementations. Applications can
use this registry as a convenience to provide an overview about
serializeable formats, e.g., in the user interface. Any custom serializer
implementation can be registered with this registry, so that it
transparently becomes available also to any ... | 62598ee785dfad0860cbedc8 |
class module_initialize: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.property=None <NEW_LINE> self.testCase=None <NEW_LINE> <DEDENT> def start_Aerobook_Aercheck(self): <NEW_LINE> <INDENT> relativeAddress = path.location() <NEW_LINE> sourceDir = relativeAddress + r"src\testCase\projectFile\自动化测试相关文... | 各模块测试之前数据初始化 | 62598ee73d592f4c4edb95b7 |
class AttMplsTopo( Topo ): <NEW_LINE> <INDENT> def addSwitch( self, name, **opts ): <NEW_LINE> <INDENT> kwargs = { 'protocols' : 'OpenFlow13' } <NEW_LINE> kwargs.update( opts ) <NEW_LINE> return super(AttMplsTopo, self).addSwitch( name, **kwargs ) <NEW_LINE> <DEDENT> def __init__( self ): <NEW_LINE> <INDENT> Topo.__ini... | Internet Topology Zoo Specimen. | 62598ee756b00c62f0fb0f91 |
class Lead(models.Model): <NEW_LINE> <INDENT> last_name = models.CharField(max_length=80) <NEW_LINE> first_name = models.CharField(max_length=40, blank=True, null=True) <NEW_LINE> company = models.CharField(max_length=255, verbose_name='Organization') <NEW_LINE> email = models.EmailField() <NEW_LINE> status = models.Ch... | Model that maps to Salesforce Lead object. | 62598ee7236d856c2adc8775 |
class SoftwareSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Software <NEW_LINE> fields = ('id', 'name', 'specification', 'user_guide_document', 'indemnity', 'status', 'created_at') <NEW_LINE> read_only_fields = ('id', 'created_at',) | Software Serializer | 62598ee74e4d562566370ada |
class Writer(): <NEW_LINE> <INDENT> def __init__(self,openFile,delimeter=',',quote='"'): <NEW_LINE> <INDENT> self.openFile = openFile <NEW_LINE> self.delimeter = delimeter <NEW_LINE> self.quote = quote <NEW_LINE> <DEDENT> def writeRow(self,row): <NEW_LINE> <INDENT> tooFile = '' <NEW_LINE> for elt in row[:-1]: <... | writer = csv.DictWriter(csvfile)
writer.writeRow(self.header)
for p in self.presets.keys():
writer.writerow(self.confDict2RowDict(p,self.presets[p])) | 62598ee7a8ecb0332586f8aa |
class KeyGetterWindows: <NEW_LINE> <INDENT> def kbhit(self, echo): <NEW_LINE> <INDENT> return msvcrt.kbhit() <NEW_LINE> <DEDENT> def getchar(self, block = True): <NEW_LINE> <INDENT> if not block and not msvcrt.kbhit(): <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> return msvcrt.getchar() <NEW_LINE> <DEDENT> def get... | kbhit() and getchar() in Windows.
Tested on Windows 7 64 bit, Python 2.7.1 | 62598ee75fcc89381b265486 |
class arguments_renamer_t(renamer_t): <NEW_LINE> <INDENT> def __init__(self, dec): <NEW_LINE> <INDENT> renamer_t.__init__(self, dec.function) <NEW_LINE> self.dec = dec <NEW_LINE> self.ssa_tagger = dec.ssa_tagger <NEW_LINE> """ keeps track of the next index """ <NEW_LINE> self.argn = 0 <NEW_LINE> """ dict of relations b... | rename arguments | 62598ee77d43ff248742675c |
class AgentSubscriberSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Subscriber <NEW_LINE> fields = ('id', 'status', 'disposition', 'collected_data', 'agent') <NEW_LINE> <DEDENT> def get_fields(self, *args, **kwargs): <NEW_LINE> <INDENT> fields = super(Age... | **Read**:
CURL Usage::
curl -u username:password -H 'Accept: application/json' http://localhost:8000/api/v1/subscriber/
Response::
[
{
"id": 1,
"status": 1,
"disposition": 1,
"collected_data": "",
},
... | 62598ee7379a373c97d976b7 |
class GT: <NEW_LINE> <INDENT> def __init__(self, term_a, term_b): <NEW_LINE> <INDENT> self.term_a = term_a <NEW_LINE> self.term_b = term_b <NEW_LINE> <DEDENT> def loss(self, t): <NEW_LINE> <INDENT> a = self.term_a.eval(t) <NEW_LINE> b = self.term_b.eval(t) <NEW_LINE> equality = (a == b).all(1).type(a.type()) <NEW_LINE>... | a > b | 62598ee74e4d562566370adb |
class RungeKuttaSolver: <NEW_LINE> <INDENT> def __init__(self,u0,A,B = None): <NEW_LINE> <INDENT> if B == None or B == 0: <NEW_LINE> <INDENT> def B(t): <NEW_LINE> <INDENT> return np.zeros(len(u0)) <NEW_LINE> <DEDENT> <DEDENT> self.A = A <NEW_LINE> self.B = B <NEW_LINE> self.u0 = np.array(u0, dtype = 'complex') <NEW_LIN... | solves initial value problems of the form u'(t) = A(t).u(t) + B(t) in the range a<t<b where u is a vector, A(t) a function which returns a matrix and B(t) a function which returns a vector, given initial conditions u(a) = u0. | 62598ee76e29344779afecf4 |
class QTIMetadataField(core.QTIElement): <NEW_LINE> <INDENT> XMLNAME = 'qtimetadatafield' <NEW_LINE> XMLCONTENT = xml.ElementContent <NEW_LINE> def __init__(self, parent): <NEW_LINE> <INDENT> core.QTIElement.__init__(self, parent) <NEW_LINE> self.FieldLabel = FieldLabel(self) <NEW_LINE> self.FieldEntry = FieldEntry(sel... | The structure responsible for containing each of the QTI-specific
meta-data fields::
<!ELEMENT qtimetadatafield (fieldlabel , fieldentry)>
<!ATTLIST qtimetadatafield xml:lang CDATA #IMPLIED > | 62598ee78a43f66fc4bf0834 |
class DjangoAdminMinimalSettings(AdminScriptTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.write_settings('settings.py', apps=['django.contrib.auth', 'django.contrib.contenttypes']) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.remove_settings('settings.py') <NEW_LINE> <DEDE... | A series of tests for django-admin.py when using a settings.py file that
doesn't contain the test application. | 62598ee72ae34c7f260a97a9 |
class TelnetAdapter(Adapter): <NEW_LINE> <INDENT> def __init__(self, host, port=0, query_delay=0, preprocess_reply=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(preprocess_reply=preprocess_reply) <NEW_LINE> self.query_delay = query_delay <NEW_LINE> safe_keywords = ['timeout'] <NEW_LINE> for kw in kwargs: <NEW_L... | Adapter class for using the Python telnetlib package to allow
communication to instruments
:param host: host address of the instrument
:param port: TCPIP port
:param query_delay: delay in seconds between write and read in the ask
method
:param preprocess_reply: optional callable used to preprocess strings
rece... | 62598ee771ff763f4b5e5e1e |
class MrPythonUserConfParser(MrPythonConfParser): <NEW_LINE> <INDENT> def AddSection(self, section): <NEW_LINE> <INDENT> if not self.has_section(section): <NEW_LINE> <INDENT> self.add_section(section) <NEW_LINE> <DEDENT> <DEDENT> def RemoveEmptySections(self): <NEW_LINE> <INDENT> for section in self.sections(): <NEW_LI... | MrPythonConfigParser specialised for user configuration handling. | 62598ee7aad79263cf42cecc |
class StaticPanel(Panel): <NEW_LINE> <INDENT> id = Column( Integer, ForeignKey('panels.id'), primary_key=True) <NEW_LINE> body = Column(UnicodeText()) <NEW_LINE> mime_type = Column(String(30)) <NEW_LINE> type_info = Content.type_info.copy( name=u'Panel', title=_(u'Panel'), add_view=u'add_panel', addable_to=[u'Document'... | Panel content type.
Instances of StaticPanel are user editable through Kotti's UI and are
persisted in the backend DB. Although panels have the same attributes
as :class:`kotti.resources.Document` they are not subclassed from that class
to prevent them showing up as discrete items in the search results. | 62598ee7a219f33f346c4efc |
class SysLogconfigIpfix(SysLogconfigIpfixSchema): <NEW_LINE> <INDENT> cli_command = "/mgmt/tm/sys/log-config/destination/ipfix" <NEW_LINE> def rest(self): <NEW_LINE> <INDENT> response = self.device.get(self.cli_command) <NEW_LINE> response_json = response.json() <NEW_LINE> if not response_json: <NEW_LINE> <INDENT> retu... | To F5 resource for /mgmt/tm/sys/log-config/destination/ipfix
| 62598ee799cbb53fe682f574 |
class BIDSParser(ParserBase): <NEW_LINE> <INDENT> BASE_ENTITIES = ["subject", "session", "task", "run", "suffix"] <NEW_LINE> EXT = ".pkl" <NEW_LINE> def export_layout(self, name): <NEW_LINE> <INDENT> layout = self._load_layout(name) <NEW_LINE> return layout.as_data_frame() <NEW_LINE> <DEDENT> def list_keys(self, name):... | Object to retrieve data from a BIDS directory.
| 62598ee757b8e32f52507466 |
class FunctionDesc: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.expression = None <NEW_LINE> self.parameter = None <NEW_LINE> self.returntype = None <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def from_json(json_dict): <NEW_LINE> <INDENT> if not json_dict or type(json_dict) != dict: return None <N... | python class mapping to org.apache.kylin.metadata.model.FunctionDesc | 62598ee7be383301e0251e9b |
class ComputeGlobalOperationsListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> pageToken = _messages.StringField(3) <NEW_LINE> project = _messages.StringField(4, required=True) | A ComputeGlobalOperationsListRequest object.
Fields:
filter: Sets a filter expression for filtering listed resources, in the
form filter={expression}. Your {expression} must contain the following:
FIELD_NAME COMPARISON_STRING LITERAL_STRING - FIELD_NAME: The name of
the field you want to compare. The f... | 62598ee73317a56b869bd8c7 |
class Solution: <NEW_LINE> <INDENT> def beautifulArray(self, N): <NEW_LINE> <INDENT> result = [1] <NEW_LINE> while len(result) < N: <NEW_LINE> <INDENT> result = [i * 2 - 1 for i in result] + [i * 2 for i in result] <NEW_LINE> <DEDENT> return [i for i in result if i <= N] | @param N: an integer
@return: return any beautiful array A | 62598ee732920d7e50bc46ee |
class Year(OaiElement): <NEW_LINE> <INDENT> def __init__(self, soup: BeautifulSoup): <NEW_LINE> <INDENT> self._tag_name = "date" <NEW_LINE> self._name = "year" <NEW_LINE> self._value = self._get_element_value(soup) <NEW_LINE> <DEDENT> def _get_element_value(self, soup: BeautifulSoup) -> str: <NEW_LINE> <INDENT> res = s... | This class ** inherit the behavior from the superclass **.
It only defines the "_tag_name" and the "_name" for the "date" element
Attributes
----------
** See Element class (grandparent) ** | 62598ee7e64d504609df8720 |
class axis_ticks_direction_x(themeable): <NEW_LINE> <INDENT> @property <NEW_LINE> def rcParams(self): <NEW_LINE> <INDENT> rcParams = super(axis_ticks_direction_x, self).rcParams <NEW_LINE> rcParams['xtick.direction'] = self.properties['value'] <NEW_LINE> return rcParams | x-axis tick direction
Parameters
----------
theme_element : str in ``['in', 'out', 'inout']``
- ``in`` - ticks inside the panel
- ``out`` - ticks outside the panel
- ``inout`` - ticks inside and outside the panel | 62598ee799fddb7c1ca62166 |
class UtilsTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> group1, created = Group.objects.get_or_create( id=1, title="Group1") <NEW_LINE> group2, created = Group.objects.get_or_create( id=2, title="Group2") <NEW_LINE> student, created = Student.objects.get_or_create( id=1, first_name="Vita... | Test functions from util module | 62598ee74f6381625f19881d |
class PDFReportCreator(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.kwargs = { "datapath": "/my/path/mock_datadir", "struct_file": os.path.join( os.path.abspath(os.path.dirname(pyconnectomist.__file__)), "utils", "resources", "pyconnectomist_qcfast.json"), "author": "Author", "clien... | Test the PDF report creator:
'pyconnectomist.utils.pdftools.generate_pdf' | 62598ee73617ad0b5ee047f4 |
class DocumentType(CharacterData): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self, data=''): <NEW_LINE> <INDENT> CharacterData.__init__(self, data) <NEW_LINE> self.name = '#doctype' <NEW_LINE> <DEDENT> def clone_node(self, _=True): <NEW_LINE> <INDENT> node = DocumentType(self.data) <NEW_LINE> return no... | A node to store the doctype declaration. This node will not
follow the specifications at this point (May 30, 2013). This node
will simply recieve the string in between `<!doctype ` and `>`.
Specs: http://www.w3.org/TR/2012/WD-dom-20121206/#documenttype | 62598ee7cc0a2c11144796c6 |
class NewSeriesForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Series <NEW_LINE> fields = [ 'name', ] | Form to create a new series | 62598ee701c39578d7f1146c |
class ThreeLayerConvNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, dtype=np.float32): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.dtype = dtype <NEW_LINE> in_dims = n... | A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - softmax
The network operates on minibatches of data that have shape (N, C, H, W)
consisting of N images, each with height H and width W and with C input
channels. | 62598ee77047854f4633da97 |
class KeyDefaultDict(collections.defaultdict): <NEW_LINE> <INDENT> default_factory: Callable[[Any], Any] <NEW_LINE> def __missing__(self, key): <NEW_LINE> <INDENT> if self.default_factory is None: <NEW_LINE> <INDENT> raise KeyError(key) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self[key] = self.default_factory(key)... | Default dict that passes missing keys to the factory function, rather than
calling the factory function with no arguments. | 62598ee756ac1b37e63008af |
class _Node: <NEW_LINE> <INDENT> __slots__ = '_element', '_prev', '_next' <NEW_LINE> def __init__(self, element, prev, next): <NEW_LINE> <INDENT> self._element = element <NEW_LINE> self._prev = prev <NEW_LINE> self._next = next | Nonpublic class for storing a doubly linked node | 62598ee755399d3f05624bf6 |
class Component_Part(BlockBase): <NEW_LINE> <INDENT> subclass_names = [] <NEW_LINE> use_names = ['Component_Def_Stmt'] <NEW_LINE> def match(reader): <NEW_LINE> <INDENT> content = [] <NEW_LINE> while 1: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> obj = Component_Def_Stmt(reader) <NEW_LINE> <DEDENT> except NoMatchError:... | <component-part> = [ <component-def-stmt> ]... | 62598ee73c8af77a43b67295 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.