code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Chain: <NEW_LINE> <INDENT> def __init__(self, name, config, lineno): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.config = config <NEW_LINE> self.lineno = lineno <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.__dict__ == other.__dict__ <NEW_LINE> <DEDENT> def __str__(self): <... | Class that represents a chain | 62598edfd268445f26638e6d |
class MyGradeScale(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, unique=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return '{}'.format(self.name) <NEW_LINE> <DEDENT> def get_rule(self, grade): <NEW_LINE> <INDENT> if grade is not None: <NEW_LINE> <INDENT> return self.gradescaleru... | Translate a numeric grade to some other scale.
Example: Letter grade or 4.0 scale. | 62598edfbaa26c4b54d4d88f |
class SettingsCredSnmpV3SuccessGridRemote(RemoteModel): <NEW_LINE> <INDENT> properties = ("id", "Collector", "DeviceID", "DeviceName", "DeviceType", "DeviceIPDotted", "DeviceIPNumeric", "VirtualNetworkID", "Network", "DeviceAssurance", ) | | ``id:`` none
| ``attribute type:`` string
| ``Collector:`` none
| ``attribute type:`` string
| ``DeviceID:`` none
| ``attribute type:`` string
| ``DeviceName:`` none
| ``attribute type:`` string
| ``DeviceType:`` none
| ``attribute type:`` string
| ``DeviceIPDotted:`` none
| ``attribute type:`` strin... | 62598edf0a50d4780f703967 |
class MailSender(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.outlook = win32.Dispatch('outlook.application') <NEW_LINE> self.mail = None <NEW_LINE> <DEDENT> def add_email_headers(self, headers: Dict[str, str]): <NEW_LINE> <INDENT> for field, value in headers.items(): <NEW_LINE> <INDENT> se... | Send email using the active email on Outlook | 62598edf9b70327d1c57d379 |
class ISYSensorDevice(ISYDeviceABC): <NEW_LINE> <INDENT> _domain = 'sensor' <NEW_LINE> def __init__(self, node, states=None): <NEW_LINE> <INDENT> super().__init__(node) <NEW_LINE> self._states = states or [] | Represents a ISY sensor. | 62598edf91af0d3eaad383d7 |
class ISQLLockable(Interface): <NEW_LINE> <INDENT> pass | Marker interface for lockable sql objects or wrapper(objects). | 62598edf99cbb53fe682f471 |
class SelfAttention(Attention): <NEW_LINE> <INDENT> def call(self, x, bias, training, cache=None, decode_loop_step=None): <NEW_LINE> <INDENT> return super(SelfAttention, self).call(x, x, bias, training, cache, decode_loop_step) | Multiheaded self-attention layer. | 62598edf097d151d1a2bf5de |
class PriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.heap = [] <NEW_LINE> self.size = 0 <NEW_LINE> <DEDENT> def insert(self, x, k): <NEW_LINE> <INDENT> self.heap.append([x, float("-inf")]) <NEW_LINE> self.size += 1 <NEW_LINE> self.update_key(self.size - 1, k) <NEW_LINE> <DEDENT> def get... | Note: When using self.size as an **index** self.size - 1 is used due to
0-based indexing. self.size is the same as len(self.heap), just updated
'manually' for learning the algorithm. | 62598edf1b99ca400228e7ec |
class Cache: <NEW_LINE> <INDENT> _modules_timestamp = {} <NEW_LINE> _data = {} <NEW_LINE> DISK_SYNC_SECONDS = 30 <NEW_LINE> @staticmethod <NEW_LINE> def is_disabled() -> bool: <NEW_LINE> <INDENT> return os.environ['CACHE_DISABLED'] == 1 if 'CACHE_DISABLED' in os.environ else False <NEW_LINE> <DEDENT> @staticmethod <NEW... | Cache handling class, storing data in the memory with disk persistence | 62598edfe5267d203ee69ec2 |
class ImportFootage(HookBaseClass): <NEW_LINE> <INDENT> __DEFAULT_IMPORT_TYPES = None <NEW_LINE> @property <NEW_LINE> def _default_import_types(self): <NEW_LINE> <INDENT> if self.__DEFAULT_IMPORT_TYPES is None: <NEW_LINE> <INDENT> self.__DEFAULT_IMPORT_TYPES = { ".mov": self.adobe.ImportAsType.FOOTAGE, ".avi": self.ado... | Used to control the way the current context fields are displayed. | 62598edf23849d37ff84f679 |
class Encoder(object): <NEW_LINE> <INDENT> DEFAULT_ENCODING = 'hex' <NEW_LINE> DEFAULT_DELIMITER = "-" <NEW_LINE> def __init__(self, encoding=DEFAULT_ENCODING, delimiter=DEFAULT_DELIMITER, signature_kw=None, encryption_kw=None): <NEW_LINE> <INDENT> self.encoding = encoding <NEW_LINE> if signature_kw is None: <NEW_LINE>... | Class to encrypt, sign and encode messages and handle the equivalent
signature verification and decryption. Uses symmetric key encryption
(AES) and HMAC signature. | 62598edffff4ab517ebcbda3 |
class PatrowlEngineExceptions(Exception): <NEW_LINE> <INDENT> _error_codes = { 1000: 'Configuration file not found.', 1001: 'Report file not found.', 1002: 'Scan_id not found in current scans.', 1003: 'Scan not finished.', } <NEW_LINE> def __init__(self, code, msg=None): <NEW_LINE> <INDENT> Exception.__init__(self) <NE... | This class is all about exceptions based directly on PatrowlEnginese.
It will consist of a **code** and a **message** describing the reason of
the exception shortly. | 62598edf24f1403a92684b84 |
class CreateCommitCommentResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Limit(self): <NEW_LINE> <INDENT> return self._output.get('Limit', None) <NEW_LINE> <DEDENT> def get_Remaining(self): <NEW_LINE> <INDENT> return self... | A ResultSet with methods tailored to the values returned by the CreateCommitComment Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598edf442bda511e95aa26 |
class TestModel_UserState(): <NEW_LINE> <INDENT> def test_user_state_serialization(self): <NEW_LINE> <INDENT> user_state_model_json = {} <NEW_LINE> user_state_model_json['state'] = 'draft' <NEW_LINE> user_state_model_json['set_by'] = 'testString' <NEW_LINE> user_state_model_json['set_at'] = "2019-01-01T12:00:00Z" <NEW_... | Test Class for UserState | 62598edf1f037a2d8b9e26c5 |
class DateFilter(AttributeFilter): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get(cls, approach): <NEW_LINE> <INDENT> return approach.time.date() | Child of attribute filter. | 62598edf8da39b475be01769 |
class Order_State(models.Model): <NEW_LINE> <INDENT> order = models.ForeignKey(Order) <NEW_LINE> state = models.ForeignKey(State) <NEW_LINE> ctime = models.DateTimeField('创建时间', auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.state | 订单壮态 | 62598edf236d856c2adc86f3 |
class MObjectDiscrete(MObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> <DEDENT> def helloCont(self): <NEW_LINE> <INDENT> print("HelloDisc!") | A Discrete Object | 62598edf796e427e5384cd58 |
class TestSale(TestBase): <NEW_LINE> <INDENT> def test_0010_import_sale_order(self): <NEW_LINE> <INDENT> Sale = POOL.get('sale.sale') <NEW_LINE> Party = POOL.get('party.party') <NEW_LINE> Product = POOL.get('product.product') <NEW_LINE> with Transaction().start(DB_NAME, USER, CONTEXT): <NEW_LINE> <INDENT> self.setup_de... | Tests import of sale order | 62598edf92d797404e387e5b |
class USBProxyPrettyPrintFilter(USBProxyFilter): <NEW_LINE> <INDENT> def __init__(self, verbose, decoration=''): <NEW_LINE> <INDENT> self.verbose = verbose <NEW_LINE> self.decoration = decoration <NEW_LINE> <DEDENT> def filter_control_in(self, req, data, stalled): <NEW_LINE> <INDENT> if self.verbose > 3 and req is None... | Filter that pretty prints USB transactions according to log levels. | 62598edff7d966606f7465b0 |
class QueryFacet(Facet): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def validate_range(value): <NEW_LINE> <INDENT> return bool(re.compile("\[.* TO .*\]").match(value)) <NEW_LINE> <DEDENT> def sort_by_value(self): <NEW_LINE> <INDENT> self.items = sorted(self.items, key=lambda item: self._sort_val(item.value)) <NEW_LIN... | This class is generally just for overriding that method to sort values properly.
The Facet.sort_by_value screws up the ordering of query based facets,
which have values that look like:
[* TO 500], '[500 TO 1000], '[1001 TO 2000], [2001 TO *], etc. | 62598edf3539df3088eca872 |
class NumpyDeviceBuffer(Node): <NEW_LINE> <INDENT> _output_specs = {'signals': dict(streamtype='analogsignal', shape=(-1, 16), compression ='', sample_rate =30. )} <NEW_LINE> def __init__(self, **kargs): <NEW_LINE> <INDENT> Node.__init__(self, **kargs) <NEW_LINE> <DEDENT> def configure(self, *args, **kwargs): <NEW_LINE... | A fake analogsignal device.
This node streams data from a predefined buffer in an endless loop. | 62598edfcb5e8a47e493b459 |
class Output: <NEW_LINE> <INDENT> report = FileField(label="Bisulfite conversion rate report") | Output fields. | 62598edfac7a0e7691f70ad4 |
class RandomDico(Dico): <NEW_LINE> <INDENT> randomType = 'none' <NEW_LINE> iterationNumber = 0 <NEW_LINE> nbSim = 1; <NEW_LINE> nature = 'RandomMDCT' <NEW_LINE> def __init__(self , sizes=[] , randomType = 'random' , nbSame = 1 , windowType = None): <NEW_LINE> <INDENT> self.randomType = randomType <NEW_LINE> self.sizes ... | This dictionary implements a sequence of subdictionaries that are shifted in time at each iteration in a pre-defined manner
the shifts are controlled by the different blocks.
Attributes:
`randomType`: The type of time-shift sequence, available choices are *scale*,*random*,*gaussian*,*binom*,*dicho*,*jump*,*b... | 62598edf097d151d1a2bf5df |
class PublishedCluster: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> <DEDENT> @property <NEW_LINE> def id(self): <NEW_LINE> <INDENT> return self._data.get("id") <NEW_LINE> <DEDENT> @property <NEW_LINE> def versions(self): <NEW_LINE> <INDENT> return [PublishedClusterVers... | A representation of a published cluster in a mastering project with version information.
See https://docs.tamr.com/reference#retrieve-published-clusters-given-cluster-ids.
This is not a `BaseResource` because it does not have its own API endpoint.
:param data: The JSON entity representing this :class:`~tamr_unify_cli... | 62598edf55399d3f05624af0 |
class GraphConvolution(Module): <NEW_LINE> <INDENT> def __init__(self, in_features, out_features, bias=True, init='xavier'): <NEW_LINE> <INDENT> super(GraphConvolution, self).__init__() <NEW_LINE> self.in_features = in_features <NEW_LINE> self.out_features = out_features <NEW_LINE> self.weight = Parameter(torch.FloatTe... | Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
SOURCE CODE https://github.com/meliketoy/graph-cnn.pytorch/blob/master/layers.py | 62598edfd268445f26638e6e |
class PushNode(SetNode): <NEW_LINE> <INDENT> def set_left(self, left): <NEW_LINE> <INDENT> self._left = left <NEW_LINE> if self._left != None: <NEW_LINE> <INDENT> self._left.set_parent(self) <NEW_LINE> <DEDENT> <DEDENT> def evaluate(self): <NEW_LINE> <INDENT> log.debug(self._id, 'PushNode: evaluating') <NEW_LINE> value... | Appends item to list. Optionally, inserts item at specified position, if list
index is specified.
Example, push to list::
lst << 5
Insert at certain index::
lst[5] << 5 | 62598edf7b25080760ed5a5a |
class QA_DataStruct_Indicators(): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '< QA_DATASTRUCT_INDICATOR FROM {} TO {} WITH {} CODES >'.format(self.data.index.levels[0][0],self.data.index.levels[0][-1],len(self.dat... | 指标的结构 | 62598edfbaa26c4b54d4d891 |
class ProductView(View): <NEW_LINE> <INDENT> form_class = FilterForm <NEW_LINE> @staticmethod <NEW_LINE> def create_top3_rated(): <NEW_LINE> <INDENT> return sorted([obj for obj in Produs.objects.all()], key=lambda x: x.finalrating, reverse=True)[:3] <NEW_LINE> <DEDENT> def validate_pages_on_mainpage(self, page): <NEW_L... | View that handles the logic of the home page | 62598edfe76e3b2f99fd6ffa |
class OAuthServer(socketserver.TCPServer): <NEW_LINE> <INDENT> def __init__(self, addr: tuple): <NEW_LINE> <INDENT> super(OAuthServer, self).__init__(addr, TCPRequestHandler) <NEW_LINE> self.http_data = None <NEW_LINE> <DEDENT> def handle_auth(self): <NEW_LINE> <INDENT> self.handle_request() <NEW_LINE> self.server_clos... | A socketserver.TCPServer with added functionality to handle POST data | 62598edf0c0af96317c5495e |
class LdapSyncConnector(ApiItem): <NEW_LINE> <INDENT> API_NAME = "ldap_sync_connector" <NEW_LINE> API_NAME_SRC = "ldap_sync_connector" <NEW_LINE> API_SIMPLE = { "id": "integer_types", "name": "string_types", "enable": "integer_types", "host": "string_types", "port": "integer_types", "secure": "integer_types", "use_ntlm... | Automagically generated API object. | 62598edfa8370b77170ee9b0 |
class NormalizedEnv(gym.ObservationWrapper): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> gym.ObservationWrapper.__init__(self, env) <NEW_LINE> <DEDENT> def _observation(self, obs): <NEW_LINE> <INDENT> return obs / 255.0 | Normalize the observations to [0, 1] | 62598edf1b99ca400228e7ed |
class Bug551533and586003(tests.MySQLConnectorTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tbl = 'Bug551533' <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> config = tests.get_mysql_config() <NEW_LINE> cnx = connection.MySQLConnection(**config) <NEW_LINE> cnx.cmd_query("DROP TABLE IF... | lp: 551533 as 586003: impossible to retrieve big result sets | 62598edf4f6381625f19879d |
class LeapControllerUnitTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass | TODO: The unit test suite for LEAP_Controler. | 62598edfe5267d203ee69ec4 |
class TokenRefreshRestServlet(RestServlet): <NEW_LINE> <INDENT> PATTERNS = client_v2_patterns("/tokenrefresh") <NEW_LINE> def __init__(self, hs): <NEW_LINE> <INDENT> super(TokenRefreshRestServlet, self).__init__() <NEW_LINE> self.hs = hs <NEW_LINE> self.store = hs.get_datastore() <NEW_LINE> <DEDENT> @defer.inlineCallba... | Exchanges refresh tokens for a pair of an access token and a new refresh
token. | 62598edf7cff6e4e811b3fae |
class WorkerInfo: <NEW_LINE> <INDENT> def __init__(self, host, port, local_worker_id, global_worker_id = None): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.local_worker_id = local_worker_id <NEW_LINE> if global_worker_id is None: <NEW_LINE> <INDENT> self.global_worker_id = host + "-... | Contains Worker Thrift Service details and worker id | 62598edf0c0af96317c5495f |
class TestRouteResults(TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> self.route = MagicMock() <NEW_LINE> self.result_1 = MagicMock() <NEW_LINE> self.result_2 = MagicMock() <NEW_LINE> self.result_3 = MagicMock() <NEW_LINE> self.result_4 = MagicMock() <NEW_LINE> self.route_results = RouteRes... | RouteResults class testing. | 62598edf442bda511e95aa28 |
class GeneView: <NEW_LINE> <INDENT> def __init__( self, owner_model_view: "ModelView", gene: gr.Gene ) -> None: <NEW_LINE> <INDENT> self.model_view = owner_model_view <NEW_LINE> self.gene = gene <NEW_LINE> self.domain_views: Dict[gr.UserDomain, DomainView] = { } <NEW_LINE> self._recreate() <NEW_LINE> <DEDENT> def get_s... | Views a gene | 62598edf45492302aabfaa74 |
class NotAModuleError(Exception): <NEW_LINE> <INDENT> pass | Exception for when the `discover_via_entrypoint_extensions` function
found an entrypoint that was *not* a module specification. | 62598edfcc0a2c11144795c3 |
class UploadConfiguration(GenericRolesHook): <NEW_LINE> <INDENT> identity = 'upload_configuration' <NEW_LINE> def __init__(self, task, cluster, nodes, configs=None, role_resolver=None): <NEW_LINE> <INDENT> super(UploadConfiguration, self).__init__( task, cluster, nodes, role_resolver=role_resolver ) <NEW_LINE> self.con... | Hook that uploads yaml file with configuration on nodes. | 62598edf596a897236126221 |
class SetupFunction(Setup): <NEW_LINE> <INDENT> def __init__(self, function, name=None, group=None): <NEW_LINE> <INDENT> assert not group or isinstance(group, str), 'Invalid group %s' % group <NEW_LINE> if name: <NEW_LINE> <INDENT> assert callable(function), 'Invalid callable function %s' % function <NEW_LINE> assert i... | A setup indexer based on a function. | 62598edf38b623060ffa7656 |
class Field(object): <NEW_LINE> <INDENT> typeof='str' <NEW_LINE> length=15 <NEW_LINE> width=15 <NEW_LINE> unique=False <NEW_LINE> not_null=False <NEW_LINE> primary_key=False <NEW_LINE> join_on=None <NEW_LINE> is_function=None <NEW_LINE> save_included=True <NEW_LINE> view_included=True <NEW_LINE> form_included=True <NEW... | Describe string fields | 62598edfcc0a2c11144795c4 |
class RandomIterator(Sampler, Generic[T]): <NEW_LINE> <INDENT> def __init__(self, data: List[T], batch_size: int, drop_fn: Optional[Callable[[T], float]] = None ): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.drop_fn = drop_fn <NEW_LINE> self.pos = 0 <NEW_LINE> <DEDENT> d... | iterate over a list and shuffle the list at each round.
self.data: target list.
self.drop_fn: a function to determine dropout probabilities.
self.pos: current position of the cursor.
self.cycled: is last round finished? | 62598edf60cbc95b063628fd |
class RequestError(PyCRError): <NEW_LINE> <INDENT> def __init__(self, status_code, response, message, cause=None): <NEW_LINE> <INDENT> self.response = response <NEW_LINE> self.status_code = status_code <NEW_LINE> super(RequestError, self).__init__(message, cause) | Exception raised when catching a requests.exceptions.RequestException | 62598edf2c8b7c6e89bd1d81 |
class FIOLogsReader(BaseLogsReader): <NEW_LINE> <INDENT> CUNIT = {'usec': 1, 'msec': 1000, 'sec': 1000000} <NEW_LINE> def __init__(self, log_path=None): <NEW_LINE> <INDENT> super(FIOLogsReader, self).__init__(log_path) <NEW_LINE> self.headers = ['rand-read:', 'rand-read: latency', 'rand-write: latency', 'seq-write: lat... | Subclass for parsing FIO log files e.g.
FIOLog-XXXq.log | 62598edf67a9b606de544590 |
class Reverse(SGRFunction): <NEW_LINE> <INDENT> sgr_param = "7" | Displays text with the foreground and background reversed.
Note, this have unexpected effects when combined with other commands,
especially on Windows.
For example, using the default Windows color palette:
Reverse(Red("hello")) # makes black text on a red background
Red(Reverse("hello")) # makes black text on a red bac... | 62598edf7d847024c075a991 |
class PackageException(Exception): <NEW_LINE> <INDENT> pass | Dummy Exception. | 62598edfe64d504609df86a1 |
@validation_decorators.AuditsExisting( subtopic_models.SubtopicPageSnapshotMetadataModel) <NEW_LINE> class ValidateSubtopicPageSnapshotMetadataModel( base_validation.BaseValidateCommitCmdsSchema): <NEW_LINE> <INDENT> def _get_change_domain_class(self, unused_input_model): <NEW_LINE> <INDENT> return subtopic_page_domain... | Overrides _get_change_domain_class for SubtopicPageSnapshotMetadataModel.
| 62598edf30bbd722464681fb |
class DescribePersonVisitInfoRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CompanyId = None <NEW_LINE> self.ShopId = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> self.StartDate = None <NEW_LINE> self.EndDate = None <NEW_LINE> self.PictureExpires =... | DescribePersonVisitInfo请求参数结构体
| 62598edf21a7993f00c6452f |
class NFk(lland_parameters.MultiParameterSoil): <NEW_LINE> <INDENT> NDIM, TYPE, TIME, SPAN = 1, float, None, (0., None) | Nutzbare Feldkapazität (usable field capacity) [mm]. | 62598edf8a43f66fc4bf0735 |
class AppointmentForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Appointment <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> message = self.cleaned_data['description'] <NEW_LINE> urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', mes... | Provides the appointment request form
| 62598edfd486a94d0ba2a599 |
class LRUCache: <NEW_LINE> <INDENT> def __init__(self, max_size=100000): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> self.set_max_size(max_size) <NEW_LINE> self.sentinel = LRUCacheNode(None, None) <NEW_LINE> self.sentinel.prev = self.sentinel <NEW_LINE> self.sentinel.next = self.sentinel <NEW_LINE> self.lock = _threa... | Thread-safe, bounded, least-recently-used DNS answer cache.
This cache is better than the simple cache (above) if you're
running a web crawler or other process that does a lot of
resolutions. The LRUCache has a maximum number of nodes, and when
it is full, the least-recently used node is removed to make space
for a n... | 62598edfbd1bec0571e143ad |
class BlockOutRule(BlockRule): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> super(BlockOutRule, self).__init__(direction=PF_OUT, **kw) | Block outgoing traffic | 62598edfe5267d203ee69ec6 |
class RestorePointInfoFormatterTest(test_lib.EventFormatterTestCase): <NEW_LINE> <INDENT> def testInitialization(self): <NEW_LINE> <INDENT> event_formatter = winrestore.RestorePointInfoFormatter() <NEW_LINE> self.assertNotEqual(event_formatter, None) <NEW_LINE> <DEDENT> def testGetFormatStringAttributeNames(self): <NEW... | Tests for the Windows Restore Point information event formatter. | 62598edf462c4b4f79db9fbd |
class MatchResultView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = MatchResult.objects.all() <NEW_LINE> serializer_class = MatchResultSerializer | Match Result table | 62598edf009cb60464cffb12 |
class AddCarForm(FlaskForm): <NEW_LINE> <INDENT> model = StringField('Жанр', validators=[DataRequired()]) <NEW_LINE> price = IntegerField('Цена', validators=[DataRequired()]) <NEW_LINE> power = IntegerField('Востребованность', validators=[DataRequired()]) <NEW_LINE> color = StringField('Цвет', validators=[DataRequired(... | Форма игры | 62598edf460517430c430a4c |
class Command(Event): <NEW_LINE> <INDENT> def __init__(self, ff_id, source: str, command: COMMAND_TYPE, command_action: str = '', force=False, **kwargs): <NEW_LINE> <INDENT> Event.__init__(self, source, EVENT_TYPE_COMMAND) <NEW_LINE> self._command = command <NEW_LINE> self._command_action = command_action <NEW_LINE> se... | Class for holding a command. | 62598edfcc0a2c11144795c6 |
class UserIPManager(models.Manager): <NEW_LINE> <INDENT> def countries_for(self, user, as_codes=True, days=None): <NEW_LINE> <INDENT> criteria = {} if days is None else {'time__gt': now() - 86400 * days} <NEW_LINE> country_list = set(self.filter(user=user, **criteria).exclude(ip__country='').values_list('ip__country', ... | Manager des IPs des utilisateurs | 62598edf63d6d428bbee0d96 |
class AsInt8(_AsInt): <NEW_LINE> <INDENT> def __init__(self, group, generator, isSigned=1, isLittleEndian=1): <NEW_LINE> <INDENT> SimpleGenerator.__init__(self, group) <NEW_LINE> self._generator = generator <NEW_LINE> self.setTransformer(Peach.Transformers.Type.Integer.AsInt8(isSigned, isLittleEndian)) | Cause generated value to be an 8 bit number. | 62598edf32920d7e50bc45f1 |
class mobilize(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> from gluon import current <NEW_LINE> user_agent = current.request.user_agent() <NEW_LINE> if user_agent.is_mobile: <NEW_LINE> <INDENT> items = current.re... | Decorator for controller functions so they use different views for mobile devices.
WARNING: If you update httpagentparser make sure to leave mobilize for
backwards compatibility. | 62598edfac7a0e7691f70ad7 |
class Codename(TypeDecorator): <NEW_LINE> <INDENT> domain_name = "CODENAME" <NEW_LINE> impl = Unicode <NEW_LINE> @classmethod <NEW_LINE> def get_create_command(cls): <NEW_LINE> <INDENT> return DDL("CREATE DOMAIN %(domain)s VARCHAR " "CHECK (VALUE ~ '^[A-Za-z0-9_-]+$')", context={"domain": cls.domain_name}) <NEW_LINE> <... | Check that the column uses a limited alphabet.
Namely: latin letters (upper and lowercase), arabic digits, the
underscore and the dash. It must also be non-empty. | 62598edf6e29344779afebf2 |
class RandomMutation(Mutation): <NEW_LINE> <INDENT> def __init__(self, length=2., num_muts=1): <NEW_LINE> <INDENT> Mutation.__init__(self, num_muts=num_muts) <NEW_LINE> self.descriptor = 'RandomMutation' <NEW_LINE> self.length = length <NEW_LINE> <DEDENT> def mutate(self, atoms): <NEW_LINE> <INDENT> tbm = random.choice... | Moves a random atom the supplied length in a random direction. | 62598edf4e4d5625663709dd |
class StdoutText(WorkspaceText): <NEW_LINE> <INDENT> def __init__(self, ws, vbRecordedOutput): <NEW_LINE> <INDENT> super(StdoutText,self).__init__(ws, self._create, vbRecordedOutput) <NEW_LINE> <DEDENT> def _create(self, vbRecordedOutput): <NEW_LINE> <INDENT> return _ReportText(vbRecordedOutput, "VerbosityPrinter") | A text block showing standard output recorded using
VerbosityPrinter objects | 62598edf2eb69b55b15a066b |
class ConcreteStencil(ConcreteSpecializedFunction): <NEW_LINE> <INDENT> def finalize(self, tree, entry_name, entry_type, output): <NEW_LINE> <INDENT> self.output = output <NEW_LINE> self._c_function = self._compile(entry_name, tree, entry_type) <NEW_LINE> return self <NEW_LINE> <DEDENT> def __call__(self, *args): <NEW_... | StencilFunction
The standard concrete specialized function that is returned when using the
C or OpenMP backend. | 62598edf097d151d1a2bf5e3 |
class UserNotFoundException(MagicLinkException): <NEW_LINE> <INDENT> pass | No user is associated with this email. | 62598edf63b5f9789fe83735 |
class SerializedAPI(ListCreateAPIView): <NEW_LINE> <INDENT> serializer_class = QuerySerializer <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return super(SerializedAPI, self).post( request, *args, **kwargs) | ---
POST:
serializer: QuerySerializer
response_serializer: CommentSerializer | 62598edf7b25080760ed5a5e |
class DemoList(ListView): <NEW_LINE> <INDENT> model = ApplicationDemo | Stub uses serializer for demo list. | 62598edfbaa26c4b54d4d895 |
class ConfirmRecordTypeDeleteTests(AnnalistTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> init_annalist_test_site() <NEW_LINE> self.testsite = Site(TestBaseUri, TestBaseDir) <NEW_LINE> self.testcoll = Collection.create(self.testsite, "testcoll", collection_create_values("testcoll")) <NEW_LINE> crea... | Tests for record type deletion on response to confirmation form | 62598edf8e71fb1e983ba035 |
class ShortBookPublishSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> id = serializers.HyperlinkedRelatedField( many=False, read_only=True, view_name='book-detail', ) <NEW_LINE> cover_image = serializers.HyperlinkedRelatedField( many=False, view_name='image-detail', queryset=Image.objects.all(), required=F... | Short Book serializer for published objects. | 62598edfd58c6744b42db599 |
class FavoritesListMTF(FavoritesList): <NEW_LINE> <INDENT> def _move_up(self, p): <NEW_LINE> <INDENT> if p != self._data.first( ): <NEW_LINE> <INDENT> self._data.move_to_front(p) <NEW_LINE> <DEDENT> <DEDENT> def top(self, k): <NEW_LINE> <INDENT> if not 1 <= k <= len(self): <NEW_LINE> <INDENT> raise ValueError('Illegal ... | List of elements ordered with move-to-front heuristic. | 62598edfe64d504609df86a2 |
class TestModelResource(unittest.TestCase): <NEW_LINE> <INDENT> @patch('pyramid_duh.route.IModelResource.get_model') <NEW_LINE> def test_fetch_model(self, get_model): <NEW_LINE> <INDENT> resource = IModelResource() <NEW_LINE> ret = resource['foobar'] <NEW_LINE> self.assertTrue(isinstance(ret, IModelResource)) <NEW_LINE... | Tests for model resource nodes | 62598edfe76e3b2f99fd6ffe |
class SSD300(SSD): <NEW_LINE> <INDENT> _models = { 'voc0712': { 'param': {'n_fg_class': 20}, 'url': 'https://chainercv-models.preferred.jp/' 'ssd300_voc0712_converted_2017_06_06.npz', 'cv2': True }, 'imagenet': { 'url': 'https://chainercv-models.preferred.jp/' 'ssd_vgg16_imagenet_converted_2017_06_09.npz', 'cv2': True ... | Single Shot Multibox Detector with 300x300 inputs.
This is a model of Single Shot Multibox Detector [#]_.
This model uses :class:`~chainercv.links.model.ssd.VGG16Extractor300` as
its feature extractor.
.. [#] Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy,
Scott Reed, Cheng-Yang Fu, Alexander C. Berg... | 62598edf99cbb53fe682f477 |
class LivroViewSet(mixins.CreateModelMixin, mixins.ListModelMixin, generics.RetrieveUpdateDestroyAPIView, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = Livro.objects.all() <NEW_LINE> lookup_field = 'id' <NEW_LINE> serializer_class = LivroSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticated... | API endpoint that allows groups to be viewed or edited. | 62598edf4428ac0f6e656b17 |
class RoundRobin(PSDispatcher): <NEW_LINE> <INDENT> def __init__(self, pserver_endpoints): <NEW_LINE> <INDENT> super(self.__class__, self).__init__(pserver_endpoints) <NEW_LINE> <DEDENT> def dispatch(self, varlist): <NEW_LINE> <INDENT> eplist = [] <NEW_LINE> for var in varlist: <NEW_LINE> <INDENT> server_for_param = se... | :api_attr: Static Graph
Distribute variables to several endpoints using
RondRobin<https://en.wikipedia.org/wiki/Round-robin_scheduling> method.
Args:
pserver_endpoints (list): list of endpoint(ip:port).
Examples:
.. code-block:: python
pserver_endpoints = ["127.0.0.1:6007", "127.0.0.1:6008"]
var... | 62598edfa8370b77170ee9b3 |
class cistr(str): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.canonical = value.lower() <NEW_LINE> self.hashcode = hash(self.canonical) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, cistr): <NEW_LINE> <INDENT> other = cistr(other) <NEW_LINE> <DEDEN... | Subclass of str that computes __eq__ case-insensitively.
Also computes a hash code of the string in canonical form. | 62598edf8c0ade5d55dc2966 |
class City(Base): <NEW_LINE> <INDENT> __tablename__ = "cities" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(128), nullable=False) <NEW_LINE> state_id = Column(Integer, ForeignKey('states.id'), nullable=False) | Class City that will map to the MySQL table cities
attributes:
__tablename_: the name of the mapped table
id: id of the city
name: name of the city
state_id: id of a state (foreign key) | 62598edfe5267d203ee69ec9 |
class RaidenShuttingDown(RaidenError): <NEW_LINE> <INDENT> pass | Raised when Raiden is in the process of shutting down to help with a
clean shutdown and not have exceptions thrown in all greenlets when there
is a connection timeout with the rpc client before shutting down. | 62598edfe5267d203ee69ec8 |
class RescourceDataObj(object): <NEW_LINE> <INDENT> def __init__(self, patient_id, directory='data', ignore_file='Patient.ndjson'): <NEW_LINE> <INDENT> self.patient_id = patient_id <NEW_LINE> self.directory = directory <NEW_LINE> self.counter_ids = {'Patient': [patient_id]} <NEW_LINE> self._extension = '.ndjson' <NEW_L... | Object to organize data structure manipulation and storage | 62598edf7d43ff24874266de |
class C(Package): <NEW_LINE> <INDENT> homepage = "http://www.example.com" <NEW_LINE> url = "http://www.example.com/c-1.0.tar.gz" <NEW_LINE> version('1.0', '0123456789abcdef0123456789abcdef') | Simple package with no dependencies | 62598edf1f037a2d8b9e26cb |
class ISendWechatEvent(zope.interface.Interface): <NEW_LINE> <INDENT> pass | a send wechat event mark interface. | 62598edfcc0a2c11144795c7 |
class KiGBError(Exception): <NEW_LINE> <INDENT> pass | Error thrown by LKiGB . | 62598edffbf16365ca792669 |
class PaymentHandlerError(Exception): <NEW_LINE> <INDENT> pass | Generic payment handler error. | 62598edf5f7d997b871f86b8 |
class OpenDocumentPDFView(OpenMailPDFView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> mimetypeitem = self.context.get_mimetype() <NEW_LINE> if not mimetypeitem or not is_mimetype_supported(mimetypeitem[0]): <NEW_LINE> <INDENT> raise NotFound <NEW_LINE> <DEDENT> return super(OpenDocumentPDFView, self).... | Redirect to bumblebee pdf for documents. | 62598edf3317a56b869bd84a |
class UrlsafeString(str): <NEW_LINE> <INDENT> strip_whitespace = True <NEW_LINE> min_length = 16 <NEW_LINE> max_length = 128 <NEW_LINE> @classmethod <NEW_LINE> def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: <NEW_LINE> <INDENT> update_not_none( field_schema, minLength=cls.min_length, maxLength=cls.max... | API key type for Pydantic schemas
It's a URL safe string of minimum length and max length | 62598edf498bea3a75a560fc |
class SortOptionsLabel(Enum): <NEW_LINE> <INDENT> year = "year" <NEW_LINE> title = "title" <NEW_LINE> format = "format" | Valid sort options for label releases. | 62598edf435de62698e9a39c |
class InvalidRequestException(TException): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'why', None, None, ), ) <NEW_LINE> def __init__(self, why=None,): <NEW_LINE> <INDENT> self.why = why <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocol... | Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
why contains an associated error message.
Attributes:
- why | 62598edf07f4c71912bada1c |
class AccountAuthException(AltimeterException): <NEW_LINE> <INDENT> pass | Exception indicating auth was unable to be obtained to an account. | 62598edf29b78933be2693b2 |
class GpMeanVarRequest(base_schemas.StrictMappingSchema): <NEW_LINE> <INDENT> points_to_evaluate = base_schemas.ListOfPointsInDomain() <NEW_LINE> gp_historical_info = base_schemas.GpHistoricalInfo() <NEW_LINE> domain_info = base_schemas.DomainInfo() <NEW_LINE> covariance_info = base_schemas.CovarianceInfo( missing=base... | A request colander schema for the views in :mod:`moe.views.rest.gp_mean_var`.
.. Note:: Requesting ``points_to_evaluate`` that are close to each or close to existing
``points_sampled`` may result in a [numerically] singular GP-variance matrix.
See additional notes in :class:`moe.views.schemas.base_schemas.Covarianc... | 62598edf30bbd722464681fe |
class ReferenceGenome(object): <NEW_LINE> <INDENT> def __init__(self, genome_fasta_file, logger): <NEW_LINE> <INDENT> self._logger = logger <NEW_LINE> self.genome_fasta_file = genome_fasta_file <NEW_LINE> self._validate_reference_file() <NEW_LINE> try: <NEW_LINE> <INDENT> self._fasta_file = Fastafile(self.genome_fasta_... | Class to read sequence data from a reference genome
Attributes:
genome_fasta_file (string): Path to reference genome file
fasta_file (pysam.Fastafile): Fastafile object for reference genome | 62598edf3539df3088eca878 |
class ArgPacker(object): <NEW_LINE> <INDENT> def __init__(self, dmm, fe_args): <NEW_LINE> <INDENT> self._dmm = dmm <NEW_LINE> self._fe_args = fe_args <NEW_LINE> self._nargs = len(fe_args) <NEW_LINE> self._dm_args = [self._dmm.lookup(ty) for ty in fe_args] <NEW_LINE> argtys = [bt.get_argument_type() for bt in self._dm_a... | Compute the position for each high-level typed argument.
It flattens every composite argument into primitive types.
It maintains a position map for unflattening the arguments.
Since struct (esp. nested struct) have specific ABI requirements (e.g.
alignemnt, pointer address-space, ...) in different architecture (e.g.
O... | 62598edf627d3e7fe0e0544d |
class FontChangeEvent(wx.PyCommandEvent): <NEW_LINE> <INDENT> def __init__(self, etype, eid, value=None, obj=None): <NEW_LINE> <INDENT> wx.PyCommandEvent.__init__(self, etype, eid) <NEW_LINE> self._value = value <NEW_LINE> self.SetEventObject(obj) <NEW_LINE> <DEDENT> def GetValue(self): <NEW_LINE> <INDENT> return self.... | General notification event | 62598edfb7558d5895461c12 |
class FusionAtt(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, normalized=False): <NEW_LINE> <INDENT> super(FusionAtt, self).__init__() <NEW_LINE> self.input_dim = input_dim <NEW_LINE> self.output_dim = output_dim <NEW_LINE> self.normalized = normalized <NEW_LINE> self.att_linear = nn.L... | Fusion by attention | 62598edfac7a0e7691f70ad9 |
class IrOpNode(IrNode): <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> assert isinstance(node, core.Node) and node.is_op(), 'node must be the instance of core.Node and it must be a operator node.' <NEW_LINE> super(IrOpNode, self).__init__(node) <NEW_LINE> self.node = node <NEW_LINE> <DEDEN... | Python IrOpNode. Beneath it is a core.Node, it inherits from IrNode. | 62598edf56ac1b37e63007b2 |
class _QtExceptionCaptureManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.old_hook = None <NEW_LINE> self.exceptions = [] <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.old_hook = sys.excepthook <NEW_LINE> sys.excepthook = functools.partial(_except_hook, exceptions=self.exception... | Manages exception capture context. | 62598edf7d847024c075a995 |
class SubProjectAppriasal(models.Model): <NEW_LINE> <INDENT> owned_by = models.OneToOneField(SubProject, on_delete=models.CASCADE, blank=True, null=True) <NEW_LINE> appriase_date = models.DateField() <NEW_LINE> delay_reason = models.TextField() <NEW_LINE> remedial_action = models.TextField() <NEW_LINE> appriaser_name =... | This models the supproject appriasal info | 62598edfa79ad161977685e3 |
class WebRegEnrollmentError(Exception): <NEW_LINE> <INDENT> pass | An unknown enrollment error
| 62598edf9b70327d1c57d381 |
class EmployeeLedgerEntry(Model): <NEW_LINE> <INDENT> hash = ndb.IntegerProperty(required=True) <NEW_LINE> created_at = ndb.DateTimeProperty(required=True) <NEW_LINE> last_updated_at = ndb.DateTimeProperty() <NEW_LINE> entry_type = ndb.StringProperty(choices=("credit", "debit"), required=True) <NEW_LINE> source = ndb.S... | A credit or debit to an employee's account.
Ancestor: Employee
Name: (str) concatenation of employee id, type, source, amount,
timestamp, and salt. | 62598edf7047854f4633d9a8 |
class TestingEmailBackend(locmem.EmailBackend): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def send_messages(self, messages): <NEW_LINE> <INDENT> log.info('Send E-Mails:') <NEW_LINE> for message in messages: <NEW_LINE> <INDENT> log.... | This Backend stores all sent emails to EMAIL_TESTING_BACKEND_STORE_PATH as a json file
In additition to locem's in-memory storage this is needed because of our multi-worker testing environment
(we cannot share data in-memory between testing api calls) | 62598edf99cbb53fe682f478 |
class BoundImportRefData(DataContainer): <NEW_LINE> <INDENT> pass | Holds bound import forwarder reference data.
Contains the same information as the bound descriptor but
for forwarded DLLs, if any.
struct: IMAGE_BOUND_FORWARDER_REF structure
name: dll name | 62598edf67a9b606de544595 |
class BestVersionAlreadyInstalled(Exception): <NEW_LINE> <INDENT> pass | Raised when the most up-to-date version of a package is already
installed. | 62598edf76e4537e8c3edb7e |
class BeforeInput(Processor): <NEW_LINE> <INDENT> def __init__(self, text, style=''): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> self.style = style <NEW_LINE> <DEDENT> def apply_transformation(self, ti): <NEW_LINE> <INDENT> if ti.lineno == 0: <NEW_LINE> <INDENT> fragments_before = to_formatted_text(self.text, self... | Insert text before the input.
:param text: This can be either plain text or formatted text
(or a callable that returns any of those).
:param style: style to be applied to this prompt/prefix. | 62598edf91f36d47f2230187 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.