code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class PowerUp(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, game, x, y, type): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.type = type <NEW_LINE> self.image = game.image_manager.get_image('powerups')[type] <NEW_LINE> self.sound = game.sound_manager.get_sound('powerup') <NEW_L...
PowerUp Class - A power up sprite that can be collected by the player. Power up types: 0 - Spreader Gun, 1 - Reverse Fire Gun, 2 - Laser Beam, 3 - Move Speed, 4 - Fire Speed
62598eecd58c6744b42db669
class PairValue(DirectedPairValue): <NEW_LINE> <INDENT> def __init__(self, value=None): <NEW_LINE> <INDENT> super(PairValue, self).__init__() <NEW_LINE> self.baseType = BaseType.pair <NEW_LINE> if value is not None: <NEW_LINE> <INDENT> self.set_value(value) <NEW_LINE> <DEDENT> <DEDENT> def set_value(self, value, name_c...
Represents single values of type :py:class:`BaseType.pair`.
62598eec2c8b7c6e89bd1f29
class ModlitError(Exception): <NEW_LINE> <INDENT> def __init__(self, message: str): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._message = message <NEW_LINE> <DEDENT> @property <NEW_LINE> def message(self) -> str: <NEW_LINE> <INDENT> return self._message
A general error pertaining to things that happen in the `modlit` package.
62598eecaad79263cf42cf74
class TestConnectWidgetRequestBody(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 testConnectWidgetRequestBody(self): <NEW_LINE> <INDENT> pass
ConnectWidgetRequestBody unit test stubs
62598eec3d592f4c4edb965f
class Actor(Avatar): <NEW_LINE> <INDENT> def __init__(self, script): <NEW_LINE> <INDENT> super(Actor, self).__init__() <NEW_LINE> self.performance = self.__rehearse(script) <NEW_LINE> <DEDENT> def cue(self): <NEW_LINE> <INDENT> self.performance.next() <NEW_LINE> <DEDENT> def __rehearse(self, script): <NEW_LINE> <INDENT...
I'm an avatar that moves on my own (if you call my .cue() method in an event loop)
62598eecadb09d7d5dc08d31
class debug(Exception): <NEW_LINE> <INDENT> def __init__(self, err): <NEW_LINE> <INDENT> error = u"\033[93m[Error] %s\033[0m" % unicode(err) <NEW_LINE> super(self.__class__, self).__init__(error) <NEW_LINE> traceback_error()
Console debug error message. Args: err (str): Error to display.
62598eec2eb69b55b15a073f
class CustomerCreateView(CreateView): <NEW_LINE> <INDENT> model = Customer <NEW_LINE> template_name = 'suscriptions/customer_create.html' <NEW_LINE> form_class = CustomerCreationForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> form.save() <NEW_LINE> username = form.cleaned_data.get('username') <NEW_LINE>...
Create Customer View or Registration Users
62598eec4527f215b58e8667
class Button: <NEW_LINE> <INDENT> def __init__(self, text, results): <NEW_LINE> <INDENT> self.b = QPushButton(str(text)) <NEW_LINE> self.text = text <NEW_LINE> self.results = results <NEW_LINE> self.b.clicked.connect(lambda: self.handle_input(self.text)) <NEW_LINE> <DEDENT> def handle_input(self, v): <NEW_LINE> <INDENT...
The Button class builds the button and handles the events Arguments: text = the text displayed on the button results = what is or will be in the text box at the top of the app Methods: __init__ handle_input
62598eecbe7bc26dc9251216
class CommandBus(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def dispatch(self, command: Command) -> NoReturn: <NEW_LINE> <INDENT> raise NotImplementedError("Not implemented yet")
Command bus
62598eec4f88993c371ef89c
class repeat(object): <NEW_LINE> <INDENT> def __getattribute__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, p_object, times=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __iter__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __length_hint__...
repeat(object [,times]) -> create an iterator which returns the object for the specified number of times. If not specified, returns the object endlessly.
62598eec090684286d592a96
class EmailPhotoCronJob(CronJobBase): <NEW_LINE> <INDENT> RUN_INTERVAL = 0 if settings.DEBUG else 360 <NEW_LINE> schedule = Schedule(run_every_mins=RUN_INTERVAL) <NEW_LINE> code = 'cron.EmailPhotoCronJob' <NEW_LINE> def do(self): <NEW_LINE> <INDENT> job_timestamp = time.strftime('%D %H:%M:%S') <NEW_LINE> message = 'PyG...
Send an email with a Pi Camera photo.
62598eec1f037a2d8b9e2871
class DocTemplate(QObject): <NEW_LINE> <INDENT> started = pyqtSignal() <NEW_LINE> finished = pyqtSignal() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> QObject.__init__(self) <NEW_LINE> self._doc = None <NEW_LINE> self._styles = None <NEW_LINE> self.tables = [] <NEW_LINE> self._table_map = {} <NEW_LINE> self.name ...
Maintains a list of column headings and years to table refs
62598eec3317a56b869bd91a
class VKAuthenticationComplete(AuthenticationComplete): <NEW_LINE> <INDENT> pass
VK auth complete
62598eeca8370b77170eeb4e
class Notification( namedtuple( "Notification", ["reply", "reply_user", "parent", "parent_user", "document"] ) ): <NEW_LINE> <INDENT> pass
A data structure representing a notification of a reply to an annotation. :param reply: the reply annotation :type reply: h.models.Annotation :param reply_user: the user who made the reply annotation :type reply_user: h.models.User :param parent: the annotation being replied to :type parent: h.models.Annotation :param...
62598eec851cf427c66b6a32
class DynamoWrapper(DbWrapper): <NEW_LINE> <INDENT> def __init__(self, table_name: str, region_name: str, endpoint_url: str): <NEW_LINE> <INDENT> self.table_name = table_name <NEW_LINE> dynamo_resource = boto3.resource('dynamodb', region_name=region_name, endpoint_url=endpoint_url) <NEW_LINE> self.table = dynamo_resour...
Allows access to a DynamoDB instance
62598eec2ae34c7f260a9851
class DFA: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.accepting = [False] * size <NEW_LINE> self.table = [[None] * 26 for row in range(size)]
Trida DFA slouzi k reprezentaci konecneho automatu. Atributy: size pocet uzlu accepting je uzel akceptujici? table matice hran 2D matice 'table' je velikosti 'size' krat 26. Kazdy radek odpovida jednomu uzlu, kazdy sloupec jednomu pismenu anglicke abecedy. Pokud na pozici 'table[s][i]' je...
62598eec56ac1b37e6300956
class ExportPlaneTrack(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "wm.export_plane_track_cp_only" <NEW_LINE> bl_label = "export corner pin" <NEW_LINE> test = bpy.props.BoolProperty(name="Execute",description="If it shall actually run, for optimal performance",default=False) <NEW_LINE> def execute(self, contex...
Tooltip
62598eecd486a94d0ba2a736
class InvCategory(caching.base.CachingMixin, models.Model): <NEW_LINE> <INDENT> id = models.IntegerField(unique=True, primary_key=True) <NEW_LINE> name = models.CharField(max_length=50) <NEW_LINE> is_published = models.BooleanField(default=True) <NEW_LINE> icon_id = models.IntegerField(blank=True, null=True) <NEW_LINE>...
Inventory categories are the top level classification for all items, be it planets, moons, modules, ships, or any other entity within the game that physically exists. CCP Table: invCategories CCP Primary key: "categoryID" tinyint(3)
62598eec8da39b475be01916
class BulkEmailModel(base_models.BaseModel): <NEW_LINE> <INDENT> recipient_ids = ndb.JsonProperty(default=[], compressed=True) <NEW_LINE> sender_id = ndb.StringProperty(required=True) <NEW_LINE> sender_email = ndb.StringProperty(required=True) <NEW_LINE> intent = ndb.StringProperty(required=True, indexed=True, choices=...
Records the content of an email sent from Oppia to multiple users. This model is read-only; entries cannot be modified once created. The id/key of instances of this model is randomly generated string of length 12.
62598eec3539df3088ecaa1c
class ErrorResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'error': {'required': True}, } <NEW_LINE> _attribute_map = { 'error': {'key': 'error', 'type': 'Error'}, } <NEW_LINE> def __init__( self, *, error: "Error", **kwargs ): <NEW_LINE> <INDENT> super(ErrorResponse, self).__init__(**kwargs) ...
Error response object. All required parameters must be populated in order to send to Azure. :ivar error: Required. Error info. :vartype error: ~azure.ai.formrecognizer.v2022_01_30_preview.models.Error
62598eec4f6381625f198870
class _TreeClassifierParams(object): <NEW_LINE> <INDENT> supportedImpurities = ["entropy", "gini"] <NEW_LINE> impurity = Param(Params._dummy(), "impurity", "Criterion used for information gain calculation (case-insensitive). " + "Supported options: " + ", ".join(supportedImpurities), typeConverter=TypeConverters.toStri...
Private class to track supported impurity measures. .. versionadded:: 1.4.0
62598eec23849d37ff84f822
class CsvPlotProvider(BasePlotProvider): <NEW_LINE> <INDENT> REQUIRED_COLUMNS = set(['id', 'name', 'x', 'y']) <NEW_LINE> def __init__(self, data_provider, plot_csv_path): <NEW_LINE> <INDENT> super(CsvPlotProvider, self).__init__(data_provider) <NEW_LINE> self.plot_csv_path = plot_csv_path <NEW_LINE> <DEDENT> def get_pr...
Csv plot provider. The csv file must contain AT LEAST the following columns: id -> The provider's identifier for the plot. name -> The name of the plot. x -> The longitude of the plot (WGS84). y -> The latitude of the plot (WGS84). All the remaining column will be stored as properties.
62598eecd7e4931a7ef3a809
class Provider: <NEW_LINE> <INDENT> def __init__(self, host, port, user, password, agent): <NEW_LINE> <INDENT> self._user = user <NEW_LINE> self._password = password <NEW_LINE> self._header = {'User-Agent': agent} <NEW_LINE> self._start_url = 'http://{}:{}/{}'.format(host, port, 'provider') <NEW_LINE> <DEDENT> def info...
Class contains all methods to access Provider API
62598eec8e71fb1e983ba1d6
class RegistroC170(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'C170'), CampoNumerico(2, 'NUM_ITEM'), Campo(3, 'COD_ITEM'), Campo(4, 'DESCR_COMPL'), CampoNumerico(5, 'QTD'), Campo(6, 'UNID'), CampoNumerico(7, 'VL_ITEM'), CampoNumerico(8, 'VL_DESC'), Campo(9, 'IND_MOV'), Campo(10, 'CST_ICMS'), Campo(11...
ITENS DO DOCUMENTO
62598eec44b2445a339b5d1f
class LogFile(object): <NEW_LINE> <INDENT> def __init__(self, name, append=False, developer=False, flush=True): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.append = append <NEW_LINE> self.developer = developer <NEW_LINE> self.flush = flush <NEW_LINE> self.file = None <NEW_LINE> self.softspace = 0 <NEW_LINE> se...
This manages one of our logfiles.
62598eec2c8b7c6e89bd1f2b
class compose(Generic[_ComposeRetT]): <NEW_LINE> <INDENT> def __init__(self, *funcs: _UnaryFunc) -> None: <NEW_LINE> <INDENT> self.funcs = funcs <NEW_LINE> <DEDENT> def __call__(self, arg: Any) -> _ComposeRetT: <NEW_LINE> <INDENT> return reduce(lambda acc, f: f(acc), self.funcs, arg) <NEW_LINE> <DEDENT> def __reversed_...
Returns a function which calls the argument functions in order from left to right (first to last). Undefined behavior for non-unary functions. >>> from functools import partial; from operator import mul >>> times2tostr = compse(partial(mul, 2), str) >>> times2tostr(10) '20'
62598eec097d151d1a2bf787
class DirectoryObject(Model): <NEW_LINE> <INDENT> _validation = { 'object_id': {'readonly': True}, 'deletion_timestamp': {'readonly': True}, 'object_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'additional_properties': {'key': '', 'type': '{object}'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'dele...
Represents an Azure Active Directory object. You probably want to use the sub-classes and not this class directly. Known sub-classes are: Application, ADGroup, ServicePrincipal, User Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in o...
62598eec3cc13d1c6d463edc
class SSLWebServer(ServerAdapter): <NEW_LINE> <INDENT> def run(self, handler): <NEW_LINE> <INDENT> from cherrypy import wsgiserver <NEW_LINE> from cherrypy.wsgiserver.ssl_pyopenssl import pyOpenSSLAdapter <NEW_LINE> server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) <NEW_LINE> server.ssl_adapter = ...
CherryPy web server with SSL support.
62598eec4f88993c371ef89d
class Downloader: <NEW_LINE> <INDENT> def __init__(self, configuration: Configuration) -> None: <NEW_LINE> <INDENT> self.configuration = configuration <NEW_LINE> self.output_path = configuration.output <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def __invoke_ytdl(cls, args: Sequence[str]) -> int: <NEW_LINE> <INDENT> tr...
Download mp3 file from YouTube. Class download file to cache folder. In case of success files are moved to output file. Output and cache folder are describe in L{YTSettings<ytrss.core.settings.YTSettings>} object. @ivar configuration: Setting object @type configuration: L{YTSettings<ytrss.core.settings.YTSettings>} @...
62598eecf548e778e5969cf6
class MultiLinesOutlinedText(Container): <NEW_LINE> <INDENT> def __init__(self, message, text_color=(255,255,255), font=None): <NEW_LINE> <INDENT> Container.__init__(self, str(id(self)), padding = 5) <NEW_LINE> lines = message.split("\n") <NEW_LINE> for line_no in range(len(lines)): <NEW_LINE> <INDENT> self.sub(Outline...
A multi line outlined text.
62598eec01c39578d7f11513
class _DBRollbackException(Exception): <NEW_LINE> <INDENT> pass
Used by Connection transaction context manager. Caught in __exit__ and converted into a rollback call.
62598eec99cbb53fe682f617
class AssignCharacter(Event): <NEW_LINE> <INDENT> def __init__(self, character_id): <NEW_LINE> <INDENT> super(AssignCharacter, self).__init__(name="Assign character") <NEW_LINE> self.character_id = character_id
This event is sent when a new character is assigned to the local client.
62598eecdc8b845886d51d2e
class NetVar: <NEW_LINE> <INDENT> def __init__(self, data=None): <NEW_LINE> <INDENT> self.g, self._data = None, None <NEW_LINE> if data is not None: <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self._data <NEW_LINE> <DEDENT> @data.sett...
Base class for all nodes in a network holding a value, which can be optionally learned. Variables are the building blocks of a network and hold data (their value) which gets propagated and transformed throughout a network. They also have a gradient (g) property which holds the gradient of a network's implemented funct...
62598eeca79ad16197768789
class ListLayersRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CompatibleRuntime = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> self.SearchKey = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.CompatibleRuntime = p...
ListLayers请求参数结构体
62598eec796e427e5384cf03
class TestContentTypes(common.KeystoneTestCase): <NEW_LINE> <INDENT> def test_default_content_type(self): <NEW_LINE> <INDENT> r = self.service_request() <NEW_LINE> self.assertTrue('application/json' in r.getheader('Content-Type')) <NEW_LINE> <DEDENT> def test_xml_extension(self): <NEW_LINE> <INDENT> r = self.service_re...
Tests API's Content-Type handling
62598eec627d3e7fe0e055f5
class Column: <NEW_LINE> <INDENT> def __init__(self, parent, w): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.cells = [] <NEW_LINE> self.w = w <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "\n".join(c.__repr__() for c in self.cells) <NEW_LINE> <DEDENT> @property <NEW_LINE> def h(self): ...
Represents a column in a page Properties: <----- x ----><-- w -> ---------------------- ^ | | | | | | | | | | | |Column| h | | | | -------| | | | | |------- v --------
62598eec236d856c2adc87cb
class TapClockify(Tap): <NEW_LINE> <INDENT> name = "tap-clockify" <NEW_LINE> config_jsonschema = th.PropertiesList( th.Property("api_key", th.StringType, required=True), th.Property("workspace", th.StringType, required=True), th.Property("start_date", th.DateTimeType), ).to_dict() <NEW_LINE> def discover_streams(self) ...
Clockify tap class.
62598eec91f36d47f2230259
class UpdateOwnBudget(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return obj.user_profile.id == request.user.id <NEW_LINE> <DEDENT> return obj.user_profile.id == request.user....
Allow users to update own budget only
62598eeca17c0f6771d5a9bf
class SimulationRun(ValueEqual): <NEW_LINE> <INDENT> def __init__(self, setup, errorHandling=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._setup = setup <NEW_LINE> self._aggregators = self._createAggregators() <NEW_LINE> self._sim = None <NEW_LINE> self._result = None <NEW_LINE> self._errorHandling = e...
Encapsulates the definition and execution of a simulation run.
62598eec8e7ae83300ee77fb
class UserRole(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, unique=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Default Django user model
62598eec9c8ee8231303f50f
class Foo: <NEW_LINE> <INDENT> def __init__(self, simulation, name, **kwargs): <NEW_LINE> <INDENT> self.simulation = simulation <NEW_LINE> self.name = name <NEW_LINE> for key, val in kwargs.items(): <NEW_LINE> <INDENT> setattr(self, key, val)
A class to test the Handler correctly updating the wrapee
62598eecdd821e528d6d76ad
class TeamNotFound(commands.CommandError): <NEW_LINE> <INDENT> def __init__(self, team): <NEW_LINE> <INDENT> self.team = team
Thrown when a match id is not found.
62598eec56ac1b37e6300958
@TokenIndexer.register("elmo_characters") <NEW_LINE> class ELMoTokenCharactersIndexer(TokenIndexer[List[int]]): <NEW_LINE> <INDENT> def __init__(self, namespace: str = 'elmo_characters', tokens_to_add: Dict[str, int] = None, token_min_padding_length: int = 0) -> None: <NEW_LINE> <INDENT> super().__init__(token_min_padd...
Convert a token to an array of character ids to compute ELMo representations. Parameters ---------- namespace : ``str``, optional (default=``elmo_characters``) tokens_to_add : ``Dict[str, int]``, optional (default=``None``) If not None, then provides a mapping of special tokens to character ids. When using pre...
62598eecf9cc0f698b1c4684
class Extension(object): <NEW_LINE> <INDENT> dist_name = None <NEW_LINE> ext_name = None <NEW_LINE> version = None <NEW_LINE> def get_default_config(self): <NEW_LINE> <INDENT> raise NotImplementedError( 'Add at least a config section with "enabled = true"') <NEW_LINE> <DEDENT> def get_config_schema(self): <NEW_LINE> <I...
Base class for Mopidy extensions
62598eec8da39b475be01918
class TetMeshImporter(bpy.types.Operator, ImportHelper): <NEW_LINE> <INDENT> bl_idname = "mesh.import_tetmesh" <NEW_LINE> bl_label = "Import TetMesh" <NEW_LINE> bl_options = {'PRESET'} <NEW_LINE> filename_ext = filename_ext <NEW_LINE> filter_glob = StringProperty(default = "*.tet", options = {'HIDDEN'}, ) <NEW_LINE> f...
Import TetMesh
62598eec5fdd1c0f98e5c70c
class TransLoss(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, trans_type, blank_id): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> device = torch.device("cuda" if torch.cuda.is_available() else "cpu") <NEW_LINE> if trans_type == "warp-transducer": <NEW_LINE> <INDENT> from warprnnt_pytorch import RNNTLoss...
Transducer loss module. Args: trans_type (str): type of transducer implementation to calculate loss. blank_id (int): blank symbol id
62598eec7d847024c075ab39
class EnterIntoChatPage(): <NEW_LINE> <INDENT> def __init__(self, searched_qq_number, message, start_time='', end_time='', ontime_message=''): <NEW_LINE> <INDENT> self.searched_qq_number = searched_qq_number <NEW_LINE> self.message = message <NEW_LINE> self.start_time = start_time <NEW_LINE> self.end_time = end_time <N...
1.进入聊天界面 2.发送消息 3.定时发送消息
62598eec3539df3088ecaa1e
class TeacherClassList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> serializer_class = SchoolClassSerializer <NEW_LINE> permission_classes = (IsAuthenticatedOrReadOnly,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> id = self.kwargs['pk'] <NEW_LINE> queryset = SchoolClass.objects.filter(teacher__id=id) <NE...
This view retrieves all the classes for a teacher
62598eec379a373c97d97762
class WebhookHookParameterPatch(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '{str}'}, 'certificate_key': {'key': '...
WebhookHookParameterPatch. :param endpoint: API address, will be called when alert is triggered, only support POST method via SSL. :type endpoint: str :param username: (Deprecated) The username, if using basic authentication. :type username: str :param password: (Deprecated) The password, if using basic authenticatio...
62598eec10dbd63aa1c6f2e2
class Worm(Generator): <NEW_LINE> <INDENT> def __init__(self, coordinates, color, outline=None): <NEW_LINE> <INDENT> super().__init__(coordinates, color, outline=outline) <NEW_LINE> self.s['quantity'] = randint(1000, 10000) <NEW_LINE> self.s['p_shapes'] = [0.5, 0.5] <NEW_LINE> self.s['shape'] = choice(self.s['s_shapes'...
Worm class. Experimental
62598eecff9c53063f518dd0
class LogFileHandler(logging.FileHandler): <NEW_LINE> <INDENT> def __init__(self, path, mode='a', endcoding='utf-8'): <NEW_LINE> <INDENT> import logging <NEW_LINE> path = os.path.expanduser(path) <NEW_LINE> logging.FileHandler.__init__(self, path, mode, endcoding)
Advanced FileHandler with expanduser support. Use this class in the your logging configuration to use '~' (*expanduser*) in the logfile path specification. Example: usage in file based logging configuration:: [handler_fileHandler] formatter=fileFormatter level=INFO class=pyutils.L...
62598eecbaa26c4b54d4da39
class CarRental(Resource): <NEW_LINE> <INDENT> @swagger.operation( summary="Aluga um veículo com status disponível.", notes="Para resposta válida, este endpoint deve ser testado com um fresh access token. " "Para isso, basta inserir o token gerado após realizado login. Token de acesso " "do tipo 'refresh' não é permiti...
Locação de veículos Registra, no banco de dados, a locação de um veículo.
62598eecd7e4931a7ef3a80b
class InstantQuoteVO(CouchdbVO): <NEW_LINE> <INDENT> def __init__(self,aDate,aCompany,aValue): <NEW_LINE> <INDENT> CouchdbVO.__init__(self,type='InstantQuote',date=aDate,company=aCompany,value=aValue)
Instant quote of a company.
62598eecd268445f26638f44
class MuscleCacheTestCase(WgerTestCase): <NEW_LINE> <INDENT> def test_overview(self): <NEW_LINE> <INDENT> self.assertFalse(cache.get(make_template_fragment_key('muscle-overview', [2]))) <NEW_LINE> self.client.get(reverse('exercise:muscle:overview')) <NEW_LINE> self.assertTrue(cache.get(make_template_fragment_key('muscl...
Muscle cache test case
62598eec44b2445a339b5d20
class Cylinder(Axial): <NEW_LINE> <INDENT> def __init__(self, pos=Vector([0, 0, 0]), axis=Vector([1, 0, 0]), radius=1.0, color=Rgb(0, 0, 0)): <NEW_LINE> <INDENT> super(Cylinder, self).__init__(pos=pos, radius=radius, color=color, axis=axis) <NEW_LINE> <DEDENT> def init_model(self, scene): <NEW_LINE> <INDENT> n_faces = ...
A Cylinder object.
62598eec56b00c62f0fb103e
class DeleteLbSSLProfile(neutronV20.DeleteCommand): <NEW_LINE> <INDENT> resource = 'ssl_profile' <NEW_LINE> log = logging.getLogger(__name__ + '.DeleteLbSSLProfile') <NEW_LINE> def args2body(self, parsed_args): <NEW_LINE> <INDENT> body = {'ssl_profile': { 'id': parsed_args.id}} <NEW_LINE> neutronV20.update_dict(parsed_...
Delete an SSL certificate key in v1 lbaas api.
62598eecaad79263cf42cf78
class KNN(): <NEW_LINE> <INDENT> def __init__(self, k=5): <NEW_LINE> <INDENT> self.k = k <NEW_LINE> <DEDENT> def _vote(self, neighbors): <NEW_LINE> <INDENT> counts = np.bincount(neighbors[:, 1].astype('int')) <NEW_LINE> return counts.argmax() <NEW_LINE> <DEDENT> def predict(self, X_test, X_train, y_train): <NEW_LINE> <...
K Nearest Neighbors classifier. Parameters: ----------- k: int The number of closest neighbors that will determine the class of the sample that we wish to predict.
62598eecb7558d5895461db2
class aMSNWindow(object): <NEW_LINE> <INDENT> def __init__(self, amsn_core): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def show(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def hide(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def set_title...
This Interface represents a window of the application. Everything will be done from here
62598eec67a9b606de54473b
class pdf_iobjs(pdf_matches): <NEW_LINE> <INDENT> def __init__(self, iterator, origin): <NEW_LINE> <INDENT> super().__init__(iterator, origin, pdf_iobj) <NEW_LINE> <DEDENT> def iobjs(self, nums=None): <NEW_LINE> <INDENT> if nums==None: <NEW_LINE> <INDENT> return self.els <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> as...
A base class for a collection of pdf indirect objects Is initialized from a re.match object
62598eec76e4537e8c3edd20
class Solution: <NEW_LINE> <INDENT> def permuteUnique(self, nums): <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return [[]] <NEW_LINE> <DEDENT> if len(nums) == 1: <NEW_LINE> <INDENT> return [nums] <NEW_LINE> <DEDENT> number = nums[0] <NEW_LINE> cur_permute = [] <NEW_LINE> pre_permute = self.permuteUnique(nums[1...
@param nums: A list of integers. @return: A list of unique permutations.
62598eecac7a0e7691f70c86
class TeeFile(StringIO): <NEW_LINE> <INDENT> def __init__(self, file, auto_flush=False): <NEW_LINE> <INDENT> StringIO.__init__(self) <NEW_LINE> self.file = file <NEW_LINE> self.auto_flush = auto_flush <NEW_LINE> self.length = 0 <NEW_LINE> <DEDENT> def write(self, s): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> s = ''....
A helper class for allowing output to be stored in a StringIO instance while still be directed to a second file object, such as sys.stdout.
62598eec66673b3332c2eb15
class Database: <NEW_LINE> <INDENT> def __init__(self, database=None): <NEW_LINE> <INDENT> if database: <NEW_LINE> <INDENT> self.database = database <NEW_LINE> if '.sqlite' not in self.database: <NEW_LINE> <INDENT> self.database += '.sqlite' <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> self.database = 'dojo.s...
create database for the project
62598eecfff4ab517ebcbf44
class Node(object): <NEW_LINE> <INDENT> def __init__(self, init_data): <NEW_LINE> <INDENT> self._data = init_data <NEW_LINE> self._next = None <NEW_LINE> <DEDENT> def get_data(self): <NEW_LINE> <INDENT> return self._data <NEW_LINE> <DEDENT> def get_next(self): <NEW_LINE> <INDENT> return self._next <NEW_LINE> <DEDENT> d...
链表节点。一个节点包含一个值,以及指向下一个节点的指针
62598eec1b99ca400228e8c4
class SocketClosed(Exception): <NEW_LINE> <INDENT> pass
Exception to raise when a method is called on a closed socket.
62598eec4e4d562566370b86
@tf_export('profiler.experimental.Trace', v1=[]) <NEW_LINE> class Trace(object): <NEW_LINE> <INDENT> def __init__(self, name, **kwargs): <NEW_LINE> <INDENT> if _pywrap_traceme.TraceMe.IsEnabled(): <NEW_LINE> <INDENT> if kwargs: <NEW_LINE> <INDENT> name += '#' + ','.join(key + '=' + str(value) for key, value in six.iter...
Context manager that generates a trace event in the profiler. A trace event will start when entering the context, and stop and save the result to the profiler when exiting the context. Open TensorBoard Profile tab and choose trace viewer to view the trace event in the timeline. Trace events are created only when the ...
62598eec851cf427c66b6a35
class ListItemRule(Rule): <NEW_LINE> <INDENT> type = 'listitem' <NEW_LINE> def condition(self, block): <NEW_LINE> <INDENT> return block[0] == '-' <NEW_LINE> <DEDENT> def action(self, block, handler): <NEW_LINE> <INDENT> handler.start(self.type) <NEW_LINE> handler.feed(block[1:].strip()) <NEW_LINE> handler.end(self.type...
列表项是以连字符打头的段落,在设置格式的过程中,将把连字符删除
62598eec435de62698e9a543
class PropertyNotFoundException(Exception): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(PropertyNotFoundException, self).__init__( "Property not found at path in stage: %s" % str(path))
Raised when a property does not exist at a valid path.
62598eec4a966d76dd5ed647
class AttrVI_ATTR_PXI_MEM_SIZE_BARX(RangeAttribute): <NEW_LINE> <INDENT> resources = [(constants.InterfaceType.pxi, 'INSTR')] <NEW_LINE> py_name = '' <NEW_LINE> visa_name = 'VI_ATTR_PXI_MEM_SIZE_BARX' <NEW_LINE> visa_type = 'ViUInt32' <NEW_LINE> default = NotAvailable <NEW_LINE> read, write, local = True, False, False ...
Memory size used by the device in the specified BAR. If the value of the corresponding VI_ATTR_PXI_MEM_TYPE_BARx is VI_PXI_ADDR_NONE, the value of this attribute is meaningless for the given PXI device.
62598eec91f36d47f223025a
class Headers(xso.XSO): <NEW_LINE> <INDENT> TAG = (namespaces.xep0131_shim, "header") <NEW_LINE> headers = xso.ChildValueMultiMap( HeaderType(), mapping_type=multidict.CIMultiDict, )
Represent stanza headers. The headers are accessible at the :attr:`headers` attribute. .. attribute:: headers A :class:`multidict.CIMultiDict` which provides access to the headers. The keys are the header names and the values are the values of the header. Both must be strings. .. seealso:: :attr:`.Messa...
62598eec38b623060ffa7809
class RustBinary(object): <NEW_LINE> <INDENT> def __init__(self, name, package=None, manifest=None, rename=None, features=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.manifest = manifest or "Cargo.toml" <NEW_LINE> self.type = "binary" <NEW_LINE> self.final_name = rename or name <NEW_LINE> self.features =...
Data for a Rust binary. 'name' is the name of the target, and must match the 'name' in the Cargo manifest. This will also be the name of the binary that is produced. 'manifest' is the path to the Cargo.toml file for the Rust project.
62598eec30bbd722464683a1
class UserConditionFilter(SimpleListFilter): <NEW_LINE> <INDENT> title = _("Condition") <NEW_LINE> parameter_name = 'user_condition' <NEW_LINE> def lookups(self, request, model_admin): <NEW_LINE> <INDENT> return [(cond.id, cond.name) for cond in NamedCondition.objects.filter(as_filter=True)] <NEW_LINE> <DEDENT> def que...
Filters using computed dynamic conditions from DB
62598eed2c8b7c6e89bd1f2e
class ClearCachedAttrView(FormView): <NEW_LINE> <INDENT> form_class = ScoreCacheResetForm <NEW_LINE> template_name = "test_collection/partial/clear_cache_form.html" <NEW_LINE> def get_form(self, form_class): <NEW_LINE> <INDENT> self.model_name = self.kwargs['model_name'] <NEW_LINE> model = _get_model_from_string(self.m...
Extract and display collocations from pdf document
62598eed283ffb24f3cf201d
class ScrapModuleClipboardNotOwnedTest(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> pygame.display.init() <NEW_LINE> pygame.display.set_mode((1, 1)) <NEW_LINE> scrap.init() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls): <NEW_LINE> <INDENT>...
Test the scrap module's functionality when the pygame application is not the current owner of the clipboard. A separate class is used to prevent tests that acquire the clipboard from interfering with these tests.
62598eedd6c5a102081e089f
class HeliumStartKernel(TextCommand): <NEW_LINE> <INDENT> def run(self, edit, *, logger=HELIUM_LOGGER): <NEW_LINE> <INDENT> _start_kernel(sublime.active_window(), self.view) <NEW_LINE> self.view.run_command("helium_clear_all_cells")
Start a kernel and connect view to it.
62598eede5267d203ee6a074
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, ship, *groups): <NEW_LINE> <INDENT> super(Bullet, self).__init__(*groups) <NEW_LINE> self.screen = screen <NEW_LINE> self.rect = pygame.Rect(0, 0, ai_settings.bullet_width, ai_settings.bullet_height) <NEW_LINE> self.rect.centerx = ship.re...
一个对飞船发射的子弹进行管理的类
62598eed7047854f4633db41
class Solution: <NEW_LINE> <INDENT> def sortIntegers(self, A): <NEW_LINE> <INDENT> for i in range(len(A)): <NEW_LINE> <INDENT> for j in range(i+1, len(A)): <NEW_LINE> <INDENT> if A[i] > A[j]: <NEW_LINE> <INDENT> A[i], A[j]= A[j],A[i] <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> return A
@param: A: an integer array @return:
62598eedbaa26c4b54d4da3b
class IPresentation(form.Schema): <NEW_LINE> <INDENT> pass
Plantilla del mode presentacio: /presentation
62598eedd268445f26638f45
class DeleteAddressInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(DeleteAddressInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_Address(self, value): <NEW_LINE> <INDENT> super(DeleteAddressInputSet, self)._set_input('Address', value) <NEW_...
An InputSet with methods appropriate for specifying the inputs to the DeleteAddress Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598eed23849d37ff84f825
class IDeviceManager(object): <NEW_LINE> <INDENT> def get_devices(self): <NEW_LINE> <INDENT> raise NotImplementedError("FIXME: Implement method get_devices") <NEW_LINE> <DEDENT> def set_device_added_callback(self, callback): <NEW_LINE> <INDENT> raise NotImplementedError( "FIXME: Implement method set_device_added_callba...
Interface to manage storage devices. Should detect devices added / removed and provide their mount point
62598eedcc40096d6161958f
class Encoding: <NEW_LINE> <INDENT> BECH32 = 1 <NEW_LINE> BECH32M = 2
Enumeration type to list the various supported encodings.
62598eed3d592f4c4edb9665
class ContactView(FormView): <NEW_LINE> <INDENT> template_name = 'contact_form/contact_form.html' <NEW_LINE> form_class = CustomContactForm <NEW_LINE> success_url = '/contact-admin/' <NEW_LINE> @method_decorator(permission_required('auth.add_user')) <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <I...
docstring for ContactView
62598eed56ac1b37e630095b
class PstorageTest(test_lib.OutputModuleTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_filename = os.path.join(u'test_data', u'psort_test.out') <NEW_LINE> pfilter.TimeRangeCache.ResetTimeConstraints() <NEW_LINE> <DEDENT> def testOutput(self): <NEW_LINE> <INDENT> with TempDirectory() as di...
Tests for the plaso storage outputter.
62598eed16aa5153ce3fec6e
class DictAttr(object): <NEW_LINE> <INDENT> def __init__(self, data:typing.Union[typing.Dict, typing.List, str, int]): <NEW_LINE> <INDENT> super().__setattr__('_data', data) <NEW_LINE> super().__setattr__('_path', []) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_string(cls, value:str): <NEW_LINE> <INDENT> retur...
Interpretation of dictionary keys as Attributtes using dot(.) notation(with minor restrictions).
62598eed57b8e32f525074bb
class DiskUsageProbe(AccountingProbe): <NEW_LINE> <INDENT> COUNTER_DISKUSAGE="Disk usage" <NEW_LINE> def __init__(self, accounting): <NEW_LINE> <INDENT> AccountingProbe.__init__(self, accounting) <NEW_LINE> self.accounting.create_counter(DiskUsageProbe.COUNTER_DISKUSAGE, AccountingDataCollection.AVERAGE_NONE) <NEW_LINE...
Collects information on disk usage * Counters - "Disk usage": Maximum disk space used across nodes.
62598eed3cc13d1c6d463ee0
class Solution: <NEW_LINE> <INDENT> def houseRobber(self, A): <NEW_LINE> <INDENT> n = len(A) <NEW_LINE> if n == 0: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> if n == 1: <NEW_LINE> <INDENT> return A[n - 1] <NEW_LINE> <DEDENT> if n == 2: <NEW_LINE> <INDENT> return max(A[n - 2], A[n - 1]) <NEW_LINE> <DEDENT> memo = ...
@param: A: An array of non-negative integers @return: The maximum amount of money you can rob tonight
62598eed851cf427c66b6a37
class MemberListCreateMixins(mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView): <NEW_LINE> <INDENT> queryset = Member.objects.all() <NEW_LINE> serializer_class = MemberSerializer <NEW_LINE> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> print("Mixins list...") <NEW_LINE> members = ...
List of available mixins: ListModelMixin: provides a .list() method to the view/viewset RetrieveModelMixin: provides a .retrieve() method to the view/viewset CreateModelMixin: provides a .create() method to the view/viewset UpdateModelMixin: provides a .update() method to the view/viewset DestroyModelMixin: provides a ...
62598eedbe7bc26dc9251219
class PolicyDelta(_messages.Message): <NEW_LINE> <INDENT> bindingDeltas = _messages.MessageField('BindingDelta', 1, repeated=True)
The difference delta between two policies. Fields: bindingDeltas: The delta for Bindings between two policies.
62598eed460517430c430bf7
class Meta: <NEW_LINE> <INDENT> name = "Backup Configurations" <NEW_LINE> description = "Backup the configurations of your network devices."
Meta object boilerplate for backup configurations.
62598eed1f037a2d8b9e2877
@patch.dict('os.environ', {'GENIE_BYPASS_HOME_CONFIG': '1'}) <NEW_LINE> class TestingJobExecute(unittest.TestCase): <NEW_LINE> <INDENT> @patch('pygenie.jobs.core.reattach_job') <NEW_LINE> @patch('pygenie.jobs.core.generate_job_id') <NEW_LINE> @patch('pygenie.jobs.core.execute_job') <NEW_LINE> def test_job_execute(self,...
Test executing job.
62598eed627d3e7fe0e055f9
class PropertyDataChangedEventHandler(MulticastDelegate,ICloneable,ISerializable): <NEW_LINE> <INDENT> def BeginInvoke(self,sender,e,callback,object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CombineImpl(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def DynamicInvokeImpl(self,*args): <NEW_LINE> <IND...
Represents the method that handles the PropertyDataChanged event. PropertyDataChangedEventHandler(object: object,method: IntPtr)
62598eeda8370b77170eeb53
class SignUpView(generic.CreateView): <NEW_LINE> <INDENT> form_class = UserCreationForm <NEW_LINE> template_name = "signup.html" <NEW_LINE> success_url = reverse_lazy("login")
Basic signup view.
62598eed91f36d47f223025b
class IdentityProjector(object): <NEW_LINE> <INDENT> def project(self, p): <NEW_LINE> <INDENT> return p
Identity projection. No distortion.
62598eed38b623060ffa780b
class Books(models.Model): <NEW_LINE> <INDENT> CATEGORY_CHOICES = ( ("HE", "Health"), ("SOC", "Social"), ("MA", "Music & Audio"), ("PT", "Programming & Tech") ) <NEW_LINE> title = models.CharField(max_length=500) <NEW_LINE> author = models.CharField(max_length=500, default="lijo") <NEW_LINE> price = models.IntegerField...
Books model which shows basic book details.
62598eed21bff66bcd7213c3
class SQRT(TAFunc): <NEW_LINE> <INDENT> __slots__ = ('real', 'outReal') <NEW_LINE> def __init__(self, real, outReal=None): <NEW_LINE> <INDENT> pass
SQRT(real, outReal=None) -> Sqrt Sqrt(stop, start=-1) -> outNBElement Vector Square Root (Math Transform) Inputs: real Outputs: (outReal,d)
62598eed9c8ee8231303f511
class RuleItem(object): <NEW_LINE> <INDENT> __slots__ = "src", "tgt", "sl_feat", "score", "lm_heu" <NEW_LINE> def __init__(self, src, tgt, sl_f_obj, score = 0.0, lm_heu = 0.0): <NEW_LINE> <INDENT> self.src = src <NEW_LINE> self.tgt = tgt <NEW_LINE> self.sl_feat = sl_f_obj <NEW_LINE> self.score = score <NEW_LINE> self.l...
Phrase-table rule item (both lexical and hierarchical rules)
62598eeddd821e528d6d76af
class NoteOn(MIDIMessage): <NEW_LINE> <INDENT> _STATUS = 0x90 <NEW_LINE> _STATUSMASK = 0xF0 <NEW_LINE> LENGTH = 3 <NEW_LINE> def __init__(self, note, velocity=127, *, channel=None): <NEW_LINE> <INDENT> self.note = note_parser(note) <NEW_LINE> self.velocity = velocity <NEW_LINE> super().__init__(channel=channel) <NEW_LI...
Note On Change MIDI message. :param note: The note (key) number either as an ``int`` (0-127) or a ``str`` which is parsed, e.g. "C4" (middle C) is 60, "A4" is 69. :param int velocity: The strike velocity, 0-127, 0 is equivalent to a Note Off, defaults to 127.
62598eed2ae34c7f260a9855
class TestToAscii(TestCase): <NEW_LINE> <INDENT> def test_ascii_to_ascii(self): <NEW_LINE> <INDENT> testText = b'Word association football' <NEW_LINE> r = to_ascii(testText) <NEW_LINE> self.assertEqual(type(testText), type(r)) <NEW_LINE> <DEDENT> def test_unicode_to_ascii(self): <NEW_LINE> <INDENT> testText = 'Word ass...
Test the to_unicode_or_bust function of gs.core.utils
62598eed167d2b6e312b5708
class CreateUserView(generics.CreateAPIView): <NEW_LINE> <INDENT> permission = (AllowAny) <NEW_LINE> serializer_class = UserRegistrationPostSerializer
Views that will allow for user registeration
62598eed442bda511e95abd2
class Basic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_classes, trunk='hrnetv2', criterion=None): <NEW_LINE> <INDENT> super(Basic, self).__init__() <NEW_LINE> self.criterion = criterion <NEW_LINE> self.backbone, _, _, high_level_ch = get_trunk( trunk_name=trunk, output_stride=8) <NEW_LINE> self.seg_head = m...
Basic segmentation network, no ASPP, no Mscale
62598eedd486a94d0ba2a73c
class ReceiveEmail(InboundMailHandler): <NEW_LINE> <INDENT> def receive(self, message): <NEW_LINE> <INDENT> user = user_from_email(email.utils.parseaddr(message.sender)[1]) <NEW_LINE> for content_type, body in message.bodies('text/plain'): <NEW_LINE> <INDENT> if body.encoding == '8bit': <NEW_LINE> <INDENT> body.encodin...
Receive a snippet email and create or replace snippet for this week.
62598eed3539df3088ecaa21