code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PaginationException(SendbeeException): <NEW_LINE> <INDENT> pass | Handle Pagination Exceptions | 6259905330dc7b76659a0d04 |
class SessionDetails: <NEW_LINE> <INDENT> __slots__ = ( 'realm', 'session', 'authid', 'authrole', 'authmethod', 'authprovider', 'authextra', ) <NEW_LINE> def __init__(self, realm, session, authid=None, authrole=None, authmethod=None, authprovider=None, authextra=None): <NEW_LINE> <INDENT> assert(isinstance(realm, strin... | Provides details for a WAMP session upon open.
.. seealso:: :func:`autobahn.wamp.interfaces.ISession.onJoin` | 625990534e4d562566373911 |
class LabPairIdx: <NEW_LINE> <INDENT> def __init__(self, master, deflist, name, **kw): <NEW_LINE> <INDENT> self.default = kw.get('default') <NEW_LINE> self.hide = kw.get('hide') <NEW_LINE> label = kw.get('label', string.upper(name[:1]) + name[1:]) <NEW_LINE> self.coord = ["", ""] <NEW_LINE> self.label = Tkinter.Label(m... | Same as LabPair, but take two values and create an x/y index. | 625990538da39b475be046f6 |
class FilterNotes(Filter): <NEW_LINE> <INDENT> def artifact_id(self, operator, artifact_id): <NEW_LINE> <INDENT> self._tql.add_filter('artifactId', operator, artifact_id, TQL.Type.INTEGER) <NEW_LINE> <DEDENT> def author(self, operator, author): <NEW_LINE> <INDENT> self._tql.add_filter('author', operator, author, TQL.Ty... | Filter Object for Notes | 625990548e71fb1e983bcfd4 |
@unique <NEW_LINE> class ControllerState(IntEnum): <NEW_LINE> <INDENT> INSTALL_WAIT = 0 <NEW_LINE> PLACEMENT = 1 <NEW_LINE> SERVICES = 2 | Names for current screen state | 62599054b57a9660fecd2f86 |
class RasaFileImporter(TrainingDataImporter): <NEW_LINE> <INDENT> def __init__( self, config_file: Optional[Text] = None, domain_path: Optional[Text] = None, training_data_paths: Optional[Union[List[Text], Text]] = None, ): <NEW_LINE> <INDENT> if config_file and os.path.exists(config_file): <NEW_LINE> <INDENT> self.con... | Default `TrainingFileImporter` implementation. | 62599054a79ad1619776b543 |
class BackendHTTPRequestHandler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def _handle_req_with_cb(self): <NEW_LINE> <INDENT> headers = self.headers <NEW_LINE> body_len = int(headers['Content-Length'] or 0) <NEW_LINE> body = self.rfile.read(body_len) <NEW_LINE> cb = self.server.backend_callback <NEW_LINE> resp_tuple ... | A wrapper for BackendHTTPServer.backend_callback.
The class simply pushes HTTP requests to the callback, and then builds
responses from data returned by the callback.
That is done for simplicity. It is easier to code a single callback function
than a whole handler class. We have to code one in every test, and we don... | 6259905463d6d428bbee3cde |
class IndexDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Index.objects.all() <NEW_LINE> serializer_class = IndexSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticatedOrReadOnly,IsUserOrReadOnly] <NEW_LINE> def perform_destroy(self, instance): <NEW_LINE> <INDENT> try: <NE... | Ce viewset fournit les actions `retrieve`,`update` et `destroy` pour les indices | 6259905426068e7796d4de53 |
class Course(models.Model): <NEW_LINE> <INDENT> pass | 课程表 | 62599054fff4ab517ebced2e |
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "sub categories" | Meta Class. | 6259905494891a1f408ba17c |
class RegisterModulePreparerPy(RegisterModulePreparerBase): <NEW_LINE> <INDENT> def prepare(self, py_b64, dest_filename=None): <NEW_LINE> <INDENT> mytempfile = self.modules["tempfile"] <NEW_LINE> myos = self.modules["os"] <NEW_LINE> mysubprocess = self.modules["subprocess"] <NEW_LINE> try: <NEW_LINE> <INDENT>... | class to register a python file by putting it in a web-accessible location | 6259905423849d37ff8525d0 |
class survey_ExportResponses(S3Method): <NEW_LINE> <INDENT> def apply_method(self, r, **attr): <NEW_LINE> <INDENT> if r.representation != "xls": <NEW_LINE> <INDENT> r.error(415, current.error.BAD_FORMAT) <NEW_LINE> <DEDENT> series_id = self.record_id <NEW_LINE> if series_id is None: <NEW_LINE> <INDENT> r.error(405, cur... | Download all responses in a Spreadsheet | 625990547d847024c075d8e7 |
class AbstractField(models.Model): <NEW_LINE> <INDENT> label = models.CharField(_("Label"), max_length=settings.LABEL_MAX_LENGTH) <NEW_LINE> slug = models.SlugField(_('Slug'), max_length=2000, blank=True, default="") <NEW_LINE> field_type = models.IntegerField(_("Type"), choices=fields.NAMES) <NEW_LINE> required = mode... | A field for a user-built form. | 6259905438b623060ffaa2d5 |
class BatchProvider(): <NEW_LINE> <INDENT> def __init__(self, X, y, indices): <NEW_LINE> <INDENT> self.X = X <NEW_LINE> self.y = y <NEW_LINE> self.indices = indices <NEW_LINE> self.unused_indices = indices.copy() <NEW_LINE> <DEDENT> def next_batch(self, batch_size, add_dummy_dimension=True): <NEW_LINE> <INDENT> if len(... | This is a helper class to conveniently access mini batches of training, testing and validation data | 6259905471ff763f4b5e8cbb |
class ConvModelAvgPool(Baseline): <NEW_LINE> <INDENT> def block(self, input_data, scope, pool_size=2, pool_strides=1, filters=16, conv_strides=1, kernel_size=3, padding='valid'): <NEW_LINE> <INDENT> with tf.variable_scope(scope): <NEW_LINE> <INDENT> h = tf.layers.conv2d(input_data, filters=filters, kernel_size=3, strid... | Sum_pool layer is an aggregation layer which returns the sum
of per-channel neighborhood values
7 layer convolutional neural network
(conv - max)*6 - conv - softmax
Inputs:
- img: Input image of size (N, 32, 32, 3)
- label: label associated with each input (N, C)
N: dataset size
C: number of classes | 62599054d99f1b3c44d06bac |
class ExperimentalPlugins(BasePluginManager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super(ExperimentalPlugins, self).get_queryset().filter(pluginversion__approved=True, pluginversion__experimental=True).distinct() | Shows only public plugins: i.e. those with "approved" flag set
and with one "experimental" version | 62599054d53ae8145f91996f |
class ItemsPlugin(BasePluginUI): <NEW_LINE> <INDENT> tool_name = 'Item Types' <NEW_LINE> description = 'Helps handle data that is of a certain type.' <NEW_LINE> category = Category.Core <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> super(ItemsPlugin, self).__init__(*args) <NEW_LINE> self.item_types_object =... | For augmentation purposes, we use a plugin to help with item types. | 62599054f7d966606f74933e |
class StalledEvent(Event): <NEW_LINE> <INDENT> pass | An stalled event is dispatched from the session manager when an FSM has stuck
to a non-terminal state for longer than expected time. | 62599054b5575c28eb713752 |
class RpcServiceMock(object): <NEW_LINE> <INDENT> def __init__(self, worker_instance): <NEW_LINE> <INDENT> self.worker = worker_instance <NEW_LINE> self._request = _RequestMock(worker_instance) <NEW_LINE> <DEDENT> def get_worker_info(self): <NEW_LINE> <INDENT> return worker.get_worker_info(self._request) <NEW_LINE> <DE... | RpcServiceMock implements all XML-RPC methods. | 62599054d486a94d0ba2d4d5 |
class Slug(PolymorphicModel): <NEW_LINE> <INDENT> slug = models.SlugField(max_length=200, unique=True, db_index=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return u'%s %s' % (self.__class__.__name__, self.slug.replace('-',' ').title()) | Core namespace of assets and contents. A kludge to avoid content types. | 6259905463d6d428bbee3ce0 |
class TestSceneNodeBasic_Box_and_Sphere(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.scale_factor = 4 <NEW_LINE> self.scale = np.ones((1, 3)).flatten() * self.scale_factor <NEW_LINE> self.center = [0, 0, -5] <NEW_LINE> self.radius = 0.5 <NEW_LINE> self.scaled_radius = self.radius * ... | Add an ellipse by scaling a sphere of radius 1 along y by a factor of 10 and check if the ellipse
intersection for radius 2 holds on y axis. | 6259905423e79379d538da09 |
class MoneyField(models.DecimalField): <NEW_LINE> <INDENT> def __init__(self, verbose_name=None, name=None, max_digits=28, decimal_places=18, **kwargs): <NEW_LINE> <INDENT> super(MoneyField, self).__init__(verbose_name, name, max_digits, decimal_places, **kwargs) | Decimal Field with hardcoded precision of 28 and a scale of 18.
Usage:
from decimal import Decimal
field_name = MoneyField(default=Decimal(0)) | 6259905482261d6c52730950 |
class ReportCriteriaForm(forms.Form): <NEW_LINE> <INDENT> error_css_class = 'text-error' <NEW_LINE> endtime = forms.SplitDateTimeField(label='Report End Time', input_time_formats=['%I:%M %p'], input_date_formats=['%m/%d/%Y'], widget=ReportSplitDateTimeWidget) <NEW_LINE> duration = forms.ChoiceField(choices=zip(DURATION... | Base Form for Report Criteria
| 6259905494891a1f408ba17d |
class PersistentExternalizableDictionary(PersistentMapping, ExternalizableDictionaryMixin): <NEW_LINE> <INDENT> def toExternalDictionary(self, *args, **kwargs): <NEW_LINE> <INDENT> result = super(PersistentExternalizableDictionary, self).toExternalDictionary(self, *args, **kwargs) <NEW_LINE> for key, value in iteritems... | Dictionary mixin that provides :meth:`toExternalDictionary` to
return a new dictionary with each value in the dict having been
externalized with :func:`~.toExternalObject`.
.. versionchanged:: 1.0
No longer extends :class:`nti.zodb.persistentproperty.PersistentPropertyHolder`.
If you have subclasses that use w... | 625990546e29344779b01b57 |
class Field(Resource): <NEW_LINE> <INDENT> pass | A simple field to retrieve from a value by using its filters. | 6259905415baa723494634a0 |
class GuestUser(object): <NEW_LINE> <INDENT> preferences = dict() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.id = 0 <NEW_LINE> self.username = "guest" <NEW_LINE> self.display_name = "guest" <NEW_LINE> self.role = Role.get_by_name('Guest') <NEW_LINE> self.is_guest = True <NEW_LINE> <DEDENT> def __nonzero__(... | Dummy object for not-logged-in users | 62599054435de62698e9d311 |
class TextPosition(Position): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> Position.__init__(self) <NEW_LINE> self.pos = 0 <NEW_LINE> self.text = text <NEW_LINE> self.checkbytemark() <NEW_LINE> <DEDENT> def skip(self, string): <NEW_LINE> <INDENT> self.pos += len(string) <NEW_LINE> <DEDENT> def iden... | A parse position based on a raw text. | 625990547b25080760ed8766 |
class EventFileLoggingApplication(EventStoringApplication): <NEW_LINE> <INDENT> def __init__(self, broker, output_file=None, **kwargs): <NEW_LINE> <INDENT> super(EventFileLoggingApplication, self).__init__(broker, **kwargs) <NEW_LINE> if output_file: <NEW_LINE> <INDENT> self.output_file = output_file <NEW_LINE> <DEDENT... | This Application outputs all of its received events that it subscribed to into a JSON file when it stops.
Mainly intended for testing.
WARNING: if you let this Application run for a very long time, you'll end up with a huge list of sunk events that may
cause memory problems | 625990544e4d562566373916 |
class ValidNode(n.LiteralNode): <NEW_LINE> <INDENT> validators = dict(a=float, b=int) | ValidNode test implementation. | 625990542ae34c7f260ac5f5 |
class FavouriteDeleteAPIView(APIView): <NEW_LINE> <INDENT> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return Favourite.objects.get(pk=pk) <NEW_LINE> <DEDENT> except Favourite.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> <DEDENT> def get(self, request, pk, format=None):... | Retrieve, update or delete a favourite instance. | 6259905407f4c71912bb0948 |
class ElementRemovalError(UserActionError): <NEW_LINE> <INDENT> message = "error removing element" | Element removal failed.
| 6259905407f4c71912bb0949 |
class ReadonlyAdmin(EtcAdmin): <NEW_LINE> <INDENT> view_on_site: bool = False <NEW_LINE> actions = None <NEW_LINE> def has_add_permission(self, request: HttpRequest) -> bool: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def has_delete_permission(self, request: HttpRequest, obj: models.Model = None) -> bool: <NE... | Read-only etc admin base class. | 62599054b57a9660fecd2f8a |
class Graph(): <NEW_LINE> <INDENT> def __init__(self, alist): <NEW_LINE> <INDENT> self.adj_lists = {} <NEW_LINE> for l in alist: <NEW_LINE> <INDENT> nid = l[NID] <NEW_LINE> if nid not in self.adj_lists: <NEW_LINE> <INDENT> self.adj_lists[nid] = [] <NEW_LINE> <DEDENT> self.adj_lists[nid].append(Node(nid)) <NEW_LINE> for... | The graph structure, here an adjacency list. | 625990548e71fb1e983bcfd9 |
class DescribeRiskSyscallEventsExportResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DownloadUrl = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.DownloadUrl = params.get("DownloadUrl") <NEW_LINE> self.RequestI... | DescribeRiskSyscallEventsExport返回参数结构体
| 625990540c0af96317c577e7 |
class MonitoringManager(ResourceDetector): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MonitoringManager, self).__init__("monitoring") <NEW_LINE> self.config = ConfParser("ro.conf") <NEW_LINE> self.monitoring_section = self.config.get("monitoring") <NEW_LINE> self.protocol = self.monitoring_sectio... | Periodically communicates both physical and slice data to the MS. | 62599054379a373c97d9a534 |
class CpuIowaitPercent(ComputeMetricsNotificationBase): <NEW_LINE> <INDENT> metric = 'cpu.iowait.percent' <NEW_LINE> unit = '%' <NEW_LINE> sample_type = sample.TYPE_GAUGE, | Handle CPU I/O wait percentage message. | 6259905463d6d428bbee3ce2 |
class JSONAPIResourceIdentifierSerializer(JSONAPIPrimaryDataSerializer): <NEW_LINE> <INDENT> primary = False <NEW_LINE> exclude_parameterized = True <NEW_LINE> def to_internal_value(self, data): <NEW_LINE> <INDENT> value = super( JSONAPIResourceIdentifierSerializer, self).to_internal_value(data) <NEW_LINE> id_field = l... | Common serializer support for JSON API objects with resource identifiers. | 62599054596a897236129037 |
class PositionalEncoding(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_model, dropout=0, max_len=5000): <NEW_LINE> <INDENT> super(PositionalEncoding, self).__init__() <NEW_LINE> self.dropout = nn.Dropout(p=dropout) <NEW_LINE> pe = torch.zeros(max_len, d_model) <NEW_LINE> position = torch.arange(0, max_len).unsqu... | Add position information to input tensor.
:Examples:
>>> m = PositionalEncoding(d_model=6, max_len=10, dropout=0)
>>> input = torch.randn(3, 10, 6)
>>> output = m(input) | 625990547cff6e4e811b6f50 |
class open_app_from_settings(parent_ui_steps.open_app_from_settings): <NEW_LINE> <INDENT> pass | description:
opens an app/activity ideintified by <view_to_find> from
settings page
if <view_to_check> given it will check that
the object identified by <view_to_check>:
- appeared if <view_presence> is True
- disappeared if <view_presence> is False
usage:
ui_steps.open_... | 62599054a17c0f6771d5d629 |
class PulseCounter(object): <NEW_LINE> <INDENT> def __init__(self, rcpod): <NEW_LINE> <INDENT> self.rcpod = rcpod <NEW_LINE> self.numSamples = 0 <NEW_LINE> <DEDENT> def sample(self, duration, prescale=0): <NEW_LINE> <INDENT> timer_off = 0x06 | (prescale << 4) <NEW_LINE> timer_on = timer_off | 0x01 <NEW_LINE> self.rcpod... | A counter for pulses arriving on RC0 / T1CKI | 62599054435de62698e9d313 |
class RunCases: <NEW_LINE> <INDENT> def __init__(self, device, port): <NEW_LINE> <INDENT> self.test_report_root = '.\\TestReport' <NEW_LINE> self.device = device <NEW_LINE> self.port = port <NEW_LINE> if not os.path.exists(self.test_report_root): <NEW_LINE> <INDENT> os.mkdir(self.test_report_root) <NEW_LINE> <DEDENT> d... | 设置了每个设备UI自动化时设备信息、macaca server端口、存放测试报告/日志/截图的路径 | 625990547b25080760ed8767 |
class DB_step(models.Model): <NEW_LINE> <INDENT> Case_id = models.CharField(max_length=10, null=True) <NEW_LINE> name = models.CharField(max_length=50, null=True) <NEW_LINE> index = models.IntegerField(null=True) <NEW_LINE> api_method = models.CharField(max_length=10, null=True) <NEW_LINE> api_url = models.CharField(ma... | 小用例表 | 6259905430dc7b76659a0d07 |
class WordsCollection(Iterable): <NEW_LINE> <INDENT> def __init__(self, collection: List[Any] = []) -> None: <NEW_LINE> <INDENT> self._collection = collection <NEW_LINE> <DEDENT> def __iter__(self) -> AlphabeticalOrderIterator: <NEW_LINE> <INDENT> return AlphabeticalOrderIterator(self._collection) <NEW_LINE> <DEDENT> d... | EN: Concrete Collections provide one or several methods for retrieving fresh
iterator instances, compatible with the collection class.
RU: Конкретные Коллекции предоставляют один или несколько методов для
получения новых экземпляров итератора, совместимых с классом коллекции. | 625990548e71fb1e983bcfda |
class Rack: <NEW_LINE> <INDENT> def __init__(self, bagtiles): <NEW_LINE> <INDENT> self.racktiles = rand.sample(bagtiles, 7) <NEW_LINE> self.solution = self.__findsolution__() <NEW_LINE> <DEDENT> def __findsubsets__(self, tiles): <NEW_LINE> <INDENT> sortrack = "".join(sorted(tiles)) <NEW_LINE> alphabet = ["A", "B", "C",... | Constitutes one seven-letter draw from scrabble tiles and has all the corresponding anagram solutions. | 62599054b57a9660fecd2f8c |
class QQAuthUserView(APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> code = request.query_params.get('code') <NEW_LINE> if not code: <NEW_LINE> <INDENT> return Response({'message': '缺少code'}, status=status.HTTP_400_BAD_REQUEST) <NEW_LINE> <DEDENT> oauthqq = OAuthQQ(client_id=settings.QQ_CLIENT... | 扫码成功后回调处理 | 62599054e76e3b2f99fd9f0f |
class While(AST): <NEW_LINE> <INDENT> def __init__(self, condition, token, block): <NEW_LINE> <INDENT> self.block = block <NEW_LINE> self.token = token <NEW_LINE> self.condition = condition | The while statement. | 62599054cad5886f8bdc5b09 |
class AS2Error(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, *args, **kwargs): <NEW_LINE> <INDENT> self.msg = safe_unicode(msg) <NEW_LINE> if args: <NEW_LINE> <INDENT> if isinstance(args[0], dict): <NEW_LINE> <INDENT> xxx = args[0] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> xxx = {} <NEW_LINE> <DEDENT> <DE... | formats the error messages. Under all circumstances: give (reasonable) output, no errors.
input (msg,*args,**kwargs) can be anything: strings (any charset), unicode, objects.
Note that these are errors, so input can be 'not valid'!
to avoid the risk of 'errors during errors' catch-all solutions are used.
2 ways to rais... | 62599054fff4ab517ebced34 |
class RefreshApiToken(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> token = Token.objects.get(user=request.user) <NEW_LINE> token.delete() <NEW_LINE> Token.objects.get_or_create(user=request.user) <NEW_LINE> <DEDENT> except Exception as err: <NEW_LI... | delete current user API (auth) token and create a new one | 62599054be383301e0254d15 |
class UserViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer | 此viewset默认提供list和detail方法 | 62599054e64d504609df9e59 |
class DegreeRegistrationForm(models.Model): <NEW_LINE> <INDENT> enrolled_degree = models.OneToOneField("EnrolledDegreeCourse") <NEW_LINE> current_company = models.CharField(max_length=64, ) <NEW_LINE> current_position = models.CharField(max_length=64, ) <NEW_LINE> current_salary = models.IntegerField() <NEW_LINE> work_... | 学位课程报名表 | 62599054507cdc57c63a62b7 |
class FileModel: <NEW_LINE> <INDENT> def __init__(self, path, name): <NEW_LINE> <INDENT> self.path = path_helpers.ensure_trailing_slash(path) <NEW_LINE> self.name = name <NEW_LINE> full_path = path_helpers.join_paths([path, name]) <NEW_LINE> base_path = conf.BaseConfig.FILES_BASE_PATH <NEW_LINE> if conf.BaseConfig.VIRT... | Represents a file, will track size, file type ect | 62599054adb09d7d5dc0ba7d |
class Operator(object): <NEW_LINE> <INDENT> def __init__(self, name, version, cmd_cmpl, cmd_run, extensions): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.version = version <NEW_LINE> self.cmd_cmpl = cmd_cmpl <NEW_LINE> self.cmd_run = cmd_run <NEW_LINE> self.extensions = frozenset(extensions) <NEW_LINE> <DEDENT... | Represents an operator which can be used to compile and run programs.
Note: When passing file extensions to this class, they must have a leading
`.` character (no backticks).
Note: When passing compiler/interpreter commands to this class, make sure
that they will be able to execute on your system!
Args:
... | 62599054d7e4931a7ef3d590 |
class Server: <NEW_LINE> <INDENT> def __init__(self, lean_exec_path, lean_path): <NEW_LINE> <INDENT> self.proc = subprocess.Popen([lean_exec_path, "-j0", "--server"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True, bufsize=1, env={'LEAN_PATH': lean_path}) <NEW_LINE> self.seq_num = 0 <NEW_LINE> <... | Very rough interface around the Lean server. Will work only if nothing bad
happens/ | 6259905499cbb53fe68323fd |
class StateValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> UNKNOWN = 0 <NEW_LINE> CREATING = 1 <NEW_LINE> RUNNING = 2 <NEW_LINE> ERROR = 3 <NEW_LINE> DELETING = 4 <NEW_LINE> UPDATING = 5 | Output only. The cluster's state.
Values:
UNKNOWN: The cluster state is unknown.
CREATING: The cluster is being created and set up. It is not ready for
use.
RUNNING: The cluster is currently running and healthy. It is ready for
use.
ERROR: The cluster encountered an error. It is not ready for use.
DE... | 6259905407f4c71912bb094d |
class Arguments: <NEW_LINE> <INDENT> linkID = graphene.Int() | Corpo da requisição | 62599054be8e80087fbc0594 |
class RemoveUserFromCohortTestCase(CohortViewsTestCase): <NEW_LINE> <INDENT> def request_remove_user_from_cohort(self, username, cohort): <NEW_LINE> <INDENT> if username is not None: <NEW_LINE> <INDENT> request = RequestFactory().post("dummy_url", {"username": username}) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> re... | Tests the `remove_user_from_cohort` view. | 62599054e76e3b2f99fd9f11 |
class SaveError(Error): <NEW_LINE> <INDENT> pass | An attempt to save a page with changed interwiki has failed. | 625990543c8af77a43b689c9 |
class DahuaEventThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, hass: HomeAssistant, client: DahuaClient, on_receive, events: list, channel: int): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.hass = hass <NEW_LINE> self.stopped = threading.Event() <NEW_LINE> self.on_receive = on_... | Connects to device and subscribes to events. Mainly to capture motion detection events. | 625990540c0af96317c577e9 |
class _CommandFemElementFluid1D(CommandManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_CommandFemElementFluid1D, self).__init__() <NEW_LINE> self.resources = {'Pixmap': 'fem-fluid-section', 'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_ElementFluid1D", "Fluid section for 1D flow"), 'Accel': "C,... | The FEM_ElementFluid1D command definition | 62599054379a373c97d9a537 |
class IMappingZone(components.Interface): <NEW_LINE> <INDENT> pass | A zone which consists of a map of domain names to record information.
@type records: mapping
@ivar records: An object mapping lower-cased domain names to lists of
L{twisted.protocols.dns.IRecord} objects. | 62599054379a373c97d9a538 |
class Contact(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> name = models.CharField(max_length=30) <NEW_LINE> phone_regex = RegexValidator( regex=r'\+?1?\d{9,15}$', message="Phone number must be entered in the format: +999999999. Up to 15 digits allowed." ) <NEW_... | Contact model. | 62599054baa26c4b54d507b6 |
class LinkRsData(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'LinkRsData' <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> resource_set_id = db.Column(db.Integer, db.ForeignKey('ResourceSet.id'), nullable=False) <NEW_LINE> categories_id = db.Column(db.Integer, db.... | Link resource set with categories | 62599054fff4ab517ebced36 |
class PreviewFile(db.Model, BaseMixin, SerializerMixin): <NEW_LINE> <INDENT> name = db.Column(db.String(250)) <NEW_LINE> original_name = db.Column(db.String(250)) <NEW_LINE> revision = db.Column(db.Integer(), default=1) <NEW_LINE> position = db.Column(db.Integer(), default=1) <NEW_LINE> extension = db.Column(db.String(... | Describes a file which is aimed at being reviewed. It is not a publication
neither a working file. | 625990543eb6a72ae038bb73 |
class sshConnecter(sshBaseConnecter): <NEW_LINE> <INDENT> def __init__(self,ip,userName,passWord): <NEW_LINE> <INDENT> super().__init__(ip,userName,passWord) <NEW_LINE> self.sh=paramiko.SSHClient() <NEW_LINE> <DEDENT> def ssh_get_connect(self,retryList): <NEW_LINE> <INDENT> self.sh.set_missing_host_key_policy(paramiko.... | 建立连接,并完成一系列操作 | 6259905494891a1f408ba180 |
class Vault(Backend): <NEW_LINE> <INDENT> _client = None <NEW_LINE> config_defaults = { 'vault_url': 'http://localhost:8200', } <NEW_LINE> def __init__(self, name: str, backend_config: dict, *args, **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> config = {**self.config_defaults, **backend_config} <NEW_LINE> ... | Only KV2 is currently supported, token auth only. | 62599054adb09d7d5dc0ba7f |
class COORD(Structure): <NEW_LINE> <INDENT> _fields_ = [ ("x", short), ("y", short) ] | XY coordinate structure from "wincon.h" | 6259905410dbd63aa1c720f6 |
class KeyboardConstants(Constants): <NEW_LINE> <INDENT> _virtualKeyCodes=VirtualKeyCodes() <NEW_LINE> if sys.platform == 'win32': <NEW_LINE> <INDENT> _asciiKeyCodes=AsciiConstants() <NEW_LINE> <DEDENT> if sys.platform == 'darwin': <NEW_LINE> <INDENT> _unicodeChars=UnicodeChars() <NEW_LINE> _ansiKeyCodes=AnsiKeyCodes() ... | Stores internal windows hook constants including hook types, mappings from virtual
keycode name to value and value to name, and event type value to name. | 6259905471ff763f4b5e8cc3 |
class SearchLanguageSetting(EnumStringSetting): <NEW_LINE> <INDENT> def parse(self, data): <NEW_LINE> <INDENT> if data not in self.choices and data != self.value: <NEW_LINE> <INDENT> data = str(data).replace('_', '-') <NEW_LINE> lang = data.split('-')[0] <NEW_LINE> if data in self.choices: <NEW_LINE> <INDENT> pass <NEW... | Available choices may change, so user's value may not be in choices anymore | 625990548da39b475be04700 |
class HuffmanNode(object): <NEW_LINE> <INDENT> __slots__ = ['l', 'r'] <NEW_LINE> def __init__(self, l, r): <NEW_LINE> <INDENT> self.l = l <NEW_LINE> self.r = r <NEW_LINE> <DEDENT> def __getitem__(self, b): <NEW_LINE> <INDENT> return self.r if b else self.l <NEW_LINE> <DEDENT> def __setitem__(self, b, val): <NEW_LINE> <... | HuffmanNode is an entry of the binary tree used for encoding/decoding
HPack compressed HTTP/2 headers | 62599054f7d966606f749342 |
class EisensteinExtensionFieldCappedRelative(EisensteinExtensionGeneric, pAdicCappedRelativeFieldGeneric): <NEW_LINE> <INDENT> def __init__(self, prepoly, poly, prec, halt, print_mode, shift_seed, names, implementation='NTL'): <NEW_LINE> <INDENT> unram_prec = (prec + poly.degree() - 1) // poly.degree() <NEW_LINE> ntl_p... | TESTS::
sage: R = Qp(3, 10000, print_pos=False); S.<x> = ZZ[]; f = x^3 + 9*x - 3
sage: W.<w> = R.ext(f); W == loads(dumps(W))
True | 625990542ae34c7f260ac5fb |
class AddClass(View): <NEW_LINE> <INDENT> def get(self, request, pk): <NEW_LINE> <INDENT> _class = Class.objects.get(pk=pk) <NEW_LINE> new_student = Student(user=request.user, name_of_class=_class.name) <NEW_LINE> new_student.save() <NEW_LINE> _class.students.add(new_student) <NEW_LINE> schedule = Schedule.objects.get(... | Allow a student to enroll in a class | 625990544e4d56256637391c |
class _SystemHealthStorySet(story.StorySet): <NEW_LINE> <INDENT> PLATFORM = NotImplemented <NEW_LINE> def __init__(self, take_memory_measurement=True): <NEW_LINE> <INDENT> super(_SystemHealthStorySet, self).__init__( archive_data_file=('../data/memory_system_health_%s.json' % self.PLATFORM), cloud_storage_bucket=story.... | User stories for the System Health Plan.
See https://goo.gl/Jek2NL. | 62599054097d151d1a2c2587 |
class Version(Model): <NEW_LINE> <INDENT> def __init__(self, api=None, insite=None): <NEW_LINE> <INDENT> self.openapi_types = { 'api': str, 'insite': str } <NEW_LINE> self.attribute_map = { 'api': 'api', 'insite': 'insite' } <NEW_LINE> self._api = api <NEW_LINE> self._insite = insite <NEW_LINE> <DEDENT> @classmethod <N... | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually. | 62599054b5575c28eb713756 |
@command(project_cmds) <NEW_LINE> class project_terminate(_ProjectAction): <NEW_LINE> <INDENT> action = 'terminate' | Terminate a project (special privileges needed) | 6259905476e4537e8c3f0aa0 |
class LearningRateScheduler(TrainingCallback): <NEW_LINE> <INDENT> def __init__(self, learning_rates): <NEW_LINE> <INDENT> assert callable(learning_rates) or isinstance(learning_rates, collections.abc.Sequence) <NEW_LINE> if callable(learning_rates): <NEW_LINE> <INDENT> self.learning_rates = learning_rates <... | Callback function for scheduling learning rate.
.. versionadded:: 1.3.0
Parameters
----------
learning_rates : callable/collections.Sequence
If it's a callable object, then it should accept an integer parameter
`epoch` and returns the corresponding learning rate. Otherwise it
should be a sequence like l... | 625990540a50d4780f706849 |
class ContinuedFraction_real(ContinuedFraction_base): <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> ContinuedFraction_base.__init__(self) <NEW_LINE> self._x0 = x <NEW_LINE> from .real_mpfi import RealIntervalField <NEW_LINE> self._xa = RealIntervalField(53)(self._x0) <NEW_LINE> self._quotients = [] <NE... | Continued fraction of a real (exact) number.
This class simply wraps a real number into an attribute (that can be
accessed through the method :meth:`value`). The number is assumed to be
irrational.
EXAMPLES::
sage: cf = continued_fraction(pi)
sage: cf
[3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, ... | 62599054596a89723612903a |
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 | 62599054e5267d203ee6ce04 |
class DataService(): <NEW_LINE> <INDENT> def __init__(self, conf_path): <NEW_LINE> <INDENT> self.__client = MongoClient(HOST, PORT) <NEW_LINE> self.conf = Configuration() <NEW_LINE> self.base_conf = self.conf.read_configuration(conf_path) <NEW_LINE> <DEDENT> def getConfigJson(self): <NEW_LINE> <INDENT> return self.base... | The function collection to query data from the Database | 625990548e7ae83300eea5ad |
class Account(rlp.Serializable): <NEW_LINE> <INDENT> fields = [ ('nonce', big_endian_int), ('balance', big_endian_int), ('storage_root', trie_root), ('code_hash', hash32) ] <NEW_LINE> def __init__(self, nonce: int=0, balance: int=0, storage_root: bytes=BLANK_ROOT_HASH, code_hash: bytes=EMPTY_SHA3, **kwargs: Any) -> Non... | RLP object for accounts. | 6259905482261d6c52730954 |
class _DatabaseFixtures(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prescribing = [ { "month": str(p.processing_date), "practice": p.practice_id, "bnf_code": p.presentation_code, "items": p.total_items, "quantity": p.quantity, "net_cost": p.net_cost or 0, "actual_cost": p.actual_cost, "bnf... | Presents the same attributes as a DataFactory instance but with data read
from the database (where it was presumably loaded from test fixtures),
rather than randomly generated. | 625990544e696a045264e8ad |
class AlertPage(BasePage): <NEW_LINE> <INDENT> top_logo_frame_locator = (By.NAME, "TopLogo") <NEW_LINE> exit_button_locator = (By.ID, "mtLogout") <NEW_LINE> header_frame_locator = (By.NAME, "Header") <NEW_LINE> def switch_to_alert(self): <NEW_LINE> <INDENT> self.switch_to_window() <NEW_LINE> self.accept_ssl_certificate... | Contains Alert UI page locators
Switch to alert function
Get alert page title function
Close alert page function
Click exit button function | 62599054d7e4931a7ef3d594 |
class DefaultInsertionMarker(QGraphicsItem): <NEW_LINE> <INDENT> COLOR = QColor(70, 70, 70) <NEW_LINE> def boundingRect(self): <NEW_LINE> <INDENT> return QRectF(0, 0, 400, 15) <NEW_LINE> <DEDENT> def paint(self, painter, option, widget=None): <NEW_LINE> <INDENT> painter.fillRect(self.boundingRect(), self.COLOR) | Simple rectangle to act like a maker on the insertion effect. | 62599054cb5e8a47e493cc12 |
class Label(object): <NEW_LINE> <INDENT> def __init__(self, pos=-1, lx=-1, ly=-1, text=""): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.lx = lx <NEW_LINE> self.ly = ly <NEW_LINE> self.text = text | Auxiliary class. Just holds information about a label in :class:`RulerCtrl`. | 62599054a17c0f6771d5d62c |
class Learner(IRC.Bot): <NEW_LINE> <INDENT> def __init__(self, parent, target, username, server): <NEW_LINE> <INDENT> IRC.Bot.__init__(self, parent, target, username, server) <NEW_LINE> <DEDENT> def user_pubmsg(self, message): <NEW_LINE> <INDENT> if message.content != "!stop_learning": <NEW_LINE> <INDENT> if not messag... | learning class for bot (mostly troll) | 62599054b7558d58954649b5 |
class ResnetGenerator(nn.Module): <NEW_LINE> <INDENT> def __init__( self, input_nc, output_nc, ngf=64, norm_layer=nn.BatchNorm3d, use_dropout=False, n_blocks=6, padding_type="reflect", ): <NEW_LINE> <INDENT> assert n_blocks >= 0 <NEW_LINE> super(ResnetGenerator, self).__init__() <NEW_LINE> if type(norm_layer) == functo... | Resnet-based generator that consists of Resnet blocks between a few
downsampling/upsampling operations.
We adapt Torch code and idea from Justin Johnson's neural style transfer
project(https://github.com/jcjohnson/fast-neural-style) | 625990547d847024c075d8f1 |
class ArticleList(models.Model): <NEW_LINE> <INDENT> article_id = models.CharField('ID', primary_key=True, max_length=100) <NEW_LINE> article_title = models.CharField('文章标题', max_length=100) <NEW_LINE> article_url = models.URLField('文章URL') <NEW_LINE> article_user = models.CharField('作者', max_length=100) <NEW_LINE> art... | 文章概要信息 | 62599054dc8b845886d54ada |
class Heroes(AbstractResponse): <NEW_LINE> <INDENT> def parse_response(self): <NEW_LINE> <INDENT> self.assign_subkey('result') <NEW_LINE> self['heroes'] = [LocalizedHero(h) for h in self.get('heroes', [])] | :any:`get_heroes` response object
Attributes
----------
heroes : list(LocalizedHero)
List of localized hero information
count : int
Number of heroes returned | 6259905476d4e153a661dd06 |
class LogFormatter(object): <NEW_LINE> <INDENT> def crawled(self, request, response, spider): <NEW_LINE> <INDENT> flags = ' %s' % str(response.flags) if response.flags else '' <NEW_LINE> return { 'format': CRAWLEDFMT, 'status': response.status, 'request': request, 'referer': request.headers.get('Referer'), 'flags': fla... | Class for generating log messages for different actions. All methods
must return a plain string which doesn't include the log level or the
timestamp | 625990543539df3088ecd7bc |
class MovieReview: <NEW_LINE> <INDENT> def __init__(self, title=None, year=None, text=None, publication_date=None): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.year = year <NEW_LINE> self.text = text <NEW_LINE> self.publication_date=publication_date <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_review_... | Class representing a movie review.
Attributes:
title: String representing the title of movie reviewed.
year: Integer representing the release year of the movie.
text: String containing summary of movie review.
publication_date: String representing date review was published. | 6259905499cbb53fe6832401 |
class MongoDebugPanel(DebugPanel): <NEW_LINE> <INDENT> name = 'MongoDB' <NEW_LINE> has_content = True <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(MongoDebugPanel, self).__init__(*args, **kwargs) <NEW_LINE> self.jinja_env.loader = ChoiceLoader([self.jinja_env.loader, PackageLoader('flask.ex... | Panel that shows information about MongoDB operations (including stack)
Adapted from https://github.com/hmarr/django-debug-toolbar-mongo | 62599054adb09d7d5dc0ba81 |
class Database: <NEW_LINE> <INDENT> @contextmanager <NEW_LINE> def cursor(self) -> Generator[Cursor, None, None]: <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def result(self, cursor: Cursor) -> Result: <NEW_LINE> <INDENT> raise NotImplementedError | Common facade for get DB services. | 625990544e4d56256637391d |
class Widget(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QWidget.__init__(self, parent) <NEW_LINE> l=QVBoxLayout(self) <NEW_LINE> self._tm=TableModel(self) <NEW_LINE> self._tv=TableView(self) <NEW_LINE> self._tv.setShowGrid(False) <NEW_LINE> self._tv.setAlternatingRowColors(True) ... | A simple test widget to contain and own the model and table. | 62599054d99f1b3c44d06bb6 |
class ExcerptTranslationInlineForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ExcerptTranslation <NEW_LINE> exclude = [] | Formulaire inline des extraits | 625990548a43f66fc4bf36a3 |
class Dictionary: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._root = {} <NEW_LINE> self._end = "_end" <NEW_LINE> <DEDENT> def _getLastNode(self, prefix): <NEW_LINE> <INDENT> prefix = prefix.lower() <NEW_LINE> cur_dict = self._root <NEW_LINE> for letter in prefix: <NEW_LINE> <INDENT> if letter in c... | Implementation of a Dictionary using trie. Not case-sensitive. | 625990544e4d56256637391e |
class OwnerContextAdapter: <NEW_LINE> <INDENT> def __init__(self, owner): <NEW_LINE> <INDENT> self._owner = owner <NEW_LINE> self._owned_name = getattr(owner, "_owned_name", repr(owner)) <NEW_LINE> display_name = getattr(self, "_owned_name", type(self).__name__) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDE... | transform calls to __enter__ -> open and __exit__ -> close.
each will be called | 62599054009cb60464d02a56 |
class BgColorTool (ColorTool): <NEW_LINE> <INDENT> def __init__(self, width, height, default): <NEW_LINE> <INDENT> self.icon = ColorTextImage(width, height, False, True) <NEW_LINE> self.icon.set_bg_color(default) <NEW_LINE> ColorTool.__init__(self, self.icon, default) <NEW_LINE> <DEDENT> def on_set_color(self, menu, co... | ToolItem for choosing the backgroundground color | 62599054cad5886f8bdc5b0c |
class ExampleGroupWithPromotes(Group): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ExampleGroupWithPromotes, self).__init__() <NEW_LINE> self.G2 = self.add('G2', Group()) <NEW_LINE> self.C1 = self.G2.add('C1', IndepVarComp('x', 5.), promotes=['x']) <NEW_LINE> self.G1 = self.G2.add('G1', Group(), p... | A nested `Group` with implicit connections for testing | 62599054dd821e528d6da3f6 |
class CreditCard: <NEW_LINE> <INDENT> def __init__(self, customer, bank, acnt, limit): <NEW_LINE> <INDENT> self._customer = customer <NEW_LINE> self._bank = bank <NEW_LINE> self._account = acnt <NEW_LINE> self._limit = limit <NEW_LINE> self._balance = 0 <NEW_LINE> <DEDENT> def get_customer(self): <NEW_LINE> <INDENT> re... | A consumer credit card | 62599054a8ecb0332587272e |
class Scheduler(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def matches_share_opponents(match1, match2): <NEW_LINE> <INDENT> (match1_1, match1_2) = match1 <NEW_LINE> return (match1_1 in match2 or match1_2 in match2) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def find_unique_match(matches, rest): <NEW_LINE> ... | Base class for schedulers.
This class includes general-purpose scheduler functionality. | 6259905426068e7796d4de5f |
@dataclasses.dataclass(frozen=True) <NEW_LINE> class Frame: <NEW_LINE> <INDENT> priority: pyuavcan.transport.Priority <NEW_LINE> transfer_id: int <NEW_LINE> index: int <NEW_LINE> end_of_transfer: bool <NEW_LINE> payload: memoryview <NEW_LINE> def __post_init__(self) -> None: <NEW_LINE> <INDENT> if not isinstance(self.p... | The base class of a high-overhead-transport frame.
It is used with the common transport algorithms defined in this module.
Concrete transport implementations should make their transport-specific frame dataclasses inherit from this class.
Derived types are recommended to not override ``__repr__()``. | 62599054be383301e0254d18 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.