code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ListingPinned(models.Model): <NEW_LINE> <INDENT> modelbase_obj = models.ForeignKey('jmbo.ModelBase', on_delete=models.CASCADE) <NEW_LINE> listing = models.ForeignKey( Listing, related_name="pinned_link_to_listing", on_delete=models.CASCADE ) <NEW_LINE> position = models.PositiveIntegerField(default=0)
Through model to facilitate ordering
62598f9a38b623060ffa8e0e
class FunctionalAreasResource(ModelResource): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> queryset = FunctionalArea.objects.all() <NEW_LINE> resource_name = 'functionalareas' <NEW_LINE> authentication = Authentication() <NEW_LINE> authorization = ReadOnlyAuthorization() <NEW_LINE> include_resource_uri = False <...
Functional Areas Resource.
62598f9a7cff6e4e811b57a0
class Host: <NEW_LINE> <INDENT> def __init__(self, name, address, tapdevice, tapaddress, internaldevice, macaddress): <NEW_LINE> <INDENT> self.address = address <NEW_LINE> self.name = name <NEW_LINE> self.internaldevice = internaldevice <NEW_LINE> self.tapdevice = tapdevice <NEW_LINE> self.tapaddress = tapaddress <NEW_...
Represents a host _in a network_, this is, one of the interfaces configured in a running/configured image
62598f9acc0a2c111447ad8b
class CmdDash(MuxCommand): <NEW_LINE> <INDENT> key = "dash" <NEW_LINE> aliases = ["run", "hustle"] <NEW_LINE> help_category = 'battle' <NEW_LINE> def func(self): <NEW_LINE> <INDENT> cmd_check = rules.cmd_check(self.caller, self.args, "dash", ['InCombat', 'IsTurn', 'HasHP', 'HasAction', 'AttacksResolved']) <NEW_LINE> if...
Spend your action to get more movement. Usage: dash [optional custom message] alias 'run', 'hustle' Examples: > dash Protagonist dashes for extra movement! |552[|554+3|552 Movement]|n > dash sprints across the room! Protagonist sprints across the room! |552[|554+3|552 Movement]|n You can spend your action in comba...
62598f9a4a966d76dd5eec60
class CarefulConsumer(MustCommitConsumer): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__(config) <NEW_LINE> self.last_message = None <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> self.close() <NEW_LINE> if hasattr(super(), '__del__'): <NEW_LINE> <INDENT> super().__del...
A Kafka consumer that refrains from commiting it's previous message until it is asking for a new one. Threads should not share a CarefulConsumer! >>> from confluent_kafka import TopicPartition >>> from uuid import uuid4 >>> cluster = run_local_docker_kafka() >>> t = str(uuid4()) >>> h = 'localhost:9092' >>> c1 = get_c...
62598f9abaa26c4b54d4f032
class Market(object): <NEW_LINE> <INDENT> def __init__(self, exchange, name, dry_run=False): <NEW_LINE> <INDENT> self._exchange = exchange <NEW_LINE> self._name = name <NEW_LINE> self._dry_run = dry_run <NEW_LINE> <DEDENT> @property <NEW_LINE> def currency(self): <NEW_LINE> <INDENT> pair = self._name.split("_") <NEW_LI...
Docstring for Market.
62598f9a07f4c71912baf1cb
class WiresPuzzle(): <NEW_LINE> <INDENT> def __init__(self, *steps, **kwargs): <NEW_LINE> <INDENT> self.steps = steps <NEW_LINE> self.completed = False <NEW_LINE> for k,v in kwargs.items(): <NEW_LINE> <INDENT> setattr(self,k,v) <NEW_LINE> <DEDENT> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.steps) <...
handle a wires puzzle composed for various Things
62598f9a090684286d593599
class TestToDecimal(unittest.TestCase): <NEW_LINE> <INDENT> def testString(self): <NEW_LINE> <INDENT> value = '1.0' <NEW_LINE> result = utils.to_decimal(value) <NEW_LINE> self.assertEqual( Decimal(str(value)), result ) <NEW_LINE> <DEDENT> def testStringInt(self): <NEW_LINE> <INDENT> value = '1' <NEW_LINE> result = util...
Some quick tests for ToDecimal
62598f9ad6c5a102081e1ec5
class Arbitrage(): <NEW_LINE> <INDENT> def __init__(self,config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> <DEDENT> def buyOrSellDecision(self,ticker,buyPrices,balances,logger): <NEW_LINE> <INDENT> currentSellPrice = ticker['sell'] <NEW_LINE> currentBuyPrice = ticker['buy'] <NEW_LINE> <DEDENT> def pollPrices...
classdocs
62598f9af7d966606f747d67
@script_interface_register <NEW_LINE> class CylindricalVelocityProfile(Observable): <NEW_LINE> <INDENT> _so_name = "Observables::CylindricalVelocityProfile"
Calculates the particle velocity profile in polar coordinates. Parameters ---------- ids : array_like of :obj:`int` The ids of (existing) particles to take into account. center : array_like of :obj:`float` Position of the center of the polar coordinate system for the histogram. axis : :obj:`str` (``x``,...
62598f9ad7e4931a7ef3be19
class LevelState(game.GameContext): <NEW_LINE> <INDENT> def __init__(self, area): <NEW_LINE> <INDENT> self.area = area <NEW_LINE> <DEDENT> def enter(self): <NEW_LINE> <INDENT> self.area.loadAll() <NEW_LINE> self.controllers = [] <NEW_LINE> self.ui = LevelUI() <NEW_LINE> vpm = ui.Frame(self.ui, ui.GridPacker()) <NEW_LIN...
This state is where the player will move the hero around the map interacting with npcs, other players, objects, etc.
62598f9a85dfad0860cbf934
class Corpus(object): <NEW_LINE> <INDENT> def __init__(self, description, no_below=4, no_above=0.5, keep_n=2500): <NEW_LINE> <INDENT> self.description = description <NEW_LINE> self.no_below = no_below <NEW_LINE> self.no_above = no_above <NEW_LINE> self.keep_n = keep_n <NEW_LINE> self.dictionary = None <NEW_LINE> self.d...
Generic BOW corpus.
62598f9a8e71fb1e983bb836
class MockCrazyHash(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self._x = hashlib.sha256(*args) <NEW_LINE> self.digest_size = self._x.digest_size <NEW_LINE> <DEDENT> def update(self, v): <NEW_LINE> <INDENT> self._x.update(v) <NEW_LINE> <DEDENT> def digest(self): <NEW_LINE> <INDENT> retur...
Ain't no block_size attribute here.
62598f9afff4ab517ebcd56e
class Hirshfeld(Pop): <NEW_LINE> <INDENT> def __init__(self, job, type_string="HIRSHFELD"): <NEW_LINE> <INDENT> Pop.__init__(self, job, type_string) <NEW_LINE> if self.idx_section > -1: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> return
Hold results from a Hirshfeld population analysis.
62598f9a442bda511e95c1e7
class DeleteMEA(apmecV10.DeleteCommand): <NEW_LINE> <INDENT> resource = _MEA <NEW_LINE> deleted_msg = {'mea': 'delete initiated'}
Delete given MEA(s).
62598f9a63d6d428bbee2534
class KalturaExternalMediaService(KalturaServiceBase): <NEW_LINE> <INDENT> def __init__(self, client = None): <NEW_LINE> <INDENT> KalturaServiceBase.__init__(self, client) <NEW_LINE> <DEDENT> def add(self, entry): <NEW_LINE> <INDENT> kparams = KalturaParams() <NEW_LINE> kparams.addObjectIfDefined("entry", entry) <NEW_L...
External media service lets you upload and manage embed codes and external playable content
62598f9abe8e80087fbbede0
class ElexResult(models.Model): <NEW_LINE> <INDENT> elexid = models.CharField(max_length=80) <NEW_LINE> raceid = models.CharField(max_length=5, null=True) <NEW_LINE> racetype = models.TextField(null=True) <NEW_LINE> racetypeid = models.CharField(max_length=1, null=True) <NEW_LINE> ballotorder = models.PositiveSmallInte...
Bulk store of AP election API response.
62598f9ac432627299fa2d57
class RoomDetailView(DetailView): <NEW_LINE> <INDENT> model = Room <NEW_LINE> template_name = "rooms/room_detail.html" <NEW_LINE> context_object_name = 'room' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(RoomDetailView, self).get_context_data(**kwargs) <NEW_LINE> return context
View detail Room - NOT USED
62598f9aa219f33f346c659b
class ExtendedSelectElementKeywords(_SelectElementKeywords): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ExtendedSelectElementKeywords, self).__init__() <NEW_LINE> <DEDENT> def select_all_from_list(self, locator): <NEW_LINE> <INDENT> super(ExtendedSelectElementKeywords, self).select_all_from_list(...
ExtendedSelectElementKeywords are select element execution in the requested browser.
62598f9a30dc7b766599f5ce
class Permutation: <NEW_LINE> <INDENT> def __init__(self, genome_name, chr_name, chr_id, chr_len, blocks): <NEW_LINE> <INDENT> self.genome_name = genome_name <NEW_LINE> self.chr_name = chr_name <NEW_LINE> self.chr_id = chr_id <NEW_LINE> self.chr_len = chr_len <NEW_LINE> self.blocks = blocks <NEW_LINE> <DEDENT> def iter...
Represents signed permutation
62598f9a3617ad0b5ee05ed0
class ActivityMonitor: <NEW_LINE> <INDENT> def __init__(self, history_length=3600): <NEW_LINE> <INDENT> self.history_length = history_length <NEW_LINE> self.log = [] <NEW_LINE> self.trim_lock = threading.Lock() <NEW_LINE> <DEDENT> def closedConnection(self, conn): <NEW_LINE> <INDENT> log = self.log <NEW_LINE> now = tim...
ZODB load/store activity monitor This simple implementation just keeps a small log in memory and iterates over the log when getActivityAnalysis() is called. It assumes that log entries are added in chronological sequence.
62598f9a3cc13d1c6d4654ed
class JSONEncodedDict(TypeDecorator): <NEW_LINE> <INDENT> impl = TEXT <NEW_LINE> def process_bind_param(self, value, dialect): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> value = json.dumps(value) <NEW_LINE> <DEDENT> return value <NEW_LINE> <DEDENT> def process_result_value(self, value, dialect): <NEW...
Represents an immutable structure as a json-encoded string. Usage:: JSONEncodedDict(255)
62598f9abaa26c4b54d4f033
class Circle(Sphere): <NEW_LINE> <INDENT> pass
Instantiates a circle with a given radius. Parameters ========== radius: float or SymPy Expression The radius of the circle. Examples ======== >>> from pydy.viz.shapes import Circle >>> s = Circle(10.0) >>> s.name 'unnamed' >>> s.color 'grey' >>>s.radius 10.0 >>> s.name = 'my-shape1' >>> s.name 'my-shape1' >>> s...
62598f9a91af0d3eaad39b8b
class BetaTransformerServicer(object): <NEW_LINE> <INDENT> def TransformInput(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
The Beta API is deprecated for 0.15.0 and later. It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This class was generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.
62598f9a4a966d76dd5eec62
class Directory(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> members = User.objects.all().order_by("id") <NEW_LINE> print(members) <NEW_LINE> return render(request, "directory.html", {"members": members})
Returns the list of all memebers on the platform
62598f9a0fa83653e46f4c6c
class AccountRouter(SimpleRouter): <NEW_LINE> <INDENT> routes = [ Route( url=r'^{prefix}$', mapping={ 'post': 'create', 'get': 'retrieve', 'put': 'update', 'patch': 'partial_update', 'delete': 'destroy' }, name='{basename}-list', detail=False, initkwargs={'suffix': 'List'} ), DynamicRoute( url=r'^{prefix}/{url_path}$',...
A router for account view APIs, which doesn't use lookup.
62598f9a44b2445a339b682d
class TrakcResourceResponses(object): <NEW_LINE> <INDENT> def raise_unauthorized(self): <NEW_LINE> <INDENT> raise ImmediateHttpResponse(http.HttpUnauthorized()) <NEW_LINE> <DEDENT> def raise_forbidden(self): <NEW_LINE> <INDENT> raise ImmediateHttpResponse(http.HttpForbidden())
This class implements methods that should be called when something is not supposed to happen (an unauthorized user tries to access a resourse, an user tries to access a resource from LIMBO etc)
62598f9a435de62698e9bb76
class XSettingsHelper(object): <NEW_LINE> <INDENT> def __init__(self, screen_number=0): <NEW_LINE> <INDENT> self._selection = "_XSETTINGS_S%s" % screen_number <NEW_LINE> self._clipboard = gtk.Clipboard(gtk.gdk.display_get_default(), self._selection) <NEW_LINE> <DEDENT> def xsettings_owner(self): <NEW_LINE> <INDENT> own...
Convenience class for accessing XSETTINGS, without all the code from the watcher.
62598f9a9c8ee82313040030
class LoadPipetteCreate(BaseCommandCreate[LoadPipetteParams]): <NEW_LINE> <INDENT> commandType: LoadPipetteCommandType = "loadPipette" <NEW_LINE> params: LoadPipetteParams <NEW_LINE> _CommandCls: Type[LoadPipette] = LoadPipette
Load pipette command creation request model.
62598f9a55399d3f056262a2
class CloneContext(messages.Message): <NEW_LINE> <INDENT> binLogCoordinates = messages.MessageField('BinLogCoordinates', 1) <NEW_LINE> destinationInstanceName = messages.StringField(2) <NEW_LINE> kind = messages.StringField(3, default=u'sql#cloneContext') <NEW_LINE> sourceInstanceName = messages.StringField(4)
Database instance clone context. Fields: binLogCoordinates: Binary log coordinates, if specified, indentify the the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordintes. destinationInstanceName: Name of th...
62598f9aa05bb46b3848a601
class ModifyFlowLogAttributeRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VpcId = None <NEW_LINE> self.FlowLogId = None <NEW_LINE> self.FlowLogName = None <NEW_LINE> self.FlowLogDescription = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Vpc...
ModifyFlowLogAttribute请求参数结构体
62598f9a7d43ff24874272c3
class Error(core_exc.Error): <NEW_LINE> <INDENT> pass
Base exception for storage API module.
62598f9a9b70327d1c57eb23
class WordformLinkSource(Base): <NEW_LINE> <INDENT> __tablename__ = 'source_x_wordform_link' <NEW_LINE> __table_args__ = ( ForeignKeyConstraint(['wordform_from', 'wordform_to'], ['wordform_links.wordform_from', 'wordform_links.wordform_to']), ) <NEW_LINE> source_x_wordform_link_id = Column(BigInteger(), primary_key=Tru...
Table for storing the sources of links between wordforms. Wordform links are given by lexica (dictionaries, spelling correction lists, etc.). This table records which lexicon a given link between wordforms was originally ingested from.
62598f9aa79ad16197769de6
class VariableEval(Extension): <NEW_LINE> <INDENT> def __init__(self, flow): <NEW_LINE> <INDENT> super().__init__(flow) <NEW_LINE> class_name = self.__class__.__module__ + '.' + self.__class__.__name__ <NEW_LINE> flow.register_dot_flow_function('variableEval', { 'class': class_name, 'method': 'match'}) <NEW_LINE> <DEDE...
VariableEval plugin - defines pseudo function variableEval. This will be called on each matched node to evaluate any conditional defined in the flow.
62598f9ae76e3b2f99fd87b8
class JobServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.RunJob = channel.unary_unary( '/JobService/RunJob', request_serializer=jobs__pb2.JobRunRequest.SerializeToString, response_deserializer=jobs__pb2.JobRunResponse.FromString, ) <NEW_LINE> self.GetJobStatus = channel.un...
Missing associated documentation comment in .proto file.
62598f9a8c0ade5d55dc3550
class LockedClass(object): <NEW_LINE> <INDENT> __slots__ = ('first_name', )
Initialize LockedClass
62598f9ad7e4931a7ef3be1a
class GameForm(messages.Message): <NEW_LINE> <INDENT> urlsafe_key = messages.StringField(1, required=True) <NEW_LINE> attempts_remaining = messages.IntegerField(2, required=True) <NEW_LINE> game_over = messages.BooleanField(3, required=True) <NEW_LINE> message = messages.StringField(4, required=True) <NEW_LINE> user_na...
GameForm for outbound game state information
62598f9a32920d7e50bc5dd9
class Category(m.TimeStampedModel): <NEW_LINE> <INDENT> name = models.CharField(verbose_name='类别名称', help_text='类别名称', max_length=50) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = '文章类别' <NEW_LINE> verbose_name_plural = verbose_name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name
Article Category
62598f9a85dfad0860cbf935
class LinkDown (LinkEvent): <NEW_LINE> <INDENT> pass
LinkUp Event
62598f9af548e778e596b32e
class ManualFileUpload(): <NEW_LINE> <INDENT> def __init__(self, driver): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> <DEDENT> def manualFileUpload(self, dir): <NEW_LINE> <INDENT> manualFileUploadbutton = self.driver.find_element(locators['manual.file.upload.button'][0], locators['manual.file.upload.button'][1]...
Manual File Upload Keywords
62598f9bc432627299fa2d59
class Solicitud(Boleta): <NEW_LINE> <INDENT> def __init__(self, fecha='' , cliente='', asesor='', vehiculo='', repuestos=''): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.fecha = fecha <NEW_LINE> self.cliente = cliente <NEW_LINE> self.asesor = asesor <NEW_LINE> self.vehiculo=vehiculo <NEW_LINE> self.repuestos...
Clase donde se guardan los datos de la solicitud de mantenimiento ---Se almacenan los datos de los vehiculos
62598f9be5267d203ee6b691
class CanNotStartError(Exception): <NEW_LINE> <INDENT> def something(self): <NEW_LINE> <INDENT> pass
A service could not start successfully.
62598f9b3617ad0b5ee05ed2
class RegenConverter(BaseConverter): <NEW_LINE> <INDENT> def __init__(self,url_map,*args): <NEW_LINE> <INDENT> super(RegenConverter,self).__init__(url_map) <NEW_LINE> self.regex = args[0]
自定义正则转换器
62598f9bbd1bec0571e14f85
class RobertaClassificationHead(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dense = nn.Linear(config.hidden_size, config.hidden_size) <NEW_LINE> self.dp_prob = config.hidden_dropout_prob <NEW_LINE> self.dp_mask1 = None <NEW_LINE> self.dp_mask2 = Non...
Head for sentence-level classification tasks.
62598f9bbaa26c4b54d4f035
class CenterLossAccuracy(EvalMetric): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(CenterLossAccuracy, self).__init__('center_loss_accuracy') <NEW_LINE> try: <NEW_LINE> <INDENT> self.label_array_idx = kwargs['label_array_idx'] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> self....
Calculate accuracy
62598f9b63b5f9789fe84ef9
class SellConfig(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Device = None <NEW_LINE> self.Type = None <NEW_LINE> self.CdbType = None <NEW_LINE> self.Memory = None <NEW_LINE> self.Cpu = None <NEW_LINE> self.VolumeMin = None <NEW_LINE> self.VolumeMax = None <NEW_LINE> self.VolumeStep...
售卖配置详情
62598f9b2ae34c7f260aae64
class PreferencesConfig(mdc_gui.Preferences): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> mdc_gui.Preferences.__init__(self, parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.set_values() <NEW_LINE> <DEDENT> def set_values(self): <NEW_LINE> <INDENT> self.master_address_txt.SetValue(self.pa...
Sets the preferences
62598f9b507cdc57c63a4b19
class ConcreteProductA(Product): <NEW_LINE> <INDENT> def interface(self): <NEW_LINE> <INDENT> return "Concrete Product A"
Implement the Product interface.
62598f9b596a897236127a05
class CocoConfig(Config): <NEW_LINE> <INDENT> NAME = "ondra" <NEW_LINE> IMAGES_PER_GPU = 1 <NEW_LINE> NUM_CLASSES = 3 <NEW_LINE> TRAIN_ROIS_PER_IMAGE = 64 <NEW_LINE> STEPS_PER_EPOCH = 1500 // IMAGES_PER_GPU <NEW_LINE> MINI_MASK_SHAPE = (128, 128) <NEW_LINE> VALIDATION_STEPS = 100 <NEW_LINE> IMAGE_MAX_DIM = 256*3 <NEW_L...
Configuration for training on MS COCO. Derives from the base Config class and overrides values specific to the COCO dataset.
62598f9b9c8ee82313040031
class IdentifyOperatorBoolean(IdentifyOperator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(IdentifyOperatorBoolean, self).__init__() <NEW_LINE> <DEDENT> def _identify_op(self): <NEW_LINE> <INDENT> if self.step.lower().startswith('if ') or self.step.lower().startswith('is ') or sel...
Example: "if both #2 and #3 are true" Example: "is #2 more than #3" Example: "if #1 is american"
62598f9bb5575c28eb712b8f
class GetNewUcdnDomainBandwidthResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "BandwidthList": fields.List( models.BandwidthInfoSchema(), required=False, load_from="BandwidthList", ), "Traffic": fields.Float(required=False, load_from="Traffic"), }
GetNewUcdnDomainBandwidth - 获取域名带宽数据
62598f9b435de62698e9bb78
class Group(CouchObject): <NEW_LINE> <INDENT> def __init__(self, **options): <NEW_LINE> <INDENT> CouchObject.__init__(self) <NEW_LINE> self.cdb_document_data = "group" <NEW_LINE> self.setdefault('name', None) <NEW_LINE> self.setdefault('administrators', []) <NEW_LINE> self.setdefault('associated_sites', {}) <NEW_LINE> ...
_Group_ Dictionary object containing attributes of a group
62598f9b3c8af77a43b67dff
@implementer(IFieldValues) <NEW_LINE> @attr.s(auto_attribs=True) <NEW_LINE> class FieldValues: <NEW_LINE> <INDENT> form: "Form" <NEW_LINE> arguments: Dict[str, Any] <NEW_LINE> prevalidationValues: Dict[Field, Optional[str]] <NEW_LINE> validationErrors: Dict[Field, ValidationError] <NEW_LINE> _injectionComponents: Compo...
Reified post-parsing values for HTTP form submission.
62598f9ba05bb46b3848a603
class ProjectBase(api.ProjectBase): <NEW_LINE> <INDENT> url = Field(source='get_absolute_url') <NEW_LINE> class Meta(api.ProjectBase.Meta): <NEW_LINE> <INDENT> lookup_field = 'slug'
Base Project serializer, exposing our defaults for projects.
62598f9b462c4b4f79dbb78e
class ArticleCrudTest(RepositoryTestCase): <NEW_LINE> <INDENT> serializer = ArticleHeavySerializer <NEW_LINE> def test_create_article(self): <NEW_LINE> <INDENT> data = { "name": "YSON", "description": "---", "identifier": "123334", "author": "YSON", "license": "ls", "url": "https://www.google.com", "created": "2019-09-...
...
62598f9bd58c6744b42dc193
class CBOREncodeError(Exception): <NEW_LINE> <INDENT> pass
Raised when an error occurs while serializing an object into a CBOR datastream.
62598f9b32920d7e50bc5dda
class AccountMoveLine(orm.Model): <NEW_LINE> <INDENT> _inherit = 'account.move.line' <NEW_LINE> def init(self, cr): <NEW_LINE> <INDENT> cr.execute("UPDATE account_move_line as acm " " SET last_rec_date =" " (SELECT date from account_move_line" " WHERE reconcile_id = acm.reconcile_id" " AND re...
Overriding Account move line in order to add last_rec_date. Last rec date is the date of the last reconciliation (full or partial) account move line
62598f9b07f4c71912baf1cf
class LogFormatter(logging.Formatter): <NEW_LINE> <INDENT> DEFAULT_FORMAT = '%(color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s' <NEW_LINE> DEFAULT_DATE_FORMAT = '%y%m%d %H:%M:%S' <NEW_LINE> DEFAULT_COLORS = { logging.DEBUG: 4, logging.INFO: 2, logging.WARNING: 3, logging.ERROR: 1, }...
Log formatter used in Tornado. Key features of this formatter are: * Color support when logging to a terminal that supports it. * Timestamps on every log line. * Robust against str/bytes encoding problems. This formatter is enabled automatically by `tornado.options.parse_command_line` or `tornado.options.parse_config_f...
62598f9b656771135c489405
class TestEbins(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.sm = ScdMesh.fromFile(meshfile) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testTagClean(self): <NEW_LINE> <INDENT> ergs = StringIO.StringIO('1\n2\n3\n4') <NEW_LINE> self.assert...
Class methods test read_and_tag_phtn_ergs()
62598f9bd6c5a102081e1ec9
class Ball(GEllipse): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> GEllipse.__init__(self, x = GAME_WIDTH/2.0, y = GAME_HEIGHT/2.0, width = BALL_DIAMETER, height = BALL_DIAMETER, fillcolor = colormodel.BLACK) <NEW_LINE> self._vy = -5.0 <NEW_LINE> self._vx = random.uniform(1.0,5.0) <NEW_LINE> self._vx = s...
Instance is a game ball. We extend GEllipse because a ball must have additional attributes for velocity. This class adds this attributes and manages them. INSTANCE ATTRIBUTES: _vx [int or float]: Velocity in x direction _vy [int or float]: Velocity in y direction The class Play will need to look at these a...
62598f9b56ac1b37e6301f6e
class TimingLayer(AbstractAnnotationLayer): <NEW_LINE> <INDENT> pass
Dependencies Layer: Annotation layer for Dependency span annotation elements. For dependency entities.
62598f9b8c0ade5d55dc3551
class VoiceEqualityDynamicsFeature(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'T6' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> featuresModule.FeatureExtractor.__init__(self, dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Voic...
>>> from music21 import *
62598f9b6aa9bd52df0d4c51
class Problem0022(EulerProblem, unittest.TestCase): <NEW_LINE> <INDENT> problem_id = 22 <NEW_LINE> simple_input = "p022_names.txt" <NEW_LINE> simple_output = 871198282 <NEW_LINE> real_input = "p022_names.txt" <NEW_LINE> real_output = 871198282 <NEW_LINE> @staticmethod <NEW_LINE> def solver(input_val): <NEW_LINE> <INDEN...
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. For example, whe...
62598f9bd7e4931a7ef3be1c
class Critic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, nb_agents, seed, fcs1_units=400,fc2_units=300): <NEW_LINE> <INDENT> super(Critic, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fcs1 = nn.Linear((state_size+action_size)*nb_agents, fcs1_units) <NEW...
Critic (Value) Model.
62598f9b8e71fb1e983bb83a
class PileLIFO: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sommet = -1 <NEW_LINE> self.donnees = [None] * TAILLE_MAX_PILE <NEW_LINE> <DEDENT> def estVide(self): <NEW_LINE> <INDENT> return self.sommet == -1 <NEW_LINE> <DEDENT> def estPleine(self): <NEW_LINE> <INDENT> return self.sommet == TAILLE_MA...
une pile implementee dans un tableau de taille fixe TAILLE_MAX_PILE
62598f9bd99f1b3c44d05435
class LoginView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> if 'username' in request.COOKIES: <NEW_LINE> <INDENT> username = request.COOKIES.get('username') <NEW_LINE> checked = 'checked' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> username = '' <NEW_LINE> checked = '' <NEW_LINE> <DEDENT> r...
登录
62598f9b442bda511e95c1eb
class ReservationTemplate(Drmaa2Object): <NEW_LINE> <INDENT> reservation_name = Drmaa2Object.StringDescriptor('reservationName') <NEW_LINE> start_time = Drmaa2Object.TimeDescriptor('startTime') <NEW_LINE> end_time = Drmaa2Object.TimeDescriptor('endTime') <NEW_LINE> duration = Drmaa2Object.LongLongDescriptor('duration')...
High-level DRMAA2 reservation template class.
62598f9b99cbb53fe6830c57
class IndicatorDAO(DAO): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(IndicatorDAO, self).__init__(Indicator) <NEW_LINE> <DEDENT> def get_indicators_by_country(self, iso3): <NEW_LINE> <INDENT> return self.session.query(Indicator).join(Observation).join(Country).filter(Country.iso3 == iso3).all() <N...
Dao for indicator entity
62598f9bf548e778e596b330
class SshFpForm(FormRevMixin, ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = SshFp <NEW_LINE> exclude = ("machine",) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> prefix = kwargs.pop("prefix", self.Meta.model.__name__) <NEW_LINE> super(SshFpForm, self).__init__(*a...
Form used to add and edit SSHFP records.
62598f9bbe8e80087fbbede4
class SaloonListView(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = Saloon.objects.all() <NEW_LINE> serializer_class = SaloonSearchSerializer <NEW_LINE> filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) <NEW_LINE> filterset_class = SaloonFilter
Returns the list of all the available saloons. Also supports filtering on the basis of fields declared in SaloonFilter defined in filter module
62598f9bdd821e528d6d8cb9
class CharmSwiftProxy(CharmBase): <NEW_LINE> <INDENT> charm_name = 'swift-proxy' <NEW_LINE> charm_rev = 15 <NEW_LINE> display_name = 'Swift Proxy' <NEW_LINE> display_priority = DisplayPriorities.Storage <NEW_LINE> related = [ ('keystone:identity-service', 'swift-proxy:identity-service'), ('glance:object-store', 'swift-...
swift directives
62598f9bfbf16365ca793e3c
class SizedDialog(wx.Dialog): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> wx.Dialog.__init__(self, *args, **kwargs) <NEW_LINE> self.SetExtraStyle(wx.WS_EX_VALIDATE_RECURSIVELY) <NEW_LINE> self.borderLen = 12 <NEW_LINE> self.mainPanel = SizedPanel(self, -1) <NEW_LINE> mysizer = wx.BoxSiz...
A sized dialog Controls added to its content pane will automatically be added to the panes sizer.
62598f9b498bea3a75a578a5
class SquareTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.board = Board([10,10,2]) <NEW_LINE> <DEDENT> def test_display(self): <NEW_LINE> <INDENT> square = self.square = self.board.squares[3][3] <NEW_LINE> self.assertEquals(square.display(), ' ') <NEW_LINE> self.square.flag() <N...
Tests for Square object
62598f9b925a0f43d25e7dc1
class MGMSG_MOD_SET_DIGOUTPUTS(MessageWithoutData): <NEW_LINE> <INDENT> message_id = 0x0213 <NEW_LINE> _params_names = ['message_id'] + ['bits', None] + ['dest', 'source']
The CONTROL IO connector on the rear panel of the unit exposes a number of digital outputs. The number of outputs available depends on the type of unit. This message is used to configure these digital outputs. :param bits: :type bits: int
62598f9badb09d7d5dc0a30e
class PressureReading(DB.Model): <NEW_LINE> <INDENT> id = DB.Column(DB.Integer, primary_key=True) <NEW_LINE> value = DB.Column(DB.Integer) <NEW_LINE> date = DB.Column(DB.DateTime) <NEW_LINE> def __init__(self, value, date): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.date = date <NEW_LINE> <DEDENT> def __rep...
Model a pressure reading.
62598f9b16aa5153ce400282
@total_ordering <NEW_LINE> class Stylesheet(object): <NEW_LINE> <INDENT> def __init__(self, name, url, priority=100): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.name = name <NEW_LINE> self.priority = priority <NEW_LINE> <DEDENT> def __gt__(self, other): <NEW_LINE> <INDENT> return self.priority > other.priority ...
Represents a CSS stylesheet file. Used internally.
62598f9ba219f33f346c659f
class NotImplementedObjectHandler(BaseObjectHandler): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def update(model_id, updated_dict): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def delete(model_id): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @s...
Default Object Handler to force implementation of subclasses. Helper class to make any subclass of AbstractHandler explode if it is missing any of the required object managers.
62598f9b3617ad0b5ee05ed4
class BuilderError(CLAPError): <NEW_LINE> <INDENT> pass
Raised when something wrong went in builder.
62598f9be5267d203ee6b693
@dataclass <NEW_LINE> class ConsoleData: <NEW_LINE> <INDENT> status: SmartglassConsoleStatus <NEW_LINE> app_details: Optional[Product]
Xbox console status data.
62598f9b15baa72349461d08
class TestAddressGeofencePolygonVertices(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return ...
AddressGeofencePolygonVertices unit test stubs
62598f9bbaa26c4b54d4f037
class Model(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Model, self).__init__() <NEW_LINE> self.l1 = torch.nn.Linear(feature_size, 16) <NEW_LINE> self.l2 = torch.nn.Linear(16, 8) <NEW_LINE> self.l3 = torch.nn.Linear(8, 4) <NEW_LINE> <DEDENT> def forward(self, feat): <NEW_LINE> <I...
my model for stock price predicting
62598f9b7b25080760ed7229
class OBJECT_OT_CoordActionPanelButton(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname="coordactionpanelbutton.button" <NEW_LINE> bl_label="Button" <NEW_LINE> number = bpy.props.IntProperty() <NEW_LINE> def execute(self,context): <NEW_LINE> <INDENT> if(self.number==1): <NEW_LINE> <INDENT> myobj=bpy.context.active_ob...
Reaction on button, print information about object in blender coordinates
62598f9b8e7ae83300ee8e23
class PODDeepONet(NN): <NEW_LINE> <INDENT> def __init__( self, pod_basis, layer_sizes_branch, activation, kernel_initializer, layer_sizes_trunk=None, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.pod_basis = tf.convert_to_tensor(pod_basis, dtype=tf.float32) <NEW_LINE> if isinstance(activation, dict): <NEW_L...
Deep operator network with proper orthogonal decomposition (POD) for dataset in the format of Cartesian product. Args: pod_basis: POD basis used in the trunk net. layer_sizes_branch: A list of integers as the width of a fully connected network, or `(dim, f)` where `dim` is the input dimension and `f` i...
62598f9b96565a6dacd2ce3c
class GetisCluster(Cluster): <NEW_LINE> <INDENT> def __init__(self, id : int, cpoints : List[ClusterPoint], t : int): <NEW_LINE> <INDENT> super().__init__(id = id, cpoints = cpoints, t = t) <NEW_LINE> self.x = len(cpoints) <NEW_LINE> self.gi = None <NEW_LINE> self.significant = False <NEW_LINE> self.spot = None
GetisCluster class, the cluster of points to evaluate its Gi* and statisticaly characterize as 'Hot', 'Cold' or None. Parameters ---------- id : int A unique identifier. cpoints : list A list of ClusterPoint objects. t : int Timestamp Attributes ---------- m : Point The centroid to use in distance cal...
62598f9b21a7993f00c65d07
class ConfigServiceProvider(ServiceProvider): <NEW_LINE> <INDENT> def register(self, app: Application) -> None: <NEW_LINE> <INDENT> async def register_config(app: Application) -> Config: <NEW_LINE> <INDENT> config = Config() <NEW_LINE> config.optionxform = str <NEW_LINE> for config_file in listdir(app.paths["config"]):...
Registers configuration services to the service container.
62598f9bcc0a2c111447ad91
class OscilloGetTraceTask(InstrumentTask): <NEW_LINE> <INDENT> trace = Enum('1', '2', '3', '4', 'TA', 'TB', 'TC', 'TD').tag(pref=True) <NEW_LINE> average_nb = Str().tag(pref=True, feval=validators.Feval(types=numbers.Integral)) <NEW_LINE> highres = Bool(True).tag(pref=True) <NEW_LINE> database_entries = set_default({'t...
Get the trace displayed on the oscilloscope.
62598f9bd53ae8145f918213
class DustGridTest(TestImplementation): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DustGridTest, self).__init__(*args, **kwargs) <NEW_LINE> self.smile = SKIRTSmileSchema() <NEW_LINE> self.launcher = SKIRTLauncher() <NEW_LINE> <DEDENT> def _run(self, **kwargs): <NEW_LINE> <INDENT>...
This class ...
62598f9b009cb60464d012aa
class DeletedUserCase(OneUserCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(DeletedUserCase, self).setUp() <NEW_LINE> self.user.delete() <NEW_LINE> <DEDENT> def test_no_profile_pk_after_delete(self): <NEW_LINE> <INDENT> self.assertIsNone(self.user.profile.pk) <NEW_LINE> <DEDENT> def test_profile_...
Inheritable base case setting up one User, then deleting it.
62598f9b3539df3088ecc03b
class Importer(Synchronizer): <NEW_LINE> <INDENT> _base_mapper = ImportMapper
Synchronizer for importing data from a backend to odoo
62598f9b10dbd63aa1c7093b
class HTMLFileLog(FileLog): <NEW_LINE> <INDENT> def __init__(self, file: TextIO) -> None: <NEW_LINE> <INDENT> super().__init__(file, html_part_processor) <NEW_LINE> file.write('\n\n<pre style="background-color: black; color: white;">\n') <NEW_LINE> <DEDENT> def _close(self) -> None: <NEW_LINE> <INDENT> self._file.write...
FileLog subclass that renders the log as HTML.
62598f9b56b00c62f0fb2636
class ConnectWrapBase: <NEW_LINE> <INDENT> def __init__(self, connection): <NEW_LINE> <INDENT> self.__dict__["dbConn"] = connection <NEW_LINE> self.__dict__["dbCursor"] = connection.cursor() <NEW_LINE> <DEDENT> def __setattr__(self, attr, value): <NEW_LINE> <INDENT> setattr(self.dbCursor, attr, value) <NEW_LINE> <DEDEN...
Connection (and Cursor)-Wrapper to simplify some operations. Base class to versions with synchronous and asynchronous commit.
62598f9b627d3e7fe0e06c30
class Item(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> FORMAT = "*" <NEW_LINE> def __init__(self, bytestream): <NEW_LINE> <INDENT> self._bytestream = bytestream <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get(cls, bytestream, count): <NEW_LINE> <INDENT> import struct <NEW_LINE> if cls.FORMAT[0] ...
base class for all data items
62598f9b8e71fb1e983bb83b
class BaseTestCase(TestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BaseTestCase, self).__init__(*args, **kwargs) <NEW_LINE> self.app_instance = None <NEW_LINE> self.client = None <NEW_LINE> <DEDENT> def create_app(self): <NEW_LINE> <INDENT> os.environ['APP_SETTINGS'] = 'aut...
Base Tests
62598f9b9b70327d1c57eb27
class scSE_Block(nn.Module): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> super(scSE_Block, self).__init__() <NEW_LINE> self.cse = cSE_Block(channel) <NEW_LINE> self.sse = sSE_Block(channel) <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> return self.cse(x) + self.sse(x)
Implementation of Concurrent Spatial and Channel Squeeze & Excitation as discussed by Roy et al.
62598f9bd58c6744b42dc194
class FibHeapItem(Item): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> Item.__init__(self, *args, **kwargs) <NEW_LINE> self.parent = None <NEW_LINE> self.children = None <NEW_LINE> self.marked = False <NEW_LINE> self.degree = 0 <NEW_LINE> <DEDENT> def link(self, other): <NEW_LINE> <INDENT...
A subclass of the Item base class specifically for Items to go in FibHeaps, which have some extra member variables and methods.
62598f9b07f4c71912baf1d1
class AthleteProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('Users must have an email address.') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=emai...
Helps django work with our customer user model
62598f9ba79ad16197769dea
class KeyboardChain(Chain): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> Chain.__init__(self, context) <NEW_LINE> self.__pitches = [] <NEW_LINE> <DEDENT> def instance(self): <NEW_LINE> <INDENT> return self.__pitches <NEW_LINE> <DEDENT> def noteOn(self, pitch, velocity): <NEW_LINE> <INDENT> if no...
A chain which can hold the notes played/held on a keyboard. At present the notes are only in chronological order, and we only hold the pitches. Repeated notes are discarded. (We might change this at some stage to have it encapsulate individual chains for pitch and velocity.)
62598f9be76e3b2f99fd87bc
class AuthenticatedHandler(web.RequestHandler): <NEW_LINE> <INDENT> @property <NEW_LINE> def content_security_policy(self): <NEW_LINE> <INDENT> if 'Content-Security-Policy' in self.settings.get('headers', {}): <NEW_LINE> <INDENT> return self.settings['headers']['Content-Security-Policy'] <NEW_LINE> <DEDENT> return '; '...
A RequestHandler with an authenticated user.
62598f9bd7e4931a7ef3be1e
class MixtureModel(Model): <NEW_LINE> <INDENT> def __init__(self, model_list): <NEW_LINE> <INDENT> self.model_list = model_list <NEW_LINE> <DEDENT> def pack(self): <NEW_LINE> <INDENT> theta = np.array(self.mu) <NEW_LINE> for i, Crow in enumerate(self.C): <NEW_LINE> <INDENT> theta = np.concatenate([theta, Crow[i:]]) <NE...
A mixture model of one or more distributions. The latent component memberships are marginalized out to make things easier.
62598f9b99cbb53fe6830c58
class NullLog(BaseLog): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> BaseLog.__init__(self, *args, **kwargs) <NEW_LINE> self.set_handler(NullHandler())
If the user does not want to generate a log file, use the NullLog. It calls the NullHandler class as its handler.
62598f9b236d856c2adc92fc