code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PlaintextMessage(Message): <NEW_LINE> <INDENT> def __init__(self, text, shift): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> self.shift = shift <NEW_LINE> self.valid_words = load_words("words.txt") <NEW_LINE> message = Message(text) <NEW_LINE> self.encrypting_dict = message.build_shift_dict(shift) <NEW_LINE> s... | PlaintextMessage class | 62598faad486a94d0ba2bf39 |
class investment: <NEW_LINE> <INDENT> def __init__(self, positions, num_trials): <NEW_LINE> <INDENT> self.positions = positions <NEW_LINE> self.num_trials = num_trials <NEW_LINE> self.position_value = 1000 / positions <NEW_LINE> <DEDENT> def simulate(self): <NEW_LINE> <INDENT> cumu_ret = np.zeros(self.num_trials) <NEW_... | Create class investment | 62598faa442bda511e95c3c2 |
class GettextLocale(Locale): <NEW_LINE> <INDENT> def __init__(self, code: str, translations: gettext.NullTranslations) -> None: <NEW_LINE> <INDENT> self.ngettext = translations.ngettext <NEW_LINE> self.gettext = translations.gettext <NEW_LINE> super().__init__(code) <NEW_LINE> <DEDENT> def translate( self, message: str... | Locale implementation using the `gettext` module. | 62598faacb5e8a47e493c12e |
class ActivePool: <NEW_LINE> <INDENT> start = time.time() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ActivePool, self).__init__() <NEW_LINE> self.active = [] <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> <DEDENT> def makeActive(self, name): <NEW_LINE> <INDENT> with self.lock: <NEW_LINE> <INDENT> self... | Воображаемый пул соединений | 62598faa435de62698e9bd61 |
class SpiralStepHook(StepHook): <NEW_LINE> <INDENT> def __init__(self, max_episode_steps, save_global_step_interval, outdir): <NEW_LINE> <INDENT> self.max_episode_steps = max_episode_steps <NEW_LINE> self.save_global_step_interval = save_global_step_interval <NEW_LINE> self.outdir = outdir <NEW_LINE> <DEDENT> def __cal... | Ask the agent to compute reward at the current drawn picture | 62598faa435de62698e9bd62 |
class NonceFlagUsed(db.Model): <NEW_LINE> <INDENT> challenge_cid = db.Column(db.BigInteger, db.ForeignKey('challenge.cid'), primary_key=True) <NEW_LINE> nonce = db.Column(db.BigInteger, primary_key=True) <NEW_LINE> team_tid = db.Column(db.Integer, db.ForeignKey('team.tid')) <NEW_LINE> @classmethod <NEW_LINE> def create... | Single-time used flags. | 62598faa8c0ade5d55dc3647 |
class UserProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, first_name, last_name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError("User must have an email address") <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.mode... | Manager for UserProfile model | 62598faa8e7ae83300ee900d |
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, myplane): <NEW_LINE> <INDENT> super().__init__() <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 = myplane.rect.centerx <NEW_LINE> ... | 一个对飞机发射的子弹进行管理的类 | 62598faa56ac1b37e6302158 |
class Test_SetDataStrict(Test_SetData): <NEW_LINE> <INDENT> def TestFunction(self, gTarget, gPath, gValue): <NEW_LINE> <INDENT> TestModule.SetDataStrict(gTarget, gPath, gValue) <NEW_LINE> <DEDENT> def test_IndexAccessNonExisting(self): <NEW_LINE> <INDENT> iLen = len(self.List) <NEW_LINE> for iIndex in range(1, 5): <NEW... | Test cases for the function SetDataStrict() from the module
universal_access.
Implements tests ID TEST-T-540. Covers requirements REQ-FUN-540,
REQ-AWM-500, REQ-AWM-502 and REQ-AWM-503. | 62598faa91af0d3eaad39d7c |
class TransitionEvent(CommandEvent): <NEW_LINE> <INDENT> def __init__(self, commands, destination): <NEW_LINE> <INDENT> CommandEvent.__init__(self, commands) <NEW_LINE> self.destination = destination <NEW_LINE> <DEDENT> def on_success(self, game): <NEW_LINE> <INDENT> game.pc.move_to_room(self.destination) <NEW_LINE> ga... | Transition (movement) event.
Transition events are those that move the player character from one
room to another.
Attributes:
destination: Room object where the player character will be
transported on this event's success. | 62598faa1f037a2d8b9e4059 |
class SaveDirty(Operator): <NEW_LINE> <INDENT> bl_idname = "image.save_dirty" <NEW_LINE> bl_label = "Save Dirty" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> unique_paths = set() <NEW_LINE> for image in bpy.data.images: <NEW_LINE> <INDENT> if image.is_dirty: <N... | Save all modified textures | 62598faad7e4931a7ef3c002 |
class CalendarWidget(qt_widgets.QWidget): <NEW_LINE> <INDENT> def __init__(self, title="Calendar"): <NEW_LINE> <INDENT> super(CalendarWidget, self).__init__() <NEW_LINE> self.setWindowTitle(title) <NEW_LINE> layout = qt_widgets.QGridLayout() <NEW_LINE> layout.setColumnStretch(1, 1) <NEW_LINE> self.cal = qt_widgets.QCal... | Creates a calendar widget allowing the user to select a date. | 62598faa5fcc89381b266102 |
class itkDenseFiniteDifferenceImageFilterIF3IF3(itkFiniteDifferenceImageFilterPython.itkFiniteDifferenceImageFilterIF3IF3): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No... | Proxy of C++ itkDenseFiniteDifferenceImageFilterIF3IF3 class | 62598faa67a9b606de545f38 |
class ForceGarbageCollectionTests(unittest.SynchronousTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.config = trial.Options() <NEW_LINE> self.log = [] <NEW_LINE> self.patch(gc, 'collect', self.collect) <NEW_LINE> test = pyunit.FunctionTestCase(self.simpleTest) <NEW_LINE> self.test = TestSuite(... | Tests for the --force-gc option. | 62598faa66673b3332c30337 |
class LastOrgTicketLoaderRunAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ["org_id", "last", "runtime", "success"] <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = LastOrgTicketLoaderRun | Override the default Django Admin website display of Ticket app | 62598faa30dc7b766599f7b9 |
class PublicSearchHandler(myRequestHandler, Entity2): <NEW_LINE> <INDENT> def get(self, path=None, search=None): <NEW_LINE> <INDENT> if not path: <NEW_LINE> <INDENT> self.redirect('/public') <NEW_LINE> <DEDENT> search = urllib.unquote_plus(search.strip('/').strip('-')) <NEW_LINE> if not search: <NEW_LINE> <INDENT> self... | Show public search results. | 62598faa498bea3a75a57a8a |
class BaseDirectoryDiffer(object): <NEW_LINE> <INDENT> def __init__(self, dir1, dir2): <NEW_LINE> <INDENT> if not self.validate(dir1) or not self.validate(dir2): <NEW_LINE> <INDENT> raise ValueError('is not a dir') <NEW_LINE> <DEDENT> self.dir1 = dir1 <NEW_LINE> self.dir2 = dir2 <NEW_LINE> self.files = self.list_files(... | Compare two directory and differ by the same filename in two directory | 62598faa627d3e7fe0e06e19 |
class LoggedMessage(models.Model): <NEW_LINE> <INDENT> to = models.EmailField(help_text=_lazy("Address to which the the Email was sent.")) <NEW_LINE> user = models.ForeignKey( settings.AUTH_USER_MODEL, related_name="logged_emails", on_delete=models.SET_NULL, null=True, blank=True, db_index=True, ) <NEW_LINE> template: ... | Record of emails sent via Appmail. | 62598faa92d797404e388b1b |
class ServicePage(Page): <NEW_LINE> <INDENT> def __init__(self, version, response, solution): <NEW_LINE> <INDENT> super(ServicePage, self).__init__(version, response) <NEW_LINE> self._solution = solution <NEW_LINE> <DEDENT> def get_instance(self, payload): <NEW_LINE> <INDENT> return ServiceInstance(self._version, paylo... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598faa60cbc95b063642ba |
class SwitchLayer(NeuronLayer): <NEW_LINE> <INDENT> def __init__(self, dim, name=None): <NEW_LINE> <INDENT> Module.__init__(self, dim, dim * 2, name) <NEW_LINE> <DEDENT> def _forwardImplementation(self, inbuf, outbuf): <NEW_LINE> <INDENT> outbuf[:self.indim] += sigmoid(inbuf) <NEW_LINE> outbuf[self.indim:] += 1 - sigmo... | Layer that implements pairwise multiplication. | 62598faaa8370b77170f0348 |
class HTTPUnsupportedMediaType(HTTPClientError): <NEW_LINE> <INDENT> code = 415 <NEW_LINE> status = b'Unsupported Media Type' <NEW_LINE> explanation = 'The request media type is not supported by this server.' | 415 Unsupported Media Type
The server is refusing to service the request because the entity of the
request is in a format not supported by the requested resource for the
requested method.
For information, see RFC 2616 §10.:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1 | 62598faad58c6744b42dc28c |
class TunneldiggerBrokerConfig(cgm_models.PackageConfig, cgm_models.RoutableInterface): <NEW_LINE> <INDENT> uplink_interface = registry_fields.ReferenceChoiceField( cgm_models.InterfaceConfig, limit_choices_to=lambda model: getattr(model, 'uplink', False), related_name='+', help_text=_("Select on which interface the br... | Tunneldigger broker configuration. | 62598faa76e4537e8c3ef51a |
class ExtendedSaleOrder(models.Model): <NEW_LINE> <INDENT> _inherit = 'sale.order' <NEW_LINE> nrg_accounting_paytype = fields.Many2one('nrg.accounting.paytype', 'Payment Type', required=True) <NEW_LINE> nrg_accounting_paytype_fund = fields.Many2one('nrg.accounting.paytype.fund', 'Fund') <NEW_LINE> nrg_accounting_ref_pa... | Inherits sale.order and adds payment type. | 62598faa4a966d76dd5eee4e |
class ModelSaver(Callback): <NEW_LINE> <INDENT> def __init__(self, max_to_keep=10, keep_checkpoint_every_n_hours=0.5, checkpoint_dir=None, var_collections=None): <NEW_LINE> <INDENT> if var_collections is None: <NEW_LINE> <INDENT> var_collections = [tf.GraphKeys.GLOBAL_VARIABLES] <NEW_LINE> <DEDENT> self._max_to_keep = ... | Save the model once triggered. | 62598faa4e4d562566372392 |
class Supplement: <NEW_LINE> <INDENT> def __init__(self, middleware, environ): <NEW_LINE> <INDENT> self.middleware = middleware <NEW_LINE> self.environ = environ <NEW_LINE> self.source_url = request.construct_url(environ) <NEW_LINE> <DEDENT> def extraData(self): <NEW_LINE> <INDENT> data = {} <NEW_LINE> cgi_vars = data[... | This is a supplement used to display standard WSGI information in
the traceback. | 62598faa0a50d4780f70534a |
class TableQuestionViewJSON(QuestionView.QuestionViewJSON): <NEW_LINE> <INDENT> name = 'table_question' | TableQuestionViewJSON class represents the implementation of exporting a table question to a JSON formatted string.
This class extends from another class, using an implemention like this:
.. code:: python
from report_builder.Question import QuestionView
class TableQuestionViewJSON(QuestionView.QuestionViewJS... | 62598faa8e71fb1e983bba1f |
class RedisSession: <NEW_LINE> <INDENT> _pool = None <NEW_LINE> async def get_redis_pool(self): <NEW_LINE> <INDENT> if not self._pool: <NEW_LINE> <INDENT> self._pool = await asyncio_redis.Pool.create( host=str(REDIS_DICT.get('REDIS_ENDPOINT', "localhost")), port=int(REDIS_DICT.get('REDIS_PORT', 6379)), poolsize=int(RED... | 建立redis连接池 | 62598faa7b25080760ed741a |
class FormGroup(Component): <NEW_LINE> <INDENT> @_explicitize_args <NEW_LINE> def __init__(self, children=None, id=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, row=Component.UNDEFINED, check=Component.UNDEFINED, inline=Component.UNDEFINED, disabled=Component.UNDEFINED, **kwargs): <NEW_... | A FormGroup component.
Keyword arguments:
- children (a list of or a singular dash component, string or number; optional): The children of this component
- id (string; optional): The ID of this component, used to identify dash components
in callbacks. The ID needs to be unique across all of the
components in an app.
... | 62598faa8da39b475be03151 |
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=60): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kWh battery.") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE... | Простая модель аккумулятора электромобиля. | 62598faa7047854f4633f346 |
class CourseModeAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> form = CourseModeForm <NEW_LINE> search_fields = ('course_id',) <NEW_LINE> list_display = ( 'id', 'course_id', 'mode_slug', 'mode_display_name', 'min_price', 'suggested_prices', 'currency', 'expiration_date', 'expiration_datetime_custom', 'sku' ) <NEW_LINE> d... | Admin for course modes | 62598faa4c3428357761a227 |
class PostgreSQLDatabase(Database): <NEW_LINE> <INDENT> query_cls = PostgreSQLQuery <NEW_LINE> def __init__(self, host="localhost", port=5432, database=None, user=None, password=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(host, port, database, **kwargs) <NEW_LINE> self.user = user <NEW_LINE> self.password = p... | PostgreSQL client that uses the psycopg module. | 62598faaf7d966606f747f52 |
class MinBinaryHeapTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_binary_heap_insertion(self): <NEW_LINE> <INDENT> print("Inserting Elements in Binary Heap") <NEW_LINE> bh = MinBinaryHeap() <NEW_LINE> elements:List[int] = [random.randrange(0,1000) for _ in range(10)] <NEW_LINE> print('Elements are:{}'.format... | Test for Min Binary Tree | 62598faaac7a0e7691f72477 |
class UniformRandomPolicy(Policy): <NEW_LINE> <INDENT> def __init__(self, mdp): <NEW_LINE> <INDENT> self.mdp = mdp <NEW_LINE> self.policy_mapping = {} <NEW_LINE> for state in mdp.get_state_set(): <NEW_LINE> <INDENT> self.policy_mapping[state] = {} <NEW_LINE> possible_actions = mdp.get_possible_action_mapping()[state] <... | Implements a uniform random distribution over possible actions
from each state | 62598faae1aae11d1e7ce7da |
class Brick(): <NEW_LINE> <INDENT> def __init__(self, x, y, coin, sz): <NEW_LINE> <INDENT> self.xps = x <NEW_LINE> self.yps = y <NEW_LINE> self.coin = coin <NEW_LINE> self.size = sz <NEW_LINE> <DEDENT> def print_on_board(self, xps, yps): <NEW_LINE> <INDENT> BOARD.make_brick(xps, yps, self.coin, self.size) <NEW_LINE> <D... | brick | 62598faa0c0af96317c562f0 |
class Logic(object): <NEW_LINE> <INDENT> op_2class = {} <NEW_LINE> def __new__(cls, *args): <NEW_LINE> <INDENT> obj = object.__new__(cls) <NEW_LINE> obj.args = args <NEW_LINE> return obj <NEW_LINE> <DEDENT> def __getnewargs__(self): <NEW_LINE> <INDENT> return self.args <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE>... | Logical expression | 62598faa99cbb53fe6830e44 |
class AiogitParsingError(AiogitException, ValueError): <NEW_LINE> <INDENT> pass | Raised when a parsing failed (such as the return of a git command or a diff
file). | 62598faa851cf427c66b822c |
class TestMatrixParenthesis(unittest.TestCase): <NEW_LINE> <INDENT> def test_basic(self): <NEW_LINE> <INDENT> arr = [Matrix(4, 5), Matrix(5, 6), Matrix(6, 7)] <NEW_LINE> self.assertEqual(get_cost(0, 1, 2, arr), 4 * 5 * 6 * 7) <NEW_LINE> <DEDENT> def test_get_min_cost(self): <NEW_LINE> <INDENT> self.assertEqual() | Test. | 62598faa796e427e5384e701 |
class VcfFileFixer: <NEW_LINE> <INDENT> def __init__(self, args, argv): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.argv = tuple(argv or []) <NEW_LINE> self.output_vcf = self.args.output_vcf <NEW_LINE> self.state = STATE_INITIAL <NEW_LINE> self.seen_contig_line = False <NEW_LINE> self.handlers = ( self._run_in... | Implementation of file fixing.
Care has been taken to only look at lines when necessary as doing this in
Python quickly becomes an I/O bottleneck. | 62598faa4e4d562566372393 |
class BaseCLI(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.hostname = conf.properties['main.server.hostname'] <NEW_LINE> cls.katello_user = conf.properties['foreman.admin.username'] <NEW_LINE> cls.katello_passwd = conf.properties['foreman.admin.password'] ... | Base class for all cli tests | 62598faa6e29344779b005ca |
class Station(AbstractTimeTrackable, AbstractLocation): <NEW_LINE> <INDENT> TYPE_SMOGLY = 'smogly' <NEW_LINE> TYPE_CUSTOM = 'custom' <NEW_LINE> TYPE_AQICN = 'aqicn' <NEW_LINE> TYPE_BASIC_SDS011 = 'basic-sds011' <NEW_LINE> TYPE_CHOICES = ( (TYPE_SMOGLY, 'SMOGLY'), (TYPE_CUSTOM, 'CUSTOM'), (TYPE_AQICN, 'AQICN'), (TYPE_BA... | Model representing sensor station. Can be grouped using Project model. | 62598faa8a43f66fc4bf20ea |
class Movie(object): <NEW_LINE> <INDENT> def __init__(self, title, storyline, poster_image_url, trailer_youtube_url): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.storyline = storyline <NEW_LINE> self.poster_image_url = poster_image_url <NEW_LINE> self.trailer_youtube_url = trailer_youtube_url | Holds infos about a Movie
Args:
title: Movie's title
storyline: Movie's storyline
poster_image_url: Movie's poster image URL
trailer_youtube_url: Movie's trailer Youtube URL
Behavior:
Create an instance of the Movie class
Returns:
void | 62598faabe8e80087fbbefd1 |
class Mode(): <NEW_LINE> <INDENT> def __init__(self, minibatch=True, nce=False): <NEW_LINE> <INDENT> self.minibatch = minibatch <NEW_LINE> self.nce = nce | Network Mode Selection
Enumeration of options for selecting network mode. This will create a
slightly different output for different purposes.
- ``minibatch``: Process mini-batches with multiple sequences and time
steps. The output is a matrix with one less time
steps containin... | 62598faa5fdd1c0f98e5df05 |
class ProjectMessage(message.Message): <NEW_LINE> <INDENT> project_schema = { "type": "object", "properties": { "backend": {"type": "string"}, "created_on": {"type": "number"}, "ecosystem": {"type": "string"}, "homepage": {"type": "string"}, "id": {"type": "integer"}, "name": {"type": "string"}, "regex": {"anyOf": [{"t... | Base class for every project message.
Attributes:
project_schema (str): Project schema definition | 62598faaa8ecb0332587117e |
class AiReviewTaskPoliticalOcrResult(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Status = None <NEW_LINE> self.ErrCodeExt = None <NEW_LINE> self.ErrCode = None <NEW_LINE> self.Message = None <NEW_LINE> self.Input = None <NEW_LINE> self.Output = None <NEW_LINE> <DEDENT> def _deserial... | 内容审核 Ocr 文字敏感任务结果类型
| 62598faa66656f66f7d5a35f |
class Tag(models.Model): <NEW_LINE> <INDENT> title = models.CharField( max_length=200, help_text='Short descriptive name for this tag.', ) <NEW_LINE> slug = models.SlugField( max_length=255, db_index=True, unique=True, help_text='Short descriptive unique name for use in urls.', ) <NEW_LINE> def __str__(self): <NEW_LINE... | Tag model to be used for tagging content. Tags are to be used to describe
your content in more detail, in essence providing keywords associated with
your content. Tags can also be seen as micro-categorization of a site's
content. | 62598faad486a94d0ba2bf3c |
class Summary(Collector): <NEW_LINE> <INDENT> kind = MetricsTypes.summary <NEW_LINE> REPR_STR = "summary" <NEW_LINE> DEFAULT_INVARIANTS = ((0.50, 0.05), (0.90, 0.01), (0.99, 0.001)) <NEW_LINE> SUM_KEY = "sum" <NEW_LINE> COUNT_KEY = "count" <NEW_LINE> def __init__( self, name: str, doc: str, const_labels: LabelsType = N... | A Summary metric captures individual observations from an event or sample
stream and summarizes them in a manner similar to traditional summary
statistics:
1. sum of observations,
2. observation count,
3. rank estimations.
Example use cases for Summaries:
- Response latency
- Request size | 62598faa2c8b7c6e89bd3734 |
class Clean(Command): <NEW_LINE> <INDENT> user_options = [] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> pass | Command to clean up the directory. | 62598faa7d43ff24874273b9 |
@implementer(ICheckerFactory, plugin.IPlugin) <NEW_LINE> class AnonymousCheckerFactory(object): <NEW_LINE> <INDENT> authType = 'anonymous' <NEW_LINE> authHelp = anonymousCheckerFactoryHelp <NEW_LINE> argStringFormat = 'No argstring required.' <NEW_LINE> credentialInterfaces = (IAnonymous,) <NEW_LINE> def generateChecke... | Generates checkers that will authenticate an anonymous request. | 62598faa30dc7b766599f7bb |
class Project(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'project' <NEW_LINE> id = Column(GUID, primary_key=True, default=uuid4) <NEW_LINE> slug = Column(String(64), unique=True, nullable=False) <NEW_LINE> repository_id = Column(GUID, ForeignKey('repository.id', ondelete="RESTRICT"), nullable=False) <NEW_LINE> name... | The way we organize changes. Each project is linked to one repository, and
usually kicks off builds for it when new revisions come it (or just for
some revisions based on filters.) Projects use build plans (see plan) to
describe the work to be done for a build. | 62598faad58c6744b42dc28d |
@attr.s <NEW_LINE> class SolutionInput: <NEW_LINE> <INDENT> start = attr.ib() <NEW_LINE> stop = attr.ib() <NEW_LINE> max_steps = attr.ib() <NEW_LINE> num_heights = attr.ib() <NEW_LINE> relative_tolerance = attr.ib() <NEW_LINE> absolute_tolerance = attr.ib() <NEW_LINE> v_rin_on_c_s = attr.ib() <NEW_LINE> v_a_on_c_s = at... | Container for parsed input for solution | 62598faa76e4537e8c3ef51c |
@dataclass(order=True, frozen=True) <NEW_LINE> class Dependencies(): <NEW_LINE> <INDENT> deps: FS[Dependency] = field(default_factory=frozenset) <NEW_LINE> @classmethod <NEW_LINE> def fromlist(cls, deps: L[Dependency]) -> 'Dependencies': <NEW_LINE> <INDENT> return cls(frozenset(deps)) <NEW_LINE> <DEDENT> def chase(self... | Methods depending on sets of dependencies | 62598faa5fc7496912d4823a |
class DatasetCollectionItem(HydraComplexModel): <NEW_LINE> <INDENT> _type_info = [ ('collection_id', Integer), ('dataset_id', Integer), ('cr_date', Unicode(default=None)), ] <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(DatasetCollectionItem, self).__init__() <NEW_LINE> if parent is None: <NEW_... | - **collection_id** Integer
- **dataset_id** Integer
- **cr_date** Unicode(default=None) | 62598faa99fddb7c1ca62da0 |
class ShowArp(ShowArp_iosxe): <NEW_LINE> <INDENT> pass | Parser for show arp | 62598faa7c178a314d78d40c |
class CueJobModel(QtGui.QStandardItemModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CueJobModel, self).__init__() <NEW_LINE> self.setHorizontalHeaderLabels(['Layer Name', 'Job Type', 'Frames', 'Depend Type']) <NEW_LINE> <DEDENT> def getAllLayers(self): <NEW_LINE> <INDENT> jobItem = self.item(... | Data model for a job, in Qt format. | 62598faa4428ac0f6e658493 |
class BackupUDBInstanceSlowLogRequestSchema(schema.RequestSchema): <NEW_LINE> <INDENT> fields = { "BackupName": fields.Str(required=True, dump_to="BackupName"), "BeginTime": fields.Int(required=True, dump_to="BeginTime"), "DBId": fields.Str(required=True, dump_to="DBId"), "EndTime": fields.Int(required=True, dump_to="E... | BackupUDBInstanceSlowLog - 备份UDB指定时间段的slowlog分析结果
| 62598faaf548e778e596b513 |
class GCodeException(Exception): <NEW_LINE> <INDENT> pass | Exceptions while parsing gcode.
| 62598faacb5e8a47e493c130 |
class ToggleableInteraction(TimeStampedModel): <NEW_LINE> <INDENT> objects = ToggleableInteractionManager() <NEW_LINE> user = models.ForeignKey( User ) <NEW_LINE> content_type = models.ForeignKey( ContentType, editable=False ) <NEW_LINE> object_id = models.PositiveIntegerField( editable=False ) <NEW_LINE> content_objec... | An abstract class for toggleable user-object interactions | 62598faa01c39578d7f12cef |
class PrewikkaResponse(object): <NEW_LINE> <INDENT> def __init__(self, data=None, headers=_sentinel, code=None, status_text=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.code = code <NEW_LINE> self.status_text = status_text <NEW_LINE> self.ext_content = {} <NEW_LINE> if headers is not _sentinel: <NEW_LINE... | HTML response
Use this class to render HTML in your view.
:param data: Data of the response
:param int code: HTTP response code
:param str status_text: HTTP response status text
If the type of data is a dict, it will be cast in a JSON string | 62598faacc0a2c111447af80 |
class Exploit(exploits.Exploit): <NEW_LINE> <INDENT> __info__ = { 'name': 'D-Link DWR-932 Info Disclosure', 'description': 'Module explois information disclosure vulnerability in D-Link DWR-932 devices. It is possible to retrieve sensitive information such as credentials.', 'authors': [ 'Saeed reza Zamanian' 'Marcin Bu... | Exploit implementation for D-Link DWR-932 Information Disclosure vulnerability.
If the target is vulnerable it allows to read credentials for administrator." | 62598faa4e4d562566372395 |
class UsernameExistsException(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value) | Username already exists in database. | 62598faa009cb60464d0148f |
class TestEventsListView: <NEW_LINE> <INDENT> url = reverse('events:list') <NEW_LINE> def test_events_list_shows_existing_events(self, client, authenticated_user, mocker): <NEW_LINE> <INDENT> events = factories.EventFactory.build_batch(2, slug='i-am-a-slug') <NEW_LINE> mocker.patch.object(views.EventListView, 'get_quer... | Test events.views.EventListView on '/events/'. | 62598faa8e7ae83300ee9012 |
class Color(models.Model): <NEW_LINE> <INDENT> title = models.CharField(verbose_name=_(u'Title'), max_length=64) <NEW_LINE> slug = models.SlugField(max_length=80) <NEW_LINE> color = models.CharField(verbose_name=_(u'Color'), max_length=7, default='#6699bb', help_text=_(u'HEX color, as #RRGGBB')) <NEW_LINE> class Meta: ... | Definition of product's colors. | 62598faa99cbb53fe6830e47 |
class Solution: <NEW_LINE> <INDENT> def numMatchingSubseq(self, S: str, words: List[str]) -> int: <NEW_LINE> <INDENT> def is_sub_seq(word): <NEW_LINE> <INDENT> pre_pos = -1 <NEW_LINE> for c in word: <NEW_LINE> <INDENT> if c not in index_map: return False <NEW_LINE> index = bisect_right(index_map[c], pre_pos) <NEW_LINE>... | Basic concept lies around, if our string is abcde, make a dict like this
{
"a": [0],
"b": [1],
"c": [2],
"d": [3],
"e": [4]
}
Now in case we want to check for a subsequence ace,
check if
-> -1 can be inserted in [0], such that, its not inserted at the last location of list.
-> 0 can be inserted ... | 62598faa26068e7796d4c8c4 |
class ImportApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def import_listtypes(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_http_da... | NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598faa67a9b606de545f3c |
class SshdMatchBlock(structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = config_file_pb2.SshdMatchBlock <NEW_LINE> rdf_deps = [ protodict.AttributedDict, ] | An RDFValue representation of an sshd config match block. | 62598faaf548e778e596b514 |
class OAuthQQUser(BaseModel): <NEW_LINE> <INDENT> user = models.ForeignKey("users.User", on_delete=models.CASCADE, verbose_name="用户") <NEW_LINE> openid = models.CharField(max_length=64, verbose_name="openid", db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = "tb_oauth_qq" <NEW_LINE> verbose_name = "Q... | QQ登录用户数据:继承BaseModel后补充必要字段 | 62598faa1f5feb6acb162b91 |
class TestIPDisabled(VppTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestIPDisabled, self).setUp() <NEW_LINE> self.create_pg_interfaces(range(2)) <NEW_LINE> self.pg0.admin_up() <NEW_LINE> self.pg0.config_ip6() <NEW_LINE> self.pg0.resolve_ndp() <NEW_LINE> self.pg1.admin_up() <NEW_LINE> <DEDE... | IPv6 disabled | 62598faa3d592f4c4edbae3c |
class BaseFile(object): <NEW_LINE> <INDENT> def __init__(self, name, expected_hash=None, hash_class=hashlib.sha256): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.expected_hash = expected_hash <NEW_LINE> self.hash_class = hash_class <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW... | Base class for virtual files.
| 62598faa32920d7e50bc5fc5 |
@ROUTER('/') <NEW_LINE> class GamesCollection(Resource): <NEW_LINE> <INDENT> @BUILDER.expect(pagination_args) <NEW_LINE> @BUILDER.marshal_with(games_collection) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> args = pagination_args.parse_args(request) <NEW_LINE> page = args.get('page', 1) <NEW_LINE> per_page = args.get('... | Lists all games, allows adding new ones to system. | 62598faa01c39578d7f12cf0 |
class Visualizer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Visualizer, self).__init__() <NEW_LINE> plt.ion() <NEW_LINE> self.bundle = {} <NEW_LINE> self.fig = plt.figure(figsize=(6,12)) <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> plt.ioff() <NEW_LINE> <DEDENT> def registe... | Visualizer for statistics, e.g. loss | 62598faaf9cc0f698b1c5281 |
class DynamicsAuthenticationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> OFFICE365 = "Office365" <NEW_LINE> IFD = "Ifd" <NEW_LINE> AAD_SERVICE_PRINCIPAL = "AADServicePrincipal" | All available dynamicsAuthenticationType values.
| 62598faa76e4537e8c3ef51d |
class LanguageHomePage(AbstractHomePage): <NEW_LINE> <INDENT> language_code = models.CharField(max_length=255) <NEW_LINE> settings_panels = TranslatablePage.settings_panels + [ FieldPanel('language_code'), ] <NEW_LINE> lexical_resources = StreamField( [('lexical_resource_link', ResourceLinkBlock())], blank=True, ) <NEW... | The landing page for each individual language site, which
links to the language's resources. | 62598faa379a373c97d98f83 |
class Timeout(IntegerField): <NEW_LINE> <INDENT> pass | A timeout field. | 62598faaaad79263cf42e745 |
class JSONSource(FileSource): <NEW_LINE> <INDENT> def _process_file(self, f): <NEW_LINE> <INDENT> import json <NEW_LINE> obj = json.load(f) <NEW_LINE> if isinstance(obj, list): <NEW_LINE> <INDENT> for record in obj: <NEW_LINE> <INDENT> yield record <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> yield obj | Source for reading from JSON files.
When processing JSON files, if the top-level object is a list, will
yield each member separately. Otherwise, yields the top-level
object. | 62598faa4c3428357761a22b |
class TestExportKeepass(tests.Test): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._tmpdir('keepass.kdbx') <NEW_LINE> self.keepass = Keepass(self.prefix) <NEW_LINE> self.keepass.all = True <NEW_LINE> <DEDENT> def test_keepass_exist(self): <NEW_LINE> <INDENT> self._init_keepass() <NEW_LINE> self.assertTr... | Test keepass general features. | 62598faae5267d203ee6b87b |
@dataclass <NEW_LINE> class SourceEvaluation: <NEW_LINE> <INDENT> commands_evaluations: List[CommandEvaluation] = field(default_factory=list) <NEW_LINE> source_execution_duration: float = field(default=0) <NEW_LINE> def __len__(self) -> int: <NEW_LINE> <INDENT> return len(self.commands_evaluations) <NEW_LINE> <DEDENT> ... | Evaluation result of a source. | 62598faa460517430c432015 |
class InvalidEventException(Exception): <NEW_LINE> <INDENT> pass | Raised when provided event key is invalid. | 62598faa5fc7496912d4823b |
class Profile(Id): <NEW_LINE> <INDENT> def __init__(self, dump, *args, **kwargs): <NEW_LINE> <INDENT> self.dump = dump <NEW_LINE> super(Profile, self).__init__(*args, **kwargs) | A Container Class for profile objects
(dereferenced URIs contained in the WebID cert SAN). | 62598faa4527f215b58e9e53 |
class AdminPortal2Server(amp.Command): <NEW_LINE> <INDENT> key = "AdminPortal2Server" <NEW_LINE> arguments = [(b"packed_data", Compressed())] <NEW_LINE> errors = {Exception: b"EXCEPTION"} <NEW_LINE> response = [] | Administration Portal -> Server
Sent when the portal needs to perform admin operations on the
server, such as when a new session connects or resyncs | 62598faa3317a56b869be503 |
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = '#' <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> Rectangle.number_of_instances += 1 <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def square(cls, si... | A rectangle
Attributes:
number_of_instances (int): total instances
print_symbol (any): symbol to represent size of rectangle
bigger_or_equal (rect_1, rect_2): compares 2 rectangles
square (size): makes a square
__width (int)
__height (int)
__str (str): rectangle shown in string form (#)
... | 62598faaac7a0e7691f7247b |
class BodySprite(pygame.sprite.DirtySprite): <NEW_LINE> <INDENT> def __init__(self, body, frame, imagename, imagesize=-1): <NEW_LINE> <INDENT> pygame.sprite.DirtySprite.__init__(self) <NEW_LINE> self.body = body <NEW_LINE> self.frame = frame <NEW_LINE> self.baseimage = loader.load_image(imagename, True) <NEW_LINE> self... | representation of a body on a frame | 62598faa7047854f4633f34b |
class TopTracksExistError(Exception): <NEW_LINE> <INDENT> pass | Some kind of problem with charging a payment. | 62598faa796e427e5384e705 |
@final <NEW_LINE> class InconsistentReturnVariableViolation(ASTViolation): <NEW_LINE> <INDENT> error_template = ( 'Found local variable that are only used in `return` statements' ) <NEW_LINE> code = 331 | Forbids local variable that are only used in ``return`` statements.
Reasoning:
This is done for consistency and more readable source code.
Solution:
Return the expression itself, instead of creating a temporary variable.
Example::
# Correct:
def some_function():
return 1
# Wrong:
de... | 62598faa851cf427c66b8230 |
class BaseConfig: <NEW_LINE> <INDENT> SECRET_KEY = config.SECRET_KEY <NEW_LINE> MAIL_SERVER = 'smtp.gmail.com' <NEW_LINE> MAIL_PORT = 465 <NEW_LINE> MAIL_USE_TLS = False <NEW_LINE> MAIL_USE_SSL = True <NEW_LINE> MAIL_USERNAME = config.SENDER_EMAIL <NEW_LINE> MAIL_PASSWORD = config.PASSWORD <NEW_LINE> MAIL_DEFAULT_SENDE... | Basic settings required by all classes | 62598faa0a50d4780f70534f |
class SynchronousException(Exception): <NEW_LINE> <INDENT> pass | Helper used to test remote methods which raise exceptions which are not
L{pb.Error} subclasses. | 62598faa6e29344779b005ce |
class UserDetector(): <NEW_LINE> <INDENT> def wrapper_if_logged_in(self, func): <NEW_LINE> <INDENT> def logged_in_or_error(self, *args): <NEW_LINE> <INDENT> if self.user_is_logged_in(): <NEW_LINE> <INDENT> return func(*args) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self.error(404) <NEW_LINE> <DEDENT> <DEDEN... | single class used to detect if user is loggedin or an admin or something else | 62598faadd821e528d6d8ea7 |
class nodesParser(fileParser): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> fileParser.__init__(self,filename) <NEW_LINE> self.Nodes={} <NEW_LINE> self.Relations=[] <NEW_LINE> <DEDENT> def lineParseCriteria(self,line): <NEW_LINE> <INDENT> return (len(line.strip())>1 and line.strip()[0] =='#') <... | docstring for nodesParser | 62598faadd821e528d6d8ea8 |
class Trans(Node): <NEW_LINE> <INDENT> def __init__(self, singular, plural, indicator, replacements, lineno=None, filename=None): <NEW_LINE> <INDENT> Node.__init__(self, lineno, filename) <NEW_LINE> self.singular = singular <NEW_LINE> self.plural = plural <NEW_LINE> self.indicator = indicator <NEW_LINE> self.replacemen... | A node for translatable sections. | 62598faa4e4d562566372398 |
class b2Profile(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> step = _swig_property(_Box2D.b2Profile_step_get, _Box2D.b2Profile_step_set) <NEW_LINE> collide = _swig_property(_Box2D.b2Profil... | Proxy of C++ b2Profile class | 62598faa6aa9bd52df0d4e3b |
class Factor(HasProps): <NEW_LINE> <INDENT> attr = String() <NEW_LINE> def __init__(self, attr): <NEW_LINE> <INDENT> self.attr = attr | Represents a factorization ("uniquification") of a particular
column. This is typically used to generate the unique set of values
for a categorical dimension, to feed in to things like facets and
color scales. | 62598faa379a373c97d98f85 |
class TagFeed(Feed): <NEW_LINE> <INDENT> def get_object(self,request,tag): <NEW_LINE> <INDENT> return get_object_or_404(Tag, slug=tag) <NEW_LINE> <DEDENT> def title(self,obj): <NEW_LINE> <INDENT> return u"yasar11732: %s ile ilgili makaleler" % obj.text <NEW_LINE> <DEDENT> def item_description(self,obj): <NEW_LINE> <IND... | 15 latest posts for a given tag. | 62598faaaad79263cf42e747 |
class Camera(Object3d): <NEW_LINE> <INDENT> def __init__(self, ortho, res_x, res_y): <NEW_LINE> <INDENT> super().__init__(self) <NEW_LINE> self.ortho = ortho <NEW_LINE> self.res_x = res_x <NEW_LINE> self.res_y = res_y <NEW_LINE> self.near_plane = 1 <NEW_LINE> self.far_plane = 100 <NEW_LINE> self.fov = math.radians(60) ... | Camera class.
It allows us to have a viewport into the scene. Each scene has a camera set. | 62598faad486a94d0ba2bf41 |
class StarWars(BaseProvider): <NEW_LINE> <INDENT> def planet(self): <NEW_LINE> <INDENT> return self.random_element(PLANETS) <NEW_LINE> <DEDENT> def film(self): <NEW_LINE> <INDENT> return self.random_element(FILMS) <NEW_LINE> <DEDENT> def person(self): <NEW_LINE> <INDENT> return self.random_element(PEOPLE) <NEW_LINE> <D... | A Faker provider for various entities from the Star Wars universe. | 62598faa67a9b606de545f3f |
class ReportOutputSerializer(serializers.Serializer): <NEW_LINE> <INDENT> def __init__(self, *args, output_fields=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.output_fields = output_fields <NEW_LINE> <DEDENT> def update(self, instance, validated_data): <NEW_LINE> <INDENT> pass ... | Default serializer for the report data
Serializes fields that are passed in the output_fields keyword argument
on instantiation. | 62598faa99cbb53fe6830e4b |
class GetRelatedResourceTests(TestBase): <NEW_LINE> <INDENT> def test_reverse_relation(self): <NEW_LINE> <INDENT> serializer = EntrySerializer() <NEW_LINE> field = serializer.fields['comments'] <NEW_LINE> self.assertEqual(utils.get_related_resource_type(field), 'comments') <NEW_LINE> <DEDENT> def test_m2m_relation(self... | Ensure the `get_related_resource_type` function returns correct types. | 62598faa26068e7796d4c8c8 |
class UnsupportedOperationException(Exception): <NEW_LINE> <INDENT> pass | The method is not supported by this DRMAA implementation. | 62598faa8a43f66fc4bf20f0 |
class NoOpLock(): <NEW_LINE> <INDENT> def acquire(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def release(self): <NEW_LINE> <INDENT> pass | A No-op lock class, to avoid a lot of "if self.lock:" in code using locks. | 62598faa5fcc89381b266106 |
class EditorDisplayTest(TaskEditorTestCase): <NEW_LINE> <INDENT> def getItems(self): <NEW_LINE> <INDENT> return [self.task] <NEW_LINE> <DEDENT> def createTasks(self): <NEW_LINE> <INDENT> self.task = task.Task('Task to edit') <NEW_LINE> self.stop_datetime = date.DateTime(2012, 12, 12, 12, 12) <NEW_LINE> self.task.setRec... | Does the editor display the task data correctly when opened? | 62598faa167d2b6e312b6ee5 |
class NetworkTimeoutError(NCPError, asyncio.TimeoutError): <NEW_LINE> <INDENT> pass | Raised when an NCP :class:`Connection` times out while performing network activity. | 62598faa71ff763f4b5e76e2 |
class BlockOperator(BlockOperatorBase): <NEW_LINE> <INDENT> blocked_source = True <NEW_LINE> blocked_range = True | A matrix of arbitrary |Operators|.
This operator can be :meth:`applied <pymor.operators.interface.Operator.apply>`
to a compatible :class:`BlockVectorArrays <pymor.vectorarrays.block.BlockVectorArray>`.
Parameters
----------
blocks
Two-dimensional array-like where each entry is an |Operator| or `None`. | 62598faa3d592f4c4edbae40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.