code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@python_2_unicode_compatible <NEW_LINE> class link_attribute_type(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> parent = models.ForeignKey('self', related_name='children', null=True) <NEW_LINE> root = models.ForeignKey('self', null=True) <NEW_LINE> child_order = models.IntegerFie... | Not all parameters are listed here, only those that present some interest
in their Django implementation.
:param gid: this is interesting because it cannot be NULL but a default is
not defined in SQL. The default `uuid.uuid4` in Django will generate a
UUID during the creation of an instance. | 62598f9e6aa9bd52df0d4cca |
class writeabledict(dict): <NEW_LINE> <INDENT> pass | dict with all (especially write) methods allowed by security | 62598f9e3d592f4c4edbaccb |
class DiceLoss(keras.losses.Loss): <NEW_LINE> <INDENT> def __init__(self, eps=1e-8,log_cosh=False, **kwargs): <NEW_LINE> <INDENT> self.eps = eps <NEW_LINE> self.log_cosh = log_cosh <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def call(self, y_true, y_pred): <NEW_LINE> <INDENT> num_classes = tf.shape(y_pred... | Dice loss for segmentation task
| 62598f9e76e4537e8c3ef3b4 |
class GitImportRequest(Model): <NEW_LINE> <INDENT> _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitImportStatusDetail'}, 'import_request_id': {'key': 'importRequestId', 'type': 'int'}, 'parameters': {'key': 'parameters', 'type': 'GitImpo... | GitImportRequest.
:param _links: Links to related resources.
:type _links: :class:`ReferenceLinks <git.v4_1.models.ReferenceLinks>`
:param detailed_status: Detailed status of the import, including the current step and an error message, if applicable.
:type detailed_status: :class:`GitImportStatusDetail <git.v4_1.model... | 62598f9e63d6d428bbee25af |
class TemplatesSourceFiles: <NEW_LINE> <INDENT> def __init__(self, templates_directory): <NEW_LINE> <INDENT> self.templates_directory = templates_directory <NEW_LINE> <DEDENT> @property <NEW_LINE> def imports_(self): <NEW_LINE> <INDENT> return self.templates_directory + 'client/imports.txt' <NEW_LINE> <DEDENT> @propert... | Source files of needed templates handler. | 62598f9e656771135c489481 |
class MySensorsIRSwitch(MySensorsSwitch): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self._ir_code = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> set_req = self.gateway.const.SetReq <NEW_LINE> return self._values.get(set_re... | IR switch child class to MySensorsSwitch. | 62598f9ea8ecb0332587100b |
class ClickHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, level=logging.NOTSET, err=True): <NEW_LINE> <INDENT> super(ClickHandler, self).__init__(level=level) <NEW_LINE> self.err = err <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> msg = self.format(record) <N... | Logging handler that prints colorful messages with click.echo. | 62598f9efbf16365ca793eb7 |
class ThrowerAnt(Ant): <NEW_LINE> <INDENT> name = 'Thrower' <NEW_LINE> implemented = True <NEW_LINE> damage = 1 <NEW_LINE> food_cost = 3 <NEW_LINE> min_range = 0 <NEW_LINE> max_range = 1000000 <NEW_LINE> def nearest_bee(self, hive): <NEW_LINE> <INDENT> checking_place = self.place <NEW_LINE> location = 0 <NEW_LINE> whil... | ThrowerAnt throws a leaf each turn at the nearest Bee in its range. | 62598f9ee76e3b2f99fd8835 |
class TempHumidBaro(SensorPacket): <NEW_LINE> <INDENT> TYPES = {0x01: 'BTHR918', 0x02: 'BTHR918N, BTHR968'} <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return ("TempHumidBaro [subtype={0}, seqnbr={1}, id={2}, temp={3}, " + "humidity={4}, humidity_status={5}, baro={6}, forecast={7}, " + "battery={8}, rssi={9}]") ... | Data class for the TempHumidBaro packet type | 62598f9ee5267d203ee6b70b |
class DiscoverYandexTransport(SensorEntity): <NEW_LINE> <INDENT> def __init__(self, requester: YandexMapsRequester, stop_id, routes, name): <NEW_LINE> <INDENT> self.requester = requester <NEW_LINE> self._stop_id = stop_id <NEW_LINE> self._routes = routes <NEW_LINE> self._state = None <NEW_LINE> self._name = name <NEW_L... | Implementation of yandex_transport sensor. | 62598f9ed7e4931a7ef3be96 |
class MotorMixDriver: <NEW_LINE> <INDENT> def __init__(self, strips): <NEW_LINE> <INDENT> self.__strips = strips <NEW_LINE> self.__currStripIndex = 0 <NEW_LINE> <DEDENT> def getStrip(self, i): <NEW_LINE> <INDENT> return self.__strips[i] <NEW_LINE> <DEDENT> def ctrlIn(self, ctrl, val): <NEW_LINE> <INDENT> if ctrl == IN_... | MIDI receiver wrapped around an array of strip receivers.
We currently ignore events for the mini-buttons (blocks
8 to 11 inclusive).
>>> sr = StripDriver(None, 3)
>>> def press(idx, how): print "[press %d -> %d]" % (idx, how)
>>> sr.doPress = press
>>> strips = [StripDriver(None, i) for i in range(8)]
>>> strips[3] =... | 62598f9e45492302aabfc2d4 |
class IMDBTitleBasics(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'imdb_title_basics' <NEW_LINE> tconst = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> titleType = db.Column(db.String, default='Movie') <NEW_LINE> primaryTitle = db.Column(db.String, nullable=False) <NEW_LINE> originalTitle = ... | Contains the imdb titles information | 62598f9e8c0ade5d55dc358e |
class HelloWorldBlock(XBlock): <NEW_LINE> <INDENT> def fallback_view(self, _view_name, context): <NEW_LINE> <INDENT> return Fragment(u"Hello, world!") | A simple block: just show some fixed content. | 62598f9e7cff6e4e811b5821 |
class AuthorAdmin(MonitorAdmin): <NEW_LINE> <INDENT> list_display = ('__unicode__',) | Monitored model. So the admin inherited from MonitorAdmin. | 62598f9e796e427e5384e591 |
class BTModel(model.Model): <NEW_LINE> <INDENT> def __init__(self, beta=0., rd=0., H=1., U=0., **kwargs): <NEW_LINE> <INDENT> self.beta = beta <NEW_LINE> self.rd = rd <NEW_LINE> self.H = H <NEW_LINE> self.Hi = np.array(H)[np.newaxis,...] <NEW_LINE> self.U = U <NEW_LINE> self.nz = 1 <NEW_LINE> if rd: <NEW_LINE> <INDENT... | Single-layer (barotropic) quasigeostrophic model.
This class can represent both pure two-dimensional flow
and also single reduced-gravity layers with deformation
radius ``rd``.
The equivalent-barotropic quasigeostrophic evolution equations is
.. math::
\partial_t q + J(\psi, q ) + \beta \psi_x = \text{ssd}
The p... | 62598f9ef7d966606f747de5 |
class ParticipantAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('name', 'email', 'affiliation') <NEW_LINE> search_fields = ('name', 'affiliation') | Administration interface for participants. | 62598f9e8e7ae83300ee8e9e |
class Script: <NEW_LINE> <INDENT> def __init__(self, flavor): <NEW_LINE> <INDENT> self.events = {} <NEW_LINE> self.integers = [] <NEW_LINE> self.strings = [] <NEW_LINE> self.variables = [] <NEW_LINE> self.targets = [] <NEW_LINE> self.builtins = [] <NEW_LINE> self.flavor = flavor <NEW_LINE> self.code = [] <NEW_LINE> <DE... | A sequence of instructions and associated data.
| 62598f9e91f36d47f2230d9f |
class rgb24: <NEW_LINE> <INDENT> def __init__(self, r=[0, 0, 0], g=None, b=None): <NEW_LINE> <INDENT> if(isinstance(r, list) and g is None and b is None): <NEW_LINE> <INDENT> self.value = r <NEW_LINE> <DEDENT> elif(isinstance(r, (int,long)) and isinstance(g, (int,long)) and isinstance(b, (int,long))): <NEW_LINE> <INDEN... | 24bit pixel color value class for LEDMatrix. | 62598f9ed7e4931a7ef3be97 |
class PybridReport(object): <NEW_LINE> <INDENT> def write(self, output_dir): <NEW_LINE> <INDENT> if hasattr(self, 'write_string'): <NEW_LINE> <INDENT> res_string = self.write_string(output_dir) <NEW_LINE> f = file(os.path.join(output_dir, 'index.html'), 'w') <NEW_LINE> f.write(res_string) <NEW_LINE> f.close() <NEW_LINE... | The base class for pybrid reports.
A PybridReport mainly just outputs itself when write() is called
with an output directory.
If you give it a NAME, AUTHOR, or GROUPS, it will return those
when requested via get_author, get_name, or get_groups.
Lastly, if you implement a write_string() method, PybridReport
will call... | 62598f9e07f4c71912baf249 |
class UDPEmitter(object): <NEW_LINE> <INDENT> def __init__(self, daemon_address=DEFAULT_DAEMON_ADDRESS): <NEW_LINE> <INDENT> self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> self._socket.setblocking(0) <NEW_LINE> self.set_daemon_address(daemon_address) <NEW_LINE> <DEDENT> def send_entity(self,... | The default emitter the X-Ray recorder uses to send segments/subsegments
to the X-Ray daemon over UDP using a non-blocking socket. If there is an
exception on the actual data transfer between the socket and the daemon,
it logs the exception and continue. | 62598f9e460517430c431f5a |
class MetadataViewer(Gramplet): <NEW_LINE> <INDENT> def init(self): <NEW_LINE> <INDENT> self.gui.WIDGET = self.build_gui() <NEW_LINE> self.gui.get_container_widget().remove(self.gui.textview) <NEW_LINE> self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET) <NEW_LINE> self.gui.WIDGET.show() <NEW_LINE> self.... | Displays the exif tags of an image. | 62598f9e7b25080760ed72a6 |
@pytest.mark.parametrize("algo", [EmbedGreedy, EmbedBalanced, EmbedILP, EmbedPartition]) <NEW_LINE> class TestGroupInterfaces(object): <NEW_LINE> <INDENT> def test_unfesible(self, algo, virtual_nw): <NEW_LINE> <INDENT> physical_topo = PhysicalNetwork.create_test_nw( cores=4, memory=4000, rate=10000, group_interfaces=Fa... | Test the group interface option for a physical node. | 62598f9e8a43f66fc4bf1f7a |
class ReadWriteLock(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._lock = RLock() <NEW_LINE> self._can_read = Semaphore(0) <NEW_LINE> self._can_write = Semaphore(0) <NEW_LINE> self._active_readers = 0 <NEW_LINE> self._active_writers = 0 <NEW_LINE> self._waiting_readers = 0 <NEW_LINE> self.... | Reader-writer lock with preference to writers. | 62598f9e498bea3a75a57920 |
class DbPackage(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'package' <NEW_LINE> id = db.Column(db.String, primary_key=True) <NEW_LINE> name = db.Column(db.String(120)) <NEW_LINE> stime = db.Column(db.DateTime) <NEW_LINE> duration = db.Column(db.Time) <NEW_LINE> success = db.Column(db.Boolean) <NEW_LINE> version = d... | A deployed instance of a package | 62598f9ec432627299fa2dd7 |
class BackupImage(object): <NEW_LINE> <INDENT> def __init__(self, backup_url): <NEW_LINE> <INDENT> self.url = urlparse.urlparse(backup_url) <NEW_LINE> <DEDENT> def backup_server(self, server, database): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def restore_server(self, server): <NEW_LINE> <INDENT> pass | A backup image.
| 62598f9e60cbc95b0636414b |
class AristotleCompanion(SpecialCompanion): <NEW_LINE> <INDENT> NAME = 'aristotle' <NEW_LINE> def __init__(self, max_charge=6, dot_count=4): <NEW_LINE> <INDENT> super().__init__(ButterflyDot, max_charge, dot_count=dot_count) <NEW_LINE> <DEDENT> def activate(self, game): <NEW_LINE> <INDENT> game.place_random_dots(self._... | Captain America doesn't have a laser gun, but he could give you some Beam Dots | 62598f9ecb5e8a47e493c074 |
class _Completion(base.Completion, collections.namedtuple('_Completion', ( 'terminal_metadata', 'code', 'message', ))): <NEW_LINE> <INDENT> pass | A trivial implementation of base.Completion. | 62598f9e7d847024c075c1d1 |
class BinaryOperatorExpr(Expr): <NEW_LINE> <INDENT> def __init__(self, op, left, right): <NEW_LINE> <INDENT> self.op = op <NEW_LINE> self.left = left <NEW_LINE> self.right = right <NEW_LINE> <DEDENT> def evaluate(self, node, pos, size, context): <NEW_LINE> <INDENT> return self.operate(self.left.evaluate(node, pos, size... | Base class for all binary operators. | 62598f9e44b2445a339b686d |
class TextTranslateBatchResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Source = None <NEW_LINE> self.Target = None <NEW_LINE> self.TargetTextList = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Source = param... | TextTranslateBatch返回参数结构体
| 62598f9ea8ecb0332587100d |
class Scorer: <NEW_LINE> <INDENT> def score_prefix(self, prefix): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def final_prefix_score(self, prefix): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def is_valid_prefix(self, value): <NEW_LINE> <INDENT> pass | Base class for a external scorer.
This can be used to integrate for example a language model. | 62598f9e99cbb53fe6830cd2 |
class ExportDeviceEnvironment(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ExportDeviceEnvironment, self).__init__() <NEW_LINE> self.name = "export-device-env" <NEW_LINE> self.summary = "Exports environment variables action" <NEW_LINE> self.description = "Exports environment variables to t... | Exports environment variables found in common data on to the device. | 62598f9e0a50d4780f7051da |
class Tank(object): <NEW_LINE> <INDENT> def __init__(self, num_frogs, zpool_init, growth_params): <NEW_LINE> <INDENT> self.num_frogs = num_frogs <NEW_LINE> self.frogs = [Frog(0, growth_params) for i in range(num_frogs)] <NEW_LINE> self.zpool = zpool_init <NEW_LINE> self.growth_params = growth_params <NEW_LINE> <DEDENT>... | A tank holds some number of frogs | 62598f9e4e4d562566372224 |
class _Adder(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.__class__.__name__ <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def can_add(self, op1, op2): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def _add(self, op1,... | Abstract base class to add two operators.
Each `Adder` acts independently, adding everything it can, paying no attention
as to whether another `Adder` could have done the addition more efficiently. | 62598f9efff4ab517ebcd5ee |
class ApplicationBundlePackager(object): <NEW_LINE> <INDENT> def __init__(self, package): <NEW_LINE> <INDENT> self.package = package <NEW_LINE> <DEDENT> def create_bundle(self, tmp=None): <NEW_LINE> <INDENT> tmp = tmp or tempfile.mkdtemp() <NEW_LINE> contents = os.path.join(tmp, 'Contents') <NEW_LINE> macos = os.path.j... | Creates a package with the basic structure of an Application bundle. | 62598f9e91f36d47f2230da0 |
class TestDiaryCreateView(LoggedInTestCase): <NEW_LINE> <INDENT> def test_create_diary_success(self): <NEW_LINE> <INDENT> params = {'title':'テストタイトル', 'content':'本文', 'photo1':'', 'photo2': '', 'photo3': '', } <NEW_LINE> response = self.client.post(reverse_lazy('diary:diary_create'), params) <NEW_LINE> self.assertRedir... | DiaryCreateView用のテストクラス | 62598f9ed7e4931a7ef3be99 |
class PolyScaler(DarkScaler): <NEW_LINE> <INDENT> def __init__(self, data_in, data_out, rank=2): <NEW_LINE> <INDENT> super(PolyScaler, self).__init__(data_in, data_out) <NEW_LINE> self.rank = rank <NEW_LINE> self.name = 'Poly'+str(self.rank) <NEW_LINE> <DEDENT> @property <NEW_LINE> def rank(self): <NEW_LINE> <INDENT> r... | Manage polynomial fits. Default rank is 2. | 62598f9e66656f66f7d5a1f1 |
class Rectangle(Base): <NEW_LINE> <INDENT> def __init__(self, width, height, x=0, y=0, id=None): <NEW_LINE> <INDENT> super().__init__(id) <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT... | class rectangle that inherites from base | 62598f9e56b00c62f0fb26b0 |
class FilterCondition(ComplexObject): <NEW_LINE> <INDENT> ALL_ATTRIBS = {'field', 'condition', 'value'} <NEW_LINE> REQUIRED_ATTRIBS = {'field', 'value', 'condition'} <NEW_LINE> OPTIONAL_ATTRIBS = set() <NEW_LINE> TYPES = {'field': str, 'value': List(str), 'condition': enums.Condition} | FCO REST API FilterCondition complex object.
Name.
Attributes (type name (required): description:
str field (T):
The field the filter condition must match
List(str) value (T):
The value or values the filter condition must match
enums.Condition condition (T):
The filter condition (d... | 62598f9e435de62698e9bbf4 |
class LeftShift(_ShiftOperator): <NEW_LINE> <INDENT> mapper_method = intern("map_left_shift") | .. attribute:: shiftee
.. attribute:: shift | 62598f9e24f1403a926857b2 |
class NotebookAlreadyExistsError(CloudCacheError): <NEW_LINE> <INDENT> pass | Raised when attempting to create a Notebook for a specific user, and a Notebook with that
name already exists for that user. | 62598f9ea79ad16197769e65 |
class StorageHeader: <NEW_LINE> <INDENT> DATA_LENGTH = 16 <NEW_LINE> DLT_PATTERN = b"\x44\x4C\x54\x01" <NEW_LINE> STRUCT_FORMAT = "<Ii4s" <NEW_LINE> def __init__(self, seconds: int, microseconds: int, ecu_id: str) -> None: <NEW_LINE> <INDENT> self.seconds = seconds <NEW_LINE> self.microseconds = microseconds <NEW_LINE>... | The Storage Header of a DLT Message. | 62598f9e57b8e32f5250801c |
class UserNameDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.ok_pressed = False <NEW_LINE> self.setWindowTitle('Привет!') <NEW_LINE> self.setFixedSize(300, 120) <NEW_LINE> self.label = QLabel('Введите имя пользователя:', self) <NEW_LINE> self.label.move(1... | Класс - интерфейс входа пользователя в систему | 62598f9e3c8af77a43b67e3f |
class DescribeEdgeUnitCloudRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.EdgeUnitId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.EdgeUnitId = params.get("EdgeUnitId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value ... | DescribeEdgeUnitCloud请求参数结构体
| 62598f9e60cbc95b0636414d |
class CrawlTimeoutError(CrawlError): <NEW_LINE> <INDENT> pass | Indicates some error during crawling. | 62598f9e32920d7e50bc5e56 |
class FunctionIterator(Iterator): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> for x in CodebaseIterator(verbose=self.verbose): <NEW_LINE> <INDENT> if isinstance(x, types.FunctionType): <NEW_LINE> <INDENT> yield x <NEW_LINE> <DEDENT> <DEDENT> raise StopIteration | Iterates over music21's packagesystem, yielding all functions discovered:
::
>>> from music21 import documentation
>>> iterator = documentation.FunctionIterator(verbose=False)
>>> functions = [x for x in iterator]
>>> for function in sorted(functions,
... key=lambda x: (x.__module__, x.__name_... | 62598f9eeab8aa0e5d30bb86 |
class TestOrganizationApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.api.organization_api.OrganizationApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_org_repo(self): <NEW_LINE> <INDENT> pass <NEW_LINE>... | OrganizationApi unit test stubs | 62598f9e30bbd72246469877 |
class ShufflingBatchIteratorMixin(object): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> self.X, self.y = shuffle(self.X, self.y) <NEW_LINE> for res in super(ShufflingBatchIteratorMixin, self).__iter__(): <NEW_LINE> <INDENT> yield res | Mixin for shuffling data after each epoch | 62598f9e0c0af96317c56182 |
class Jongsung: <NEW_LINE> <INDENT> _START_HANGLE = START_HANGLE <NEW_LINE> _J_IDX = J_INDEX <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise JongsungInstantiationException <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_hangle(string: str) -> bool: <NEW_LINE> <INDENT> last_char = string[-1] <NEW_LINE> if r... | 글자가 한글인지 체크 및 종성이 있는지 체크하는 클래스 | 62598f9ed58c6744b42dc1d3 |
class urlbar(SortFind): <NEW_LINE> <INDENT> def __init__(self,sortedurlph): <NEW_LINE> <INDENT> f=open(sortedurlph) <NEW_LINE> c=f.readlines() <NEW_LINE> f.close() <NEW_LINE> self.urlbar=[] <NEW_LINE> for l in c: <NEW_LINE> <INDENT> self.urlbar.append(hash(l.split()[1])) <NEW_LINE> <DEDENT> SortFind.__init__(self,self.... | url库查询 | 62598f9e009cb60464d01326 |
class DisjunctionMaxMatcher(UnionMatcher): <NEW_LINE> <INDENT> def __init__(self, a, b, tiebreak=0.0): <NEW_LINE> <INDENT> super(DisjunctionMaxMatcher, self).__init__(a, b) <NEW_LINE> self.tiebreak = tiebreak <NEW_LINE> <DEDENT> def copy(self): <NEW_LINE> <INDENT> return self.__class__(self.a.copy(), self.b.copy(), tie... | Matches the union (OR) of two sub-matchers. Where both sub-matchers
match the same posting, returns the weight/score of the higher-scoring
posting. | 62598f9e3539df3088ecc0b7 |
class ValidationError(object): <NEW_LINE> <INDENT> openapi_types = { 'loc': 'list[str]', 'msg': 'str', 'type': 'str' } <NEW_LINE> attribute_map = { 'loc': 'loc', 'msg': 'msg', 'type': 'type' } <NEW_LINE> def __init__(self, loc=None, msg=None, type=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f9ed53ae8145f918290 |
class DeletePost(BlogHandler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> if not self.user: <NEW_LINE> <INDENT> return self.redirect('/login') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> key = db.Key.from_path('Post', int(post_id), parent=blog_key()) <NEW_LINE> post = db.get(key) <NEW_LINE> autho... | user can delete a post. | 62598f9ea8ecb0332587100f |
class PushParam(tuple): <NEW_LINE> <INDENT> def __new__(cls, src): <NEW_LINE> <INDENT> return tuple.__new__(cls, (src,)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(src=%r)" % (type(self).__name__, self.src) <NEW_LINE> <DEDENT> src = property(lambda self: self[0]) | An operation that pushes the source onto the parameter stack for a future
function call | 62598f9ea17c0f6771d5c03c |
class Filer(models.Model): <NEW_LINE> <INDENT> filer_id = models.CharField(max_length=20, null=False) <NEW_LINE> name = models.TextField() | Not from Voter Information Project. A filer in the state of
California. | 62598f9e91f36d47f2230da1 |
class PyICONINFO(object): <NEW_LINE> <INDENT> def __new__(cls): <NEW_LINE> <INDENT> raise Exception('This class just for typing, can not be instanced!') | Tuple describing an icon or cursor | 62598f9e851cf427c66b80ca |
class HashtagSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Hashtag <NEW_LINE> fields = ('name',) | Serializing all the Hashtags | 62598f9ee64d504609df92b9 |
class ToggleBreakpoint (gdb.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ToggleBreakpoint, self).__init__("toggle-break", gdb.COMMAND_USER) <NEW_LINE> <DEDENT> def invoke(self, args, from_tty): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> sal = gdb.selected_frame().find_sal() <NEW_LINE> f... | Toggle breakpoint | 62598f9e460517430c431f5c |
class LogBodyWeightInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessTokenSecret(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccessTokenSecret', value) <NEW_LINE> <DEDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccessToken', value) <NEW_LINE> <DEDENT> def s... | An InputSet with methods appropriate for specifying the inputs to the LogBodyWeight
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f9ee5267d203ee6b710 |
class DocumentReference(Base): <NEW_LINE> <INDENT> __tablename__ = 'document_reference' <NEW_LINE> __table_args__ = {'schema': 'motorways_building_lines'} <NEW_LINE> id = sa.Column(sa.String, primary_key=True, autoincrement=False) <NEW_LINE> document_id = sa.Column( sa.String, sa.ForeignKey(Document.id), nullable=False... | Meta bucket (join table) for the relationship between documents.
Attributes:
id (int): The identifier. This is used in the database only and must not be set manually. If
you don't like it - don't care about.
document_id (int): The foreign key to the document which references to another document.
r... | 62598f9e7d43ff2487427303 |
class CircularLinkedlist(Linked): <NEW_LINE> <INDENT> def __init__(self, root=None): <NEW_LINE> <INDENT> super().__init__(root) <NEW_LINE> <DEDENT> def add(self, item): <NEW_LINE> <INDENT> if self.size == 0: <NEW_LINE> <INDENT> self.root = Node(item) <NEW_LINE> self.root.next_node = self.root <NEW_LINE> <DEDENT> else: ... | A variant of linked list, where the first element points to the last element and the last element points to the first element. | 62598f9e097d151d1a2c0e2a |
class Order2StringTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_order2string(self): <NEW_LINE> <INDENT> self.assertEquals("1st", util.order2string(1)) <NEW_LINE> self.assertEquals("2nd", util.order2string(2)) <NEW_LINE> self.assertEquals("3rd", util.order2string(3)) <NEW_LINE> self.assertEquals("4th", util.orde... | Test class for order2string | 62598f9e4f6381625f1993bd |
@cbook.deprecated("3.0") <NEW_LINE> class TempCache(object): <NEW_LINE> <INDENT> invalidating_rcparams = ( 'font.serif', 'font.sans-serif', 'font.cursive', 'font.fantasy', 'font.monospace') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._lookup_cache = {} <NEW_LINE> self._last_rcParams = self.make_rcparams_key... | A class to store temporary caches that are (a) not saved to disk
and (b) invalidated whenever certain font-related
rcParams---namely the family lookup lists---are changed or the
font cache is reloaded. This avoids the expensive linear search
through all fonts every time a font is looked up. | 62598f9e8e71fb1e983bb8b9 |
class RequestsWebClient(AbstractWebClient): <NEW_LINE> <INDENT> __USER_AGENT = 'ultimate_sitemap_parser/{}'.format(__version__) <NEW_LINE> __HTTP_REQUEST_TIMEOUT = 60 <NEW_LINE> __slots__ = [ '__max_response_data_length', '__timeout', '__proxies', ] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.__max_response... | requests-based web client to be used by the sitemap fetcher. | 62598f9ecb5e8a47e493c076 |
class Product: <NEW_LINE> <INDENT> pass | A Base Model Representation of Product Entity. | 62598f9e442bda511e95c25e |
@dataclass(frozen=True) <NEW_LINE> class Route: <NEW_LINE> <INDENT> filt: Optional[Filter] = None <NEW_LINE> def get_dests( self, data_set: Dataset ) -> Optional[Tuple[DataBucket[Any, Any], ...]]: <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_filtered(self, data_set: Dataset) -> Optional[Dat... | Abstract base class for all Routes
The main functionality of routes is to map datasets to destinations.
Routes can have a filter associated with them, which take a dataset as
input and return one as output. The dataset can be modified and None can be
returned to reject the dataset. | 62598f9f097d151d1a2c0e2b |
class search: <NEW_LINE> <INDENT> def __init__(self, number): <NEW_LINE> <INDENT> URL = 'https://search5.truecaller.com/v2/search?' <NEW_LINE> raw_params = { 'q': number, 'countryCode': 'IN', 'type': '4', 'locAddr': '', 'placement': 'SEARCHRESULTS,HISTORY,DETAILS', 'clientId': '1', 'myNumber': 'lS5757de85c2804a87d452c1... | Return a new search instance given a phone number.
| 62598f9f32920d7e50bc5e59 |
class Equipable(Base): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Base.__init__(self, possible_slots=list, wearer=object, in_slot=str) <NEW_LINE> <DEDENT> @property <NEW_LINE> def saveable_fields(self): <NEW_LINE> <INDENT> fields = self.fields.keys() <NEW_LINE> fields.remove("wearer") <NEW_LINE> return... | Component that stores the data for an entity that can be equipped. | 62598f9ff8510a7c17d7e079 |
class InteractiveGraphicsDevice(GraphicsDevice): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> plt.show(block=False) <NEW_LINE> plt.pause(.001) <NEW_LINE> <DEDENT> def draw_current_axes(self): <NEW_LINE> <INDENT> plt.pause(.001) | A private stack manages the set of active graphics devices. | 62598f9ee1aae11d1e7ce726 |
class NoSuchJobStoreException(Exception): <NEW_LINE> <INDENT> def __init__(self, locator): <NEW_LINE> <INDENT> super().__init__("The job store '%s' does not exist, so there is nothing to restart." % locator) | Indicates that the specified job store does not exist. | 62598f9f3539df3088ecc0b8 |
class CompositeSequenceAccess(CompositeAccess): <NEW_LINE> <INDENT> def __init__(self, segment, compositeQualifier=None, x12type=None): <NEW_LINE> <INDENT> self.segment = segment <NEW_LINE> if isinstance(compositeQualifier, (list, tuple)): <NEW_LINE> <INDENT> self.qualifier = compositeQualifier <NEW_LINE> <DEDENT> else... | Map a user-friendly attribute name to a sequence of Composites
that occur somewhere in the occurances of a given Segment type.
This is used for the various "HI" Segments where a sequence of values
is located in a qualified Composites.
Each Composite Element has multiple values, the first of which
is a qualifier for th... | 62598f9fadb09d7d5dc0a38d |
class SetKeyOperator(Operator): <NEW_LINE> <INDENT> name = 'set_key' <NEW_LINE> operator_name = 'set_key' <NEW_LINE> operator_constructors = [(str, str)] <NEW_LINE> def __init__(self, inputs, key, value): <NEW_LINE> <INDENT> outputs = copy.deepcopy(inputs) <NEW_LINE> for o in outputs: <NEW_LINE> <INDENT> o[key] = value... | Sets a key on all output streams
For instance, adding a:
set_key("Metadata/Extra/Name", "Foo")
To the operator pipeline will set the Metadata/Extra/Name tag to
"Foo" on all input streams. | 62598f9f21a7993f00c65d87 |
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = User... | database model for users in the system | 62598f9f8e7ae83300ee8ea3 |
class FacadeQueries(AbsResource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> query_content = request.get_json(force=True) <NEW_LINE> query_id, workflow_id = self.service.query(query_content) <NEW_LINE> result_url = "%s/%s" % (self.generate_host_port_endpoint(endpoint = "/results/<query_id>"), query_id) <NE... | Served by a facade service. It provides the entry point to the system for
search clients | 62598f9fd53ae8145f918292 |
class ForceObject(object): <NEW_LINE> <INDENT> def __init__(self, start, end): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> self.id = None <NEW_LINE> self._components_map = None <NEW_LINE> self.gpu_idx_buf = None <NEW_LINE> self.gpu_force_buf = None <NEW_LINE> self.force_buf = None <NEW_L... | Used to track momentum exchange between the fluid and a solid object.
The exchanged momentum can be used to compute the value of the force
acting on the solid object. See Ladd A. Effects of container walls on the
velocity fluctuations of sedimenting spheres. Phys Rev Lett 2002; 88:048301
for more info about this proce... | 62598f9fe5267d203ee6b711 |
class ReadDeviceInputRegisters(ReadInputRegistersRequest): <NEW_LINE> <INDENT> def __init__(self, unit, address, count): <NEW_LINE> <INDENT> ReadInputRegistersRequest.__init__(self, address, count, unit=unit) | Read device input registers.
| 62598f9f10dbd63aa1c709ba |
class Revert(SetRevertBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._revert_stack = deque() <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._revert_stack.append([]) <NEW_LINE> for key, value in self._parameters: <NEW_LINE> <INDENT> old_value = self._update_value(key, value) <... | A context manager that sets and reverts parameter values.
The manager can handle repeated calls to `__enter__`, with or without
intermediate calls to `__exit__` correctly. | 62598f9fa17c0f6771d5c03e |
class Book(models.Model): <NEW_LINE> <INDENT> zoterokey = models.CharField( verbose_name=ugettext_lazy("Zoterokey"), primary_key=True, max_length=100, blank=True, help_text=ugettext_lazy("Zoterokey des bibliographischen Eintrags aus der Zoterolibrary 'Peter Handke stage texts'")) <NEW_LINE> item_type = models.CharField... | Bibliographische Informationen zu einem publizierten Buch. | 62598f9f3eb6a72ae038a445 |
class data_show: <NEW_LINE> <INDENT> def __init__(self, vals): <NEW_LINE> <INDENT> self.vals = vals.copy() <NEW_LINE> <DEDENT> def modify(self, vals): <NEW_LINE> <INDENT> raise NotImplementedError("this needs to be implemented to use the data_show class") <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> raise N... | The data_show class is a base class which describes how to visualize a
particular data set. For example, motion capture data can be plotted as a
stick figure, or images are shown using imshow. This class enables latent
to data visualizations for the GP-LVM. | 62598f9fbd1bec0571e14fc5 |
class SoQtPlaneViewer(SoQtFullViewer): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def initClass(): <NEW_LINE> <INDENT> return _soqt.SoQtPlaneViewer_initClass() <NEW_LINE> <DEDENT> initClass = sta... | Proxy of C++ SoQtPlaneViewer class | 62598f9f2c8b7c6e89bd35d4 |
class ShuffledSequentialSubsetIterator(SequentialSubsetIterator): <NEW_LINE> <INDENT> stochastic = True <NEW_LINE> fancy = True <NEW_LINE> def __init__(self, dataset_size, batch_size, num_batches, rng=None): <NEW_LINE> <INDENT> super(ShuffledSequentialSubsetIterator, self).__init__( dataset_size, batch_size, num_batche... | .. todo::
WRITEME | 62598f9ff7d966606f747dec |
class LassimContext: <NEW_LINE> <INDENT> def __init__(self, core: CoreSystem, primary_opt: List['OptimizationArgs'], ode_fun: Callable[..., Vector], pert_fun: Callable[..., float], solution_class: Type[BaseSolution], secondary_opt: List['OptimizationArgs'] = None): <NEW_LINE> <INDENT> self.__core_system = core <NEW_LIN... | Represents the context of the current optimization. Should allow dependency
injection of common parameters, like the class that represents the
solutions, the ode function to use, .. | 62598f9f67a9b606de545dce |
class Grade: <NEW_LINE> <INDENT> def __init__(self, disciplineID, studentID, gradeValue): <NEW_LINE> <INDENT> self.__disciplineID = disciplineID <NEW_LINE> self.__studentID = studentID <NEW_LINE> self.__gradeValue = gradeValue <NEW_LINE> <DEDENT> def getDisciplineID(self): <NEW_LINE> <INDENT> return self.__disciplineID... | We declare a class of grades where we have the discipline ID,
student ID and the value of the grade | 62598f9fdd821e528d6d8d38 |
class ModelContainerTestCase(BaseTest): <NEW_LINE> <INDENT> def test_valid_model(self): <NEW_LINE> <INDENT> model_cls = ModelContainer(APP_LABEL, TestModel2._meta.db_table).model_cls <NEW_LINE> self.assertTrue(model_cls.__class__.__name__ is models.Model.__class__.__name__) <NEW_LINE> <DEDENT> def test_access_denied_mo... | ModelContainer class tests | 62598f9f99cbb53fe6830cd7 |
class UserUpdateForm(forms.ModelForm): <NEW_LINE> <INDENT> email = forms.EmailField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['username', 'email'] | will update the user model | 62598f9f7047854f4633f1e7 |
class ParentAccessSchema(Schema): <NEW_LINE> <INDENT> grants = fields.List(fields.Nested(Grant)) <NEW_LINE> owned_by = fields.List(fields.Nested(Agent)) <NEW_LINE> links = fields.List(fields.Nested(SecretLink)) | Access schema. | 62598f9f460517430c431f5d |
class FourSiteWaterBox(WaterBox): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(FourSiteWaterBox, self).__init__(model='tip4pew', *args, **kwargs) | Four-site water box (TIP4P-Ew). | 62598f9f9b70327d1c57eba3 |
class CameraError(RuntimeError): <NEW_LINE> <INDENT> pass | Base class of the camera-related error conditions. | 62598f9f32920d7e50bc5e5b |
class TestCreateNamedRequest(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 testCreateNamedRequest(self): <NEW_LINE> <INDENT> pass | CreateNamedRequest unit test stubs | 62598f9fac7a0e7691f72310 |
class CFM_650: <NEW_LINE> <INDENT> play = Buff(FRIENDLY_HAND + MURLOC, "CFM_650e") | Grimscale Chum | 62598f9f76e4537e8c3ef3bc |
class AbstractSCE: <NEW_LINE> <INDENT> def __init__(self, model, target_class): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.model.eval() <NEW_LINE> self.target_class = target_class <NEW_LINE> <DEDENT> def mask_norm(self, masks): <NEW_LINE> <INDENT> return torch.norm(masks, p=1) / masks.shape[0] <NEW_LINE> <D... | SCE = Sequence of Counterfactuals Explainer.
This is an abstract class, which implements framework proposed
by the thesis TODO[insert name here]. | 62598f9fd58c6744b42dc1d5 |
class Cutout(object): <NEW_LINE> <INDENT> def __init__(self, n_holes, length): <NEW_LINE> <INDENT> self.n_holes = n_holes <NEW_LINE> self.length = length <NEW_LINE> <DEDENT> def __call__(self, img): <NEW_LINE> <INDENT> h = img.size(1) <NEW_LINE> w = img.size(2) <NEW_LINE> mask = np.ones((h, w), np.float32) <NEW_LINE> f... | Randomly mask out one or more patches from an image.
Args:
n_holes (int): Number of patches to cut out of each image.
length (int): The length (in pixels) of each square patch. | 62598f9f63d6d428bbee25b7 |
class UrlManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.check_log_file() <NEW_LINE> self.load_progress() <NEW_LINE> <DEDENT> def check_log_file(self): <NEW_LINE> <INDENT> for logfile in ['./log/failed.log', './log/tocrawl.log', './log/crawled.log']: <NEW_LINE> <INDENT> if not os.path.... | manage the urls | 62598f9fcc0a2c111447ae12 |
class InterpreterWithCustomOps(Interpreter): <NEW_LINE> <INDENT> def __init__(self, custom_op_registerers=None, **kwargs): <NEW_LINE> <INDENT> self._custom_op_registerers = custom_op_registerers or [] <NEW_LINE> super(InterpreterWithCustomOps, self).__init__(**kwargs) | Interpreter interface for TensorFlow Lite Models that accepts custom ops.
The interface provided by this class is experimental and therefore not exposed
as part of the public API.
Wraps the tf.lite.Interpreter class and adds the ability to load custom ops
by providing the names of functions that take a pointer to a B... | 62598f9f656771135c489489 |
class IJLogHandler(logging.StreamHandler): <NEW_LINE> <INDENT> def emit(self, record): <NEW_LINE> <INDENT> IJ.log(self.format(record)) | A logging handler sending everything to IJ.log(). | 62598f9f8e7ae83300ee8ea5 |
class ColorizedTextReporter(TextReporter): <NEW_LINE> <INDENT> COLOR_MAPPING = { "I" : ("green", None), 'C' : (None, "bold"), 'R' : ("magenta", "bold, italic"), 'W' : ("blue", None), 'E' : ("red", "bold"), 'F' : ("red", "bold, underline"), 'S' : ("yellow", "inverse"), } <NEW_LINE> def __init__(self, output=sys.stdout, ... | Simple TextReporter that colorizes text output | 62598f9f8e71fb1e983bb8bc |
class Newsletters(BaseModel): <NEW_LINE> <INDENT> yearly: List[Newsletter] = Field(default_factory=list) <NEW_LINE> monthly: List[Newsletter] = Field(default_factory=list) <NEW_LINE> weekly: List[Newsletter] = Field(default_factory=list) <NEW_LINE> daily: List[Newsletter] = Field(default_factory=list) <NEW_LINE> def so... | Represents the newsletters for each feed type. | 62598f9fa17c0f6771d5c040 |
class TestConfig(config): <NEW_LINE> <INDENT> ENV = 'test' <NEW_LINE> TESTING = True <NEW_LINE> DEBUG = True | Test configuration | 62598f9f851cf427c66b80ce |
class MessageDispatcher(object): <NEW_LINE> <INDENT> message_to_method = { 0x0001: 'c_store', 0x0020: 'c_find', 0x0010: 'c_get', 0x0021: 'c_move', 0x0030: 'c_echo', 0x0100: 'n_event_report', 0x0110: 'n_get', 0x0120: 'n_set', 0x0130: 'n_action', 0x0140: 'n_create', 0x0150: 'n_delete', } <NEW_LINE> def get_method(self, m... | Base class for message dispatcher service.
Class provides method for selecting method based on incoming message type. | 62598f9f4e4d56256637222a |
class FileLock: <NEW_LINE> <INDENT> def __init__(self, file_path, expire=60 * 60 * 2): <NEW_LINE> <INDENT> self.expire = expire <NEW_LINE> self.fpath = file_path <NEW_LINE> self.fd = None <NEW_LINE> <DEDENT> def lock(self): <NEW_LINE> <INDENT> if os.path.exists(self.fpath): <NEW_LINE> <INDENT> if (time.time() - os.stat... | Lock/Unlock file | 62598f9f92d797404e388a69 |
class OptimizerWithSparsityGuarantee(object): <NEW_LINE> <INDENT> def __init__(self, optimizer): <NEW_LINE> <INDENT> self._optimizer = optimizer <NEW_LINE> self._learning_rate = optimizer._learning_rate <NEW_LINE> self._learning_rate_map = optimizer._learning_rate_map <NEW_LINE> <DEDENT> def minimize(self, loss, startu... | OptimizerWithSparsityGuarantee is a wrapper to decorate `minimize` function of given optimizer by `_minimize` of ASPHelper.
The decorated `minimize` function would do three things (exactly same as `ASPHelper._minimize`):
1. Call `minimize` function of given optimizer.
2. Call `ASPHelper._create_mask_variables` to creat... | 62598f9f2c8b7c6e89bd35d5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.