code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class LineEditCount(QObject): <NEW_LINE> <INDENT> def __init__(self, lineEdit): <NEW_LINE> <INDENT> QObject.__init__(self) <NEW_LINE> hbox = QHBoxLayout(lineEdit) <NEW_LINE> hbox.setContentsMargins(0, 0, 0, 0) <NEW_LINE> lineEdit.setLayout(hbox) <NEW_LINE> hbox.addStretch() <NEW_LINE> self.counter = QLabel(lineEdit) <N... | Show summary results inside the line edit, for counting some property. | 62598fa0a8370b77170f0225 |
class DependencyNotFoundError(SetupError): <NEW_LINE> <INDENT> pass | Raised when a dependency cannot be found | 62598fa04e4d562566372265 |
class BadTileID(Exception): <NEW_LINE> <INDENT> def __init__(self, bad_tile_id): <NEW_LINE> <INDENT> message = ('no tile by id #%d' % bad_tile_id) <NEW_LINE> super(BadTileID, self).__init__(message) <NEW_LINE> self.bad_tile_id = bad_tile_id | Tilesheet: tile was referenced by an
ID which does not exist.
Args:
bad_tile_id (int): the tile id referenced which
does not actually exist in a Tilesheet.
Attributes:
bad_tile_id (int): the tile ID referenced
which does not exist. | 62598fa085dfad0860cbf995 |
class VisualVertexBuilder(AttributeCollectorBase): <NEW_LINE> <INDENT> _kwds_prefix = "vertex_" <NEW_LINE> color = (str(self.vertex_defaults["color"]), color_conv) <NEW_LINE> label = None <NEW_LINE> shape = str(self.vertex_defaults["shape"]) <NEW_LINE> size = float(self.vertex_defaults["size"]) | Collects some visual properties of a vertex for drawing | 62598fa0e1aae11d1e7ce744 |
class Registered(Message): <NEW_LINE> <INDENT> MESSAGE_TYPE = 65 <NEW_LINE> def __init__(self, request, registration): <NEW_LINE> <INDENT> assert (type(request) is int) <NEW_LINE> assert (type(registration) is int) <NEW_LINE> Message.__init__(self) <NEW_LINE> self.request = request <NEW_LINE> self.registration = regist... | A WAMP ``REGISTERED`` message.
Format: ``[REGISTERED, REGISTER.Request|id, Registration|id]`` | 62598fa007f4c71912baf285 |
class CPUMeasurer(object): <NEW_LINE> <INDENT> def __init__(self, pid=None): <NEW_LINE> <INDENT> self._ps = ProcStat(pid) <NEW_LINE> <DEDENT> def start(self, timestamp, statstring=None): <NEW_LINE> <INDENT> ps = self._ps <NEW_LINE> self._starttime = timestamp <NEW_LINE> if statstring: <NEW_LINE> <INDENT> ps.load(statst... | Helper to measure CPU utilization of a process. | 62598fa099fddb7c1ca62d08 |
class Customer(object): <NEW_LINE> <INDENT> def __init__(self, name, email): <NEW_LINE> <INDENT> email_check = str(email).lower() <NEW_LINE> if '@' not in email_check: <NEW_LINE> <INDENT> print("This is not a valid email. Try again.") <NEW_LINE> <DEDENT> for cust_id in customers: <NEW_LINE> <INDENT> if customers[cust_i... | Customer class, gives a random unused ID | 62598fa0462c4b4f79dbb84d |
class vn41_t15(rose.upgrade.MacroUpgrade): <NEW_LINE> <INDENT> BEFORE_TAG = "vn4.1_t33" <NEW_LINE> AFTER_TAG = "vn4.1_t15" <NEW_LINE> def upgrade(self, config, meta_config=None): <NEW_LINE> <INDENT> self.add_setting(config, ["namelist:jules_rivers"]) <NEW_LINE> self.add_setting(config, ["file:jules_rivers.nml", "source... | Upgrade macro for JULES ticket #15 by Huw Lewis | 62598fa01f037a2d8b9e3f29 |
class JDSeleniumMiddleware(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.driver = webdriver.Chrome() <NEW_LINE> self.driver.set_window_size(1232, 8392) <NEW_LINE> <DEDENT> @retry(stop_max_attempt_number=30, wait_fixed=200) <NEW_LINE> def retry_load_page(self, request, num, spider): <NEW_LINE... | 模拟浏览器下载中间件 | 62598fa0097d151d1a2c0e6b |
class Breach(Testssl_base): <NEW_LINE> <INDENT> stix = Bundled(mitigation_object=load_mitigation("BREACH")) <NEW_LINE> def _set_arguments(self): <NEW_LINE> <INDENT> self._arguments = ["-B"] <NEW_LINE> <DEDENT> def _worker(self, results): <NEW_LINE> <INDENT> return self._obtain_results(results, ["BREACH"]) | Analysis of the breach testssl results | 62598fa0f548e778e596b3ef |
class TestSaveState(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dojo = Dojo() <NEW_LINE> <DEDENT> def test_empty_session_not_persisted(self): <NEW_LINE> <INDENT> self.dojo.save_state() <NEW_LINE> result = sys.stdout.getvalue().strip() <NEW_LINE> self.assertEqual( result, 'Session h... | The test suite for the functionalities,
save state and load state in the Dojo
class | 62598fa0460517430c431f7c |
class self_seg(null_seg): <NEW_LINE> <INDENT> def __str__(self): return '.' <NEW_LINE> def next_self(self): <NEW_LINE> <INDENT> self.next = self.next_null <NEW_LINE> return self.cntx <NEW_LINE> <DEDENT> def bind(self,cntx): <NEW_LINE> <INDENT> null_seg.bind(self,cntx) <NEW_LINE> self.next = self.next_self | summary: >
This path segment returns the context
node exactly once. | 62598fa0bd1bec0571e14fe4 |
class Element(object): <NEW_LINE> <INDENT> _idx = itertools.count(0) <NEW_LINE> def __init__(self, name=None): <NEW_LINE> <INDENT> self._my_id = self._idx.next() <NEW_LINE> if name is None: <NEW_LINE> <INDENT> self.name = 'element%d' % self._my_id <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.name = name <NEW_LINE... | A generic device. | 62598fa0be8e80087fbbeea1 |
class TeamByMatchTimeFinder(object): <NEW_LINE> <INDENT> def __init__(self, category: Category): <NEW_LINE> <INDENT> self._category = category <NEW_LINE> <DEDENT> def find_possible_teams(self, taken: datetime) -> Iterable[Iterable[TeamInfo]]: <NEW_LINE> <INDENT> if taken > datetime.now(): <NEW_LINE> <INDENT> logging.wa... | Tries find possible teams in category playing in given time. | 62598fa06aa9bd52df0d4d0d |
class ColoredFormatter(logging.Formatter): <NEW_LINE> <INDENT> _LOG_COLORS = { 'WARNING': 'y', 'INFO': 'g', 'DEBUG': 'b', 'CRITICAL': 'y', 'ERROR': 'r' } <NEW_LINE> def format(self, record): <NEW_LINE> <INDENT> levelname = record.levelname <NEW_LINE> if levelname in self._LOG_COLORS: <NEW_LINE> <INDENT> record.levelnam... | Formatter for colored log. | 62598fa0baa26c4b54d4f0f2 |
class MatdynBaseWorkChain(BaseRestartWorkChain): <NEW_LINE> <INDENT> _process_class = MatdynCalculation <NEW_LINE> @classmethod <NEW_LINE> def define(cls, spec): <NEW_LINE> <INDENT> super().define(spec) <NEW_LINE> spec.expose_inputs(MatdynCalculation, namespace='matdyn') <NEW_LINE> spec.expose_outputs(MatdynCalculation... | Workchain to run a Quantum ESPRESSO matdyn.x calculation with automated error handling and restarts. | 62598fa092d797404e388a87 |
class SensorsView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Sensors.objects.all() <NEW_LINE> serializer_class = SensorsSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save() <NEW_LINE> <DEDENT> def list(request, *args, **kwargs): <NEW_LINE> <INDENT> sensors =... | API endpoint that allows groups to be viewed or edited. | 62598fa0379a373c97d98e59 |
class CommentForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Comment <NEW_LINE> fields = [ "comment" ] <NEW_LINE> <DEDENT> def __init__(self, obj, instance=None, **kwargs): <NEW_LINE> <INDENT> self.obj = obj <NEW_LINE> if instance is not None: <NEW_LINE> <INDENT> assert obj == instanc... | Comment form. | 62598fa07cff6e4e811b5867 |
class Member(Person): <NEW_LINE> <INDENT> def __init__(self, schema, current_id): <NEW_LINE> <INDENT> super().__init__(1, db_schema=schema) <NEW_LINE> self.schema = None <NEW_LINE> self.id = current_id <NEW_LINE> <DEDENT> def add_to_member_table(self, login_email, hashed_password, company, schema=None): <NEW_LINE> <IND... | This class is used to hold the higher functions of the lower classes. | 62598fa0a79ad16197769ea7 |
class ibmTextToSpeech: <NEW_LINE> <INDENT> IBM_SPEECH_API_URL = 'https://stream.watsonplatform.net' + '/text-to-speech/api/v1/synthesize' <NEW_LINE> def get_api_url(self): <NEW_LINE> <INDENT> return self.IBM_SPEECH_API_URL <NEW_LINE> <DEDENT> def get_text_to_speech(self, text, lang): <NEW_LINE> <INDENT> w... | IBM Watsonのテキスト to 音声処理APIへアクセスするクラス | 62598fa056b00c62f0fb26f3 |
class DummySingleton1(bouwer.util.Singleton): <NEW_LINE> <INDENT> def __init__(self, arg1, arg2): <NEW_LINE> <INDENT> self.arg1 = arg1 <NEW_LINE> self.arg2 = arg2 | First Dummy Singleton class | 62598fa07b25080760ed72eb |
class SmtLibOptions(SolverOptions): <NEW_LINE> <INDENT> def __init__(self, **base_options): <NEW_LINE> <INDENT> SolverOptions.__init__(self, **base_options) <NEW_LINE> if self.unsat_cores_mode is not None: <NEW_LINE> <INDENT> raise PysmtValueError("'unsat_cores_mode' option not supported.") <NEW_LINE> <DEDENT> self.deb... | Options for the SmtLib Solver.
* debug_interaction: True, False
Print the communication between pySMT and the wrapped executable | 62598fa03c8af77a43b67e61 |
class Options(object): <NEW_LINE> <INDENT> def __init__(self, namespace='', port=8000, address='', registry=CollectorRegistry()): <NEW_LINE> <INDENT> self._namespace = namespace <NEW_LINE> self._registry = registry <NEW_LINE> self._port = int(port) <NEW_LINE> self._address = address <NEW_LINE> <DEDENT> @property <NEW_L... | Options contains options for configuring the exporter.
The address can be empty as the prometheus client will
assume it's localhost
:type namespace: str
:param namespace: The prometheus namespace to be used. Defaults to ''.
:type port: int
:param port: The Prometheus port to be used. Defaults to 8000.
:type address:... | 62598fa0adb09d7d5dc0a3cd |
class YeelightScanner: <NEW_LINE> <INDENT> _scanner = None <NEW_LINE> @classmethod <NEW_LINE> @callback <NEW_LINE> def async_get(cls, hass: HomeAssistant): <NEW_LINE> <INDENT> if cls._scanner is None: <NEW_LINE> <INDENT> cls._scanner = cls(hass) <NEW_LINE> <DEDENT> return cls._scanner <NEW_LINE> <DEDENT> def __init__(s... | Scan for Yeelight devices. | 62598fa0e5267d203ee6b750 |
class Help(object): <NEW_LINE> <INDENT> swagger_types = { 'text': 'str' } <NEW_LINE> attribute_map = { 'text': 'text' } <NEW_LINE> def __init__(self, text=None): <NEW_LINE> <INDENT> self._text = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.text = text <NEW_LINE> <DEDENT> @property <NEW_LINE> def text(self)... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fa08e71fb1e983bb8f9 |
class Subscription(models.Model): <NEW_LINE> <INDENT> pack_name = models.CharField('Subscription Name', max_length=255) <NEW_LINE> price = models.PositiveIntegerField('Subscription Price',) <NEW_LINE> no_resume = models.IntegerField('No. of Resume User can Access') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> retu... | Add Subscription Pack by Admin | 62598fa0d7e4931a7ef3bedc |
class HathiBaseAPI: <NEW_LINE> <INDENT> api_root = "" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.session = requests.Session() <NEW_LINE> headers = { "User-Agent": "ppa-django/%s (%s)" % (ppa_version, self.session.headers["User-Agent"]) } <NEW_LINE> tech_contact = getattr(settings, "TECHNICAL_CONTACT", None... | Base client class for HathiTrust APIs | 62598fa04428ac0f6e65836e |
class MyList(list): <NEW_LINE> <INDENT> def print_sorted(self): <NEW_LINE> <INDENT> copy_list = self[:] <NEW_LINE> copy_list.sort() <NEW_LINE> print(copy_list) | Represent a list that inherits from a built-in list. | 62598fa04f6381625f1993de |
class Initiator(Resource): <NEW_LINE> <INDENT> def update(self, **kwargs): <NEW_LINE> <INDENT> raise NimOSAPIOperationUnsupported("update operation not supported") | Manage initiators in initiator groups. An initiator group has a set of initiators that can be configured as part of your ACL to access a specific volume through group
membership.
# Parameters
id : Identifier for initiator.
access_protocol : Access protocol used by the initiator. Valid valu... | 62598fa0c432627299fa2e1d |
class Service(Dict[str, Parameter]): <NEW_LINE> <INDENT> def __init__( self, name: str, parameters: Optional[Dict[str, Parameter]] = None, **extra: Parameter, ) -> None: <NEW_LINE> <INDENT> super(Service, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.update(parameters or {}) <NEW_LINE> self.update(extra)... | Service definition.
The :class:`Service` class represents a single service definition in a
Service file. It’s actually a dictionnary of its own parameters.
The ``name`` attributes is mapped to the section name of the service in the
Service file.
Each parameters can be accessed either as a dictionnary entry or as an
... | 62598fa03539df3088ecc0f8 |
class QuoteViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.QuoteModel.objects.all() <NEW_LINE> serializer_class = serializers.QuoteSerializer | API endpoint that allows currency quotations to be viewed. | 62598fa18e7ae83300ee8ee3 |
class NasHTTPServerHandler(BaseHTTPServer.BaseHTTPRequestHandler): <NEW_LINE> <INDENT> post_paths = { "/ac": handle_ac, "/pr": handle_pr, "/download": handle_download } <NEW_LINE> ac_actions = { "acctcreate": handle_ac_acctcreate, "login": handle_ac_login, "svcloc": handle_ac_svcloc, } <NEW_LINE> download_actions = { "... | Nintendo NAS server handler. | 62598fa1d53ae8145f9182d1 |
class Settings(object): <NEW_LINE> <INDENT> NotDefined = object() <NEW_LINE> def __init__(self, **overrides): <NEW_LINE> <INDENT> self.overrides = overrides <NEW_LINE> self._orig = {} <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> for k, v in self.overrides.iteritems(): <NEW_LINE> <INDENT> self._orig[k] =... | Allows you to define settings that are required for this function to work.
>>> with Settings(SENTRY_LOGIN_URL='foo'): #doctest: +SKIP
>>> print settings.SENTRY_LOGIN_URL #doctest: +SKIP | 62598fa1442bda511e95c29e |
class Column(): <NEW_LINE> <INDENT> Name = 0 <NEW_LINE> Location = 1 <NEW_LINE> InternalID = 2 <NEW_LINE> LabelsAllowed = 3 <NEW_LINE> NumColumns = 4 | Enum for table column positions | 62598fa1baa26c4b54d4f0f4 |
class PyBpython(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/bpython/bpython" <NEW_LINE> url = "https://github.com/bpython/bpython/archive/0.17-release.tar.gz" <NEW_LINE> version('0.17', '0889bc44c89b82e78baf1fd929b50cdb') <NEW_LINE> depends_on('py-pygments') <NEW_LINE> depends_on('py-request... | A fancy curses interface to the Python interactive interpreter.
https://bpython-interpreter.org/ | 62598fa17d43ff2487427324 |
class TestExportGmap(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> logging.info('setup') <NEW_LINE> self.____never_used_variable = 1 <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> logging.info("teardown") <NEW_LINE> <DEDENT> def test_export_gmap_true(self): <NEW_LINE> <INDENT... | unit tests for export_gmap | 62598fa166656f66f7d5a235 |
class cycle(object): <NEW_LINE> <INDENT> def next(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __getattribute__(self, name): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, iterable): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>... | cycle(iterable) --> cycle object
Return elements from the iterable until it is exhausted.
Then repeat the sequence indefinitely. | 62598fa1a8370b77170f0229 |
class Adc(Instruction): <NEW_LINE> <INDENT> sets_zero_bit = True <NEW_LINE> sets_negative_bit = True <NEW_LINE> @classmethod <NEW_LINE> def write(cls, cpu, memory_address, value): <NEW_LINE> <INDENT> result = cpu.a_reg + int(value) + int(cpu.status_reg.bits[Status.StatusTypes.carry]) <NEW_LINE> overflow = bool((cpu.a_r... | A + M + C -> A, C
N Z C I D V
+ + + - - + | 62598fa14e4d562566372268 |
class CSVFilterForm(forms.Form): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.model = kwargs.pop('model') <NEW_LINE> super(CSVFilterForm, self).__init__(*args, **kwargs) <NEW_LINE> if not self.model: <NEW_LINE> <INDENT> raise ImproperlyConfigured('Seems like there is no model define... | filter the data of a queryset. | 62598fa1379a373c97d98e5b |
class TestLive(TestAsServer): <NEW_LINE> <INDENT> def setUpPreSession(self): <NEW_LINE> <INDENT> TestAsServer.setUpPreSession(self) <NEW_LINE> self.destdir = '.' <NEW_LINE> f = open("liveinput.dat","wb") <NEW_LINE> self.nchunks = 1017 <NEW_LINE> for i in range(0,self.nchunks): <NEW_LINE> <INDENT> data = chr((ord('a')+i... | Basic test that starts a live source which generates ~1000 chunks. | 62598fa1cb5e8a47e493c098 |
class AddLoginWhiteListRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Rules = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Rules") is not None: <NEW_LINE> <INDENT> self.Rules = LoginWhiteListsRule() <NEW_LINE> self.Rules._deseriali... | AddLoginWhiteList请求参数结构体
| 62598fa1a79ad16197769ea9 |
class BEPZero(Transform): <NEW_LINE> <INDENT> default_priority =760 <NEW_LINE> def apply(self): <NEW_LINE> <INDENT> visitor = BEPZeroSpecial(self.document) <NEW_LINE> self.document.walk(visitor) <NEW_LINE> self.startnode.parent.remove(self.startnode) | Special processing for BEP 0. | 62598fa17b25080760ed72ed |
class IndividualCourseSummary(models.Model): <NEW_LINE> <INDENT> _name='school.individual_course_summary' <NEW_LINE> _inherit = ['school.open.form.mixin'] <NEW_LINE> program_id = fields.Many2one('school.individual_program', string='Individual Program') <NEW_LINE> course_group_id = fields.Many2one('school.course_group',... | IndividualCourse Summary | 62598fa13c8af77a43b67e62 |
class IsOwnerOrReadOnly(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> elif obj.author == request.user: <NEW_LINE> <INDENT> return True <NEW_LINE>... | 自定义权限类 | 62598fa166673b3332c3020b |
class TestRunBenchmark(unittest.TestCase): <NEW_LINE> <INDENT> @patch('test_runners.tf_cnn_bench.run_benchmark.TestRunner.run_test_suite') <NEW_LINE> @patch('test_runners.tf_cnn_bench.run_benchmark.TestRunner._make_log_dir') <NEW_LINE> def test_run_tests(self, make_log_dir_mock, run_test_suite): <NEW_LINE> <INDENT> exp... | Tests for run_benchmark module. | 62598fa167a9b606de545e0f |
class GetUserFeedInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccessToken', value) <NEW_LINE> <DEDENT> def set_Count(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Count', value) <NEW_LINE> <DEDENT> def set_MaxID(self, value): <NE... | An InputSet with methods appropriate for specifying the inputs to the GetUserFeed
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598fa1cc0a2c111447ae53 |
class getFilialById_args(object): <NEW_LINE> <INDENT> def __init__(self, id=None,): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE> <I... | Attributes:
- id | 62598fa107f4c71912baf289 |
class Meta: <NEW_LINE> <INDENT> verbose_name = "Rol" <NEW_LINE> verbose_name_plural = "Roles" | Configuraciones | 62598fa12c8b7c6e89bd360b |
class ErrorTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_Raise(self): <NEW_LINE> <INDENT> nest.ResetKernel() <NEW_LINE> try: <NEW_LINE> <INDENT> raise nest.NESTError('test') <NEW_LINE> self.fail('an error should have risen!') <NEW_LINE> <DEDENT> except nest.NESTError: <NEW_LINE> <INDENT> info = sys.exc_info... | Tests if errors are handled correctly | 62598fa16e29344779b004a1 |
class Beam(): <NEW_LINE> <INDENT> def __init__(self, elements, supports): <NEW_LINE> <INDENT> self.len_elements = [element.length for element in elements] <NEW_LINE> self.E_elements = [element.E for element in elements] <NEW_LINE> self.I_elements = [element.I for element in elements] <NEW_LINE> self.num_elements = len(... | Class for an assembly of elements into a single beam. | 62598fa1eab8aa0e5d30bbcc |
class Perceptron(object): <NEW_LINE> <INDENT> def __init__(self, eta=0.01, n_iter=10): <NEW_LINE> <INDENT> self.eta = eta <NEW_LINE> self.n_iter = n_iter <NEW_LINE> self.w_ = [] <NEW_LINE> self.errors_ = [] <NEW_LINE> <DEDENT> def fit(self, X, y): <NEW_LINE> <INDENT> self.w_ = np.zeros(1 + X.shape[1]) <NEW_LINE> self.e... | Perceptron classifier
Parameters
eta: float
Learning rate (0.0 - 1.0)
n_iter: int
Passes over the training set
Attributes
w_: 1d-array
Weights after filtering
errors_: list
Number of misclassification in every epoch | 62598fa1460517430c431f7e |
class SearchFinalMultipleNumQA(SearchMultipleNumQABase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def is_match(value_list, num, data): <NEW_LINE> <INDENT> (matched, left_over_final_data) = SearchMultipleNumQABase.multiple_num_helper(value_list, num, data) <NEW_LINE> return matched | Aggregator for: P7_other_[12,13,14] | 62598fa1e5267d203ee6b753 |
class RenderAutoShortcutLink(AutoLinkMixin, components.RenderComponent): <NEW_LINE> <INDENT> def createHTML(self, token, parent): <NEW_LINE> <INDENT> page, tag, href = self.createHTMLHelper(token, parent, 'key') <NEW_LINE> if token.bookmark is not None: <NEW_LINE> <INDENT> tok = self.findToken(page, token) <NEW_LINE> h... | Render AutoShortcutLink token. | 62598fa10a50d4780f705220 |
class Cello(Instrument): <NEW_LINE> <INDENT> name, short_name = 'Cello', 'Vcl.' <NEW_LINE> clef = 'bass' <NEW_LINE> max_gliss = NumberedInterval(12) <NEW_LINE> max_trill = NumberedInterval(5) <NEW_LINE> range = PitchRange.from_pitches( NamedPitch("c,"), NamedPitch("a'"), ) <NEW_LINE> quadruple_sort = 'start_offset' <NE... | Model of the cello as an instrument.
::
>>> import aurora
>>> aurora.nouns.instruments.Cello()
Cello() | 62598fa1442bda511e95c2a0 |
class EbsCustomTagsRule(BaseRule): <NEW_LINE> <INDENT> def __init__(self, cfn_model=None, debug=None): <NEW_LINE> <INDENT> BaseRule.__init__(self, cfn_model, debug=debug) <NEW_LINE> <DEDENT> def rule_text(self): <NEW_LINE> <INDENT> if self.debug: <NEW_LINE> <INDENT> print('rule_text' + lineno()) <NEW_LINE> <DEDENT> ret... | Ebs custom tags rule | 62598fa1d268445f26639aa6 |
class Task(object): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> raise NotImplementedError() | Container for an task.
Runner objects run tasks (normally or in parallel).
Intuitively, think of a Task as a box that Analysis creates and sends to a factory (Runner object)
The base class is a dummy, meant to be extended | 62598fa19c8ee82313040091 |
class palm_position(object): <NEW_LINE> <INDENT> x = 0 <NEW_LINE> y = 0 <NEW_LINE> z = 0 | Fake palm position of hand to controller. | 62598fa1a17c0f6771d5c080 |
class Cluster(Task): <NEW_LINE> <INDENT> def __init__(self, settings=None): <NEW_LINE> <INDENT> if settings is None: <NEW_LINE> <INDENT> settings = {} <NEW_LINE> <DEDENT> super(Cluster, self).__init__(settings) <NEW_LINE> self._kmeans_args = { 'max_iter': 50, 'tol': 1.0, } <NEW_LINE> <DEDENT> def get(self, img): <NEW_L... | Use the K-Means algorithm to group pixels by clusters. The algorithm tries
to determine the optimal number of clusters for the given pixels. | 62598fa157b8e32f5250803f |
class Test_keyImport(unittest.TestCase): <NEW_LINE> <INDENT> private_key = "L52XzL2cMkHxqxBXRyEpnPQZGUs3uKiL3R11XbAdHigRzDozKZeW" <NEW_LINE> public_key_hex = "0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2" <NEW_LINE> main_address = "15mKKb2eos1hWa6tisdPwwDC1a5J1y9nma" <NEW_LINE> def test_public_key... | The keys used in this class are TEST keys from
https://en.bitcoin.it/wiki/BIP_0032_TestVectors | 62598fa191f36d47f2230dc4 |
class HoneywellConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> async def async_step_user(self, user_input=None): <NEW_LINE> <INDENT> errors = {} <NEW_LINE> if user_input is not None: <NEW_LINE> <INDENT> valid = await self.is_valid(**user_input) <NEW_LINE> if valid: <NEW_... | Handle a honeywell config flow. | 62598fa1cb5e8a47e493c099 |
class SemDesconto(object): <NEW_LINE> <INDENT> def calcula(self, carrinho): <NEW_LINE> <INDENT> return 0 | Não há descontos. | 62598fa14e4d56256637226b |
class BasicPostProcessor(Processor): <NEW_LINE> <INDENT> def get_board_topics_list(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_topic_all_reply(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_topic_page_reply(self): <NEW_LINE> <INDENT> raise NotIm... | BasicPostProcessor, used to get/set posts' information | 62598fa1e5267d203ee6b754 |
class DynamicUIRenderer(Enum): <NEW_LINE> <INDENT> indicatif_spinner = "indicatif-spinner" <NEW_LINE> experimental_prodash = "experimental-prodash" | Which renderer to use for dyanmic UI. | 62598fa16fb2d068a7693d58 |
class Word(unicode): <NEW_LINE> <INDENT> def __new__(cls, string, pos_tag=None): <NEW_LINE> <INDENT> return super(Word, cls).__new__(cls, string) <NEW_LINE> <DEDENT> def __init__(self, string, pos_tag=None): <NEW_LINE> <INDENT> self.string = string <NEW_LINE> self.pos_tag = pos_tag <NEW_LINE> <DEDENT> def __repr__(self... | A simple word representation. | 62598fa1a79ad16197769eac |
class LocaleURLMiddleware(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if not settings.USE_I18N: <NEW_LINE> <INDENT> raise django.core.exceptions.MiddlewareNotUsed() <NEW_LINE> <DEDENT> <DEDENT> def process_request(self, request): <NEW_LINE> <INDENT> locale, path = utils.strip_path(request.path_... | Middleware that sets the language based on the request path prefix and
strips that prefix from the path. It will also automatically redirect any
path without a prefix, unless PREFIX_DEFAULT_LOCALE is set to True.
Exceptions are paths beginning with MEDIA_URL and/or STATIC_URL (if
settings.LOCALE_INDEPENDENT_MEDIA_URL a... | 62598fa1cc0a2c111447ae54 |
class eICUSubsampleUnobs(eICUSubsampleObs): <NEW_LINE> <INDENT> def __init__(self, hparams, args): <NEW_LINE> <INDENT> eicuConstants.static_cat_features.remove('gender') <NEW_LINE> super().__init__(hparams, args) | Hyperparameters:
subsample_g1_mean
subsample_g2_mean
subsample_g1_dist
subsample_g2_dist | 62598fa1cc0a2c111447ae55 |
class SumField(AggregateField): <NEW_LINE> <INDENT> function_name = 'Sum' | Summation aggregation | 62598fa1e76e3b2f99fd887e |
class ClearAllTransforms(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "pose.clearall" <NEW_LINE> bl_label = "Clear Transforms" <NEW_LINE> def execute(self,context): <NEW_LINE> <INDENT> for object in bpy.data.objects: <NEW_LINE> <INDENT> if object.type == 'ARMATURE': <NEW_LINE> <INDENT> bpy.ops.pose.rot_clear() ... | Clears all transforms on the bone I hope | 62598fa11f037a2d8b9e3f2f |
class TestGetBoolEnv: <NEW_LINE> <INDENT> envar_name = "TEST_VAR" <NEW_LINE> @pytest.mark.parametrize( "environment_value", [ "1", "TRUE", "true", "YES", "yes", ], ) <NEW_LINE> def test_trythy_bools(self, monkeypatch, environment_value): <NEW_LINE> <INDENT> monkeypatch.setenv(self.envar_name, environment_value) <NEW_LI... | Test get_bool_env | 62598fa107f4c71912baf28b |
class test_lp_1282584(TransactionCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(test_lp_1282584, self).setUp() <NEW_LINE> self.wizardmakepicking = self.env['claim_make_picking.wizard'] <NEW_LINE> claimline_obj = self.env['claim.line'] <NEW_LINE> claim_obj = self.env['crm.claim'] <NEW_LINE> self.p... | Test wizard open the right type of view
The wizard can generate picking.in and picking.out
Let's ensure it open the right view for each picking type | 62598fa17047854f4633f21e |
class VeranstaltungBasisdatenForm(forms.ModelForm): <NEW_LINE> <INDENT> required_css_class = 'required' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> veranstalter_queryset = kwargs.pop('all_veranstalter', None) <NEW_LINE> super(VeranstaltungBasisdatenForm, self).__init__(*args, **kwargs) <NEW_LINE... | Definiert die Form für den 2. Schritt des Wizards. | 62598fa1462c4b4f79dbb853 |
class ModifyApplicationVisualizationRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ApplicationId = None <NEW_LINE> self.BasicConfig = None <NEW_LINE> self.Volumes = None <NEW_LINE> self.InitContainers = None <NEW_LINE> self.Containers = None <NEW_LINE> self.Service = None <NEW_... | ModifyApplicationVisualization请求参数结构体
| 62598fa124f1403a926857d6 |
class WebinarComponent(base.BaseComponent): <NEW_LINE> <INDENT> def list(self, **kwargs): <NEW_LINE> <INDENT> util.require_keys(kwargs, 'host_id') <NEW_LINE> if kwargs.get('start_time'): <NEW_LINE> <INDENT> kwargs['start_time'] = util.date_to_str(kwargs['start_time']) <NEW_LINE> <DEDENT> return self.post_request("/webi... | Component dealing with all webinar related matters | 62598fa1498bea3a75a57968 |
class SValueModel: <NEW_LINE> <INDENT> def compute_outlier_scores(self, frequencies): <NEW_LINE> <INDENT> if (len(frequencies.keys()) < 2): <NEW_LINE> <INDENT> raise Exception("There must be at least 2 aggregation units.") <NEW_LINE> <DEDENT> rng = frequencies[frequencies.keys()[0]].keys() <NEW_LINE> normalized_frequen... | Model implementing SVA. | 62598fa13539df3088ecc0fc |
class Encounter(models.Model): <NEW_LINE> <INDENT> patient = models.ForeignKey(Patient) <NEW_LINE> start_date = models.DateTimeField() <NEW_LINE> end_date = models.DateTimeField(blank=True, null=True) <NEW_LINE> status = models.ForeignKey(EncounterStatus) <NEW_LINE> notes = models.TextField("Special Notes", blank=True,... | The actual encounter, when a patient meets a practitioner or visits
a service provider/point of care | 62598fa12c8b7c6e89bd360e |
class HDCASummary(HistoryItemCommon): <NEW_LINE> <INDENT> model_class: str = ModelClassField(HDCA_MODEL_CLASS_NAME) <NEW_LINE> type: str = Field( "collection", const=True, title="Type", description="This is always `collection` for dataset collections.", ) <NEW_LINE> collection_type: str = CollectionTypeField <NEW_LINE>... | History Dataset Collection Association summary information. | 62598fa1bd1bec0571e14fe7 |
class Queue(): <NEW_LINE> <INDENT> def __init__(self,value=None,next_node=None): <NEW_LINE> <INDENT> if value == None and next_node == None: <NEW_LINE> <INDENT> self.tail = None <NEW_LINE> self.size = 0 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.tail = Node(value,next_node) <NEW_LINE> self.size = 1 <NEW_LINE> <... | This is the best working version I can come up with so far
that is both my style and 100% working.
I would ideally like the remove() method to be recursive,
and I would like to fully understand the issues with my
earlier attempts at Stacks/Queues.
Another interesting approach with Queues specifically
is to have varia... | 62598fa1442bda511e95c2a2 |
class RandomFlipTopBottom(HybridBlock): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(RandomFlipTopBottom, self).__init__() <NEW_LINE> <DEDENT> def hybrid_forward(self, F, x): <NEW_LINE> <INDENT> if is_np_array(): <NEW_LINE> <INDENT> F = F.npx <NEW_LINE> <DEDENT> return F.image.random_flip_top_botto... | Randomly flip the input image top to bottom with a probability
of 0.5.
Inputs:
- **data**: input tensor with (H x W x C) shape.
Outputs:
- **out**: output tensor with same shape as `data`. | 62598fa1baa26c4b54d4f0f7 |
class FakePartnerFormProtectedFields(models.AbstractModel): <NEW_LINE> <INDENT> _name = 'cms.form.protected.fields' <NEW_LINE> _inherit = 'cms.form' <NEW_LINE> _form_fields_order = ['ihaveagroup', 'nogroup'] <NEW_LINE> nogroup = fields.Char() <NEW_LINE> ihaveagroup = fields.Char(groups='website.group_website_designer') | A test model form w/ `groups` protected fields. | 62598fa17d43ff2487427326 |
class CConverter(Converter): <NEW_LINE> <INDENT> def __init__(self, code, *args): <NEW_LINE> <INDENT> super().__init__(code) <NEW_LINE> self.output = ["#include <stdio.h>\n", "int main(void) {", " int index = 0;", " static char array[30000];"] <NEW_LINE> self.op["add"] = "array[index] += {};" <NEW_LINE> self.op["... | C code converter class | 62598fa13cc13d1c6d4655b4 |
class Task(BaseItem, Tagged, Commented, TaskStateMixin, Owned, Meta, Base): <NEW_LINE> <INDENT> __tablename__ = 'tasks' <NEW_LINE> _modul_id = 1000 <NEW_LINE> id = sa.Column(sa.Integer, primary_key=True) <NEW_LINE> name = sa.Column('name', sa.Text, nullable=False, server_default="") <NEW_LINE> description = sa.Column('... | A task is a general container for all kind of tasks, defects,
feature requests or any other issue in your product. | 62598fa199cbb53fe6830d1b |
class KeyReferenceToPersistent(object): <NEW_LINE> <INDENT> zope.interface.implements(zope.app.keyreference.interfaces.IKeyReference) <NEW_LINE> key_type_id = 'zope.app.keyreference.persistent' <NEW_LINE> def __init__(self, object): <NEW_LINE> <INDENT> if not getattr(object, '_p_oid', None): <NEW_LINE> <INDENT> connect... | An IReference for persistent object which is comparable.
These references compare by _p_oids of the objects they reference. | 62598fa1379a373c97d98e5e |
class ModelTestListView(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = Test.objects.all() <NEW_LINE> serializer_class = ModelTestSerializer | 测试列表 | 62598fa18e7ae83300ee8ee8 |
class SAM_generators(th.nn.Module): <NEW_LINE> <INDENT> def __init__(self, data_shape, cat_embedding, zero_components, nh=None, batch_size=-1, **kwargs): <NEW_LINE> <INDENT> super(SAM_generators, self).__init__() <NEW_LINE> if batch_size == -1: <NEW_LINE> <INDENT> batch_size = data_shape[0] <NEW_LINE> <DEDENT> gpu = kw... | Ensemble of all the generators. | 62598fa197e22403b383ad55 |
class TomoReconsDialog(qt.QDialog): <NEW_LINE> <INDENT> class SinogramHasMultipleRoleInfoMessage(qt.QMessageBox): <NEW_LINE> <INDENT> def __init__(self, sinoName, roles): <NEW_LINE> <INDENT> qt.QMessageBox.__init__(self) <NEW_LINE> self.setIcon(qt.QMessageBox.Warning) <NEW_LINE> self.setText('Multiple role for a sinogr... | Dialog to validate the sinogram selection for tomogui reconstruction
| 62598fa116aa5153ce400348 |
class NoDifferenceError(Exception): <NEW_LINE> <INDENT> pass | This exception represents a case where schoology returns a String with the API
and makes it easier to tell what went wrong. | 62598fa13539df3088ecc0fd |
class RKknn(RPackage): <NEW_LINE> <INDENT> homepage = "https://cloud.r-project.org/package=kknn" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/kknn_1.3.1.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/kknn" <NEW_LINE> version('1.3.1', sha256='22840e70ec2afa40371e274b5836... | Weighted k-Nearest Neighbors for Classification, Regression and
Clustering. | 62598fa1adb09d7d5dc0a3d3 |
class InstrumentDriver(WorkhorseInstrumentDriver): <NEW_LINE> <INDENT> def __init__(self, evt_callback): <NEW_LINE> <INDENT> WorkhorseInstrumentDriver.__init__(self, evt_callback) <NEW_LINE> <DEDENT> def _build_protocol(self): <NEW_LINE> <INDENT> self._protocol = Protocol(Prompt, NEWLINE, self._driver_event) <NEW_LINE>... | Specialization for this version of the workhorse ADCP driver | 62598fa166673b3332c3020f |
class Cinematics(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.scenes = [] <NEW_LINE> <DEDENT> def addScene(self, scene): <NEW_LINE> <INDENT> scenes.append(scence) | Cinématique : séquence de scènes | 62598fa1e5267d203ee6b756 |
@unittest.skipUnless(hasattr(signal, "setitimer"), "requires setitimer()") <NEW_LINE> class SignalEINTRTest(EINTRBaseTest): <NEW_LINE> <INDENT> @unittest.skipUnless(hasattr(signal, 'sigtimedwait'), 'need signal.sigtimedwait()') <NEW_LINE> def test_sigtimedwait(self): <NEW_LINE> <INDENT> t0 = time.monotonic() <NEW_LINE>... | EINTR tests for the signal module. | 62598fa10a50d4780f705223 |
class STUDIO_INIT_FLAGS(Flag): <NEW_LINE> <INDENT> NORMAL = 0x0 <NEW_LINE> LIVEUPDATE = 0x00000001 <NEW_LINE> ALLOW_MISSING_PLUGINS = 0x00000002 <NEW_LINE> SYNCHRONOUS_UPDATE = 0x00000004 <NEW_LINE> DEFERRED_CALLBACKS = 0x00000008 <NEW_LINE> LOAD_FROM_UPDATE = 0x00000010 | Studio System initialization flags.
The zero flag is called "NORMAL".
:cvar int LIVEUPDATE: Enable live update.
:cvar int ALLOW_MISSING_PLUGINS: Load banks even if they reference plugins
that have not been loaded.
:cvar int SYNCHRONOUS_UPDATE: Disable asynchronous processing and perform
all processing on the ... | 62598fa1cc0a2c111447ae57 |
class PublicAPITests(TestCase): <NEW_LINE> <INDENT> def test_addDestination(self): <NEW_LINE> <INDENT> o = object() <NEW_LINE> eliot.addDestination(o) <NEW_LINE> self.addCleanup(eliot.removeDestination, o) <NEW_LINE> self.assertIn(o, Logger._destinations._destinations) <NEW_LINE> <DEDENT> def test_removeDestination(sel... | Tests for the public API. | 62598fa13eb6a72ae038a48c |
class RedditShredderForm(forms.Form): <NEW_LINE> <INDENT> account = forms.ModelChoiceField(queryset=RedditAccounts.objects.none(), label=_('Select an Account'), required=False, widget=forms.Select({ 'class': 'form-control', })) <NEW_LINE> def __init__(self, user_id, *args, **kwargs): <NEW_LINE> <INDENT> super(RedditShr... | Receives the user's preferences for the manual shredder. | 62598fa18a43f66fc4bf1fc5 |
class ProductQuestionSamerel(Base): <NEW_LINE> <INDENT> __tablename__ = "em_product_question_same_rel" <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True) <NEW_LINE> question = Column(VARCHAR(255), nullable=False, comment="问题内容") <NEW_LINE> qid = Column(Integer, Forei... | 问答知识的相同问题 | 62598fa199cbb53fe6830d1c |
class CnczPush(TCPSocketServer): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CnczPush, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def create_handler(self, con, addr, logger): <NEW_LINE> <INDENT> return CnczPushRHWrapper(con, addr, self, logger) <NEW_LINE> <DEDENT> def _pu... | Listens for notification from C&CZ on port 1235 | 62598fa1925a0f43d25e7e86 |
class Session: <NEW_LINE> <INDENT> def __init__(self, user, token_payload, token): <NEW_LINE> <INDENT> self.user = user <NEW_LINE> self.token = token <NEW_LINE> if token_payload: <NEW_LINE> <INDENT> self.expires_at = token_payload["exp"] <NEW_LINE> self.issued_at = token_payload["iat"] <NEW_LINE> self.user_id = token_p... | A api session | 62598fa16e29344779b004a5 |
class AipImageProcess(AipBase): <NEW_LINE> <INDENT> __imageQualityEnhanceUrl = 'https://aip.baidubce.com/rest/2.0/image-process/v1/image_quality_enhance' <NEW_LINE> __dehazeUrl = 'https://aip.baidubce.com/rest/2.0/image-process/v1/dehaze' <NEW_LINE> __contrastEnhanceUrl = 'https://aip.baidubce.com/rest/2.0/image-proces... | 图像处理 | 62598fa1090684286d5935ff |
class AttachmentData(Model): <NEW_LINE> <INDENT> _attribute_map = { "type": {"key": "type", "type": "str"}, "name": {"key": "name", "type": "str"}, "original_base64": {"key": "originalBase64", "type": "bytearray"}, "thumbnail_base64": {"key": "thumbnailBase64", "type": "bytearray"}, } <NEW_LINE> def __init__( self, *, ... | Attachment data.
:param type: Content-Type of the attachment
:type type: str
:param name: Name of the attachment
:type name: str
:param original_base64: Attachment content
:type original_base64: bytearray
:param thumbnail_base64: Attachment thumbnail
:type thumbnail_base64: bytearray | 62598fa12c8b7c6e89bd3610 |
class ForEach(Statement, HasSymbolTable): <NEW_LINE> <INDENT> def __init__(self, pos: Tuple[int, int], name: Name, otype: ObjectType, atom_indices: Optional[Tuple[str, str]], constraints: Constraint, body: List[Statement]) -> None: <NEW_LINE> <INDENT> super().__init__(pos) <NEW_LINE> self.name: Name = name <NEW_LINE> s... | For each loop | 62598fa1e64d504609df92dd |
class Model(Transformer, metaclass=ABCMeta): <NEW_LINE> <INDENT> pass | Abstract class for models that are fitted by estimators.
A model is an ordinary Transformer except how it is created. While ordinary transformers
are defined by specifying the parameters directly, a model is usually generated by an Estimator
when Estimator.fit(table_env, table) is invoked.
.. versionadded:: 1.11.0 | 62598fa1dd821e528d6d8d7e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.