code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class FSMField(models.Field): <NEW_LINE> <INDENT> descriptor_class = FSMFieldDescriptor <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.protected = kwargs.pop('protected', False) <NEW_LINE> kwargs.setdefault('max_length', 50) <NEW_LINE> super(FSMField, self).__init__(*args, **kwargs) <NEW_LINE>... | State Machine support for Django model | 62598fbb097d151d1a2c11d0 |
class PetterssonM500BatMic(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._device = None <NEW_LINE> self._endpoint_out = None <NEW_LINE> self._endpoint_in = None <NEW_LINE> self._init_sound_card() <NEW_LINE> <DEDENT> def start_stream(self): <NEW_LINE> <INDENT> self._send_command('01') <NEW_LI... | Class used for control of the Pettersson M500 USB Ultrasound Microphone.
More info at http://batsound.com/
Normally the M500 should be accessed from Windows systems, but this class
makes it possible to call it from Linux.
Installation instructions for pyusb: https://github.com/walac/pyusb
Since pyusb access hardwa... | 62598fbb2c8b7c6e89bd3963 |
class MenuButton(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, pos=0, text="", cmd="", enabled=True, loc=(0, 0)): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.type = 'button' <NEW_LINE> self.color = (255, 255, 255) <NEW_LINE> self.font = pygame.font.Font(current_fol... | menu item | 62598fbb60cbc95b063644dc |
class C1aStatistic(Statistic, Asymmetry): <NEW_LINE> <INDENT> def __calculate__(self): <NEW_LINE> <INDENT> SD1a = SD1aStatistic(signal_plus=self.signal_plus, signal_minus=self.signal_minus, buffer=self.buffer).compute() <NEW_LINE> SD1 = SD1Statistic(signal_plus=self.signal_plus, signal_minus=self.signal_minus, buffer=s... | for accelerations | 62598fbb627d3e7fe0e0704f |
class ApplicantConfirmationGet(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> applicant = ApplicantForm(VALID_APPLICANT) <NEW_LINE> applicant.save() <NEW_LINE> <DEDENT> def test_no_code(self): <NEW_LINE> <INDENT> response = self.client.get('/AuditiON/applicant_confirmation') <NEW_LINE> self.assertE... | Test all GET use cases for applicant_confirmation | 62598fbb4a966d76dd5ef070 |
class ParameterNameError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, *args): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> super(ParameterNameError, self).__init__(message, *args) | Raise an error when the names of the parameter given by the
user do not correspond to the names of the parameters detected
in the symbolic expression of the immittance. | 62598fbb63d6d428bbee294e |
@admin.register(Image) <NEW_LINE> class ImageAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("id", "content_type", "object_id", "content_object") <NEW_LINE> search_fields = ("id", "content_type", "object_id", "content_object") | Admin page of :model:`images.Image` | 62598fbb3d592f4c4edbb05b |
class TrafficReportTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._ncc = None <NEW_LINE> self._ndr_config_file = None <NEW_LINE> self._created_files = [] <NEW_LINE> tests.util.setup_ndr_client_config(self) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> tests.util.cle... | Tests handling of snort traffic data reporting | 62598fbbcc40096d6161a2a8 |
class CalculationRule(models.Model): <NEW_LINE> <INDENT> first_year_effective = models.ForeignKey('sis.SchoolYear', help_text='Rule also applies to subsequent years unless a more recent rule exists.') <NEW_LINE> points_possible = models.DecimalField(max_digits=8, decimal_places=2, default=4) <NEW_LINE> decimal_places =... | A per-year GPA calculation rule. It should also be applied to future years unless a more current rule exists.
| 62598fbb56ac1b37e630238b |
class ConstantSingleQuotedString(ConstantString): <NEW_LINE> <INDENT> def repr(self): <NEW_LINE> <INDENT> return "ConstantSingleQuotedString('%s')" % (self.value) | String, that needs to be pre-processed | 62598fbb57b8e32f525081eb |
class Tag(NerdeezModel): <NEW_LINE> <INDENT> title = models.CharField(max_length=400) | bugs can have tags | 62598fbb71ff763f4b5e7918 |
class LogBlockDebugTab(Tab, logblock_tab_class): <NEW_LINE> <INDENT> _blocks_updated_signal = pyqtSignal(object, bool) <NEW_LINE> _disconnected_signal = pyqtSignal(str) <NEW_LINE> def __init__(self, tabWidget, helper, *args): <NEW_LINE> <INDENT> super(LogBlockDebugTab, self).__init__(*args) <NEW_LINE> self.setupUi(self... | Used to show debug-information about log status. | 62598fbbbe383301e025399d |
class Data7041(BaseData): <NEW_LINE> <INDENT> hdr_dtype = np.dtype([('SonarID', 'u8'), ('PingNumber', 'u4'), ('MultipingSequence', 'u2'), ('Beams', 'u2'), ('Flags', 'u2'), ('SampleRate', 'f4'), ('Reserved', '4u4')]) <NEW_LINE> def __init__(self, datablock, utctime, read_limit=1): <NEW_LINE> <INDENT> super(Data7041, sel... | Compressed Beamformed Intensity Data | 62598fbb4a966d76dd5ef072 |
class AccountingDescriptorTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testGetSucceedOnInstance(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testGetFailOnClass(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testSetFailIfInstance(self): <NEW_LI... | Tests related to the ``AccountingDescriptor`` descriptor | 62598fbbe5267d203ee6ba9f |
class ExchangeNTLMAuthConnection(ExchangeBaseConnection): <NEW_LINE> <INDENT> def __init__(self, url, username, password, verify_certificate=True, **kwargs): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.username = username <NEW_LINE> self.password = password <NEW_LINE> self.verify_certificate = verify_certificate... | Connection to Exchange that uses NTLM authentication | 62598fbb3317a56b869be61e |
class IPages(Interface): <NEW_LINE> <INDENT> pass | Shared interface and schema for Pages | 62598fbbdc8b845886d53758 |
class TestDiscoveryString(unittest.TestCase): <NEW_LINE> <INDENT> def test_valid_discovery_response(self): <NEW_LINE> <INDENT> if is_py3: <NEW_LINE> <INDENT> data = bytearray(b"\xab\x01\xa8\xc0OKTwinkly_A1234B\x00") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> data = "\xab\x01\xa8\xc0OKTwinkly_A1234B\x00" <NEW_LINE> <... | Tests for `xled.discovery` module. String input data. | 62598fbb4c3428357761a45b |
class RegistrationView(BaseRegistrationView): <NEW_LINE> <INDENT> folder = Folder; <NEW_LINE> def register(self, request, **cleaned_data): <NEW_LINE> <INDENT> username, email, password = cleaned_data['username'], cleaned_data['email'], cleaned_data['password1'] <NEW_LINE> UserModel().objects.create_user(username, email... | A registration backend which implements the simplest possible
workflow: a user supplies a username, email address and password
(the bare minimum for a useful account), and is immediately signed
up and logged in). | 62598fbbbf627c535bcb1644 |
class LabListCreateSerializer(serializers.ListSerializer): <NEW_LINE> <INDENT> def to_internal_value(self, data): <NEW_LINE> <INDENT> course = self.context.get("course") <NEW_LINE> for i in range(len(data)): <NEW_LINE> <INDENT> data[i]['course'] = course <NEW_LINE> <DEDENT> return data <NEW_LINE> <DEDENT> def validate(... | 複数の研究室を一括で作成するシリアライザ | 62598fbb796e427e5384e935 |
class FileExistsError(OSError): <NEW_LINE> <INDENT> pass | | File already exists.
|
| Method resolution order:
| FileExistsError
| OSError
| Exception
| BaseException
| object
|
| Methods defined here:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------... | 62598fbb099cdd3c636754b2 |
class WalkieFactory(protocol.Factory): <NEW_LINE> <INDENT> protocol = WalkieServer | Factory Class that Generates WalkieServer Instances | 62598fbbd486a94d0ba2c16f |
@attr.s(hash=True) <NEW_LINE> class RefResolutionError(Exception): <NEW_LINE> <INDENT> _cause = attr.ib() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return str(self._cause) | A ref could not be resolved. | 62598fbba8370b77170f0580 |
class Process(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> if 'process_id' not in kwargs and 'pid' not in kwargs: <NEW_LINE> <INDENT> raise Exception("Need a process id to initialize a process!") <NEW_LINE> <DEDENT> if 'pid' in kwargs: <NEW_LINE> <INDENT> kwargs['process_id'] = kwargs[... | Represents a single process.
- Classes:
Pcb : Process Control Block Included in process class
SystemAccounting : Accounting class
- Methods:
__str__ : Prints a string representation of the object
__setitem__: Allows user to use [] to set a value within the object.
(e.g. ... | 62598fbbad47b63b2c5a79f5 |
class OmnisciServerError(Exception): <NEW_LINE> <INDENT> pass | Raised when OmnisciDB server raises a runtime error that RBC knows
how to interpret. | 62598fbb63b5f9789fe85310 |
class FileCollection(BaseCollection): <NEW_LINE> <INDENT> model = FileProxy <NEW_LINE> object_id_field = 'path' <NEW_LINE> def __init__(self, data_store): <NEW_LINE> <INDENT> self.data_store = data_store <NEW_LINE> <DEDENT> def get_available_key(self, path): <NEW_LINE> <INDENT> return self.data_store.get_available_key(... | A collection of file objects referenced through paths | 62598fbb60cbc95b063644e0 |
class ApplicationConfigSection(PythonPackageConfigSection): <NEW_LINE> <INDENT> def __init__(self, template_config): <NEW_LINE> <INDENT> super(ApplicationConfigSection, self).__init__(template_config, "Application") <NEW_LINE> <DEDENT> @property <NEW_LINE> def app_class_name(self): <NEW_LINE> <INDENT> return self._get_... | Configuration section for the "application" | 62598fbb4f6381625f199593 |
class Function(object): <NEW_LINE> <INDENT> def __init__(self, callable_object): <NEW_LINE> <INDENT> self.function = callable_object <NEW_LINE> for attr in ('__module__', '__name__', '__doc__'): <NEW_LINE> <INDENT> setattr(self, attr, getattr(callable_object, attr, None)) <NEW_LINE> <DEDENT> <DEDENT> def __call__(self,... | The Function Wrapper.
Support function composition via ``*`` operator.
>>> add_1 = Function(lambda n: n + 1)
>>> inc = add_1 * int
>>> inc('42')
43
Support function piping via ``|`` operator.
>>> inc2 = int | add_1 | add_1 | str
>>> inc2('42')
'44' | 62598fbb3317a56b869be61f |
class TestPortlet(unittest.TestCase): <NEW_LINE> <INDENT> layer = FTW_CLOCKPORTLET_INTEGRATION_TESTING <NEW_LINE> def test_portlet_type_registered(self): <NEW_LINE> <INDENT> portlet = getUtility( IPortletType, name='ftw.portlet.clock') <NEW_LINE> self.assertEquals( portlet.addview, 'ftw.portlet.clock') <NEW_LINE> <DEDE... | Test clock portlet
| 62598fbb7047854f4633f577 |
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kWh battery.") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE... | A simple attempt to model a battery for an electric car. | 62598fbbf548e778e596b748 |
class UnknownCommand(StatueException): <NEW_LINE> <INDENT> def __init__(self, command_name: str) -> None: <NEW_LINE> <INDENT> super().__init__(f'Could not find command named "{command_name}"') | Command isn't recognized. | 62598fbb0fa83653e46f5086 |
@tf_export(v1=['layers.Conv2D']) <NEW_LINE> class Conv2D(keras_layers.Conv2D, base.Layer): <NEW_LINE> <INDENT> def __init__(self, filters, kernel_size, strides=(1, 1), padding='valid', data_format='channels_last', dilation_rate=(1, 1), activation=None, use_bias=True, kernel_initializer=None, bias_initializer=init_ops.z... | 2D convolution layer (e.g. spatial convolution over images).
This layer creates a convolution kernel that is convolved
(actually cross-correlated) with the layer input to produce a tensor of
outputs. If `use_bias` is True (and a `bias_initializer` is provided),
a bias vector is created and added to the outputs. Finall... | 62598fbb7d847024c075c55e |
class PowerSurge(Feature): <NEW_LINE> <INDENT> name = "Power Surge" <NEW_LINE> source = "Wizard (School of War Magic)" | Starting at 6th level, you can store magical energy within yourself to
later empower your damaging spells. In its stored form, this energy is
called a power surge. You can store a maximum number of power surges equal
to your Intelligence modifier (minimum of one). Whenever you finish a long
rest, your number of power s... | 62598fbb7c178a314d78d641 |
class SelectManager(Manager): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._select_related = kwargs.pop('_select_related', []) <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def get_queryset(self, *args, **kwargs): <NEW_LINE> <INDENT> queryset = super().get_queryse... | Custom manager to transparently select related items. | 62598fbb01c39578d7f12f1d |
class TestApp(object): <NEW_LINE> <INDENT> cov = None <NEW_LINE> try: <NEW_LINE> <INDENT> import coverage <NEW_LINE> src_dirs = [ "pythia.journal", "pythia.pyre.applications", "pythia.pyre.components", "pythia.pyre.filesystem", "pythia.pyre.inventory", "pythia.pyre.odb", "pythia.pyre.parsing", "pythia.pyre.schedulers",... | Application to run tests.
| 62598fbba8370b77170f0581 |
class GameState(str, enum.Enum): <NEW_LINE> <INDENT> READY = "READY" <NEW_LINE> ACTIVE = "ACTIVE" <NEW_LINE> WON = "WON" <NEW_LINE> LOST = "LOST" <NEW_LINE> def started(self) -> bool: <NEW_LINE> <INDENT> return self is not self.READY <NEW_LINE> <DEDENT> def finished(self) -> bool: <NEW_LINE> <INDENT> return self in [se... | Enum representing the state of a game. | 62598fbb851cf427c66b8458 |
class InputModule(AbstractInput): <NEW_LINE> <INDENT> def __init__(self, input_dev, testing=False): <NEW_LINE> <INDENT> super(InputModule, self).__init__(input_dev, testing=testing, name=__name__) <NEW_LINE> self.sensor = None <NEW_LINE> if not testing: <NEW_LINE> <INDENT> self.initialize_input() <NEW_LINE> <DEDENT> <D... | A sensor support class that measures. | 62598fbbd268445f26639c55 |
class RunApiGetLotteryRecord(RunApi): <NEW_LINE> <INDENT> def __init__(self, step_name: str = None): <NEW_LINE> <INDENT> super().__init__("getLotteryRecord", step_name) <NEW_LINE> <DEDENT> def request(self): <NEW_LINE> <INDENT> return ( super() .request() .with_json( { "data": { "accountId": "$account_id" } } ) ) | Implement api 'getLotteryRecord'.
Key-value pairs:
- accountId: $account_id (str), required
- awardId: $award_id (int), required | 62598fbb236d856c2adc9511 |
class Problem(object): <NEW_LINE> <INDENT> def __init__(self, filename, instance): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.instance = instance <NEW_LINE> self.numberOfJobs = 0 <NEW_LINE> self.numberOfMachines = 0 <NEW_LINE> self.processing_times = None <NEW_LINE> self.operation_numbers_dictionary =... | Reads and parses Open Shop Scheduling Problem | 62598fbb7d43ff24874274d5 |
class LoginRequestEventlet(GenericApiRequest): <NEW_LINE> <INDENT> def __init__(self, client_obj, user, password, client_conn=None, headers=None): <NEW_LINE> <INDENT> if headers is None: <NEW_LINE> <INDENT> headers = {} <NEW_LINE> <DEDENT> message = client_obj.render(client_obj.login_msg()) <NEW_LINE> body = message.ge... | Process a login request. | 62598fbb3317a56b869be620 |
class HostCollection(object): <NEW_LINE> <INDENT> command_base = 'host-collection' <NEW_LINE> @classmethod <NEW_LINE> def add_content_host(cls, options=None): <NEW_LINE> <INDENT> cls.command_sub = 'add-content-host' <NEW_LINE> return cls.execute(cls._construct_command(options)) <NEW_LINE> <DEDENT> @classmethod <NEW_LIN... | Manipulates Katello engine's host-collection command. | 62598fbb1f5feb6acb162dc3 |
class StatusCause(_messages.Message): <NEW_LINE> <INDENT> field = _messages.StringField(1) <NEW_LINE> message = _messages.StringField(2) <NEW_LINE> reason = _messages.StringField(3) | StatusCause provides more information about an api.Status failure,
including cases when multiple errors are encountered.
Fields:
field: The field of the resource that has caused this error, as named by
its JSON serialization. May include dot and postfix notation for nested
attributes. Arrays are zero-indexed... | 62598fbb3539df3088ecc450 |
class TestDistributionSettingsView(TestCaseWithFactory): <NEW_LINE> <INDENT> layer = LaunchpadFunctionalLayer <NEW_LINE> def test_only_translation_fields(self): <NEW_LINE> <INDENT> distribution = self.factory.makeDistribution() <NEW_LINE> view = create_initialized_view( distribution, '+configure-translations', rootsite... | Test distribution settings (+configure-translations) view. | 62598fbb56ac1b37e6302391 |
class ReplacedContext(BaseModel): <NEW_LINE> <INDENT> vocab: Optional[str] <NEW_LINE> syn: Optional[str] <NEW_LINE> orig_text: Optional[List[str]] <NEW_LINE> mod_text: Optional[List[str]] <NEW_LINE> similarity_score: Optional[List[float]] | Info around a replaced vocabulary.
Examples:
>>> rc = ReplacedContext(vocab = "detrimental",
syn = "damaging",
orig_text = ["damaging to health"],
mod_text = ["detrimental to health"]) | 62598fbb7b180e01f3e49121 |
class GameOfRoundsReport(game.GameReport): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GameOfRoundsReport, self).__init__() <NEW_LINE> self.roundsReports = [] <NEW_LINE> <DEDENT> def addRoundReport(self, roundReport): <NEW_LINE> <INDENT> self.roundsReports.append(roundReport) <NEW_LINE> <DEDENT> d... | roundsReports | 62598fbb8a349b6b436863e0 |
class CatagtleCustmersSearchView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> mp = request.GET.get('user_name') <NEW_LINE> req = MiddlePeople.objects.values('id', 'really_name').filter(really_name__contains=mp) <NEW_LINE> query = list(req) <NEW_LINE> paginator = Pagina... | 专属客户搜索框 | 62598fbb236d856c2adc9512 |
class InvalidFacePointsException(ConnectiveGeometryException): <NEW_LINE> <INDENT> pass | InvalidFacePointsException() | 62598fbb091ae35668704dc7 |
class TestValues(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls) -> None: <NEW_LINE> <INDENT> init_testing() <NEW_LINE> <DEDENT> def test_basic(self) -> None: <NEW_LINE> <INDENT> from pineboolib.application.database import pnsqlcursor <NEW_LINE> from pineboolib.application.qsatypes i... | Test Values class. | 62598fbb63b5f9789fe85314 |
class SaveMatplotlib(qt.QAction): <NEW_LINE> <INDENT> def __init__(self, title, maskImageWidget): <NEW_LINE> <INDENT> super(SaveMatplotlib, self).__init__(QString(title), maskImageWidget) <NEW_LINE> self.maskImageWidget = maskImageWidget <NEW_LINE> self.triggered[bool].connect(self.onTrigger) <NEW_LINE> self._matplotli... | Save current image ho high quality graphics using matplotlib | 62598fbb3317a56b869be621 |
class Eq_46(HardwoodVolumeEquation_WithX): <NEW_LINE> <INDENT> def calc_cvts(self, drc, ht, stems=None): <NEW_LINE> <INDENT> if stems is None: <NEW_LINE> <INDENT> stems = np.ones_like(drc) <NEW_LINE> <DEDENT> cvts = np.where( drc**2 * ht / 1000 <= 2, (-0.043 + 2.3378 * drc**2 * ht / 1000 + 0.8024 * (drc**2 * ht / 1000)... | Mesquite (CHOJNACKY, 1985)
Chojnacky D.C., 1985. Pinyon-Juniper Volume Equations for the Central
Rocky Mountain States. Res. Note INT-339, USDA, Forest Service,
Intermountain Res. Station, Ogden, UT 84401. | 62598fbb67a9b606de546173 |
class Missile(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, position, velocity, angle): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.Surface([4, 10], pygame.SRCALPHA) <NEW_LINE> self.image.fill(BLUE) <NEW_LINE> self.image = pygame.transform.rotozoom(self.image, ... | This class represents the bullet.
A missile launched by the player's ship. | 62598fbb3539df3088ecc452 |
class QuiverConfig(object): <NEW_LINE> <INDENT> def __init__(self, parameterSets, minMapQV=10, minPoaCoverage=3, maxPoaCoverage=11, mutationSeparation=10, mutationNeighborhood=20, maxIterations=40, refineDinucleotideRepeats=True, noEvidenceConsensus="nocall", computeConfidence=True, readStumpinessThreshold=0.1): <NEW_L... | Quiver configuration options | 62598fbbcc0a2c111447b1b3 |
class Article(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=40) <NEW_LINE> headline = models.CharField(max_length=100) <NEW_LINE> body = models.TextField() <NEW_LINE> author = models.ForeignKey(User) <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW... | Model to hold data about articles | 62598fbb0fa83653e46f508a |
class Row(Index): <NEW_LINE> <INDENT> def __index__(self): <NEW_LINE> <INDENT> return int(self.name) - 1 | A one-based, end-inclusive row index for use in slices,
eg:: ``[Row(1):Row(2), :]`` | 62598fbb5fdd1c0f98e5e137 |
class HassAqualinkSwitch(AqualinkEntity, SwitchEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return self.dev.label <NEW_LINE> <DEDENT> @property <NEW_LINE> def icon(self) -> str: <NEW_LINE> <INDENT> if self.name == "Cleaner": <NEW_LINE> <INDENT> return "mdi:robot-vacuum" <... | Representation of a switch. | 62598fbb656771135c489815 |
class CopyrightView(BrowserView): <NEW_LINE> <INDENT> def changeCopyright(self, value): <NEW_LINE> <INDENT> context = self.context <NEW_LINE> message = '' <NEW_LINE> if IClearCopyrightable.providedBy(context): <NEW_LINE> <INDENT> anno = IAnnotations(context) <NEW_LINE> if value == 'True': <NEW_LINE> <INDENT> anno['eduC... | Provides view of object with access to annotations in placeless environments | 62598fbb66673b3332c30577 |
class MalibApiBase: <NEW_LINE> <INDENT> def addressIsAllowed(self, addr): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def codeIsValid(self, code): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def log(self, severity, msg): <NEW_LINE> <INDENT> if hasattr(logging,severity): <NEW_LINE> <INDENT> getattr(loggi... | Base class for mobile agents. Provides a facility for registering
events, logging and sending mobile agents to other peers. | 62598fbbcc40096d6161a2ac |
@handler.subscribe(OpenPortEvent, predicate=lambda x: x.port == 8001) <NEW_LINE> class KubeProxy(Discovery): <NEW_LINE> <INDENT> def __init__(self, event): <NEW_LINE> <INDENT> self.event = event <NEW_LINE> self.host = event.host <NEW_LINE> self.port = event.port or 8001 <NEW_LINE> <DEDENT> @property <NEW_LINE> def acce... | Proxy Discovery
Checks for the existence of a an open Proxy service | 62598fbb56ac1b37e6302394 |
class GetMsg(object): <NEW_LINE> <INDENT> def get_info(self, regx, msg): <NEW_LINE> <INDENT> result = re.findall(regx, msg) <NEW_LINE> if result: <NEW_LINE> <INDENT> return result[0] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> <DEDENT> def get_text_msg(self, msg): <NEW_LINE> <INDENT> sel... | 输入一个xml文本字符串对象,生成一个object并返回 | 62598fbb4f88993c371f05e0 |
class disconnection_notification_dialog(Gtk.Dialog): <NEW_LINE> <INDENT> def window_attn(self, widget, event): <NEW_LINE> <INDENT> if event.new_window_state | Gdk.WINDOW_STATE_ICONIFIED: <NEW_LINE> <INDENT> widget.set_urgency_hint(True) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> widget.set_urgency_hint(False) <NEW_L... | Used to show a dialog related to the failure of the server connection. | 62598fbb4527f215b58ea07b |
class RunConfigsTest(DriftBaseTestCase): <NEW_LINE> <INDENT> def test_runconfig_create(self): <NEW_LINE> <INDENT> self.auth_service() <NEW_LINE> data = { "name": make_unique("runconfig name"), "repository": "Test/Test", "ref": "test/test", "build": "HEAD" } <NEW_LINE> r = self.post(self.endpoints["runconfigs"], data=da... | Tests for the /machines service endpoints | 62598fbb3346ee7daa33771b |
class TransportException(Exception): <NEW_LINE> <INDENT> pass | An error due to incomprehensible data received from the transport side | 62598fbbad47b63b2c5a79fb |
class UserApi: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.get_token_url = app.base_url + "/token/user" <NEW_LINE> self.token_verify_url = app.base_url + "/token/verify" <NEW_LINE> self.user_address_url = app.base_url + "/address" <NEW_LINE> <DEDENT> def get_token_api(self): <NEW_LINE> <INDENT> log... | 用户API接口方法 | 62598fbb60cbc95b063644e6 |
class MngFormat(FreeimageMulti): <NEW_LINE> <INDENT> _fif = 6 <NEW_LINE> def _can_save(self, request): <NEW_LINE> <INDENT> return False | An Mng format based on the Freeimage library.
Read only. Seems broken. | 62598fbb7047854f4633f57d |
class NumericFieldSerializer(FieldSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = NumericField <NEW_LINE> depth = 1 <NEW_LINE> fields = ('id', 'status', 'fieldtype', 'name', 'description', 'key', 'required', 'is_displayfield', 'minval', 'maxval') <NEW_LINE> read_only_fields = ('id', 'name', 'ke... | Serializer for numeric fields. | 62598fbb4527f215b58ea07c |
class TestMaxRange(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.ranges1 = [(-0.2, 0.5), (0, 1), (-0.37, 1.02), (np.NaN, 0.3)] <NEW_LINE> self.ranges2 = [(np.NaN, np.NaN), (np.NaN, np.NaN)] <NEW_LINE> <DEDENT> def test_max_range1(self): <NEW_LINE> <INDENT> self.assertEqual(max_range(... | Tests for max_range function. | 62598fbb63d6d428bbee2958 |
class SaleOpportunityTestCase(ModuleTestCase): <NEW_LINE> <INDENT> module = 'sale_opportunity' | Test SaleOpportunity module | 62598fbb67a9b606de546174 |
class EventSpinboxFilter(Qt.QObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(EventSpinboxFilter, self).__init__() <NEW_LINE> <DEDENT> def eventFilter(self, *args, **kwargs): <NEW_LINE> <INDENT> event = args[1] <NEW_LINE> eventType = args[1].type() <NEW_LINE> if eventType == Qt.QEvent.KeyPress... | Event filter for spinbox
Value is changed only when ENTER is pressed | 62598fbb26068e7796d4cb02 |
class RegistrationFormTests(TestCase): <NEW_LINE> <INDENT> def test_registration_form(self): <NEW_LINE> <INDENT> User = get_user_model() <NEW_LINE> User.objects.create_user('alice', 'alice@example.com', 'secret') <NEW_LINE> invalid_data_dicts = [ {'data': {'username': 'foo/bar', 'email': 'foo@example.com', 'password1':... | Test the default registration forms. | 62598fbb3d592f4c4edbb066 |
class CosmologyRead(io_registry.UnifiedReadWrite): <NEW_LINE> <INDENT> def __init__(self, instance, cosmo_cls): <NEW_LINE> <INDENT> super().__init__(instance, cosmo_cls, "read") <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> from astropy.cosmology.core import Cosmology <NEW_LINE> if self._... | Read and parse data to a `~astropy.cosmology.Cosmology`.
This function provides the Cosmology interface to the Astropy unified I/O
layer. This allows easily reading a file in supported data formats using
syntax such as::
>>> from astropy.cosmology import Cosmology
>>> cosmo1 = Cosmology.read('<file name>')
W... | 62598fbb283ffb24f3cf3a2b |
class CallBackHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> @tornado.gen.coroutine <NEW_LINE> def post(self): <NEW_LINE> <INDENT> req_head = self.request.headers <NEW_LINE> req_body = self.request.body <NEW_LINE> yield receiveQueue.queued_items.put([req_head, req_body]) <NEW_LINE> self.write("OK") | LINEからの通知(コールバック)用ハンドラ
| 62598fbb71ff763f4b5e7922 |
class newobject(object): <NEW_LINE> <INDENT> def next(self): <NEW_LINE> <INDENT> if hasattr(self, '__next__'): <NEW_LINE> <INDENT> return type(self).__next__(self) <NEW_LINE> <DEDENT> raise TypeError('newobject is not an iterator') <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> if hasattr(self, '__str__... | A magical object class that provides Python 2 compatibility methods::
next
__unicode__
__nonzero__
Subclasses of this class can merely define the Python 3 methods (__next__,
__str__, and __bool__).
This is a copy/paste of the future.types.newobject class of the future
package. | 62598fbbf9cc0f698b1c53a2 |
class GenerateManifests: <NEW_LINE> <INDENT> def __init__(self, df, directory, context): <NEW_LINE> <INDENT> self.df = df <NEW_LINE> self.directory = directory <NEW_LINE> self.context = context <NEW_LINE> self.manifest_dir = os.path.join(directory, "manifests") <NEW_LINE> self.submission_dir = os.path.join(directory, "... | Class object that coordinates the generation of manifest files | 62598fbb66673b3332c30579 |
class ConfigParserWithDefaults(configparser.ConfigParser): <NEW_LINE> <INDENT> def get(self, section, options, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> result = configparser.ConfigParser.get(self, section, options, **kwargs) <NEW_LINE> <DEDENT> except configparser.NoOptionError: <NEW_LINE> <INDENT> resul... | This is just a wrapper on ConfigParser, that uses default values
| 62598fbb4f88993c371f05e1 |
class NCISerial(NeatoCommandInterface): <NEW_LINE> <INDENT> def __init__(self, port="/dev/ttyACM0", baudrate=115200, timeout=0.5): <NEW_LINE> <INDENT> self.ser = serial.Serial() <NEW_LINE> self.ser.port = port <NEW_LINE> self.ser.baudrate = baudrate <NEW_LINE> self.ser.bytesize = serial.EIGHTBITS <NEW_LINE> self.ser.pa... | Neato Command Interface for serial ports | 62598fbbd268445f26639c58 |
class MirrorSweepRectangle(StoppableThread): <NEW_LINE> <INDENT> def __init__(self, driver, point_a, point_b, step, wait_time = 0): <NEW_LINE> <INDENT> super(MirrorSweepRectangle, self).__init__() <NEW_LINE> self.driver = driver <NEW_LINE> self.driver.running_sweep = False <NEW_LINE> self.point_a = point_a <NEW_LINE> s... | Mirror sweep in a separate thread to ensure continous data acquisition
simultaneous to sweeping the mirror.
Define a rectangle by two opposing corners to sweep through. | 62598fbbe1aae11d1e7ce8f9 |
class _Project(ArchIFC.IfcContext): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> obj.Proxy = self <NEW_LINE> self.setProperties(obj) <NEW_LINE> obj.IfcType = "Project" <NEW_LINE> <DEDENT> def setProperties(self, obj): <NEW_LINE> <INDENT> ArchIFC.IfcContext.setProperties(self, obj) <NEW_LINE> pl = ob... | The project object.
Takes a <Part::FeaturePython>, and turns it into a Project. Then takes a
list of Arch sites to own as its children.
Parameters
----------
obj: <App::DocumentObjectGroupPython> or <App::FeaturePython>
The object to turn into a Project. | 62598fbbbe7bc26dc9251f30 |
class Soulution: <NEW_LINE> <INDENT> def GetLeastNumbers(self, tinput, k): <NEW_LINE> <INDENT> tinput.sort() <NEW_LINE> return tinput[:k] if len(tinput) > k else [] | 输入n个整数,找出其中最小的K个数。
例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4。输入n个整数,找出其中最小的K个数。
例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4。 | 62598fbb377c676e912f6e45 |
class ScheduleAction(Action): <NEW_LINE> <INDENT> def __init__(self, instance, *, condition=None): <NEW_LINE> <INDENT> self.job_id = instance.job_id <NEW_LINE> self.args = instance.args <NEW_LINE> self.condition = condition <NEW_LINE> <DEDENT> async def __call__(self, apsis, run): <NEW_LINE> <INDENT> if self... | Schedules a new run. | 62598fbb4f6381625f199597 |
class GenerativeModel: <NEW_LINE> <INDENT> def __init__(self, config: Config, loss_terms: [LossTerm], dis_a: Model, dis_b: Model, gen_a: Model, gen_b: Model): <NEW_LINE> <INDENT> self.model: Model = None <NEW_LINE> self.config = config <NEW_LINE> self.batch_size = config.batch_size <NEW_LINE> self.dis_a = dis_a <NEW_LI... | Combines two generators into a single generative model | 62598fbb5fcc89381b266221 |
class InfoCommand(Command): <NEW_LINE> <INDENT> def __init__(self, subparsers, parser): <NEW_LINE> <INDENT> subparser = self.add_parser_compat(subparsers, 'info', help="get static information about a network", epilog=parser.epilog) <NEW_LINE> subparser.add_argument('network', metavar='NETWORK', type=_network_address, h... | Get static information about a network.
Arguments:
NETWORK
Example:
>>> parser = argparse.ArgumentParser()
>>> subparsers = parser.add_subparsers()
>>> info = InfoCommand(subparsers, parser)
>>> args = parser.parse_args("info 192.0.2.18/24".split())
>>> args.func(args)
IP address - 192.0.2.18
... | 62598fbb796e427e5384e93f |
class Not_Compiled_Error(Exception): <NEW_LINE> <INDENT> pass | Raised when code that should be compiled is found to be interpreted instead. | 62598fbb3d592f4c4edbb068 |
class no_grad(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prev = torch.is_grad_enabled() <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> torch._C.set_grad_enabled(False) <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> torch.set_grad_enabled(self.prev) <NEW_L... | Context-manager that disabled gradient calculation.
Disabling gradient calculation is useful for inference, when you are sure
that you will not call :meth:`Variable.backward()`. It will reduce memory
consumption for computations that would otherwise have `requires_grad=True`.
In this mode, the result of every computat... | 62598fbb0fa83653e46f508e |
class Creature: <NEW_LINE> <INDENT> id_count = 0 <NEW_LINE> def __init__(self, x, y, dx, dy, color, radius): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.dx = dx <NEW_LINE> self.dy = dy <NEW_LINE> self.color = color <NEW_LINE> self.radius = radius <NEW_LINE> self.id = Creature.id_count <NEW_LINE... | Creature class representing one bouncing ball for now. | 62598fbb9c8ee82313040249 |
class ITermField(Interface): <NEW_LINE> <INDENT> pass | A field using an ITerm as an object value.
| 62598fbb7c178a314d78d649 |
class StencylTests(LargeFrameworkTests): <NEW_LINE> <INDENT> TIMEOUT_INSTALL_PROGRESS = 120 <NEW_LINE> TIMEOUT_START = 20 <NEW_LINE> TIMEOUT_STOP = 20 <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.installed_path = os.path.join(self.install_base_path, "games", "stencyl") <NEW_LINE> self... | This will test the Stencyl installation | 62598fbb656771135c489818 |
class LoadYaml(TemplatePlugin): <NEW_LINE> <INDENT> aliases = ['loadyaml'] <NEW_LINE> def load_yaml(self, filename): <NEW_LINE> <INDENT> import yaml <NEW_LINE> with open(filename, 'rb') as f: <NEW_LINE> <INDENT> return yaml.safe_load(f.read()) <NEW_LINE> <DEDENT> <DEDENT> def run(self): <NEW_LINE> <INDENT> return { 'lo... | Loads YAML from a file. | 62598fbb851cf427c66b8460 |
class TestV1LoadBalancerIngress(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 testV1LoadBalancerIngress(self): <NEW_LINE> <INDENT> pass | V1LoadBalancerIngress unit test stubs | 62598fbbd268445f26639c59 |
class _SubnetworkSpec( collections.namedtuple("_SubnetworkSpec", [ "name", "subnetwork", "builder", "predictions", "loss", "train_op", "eval_metrics", ])): <NEW_LINE> <INDENT> def __new__(cls, name, subnetwork, builder, predictions, loss=None, train_op=None, eval_metrics=None): <NEW_LINE> <INDENT> return super(_Subnetw... | Subnetwork training and evaluation `Tensors` and `Ops`.
Args:
name: String name of this subnetwork. Should be unique in the graph.
subnetwork: The `adanet.subnetwork.Subnetwork` for this spec.
builder: The `adanet.subnetwork.Builder` that produced `subnetwork`.
predictions: Predictions `Tensor` or dict of `Ten... | 62598fbb377c676e912f6e46 |
class _Model(_Register): <NEW_LINE> <INDENT> pass | The model registry; all models are accessed through here for
reconstruction. | 62598fbb63b5f9789fe8531a |
class Queue(object): <NEW_LINE> <INDENT> def __init__(self, name, config=None): <NEW_LINE> <INDENT> specified_config = config or {} <NEW_LINE> self.name = name <NEW_LINE> self._name = 'retaskqueue-' + name <NEW_LINE> self.config = { 'host': 'localhost', 'port': 6379, 'db': 0, 'password': None, } <NEW_LINE> self.config.... | Returns the ``Queue`` object with the given name. If the user
passes optional config dictionary with details for Redis
server, it will connect to that instance. By default it connects
to the localhost. | 62598fbb3617ad0b5ee062f1 |
class ThemeFilesFinder(BaseFinder): <NEW_LINE> <INDENT> storage_class = ThemeStorage <NEW_LINE> source_dir = 'static' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.themes = [] <NEW_LINE> self.storages = OrderedDict() <NEW_LINE> themes = get_themes() <NEW_LINE> for theme in themes: <NEW_LINE> ... | A static files finder that looks in the directory of each theme as
specified in the source_dir attribute. | 62598fbb4a966d76dd5ef07e |
class PythonModuleIndex(Index): <NEW_LINE> <INDENT> name = 'modindex' <NEW_LINE> localname = l_('Python Module Index') <NEW_LINE> shortname = l_('modules') <NEW_LINE> def generate(self, docnames=None): <NEW_LINE> <INDENT> content = {} <NEW_LINE> ignores = self.domain.env.config['modindex_common_prefix'] <NEW_LINE> igno... | Index subclass to provide the Python module index. | 62598fbb4527f215b58ea080 |
class Actor(db.Model): <NEW_LINE> <INDENT> __tablename__ = "actors" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String, nullable=False) <NEW_LINE> age = db.Column(db.Integer, nullable=False) <NEW_LINE> gender = db.Column(db.String, nullable=False) <NEW_LINE> def get_actorname(... | Actor Model to create actor table in postgres
Each Actor must have a name, age, gender | 62598fbbf548e778e596b751 |
class Backend(abc.ABC): <NEW_LINE> <INDENT> def __init__(self, title): <NEW_LINE> <INDENT> self._title = title <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def add_data(self, module_name, datum, step): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def add_histogram(self, module_name,... | Base class for visualiation backends. :class:`~ikkuna.export.subscriber.Subscriber`\ s use
this class to dispatch their metrics to have them visualised.
Attributes
----------
title : str
The figure title | 62598fbbbe383301e02539a9 |
class ContainerTest(unittest_utils.ForsetiTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> @mock.patch.object( google.auth, 'default', return_value=(mock.Mock(spec_set=credentials.Credentials), 'test-project')) <NEW_LINE> def setUpClass(cls, mock_google_credential): <NEW_LINE> <INDENT> fake_global_configs = { 'co... | Test the Container Client. | 62598fbb60cbc95b063644ea |
class Commands(Enum): <NEW_LINE> <INDENT> DESCRIBE = 'describe' <NEW_LINE> PLACE = 'place' <NEW_LINE> CONSUME = 'consume' <NEW_LINE> CLOSE = 'close' <NEW_LINE> EXTEND = 'extend' <NEW_LINE> TRANSFER = 'transfer' <NEW_LINE> RAW = 'raw' <NEW_LINE> LIST = 'list' <NEW_LINE> CUSTOMIZE = 'customize' <NEW_LINE> PRODUCE = 'prod... | Values COMMAND can take. | 62598fbb3d592f4c4edbb06a |
class UserValid(_NotifyUser): <NEW_LINE> <INDENT> verb = 'vérifiée' <NEW_LINE> template_name = 'projects/participation_valid.md' | Notify a user their participation was marked as valid. | 62598fbb9c8ee8231304024a |
class TaeminPluginTest(utils.TaeminTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.plugin = plugin.TaeminPlugin(self.taemin) <NEW_LINE> <DEDENT> @mock.patch("irc.client.ServerConnection.privmsg") <NEW_LINE> def test_privmsg(self, privmsg): <NEW_LINE> <INDENT> self.plugin.... | test TaeminPlugin class | 62598fbb57b8e32f525081f2 |
class UsersView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> authentication_classes = (SessionAuthentication, BasicAuthentication, TokenAuthentication) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> queryset = User.objects.all() <NEW_LINE> renderer_classes = (JSONRenderer, ) <NEW_LINE> serializer_cla... | API for reviewers.
Handles GET
:returns:
All reviewers
Handles POST
:returns:
A JSON with applied data in it. | 62598fbb656771135c48981a |
class MessengerOverworld(World): <NEW_LINE> <INDENT> def __init__(self, opt, agent): <NEW_LINE> <INDENT> self.agent = agent <NEW_LINE> self.opt = opt <NEW_LINE> self.first_time = True <NEW_LINE> self.episodeDone = False <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def generate_world(opt, agents): <NEW_LINE> <INDENT> re... | World to handle moving agents to their proper places. | 62598fbba8370b77170f058c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.