code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Command: <NEW_LINE> <INDENT> def __init__( self, action, label, shortcut=None, tooltip=None, icon=None, group=None, section=None, order=None, enabled=True, factory=None, ): <NEW_LINE> <INDENT> self.factory = factory <NEW_LINE> self.action = wrapped_handler(self, action) <NEW_LINE> self.label = label <NEW_LINE> se... | Args:
action: a function to invoke when the command is activated.
label: a name for the command.
shortcut: (optional) a key combination that can be used to invoke the
command.
tooltip: (optional) a short description for what the command will do.
icon: (optional) a path to an icon resource to... | 62598f03283ffb24f3cf22e1 |
class RandomWalkRobot(BaseRobot): <NEW_LINE> <INDENT> def updatePositionAndClean(self): <NEW_LINE> <INDENT> if self.speed < 1: <NEW_LINE> <INDENT> possible_path = self.position.getNewPosition(random.randrange(359), self.speed) <NEW_LINE> while not self.room.isPositionInRoom(possible_path): <NEW_LINE> <INDENT> self.setR... | A RandomWalkRobot is a robot with the "random walk" movement
strategy: it chooses a new direction at random after each
time-step. | 62598f039f2886367281722c |
class CANDUCollectionView(RegionView): <NEW_LINE> <INDENT> all_clusters_cb = BootstrapSwitch(id='all_clusters') <NEW_LINE> all_datastores_cb = BootstrapSwitch(id='all_storages') <NEW_LINE> save_button = Button('Save') <NEW_LINE> reset_button = Button('Reset') <NEW_LINE> @property <NEW_LINE> def is_displayed(self): <NEW... | C and U View | 62598f03f548e778e5969fbd |
class CanvasAdmin(ImportExportModelAdmin, admin.ModelAdmin): <NEW_LINE> <INDENT> resource_class = CanvasResource <NEW_LINE> list_display = ( 'id', 'pid', 'height', 'width', 'position', 'is_starting_page', 'manifest', 'label' ) <NEW_LINE> search_fields = ( 'pid', 'is_starting_page', 'manifest__pid', 'manifest__label' ) ... | Django admin settings for Canvas. | 62598f034c34283577618d20 |
class BJ_Game(object): <NEW_LINE> <INDENT> def __init__(self, names): <NEW_LINE> <INDENT> self.players = [] <NEW_LINE> for name in names: <NEW_LINE> <INDENT> player = BJ_Player(name) <NEW_LINE> self.players.append(player) <NEW_LINE> <DEDENT> self.dealer = BJ_Dealer("Dealer") <NEW_LINE> self.deck = BJ_Deck() <NEW_LINE> ... | Игра в блекджек | 62598f030fa83653e46f3919 |
class SmartPlugSwitch(SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, smartplug, name): <NEW_LINE> <INDENT> self.smartplug = smartplug <NEW_LINE> self._name = name <NEW_LINE> self._state = None <NEW_LINE> self._emeter_params = {} <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return ... | Representation of a TPLink Smart Plug switch. | 62598f037047854f4633ddfd |
class RMObject(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if kwargs: <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> <DEDENT> if args: <NEW_LINE> <INDENT> self.define(*args) <NEW_LINE> <DEDENT> <DEDENT> def define(self, args): <NEW_LINE> <INDENT> for attribute in a... | Generates a generic Remote Manager data object | 62598f03ff9c53063f519097 |
class SpatialDropout3D(Dropout): <NEW_LINE> <INDENT> def __init__(self, p, dim_ordering='default', **kwargs): <NEW_LINE> <INDENT> if dim_ordering == 'default': <NEW_LINE> <INDENT> dim_ordering = K.image_dim_ordering() <NEW_LINE> <DEDENT> assert dim_ordering in {'tf', 'th'}, 'dim_ordering must be in {tf, th}' <NEW_LINE>... | This version performs the same function as Dropout, however it drops
entire 3D feature maps instead of individual elements. If adjacent voxels
within feature maps are strongly correlated (as is normally the case in
early convolution layers) then regular dropout will not regularize the
activations and will otherwise jus... | 62598f033617ad0b5ee04b62 |
class homeScreen(screen): <NEW_LINE> <INDENT> def __init__(self,controller): <NEW_LINE> <INDENT> screen.__init__(self,controller,"Open") <NEW_LINE> self.grid_rowconfigure(2,weight=1) <NEW_LINE> self.grid_columnconfigure(0,weight=1) <NEW_LINE> self.topBar=mainFrame(self) <NEW_LINE> self.filterFrame=mainFrame(self) <NEW_... | Screen where user selects
which diary file to open | 62598f034428ac0f6e656f84 |
class NonPicklistError(ApiError): <NEW_LINE> <INDENT> def __init__(self, error, message): <NEW_LINE> <INDENT> super(NonPicklistError, self).__init__(error, message) <NEW_LINE> self.error = error <NEW_LINE> self.message = message <NEW_LINE> self.should_retry = False <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <IN... | You cannot add options to the given column {0} because it is ... | 62598f03099cdd3c636748f2 |
class MeSetCallPage(BasePage): <NEW_LINE> <INDENT> ACTIVITY = 'com.cmicc.module_aboutme.ui.activity.IncomingTelegramSettingActivity' <NEW_LINE> locators = {'': (MobileBy.ID, ''), 'com.chinasofti.rcs:id/action_bar_root': (MobileBy.ID, 'com.chinasofti.rcs:id/action_bar_root'), 'android:id/content': (MobileBy.ID, 'android... | 我-》设置-》来电管理 | 62598f035fcc89381b265646 |
class Collection(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> object.__setattr__(self, '_contained_items', set()) <NEW_LINE> for k, v in kwargs.items(): <NEW_LINE> <INDENT> self.add_property(k, v) <NEW_LINE> <DEDENT> <DEDENT> def __setattr__(self, name, value): <NEW_LINE> <INDENT> if n... | A class to hold arbitrary settings as properties.
To initialize, pass in any desired settings as keyword arguments (you may
use only keyword arguments). To use, simply access the keywords as properties.
WARNING: If you add a property directly, without using the add_property
method, it is your responsibility to ensure... | 62598f0350812a4eaa620107 |
class TestWhitenessCIE2004(unittest.TestCase): <NEW_LINE> <INDENT> def test_whiteness_CIE2004(self): <NEW_LINE> <INDENT> np.testing.assert_almost_equal( whiteness_CIE2004(np.array([0.3139, 0.3311]), 100, np.array([0.3139, 0.3311])), np.array([100., 0.]), decimal=7) <NEW_LINE> np.testing.assert_almost_equal( whiteness_C... | Defines :func:`colour.colorimetry.whiteness.whiteness_CIE2004`
definition unit tests methods. | 62598f03091ae35668703653 |
class QAbstractMeta(QObjectMeta, abc.ABCMeta): <NEW_LINE> <INDENT> pass | Shared meta class of QObject's meta and ABCMeta.
This is workaround of metaclass conflict:
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases | 62598f039f2886367281722f |
class canUseEffects(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.ability = Ability(None) <NEW_LINE> <DEDENT> def properReturnValues(self): <NEW_LINE> <INDENT> can = self.ability.canUseEffects() <NEW_LINE> assert can, "Should be able to use Effects" | Test that canUseEffects returns the correct default values | 62598f0363b5f9789fe83b99 |
class TinyMCE(forms.Textarea): <NEW_LINE> <INDENT> def __init__(self, content_language=None, attrs=None, mce_attrs=None): <NEW_LINE> <INDENT> super(TinyMCE, self).__init__(attrs) <NEW_LINE> if mce_attrs is None: <NEW_LINE> <INDENT> mce_attrs = {} <NEW_LINE> <DEDENT> self.mce_attrs = mce_attrs <NEW_LINE> if content_lang... | TinyMCE widget. Set settings.TINYMCE_JS_URL to set the location of the
javascript file. Default is "MEDIA_URL + 'js/tiny_mce/tiny_mce.js'".
You can customize the configuration with the mce_attrs argument to the
constructor.
In addition to the standard configuration you can set the
'content_language' parameter. It take... | 62598f033617ad0b5ee04b64 |
class Experiment(Base): <NEW_LINE> <INDENT> __tablename__ = "experiments" <NEW_LINE> id = Column(Integer(), primary_key=True) <NEW_LINE> name = Column(Text(), nullable=True, unique=True) <NEW_LINE> added_on = Column(DateTime(timezone=False), default=datetime.now, nullable=False) <NEW_LINE> delta = Column(String(), null... | Experiment regroups a list of tasks together. | 62598f033d592f4c4edb9928 |
class Clustering(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Clustering, self).__init__() <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def execute(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def labels_(self): <NEW_LINE> <INDENT> pass... | docstring for Clustering. | 62598f03099cdd3c636748f3 |
class WithdrawRecord(models.Model): <NEW_LINE> <INDENT> user_id = models.IntegerField('用户ID', db_index=True) <NEW_LINE> amount_of_money = models.CharField('申请提现金额', max_length=16) <NEW_LINE> service_charge = models.CharField('手续费', max_length=16) <NEW_LINE> payment_of_money = models.CharField('实际提现金额', max_length=16) <... | 提现记录 | 62598f034a966d76dd5ed90d |
class UserProfile: <NEW_LINE> <INDENT> def __init__(self, **q): <NEW_LINE> <INDENT> self._defaults = copy.deepcopy(app.cfg.user_defaults) <NEW_LINE> self._meta = {} <NEW_LINE> self._stored = False <NEW_LINE> self._changed = False <NEW_LINE> if q: <NEW_LINE> <INDENT> self.load(**q) <NEW_LINE> <DEDENT> <DEDENT> @property... | A User Profile | 62598f03851cf427c66b6d02 |
class ApafAppWrapper(AppKit.NSObject): <NEW_LINE> <INDENT> reactor = None <NEW_LINE> menuitem = None <NEW_LINE> def setMainFunction_andReactor_(self, callback, reactor): <NEW_LINE> <INDENT> self.reactor = reactor <NEW_LINE> self.callback = callback <NEW_LINE> <DEDENT> def applicationDidFinishLaunching_(self, notificati... | Wrapper around the standard apaf runner;
creates a new icon around the notification centre and controls the apaf. | 62598f03283ffb24f3cf22e5 |
class InfoModelSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> def validate(self, attrs): <NEW_LINE> <INDENT> if "article" in attrs or "article_id" in attrs: <NEW_LINE> <INDENT> request = self.context["request"] <NEW_LINE> if request.method in ["PUT", "PATCH"]: <NEW_LINE> <INDENT> if "article" in attrs: at... | Info Model Serilizer | 62598f039f28863672817230 |
class GetCoordinates: <NEW_LINE> <INDENT> def __init__(self, name, coord_filter): <NEW_LINE> <INDENT> self.message = "" <NEW_LINE> self.filename = name <NEW_LINE> self.filter = coord_filter <NEW_LINE> <DEDENT> def get_input(self, input_file=None): <NEW_LINE> <INDENT> if input_file: <NEW_LINE> <INDENT> self.filename = i... | Class which creates coordinates by user given input | 62598f03cc40096d616196f6 |
class ObjectReferenceDefinition(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'namespace': {'key': 'namespace', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: Optional[str] = None, namespace: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> s... | Object reference to a Kubernetes object on a cluster.
:param name: Name of the object.
:type name: str
:param namespace: Namespace of the object.
:type namespace: str | 62598f03656771135c4880c5 |
class __LayoutChangedContext(object): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.model.layoutAboutToBeChanged.emit() <NEW_LINE> <DEDENT> def __exit__(self, exceptionType, exceptionValue, traceBack): <NEW_LINE> <... | context manager to ensure layout changes if exception is thrown | 62598f03ab23a570cc2d4289 |
class Augury(Spell): <NEW_LINE> <INDENT> name = "Augury" <NEW_LINE> level = 2 <NEW_LINE> casting_time = "1 minute" <NEW_LINE> casting_range = "Self" <NEW_LINE> components = ('V', 'S', 'M') <NEW_LINE> materials = """Specially marked sticks, bones, or similar tokens worth at least 25 gp""" <NEW_LINE> duration = "Instanta... | By casting gem-inlaid sticks, rolling dragon bones, laying out ornate cards, or
employing some other divining tool, you receive an omen from an otherworldly
entity about the results of a specific course of action that you plan to take
within the next 30 minutes. The DM chooses from the following possible omens:
•... | 62598f03956e5f7376df4b99 |
class Person: <NEW_LINE> <INDENT> def __init__(self, name, age, pay = 0, job = None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> self.pay = pay <NEW_LINE> self.job = job <NEW_LINE> <DEDENT> def lastName(self): <NEW_LINE> <INDENT> return self.name.split()[-1] <NEW_LINE> <DEDENT> def giveRa... | a general person: data + logic | 62598f03283ffb24f3cf22e6 |
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = "users" <NEW_LINE> __table_args__ = ( db.UniqueConstraint('id', 'email', name='id_email_unique_components'), ) <NEW_LINE> id = db.Column( db.Integer, primary_key = True, autoincrement = True, ) <NEW_LINE> name = db.Column( db.String(100), nullable = False, ) <NE... | USER MODEL | 62598f03a219f33f346c5269 |
class BaseComponent(object): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> self.name = cfg['name'] <NEW_LINE> <DEDENT> def execute(self, input_data, input_directory, output_directory): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def completed(self, input_data, input_directo... | Base class for all components. Host for common helpers instead
of repeating in each subclass. | 62598f03fff4ab517ebcc20e |
class MeiJu(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._header = FAKE_HEADERS <NEW_LINE> key_id = getGUID() <NEW_LINE> self._header.update(a=key_id) <NEW_LINE> self.get_ticket() <NEW_LINE> <DEDENT> def get_json(self, url, data=None, pretty=False): <NEW_LINE> <INDENT> headers = self.header... | docstring for RenRenMeiJu | 62598f03ec188e330fdf72eb |
class TeleportGraph: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._city_nodes = dict() <NEW_LINE> <DEDENT> @property <NEW_LINE> def city_nodes(self): <NEW_LINE> <INDENT> return self._city_nodes.values() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_tuples(cls, routes): <NEW_LINE> <INDENT> ins... | Represents the graph data structure - contains an index (via a dict) to each node | 62598f03283ffb24f3cf22e7 |
class NeuralTensorLayer(object): <NEW_LINE> <INDENT> def __init__(self, rank=3): <NEW_LINE> <INDENT> super(NeuralTensorLayer, self).__init__() <NEW_LINE> self.rank = rank <NEW_LINE> <DEDENT> def __call__(self, input1, input2, scope=None, input_keep_prob=1.0, wd=0.0, is_train=None): <NEW_LINE> <INDENT> N = tf.shape(inpu... | docstring for NeuralTensorLayer | 62598f03aad79263cf42d24c |
class ConvexCombinationQuasiMM(QuasiMM): <NEW_LINE> <INDENT> def __init__(self, mmms, mu, timeendpoint='infinity'): <NEW_LINE> <INDENT> self.mMM0 = mmms[0] <NEW_LINE> self.mMM1 = mmms[1] <NEW_LINE> self.mu = mu <NEW_LINE> self.timeendpoint = timeendpoint <NEW_LINE> <DEDENT> def eval(self, taumeta, tauquasi) -> ConvexCo... | quasistationary family of ConvexCombinationMMs
ToDo: get definition of quasistationary from paper | 62598f0397e22403b3839923 |
class MemberChoiceField(forms.ModelChoiceField): <NEW_LINE> <INDENT> def label_from_instance(self, obj): <NEW_LINE> <INDENT> return "%s" % obj.nommembre | ModelChoiceField modification for display member name instead of complete object. | 62598f03ad47b63b2c5a6255 |
class Genre(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200, help_text="Enter a genre (e.g. Science Fiction, French Poetry etc.)") <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Model representing a book genre (e.g. Science Fiction, Non Fiction). | 62598f033346ee7daa336b84 |
class Frame(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.frame_data = bytearray() <NEW_LINE> self.notification_data = list() <NEW_LINE> <DEDENT> def get_frame(self): <NEW_LINE> <INDENT> return self.frame_data <NEW_LINE> <DEDENT> def add_item(self, token_hex, payload, identifier, expiry, pri... | A class representing an APNs message frame for multiple sending | 62598f03ec188e330fdf72ed |
class ListWidget(forms.TextInput): <NEW_LINE> <INDENT> list_separator = ";" <NEW_LINE> maximum = 0 <NEW_LINE> minimum = 0 <NEW_LINE> template_name = "list_input/list_widget.html" <NEW_LINE> def get_context(self, name, value, attrs): <NEW_LINE> <INDENT> context = super().get_context(name, value, attrs) <NEW_LINE> contex... | ListWidget is the default widget for the ListInput field. | 62598f03dc8b845886d52004 |
class FileStorage: <NEW_LINE> <INDENT> __file_path = 'file.json' <NEW_LINE> __objects = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def all(self): <NEW_LINE> <INDENT> return FileStorage.__objects <NEW_LINE> <DEDENT> def new(self, obj): <NEW_LINE> <INDENT> FileStorage.__objects["{}.{}"... | Class FileStorage | 62598f0376e4537e8c3edffa |
class TestREAL(unittest.TestCase): <NEW_LINE> <INDENT> def test_create_from_float(self): <NEW_LINE> <INDENT> a = REAL(1.5) <NEW_LINE> self.assertEqual(a,1.5) <NEW_LINE> b = REAL(0) <NEW_LINE> self.assertEqual(b,0) <NEW_LINE> <DEDENT> def test_create_from_string(self): <NEW_LINE> <INDENT> a = REAL("1.5") <NEW_LINE> self... | REAL test | 62598f039f28863672817234 |
class CleanAndSaveFactoryMixin: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _create(cls, model_class, *args, **kwargs): <NEW_LINE> <INDENT> instance = model_class(*args, **kwargs) <NEW_LINE> instance.clean() <NEW_LINE> instance.save() <NEW_LINE> return instance | Mixin for a test factory that cleans an instance before saving it. | 62598f03f548e778e5969fc5 |
class V1TeamSettings(object): <NEW_LINE> <INDENT> openapi_types = { 'projects': 'list[V1SettingsCatalog]', 'hubs': 'list[V1SettingsCatalog]', 'registries': 'list[V1SettingsCatalog]' } <NEW_LINE> attribute_map = { 'projects': 'projects', 'hubs': 'hubs', 'registries': 'registries' } <NEW_LINE> def __init__(self, projects... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f03cc40096d616196f8 |
class Quotes(object): <NEW_LINE> <INDENT> def __init__(self, main): <NEW_LINE> <INDENT> self.main = main <NEW_LINE> <DEDENT> def get_quote(self, ttype, base_amount, pair): <NEW_LINE> <INDENT> data = { 'type': ttype, 'base_amount': base_amount, 'pair': pair, } <NEW_LINE> result = self.main.api_request('quotes', data=dat... | Class for quote related methods. | 62598f0323849d37ff84faff |
class PagesGenerator(Generator): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.pages = [] <NEW_LINE> self.hidden_pages = [] <NEW_LINE> self.hidden_translations = [] <NEW_LINE> super(PagesGenerator, self).__init__(*args, **kwargs) <NEW_LINE> signals.pages_generator_init.send(self) <NE... | Generate pages | 62598f03167d2b6e312b59da |
class ContourLabel(setting.Text): <NEW_LINE> <INDENT> def __init__(self, name, **args): <NEW_LINE> <INDENT> setting.Text.__init__(self, name, **args) <NEW_LINE> self.add( setting.Str( 'format', '%.3Vg', descr = _('Format of the tick labels'), usertext=_('Format')) ) <NEW_LINE> self.add( setting.Float('scale', 1., descr... | For tick labels on axes. | 62598f033617ad0b5ee04b6a |
class GitRepo(object): <NEW_LINE> <INDENT> git_cmd = 'git' <NEW_LINE> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path or getcwd() <NEW_LINE> if not op.isdir(self.path): <NEW_LINE> <INDENT> self.path = op.dirname(self.path) <NEW_LINE> <DEDENT> if not op.exists(self.path): <NEW_LINE> <INDENT> raise GitExce... | Initialize Git repository. | 62598f03a8370b77170eee1c |
class IncrementalDateTime(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.time = time.time() <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> formatted = formatdate(self.time, True) <NEW_LINE> self.time += 1 <NEW_LINE> return formatted | Simple wrapper to give incremental date/times.
Each call will result in a date/time a second later than the
previous call. This can be used to falsify email headers, to
increase the likelihood that email clients sort the emails
correctly. | 62598f03fbf16365ca792ad9 |
class Talk(Action): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> <DEDENT> def __call__(self, wmode, entity): <NEW_LINE> <INDENT> wmode.infobox.write(self.text) | On call, writes text to the infobox preceded by the name of the
speaking entity. | 62598f03091ae35668703659 |
class LinkedList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> self.last = None <NEW_LINE> <DEDENT> def append(self, val): <NEW_LINE> <INDENT> if not self.head: <NEW_LINE> <INDENT> self.head = Node(val) <NEW_LINE> self.last = self.head <NEW_LINE> <DEDENT> else: <NEW_LINE> <IND... | Linked List class. | 62598f03adb09d7d5dc08ff0 |
@API.private <NEW_LINE> @final <NEW_LINE> class LazyMethodCallWithArgsKwargs(FinalImmutable): <NEW_LINE> <INDENT> __slots__ = ('_method_name', '_scope', '_args', '_kwargs', '__cache_attr') <NEW_LINE> _method_name: str <NEW_LINE> _scope: Optional[Scope] <NEW_LINE> _args: Tuple[object, ...] <NEW_LINE> _kwargs: Dict[str, ... | :meta private: | 62598f035fdd1c0f98e5c9df |
class WikiHopExampleToTfExamplesFn(beam.DoFn): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> super().setup() <NEW_LINE> if FLAGS.tokenizer_type == "BERT": <NEW_LINE> <INDENT> tokenization.validate_case_matches_checkpoint(FLAGS.do_lower_case, FLAGS.init_checkpoint) <NEW_LINE> if not FLAGS.vocab_file: <NEW_LIN... | DoFn for converting WikiHopExample to tf.Example. | 62598f035166f23b2e241e1e |
class TimeFramedManager(Manager): <NEW_LINE> <INDENT> def _get_queryset(self): <NEW_LINE> <INDENT> return TimeFramedQuerySet(self.model, using=self._db) <NEW_LINE> <DEDENT> def get_queryset(self): <NEW_LINE> <INDENT> return self._get_queryset() <NEW_LINE> <DEDENT> @property <NEW_LINE> def in_effect(self): <NEW_LINE> <I... | Manager for Models using the Time Framed Mixin | 62598f03fff4ab517ebcc213 |
class NeutronAgentMissing(Exception): <NEW_LINE> <INDENT> pass | Agent binary does not appear in the Neutron agent list. | 62598f03ec188e330fdf72ef |
class ConnectedDeviceViewSet(ViewSet): <NEW_LINE> <INDENT> permission_classes = [IsAuthenticatedOrLoginNotRequired] <NEW_LINE> _device_param = Parameter( name='peer_device', in_='query', description='The name of the peer device', required=True, type=openapi.TYPE_STRING ) <NEW_LINE> _interface_param = Parameter( name='p... | This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer
interface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors
via a protocol such as LLDP. Two query parameters must be included in the request:
* `peer_device`... | 62598f03851cf427c66b6d08 |
class R1NStopCollection(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = models.R1NStops.objects.all() <NEW_LINE> serializer_class = serializers.R1NStops <NEW_LINE> filter_class = R1NStopFilter | API endpoint that allows R 1 N stops to be viewed | 62598f037b180e01f3e48567 |
class InvalidRequestIDException(DeltaException): <NEW_LINE> <INDENT> pass | Is raised when given request id is not valid. | 62598f03be7bc26dc9251383 |
class Category(models.Model): <NEW_LINE> <INDENT> nid = models.BigAutoField(primary_key=True) <NEW_LINE> title = models.CharField(verbose_name='分类标题', max_length=32) <NEW_LINE> blog = models.ForeignKey(verbose_name='所属博客', to='Blog', to_field='nid') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.title <N... | 博主个人文章分类表 | 62598f0331939e2706ed0f81 |
class Kidder76(Cog7): <NEW_LINE> <INDENT> parameters = { 'tau': Cog7.parameters['tau'], 'R0': Cog7.parameters['R0'], 'Ri': Cog7.parameters['Ri'], 'Gamma': Cog7.parameters['Gamma'], } <NEW_LINE> geometry = 3 <NEW_LINE> b = 0. | Cog7 reduces to the 1976 Kidder solution for geometry=3, b=0.
| 62598f03a8370b77170eee1e |
class ForumPost(db.Model): <NEW_LINE> <INDENT> __tablename__ = "forum_thread_posts" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> author_id = db.Column(db.Integer, db.ForeignKey('users.id')) <NEW_LINE> author = db.relationship("User") <NEW_LINE> body = db.Column(db.Text()) <NEW_LINE> date_created =... | Forum Thread Posts.
Many to One relationship with `ForumThread`. | 62598f0360cbc95b06362d72 |
class ProductionConfig(BaseConfig): <NEW_LINE> <INDENT> SECRET_KEY = 'my_precious' <NEW_LINE> DEBUG = False <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://jacknlin_apiFetcher:56ePeaYu33E5pTV@jlocalhost:3306/' | Production Configuration | 62598f039f28863672817237 |
class RefreshContainer(ContainerCommandMixin, Command): <NEW_LINE> <INDENT> log = getLogger(__name__ + '.RefreshContainer') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(RefreshContainer, self).get_parser(prog_name) <NEW_LINE> self.patch_parser_container(parser) <NEW_LINE> return parser... | Refresh counters of an account (triggers asynchronous treatments) | 62598f03bf627c535bcafeb5 |
class EmployeeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Employee.objects.all() <NEW_LINE> serializer_class = EmployeeSerializer | This viewset automatically provides `list` and `detail` actions. | 62598f033346ee7daa336b86 |
class BarcampEditSideEventView(BarcampBaseView): <NEW_LINE> <INDENT> template_name = 'barcamp/edit-sideevent.html' <NEW_LINE> def view(self, *args, **kwargs): <NEW_LINE> <INDENT> event = get_object_or_404(models.SideEvent.objects.filter( barcamp=self.barcamp, pk=kwargs['event_pk'])) <NEW_LINE> form = forms.CreateSideEv... | Edit the details of a side event. | 62598f034f88993c371efa0b |
class Method(Field): <NEW_LINE> <INDENT> _CHECK_ATTRIBUTE = False <NEW_LINE> def __init__(self, serialize: str = None, deserialize: str = None, **kwargs): <NEW_LINE> <INDENT> kwargs["dump_only"] = bool(serialize) and not bool(deserialize) <NEW_LINE> kwargs["load_only"] = bool(deserialize) and not bool(serialize) <NEW_L... | A field that takes the value returned by a `Schema` method.
:param str serialize: The name of the Schema method from which
to retrieve the value. The method must take an argument ``obj``
(in addition to self) that is the object to be serialized.
:param str deserialize: Optional name of the Schema method for de... | 62598f03a219f33f346c526f |
class SourceSchedule(): <NEW_LINE> <INDENT> def __init__(self, *, enabled: bool = None, time_zone: str = None, frequency: str = None) -> None: <NEW_LINE> <INDENT> self.enabled = enabled <NEW_LINE> self.time_zone = time_zone <NEW_LINE> self.frequency = frequency <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(... | Object containing the schedule information for the source.
:attr bool enabled: (optional) When `true`, the source is re-crawled based on
the **frequency** field in this object. When `false` the source is not
re-crawled; When `false` and connecting to Salesforce the source is crawled
annually.
:attr s... | 62598f03a05bb46b384892b8 |
class BattleBotFactory(protocol.ClientFactory): <NEW_LINE> <INDENT> def __init__(self, channel, filename): <NEW_LINE> <INDENT> self.channel = channel <NEW_LINE> self.filename = filename <NEW_LINE> <DEDENT> def buildProtocol(self, addr): <NEW_LINE> <INDENT> p = BattleBot() <NEW_LINE> p.factory = self <NEW_LINE> return p... | A factory for Battlebots.
A new protocol instance will be created each time we connect to the server. | 62598f0371ff763f4b5e61a5 |
class Base(Atom): <NEW_LINE> <INDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return not self.__eq__(other) <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.__getstate__()) | Makes comparisons and hashing work properly | 62598f037047854f4633de09 |
class HotWaterBoilerMaximumFlowRate(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal" | The maximum flow rate of water that the boiler is designed to accept. (gpm) | 62598f03fbf16365ca792add |
class monManLBsInHighStatInterval(JobProperty): <NEW_LINE> <INDENT> statusOn = True <NEW_LINE> allowedTypes = ['int'] <NEW_LINE> StoredValue = 180 | number of LBs in high statistics interval | 62598f03167d2b6e312b59de |
class ControllerApi(object): <NEW_LINE> <INDENT> notify_widget = None <NEW_LINE> lyric_widget = None <NEW_LINE> desktop_mini = None <NEW_LINE> current_playlist_widget = None <NEW_LINE> player = None <NEW_LINE> network_manager = None <NEW_LINE> api = None <NEW_LINE> state = {"is_login": False, "current_mid": 0, "current... | 暴露给plugin或者其他外部模块的接口和数据
| 62598f03aad79263cf42d252 |
class TestParams(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(self): <NEW_LINE> <INDENT> self.runner = CliRunner() <NEW_LINE> (_, self.empty_file_path) = tempfile.mkstemp(suffix='.txt') <NEW_LINE> <DEDENT> def invoke(self, args, input=None): <NEW_LINE> <INDENT> return self.runner.invok... | Test options and arguments | 62598f032c8b7c6e89bd2206 |
class ShowOspf3NeighborInstanceAllSchema(MetaParser): <NEW_LINE> <INDENT> schema = { "ospf3-neighbor-information-all": { "ospf3-instance-neighbor": { "ospf3-instance-name": str, "ospf3-realm-neighbor": { "ospf3-realm-name": str, Optional("ospf3-neighbor"): ListOf({ "activity-timer": str, "interface-name": str, "neighbo... | schema = {
"ospf3-neighbor-information-all": {
"ospf3-instance-neighbor": {
"ospf3-instance-name": str,
"ospf3-realm-neighbor": {
"ospf3-realm-name": str
"ospf3-neighbor": [
{
"activity-timer": str,
... | 62598f033346ee7daa336b87 |
class ProductOptionsModifier(BaseCartModifier): <NEW_LINE> <INDENT> def process_cart_item(self, cart_item, request): <NEW_LINE> <INDENT> selected_options = CartItemOption.objects.filter(cartitem=cart_item) <NEW_LINE> for selected_opt in selected_options: <NEW_LINE> <INDENT> option_obj = selected_opt.option <NEW_LINE> p... | This modifier adds an extra field to the cart to let the lineitem "know"
about product options and their respective price. | 62598f0376e4537e8c3edfff |
class INoticiaDestacadaPortlet(IPortletDataProvider): <NEW_LINE> <INDENT> pass | Defines a new portlet
| 62598f03f9cc0f698b1c47f0 |
class HashDistance(Distance): <NEW_LINE> <INDENT> NAME = 'hash' <NEW_LINE> def measure(self, x, y): <NEW_LINE> <INDENT> xh = set([hash(w) for w in x]) <NEW_LINE> yh = set([hash(w) for w in y]) <NEW_LINE> return len(xh.symmetric_difference(yh)) | Distance is equal to size of symdiff(X,Y). | 62598f034f88993c371efa0c |
class WindowsCrashDumpSpace64(WindowsCrashDumpSpace32): <NEW_LINE> <INDENT> order = 30 <NEW_LINE> __image = True <NEW_LINE> def check_file(self): <NEW_LINE> <INDENT> self.as_assert((self.base.read(0, 8) == b'PAGEDU64'), "Header signature invalid") <NEW_LINE> self.profile = crashdump.CrashDump64Profile( session=self.ses... | This AS supports windows Crash Dump format. | 62598f039f2886367281723a |
class MgmtDataExporterFsmTask(ManagedObject): <NEW_LINE> <INDENT> consts = MgmtDataExporterFsmTaskConsts() <NEW_LINE> naming_props = set([u'item']) <NEW_LINE> mo_meta = MoMeta("MgmtDataExporterFsmTask", "mgmtDataExporterFsmTask", "task-[item]", VersionMeta.Version101a, "OutputOnly", 0xf, [], [""], [u'mgmtDataExporter']... | This is MgmtDataExporterFsmTask class. | 62598f03283ffb24f3cf22ef |
class Policy(object): <NEW_LINE> <INDENT> def __init__(self, db, current_user): <NEW_LINE> <INDENT> self.db = db <NEW_LINE> self.current_user = current_user <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def grant(account, action, target, fields): <NEW_LINE> <INDENT> if fields is not Available and not isinstance(fields, ... | Operator class that can verify the compliance of CRUD operations.
An intent is passed as a method call and a grant is issued upon compliance
or a violancion exception is raised on dissent. | 62598f037c178a314d78bee1 |
class Test_Tools_Api(object): <NEW_LINE> <INDENT> def list1(self): <NEW_LINE> <INDENT> return 'test11' | docstring for Test_Tools_Api | 62598f03f548e778e5969fcb |
class StateMachine( object ): <NEW_LINE> <INDENT> def __init__( self, state = None ): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.states = { 'Nirvana' : State( 100 ) } <NEW_LINE> <DEDENT> def levelOfState( self, state ): <NEW_LINE> <INDENT> if not state in self.states: <NEW_LINE> <INDENT> return -1 <NEW_LIN... | StateMachine class that represents the whole state machine with all transitions. | 62598f0323849d37ff84fb05 |
class PemCertificateList(CertificateSource): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, 'certificates': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, 'certificates': {'key': 'certificates', 'type': '[str]'}, } <NEW_LINE> def __init__( self, *, certific... | A list of PEM formatted certificates.
All required parameters must be populated in order to send to Azure.
:ivar type: Required. Type discriminator for the derived types.Constant filled by server.
:vartype type: str
:ivar certificates: Required. PEM formatted public certificates. One certificate per entry.
:vartype c... | 62598f034c34283577618d2e |
class KaheloConfigParser (configparser.ConfigParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if sys.version_info < (3,): <NEW_LINE> <INDENT> configparser.ConfigParser.__init__(self) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> configparser.ConfigParser.__init__(self, inline_comment_prefixes=(';',)... | Add input checking. | 62598f0397e22403b383992a |
class EmbeddedFirmwareResponseTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_embedded_firmware_response(self): <NEW_LINE> <INDENT> embedded_firmware_response_obj = EmbeddedFirmwareResponse() <NEW_LINE> self.assertNotEqual(embedded_firmware_response_obj, None) | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f033617ad0b5ee04b70 |
class _IsoLevelSlider(qt.QSlider): <NEW_LINE> <INDENT> def __init__(self, parent, subject, normalization): <NEW_LINE> <INDENT> super(_IsoLevelSlider, self).__init__(parent=parent) <NEW_LINE> self.subject = subject <NEW_LINE> if normalization == 'arcsinh': <NEW_LINE> <INDENT> self.__norm = numpy.arcsinh <NEW_LINE> self.... | QSlider used for iso-surface level with linear scale | 62598f03091ae3566870365f |
class ReleaseTableDuplication(Operation): <NEW_LINE> <INDENT> reversible = True <NEW_LINE> def __init__(self, old_model_name, new_model_name): <NEW_LINE> <INDENT> self.old_model_name = old_model_name <NEW_LINE> self.new_model_name = new_model_name <NEW_LINE> <DEDENT> def database_forwards(self, app_label, schema_editor... | Release the triggers setup in the CreateTableDuplication operation. | 62598f03283ffb24f3cf22f0 |
class NonnegativeInt(BaseObject): <NEW_LINE> <INDENT> description = 'A non-negative integer.' <NEW_LINE> default_value = 0 <NEW_LINE> @classmethod <NEW_LINE> def get_schema(cls): <NEW_LINE> <INDENT> return { 'type': 'int', 'validators': [{ 'id': 'is_at_least', 'min_value': 0 }] } | Nonnegative integer class. | 62598f03fbf16365ca792adf |
class MassObject: <NEW_LINE> <INDENT> def __init__(self,name,mass,radius, xPos,yPos,zPos,xVel,yVel,zVel, color): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> self.mass=mass <NEW_LINE> self.radius=radius <NEW_LINE> self.color= "#%02x%02x%02x" % color <NEW_LINE> self.x=xPos <NEW_LINE> self.y=yPos <NEW_LINE> self.z=zPos ... | An inner-class used by the simulator
Main use is for the simulator. Some small functions are available.
Parameters:
name (str): Name of the mass
mass (double): Mass of the object
radius (double): Radius of the spherical object
color (3 tuple): The RGB values for the Color of the object
x (double):... | 62598f03099cdd3c636748f9 |
class Account(Base): <NEW_LINE> <INDENT> __tablename__ = "account" <NEW_LINE> id = Column(String, primary_key=True) <NEW_LINE> name = Column(String) <NEW_LINE> email = Column(String) <NEW_LINE> creation_time_utc = Column(DateTime, default=datetime.datetime.utcnow) <NEW_LINE> last_login_time_utc = Column(DateTime) <NEW_... | A person who uses RouteMaster | 62598f034a966d76dd5ed919 |
class TestAddress(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Address( address_lines ... | Address unit test stubs | 62598f035fdd1c0f98e5c9e5 |
class Asset(): <NEW_LINE> <INDENT> def __init__(self, id_type, identifier, universe, bar, meta, tradeable_override = False): <NEW_LINE> <INDENT> self.id_type = id_type <NEW_LINE> self.identifier = identifier <NEW_LINE> self.universe = universe <NEW_LINE> self.bar = bar <NEW_LINE> self.meta = meta <NEW_LINE> self.tradea... | A tradeable asset.
...
Parameters
----------
id_type : str
type of asset
identifier : str
identifier
bar : str
time series
meta : dict
meta information | 62598f035166f23b2e241e24 |
class SpacyModelPicklerMixin: <NEW_LINE> <INDENT> def __getstate__(self): <NEW_LINE> <INDENT> state = self.__dict__.copy() <NEW_LINE> model_path = state["nlp"].path <NEW_LINE> state["model_path"] = model_path <NEW_LINE> del state["nlp"] <NEW_LINE> return state <NEW_LINE> <DEDENT> def __setstate__(self, state: dict): <N... | Class intented to be inherited by classes that use
spacy's model so that the spacy's model is not pickled.
Instead only the path to the mode is pickled | 62598f0350812a4eaa62010e |
class AS2EnvelopeSettings(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'message_content_type': {'required': True}, 'transmit_file_name_in_mime_header': {'required': True}, 'file_name_template': {'required': True}, 'suspend_message_on_file_name_generation_error': {'required': True}, 'autogenerate_fil... | The AS2 agreement envelope settings.
All required parameters must be populated in order to send to Azure.
:param message_content_type: Required. The message content type.
:type message_content_type: str
:param transmit_file_name_in_mime_header: Required. The value indicating whether to transmit
file name in mime hea... | 62598f0323849d37ff84fb07 |
class IdentificationRecall(Recall): <NEW_LINE> <INDENT> def __init__(self, matcher=None, unknown=False, **kwargs): <NEW_LINE> <INDENT> super(IdentificationRecall, self).__init__() <NEW_LINE> if matcher: <NEW_LINE> <INDENT> self.matcher = matcher <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.matcher = UnknownIDMatc... | Identification Recall
Parameters
----------
matcher : `IDMatcher`, optional
Defaults to `UnknownIDMatcher` instance
unknown : bool, optional
Set `unknown` to True to take `Unknown` instances into account.
Set it to False (default) to get rid of them before evaluation. | 62598f0397e22403b383992c |
class InsBasicConfigurationRegisterVn300(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, InsBasicConfigurationRegisterVn300, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, InsB... | Proxy of C++ vn::sensors::InsBasicConfigurationRegisterVn300 class. | 62598f03bf627c535bcafebb |
class Context: <NEW_LINE> <INDENT> __slots__ = ['ctx', 'device', 'settings', 'read_endpoint', 'read_endpoint_address', 'write_endpoint', 'write_endpoint_address', 'handle', 'interface'] <NEW_LINE> def __init__(self, ctx, device, settings, read_endpoint, write_endpoint, handle, interface): <NEW_LINE> <INDENT> self.ctx =... | Transport context object returned by :meth:`~adbpy.transport.sync.usb.Transport.connect`. | 62598f030fa83653e46f3929 |
class SimpleCopBehavior: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.firstinformed = None <NEW_LINE> <DEDENT> def input(self, _event, _posteventcallback): <NEW_LINE> <INDENT> if _event.type == COLLISION_EVENT: <NEW_LINE> <INDENT> entity = _event.colliding <NEW_LINE> tag_artifact = entity.artifacts[... | Class defining behaviour of standard cop on incoming events. | 62598f03adb09d7d5dc08ff7 |
class NVEncH264(H264Codec): <NEW_LINE> <INDENT> codec_name = 'nvenc_h264' <NEW_LINE> ffmpeg_codec_name = 'nvenc_h264' | Nvidia H.264/AVC video codec.
@see http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide | 62598f03fbf16365ca792ae1 |
class BaseIndex(object): <NEW_LINE> <INDENT> ALL = 'ALL' <NEW_LINE> KEYS = 'KEYS_ONLY' <NEW_LINE> INCLUDE = 'INCLUDE' <NEW_LINE> def __init__(self, projection_type, name, range_key, includes): <NEW_LINE> <INDENT> self.projection_type = projection_type <NEW_LINE> self.name = name <NEW_LINE> self.range_key = range_key <N... | Base class for indexes | 62598f034a966d76dd5ed91b |
class _ConnectionDebugProxy(ConnectionProxy): <NEW_LINE> <INDENT> def __init__(self, import_name, bind): <NEW_LINE> <INDENT> self.app_package = import_name <NEW_LINE> self.bind = bind <NEW_LINE> <DEDENT> def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): <NEW_LINE> <INDENT> start = ... | Helps debugging the database. | 62598f034f88993c371efa0e |
class UnknownService(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(ErrorType.UNKNOWN_SERVICE) | An exception raised whenever a ``Base`` object cannot find a service. | 62598f039f2886367281723e |
class Variable: <NEW_LINE> <INDENT> def __init__(self, str_symbol, var_index): <NEW_LINE> <INDENT> _LOGGER.debug("Creating a new Variable object: %s", str_symbol) <NEW_LINE> self._var_index = var_index <NEW_LINE> self._str_var = str_symbol <NEW_LINE> self._sym_symbol = sym.Symbol(str_symbol) <NEW_LINE> <DEDENT> def __e... | A Variable (or species) represents a set of individuals in the population. | 62598f03851cf427c66b6d10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.