code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PartOfSpeech(object): <NEW_LINE> <INDENT> ADJ = ('ADJ', 82) <NEW_LINE> ADP = ('ADP', 83) <NEW_LINE> ADV = ('ADV', 84) <NEW_LINE> AUX = ('AUX', 85) <NEW_LINE> CONJ = ('CONJ', 86) <NEW_LINE> DET = ('DET', 87) <NEW_LINE> INTJ = ('INTJ', 88) <NEW_LINE> NOUN = ('NOUN', 89) <NEW_LINE> NUM = ('NUM', 90) <NEW_LINE> PART ... | Enumeration class of parts of speech for PartOfSpeechExtractor.
Available parts of speech are as follows:
PartOfSpeech.ADJ: adjective
PartOfSpeech.ADP: adposition
PartOfSpeech.ADV: adverb
PartOfSpeech.AUX: auxiliary verb
PartOfSpeech.CONJ: coordinating conjunction
PartOfSpeech.DET: determiner
PartOfSpeech.INTJ: interj... | 62598edb435de62698e9a316 |
class NotificationService(object): <NEW_LINE> <INDENT> _logger = None <NEW_LINE> def __init__(self, logger): <NEW_LINE> <INDENT> self._logger = logger <NEW_LINE> <DEDENT> def get_notifications(self, client_id, client_version, client_tree_version, client_api_version, lang='en', user_id=None): <NEW_LINE> <INDENT> notific... | Public Business Service
Request
=======
GET /notifications
lang: String. ISO 639-1 code. e.g: "es", "en", "pt".
user_id: String. e.g: "CKJG3L".
client_id: String. This id/code is unique for each registered client. e.g: "iphone_core_client".
client_version: String. major.minor.stage.build http://en.wikipedia.org/wik... | 62598edb627d3e7fe0e053c7 |
class RemoteObject: <NEW_LINE> <INDENT> def __init__(self, funcnames, postfunc): <NEW_LINE> <INDENT> for f in funcnames: <NEW_LINE> <INDENT> setattr(self, f, functools.partial(make_encode_and_post(f, postfunc), self)) | Clone a remote object for JSON RPC. Method calls to this object will be
converted to JSON and posted via the postfunc. | 62598edbe1aae11d1e7cdade |
class Firefox(Profile): <NEW_LINE> <INDENT> def setup_session(self, session): <NEW_LINE> <INDENT> session.headers = { 'Accept-Language': 'en-us,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:45... | Try to mimic a specific version of Firefox.
Ideally, it should follow the current ESR Firefox:
https://www.mozilla.org/en-US/firefox/organizations/all.html
Do not change the Firefox version without checking the Gecko one! | 62598edb3cc13d1c6d463ca9 |
class IntervalTimer(threading.Thread): <NEW_LINE> <INDENT> def __init__( self, function, interval, name=None, args=(), kwargs=None, daemon=None, evaluate_function_interval=False ): <NEW_LINE> <INDENT> super(IntervalTimer, self).__init__(name=name) <NEW_LINE> self.daemon = daemon <NEW_LINE> self._args = args <NEW_LINE> ... | A timer that runs a function repeatedly. In contrast to threading.Timer,
IntervalTimer runs the given function in perpetuity or until it is cancelled.
When run, it will wait `interval` seconds until the first execution. | 62598edb1f5feb6acb161192 |
class NodeDisableSchedulingParameter(Model): <NEW_LINE> <INDENT> _attribute_map = { 'node_disable_scheduling_option': {'key': 'nodeDisableSchedulingOption', 'type': 'DisableComputeNodeSchedulingOption'}, } <NEW_LINE> def __init__(self, *, node_disable_scheduling_option=None, **kwargs) -> None: <NEW_LINE> <INDENT> super... | Options for disabling scheduling on a Compute Node.
:param node_disable_scheduling_option: The default value is requeue.
Possible values include: 'requeue', 'terminate', 'taskCompletion'
:type node_disable_scheduling_option: str or
~azure.batch.models.DisableComputeNodeSchedulingOption | 62598edb55399d3f05624a6e |
class Always(Filter): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __invert__(self): <NEW_LINE> <INDENT> return Never() | Always enable feature. | 62598edb4428ac0f6e656a9c |
class JMProduct(JordanMonomialBase): <NEW_LINE> <INDENT> def __init__(self, L, R): <NEW_LINE> <INDENT> if isinstance(L, str): <NEW_LINE> <INDENT> L = JMSingle(L) <NEW_LINE> <DEDENT> if isinstance(R, str): <NEW_LINE> <INDENT> R = JMSingle(R) <NEW_LINE> <DEDENT> self._L = L <NEW_LINE> self._R = R <NEW_LINE> <DEDENT> def ... | Used for representing T_{LR} where L and R are
other instances of JordanMonomialBase | 62598edb4a966d76dd5ed424 |
class ExerciseList(OwndedListView): <NEW_LINE> <INDENT> query_model = Exercise <NEW_LINE> serializer_class = ExerciseSerializer | API endpoint that allows exercises to be viewed or edited | 62598edb94891a1f408b8111 |
class pyramid(object): <NEW_LINE> <INDENT> def __init__(self, num_layers, ratio, image = False, mask = False): <NEW_LINE> <INDENT> self.num_layers = num_layers <NEW_LINE> self.ratio = ratio <NEW_LINE> self.image_T = image <NEW_LINE> self.mask_T = mask <NEW_LINE> <DEDENT> def __call__(self, image, mask): <NEW_LINE> <IND... | if image size is 256*256, then pyramid(3, 2, image = True)
will return list image = [image1, image2, image3]
size is [256*256, 128*128, 64*64] | 62598edb7cff6e4e811b3f2f |
class InvalidAccessToken(AccessTokenException): <NEW_LINE> <INDENT> pass | Invalid access token type.Raised when
the access token provided is not a valid
str or a BitGoAccessToken instance. | 62598edb851cf427c66b6812 |
class ItemCreateView(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> cls.user1 = User.objects.create_user(username='test1', password='12345') <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> self.client._login(self.user1, backend=settings.AUTHENTICATION_BACKEND... | Tests ItemCreateView from menus.views | 62598edb7d43ff248742669c |
class SafeDictReader: <NEW_LINE> <INDENT> def __init__(self, istream: TextIO, sep: str = ',') -> None: <NEW_LINE> <INDENT> csv.field_size_limit(2**24) <NEW_LINE> self.reader = csv.DictReader(istream, delimiter=sep) <NEW_LINE> <DEDENT> def __iter__(self) -> Iterator[Record]: <NEW_LINE> <INDENT> for lineno, r in enumerat... | A CSV reader that streams records but gives nice errors if lines fail to parse. | 62598edb99fddb7c1ca620a7 |
class SimpleTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_os_path(self): <NEW_LINE> <INDENT> mf = ModuleFinder() <NEW_LINE> mf.import_hook("os", None, ["path"]) <NEW_LINE> self.assertIn("os", mf.modules) <NEW_LINE> self.assertIn("ntpath", mf.modules) <NEW_LINE> self.assertNotIn("os.path", mf.missing()) <NEW_LI... | Simple import tests on the Python standard library. | 62598edb9b70327d1c57d2fa |
class WebTicket(QRCode, PersonModel): <NEW_LINE> <INDENT> product_id = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('ID do Produto'), ) <NEW_LINE> product_name = models.CharField( max_length=100, verbose_name=_('Nome do Produto'), ) <NEW_LINE> buyer_name = models.CharField( max_length=100, verbose... | WebTicket data handles web tickets information.
Web tickets contains a QRCode (`uuid param`) usually previously
generated from another application.
The required attributes are:
:param uuid: The universally unique identifier for the ticket.
:type uuid: string
:param product_id: The product ID or type.
:type product_i... | 62598edbd99f1b3c44d03bf7 |
class has_eg_DDD_households_with_DDD_nonhome_based_workers(Variable): <NEW_LINE> <INDENT> def __init__(self, number1, number2): <NEW_LINE> <INDENT> Variable.__init__(self) <NEW_LINE> self.tnumber = number1 <NEW_LINE> self.household_condition = "has_%s_nonhome_based_workers" % number2 <NEW_LINE> <DEDENT> def dependencie... | has equal to or more than DDD surveyed households with DDD nonhome-based workers? | 62598edb8e7ae83300ee75d1 |
class VelocityXmlLexer(DelegatingLexer): <NEW_LINE> <INDENT> name = 'XML+Velocity' <NEW_LINE> aliases = ['xml+velocity'] <NEW_LINE> alias_filenames = ['*.xml', '*.vm'] <NEW_LINE> mimetypes = ['application/xml+velocity'] <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> super().__init__(XmlLexer, VelocityLex... | Subclass of the `VelocityLexer` that highlights unlexed data
with the `XmlLexer`. | 62598edbbaa26c4b54d4d819 |
class LinearLayout(base_frame_view.BaseFrameView): <NEW_LINE> <INDENT> def __init__(self, parent, linear_layout=None, **kwargs): <NEW_LINE> <INDENT> super(LinearLayout, self).__init__(parent) <NEW_LINE> self.__linear_layout = linear_layout if isinstance(linear_layout, WebElement) else self.find_element(**kwargs) <NEW_L... | Attribute:
__switch: | 62598edb32920d7e50bc456f |
class AlbumVignette(Helper): <NEW_LINE> <INDENT> def __init__(self, request, album, vignette_type=''): <NEW_LINE> <INDENT> super(AlbumVignette, self).__init__(request) <NEW_LINE> self.album_title = album.title <NEW_LINE> self.album_id = album.pk <NEW_LINE> self.img_url = album.imagefile_set.filter(ima_usage='cover100')... | Small album vignette | 62598edb5fdd1c0f98e5c4ef |
class Singleton(object): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> def __new__(cls, *args, **kw): <NEW_LINE> <INDENT> if not cls._instance: <NEW_LINE> <INDENT> cls._instance = super(Singleton, cls).__new__(cls, *args, **kw) <NEW_LINE> <DEDENT> return cls._instance | 实现单例模式,Proxy在程序中只有一个实例
Attributes:
_instance: 唯一实例的引用。 | 62598edb009cb60464cffa96 |
class ExcelReader: <NEW_LINE> <INDENT> def __init__(self, excel, sheet=0, title_line=True): <NEW_LINE> <INDENT> if os.path.exists(excel): <NEW_LINE> <INDENT> self.excel = excel <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise FileNotFoundError('文件不存在') <NEW_LINE> <DEDENT> self.sheet = sheet <NEW_LINE> self.title_lin... | 读取excel文件中的内容。返回list
如:
excel中内容为:
|A |B |C |
|A1|B1|C1|
|A2|B2|C2|
如果print(ExcelReader(excel,title_line=True).data)输出结果:
[{A:A1,B:B1,C:C1},{A:A2,B:B2,C:C2}]
如果print(ExcelReader(excel,title_line=False).data)输出结果:
[[A,B,C],[A1,B1,C1],[A2,B2,C2]]
可以指定sheet,通过index或者name:
ExcelReader(excel, sheet=2)
ExcelReader(excel, sh... | 62598edbcc0a2c1114479544 |
class ReportKeycodeInactive(_Assertion): <NEW_LINE> <INDENT> def __init__(self, keycode): <NEW_LINE> <INDENT> _Assertion.__init__(self) <NEW_LINE> self.keycode = keycode <NEW_LINE> <DEDENT> def _description(self): <NEW_LINE> <INDENT> return "Keycode %s inactive" % str(kaleidoscope.Key.keycodeToName(self.keycode)) <NEW_... | Asserts that a specific key is inactive in the keyboard report.
Args:
keycode (int): The key tested for being inactive. | 62598edb91f36d47f2230145 |
class Importer(object): <NEW_LINE> <INDENT> def __init__(self, db_name='speedcams'): <NEW_LINE> <INDENT> self.points = 0 <NEW_LINE> mongo = MongoClient() <NEW_LINE> database = mongo[db_name] <NEW_LINE> database.points.drop() <NEW_LINE> points = database.points <NEW_LINE> points.ensure_index([("loc", pymongo.GEOSPHERE)]... | Camera data importer | 62598edb66656f66f7d58922 |
class Solution: <NEW_LINE> <INDENT> def aplusb(self, a, b): <NEW_LINE> <INDENT> while b != 0: <NEW_LINE> <INDENT> _a = (a ^ b) & 0xFFFFFFFF <NEW_LINE> _b = (a & b) << 1 <NEW_LINE> a = _a <NEW_LINE> b = _b <NEW_LINE> <DEDENT> return a | @param a: An integer
@param b: An integer
@return: The sum of a and b | 62598edb29b78933be26936f |
class UIMain(tk.Tk): <NEW_LINE> <INDENT> def __init__(self,parent): <NEW_LINE> <INDENT> tk.Tk.__init__(self,parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.initialize() <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> self.grid() <NEW_LINE> self.entryVatiable=tk.StringVar() <NEW_LINE> self.entry=tk... | classdocs | 62598edbb7558d5895461b8d |
class PreprocessingPipelineWriter: <NEW_LINE> <INDENT> def __init__(self, result_folder_path = "runs", saved_text_pipeline_file_path = "text_pipeline.pkl", saved_label_pipeline_file_path = "label_pipeline.pkl"): <NEW_LINE> <INDENT> self.result_folder_path = result_folder_path <NEW_LINE> self.saved_text_pipeline_file_pa... | Class for saving data.Field for production.
Inputs:
- result_folder_path (string): folder for saving data
- saved_text_pipeline_file_path: file path relative to result_folder_path for saving data.Field for text
- saved_label_pipeline_file_path: file path relative to result_folder_path for saving data.Field... | 62598edb60cbc95b0636287d |
class DownloadArchetypeFile(BrowserView): <NEW_LINE> <INDENT> implements(IPublishTraverse) <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> super(DownloadArchetypeFile, self).__init__(context, request) <NEW_LINE> self.fieldname = None <NEW_LINE> self.filename = None <NEW_LINE> <DEDENT> def publishTr... | Basically, straight copy from plone.namedfile
| 62598edba79ad1619776855d |
class AM(sequencetools.FluxSequence): <NEW_LINE> <INDENT> NDIM, NUMERIC, SPAN = 0, False, (0., None) | Durchflossene Fläche Hauptgerinne (flown through area of the
main channel) [m²]. | 62598edb44b2445a339b5c06 |
class NotFound(NotFound): <NEW_LINE> <INDENT> pass | NotFound exception specific to Session. | 62598edb3617ad0b5ee0466f |
class ListSharedLinksError(bb.Union): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> reset = None <NEW_LINE> other = None <NEW_LINE> @classmethod <NEW_LINE> def path(cls, val): <NEW_LINE> <INDENT> return cls('path', val) <NEW_LINE> <DEDENT> def is_path(self): <NEW_LINE> <INDENT> return self._tag == 'path' <NEW_LIN... | This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method.
:ivar sharing.ListSharedLinksError.reset: Indicates that the cursor has been
invalidated. Call
:meth:`dropbox.dropbox_client.Dropbo... | 62598edb82261d6c5272f158 |
class WeeksToCheckForm(forms.Form): <NEW_LINE> <INDENT> weeks_to_check=forms.IntegerField(min_value=1) | Field to type in the integer | 62598edb4e4d56256637095b |
class JobDetailsSerializer(JobSerializer): <NEW_LINE> <INDENT> from error.serializers import ErrorSerializer <NEW_LINE> from storage.serializers import ScaleFileBaseSerializer <NEW_LINE> from trigger.serializers import TriggerEventDetailsSerializer <NEW_LINE> job_type = JobTypeSerializer() <NEW_LINE> job_type_rev = Job... | Converts job model and related fields to REST output. | 62598edb2ae34c7f260a962a |
class TOPDate: <NEW_LINE> <INDENT> def create(self, date_str): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return date_parse(date_str) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> return date_str | pyTOP Date Object | 62598edb0a50d4780f7038ea |
class _TagFactory: <NEW_LINE> <INDENT> def __getattr__(self, tagName): <NEW_LINE> <INDENT> if tagName == 'transparent': <NEW_LINE> <INDENT> return Tag('') <NEW_LINE> <DEDENT> tagName = tagName.rstrip('_') <NEW_LINE> if tagName not in VALID_HTML_TAG_NAMES: <NEW_LINE> <INDENT> raise AttributeError('unknown tag %r' % (tag... | A factory for L{Tag} objects; the implementation of the L{tags} object.
This allows for the syntactic convenience of C{from twisted.web.html import
tags; tags.a(href="linked-page.html")}, where 'a' can be basically any HTML
tag.
The class is not exposed publicly because you only ever need one of these,
and we already... | 62598edb55399d3f05624a70 |
class TestRestoreFiles(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> _make_test_data_objects(self) <NEW_LINE> <DEDENT> def test_files_restored(self): <NEW_LINE> <INDENT> restore_files(ReplacedFile.objects.filter(name__in=['file_four.nc', 'file_five.nc'])) <NEW_LINE> self.assertEqual(0, ReplacedFil... | Test pdata_app.utils.replace_file.replace_files | 62598edbb7558d5895461b8e |
class RbacAuthorizationApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def get_api_group(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return... | NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598edb7cff6e4e811b3f31 |
class Future(object): <NEW_LINE> <INDENT> def __init__(self, resource_manager: SourceResource, name: str, description: gmx.datamodel.ResultDescription): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> if not isinstance(description, gmx.datamodel.ResultDescription): <NEW_LINE> <INDENT> raise exceptions.ValueError('Need ... | gmxapi data handle.
Future is currently more than a Future right now. (should be corrected / clarified.)
Future is also a facade to other features of the data provider. The ``subscribe``
method allows consumers to bind as Observers.
TODO: extract the abstract class for input inspection?
Currently abstraction is handl... | 62598edba8370b77170ee931 |
class Invitation(models.Model): <NEW_LINE> <INDENT> inviter_id = models.UUIDField(db_index=True) <NEW_LINE> invitee_id = models.UUIDField(db_index=True) <NEW_LINE> phone = models.CharField(max_length=18) <NEW_LINE> relation = models.CharField(max_length=15) <NEW_LINE> message = models.CharField(max_length=200) <NEW_LIN... | 如果invitee为空(未注册或者找不到Ta),可以通过phone或者email邀请 | 62598edbbe383301e0251d19 |
class InvalidDocumentValueException(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value) | classdocs | 62598edb21bff66bcd721196 |
class IUniformTitleContainer(zope.interface.Interface): <NEW_LINE> <INDENT> _count = Int( title = u"Count", ) | The uniform title objects go into a destinct container. This
interface is the schema part of this container. | 62598edb3317a56b869bd80a |
class NbdeClientClevisError(Exception): <NEW_LINE> <INDENT> pass | The exceptions thrown by the module | 62598edb76e4537e8c3edb05 |
class arcsine_gen(rv_continuous): <NEW_LINE> <INDENT> _support_mask = rv_continuous._open_support_mask <NEW_LINE> def _pdf(self, x): <NEW_LINE> <INDENT> return 1.0/np.pi/np.sqrt(x*(1-x)) <NEW_LINE> <DEDENT> def _cdf(self, x): <NEW_LINE> <INDENT> return 2.0/np.pi*np.arcsin(np.sqrt(x)) <NEW_LINE> <DEDENT> def _ppf(self, ... | An arcsine continuous random variable.
%(before_notes)s
Notes
-----
The probability density function for `arcsine` is::
arcsine.pdf(x) = 1/(pi*sqrt(x*(1-x)))
for ``0 < x < 1``.
%(after_notes)s
%(example)s | 62598edbd99f1b3c44d03bf9 |
class TestHostlistsExpand(unittest.TestCase): <NEW_LINE> <INDENT> class base_test_expand_string_input(unittest.TestCase): <NEW_LINE> <INDENT> range_list = 'localhost' <NEW_LINE> expected_result = ['localhost'] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> result = hostlists.expand(self.range_list) <NEW_LINE> self.... | hostmap unit tests | 62598edb32920d7e50bc4571 |
class EngagementContextList(ListResource): <NEW_LINE> <INDENT> def __init__(self, version, flow_sid, engagement_sid): <NEW_LINE> <INDENT> super(EngagementContextList, self).__init__(version) <NEW_LINE> self._solution = {'flow_sid': flow_sid, 'engagement_sid': engagement_sid, } <NEW_LINE> <DEDENT> def get(self): <NEW_LI... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598edb925a0f43d25e6571 |
class InvalidConfigError(Exception): <NEW_LINE> <INDENT> pass | Class to represent an invalid configuration error. | 62598edbadb09d7d5dc08b0a |
class T411Error(Exception): <NEW_LINE> <INDENT> def __init__(self, code, message): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.code = int(code) <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Error {} : {}".format(self.code, self.message) | Representation of a T411 error. | 62598edb0a50d4780f7038eb |
class IsNotCodeRepresentableValue(CodeRepresentationError): <NEW_LINE> <INDENT> def __init__(self, value: Any): <NEW_LINE> <INDENT> super().__init__(f"Value '{value}' is not code-representable") | Error for when a value is not code-representable. | 62598edbbe8e80087fbbd590 |
class IPKANFolderTile(Schema): <NEW_LINE> <INDENT> tile_title = schema.TextLine( description=_PMF( u'The title will also be used to create identifying class on ' u'that tile', ), required=True, title=_PMF(u'Title'), ) <NEW_LINE> show_title = schema.Bool( default=True, title=_PMF(u'Show tile title'), ) <NEW_LINE> title_... | A tile that shows Gists from GitHub. | 62598edbd268445f26638e30 |
class FedoraBadgesConsumer(FedmsgConsumer): <NEW_LINE> <INDENT> def __init__(self, hub): <NEW_LINE> <INDENT> super(FedoraBadgesConsumer, self).__init__(hub) <NEW_LINE> if not getattr(self, "_initialized", False): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.badges = {} <NEW_LINE> global_settings = hub.config["ba... | The Base class for creating fedmsg consumers that issue open badges
Provides a base that does all of the heavy lifting related to issuing badges.
All the subclass needs to do is have a topic and implement consume(self, msg)
:type hub: Moksha Hub
:param hub: the moksha hub we are getting our messages from | 62598edb60cbc95b0636287f |
class BookListSerializer(serializers.ListSerializer): <NEW_LINE> <INDENT> def update(self, instance, validated_data): <NEW_LINE> <INDENT> print(instance) <NEW_LINE> print(validated_data) <NEW_LINE> for index, obj in enumerate(instance): <NEW_LINE> <INDENT> self.child.update(obj.validated_data[index]) <NEW_LINE> <DEDENT... | 使用此序列化器完成更新多个对象 | 62598edbf8510a7c17d7d41e |
class DiffySchema(Schema): <NEW_LINE> <INDENT> __envelope__ = True <NEW_LINE> def under(self, data, many=None): <NEW_LINE> <INDENT> items = [] <NEW_LINE> if many: <NEW_LINE> <INDENT> for i in data: <NEW_LINE> <INDENT> items.append({underscore(key): value for key, value in i.items()}) <NEW_LINE> <DEDENT> return items <N... | Base schema from which all diffy schema's inherit | 62598edbfbf16365ca7925e6 |
class Database: <NEW_LINE> <INDENT> def __init__(self, directory_strs): <NEW_LINE> <INDENT> self.dict_list = [] <NEW_LINE> self.directory_strs = directory_strs <NEW_LINE> self.generate_database(directory_strs) <NEW_LINE> self.sort_tracks("NORMAL") <NEW_LINE> <DEDENT> def generate_database(self, directory_strs): <NEW_LI... | A representation of the entire music library.
Args:
directory_str (str): The directory of the music folder. | 62598edb1f037a2d8b9e2649 |
class TestKapbookReset(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.driver = webdriver.Chrome() <NEW_LINE> cls.url = test_env + reset <NEW_LINE> cls.driver.maximize_window() <NEW_LINE> cls.driver.implicitly_wait(5) <NEW_LINE> cls.data_list = excel_to_list(... | Kapbook忘记密码页面 UI自动化登录 | 62598edb3539df3088eca7f6 |
class AffineCouple(Layer): <NEW_LINE> <INDENT> def __init__(self, isinverse=False, add_logdet_to_loss=True, **kwargs): <NEW_LINE> <INDENT> self.isinverse = isinverse <NEW_LINE> self.add_logdet_to_loss = add_logdet_to_loss <NEW_LINE> super(AffineCouple, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def call(self, inputs)... | 仿射耦合层
| 62598edbd6c5a102081e0674 |
class AndroidTVDevice(ADBDevice): <NEW_LINE> <INDENT> def __init__( self, aftv, name, apps, get_sources, turn_on_command, turn_off_command ): <NEW_LINE> <INDENT> super().__init__( aftv, name, apps, get_sources, turn_on_command, turn_off_command ) <NEW_LINE> self._is_volume_muted = None <NEW_LINE> self._volume_level = N... | Representation of an Android TV device. | 62598edb30bbd7224646817c |
class TestChildDog(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 testChildDog(self): <NEW_LINE> <INDENT> pass | ChildDog unit test stubs | 62598edb435de62698e9a31a |
class CustomUserPreferencesForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = CustomUserPreferences <NEW_LINE> fields = ("default_report_date",) | A form for updating user's app preferences. | 62598edb5f7d997b871f8677 |
class logarithmic(costfunction): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def cost(x, *y): <NEW_LINE> <INDENT> return -np.sum(np.log(x)) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def gradient(x, *y): <NEW_LINE> <INDENT> return -1.0/x*x.shape[1] | Logarithmic total cost | 62598edb82261d6c5272f159 |
class KolyvaginCohomologyClass(SageObject): <NEW_LINE> <INDENT> def __init__(self, kolyvagin_point, n): <NEW_LINE> <INDENT> if n is None: <NEW_LINE> <INDENT> c = kolyvagin_point.conductor() <NEW_LINE> E = kolyvagin_point.curve() <NEW_LINE> n = gcd([(p+1).gcd(E.ap(p)) for p in c.prime_divisors()]) <NEW_LINE> <DEDENT> if... | A Kolyvagin cohomology class in `H^1(K,E[n])` or `H^1(K,E)[n]`
attached to a Heegner point.
EXAMPLES::
sage: y = EllipticCurve('37a').heegner_point(-7)
sage: c = y.kolyvagin_cohomology_class(3); c
Kolyvagin cohomology class c(1) in H^1(K,E[3])
sage: type(c)
<class 'sage.schemes.elliptic_curves.hee... | 62598edbe5267d203ee69e47 |
class APIRequest: <NEW_LINE> <INDENT> def __init__(self, verify_ssl=False): <NEW_LINE> <INDENT> setting = Setting.get() <NEW_LINE> self.__url = "https://{}".format(setting.sdios_url) <NEW_LINE> self.__verify = verify_ssl <NEW_LINE> params = { "grant_type": "password", "username": setting.sdios_username, "password": set... | This class allows API calls to be made to SDI OS.
Credentials are pulled from the Setting table in the database, so
nothing needs to be passed to the constructor.
When making API calls, paths are represented without the leading
"api" and without a trailing slash. For example, to call the API
function `http://sdios/ap... | 62598edb94891a1f408b8115 |
class APIBaseHandler(BaseHandler): <NEW_LINE> <INDENT> def initialize(self): <NEW_LINE> <INDENT> self.set_header("Content-type", "application/json; charset=UTF-8") <NEW_LINE> self._session = None <NEW_LINE> self._dbsession = None <NEW_LINE> self._user = None <NEW_LINE> if self.request.headers.get("X-APP", None) is None... | This is a nice little wrapper to make it easier for classes to handle and
respond to JSON requests in the Backbone.js format. | 62598edb0fa83653e46f3431 |
class VgEventStream(VegaLiteSchema): <NEW_LINE> <INDENT> _schema = {'$ref': '#/definitions/VgEventStream'} <NEW_LINE> _rootschema = Root._schema <NEW_LINE> def __init__(self, **kwds): <NEW_LINE> <INDENT> super(VgEventStream, self).__init__(**kwds) | VgEventStream schema wrapper
Mapping(required=[]) | 62598edb4e4d56256637095e |
class FtpPublisher(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> self.ftp = ftplib.FTP(config.FTP_HOST, config.FTP_USER, config.FTP_PASSWORD) <NEW_LINE> ftp_paths = self.ftp.nlst() <NEW_LINE> for path in [path for d in config.PRODUCT_CODE.values() for path in d.values()] + [config.NOWCAST_PRODUC... | Context manager for FTP publishing. | 62598edb851cf427c66b6816 |
class GetCharTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> handle, self.filename = tempfile.mkstemp() <NEW_LINE> os.write(handle, py3k.b('a')) <NEW_LINE> os.close(handle) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> os.remove(self.filename) <NEW_LINE> <DEDENT> def test... | Test case for QIODevice.getChar in QFile | 62598edb435de62698e9a31b |
class Solution: <NEW_LINE> <INDENT> def removeElements(self, head: ListNode, val: int) -> ListNode: <NEW_LINE> <INDENT> if not head: <NEW_LINE> <INDENT> return head <NEW_LINE> <DEDENT> root = ListNode(0) <NEW_LINE> root.next = head <NEW_LINE> prev = root <NEW_LINE> current = head <NEW_LINE> while current: <NEW_LINE> <I... | 중간 노드를 삭제하는 것은 쉽다. prev node의 next에 현재 노드의 next를 대입한다
삭제할 노드가 head node이면 복잡해진다.
* sentinel node 사용하기 : 센티넬 노드는 의사head, 의사 tail, level end 마커 등으로 tree와 linked list에서 널리 쓰인다. 순전히 기능적이며 대개 어떤 데이터도 저장하지 않는다. 주된 목적은 링크드 리스트를 절대 비워두지 않고 head도 비우지 않고 삽입과 삭제를 단순화하는 것이다.
sentinel node를 listNode(0)으로 시작하고, sentinel.next = h... | 62598edb6aa9bd52df0d33f2 |
class InvalidInputArg(Error): <NEW_LINE> <INDENT> def __init__(self, message=None): <NEW_LINE> <INDENT> if message is None: <NEW_LINE> <INDENT> self.message = "Invalid input argument." <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.message = message | Raise when the user try invalid input argument | 62598edb7d43ff248742669e |
class HospitalViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = HospitalSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = Hospital.objects.all() <NEW_LINE> id = self.request.query_params.get('id', None) <NEW_LINE> if id is not None: <NEW_LINE> <INDENT> queryset = queryset... | API endpoint that allows hospitals to be viewed. | 62598edb21bff66bcd721198 |
class PostgresCheck(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.previous_env = copy.deepcopy(env) <NEW_LINE> env.verbose_output = True <NEW_LINE> env.locale = 'fr_FR.UTF-8' <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> env.clear() <NEW_LINE> env.update(self.previous_env) <NEW_... | test database | 62598edb3317a56b869bd80b |
class SincPulse(Pulse): <NEW_LINE> <INDENT> def __init__(self, length_in_symbols): <NEW_LINE> <INDENT> L = self._length_in_symbols = int(length_in_symbols) <NEW_LINE> def impulse_response(t): <NEW_LINE> <INDENT> return np.sinc(t) <NEW_LINE> <DEDENT> super().__init__(impulse_response, interval=(-L/2, L/2)) <NEW_LINE> <D... | Sinc pulse. It is a formatting pulse (:class:`FormattingPulse`) with impulse response given by
.. math::
h(t) = \operatorname{sinc}(t) = \frac{\sin(\pi t)}{\pi t}.
The sinc pulse is depicted below.
.. image:: figures/pulse_sinc.png
:alt: Sinc pulse
:align: center | 62598edb7d847024c075a916 |
class Municipality(Base, EntityMixin, InProvinceMixin): <NEW_LINE> <INDENT> __tablename__ = constants.MUNICIPALITIES_ETL_TABLE <NEW_LINE> _id_len = constants.MUNICIPALITY_ID_LEN <NEW_LINE> nombre_completo = Column(String, nullable=False) <NEW_LINE> provincia_interseccion = Column(Float, nullable=False) <NEW_LINE> lon =... | Modelo utilizado para representar departamentos.
Attributes:
__tablename__ (str): Nombre de la tabla.
_id_len (int): Longitud de los IDs.
nombre_completo (str): Nombre completo del municipio, es decir, la
categoría del municipio junto a su nombre: 'Comuna Salto Grande'.
provincia_interseccion (... | 62598edb236d856c2adc86b6 |
class NetworkError(PyLastError): <NEW_LINE> <INDENT> def __init__(self, network, underlying_error): <NEW_LINE> <INDENT> self.network = network <NEW_LINE> self.underlying_error = underlying_error <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "NetworkError: %s" % str(self.underlying_error) | Exception conveying a problem in sending a request to Last.fm | 62598edbbd1bec0571e1436e |
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Meta tag for recipe | 62598edcbaa26c4b54d4d81d |
class Extended_hypervisors(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "ExtendedHypervisors" <NEW_LINE> alias = "os-extended-hypervisors" <NEW_LINE> namespace = ("http://docs.openstack.org/compute/ext/" "extended_hypervisors/api/v1.1") <NEW_LINE> updated = "2014-01-04T00:00:00Z" | Extended hypervisors support. | 62598edc8da39b475be016ef |
class PPO(): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, lr=1e-4, gamma=0.99, epsilon_clip=0.2, epochs=20, action_std=0.5): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.lr = lr <NEW_LINE> self.gamma = gamma <NEW_LINE> self.epsilon_clip =... | Proximal Policy Optimization algorithm. | 62598edc796e427e5384ccdd |
@dataclass <NEW_LINE> class MinutPointRequiredKeysMixin: <NEW_LINE> <INDENT> precision: int | Mixin for required keys. | 62598edcdd821e528d6d748c |
class Usage(Model): <NEW_LINE> <INDENT> _validation = { 'unit': {'required': True, 'constant': True}, 'current_value': {'required': True}, 'limit': {'required': True}, 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'unit': {'key': 'unit', 'type': 'str'}, 'current_value': {'key': 'currentValue', 'type': 'lo... | Describes network resource usage.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar unit: An enum describing the unit of measurement. Default value:
"Count" .
:vartype unit: str
:param current_value: The current value of the usage.
:type current_value: long
:param limit: T... | 62598edc460517430c4309ce |
@dataclass <NEW_LINE> class TFXLNetForTokenClassificationOutput(ModelOutput): <NEW_LINE> <INDENT> loss: Optional[tf.Tensor] = None <NEW_LINE> logits: tf.Tensor = None <NEW_LINE> mems: Optional[List[tf.Tensor]] = None <NEW_LINE> hidden_states: Optional[Tuple[tf.Tensor]] = None <NEW_LINE> attentions: Optional[Tuple[tf.Te... | Output type of [`TFXLNetForTokenClassificationOutput`].
Args:
loss (`tf.Tensor` of shape `(1,)`, *optional*, returned when `labels` is provided) :
Classification loss.
logits (`tf.Tensor` of shape `(batch_size, sequence_length, config.num_labels)`):
Classification scores (before SoftMax).
m... | 62598edc379a373c97d97540 |
class DHT22Stable(metaclass=Singleton): <NEW_LINE> <INDENT> def __init__(self, gpioPortNum = 22): <NEW_LINE> <INDENT> self.gpioPortNum = gpioPortNum <NEW_LINE> self.data = {} <NEW_LINE> <DEDENT> def readData(self): <NEW_LINE> <INDENT> h,t = dht.read_retry(dht.DHT22, self.gpioPortNum) <NEW_LINE> result = {} <NEW_LINE> r... | docstring for DHT22Stable | 62598edc8c0ade5d55dc2926 |
class WatcherManager: <NEW_LINE> <INDENT> def __init__(self, page_watchers, alert_function=logging.info): <NEW_LINE> <INDENT> if page_watchers is None: <NEW_LINE> <INDENT> self.watchers = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.watchers = page_watchers <NEW_LINE> <DEDENT> self.alert = alert_function <NEW_... | Manages the running of several PageWatchers | 62598edc23849d37ff84f601 |
class InvalidDisplayName(Exception): <NEW_LINE> <INDENT> pass | The display name provided was not accepted as valid. | 62598edc30bbd7224646817f |
class Bus(Descriptor): <NEW_LINE> <INDENT> name = 'bus' <NEW_LINE> ty = pd.DataFrame | Bus Descriptor for a case | 62598edc435de62698e9a31c |
class Export_document_result(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.document = None <NEW_LINE> self.is_success = False <NEW_LINE> self.message = None <NEW_LINE> <DEDENT> def setSucess(self, document, mess): <NEW_LINE> <INDENT> self.is_success = True <NEW_LINE> self.message = mess <NEW... | Contains export result for a document. | 62598edccad5886f8bdc3845 |
class Parameter(str): <NEW_LINE> <INDENT> def __new__(cls, name, dtype=None, default=None, label=None, description="No description."): <NEW_LINE> <INDENT> obj = str.__new__(cls, name) <NEW_LINE> obj.name = name <NEW_LINE> obj.dtype = dtype <NEW_LINE> obj.default = default <NEW_LINE> obj.label = label <NEW_LINE> obj.des... | A class that stores information about a parameter. This is done by
sub-classing string, adding additional attributes. | 62598edc627d3e7fe0e053cd |
class MigrateSyncCompleteCommandOutput(Model): <NEW_LINE> <INDENT> _attribute_map = { 'errors': {'key': 'errors', 'type': '[ReportableException]'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(MigrateSyncCompleteCommandOutput, self).__init__(**kwargs) <NEW_LINE> self.errors = kwargs.get('errors'... | Output for command that completes sync migration for a database.
:param errors: List of errors that happened during the command execution
:type errors: list[~azure.mgmt.datamigration.models.ReportableException] | 62598edc44b2445a339b5c08 |
class Deliver(APIView): <NEW_LINE> <INDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> serializer = DeliveryRequestSerializer(data=request.data) <NEW_LINE> headers = util.parse_secondlife_http_headers(request.META) <NEW_LINE> if serializer.is_valid(): <NEW_LINE> <INDENT> delivery_request = serializer.sav... | Deliver an object | 62598edc5f7d997b871f8678 |
class HostMemory(models.Model): <NEW_LINE> <INDENT> host = models.ForeignKey('Host', verbose_name="所属主机",related_name="memory",on_delete=models.CASCADE) <NEW_LINE> locator = models.CharField('插槽位', max_length=32) <NEW_LINE> manufacturer = models.CharField('制造商', max_length=32, null=True, blank=True) <NEW_LINE> type = m... | 内存信息 | 62598edcac7a0e7691f70a58 |
class SmoothedValue(): <NEW_LINE> <INDENT> def __init__(self, window_size=20): <NEW_LINE> <INDENT> self.deque = deque(maxlen=window_size) <NEW_LINE> self.series = [] <NEW_LINE> self.total = 0.0 <NEW_LINE> self.count = 0 <NEW_LINE> <DEDENT> def update(self, value): <NEW_LINE> <INDENT> self.deque.append(value) <NEW_LINE>... | Track a series of values and provide access to smoothed values over a
window or the global series average. | 62598edce76e3b2f99fd6f81 |
class Meta: <NEW_LINE> <INDENT> db_table = "article" <NEW_LINE> ordering = ['-created'] | docstring for Meta | 62598edce5267d203ee69e49 |
class GetUserResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'request_id': 'str', 'took': 'float', 'expandable': 'list[str]', 'data': 'User' } <NEW_LINE> attribute_map = { 'request_id': 'requestId', 'took': 'took', 'expandable': 'expandable', 'data': 'data' } <NEW_LINE> def __init__(self, request_id=None, took=... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598edc9c8ee8231303f3fb |
class Entry(models.Model): <NEW_LINE> <INDENT> STATUS_OFFLINE = 0 <NEW_LINE> STATUS_ONLINE = 1 <NEW_LINE> STATUS_DEFAULT = STATUS_OFFLINE <NEW_LINE> STATUS_CHOICES = ( (STATUS_OFFLINE, _('Offline')), (STATUS_ONLINE, _('Online')), ) <NEW_LINE> title = models.CharField(_('title'), max_length=255) <NEW_LINE> slug = models... | A blog entry. | 62598edc7cff6e4e811b3f35 |
@with_logger <NEW_LINE> class TestPeer: <NEW_LINE> <INDENT> def __init__(self, connection, host: str, port: int, identifier: str): <NEW_LINE> <INDENT> super(TestPeer, self).__init__() <NEW_LINE> self.connection = connection <NEW_LINE> self.connectivity_state = None <NEW_LINE> self.remote_addr = (host, port) <NEW_LINE> ... | Determine the connectivity state of a single peer. | 62598edc7d43ff248742669f |
class PtpEvent(object): <NEW_LINE> <INDENT> def __init__(self, eventcode, sessionid, transactionid, params=None): <NEW_LINE> <INDENT> self.eventcode = eventcode <NEW_LINE> self.sessionid = sessionid <NEW_LINE> self.transactionid = transactionid <NEW_LINE> self.params = () if params == None else params <NEW_LINE> <DEDEN... | Class encapsulating a PTP Event. | 62598edca17c0f6771d5a7a2 |
class TranscoderDirMgrWidget(DirectoryManagerWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self._parent = parent <NEW_LINE> <DEDENT> def _processNewDirectory(self, dirpath): <NEW_LINE> <INDENT> self._parent.processDirectory(dirpath) <NEW_LINE> <DED... | The transcoder directory manager widget.
It enables to add directories to be scanned for video files. It displays
the status of the search and the number of video files found. | 62598edccc0a2c1114479549 |
class RuleContextAttribute(): <NEW_LINE> <INDENT> def __init__(self, name: str, value: str) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'RuleContextAttribute': <NEW_LINE> <INDENT> args = {} <NEW_LINE> if 'name... | An rule context attribute.
:attr str name: The attribute name.
:attr str value: The attribute value. | 62598edc9b70327d1c57d300 |
class Slice(ComputableTerm): <NEW_LINE> <INDENT> def __new__(cls, term, asset): <NEW_LINE> <INDENT> return super(Slice, cls).__new__( cls, asset=asset, inputs=[term], window_length=0, mask=term.mask, dtype=term.dtype, missing_value=term.missing_value, window_safe=term.window_safe, ndim=1, ) <NEW_LINE> <DEDENT> def __re... | Term for extracting a single column of a another term's output.
Parameters
----------
term : gateway.pipeline.term.Term
The term from which to extract a column of data.
asset : gateway.assets.Asset
The asset corresponding to the column of `term` to be extracted.
Notes
-----
Users should rarely construct insta... | 62598edc3317a56b869bd80c |
class LogCollector(object): <NEW_LINE> <INDENT> def __init__(self, definition): <NEW_LINE> <INDENT> self._definition = definition <NEW_LINE> self.max_value_len = 256 <NEW_LINE> self.max_list_items = 10 <NEW_LINE> level = self._definition.get('logLevel') <NEW_LINE> if not level or level == 'INFO': <NEW_LINE> <INDENT> se... | Captures minimal application snapshot and logs it to application log.
This is similar to CaptureCollector, but we don't need to capture local
variables, arguments and the objects tree. All we need to do is to format a
log message. We still need to evaluate watched expressions.
The actual log functions are defined glo... | 62598edc7d847024c075a917 |
class VersionInterval(object): <NEW_LINE> <INDENT> def __init__(self, interval): <NEW_LINE> <INDENT> interval_rex = r"^(\[|\()(.*?)\s*,\s*(.*?)(\]|\))$" <NEW_LINE> match = re.search(interval_rex, interval) <NEW_LINE> if match is None: <NEW_LINE> <INDENT> raise ValueError("Invaild string representation of an interval") ... | A class for a Version Interval object.
An interval is a string representation of a mathmetical like interval.
e.g: "(3,4]", "[3.10.0,)"
A verison is a version string.
Examples::
>>> verison_interval = VersionInterval("[2.10.1, 2.11.0)")
>>> verison = "2.10.16"
>>> verison in verison_interval
True
... | 62598edce5267d203ee69e4a |
class SubmodDLSCCB(SubmodBase): <NEW_LINE> <INDENT> def _evalcmd(self, arg1, r, y, d, C, NT, Tk=None): <NEW_LINE> <INDENT> assert arg1 is None <NEW_LINE> prefix = self._new_prefix() <NEW_LINE> assert isinstance(r, list) and len(r) == NT <NEW_LINE> assert isinstance(y, list) and len(y) == NT <NEW_LINE> assert isinstance... | Command for creating DLS-CC-B extended formulations. | 62598edc8da39b475be016f1 |
class ScrollingCanvas(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.canvas = canvas = tk.Canvas(self, borderwidth=0) <NEW_LINE> canvas.grid(row=0, column=0) <NEW_LINE> canvas.grid_rowconfigure(0, weight=1) <NEW_LIN... | Tk.Canvas with scrollbar. | 62598edc796e427e5384ccdf |
class CIFAR100Test(Dataset): <NEW_LINE> <INDENT> def __init__(self, path, transform=None): <NEW_LINE> <INDENT> with open(os.path.join(path, 'test'), 'rb') as cifar100: <NEW_LINE> <INDENT> self.data = pickle.load(cifar100, encoding='bytes') <NEW_LINE> <DEDENT> self.transform = transform <NEW_LINE> <DEDENT> def __len__(s... | cifar100 test dataset, derived from
torch.utils.data.DataSet | 62598edc66673b3332c2e8ee |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.