code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RegularPolygonVisual(EllipseVisual): <NEW_LINE> <INDENT> def __init__(self, center=None, color='black', border_color=None, border_width=1, radius=0.1, sides=4, **kwargs): <NEW_LINE> <INDENT> EllipseVisual.__init__(self, center=center, radius=radius, color=color, border_color=border_color, border_width=border_widt... | Displays a regular polygon
Parameters
----------
center : array-like (x, y)
Center of the regular polygon
color : str | tuple | list of colors
Fill color of the polygon
border_color : str | tuple | list of colors
Border color of the polygon
border_width: float
The width of the border in pixels
radius :... | 62598edd796e427e5384ccff |
class ExperimentDoesntExist(twc.Validator): <NEW_LINE> <INDENT> msgs = { 'exists': twc._("Experiment already exists") } <NEW_LINE> def __init__(self, owner, **kw): <NEW_LINE> <INDENT> super(ExperimentDoesntExist, self).__init__(**kw) <NEW_LINE> self.owner = owner <NEW_LINE> <DEDENT> def validate_python(self, value, sta... | Confirm an experiment doesn't already exist.
`owner`
Name of the sibling field this must match | 62598edd097d151d1a2bf585 |
class HttpProxyGetRequest(Command): <NEW_LINE> <INDENT> SYNOPSIS = (None, None, 'http_proxy', None) <NEW_LINE> ORDER = ('Internals', 0) <NEW_LINE> RAISES = (AccessError, SuppressHtmlOutput) <NEW_LINE> HTTP_CALLABLE = ('GET', ) <NEW_LINE> HTTP_AUTH_REQUIRED = True <NEW_LINE> HTTP_QUERY_VARS = { 'ts': 'Cache busting time... | HTTP GET content from the public web | 62598eddd7e4931a7ef3a604 |
class OneResource: <NEW_LINE> <INDENT> args = None <NEW_LINE> log = None <NEW_LINE> tcex = None <NEW_LINE> def on_get(self, req, resp): <NEW_LINE> <INDENT> data = {'data': 'one'} <NEW_LINE> resp.media = data | Handle request to /one endpoint. | 62598eddcb5e8a47e493b42d |
class Transformation(object): <NEW_LINE> <INDENT> all_compounds = dict() <NEW_LINE> @classmethod <NEW_LINE> def SetAllCompounds(cls, compounds): <NEW_LINE> <INDENT> cls.all_compounds = compounds <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def CmpdToStr(cls, smiles, coeff): <NEW_LINE> <INDENT> cids = cls.all_compounds[s... | Handle information on a given transformation. | 62598edd1f5feb6acb1611b9 |
class TurboActivateTrialExpiredError(TurboActivateError): <NEW_LINE> <INDENT> pass | The activation has expired or the system time has been tampered
with. Ensure your time, timezone, and date settings are correct. | 62598edd2ae34c7f260a964f |
@autoprop <NEW_LINE> class Shape(object): <NEW_LINE> <INDENT> def get_bottom(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_left(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_width(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDEN... | Provide an interface for custom shape classes to interact with the
rectangle class.
For example, rectangles can be instantiated from shapes and can test for
collisions against shapes. The interface is very simple, requiring only
four methods to be redefined. These methods specify the outer dimensions,
i.e. the b... | 62598eddbe8e80087fbbd5b4 |
class HttpServer(BaseHTTPServer.HTTPServer): <NEW_LINE> <INDENT> def __init__(self, server_address, player_proxy): <NEW_LINE> <INDENT> BaseHTTPServer.HTTPServer.__init__(self, server_address, RequestHandler) <NEW_LINE> self._player_conter = 1 <NEW_LINE> self._connected_players = {} <NEW_LINE> self._player_proxy = playe... | Lyrics Http server | 62598edd0a50d4780f703910 |
class SSHDeployer(Deployer): <NEW_LINE> <INDENT> def __init__(self, skip_names=None): <NEW_LINE> <INDENT> Deployer.__init__(self, skip_names) <NEW_LINE> <DEDENT> def deploy(self, target, prefix_dir): <NEW_LINE> <INDENT> prefix_content = [ x for x in os.listdir(prefix_dir) if not os.path.join(prefix_dir, x) i... | Deploy via scp | 62598edd55399d3f05624a96 |
class ArticleEditor(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.set_options(*args) <NEW_LINE> self.setpage() <NEW_LINE> self.site = pywikibot.Site() <NEW_LINE> <DEDENT> def set_options(self, *args): <NEW_LINE> <INDENT> my_args = pywikibot.handle_args(args) <NEW_LINE> parser = argpar... | Edit a wiki page. | 62598edd2c8b7c6e89bd1d28 |
class ODEExpressions(ExpressionBlock): <NEW_LINE> <INDENT> def __init__(self, ode_exprs=None): <NEW_LINE> <INDENT> super().__init__(ode_exprs) <NEW_LINE> self._title = 'ODE' | Class for ODE expressions
:param dict ode_exprs: dict of ODE expressions | 62598edd23849d37ff84f623 |
class UploadEggToPyPI(PythonCommand): <NEW_LINE> <INDENT> flunkOnFailure = True <NEW_LINE> description = ["upload egg to PyPI"] <NEW_LINE> name = "upload egg to PyPI" <NEW_LINE> python_command = ["setup.py", "bdist_egg", "upload"] | Use the 'setup.py upload' tool to upload the .egg to PyPI (requires a
login/password for PyPI). | 62598edd07f4c71912bad9c7 |
class FileImport(forms.Form): <NEW_LINE> <INDENT> csv_file = forms.FileField(label=_('upload CSV File '), required=True, error_messages={'required': 'please upload File'}, help_text=_('browse CSV file')) <NEW_LINE> def clean_csv_file(self): <NEW_LINE> <INDENT> filename = self.cleaned_data['csv_file'] <NEW_LINE> file_ex... | General Form : CSV file upload | 62598edd21bff66bcd7211ba |
class TXAC(M2ArrayChunk): <NEW_LINE> <INDENT> item = TextureAC <NEW_LINE> data = "texture_ac" | Texture AC | 62598edd3d592f4c4edb945d |
class Point: <NEW_LINE> <INDENT> def __init__(self, x, y, z): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z <NEW_LINE> self.visited = False | Define a class Point to contains information in YXZ, together with a boolean attribute to show if it has been visited. | 62598eddcc0a2c111447956b |
class TestViews(BaseWidgetCase): <NEW_LINE> <INDENT> def test_FacetedDashboardView(self): <NEW_LINE> <INDENT> subtyper = getMultiAdapter((self.category1, self.request), name=u'faceted_subtyper') <NEW_LINE> subtyper.enable() <NEW_LINE> self.request.RESPONSE.status = 200 <NEW_LINE> view = getMultiAdapter((self.folder, se... | Test the views. | 62598edd60cbc95b063628a5 |
class MyOnlyFriend(Version): <NEW_LINE> <INDENT> @gen.engine <NEW_LINE> def Transform(self, client, user, callback): <NEW_LINE> <INDENT> from friend import Friend <NEW_LINE> friend = Friend.CreateFromKeywords(user_id=user.user_id, friend_id=user.user_id) <NEW_LINE> logging.info('Creating friend for user %d', user.user_... | Make each user a friend with himself/herself. | 62598edd38b623060ffa75fc |
class RelayController: <NEW_LINE> <INDENT> def __init__(self, lines): <NEW_LINE> <INDENT> self.lines = lines <NEW_LINE> self.line_count = len(lines) <NEW_LINE> self.by_name = dict() <NEW_LINE> for line in lines.values(): <NEW_LINE> <INDENT> name = line.name() <NEW_LINE> if name: <NEW_LINE> <INDENT> self.by_name[name] =... | RelayAPI Controller | 62598edd097d151d1a2bf587 |
class Gateways(Enum): <NEW_LINE> <INDENT> INTERNET_GATEWAY = auto() <NEW_LINE> NAT_GATEWAY = auto() <NEW_LINE> PROXY = auto() <NEW_LINE> NONE = auto() | Define gateways to use for default traffic in a subnet. | 62598edd090684286d592993 |
class BaseCartItemFormsTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = User.objects.create(username="test", email="test@example.com", first_name="Test", last_name="Tester") <NEW_LINE> self.cart = Cart.objects.create() <NEW_LINE> self.product = Product.objects.create(unit_price=1... | Base class for tests related to ``CartItem`` forms and formsets. | 62598eddb7558d5895461bb5 |
class StatusMixin(models.Model): <NEW_LINE> <INDENT> STATUS_FIELD: str = "status" <NEW_LINE> ALLOWED_TRANSITIONS: List[Tuple[str, str]] = [] <NEW_LINE> FORBIDDEN_TRANSITIONS: List[Tuple[str, str]] = [] <NEW_LINE> TRANSITION_HANDLERS: Dict[Tuple[str, str], str] = {} <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = ... | Mixin to handle status changes | 62598edd7cff6e4e811b3f57 |
class AutoconfHell(Achievement): <NEW_LINE> <INDENT> path = ['configure.in'] <NEW_LINE> def on_change(self, old, new): <NEW_LINE> <INDENT> return new is not None | Do you compile correctly on Cray systems? | 62598eddbaa26c4b54d4d83b |
class AIA(Images): <NEW_LINE> <INDENT> def __init__(self, wavelength): <NEW_LINE> <INDENT> self.wavelength = wavelength <NEW_LINE> <DEDENT> def download_latest(self, directory): <NEW_LINE> <INDENT> aia_latest_url = 'http://jsoc.stanford.edu/data/aia/synoptic/mostrecent/' <NEW_LINE> aia_file = 'AIAsynoptic%4.4i.fits' %... | AIA magic
| 62598edda17c0f6771d5a7c5 |
class RouteTableInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RouteTableName = None <NEW_LINE> self.RouteTableCidrBlock = None <NEW_LINE> self.VpcId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RouteTableName = params.get("RouteTableName") <... | 集群路由表对象
| 62598eddbd1bec0571e14380 |
class dentist_appointment (orm.Model): <NEW_LINE> <INDENT> _name = "dentist.appointment" <NEW_LINE> _inherit = "dentist.appointment" <NEW_LINE> _columns = { 'operation_ids':fields.many2many( 'dentist.operation', 'appointment_operation_relation', 'appointment_id', 'operation_id', 'Operations', required=False), } | Medical appointment with wf status included
| 62598edd796e427e5384cd01 |
class GetDDAStatus_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (DDAStatus, DDAStatus.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinary... | Attributes:
- success | 62598edda8370b77170ee958 |
class Seq2VecR2RWord(TrainableSeq2VecBase): <NEW_LINE> <INDENT> def __init__( self, word2vec_model, max_length=10, latent_size=20, encoding_size=100, learning_rate=0.0001, **kwargs ): <NEW_LINE> <INDENT> self.word2vec_model = word2vec_model <NEW_LINE> self.input_transformer = WordEmbeddingTransformer( word2vec_model, m... | seq2seq auto-encoder using pretrained word vectors as input.
Attributes
----------
word_embedding_size: int
The length of input feature
max_length: int
The length of longest sequence.
latent_size: int
The returned latent vector size after encoding. | 62598edd56b00c62f0fb0e39 |
class ListParser(list): <NEW_LINE> <INDENT> def __init__(self, aList): <NEW_LINE> <INDENT> for element in aList: <NEW_LINE> <INDENT> if len(element) > 0: <NEW_LINE> <INDENT> if element.tag == element[0].tag: <NEW_LINE> <INDENT> self.append(ListParser(element)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.append(D... | Converts a xml structure into an array
See: http://code.activestate.com/recipes/410469-xml-as-dictionary/ | 62598edda79ad16197768585 |
class NotificationFeedly(Feedly): <NEW_LINE> <INDENT> def add_love(self, love): <NEW_LINE> <INDENT> return feedly_tasks.notification_add_love.apply_async(args=[love], countdown=2) <NEW_LINE> <DEDENT> @warn_on_duplicate <NEW_LINE> def _add_love(self, love): <NEW_LINE> <INDENT> from user.models import UserNotificationSet... | Manager functionality for interfacing with the
Notification feed | 62598edd925a0f43d25e6597 |
class UserProfileView(generics.RetrieveAPIView): <NEW_LINE> <INDENT> queryset = Profile.objects.all() <NEW_LINE> serializer_class = serializers.ProfileSerializer <NEW_LINE> lookup_field = 'user' | Retrive other users profile | 62598edd1f5feb6acb1611bb |
class Queue: <NEW_LINE> <INDENT> def __init__(self, max_size): <NEW_LINE> <INDENT> self._cond = threading.Condition(threading.Lock()) <NEW_LINE> self._queue = deque(maxlen=max_size) <NEW_LINE> self._closed = False <NEW_LINE> <DEDENT> @property <NEW_LINE> def closed(self): <NEW_LINE> <INDENT> return self._closed <NEW_LI... | A simple queue supporting cancellation.
Once a queue is closed, putting items or getting items will raise a Closed
exception. This makes it easy to cancel group of threads waiting on the
queue. | 62598edd57b8e32f525073bc |
class Pygments(Directive): <NEW_LINE> <INDENT> required_arguments = 1 <NEW_LINE> optional_arguments = 0 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> option_spec = dict([(key, directives.flag) for key in VARIANTS]) <NEW_LINE> has_content = True <NEW_LINE> def run(self): <NEW_LINE> <INDENT> self.assert_has_cont... | Source code syntax hightlighting.
| 62598edd99cbb53fe682f41b |
class Progress(APIView): <NEW_LINE> <INDENT> def get(self, request, id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> image = UploadedImage.objects.get(pk=id) <NEW_LINE> image = {'name': image.image.name, 'progress': image.progress} <NEW_LINE> return Response(image, status=status.HTTP_200_OK) <NEW_LINE> <DEDENT> except... | Interface to view progress of images. | 62598eddf8510a7c17d7d431 |
@Predictor.register("coreference-resolution") <NEW_LINE> class CorefPredictor(Predictor): <NEW_LINE> <INDENT> def __init__(self, model: Model, dataset_reader: DatasetReader, language: str = 'en_core_web_sm') -> None: <NEW_LINE> <INDENT> super().__init__(model, dataset_reader) <NEW_LINE> self._spacy = get_spacy_model(la... | Predictor for the :class:`~allennlp.models.coreference_resolution.CoreferenceResolver` model. | 62598edd6e29344779afeb96 |
class InstanceNotFoundError(CatoError): <NEW_LINE> <INDENT> pass | Instance not found error | 62598edd462c4b4f79db9f62 |
class I18nLangPrefTests(BaseI18nTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(I18nLangPrefTests, self).setUp() <NEW_LINE> self.user_login() <NEW_LINE> <DEDENT> def set_lang_preference(self, language): <NEW_LINE> <INDENT> response = self.client.patch( reverse('preferences_api', args=[self.use... | Regression tests of language presented to the user, when they
choose a language preference, and when they have a preference
and use the dark lang preview functionality. | 62598eddd268445f26638e43 |
class Meta: <NEW_LINE> <INDENT> verbose_name = 'Language' <NEW_LINE> verbose_name_plural = 'Languages' | Meta definition for Language. | 62598edd0a50d4780f703912 |
class TaskPayload(Serializable): <NEW_LINE> <INDENT> dependencies = OptionalField(SetField(StringField)) <NEW_LINE> logs = MappingField(StringField, ListField(TupleField(DateTimeField, StringField))) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.dependencies = None <NEW_LINE> self.logs = {} | A basic task payload.
Attributes:
dependencies (Optional[Set[String]]) - the set of aliases of tasks that the task depends on
logs (Mapping[String, List[Tuple[DateTime, String]]]) - log messages, grouped by agent,
with corresponding timestamps | 62598eddd6c5a102081e069a |
class ConnectionPool(object): <NEW_LINE> <INDENT> def __init__(self, maxnum=5): <NEW_LINE> <INDENT> pywikibot.debug(u"Creating connection pool.", _logger) <NEW_LINE> self.connections = {} <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> self.maxnum = maxnum <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> s... | A thread-safe connection pool. | 62598edda05bb46b38488de7 |
class GRUCell(tf.nn.rnn_cell.RNNCell): <NEW_LINE> <INDENT> def __init__(self, input_size, state_size): <NEW_LINE> <INDENT> self.input_size = input_size <NEW_LINE> self._state_size = state_size <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_size(self): <NEW_LINE> <INDENT> return self._state_size <NEW_LINE> <DEDENT> ... | Wrapper around our GRU cell implementation that allows us to play
nicely with TensorFlow. | 62598edd63d6d428bbee0d3c |
class Error(Exception): <NEW_LINE> <INDENT> pass | Base error class for the library. | 62598edd4428ac0f6e656ac6 |
class Menu(models.Model): <NEW_LINE> <INDENT> date = models.DateField(verbose_name="Datum", editable=True, blank=False, default=timezone.now) <NEW_LINE> items = models.ManyToManyField(Food, related_name="menu_item") <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = "Speisekarte" <NEW_LINE> verbose_name_plural =... | `Menu` represents the menu at the food truck for a specific day. Each menu must have a date and can list several
food items (many-to-many-relationship with Food: a food item can appear on many menus,
a menu has got many items) | 62598edd7047854f4633d94d |
class UpdateChart(Wizard): <NEW_LINE> <INDENT> __name__ = 'analytic_account.update_chart' <NEW_LINE> start = StateView('analytic_account.update_chart.start', 'account_financial_indicator.update_chart_start_view_form', [ Button('Cancel', 'end', 'tryton-cancel'), Button('Update', 'update', 'tryton-ok', default=True), ]) ... | Update Chart | 62598eddcc0a2c111447956c |
class Account(AbstractUser): <NEW_LINE> <INDENT> pass | Overriding the default Django user model to be able to update it in the
future if needed | 62598eddcc0a2c111447956d |
class Team(Group): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'api' <NEW_LINE> <DEDENT> OWNER_TEAM_NAME = "Owners" <NEW_LINE> organization = models.ForeignKey(User) <NEW_LINE> projects = models.ManyToManyField(Project) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name.split('#'... | TODO: documentation
TODO: Whenever a member is removed from members team,
we should remove them from all teams and projects
within the organization. | 62598edd3cc13d1c6d463cd5 |
class TracePaneWritePosition(_ContainerProxy): <NEW_LINE> <INDENT> def __init__(self, pymux, arrangement_pane, content): <NEW_LINE> <INDENT> content = to_container(content) <NEW_LINE> _ContainerProxy.__init__(self, content) <NEW_LINE> self.pymux = pymux <NEW_LINE> self.arrangement_pane = arrangement_pane <NEW_LINE> <DE... | Trace the write position of this pane. | 62598edd8e7ae83300ee75fb |
class InWhitelistCheckFailure(CheckFailure): <NEW_LINE> <INDENT> def __init__(self, redirect_channel: Optional[int]) -> None: <NEW_LINE> <INDENT> self.redirect_channel = redirect_channel <NEW_LINE> if redirect_channel: <NEW_LINE> <INDENT> redirect_message = f" here. Please use the <#{redirect_channel}> channel instead"... | Raised when the `in_whitelist` check fails. | 62598eddfff4ab517ebcbd4f |
class Repo(models.Model): <NEW_LINE> <INDENT> repo_name = models.CharField(max_length=512, null=True, blank=True) <NEW_LINE> team = models.ForeignKey(Team, null=True, blank=True, related_name='team_repo') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.repo_name | Repo associated with Team | 62598edd24f1403a92684b59 |
class IJuanZeng(Interface): <NEW_LINE> <INDENT> id = schema.Int( title=_(u"table primary key"), ) <NEW_LINE> xiangmu_id = schema.Choice( title=_(u"juanzeng xiangmu id"), vocabulary='xtcs.policy.vocabulary.donateId', required=True, ) <NEW_LINE> xingming = schema.TextLine( title=_(u"juanzeng zhe"), ) <NEW_LINE> xianjin =... | donor 记录在某一慈善项目(did决定)下,所有捐赠记录
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| xiangmu_id | int(10) unsigned | NO | MUL | NULL | |
| xingming | varchar(64) | NO | MUL | | |
| xianjin ... | 62598edd7d43ff24874266b1 |
class LBPoolPollster(_BasePollster): <NEW_LINE> <INDENT> FIELDS = ['admin_state_up', 'description', 'lb_method', 'name', 'protocol', 'provider', 'status', 'status_description', 'subnet_id', 'vip_id' ] <NEW_LINE> def _get_lb_pools(self): <NEW_LINE> <INDENT> return self.nc.pool_get_all() <NEW_LINE> <DEDENT> def get_sampl... | Pollster to capture Load Balancer pool status samples.
| 62598edd236d856c2adc86c9 |
class SSLDomain(object): <NEW_LINE> <INDENT> MODE_CLIENT = PN_SSL_MODE_CLIENT <NEW_LINE> MODE_SERVER = PN_SSL_MODE_SERVER <NEW_LINE> VERIFY_PEER = PN_SSL_VERIFY_PEER <NEW_LINE> VERIFY_PEER_NAME = PN_SSL_VERIFY_PEER_NAME <NEW_LINE> ANONYMOUS_PEER = PN_SSL_ANONYMOUS_PEER <NEW_LINE> def __init__(self, mode: int) -> None: ... | An SSL configuration domain, used to hold the SSL configuration
for one or more SSL sessions. | 62598edd4e4d562566370984 |
class AcademicCorpus (object): <NEW_LINE> <INDENT> def _init_(self, url): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.text = _textFromURL(url) <NEW_LINE> <DEDENT> def getText(self): <NEW_LINE> <INDENT> return nltk.pos_tag(self.text) <NEW_LINE> <DEDENT> def getTaggedText(self): <NEW_LINE> <INDENT> return <NEW_LIN... | Represents an NLTK wrapped object for conference programs. | 62598eddadb09d7d5dc08b32 |
class Attributes(object): <NEW_LINE> <INDENT> __metaclass__ = AttributesMeta <NEW_LINE> default = None <NEW_LINE> nillable = True <NEW_LINE> min_occurs = 0 <NEW_LINE> max_occurs = 1 <NEW_LINE> schema_tag = '{%s}element' % spyne.const.xml_ns.xsd <NEW_LINE> translations = None <NEW_LINE> sqla_column_args = None <NEW_LINE... | The class that holds the constraints for the given type. | 62598edd3539df3088eca81d |
class QuotedFormatter(string.Formatter): <NEW_LINE> <INDENT> def __init__(self, quote_func=None, *args, **kwargs): <NEW_LINE> <INDENT> if quote_func is None: <NEW_LINE> <INDENT> quote_func = shlex.quote <NEW_LINE> <DEDENT> self.quote_func = quote_func <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def... | Subclass of string.Formatter that supports quoting.
Using this formatter, any field can be quoted after formatting by
appending "q" to its format string. By default, shell quoting is
performed using "shlex.quote", but you can pass a different
quote_func to the constructor. The quote_func simply has to take a
string ar... | 62598eddcb5e8a47e493b42f |
class TestLogin(object): <NEW_LINE> <INDENT> def test_run_login(self, appium_driver): <NEW_LINE> <INDENT> logger.info("Test login.") <NEW_LINE> if appium_driver is None: <NEW_LINE> <INDENT> logger.info(" all devices inuse or no devices.") <NEW_LINE> return <NEW_LINE> <DEDENT> logger.info("Begin to login") <NEW_LINE> lo... | Test login | 62598edde5267d203ee69e6e |
class Operation(Model): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'display': {'readonly': True}, 'origin': {'readonly': True}, 'properties': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origi... | REST API operation definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The name of the operation being performed on this particular
object.
:vartype name: str
:ivar display: The localized display information for this particular
operation or action.
:vartyp... | 62598edd63d6d428bbee0d3d |
class Permission(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('name'), max_length=255, null=False) <NEW_LINE> content_type = models.ForeignKey( 'content.type', models.CASCADE, verbose_name=_('content type'), null=False, ) <NEW_LINE> codename = models.CharField(_('codename'), max_length=100, null=False) ... | The permissions system provides a way to assign permissions to specific
users and groups of users.
The permission system is used by the Orun admin site, but may also be
useful in your own code. The Orun admin site uses permissions as follows:
- The "add" permission limits the user's ability to view the "add" form... | 62598edd1f037a2d8b9e2671 |
class flist(list): <NEW_LINE> <INDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return [f(*args, **kwargs) for f in self] | @brief augmented builtin list: supports call operation | 62598edd0c0af96317c54909 |
class Histogram(object): <NEW_LINE> <INDENT> def __init__(self, reservoir): <NEW_LINE> <INDENT> self.reservoir = reservoir <NEW_LINE> <DEDENT> def notify(self, value): <NEW_LINE> <INDENT> return self.reservoir.add(value) <NEW_LINE> <DEDENT> def raw_data(self): <NEW_LINE> <INDENT> return self.reservoir.values <NEW_LINE>... | A metric which calculates some statistics over the distribution of some values | 62598edd851cf427c66b683d |
class DesktopParser(ConfigParser): <NEW_LINE> <INDENT> def __init__(self, defaults=None): <NEW_LINE> <INDENT> ConfigParser.__init__(self, defaults) <NEW_LINE> self._list_separator = ';' <NEW_LINE> <DEDENT> def optionxform(self, optionstr): <NEW_LINE> <INDENT> return optionstr <NEW_LINE> <DEDENT> def set_list_separator(... | A DesktopParser for GNOME/KDE .desktop files.
The API is similar to GKeyFile from GLib.
Example:
>>> parser = DesktopParser()
>>> parser.read('/usr/share/applications/gnome-terminal.desktop')
>>> parser.get_locale('Desktop Entry', 'Comment', 'pt') | 62598edd379a373c97d97566 |
class PenSvg(LaserSvg, SVGParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PenSvg, self).__init__() <NEW_LINE> self.shading = False <NEW_LINE> self.ext_metadata['HEAD_TYPE'] = 'N/A' <NEW_LINE> self.lift_height = 100 <NEW_LINE> self.draw_height = 0 <NEW_LINE> self.nozzle_height = HW_PROFILE['mo... | docstring for PenSvg | 62598edd99cbb53fe682f41e |
class Wedge(PatternGenerator): <NEW_LINE> <INDENT> aspect_ratio = param.Number(default=1.0,bounds=(0.0,None),softbounds=(0.0,2.0), precedence=0.31,doc="Ratio of width to height.") <NEW_LINE> size = param.Number(default=pi/4,bounds=(0.0,None),softbounds=(0.0,2.0*pi), precedence=0.60,doc="Angular length of the sector, in... | A sector of a circle with Gaussian fall-off, with size determining the arc length. | 62598edd8e71fb1e983b9fdd |
class High1(BlockTaskSet): <NEW_LINE> <INDENT> def __init__(self, seed=None, size=1): <NEW_LINE> <INDENT> random.seed(seed) <NEW_LINE> super().__init__( binaries.RandomList(size, 1), priority.HighRandom, period.Random ) | 1 tasks with random periods, binaries and only high priorities | 62598edd3617ad0b5ee04699 |
class User(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> email = db.Column(db.String(50), unique=True, nullable=False) <NEW_LINE> password = db.Column(db.String(100), nullable=False) <NEW_LINE> first_name = db.Column(db.String(20), nullable=True) <NEW_LINE> address = db.Column(d... | User database model. | 62598edd63b5f9789fe836dd |
class Tab(CanvasObject): <NEW_LINE> <INDENT> _resource_url = 'tabs/' <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.dict['label'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def html_url(self): <NEW_LINE> <INDENT> return self.dict['html_url'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def id(self): <NEW_L... | Tab object
Takes a dict of course attrs | 62598eddcad5886f8bdc386b |
class State(enum.IntEnum): <NEW_LINE> <INDENT> Running = 0 <NEW_LINE> Stopped = 1 <NEW_LINE> Paused = 2 | SignalManager state flags.
.. seealso:: :func:`SignalManager.state()` | 62598edd9b70327d1c57d325 |
class UpdateWarcsDatabase(luigi.Task): <NEW_LINE> <INDENT> date = luigi.DateParameter(default=datetime.date.today()) <NEW_LINE> trackdb = luigi.Parameter(default='http://localhost:8983/solr/tracking') <NEW_LINE> clear_trackdb = luigi.BoolParameter(default=False) <NEW_LINE> task_namespace = 'analyse.hdfs' <NEW_LINE> tot... | Lists the WARCS and arranges them by date: | 62598eddf7d966606f74655c |
class Game: <NEW_LINE> <INDENT> def __init__(self, map_: GameMap): <NEW_LINE> <INDENT> self.__playerManager: PlayerManager = PlayerManager.instance <NEW_LINE> self.__playerManager.startGame() <NEW_LINE> self.__map: GameMap = map_ <NEW_LINE> self.__turnNum: int = 0 <NEW_LINE> self.__roundNum: int = 0 <NEW_LINE> self.__p... | Represents a game and its associated data | 62598edd4f6381625f198773 |
class ConnectionError(Exception): <NEW_LINE> <INDENT> def __init__(self, code, message=None): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.message = message | A protocol-level error which shuts down the entire connection. | 62598edd3c8af77a43b671e8 |
class RomanNumerals: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def from_roman(roman: str) -> int: <NEW_LINE> <INDENT> roman_to_arabic = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1} <NEW_LINE> answer_arabic = 0 <NEW_LINE> if len(roman) == 1: <NEW_LINE> <INDENT> return roman_to_arabic[roman] <NEW_... | Class-converter:
Roman numbers to Arabic and vice versa | 62598edd60cbc95b063628a9 |
class TestMapTest(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 test_MapTest(self): <NEW_LINE> <INDENT> pass | MapTest unit test stubs | 62598edd097d151d1a2bf58b |
class Page(BasePage): <NEW_LINE> <INDENT> def __init__(self, url, elements, child_pages, source_html): <NEW_LINE> <INDENT> print("Creating {self.tag_name} tag.") <NEW_LINE> super().__init__(url, elements, child_pages, source_html) | Represents any given HTML page on a website. | 62598edd24f1403a92684b5a |
class XueqiuHomeCrawler(XueqiuBaseCrawler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(XueqiuHomeCrawler, self).__init__('xueqiu_home') <NEW_LINE> <DEDENT> def update_info(self): <NEW_LINE> <INDENT> session = requests.Session() <NEW_LINE> response = get_response(session, self.info_source.url, tim... | from info_collector.crawlers import XueqiuHomeCrawler
crawler = XueqiuHomeCrawler()
crawler.update_info() | 62598eddbe383301e0251d44 |
class TestTagMedia(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 testTagMedia(self): <NEW_LINE> <INDENT> pass | TagMedia unit test stubs | 62598edd435de62698e9a343 |
class Exp(PowerTransform): <NEW_LINE> <INDENT> def __init__(self, event_ndims=0, validate_args=False, name="exp"): <NEW_LINE> <INDENT> super(Exp, self).__init__( event_ndims=event_ndims, validate_args=validate_args, name=name) | Compute `Y = g(X) = exp(X)`.
Example Use:
```python
# Create the Y=g(X)=exp(X) transform which works only on Tensors with 1
# batch ndim and 2 event ndims (i.e., vector of matrices).
exp = Exp(event_ndims=2)
x = [[[1., 2],
[3, 4]],
[[5, 6],
[7, 8]]]
exp(x) == exp.forward(x)
log(x) == exp.inverse(x... | 62598edd3317a56b869bd81f |
class Timer: <NEW_LINE> <INDENT> def __init__(self, on_time_event): <NEW_LINE> <INDENT> self.on_time_event = on_time_event <NEW_LINE> self.start_time = None <NEW_LINE> self.interval = None <NEW_LINE> self.running = False <NEW_LINE> <DEDENT> def start(self, interval): <NEW_LINE> <INDENT> self.running = True <NEW_LINE> s... | Execute event on timer.
Parameters
----------
on_time_event L callable
Call this event on timer. | 62598edd4e4d562566370986 |
class BaseCat(object): <NEW_LINE> <INDENT> tag = "猫科动物" <NEW_LINE> def __init__(self,name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def eat(self): <NEW_LINE> <INDENT> print("猫吃东西") | 猫科动物的基础类 | 62598edd3539df3088eca81f |
class PlayPauseMedia(Baserequests): <NEW_LINE> <INDENT> def __init__(self, sourceName, playPause): <NEW_LINE> <INDENT> Baserequests.__init__(self) <NEW_LINE> self.name = 'PlayPauseMedia' <NEW_LINE> self.dataout['sourceName'] = sourceName <NEW_LINE> self.dataout['playPause'] = playPause | Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)
:Arguments:
*sourceName*
type: String
Source name.
*playPause*
type: boolean
Whether to pause or play the source. `false` for play, `true` for pause. | 62598eddd58c6744b42db56d |
class LogFileHandler: <NEW_LINE> <INDENT> Format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s' <NEW_LINE> DateFormat = '%Y-%m-%dT%H:%M:%S' <NEW_LINE> def __init__(self, filename=None): <NEW_LINE> <INDENT> self.__filename = filename <NEW_LINE> self.__handler = None <NEW_LINE> self.__logger = logging.getLogger() <NE... | Context manager for log files. | 62598edddd821e528d6d74b4 |
class AccountNumberGeneratorRandomLuhn(AccountNumberGeneratorRandom): <NEW_LINE> <INDENT> def __init__( self, length: int, bank_display_name: Optional[str], bank_name: Optional[str], cvv_length: int, masker: Optional[AccountNumberMasker], routing_number: Optional[str], prefixes: Tuple[str, ...], ): <NEW_LINE> <INDENT> ... | This class generates a random Luhn AccountNumber.
:param length: The final length of the account number.
:param bank_display_name: Specifies the name of the bank associated
with this account number; this name is appropriate for logging
in log files.
:param bank_name: Specifies name of the bank associated with ... | 62598eddadb09d7d5dc08b34 |
class OAILEXML: <NEW_LINE> <INDENT> def __init__(self, prefix): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> self.ns = {'oai_lexml': 'http://www.lexml.gov.br/oai_lexml', } <NEW_LINE> self.schemas = {'oai_lexml': 'http://projeto.lexml.gov.br/esquemas/oai_lexml.xsd'} <NEW_LINE> <DEDENT> def __call__(self, element,... | Padrao OAI do LeXML
Esta registrado sobre o nome 'oai_lexml' | 62598edd66656f66f7d5894f |
class AcceptMissingHostKey(paramiko.client.MissingHostKeyPolicy): <NEW_LINE> <INDENT> def missing_host_key(self, client, hostname, key): <NEW_LINE> <INDENT> client._host_keys.add(hostname, key.get_name(), key) | Allow connections to hosts whose fingerprints are not on record. | 62598edd7d847024c075a93e |
class LongitudinalPreprocessor(ABC, Base): <NEW_LINE> <INDENT> def __init__(self, n_jobs=-1): <NEW_LINE> <INDENT> Base.__init__(self) <NEW_LINE> self.n_jobs = n_jobs <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def fit(self, features, labels, censoring) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractm... | An abstract base class for a longitudinal data preprocessors
Parameters
----------
n_jobs : `int`, default=-1
Number of tasks to run in parallel. If set to -1, the number of tasks is
set to the number of cores. | 62598edd6e29344779afeb9a |
class MacGyver: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.case_x = 60 <NEW_LINE> self.case_y = 0 <NEW_LINE> self.position_x = 3 <NEW_LINE> self.position_y = 0 <NEW_LINE> <DEDENT> def move(self, direction): <NEW_LINE> <INDENT> if direction == 'right': <NEW_LINE> <INDENT> if self.position_x < (cons... | Class who manage the main character,
and his movements on the map | 62598edd379a373c97d97568 |
class cRulesGrabber: <NEW_LINE> <INDENT> def __init__(self, cGuiRequestHandler): <NEW_LINE> <INDENT> self.cGui = cGuiRequestHandler <NEW_LINE> <DEDENT> def GetHtml(self, dParams): <NEW_LINE> <INDENT> sHeader = self.cGui.GetHeader('iOwl.net - Rules') <NEW_LINE> bState = pManager.manager.GetProxyInterface().GetStatus() <... | Responsible for displaying rules page | 62598edd85dfad0860cbed21 |
class MinDeque: <NEW_LINE> <INDENT> def __init__(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_first(self, x): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_last(self, x): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def remove_first(self)... | As described in Exercise 3.16. | 62598edd7b25080760ed5a08 |
class Stats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.paused = False <NEW_LINE> self.score = 0 <NEW_LINE> self.record_score = self.get_record_score() <NEW_LINE> self.level = 1 <NEW_LINE> <DEDENT> def get_record_score(self): <NEW_LINE> <IND... | 游戏状态的类 | 62598edd2ae34c7f260a9655 |
class KDETerminal(LinuxTerminal): <NEW_LINE> <INDENT> name = "KDE" <NEW_LINE> @staticmethod <NEW_LINE> def detect(): <NEW_LINE> <INDENT> return os.environ.get('KDE_FULL_SESSION', '') == 'true' <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_command_line(): <NEW_LINE> <INDENT> kreadconfig_path = shutil.which('kread... | Handles terminals on KDE (e.g. Konsole). | 62598edd99cbb53fe682f420 |
class DiscreteMetaAction(ActionType): <NEW_LINE> <INDENT> ACTIONS_ALL = { 0: 'LANE_LEFT', 1: 'IDLE', 2: 'LANE_RIGHT', 3: 'FASTER', 4: 'SLOWER' } <NEW_LINE> ACTIONS_LONGI = { 0: 'SLOWER', 1: 'IDLE', 2: 'FASTER' } <NEW_LINE> ACTIONS_LAT = { 0: 'LANE_LEFT', 1: 'IDLE', 2: 'LANE_RIGHT' } <NEW_LINE> def __init__(self, env: '... | An discrete action space of meta-actions: lane changes, and cruise control set-point. | 62598edd442bda511e95a9d5 |
class EqualsOperator(GenericBinaryOperator): <NEW_LINE> <INDENT> def _CompareValue(self, event_value, filter_value): <NEW_LINE> <INDENT> return event_value == filter_value | Equals (==) operator. | 62598edd30dc7b766599ddf6 |
class Network(tls.Unicode, TypeMeta): <NEW_LINE> <INDENT> info_text = "KBaseNetworks.Network" <NEW_LINE> class v1_0(tls.Unicode, TypeMeta): <NEW_LINE> <INDENT> info_text = "KBaseNetworks.Network-1.0" | Network type | 62598edd67a9b606de54453c |
class Model: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_dict(cls, **kwargs): <NEW_LINE> <INDENT> return cls(**kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def new(cls, name: str, tag: str, root: pathlib.Path, loader: Loader = None): <NEW_LINE> <INDENT> model_id = uuid.uuid4() <NEW_LINE> model_path = ro... | Machine-leaning model.
Attributes:
id -- unique model identifier
name -- the name of the model
tag -- the tag of the model
path -- the location of the model on file system
loader -- the model loader | 62598edd6fb2d068a76930d8 |
class BaseBalancer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.lstFS = [] <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def updateFileServerList(self, lstFS): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def getFileServer(self, operation, hash_file): <NEW_LINE> ... | Basic class for balancers | 62598edd45492302aabfaa22 |
class CodeCompressorThreadFactoryImpl(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._klass = {} <NEW_LINE> <DEDENT> def _setup(self, code_type): <NEW_LINE> <INDENT> from django.utils.importlib import import_module <NEW_LINE> if code_type not in compressor_defaults: <NEW_LINE> <INDENT> raise ... | Code Compressor Factory. Handles the initialization of the compressor backend and threads used
by compressor.py. | 62598edde64d504609df8677 |
class BRAINSDemonWarp(SlicerCommandLine): <NEW_LINE> <INDENT> input_spec = BRAINSDemonWarpInputSpec <NEW_LINE> output_spec = BRAINSDemonWarpOutputSpec <NEW_LINE> _cmd = " BRAINSDemonWarp " <NEW_LINE> _outputs_filenames = {'outputVolume':'outputVolume.nii','outputCheckerboardVolume':'outputCheckerboardVolume.nii','outpu... | title: Demon Registration (BRAINS)
category: Registration
description:
This program finds a deformation field to warp a moving image onto a fixed image. The images must be of the same signal kind, and contain an image of the same kind of object. This program uses the Thirion Demons warp software in ITK, the Ins... | 62598edde5267d203ee69e71 |
class QDbgConsole(QTextEdit): <NEW_LINE> <INDENT> WIDTH = 480 <NEW_LINE> HEIGHT = 320 <NEW_LINE> def __init__(self, parent=None, w=WIDTH, h=HEIGHT): <NEW_LINE> <INDENT> super(QDbgConsole, self).__init__(parent) <NEW_LINE> self._buffer = StringIO() <NEW_LINE> self.resize(w, h) <NEW_LINE> self.setReadOnly(True) <NEW_LINE... | A simple QTextEdit, with a few pre-set attributes and a file-like
interface. | 62598edda79ad1619776858a |
class ColourHandler(StreamHandler): <NEW_LINE> <INDENT> colours = { 'DEBUG': Fore.RESET, 'INFO': Fore.GREEN, 'WARNING': Fore.YELLOW, 'ERROR': Fore.RED, 'CRITICAL': Fore.RED } <NEW_LINE> def emit(self, record): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> message = self.format(record) <NEW_LINE> self.stream.write(self.c... | A colorized output SteamHandler | 62598edd460517430c4309f8 |
class OnlyWithAnyCategoryTagMatcher(TagMatcher): <NEW_LINE> <INDENT> def __init__(self, value_provider, tag_prefix=None, value_sep=None): <NEW_LINE> <INDENT> warnings.warn("Use ActiveTagMatcher instead.", DeprecationWarning) <NEW_LINE> super(OnlyWithAnyCategoryTagMatcher, self).__init__() <NEW_LINE> if value_sep is Non... | Provides a tag matcher that matches any category that follows the
"@only.with_" tag schema and determines if it should run or
should be excluded from the run-set (at runtime).
TAG SCHEMA: @only.with_{category}={value}
.. seealso:: OnlyWithCategoryTagMatcher
.. deprecated:: Use :class:`ActiveTagMatcher` instead.
EXAM... | 62598eddb7558d5895461bbb |
class Base(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.today = date.today() <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def write_to_database(self, task, _date): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def read_from_database(self, _date=None): <NEW_LINE> <IN... | Абстрактный класс для создания общего интерфейся работы с БД.
write_to_database() - записывает введенную пользователем информацию в БД,
read_from_database() - читает информацию из БД. | 62598eddbe383301e0251d46 |
class JSONWriter(Writer): <NEW_LINE> <INDENT> def __init__(self, file_handle): <NEW_LINE> <INDENT> super(JSONWriter, self).__init__(file_handle) <NEW_LINE> self.write_count = 0 <NEW_LINE> self.file_handle.write("[") <NEW_LINE> <DEDENT> def write(self, record): <NEW_LINE> <INDENT> Writer.write(self, record) <NEW_LINE> i... | A class for writing records as an array of MARC-in-JSON objects.
IMPORTANT: You must the close a JSONWriter,
otherwise you will not get valid JSON.
Simple usage::
.. code-block:: python
from pymarc import JSONWriter
# writing to a file
writer = JSONWriter(open('file.json','wt'))
writer.write(record... | 62598edd4a966d76dd5ed453 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.