code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class NTRansition(SCPINode, SCPIQuery): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "NTRansition" <NEW_LINE> args = [] | STATus:DEVice:SINTegrity:AMPLitude:NTRansition
Arguments: | 62598fa899fddb7c1ca62d7e |
class h6(html_tag): <NEW_LINE> <INDENT> pass | Represents the sixth-highest ranking heading. | 62598fa8a79ad16197769f8f |
class ContentImageInline(admin.TabularInline): <NEW_LINE> <INDENT> model = ContentImage <NEW_LINE> extra = 1 | Use admin's "inline" feature to allow editing from the parent model page. | 62598fa83cc13d1c6d465697 |
class ContentProcessorMakoTest(TestCase): <NEW_LINE> <INDENT> def test_template(self): <NEW_LINE> <INDENT> item = MagicMock() <NEW_LINE> item.node.name = "localhost" <NEW_LINE> item.attributes = { 'context': { 'number': "47", }, 'encoding': "latin-1", } <NEW_LINE> item._template_content = "Hi fröm ${number}@${node.name... | Tests bundlewrap.items.files.content_processor_mako. | 62598fa863b5f9789fe85091 |
class ScriptNW(NodeWriter): <NEW_LINE> <INDENT> def start(self, node): <NEW_LINE> <INDENT> if 'type' in node and 'math/tex' in node['type']: <NEW_LINE> <INDENT> self.write('<%s' % node.name) <NEW_LINE> att = ' '.join(['%s="%s"' % (k, v) for k, v in node.items()]) <NEW_LINE> if att != '': <NEW_LINE> <INDENT> self.write(... | Handles some special types of scripts. | 62598fa88e7ae83300ee8fcd |
class BoolTest(object): <NEW_LINE> <INDENT> def __init__(self, b=True, s="true",): <NEW_LINE> <INDENT> self.b = b <NEW_LINE> self.s = s <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not ... | Attributes:
- b
- s | 62598fa8d486a94d0ba2bef9 |
class NewRule(Model): <NEW_LINE> <INDENT> name = StringType(required=True) <NEW_LINE> expr = StringType(required=True) <NEW_LINE> position = IntType() <NEW_LINE> stop_condition = BooleanType(default=False) <NEW_LINE> tags = ListType(StringType) <NEW_LINE> class Options: <NEW_LINE> <INDENT> serialize_when_none = False | New filter rule. | 62598fa88da39b475be0310e |
class strategy: <NEW_LINE> <INDENT> def __init__(self, pop_size, genome_size, srate, mrate): <NEW_LINE> <INDENT> self.n = pop_size <NEW_LINE> self._max_l = genome_size <NEW_LINE> self.srate = srate <NEW_LINE> self.mrate = mrate <NEW_LINE> <DEDENT> def generate_from_lengths (self, ls): <NEW_LINE> <INDENT> return np.stac... | This is a vanilla strategy used by sparkge. In principle this would be extended or changed for another bundle of functions. | 62598fa8be8e80087fbbef8e |
class Bullet(Projectile): <NEW_LINE> <INDENT> def expiryCheck(self): <NEW_LINE> <INDENT> if Vector(self.pos).y > self.parent.height: <NEW_LINE> <INDENT> self.expired = True | A kind of projectile that moves vertically upward and kills aliens
| 62598fa85166f23b2e243303 |
class TenantLib: <NEW_LINE> <INDENT> def __init__(self, tenant_config_loader: TenantConfigLoader, private_key_path: str, skills: List[Skill]) -> None: <NEW_LINE> <INDENT> self._tenant_config_loader = tenant_config_loader <NEW_LINE> self._tenants: Dict[int, Tenant] = {} <NEW_LINE> self._private_key_path = private_key_pa... | Creates and holds tenants registry.
Tenants are identified by chat user ID.
Each tenant has a set of handlers parameterized with tenant config. | 62598fa88e7ae83300ee8fce |
class _QueuePutDataManager(ObjectDataManager): <NEW_LINE> <INDENT> def __init__(self, queue, method, args=()): <NEW_LINE> <INDENT> super(_QueuePutDataManager, self).__init__(target=queue, call=method, args=args) <NEW_LINE> <DEDENT> def tpc_vote(self, tx): <NEW_LINE> <INDENT> if self.target.full(): <NEW_LINE> <INDENT> r... | A data manager that checks if the queue is full before putting.
Overrides :meth:`tpc_vote` for efficiency. | 62598fa8236d856c2adc93d2 |
class TestGetMove(unittest.TestCase): <NEW_LINE> <INDENT> def test_exit_on_q_entry(self): <NEW_LINE> <INDENT> with mock.patch('builtins.input', return_value='q'): <NEW_LINE> <INDENT> self.assertRaises(SystemExit, minesweep.get_move) <NEW_LINE> <DEDENT> <DEDENT> def test_return_is_tuple(self): <NEW_LINE> <INDENT> with m... | test function get_move | 62598fa8435de62698e9bd22 |
class DebugPanel(object): <NEW_LINE> <INDENT> has_content = False <NEW_LINE> context = {} <NEW_LINE> def __init__(self, context={}): <NEW_LINE> <INDENT> self.context.update(context) <NEW_LINE> self.slug = slugify(self.name) <NEW_LINE> <DEDENT> def dom_id(self): <NEW_LINE> <INDENT> return 'djDebug%sPanel' % (self.name.r... | Base class for debug panels. | 62598fa897e22403b383ae38 |
class Deployment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.commands() <NEW_LINE> <DEDENT> def commands(self): <NEW_LINE> <INDENT> op_con_list = {} <NEW_LINE> data = db_con_list(print_op=False) <NEW_LINE> connections_orignal = data.get('connections') <NEW_LINE> connections = {k:{x:y for x,y in v.... | class for deploying crawler framework | 62598fa8f548e778e596b4d0 |
class RedditorListingMixin(BaseListingMixin, GildedListingMixin): <NEW_LINE> <INDENT> @cachedproperty <NEW_LINE> def comments(self) -> SubListing: <NEW_LINE> <INDENT> return SubListing(self._reddit, self._path, "comments") <NEW_LINE> <DEDENT> @cachedproperty <NEW_LINE> def submissions(self) -> SubListing: <NEW_LINE> <I... | Adds additional methods pertaining to Redditor instances. | 62598fa876e4537e8c3ef4d9 |
class EmailEMLForm(forms.Form): <NEW_LINE> <INDENT> error_css_class = 'error' <NEW_LINE> required_css_class = 'required' <NEW_LINE> source = forms.ChoiceField(required=True, widget=forms.Select(attrs={'class': 'no_clear'}), label=form_consts.Email.SOURCE) <NEW_LINE> source_method = forms.CharField(required=False, widge... | Django form for uploading an EML email. | 62598fa855399d3f05626450 |
class _UsmUserOwnPrivKeyChange_Type(KeyChange): <NEW_LINE> <INDENT> defaultHexValue = "" | Custom type usmUserOwnPrivKeyChange based on KeyChange | 62598fa84a966d76dd5eee0e |
class Card(models.Model): <NEW_LINE> <INDENT> number = models.CharField(max_length=16, validators=[MinLengthValidator(16)], null=False) <NEW_LINE> pin = models.CharField(max_length=4, validators=[MinLengthValidator(4)], null=False) <NEW_LINE> cvv = models.CharField(max_length=3, validators=[MinLengthValidator(3)], null... | Store card data with number, pin, cvv, cash
Related to Person model | 62598fa86aa9bd52df0d4df5 |
class Scorer(): <NEW_LINE> <INDENT> def __init__(self, scoring_params): <NEW_LINE> <INDENT> self.available_methods=ScoringMethods() <NEW_LINE> self.scoring_params = scoring_params <NEW_LINE> self.default_sorting = 'association_score' <NEW_LINE> <DEDENT> def score(self, evs, stringency, datatypes, sortby=None ): <NEW_LI... | Calculate scores for a list of evidencestring documents | 62598fa84f88993c371f04a0 |
class PlayerGeneralSplits(_PlayerDashboard): <NEW_LINE> <INDENT> _endpoint = 'playerdashboardbygeneralsplits' <NEW_LINE> def location(self): <NEW_LINE> <INDENT> return _api_scrape(self.json, 1) <NEW_LINE> <DEDENT> def win_losses(self): <NEW_LINE> <INDENT> return _api_scrape(self.json, 2) <NEW_LINE> <DEDENT> def pre_pos... | Contains stats pertaining to location, wins and losses, pre/post all star
break, starting position, and numbers of days rest
Args:
:player_id: ID of the player to look up
:team_id: ID of the team to look up
:measure_type: Specifies type of measure to use (Base, Advanced, etc.)
:per_mode: Mode to measur... | 62598fa821bff66bcd722b92 |
class UserSettings(FieldsetForm): <NEW_LINE> <INDENT> def __init__(self, address_choices, *args, **kwargs): <NEW_LINE> <INDENT> super(UserSettings, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['address'] = forms.ChoiceField( choices=(address_choices), widget=forms.Select(), error_messages={'required': _("Plea... | Form handling the user settings.
| 62598fa8cc0a2c111447af3c |
class Node: <NEW_LINE> <INDENT> def __init__(self, val, isLeaf, topLeft, topRight, bottomLeft, bottomRight): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> self.isLeaf = isLeaf <NEW_LINE> self.topLeft = topLeft <NEW_LINE> self.topRight = topRight <NEW_LINE> self.bottomLeft = bottomLeft <NEW_LINE> self.bottomRight = bott... | Definition for a QuadTree node. | 62598fa830bbd7224646990e |
class GenericPointWiseLossEvaluator(AbstractEvaluator): <NEW_LINE> <INDENT> def __init__(self, loss_wrapper, label='loss', score_format='%f', batch_target_key='target'): <NEW_LINE> <INDENT> super(GenericPointWiseLossEvaluator, self).__init__() <NEW_LINE> self._loss_wrapper = loss_wrapper <NEW_LINE> self._label = label ... | Adapter that uses an object of a class derived from AbstractLossWrapper to calculate the loss during evaluation. | 62598fa801c39578d7f12cac |
class ItemCSVPipeline(object): <NEW_LINE> <INDENT> file_dict = {} <NEW_LINE> exporter_dict = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.item_list = calaccess_crawler.get_items() <NEW_LINE> self.file_dir = os.environ.get( 'SCRAPY_EXPORT_DIR', os.path.dirname(__file__) ) <NEW_LINE> for item_klass in self.... | Exports each item's records as a separate CSV file. | 62598fa8498bea3a75a57a4a |
class ConsoleLogStatusHandler(AbstractStatusTimetableHandler): <NEW_LINE> <INDENT> def add_timetable_error(self, e: Exception) -> None: <NEW_LINE> <INDENT> if isinstance(e, TimetableExistError): <NEW_LINE> <INDENT> print(f'Расписание {e.timetable} уже существует.') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> print(f'... | Логирует добавление расписания в консоль.
| 62598fa83cc13d1c6d465699 |
class GetAccountArg(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_account_id_value', '_account_id_present', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, account_id=None): <NEW_LINE> <INDENT> self._account_id_value = None <NEW_LINE> self._account_id_present = False <NEW_LINE> if account_id is... | :ivar users.GetAccountArg.account_id: A user's account identifier. | 62598fa8462c4b4f79dbb93a |
class Posterize(Operation): <NEW_LINE> <INDENT> def __init__(self, prob, magnitude): <NEW_LINE> <INDENT> super(Posterize, self).__init__(prob, magnitude) <NEW_LINE> <DEDENT> def __call__(self, image): <NEW_LINE> <INDENT> if random.uniform(0, 1) > self.prob: <NEW_LINE> <INDENT> return image <NEW_LINE> <DEDENT> else: <NE... | Reduce the number of bits for each pixel magnitude bits. | 62598fa8baa26c4b54d4f1de |
class B(A): <NEW_LINE> <INDENT> pass | def chapo(self):
print("this is last function from last class class object") | 62598fa83317a56b869be4e1 |
class Register(BaseRequest): <NEW_LINE> <INDENT> def handler_function(self): <NEW_LINE> <INDENT> args = self.get_request_data() <NEW_LINE> username = args.get('username', None) <NEW_LINE> password1 = args.get('password1', None) <NEW_LINE> password2 = args.get('password2', None) <NEW_LINE> key = args.get('registerKey', ... | 注册 | 62598fa83d592f4c4edbadfb |
class LocaleMiddleware(object): <NEW_LINE> <INDENT> response_redirect_class = HttpResponseRedirect <NEW_LINE> def process_request(self, request): <NEW_LINE> <INDENT> language = translation.get_language_from_request( request, check_path=self.is_language_prefix_patterns_used) <NEW_LINE> translation.activate(language) <NE... | This is a very simple middleware that parses a request
and decides what translation object to install in the current
thread context. This allows pages to be dynamically
translated to the language the user desires (if the language
is available, of course). | 62598fa88da39b475be03110 |
class SourcePrms: <NEW_LINE> <INDENT> def __init__(self, posn): <NEW_LINE> <INDENT> self.initialPosn = Vec3(posn) <NEW_LINE> <DEDENT> def getInitialPosn(self): <NEW_LINE> <INDENT> return self.initialPosn <NEW_LINE> <DEDENT> def getPosn(self, t): <NEW_LINE> <INDENT> raise NotImplementedException() | Base class for point-source distubance which generates elastic wave. | 62598fa87d43ff2487427399 |
class DeleteBruteAttacksRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Ids = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Ids = params.get("Ids") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(self).items(): <... | DeleteBruteAttacks请求参数结构体
| 62598fa824f1403a9268584a |
class CacheInvalidationTestCase(KALiteTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CacheInvalidationTestCase, self).setUp() <NEW_LINE> post_save.disconnect(receiver=updates.invalidate_on_video_update, sender=VideoFile) <NEW_LINE> VideoFile.objects.create(youtube_id="blah1", flagged_for_down... | Test that cache invalidation only happens ONCE per videoscan, even if multiple deletions are made.
See issue 3621. | 62598fa8236d856c2adc93d3 |
class UUIDUser(AbstractUser): <NEW_LINE> <INDENT> id = models.UUIDField(default=uuid.uuid4, primary_key=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = 'auth' | A user with a UUID as primary key | 62598fa82c8b7c6e89bd36f3 |
@final <NEW_LINE> class BooleanConditionVisitor(BaseNodeVisitor): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._same_nodes: List[ast.BoolOp] = [] <NEW_LINE> self._isinstance_calls: List[ast.BoolOp] = [] <NEW_LINE> <DEDENT> def vis... | Ensures that boolean conditions are correct. | 62598fa87047854f4633f307 |
class LabelCacheTests(unittest.TestCase): <NEW_LINE> <INDENT> cache = LabelCache() <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.cache.empty() <NEW_LINE> <DEDENT> def test_write(self): <NEW_LINE> <INDENT> self.cache.write('sort', 20) <NEW_LINE> self.cache.write('L1', 16) <NEW_LINE> self.assertTrue('sort' in self... | Tests basic functionality of the label cache. | 62598fa8f9cc0f698b1c525f |
class TelnetController: <NEW_LINE> <INDENT> def __init__(self, host_name, user_name, password, prompt): <NEW_LINE> <INDENT> self.host_name = host_name <NEW_LINE> self.user_name = user_name <NEW_LINE> self.password = password <NEW_LINE> self.prompt = prompt <NEW_LINE> self.tn = None <NEW_LINE> <DEDENT> def login(self): ... | Connect to remote host with TELNET and issue commands.
@ivar host_name: Host name or IP address
@ivar user_name: User name
@ivar password: Password
@ivar prompt: Command prompt (or partial string matching the end of the prompt)
@ivar tn: Instance of a telnetlib.Telnet object | 62598fa844b2445a339b6906 |
class BaseChannel(object): <NEW_LINE> <INDENT> cache_timeout = 60*60*4 <NEW_LINE> short_name = None <NEW_LINE> long_name = None <NEW_LINE> icon_path = None <NEW_LINE> description = None <NEW_LINE> root_url = '' <NEW_LINE> swf_url = None <NEW_LINE> is_abstract = True <NEW_LINE> status = STATUS_GOOD <NEW_LINE> default_ac... | The Base of all Channel classes. | 62598fa8b7558d589546355d |
class TMB_Panel: <NEW_LINE> <INDENT> bl_space_type = 'PROPERTIES' <NEW_LINE> bl_region_type = 'WINDOW' <NEW_LINE> bl_options = {'DEFAULT_CLOSED'} <NEW_LINE> bl_context = "render" <NEW_LINE> bl_category = 'True Motion Blur add-on' <NEW_LINE> COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} <NEW_LINE> @classmethod... | Not an Operator class, doesn't need to be registered as Operator | 62598fa885dfad0860cbfa0b |
class Domain(models.Model): <NEW_LINE> <INDENT> TYPES = [ ('MASTER', 'MASTER'), ('SLAVE', 'SLAVE'), ('NATIVE', 'NATIVE'), ] <NEW_LINE> id = models.IntegerField(primary_key=True) <NEW_LINE> name = models.CharField(max_length=255, null=False) <NEW_LINE> type = models.CharField(max_length=6, null=False, choices=TYPES) <NE... | PowerDNS Domain
Model to access domain in the PowerDNS db.
See https://doc.powerdns.com/authoritative/backends/generic-postgresql.html#default-schema | 62598fa86aa9bd52df0d4df7 |
class ClassAutoBalancedLoader(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def loadNextBatch(self, maxinstances = None): <NEW_LINE> <INDENT> pass | Future Implement Queue | 62598fa816aa5153ce400430 |
class DenseOpticalFlow(IOpticalFlow): <NEW_LINE> <INDENT> def set1stFrame(self, frame): <NEW_LINE> <INDENT> self.prev = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) <NEW_LINE> <DEDENT> def apply(self, frame): <NEW_LINE> <INDENT> next = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) <NEW_LINE> flow = cv2.calcOpticalFlowFarneback(se... | Abstract class for DenseOpticalFlow expressions | 62598fa863d6d428bbee26e0 |
class ConnScan(common.AbstractScanCommand): <NEW_LINE> <INDENT> scanners = [PoolScanConn] <NEW_LINE> meta_info = dict( author = 'Brendan Dolan-Gavitt', copyright = 'Copyright (c) 2007,2008 Brendan Dolan-Gavitt', contact = 'bdolangavitt@wesleyan.edu', license = 'GNU General Public License 2.0', url = 'http://moyix.blogs... | Pool scanner for tcp connections | 62598fa81f5feb6acb162b4f |
class Min(Aggregation): <NEW_LINE> <INDENT> def __init__(self, column_name): <NEW_LINE> <INDENT> self._column_name = column_name <NEW_LINE> <DEDENT> def get_aggregate_data_type(self, table): <NEW_LINE> <INDENT> column = table.columns[self._column_name] <NEW_LINE> if isinstance(column.data_type, (Date, DateTime, Number,... | Find the minimum value in a column.
This aggregation can be applied to columns containing :class:`.Date`,
:class:`.DateTime`, or :class:`.Number` data.
:param column_name:
The name of the column to be searched. | 62598fa821bff66bcd722b94 |
class Solution: <NEW_LINE> <INDENT> def lowestCommonAncestorII(self, root, A, B): <NEW_LINE> <INDENT> check_none_list = [root, A, B] <NEW_LINE> if any(map(lambda x: x is None, check_none_list)): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> visited = set() <NEW_LINE> visited.add(root) <NEW_LINE> A_ptr = A <NEW_LI... | @param root: The root of the tree
@param A and B: Two node in the tree
@return: The lowest common ancestor of A and B | 62598fa867a9b606de545efa |
class RatbagdDevice(_RatbagdDBus): <NEW_LINE> <INDENT> CAP_NONE = 0 <NEW_LINE> CAP_QUERY_CONFIGURATION = 1 <NEW_LINE> CAP_RESOLUTION = 100 <NEW_LINE> CAP_SWITCHABLE_RESOLUTION = 101 <NEW_LINE> CAP_PROFILE = 200 <NEW_LINE> CAP_SWITCHABLE_PROFILE = 201 <NEW_LINE> CAP_DISABLE_PROFILE = 202 <NEW_LINE> CAP_DEFAULT_PROFILE =... | Represents a ratbagd device. | 62598fa866673b3332c302f9 |
class bitmap_8bpp(bitmap): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> bitmap.__init__(self, 8, width, height) <NEW_LINE> self.palette = [ 0x00FF00FF, 0x00000000, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFFFF] <NEW_LINE> self.INDEX_MAGENTA = 0 <NEW_LINE> self.INDEX_BLACK = 1 <NEW_LINE>... | An uncompressed RGB bitmap that has 8 bits per pixel. | 62598fa832920d7e50bc5f84 |
class RHConfAddPaperReviewManager( RHConfModifReviewingBase ): <NEW_LINE> <INDENT> def _process( self ): <NEW_LINE> <INDENT> params = self._getRequestParams() <NEW_LINE> if "selectedPrincipals" in params: <NEW_LINE> <INDENT> ph = user.PrincipalHolder() <NEW_LINE> for id in self._normaliseListParam( params["selectedPrin... | Only conference managers can add paper review managers,
so this class inherits from RHConferenceModifBase | 62598fa87047854f4633f308 |
class Device(object): <NEW_LINE> <INDENT> def __init__(self, hostname): <NEW_LINE> <INDENT> self.hostname = hostname <NEW_LINE> self.SSHClient = paramiko.SSHClient() <NEW_LINE> self.RemoteShell = None <NEW_LINE> self.username = "" <NEW_LINE> self.password = "" <NEW_LINE> <DEDENT> def connect(self, username, password): ... | Represents a remote controlled device connected with SSH.
The Device class is a generic that interacts witht the Activity module.
Any specific device must inherit from this Device class and
implement the methods login() and super().
Source:
http://jessenoller.com/blog/2009/02/05/ssh-programming-with-paramiko-comp... | 62598fa8498bea3a75a57a4c |
class AarTopology(Topo): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Topo.__init__(self) <NEW_LINE> hosts = [ self.addHost('h%s' % (n + 1)) for n in range(6) ] <NEW_LINE> switches = [ self.addSwitch('s%s' % (n + 1)) for n in range(6) ] <NEW_LINE> for i in range(3): <NEW_LINE> <INDENT> self.addLink( host... | Application aware routing custom toplogy | 62598fa899fddb7c1ca62d80 |
class PluginManager(object): <NEW_LINE> <INDENT> def __init__(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> __instance = None <NEW_LINE> __lock = threading.Lock() <NEW_LINE> __plugin_list = [] <NEW_LINE> @staticmethod <NEW_LINE> def getManager(): <NEW_LINE> <INDENT> PluginManager.__lock.acquire() <NEW_LINE> if no... | Plugin Manager | 62598fa88e7ae83300ee8fd1 |
class UnitRegistry(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.units = set() <NEW_LINE> self.units_for_dimensions = collections.defaultdict(list) <NEW_LINE> <DEDENT> def add(self, u): <NEW_LINE> <INDENT> if u in self.units: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.units.add(u) <... | Stores known units for printing in best units.
All a user needs to do is to use the `register_new_unit`
function.
Default registries:
The units module defines three registries, the standard units,
user units, and additional units. Finding best units is done
by first checking standard, then user, then additional. New... | 62598fa87cff6e4e811b5959 |
class SinglePost(Handler): <NEW_LINE> <INDENT> def get(self, blog_id): <NEW_LINE> <INDENT> blog = Blog.get_by_id(int(blog_id)) <NEW_LINE> self.render("single-post.html", blog = blog) | renders a page with a single blog post based on the id of the blog post in the data store 'Blog' | 62598fa80c0af96317c562b2 |
class WordFile(models.Model): <NEW_LINE> <INDENT> words = models.FileField() <NEW_LINE> def save(self, request): <NEW_LINE> <INDENT> task_id = handle_uploaded_file(request.FILES['words']) <NEW_LINE> return HttpResponseRedirect('main?task_id=' + task_id) | Корпус с разметкой (файлы *.conll) | 62598fa84a966d76dd5eee12 |
class SubCommentFormTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.subcomment = { 'nickname': 'testClient', 'email': 'test@example.com', 'content': 'my subcomment for test' } <NEW_LINE> <DEDENT> def test_attrs_cannot_empty(self): <NEW_LINE> <INDENT> f = SubCommentForm({}) <NEW_LINE> self.... | 测试回复表单 | 62598fa856ac1b37e630211c |
class SingletonRule(ConstantRule): <NEW_LINE> <INDENT> def __init__(self, fun): <NEW_LINE> <INDENT> ConstantRule.__init__(self) <NEW_LINE> self._fun = fun <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Singleton" <NEW_LINE> <DEDENT> def fun(self, x): <NEW_LINE> <INDENT> return self._fun(x) <NEW_LIN... | Représente un ensemble composé d'un objet unique de taille 1 | 62598fa830dc7b766599f77d |
class RedisCacheManager(CacheManager, SimpleItem): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> security.setPermissionDefault('Change cache managers', ('Manager', )) <NEW_LINE> manage_options = ( {'label': 'Properties', 'action': 'manage_main'}, ) + CacheManager.manage_options + SimpleItem.manage_optio... | Manage a RedisCache, which stores rendered data in redis.
This is intended to be used as a low-level cache for
expensive Python code, not for objects published
under their own URLs such as web pages.
RedisCacheManager *can* be used to cache complete publishable
pages, such as DTMLMethods/Documents and Page Templates,... | 62598fa84e4d562566372354 |
class BackwardsCompatibleHTTPClientTests(HTTPClientTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(BackwardsCompatibleHTTPClientTests, self).setUp() <NEW_LINE> config_lib.CONFIG.Set("Network.api", 2) <NEW_LINE> <DEDENT> def testCachedRSAOperations(self): <NEW_LINE> <INDENT> self.SendToServer() <N... | Test that we can talk using the old protocol still (version 2). | 62598fa8f7d966606f747f14 |
@inherit_doc <NEW_LINE> class GeneralJavaMLWritable(JavaMLWritable): <NEW_LINE> <INDENT> def write(self) -> GeneralJavaMLWriter: <NEW_LINE> <INDENT> return GeneralJavaMLWriter(self) | (Private) Mixin for ML instances that provide :py:class:`GeneralJavaMLWriter`. | 62598fa86e29344779b0058c |
class IgnoreQueriesProcessor(BaseProcessor): <NEW_LINE> <INDENT> def __init__(self, ignore_queries): <NEW_LINE> <INDENT> super(IgnoreQueriesProcessor, self).__init__() <NEW_LINE> self.ignore_queries = set(ignore_queries) <NEW_LINE> self.inputs = ['query'] <NEW_LINE> self.outputs = [] <NEW_LINE> <DEDENT> def process(sel... | Reject some specific queries | 62598fa8bd1bec0571e1505b |
class RecipeMalts(models.Model): <NEW_LINE> <INDENT> malt_brand = models.CharField(max_length=120) <NEW_LINE> malt_type = models.CharField(max_length=120) <NEW_LINE> malt_extract = models.BooleanField(default=True) <NEW_LINE> dry_malt = models.BooleanField(default=False) <NEW_LINE> recipe = models.ForeignKey('Reci... | Hold descriptors for all the malts used in a recipe | 62598fa816aa5153ce400432 |
class account_tax_template(osv.osv): <NEW_LINE> <INDENT> _inherit = 'account.tax.template' <NEW_LINE> _columns = { 'tax_discount': fields.boolean('Discount this Tax in Prince', help="Mark it for (ICMS, PIS e etc.)."), 'base_reduction': fields.float('Redution', required=True, digits=0, help="Um percentual decimal em % e... | Add fields used to define some brazilian taxes | 62598fa863d6d428bbee26e2 |
class Address(dict): <NEW_LINE> <INDENT> @property <NEW_LINE> def location(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> lat, lng = self['metadata']['latitude'], self['metadata']['longitude'] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if not lat or not lng: <NEW_LINE>... | Class for handling a single address response | 62598fa863b5f9789fe85095 |
class META(type): <NEW_LINE> <INDENT> def __add__(kls, other_class): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __lshift__(kls, my_mixin): <NEW_LINE> <INDENT> die_if_not_mixin(my_mixin) <NEW_LINE> name = dynamic_name() <NEW_LINE> bases = tuple([my_mixin, kls]) <NEW_LINE> return type(name, bases, {}) <NEW_LINE> <... | the most generic metaclass..
sorry but to avoid MRO issues, this should be the main one used,
and everything should subclass it. | 62598fa84f88993c371f04a2 |
class SimpleGraph(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.graph = {} <NEW_LINE> <DEDENT> def neighbors(self, vertex): <NEW_LINE> <INDENT> return self.graph[vertex] | Simple adjacency matrix graph class | 62598fa8aad79263cf42e705 |
class CustViewer(ida_kernwin.simplecustviewer_t): <NEW_LINE> <INDENT> def __init__(self, ea): <NEW_LINE> <INDENT> ida_kernwin.simplecustviewer_t.__init__(self) <NEW_LINE> self.ea = ea <NEW_LINE> <DEDENT> def jump_in_disassembly(self): <NEW_LINE> <INDENT> ea = self.ea <NEW_LINE> if not ea or not ida_bytes.is_loaded(ea):... | 分析结果窗口显示器 | 62598fa8009cb60464d0144f |
class Table(MultiRowSelection): <NEW_LINE> <INDENT> def __init__(self, table_name, db_expr=None, allow_outdated=None): <NEW_LINE> <INDENT> ReadQuery.__init__(self, internal.Table(self)) <NEW_LINE> self.table_name = table_name <NEW_LINE> self.db_expr = db_expr <NEW_LINE> self.allow_outdated = allow_outdated <NEW_LINE> <... | A ReQL expression that encodes a RethinkDB table. Most data
manipulation operations (such as inserting, selecting, and
updating data) can be chained off of this object. | 62598fa8627d3e7fe0e06ddd |
class Interface2App(App): <NEW_LINE> <INDENT> def build(self): <NEW_LINE> <INDENT> screen = AllImage() <NEW_LINE> screen.name = 'interface2' <NEW_LINE> return screen | The kivy App that runs the main root. All we do is build a AllImage
widget into the root. | 62598fa81b99ca400228f4c8 |
class ColumnShifterCTX_P(object): <NEW_LINE> <INDENT> def __init__(self, dict_db): <NEW_LINE> <INDENT> self.db = dict_db <NEW_LINE> <DEDENT> def define(self, columns, shifts, ignore_unknown=True): <NEW_LINE> <INDENT> db_set = set(self.db.keys()) <NEW_LINE> if not(set(columns) <= db_set): <NEW_LINE> <INDENT> if ignore_u... | Grabs columns around predicate and shifts it
Usage:
See below (main) | 62598fa8e5267d203ee6b83c |
class UserDlRequest(Model): <NEW_LINE> <INDENT> user_id = f.Integer(nullable=False, index=True) <NEW_LINE> dlrequest_id = f.ForeignKey(DlRequest.id) <NEW_LINE> created = f.DateTime(with_timezone=True, nullable=False, default=datetime.utcnow) <NEW_LINE> unique = ( ('user_id', 'dlrequest_id'), ) | Users vs Download Requests. | 62598fa8498bea3a75a57a4e |
class MonitorPMA(Command): <NEW_LINE> <INDENT> log = logging.getLogger(__name__) <NEW_LINE> def take_action(self, parsed_args): <NEW_LINE> <INDENT> self.log.info('monitorPMA service starting...') <NEW_LINE> startService(CONF.hades_exchange, 'hades-monitorPMA', CONF.hades_monitorPMA_topic, 'pike', CONF.hades_monitorPMA_... | A command that start monitorPMA service. | 62598fa8a79ad16197769f95 |
class CustomDBAdapter(DBAdapter): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super(CustomDBAdapter, self).__init__(config) <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _open(self, filename, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>... | Для создания нового класса-коннектора к БД, реализуйте следующие методы или
пометьте их raise error.NotSupportedOperation | 62598fa8a219f33f346c6748 |
class MultiModalEncoder(snt.AbstractModule): <NEW_LINE> <INDENT> def __init__(self, encoder_list, mlp_dim, latent_dim, dropout=False, keep_prob=0.5, is_training=True, swap_out_mlp_relu_for_elu=False, name='multi_modal_encoder'): <NEW_LINE> <INDENT> super(MultiModalEncoder, self).__init__(name=name) <NEW_LINE> self.enco... | Abstract class for encoding multiple modalities together. | 62598fa899fddb7c1ca62d81 |
class AugMix(object): <NEW_LINE> <INDENT> def __init__(self, prob=0.5, aug_prob_coeff=0.1, mixture_width=3, mixture_depth=1, aug_severity=1): <NEW_LINE> <INDENT> self.prob = prob <NEW_LINE> self.aug_prob_coeff = aug_prob_coeff <NEW_LINE> self.mixture_width = mixture_width <NEW_LINE> self.mixture_depth = mix... | Perform AugMix augmentation and compute mixture.
| 62598fa85166f23b2e243309 |
class Authentication(TypedDict): <NEW_LINE> <INDENT> clientCert: ClientCert | Authentication
Attributes:
----------
clientCert: :py:class:`ClientCert` | 62598fa8097d151d1a2c0f5a |
class Task(DBObject): <NEW_LINE> <INDENT> def __init__(self, task_id=[], task_time = [], scaled_model_id=[], hand_id=[], task_type_id=[], task_outcome_id=[], comment = [], parameters = []): <NEW_LINE> <INDENT> DBObject.__init__(self, task_id = task_id, task_time = task_time, scaled_model_id = scaled_model_id, hand_id =... | @brief Class that encapsulates the database representation of the Tasks in the database. It
derives from DBOject. | 62598fa8379a373c97d98f43 |
class CSSProductions(object): <NEW_LINE> <INDENT> EOF = True | most attributes are set later | 62598fa876e4537e8c3ef4de |
class ExposePIDDevice(microscope.abc.Device): <NEW_LINE> <INDENT> def _do_shutdown(self) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_pid(self) -> int: <NEW_LINE> <INDENT> return os.getpid() | Test device for testing the device server keep alive. | 62598fa8851cf427c66b81fa |
class GCSQL(CloudDB): <NEW_LINE> <INDENT> def exec_sql(self, sql): <NEW_LINE> <INDENT> print('Executed SQL in Google Cloud SQL') | GC / DB
| 62598fa83d592f4c4edbadff |
class Account: <NEW_LINE> <INDENT> def __init__(self, index, name, answered, attempts): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.name = name <NEW_LINE> self.answered = answered <NEW_LINE> self.attempts = attempts <NEW_LINE> <DEDENT> def addAnswered(self, type): <NEW_LINE> <INDENT> with open(file_path, 'r'... | An account that stores the user's progress
Attributes
----------
answered : int list
The total number of completed problems for each problem type
attempts : int list
The total number of attempts for each problem type
Methods
-------
addAnswered(type : str) -> None
Increases the number of answered problems... | 62598fa824f1403a9268584c |
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0, position=(0, 0)): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.position = position <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return (self.__size) <NEW_LINE> <DEDENT> @size.setter <NEW_LINE> def size(self, value): <NE... | Defines a Square | 62598fa87047854f4633f30b |
class Rectangle(Shape): <NEW_LINE> <INDENT> def __init__(self, pos_x=0, pos_y=0, width=0, height=0): <NEW_LINE> <INDENT> self.position = Vector2() <NEW_LINE> self.position.x = pos_x <NEW_LINE> self.position.y = pos_y <NEW_LINE> self.size = Vector2() <NEW_LINE> self.size.x = width <NEW_LINE> self.size.y = height <NEW_LI... | Any quadrilateral with four right angles | 62598fa845492302aabfc402 |
class GoogleAnalyticsDeletePreviousDataUploadsOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ("impersonation_chain",) <NEW_LINE> def __init__( self, account_id: str, web_property_id: str, custom_data_source_id: str, gcp_conn_id: str = "google_cloud_default", delegate_to: Optional[str] = None, api_version... | Deletes previous GA uploads to leave the latest file to control the size of the Data Set Quota.
:param account_id: The GA account Id (long) to which the data upload belongs.
:type account_id: str
:param web_property_id: The web property UA-string associated with the upload.
:type web_property_id: str
:param custom_dat... | 62598fa84e4d562566372356 |
class GetSamplesTest(test.TestCase): <NEW_LINE> <INDENT> def test_raises_if_both_z_and_n_are_none(self): <NEW_LINE> <INDENT> with self.test_session(): <NEW_LINE> <INDENT> dist = normal_lib.Normal(loc=0., scale=1.) <NEW_LINE> z = None <NEW_LINE> n = None <NEW_LINE> seed = None <NEW_LINE> with self.assertRaisesRegexp(Val... | Test the private method 'get_samples'. | 62598fa80c0af96317c562b4 |
class ParallelSafetyWarning(RuntimeWarning): <NEW_LINE> <INDENT> pass | Warning category for when an operation in a prange
might not have parallel semantics. | 62598fa830dc7b766599f77f |
class Program(BaseRegister): <NEW_LINE> <INDENT> def __init__(self, thermostat_identifier): <NEW_LINE> <INDENT> program_description = "List or resume non-vacation programs stored on Ecobee thermostat" <NEW_LINE> super(Program, self).__init__("byte", False, "Programs", "", description=program_description) <NEW_LINE> sel... | Wrapper register for managing Ecobee thermostat programs, and getting program status | 62598fa8e5267d203ee6b83d |
class ArchiveView(BaseCartView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> request = self.request <NEW_LINE> pm = api.portal.get_tool('portal_membership') <NEW_LINE> user = pm.getAuthenticatedMember() <NEW_LINE> handled = [] <NEW_LINE> for obj in self.items: <NEW_LINE> <INDENT> if not user.has_permiss... | Archive Action implementation that uses slc.outdated to mark items as
outdated. | 62598fa87d847024c075c2f6 |
class OneWire(Entity): <NEW_LINE> <INDENT> def __init__(self, name, device_file, sensor_type): <NEW_LINE> <INDENT> self._name = name+' '+sensor_type.capitalize() <NEW_LINE> self._device_file = device_file <NEW_LINE> self._unit_of_measurement = SENSOR_TYPES[sensor_type][1] <NEW_LINE> self._state = None <NEW_LINE> <DEDEN... | Implementation of an One wire Sensor. | 62598fa82c8b7c6e89bd36f7 |
class read_write(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._logfilename = os.path.join(os.path.dirname(os.path.abspath(__file__)), ".download") <NEW_LINE> <DEDENT> @property <NEW_LINE> def read(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(self._logfilename, 'rb', ) as f:... | 保存已下载过的日志 | 62598fa8a17c0f6771d5c167 |
class Client(object): <NEW_LINE> <INDENT> def __init__(self, access_token=None, base_url=None, proxies=None): <NEW_LINE> <INDENT> self._access_token = access_token <NEW_LINE> self._base_url = base_url or DEFAULT_BASE_URL <NEW_LINE> self._proxies = proxies <NEW_LINE> <DEDENT> def get(self, path, **kwargs): <NEW_LINE> <I... | A client for the Yammer API. | 62598fa816aa5153ce400434 |
class BlogCLITests(base_v1.BlogClientTestBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(BlogCLITests, cls).setUpClass() <NEW_LINE> <DEDENT> def test_blog_create_delete(self): <NEW_LINE> <INDENT> wb = self.blog_admin( 'blog-create', params=self.wb_def) <NEW_LINE> wb_nam... | Test suite checks commands to work with blogs. | 62598fa8460517430c431ff5 |
class F26(FeatureExtractor): <NEW_LINE> <INDENT> @numba.jit(cache=True) <NEW_LINE> def run(self, series): <NEW_LINE> <INDENT> return round(series[-1]-series[-20], 2) | 对于有限长度信号序列时域幅值,求脉冲因子--最大值/绝对均值
| 62598fa826068e7796d4c88c |
class RuleGroupUser(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'ir.rule.group-res.user' <NEW_LINE> rule_group = fields.Many2One('ir.rule.group', 'Rule Group', ondelete='CASCADE', select=True, required=True) <NEW_LINE> user = fields.Many2One('res.user', 'User', ondelete='CASCADE', select=True, required=True) <NEW_LINE> @... | Rule Group - User | 62598fa82c8b7c6e89bd36f8 |
class tmpFolder(object): <NEW_LINE> <INDENT> __slots__ = ('__tmpFolderName',) <NEW_LINE> def __init__(self, path = './'): <NEW_LINE> <INDENT> self.__tmpFolderName = abspath(join(path, str(uuid4()))) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> mkdir(self.__tmpFolderName) <NEW_LINE> return self.__tmpFold... | DESCRIPTION
Create a tmp folder.
USAGE
from tmpFile import tmpFolder
with tmpFolder() as tmpFolderPath:
...
# Folder: "tmpFolderPath" will be deleted automatically (if exist)
ARGUMENT
* path = './', str
The path of the tmp folder. | 62598fa810dbd63aa1c70ae5 |
class TestNetworkAdvancedInterVMConnectivity( manager.AdvancedNetworkScenarioTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def resource_setup(cls): <NEW_LINE> <INDENT> super(TestNetworkAdvancedInterVMConnectivity, cls).resource_setup() <NEW_LINE> cls.builder = TestNetworkAdvancedInterVMConnectivity(builder=True) <... | Scenario:
VMs with "default" security groups can
on different networks connected by a common
router should be able to talk to each other
Pre-requisites:
1 tenant
2 network
1 router
2 VMs
Steps:
1. create two networks with subnets
2. create a router
3. connect a router with both subnets
4. launch one VM for each netw... | 62598fa84428ac0f6e658455 |
class Commands(object): <NEW_LINE> <INDENT> def handle(self, cmd, data, client): <NEW_LINE> <INDENT> getattr(self, 'cmd_{0}'.format(cmd), self.unknown_cmd)(data, client) <NEW_LINE> <DEDENT> def unknown_cmd(self, data, client): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def cmd_about(self, data, dAmn): <NEW_LINE> <IND... | Just a simple object to hold any command callbacks. | 62598fa88c0ade5d55dc362a |
class StockLSTM(object): <NEW_LINE> <INDENT> def __init__(self, is_training, config): <NEW_LINE> <INDENT> self.batch_size = batch_size = config.batch_size <NEW_LINE> self.num_steps = num_steps = config.num_steps <NEW_LINE> size = config.hidden_size <NEW_LINE> self._input_data = tf.placeholder(tf.float32, [batch_size, n... | This model predicts a 1D sequence of real numbers (here representing daily stock adjusted
returns normalized by running fixed-length standard deviation) using an LSTM.
It is regularized using the method in [Zaremba et al 2015]
http://arxiv.org/pdf/1409.2329v5.pdf | 62598fa8097d151d1a2c0f5c |
class VersionTests(TestCase): <NEW_LINE> <INDENT> def test_OPENSSL_VERSION_NUMBER(self): <NEW_LINE> <INDENT> self.assertTrue(isinstance(OPENSSL_VERSION_NUMBER, int)) <NEW_LINE> <DEDENT> def test_SSLeay_version(self): <NEW_LINE> <INDENT> versions = {} <NEW_LINE> for t in [SSLEAY_VERSION, SSLEAY_CFLAGS, SSLEAY_BUILT_ON, ... | Tests for version information exposed by
L{OpenSSL.SSL.SSLeay_version} and
L{OpenSSL.SSL.OPENSSL_VERSION_NUMBER}. | 62598fa83617ad0b5ee06087 |
class Region(object): <NEW_LINE> <INDENT> def __init__(self, beg, end, weight, coupled=True, label=0): <NEW_LINE> <INDENT> if math.isinf(beg): <NEW_LINE> <INDENT> raise ValueError("fwdpy11.Region: beg not finite") <NEW_LINE> <DEDENT> if math.isinf(end): <NEW_LINE> <INDENT> raise ValueError("fwdpy11.Region: end not fini... | Representation of a "region" in a simulation.
Attributes:
b: the beginning of the region
e: the end of the region
w: the "weight" assigned to the region
l: A label assigned to the region.
Labels must be integers, and can be used to
'tag' mutations arising in different regions.
See :fun... | 62598fa87cff6e4e811b595d |
@method_decorator(login_required(login_url=reverse_lazy('login')), name='dispatch') <NEW_LINE> class RamblerBaseCreateView(RamblerBaseFormView): <NEW_LINE> <INDENT> pass | Used for creating objects of a specific model, requires the inheriting view
to have as attributes:
- url_route
- model: models.Model
- template_form
requires user to be logged in to do creation. | 62598fa84e4d562566372358 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.