code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class _PropertyInstance(dict): <NEW_LINE> <INDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> return self.__getitem__(attr) | Stores properties as a dictionary and
allows access to them via attributes | 62599019507cdc57c63a5b44 |
class Surface: <NEW_LINE> <INDENT> def __init__(self, *nodes, degree: int = 2): <NEW_LINE> <INDENT> self._nodes = np.asfortranarray(list(nodes)) <NEW_LINE> self.degree = degree <NEW_LINE> <DEDENT> @property <NEW_LINE> def nodes(self): <NEW_LINE> <INDENT> return self._nodes.tolist() <NEW_LINE> <DEDENT> def get_xy_coords... | Class that represents a Surface from a number of nodes and degree | 6259901991af0d3eaad3abc5 |
class ShowVariablesBoot(ShowVariablesBootSchema): <NEW_LINE> <INDENT> cli_command = 'show variables boot' <NEW_LINE> def cli(self, output=None): <NEW_LINE> <INDENT> if output is None: <NEW_LINE> <INDENT> out = self.device.execute(self.cli_command) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> out = output <NEW_LINE> <D... | Parser for show variables boot | 625990195166f23b2e244175 |
class LogViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> filter_backends = [filters.OrderingFilter, filters.SearchFilter] <NEW_LINE> ordering = ["-date_created"] <NEW_LINE> ordering_fields = "__all__" <NEW_LINE> pagination_class = pagination.CustomPageNumberPagination <NEW_LINE> permission_classes = ( permi... | Log viewset. | 62599019bf627c535bcb2254 |
class TestCheck(Check): <NEW_LINE> <INDENT> __test__ = True <NEW_LINE> @property <NEW_LINE> def this_check(self): <NEW_LINE> <INDENT> return chk <NEW_LINE> <DEDENT> def test_smoke(self): <NEW_LINE> <INDENT> assert self.passes("""Smoke phrase with nothing flagged.""") <NEW_LINE> assert not self.passes("""It goes back to... | The test class for misc.capitalization. | 62599019925a0f43d25e8de7 |
class UCProgramVariableCollection (object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.log = logging.getLogger(__name__) <NEW_LINE> self.by_index = [] <NEW_LINE> self.by_name = {} <NEW_LINE> <DEDENT> def getVariable(self, name): <NEW_LINE> <INDENT> if(name in self.by_name): <NEW_LINE> <INDENT> re... | Represents a collection of program variables | 625990190a366e3fb87dd79b |
class TemplateMatch(Feature): <NEW_LINE> <INDENT> template_image = None <NEW_LINE> quality = 0 <NEW_LINE> w = 0 <NEW_LINE> h = 0 <NEW_LINE> def __init__(self, image, template, location, quality): <NEW_LINE> <INDENT> self.template_image = template <NEW_LINE> self.image = image <NEW_LINE> self.quality = quality <NEW_LINE... | **SUMMARY**
This class is used for template (pattern) matching in images.
The template matching cannot handle scale or rotation. | 625990195e10d32532ce3fda |
class Testcase_320_180_MultipartTableFeaturesOmittingMatch(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> @wireshark_capture <NEW_LINE> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running 320.180 - Table features omitting match test") <NEW_LINE> logging.info("Delete all flows on DUT") <NEW_LINE> rv = delete_... | 320.180 - Table features omitting match
Verify an attempt to set table feature properties without including the match property triggers an error message. | 625990198c3a8732951f7309 |
class UnionWithData(ctypes.Union): <NEW_LINE> <INDENT> _pack_ = 1 <NEW_LINE> _fields_ = [("input_buffer", ctypes.c_byte * ctypes.sizeof(dynamic_struct)), ("struct_data", dynamic_struct)] | This union binds the buffer with the struct or union by holding them as two fields (that's how unions work
in C). Only the struct field should be returned, however, so the user won't be able to access (or know
about) the buffer array field. | 625990195e10d32532ce3fdb |
class BahdanauAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, hidden_dim=128, query_dim=128, memory_dim=128): <NEW_LINE> <INDENT> super(BahdanauAttention, self).__init__() <NEW_LINE> self.hidden_dim = hidden_dim <NEW_LINE> self.query_dim = query_dim <NEW_LINE> self.memory_dim = memory_dim <NEW_LINE> self.s... | Reused from https://github.com/chrisbangun/pytorch-seq2seq_with_attention/ | 62599019925a0f43d25e8deb |
@format_doc(geodetic_base_doc) <NEW_LINE> class BaseGeodeticRepresentation(BaseRepresentation): <NEW_LINE> <INDENT> attr_classes = {'lon': Longitude, 'lat': Latitude, 'height': u.Quantity} <NEW_LINE> def __init_subclass__(cls, **kwargs): <NEW_LINE> <INDENT> super().__init_subclass__(**kwargs) <NEW_LINE> if '_ellipsoid'... | Base geodetic representation. | 62599019507cdc57c63a5b4b |
class BlogDetailView(generic.DetailView): <NEW_LINE> <INDENT> model = Blog | Generic class-based detail view for a blog. | 6259901956b00c62f0fb3668 |
class Response( models.Model ): <NEW_LINE> <INDENT> instance = models.ForeignKey( Instance , blank=False , null=False , editable = False , unique = True ) <NEW_LINE> response = models.TextField( editable = False ) <NEW_LINE> mimeType = models.TextField( editable = True ) <NEW_LINE> def __unicode__( self ) : return u... | Task Response storage.
DB fields:
instance - process instance;
response - process XML response (if not in plain text GZIP+BASE64 is applied). | 625990190a366e3fb87dd7a1 |
class SequencingMachine(UuidStampedMixin, TimeStampedModel): <NEW_LINE> <INDENT> vendor_id = models.CharField( unique=True, db_index=True, max_length=100, help_text='Vendor ID of the machine') <NEW_LINE> label = models.CharField( max_length=100, help_text='Short name of the machine') <NEW_LINE> description = models.Tex... | Represent a sequencing machine instance
| 6259901956b00c62f0fb366a |
class Thread(models.Model): <NEW_LINE> <INDENT> created = models.DateTimeField(blank=True, null=True, auto_now_add=True) <NEW_LINE> user = models.ForeignKey(hmod.SiteUser) <NEW_LINE> topic = models.ForeignKey(Topic) <NEW_LINE> title = models.TextField(blank=True, null=True) <NEW_LINE> options = JSONField(blank=True, nu... | A discussion thread within a topic | 62599019d164cc6175821d2b |
class Checkbox(_CheckableInput): <NEW_LINE> <INDENT> def __init__(self, name="", value=""): <NEW_LINE> <INDENT> super().__init__("checkbox", name, value) | An HTML checkbox (<input type="checkbox">) element.
>>> cb = Checkbox("my-name", "my-value")
>>> cb.checked = True | 62599019d18da76e235b7824 |
class Notation(XMLSchemaComponent): <NEW_LINE> <INDENT> required = ['name', 'public'] <NEW_LINE> attributes = {'id': None, 'name': None, 'public': None, 'system': None} <NEW_LINE> contents = {'xsd': ('annotation')} <NEW_LINE> tag = 'notation' <NEW_LINE> def __init__(self, parent): <NEW_LINE> <INDENT> XMLSchemaComponent... | <notation>
parent:
schema
attributes:
id -- ID
name -- NCName, Required
public -- token, Required
system -- anyURI
contents:
annotation? | 625990199b70327d1c57fb2e |
class EmotionRecogniser(object): <NEW_LINE> <INDENT> def __init__(self, dev_data, dev_targets, eval_data, eval_targets, features_min_max): <NEW_LINE> <INDENT> logging.info("Initialising emotion recognising") <NEW_LINE> self._error = -1 <NEW_LINE> self._dev_data = dev_data <NEW_LINE> self._dev_targets = dev_targets <NEW... | Class containing neural network object, used to train and evaluate | 62599019d164cc6175821d2d |
class Event(object): <NEW_LINE> <INDENT> def __init__(self, json_obj): <NEW_LINE> <INDENT> self.id = json_obj['id'] <NEW_LINE> self.raw_json = json_obj <NEW_LINE> self._attributes = json_obj['attributes'] <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if attr not in self._attributes: <NEW_LINE> <I... | Class to represent a Tech @ NYU Event | 62599019462c4b4f79dbc7b9 |
class CredentialProblemReportRequestSchema(Schema): <NEW_LINE> <INDENT> explain_ltxt = fields.Str(required=True) | Request schema for sending a problem report. | 625990190a366e3fb87dd7a5 |
class Writer(object): <NEW_LINE> <INDENT> def __init__(self, doc_type=None): <NEW_LINE> <INDENT> super(Writer, self).__init__() <NEW_LINE> self.db_name = config.db_name <NEW_LINE> self.doc_type = doc_type <NEW_LINE> self.conn = MongoClient(config.mongodb_uri) <NEW_LINE> self.db = self.conn[self.db_name] <NEW_LINE> self... | Storage Reader Object | 625990196fece00bbaccc766 |
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE) <NEW_LINE> class TestWikiAccessForStudent(TestWikiAccessBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestWikiAccessForStudent, self).setUp() <NEW_LINE> self.student = UserFactory.create() <NEW_LINE> <DEDENT> def test_student_is_not_roo... | Test access for students. | 62599019be8e80087fbbfe24 |
class GaussLogisticActiveLearnerMO(GaussLogisticProblem, mps.MyopicOracleExperimentDesigner): <NEW_LINE> <INDENT> pass | Active Learning on the Bayesian Logistic Model with the Oracle policy. | 6259901921a7993f00c66d2d |
class User(UserMixin): <NEW_LINE> <INDENT> pass | User representation | 625990190a366e3fb87dd7a7 |
class point3d(object): <NEW_LINE> <INDENT> def __init__(self, x = np.float32(0.0), y = np.float32(0.0), z = np.float32(0.0)): <NEW_LINE> <INDENT> self._x = np.float32( x ) <NEW_LINE> self._y = np.float32( y ) <NEW_LINE> self._z = np.float32( z ) <NEW_LINE> <DEDENT> @property <NEW_LINE> def x(self): <NEW_LINE> <INDENT> ... | 3D point made from three floats | 62599019a8ecb03325871fd0 |
class RepeatingTimer: <NEW_LINE> <INDENT> def __init__(self, interval): <NEW_LINE> <INDENT> self.interval = interval <NEW_LINE> self.callbacks = [] <NEW_LINE> <DEDENT> def register(self, f, *args, **kwargs): <NEW_LINE> <INDENT> self.callbacks.append(Callback(f, args, kwargs)) <NEW_LINE> <DEDENT> def run(self): <NEW_LIN... | Calls a set of functions in regular intervals | 6259901991af0d3eaad3abd5 |
class KeyMatcher(object): <NEW_LINE> <INDENT> def __init__(self, keys_to_track): <NEW_LINE> <INDENT> self.keys_to_track = keys_to_track <NEW_LINE> self.tracker = {} <NEW_LINE> for key_to_track in self.keys_to_track: <NEW_LINE> <INDENT> self.tracker[key_to_track] = {} <NEW_LINE> <DEDENT> <DEDENT> def add(self, obj, matc... | Lets you define keys that should be tracked. You then add()
matches. You can then match() against the keys you defined.
The reason this exists is to support a "hierarchy" of matches. For
example, you may want to match on key A--and if there's a match,
you're done. Then if there's no match on key A, try key B. &c. | 6259901a0a366e3fb87dd7a9 |
class _IMetricProxy: <NEW_LINE> <INDENT> __jsii_type__: typing.ClassVar[str] = "@aws-cdk/aws-cloudwatch.IMetric" <NEW_LINE> @jsii.member(jsii_name="toAlarmConfig") <NEW_LINE> def to_alarm_config(self) -> "MetricAlarmConfig": <NEW_LINE> <INDENT> return jsii.invoke(self, "toAlarmConfig", []) <NEW_LINE> <DEDENT> @jsii.mem... | Interface for metrics. | 6259901a56b00c62f0fb3672 |
class OBFS(Binary): <NEW_LINE> <INDENT> file_ext = 'obfs' <NEW_LINE> composite_type = 'basic' <NEW_LINE> allow_datatype_change = False <NEW_LINE> MetadataElement(name="base_name", default='OpenBabel Fastsearch Index', readonly=True, visible=True, optional=True,) <NEW_LINE> def __init__(self, **kwd): <NEW_LINE> <INDENT>... | OpenBabel Fastsearch format (fs). | 6259901a5e10d32532ce3fe1 |
class Concord232Alarm(alarm.AlarmControlPanel): <NEW_LINE> <INDENT> def __init__(self, hass, url, name): <NEW_LINE> <INDENT> from concord232 import client as concord232_client <NEW_LINE> self._state = STATE_UNKNOWN <NEW_LINE> self._hass = hass <NEW_LINE> self._name = name <NEW_LINE> self._url = url <NEW_LINE> try: <NEW... | Represents the Concord232-based alarm panel. | 6259901a91af0d3eaad3abd7 |
class Send(VbaLibraryFunc): <NEW_LINE> <INDENT> def eval(self, context, params=None): <NEW_LINE> <INDENT> return 200 | Faked emulation of HTTP send(). Always returns 200. | 6259901abe8e80087fbbfe28 |
class Log: <NEW_LINE> <INDENT> def __init__(self, filename="") -> None: <NEW_LINE> <INDENT> self._logger = logging.getLogger(filename) <NEW_LINE> self._log_level = logging.DEBUG <NEW_LINE> self._log_dir = None <NEW_LINE> self.log_format = LOG_FORMAT <NEW_LINE> self.rp_logger = None <NEW_LINE> <DEDENT> def set_rp_logger... | CephCI Logger object to help streamline logging. | 6259901a9b70327d1c57fb36 |
class ProjectTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> project1 = Project.objects.create(title="Test Project 1", creator="user_test1", tagline="Test Tagline 1", content="Test Content 1", avail_mem=True, sponsor=False, slug="test1-slug",resource="Test Resource 1") <NEW_LINE> project2 =... | Tests various methods included in projects/models.py
Adapted from: https://docs.djangoproject.com/en/1.11/topics/testing/overview/ | 6259901a0a366e3fb87dd7ab |
class stock_move(osv.osv): <NEW_LINE> <INDENT> _inherit = 'stock.move' <NEW_LINE> def default_get(self, cr, uid, fields, context=None): <NEW_LINE> <INDENT> if not context: <NEW_LINE> <INDENT> context = {} <NEW_LINE> <DEDENT> res = super(stock_move, self).default_get(cr, uid, fields, context=context) <NEW_LINE> res['dat... | shipment date of sale order is updated | 6259901a56b00c62f0fb3674 |
class AssessmentDto(BaseDto): <NEW_LINE> <INDENT> allottedMinutes = ndb.IntegerProperty(indexed=False) <NEW_LINE> owner = ndb.KeyProperty(UserDto) <NEW_LINE> closeTime = ndb.StringProperty() <NEW_LINE> description = ndb.StringProperty(indexed=False) <NEW_LINE> openTime = ndb.StringProperty() <NEW_LINE> pointsForCorrect... | Represents an assessment. | 6259901a796e427e5384f536 |
class RedditerCreationForm(UserCreationForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kargs): <NEW_LINE> <INDENT> super(RedditerCreationForm, self).__init__(*args, **kargs) | A form that creates a user, with no privileges, from the given email and
password. | 6259901ad164cc6175821d35 |
class AttrVI_ATTR_TERMCHAR(RangeAttribute): <NEW_LINE> <INDENT> resources = [(constants.InterfaceType.gpib, 'INSTR'), (constants.InterfaceType.gpib, 'INTFC'), (constants.InterfaceType.asrl, 'INSTR'), (constants.InterfaceType.tcpip, 'INSTR'), (constants.InterfaceType.tcpip, 'SOCKET'), (constants.InterfaceType.usb, 'INST... | VI_ATTR_TERMCHAR is the termination character. When the termination
character is read and VI_ATTR_TERMCHAR_EN is enabled during a read
operation, the read operation terminates. | 6259901a925a0f43d25e8df9 |
class _ActuatorEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if isinstance(o, Actuator): <NEW_LINE> <INDENT> dct = {} <NEW_LINE> dct["status"] = o.actuatorState.value <NEW_LINE> dct["value"] = o.value <NEW_LINE> return dct <NEW_LINE> <DEDENT> return json.JSONEncoder.default(se... | Actuator JSON encoder that returns
dictionary with status and value | 6259901aa8ecb03325871fd6 |
class _dataclasses: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def patch(cls): <NEW_LINE> <INDENT> def raise_if_frozen(self, fun, name, *args, **kwargs): <NEW_LINE> <INDENT> _raise_if(f"cannot assign to/delete field {name!r}", getattr(self, '__frozen__', False)) <NEW_LINE> getattr(object, fun)(self, name, *args, **kw... | dataclass proxy | 6259901a6fece00bbaccc76f |
class Alianza(Candidatura): <NEW_LINE> <INDENT> plural_name = NOMBRE_JSON_ALIANZAS <NEW_LINE> def full_dict(self, img_func, listas=True): <NEW_LINE> <INDENT> alianza = self.to_dict() <NEW_LINE> alianza['imagen'] = img_func(alianza['codigo']) <NEW_LINE> alianza['listas'] = [] <NEW_LINE> if listas: <NEW_LINE> <INDENT> fo... | Alianza que participa de la eleccion. | 6259901a0a366e3fb87dd7af |
class LayerObjective(Objective): <NEW_LINE> <INDENT> def __init__(self, model, layer, channel=None, neuron=None, shortcut=False, batchwise=False): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.layer = layer <NEW_LINE> self.channel = channel <NEW_LINE> self.neuron = neuron <NEW_LINE> self.shortcut = shortcut <N... | Generate an Objective from a particular layer of a network.
Supports the layer indexing that interpret provides as well as
options for selecting the channel or neuron of the layer.
Parameters:
model (nn.Module): PyTorch model.
layer (str or int): the layer to optimise.
channel (int): the channel to optimis... | 6259901a56b00c62f0fb3678 |
class ToggleDrive(yeti.Module): <NEW_LINE> <INDENT> USE_CAN = False <NEW_LINE> def module_init(self): <NEW_LINE> <INDENT> self.referee = Referee(self) <NEW_LINE> self.joystick = wpilib.Joystick(0) <NEW_LINE> self.referee.watch(self.joystick) <NEW_LINE> if self.USE_CAN: <NEW_LINE> <INDENT> motor_controller_class = wpili... | A 1-Joystick Mecanum drivetrain module, holding button 10 to switch between spin and strafe. | 6259901ad18da76e235b782b |
class ActionCounterWithWindow(TransformerMixin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.column_names = ['action_counter'] <NEW_LINE> <DEDENT> def fit(self, X): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform(self, X): <NEW_LINE> <INDENT> return X[self.column_names] <NEW_LINE>... | All actions are counted (also actions that were not modified between train-eval loops) | 6259901a796e427e5384f53c |
class Deuterium(IsotopeMixin, Hidrogen): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(1) | Deuterium element | 6259901a21a7993f00c66d39 |
class getPersonByName_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, dataException=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.dataException = dataException <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.... | Attributes:
- success
- dataException | 6259901a91af0d3eaad3abe0 |
class UnsubscribeForm(AlertPreferenceForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(UnsubscribeForm, self).__init__(*args, **kwargs) <NEW_LINE> for backend in self.backends: <NEW_LINE> <INDENT> for alert in self.alerts: <NEW_LINE> <INDENT> field_id = self._field_id(alert.id, b... | This form does not show any check boxes, it expects to be placed into
the page with only a submit button and some text explaining that by
clicking the submit button the user will unsubscribe form the Alert
notifications. (the alert that is passed in) | 6259901a0a366e3fb87dd7b3 |
class ContractList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Contract.objects.all() <NEW_LINE> serializer_class = ContractSerializer <NEW_LINE> filter_backends = [DjangoFilterBackend, filters.SearchFilter, filters.OrderingFilter] <NEW_LINE> filterset_fields = ['user__username', 'structure__name', 'typ... | Ce generics fournit les actions `list`, `create` pour les contrats | 6259901a9b70327d1c57fb3f |
class BearerTokenError(Exception): <NEW_LINE> <INDENT> _errors = { 'invalid_request': ( 'The request is otherwise malformed', 400 ), 'invalid_token': ( 'The access token provided is expired, revoked, malformed, ' 'or invalid for other reasons', 401 ), 'insufficient_scope': ( 'The request requires higher privileges than... | OAuth2 errors.
https://tools.ietf.org/html/rfc6750#section-3.1 | 6259901a8c3a8732951f7320 |
class TimeoutError(CommunicationError): <NEW_LINE> <INDENT> pass | Raised when an NFC Forum Digital Specification timeout error
occured. | 6259901a5166f23b2e244191 |
class NodeDispatcher(object): <NEW_LINE> <INDENT> def __init__(self, registry, node, user, permissions): <NEW_LINE> <INDENT> self.registry = registry <NEW_LINE> self.node = node <NEW_LINE> self.user = user <NEW_LINE> self.permissions = permissions <NEW_LINE> <DEDENT> def __call__(self, endpoint, args): <NEW_LINE> <INDE... | Dispatch a view. Internal class used by :meth:`NodePublisher.publish`.
:param registry: Registry to look up views in.
:param node: Node for which we are dispatching views.
:param user: User for which we are rendering the view.
:param permissions: Externally-granted permissions for this user.
The view instance is made... | 6259901ad18da76e235b782d |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(_('email address'), max_length=254, unique=True) <NEW_LINE> first_name = models.CharField(_('first name'), max_length=30, blank=True) <NEW_LINE> last_name = models.CharField(_('last name'), max_length=30, blank=True) <NEW_LINE... | A fully featured User model with admin-compliant permissions that uses
a full-length email field as the username.
Email and password are required. Other fields are optional. | 6259901a91af0d3eaad3abe2 |
class _AccessGroups(lhn.AccordionGroup): <NEW_LINE> <INDENT> _locator_button_create_new = locator.LhnMenu.BUTTON_CREATE_NEW_ACCESS_GROUPS <NEW_LINE> _locator_spinny = locator.LhnMenu.SPINNY_ACCESS_GROUPS | Access groups dropdown in LHN. | 6259901a925a0f43d25e8e03 |
class TestDetectListType: <NEW_LINE> <INDENT> test_data = [ FixtureTestData(int, None), FixtureTestData(str, None), FixtureTestData(typing.List[int], int), FixtureTestData(typing.List[str], str), FixtureTestData(typing.List[BogusClass], BogusClass), FixtureTestData(BogusClass, None) ] <NEW_LINE> test_ids = [ "{input} =... | Testing class for `codepost.models.abstract.api_resource_metaclass`
method `detect_list_type`. | 6259901ad164cc6175821d41 |
class PostExecutionHook(BaseToolDeclaration): <NEW_LINE> <INDENT> pass | A declarative class for contributing a measurement post-execution.
PostExecutionHook object can be contributed as extensions child to the
'post-execution' extension point of the 'exopy.measurement' plugin. | 6259901ad18da76e235b782f |
class LogoutView(RedirectView): <NEW_LINE> <INDENT> def get_redirect_url(self, *args, **kwargs): <NEW_LINE> <INDENT> url = self.request.META.get('HTTP_REFERER', '/') <NEW_LINE> return url <NEW_LINE> <DEDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if self.request.user.is_authenticated(): <NEW_LINE>... | Обработчик кнопки 'ВЫЙТИ' | 6259901a462c4b4f79dbc7cd |
class JSONConverter(BaseConverter): <NEW_LINE> <INDENT> def __init__(self, *args, json_spaces=4, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.config['outfile_type'] = '.json' <NEW_LINE> self.config['allow_comments'] = False <NEW_LINE> self.config['json_space'] = ' '*json_spaces <NEW_... | tosses all comments
uses groups to make nested dicts
only converts PREPARE sql statements:
use name inside the PREPARE portion as key name
the parametrized query ready for the pg api | 6259901a91af0d3eaad3abe6 |
class LightweightChart(FigureCanvas): <NEW_LINE> <INDENT> fig = None <NEW_LINE> plot = None <NEW_LINE> num_ticks = 4 <NEW_LINE> margin, maxSize = 0.0, 1.0 <NEW_LINE> def __init__(self, parent, dates=None, values=None, name=None, width=3.2, height=2.4, dpi=100): <NEW_LINE> <INDENT> self.fig = Figure(figsize=(width, heig... | Jest to klasa do wyświetlania "lekkich" wykresów, tzn. takich które będą na
głównej stronie i odnoszą się do rynku jako całości (indeksy, A/D line itd.)
Nie można po nich rysować, wyświetlać wolumenu, zmieniać skali etc. Ponadto
klasa ta nie korzysta z ChartData tylko rysuje na pałę zwykłą tablicę. | 6259901ad18da76e235b7830 |
class Manuscript(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=20,verbose_name='稿件名') <NEW_LINE> createTime = models.DateField(verbose_name='发布日期') <NEW_LINE> issuer = models.CharField(max_length=10,verbose_name='发布人') <NEW_LINE> content = models.CharField(max_length=500,verbose_name='稿件文字内容') <... | 历史稿件 | 6259901a9b70327d1c57fb47 |
class ValueTypeInt(ValueType): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_code(): <NEW_LINE> <INDENT> return VALUE_TYPE_CODE.INT <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def check_consistency(value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> int(value) <NEW_LINE> return True <NEW_LINE> <DEDENT> except ... | an int | 6259901a925a0f43d25e8e09 |
class Evieext(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://cgit.freedesktop.org/xorg/proto/evieproto" <NEW_LINE> url = "https://www.x.org/archive/individual/proto/evieext-1.1.1.tar.gz" <NEW_LINE> version('1.1.1', '018a7d24d0c7926d594246320bcb6a86') <NEW_LINE> depends_on('pkg-config@0.9.0:', type='buil... | Extended Visual Information Extension (XEVIE).
This extension defines a protocol for a client to determine information
about core X visuals beyond what the core protocol provides. | 6259901a507cdc57c63a5b69 |
class ParseError(BonesError): <NEW_LINE> <INDENT> def __init__(self, innerException, arg): <NEW_LINE> <INDENT> self.innerException = innerException <NEW_LINE> self.argument = arg | Error for when an automatic parse of an option fails. | 6259901ad18da76e235b7831 |
class FontBrowseButton(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, parent, font=None): <NEW_LINE> <INDENT> wx.Panel.__init__(self, parent, -1) <NEW_LINE> btn = wx.Button(self, -1, "Select Font") <NEW_LINE> self.Bind(wx.EVT_BUTTON, self.OnSelectFont, btn) <NEW_LINE> self.sampleText = wx.TextCtrl(self, -1, size=(15... | Simple panel and button to choose and display a new font.
Borrowed from the wxPython demo. | 6259901a796e427e5384f547 |
class TestLongerString(unittest.TestCase): <NEW_LINE> <INDENT> def test_string_1_is_string(self): <NEW_LINE> <INDENT> str1 = 2 <NEW_LINE> str2 = "Mammoth" <NEW_LINE> self.assertEqual(longer_word(str1, str2), "All inputs must be string") <NEW_LINE> <DEDENT> def test_string_2_is_string(self): <NEW_LINE> <INDENT> str1 = "... | Class to test longer string function | 6259901a0a366e3fb87dd7bd |
class Tee: <NEW_LINE> <INDENT> def __init__(self, name, mode): <NEW_LINE> <INDENT> self.file_name = name <NEW_LINE> self.mode = mode <NEW_LINE> self.file = None <NEW_LINE> self.stdout = sys.stdout <NEW_LINE> self.stderr = sys.stderr <NEW_LINE> sys.stdout = self <NEW_LINE> sys.stderr = self <NEW_LINE> <DEDENT> def write... | Class duplicating stdout and stderr to a specified log file and | 6259901a287bf620b62729b1 |
class Dog(AnimalActions): <NEW_LINE> <INDENT> strings = dict( quack="The dog cannot quack.", feathers="The dog has no feathers.", bark="Arf!", fur="The dog has white fur with black spots." ) | Class Dog to define properties of Dog | 6259901ad18da76e235b7832 |
class DefinitionList: <NEW_LINE> <INDENT> __maxDefinitionPrefixLength = 24 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.__items = [] <NEW_LINE> <DEDENT> def add(self, name, definition): <NEW_LINE> <INDENT> if isinstance(definition, basestring): <NEW_LINE> <INDENT> definition = Paragraph(definition) <NEW_LINE... | A list of terms with their definitions.
>>> print Document().add(Section("Section title")
... .add(DefinitionList()
... .add("Item", Paragraph("Definition 1"))
... .add("Other item", Paragraph("Definition 2"))
... )
... ).format()
Section title
Item Definition 1
Other item Definition 2 | 6259901a0a366e3fb87dd7bf |
class SocketListener(object): <NEW_LINE> <INDENT> def __init__(self, address, family, backlog=1): <NEW_LINE> <INDENT> self._socket = socket.socket(getattr(socket, family)) <NEW_LINE> try: <NEW_LINE> <INDENT> if os.name == 'posix': <NEW_LINE> <INDENT> self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <N... | Representation of a socket which is bound to an address and listening | 6259901a8c3a8732951f732c |
class BaseModel(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> unique_together = ("slug", "version") <NEW_LINE> default_permissions = () <NEW_LINE> get_latest_by = "version" <NEW_LINE> <DEDENT> slug = ResolweSlugField(populate_from="name", unique_with="version", max_length... | Abstract model that includes common fields for other models. | 6259901aa8ecb03325871fe8 |
class SummarizationPipeline: <NEW_LINE> <INDENT> def __init__(self, log_level: int = LOG_LEVEL): <NEW_LINE> <INDENT> logging.basicConfig( format='%(asctime)s %(name)s %(levelname)-8s %(message)s', level=log_level, datefmt='%d/%m/%Y %I:%M:%S %p' ) <NEW_LINE> self.logger = logging.getLogger("SummaryDAOPostgresql") <NEW_L... | Summarization pipeline.
This class takes care of the different summarization steps. It also updates
the summaries stored in the database.
Args:
#TODO | 6259901a5e10d32532ce3fec |
class CityDetailView(DetailView): <NEW_LINE> <INDENT> model = City <NEW_LINE> slug_field = "name" <NEW_LINE> slug_url_kwarg = "city" | Definitely read up on DetailView here:
http://ccbv.co.uk/projects/Django/1.5/django.views.generic.detail/DetailView/
This is similar to ListView (context_object_name and all that), but
here you also need a field to identify the object. | 6259901a5166f23b2e24419d |
class NewspaperEcransBrowser(BaseBrowser): <NEW_LINE> <INDENT> PAGES = { "http://www.ecrans.fr/.*": ArticlePage, } <NEW_LINE> def is_logged(self): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def login(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def fillobj(self, obj, fields): <NEW_LINE> <INDENT> pass <... | NewspaperEcransBrowser class | 6259901ad164cc6175821d49 |
class NwsLocalServerException(Exception): <NEW_LINE> <INDENT> pass | Exception thrown if an error occurs while starting the local server. | 6259901a462c4b4f79dbc7d5 |
class RoundRobinPartition(Partition): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__partitions = [-1] <NEW_LINE> self.seq = 0 <NEW_LINE> <DEDENT> def partition(self, key_record, num_partition: int): <NEW_LINE> <INDENT> self.seq = (self.seq + 1) % num_partition <NEW_LINE> self.__partitions[0] = self... | Partition record to downstream tasks in a round-robin matter. | 6259901aa8ecb03325871fec |
class LN_LSTMCell(tf.contrib.rnn.RNNCell): <NEW_LINE> <INDENT> def __init__(self, num_units, f_bias=1.0, use_zoneout=False, zoneout_keep_h = 0.9, zoneout_keep_c = 0.5, is_training = False): <NEW_LINE> <INDENT> super(LN_LSTMCell, self).__init__() <NEW_LINE> self.num_units = num_units <NEW_LINE> self.f_bias = f_bias <NEW... | Layer-Norm, with Ortho Initialization and Zoneout.
https://arxiv.org/abs/1607.06450 - Layer Norm
https://arxiv.org/abs/1606.01305 - Zoneout
derived from
https://github.com/OlavHN/bnlstm
https://github.com/LeavesBreathe/tensorflow_with_latest_papers
https://github.com/hardmaru/supercell | 6259901a6fece00bbaccc785 |
class Flatten(ZooKerasLayer): <NEW_LINE> <INDENT> def __init__(self, input_shape=None, **kwargs): <NEW_LINE> <INDENT> super(Flatten, self).__init__(None, list(input_shape) if input_shape else None, **kwargs) | Flattens the input without affecting the batch size.
When you use this layer as the first layer of a model, you need to provide the argument
input_shape (a shape tuple, does not include the batch dimension).
# Arguments
input_shape: A shape tuple, not including batch.
name: String to set the name of the layer.
... | 6259901a9b70327d1c57fb51 |
class Architecture(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _spawn(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def train(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def test(self): <NEW_LINE> <INDENT> pass | Abstract class for distributed architectures | 6259901ad164cc6175821d4f |
class Wrapper(object): <NEW_LINE> <INDENT> BASE_ATTRS = ('id', 'name') <NEW_LINE> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractmethod <NEW_LINE> def __init__(self, wrapped, parent=None, gi=None): <NEW_LINE> <INDENT> if not isinstance(wrapped, collections.Mapping): <NEW_LINE> <INDENT> raise TypeError('wrapped obj... | Abstract base class for Galaxy entity wrappers.
Wrapper instances wrap deserialized JSON dictionaries such as the
ones obtained by the Galaxy web API, converting key-based access to
attribute-based access (e.g., ``library['name'] -> library.name``).
Dict keys that are converted to attributes are listed in the
``BASE_... | 6259901a462c4b4f79dbc7db |
class GlobalConfiguration(object): <NEW_LINE> <INDENT> def __init__(self, process, pidfile="", globalTimeout=300, loglevel=10): <NEW_LINE> <INDENT> self.globalTimeout = globalTimeout <NEW_LINE> logging.basicConfig(level=loglevel) <NEW_LINE> self.globalLoglevel = loglevel <NEW_LINE> self.processes = process['username'] ... | classdocs | 6259901a0a366e3fb87dd7c7 |
class uart(object): <NEW_LINE> <INDENT> SOT = '{' <NEW_LINE> EOT = '}' <NEW_LINE> CR = '\r' <NEW_LINE> LF = '\n' <NEW_LINE> CRLF = CR+LF <NEW_LINE> def __init__(self, port, baudrate): <NEW_LINE> <INDENT> self.interface = serial.Serial(baudrate=baudrate) <NEW_LINE> self.interface.port = port <NEW_LINE> self.isOpen = Fal... | Abstracts some basic uart functionality from the pyserial module | 6259901a5166f23b2e2441a5 |
class JSON(Parser): <NEW_LINE> <INDENT> _alias_ = 'json' <NEW_LINE> _version_ = '1.0' <NEW_LINE> def parse(self): <NEW_LINE> <INDENT> return 'json' | Dummy JSON parser | 6259901ad18da76e235b7837 |
class Button(base.Peripherial): <NEW_LINE> <INDENT> def update_state(self): <NEW_LINE> <INDENT> pass | We're not supporting external button on linux.
Feel free to implement Your peripherials here. | 6259901a462c4b4f79dbc7dd |
class FakeSecurityGroup(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create_one_security_group(attrs={}, methods={}): <NEW_LINE> <INDENT> security_group_attrs = { 'id': 'security-group-id-' + uuid.uuid4().hex, 'name': 'security-group-name-' + uuid.uuid4().hex, 'description': 'security-group-description-' +... | Fake one or more security groups. | 6259901a6fece00bbaccc789 |
class ReportTests(TestCase): <NEW_LINE> <INDENT> fixtures = ['admin_user.json', 'forum_example.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.client = logIn() <NEW_LINE> <DEDENT> def test_report_thread(self): <NEW_LINE> <INDENT> response = self.client.post( reverse( 'forum.views.report', kwargs={'object_id... | Tests operations related to reports. | 6259901a796e427e5384f553 |
@export <NEW_LINE> class RandomZoom(RandomTransform): <NEW_LINE> <INDENT> def __init__( self, pad: bool = True, min_factor: float = 0.25, max_factor: float = 1.25 ) -> None: <NEW_LINE> <INDENT> super().__init__( transform=Zoom(pad=pad), min_factor=min_factor, max_factor=max_factor ) | Callable class for randomly zooming, in and out, images and bounding boxes.
Parameters
----------
pad
min_factor
max_factor | 6259901a56b00c62f0fb3692 |
class TeamModelAdminTest(case.DBTestCase): <NEW_LINE> <INDENT> @property <NEW_LINE> def admin(self): <NEW_LINE> <INDENT> from moztrap.model.mtadmin import TeamModelAdmin <NEW_LINE> return TeamModelAdmin <NEW_LINE> <DEDENT> def test_fieldsets(self): <NEW_LINE> <INDENT> ma = self.admin(self.model.ProductVersion, AdminSit... | Tests of TeamModelAdmin. | 6259901b5166f23b2e2441a7 |
class ManualInGame(): <NEW_LINE> <INDENT> def __init__( self, surfaceDest, rectManual, tutorialScheduler, fontManual=fontConsole ): <NEW_LINE> <INDENT> self.surfaceDest = surfaceDest <NEW_LINE> self.rectManual = rectManual <NEW_LINE> self.tutorialScheduler = tutorialScheduler <NEW_LINE> self.fontManual = fontManual <NE... | classe qui affiche le manuel du jeu pendant le jeu.
(Ça affiche la liste des touche)
type MVC : osef. | 6259901b507cdc57c63a5b77 |
class SyncStepDetailInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.StepNo = None <NEW_LINE> self.StepName = None <NEW_LINE> self.CanStop = None <NEW_LINE> self.StepId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.StepNo = params.get("StepNo") ... | Sync task progress
| 6259901b91af0d3eaad3abfa |
class UnknownColumnException(Exception): <NEW_LINE> <INDENT> def __init__(self, message: str, errors: dict, cls: Base, column: str, *args): <NEW_LINE> <INDENT> super().__init__(message, *args) <NEW_LINE> self.__errors = errors <NEW_LINE> self.__cls = cls <NEW_LINE> self.__column = column <NEW_LINE> <DEDENT> @property <... | Exception for Repo Objects: Unknown Column | 6259901b63f4b57ef008645d |
@ddt <NEW_LINE> class TestMainPageBuyerBanners(HelpNavigateCheckMethods, HelpNavigateData, HelpAuthCheckMethods): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUp(cls): <NEW_LINE> <INDENT> default_user_id = AccountingMethods.get_default_user_id(role='buyer') <NEW_LINE> cls.user = databases.db1.accounting.get_user_... | Story: Баннер на главной странице для покупателя | 6259901b462c4b4f79dbc7e1 |
class Station(Producer): <NEW_LINE> <INDENT> key_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_key.json") <NEW_LINE> value_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_value.json") <NEW_LINE> def __init__(self, station_id, name, color, direction_a=None, direction_b=None): <NEW_LIN... | Defines a single station | 6259901b0a366e3fb87dd7cd |
class Side(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.units = [] <NEW_LINE> self.other = None <NEW_LINE> self.name = name <NEW_LINE> self.has_king = False <NEW_LINE> self.rallied = 0 <NEW_LINE> self.influenced = False <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self.__i... | Represents an individual side/army (typically white and black). | 6259901b6fece00bbaccc78d |
class RegisterForm(ExtendedForm): <NEW_LINE> <INDENT> login = TextField(_('Username'), [validators.Required(), validators.Length(min=4, max=25)]) <NEW_LINE> password = PasswordField(_('Password'), [validators.Required(), validators.EqualTo('password2', message=_('Passwords must match'))]) <NEW_LINE> password2 = Passwor... | Registration Form
| 6259901b9b70327d1c57fb58 |
class GameStats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_stats() <NEW_LINE> self.game_active = False <NEW_LINE> self.high_score = 0 <NEW_LINE> <DEDENT> def reset_stats(self): <NEW_LINE> <INDENT> self.ship_left = self.ai_settings.shi... | Track game info | 6259901b796e427e5384f557 |
class NamedChainReadWriter(ReadWriter): <NEW_LINE> <INDENT> __slots__ = ('_pairs',) <NEW_LINE> def __init__(self, pairs): <NEW_LINE> <INDENT> assert pairs is not None <NEW_LINE> self._pairs = pairs <NEW_LINE> <DEDENT> def read(self, stream): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for name, rw in self._pairs: <NEW_L... | See :py:func:`dictionary` for documentation. | 6259901b6fece00bbaccc78f |
class FileTestRunner(object): <NEW_LINE> <INDENT> default_command = ['python'] <NEW_LINE> def __init__(self, file_filter, test_mapper, command=None): <NEW_LINE> <INDENT> self.file_filter = file_filter <NEW_LINE> self.test_mapper = test_mapper <NEW_LINE> self.command = command or self.default_co... | A test runner which runs a test file using `command`.
| 6259901b287bf620b62729c2 |
class RegistryRealbasic(unittest.TestCase): <NEW_LINE> <INDENT> def test_registry_has_zero_len_after_reset(self,): <NEW_LINE> <INDENT> registry.reset() <NEW_LINE> self.assertEqual(registry.size(),0) <NEW_LINE> <DEDENT> def test_registry_hasnt_get_an_added_job_after_reset(self,): <NEW_LINE> <INDENT> registry.add_target(... | Test the basic reset and len functions
this testcase test the functions used to
ensure the main tests are truley independent.
If these fail the RegistryTests TestCase is unreliable | 6259901b507cdc57c63a5b7d |
class Status(RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> n_orders = list(self.db.view("order", "status", reduce=True))[0].value <NEW_LINE> <DEDENT> except IndexError: <NEW_LINE> <INDENT> n_orders = 0 <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> n_forms = list(self.db... | Return JSON for the current status and some counts for the database. | 6259901bd164cc6175821d59 |
class Provider: <NEW_LINE> <INDENT> def __init__(self, provider_id, cloud_prop): <NEW_LINE> <INDENT> self.provider_id = provider_id <NEW_LINE> self._provider_key = self.get_provider_key(cloud_prop) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if not other or not isinstance(other, Provider): <NEW_LIN... | Abstract base-class for cloud-specific cloud provider logic | 6259901b91af0d3eaad3abfe |
class ReservedWordError(SexpError): <NEW_LINE> <INDENT> pass | Identifier is a reserved word.
ReservedWordError('None', sexp, idx) | 6259901bd18da76e235b783b |
class UserErrorHandler: <NEW_LINE> <INDENT> type = 'error' <NEW_LINE> def __init__(self, name, error): <NEW_LINE> <INDENT> self.name = self.longname = name <NEW_LINE> self.doc = self.shortdoc = '' <NEW_LINE> self._error = error <NEW_LINE> self.timeout = '' <NEW_LINE> <DEDENT> def init_keyword(self, varz): <NEW_LINE> <I... | Created if creating handlers fail -- running raises DataError.
The idea is not to raise DataError at processing time and prevent all
tests in affected test case file from executing. Instead UserErrorHandler
is created and if it is ever run DataError is raised then. | 6259901b56b00c62f0fb369a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.