code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class _SectionFailError(Exception): <NEW_LINE> <INDENT> pass
General error, terminates section processing
62598fb1e5267d203ee6b967
class CaninePreTrainedModel(PreTrainedModel): <NEW_LINE> <INDENT> config_class = CanineConfig <NEW_LINE> load_tf_weights = load_tf_weights_in_canine <NEW_LINE> base_model_prefix = "canine" <NEW_LINE> supports_gradient_checkpointing = True <NEW_LINE> _keys_to_ignore_on_load_missing = [r"position_ids"] <NEW_LINE> def _in...
An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models.
62598fb126068e7796d4c9b4
class XenBusConnectionGPLPV(pyxs.connection.PacketConnection): <NEW_LINE> <INDENT> def create_transport(self): <NEW_LINE> <INDENT> return XenBusTransportGPLPV() <NEW_LINE> <DEDENT> def recv(self): <NEW_LINE> <INDENT> packet = super(XenBusConnectionGPLPV, self).recv() <NEW_LINE> if not packet.payload: <NEW_LINE> <INDENT...
A pyxs.PacketConnection which communicates with xenstore over the PCI device exposed by the GPLPV drivers on Windows. The interface of this driver is very similar to the ones on Linux (direct reads/writes to a file-like object) so we reuse most of the PacketConnection class and leave the implementation detail to the Xe...
62598fb13d592f4c4edbaf1f
class ImgOutput(Component): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> super(ImgOutput, self).__init__(options) <NEW_LINE> self.input_observer = ImgOutput.InputObserver(self) <NEW_LINE> self.__file_path = "" <NEW_LINE> self.file_path = self.properties['file_path'] <NEW_LINE> <DEDENT> @property...
Class for ImgOutput
62598fb14e4d562566372485
class LoggerManager(object): <NEW_LINE> <INDENT> def __init__(self, log_name, log_directory='.', encoding='utf-8'): <NEW_LINE> <INDENT> self.log_name = log_name <NEW_LINE> self.log_directory = os.path.abspath(log_directory) <NEW_LINE> self.encoding = encoding <NEW_LINE> self.logger = None <NEW_LINE> <DEDENT> def getLog...
Class meant to help managing outputs
62598fb14527f215b58e9f33
@union <NEW_LINE> class UnionBase: <NEW_LINE> <INDENT> pass
Docstring for UnionBase
62598fb1009cb60464d01580
class StrictAssignmentTests(SimpleTestCase): <NEW_LINE> <INDENT> def test_setattr_raises_validation_error_field_specific(self): <NEW_LINE> <INDENT> form_class = modelform_factory(model=StrictAssignmentFieldSpecific, fields=['title']) <NEW_LINE> form = form_class(data={'title': 'testing setattr'}, files=None) <NEW_LINE>...
Should a model do anything special with __setattr__() or descriptors which raise a ValidationError, a model form should catch the error (#24706).
62598fb1bf627c535bcb14fe
class MessageHandler(object): <NEW_LINE> <INDENT> outputQmlWarnings = bool(os.environ.get("MESHROOM_OUTPUT_QML_WARNINGS", False)) <NEW_LINE> logFunctions = { QtMsgType.QtDebugMsg: logging.debug, QtMsgType.QtWarningMsg: logging.warning, QtMsgType.QtInfoMsg: logging.info, QtMsgType.QtFatalMsg: logging.fatal, QtMsgType.Qt...
MessageHandler that translates Qt logs to Python logging system. Also contains and filters a list of blacklisted QML warnings that end up in the standard error even when setOutputWarningsToStandardError is set to false on the engine.
62598fb167a9b606de54602d
class GpioMotorPWM (adapter.adapters.GPIOAdapter): <NEW_LINE> <INDENT> mandatoryParameters = {'frequency': 50.0, 'speed': 0.0} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> adapter.adapters.GPIOAdapter.__init__(self) <NEW_LINE> pass <NEW_LINE> <DEDENT> def speed(self, value): <NEW_LINE> <INDENT> if debug: <NEW_LIN...
controls a motor connected to two half-H-Bridges. Input 'speed' : float, -100..0.0 .. 100.0 Configuration 'frequency': float, [Hz] Needs two GPIO port pins. uses pwm-feature of RPi.GPIO-Library.
62598fb1be7bc26dc9251e8c
class Network: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def port(): <NEW_LINE> <INDENT> if 'network' in current and 'port' in current['network']: <NEW_LINE> <INDENT> return current['network']['port'] <NEW_LINE> <DEDENT> return DEFAULT_PORT <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def ip(): <NEW_LINE> <INDENT> i...
Network configuration
62598fb130bbd722464699a8
class NotLinkedToContent(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return not PublishableContent.objects.filter(gallery__pk=view.kwargs.get('pk_gallery')).exists() <NEW_LINE> <DEDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <IND...
Custom permission to denied modification of a gallery linked to a content
62598fb14428ac0f6e658585
class StatusTests(test.TestCase): <NEW_LINE> <INDENT> def test_basic(self): <NEW_LINE> <INDENT> s = base.Status('Test status', 5, 'http://github.com/criteo/defcon', description='This is a test') <NEW_LINE> expected = { 'defcon': 5, 'title': 'Test status', 'description': 'This is a test', 'link': 'http://github.com/crit...
Test that we can build statuses.
62598fb1bd1bec0571e150f2
class TestFlaskBase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = create_app() <NEW_LINE> self.app.testing = True <NEW_LINE> self.app_context = self.app.test_request_context() <NEW_LINE> self.app_context.push() <NEW_LINE> self.client = self.app.test_client() <NEW_LINE> self.app.db.creat...
Class Base for Test.
62598fb1796e427e5384e7f4
class ServiceConfigurationError(Error): <NEW_LINE> <INDENT> pass
When service configuration is incorrect.
62598fb1851cf427c66b831b
class AllQueryCache(): <NEW_LINE> <INDENT> def __init__(self, bulk_load_callback, single_load_callback): <NEW_LINE> <INDENT> self.cache = {} <NEW_LINE> self.bulk_load_callback = bulk_load_callback <NEW_LINE> self.single_load_callback = single_load_callback <NEW_LINE> self.bulk_load() <NEW_LINE> <DEDENT> def get(self, p...
This tiny class has a trick, it bulkloads on startup and clear_all(). Neater and (depends on the efficiency of the supplied callback) maybe a lot faster. @param bulk_load_callback a value @param single_load_callback [(k,v)...]. Key is converted to int
62598fb11f5feb6acb162c7e
class Adapter: <NEW_LINE> <INDENT> def __init__(self, object, **adapted_method): <NEW_LINE> <INDENT> self._object = object <NEW_LINE> self.__dict__.update(adapted_method) <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> return getattr(self._object, attr)
This change generic method name to individualized method names
62598fb12ae34c7f260ab141
class xasyFilledShape(xasyShape): <NEW_LINE> <INDENT> def __init__(self, path, asyengine, pen = None, transform = identity()): <NEW_LINE> <INDENT> if path.nodeSet[-1] != 'cycle': <NEW_LINE> <INDENT> raise Exception("Filled paths must be cyclic") <NEW_LINE> <DEDENT> super().__init__(path, asyengine, pen, transform) <NEW...
A filled shape drawn on the GUI
62598fb1d7e4931a7ef3c0f4
class Polygon(Area): <NEW_LINE> <INDENT> def __init__(self, *points): <NEW_LINE> <INDENT> assert len(points) >= 3 <NEW_LINE> self.points = points <NEW_LINE> <DEDENT> @property <NEW_LINE> def bounding_box(self): <NEW_LINE> <INDENT> lats = sorted([p.latitude for p in self.points]) <NEW_LINE> lons = sorted([p.longitude fo...
Area defined by bordering Point instances
62598fb18a43f66fc4bf21db
class getCertificateCredential_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'tokenId', 'UTF8', None, ), (2, TType.STRING, 'gatewayId', 'UTF8', None, ), ) <NEW_LINE> def __init__(self, tokenId=None, gatewayId=None,): <NEW_LINE> <INDENT> self.tokenId = tokenId <NEW_LINE> self.gatewayId = gate...
Attributes: - tokenId - gatewayId
62598fb144b2445a339b69a1
class LossHistory(keras.callbacks.Callback): <NEW_LINE> <INDENT> def on_train_begin(self, logs={}): <NEW_LINE> <INDENT> self.losses = [] <NEW_LINE> self.epoch_losses = [] <NEW_LINE> self.epoch_val_losses = [] <NEW_LINE> <DEDENT> def on_batch_end(self, batch, logs={}): <NEW_LINE> <INDENT> self.losses.append(logs.get('lo...
A custom keras callback for recording losses during network training.
62598fb17047854f4633f43a
class WheelBuilder(object): <NEW_LINE> <INDENT> def __init__(self, requirement_set, finder, wheel_dir, build_options=[], global_options=[]): <NEW_LINE> <INDENT> self.requirement_set = requirement_set <NEW_LINE> self.finder = finder <NEW_LINE> self.wheel_dir = normalize_path(wheel_dir) <NEW_LINE> self.build_options = bu...
Build wheels from a RequirementSet.
62598fb1460517430c43208e
class ResetEvent(asyncio.Event): <NEW_LINE> <INDENT> def set(self) -> None: <NEW_LINE> <INDENT> super().set() <NEW_LINE> super().clear()
An event which automatically clears after being set
62598fb1be383301e025385a
class ErrorDetails(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'code': {'readonly': True}, 'http_status_code': {'readonly': True}, 'message': {'readonly': True}, 'details': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'http_status_code': {'key': 'httpS...
Error details. Variables are only populated by the server, and will be ignored when sending a request. :ivar code: The error code. :vartype code: str :ivar http_status_code: The HTTP status code. :vartype http_status_code: str :ivar message: The error message. :vartype message: str :ivar details: The error details. :...
62598fb1a79ad1619776a0c9
class SentimentAnalysis(object): <NEW_LINE> <INDENT> def __init__(self, graph, clusters): <NEW_LINE> <INDENT> self.graph = graph <NEW_LINE> self.clusters = clusters <NEW_LINE> self.cluster_message = {} <NEW_LINE> <DEDENT> def get_cluster_message(self): <NEW_LINE> <INDENT> for cluster_id, cluster in self.clusters.iterit...
Get sentiment analysis with only positive and negative considered. Positive means normal logs and negative sentiment refers to possible attacks. This class uses sentiment analysis feature from the TextBlob library [Loria2016]_. References ---------- .. [Loria2016] Steven Loria and the contributors, TextBlob: Simple, ...
62598fb19c8ee823130401a2
class RessurrectionState(State): <NEW_LINE> <INDENT> def handle(self, context): <NEW_LINE> <INDENT> context.set_last_state(context.get_state()) <NEW_LINE> if context.get_resolve_sent() is False: <NEW_LINE> <INDENT> context.send_resolve() <NEW_LINE> <DEDENT> self.go_next(context) <NEW_LINE> <DEDENT> def go_next(self, co...
Implement a behavior associated with RessurrectionState Transitions: * next state is always AliveState
62598fb14a966d76dd5eef38
class Transformer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, enc_vocab_len, enc_max_seq_len, dec_vocab_len, dec_max_seq_len, n_layer, n_head, d_model, d_k, d_v, d_f, pad_idx=1, pos_pad_idx=0, drop_rate=0.1, use_conv=False, linear_weight_share=True, embed_weight_share=False): <NEW_LINE> <INDENT> super(Transforme...
Transformer Model
62598fb126068e7796d4c9b6
class BatchRename(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.path = 'C://Users//ZCZ//Desktop//青蛙//总集2' <NEW_LINE> <DEDENT> def rename(self): <NEW_LINE> <INDENT> filelist = os.listdir(self.path) <NEW_LINE> total_num = len(filelist) <NEW_LINE> i = 1 <NEW_LINE> for item in filelist: <NEW_LINE> <IN...
批量重命名文件夹中的图片文件
62598fb1a8370b77170f043d
class Error(ErrorResult): <NEW_LINE> <INDENT> def __init__(self, error): <NEW_LINE> <INDENT> self.is_error = True <NEW_LINE> self.traceback = traceback.format_exc() <NEW_LINE> self.error = error
Indicates an error occurred. Args: error (Exception): Exception that was raised inside of the function or method
62598fb12c8b7c6e89bd3826
class AVL_Tree(object): <NEW_LINE> <INDENT> def getHeight(self, node): <NEW_LINE> <INDENT> if not node: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> return node.height <NEW_LINE> <DEDENT> def getBalanceFactor(self, node): <NEW_LINE> <INDENT> if not node: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> return self....
Implements AVL Tree.
62598fb192d797404e388b94
class Lexicographical(Sorting): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Sorting.__init__(self) <NEW_LINE> <DEDENT> def is_applicable(self,choices): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def sort(self,choices): <NEW_LINE> <INDENT> return sorted(choices)
Sorts keys in lexicographical order
62598fb1bf627c535bcb1500
class ExtGridCellSelModel(BaseExtGridSelModel): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ExtGridCellSelModel, self).__init__(*args, **kwargs) <NEW_LINE> self.init_component(*args, **kwargs) <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> return 'new Ext.grid.CellSelec...
Модель для грида с выбором ячеек
62598fb167a9b606de54602f
class List(Serializer): <NEW_LINE> <INDENT> def __init__(self, data_type=None, *args, **kwargs): <NEW_LINE> <INDENT> self._type = data_type <NEW_LINE> super(List, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def validate(self, key, value): <NEW_LINE> <INDENT> super(List, self).validate(key, value) <NEW_LINE> if ...
Serializer for a list of data.
62598fb155399d3f0562657e
class SequentialFile(MultiFile): <NEW_LINE> <INDENT> def __init__(self, raw_files, *args, **kwargs): <NEW_LINE> <INDENT> self.files = raw_files <NEW_LINE> self.filesize = os.path.getsize(self.files[0]) <NEW_LINE> super(SequentialFile, self).__init__(None, *args, **kwargs) <NEW_LINE> self.current_file_number = None <NEW...
Class for readers that read from data stored in a sequence of files.
62598fb1e1aae11d1e7ce854
class CustomQueueHandler(logging.handlers.QueueHandler): <NEW_LINE> <INDENT> def __init__(self, queue): <NEW_LINE> <INDENT> super().__init__(queue) <NEW_LINE> <DEDENT> def prepare(self, record): <NEW_LINE> <INDENT> record = copy.copy(record) <NEW_LINE> record.exc_info = None <NEW_LINE> record.exc_text = None <NEW_LINE>...
Overrides the prepare method of QueueHandler to prevent all messages from being converted to strings
62598fb197e22403b383af6f
class CollectorPackage(Logging): <NEW_LINE> <INDENT> _PACKAGE_TYPE_NAMES = { COLLECTOR: 'SumoCollector', } <NEW_LINE> _ROOT_URL = 'https://collectors.sumologic.com/rest/download' <NEW_LINE> _RELEASE_PACKAGE_FORMAT = '{type}-{version}-{build}-{suffix}' <NEW_LINE> __meta__ = ABCMeta <NEW_LINE> def __init__(self, platform...
Represents a generic collector package. @cvar _ROOT_URL: The root URL to the releases page. @type _ROOT_URL: str @cvar _RELEASE_PACKAGE_FORMAT: The format of a release package name. Will contain args type, version, build and suffix. @type _RELEASE_PACKAGE_FORMAT: str @ivar _platform: Th...
62598fb1796e427e5384e7f6
class Timer(object): <NEW_LINE> <INDENT> def __init__(self, interval, callback, arguments=None): <NEW_LINE> <INDENT> super(Timer, self).__init__() <NEW_LINE> self.interval = interval <NEW_LINE> self.callback = callback <NEW_LINE> self.arguments = arguments <NEW_LINE> self.paused = False <NEW_LINE> self.lastcall =...
A timer defined in terms of a time interval and a callback function that is called every time such interval passes. If the callback function has any arguments, they should be passed in a dict.
62598fb1851cf427c66b831d
@admin.register(ChatText) <NEW_LINE> class ChatTextAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('room_id', 'content', 'count')
Registers the ChatText Model
62598fb11f5feb6acb162c80
class AudioNormalize(object): <NEW_LINE> <INDENT> def __init__(self, _mean=None, _std=None): <NEW_LINE> <INDENT> self._mean = _mean <NEW_LINE> self._std = _std <NEW_LINE> <DEDENT> def __call__(self, data): <NEW_LINE> <INDENT> _mean = data.mean(axis=None) if self._mean is None else self._mean <NEW_LINE> _std = data.std(...
Normalize spectrogram of mono audio with mean and standard deviation.
62598fb1f548e778e596b605
class RegionInstanceGroupList(_messages.Message): <NEW_LINE> <INDENT> id = _messages.StringField(1) <NEW_LINE> items = _messages.MessageField('InstanceGroup', 2, repeated=True) <NEW_LINE> kind = _messages.StringField(3, default=u'compute#regionInstanceGroupList') <NEW_LINE> nextPageToken = _messages.StringField(4) <NEW...
Contains a list of InstanceGroup resources. Fields: id: [Output Only] The unique identifier for the resource. This identifier is defined by the server. items: A list of InstanceGroup resources. kind: The resource type. nextPageToken: [Output Only] This token allows you to get the next page of results f...
62598fb18a43f66fc4bf21dd
class PrefixList2(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "prefix-list-2" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.name = "" <NEW_LINE> for keys, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self,keys, value)
This class does not support CRUD Operations please use parent. :param name: {"minLength": 1, "maxLength": 128, "type": "string", "description": "IPv6 prefix-list name", "format": "string"} :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
62598fb1d58c6744b42dc309
class TestTriggerWorkflowCollectionRep(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 testTriggerWorkflowCollectionRep(self): <NEW_LINE> <INDENT> pass
TriggerWorkflowCollectionRep unit test stubs
62598fb1f9cc0f698b1c52fb
class UnitTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.name = "Mysql_Server" <NEW_LINE> self.server_id = 10 <NEW_LINE> self.sql_user = "mysql_user" <NEW_LINE> self.sql_pass = "my_japd" <NEW_LINE> self.machine = getattr(machine, "Linux")() <NEW_LINE> self.host = "host_server" <N...
Class: UnitTest Description: Class which is a representation of a unit testing. Methods: setUp -> Initialize testing environment. test_list -> Test fetch_ign_tbl method with data. test_default -> Test fetch_ign_tbl method with no data.
62598fb166673b3332c3042e
class Double(Primitive): <NEW_LINE> <INDENT> fmt = "d"
Represents a double-precision floating poing conforming to IEEE 754.
62598fb130dc7b766599f8af
class ComputeRegionsListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> orderBy = _messages.StringField(3) <NEW_LINE> pageToken = _messages.StringField(4) <NEW_LINE> project = _m...
A ComputeRegionsListRequest object. Fields: filter: Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. The field_name is the name of the field you want to compare. Only atomic fie...
62598fb10c0af96317c563de
class CuentaList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Cuenta.objects.all() <NEW_LINE> serializer_class = CuentaSerializer
Listado y creacion de cuenta
62598fb1d268445f26639bb4
class fRect: <NEW_LINE> <INDENT> def __init__(self, pos, size): <NEW_LINE> <INDENT> self.pos = (pos[0], pos[1]) <NEW_LINE> self.size = (size[0], size[1]) <NEW_LINE> <DEDENT> def move(self, x, y): <NEW_LINE> <INDENT> return fRect((self.pos[0]+x, self.pos[1]+y), self.size) <NEW_LINE> <DEDENT> def move_ip(self, x, y, move...
Like PyGame's Rect class, but with floating point coordinates
62598fb1167d2b6e312b6fd4
class BasicResidualBlock(nn.Module): <NEW_LINE> <INDENT> expansion = 1 <NEW_LINE> def __init__(self, inplanes, planes, stride=1, downsample=None): <NEW_LINE> <INDENT> super(BasicResidualBlock, self).__init__() <NEW_LINE> self.conv1 = ConvLayer(inplanes, planes, kernel_size=3, stride=1) <NEW_LINE> self.bn1 = nn.BatchNor...
Residual block Original Code is from: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py Some parts are modified.
62598fb1ff9c53063f51a6af
class TestFace(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._processInterest = None <NEW_LINE> self._sentInterests = [] <NEW_LINE> <DEDENT> def expressInterest(self, interest, onData, onTimeout, onNetworkNack): <NEW_LINE> <INDENT> self._sentInterests.append(Interest(interest)) <NEW_LINE> if...
TestFace extends Face to instantly simulate a call to expressInterest. See expressInterest for details.
62598fb14a966d76dd5eef3a
class data: <NEW_LINE> <INDENT> def __init__(self,name=None,x=[],y=[],E=[]): <NEW_LINE> <INDENT> if name is not None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.x = copy.copy(x) <NEW_LINE> self.y = copy.copy(y) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.name ='none' <NEW_LINE> self.x = [0.0,0.0,0.0] <...
Holds the data and relevant information for plotting
62598fb14f88993c371f053c
class MoveStopMove(BaseStim): <NEW_LINE> <INDENT> def __init__(self, win, speed=100, stop_t=1.0, stop_dur=1.0, *args, **kwargs): <NEW_LINE> <INDENT> self.stop_t = stop_t <NEW_LINE> self.stop_dur = stop_dur <NEW_LINE> self.speed = speed <NEW_LINE> self.objects = (visual.Circle(win, radius=20, fillColor=(1,1,1), units="p...
Moves one circle from left to right and stops it at a given time.
62598fb167a9b606de546030
class showdiff(models.TransientModel): <NEW_LINE> <INDENT> _name = 'wizard.document.page.history.show_diff' <NEW_LINE> def get_diff(self): <NEW_LINE> <INDENT> history = self.env["document.page.history"] <NEW_LINE> ids = self.env.context.get('active_ids', []) <NEW_LINE> diff = "" <NEW_LINE> if len(ids) == 2: <NEW_LINE> ...
Display Difference for History
62598fb14c3428357761a31c
class PolicyDefinition(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'policy_type': {'key': 'properties.policyType', 'type': 'str'}, 'mode'...
The policy definition. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The ID of the policy definition. :vartype id: str :ivar name: The name of the policy definition. :vartype name: str :ivar policy_type: The type of policy definition. Possible values are NotSpecifie...
62598fb1627d3e7fe0e06f11
class BaseTask(PolymorphicModel): <NEW_LINE> <INDENT> topic_name = models.CharField( _("topic name"), max_length=255, help_text=_("Topics determine which functions need to run for a task."), ) <NEW_LINE> variables = JSONField(default=dict) <NEW_LINE> status = models.CharField( _("status"), max_length=50, choices=Status...
An external task to be processed by work units. Use this as the base class for process-engine specific task definitions.
62598fb171ff763f4b5e77d5
class UserFavorites(object): <NEW_LINE> <INDENT> swagger_types = { 'favorites': 'list[str]' } <NEW_LINE> attribute_map = { 'favorites': 'favorites' } <NEW_LINE> def __init__(self, favorites=None): <NEW_LINE> <INDENT> self._favorites = None <NEW_LINE> self.discriminator = None <NEW_LINE> if favorites is not None: <NEW_L...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fb167a9b606de546031
class FlowUnitChangeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = FlowUnitChangeSerializer <NEW_LINE> queryset = FlowUnitChange.objects.all() <NEW_LINE> filter_fields = ('cost_manager_id', 'incomes_id')
retrieve: Return a change in cost or income. list: Return all changes, ordered by most recently joined. create: Create a new change in cost or income. delete: Remove an existing change in cost or income. partial_update: Update one or more fields on an existing change. update: Update a chang...
62598fb1a17c0f6771d5c298
class Polygon: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'coordinates', (TType.STRUCT,(Point, Point.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, coordinates=None,): <NEW_LINE> <INDENT> self.coordinates = coordinates <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__cla...
Attributes: - coordinates
62598fb1236d856c2adc9470
class AdminMatchAdd(LoggedInHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> self._require_admin() <NEW_LINE> event_key = self.request.get('event_key') <NEW_LINE> matches_csv = self.request.get('matches_csv') <NEW_LINE> matches = OffseasonMatchesParser.parse(matches_csv) <NEW_LINE> event = Event.get_by...
Add Matches from CSV.
62598fb144b2445a339b69a3
class LibvirtdDebugLog(object): <NEW_LINE> <INDENT> def __init__(self, test, log_level="1", log_file=""): <NEW_LINE> <INDENT> self.log_level = log_level <NEW_LINE> self.log_file = log_file <NEW_LINE> self.test = test <NEW_LINE> self.libvirtd = utils_libvirtd.Libvirtd() <NEW_LINE> self.libvirtd_conf = utils_config.Libvi...
Enable libvirtd log for testcase incase with the use of param "enable_libvirtd_debug_log", with additional params log level("libvirtd_debug_level") and log file path("libvirtd_debug_file") can be controlled.
62598fb17d43ff2487427434
class Actor(models.Model): <NEW_LINE> <INDENT> name = models.CharField('Имя', max_length=100) <NEW_LINE> age = models.PositiveSmallIntegerField('Возраст', default=0) <NEW_LINE> description = models.TextField('Описание') <NEW_LINE> image = models.ImageField('Изображение', upload_to='actors/') <NEW_LINE> def __str__(self...
Актёры и режиссёры
62598fb1fff4ab517ebcd849
class InvalidGeometryError(ValueError): <NEW_LINE> <INDENT> pass
This geometry is not valid.
62598fb11b99ca400228f562
class TestInlineFuncs(TestCase): <NEW_LINE> <INDENT> def test_nofunc(self): <NEW_LINE> <INDENT> self.assertEqual(inlinefuncs.parse_inlinefunc( "as$382ewrw w we w werw,|44943}"), "as$382ewrw w we w werw,|44943}") <NEW_LINE> <DEDENT> def test_incomplete(self): <NEW_LINE> <INDENT> self.assertEqual(inlinefuncs.parse_inline...
Test the nested inlinefunc module
62598fb163b5f9789fe851cd
class E5SslCertificatesInfoDialog(QDialog, Ui_E5SslCertificatesInfoDialog): <NEW_LINE> <INDENT> def __init__(self, certificateChain, parent=None): <NEW_LINE> <INDENT> super(E5SslCertificatesInfoDialog, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.sslWidget.showCertificateChain(certificateChain)
Class implementing a dialog to show SSL certificate infos.
62598fb17b25080760ed7515
class TestMatrixExponentiation(unittest.TestCase): <NEW_LINE> <INDENT> def test_matrix_exponentiation(self): <NEW_LINE> <INDENT> mat = [[1, 0, 2], [2, 1, 0], [0, 2, 1]] <NEW_LINE> self.assertEqual(matrix_exponentiation.matrix_exponentiation(mat, 0), [[1, 0, 0], [0, 1, 0], [0, 0, 1]]) <NEW_LINE> self.assertEqual(matrix_...
[summary] Test for the file matrix_exponentiation.py Arguments: unittest {[type]} -- [description]
62598fb163d6d428bbee2810
class IntegersCompletion(UniqueRepresentation, Parent): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Parent.__init__(self, facade = (ZZ, FiniteEnumeratedSet([-infinity, +infinity])), category = Sets()) <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return "An example of a facade set: the integ...
An example of a facade parent: the set of integers completed with `+-\infty` This class illustrates a minimal implementation of a facade parent that models the union of several other parents. EXAMPLES:: sage: S = Sets().Facade().example("union"); S An example of a facade set: the integers completed by +-infi...
62598fb1be383301e025385e
class StreamConnectProjectInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Status = None <NEW_LINE> self.CurrentInputEndpoint = None <NEW_LINE> self.CurrentStartTime = None <NEW_LINE> self.CurrentStopTime = None <NEW_LINE> self.LastStopTime = None <NEW_LINE> self.MainInput = None <N...
云转推项目信息,包含输入源、输出源、当前转推开始时间等信息。
62598fb1a8370b77170f0440
class TestBSMP0x2(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.serial = Mock() <NEW_LINE> self.entities = Mock() <NEW_LINE> self.entities.variables = None <NEW_LINE> self.bsmp = BSMP(self.serial, 1, self.entities) <NEW_LINE> <DEDENT> def test_write_variable(self): <NEW_LINE> <INDENT> with se...
Test BSMP write methods.
62598fb1851cf427c66b8320
class GameBoard: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.board = [] <NEW_LINE> self.rooms = [] <NEW_LINE> <DEDENT> def check_reachable_rooms(self, start, move_points) -> list: <NEW_LINE> <INDENT> result_list = [] <NEW_LINE> if isinstance(start, Player) and not start.in_room: <NEW_LINE> <INDENT>...
gameboard for players to move on Where I really need some other brilliant minds to work together on
62598fb1cc40096d6161a20b
class PostView(ViewInterface): <NEW_LINE> <INDENT> def __init__(self, win, left, feed): <NEW_LINE> <INDENT> self.LEFT_BOUNDS = left + 3 <NEW_LINE> self.window = win <NEW_LINE> self.RIGHT_BOUNDS = left + (3 * self.window.getmaxyx()[1]) / 6 <NEW_LINE> self.BOTTOM_BOUNDS = self.window.getmaxyx()[0] - 2 <NEW_LINE> self.win...
docstring for PostView
62598fb1e5267d203ee6b96d
class SavedText: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.text_versions = [] <NEW_LINE> <DEDENT> def save_text(self, text: Text): <NEW_LINE> <INDENT> self.text_versions.append(deepcopy(text)) <NEW_LINE> <DEDENT> def get_version(self, number: int) -> Text: <NEW_LINE> <INDENT> return self.text_ver...
Control the Text versions and save them
62598fb1a8370b77170f0441
class FileStorage: <NEW_LINE> <INDENT> __file_path = "file.json" <NEW_LINE> __objects = {} <NEW_LINE> def all(self, cls=None): <NEW_LINE> <INDENT> new_dict = {} <NEW_LINE> if cls is None: <NEW_LINE> <INDENT> return self.__objects <NEW_LINE> <DEDENT> if cls != "": <NEW_LINE> <INDENT> if isinstance(cls, str) is False: <N...
Serializes instances to JSON file and deserializes to JSON file.
62598fb14f88993c371f053d
class CBUSH2D(BushElement): <NEW_LINE> <INDENT> type = 'CBUSH2D' <NEW_LINE> def __init__(self, card=None, data=None): <NEW_LINE> <INDENT> BushElement.__init__(self, card, data) <NEW_LINE> if card: <NEW_LINE> <INDENT> self.eid = int(card.field(1)) <NEW_LINE> self.pid = int(card.field(2)) <NEW_LINE> nids = card.fields(3,...
2-D Linear-Nonlinear Connection Defines the connectivity of a two-dimensional Linear-Nonlinear element.
62598fb199cbb53fe6830f3e
class FederationGroupsJoinServlet(BaseGroupsServerServlet): <NEW_LINE> <INDENT> PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/join" <NEW_LINE> async def on_POST( self, origin: str, content: JsonDict, query: Dict[bytes, List[bytes]], group_id: str, user_id: str, ) -> Tuple[int, JsonDict]: <NEW_LINE> <INDE...
Attempt to join a group
62598fb171ff763f4b5e77d7
class DataMessage(messages.AsyncMessage): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> AsyncMessage.__init__(self, **kwargs) <NEW_LINE> self.identity = kwargs.pop('identity', None) <NEW_LINE> self.operation = kwargs.pop('operation', None)
This message is used to transport an operation that occured on a managed object or collection. This class of message is transmitted between clients subscribed to a remote destination as well as between server nodes within a cluster. The payload of this message describes all of the relevant details of the operation. Th...
62598fb14428ac0f6e65858b
class SOAP_Service(object): <NEW_LINE> <INDENT> def __init__(self, service): <NEW_LINE> <INDENT> self.service = service <NEW_LINE> <DEDENT> def serialize(self, response): <NEW_LINE> <INDENT> return serialize_object(response)
Base SOAP Service to bootstrap a service
62598fb199fddb7c1ca62e1c
class Base: <NEW_LINE> <INDENT> SETTINGS = [ "path_to_executable", "mandatory_options", "common_options" ] <NEW_LINE> HAS_COLUMN_INFO = re.compile('^[^:]+:\d+:\d+:') <NEW_LINE> def __init__(self, settings, view): <NEW_LINE> <INDENT> self.settings = settings <NEW_LINE> for setting_name in self.__class__.SETTINGS: <NEW_L...
This is the base search engine class. Override it to define new search engines.
62598fb14527f215b58e9f3a
class Token(collections.namedtuple('_Token', 'num val')): <NEW_LINE> <INDENT> pass
Represents a single Token. Attributes: num: The token type as per the tokenize module. val: The token value as per the tokenize module.
62598fb185dfad0860cbfaa6
class Data_ERROR(Base): <NEW_LINE> <INDENT> name = "error" <NEW_LINE> def __init__(self, request=False, body = b'', cmd=CMD_ERROR, sub_cmd=CMD_ERROR, msg = '', msg_type = MSG_TYPE_STR): <NEW_LINE> <INDENT> self.cmd = cmd <NEW_LINE> self.sub_cmd = sub_cmd <NEW_LINE> self.msg = msg <NEW_LINE> self.msg_type = msg_type <NE...
response | cmd(1B) | sub_cmd(1B) | msg_type(1B) | msg |
62598fb155399d3f05626580
class Display(): <NEW_LINE> <INDENT> def __init__(self,on_page=None,on_poll=None,on_tick=None,on_refresh=None): <NEW_LINE> <INDENT> self.ser = serial.Serial('/dev/ttyAMA0',115200,timeout=0.1) <NEW_LINE> self.on_page = on_page <NEW_LINE> self.on_poll = on_poll <NEW_LINE> self.on_tick = on_tick <NEW_LINE> self.on_refresh...
Manages the 16x2 4 button display: on_tick called every 0.1 seconds as part of the main loop after the button read on_poll called every 1.5 seconds on_page called when a new page has been selected on_refresh called every 30 seconds
62598fb157b8e32f5250814e
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 giveRaise(...
一般perosn: 数据+逻辑
62598fb1adb09d7d5dc0a5f0
class TimeRestriction(models.Model): <NEW_LINE> <INDENT> _name = 'hr_time_labour.time_restriction' <NEW_LINE> _description = 'Shift Time Restriction' <NEW_LINE> name = fields.Char('Restriction Name') <NEW_LINE> code = fields.Char('Restriction Code') <NEW_LINE> description = fields.Text('Description') <NEW_LINE> active ...
Restriction punch type
62598fb160cbc95b063643b6
class VirtualHostCollection(roots.Homogenous): <NEW_LINE> <INDENT> entityType = resource.Resource <NEW_LINE> def __init__(self, nvh): <NEW_LINE> <INDENT> self.nvh = nvh <NEW_LINE> <DEDENT> def listStaticEntities(self): <NEW_LINE> <INDENT> return self.nvh.hosts.items() <NEW_LINE> <DEDENT> def getStaticEntity(self, name)...
Wrapper for virtual hosts collection. This exists for configuration purposes.
62598fb138b623060ffa9102
class _Float4x4Element(_XML3DElement): <NEW_LINE> <INDENT> _name = None <NEW_LINE> def __init__(self, doc_, id_, name_): <NEW_LINE> <INDENT> _XML3DElement.__init__(self, doc_, "float4x4", id_) <NEW_LINE> self._name = name_ <NEW_LINE> if not (self._name == None): <NEW_LINE> <INDENT> self.setAttribute("name", self._name)...
A float4x4 Element
62598fb1442bda511e95c4bf
class XYInspector(BaseTool): <NEW_LINE> <INDENT> new_value = Event <NEW_LINE> visible = Bool(True) <NEW_LINE> last_mouse_position = Tuple <NEW_LINE> inspector_key = KeySpec('p') <NEW_LINE> _old_visible = Enum(None, True, False) <NEW_LINE> def normal_key_pressed(self, event): <NEW_LINE> <INDENT> if self.inspector_key.ma...
A tool that captures the color and underlying values of an image plot.
62598fb1f548e778e596b60a
class ZincArtifactState(object): <NEW_LINE> <INDENT> def __init__(self, artifact): <NEW_LINE> <INDENT> self.artifact = artifact <NEW_LINE> relfile = self.artifact.relations_file <NEW_LINE> self.analysis_fprint = ZincArtifactState._fprint_file(relfile) if os.path.exists(relfile) else None <NEW_LINE> self.classes_by...
The current state of a zinc artifact.
62598fb15fcc89381b26617f
class MarkerSize(Formatoption): <NEW_LINE> <INDENT> connections = ['plot'] <NEW_LINE> priority = BEFOREPLOTTING <NEW_LINE> def update(self, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> self.plot._kwargs.pop('markersize', None) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.plot._kwargs['markers...
Choose the size of the markers for points Possible types -------------- None Use the default from matplotlibs rcParams float The size of the marker
62598fb1d268445f26639bb6
class Console(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "console" <NEW_LINE> self.a10_url="/axapi/v3/authentication/console" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.type_cfg = {} <NEW_LINE> self.u...
Class Description:: Configure console authentication type. Class console supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param uuid: {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": tr...
62598fb10c0af96317c563e2
class Voronoi_probabilistic_algorithm: <NEW_LINE> <INDENT> def __init__(self, parameters): <NEW_LINE> <INDENT> self.parameters = parameters <NEW_LINE> self.dimensions = None <NEW_LINE> <DEDENT> def _run(self, data, weigths, dict_data_indexes): <NEW_LINE> <INDENT> print("data len : "+ str(len(data))) <NEW_LINE> return _...
Main algorithm. Parameters is Voronoi_probabilistic_algorithm_parameters
62598fb14a966d76dd5eef3d
class CardsDirective(InsertInputDirective): <NEW_LINE> <INDENT> required_arguments = 0 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> def get_rst(self): <NEW_LINE> <INDENT> cellsep = '<NEXTCARD>' <NEW_LINE> rowsep = '<NEXTROW>' <NEW_LINE> rows = [] <NEW_LINE> content = '\n'.join(self.content) <NEW_LINE> for row...
Defines the :rst:dir:`cards` directive.
62598fb132920d7e50bc60ba
class TestFeatureValueListResponse1(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 testFeatureValueListResponse1(self): <NEW_LINE> <INDENT> model = kinow_client.models.feature_value_list_response_...
FeatureValueListResponse1 unit test stubs
62598fb121bff66bcd722ccd
class BoolType(FieldType): <NEW_LINE> <INDENT> def __init__(self ,default=False): <NEW_LINE> <INDENT> self.default = default <NEW_LINE> <DEDENT> def check(self, field_value=None): <NEW_LINE> <INDENT> if field_value is None: <NEW_LINE> <INDENT> return self.default <NEW_LINE> <DEDENT> return bool(field_value)
True or False. Default if False.
62598fb13d592f4c4edbaf27
class DefaultBranchProtection(enum.Enum): <NEW_LINE> <INDENT> NONE = 0 <NEW_LINE> PARTIAL = 1 <NEW_LINE> FULL = 2
Default branch protection values, see https://docs.gitlab.com/ee/api/groups.html#options-for-default_branch_protection
62598fb123849d37ff85111a
class ShortTermUFValues(PyObserver, ql.SimpleQuote): <NEW_LINE> <INDENT> def __init__(self, dates, prices): <NEW_LINE> <INDENT> PyObserver.__init__(self) <NEW_LINE> ql.SimpleQuote.__init__(self, 0) <NEW_LINE> self.dates = dates <NEW_LINE> self.prices = prices <NEW_LINE> self.fn = self.buildUfFwd <NEW_LINE> self.exc = 0...
Recieves an evaluation date, UF FWD contract dates -as QL Date Object- and UF prices -as QL Simple Quote Objects-. The ShortTermUFValues object inherits from the SimpleQuote SWIG class to simulate the ql.Observeable interface, which is not avaible for Python.
62598fb15fc7496912d482b1
class DingzNoDataAvailable(DingzError): <NEW_LINE> <INDENT> pass
When no data is available.
62598fb14527f215b58e9f3b
class MapPythonExportedSymbols(Task): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def product_types(cls): <NEW_LINE> <INDENT> return [ 'python_source_to_exported_symbols', ] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def prepare(cls, options, round_manager): <NEW_LINE> <INDENT> round_manager.require_data('python') <NE...
A naive map of python sources to the symbols they export. We just assume that each python source file represents a single symbol defined by the directory structure (from the source root) and terminating in the name of the file with '.py' stripped off.
62598fb199fddb7c1ca62e1d
class OutOfRetries(exceptions.HomeAssistantError): <NEW_LINE> <INDENT> pass
Error to indicate too many error attempts.
62598fb1bf627c535bcb1506
class PagesController(BaseAPIController, SharableItemSecurityMixin, UsesAnnotations, SharableMixin): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> super(PagesController, self).__init__(app) <NEW_LINE> self.manager = PageManager(app) <NEW_LINE> self.serializer = PageSerializer(app) <NEW_LINE> <DEDENT>...
RESTful controller for interactions with pages.
62598fb18e7ae83300ee910a
class SphinxParallelError(SphinxError): <NEW_LINE> <INDENT> category = 'Sphinx parallel build error' <NEW_LINE> def __init__(self, message: str, traceback: Any) -> None: <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.traceback = traceback <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> ret...
Sphinx parallel build error.
62598fb15fdd1c0f98e5dff4
class Movie(): <NEW_LINE> <INDENT> VALID_RATINGS = ["G", "PG", "PG-13", "R"] <NEW_LINE> def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline=movie_storyline <NEW_LINE> self.poster_image_url=poster_image <NEW_LINE> self.tr...
This Class provides a way to store movie related information
62598fb1f9cc0f698b1c52fe
class TestUserContactMethodsApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = victorops_client.apis.user_contact_methods_api.UserContactMethodsApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_user_user_contact_methods_devices_c...
UserContactMethodsApi unit test stubs
62598fb1236d856c2adc9472
class PBFT: <NEW_LINE> <INDENT> def __init__(self, blockChain): <NEW_LINE> <INDENT> self.blockChain = blockChain <NEW_LINE> self.node = blockChain.node <NEW_LINE> self.pendingBlocks = {} <NEW_LINE> self.prepareInfo = None <NEW_LINE> self.commitInfo = {} <NEW_LINE> self.state = PBFT_STATES["NONE"] <NEW_LINE> pass <NEW_L...
Pbft class for implementing PBFT protocol, for consensus within a committee.
62598fb1f7d966606f74804d