code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ValueDisplay(object): <NEW_LINE> <INDENT> _VALUE_LENGTH = 8 <NEW_LINE> def __init__(self, window, wave_height): <NEW_LINE> <INDENT> self._window = window <NEW_LINE> self._height, self._width = self._window.getmaxyx() <NEW_LINE> self._wave_height = wave_height <NEW_LINE> logging.debug('Value display height, width ...
Value display controls display for value. ------------------------------ | Maximum value in this view.| --> 0 | | | | | | | | | | | | | Minimum value in this...
62598fa6fff4ab517ebcd6e3
class WSProxy: <NEW_LINE> <INDENT> def __init__(self, ws, child, room, connection): <NEW_LINE> <INDENT> self.ws = ws <NEW_LINE> self.child = child <NEW_LINE> self.stop_event = threading.Event() <NEW_LINE> self.room = room <NEW_LINE> self.auto_forward() <NEW_LINE> self.connection = connection <NEW_LINE> <DEDENT> def sen...
WSProxy is websocket proxy channel object. websocket代理通道对象 Because tornado or flask websocket base event, if we want reuse func with sshd, we need change it to socket, so we implement a proxy. we should use socket pair implement it. usage: 我们使用 socket pair 实现它 ``` child, parent = socket.socketpair() # self must h...
62598fa6009cb60464d0141e
class BookmarkType(EditType): <NEW_LINE> <INDENT> def __init__(self, bookmark_string): <NEW_LINE> <INDENT> self.date = self.parse_edit_date(bookmark_string) <NEW_LINE> self.location = self.parse_edit_location(bookmark_string) <NEW_LINE> <DEDENT> def parse_edit_date(self, data): <NEW_LINE> <INDENT> date_part = data.spli...
Created for Kindle Paperwhite gen 5. Highlight Edit class. Bookmark Edit class Contains location of the bookmark and the date
62598fa699cbb53fe6830dd4
class BootstrapSplitDateTimeWidget(MultiWidget): <NEW_LINE> <INDENT> def __init__(self, attrs=None, date_format=None, time_format=None): <NEW_LINE> <INDENT> from django.forms.widgets import DateInput, TimeInput <NEW_LINE> date_class = attrs['date_class'] <NEW_LINE> time_class = attrs['time_class'] <NEW_LINE> del attrs[...
Bootstrap Split DateTime Widget github.com/stholmes/django-bootstrap-datetime-widgets/ format_output slightly modified.
62598fa663b5f9789fe85064
class beginFileUpload_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAcc...
Attributes: - success
62598fa60a50d4780f7052db
class HostPropertyManagerTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_fetch_all(self): <NEW_LINE> <INDENT> av_host_properties = AV.host_properties.all().result() <NEW_LINE> self.assertNotEqual(len(av_host_properties), 0) <NEW_LINE> <DEDENT> def test_filter(self): <NEW_LINE> <INDENT> av_host_properties = AV.hos...
Test HostPropertyManager.
62598fa68c0ade5d55dc3610
class RulesPage(GenericPage): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> GenericPage.__init__(self,parent,'Game rules')
Choose the ruleset, komi, handicap etc
62598fa623849d37ff850fb4
class Post(models.Model): <NEW_LINE> <INDENT> title = models.CharField("Title", max_length=70) <NEW_LINE> body = models.TextField("text") <NEW_LINE> created_time = models.DateTimeField("created_at", default=timezone.now) <NEW_LINE> modified_time = models.DateTimeField("updated_at") <NEW_LINE> excerpt = models.CharField...
文章的数据库表稍微复杂一点,主要是涉及的字段更多。
62598fa6bd1bec0571e15043
class HierarchicObject(ModelObject): <NEW_LINE> <INDENT> def AddObjects(self, Objects): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Delete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Insert(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Modify(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT...
HierarchicObject() HierarchicObject(ID: Identifier)
62598fa624f1403a92685833
class BGRProviaCurveFilter(BGRCurveFilter): <NEW_LINE> <INDENT> def __init__(self, dtype=np.uint8): <NEW_LINE> <INDENT> BGRCurveFilter.__init__( self, bPoints = [(0,0),(35,25),(205,227),(255,255)], gPoints = [(0,0),(27,21),(196,207),(255,255)], rPoints = [(0,0),(59,54),(202,210),(255,255)], dtype = dtype )
A filter that applies Portra-like curves to BGR
62598fa68a43f66fc4bf207d
class UnterminatedCommentError(Error): <NEW_LINE> <INDENT> pass
Raised if an Unterminated multi-line comment is encountered.
62598fa64428ac0f6e658422
class TestResources(BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.root = DATA_DIR <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.root = None <NEW_LINE> <DEDENT> @patch('lnxproc.resources.time') <NEW_LINE> def test_resources(self, mytime): <NEW_LINE> <INDENT> mytime.retur...
Test Resources class
62598fa6d268445f26639b03
class ExpressionMapping(str): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.expression = Expression(value[1:-1]) <NEW_LINE> super(ExpressionMapping, self).__init__(value) <NEW_LINE> <DEDENT> def values(self, variables): <NEW_LINE> <INDENT> return [self.expression.value(variables)] <NEW_LINE> <...
Class for parsing and expanding an expression.
62598fa6be383301e02536f8
class Stack: <NEW_LINE> <INDENT> def __init__(self, max_size=101): <NEW_LINE> <INDENT> self.elements = [None] * max_size <NEW_LINE> self.top_element = -1 <NEW_LINE> self.max_size = max_size <NEW_LINE> <DEDENT> def top(self): <NEW_LINE> <INDENT> if self.is_empty(): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> return s...
>>> from crazy_notes.stack import Stack >>> s = Stack() >>> s.push(1) >>> s.push(2) >>> s.push(3) >>> s.top() 3 >>> s.is_empty() False >>> s.pop() 3 >>> s.top() 2
62598fa62ae34c7f260aafe1
class AverageOfTwo(EstimationMethodService): <NEW_LINE> <INDENT> def parameter_names(self): <NEW_LINE> <INDENT> return ["x", "y"] <NEW_LINE> <DEDENT> @endpoint("/info", ["GET", "PUT"], "text/plain") <NEW_LINE> def info(self): <NEW_LINE> <INDENT> return "This is an estimation method which takes two parameters (X, Y), an...
This is a simple example of an estimation method. It takes two parameters, X and Y, and the result is the average of them.
62598fa6097d151d1a2c0f28
class UEntity(EmbeddedDocument): <NEW_LINE> <INDENT> url = EmbeddedDocumentField(EUrl, null=True) <NEW_LINE> description = EmbeddedDocumentField(EUrl, null=True)
Entities which have been parsed out of the url or description fields defined by the user. Read more about User Entities . Example: "entities": { "url": { "urls": [ { "url": "http://dev.twitter.com", "expanded_url": null, "indices": [0, 22] } ] }, "description":...
62598fa663d6d428bbee26b2
class PreGeneratedProblem(MOProblem): <NEW_LINE> <INDENT> def __init__(self, filename=None, points=None, delim=",", **kwargs): <NEW_LINE> <INDENT> self.points = [] <NEW_LINE> self.original_points = [] <NEW_LINE> if points: <NEW_LINE> <INDENT> self.original_points = list(points) <NEW_LINE> self.points = list(points) <NE...
A problem where the objective function values have beeen pregenerated
62598fa6d7e4931a7ef3bf9b
class Features: <NEW_LINE> <INDENT> __slots__ = ['has_copy', 'has_bulk_delete', 'max_deletes', 'max_meta_len'] <NEW_LINE> def __init__(self, has_copy=False, has_bulk_delete=False, max_deletes=1000, max_meta_len=255): <NEW_LINE> <INDENT> self.has_copy = has_copy <NEW_LINE> self.has_bulk_delete = has_bulk_delete <NEW_LIN...
Set of configurable features for Swift servers. Swift is deployed in many different versions and configurations. To be able to use advanced features like bulk delete we need to make sure that the Swift server we are using can handle them. This is a value object.
62598fa6a219f33f346c6718
class SitePhpErrorLogFlag(ProxyOnlyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'type': ...
Used for getting PHP error logging flag. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :param kind: Kind of resource. :type kind: str :ivar type: Resource type. :vartype type: str :param loc...
62598fa601c39578d7f12c80
class SwordDamageAlter(PropertyEffect): <NEW_LINE> <INDENT> def __init__(self, user: Entity, sword_move_type_effectiveness: Tuple[float, float, float]): <NEW_LINE> <INDENT> super().__init__(user, "SwordDamageAlter") <NEW_LINE> self.sword_move_type_effectiveness = sword_move_type_effectiveness <NEW_LINE> <DEDENT> def on...
Simple PropertyEffect that allows you to add
62598fa6d7e4931a7ef3bf9c
class CredentialResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'value': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'bytearray'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE>...
The credential result response. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: The name of the credential. :vartype name: str :ivar value: Base64-encoded Kubernetes configuration file. :vartype value: bytearray
62598fa67cff6e4e811b592a
class OPAMetric(_RankingMetric): <NEW_LINE> <INDENT> def __init__(self, name, ragged=False): <NEW_LINE> <INDENT> super(OPAMetric, self).__init__(ragged=ragged) <NEW_LINE> self._name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def _compute_imp...
Implements ordered pair accuracy (OPA).
62598fa60c0af96317c56283
class UsersStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Create = channel.unary_unary( '/event_store.client.users.Users/Create', request_serializer=users__pb2.CreateReq.SerializeToString, response_deserializer=users__pb2.CreateResp.FromString, ) <NEW_LINE> self.Update = channel...
Missing associated documentation comment in .proto file
62598fa6aad79263cf42e6d5
class RoutePolicy(object): <NEW_LINE> <INDENT> openapi_types = { 'policy_route_info': 'PolicyRouteInfo', 'throttle_policy': 'ThrottlePolicy' } <NEW_LINE> attribute_map = { 'policy_route_info': 'policyRouteInfo', 'throttle_policy': 'throttlePolicy' } <NEW_LINE> def __init__(self, policy_route_info=None, throttle_policy=...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fa6236d856c2adc93bc
class FilterWord(models.Model): <NEW_LINE> <INDENT> words = models.TextField(_("Words")) <NEW_LINE> enabled = models.BooleanField(_("Enabled"), default=True) <NEW_LINE> objects = models.Manager() <NEW_LINE> FilterWordManager = FilterWordManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _("Filter Word"...
Each comma delimited entry represents words that are banned when used together
62598fa656ac1b37e63020ed
class UpdateResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_NewAccessToken(self): <NEW_LINE> <INDENT> return self._output.get('NewAccessToken', None) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return ...
A ResultSet with methods tailored to the values returned by the Update Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598fa607f4c71912baf344
class RandomFactory: <NEW_LINE> <INDENT> randomSources = () <NEW_LINE> getrandbits = getrandbits <NEW_LINE> def _osUrandom(self, nbytes): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return os.urandom(nbytes) <NEW_LINE> <DEDENT> except (AttributeError, NotImplementedError) as e: <NEW_LINE> <INDENT> raise SourceNotAvail...
Factory providing L{secureRandom} and L{insecureRandom} methods. You shouldn't have to instantiate this class, use the module level functions instead: it is an implementation detail and could be removed or changed arbitrarily.
62598fa6009cb60464d01420
class GameStats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_stats() <NEW_LINE> self.game_active = True <NEW_LINE> <DEDENT> def reset_stats(self): <NEW_LINE> <INDENT> self.ships_self = self.ai_settings.ship_limit
Track statistics for Alien Invasion.
62598fa663b5f9789fe85066
class HostIPv4(Record): <NEW_LINE> <INDENT> bootfile = None <NEW_LINE> bootserver = None <NEW_LINE> configure_for_dhcp = None <NEW_LINE> deny_bootp = None <NEW_LINE> discovered_data = None <NEW_LINE> enable_pxe_lease_time = None <NEW_LINE> host = None <NEW_LINE> ignore_client_requested_options = None <NEW_LINE> ipv4add...
Implements the host_ipv4addr record type.
62598fa6baa26c4b54d4f1b1
class ESPNetv2(nn.Module): <NEW_LINE> <INDENT> mult2name = { 0.5: 'espnetv2_wd2', 1.0: 'espnetv2_w1', 1.25: 'espnetv2_w5d4', 1.5: 'espnetv2_w3d2', 2.0: 'espnetv2_w2', } <NEW_LINE> def __init__(self, width_mult=2.0, feature_levels=(3, 4, 5), pretrained=True, include_final=False): <NEW_LINE> <INDENT> super().__init__() <...
ESPNetv2: A Light-weight, Power Efficient, and General Purpose Convolutional Neural Network width_mult Top1 Top5 Params FLOPs/2 x0.5 42.32 20.15 1,241,332 35.36M x1.0 33.92 13.45 1,670,072 98.09M x1.25 32.06 12.18 1,965,440 138.18M x1.5 30.83 11.29 2,314,856...
62598fa6460517430c431fdc
class plantCalendarScheduling(Base): <NEW_LINE> <INDENT> __tablename__ = "plantCalendarScheduling" <NEW_LINE> ID = Column(Integer, primary_key=True, autoincrement=True, nullable=False) <NEW_LINE> color = Column(Unicode(32), primary_key=False, autoincrement=False, nullable=True) <NEW_LINE> title = Column(Unicode(32), pr...
日历
62598fa6cc0a2c111447af11
class ShimCacheEntryTypeXPSP2x86(obj.ProfileModification): <NEW_LINE> <INDENT> before = ['WindowsObjectClasses'] <NEW_LINE> conditions = {'os': lambda x: x == 'windows', 'major': lambda x: x == 5, 'minor': lambda x: x == 1, 'memory_model': lambda x: x == '32bit', 'vtype_module': lambda x: x == 'volatility.plugins.overl...
A shimcache entry on Windows XP SP2 (x86)
62598fa699cbb53fe6830dd7
class ExtGridLockingColumnModel(BaseExtComponent): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ExtGridLockingColumnModel, self).__init__(*args, **kwargs) <NEW_LINE> self.grid = None <NEW_LINE> self.init_component(*args, **kwargs) <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <I...
Модель колонок для грида блокирования
62598fa68e7ae83300ee8fa3
class Gaussian(nn.Module): <NEW_LINE> <INDENT> def __init__(self, kernel_size=3, sigma=2, channels=3): <NEW_LINE> <INDENT> super(Gaussian, self).__init__() <NEW_LINE> self.gaussian = gaussian_kernel(kernel_size=kernel_size, sigma=sigma, channels=channels) <NEW_LINE> <DEDENT> def forward(self, noised_and_cover): <NEW_LI...
Gaussian kernel.
62598fa68a43f66fc4bf207f
class GenerateMissingAttendanceSheets(models.TransientModel): <NEW_LINE> <INDENT> _name = "beesdoo.shift.generate_missing_attendance_sheets" <NEW_LINE> _description = "beesdoo.shift.generate_missing_attendance_sheets" <NEW_LINE> date_start = fields.Datetime("Start date", required=True) <NEW_LINE> date_end = fields.Date...
Generate missing past sheets
62598fa6b7558d5895463531
class LinkIconMixin(object): <NEW_LINE> <INDENT> _IMG_RE = re.compile(''.join(('^', IMAGE_LINK_RE, '$|^', IMAGE_REFERENCE_RE, '$|^<img\s.*?>$'))) <NEW_LINE> brands = OrderedDict(( ('', 'am-icon-link'), ('yahoo.com', 'am-icon-yahoo'), ('youtube.com', 'am-icon-youtube'), ('plus.google.com', 'am-icon-google-plus'), ('goog...
Common extension logic; mixed into the existing classes.
62598fa67047854f4633f2db
class WebAPIError(Exception): <NEW_LINE> <INDENT> pass
Raised when the online brain visualization could not be launched
62598fa62c8b7c6e89bd36c7
class SchemaService(SchemaInterface): <NEW_LINE> <INDENT> def __init__(self, schema_repository): <NEW_LINE> <INDENT> self.schema_repository = schema_repository <NEW_LINE> <DEDENT> def dump_schema(self): <NEW_LINE> <INDENT> return self.schema_repository.dump_schema() <NEW_LINE> <DEDENT> def initialize_schema(self): <NEW...
Manage the schema of the storage layer.
62598fa6dd821e528d6d8e37
class CallCode(object): <NEW_LINE> <INDENT> def __init__(self,code,binds=None,divided=False): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.binds = binds or [] <NEW_LINE> self.divided = divided <NEW_LINE> <DEDENT> def output(self,args,ind): <NEW_LINE> <INDENT> args = list(args) <NEW_LINE> for i,val in self.binds...
C++ code representing a function call with optional predefined argument values.
62598fa6435de62698e9bcf7
class DataSourceKey(BaseEnum): <NEW_LINE> <INDENT> PHSEN_ABCDEF_SIO_MULE = 'phsen_abcdef_sio_mule' <NEW_LINE> PHSEN_ABCDEF = 'phsen_abcdef'
These are the possible harvester/parser pairs for this driver
62598fa638b623060ffa8f99
class Industry(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128) <NEW_LINE> def __str__(self): return self.name <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = 'nadine' <NEW_LINE> verbose_name = "Industry" <NEW_LINE> verbose_name_plural = "Industries" <NEW_LINE> ordering = ['name']
The type of work a user does
62598fa6796e427e5384e696
class Genome(object): <NEW_LINE> <INDENT> def __init__(self, fitness): <NEW_LINE> <INDENT> self.fitness = fitness
A simple representation of a genome.
62598fa68da39b475be030e4
class ReleaseVariantViewSet(ChangeSetModelMixin, StrictQueryParamMixin, MultiLookupFieldMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = models.Variant.objects.all().order_by('id') <NEW_LINE> serializer_class = ReleaseVariantSerializer <NEW_LINE> filter_class = filters.ReleaseVariantFilter <NEW_LINE> loo...
This end-point provides access to Variants. Each variant is uniquely identified by release ID and variant UID. The pair in the form `release_id/variant_uid` is used in URL for retrieving, updating or deleting a single variant as well as in bulk operations.
62598fa6f7d966606f747ee6
class DapServer(object): <NEW_LINE> <INDENT> def __init__(self, path, templates=None): <NEW_LINE> <INDENT> self.path = os.path.abspath(path) <NEW_LINE> loaders = [PackageLoader("pydap.wsgi", "templates")] <NEW_LINE> if templates is not None: <NEW_LINE> <INDENT> loaders.insert(0, FileSystemLoader(templates)) <NEW_LINE> ...
A directory app that creates file listings and handle DAP requests.
62598fa660cbc95b0636424f
class ComparisonTaskWrapper(): <NEW_LINE> <INDENT> def __init__(self, tasks): <NEW_LINE> <INDENT> self._tasks = tasks <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> out = [] <NEW_LINE> for com_task, result, timed_points, adjust_name, com_name in self._tasks: <NEW_LINE> <INDENT> score = com_task(result.pred...
:param tasks: List of tuples `(com_task, result, timed_points, adjust_name, com_name)`
62598fa6167d2b6e312b6e73
class ActionRegistry(object): <NEW_LINE> <INDENT> __EXTENSION_NAME = 'abilian:actions' <NEW_LINE> def init_app(self, app): <NEW_LINE> <INDENT> if self.__EXTENSION_NAME in app.extensions: <NEW_LINE> <INDENT> log.warning('ActionRegistry.init_app: actions already enabled on this application') <NEW_LINE> return <NEW_LINE> ...
The Action registry. This is a Flask extension which registers :class:`.Action` sets. Actions are grouped by category and are ordered by registering order. From your application use the instanciated registry :data:`.actions`. The registry is available in jinja2 templates as `actions`.
62598fa644b2445a339b68f0
class APIChangeSpec(object): <NEW_LINE> <INDENT> pass
This class defines the transformations that need to happen. This class must provide the following fields: * `function_keyword_renames`: maps function names to a map of old -> new argument names * `symbol_renames`: maps function names to new function names * `change_to_function`: a set of function names that have ch...
62598fa656b00c62f0fb27b6
class WRNBottleneck(Chain): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, stride, width_factor): <NEW_LINE> <INDENT> super(WRNBottleneck, self).__init__() <NEW_LINE> mid_channels = int(round(out_channels // 4 * width_factor)) <NEW_LINE> with self.init_scope(): <NEW_LINE> <INDENT> self.conv1 = wrn_co...
WRN bottleneck block for residual path in WRN unit. Parameters: ---------- in_channels : int Number of input channels. out_channels : int Number of output channels. stride : int or tuple/list of 2 int Stride of the convolution. width_factor : float Wide scale factor for width of layers.
62598fa667a9b606de545ecf
class StandardRegression(FitnessMetric): <NEW_LINE> <INDENT> def __init__(self, const_deriv=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.const_deriv = const_deriv <NEW_LINE> <DEDENT> def evaluate_fitness_vector(self, individual, training_data): <NEW_LINE> <INDENT> f_of_x = individual.evaluate(training...
Traditional fitness evaluation
62598fa6090684286d59365d
class FormatHtml(Processor): <NEW_LINE> <INDENT> re_html = re.compile("^<.+?>") <NEW_LINE> def format(self, element: str): <NEW_LINE> <INDENT> if not bool(self.re_html.search(element)): <NEW_LINE> <INDENT> return element <NEW_LINE> <DEDENT> soup = BeautifulSoup(element, features="lxml") <NEW_LINE> text = soup.body.pret...
Processor for pretty format of XML elements
62598fa62c8b7c6e89bd36c9
class AWGServer(DeviceServer): <NEW_LINE> <INDENT> name = 'awg' <NEW_LINE> @setting(10) <NEW_LINE> def waveforms(self, c, request_json='{}'): <NEW_LINE> <INDENT> request = json.loads(request_json) <NEW_LINE> response = self._waveforms(request) <NEW_LINE> response_json = json.dumps(response) <NEW_LINE> return response_j...
Provides basic control for arbitrary waveform generators
62598fa6d486a94d0ba2bed1
@admin.register(Tasks) <NEW_LINE> class TasksAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( "priority", "task", "parent", "slug", "id" ) <NEW_LINE> list_display_links: Tuple[str] = ('task',) <NEW_LINE> list_filter = ('task',) <NEW_LINE> prepopulated_fields = {"slug": ("task",)}
Задачи
62598fa67d847024c075c2c8
class ImportUserSocialAuthTask(ImportMysqlToHiveTableTask): <NEW_LINE> <INDENT> @property <NEW_LINE> def table_name(self): <NEW_LINE> <INDENT> return 'social_auth_usersocialauth' <NEW_LINE> <DEDENT> @property <NEW_LINE> def columns(self): <NEW_LINE> <INDENT> return [ ('id', 'INT'), ('user_id', 'INT'), ('provider', 'STR...
Imports the `social_auth_usersocialauth` table to S3/Hive.
62598fa66aa9bd52df0d4dcd
class RioVersionInfoBuilder(VersionInfoBuilder): <NEW_LINE> <INDENT> def generate(self, to_file): <NEW_LINE> <INDENT> info = Stanza() <NEW_LINE> revision_id = self._get_revision_id() <NEW_LINE> if revision_id != NULL_REVISION: <NEW_LINE> <INDENT> info.add('revision-id', revision_id) <NEW_LINE> rev = self._branch.reposi...
This writes a rio stream out.
62598fa64f88993c371f048c
class ControlSocketMissingException(Exception): <NEW_LINE> <INDENT> def __init__(self, path=''): <NEW_LINE> <INDENT> message = "SSH control socket %s does not exist" % path <NEW_LINE> super(ControlSocketMissingException, self).__init__(message)
Raised when the SSH control socket is missing
62598fa6435de62698e9bcf9
@register_proxy_pool("karmenzind") <NEW_LINE> class KarmenzindProxyPool(ProxyPool): <NEW_LINE> <INDENT> def __init__(self, redis_db, args=None): <NEW_LINE> <INDENT> super().__init__(redis_db, args) <NEW_LINE> self.proxy_pool_host = os.environ.get('PROXY_POOL_SERVER_HOST', 'localhost') <NEW_LINE> self.port = os.environ....
https://github.com/Karmenzind/fp-server Set the port 12345
62598fa697e22403b383ae11
class EQ(Comparison): <NEW_LINE> <INDENT> def _apply(self, left: int, right: int) -> int: <NEW_LINE> <INDENT> return 1 if left == right else 0
left == right
62598fa64a966d76dd5eede7
class InvanaBotSingleWebCrawler(WebCrawlerBase): <NEW_LINE> <INDENT> name = "InvanaBotSingleWebCrawler" <NEW_LINE> def closed(self, reason): <NEW_LINE> <INDENT> print("spider closed with payload:", reason, self.spider_config.get('cti_id')) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def run_extractor(response=None, ex...
This is generic spider
62598fa61f5feb6acb162b26
class DirectoryRoleRequest(RequestBase): <NEW_LINE> <INDENT> def __init__(self, request_url, client, options): <NEW_LINE> <INDENT> super(DirectoryRoleRequest, self).__init__(request_url, client, options) <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> self.method = "DELETE" <NEW_LINE> self.send() <NEW_LINE> <...
The type DirectoryRoleRequest.
62598fa6167d2b6e312b6e75
@injected <NEW_LINE> class ForwardHTTPHandler(HandlerProcessorProceed): <NEW_LINE> <INDENT> externalHost = str <NEW_LINE> externalPort = int <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> assert isinstance(self.externalHost, str), 'Invalid external host %s' % self.externalHost <NEW_LINE> assert isinstance(self.exte...
Implementation for a handler that provides forwarding to external servers.
62598fa6d58c6744b42dc257
class IgnoreFileTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_filter_none(self): <NEW_LINE> <INDENT> p = notify_processor.NotifyProcessor(None) <NEW_LINE> self.assertFalse(p.is_ignored("froo.pyc")) <NEW_LINE> <DEDENT> def test_filter_one(self): <NEW_LINE> <INDENT> p = notify_processor.NotifyProcessor(None, ['\...
Tests the ignore files behaviour.
62598fa6d7e4931a7ef3bfa0
class _XMLSerializable: <NEW_LINE> <INDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return self.flattenXML() <NEW_LINE> <DEDENT> def __add__(self, other: 'XMLContent') -> '_XMLSequence': <NEW_LINE> <INDENT> return _XMLSequence(chain((self,), _adaptSequence(other))) <NEW_LINE> <DEDENT> def __radd__(self, other: 'X...
Base class for objects that can be serialized to XML.
62598fa623849d37ff850fb9
class FolderMoveFrom(BaseSubstitution): <NEW_LINE> <INDENT> category = u'AsyncMove' <NEW_LINE> description = u'Move folder from' <NEW_LINE> def safe_call(self): <NEW_LINE> <INDENT> return getattr(self.wrapper, 'folder_move_from', '')
Move folder from substitution
62598fa656b00c62f0fb27b7
class EventTypes(): <NEW_LINE> <INDENT> types = {'event_types': [i for i, j in DISASTER_TYPES]}
Model for event types. Returns only the first element of each tuple.
62598fa6e5267d203ee6b810
class EditProfileForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[DataRequired()]) <NEW_LINE> email = StringField('E-mail', validators=[DataRequired(), Email()]) <NEW_LINE> password = PasswordField('Password', validators=[Length(min=6)]) <NEW_LINE> image_url = StringField('(Optional) ...
Form for editing users
62598fa6e5267d203ee6b811
class ComputeDisksCreateSnapshotRequest(messages.Message): <NEW_LINE> <INDENT> disk = messages.StringField(1, required=True) <NEW_LINE> project = messages.StringField(2, required=True) <NEW_LINE> snapshot = messages.MessageField('Snapshot', 3) <NEW_LINE> zone = messages.StringField(4, required=True)
A ComputeDisksCreateSnapshotRequest object. Fields: disk: Name of the persistent disk resource to snapshot. project: Name of the project scoping this request. snapshot: A Snapshot resource to be passed as the request body. zone: Name of the zone scoping this request.
62598fa70a50d4780f7052e2
class _DrawingEditorMixin: <NEW_LINE> <INDENT> def _add(self,obj,value,name=None,validate=None,desc=None,pos=None): <NEW_LINE> <INDENT> ivc = isValidChild(value) <NEW_LINE> if name and hasattr(obj,'_attrMap'): <NEW_LINE> <INDENT> if '_attrMap' not in obj.__dict__: <NEW_LINE> <INDENT> obj._attrMap = obj._attrMap.clone()...
This is a mixin to provide functionality for edited drawings
62598fa730dc7b766599f753
class Test_is_person_or_closed_team(TestCaseWithFactory): <NEW_LINE> <INDENT> layer = DatabaseFunctionalLayer <NEW_LINE> def test_non_person(self): <NEW_LINE> <INDENT> self.assertFalse(is_public_person_or_closed_team(0)) <NEW_LINE> <DEDENT> def test_person(self): <NEW_LINE> <INDENT> person = self.factory.makePerson() <...
Tests for is_person_or_closed_team().
62598fa785dfad0860cbf9f7
@method_decorator(login_required(login_url='/login/'), name="dispatch") <NEW_LINE> class createNoteList(GenericAPIView): <NEW_LINE> <INDENT> serializer_class = CreateNoteSerializer <NEW_LINE> queryset = Notes.objects.all() <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = request.us...
This API used to create Note for User
62598fa7d268445f26639b06
class ValueOf: <NEW_LINE> <INDENT> def __init__(self, g): <NEW_LINE> <INDENT> self.g = g <NEW_LINE> <DEDENT> def __call__(self, nodeid): <NEW_LINE> <INDENT> return self.g.value_of(nodeid)
Function that returns the value of a nodeid in graph g. Returns None if g.value_of(nodeid) returns None.
62598fa7442bda511e95c35b
class SvBMVertsNode(bpy.types.Node, SverchCustomTreeNode): <NEW_LINE> <INDENT> bl_idname = 'SvBMVertsNode' <NEW_LINE> bl_label = 'bmesh_props' <NEW_LINE> bl_icon = 'OUTLINER_OB_EMPTY' <NEW_LINE> Modes = ['verts','faces','edges'] <NEW_LINE> Mod = EnumProperty(name="getmodes", default="verts", items=e(Modes), update=upda...
BMesh Verts
62598fa7be383301e02536fe
class TwoTwoReaction(Reaction): <NEW_LINE> <INDENT> def __init__( self, construction_state, functional_group1, functional_group2, bond_order, periodicity, ): <NEW_LINE> <INDENT> self._position_matrix = ( construction_state.get_position_matrix() ) <NEW_LINE> self._functional_group1 = functional_group1 <NEW_LINE> self._f...
A reaction between two functional groups, each with 2 bonder atoms. The reaction creates the two shortest possible bonds between the *bonder* atoms of the two functional groups, and deletes any *deleter* atoms.
62598fa7097d151d1a2c0f2e
class Mint: <NEW_LINE> <INDENT> current_year = 2019 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.update() <NEW_LINE> <DEDENT> def create(self, kind): <NEW_LINE> <INDENT> return kind(self.year) <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> self.year = Mint.current_year
A mint creates coins by stamping on years. The update method sets the mint's stamp to Mint.current_year. >>> mint = Mint() >>> mint.year 2019 >>> dime = mint.create(Dime) >>> dime.year 2019 >>> Mint.current_year = 2100 # Time passes >>> nickel = mint.create(Nickel) >>> nickel.year # The mint has not updated its ...
62598fa7a79ad16197769f69
class Report(Sheet): <NEW_LINE> <INDENT> def __init__(self, props=None, base_obj=None): <NEW_LINE> <INDENT> super(Report, self).__init__(None, base_obj) <NEW_LINE> self._base = None <NEW_LINE> if base_obj is not None: <NEW_LINE> <INDENT> self._base = base_obj <NEW_LINE> <DEDENT> self._columns = TypedList(ReportColumn) ...
Smartsheet Report data model.
62598fa7be8e80087fbbef68
class ContentEntry(BaseSiteEntry): <NEW_LINE> <INDENT> content = Content <NEW_LINE> deleted = Deleted <NEW_LINE> publisher = Publisher <NEW_LINE> in_reply_to = InReplyTo <NEW_LINE> worksheet = Worksheet <NEW_LINE> header = Header <NEW_LINE> data = Data <NEW_LINE> field = [Field] <NEW_LINE> revision = Revision <NEW_LINE...
Google Sites Content Entry.
62598fa78da39b475be030e8
class Retry(celery.exceptions.Retry, HandleAfterAbort): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> self.signature = kw.pop('signature', None) <NEW_LINE> celery.exceptions.Retry.__init__(self, *args, **kw) <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ...
With cooperation from TransactionAwareTask.retry(), this moves the actual re-queueing of the task into the proper "error handling" transaction phase.
62598fa7796e427e5384e69a
class RMSELoss(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, eps=1e-6): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.mse = torch.nn.MSELoss() <NEW_LINE> self.eps = eps <NEW_LINE> <DEDENT> def forward(self, yhat, y): <NEW_LINE> <INDENT> loss = torch.sqrt(self.mse(yhat, y) + self.eps) <NEW_LINE> retu...
Root mean squared loss
62598fa7435de62698e9bcfc
@attr.s <NEW_LINE> class SecurityGroupCollection(BaseCollection): <NEW_LINE> <INDENT> ENTITY = SecurityGroup <NEW_LINE> def create(self, name, description, provider, cancel=False, wait=False): <NEW_LINE> <INDENT> view = navigate_to(self, 'Add') <NEW_LINE> changed = view.form.fill({'network_manager': "{} Network Manager...
Collection object for the :py:class: `cfme.cloud.SecurityGroup`.
62598fa776e4537e8c3ef4b3
class TestTsloplace(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Tsloplace( spread = 1...
Tsloplace unit test stubs
62598fa726068e7796d4c85f
class Variant(Subtyped): <NEW_LINE> <INDENT> sku = models.CharField(_('SKU'), max_length=128, db_index=True, unique=True, help_text=_('ID of the product variant used' ' internally in the shop.')) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return '%s' % self.sku
Base class for variants. It identifies a concrete product instance, which goes to a cart. Custom variants inherit from it.
62598fa732920d7e50bc5f5d
class MixData(task.SingleTask): <NEW_LINE> <INDENT> data_coeff = config.list_type(type_=float) <NEW_LINE> weight_coeff = config.list_type(type_=float) <NEW_LINE> mixed_data = None <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> if len(self.data_coeff) != len(self.weight_coeff): <NEW_LINE> <INDENT> raise config.CaputCon...
Mix together pieces of data with specified weights. This can generate arbitrary linear combinations of the data and weights for both `SiderealStream` and `RingMap` objects, and can be used for many purposes such as: adding together simulated timestreams, injecting signal into data, replacing weights in simulated data ...
62598fa701c39578d7f12c86
class UnpackException(Exception): <NEW_LINE> <INDENT> pass
Exception while msgpack unpacking
62598fa791af0d3eaad39d16
class NDBUserDatastore(NDBDatastore, datastore.UserDatastore): <NEW_LINE> <INDENT> def __init__(self, user_model, role_model): <NEW_LINE> <INDENT> NDBDatastore.__init__(self) <NEW_LINE> datastore.UserDatastore.__init__(self, user_model, role_model) <NEW_LINE> <DEDENT> def create_user(self, **kwargs): <NEW_LINE> <INDENT...
An NDB datastore implementation for Flask-Security.
62598fa721bff66bcd722b6d
class BucketListItemView(generics.CreateAPIView): <NEW_LINE> <INDENT> serializer_class = BucketListItemSerializer <NEW_LINE> permission_classes = (IsAuthenticated, IsBucketlistOwner) <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> bucketlist_id = self.kwargs.get('pk') <NEW_LINE> bucketlist = Bucket...
Create a new item.
62598fa767a9b606de545ed3
class ListPluginResponse: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I32, 'Status', None, None, ), (2, TType.LIST, 'Plugins', (TType.STRUCT,(ListPluginResponseItem, ListPluginResponseItem.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, Status=None, Plugins=None,): <NEW_LINE> <INDENT> self.Status = Stat...
Attributes: - Status - Plugins
62598fa71f037a2d8b9e3ff3
class TestBalanceResource(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testBalanceResource(self): <NEW_LINE> <INDENT> pass
BalanceResource unit test stubs
62598fa763d6d428bbee26b9
class GraylogUDPPublisherTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.reactor = iMock(IReactorUDP, IReactorCore, IReactorPluggableResolver) <NEW_LINE> patch(self, 'txgraylog2.graylogger.reactor', new=self.reactor) <NEW_LINE> self.transport = iMock(IUDPTransport) <NEW_LINE> def listenUD...
Test the GraylogUDPPublisher.
62598fa73cc13d1c6d465673
class DetectSlowWave: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __call__(self, data): <NEW_LINE> <INDENT> return SlowWave()
Design slow wave detection
62598fa74e4d56256637232c
class IPluginsNames(Interface): <NEW_LINE> <INDENT> pass
Retriever Marker
62598fa7a8ecb03325871117
class IPWhitelistHandler(EntityHandlerBase): <NEW_LINE> <INDENT> entity_url_prefix = '/auth/api/v1/ip_whitelists/' <NEW_LINE> entity_kind = model.AuthIPWhitelist <NEW_LINE> entity_kind_name = 'ip_whitelist' <NEW_LINE> entity_kind_title = 'ip whitelist' <NEW_LINE> @classmethod <NEW_LINE> def get_entity_key(cls, name): <...
Creating, reading, updating and deleting a single IP whitelist. GET is available in Standalone, Primary and Replica modes. Everything else is available only in Standalone and Primary modes.
62598fa7442bda511e95c35d
class Triangle(Figure): <NEW_LINE> <INDENT> def __init__(self, x, y, a, color): <NEW_LINE> <INDENT> super().__init__(x, y, color) <NEW_LINE> self._a = a <NEW_LINE> <DEDENT> def _draw(self, color): <NEW_LINE> <INDENT> pencolor(color) <NEW_LINE> up() <NEW_LINE> setpos(self._x, self._y) <NEW_LINE> down() <NEW_LINE> for i ...
Клас Трикутник Використовується для зображення правильного трикутника на екрані
62598fa7d486a94d0ba2bed5
class Worker(object): <NEW_LINE> <INDENT> DEFAULT_SCHEDULE = 300 <NEW_LINE> def __init__(self, conf_dict): <NEW_LINE> <INDENT> self.worker = configmanager.ConfigManager.create(conf_dict['module'], conf_dict['name'], conf_dict['parameters']) <NEW_LINE> self.module = conf_dict['module'] <NEW_LINE> self.name = self.worker...
Provides interface to loadable modules an events to sycronise execution
62598fa72ae34c7f260aafe9
class IPBrightnessSensor(SensorHmIP): <NEW_LINE> <INDENT> def __init__(self, device_description, proxy, resolveparamsets=False): <NEW_LINE> <INDENT> super().__init__(device_description, proxy, resolveparamsets) <NEW_LINE> self.SENSORNODE.update({"CURRENT_ILLUMINATION": [1], "AVERAGE_ILLUMINATION": [1], "LOWEST_ILLUMINA...
IP Sensor for outdoor brightness measure
62598fa745492302aabfc3d9
class IsolationTestCase(test.TestCase): <NEW_LINE> <INDENT> def test_service_isolation(self): <NEW_LINE> <INDENT> self.useFixture(test.ServiceFixture('compute')) <NEW_LINE> <DEDENT> def test_rpc_consumer_isolation(self): <NEW_LINE> <INDENT> class NeverCalled(object): <NEW_LINE> <INDENT> def __getattribute__(*args): <NE...
Ensure that things are cleaned up after failed tests. These tests don't really do much here, but if isolation fails a bunch of other tests should fail.
62598fa78da39b475be030ea
class ModelBackend(OridginModelBackend): <NEW_LINE> <INDENT> def authenticate(self, username=None, password=None, **kwargs): <NEW_LINE> <INDENT> UserModel = get_user_class() <NEW_LINE> if username is None: <NEW_LINE> <INDENT> username = kwargs.get(UserModel.USERNAME_FIELD) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> u...
Authenticates against settings.AUTH_USER_MODEL.
62598fa763d6d428bbee26ba
class ComputeType(Enum): <NEW_LINE> <INDENT> KVM=1 <NEW_LINE> DOCKER=2
This declare all types of network in our system using enumeration
62598fa74e4d56256637232d
class Query: <NEW_LINE> <INDENT> def __init__(self, record_type, predicate=None, count=False, limit=50, offset=None, include=[]): <NEW_LINE> <INDENT> self.record_type = record_type <NEW_LINE> if predicate is None: <NEW_LINE> <INDENT> predicate = Predicate() <NEW_LINE> <DEDENT> self.predicate = predicate <NEW_LINE> self...
Skygear Query Class Example: >>> p = Predicate(gender__eq="m") >>> query = Query("student", predicate=p) >>> database = container.public_database >>> result = database.query(query)
62598fa74a966d76dd5eedeb
class DataResSwitchBanVendor(object): <NEW_LINE> <INDENT> def __init__(self, data, data_req=None): <NEW_LINE> <INDENT> assert_that(data, has_key('code')) <NEW_LINE> assert_that(data, has_key('message'))
返回值验证
62598fa7d6c5a102081e2050
class MinibatchSource(cntk_py.MinibatchSource): <NEW_LINE> <INDENT> def stream_infos(self): <NEW_LINE> <INDENT> return super(MinibatchSource, self).stream_infos() <NEW_LINE> <DEDENT> def stream_info(self, name): <NEW_LINE> <INDENT> return super(MinibatchSource, self).stream_info(name) <NEW_LINE> <DEDENT> def get_next_m...
Parent class of all minibatch sources. For most cases you will need the helper functions `:func:cntk.io.text_format_minibatch_source` or `:func:cntk.io.create_minibatch_source`.
62598fa74527f215b58e9deb
class StatusCommand(Command): <NEW_LINE> <INDENT> key = "status" <NEW_LINE> aliases = ["shipstat"] <NEW_LINE> locks = "cmd:all()" <NEW_LINE> help_category = "Cochran - Ships" <NEW_LINE> def at_pre_cmd(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def parse(self): <NEW_LINE> <INDENT> pass
Run a scan. This shows everything in space within the craft's sensor range.
62598fa7d7e4931a7ef3bfa4